@sentio/runtime 4.0.0 → 4.0.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm-CSGQo6hb.js +1773 -0
- package/dist/esm-CSGQo6hb.js.map +1 -0
- package/dist/execAsync-DiFDE921.js +14 -0
- package/dist/execAsync-DiFDE921.js.map +1 -0
- package/dist/getMachineId-bsd-57c_YWfQ.js +30 -0
- package/dist/getMachineId-bsd-57c_YWfQ.js.map +1 -0
- package/dist/getMachineId-darwin-dyf00K_U.js +27 -0
- package/dist/getMachineId-darwin-dyf00K_U.js.map +1 -0
- package/dist/getMachineId-linux-p9niCx07.js +23 -0
- package/dist/getMachineId-linux-p9niCx07.js.map +1 -0
- package/dist/getMachineId-unsupported-hKbFGxhH.js +18 -0
- package/dist/getMachineId-unsupported-hKbFGxhH.js.map +1 -0
- package/dist/getMachineId-win-Bn6Q0xbV.js +29 -0
- package/dist/getMachineId-win-Bn6Q0xbV.js.map +1 -0
- package/dist/index.d.ts +2780 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-BrBSx4KR.d.ts +111 -0
- package/dist/plugin-BrBSx4KR.d.ts.map +1 -0
- package/dist/plugin-Tb-OZb_A.js +6937 -0
- package/dist/plugin-Tb-OZb_A.js.map +1 -0
- package/dist/processor-runner.d.ts +1 -0
- package/dist/processor-runner.js +57749 -0
- package/dist/processor-runner.js.map +1 -0
- package/dist/service-v3-CtXk2PFI.js +12238 -0
- package/dist/service-v3-CtXk2PFI.js.map +1 -0
- package/package.json +9 -8
- package/src/tsdown.config.ts +29 -0
- package/lib/chunk-AUPVVLD3.js +0 -3
- package/lib/chunk-AUPVVLD3.js.map +0 -1
- package/lib/chunk-GIDETKWP.js +0 -3
- package/lib/chunk-GIDETKWP.js.map +0 -1
- package/lib/chunk-OWUO6IOO.js +0 -4
- package/lib/chunk-OWUO6IOO.js.map +0 -1
- package/lib/chunk-TW627LH5.js +0 -3
- package/lib/chunk-TW627LH5.js.map +0 -1
- package/lib/chunk-ZBEAD3P3.js +0 -15
- package/lib/chunk-ZBEAD3P3.js.map +0 -1
- package/lib/getMachineId-bsd-D4LAJDEF.js +0 -3
- package/lib/getMachineId-bsd-D4LAJDEF.js.map +0 -1
- package/lib/getMachineId-darwin-LI2YUJNR.js +0 -4
- package/lib/getMachineId-darwin-LI2YUJNR.js.map +0 -1
- package/lib/getMachineId-linux-U5ITOJBK.js +0 -3
- package/lib/getMachineId-linux-U5ITOJBK.js.map +0 -1
- package/lib/getMachineId-unsupported-5HCFSWXA.js +0 -3
- package/lib/getMachineId-unsupported-5HCFSWXA.js.map +0 -1
- package/lib/getMachineId-win-MPVRXIQL.js +0 -3
- package/lib/getMachineId-win-MPVRXIQL.js.map +0 -1
- package/lib/index.d.ts +0 -1750
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/lib/plugin-D-rx1WCp.d.ts +0 -108
- package/lib/processor-runner.d.ts +0 -1
- package/lib/processor-runner.js +0 -184
- package/lib/processor-runner.js.map +0 -1
- package/src/tsup.config.ts +0 -17
package/lib/processor-runner.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
|
|
3
|
-
import{i as Kf,j as T3,l as Hy,m as Ne,n as dt,o as Xf,p as zy,y as Xy,z as Jy}from"./chunk-ZBEAD3P3.js";import{B as Yf,c as Dc,m as Vy,n as qy,v as Gy}from"./chunk-OWUO6IOO.js";import{a as Ht,b as jy,c as Uc,d as $y,e as Wy,f as Nt,g as Yy,h as Ky,i as Oo,j as P,k as Jf,l as kc,m as Qf,n as cn,o as Q}from"./chunk-TW627LH5.js";import{a as L,b as T,c as m,d as kr,e as Ro,f as Xe}from"./chunk-AUPVVLD3.js";var ft=m((Whe,s0)=>{"use strict";var rp=class t extends Error{constructor(e){super(`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
4
|
-
Found: ${e.toString().split(`
|
|
5
|
-
`)[0]}
|
|
6
|
-
`),Error.captureStackTrace(this,t)}};s0.exports=t=>{if(t.length>2)throw new rp(t);function e(n={}){this.options=n}e.prototype.transform=t;function r(n){return new e(n)}return r.Format=e,r}});var l0=m((Yhe,c0)=>{"use strict";var a0={};c0.exports=a0;var o0={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(o0).forEach(function(t){var e=o0[t],r=a0[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var h0=m((Khe,u0)=>{"use strict";u0.exports=function(t,e){e=e||process.argv||[];var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var f0=m((Xhe,d0)=>{"use strict";var P3=L("os"),zt=h0(),st=process.env,Hi=void 0;zt("no-color")||zt("no-colors")||zt("color=false")?Hi=!1:(zt("color")||zt("colors")||zt("color=true")||zt("color=always"))&&(Hi=!0);"FORCE_COLOR"in st&&(Hi=st.FORCE_COLOR.length===0||parseInt(st.FORCE_COLOR,10)!==0);function x3(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function I3(t){if(Hi===!1)return 0;if(zt("color=16m")||zt("color=full")||zt("color=truecolor"))return 3;if(zt("color=256"))return 2;if(t&&!t.isTTY&&Hi!==!0)return 0;var e=Hi?1:0;if(process.platform==="win32"){var r=P3.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in st)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in st})||st.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in st)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(st.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in st){var n=parseInt((st.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(st.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(st.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(st.TERM)||"COLORTERM"in st?1:(st.TERM==="dumb",e)}function np(t){var e=I3(t);return x3(e)}d0.exports={supportsColor:np,stdout:np(process.stdout),stderr:np(process.stderr)}});var m0=m((Jhe,p0)=>{"use strict";p0.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(s){s=s.toLowerCase();var o=i[s]||[" "],a=Math.floor(Math.random()*o.length);typeof i[s]<"u"?n+=i[s][a]:n+=s}),n}});var _0=m((Qhe,g0)=>{"use strict";g0.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function s(c){var l=Math.floor(Math.random()*c);return l}function o(c){var l=!1;return i.filter(function(h){l=h===c}),l}function a(c,l){var h="",d,f;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",c=c.split("");for(f in c)if(!o(f)){switch(h=h+c[f],d={up:0,down:0,mid:0},l.size){case"mini":d.up=s(8),d.mid=s(2),d.down=s(8);break;case"maxi":d.up=s(16)+3,d.mid=s(4)+1,d.down=s(64)+3;break;default:d.up=s(8)+1,d.mid=s(6)/2,d.down=s(8)+1;break}var p=["up","mid","down"];for(var g in p)for(var S=p[g],A=0;A<=d[S];A++)l[S]&&(h=h+n[S][s(n[S].length)])}return h}return a(e,r)}});var S0=m((Zhe,E0)=>{"use strict";E0.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var y0=m((ede,T0)=>{"use strict";T0.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var A0=m((tde,v0)=>{"use strict";v0.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var R0=m((rde,C0)=>{"use strict";C0.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var P0=m((ide,w0)=>{"use strict";var ne={};w0.exports=ne;ne.themes={};var L3=L("util"),Xn=ne.styles=l0(),b0=Object.defineProperties,D3=new RegExp(/[\r\n]+/g);ne.supportsColor=f0().supportsColor;typeof ne.enabled>"u"&&(ne.enabled=ne.supportsColor()!==!1);ne.enable=function(){ne.enabled=!0};ne.disable=function(){ne.enabled=!1};ne.stripColors=ne.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var nde=ne.stylize=function(e,r){if(!ne.enabled)return e+"";var n=Xn[r];return!n&&r in ne?ne[r](e):n.open+e+n.close},U3=/[|\\{}()[\]^$+*?.]/g,k3=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(U3,"\\$&")};function M0(t){var e=function r(){return B3.apply(r,arguments)};return e._styles=t,e.__proto__=F3,e}var N0=function(){var t={};return Xn.grey=Xn.gray,Object.keys(Xn).forEach(function(e){Xn[e].closeRe=new RegExp(k3(Xn[e].close),"g"),t[e]={get:function(){return M0(this._styles.concat(e))}}}),t}(),F3=b0(function(){},N0);function B3(){var t=Array.prototype.slice.call(arguments),e=t.map(function(o){return o!=null&&o.constructor===String?o:L3.inspect(o)}).join(" ");if(!ne.enabled||!e)return e;for(var r=e.indexOf(`
|
|
7
|
-
`)!=-1,n=this._styles,i=n.length;i--;){var s=Xn[n[i]];e=s.open+e.replace(s.closeRe,s.open)+s.close,r&&(e=e.replace(D3,function(o){return s.close+o+s.open}))}return e}ne.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){ne[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var s in t[r])i=ne[t[r][s]](i);return i}return ne[t[r]](n)}})(e)};function V3(){var t={};return Object.keys(N0).forEach(function(e){t[e]={get:function(){return M0([e])}}}),t}var q3=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};ne.trap=m0();ne.zalgo=_0();ne.maps={};ne.maps.america=S0()(ne);ne.maps.zebra=y0()(ne);ne.maps.rainbow=A0()(ne);ne.maps.random=R0()(ne);for(O0 in ne.maps)(function(t){ne[t]=function(e){return q3(ne.maps[t],e)}})(O0);var O0;b0(ne,V3())});var ip=m((sde,x0)=>{"use strict";var G3=P0();x0.exports=G3});var I0=m(sp=>{"use strict";sp.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};sp.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var L0=m(op=>{"use strict";op.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};op.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var D0=m(ap=>{"use strict";ap.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};ap.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var U0=m(Hc=>{"use strict";Object.defineProperty(Hc,"cli",{value:I0()});Object.defineProperty(Hc,"npm",{value:L0()});Object.defineProperty(Hc,"syslog",{value:D0()})});var Pe=m(bo=>{"use strict";Object.defineProperty(bo,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(bo,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(bo,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(bo,"configs",{value:U0()})});var $c=m((hde,jc)=>{"use strict";var up=ip(),{LEVEL:cp,MESSAGE:lp}=Pe();up.enabled=!0;var k0=/\s+/,zc=class t{constructor(e={}){e.colors&&this.addColors(e.colors),this.options=e}static addColors(e){let r=Object.keys(e).reduce((n,i)=>(n[i]=k0.test(e[i])?e[i].split(k0):e[i],n),{});return t.allColors=Object.assign({},t.allColors||{},r),t.allColors}addColors(e){return t.addColors(e)}colorize(e,r,n){if(typeof n>"u"&&(n=r),!Array.isArray(t.allColors[e]))return up[t.allColors[e]](n);for(let i=0,s=t.allColors[e].length;i<s;i++)n=up[t.allColors[e][i]](n);return n}transform(e,r){return r.all&&typeof e[lp]=="string"&&(e[lp]=this.colorize(e[cp],e.level,e[lp])),(r.level||r.all||!r.message)&&(e.level=this.colorize(e[cp],e.level)),(r.all||r.message)&&(e.message=this.colorize(e[cp],e.level,e.message)),e}};jc.exports=t=>new zc(t);jc.exports.Colorizer=jc.exports.Format=zc});var B0=m((dde,F0)=>{"use strict";var{Colorizer:H3}=$c();F0.exports=t=>(H3.addColors(t.colors||t),t)});var q0=m((fde,V0)=>{"use strict";var z3=ft();V0.exports=z3(t=>(t.message=` ${t.message}`,t))});var z0=m((pde,H0)=>{"use strict";var j3=ft(),{LEVEL:G0,MESSAGE:hp}=Pe();H0.exports=j3((t,{stack:e,cause:r})=>{if(t instanceof Error){let i=Object.assign({},t,{level:t.level,[G0]:t[G0]||t.level,message:t.message,[hp]:t[hp]||t.message});return e&&(i.stack=t.stack),r&&(i.cause=t.cause),i}if(!(t.message instanceof Error))return t;let n=t.message;return Object.assign(t,n),t.message=n.message,t[hp]=n.message,e&&(t.stack=n.stack),r&&(t.cause=n.cause),t})});var fp=m((mde,Yc)=>{"use strict";var{configs:$3,LEVEL:j0,MESSAGE:dp}=Pe(),Wc=class t{constructor(e={levels:$3.npm.levels}){this.paddings=t.paddingForLevels(e.levels,e.filler),this.options=e}static getLongestLevel(e){let r=Object.keys(e).map(n=>n.length);return Math.max(...r)}static paddingForLevel(e,r,n){let i=n+1-e.length,s=Math.floor(i/r.length);return`${r}${r.repeat(s)}`.slice(0,i)}static paddingForLevels(e,r=" "){let n=t.getLongestLevel(e);return Object.keys(e).reduce((i,s)=>(i[s]=t.paddingForLevel(s,r,n),i),{})}transform(e,r){return e.message=`${this.paddings[e[j0]]}${e.message}`,e[dp]&&(e[dp]=`${this.paddings[e[j0]]}${e[dp]}`),e}};Yc.exports=t=>new Wc(t);Yc.exports.Padder=Yc.exports.Format=Wc});var $0=m((gde,pp)=>{"use strict";var{Colorizer:W3}=$c(),{Padder:Y3}=fp(),{configs:K3,MESSAGE:X3}=Pe(),Kc=class{constructor(e={}){e.levels||(e.levels=K3.cli.levels),this.colorizer=new W3(e),this.padder=new Y3(e),this.options=e}transform(e,r){return this.colorizer.transform(this.padder.transform(e,r),r),e[X3]=`${e.level}:${e.message}`,e}};pp.exports=t=>new Kc(t);pp.exports.Format=Kc});var Y0=m((_de,mp)=>{"use strict";var J3=ft();function W0(t){if(t.every(Q3))return e=>{let r=e;for(let n=0;n<t.length;n++)if(r=t[n].transform(r,t[n].options),!r)return!1;return r}}function Q3(t){if(typeof t.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
|
|
8
|
-
`));return!0}mp.exports=(...t)=>{let e=J3(W0(t)),r=e();return r.Format=e.Format,r};mp.exports.cascade=W0});var Mo=m((Sp,Q0)=>{"use strict";var{hasOwnProperty:Xc}=Object.prototype,Qn=Ep();Qn.configure=Ep;Qn.stringify=Qn;Qn.default=Qn;Sp.stringify=Qn;Sp.configure=Ep;Q0.exports=Qn;var Z3=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function un(t){return t.length<5e3&&!Z3.test(t)?`"${t}"`:JSON.stringify(t)}function gp(t){if(t.length>200)return t.sort();for(let e=1;e<t.length;e++){let r=t[e],n=e;for(;n!==0&&t[n-1]>r;)t[n]=t[n-1],n--;t[n]=r}return t}var eq=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function _p(t){return eq.call(t)!==void 0&&t.length!==0}function K0(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",i=`"0":${n}${t[0]}`;for(let s=1;s<r;s++)i+=`${e}"${s}":${n}${t[s]}`;return i}function tq(t){if(Xc.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function X0(t,e){let r;if(Xc.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function J0(t,e){let r;if(Xc.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function Jn(t){return t===1?"1 item":`${t} items`}function rq(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function nq(t){if(Xc.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Ep(t){t={...t};let e=nq(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=tq(t),n=X0(t,"bigint"),i=X0(t,"deterministic"),s=J0(t,"maximumDepth"),o=J0(t,"maximumBreadth");function a(f,p,g,S,A,C){let R=p[f];switch(typeof R=="object"&&R!==null&&typeof R.toJSON=="function"&&(R=R.toJSON(f)),R=S.call(p,f,R),typeof R){case"string":return un(R);case"object":{if(R===null)return"null";if(g.indexOf(R)!==-1)return r;let M="",v=",",w=C;if(Array.isArray(R)){if(R.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(R),A!==""&&(C+=A,M+=`
|
|
9
|
-
${C}`,v=`,
|
|
10
|
-
${C}`);let _=Math.min(R.length,o),de=0;for(;de<_-1;de++){let u=a(String(de),R,g,S,A,C);M+=u!==void 0?u:"null",M+=v}let E=a(String(de),R,g,S,A,C);if(M+=E!==void 0?E:"null",R.length-1>o){let u=R.length-o-1;M+=`${v}"... ${Jn(u)} not stringified"`}return A!==""&&(M+=`
|
|
11
|
-
${w}`),g.pop(),`[${M}]`}let I=Object.keys(R),V=I.length;if(V===0)return"{}";if(s<g.length+1)return'"[Object]"';let q="",Y="";A!==""&&(C+=A,v=`,
|
|
12
|
-
${C}`,q=" ");let F=Math.min(V,o);i&&!_p(R)&&(I=gp(I)),g.push(R);for(let _=0;_<F;_++){let de=I[_],E=a(de,R,g,S,A,C);E!==void 0&&(M+=`${Y}${un(de)}:${q}${E}`,Y=v)}if(V>o){let _=V-o;M+=`${Y}"...":${q}"${Jn(_)} not stringified"`,Y=v}return A!==""&&Y.length>1&&(M=`
|
|
13
|
-
${C}${M}
|
|
14
|
-
${w}`),g.pop(),`{${M}}`}case"number":return isFinite(R)?String(R):e?e(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(R);default:return e?e(R):void 0}}function c(f,p,g,S,A,C){switch(typeof p=="object"&&p!==null&&typeof p.toJSON=="function"&&(p=p.toJSON(f)),typeof p){case"string":return un(p);case"object":{if(p===null)return"null";if(g.indexOf(p)!==-1)return r;let R=C,M="",v=",";if(Array.isArray(p)){if(p.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(p),A!==""&&(C+=A,M+=`
|
|
15
|
-
${C}`,v=`,
|
|
16
|
-
${C}`);let V=Math.min(p.length,o),q=0;for(;q<V-1;q++){let F=c(String(q),p[q],g,S,A,C);M+=F!==void 0?F:"null",M+=v}let Y=c(String(q),p[q],g,S,A,C);if(M+=Y!==void 0?Y:"null",p.length-1>o){let F=p.length-o-1;M+=`${v}"... ${Jn(F)} not stringified"`}return A!==""&&(M+=`
|
|
17
|
-
${R}`),g.pop(),`[${M}]`}g.push(p);let w="";A!==""&&(C+=A,v=`,
|
|
18
|
-
${C}`,w=" ");let I="";for(let V of S){let q=c(V,p[V],g,S,A,C);q!==void 0&&(M+=`${I}${un(V)}:${w}${q}`,I=v)}return A!==""&&I.length>1&&(M=`
|
|
19
|
-
${C}${M}
|
|
20
|
-
${R}`),g.pop(),`{${M}}`}case"number":return isFinite(p)?String(p):e?e(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(p);default:return e?e(p):void 0}}function l(f,p,g,S,A){switch(typeof p){case"string":return un(p);case"object":{if(p===null)return"null";if(typeof p.toJSON=="function"){if(p=p.toJSON(f),typeof p!="object")return l(f,p,g,S,A);if(p===null)return"null"}if(g.indexOf(p)!==-1)return r;let C=A;if(Array.isArray(p)){if(p.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(p),A+=S;let q=`
|
|
21
|
-
${A}`,Y=`,
|
|
22
|
-
${A}`,F=Math.min(p.length,o),_=0;for(;_<F-1;_++){let E=l(String(_),p[_],g,S,A);q+=E!==void 0?E:"null",q+=Y}let de=l(String(_),p[_],g,S,A);if(q+=de!==void 0?de:"null",p.length-1>o){let E=p.length-o-1;q+=`${Y}"... ${Jn(E)} not stringified"`}return q+=`
|
|
23
|
-
${C}`,g.pop(),`[${q}]`}let R=Object.keys(p),M=R.length;if(M===0)return"{}";if(s<g.length+1)return'"[Object]"';A+=S;let v=`,
|
|
24
|
-
${A}`,w="",I="",V=Math.min(M,o);_p(p)&&(w+=K0(p,v,o),R=R.slice(p.length),V-=p.length,I=v),i&&(R=gp(R)),g.push(p);for(let q=0;q<V;q++){let Y=R[q],F=l(Y,p[Y],g,S,A);F!==void 0&&(w+=`${I}${un(Y)}: ${F}`,I=v)}if(M>o){let q=M-o;w+=`${I}"...": "${Jn(q)} not stringified"`,I=v}return I!==""&&(w=`
|
|
25
|
-
${A}${w}
|
|
26
|
-
${C}`),g.pop(),`{${w}}`}case"number":return isFinite(p)?String(p):e?e(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(p);default:return e?e(p):void 0}}function h(f,p,g){switch(typeof p){case"string":return un(p);case"object":{if(p===null)return"null";if(typeof p.toJSON=="function"){if(p=p.toJSON(f),typeof p!="object")return h(f,p,g);if(p===null)return"null"}if(g.indexOf(p)!==-1)return r;let S="";if(Array.isArray(p)){if(p.length===0)return"[]";if(s<g.length+1)return'"[Array]"';g.push(p);let v=Math.min(p.length,o),w=0;for(;w<v-1;w++){let V=h(String(w),p[w],g);S+=V!==void 0?V:"null",S+=","}let I=h(String(w),p[w],g);if(S+=I!==void 0?I:"null",p.length-1>o){let V=p.length-o-1;S+=`,"... ${Jn(V)} not stringified"`}return g.pop(),`[${S}]`}let A=Object.keys(p),C=A.length;if(C===0)return"{}";if(s<g.length+1)return'"[Object]"';let R="",M=Math.min(C,o);_p(p)&&(S+=K0(p,",",o),A=A.slice(p.length),M-=p.length,R=","),i&&(A=gp(A)),g.push(p);for(let v=0;v<M;v++){let w=A[v],I=h(w,p[w],g);I!==void 0&&(S+=`${R}${un(w)}:${I}`,R=",")}if(C>o){let v=C-o;S+=`${R}"...":"${Jn(v)} not stringified"`}return g.pop(),`{${S}}`}case"number":return isFinite(p)?String(p):e?e(p):"null";case"boolean":return p===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(p);default:return e?e(p):void 0}}function d(f,p,g){if(arguments.length>1){let S="";if(typeof g=="number"?S=" ".repeat(Math.min(g,10)):typeof g=="string"&&(S=g.slice(0,10)),p!=null){if(typeof p=="function")return a("",{"":f},[],p,S,"");if(Array.isArray(p))return c("",f,[],rq(p),S,"")}if(S.length!==0)return l("",f,[],S,"")}return h("",f,[])}return d}});var Tp=m((Ede,Z0)=>{"use strict";var iq=ft(),{MESSAGE:sq}=Pe(),oq=Mo();function aq(t,e){return typeof e=="bigint"?e.toString():e}Z0.exports=iq((t,e)=>{let r=oq.configure(e);return t[sq]=r(t,e.replacer||aq,e.space),t})});var tv=m((Sde,ev)=>{"use strict";var cq=ft();ev.exports=cq((t,e)=>e.message?(t.message=`[${e.label}] ${t.message}`,t):(t.label=e.label,t))});var nv=m((Tde,rv)=>{"use strict";var lq=ft(),{MESSAGE:uq}=Pe(),hq=Mo();rv.exports=lq(t=>{let e={};return t.message&&(e["@message"]=t.message,delete t.message),t.timestamp&&(e["@timestamp"]=t.timestamp,delete t.timestamp),e["@fields"]=t,t[uq]=hq(e),t})});var sv=m((yde,iv)=>{"use strict";var dq=ft();function fq(t,e,r){let n=e.reduce((s,o)=>(s[o]=t[o],delete t[o],s),{}),i=Object.keys(t).reduce((s,o)=>(s[o]=t[o],delete t[o],s),{});return Object.assign(t,n,{[r]:i}),t}function pq(t,e,r){return t[r]=e.reduce((n,i)=>(n[i]=t[i],delete t[i],n),{}),t}iv.exports=dq((t,e={})=>{let r="metadata";e.key&&(r=e.key);let n=[];return!e.fillExcept&&!e.fillWith&&(n.push("level"),n.push("message")),e.fillExcept&&(n=e.fillExcept),n.length>0?fq(t,n,r):e.fillWith?pq(t,e.fillWith,r):t})});var av=m((vde,ov)=>{"use strict";var zi=1e3,ji=zi*60,$i=ji*60,Zn=$i*24,mq=Zn*7,gq=Zn*365.25;ov.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return _q(t);if(r==="number"&&isFinite(t))return e.long?Sq(t):Eq(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function _q(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*gq;case"weeks":case"week":case"w":return r*mq;case"days":case"day":case"d":return r*Zn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*$i;case"minutes":case"minute":case"mins":case"min":case"m":return r*ji;case"seconds":case"second":case"secs":case"sec":case"s":return r*zi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Eq(t){var e=Math.abs(t);return e>=Zn?Math.round(t/Zn)+"d":e>=$i?Math.round(t/$i)+"h":e>=ji?Math.round(t/ji)+"m":e>=zi?Math.round(t/zi)+"s":t+"ms"}function Sq(t){var e=Math.abs(t);return e>=Zn?Jc(t,e,Zn,"day"):e>=$i?Jc(t,e,$i,"hour"):e>=ji?Jc(t,e,ji,"minute"):e>=zi?Jc(t,e,zi,"second"):t+" ms"}function Jc(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var lv=m((No,cv)=>{"use strict";var Tq=ft(),yq=av();cv.exports=Tq(t=>{let e=+new Date;return No.diff=e-(No.prevTime||e),No.prevTime=e,t.ms=`+${yq(No.diff)}`,t})});var dv=m((Ade,hv)=>{"use strict";var vq=L("util").inspect,Aq=ft(),{LEVEL:Cq,MESSAGE:uv,SPLAT:Rq}=Pe();hv.exports=Aq((t,e={})=>{let r=Object.assign({},t);return delete r[Cq],delete r[uv],delete r[Rq],t[uv]=vq(r,!1,e.depth||null,e.colorize),t})});var fv=m((Cde,Zc)=>{"use strict";var{MESSAGE:Oq}=Pe(),Qc=class{constructor(e){this.template=e}transform(e){return e[Oq]=this.template(e),e}};Zc.exports=t=>new Qc(t);Zc.exports.Printf=Zc.exports.Format=Qc});var gv=m((Rde,mv)=>{"use strict";var bq=ft(),{MESSAGE:pv}=Pe(),Mq=Mo();mv.exports=bq(t=>{let e=Mq(Object.assign({},t,{level:void 0,message:void 0,splat:void 0})),r=t.padding&&t.padding[t.level]||"";return e!=="{}"?t[pv]=`${t.level}:${r} ${t.message} ${e}`:t[pv]=`${t.level}:${r} ${t.message}`,t})});var Sv=m((Ode,Ev)=>{"use strict";var Nq=L("util"),{SPLAT:_v}=Pe(),wq=/%[scdjifoO%]/g,Pq=/%%/g,yp=class{constructor(e){this.options=e}_splat(e,r){let n=e.message,i=e[_v]||e.splat||[],s=n.match(Pq),o=s&&s.length||0,c=r.length-o-i.length,l=c<0?i.splice(c,-1*c):[],h=l.length;if(h)for(let d=0;d<h;d++)Object.assign(e,l[d]);return e.message=Nq.format(n,...i),e}transform(e){let r=e.message,n=e[_v]||e.splat;if(!n||!n.length)return e;let i=r&&r.match&&r.match(wq);if(!i&&(n||n.length)){let s=n.length>1?n.splice(0):n,o=s.length;if(o)for(let a=0;a<o;a++)Object.assign(e,s[a]);return e}return i?this._splat(e,i):e}};Ev.exports=t=>new yp(t)});var Uv={};kr(Uv,{assign:()=>fn,default:()=>Bq,defaultI18n:()=>vp,format:()=>Lv,parse:()=>Dv,setGlobalDateI18n:()=>xv,setGlobalDateMasks:()=>Iv});function Nv(t,e){for(var r=[],n=0,i=t.length;n<i;n++)r.push(t[n].substr(0,e));return r}function fn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0,i=e;n<i.length;n++){var s=i[n];for(var o in s)t[o]=s[o]}return t}function Dv(t,e,r){if(r===void 0&&(r={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=tl[e]||e,t.length>1e3)return null;var n=new Date,i={year:n.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},s=[],o=[],a=e.replace(Mv,function(v,w){return o.push(yv(w)),"@@@"}),c={},l={};a=yv(a).replace(bv,function(v){var w=kq[v],I=w[0],V=w[1],q=w[3];if(c[I])throw new Error("Invalid format. "+I+" specified twice in format");return c[I]=!0,q&&(l[q]=!0),s.push(w),"("+V+")"}),Object.keys(l).forEach(function(v){if(!c[v])throw new Error("Invalid format. "+v+" is required in specified format")}),a=a.replace(/@@@/g,function(){return o.shift()});var h=t.match(new RegExp(a,"i"));if(!h)return null;for(var d=fn(fn({},el),r),f=1;f<h.length;f++){var p=s[f-1],g=p[0],S=p[2],A=S?S(h[f],d):+h[f];if(A==null)return null;i[g]=A}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var C;if(i.timezoneOffset==null){C=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var R=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],f=0,M=R.length;f<M;f++)if(c[R[f][0]]&&i[R[f][0]]!==C[R[f][1]]())return null}else if(C=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return C}var bv,dn,hn,xq,Iq,wo,Mv,Tv,wv,Pv,Lq,Dq,vp,el,xv,yv,pt,Uq,vv,Av,Cv,Rv,Ov,kq,tl,Iv,Lv,Fq,Bq,kv=T(()=>{"use strict";bv=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,dn="\\d\\d?",hn="\\d\\d",xq="\\d{3}",Iq="\\d{4}",wo="[^\\s]+",Mv=/\[([^]*?)\]/gm;Tv=function(t){return function(e,r){var n=r[t].map(function(s){return s.toLowerCase()}),i=n.indexOf(e.toLowerCase());return i>-1?i:null}};wv=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Pv=["January","February","March","April","May","June","July","August","September","October","November","December"],Lq=Nv(Pv,3),Dq=Nv(wv,3),vp={dayNamesShort:Dq,dayNames:wv,monthNamesShort:Lq,monthNames:Pv,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!==10?1:0)*t%10]}},el=fn({},vp),xv=function(t){return el=fn(el,t)},yv=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},pt=function(t,e){for(e===void 0&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Uq={D:function(t){return String(t.getDate())},DD:function(t){return pt(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return pt(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return pt(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return pt(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return pt(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return pt(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return pt(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return pt(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return pt(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return pt(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return pt(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+pt(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+pt(Math.floor(Math.abs(e)/60),2)+":"+pt(Math.abs(e)%60,2)}},vv=function(t){return+t-1},Av=[null,dn],Cv=[null,wo],Rv=["isPm",wo,function(t,e){var r=t.toLowerCase();return r===e.amPm[0]?0:r===e.amPm[1]?1:null}],Ov=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var r=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?r:-r}return 0}],kq={D:["day",dn],DD:["day",hn],Do:["day",dn+wo,function(t){return parseInt(t,10)}],M:["month",dn,vv],MM:["month",hn,vv],YY:["year",hn,function(t){var e=new Date,r=+(""+e.getFullYear()).substr(0,2);return+(""+(+t>68?r-1:r)+t)}],h:["hour",dn,void 0,"isPm"],hh:["hour",hn,void 0,"isPm"],H:["hour",dn],HH:["hour",hn],m:["minute",dn],mm:["minute",hn],s:["second",dn],ss:["second",hn],YYYY:["year",Iq],S:["millisecond","\\d",function(t){return+t*100}],SS:["millisecond",hn,function(t){return+t*10}],SSS:["millisecond",xq],d:Av,dd:Av,ddd:Cv,dddd:Cv,MMM:["month",wo,Tv("monthNamesShort")],MMMM:["month",wo,Tv("monthNames")],a:Rv,A:Rv,ZZ:Ov,Z:Ov},tl={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Iv=function(t){return fn(tl,t)},Lv=function(t,e,r){if(e===void 0&&(e=tl.default),r===void 0&&(r={}),typeof t=="number"&&(t=new Date(t)),Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");e=tl[e]||e;var n=[];e=e.replace(Mv,function(s,o){return n.push(o),"@@@"});var i=fn(fn({},el),r);return e=e.replace(bv,function(s){return Uq[s](t,i)}),e.replace(/@@@/g,function(){return n.shift()})};Fq={format:Lv,parse:Dv,defaultI18n:vp,setGlobalDateI18n:xv,setGlobalDateMasks:Iv},Bq=Fq});var Bv=m((bde,Fv)=>{"use strict";var Vq=(kv(),Xe(Uv)),qq=ft();Fv.exports=qq((t,e={})=>(e.format&&(t.timestamp=typeof e.format=="function"?e.format():Vq.format(new Date,e.format)),t.timestamp||(t.timestamp=new Date().toISOString()),e.alias&&(t[e.alias]=t.timestamp),t))});var qv=m((Mde,Vv)=>{"use strict";var Ap=ip(),Gq=ft(),{MESSAGE:Cp}=Pe();Vv.exports=Gq((t,e)=>(e.level!==!1&&(t.level=Ap.strip(t.level)),e.message!==!1&&(t.message=Ap.strip(String(t.message))),e.raw!==!1&&t[Cp]&&(t[Cp]=Ap.strip(String(t[Cp]))),t))});var Op=m(Rp=>{"use strict";var Hq=Rp.format=ft();Rp.levels=B0();function Je(t,e){Object.defineProperty(Hq,t,{get(){return e()},configurable:!0})}Je("align",function(){return q0()});Je("errors",function(){return z0()});Je("cli",function(){return $0()});Je("combine",function(){return Y0()});Je("colorize",function(){return $c()});Je("json",function(){return Tp()});Je("label",function(){return tv()});Je("logstash",function(){return nv()});Je("metadata",function(){return sv()});Je("ms",function(){return lv()});Je("padLevels",function(){return fp()});Je("prettyPrint",function(){return dv()});Je("printf",function(){return fv()});Je("simple",function(){return gv()});Je("splat",function(){return Sv()});Je("timestamp",function(){return Bv()});Je("uncolorize",function(){return qv()})});var bp=m(rl=>{"use strict";var{format:Gv}=L("util");rl.warn={deprecated(t){return()=>{throw new Error(Gv("{ %s } was removed in winston@3.0.0.",t))}},useFormat(t){return()=>{throw new Error([Gv("{ %s } was removed in winston@3.0.0.",t),"Use a custom winston.format = winston.format(function) instead."].join(`
|
|
27
|
-
`))}},forFunctions(t,e,r){r.forEach(n=>{t[n]=rl.warn[e](n)})},forProperties(t,e,r){r.forEach(n=>{let i=rl.warn[e](n);Object.defineProperty(t,n,{get:i,set:i})})}}});var Hv=m((Pde,zq)=>{zq.exports={name:"winston",description:"A logger for just about everything.",version:"3.19.0",author:"Charlie Robbins <charlie.robbins@gmail.com>",maintainers:["David Hyde <dabh@alumni.stanford.edu>"],repository:{type:"git",url:"https://github.com/winstonjs/winston.git"},keywords:["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],dependencies:{"@dabh/diagnostics":"^2.0.8","@colors/colors":"^1.6.0",async:"^3.2.3","is-stream":"^2.0.0",logform:"^2.7.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.9.0"},devDependencies:{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@dabh/eslint-config-populist":"^4.4.0","@types/node":"^20.11.24","abstract-winston-transport":"^0.5.1",assume:"^2.2.0","cross-spawn-async":"^2.2.5",eslint:"^8.57.0",hock:"^1.4.1",jest:"^29.7.0",rimraf:"5.0.10",split2:"^4.1.0","std-mocks":"^2.0.0",through2:"^4.0.2","winston-compat":"^0.1.5"},main:"./lib/winston.js",browser:"./dist/winston",types:"./index.d.ts",scripts:{lint:"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",test:"jest","test:unit":"jest -c test/jest.config.unit.js","test:integration":"jest -c test/jest.config.integration.js","test:typescript":"npx --package typescript tsc --project test",build:"babel lib -d dist",prebuild:"rimraf dist",prepublishOnly:"npm run build"},engines:{node:">= 12.0.0"},license:"MIT"}});var jv=m((xde,zv)=>{"use strict";zv.exports=L("util").deprecate});var Mp=m((Ide,$v)=>{"use strict";$v.exports=L("stream")});var wp=m((Lde,Yv)=>{"use strict";function jq(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Np,this,t)):process.nextTick(Np,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(nl,r):(r._writableState.errorEmitted=!0,process.nextTick(Wv,r,s)):process.nextTick(Wv,r,s):e?(process.nextTick(nl,r),e(s)):process.nextTick(nl,r)}),this)}function Wv(t,e){Np(t,e),nl(t)}function nl(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function $q(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Np(t,e){t.emit("error",e)}function Wq(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}Yv.exports={destroy:jq,undestroy:$q,errorOrDestroy:Wq}});var pn=m((Dde,Jv)=>{"use strict";var Xv={};function wt(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}class i extends r{constructor(o,a,c){super(n(o,a,c))}}i.prototype.name=r.name,i.prototype.code=t,Xv[t]=i}function Kv(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function Yq(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Kq(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Xq(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}wt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);wt("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&Yq(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(Kq(t," argument"))i=`The ${t} ${n} ${Kv(e,"type")}`;else{let s=Xq(t,".")?"property":"argument";i=`The "${t}" ${s} ${n} ${Kv(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);wt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");wt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});wt("ERR_STREAM_PREMATURE_CLOSE","Premature close");wt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});wt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");wt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");wt("ERR_STREAM_WRITE_AFTER_END","write after end");wt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);wt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);wt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Jv.exports.codes=Xv});var Pp=m((Ude,Qv)=>{"use strict";var Jq=pn().codes.ERR_INVALID_OPT_VALUE;function Qq(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Zq(t,e,r,n){var i=Qq(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Jq(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}Qv.exports={getHighWaterMark:Zq}});var Zv=m((kde,xp)=>{"use strict";typeof Object.create=="function"?xp.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:xp.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Wi=m((Fde,Lp)=>{"use strict";try{if(Ip=L("util"),typeof Ip.inherits!="function")throw"";Lp.exports=Ip.inherits}catch{Lp.exports=Zv()}var Ip});var sA=m((Bde,iA)=>{"use strict";function eA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function tA(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?eA(Object(r),!0).forEach(function(n){eG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):eA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function eG(t,e,r){return e=nA(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rA(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nA(n.key),n)}}function rG(t,e,r){return e&&rA(t.prototype,e),r&&rA(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nA(t){var e=nG(t,"string");return typeof e=="symbol"?e:String(e)}function nG(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var iG=L("buffer"),il=iG.Buffer,sG=L("util"),Dp=sG.inspect,oG=Dp&&Dp.custom||"inspect";function aG(t,e,r){il.prototype.copy.call(t,e,r)}iA.exports=function(){function t(){tG(this,t),this.head=null,this.tail=null,this.length=0}return rG(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return il.alloc(0);for(var n=il.allocUnsafe(r>>>0),i=this.head,s=0;i;)aG(i.data,n,s),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,s=n.data;for(r-=s.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===0){a===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++i}return this.length-=i,s}},{key:"_getBuffer",value:function(r){var n=il.allocUnsafe(r),i=this.head,s=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,a),r-=a,r===0){a===o.length?(++s,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++s}return this.length-=s,n}},{key:oG,value:function(r,n){return Dp(this,tA(tA({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var cA=m((Up,aA)=>{"use strict";var sl=L("buffer"),fr=sl.Buffer;function oA(t,e){for(var r in t)e[r]=t[r]}fr.from&&fr.alloc&&fr.allocUnsafe&&fr.allocUnsafeSlow?aA.exports=sl:(oA(sl,Up),Up.Buffer=ei);function ei(t,e,r){return fr(t,e,r)}ei.prototype=Object.create(fr.prototype);oA(fr,ei);ei.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return fr(t,e,r)};ei.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=fr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};ei.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return fr(t)};ei.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return sl.SlowBuffer(t)}});var Bp=m(uA=>{"use strict";var Fp=cA().Buffer,lA=Fp.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function cG(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function lG(t){var e=cG(t);if(typeof e!="string"&&(Fp.isEncoding===lA||!lA(t)))throw new Error("Unknown encoding: "+t);return e||t}uA.StringDecoder=Po;function Po(t){this.encoding=lG(t);var e;switch(this.encoding){case"utf16le":this.text=mG,this.end=gG,e=4;break;case"utf8":this.fillLast=dG,e=4;break;case"base64":this.text=_G,this.end=EG,e=3;break;default:this.write=SG,this.end=TG;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Fp.allocUnsafe(e)}Po.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Po.prototype.end=pG;Po.prototype.text=fG;Po.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function kp(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function uG(t,e,r){var n=e.length-1;if(n<r)return 0;var i=kp(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=kp(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=kp(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function hG(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function dG(t){var e=this.lastTotal-this.lastNeed,r=hG(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function fG(t,e){var r=uG(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function pG(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function mG(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function gG(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function _G(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function EG(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function SG(t){return t.toString(this.encoding)}function TG(t){return t&&t.length?this.write(t):""}});var ol=m((qde,fA)=>{"use strict";var hA=pn().codes.ERR_STREAM_PREMATURE_CLOSE;function yG(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function vG(){}function AG(t){return t.setHeader&&typeof t.abort=="function"}function dA(t,e,r){if(typeof e=="function")return dA(t,null,e);e||(e={}),r=yG(r||vG);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){i=!1,o=!0,n||r.call(t)},c=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,c=!0,i||r.call(t)},h=function(g){r.call(t,g)},d=function(){var g;if(n&&!c)return(!t._readableState||!t._readableState.ended)&&(g=new hA),r.call(t,g);if(i&&!o)return(!t._writableState||!t._writableState.ended)&&(g=new hA),r.call(t,g)},f=function(){t.req.on("finish",a)};return AG(t)?(t.on("complete",a),t.on("abort",d),t.req?f():t.on("request",f)):i&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",h),t.on("close",d),function(){t.removeListener("complete",a),t.removeListener("abort",d),t.removeListener("request",f),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",d)}}fA.exports=dA});var mA=m((Gde,pA)=>{"use strict";var al;function mn(t,e,r){return e=CG(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function CG(t){var e=RG(t,"string");return typeof e=="symbol"?e:String(e)}function RG(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var OG=ol(),gn=Symbol("lastResolve"),ti=Symbol("lastReject"),xo=Symbol("error"),cl=Symbol("ended"),ri=Symbol("lastPromise"),Vp=Symbol("handlePromise"),ni=Symbol("stream");function _n(t,e){return{value:t,done:e}}function bG(t){var e=t[gn];if(e!==null){var r=t[ni].read();r!==null&&(t[ri]=null,t[gn]=null,t[ti]=null,e(_n(r,!1)))}}function MG(t){process.nextTick(bG,t)}function NG(t,e){return function(r,n){t.then(function(){if(e[cl]){r(_n(void 0,!0));return}e[Vp](r,n)},n)}}var wG=Object.getPrototypeOf(function(){}),PG=Object.setPrototypeOf((al={get stream(){return this[ni]},next:function(){var e=this,r=this[xo];if(r!==null)return Promise.reject(r);if(this[cl])return Promise.resolve(_n(void 0,!0));if(this[ni].destroyed)return new Promise(function(o,a){process.nextTick(function(){e[xo]?a(e[xo]):o(_n(void 0,!0))})});var n=this[ri],i;if(n)i=new Promise(NG(n,this));else{var s=this[ni].read();if(s!==null)return Promise.resolve(_n(s,!1));i=new Promise(this[Vp])}return this[ri]=i,i}},mn(al,Symbol.asyncIterator,function(){return this}),mn(al,"return",function(){var e=this;return new Promise(function(r,n){e[ni].destroy(null,function(i){if(i){n(i);return}r(_n(void 0,!0))})})}),al),wG),xG=function(e){var r,n=Object.create(PG,(r={},mn(r,ni,{value:e,writable:!0}),mn(r,gn,{value:null,writable:!0}),mn(r,ti,{value:null,writable:!0}),mn(r,xo,{value:null,writable:!0}),mn(r,cl,{value:e._readableState.endEmitted,writable:!0}),mn(r,Vp,{value:function(s,o){var a=n[ni].read();a?(n[ri]=null,n[gn]=null,n[ti]=null,s(_n(a,!1))):(n[gn]=s,n[ti]=o)},writable:!0}),r));return n[ri]=null,OG(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=n[ti];s!==null&&(n[ri]=null,n[gn]=null,n[ti]=null,s(i)),n[xo]=i;return}var o=n[gn];o!==null&&(n[ri]=null,n[gn]=null,n[ti]=null,o(_n(void 0,!0))),n[cl]=!0}),e.on("readable",MG.bind(null,n)),n};pA.exports=xG});var SA=m((Hde,EA)=>{"use strict";function gA(t,e,r,n,i,s,o){try{var a=t[s](o),c=a.value}catch(l){r(l);return}a.done?e(c):Promise.resolve(c).then(n,i)}function IG(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(c){gA(s,n,i,o,a,"next",c)}function a(c){gA(s,n,i,o,a,"throw",c)}o(void 0)})}}function _A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function LG(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_A(Object(r),!0).forEach(function(n){DG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_A(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function DG(t,e,r){return e=UG(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UG(t){var e=kG(t,"string");return typeof e=="symbol"?e:String(e)}function kG(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var FG=pn().codes.ERR_INVALID_ARG_TYPE;function BG(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new FG("iterable",["Iterable"],e);var i=new t(LG({objectMode:!0},r)),s=!1;i._read=function(){s||(s=!0,o())};function o(){return a.apply(this,arguments)}function a(){return a=IG(function*(){try{var c=yield n.next(),l=c.value,h=c.done;h?i.push(null):i.push(yield l)?o():s=!1}catch(d){i.destroy(d)}}),a.apply(this,arguments)}return i}EA.exports=BG});var Xp=m((jde,NA)=>{"use strict";NA.exports=ae;var Yi;ae.ReadableState=AA;var zde=L("events").EventEmitter,vA=function(e,r){return e.listeners(r).length},Lo=Mp(),ll=L("buffer").Buffer,VG=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function qG(t){return ll.from(t)}function GG(t){return ll.isBuffer(t)||t instanceof VG}var qp=L("util"),re;qp&&qp.debuglog?re=qp.debuglog("stream"):re=function(){};var HG=sA(),Yp=wp(),zG=Pp(),jG=zG.getHighWaterMark,ul=pn().codes,$G=ul.ERR_INVALID_ARG_TYPE,WG=ul.ERR_STREAM_PUSH_AFTER_EOF,YG=ul.ERR_METHOD_NOT_IMPLEMENTED,KG=ul.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ki,Gp,Hp;Wi()(ae,Lo);var Io=Yp.errorOrDestroy,zp=["error","close","destroy","pause","resume"];function XG(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function AA(t,e,r){Yi=Yi||ii(),t=t||{},typeof r!="boolean"&&(r=e instanceof Yi),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=jG(this,t,"readableHighWaterMark",r),this.buffer=new HG,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Ki||(Ki=Bp().StringDecoder),this.decoder=new Ki(t.encoding),this.encoding=t.encoding)}function ae(t){if(Yi=Yi||ii(),!(this instanceof ae))return new ae(t);var e=this instanceof Yi;this._readableState=new AA(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Lo.call(this)}Object.defineProperty(ae.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ae.prototype.destroy=Yp.destroy;ae.prototype._undestroy=Yp.undestroy;ae.prototype._destroy=function(t,e){e(t)};ae.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=ll.from(t,e),e=""),n=!0),CA(this,t,e,!1,n)};ae.prototype.unshift=function(t){return CA(this,t,null,!0,!1)};function CA(t,e,r,n,i){re("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,ZG(t,s);else{var o;if(i||(o=JG(s,e)),o)Io(t,o);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==ll.prototype&&(e=qG(e)),n)s.endEmitted?Io(t,new KG):jp(t,s,e,!0);else if(s.ended)Io(t,new WG);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?jp(t,s,e,!1):Wp(t,s)):jp(t,s,e,!1)}else n||(s.reading=!1,Wp(t,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function jp(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&hl(t)),Wp(t,e)}function JG(t,e){var r;return!GG(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new $G("chunk",["string","Buffer","Uint8Array"],e)),r}ae.prototype.isPaused=function(){return this._readableState.flowing===!1};ae.prototype.setEncoding=function(t){Ki||(Ki=Bp().StringDecoder);var e=new Ki(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var TA=1073741824;function QG(t){return t>=TA?t=TA:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function yA(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=QG(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ae.prototype.read=function(t){re("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return re("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?$p(this):hl(this),null;if(t=yA(t,e),t===0&&e.ended)return e.length===0&&$p(this),null;var n=e.needReadable;re("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,re("length less than watermark",n)),e.ended||e.reading?(n=!1,re("reading or ended",n)):n&&(re("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=yA(r,e)));var i;return t>0?i=bA(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&$p(this)),i!==null&&this.emit("data",i),i};function ZG(t,e){if(re("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?hl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,RA(t)))}}function hl(t){var e=t._readableState;re("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(re("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(RA,t))}function RA(t){var e=t._readableState;re("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Kp(t)}function Wp(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(eH,t,e))}function eH(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(re("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ae.prototype._read=function(t){Io(this,new YG("_read()"))};ae.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,re("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,s=i?a:S;n.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(A,C){re("onunpipe"),A===r&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,h())}function a(){re("onend"),t.end()}var c=tH(r);t.on("drain",c);var l=!1;function h(){re("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),t.removeListener("drain",c),t.removeListener("error",f),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",S),r.removeListener("data",d),l=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&c()}r.on("data",d);function d(A){re("ondata");var C=t.write(A);re("dest.write",C),C===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&MA(n.pipes,t)!==-1)&&!l&&(re("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(A){re("onerror",A),S(),t.removeListener("error",f),vA(t,"error")===0&&Io(t,A)}XG(t,"error",f);function p(){t.removeListener("finish",g),S()}t.once("close",p);function g(){re("onfinish"),t.removeListener("close",p),S()}t.once("finish",g);function S(){re("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(re("pipe resume"),r.resume()),t};function tH(t){return function(){var r=t._readableState;re("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&vA(t,"data")&&(r.flowing=!0,Kp(t))}}ae.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=MA(e.pipes,t);return o===-1?this:(e.pipes.splice(o,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ae.prototype.on=function(t,e){var r=Lo.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,re("on readable",n.length,n.reading),n.length?hl(this):n.reading||process.nextTick(rH,this)),r};ae.prototype.addListener=ae.prototype.on;ae.prototype.removeListener=function(t,e){var r=Lo.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(OA,this),r};ae.prototype.removeAllListeners=function(t){var e=Lo.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(OA,this),e};function OA(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function rH(t){re("readable nexttick read 0"),t.read(0)}ae.prototype.resume=function(){var t=this._readableState;return t.flowing||(re("resume"),t.flowing=!t.readableListening,nH(this,t)),t.paused=!1,this};function nH(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(iH,t,e))}function iH(t,e){re("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Kp(t),e.flowing&&!e.reading&&t.read(0)}ae.prototype.pause=function(){return re("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(re("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Kp(t){var e=t._readableState;for(re("flow",e.flowing);e.flowing&&t.read()!==null;);}ae.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(re("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&e.push(o)}e.push(null)}),t.on("data",function(o){if(re("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var a=e.push(o);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var s=0;s<zp.length;s++)t.on(zp[s],this.emit.bind(this,zp[s]));return this._read=function(o){re("wrapped _read",o),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ae.prototype[Symbol.asyncIterator]=function(){return Gp===void 0&&(Gp=mA()),Gp(this)});Object.defineProperty(ae.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ae.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ae.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ae._fromList=bA;Object.defineProperty(ae.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function bA(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function $p(t){var e=t._readableState;re("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(sH,e,t))}function sH(t,e){if(re("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ae.from=function(t,e){return Hp===void 0&&(Hp=SA()),Hp(ae,t,e)});function MA(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var ii=m(($de,PA)=>{"use strict";var oH=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};PA.exports=pr;var wA=Xp(),Qp=pl();Wi()(pr,wA);for(Jp=oH(Qp.prototype),dl=0;dl<Jp.length;dl++)fl=Jp[dl],pr.prototype[fl]||(pr.prototype[fl]=Qp.prototype[fl]);var Jp,fl,dl;function pr(t){if(!(this instanceof pr))return new pr(t);wA.call(this,t),Qp.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",aH)))}Object.defineProperty(pr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(pr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(pr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function aH(){this._writableState.ended||process.nextTick(cH,this)}function cH(t){t.end()}Object.defineProperty(pr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var pl=m((Wde,kA)=>{"use strict";kA.exports=Ae;function IA(t){var e=this;this.next=null,this.entry=null,this.finish=function(){DH(e,t)}}var Xi;Ae.WritableState=Uo;var lH={deprecate:jv()},LA=Mp(),gl=L("buffer").Buffer,uH=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hH(t){return gl.from(t)}function dH(t){return gl.isBuffer(t)||t instanceof uH}var em=wp(),fH=Pp(),pH=fH.getHighWaterMark,En=pn().codes,mH=En.ERR_INVALID_ARG_TYPE,gH=En.ERR_METHOD_NOT_IMPLEMENTED,_H=En.ERR_MULTIPLE_CALLBACK,EH=En.ERR_STREAM_CANNOT_PIPE,SH=En.ERR_STREAM_DESTROYED,TH=En.ERR_STREAM_NULL_VALUES,yH=En.ERR_STREAM_WRITE_AFTER_END,vH=En.ERR_UNKNOWN_ENCODING,Ji=em.errorOrDestroy;Wi()(Ae,LA);function AH(){}function Uo(t,e,r){Xi=Xi||ii(),t=t||{},typeof r!="boolean"&&(r=e instanceof Xi),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=pH(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){wH(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new IA(this)}Uo.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Uo.prototype,"buffer",{get:lH.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var ml;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ml=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ae,Symbol.hasInstance,{value:function(e){return ml.call(this,e)?!0:this!==Ae?!1:e&&e._writableState instanceof Uo}})):ml=function(e){return e instanceof this};function Ae(t){Xi=Xi||ii();var e=this instanceof Xi;if(!e&&!ml.call(Ae,this))return new Ae(t);this._writableState=new Uo(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),LA.call(this)}Ae.prototype.pipe=function(){Ji(this,new EH)};function CH(t,e){var r=new yH;Ji(t,r),process.nextTick(e,r)}function RH(t,e,r,n){var i;return r===null?i=new TH:typeof r!="string"&&!e.objectMode&&(i=new mH("chunk",["string","Buffer"],r)),i?(Ji(t,i),process.nextTick(n,i),!1):!0}Ae.prototype.write=function(t,e,r){var n=this._writableState,i=!1,s=!n.objectMode&&dH(t);return s&&!gl.isBuffer(t)&&(t=hH(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=AH),n.ending?CH(this,r):(s||RH(this,n,t,r))&&(n.pendingcb++,i=bH(this,n,s,t,e,r)),i};Ae.prototype.cork=function(){this._writableState.corked++};Ae.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&DA(this,t))};Ae.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new vH(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ae.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function OH(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=gl.from(e,r)),e}Object.defineProperty(Ae.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function bH(t,e,r,n,i,s){if(!r){var o=OH(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=e.objectMode?1:n.length;e.length+=a;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Zp(t,e,!1,a,n,i,s);return c}function Zp(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new SH("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function MH(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(Do,t,e),t._writableState.errorEmitted=!0,Ji(t,n)):(i(n),t._writableState.errorEmitted=!0,Ji(t,n),Do(t,e))}function NH(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function wH(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new _H;if(NH(r),e)MH(t,r,n,e,i);else{var s=UA(r)||t.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&DA(t,r),n?process.nextTick(xA,t,r,s,i):xA(t,r,s,i)}}function xA(t,e,r,n){r||PH(t,e),e.pendingcb--,n(),Do(t,e)}function PH(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function DA(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var o=0,a=!0;r;)i[o]=r,r.isBuf||(a=!1),r=r.next,o+=1;i.allBuffers=a,Zp(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new IA(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,h=r.callback,d=e.objectMode?1:c.length;if(Zp(t,e,!1,d,c,l,h),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Ae.prototype._write=function(t,e,r){r(new gH("_write()"))};Ae.prototype._writev=null;Ae.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||LH(this,n,r),this};Object.defineProperty(Ae.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function UA(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function xH(t,e){t._final(function(r){e.pendingcb--,r&&Ji(t,r),e.prefinished=!0,t.emit("prefinish"),Do(t,e)})}function IH(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(xH,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Do(t,e){var r=UA(e);if(r&&(IH(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function LH(t,e,r){e.ending=!0,Do(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function DH(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Ae.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ae.prototype.destroy=em.destroy;Ae.prototype._undestroy=em.undestroy;Ae.prototype._destroy=function(t,e){e(t)}});var tm=m((Yde,VA)=>{"use strict";var UH=L("util"),FA=pl(),{LEVEL:BA}=Pe(),ko=VA.exports=function(e={}){FA.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once("pipe",r=>{this.levels=r.levels,this.parent=r}),this.once("unpipe",r=>{r===this.parent&&(this.parent=null,this.close&&this.close())})};UH.inherits(ko,FA);ko.prototype._write=function(e,r,n){if(this.silent||e.exception===!0&&!this.handleExceptions)return n(null);let i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[e[BA]]){if(e&&!this.format)return this.log(e,n);let s,o;try{o=this.format.transform(Object.assign({},e),this.format.options)}catch(a){s=a}if(s||!o){if(n(),s)throw s;return}return this.log(o,n)}return this._writableState.sync=!1,n(null)};ko.prototype._writev=function(e,r){if(this.logv){let n=e.filter(this._accept,this);return n.length?this.logv(n,r):r(null)}for(let n=0;n<e.length;n++){if(!this._accept(e[n]))continue;if(e[n].chunk&&!this.format){this.log(e[n].chunk,e[n].callback);continue}let i,s;try{s=this.format.transform(Object.assign({},e[n].chunk),this.format.options)}catch(o){i=o}if(i||!s){if(e[n].callback(),i)throw r(null),i}else this.log(s,e[n].callback)}return r(null)};ko.prototype._accept=function(e){let r=e.chunk;if(this.silent)return!1;let n=this.level||this.parent&&this.parent.level;return!!((r.exception===!0||!n||this.levels[n]>=this.levels[r[BA]])&&(this.handleExceptions||r.exception!==!0))};ko.prototype._nop=function(){}});var nm=m((Kde,GA)=>{"use strict";var kH=L("util"),{LEVEL:rm}=Pe(),qA=tm(),Fo=GA.exports=function(e={}){if(qA.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function r(n){this.emit("error",n,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=r.bind(this),this.transport.on("error",this.transport.__winstonError))};kH.inherits(Fo,qA);Fo.prototype._write=function(e,r,n){if(this.silent||e.exception===!0&&!this.handleExceptions)return n(null);(!this.level||this.levels[this.level]>=this.levels[e[rm]])&&this.transport.log(e[rm],e.message,e,this._nop),n(null)};Fo.prototype._writev=function(e,r){for(let n=0;n<e.length;n++)this._accept(e[n])&&(this.transport.log(e[n].chunk[rm],e[n].chunk.message,e[n].chunk,this._nop),e[n].callback());return r(null)};Fo.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
28
|
-
`))};Fo.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var Qi=m((Xde,im)=>{"use strict";im.exports=tm();im.exports.LegacyTransportStream=nm()});var jA=m((Qde,zA)=>{"use strict";var FH=L("os"),{LEVEL:HA,MESSAGE:Zi}=Pe(),BH=Qi();zA.exports=class extends BH{constructor(e={}){super(e),this.name=e.name||"console",this.stderrLevels=this._stringArrayToSet(e.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(e.consoleWarnLevels),this.eol=typeof e.eol=="string"?e.eol:FH.EOL,this.forceConsole=e.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(e,r){if(setImmediate(()=>this.emit("logged",e)),this.stderrLevels[e[HA]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[Zi]}${this.eol}`):this._consoleError(e[Zi]),r&&r();return}else if(this.consoleWarnLevels[e[HA]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[Zi]}${this.eol}`):this._consoleWarn(e[Zi]),r&&r();return}console._stdout&&!this.forceConsole?console._stdout.write(`${e[Zi]}${this.eol}`):this._consoleLog(e[Zi]),r&&r()}_stringArrayToSet(e,r){if(!e)return{};if(r=r||"Cannot make set from type other than Array of string elements",!Array.isArray(e))throw new Error(r);return e.reduce((n,i)=>{if(typeof i!="string")throw new Error(r);return n[i]=!0,n},{})}}});var El=m((_l,$A)=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.default=VH;function VH(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}$A.exports=_l.default});var YA=m((Sl,WA)=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};WA.exports=Sl.default});var JA=m(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.fallback=KA;Sn.wrap=XA;var qH=Sn.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,GH=Sn.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,HH=Sn.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function KA(t){setTimeout(t,0)}function XA(t){return(e,...r)=>t(()=>e(...r))}var Bo;qH?Bo=queueMicrotask:GH?Bo=setImmediate:HH?Bo=process.nextTick:Bo=KA;Sn.default=XA(Bo)});var rC=m((Tl,tC)=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.default=KH;var zH=YA(),jH=eC(zH),$H=JA(),WH=eC($H),YH=si();function eC(t){return t&&t.__esModule?t:{default:t}}function KH(t){return(0,YH.isAsync)(t)?function(...e){let r=e.pop(),n=t.apply(this,e);return QA(n,r)}:(0,jH.default)(function(e,r){var n;try{n=t.apply(this,e)}catch(i){return r(i)}if(n&&typeof n.then=="function")return QA(n,r);r(null,n)})}function QA(t,e){return t.then(r=>{ZA(e,null,r)},r=>{ZA(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function ZA(t,e,r){try{t(e,r)}catch(n){(0,WH.default)(i=>{throw i},n)}}tC.exports=Tl.default});var si=m(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.isAsyncIterable=Fr.isAsyncGenerator=Fr.isAsync=void 0;var XH=rC(),JH=QH(XH);function QH(t){return t&&t.__esModule?t:{default:t}}function nC(t){return t[Symbol.toStringTag]==="AsyncFunction"}function ZH(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function e4(t){return typeof t[Symbol.asyncIterator]=="function"}function t4(t){if(typeof t!="function")throw new Error("expected a function");return nC(t)?(0,JH.default)(t):t}Fr.default=t4;Fr.isAsync=nC;Fr.isAsyncGenerator=ZH;Fr.isAsyncIterable=e4});var es=m((yl,iC)=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.default=r4;function r4(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...n){return typeof n[e-1]=="function"?t.apply(this,n):new Promise((i,s)=>{n[e-1]=(o,...a)=>{if(o)return s(o);i(a.length>1?a:a[0])},t.apply(this,n)})}return r}iC.exports=yl.default});var oC=m((vl,sC)=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});var n4=El(),i4=sm(n4),s4=si(),o4=sm(s4),a4=es(),c4=sm(a4);function sm(t){return t&&t.__esModule?t:{default:t}}vl.default=(0,c4.default)((t,e,r)=>{var n=(0,i4.default)(e)?[]:{};t(e,(i,s,o)=>{(0,o4.default)(i)((a,...c)=>{c.length<2&&([c]=c),n[s]=c,o(a)})},i=>r(i,n))},3);sC.exports=vl.default});var om=m((Al,aC)=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.default=l4;function l4(t){function e(...r){if(t!==null){var n=t;t=null,n.apply(this,r)}}return Object.assign(e,t),e}aC.exports=Al.default});var lC=m((Cl,cC)=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};cC.exports=Cl.default});var dC=m((Rl,hC)=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.default=_4;var u4=El(),h4=uC(u4),d4=lC(),f4=uC(d4);function uC(t){return t&&t.__esModule?t:{default:t}}function p4(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function m4(t){var e=-1;return function(){var n=t.next();return n.done?null:(e++,{value:n.value,key:e})}}function g4(t){var e=t?Object.keys(t):[],r=-1,n=e.length;return function i(){var s=e[++r];return s==="__proto__"?i():r<n?{value:t[s],key:s}:null}}function _4(t){if((0,h4.default)(t))return p4(t);var e=(0,f4.default)(t);return e?m4(e):g4(t)}hC.exports=Rl.default});var am=m((Ol,fC)=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.default=E4;function E4(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}fC.exports=Ol.default});var Ml=m((bl,pC)=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});var S4={};bl.default=S4;pC.exports=bl.default});var gC=m((Nl,mC)=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.default=A4;var T4=Ml(),y4=v4(T4);function v4(t){return t&&t.__esModule?t:{default:t}}function A4(t,e,r,n){let i=!1,s=!1,o=!1,a=0,c=0;function l(){a>=e||o||i||(o=!0,t.next().then(({value:f,done:p})=>{if(!(s||i)){if(o=!1,p){i=!0,a<=0&&n(null);return}a++,r(f,c,h),c++,l()}}).catch(d))}function h(f,p){if(a-=1,!s){if(f)return d(f);if(f===!1){i=!0,s=!0;return}if(p===y4.default||i&&a<=0)return i=!0,n(null);l()}}function d(f){s||(o=!1,i=!0,n(f))}l()}mC.exports=Nl.default});var TC=m((wl,SC)=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var C4=om(),R4=Vo(C4),O4=dC(),b4=Vo(O4),M4=am(),N4=Vo(M4),_C=si(),w4=gC(),EC=Vo(w4),P4=Ml(),x4=Vo(P4);function Vo(t){return t&&t.__esModule?t:{default:t}}wl.default=t=>(e,r,n)=>{if(n=(0,R4.default)(n),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return n(null);if((0,_C.isAsyncGenerator)(e))return(0,EC.default)(e,t,r,n);if((0,_C.isAsyncIterable)(e))return(0,EC.default)(e[Symbol.asyncIterator](),t,r,n);var i=(0,b4.default)(e),s=!1,o=!1,a=0,c=!1;function l(d,f){if(!o)if(a-=1,d)s=!0,n(d);else if(d===!1)s=!0,o=!0;else{if(f===x4.default||s&&a<=0)return s=!0,n(null);c||h()}}function h(){for(c=!0;a<t&&!s;){var d=i();if(d===null){s=!0,a<=0&&n(null);return}a+=1,r(d.value,d.key,(0,N4.default)(l))}c=!1}h()};SC.exports=wl.default});var lm=m((Pl,yC)=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var I4=TC(),L4=cm(I4),D4=si(),U4=cm(D4),k4=es(),F4=cm(k4);function cm(t){return t&&t.__esModule?t:{default:t}}function B4(t,e,r,n){return(0,L4.default)(e)(t,(0,U4.default)(r),n)}Pl.default=(0,F4.default)(B4,4);yC.exports=Pl.default});var CC=m((xl,AC)=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});var V4=lm(),q4=vC(V4),G4=es(),H4=vC(G4);function vC(t){return t&&t.__esModule?t:{default:t}}function z4(t,e,r){return(0,q4.default)(t,1,e,r)}xl.default=(0,H4.default)(z4,3);AC.exports=xl.default});var bC=m((Il,OC)=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.default=K4;var j4=oC(),$4=RC(j4),W4=CC(),Y4=RC(W4);function RC(t){return t&&t.__esModule?t:{default:t}}function K4(t,e){return(0,$4.default)(Y4.default,t,e)}OC.exports=Il.default});var um=m((tfe,NC)=>{"use strict";NC.exports=Br;var Ll=pn().codes,X4=Ll.ERR_METHOD_NOT_IMPLEMENTED,J4=Ll.ERR_MULTIPLE_CALLBACK,Q4=Ll.ERR_TRANSFORM_ALREADY_TRANSFORMING,Z4=Ll.ERR_TRANSFORM_WITH_LENGTH_0,Dl=ii();Wi()(Br,Dl);function e5(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new J4);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Br(t){if(!(this instanceof Br))return new Br(t);Dl.call(this,t),this._transformState={afterTransform:e5.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",t5)}function t5(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){MC(t,e,r)}):MC(this,null,null)}Br.prototype.push=function(t,e){return this._transformState.needTransform=!1,Dl.prototype.push.call(this,t,e)};Br.prototype._transform=function(t,e,r){r(new X4("_transform()"))};Br.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Br.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Br.prototype._destroy=function(t,e){Dl.prototype._destroy.call(this,t,function(r){e(r)})};function MC(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new Z4;if(t._transformState.transforming)throw new Q4;return t.push(null)}});var xC=m((rfe,PC)=>{"use strict";PC.exports=qo;var wC=um();Wi()(qo,wC);function qo(t){if(!(this instanceof qo))return new qo(t);wC.call(this,t)}qo.prototype._transform=function(t,e,r){r(null,t)}});var kC=m((nfe,UC)=>{"use strict";var hm;function r5(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var DC=pn().codes,n5=DC.ERR_MISSING_ARGS,i5=DC.ERR_STREAM_DESTROYED;function IC(t){if(t)throw t}function s5(t){return t.setHeader&&typeof t.abort=="function"}function o5(t,e,r,n){n=r5(n);var i=!1;t.on("close",function(){i=!0}),hm===void 0&&(hm=ol()),hm(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,s5(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(o||new i5("pipe"))}}}function LC(t){t()}function a5(t,e){return t.pipe(e)}function c5(t){return!t.length||typeof t[t.length-1]!="function"?IC:t.pop()}function l5(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=c5(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new n5("streams");var i,s=e.map(function(o,a){var c=a<e.length-1,l=a>0;return o5(o,c,l,function(h){i||(i=h),h&&s.forEach(LC),!c&&(s.forEach(LC),n(i))})});return e.reduce(a5)}UC.exports=l5});var oi=m((Pt,Ho)=>{"use strict";var Go=L("stream");process.env.READABLE_STREAM==="disable"&&Go?(Ho.exports=Go.Readable,Object.assign(Ho.exports,Go),Ho.exports.Stream=Go):(Pt=Ho.exports=Xp(),Pt.Stream=Go||Pt,Pt.Readable=Pt,Pt.Writable=pl(),Pt.Duplex=ii(),Pt.Transform=um(),Pt.PassThrough=xC(),Pt.finished=ol(),Pt.pipeline=kC())});var Em=m((ife,BC)=>{"use strict";var ts=[],zo=[],dm=function(){};function pm(t){return~ts.indexOf(t)?!1:(ts.push(t),!0)}function mm(t){dm=t}function u5(t){for(var e=[],r=0;r<ts.length;r++){if(ts[r].async){e.push(ts[r]);continue}if(ts[r](t))return!0}return e.length?new Promise(function(i){Promise.all(e.map(function(o){return o(t)})).then(function(o){i(o.some(Boolean))})}):!1}function gm(t){return~zo.indexOf(t)?!1:(zo.push(t),!0)}function fm(){dm.apply(dm,arguments)}function FC(t){for(var e=0;e<zo.length;e++)t=zo[e].apply(zo[e],arguments);return t}function _m(t,e){var r=Object.prototype.hasOwnProperty;for(var n in e)r.call(e,n)&&(t[n]=e[n]);return t}function h5(t){return t.enabled=!1,t.modify=gm,t.set=mm,t.use=pm,_m(function(){return!1},t)}function d5(t){function e(){var r=Array.prototype.slice.call(arguments,0);return fm.call(fm,t,FC(r,t)),!0}return t.enabled=!0,t.modify=gm,t.set=mm,t.use=pm,_m(e,t)}BC.exports=function(e){return e.introduce=_m,e.enabled=u5,e.process=FC,e.modify=gm,e.write=fm,e.nope=h5,e.yep=d5,e.set=mm,e.use=pm,e}});var qC=m((sfe,VC)=>{"use strict";var f5=Em(),p5=f5(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});VC.exports=p5});var WC=m((ofe,$C)=>{"use strict";var mr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},HC=Object.create(null);for(let t in mr)Object.hasOwn(mr,t)&&(HC[mr[t]]=t);var Fe={to:{},get:{}};Fe.get=function(t){let e=t.slice(0,3).toLowerCase(),r,n;switch(e){case"hsl":{r=Fe.get.hsl(t),n="hsl";break}case"hwb":{r=Fe.get.hwb(t),n="hwb";break}default:{r=Fe.get.rgb(t),n="rgb";break}}return r?{model:n,value:r}:null};Fe.get.rgb=function(t){if(!t)return null;let e=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,o=[0,0,0,1],a,c,l;if(a=t.match(r)){for(l=a[2],a=a[1],c=0;c<3;c++){let h=c*2;o[c]=Number.parseInt(a.slice(h,h+2),16)}l&&(o[3]=Number.parseInt(l,16)/255)}else if(a=t.match(e)){for(a=a[1],l=a[3],c=0;c<3;c++)o[c]=Number.parseInt(a[c]+a[c],16);l&&(o[3]=Number.parseInt(l+l,16)/255)}else if(a=t.match(n)){for(c=0;c<3;c++)o[c]=Number.parseInt(a[c+1],10);a[4]&&(o[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=t.match(i)){for(c=0;c<3;c++)o[c]=Math.round(Number.parseFloat(a[c+1])*2.55);a[4]&&(o[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=t.match(s))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(mr,a[1])?(o=mr[a[1]],o[3]=1,o):null:null;for(c=0;c<3;c++)o[c]=Tn(o[c],0,255);return o[3]=Tn(o[3],0,1),o};Fe.get.hsl=function(t){if(!t)return null;let e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=Tn(Number.parseFloat(r[2]),0,100),o=Tn(Number.parseFloat(r[3]),0,100),a=Tn(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};Fe.get.hwb=function(t){if(!t)return null;let e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,r=t.match(e);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=Tn(Number.parseFloat(r[2]),0,100),o=Tn(Number.parseFloat(r[3]),0,100),a=Tn(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};Fe.to.hex=function(...t){return"#"+Ul(t[0])+Ul(t[1])+Ul(t[2])+(t[3]<1?Ul(Math.round(t[3]*255)):"")};Fe.to.rgb=function(...t){return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};Fe.to.rgb.percent=function(...t){let e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"};Fe.to.hsl=function(...t){return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};Fe.to.hwb=function(...t){let e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"};Fe.to.keyword=function(...t){return HC[t.slice(0,3)]};function Tn(t,e,r){return Math.min(Math.max(e,t),r)}function Ul(t){let e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}var zC={};for(let t of Object.keys(mr))zC[mr[t]]=t;var D={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Vr=(6/29)**3;function rs(t){let e=t>.0031308?1.055*t**.4166666666666667-.055:t*12.92;return Math.min(Math.max(0,e),1)}function ns(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(let t of Object.keys(D)){if(!("channels"in D[t]))throw new Error("missing channels property: "+t);if(!("labels"in D[t]))throw new Error("missing channel labels property: "+t);if(D[t].labels.length!==D[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=D[t];delete D[t].channels,delete D[t].labels,Object.defineProperty(D[t],"channels",{value:e}),Object.defineProperty(D[t],"labels",{value:r})}D.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),s=Math.max(e,r,n),o=s-i,a,c;switch(s){case i:{a=0;break}case e:{a=(r-n)/o;break}case r:{a=2+(n-e)/o;break}case n:{a=4+(e-r)/o;break}}a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+s)/2;return s===i?c=0:l<=.5?c=o/(s+i):c=o/(2-s-i),[a,c*100,l*100]};D.rgb.hsv=function(t){let e,r,n,i,s,o=t[0]/255,a=t[1]/255,c=t[2]/255,l=Math.max(o,a,c),h=l-Math.min(o,a,c),d=function(f){return(l-f)/6/h+1/2};if(h===0)i=0,s=0;else{switch(s=h/l,e=d(o),r=d(a),n=d(c),l){case o:{i=n-r;break}case a:{i=1/3+e-n;break}case c:{i=2/3+r-e;break}}i<0?i+=1:i>1&&(i-=1)}return[i*360,s*100,l*100]};D.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=D.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,s*100,n*100]};D.rgb.oklab=function(t){let e=ns(t[0]/255),r=ns(t[1]/255),n=ns(t[2]/255),i=Math.cbrt(.4122214708*e+.5363325363*r+.0514459929*n),s=Math.cbrt(.2119034982*e+.6806995451*r+.1073969566*n),o=Math.cbrt(.0883024619*e+.2817188376*r+.6299787005*n),a=.2104542553*i+.793617785*s-.0040720468*o,c=1.9779984951*i-2.428592205*s+.4505937099*o,l=.0259040371*i+.7827717662*s-.808675766*o;return[a*100,c*100,l*100]};D.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),s=(1-e-i)/(1-i)||0,o=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function m5(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}D.rgb.keyword=function(t){let e=zC[t];if(e)return e;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(mr)){let s=mr[i],o=m5(t,s);o<r&&(r=o,n=i)}return n};D.keyword.rgb=function(t){return mr[t]};D.rgb.xyz=function(t){let e=ns(t[0]/255),r=ns(t[1]/255),n=ns(t[2]/255),i=e*.4124564+r*.3575761+n*.1804375,s=e*.2126729+r*.7151522+n*.072175,o=e*.0193339+r*.119192+n*.9503041;return[i*100,s*100,o*100]};D.rgb.lab=function(t){let e=D.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>Vr?r**(1/3):7.787*r+16/116,n=n>Vr?n**(1/3):7.787*n+16/116,i=i>Vr?i**(1/3):7.787*i+16/116;let s=116*n-16,o=500*(r-n),a=200*(n-i);return[s,o,a]};D.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,s;if(r===0)return s=n*255,[s,s,s];let o=n<.5?n*(1+r):n+r-n*r,a=2*n-o,c=[0,0,0];for(let l=0;l<3;l++)i=e+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?s=a+(o-a)*6*i:2*i<1?s=o:3*i<2?s=a+(o-a)*(2/3-i)*6:s=a,c[l]=s*255;return c};D.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,s=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s;let o=(n+r)/2,a=n===0?2*i/(s+i):2*r/(n+r);return[e,a*100,o*100]};D.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,s=e-Math.floor(e),o=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,c,o];case 1:return[a,n,o];case 2:return[o,n,c];case 3:return[o,a,n];case 4:return[c,o,n];case 5:return[n,o,a]}};D.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),s,o;o=(2-r)*n;let a=(2-r)*i;return s=r*i,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};D.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,s;i>1&&(r/=i,n/=i);let o=Math.floor(6*e),a=1-n;s=6*e-o,o&1&&(s=1-s);let c=r+s*(a-r),l,h,d;switch(o){default:case 6:case 0:{l=a,h=c,d=r;break}case 1:{l=c,h=a,d=r;break}case 2:{l=r,h=a,d=c;break}case 3:{l=r,h=c,d=a;break}case 4:{l=c,h=r,d=a;break}case 5:{l=a,h=r,d=c;break}}return[l*255,h*255,d*255]};D.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,s=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};D.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,s,o;return i=e*3.2404542+r*-1.5371385+n*-.4985314,s=e*-.969266+r*1.8760108+n*.041556,o=e*.0556434+r*-.2040259+n*1.0572252,i=rs(i),s=rs(s),o=rs(o),[i*255,s*255,o*255]};D.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>Vr?e**(1/3):7.787*e+16/116,r=r>Vr?r**(1/3):7.787*r+16/116,n=n>Vr?n**(1/3):7.787*n+16/116;let i=116*r-16,s=500*(e-r),o=200*(r-n);return[i,s,o]};D.xyz.oklab=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=Math.cbrt(.8189330101*e+.3618667424*r-.1288597137*n),s=Math.cbrt(.0329845436*e+.9293118715*r+.0361456387*n),o=Math.cbrt(.0482003018*e+.2643662691*r+.633851707*n),a=.2104542553*i+.793617785*s-.0040720468*o,c=1.9779984951*i-2.428592205*s+.4505937099*o,l=.0259040371*i+.7827717662*s-.808675766*o;return[a*100,c*100,l*100]};D.oklab.oklch=function(t){return D.lab.lch(t)};D.oklab.xyz=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=(.999999998*e+.396337792*r+.215803758*n)**3,s=(1.000000008*e-.105561342*r-.063854175*n)**3,o=(1.000000055*e-.089484182*r-1.291485538*n)**3,a=1.227013851*i-.55779998*s+.281256149*o,c=-.040580178*i+1.11225687*s-.071676679*o,l=-.076381285*i-.421481978*s+1.58616322*o;return[a*100,c*100,l*100]};D.oklab.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=(e+.3963377774*r+.2158037573*n)**3,s=(e-.1055613458*r-.0638541728*n)**3,o=(e-.0894841775*r-1.291485548*n)**3,a=rs(4.0767416621*i-3.3077115913*s+.2309699292*o),c=rs(-1.2684380046*i+2.6097574011*s-.3413193965*o),l=rs(-.0041960863*i-.7034186147*s+1.707614701*o);return[a*255,c*255,l*255]};D.oklch.oklab=function(t){return D.lch.lab(t)};D.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,s,o;s=(e+16)/116,i=r/500+s,o=s-n/200;let a=s**3,c=i**3,l=o**3;return s=a>Vr?a:(s-16/116)/7.787,i=c>Vr?c:(i-16/116)/7.787,o=l>Vr?l:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};D.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(r*r+n*n);return[e,o,i]};D.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,s=r*Math.cos(i),o=r*Math.sin(i);return[e,s,o]};D.rgb.ansi16=function(t,e=null){let[r,n,i]=t,s=e===null?D.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return s===2&&(o+=60),o};D.hsv.ansi16=function(t){return D.rgb.ansi16(D.hsv.rgb(t),t[2])};D.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e>>4===r>>4&&r>>4===n>>4?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)};D.ansi16.rgb=function(t){t=t[0];let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(Math.trunc(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,s=(e>>2&1)*r*255;return[n,i,s]};D.ansi256.rgb=function(t){if(t=t[0],t>=232){let s=(t-232)*10+8;return[s,s,s]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};D.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};D.hex.rgb=function(t){let e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=[...r].map(a=>a+a).join(""));let n=Number.parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};D.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),s=Math.min(Math.min(e,r),n),o=i-s,a,c=o<1?s/(1-o):0;return o<=0?a=0:i===e?a=(r-n)/o%6:i===r?a=2+(n-e)/o:a=4+(e-r)/o,a/=6,a%=1,[a*360,o*100,c*100]};D.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};D.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};D.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],s=e%1*6,o=s%1,a=1-o,c=0;switch(Math.floor(s)){case 0:{i[0]=1,i[1]=o,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=o;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=o,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};D.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};D.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};D.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};D.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,s=0;return i<1&&(s=(n-i)/(1-i)),[t[0],i*100,s*100]};D.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};D.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};D.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};D.gray.hsl=function(t){return[0,0,t[0]]};D.gray.hsv=D.gray.hsl;D.gray.hwb=function(t){return[0,100,t[0]]};D.gray.cmyk=function(t){return[0,0,0,t[0]]};D.gray.lab=function(t){return[t[0],0,0]};D.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(n.length)+n};D.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};function g5(){let t={},e=Object.keys(D);for(let{length:r}=e,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function _5(t){let e=g5(),r=[t];for(e[t].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(D[n]);for(let{length:s}=i,o=0;o<s;o++){let a=i[o],c=e[a];c.distance===-1&&(c.distance=e[n].distance+1,c.parent=n,r.unshift(a))}}return e}function E5(t,e){return function(r){return e(t(r))}}function S5(t,e){let r=[e[t].parent,t],n=D[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=E5(D[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}function T5(t){let e=_5(t),r={},n=Object.keys(e);for(let{length:i}=n,s=0;s<i;s++){let o=n[s];e[o].parent!==null&&(r[o]=S5(o,e))}return r}var qe={},y5=Object.keys(D);function v5(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function A5(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let{length:s}=i,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}for(let t of y5){qe[t]={},Object.defineProperty(qe[t],"channels",{value:D[t].channels}),Object.defineProperty(qe[t],"labels",{value:D[t].labels});let e=T5(t),r=Object.keys(e);for(let n of r){let i=e[n];qe[t][n]=A5(i),qe[t][n].raw=v5(i)}}var jC=["keyword","gray","hex"],Sm={};for(let t of Object.keys(qe))Sm[[...qe[t].labels].sort().join("")]=t;var Tm={};function ke(t,e){if(!(this instanceof ke))return new ke(t,e);if(e&&e in jC&&(e=null),e&&!(e in qe))throw new Error("Unknown model: "+e);let r,n;if(t==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof ke)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if(typeof t=="string"){let i=Fe.get(t);if(i===null)throw new Error("Unable to parse color from string: "+t);this.model=i.model,n=qe[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(t.length>0){this.model=e||"rgb",n=qe[this.model].channels;let i=Array.prototype.slice.call(t,0,n);this.color=ym(i,n),this.valpha=typeof t[n]=="number"?t[n]:1}else if(typeof t=="number")this.model="rgb",this.color=[t>>16&255,t>>8&255,t&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(t);"alpha"in t&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof t.alpha=="number"?t.alpha:0);let s=i.sort().join("");if(!(s in Sm))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Sm[s];let{labels:o}=qe[this.model],a=[];for(r=0;r<o.length;r++)a.push(t[o[r]]);this.color=ym(a)}if(Tm[this.model])for(n=qe[this.model].channels,r=0;r<n;r++){let i=Tm[this.model][r];i&&(this.color[r]=i(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ke.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(t){let e=this.model in Fe.to?this:this.rgb();e=e.round(typeof t=="number"?t:1);let r=e.valpha===1?e.color:[...e.color,this.valpha];return Fe.to[e.model](...r)},percentString(t){let e=this.rgb().round(typeof t=="number"?t:1),r=e.valpha===1?e.color:[...e.color,this.valpha];return Fe.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let t={},{channels:e}=qe[this.model],{labels:r}=qe[this.model];for(let n=0;n<e;n++)t[r[n]]=this.color[n];return this.valpha!==1&&(t.alpha=this.valpha),t},unitArray(){let t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,this.valpha!==1&&t.push(this.valpha),t},unitObject(){let t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,this.valpha!==1&&(t.alpha=this.valpha),t},round(t){return t=Math.max(t||0,0),new ke([...this.color.map(R5(t)),this.valpha],this.model)},alpha(t){return t!==void 0?new ke([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},red:Ce("rgb",0,Ue(255)),green:Ce("rgb",1,Ue(255)),blue:Ce("rgb",2,Ue(255)),hue:Ce(["hsl","hsv","hsl","hwb","hcg"],0,t=>(t%360+360)%360),saturationl:Ce("hsl",1,Ue(100)),lightness:Ce("hsl",2,Ue(100)),saturationv:Ce("hsv",1,Ue(100)),value:Ce("hsv",2,Ue(100)),chroma:Ce("hcg",1,Ue(100)),gray:Ce("hcg",2,Ue(100)),white:Ce("hwb",1,Ue(100)),wblack:Ce("hwb",2,Ue(100)),cyan:Ce("cmyk",0,Ue(100)),magenta:Ce("cmyk",1,Ue(100)),yellow:Ce("cmyk",2,Ue(100)),black:Ce("cmyk",3,Ue(100)),x:Ce("xyz",0,Ue(95.047)),y:Ce("xyz",1,Ue(100)),z:Ce("xyz",2,Ue(108.833)),l:Ce("lab",0,Ue(100)),a:Ce("lab",1),b:Ce("lab",2),keyword(t){return t!==void 0?new ke(t):qe[this.model].keyword(this.color)},hex(t){return t!==void 0?new ke(t):Fe.to.hex(...this.rgb().round().color)},hexa(t){if(t!==void 0)return new ke(t);let e=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),Fe.to.hex(...e)+r},rgbNumber(){let t=this.rgb().color;return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255},luminosity(){let t=this.rgb().color,e=[];for(let[r,n]of t.entries()){let i=n/255;e[r]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(t){let e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level(t){let e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){let t=this.rgb().color;return(t[0]*2126+t[1]*7152+t[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let t=this.rgb();for(let e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten(t){let e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){let e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate(t){let e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate(t){let e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten(t){let e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken(t){let e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale(){let t=this.rgb().color,e=t[0]*.3+t[1]*.59+t[2]*.11;return ke.rgb(e,e,e)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){let e=this.hsl(),r=e.color[0];return r=(r+t)%360,r=r<0?360+r:r,e.color[0]=r,e},mix(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);let r=t.rgb(),n=this.rgb(),i=e===void 0?.5:e,s=2*i-1,o=r.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,c=1-a;return ke.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let t of Object.keys(qe)){if(jC.includes(t))continue;let{channels:e}=qe[t];ke.prototype[t]=function(...r){return this.model===t?new ke(this):r.length>0?new ke(r,t):new ke([...O5(qe[this.model][t].raw(this.color)),this.valpha],t)},ke[t]=function(...r){let n=r[0];return typeof n=="number"&&(n=ym(r,e)),new ke(n,t)}}function C5(t,e){return Number(t.toFixed(e))}function R5(t){return function(e){return C5(e,t)}}function Ce(t,e,r){t=Array.isArray(t)?t:[t];for(let n of t)(Tm[n]||=[])[e]=r;return t=t[0],function(n){let i;return n!==void 0?(r&&(n=r(n)),i=this[t](),i.color[e]=n,i):(i=this[t]().color[e],r&&(i=r(i)),i)}}function Ue(t){return function(e){return Math.max(0,Math.min(t,e))}}function O5(t){return Array.isArray(t)?t:[t]}function ym(t,e){for(let r=0;r<e;r++)typeof t[r]!="number"&&(t[r]=0);return t}function b5(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var M5=function(e){for(var r=0,n=0;r<e.length;n=e.charCodeAt(r++)+((n<<5)-n));var i=Math.floor(Math.abs(Math.sin(n)*1e4%1*16777216)).toString(16);return"#"+Array(6-i.length+1).join("0")+i},GC=b5(M5);function N5(t,e){let r=t.split(e||":"),n=GC(r[0]);if(!r.length)return n;for(let i=0,s=r.length-1;i<s;i++)n=ke(n).mix(ke(GC(r[i+1]))).saturate(1).hex();return n}$C.exports=N5});var KC=m((afe,YC)=>{"use strict";function jt(t,e){if(e)return new jt(t).style(e);if(!(this instanceof jt))return new jt(t);this.text=t}jt.prototype.prefix="\x1B[";jt.prototype.suffix="m";jt.prototype.hex=function(e){e=e[0]==="#"?e.substring(1):e,e.length===3&&(e=e.split(""),e[5]=e[2],e[4]=e[2],e[3]=e[1],e[2]=e[1],e[1]=e[0],e=e.join(""));var r=e.substring(0,2),n=e.substring(2,4),i=e.substring(4,6);return[parseInt(r,16),parseInt(n,16),parseInt(i,16)]};jt.prototype.rgb=function(e,r,n){var i=e/255*5,s=r/255*5,o=n/255*5;return this.ansi(i,s,o)};jt.prototype.ansi=function(e,r,n){var i=Math.round(e),s=Math.round(r),o=Math.round(n);return 16+i*36+s*6+o};jt.prototype.reset=function(){return this.prefix+"39;49"+this.suffix};jt.prototype.style=function(e){return this.prefix+"38;5;"+this.rgb.apply(this,this.hex(e))+this.suffix+this.text+this.reset()};YC.exports=jt});var JC=m((cfe,XC)=>{"use strict";var w5=WC(),P5=KC();XC.exports=function(e,r){var n=r.namespace,i=r.colors!==!1?P5(n+":",w5(n)):n+":";return e[0]=i+" "+e[0],e}});var ZC=m((lfe,QC)=>{"use strict";QC.exports=function(e,r){if(!r)return!1;for(var n=r.split(/[\s,]+/),i=0;i<n.length;i++){if(r=n[i].replace("*",".*?"),r.charAt(0)==="-"){if(new RegExp("^"+r.substr(1)+"$").test(e))return!1;continue}if(new RegExp("^"+r+"$").test(e))return!0}return!1}});var tR=m((ufe,eR)=>{"use strict";var x5=ZC();eR.exports=function(e){return function(n){try{return x5(n,e())}catch{}return!1}}});var nR=m((hfe,rR)=>{"use strict";var I5=tR();rR.exports=I5(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var sR=m((dfe,iR)=>{"use strict";iR.exports=function(t,e){try{Function.prototype.apply.call(console.log,console,e)}catch{}}});var aR=m((ffe,oR)=>{"use strict";var L5=Em(),D5=L("tty").isatty(1),kl=L5(function t(e,r){return r=r||{},r.colors="colors"in r?r.colors:D5,r.namespace=e,r.prod=!1,r.dev=!0,!t.enabled(e)&&!(r.force||t.force)?t.nope(r):t.yep(r)});kl.modify(JC());kl.use(nR());kl.set(sR());oR.exports=kl});var jo=m((pfe,vm)=>{"use strict";process.env.NODE_ENV==="production"?vm.exports=qC():vm.exports=aR()});var lR=m((mfe,cR)=>{"use strict";var Am=L("fs"),{StringDecoder:U5}=L("string_decoder"),{Stream:k5}=oi();function F5(){}cR.exports=(t,e)=>{let r=Buffer.alloc(65536),n=new U5("utf8"),i=new k5,s="",o=0,a=0;return t.start===-1&&delete t.start,i.readable=!0,i.destroy=()=>{i.destroyed=!0,i.emit("end"),i.emit("close")},Am.open(t.file,"a+","0644",(c,l)=>{if(c){e?e(c):i.emit("error",c),i.destroy();return}(function h(){if(i.destroyed){Am.close(l,F5);return}return Am.read(l,r,0,r.length,o,(d,f)=>{if(d){e?e(d):i.emit("error",d),i.destroy();return}if(!f)return s&&((t.start==null||a>t.start)&&(e?e(null,s):i.emit("line",s)),a++,s=""),setTimeout(h,1e3);let p=n.write(r.slice(0,f));e||i.emit("data",p),p=(s+p).split(/\n+/);let g=p.length-1,S=0;for(;S<g;S++)(t.start==null||a>t.start)&&(e?e(null,p[S]):i.emit("line",p[S])),a++;return s=p[g],o+=f,h()})})()}),e?i.destroy:i}});var fR=m((_fe,dR)=>{"use strict";var mt=L("fs"),Ge=L("path"),uR=bC(),B5=L("zlib"),{MESSAGE:V5}=Pe(),{Stream:q5,PassThrough:hR}=oi(),G5=Qi(),$t=jo()("winston:file"),H5=L("os"),z5=lR();dR.exports=class extends G5{constructor(e={}){super(e),this.name=e.name||"file";function r(n,...i){i.slice(1).forEach(s=>{if(e[s])throw new Error(`Cannot set ${s} and ${n} together`)})}if(this._stream=new hR,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),e.filename||e.dirname)r("filename or dirname","stream"),this._basename=this.filename=e.filename?Ge.basename(e.filename):"winston.log",this.dirname=e.dirname||Ge.dirname(e.filename),this.options=e.options||{flags:"a"};else if(e.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),r("stream","filename","maxsize"),this._dest=this._stream.pipe(this._setupStream(e.stream)),this.dirname=Ge.dirname(this._dest.path);else throw new Error("Cannot log to file without filename or stream.");this.maxsize=e.maxsize||null,this.rotationFormat=e.rotationFormat||!1,this.zippedArchive=e.zippedArchive||!1,this.maxFiles=e.maxFiles||null,this.eol=typeof e.eol=="string"?e.eol:H5.EOL,this.tailable=e.tailable||!1,this.lazy=e.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once("open",()=>{this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())}):(this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())))}_final(e){if(this._opening){this.once("open",()=>this._final(e));return}if(this._stream.end(),!this._dest||this._dest.writableFinished)return e();this._dest.once("finish",e),this._dest.once("error",e)}log(e,r=()=>{}){if(this.silent)return r(),!0;if(this._drain){this._stream.once("drain",()=>{this._drain=!1,this.log(e,r)});return}if(this._rotate){this._stream.once("rotate",()=>{this._rotate=!1,this.log(e,r)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",()=>{this._fileExist=!0,this.log(e,r)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",()=>{this._opening||this.open(),this.once("open",()=>{this.log(e,r)})});return}}let n=`${e[V5]}${this.eol}`,i=Buffer.byteLength(n);function s(){if(this._size+=i,this._pendingSize-=i,$t("logged %s %s",this._size,n),this.emit("logged",e),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit("fileclosed")});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=i,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let o=this._stream.write(n,s.bind(this));return o?r():(this._drain=!0,this._stream.once("drain",()=>{this._drain=!1,r()})),$t("written",o,this._drain),this.finishIfEnding(),o}query(e,r){typeof e=="function"&&(r=e,e={}),e=d(e);let n=Ge.join(this.dirname,this.filename),i="",s=[],o=0,a=mt.createReadStream(n,{encoding:"utf8"});a.on("error",f=>{if(a.readable&&a.destroy(),!!r)return f.code!=="ENOENT"?r(f):r(null,s)}),a.on("data",f=>{f=(i+f).split(/\n+/);let p=f.length-1,g=0;for(;g<p;g++)(!e.start||o>=e.start)&&c(f[g]),o++;i=f[p]}),a.on("close",()=>{i&&c(i,!0),e.order==="desc"&&(s=s.reverse()),r&&r(null,s)});function c(f,p){try{let g=JSON.parse(f);h(g)&&l(g)}catch(g){p||a.emit("error",g)}}function l(f){if(e.rows&&s.length>=e.rows&&e.order!=="desc"){a.readable&&a.destroy();return}e.fields&&(f=e.fields.reduce((p,g)=>(p[g]=f[g],p),{})),e.order==="desc"&&s.length>=e.rows&&s.shift(),s.push(f)}function h(f){if(!f||typeof f!="object")return;let p=new Date(f.timestamp);if(!(e.from&&p<e.from||e.until&&p>e.until||e.level&&e.level!==f.level))return!0}function d(f){return f=f||{},f.rows=f.rows||f.limit||10,f.start=f.start||0,f.until=f.until||new Date,typeof f.until!="object"&&(f.until=new Date(f.until)),f.from=f.from||f.until-24*60*60*1e3,typeof f.from!="object"&&(f.from=new Date(f.from)),f.order=f.order||"desc",f}}stream(e={}){let r=Ge.join(this.dirname,this.filename),n=new q5,i={file:r,start:e.start};return n.destroy=z5(i,(s,o)=>{if(s)return n.emit("error",s);try{n.emit("data",o),o=JSON.parse(o),n.emit("log",o)}catch(a){n.emit("error",a)}}),n}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((e,r)=>{if(e)return this.emit("error",e);$t("stat done: %s { size: %s }",this.filename,r),this._size=r,this._dest=this._createStream(this._stream),this._opening=!1,this.once("open",()=>{this._stream.emit("rotate")||(this._rotate=!1)})})))}stat(e){let r=this._getFile(),n=Ge.join(this.dirname,r);mt.stat(n,(i,s)=>{if(i&&i.code==="ENOENT")return $t("ENOENT\xA0ok",n),this.filename=r,e(null,0);if(i)return $t(`err ${i.code} ${n}`),e(i);if(!s||this._needsNewFile(s.size))return this._incFile(()=>this.stat(e));this.filename=r,e(null,s.size)})}close(e){this._stream&&this._stream.end(()=>{e&&e(),this.emit("flush"),this.emit("closed")})}_needsNewFile(e){return e=e||this._size,this.maxsize&&e>=this.maxsize}_onError(e){this.emit("error",e)}_setupStream(e){return e.on("error",this._onError),e}_cleanupStream(e){return e.removeListener("error",this._onError),e.destroy(),e}_rotateFile(){this._incFile(()=>this.open())}_endStream(e=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),e()})):e()}_createStream(e){let r=Ge.join(this.dirname,this.filename);$t("create stream start",r,this.options);let n=mt.createWriteStream(r,this.options).on("error",i=>$t(i)).on("close",()=>$t("close",n.path,n.bytesWritten)).on("open",()=>{$t("file open ok",r),this.emit("open",r),e.pipe(n),this.rotatedWhileOpening&&(this._stream=new hR,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(n),e.end())});return $t("create stream ok",r),n}_incFile(e){$t("_incFile",this.filename);let r=Ge.extname(this._basename),n=Ge.basename(this._basename,r),i=[];this.zippedArchive&&i.push(function(s){let o=this._created>0&&!this.tailable?this._created:"";this._compressFile(Ge.join(this.dirname,`${n}${o}${r}`),Ge.join(this.dirname,`${n}${o}${r}.gz`),s)}.bind(this)),i.push(function(s){this.tailable?this._checkMaxFilesTailable(r,n,s):(this._created+=1,this._checkMaxFilesIncrementing(r,n,s))}.bind(this)),uR(i,e)}_getFile(){let e=Ge.extname(this._basename),r=Ge.basename(this._basename,e),n=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${r}${n}${e}`:`${r}${e}`}_checkMaxFilesIncrementing(e,r,n){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(n);let i=this._created-this.maxFiles,s=i!==0?i:"",o=this.zippedArchive?".gz":"",a=`${r}${s}${e}${o}`,c=Ge.join(this.dirname,a);mt.unlink(c,n)}_checkMaxFilesTailable(e,r,n){let i=[];if(!this.maxFiles)return;let s=this.zippedArchive?".gz":"";for(let o=this.maxFiles-1;o>1;o--)i.push(function(a,c){let l=`${r}${a-1}${e}${s}`,h=Ge.join(this.dirname,l);mt.exists(h,d=>{if(!d)return c(null);l=`${r}${a}${e}${s}`,mt.rename(h,Ge.join(this.dirname,l),c)})}.bind(this,o));uR(i,()=>{mt.rename(Ge.join(this.dirname,`${r}${e}${s}`),Ge.join(this.dirname,`${r}1${e}${s}`),n)})}_compressFile(e,r,n){mt.access(e,mt.F_OK,i=>{if(i)return n();var s=B5.createGzip(),o=mt.createReadStream(e),a=mt.createWriteStream(r);a.on("finish",()=>{mt.unlink(e,n)}),o.pipe(s).pipe(a)})}_createLogDirIfNotExist(e){mt.existsSync(e)||mt.mkdirSync(e,{recursive:!0})}}});var mR=m((Sfe,pR)=>{"use strict";var j5=L("http"),$5=L("https"),{Stream:W5}=oi(),Y5=Qi(),{configure:K5}=Mo();pR.exports=class extends Y5{constructor(e={}){super(e),this.options=e,this.name=e.name||"http",this.ssl=!!e.ssl,this.host=e.host||"localhost",this.port=e.port,this.auth=e.auth,this.path=e.path||"",this.maximumDepth=e.maximumDepth,this.agent=e.agent,this.headers=e.headers||{},this.headers["content-type"]="application/json",this.batch=e.batch||!1,this.batchInterval=e.batchInterval||5e3,this.batchCount=e.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||(this.port=this.ssl?443:80)}log(e,r){this._request(e,null,null,(n,i)=>{i&&i.statusCode!==200&&(n=new Error(`Invalid HTTP Status Code: ${i.statusCode}`)),n?this.emit("warn",n):this.emit("logged",e)}),r&&setImmediate(r)}query(e,r){typeof e=="function"&&(r=e,e={}),e={method:"query",params:this.normalizeQuery(e)};let n=e.params.auth||null;delete e.params.auth;let i=e.params.path||null;delete e.params.path,this._request(e,n,i,(s,o,a)=>{if(o&&o.statusCode!==200&&(s=new Error(`Invalid HTTP Status Code: ${o.statusCode}`)),s)return r(s);if(typeof a=="string")try{a=JSON.parse(a)}catch(c){return r(c)}r(null,a)})}stream(e={}){let r=new W5;e={method:"stream",params:e};let n=e.params.path||null;delete e.params.path;let i=e.params.auth||null;delete e.params.auth;let s="",o=this._request(e,i,n);return r.destroy=()=>o.destroy(),o.on("data",a=>{a=(s+a).split(/\n+/);let c=a.length-1,l=0;for(;l<c;l++)try{r.emit("log",JSON.parse(a[l]))}catch(h){r.emit("error",h)}s=a[c]}),o.on("error",a=>r.emit("error",a)),r}_request(e,r,n,i){e=e||{},r=r||this.auth,n=n||this.path||"",this.batch?this._doBatch(e,i,r,n):this._doRequest(e,i,r,n)}_doBatch(e,r,n,i){if(this.batchOptions.push(e),this.batchOptions.length===1){let s=this;this.batchCallback=r,this.batchTimeoutID=setTimeout(function(){s.batchTimeoutID=-1,s._doBatchRequest(s.batchCallback,n,i)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,n,i)}_doBatchRequest(e,r,n){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let i=this.batchOptions.slice();this.batchOptions=[],this._doRequest(i,e,r,n)}_doRequest(e,r,n,i){let s=Object.assign({},this.headers);n&&n.bearer&&(s.Authorization=`Bearer ${n.bearer}`);let o=(this.ssl?$5:j5).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${i.replace(/^\//,"")}`,headers:s,auth:n&&n.username&&n.password?`${n.username}:${n.password}`:"",agent:this.agent});o.on("error",r),o.on("response",c=>c.on("end",()=>r(null,c)).resume());let a=K5({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});o.end(Buffer.from(a(e,this.options.replacer),"utf8"))}}});var Cm=m((Tfe,gR)=>{"use strict";var gr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";gr.writable=t=>gr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";gr.readable=t=>gr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";gr.duplex=t=>gr.writable(t)&&gr.readable(t);gr.transform=t=>gr.duplex(t)&&typeof t._transform=="function";gR.exports=gr});var ER=m((vfe,_R)=>{"use strict";var X5=Cm(),{MESSAGE:J5}=Pe(),Q5=L("os"),Z5=Qi();_R.exports=class extends Z5{constructor(e={}){if(super(e),!e.stream||!X5(e.stream))throw new Error("options.stream is required.");this._stream=e.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=e.stream._writableState.objectMode,this.eol=typeof e.eol=="string"?e.eol:Q5.EOL}log(e,r){if(setImmediate(()=>this.emit("logged",e)),this.isObjectMode){this._stream.write(e),r&&r();return}this._stream.write(`${e[J5]}${this.eol}`),r&&r()}}});var SR=m($o=>{"use strict";Object.defineProperty($o,"Console",{configurable:!0,enumerable:!0,get(){return jA()}});Object.defineProperty($o,"File",{configurable:!0,enumerable:!0,get(){return fR()}});Object.defineProperty($o,"Http",{configurable:!0,enumerable:!0,get(){return mR()}});Object.defineProperty($o,"Stream",{configurable:!0,enumerable:!0,get(){return ER()}})});var Bl=m(Wo=>{"use strict";var Fl=Op(),{configs:Rm}=Pe();Wo.cli=Fl.levels(Rm.cli);Wo.npm=Fl.levels(Rm.npm);Wo.syslog=Fl.levels(Rm.syslog);Wo.addColors=Fl.levels});var yR=m((Vl,TR)=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var e6=El(),t6=ai(e6),r6=Ml(),n6=ai(r6),i6=lm(),s6=ai(i6),o6=om(),a6=ai(o6),c6=am(),l6=ai(c6),u6=si(),h6=ai(u6),d6=es(),f6=ai(d6);function ai(t){return t&&t.__esModule?t:{default:t}}function p6(t,e,r){r=(0,a6.default)(r);var n=0,i=0,{length:s}=t,o=!1;s===0&&r(null);function a(c,l){c===!1&&(o=!0),o!==!0&&(c?r(c):(++i===s||l===n6.default)&&r(null))}for(;n<s;n++)e(t[n],n,(0,l6.default)(a))}function m6(t,e,r){return(0,s6.default)(t,1/0,e,r)}function g6(t,e,r){var n=(0,t6.default)(t)?p6:m6;return n(t,(0,h6.default)(e),r)}Vl.default=(0,f6.default)(g6,3);TR.exports=Vl.default});var AR=m((ql,vR)=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.default=_6;function _6(t){return(e,r,n)=>t(e,n)}vR.exports=ql.default});var zl=m((Hl,CR)=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var E6=yR(),S6=Gl(E6),T6=AR(),y6=Gl(T6),v6=si(),A6=Gl(v6),C6=es(),R6=Gl(C6);function Gl(t){return t&&t.__esModule?t:{default:t}}function O6(t,e,r){return(0,S6.default)(t,(0,y6.default)((0,A6.default)(e)),r)}Hl.default=(0,R6.default)(O6,3);CR.exports=Hl.default});var OR=m((Rfe,RR)=>{"use strict";var b6=Object.prototype.toString;RR.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),n=b6.call(e).slice(8,-1);return n==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=n,r||"anonymous"}});var Om=m((Ofe,bR)=>{"use strict";var M6=OR();bR.exports=function(e){var r=0,n;function i(){return r||(r=1,n=e.apply(this,arguments),e=null),n}return i.displayName=M6(e),i}});var bm=m(Ko=>{"use strict";Ko.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},n=Error.prepareStackTrace;Error.prepareStackTrace=function(s,o){return o},Error.captureStackTrace(r,t||Ko.get);var i=r.stack;return Error.prepareStackTrace=n,Error.stackTraceLimit=e,i};Ko.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
|
|
29
|
-
`).slice(1);return r.map(function(n){if(n.match(/^\s*[-]{4,}$/))return e._createParsedCallSite({fileName:n,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=n.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var s=null,o=null,a=null,c=null,l=null,h=i[5]==="native";if(i[1]){a=i[1];var d=a.lastIndexOf(".");if(a[d-1]=="."&&d--,d>0){s=a.substr(0,d),o=a.substr(d+1);var f=s.indexOf(".Module");f>0&&(a=a.substr(f+1),s=s.substr(0,f))}c=null}o&&(c=s,l=o),o==="<anonymous>"&&(l=null,a=null);var p={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:a,typeName:c,methodName:l,columnNumber:parseInt(i[4],10)||null,native:h};return e._createParsedCallSite(p)}}).filter(function(n){return!!n})};function Yo(t){for(var e in t)this[e]=t[e]}var N6=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],w6=["topLevel","eval","native","constructor"];N6.forEach(function(t){Yo.prototype[t]=null,Yo.prototype["get"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});w6.forEach(function(t){Yo.prototype[t]=!1,Yo.prototype["is"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});Ko._createParsedCallSite=function(t){return new Yo(t)}});var NR=m((Nfe,MR)=>{"use strict";var{Writable:P6}=oi();MR.exports=class extends P6{constructor(e){if(super({objectMode:!0}),!e)throw new Error("ExceptionStream requires a TransportStream instance.");this.handleExceptions=!0,this.transport=e}_write(e,r,n){return e.exception?this.transport.log(e,n):(n(),!0)}}});var Nm=m((Pfe,xR)=>{"use strict";var wR=L("os"),x6=zl(),Mm=jo()("winston:exception"),I6=Om(),PR=bm(),L6=NR();xR.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle exceptions");this.logger=e,this.handlers=new Map}handle(...e){e.forEach(r=>{if(Array.isArray(r))return r.forEach(n=>this._addHandler(n));this._addHandler(r)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on("uncaughtException",this.catcher))}unhandle(){this.catcher&&(process.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let r=null;return e&&(r=typeof e=="string"?e:e.message),{error:e,level:"error",message:[`uncaughtException: ${r||"(no error message)"}`,e&&e.stack||" No stack trace"].join(`
|
|
30
|
-
`),stack:e&&e.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:wR.loadavg(),uptime:wR.uptime()}}getTrace(e){return(e?PR.parse(e):PR.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleExceptions=!0;let r=new L6(e);this.handlers.set(e,r),this.logger.pipe(r)}}_uncaughtException(e){let r=this.getAllInfo(e),n=this._getExceptionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(e):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function o(){Mm("doExit",i),Mm("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(o);x6(n,(a,c)=>{let l=I6(c),h=a.transport||a;function d(f){return()=>{Mm(f),l()}}h._ending=!0,h.once("finish",d("finished")),h.once("error",d("error"))},()=>i&&o()),this.logger.log(r),i&&(s=setTimeout(o,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleExceptions)}}});var LR=m((Ife,IR)=>{"use strict";var{Writable:D6}=oi();IR.exports=class extends D6{constructor(e){if(super({objectMode:!0}),!e)throw new Error("RejectionStream requires a TransportStream instance.");this.handleRejections=!0,this.transport=e}_write(e,r,n){return e.rejection?this.transport.log(e,n):(n(),!0)}}});var Pm=m((Dfe,kR)=>{"use strict";var DR=L("os"),U6=zl(),wm=jo()("winston:rejection"),k6=Om(),UR=bm(),F6=LR();kR.exports=class{constructor(e){if(!e)throw new Error("Logger is required to handle rejections");this.logger=e,this.handlers=new Map}handle(...e){e.forEach(r=>{if(Array.isArray(r))return r.forEach(n=>this._addHandler(n));this._addHandler(r)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let r=null;return e&&(r=typeof e=="string"?e:e.message),{error:e,level:"error",message:[`unhandledRejection: ${r||"(no error message)"}`,e&&e.stack||" No stack trace"].join(`
|
|
31
|
-
`),stack:e&&e.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:DR.loadavg(),uptime:DR.uptime()}}getTrace(e){return(e?UR.parse(e):UR.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleRejections=!0;let r=new F6(e);this.handlers.set(e,r),this.logger.pipe(r)}}_unhandledRejection(e){let r=this.getAllInfo(e),n=this._getRejectionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(e):this.logger.exitOnError,s;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function o(){wm("doExit",i),wm("process._exiting",process._exiting),i&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(o);U6(n,(a,c)=>{let l=k6(c),h=a.transport||a;function d(f){return()=>{wm(f),l()}}h._ending=!0,h.once("finish",d("finished")),h.once("error",d("error"))},()=>i&&o()),this.logger.log(r),i&&(s=setTimeout(o,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleRejections)}}});var BR=m((Ufe,FR)=>{"use strict";var xm=class{constructor(e){let r=jl();if(typeof e!="object"||Array.isArray(e)||!(e instanceof r))throw new Error("Logger is required for profiling");this.logger=e,this.start=Date.now()}done(...e){typeof e[e.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),e.pop());let r=typeof e[e.length-1]=="object"?e.pop():{};return r.level=r.level||"info",r.durationMs=Date.now()-this.start,this.logger.write(r)}};FR.exports=xm});var jl=m((kfe,HR)=>{"use strict";var{Stream:B6,Transform:V6}=oi(),VR=zl(),{LEVEL:_r,SPLAT:qR}=Pe(),GR=Cm(),q6=Nm(),G6=Pm(),H6=nm(),z6=BR(),{warn:j6}=bp(),$6=Bl(),W6=/%[scdjifoO%]/g,$l=class extends V6{constructor(e){super({objectMode:!0}),this.configure(e)}child(e){let r=this;return Object.create(r,{write:{value:function(n){let i=Object.assign({},e,n);n instanceof Error&&(i.stack=n.stack,i.message=n.message,i.cause=n.cause),r.write(i)}}})}configure({silent:e,format:r,defaultMeta:n,levels:i,level:s="info",exitOnError:o=!0,transports:a,colors:c,emitErrs:l,formatters:h,padLevels:d,rewriters:f,stripColors:p,exceptionHandlers:g,rejectionHandlers:S}={}){if(this.transports.length&&this.clear(),this.silent=e,this.format=r||this.format||Tp()(),this.defaultMeta=n||null,this.levels=i||this.levels||$6.npm.levels,this.level=s,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new q6(this),this.rejections=new G6(this),this.profilers={},this.exitOnError=o,a&&(a=Array.isArray(a)?a:[a],a.forEach(A=>this.add(A))),c||l||h||d||f||p)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
32
|
-
`));g&&this.exceptions.handle(g),S&&this.rejections.handle(S)}getHighestLogLevel(){let e=Xo(this.levels,this.level);return!this.transports||this.transports.length===0?e:this.transports.reduce((r,n)=>{let i=Xo(this.levels,n.level);return i!==null&&i>r?i:r},e)}isLevelEnabled(e){let r=Xo(this.levels,e);if(r===null)return!1;let n=Xo(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=r:this.transports.findIndex(s=>{let o=Xo(this.levels,s.level);return o===null&&(o=n),o>=r})!==-1}log(e,r,...n){if(arguments.length===1)return e[_r]=e.level,this._addDefaultMeta(e),this.write(e),this;if(arguments.length===2)return r&&typeof r=="object"?(r[_r]=r.level=e,this._addDefaultMeta(r),this.write(r),this):(r={[_r]:e,level:e,message:r},this._addDefaultMeta(r),this.write(r),this);let[i]=n;if(typeof i=="object"&&i!==null&&!(r&&r.match&&r.match(W6))){let o=Object.assign({},this.defaultMeta,i,{[_r]:e,[qR]:n,level:e,message:r});return i.message&&(o.message=`${o.message} ${i.message}`),i.stack&&(o.stack=i.stack),i.cause&&(o.cause=i.cause),this.write(o),this}return this.write(Object.assign({},this.defaultMeta,{[_r]:e,[qR]:n,level:e,message:r})),this}_transform(e,r,n){if(this.silent)return n();e[_r]||(e[_r]=e.level),!this.levels[e[_r]]&&this.levels[e[_r]]!==0&&console.error("[winston] Unknown logger level: %s",e[_r]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",e);try{this.push(this.format.transform(e,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(e){let r=this.transports.slice();VR(r,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},e)}add(e){let r=!GR(e)||e.log.length>2?new H6({transport:e}):e;if(!r._writableState||!r._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",r),this._onEvent("warn",r),this.pipe(r),e.handleExceptions&&this.exceptions.handle(),e.handleRejections&&this.rejections.handle(),this}remove(e){if(!e)return this;let r=e;return(!GR(e)||e.log.length>2)&&(r=this.transports.filter(n=>n.transport===e)[0]),r&&this.unpipe(r),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){j6.deprecated("setLevels")}query(e,r){typeof e=="function"&&(r=e,e={}),e=e||{};let n={},i=Object.assign({},e.query||{});function s(a,c){e.query&&typeof a.formatQuery=="function"&&(e.query=a.formatQuery(i)),a.query(e,(l,h)=>{if(l)return c(l);typeof a.formatResults=="function"&&(h=a.formatResults(h,e.format)),c(null,h)})}function o(a,c){s(a,(l,h)=>{c&&(h=l||h,h&&(n[a.name]=h),c()),c=null})}VR(this.transports.filter(a=>!!a.query),o,()=>r(null,n))}stream(e={}){let r=new B6,n=[];return r._streams=n,r.destroy=()=>{let i=n.length;for(;i--;)n[i].destroy()},this.transports.filter(i=>!!i.stream).forEach(i=>{let s=i.stream(e);s&&(n.push(s),s.on("log",o=>{o.transport=o.transport||[],o.transport.push(i.name),r.emit("log",o)}),s.on("error",o=>{o.transport=o.transport||[],o.transport.push(i.name),r.emit("error",o)}))}),r}startTimer(){return new z6(this)}profile(e,...r){let n=Date.now();if(this.profilers[e]){let i=this.profilers[e];delete this.profilers[e],typeof r[r.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let s=typeof r[r.length-1]=="object"?r.pop():{};return s.level=s.level||"info",s.durationMs=n-i,s.message=s.message||e,this.write(s)}return this.profilers[e]=n,this}handleExceptions(...e){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...e)}unhandleExceptions(...e){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...e)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
33
|
-
`))}_onEvent(e,r){function n(i){e==="error"&&!this.transports.includes(r)&&this.add(r),this.emit(e,i,r)}r["__winston"+e]||(r["__winston"+e]=n.bind(this),r.on(e,r["__winston"+e]))}_addDefaultMeta(e){this.defaultMeta&&Object.assign(e,this.defaultMeta)}};function Xo(t,e){let r=t[e];return!r&&r!==0?null:r}Object.defineProperty($l.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:t}=this._readableState;return Array.isArray(t)?t:[t].filter(Boolean)}});HR.exports=$l});var Im=m((Ffe,zR)=>{"use strict";var{LEVEL:Y6}=Pe(),K6=Bl(),X6=jl(),J6=jo()("winston:create-logger");function Q6(t){return"is"+t.charAt(0).toUpperCase()+t.slice(1)+"Enabled"}zR.exports=function(t={}){t.levels=t.levels||K6.npm.levels;class e extends X6{constructor(i){super(i)}}let r=new e(t);return Object.keys(t.levels).forEach(function(n){if(J6('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}e.prototype[n]=function(...i){let s=this||r;if(i.length===1){let[o]=i,a=o&&o.message&&o||{message:o};return a.level=a[Y6]=n,s._addDefaultMeta(a),s.write(a),this||r}return i.length===0?(s.log(n,""),s):s.log(n,...i)},e.prototype[Q6(n)]=function(){return(this||r).isLevelEnabled(n)}}),r}});var $R=m((Vfe,jR)=>{"use strict";var Z6=Im();jR.exports=class{constructor(e={}){this.loggers=new Map,this.options=e}add(e,r){if(!this.loggers.has(e)){r=Object.assign({},r||this.options);let n=r.transports||this.options.transports;n?r.transports=Array.isArray(n)?n.slice():[n]:r.transports=[];let i=Z6(r);i.on("close",()=>this._delete(e)),this.loggers.set(e,i)}return this.loggers.get(e)}get(e,r){return this.add(e,r)}has(e){return!!this.loggers.has(e)}close(e){if(e)return this._removeLogger(e);this.loggers.forEach((r,n)=>this._removeLogger(n))}_removeLogger(e){if(!this.loggers.has(e))return;this.loggers.get(e).close(),this._delete(e)}_delete(e){this.loggers.delete(e)}}});var YR=m(_e=>{"use strict";var WR=Op(),{warn:Jo}=bp();_e.version=Hv().version;_e.transports=SR();_e.config=Bl();_e.addColors=WR.levels;_e.format=WR.format;_e.createLogger=Im();_e.Logger=jl();_e.ExceptionHandler=Nm();_e.RejectionHandler=Pm();_e.Container=$R();_e.Transport=Qi();_e.loggers=new _e.Container;var Er=_e.createLogger();Object.keys(_e.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(t=>_e[t]=(...e)=>Er[t](...e));Object.defineProperty(_e,"level",{get(){return Er.level},set(t){Er.level=t}});Object.defineProperty(_e,"exceptions",{get(){return Er.exceptions}});Object.defineProperty(_e,"rejections",{get(){return Er.rejections}});["exitOnError"].forEach(t=>{Object.defineProperty(_e,t,{get(){return Er[t]},set(e){Er[t]=e}})});Object.defineProperty(_e,"default",{get(){return{exceptionHandlers:Er.exceptionHandlers,rejectionHandlers:Er.rejectionHandlers,transports:Er.transports}}});Jo.deprecated(_e,"setLevels");Jo.forFunctions(_e,"useFormat",["cli"]);Jo.forProperties(_e,"useFormat",["padLevels","stripColors"]);Jo.forFunctions(_e,"deprecated",["addRewriter","addFilter","clone","extend"]);Jo.forProperties(_e,"deprecated",["emitErrs","levelLength"])});var xe,Wl=T(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(xe||(xe={}))});var j,Re,qr=T(()=>{"use strict";(function(t){t.COUNTER="COUNTER",t.GAUGE="GAUGE",t.HISTOGRAM="HISTOGRAM",t.UP_DOWN_COUNTER="UP_DOWN_COUNTER",t.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",t.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",t.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(j||(j={}));(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(Re||(Re={}))});function Yl(t){let e=Object.keys(t);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(r=>[r,t[r]])))}function JR(t){return`${t.name}:${t.version??""}:${t.schemaUrl??""}`}function yn(t,e){let r,n=new Promise(function(s,o){r=setTimeout(function(){o(new ci("Operation timed out."))},e)});return Promise.race([t,n]).then(i=>(clearTimeout(r),i),i=>{throw clearTimeout(r),i})}function QR(t,e){if(t.size!==e.size)return!1;for(let r of t)if(!e.has(r))return!1;return!0}function ZR(t,e){let r=0,n=t.length-1,i=t.length;for(;n>=r;){let s=r+Math.trunc((n-r)/2);t[s]<e?r=s+1:(i=s,n=s-1)}return i}function eO(t,e){return t.toLowerCase()===e.toLowerCase()}var ci,Sr=T(()=>{"use strict";ci=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var xt,is=T(()=>{"use strict";(function(t){t[t.DROP=0]="DROP",t[t.SUM=1]="SUM",t[t.LAST_VALUE=2]="LAST_VALUE",t[t.HISTOGRAM=3]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(xt||(xt={}))});var Qo,tO=T(()=>{"use strict";is();Qo=class{kind=xt.DROP;createAccumulation(){}merge(e,r){}diff(e,r){}toMetricData(e,r,n,i){}}});function ez(t){let e=t.map(()=>0);return e.push(0),{buckets:{boundaries:t,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var ss,os,rO=T(()=>{"use strict";is();qr();Sr();ss=class{startTime;_boundaries;_recordMinMax;_current;constructor(e,r,n=!0,i=ez(r)){this.startTime=e,this._boundaries=r,this._recordMinMax=n,this._current=i}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let r=ZR(this._boundaries,e);this._current.buckets.counts[r]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},os=class{kind=xt.HISTOGRAM;_boundaries;_recordMinMax;constructor(e,r){this._boundaries=e,this._recordMinMax=r}createAccumulation(e){return new ss(e,this._boundaries,this._recordMinMax)}merge(e,r){let n=e.toPointValue(),i=r.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let h=0;h<s.length;h++)a[h]=s[h]+o[h];let c=1/0,l=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(c=Math.min(n.min,i.min),l=Math.max(n.max,i.max)):n.hasMinMax?(c=n.min,l=n.max):i.hasMinMax&&(c=i.min,l=i.max)),new ss(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:c,max:l})}diff(e,r){let n=e.toPointValue(),i=r.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let c=0;c<s.length;c++)a[c]=o[c]-s[c];return new ss(r.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,r,n,i){return{descriptor:e,aggregationTemporality:r,dataPointType:Re.HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),c=e.type===j.GAUGE||e.type===j.UP_DOWN_COUNTER||e.type===j.OBSERVABLE_GAUGE||e.type===j.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:c?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}}});var Zo,Lm,nO=T(()=>{"use strict";Zo=class t{backing;indexBase;indexStart;indexEnd;constructor(e=new Lm,r=0,n=0,i=0){this.backing=e,this.indexBase=r,this.indexStart=n,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,r)=>this.at(r))}at(e){let r=this.indexBase-this.indexStart;return e<r&&(e+=this.backing.length),e-=r,this.backing.countAt(e)}incrementBucket(e,r){this.backing.increment(e,r)}decrementBucket(e,r){this.backing.decrement(e,r)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let r=1+this.indexEnd-this.indexStart,n=1<<e,i=0,s=0;for(let o=this.indexStart;o<=this.indexEnd;){let a=o%n;a<0&&(a+=n);for(let c=a;c<n&&i<r;c++)this._relocateBucket(s,i),i++,o++;s++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new t(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,r){e!==r&&this.incrementBucket(e,this.backing.emptyBucket(r))}},Lm=class t{_counts;constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,r,n){let i=new Array(e).fill(0);i.splice(n,this._counts.length-r,...this._counts.slice(r)),i.splice(0,r,...this._counts.slice(0,r)),this._counts=i}reverse(e,r){let n=Math.floor((e+r)/2)-e;for(let i=0;i<n;i++){let s=this._counts[e+i];this._counts[e+i]=this._counts[r-i-1],this._counts[r-i-1]=s}}emptyBucket(e){let r=this._counts[e];return this._counts[e]=0,r}increment(e,r){this._counts[e]+=r}decrement(e,r){this._counts[e]>=r?this._counts[e]-=r:this._counts[e]=0}clone(){return new t([...this._counts])}}});function Kl(t){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,t),((e.getUint32(0)&2146435072)>>20)-1023}function Xl(t){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,t);let r=e.getUint32(0),n=e.getUint32(4);return(r&1048575)*Math.pow(2,32)+n}var ea,Dm=T(()=>{"use strict";ea=Math.pow(2,-1022)});function ta(t,e){return t===0||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY||Number.isNaN(t)?t:t*Math.pow(2,e)}function sO(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t}var Jl=T(()=>{"use strict"});var Tr,Ql=T(()=>{"use strict";Tr=class extends Error{}});var Zl,aO=T(()=>{"use strict";Dm();Jl();Ql();Zl=class{_shift;constructor(e){this._shift=-e}mapToIndex(e){if(e<ea)return this._minNormalLowerBoundaryIndex();let r=Kl(e),n=this._rightShift(Xl(e)-1,52);return r+n>>this._shift}lowerBoundary(e){let r=this._minNormalLowerBoundaryIndex();if(e<r)throw new Tr(`underflow: ${e} is < minimum lower boundary: ${r}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new Tr(`overflow: ${e} is > maximum lower boundary: ${n}`);return ta(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=-1022>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return 1023>>this._shift}_rightShift(e,r){return Math.floor(e*Math.pow(2,-r))}}});var eu,cO=T(()=>{"use strict";Dm();Jl();Ql();eu=class{_scale;_scaleFactor;_inverseFactor;constructor(e){this._scale=e,this._scaleFactor=ta(Math.LOG2E,e),this._inverseFactor=ta(Math.LN2,-e)}mapToIndex(e){if(e<=ea)return this._minNormalLowerBoundaryIndex()-1;if(Xl(e)===0)return(Kl(e)<<this._scale)-1;let r=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return r>=n?n:r}lowerBoundary(e){let r=this._maxNormalLowerBoundaryIndex();if(e>=r){if(e===r)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new Tr(`overflow: ${e} is > maximum lower boundary: ${r}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return ea;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new Tr(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return-1022<<this._scale}_maxNormalLowerBoundaryIndex(){return(1024<<this._scale)-1}}});function Fm(t){if(t>uO||t<lO)throw new Tr(`expected scale >= ${lO} && <= ${uO}, got: ${t}`);return rz[t+10]}var lO,uO,rz,hO=T(()=>{"use strict";aO();cO();Ql();lO=-10,uO=20,rz=Array.from({length:31},(t,e)=>e>10?new eu(e-10):new Zl(e-10))});var as,nz,iz,Bm,tu,ra,dO=T(()=>{"use strict";is();qr();Q();nO();hO();Jl();as=class t{static combine(e,r){return new t(Math.min(e.low,r.low),Math.max(e.high,r.high))}low;high;constructor(e,r){this.low=e,this.high=r}},nz=20,iz=160,Bm=2,tu=class t{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(e,r=iz,n=!0,i=0,s=0,o=0,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=new Zo,h=new Zo,d=Fm(nz)){this.startTime=e,this._maxSize=r,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=o,this._min=a,this._max=c,this._positive=l,this._negative=h,this._mapping=d,this._maxSize<Bm&&(P.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${Bm}`),this._maxSize=Bm)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,r){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=r,e===0){this._zeroCount+=r;return}this._sum+=e*r,e>0?this._updateBuckets(this._positive,e,r):this._updateBuckets(this._negative,-e,r)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let r=this._minScale(e);this._downscale(this.scale-r),this._mergeBuckets(this.positive,e,e.positive,r),this._mergeBuckets(this.negative,e,e.negative,r)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let r=this._minScale(e);this._downscale(this.scale-r),this._diffBuckets(this.positive,e,e.positive,r),this._diffBuckets(this.negative,e,e.negative,r)}clone(){return new t(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,r,n){let i=this._mapping.mapToIndex(r),s=!1,o=0,a=0;if(e.length===0?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(s=!0,a=i,o=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(s=!0,a=e.indexStart,o=i),s){let c=this._changeScale(o,a);this._downscale(c),i=this._mapping.mapToIndex(r)}this._incrementIndexBy(e,i,n)}_incrementIndexBy(e,r,n){if(n===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=r),r<e.indexStart){let s=e.indexEnd-r;s>=e.backing.length&&this._grow(e,s+1),e.indexStart=r}else if(r>e.indexEnd){let s=r-e.indexStart;s>=e.backing.length&&this._grow(e,s+1),e.indexEnd=r}let i=r-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,n)}_grow(e,r){let n=e.backing.length,i=e.indexBase-e.indexStart,s=n-i,o=sO(r);o>this._maxSize&&(o=this._maxSize);let a=o-i;e.backing.growTo(o,s,a)}_changeScale(e,r){let n=0;for(;e-r>=this._maxSize;)e>>=1,r>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let r=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=Fm(r)}_minScale(e){let r=Math.min(this.scale,e.scale),n=as.combine(this._highLowAtScale(this.positive,this.scale,r),this._highLowAtScale(e.positive,e.scale,r)),i=as.combine(this._highLowAtScale(this.negative,this.scale,r),this._highLowAtScale(e.negative,e.scale,r));return Math.min(r-this._changeScale(n.high,n.low),r-this._changeScale(i.high,i.low))}_highLowAtScale(e,r,n){if(e.length===0)return new as(0,-1);let i=r-n;return new as(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,r,n,i){let s=n.offset,o=r.scale-i;for(let a=0;a<n.length;a++)this._incrementIndexBy(e,s+a>>o,n.at(a))}_diffBuckets(e,r,n,i){let s=n.offset,o=r.scale-i;for(let a=0;a<n.length;a++){let l=(s+a>>o)-e.indexBase;l<0&&(l+=e.backing.length),e.decrementBucket(l,n.at(a))}e.trim()}},ra=class{kind=xt.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(e,r){this._maxSize=e,this._recordMinMax=r}createAccumulation(e){return new tu(e,this._maxSize,this._recordMinMax)}merge(e,r){let n=r.clone();return n.merge(e),n}diff(e,r){let n=r.clone();return n.diff(e),n}toMetricData(e,r,n,i){return{descriptor:e,aggregationTemporality:r,dataPointType:Re.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),c=e.type===j.GAUGE||e.type===j.UP_DOWN_COUNTER||e.type===j.OBSERVABLE_GAUGE||e.type===j.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:c?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}}});function ru(t){return t.setValue(Vm,!0)}function fO(t){return t.deleteValue(Vm)}function cs(t){return t.getValue(Vm)===!0}var Vm,na=T(()=>{"use strict";Q();Vm=Uc("OpenTelemetry SDK Context Key SUPPRESS_TRACING")});var pO,qm,ls,nu,Gm=T(()=>{"use strict";pO="=",qm=";",ls=",",nu="baggage"});function mO(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?ls:""}${r}`;return n.length>8192?e:n},"")}function gO(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=qm+r.metadata.toString()),n})}function Hm(t){if(!t)return;let e=t.indexOf(qm),r=e===-1?t:t.substring(0,e),n=r.indexOf(pO);if(n<=0)return;let i=r.substring(0,n).trim(),s=r.substring(n+1).trim();if(!i||!s)return;let o,a;try{o=decodeURIComponent(i),a=decodeURIComponent(s)}catch{return}let c;if(e!==-1&&e<t.length-1){let l=t.substring(e+1);c=jy(l)}return{key:o,value:a,metadata:c}}function li(t){let e={};return typeof t=="string"&&t.length>0&&t.split(ls).forEach(r=>{let n=Hm(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var zm=T(()=>{"use strict";Q();Gm()});var iu,_O=T(()=>{"use strict";Q();na();Gm();zm();iu=class{inject(e,r,n){let i=kc.getBaggage(e);if(!i||cs(e))return;let s=gO(i).filter(a=>a.length<=4096).slice(0,180),o=mO(s);o.length>0&&n.set(r,nu,o)}extract(e,r,n){let i=n.get(r,nu),s=Array.isArray(i)?i.join(ls):i;if(!s)return e;let o={};return s.length===0||(s.split(ls).forEach(c=>{let l=Hm(c);if(l){let h={value:l.value};l.metadata&&(h.metadata=l.metadata),o[l.key]=h}}),Object.entries(o).length===0)?e:kc.setBaggage(e,kc.createBaggage(o))}fields(){return[nu]}}});var su,EO=T(()=>{"use strict";su=class{_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 SO(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(!cz(r)){P.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!jm(n)){P.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function cz(t){return typeof t=="string"&&t!==""}function jm(t){return t==null?!0:Array.isArray(t)?lz(t):TO(typeof t)}function lz(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(TO(n)){e=n;continue}return!1}return!1}}return!0}function TO(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var yO=T(()=>{"use strict";Q()});function ou(){return t=>{P.error(uz(t))}}function uz(t){return typeof t=="string"?t:JSON.stringify(hz(t))}function hz(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let i=r[n];i&&(e[n]=String(i))}),r=Object.getPrototypeOf(r);return e}var $m=T(()=>{"use strict";Q()});function AO(t){vO=t}function ia(t){try{vO(t)}catch{}}var vO,CO=T(()=>{"use strict";$m();vO=ou()});import{inspect as RO}from"util";function us(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){P.warn(`Unknown value ${RO(e)} for ${t}, expected a number, using defaults`);return}return r}function tt(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function au(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||P.warn(`Unknown value ${RO(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function cu(t){return tt(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var OO=T(()=>{"use strict";Q()});var lu,bO=T(()=>{"use strict";lu=globalThis});var MO,NO=T(()=>{"use strict";MO="2.7.1"});function Oe(t){let e={},r=t.length;for(let n=0;n<r;n++){let i=t[n];i&&(e[String(i).toUpperCase().replace(/[-.]/g,"_")]=i)}return e}var Wm=T(()=>{"use strict"});var wO,PO,xO,IO,LO,DO,UO,kO,FO,BO,VO,qO,GO,HO,zO,jO,$O,WO,YO,KO,XO,JO,QO,ZO,eb,tb,rb,nb,ib,sb,ob,ab,cb,lb,ub,hb,db,fb,pb,mb,gb,_b,Eb,Sb,Tb,yb,vb,Ab,Cb,Rb,Ob,bb,Mb,Nb,wb,Pb,xb,Ib,Lb,Db,Ub,kb,Fb,Bb,Vb,qb,Gb,Hb,zb,jb,$b,Wb,Yb,Kb,Xb,Jb,Qb,Zb,eM,tM,rM,nM,iM,sM,oM,aM,cM,lM,uM,hM,dM,fM,pM,mM,gM,_M,EM,SM,TM,yM,vM,AM,CM,RM,OM,bM,MM,NM,wM,PM,xM,IM,LM,DM,UM,kM,FM,BM,VM,qM,GM,HM,zM,jM,$M,WM,YM,KM,dz,fz,pz,mz,gz,_z,Ez,Sz,Tz,yz,vz,Az,Cz,Rz,Oz,bz,Mz,Nz,wz,Pz,xz,Iz,Lz,Dz,Uz,kz,Fz,Bz,Vz,qz,Gz,Hz,zz,jz,$z,Wz,Yz,Kz,Xz,Jz,Qz,Zz,ej,tj,rj,nj,ij,sj,oj,aj,cj,lj,uj,hj,dj,fj,pj,mj,gj,_j,Ej,Sj,Tj,yj,vj,Aj,Cj,Rj,Oj,bj,Mj,Nj,wj,Pj,xj,Ij,Lj,Dj,Uj,kj,Fj,Bj,Vj,qj,Gj,Hj,zj,jj,$j,Wj,Yj,Kj,Xj,Jj,Qj,Zj,e$,t$,r$,n$,i$,s$,o$,a$,c$,l$,u$,h$,d$,f$,p$,m$,g$,_$,E$,S$,T$,y$,v$,A$,C$,R$,O$,b$,M$,N$,w$,P$,x$,XM,JM,QM,ZM,eN,tN,rN,nN,iN,sN,oN,aN,cN,lN,uN,hN,dN,fN,pN,mN,gN,_N,EN,SN,TN,yN,vN,AN,CN,RN,ON,bN,MN,NN,wN,PN,xN,IN,LN,DN,UN,kN,FN,BN,VN,qN,GN,I$,L$,D$,U$,k$,F$,B$,V$,q$,G$,H$,z$,j$,$$,W$,Y$,K$,X$,J$,Q$,Z$,eW,tW,rW,nW,iW,sW,oW,aW,cW,lW,uW,hW,dW,fW,pW,mW,gW,_W,EW,SW,TW,yW,vW,AW,CW,RW,OW,HN,zN,jN,$N,WN,YN,KN,XN,JN,QN,ZN,bW,MW,NW,wW,PW,xW,IW,LW,DW,UW,kW,FW,ew,tw,rw,nw,iw,BW,VW,qW,GW,HW,zW,sw,ow,aw,jW,$W,WW,YW,cw,lw,uw,hw,KW,XW,JW,QW,ZW,dw,fw,pw,mw,gw,_w,Ew,eY,tY,rY,nY,iY,sY,oY,aY,Sw,Tw,yw,vw,Aw,cY,lY,uY,hY,dY,fY,Cw,Rw,Ow,bw,Mw,Nw,ww,Pw,xw,Iw,Lw,Dw,Uw,kw,Fw,Bw,Vw,qw,Gw,Hw,zw,pY,mY,gY,_Y,EY,SY,TY,yY,vY,AY,CY,RY,OY,bY,MY,NY,wY,PY,xY,IY,LY,DY,jw,$w,Ww,Yw,Kw,UY,kY,FY,BY,VY,qY,Xw,Jw,GY,HY,zY,Qw,Zw,jY,$Y,WY,eP,tP,rP,nP,iP,sP,oP,aP,cP,lP,uP,hP,dP,fP,pP,mP,gP,YY,KY,XY,JY,QY,ZY,e8,t8,r8,n8,i8,s8,o8,a8,c8,l8,u8,h8,_P,EP,d8,f8,p8,SP=T(()=>{"use strict";Wm();wO="aws.lambda.invoked_arn",PO="db.system",xO="db.connection_string",IO="db.user",LO="db.jdbc.driver_classname",DO="db.name",UO="db.statement",kO="db.operation",FO="db.mssql.instance_name",BO="db.cassandra.keyspace",VO="db.cassandra.page_size",qO="db.cassandra.consistency_level",GO="db.cassandra.table",HO="db.cassandra.idempotence",zO="db.cassandra.speculative_execution_count",jO="db.cassandra.coordinator.id",$O="db.cassandra.coordinator.dc",WO="db.hbase.namespace",YO="db.redis.database_index",KO="db.mongodb.collection",XO="db.sql.table",JO="exception.type",QO="exception.message",ZO="exception.stacktrace",eb="exception.escaped",tb="faas.trigger",rb="faas.execution",nb="faas.document.collection",ib="faas.document.operation",sb="faas.document.time",ob="faas.document.name",ab="faas.time",cb="faas.cron",lb="faas.coldstart",ub="faas.invoked_name",hb="faas.invoked_provider",db="faas.invoked_region",fb="net.transport",pb="net.peer.ip",mb="net.peer.port",gb="net.peer.name",_b="net.host.ip",Eb="net.host.port",Sb="net.host.name",Tb="net.host.connection.type",yb="net.host.connection.subtype",vb="net.host.carrier.name",Ab="net.host.carrier.mcc",Cb="net.host.carrier.mnc",Rb="net.host.carrier.icc",Ob="peer.service",bb="enduser.id",Mb="enduser.role",Nb="enduser.scope",wb="thread.id",Pb="thread.name",xb="code.function",Ib="code.namespace",Lb="code.filepath",Db="code.lineno",Ub="http.method",kb="http.url",Fb="http.target",Bb="http.host",Vb="http.scheme",qb="http.status_code",Gb="http.flavor",Hb="http.user_agent",zb="http.request_content_length",jb="http.request_content_length_uncompressed",$b="http.response_content_length",Wb="http.response_content_length_uncompressed",Yb="http.server_name",Kb="http.route",Xb="http.client_ip",Jb="aws.dynamodb.table_names",Qb="aws.dynamodb.consumed_capacity",Zb="aws.dynamodb.item_collection_metrics",eM="aws.dynamodb.provisioned_read_capacity",tM="aws.dynamodb.provisioned_write_capacity",rM="aws.dynamodb.consistent_read",nM="aws.dynamodb.projection",iM="aws.dynamodb.limit",sM="aws.dynamodb.attributes_to_get",oM="aws.dynamodb.index_name",aM="aws.dynamodb.select",cM="aws.dynamodb.global_secondary_indexes",lM="aws.dynamodb.local_secondary_indexes",uM="aws.dynamodb.exclusive_start_table",hM="aws.dynamodb.table_count",dM="aws.dynamodb.scan_forward",fM="aws.dynamodb.segment",pM="aws.dynamodb.total_segments",mM="aws.dynamodb.count",gM="aws.dynamodb.scanned_count",_M="aws.dynamodb.attribute_definitions",EM="aws.dynamodb.global_secondary_index_updates",SM="messaging.system",TM="messaging.destination",yM="messaging.destination_kind",vM="messaging.temp_destination",AM="messaging.protocol",CM="messaging.protocol_version",RM="messaging.url",OM="messaging.message_id",bM="messaging.conversation_id",MM="messaging.message_payload_size_bytes",NM="messaging.message_payload_compressed_size_bytes",wM="messaging.operation",PM="messaging.consumer_id",xM="messaging.rabbitmq.routing_key",IM="messaging.kafka.message_key",LM="messaging.kafka.consumer_group",DM="messaging.kafka.client_id",UM="messaging.kafka.partition",kM="messaging.kafka.tombstone",FM="rpc.system",BM="rpc.service",VM="rpc.method",qM="rpc.grpc.status_code",GM="rpc.jsonrpc.version",HM="rpc.jsonrpc.request_id",zM="rpc.jsonrpc.error_code",jM="rpc.jsonrpc.error_message",$M="message.type",WM="message.id",YM="message.compressed_size",KM="message.uncompressed_size",dz=wO,fz=PO,pz=xO,mz=IO,gz=LO,_z=DO,Ez=UO,Sz=kO,Tz=FO,yz=BO,vz=VO,Az=qO,Cz=GO,Rz=HO,Oz=zO,bz=jO,Mz=$O,Nz=WO,wz=YO,Pz=KO,xz=XO,Iz=JO,Lz=QO,Dz=ZO,Uz=eb,kz=tb,Fz=rb,Bz=nb,Vz=ib,qz=sb,Gz=ob,Hz=ab,zz=cb,jz=lb,$z=ub,Wz=hb,Yz=db,Kz=fb,Xz=pb,Jz=mb,Qz=gb,Zz=_b,ej=Eb,tj=Sb,rj=Tb,nj=yb,ij=vb,sj=Ab,oj=Cb,aj=Rb,cj=Ob,lj=bb,uj=Mb,hj=Nb,dj=wb,fj=Pb,pj=xb,mj=Ib,gj=Lb,_j=Db,Ej=Ub,Sj=kb,Tj=Fb,yj=Bb,vj=Vb,Aj=qb,Cj=Gb,Rj=Hb,Oj=zb,bj=jb,Mj=$b,Nj=Wb,wj=Yb,Pj=Kb,xj=Xb,Ij=Jb,Lj=Qb,Dj=Zb,Uj=eM,kj=tM,Fj=rM,Bj=nM,Vj=iM,qj=sM,Gj=oM,Hj=aM,zj=cM,jj=lM,$j=uM,Wj=hM,Yj=dM,Kj=fM,Xj=pM,Jj=mM,Qj=gM,Zj=_M,e$=EM,t$=SM,r$=TM,n$=yM,i$=vM,s$=AM,o$=CM,a$=RM,c$=OM,l$=bM,u$=MM,h$=NM,d$=wM,f$=PM,p$=xM,m$=IM,g$=LM,_$=DM,E$=UM,S$=kM,T$=FM,y$=BM,v$=VM,A$=qM,C$=GM,R$=HM,O$=zM,b$=jM,M$=$M,N$=WM,w$=YM,P$=KM,x$=Oe([wO,PO,xO,IO,LO,DO,UO,kO,FO,BO,VO,qO,GO,HO,zO,jO,$O,WO,YO,KO,XO,JO,QO,ZO,eb,tb,rb,nb,ib,sb,ob,ab,cb,lb,ub,hb,db,fb,pb,mb,gb,_b,Eb,Sb,Tb,yb,vb,Ab,Cb,Rb,Ob,bb,Mb,Nb,wb,Pb,xb,Ib,Lb,Db,Ub,kb,Fb,Bb,Vb,qb,Gb,Hb,zb,jb,$b,Wb,Yb,Kb,Xb,Jb,Qb,Zb,eM,tM,rM,nM,iM,sM,oM,aM,cM,lM,uM,hM,dM,fM,pM,mM,gM,_M,EM,SM,TM,yM,vM,AM,CM,RM,OM,bM,MM,NM,wM,PM,xM,IM,LM,DM,UM,kM,FM,BM,VM,qM,GM,HM,zM,jM,$M,WM,YM,KM]),XM="other_sql",JM="mssql",QM="mysql",ZM="oracle",eN="db2",tN="postgresql",rN="redshift",nN="hive",iN="cloudscape",sN="hsqldb",oN="progress",aN="maxdb",cN="hanadb",lN="ingres",uN="firstsql",hN="edb",dN="cache",fN="adabas",pN="firebird",mN="derby",gN="filemaker",_N="informix",EN="instantdb",SN="interbase",TN="mariadb",yN="netezza",vN="pervasive",AN="pointbase",CN="sqlite",RN="sybase",ON="teradata",bN="vertica",MN="h2",NN="coldfusion",wN="cassandra",PN="hbase",xN="mongodb",IN="redis",LN="couchbase",DN="couchdb",UN="cosmosdb",kN="dynamodb",FN="neo4j",BN="geode",VN="elasticsearch",qN="memcached",GN="cockroachdb",I$=XM,L$=JM,D$=QM,U$=ZM,k$=eN,F$=tN,B$=rN,V$=nN,q$=iN,G$=sN,H$=oN,z$=aN,j$=cN,$$=lN,W$=uN,Y$=hN,K$=dN,X$=fN,J$=pN,Q$=mN,Z$=gN,eW=_N,tW=EN,rW=SN,nW=TN,iW=yN,sW=vN,oW=AN,aW=CN,cW=RN,lW=ON,uW=bN,hW=MN,dW=NN,fW=wN,pW=PN,mW=xN,gW=IN,_W=LN,EW=DN,SW=UN,TW=kN,yW=FN,vW=BN,AW=VN,CW=qN,RW=GN,OW=Oe([XM,JM,QM,ZM,eN,tN,rN,nN,iN,sN,oN,aN,cN,lN,uN,hN,dN,fN,pN,mN,gN,_N,EN,SN,TN,yN,vN,AN,CN,RN,ON,bN,MN,NN,wN,PN,xN,IN,LN,DN,UN,kN,FN,BN,VN,qN,GN]),HN="all",zN="each_quorum",jN="quorum",$N="local_quorum",WN="one",YN="two",KN="three",XN="local_one",JN="any",QN="serial",ZN="local_serial",bW=HN,MW=zN,NW=jN,wW=$N,PW=WN,xW=YN,IW=KN,LW=XN,DW=JN,UW=QN,kW=ZN,FW=Oe([HN,zN,jN,$N,WN,YN,KN,XN,JN,QN,ZN]),ew="datasource",tw="http",rw="pubsub",nw="timer",iw="other",BW=ew,VW=tw,qW=rw,GW=nw,HW=iw,zW=Oe([ew,tw,rw,nw,iw]),sw="insert",ow="edit",aw="delete",jW=sw,$W=ow,WW=aw,YW=Oe([sw,ow,aw]),cw="alibaba_cloud",lw="aws",uw="azure",hw="gcp",KW=cw,XW=lw,JW=uw,QW=hw,ZW=Oe([cw,lw,uw,hw]),dw="ip_tcp",fw="ip_udp",pw="ip",mw="unix",gw="pipe",_w="inproc",Ew="other",eY=dw,tY=fw,rY=pw,nY=mw,iY=gw,sY=_w,oY=Ew,aY=Oe([dw,fw,pw,mw,gw,_w,Ew]),Sw="wifi",Tw="wired",yw="cell",vw="unavailable",Aw="unknown",cY=Sw,lY=Tw,uY=yw,hY=vw,dY=Aw,fY=Oe([Sw,Tw,yw,vw,Aw]),Cw="gprs",Rw="edge",Ow="umts",bw="cdma",Mw="evdo_0",Nw="evdo_a",ww="cdma2000_1xrtt",Pw="hsdpa",xw="hsupa",Iw="hspa",Lw="iden",Dw="evdo_b",Uw="lte",kw="ehrpd",Fw="hspap",Bw="gsm",Vw="td_scdma",qw="iwlan",Gw="nr",Hw="nrnsa",zw="lte_ca",pY=Cw,mY=Rw,gY=Ow,_Y=bw,EY=Mw,SY=Nw,TY=ww,yY=Pw,vY=xw,AY=Iw,CY=Lw,RY=Dw,OY=Uw,bY=kw,MY=Fw,NY=Bw,wY=Vw,PY=qw,xY=Gw,IY=Hw,LY=zw,DY=Oe([Cw,Rw,Ow,bw,Mw,Nw,ww,Pw,xw,Iw,Lw,Dw,Uw,kw,Fw,Bw,Vw,qw,Gw,Hw,zw]),jw="1.0",$w="1.1",Ww="2.0",Yw="SPDY",Kw="QUIC",UY=jw,kY=$w,FY=Ww,BY=Yw,VY=Kw,qY={HTTP_1_0:jw,HTTP_1_1:$w,HTTP_2_0:Ww,SPDY:Yw,QUIC:Kw},Xw="queue",Jw="topic",GY=Xw,HY=Jw,zY=Oe([Xw,Jw]),Qw="receive",Zw="process",jY=Qw,$Y=Zw,WY=Oe([Qw,Zw]),eP=0,tP=1,rP=2,nP=3,iP=4,sP=5,oP=6,aP=7,cP=8,lP=9,uP=10,hP=11,dP=12,fP=13,pP=14,mP=15,gP=16,YY=eP,KY=tP,XY=rP,JY=nP,QY=iP,ZY=sP,e8=oP,t8=aP,r8=cP,n8=lP,i8=uP,s8=hP,o8=dP,a8=fP,c8=pP,l8=mP,u8=gP,h8={OK:eP,CANCELLED:tP,UNKNOWN:rP,INVALID_ARGUMENT:nP,DEADLINE_EXCEEDED:iP,NOT_FOUND:sP,ALREADY_EXISTS:oP,PERMISSION_DENIED:aP,RESOURCE_EXHAUSTED:cP,FAILED_PRECONDITION:lP,ABORTED:uP,OUT_OF_RANGE:hP,UNIMPLEMENTED:dP,INTERNAL:fP,UNAVAILABLE:pP,DATA_LOSS:mP,UNAUTHENTICATED:gP},_P="SENT",EP="RECEIVED",d8=_P,f8=EP,p8=Oe([_P,EP])});var TP=T(()=>{"use strict";SP()});var yP,vP,AP,CP,RP,OP,bP,MP,NP,wP,PP,xP,IP,LP,DP,UP,kP,FP,BP,VP,qP,GP,HP,zP,jP,$P,WP,YP,KP,XP,JP,QP,ZP,ex,tx,rx,nx,ix,sx,ox,ax,cx,lx,ux,hx,dx,fx,px,mx,gx,_x,Ex,Sx,Tx,yx,vx,Ax,Cx,Rx,Ox,bx,Mx,Nx,wx,Px,xx,Ix,Lx,Dx,Ux,kx,Fx,Bx,Vx,qx,Gx,Hx,zx,jx,$x,Wx,m8,g8,_8,E8,S8,T8,y8,v8,A8,C8,R8,O8,b8,M8,N8,w8,P8,x8,I8,L8,D8,U8,k8,F8,B8,V8,q8,G8,H8,z8,j8,$8,W8,Y8,K8,X8,J8,Q8,Z8,e7,t7,r7,n7,i7,s7,o7,a7,c7,l7,u7,h7,d7,f7,p7,m7,g7,_7,E7,S7,T7,y7,v7,A7,C7,R7,O7,b7,M7,N7,w7,P7,x7,I7,L7,D7,U7,k7,F7,B7,V7,q7,G7,Yx,Kx,Xx,Jx,H7,z7,j7,$7,W7,Qx,Zx,e1,t1,r1,n1,i1,s1,o1,a1,c1,l1,u1,h1,d1,f1,p1,Y7,K7,X7,J7,Q7,Z7,e9,t9,r9,n9,i9,s9,o9,a9,c9,l9,u9,h9,m1,g1,d9,f9,p9,_1,E1,S1,T1,y1,v1,A1,m9,g9,_9,E9,S9,T9,y9,v9,C1,R1,O1,b1,M1,N1,w1,P1,x1,I1,L1,A9,C9,R9,O9,b9,M9,N9,w9,P9,x9,I9,L9,D1,U1,k1,F1,B1,V1,q1,G1,H1,z1,D9,U9,k9,F9,B9,V9,q9,G9,H9,z9,j9,j1=T(()=>{"use strict";Wm();yP="cloud.provider",vP="cloud.account.id",AP="cloud.region",CP="cloud.availability_zone",RP="cloud.platform",OP="aws.ecs.container.arn",bP="aws.ecs.cluster.arn",MP="aws.ecs.launchtype",NP="aws.ecs.task.arn",wP="aws.ecs.task.family",PP="aws.ecs.task.revision",xP="aws.eks.cluster.arn",IP="aws.log.group.names",LP="aws.log.group.arns",DP="aws.log.stream.names",UP="aws.log.stream.arns",kP="container.name",FP="container.id",BP="container.runtime",VP="container.image.name",qP="container.image.tag",GP="deployment.environment",HP="device.id",zP="device.model.identifier",jP="device.model.name",$P="faas.name",WP="faas.id",YP="faas.version",KP="faas.instance",XP="faas.max_memory",JP="host.id",QP="host.name",ZP="host.type",ex="host.arch",tx="host.image.name",rx="host.image.id",nx="host.image.version",ix="k8s.cluster.name",sx="k8s.node.name",ox="k8s.node.uid",ax="k8s.namespace.name",cx="k8s.pod.uid",lx="k8s.pod.name",ux="k8s.container.name",hx="k8s.replicaset.uid",dx="k8s.replicaset.name",fx="k8s.deployment.uid",px="k8s.deployment.name",mx="k8s.statefulset.uid",gx="k8s.statefulset.name",_x="k8s.daemonset.uid",Ex="k8s.daemonset.name",Sx="k8s.job.uid",Tx="k8s.job.name",yx="k8s.cronjob.uid",vx="k8s.cronjob.name",Ax="os.type",Cx="os.description",Rx="os.name",Ox="os.version",bx="process.pid",Mx="process.executable.name",Nx="process.executable.path",wx="process.command",Px="process.command_line",xx="process.command_args",Ix="process.owner",Lx="process.runtime.name",Dx="process.runtime.version",Ux="process.runtime.description",kx="service.name",Fx="service.namespace",Bx="service.instance.id",Vx="service.version",qx="telemetry.sdk.name",Gx="telemetry.sdk.language",Hx="telemetry.sdk.version",zx="telemetry.auto.version",jx="webengine.name",$x="webengine.version",Wx="webengine.description",m8=yP,g8=vP,_8=AP,E8=CP,S8=RP,T8=OP,y8=bP,v8=MP,A8=NP,C8=wP,R8=PP,O8=xP,b8=IP,M8=LP,N8=DP,w8=UP,P8=kP,x8=FP,I8=BP,L8=VP,D8=qP,U8=GP,k8=HP,F8=zP,B8=jP,V8=$P,q8=WP,G8=YP,H8=KP,z8=XP,j8=JP,$8=QP,W8=ZP,Y8=ex,K8=tx,X8=rx,J8=nx,Q8=ix,Z8=sx,e7=ox,t7=ax,r7=cx,n7=lx,i7=ux,s7=hx,o7=dx,a7=fx,c7=px,l7=mx,u7=gx,h7=_x,d7=Ex,f7=Sx,p7=Tx,m7=yx,g7=vx,_7=Ax,E7=Cx,S7=Rx,T7=Ox,y7=bx,v7=Mx,A7=Nx,C7=wx,R7=Px,O7=xx,b7=Ix,M7=Lx,N7=Dx,w7=Ux,P7=kx,x7=Fx,I7=Bx,L7=Vx,D7=qx,U7=Gx,k7=Hx,F7=zx,B7=jx,V7=$x,q7=Wx,G7=Oe([yP,vP,AP,CP,RP,OP,bP,MP,NP,wP,PP,xP,IP,LP,DP,UP,kP,FP,BP,VP,qP,GP,HP,zP,jP,$P,WP,YP,KP,XP,JP,QP,ZP,ex,tx,rx,nx,ix,sx,ox,ax,cx,lx,ux,hx,dx,fx,px,mx,gx,_x,Ex,Sx,Tx,yx,vx,Ax,Cx,Rx,Ox,bx,Mx,Nx,wx,Px,xx,Ix,Lx,Dx,Ux,kx,Fx,Bx,Vx,qx,Gx,Hx,zx,jx,$x,Wx]),Yx="alibaba_cloud",Kx="aws",Xx="azure",Jx="gcp",H7=Yx,z7=Kx,j7=Xx,$7=Jx,W7=Oe([Yx,Kx,Xx,Jx]),Qx="alibaba_cloud_ecs",Zx="alibaba_cloud_fc",e1="aws_ec2",t1="aws_ecs",r1="aws_eks",n1="aws_lambda",i1="aws_elastic_beanstalk",s1="azure_vm",o1="azure_container_instances",a1="azure_aks",c1="azure_functions",l1="azure_app_service",u1="gcp_compute_engine",h1="gcp_cloud_run",d1="gcp_kubernetes_engine",f1="gcp_cloud_functions",p1="gcp_app_engine",Y7=Qx,K7=Zx,X7=e1,J7=t1,Q7=r1,Z7=n1,e9=i1,t9=s1,r9=o1,n9=a1,i9=c1,s9=l1,o9=u1,a9=h1,c9=d1,l9=f1,u9=p1,h9=Oe([Qx,Zx,e1,t1,r1,n1,i1,s1,o1,a1,c1,l1,u1,h1,d1,f1,p1]),m1="ec2",g1="fargate",d9=m1,f9=g1,p9=Oe([m1,g1]),_1="amd64",E1="arm32",S1="arm64",T1="ia64",y1="ppc32",v1="ppc64",A1="x86",m9=_1,g9=E1,_9=S1,E9=T1,S9=y1,T9=v1,y9=A1,v9=Oe([_1,E1,S1,T1,y1,v1,A1]),C1="windows",R1="linux",O1="darwin",b1="freebsd",M1="netbsd",N1="openbsd",w1="dragonflybsd",P1="hpux",x1="aix",I1="solaris",L1="z_os",A9=C1,C9=R1,R9=O1,O9=b1,b9=M1,M9=N1,N9=w1,w9=P1,P9=x1,x9=I1,I9=L1,L9=Oe([C1,R1,O1,b1,M1,N1,w1,P1,x1,I1,L1]),D1="cpp",U1="dotnet",k1="erlang",F1="go",B1="java",V1="nodejs",q1="php",G1="python",H1="ruby",z1="webjs",D9=D1,U9=U1,k9=k1,F9=F1,B9=B1,V9=V1,q9=q1,G9=G1,H9=H1,z9=z1,j9=Oe([D1,U1,k1,F1,B1,V1,q1,G1,H1,z1])});var $1=T(()=>{"use strict";j1()});var $9,W9,Y9,K9,X9,J9,Q9,Z9,eK,tK,rK,nK,iK,sK,oK,aK,cK,lK,uK,hK,dK,fK,pK,mK,gK,_K,EK,SK,TK,yK,vK,AK,CK,RK,OK,bK,MK,NK,wK,PK,xK,IK,LK,DK,UK,kK,FK,BK,VK,qK,GK,HK,zK,jK,$K,WK,YK,KK,XK,JK,QK,ZK,eX,tX,rX,nX,iX,sX,oX,aX,cX,lX,uX,hX,dX,fX,pX,mX,gX,_X,EX,SX,TX,yX,vX,AX,CX,RX,OX,bX,MX,NX,wX,PX,xX,IX,LX,DX,UX,kX,FX,BX,VX,qX,Ym,GX,HX,zX,jX,$X,WX,YX,KX,XX,hs,JX,QX,ZX,eJ,tJ,Km,rJ,nJ,iJ,sJ,oJ,aJ,ds,fs,cJ,lJ,uJ,hJ,dJ,fJ,W1=T(()=>{"use strict";$9="aspnetcore.diagnostics.exception.result",W9="aborted",Y9="handled",K9="skipped",X9="unhandled",J9="aspnetcore.diagnostics.handler.type",Q9="aspnetcore.rate_limiting.policy",Z9="aspnetcore.rate_limiting.result",eK="acquired",tK="endpoint_limiter",rK="global_limiter",nK="request_canceled",iK="aspnetcore.request.is_unhandled",sK="aspnetcore.routing.is_fallback",oK="aspnetcore.routing.match_status",aK="failure",cK="success",lK="aspnetcore.user.is_authenticated",uK="client.address",hK="client.port",dK="code.column.number",fK="code.file.path",pK="code.function.name",mK="code.line.number",gK="code.stacktrace",_K="db.collection.name",EK="db.namespace",SK="db.operation.batch.size",TK="db.operation.name",yK="db.query.summary",vK="db.query.text",AK="db.response.status_code",CK="db.stored_procedure.name",RK="db.system.name",OK="mariadb",bK="microsoft.sql_server",MK="mysql",NK="postgresql",wK="dotnet.gc.heap.generation",PK="gen0",xK="gen1",IK="gen2",LK="loh",DK="poh",UK="error.type",kK="_OTHER",FK="exception.escaped",BK="exception.message",VK="exception.stacktrace",qK="exception.type",GK=t=>`http.request.header.${t}`,HK="http.request.method",zK="_OTHER",jK="CONNECT",$K="DELETE",WK="GET",YK="HEAD",KK="OPTIONS",XK="PATCH",JK="POST",QK="PUT",ZK="TRACE",eX="http.request.method_original",tX="http.request.resend_count",rX=t=>`http.response.header.${t}`,nX="http.response.status_code",iX="http.route",sX="jvm.gc.action",oX="jvm.gc.name",aX="jvm.memory.pool.name",cX="jvm.memory.type",lX="heap",uX="non_heap",hX="jvm.thread.daemon",dX="jvm.thread.state",fX="blocked",pX="new",mX="runnable",gX="terminated",_X="timed_waiting",EX="waiting",SX="network.local.address",TX="network.local.port",yX="network.peer.address",vX="network.peer.port",AX="network.protocol.name",CX="network.protocol.version",RX="network.transport",OX="pipe",bX="quic",MX="tcp",NX="udp",wX="unix",PX="network.type",xX="ipv4",IX="ipv6",LX="otel.scope.name",DX="otel.scope.version",UX="otel.status_code",kX="ERROR",FX="OK",BX="otel.status_description",VX="server.address",qX="server.port",Ym="service.name",GX="service.version",HX="signalr.connection.status",zX="app_shutdown",jX="normal_closure",$X="timeout",WX="signalr.transport",YX="long_polling",KX="server_sent_events",XX="web_sockets",hs="telemetry.sdk.language",JX="cpp",QX="dotnet",ZX="erlang",eJ="go",tJ="java",Km="nodejs",rJ="php",nJ="python",iJ="ruby",sJ="rust",oJ="swift",aJ="webjs",ds="telemetry.sdk.name",fs="telemetry.sdk.version",cJ="url.fragment",lJ="url.full",uJ="url.path",hJ="url.query",dJ="url.scheme",fJ="user_agent.original"});var pJ,mJ,gJ,_J,EJ,SJ,TJ,yJ,vJ,AJ,CJ,RJ,OJ,bJ,MJ,NJ,wJ,PJ,xJ,IJ,LJ,DJ,UJ,kJ,FJ,BJ,VJ,qJ,GJ,HJ,zJ,jJ,$J,WJ,YJ,KJ,XJ,JJ,QJ,ZJ,eQ,tQ,rQ,nQ,iQ,sQ,oQ,aQ,cQ,lQ,uQ,Y1=T(()=>{"use strict";pJ="aspnetcore.diagnostics.exceptions",mJ="aspnetcore.rate_limiting.active_request_leases",gJ="aspnetcore.rate_limiting.queued_requests",_J="aspnetcore.rate_limiting.request.time_in_queue",EJ="aspnetcore.rate_limiting.request_lease.duration",SJ="aspnetcore.rate_limiting.requests",TJ="aspnetcore.routing.match_attempts",yJ="db.client.operation.duration",vJ="dotnet.assembly.count",AJ="dotnet.exceptions",CJ="dotnet.gc.collections",RJ="dotnet.gc.heap.total_allocated",OJ="dotnet.gc.last_collection.heap.fragmentation.size",bJ="dotnet.gc.last_collection.heap.size",MJ="dotnet.gc.last_collection.memory.committed_size",NJ="dotnet.gc.pause.time",wJ="dotnet.jit.compilation.time",PJ="dotnet.jit.compiled_il.size",xJ="dotnet.jit.compiled_methods",IJ="dotnet.monitor.lock_contentions",LJ="dotnet.process.cpu.count",DJ="dotnet.process.cpu.time",UJ="dotnet.process.memory.working_set",kJ="dotnet.thread_pool.queue.length",FJ="dotnet.thread_pool.thread.count",BJ="dotnet.thread_pool.work_item.count",VJ="dotnet.timer.count",qJ="http.client.request.duration",GJ="http.server.request.duration",HJ="jvm.class.count",zJ="jvm.class.loaded",jJ="jvm.class.unloaded",$J="jvm.cpu.count",WJ="jvm.cpu.recent_utilization",YJ="jvm.cpu.time",KJ="jvm.gc.duration",XJ="jvm.memory.committed",JJ="jvm.memory.limit",QJ="jvm.memory.used",ZJ="jvm.memory.used_after_last_gc",eQ="jvm.thread.count",tQ="kestrel.active_connections",rQ="kestrel.active_tls_handshakes",nQ="kestrel.connection.duration",iQ="kestrel.queued_connections",sQ="kestrel.queued_requests",oQ="kestrel.rejected_connections",aQ="kestrel.tls_handshake.duration",cQ="kestrel.upgraded_connections",lQ="signalr.server.active_connections",uQ="signalr.server.connection.duration"});var hQ,K1=T(()=>{"use strict";hQ="exception"});var X1={};kr(X1,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>W9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Y9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>K9,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>X9,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>eK,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>tK,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>rK,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>nK,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>aK,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>cK,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>$9,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>J9,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Q9,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Z9,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>iK,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>sK,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>oK,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>lK,ATTR_CLIENT_ADDRESS:()=>uK,ATTR_CLIENT_PORT:()=>hK,ATTR_CODE_COLUMN_NUMBER:()=>dK,ATTR_CODE_FILE_PATH:()=>fK,ATTR_CODE_FUNCTION_NAME:()=>pK,ATTR_CODE_LINE_NUMBER:()=>mK,ATTR_CODE_STACKTRACE:()=>gK,ATTR_DB_COLLECTION_NAME:()=>_K,ATTR_DB_NAMESPACE:()=>EK,ATTR_DB_OPERATION_BATCH_SIZE:()=>SK,ATTR_DB_OPERATION_NAME:()=>TK,ATTR_DB_QUERY_SUMMARY:()=>yK,ATTR_DB_QUERY_TEXT:()=>vK,ATTR_DB_RESPONSE_STATUS_CODE:()=>AK,ATTR_DB_STORED_PROCEDURE_NAME:()=>CK,ATTR_DB_SYSTEM_NAME:()=>RK,ATTR_DOTNET_GC_HEAP_GENERATION:()=>wK,ATTR_ERROR_TYPE:()=>UK,ATTR_EXCEPTION_ESCAPED:()=>FK,ATTR_EXCEPTION_MESSAGE:()=>BK,ATTR_EXCEPTION_STACKTRACE:()=>VK,ATTR_EXCEPTION_TYPE:()=>qK,ATTR_HTTP_REQUEST_HEADER:()=>GK,ATTR_HTTP_REQUEST_METHOD:()=>HK,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>eX,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>tX,ATTR_HTTP_RESPONSE_HEADER:()=>rX,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>nX,ATTR_HTTP_ROUTE:()=>iX,ATTR_JVM_GC_ACTION:()=>sX,ATTR_JVM_GC_NAME:()=>oX,ATTR_JVM_MEMORY_POOL_NAME:()=>aX,ATTR_JVM_MEMORY_TYPE:()=>cX,ATTR_JVM_THREAD_DAEMON:()=>hX,ATTR_JVM_THREAD_STATE:()=>dX,ATTR_NETWORK_LOCAL_ADDRESS:()=>SX,ATTR_NETWORK_LOCAL_PORT:()=>TX,ATTR_NETWORK_PEER_ADDRESS:()=>yX,ATTR_NETWORK_PEER_PORT:()=>vX,ATTR_NETWORK_PROTOCOL_NAME:()=>AX,ATTR_NETWORK_PROTOCOL_VERSION:()=>CX,ATTR_NETWORK_TRANSPORT:()=>RX,ATTR_NETWORK_TYPE:()=>PX,ATTR_OTEL_SCOPE_NAME:()=>LX,ATTR_OTEL_SCOPE_VERSION:()=>DX,ATTR_OTEL_STATUS_CODE:()=>UX,ATTR_OTEL_STATUS_DESCRIPTION:()=>BX,ATTR_SERVER_ADDRESS:()=>VX,ATTR_SERVER_PORT:()=>qX,ATTR_SERVICE_NAME:()=>Ym,ATTR_SERVICE_VERSION:()=>GX,ATTR_SIGNALR_CONNECTION_STATUS:()=>HX,ATTR_SIGNALR_TRANSPORT:()=>WX,ATTR_TELEMETRY_SDK_LANGUAGE:()=>hs,ATTR_TELEMETRY_SDK_NAME:()=>ds,ATTR_TELEMETRY_SDK_VERSION:()=>fs,ATTR_URL_FRAGMENT:()=>cJ,ATTR_URL_FULL:()=>lJ,ATTR_URL_PATH:()=>uJ,ATTR_URL_QUERY:()=>hJ,ATTR_URL_SCHEME:()=>dJ,ATTR_USER_AGENT_ORIGINAL:()=>fJ,AWSECSLAUNCHTYPEVALUES_EC2:()=>d9,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>f9,AwsEcsLaunchtypeValues:()=>p9,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Y7,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>K7,CLOUDPLATFORMVALUES_AWS_EC2:()=>X7,CLOUDPLATFORMVALUES_AWS_ECS:()=>J7,CLOUDPLATFORMVALUES_AWS_EKS:()=>Q7,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>e9,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Z7,CLOUDPLATFORMVALUES_AZURE_AKS:()=>n9,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>s9,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>r9,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>i9,CLOUDPLATFORMVALUES_AZURE_VM:()=>t9,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>u9,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>l9,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>a9,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>o9,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>c9,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>H7,CLOUDPROVIDERVALUES_AWS:()=>z7,CLOUDPROVIDERVALUES_AZURE:()=>j7,CLOUDPROVIDERVALUES_GCP:()=>$7,CloudPlatformValues:()=>h9,CloudProviderValues:()=>W7,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>bW,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>DW,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>MW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>LW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>wW,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>kW,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>PW,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>NW,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>UW,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>IW,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>xW,DBSYSTEMVALUES_ADABAS:()=>X$,DBSYSTEMVALUES_CACHE:()=>K$,DBSYSTEMVALUES_CASSANDRA:()=>fW,DBSYSTEMVALUES_CLOUDSCAPE:()=>q$,DBSYSTEMVALUES_COCKROACHDB:()=>RW,DBSYSTEMVALUES_COLDFUSION:()=>dW,DBSYSTEMVALUES_COSMOSDB:()=>SW,DBSYSTEMVALUES_COUCHBASE:()=>_W,DBSYSTEMVALUES_COUCHDB:()=>EW,DBSYSTEMVALUES_DB2:()=>k$,DBSYSTEMVALUES_DERBY:()=>Q$,DBSYSTEMVALUES_DYNAMODB:()=>TW,DBSYSTEMVALUES_EDB:()=>Y$,DBSYSTEMVALUES_ELASTICSEARCH:()=>AW,DBSYSTEMVALUES_FILEMAKER:()=>Z$,DBSYSTEMVALUES_FIREBIRD:()=>J$,DBSYSTEMVALUES_FIRSTSQL:()=>W$,DBSYSTEMVALUES_GEODE:()=>vW,DBSYSTEMVALUES_H2:()=>hW,DBSYSTEMVALUES_HANADB:()=>j$,DBSYSTEMVALUES_HBASE:()=>pW,DBSYSTEMVALUES_HIVE:()=>V$,DBSYSTEMVALUES_HSQLDB:()=>G$,DBSYSTEMVALUES_INFORMIX:()=>eW,DBSYSTEMVALUES_INGRES:()=>$$,DBSYSTEMVALUES_INSTANTDB:()=>tW,DBSYSTEMVALUES_INTERBASE:()=>rW,DBSYSTEMVALUES_MARIADB:()=>nW,DBSYSTEMVALUES_MAXDB:()=>z$,DBSYSTEMVALUES_MEMCACHED:()=>CW,DBSYSTEMVALUES_MONGODB:()=>mW,DBSYSTEMVALUES_MSSQL:()=>L$,DBSYSTEMVALUES_MYSQL:()=>D$,DBSYSTEMVALUES_NEO4J:()=>yW,DBSYSTEMVALUES_NETEZZA:()=>iW,DBSYSTEMVALUES_ORACLE:()=>U$,DBSYSTEMVALUES_OTHER_SQL:()=>I$,DBSYSTEMVALUES_PERVASIVE:()=>sW,DBSYSTEMVALUES_POINTBASE:()=>oW,DBSYSTEMVALUES_POSTGRESQL:()=>F$,DBSYSTEMVALUES_PROGRESS:()=>H$,DBSYSTEMVALUES_REDIS:()=>gW,DBSYSTEMVALUES_REDSHIFT:()=>B$,DBSYSTEMVALUES_SQLITE:()=>aW,DBSYSTEMVALUES_SYBASE:()=>cW,DBSYSTEMVALUES_TERADATA:()=>lW,DBSYSTEMVALUES_VERTICA:()=>uW,DB_SYSTEM_NAME_VALUE_MARIADB:()=>OK,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>bK,DB_SYSTEM_NAME_VALUE_MYSQL:()=>MK,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>NK,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>PK,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>xK,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>IK,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>LK,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>DK,DbCassandraConsistencyLevelValues:()=>FW,DbSystemValues:()=>OW,ERROR_TYPE_VALUE_OTHER:()=>kK,EVENT_EXCEPTION:()=>hQ,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>WW,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>$W,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>jW,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>KW,FAASINVOKEDPROVIDERVALUES_AWS:()=>XW,FAASINVOKEDPROVIDERVALUES_AZURE:()=>JW,FAASINVOKEDPROVIDERVALUES_GCP:()=>QW,FAASTRIGGERVALUES_DATASOURCE:()=>BW,FAASTRIGGERVALUES_HTTP:()=>VW,FAASTRIGGERVALUES_OTHER:()=>HW,FAASTRIGGERVALUES_PUBSUB:()=>qW,FAASTRIGGERVALUES_TIMER:()=>GW,FaasDocumentOperationValues:()=>YW,FaasInvokedProviderValues:()=>ZW,FaasTriggerValues:()=>zW,HOSTARCHVALUES_AMD64:()=>m9,HOSTARCHVALUES_ARM32:()=>g9,HOSTARCHVALUES_ARM64:()=>_9,HOSTARCHVALUES_IA64:()=>E9,HOSTARCHVALUES_PPC32:()=>S9,HOSTARCHVALUES_PPC64:()=>T9,HOSTARCHVALUES_X86:()=>y9,HTTPFLAVORVALUES_HTTP_1_0:()=>UY,HTTPFLAVORVALUES_HTTP_1_1:()=>kY,HTTPFLAVORVALUES_HTTP_2_0:()=>FY,HTTPFLAVORVALUES_QUIC:()=>VY,HTTPFLAVORVALUES_SPDY:()=>BY,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>jK,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>$K,HTTP_REQUEST_METHOD_VALUE_GET:()=>WK,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>YK,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>KK,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>zK,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>XK,HTTP_REQUEST_METHOD_VALUE_POST:()=>JK,HTTP_REQUEST_METHOD_VALUE_PUT:()=>QK,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>ZK,HostArchValues:()=>v9,HttpFlavorValues:()=>qY,JVM_MEMORY_TYPE_VALUE_HEAP:()=>lX,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>uX,JVM_THREAD_STATE_VALUE_BLOCKED:()=>fX,JVM_THREAD_STATE_VALUE_NEW:()=>pX,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>mX,JVM_THREAD_STATE_VALUE_TERMINATED:()=>gX,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>_X,JVM_THREAD_STATE_VALUE_WAITING:()=>EX,MESSAGETYPEVALUES_RECEIVED:()=>f8,MESSAGETYPEVALUES_SENT:()=>d8,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>GY,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>HY,MESSAGINGOPERATIONVALUES_PROCESS:()=>$Y,MESSAGINGOPERATIONVALUES_RECEIVE:()=>jY,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>pJ,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>mJ,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>gJ,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>SJ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>EJ,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>_J,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>TJ,METRIC_DB_CLIENT_OPERATION_DURATION:()=>yJ,METRIC_DOTNET_ASSEMBLY_COUNT:()=>vJ,METRIC_DOTNET_EXCEPTIONS:()=>AJ,METRIC_DOTNET_GC_COLLECTIONS:()=>CJ,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>RJ,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>OJ,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>bJ,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>MJ,METRIC_DOTNET_GC_PAUSE_TIME:()=>NJ,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>wJ,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>PJ,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>xJ,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>IJ,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>LJ,METRIC_DOTNET_PROCESS_CPU_TIME:()=>DJ,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>UJ,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>kJ,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>FJ,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>BJ,METRIC_DOTNET_TIMER_COUNT:()=>VJ,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>qJ,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>GJ,METRIC_JVM_CLASS_COUNT:()=>HJ,METRIC_JVM_CLASS_LOADED:()=>zJ,METRIC_JVM_CLASS_UNLOADED:()=>jJ,METRIC_JVM_CPU_COUNT:()=>$J,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>WJ,METRIC_JVM_CPU_TIME:()=>YJ,METRIC_JVM_GC_DURATION:()=>KJ,METRIC_JVM_MEMORY_COMMITTED:()=>XJ,METRIC_JVM_MEMORY_LIMIT:()=>JJ,METRIC_JVM_MEMORY_USED:()=>QJ,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>ZJ,METRIC_JVM_THREAD_COUNT:()=>eQ,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>tQ,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>rQ,METRIC_KESTREL_CONNECTION_DURATION:()=>nQ,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>iQ,METRIC_KESTREL_QUEUED_REQUESTS:()=>sQ,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>oQ,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>aQ,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>cQ,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>lQ,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>uQ,MessageTypeValues:()=>p8,MessagingDestinationKindValues:()=>zY,MessagingOperationValues:()=>WY,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>_Y,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>TY,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>mY,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>bY,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>EY,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>SY,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>RY,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>pY,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>NY,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>yY,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>AY,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>MY,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>vY,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>CY,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>PY,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>OY,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>LY,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>xY,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>IY,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>wY,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>gY,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>uY,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>hY,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>dY,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>cY,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>lY,NETTRANSPORTVALUES_INPROC:()=>sY,NETTRANSPORTVALUES_IP:()=>rY,NETTRANSPORTVALUES_IP_TCP:()=>eY,NETTRANSPORTVALUES_IP_UDP:()=>tY,NETTRANSPORTVALUES_OTHER:()=>oY,NETTRANSPORTVALUES_PIPE:()=>iY,NETTRANSPORTVALUES_UNIX:()=>nY,NETWORK_TRANSPORT_VALUE_PIPE:()=>OX,NETWORK_TRANSPORT_VALUE_QUIC:()=>bX,NETWORK_TRANSPORT_VALUE_TCP:()=>MX,NETWORK_TRANSPORT_VALUE_UDP:()=>NX,NETWORK_TRANSPORT_VALUE_UNIX:()=>wX,NETWORK_TYPE_VALUE_IPV4:()=>xX,NETWORK_TYPE_VALUE_IPV6:()=>IX,NetHostConnectionSubtypeValues:()=>DY,NetHostConnectionTypeValues:()=>fY,NetTransportValues:()=>aY,OSTYPEVALUES_AIX:()=>P9,OSTYPEVALUES_DARWIN:()=>R9,OSTYPEVALUES_DRAGONFLYBSD:()=>N9,OSTYPEVALUES_FREEBSD:()=>O9,OSTYPEVALUES_HPUX:()=>w9,OSTYPEVALUES_LINUX:()=>C9,OSTYPEVALUES_NETBSD:()=>b9,OSTYPEVALUES_OPENBSD:()=>M9,OSTYPEVALUES_SOLARIS:()=>x9,OSTYPEVALUES_WINDOWS:()=>A9,OSTYPEVALUES_Z_OS:()=>I9,OTEL_STATUS_CODE_VALUE_ERROR:()=>kX,OTEL_STATUS_CODE_VALUE_OK:()=>FX,OsTypeValues:()=>L9,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>i8,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>e8,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>KY,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>l8,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>QY,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>n8,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>a8,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>JY,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>ZY,RPCGRPCSTATUSCODEVALUES_OK:()=>YY,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>s8,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>t8,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>r8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>u8,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>c8,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>o8,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>XY,RpcGrpcStatusCodeValues:()=>h8,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>qj,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Zj,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>Fj,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Lj,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Jj,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>$j,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>zj,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>e$,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Gj,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Dj,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Vj,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>jj,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Bj,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Uj,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>kj,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Qj,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Yj,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Kj,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Hj,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Wj,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Ij,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Xj,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>dz,SEMATTRS_CODE_FILEPATH:()=>gj,SEMATTRS_CODE_FUNCTION:()=>pj,SEMATTRS_CODE_LINENO:()=>_j,SEMATTRS_CODE_NAMESPACE:()=>mj,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Az,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Mz,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>bz,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Rz,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>yz,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>vz,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Oz,SEMATTRS_DB_CASSANDRA_TABLE:()=>Cz,SEMATTRS_DB_CONNECTION_STRING:()=>pz,SEMATTRS_DB_HBASE_NAMESPACE:()=>Nz,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>gz,SEMATTRS_DB_MONGODB_COLLECTION:()=>Pz,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Tz,SEMATTRS_DB_NAME:()=>_z,SEMATTRS_DB_OPERATION:()=>Sz,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>wz,SEMATTRS_DB_SQL_TABLE:()=>xz,SEMATTRS_DB_STATEMENT:()=>Ez,SEMATTRS_DB_SYSTEM:()=>fz,SEMATTRS_DB_USER:()=>mz,SEMATTRS_ENDUSER_ID:()=>lj,SEMATTRS_ENDUSER_ROLE:()=>uj,SEMATTRS_ENDUSER_SCOPE:()=>hj,SEMATTRS_EXCEPTION_ESCAPED:()=>Uz,SEMATTRS_EXCEPTION_MESSAGE:()=>Lz,SEMATTRS_EXCEPTION_STACKTRACE:()=>Dz,SEMATTRS_EXCEPTION_TYPE:()=>Iz,SEMATTRS_FAAS_COLDSTART:()=>jz,SEMATTRS_FAAS_CRON:()=>zz,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Bz,SEMATTRS_FAAS_DOCUMENT_NAME:()=>Gz,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Vz,SEMATTRS_FAAS_DOCUMENT_TIME:()=>qz,SEMATTRS_FAAS_EXECUTION:()=>Fz,SEMATTRS_FAAS_INVOKED_NAME:()=>$z,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Wz,SEMATTRS_FAAS_INVOKED_REGION:()=>Yz,SEMATTRS_FAAS_TIME:()=>Hz,SEMATTRS_FAAS_TRIGGER:()=>kz,SEMATTRS_HTTP_CLIENT_IP:()=>xj,SEMATTRS_HTTP_FLAVOR:()=>Cj,SEMATTRS_HTTP_HOST:()=>yj,SEMATTRS_HTTP_METHOD:()=>Ej,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Oj,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>bj,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Mj,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Nj,SEMATTRS_HTTP_ROUTE:()=>Pj,SEMATTRS_HTTP_SCHEME:()=>vj,SEMATTRS_HTTP_SERVER_NAME:()=>wj,SEMATTRS_HTTP_STATUS_CODE:()=>Aj,SEMATTRS_HTTP_TARGET:()=>Tj,SEMATTRS_HTTP_URL:()=>Sj,SEMATTRS_HTTP_USER_AGENT:()=>Rj,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>w$,SEMATTRS_MESSAGE_ID:()=>N$,SEMATTRS_MESSAGE_TYPE:()=>M$,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>P$,SEMATTRS_MESSAGING_CONSUMER_ID:()=>f$,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>l$,SEMATTRS_MESSAGING_DESTINATION:()=>r$,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>n$,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>_$,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>g$,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>m$,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>E$,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>S$,SEMATTRS_MESSAGING_MESSAGE_ID:()=>c$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>h$,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>u$,SEMATTRS_MESSAGING_OPERATION:()=>d$,SEMATTRS_MESSAGING_PROTOCOL:()=>s$,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>o$,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>p$,SEMATTRS_MESSAGING_SYSTEM:()=>t$,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>i$,SEMATTRS_MESSAGING_URL:()=>a$,SEMATTRS_NET_HOST_CARRIER_ICC:()=>aj,SEMATTRS_NET_HOST_CARRIER_MCC:()=>sj,SEMATTRS_NET_HOST_CARRIER_MNC:()=>oj,SEMATTRS_NET_HOST_CARRIER_NAME:()=>ij,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>nj,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>rj,SEMATTRS_NET_HOST_IP:()=>Zz,SEMATTRS_NET_HOST_NAME:()=>tj,SEMATTRS_NET_HOST_PORT:()=>ej,SEMATTRS_NET_PEER_IP:()=>Xz,SEMATTRS_NET_PEER_NAME:()=>Qz,SEMATTRS_NET_PEER_PORT:()=>Jz,SEMATTRS_NET_TRANSPORT:()=>Kz,SEMATTRS_PEER_SERVICE:()=>cj,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>A$,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>O$,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>b$,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>R$,SEMATTRS_RPC_JSONRPC_VERSION:()=>C$,SEMATTRS_RPC_METHOD:()=>v$,SEMATTRS_RPC_SERVICE:()=>y$,SEMATTRS_RPC_SYSTEM:()=>T$,SEMATTRS_THREAD_ID:()=>dj,SEMATTRS_THREAD_NAME:()=>fj,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>y8,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>T8,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>v8,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>A8,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>C8,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>R8,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>O8,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>M8,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>b8,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>w8,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>N8,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>g8,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>E8,SEMRESATTRS_CLOUD_PLATFORM:()=>S8,SEMRESATTRS_CLOUD_PROVIDER:()=>m8,SEMRESATTRS_CLOUD_REGION:()=>_8,SEMRESATTRS_CONTAINER_ID:()=>x8,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>L8,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>D8,SEMRESATTRS_CONTAINER_NAME:()=>P8,SEMRESATTRS_CONTAINER_RUNTIME:()=>I8,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>U8,SEMRESATTRS_DEVICE_ID:()=>k8,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>F8,SEMRESATTRS_DEVICE_MODEL_NAME:()=>B8,SEMRESATTRS_FAAS_ID:()=>q8,SEMRESATTRS_FAAS_INSTANCE:()=>H8,SEMRESATTRS_FAAS_MAX_MEMORY:()=>z8,SEMRESATTRS_FAAS_NAME:()=>V8,SEMRESATTRS_FAAS_VERSION:()=>G8,SEMRESATTRS_HOST_ARCH:()=>Y8,SEMRESATTRS_HOST_ID:()=>j8,SEMRESATTRS_HOST_IMAGE_ID:()=>X8,SEMRESATTRS_HOST_IMAGE_NAME:()=>K8,SEMRESATTRS_HOST_IMAGE_VERSION:()=>J8,SEMRESATTRS_HOST_NAME:()=>$8,SEMRESATTRS_HOST_TYPE:()=>W8,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Q8,SEMRESATTRS_K8S_CONTAINER_NAME:()=>i7,SEMRESATTRS_K8S_CRONJOB_NAME:()=>g7,SEMRESATTRS_K8S_CRONJOB_UID:()=>m7,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>d7,SEMRESATTRS_K8S_DAEMONSET_UID:()=>h7,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>c7,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>a7,SEMRESATTRS_K8S_JOB_NAME:()=>p7,SEMRESATTRS_K8S_JOB_UID:()=>f7,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>t7,SEMRESATTRS_K8S_NODE_NAME:()=>Z8,SEMRESATTRS_K8S_NODE_UID:()=>e7,SEMRESATTRS_K8S_POD_NAME:()=>n7,SEMRESATTRS_K8S_POD_UID:()=>r7,SEMRESATTRS_K8S_REPLICASET_NAME:()=>o7,SEMRESATTRS_K8S_REPLICASET_UID:()=>s7,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>u7,SEMRESATTRS_K8S_STATEFULSET_UID:()=>l7,SEMRESATTRS_OS_DESCRIPTION:()=>E7,SEMRESATTRS_OS_NAME:()=>S7,SEMRESATTRS_OS_TYPE:()=>_7,SEMRESATTRS_OS_VERSION:()=>T7,SEMRESATTRS_PROCESS_COMMAND:()=>C7,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>O7,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>R7,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>v7,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>A7,SEMRESATTRS_PROCESS_OWNER:()=>b7,SEMRESATTRS_PROCESS_PID:()=>y7,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>w7,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>M7,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>N7,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>I7,SEMRESATTRS_SERVICE_NAME:()=>P7,SEMRESATTRS_SERVICE_NAMESPACE:()=>x7,SEMRESATTRS_SERVICE_VERSION:()=>L7,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>F7,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>U7,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>D7,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>k7,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>q7,SEMRESATTRS_WEBENGINE_NAME:()=>B7,SEMRESATTRS_WEBENGINE_VERSION:()=>V7,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>zX,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>jX,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>$X,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>YX,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>KX,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>XX,SemanticAttributes:()=>x$,SemanticResourceAttributes:()=>G7,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>D9,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>U9,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>k9,TELEMETRYSDKLANGUAGEVALUES_GO:()=>F9,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>B9,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>V9,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>q9,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>G9,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>H9,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>z9,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>JX,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>QX,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>ZX,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>eJ,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>tJ,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Km,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>rJ,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>nJ,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>iJ,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>sJ,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>oJ,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>aJ,TelemetrySdkLanguageValues:()=>j9});var uu=T(()=>{"use strict";TP();$1();W1();Y1();K1()});var J1,Q1=T(()=>{"use strict";J1="process.runtime.name"});var vn,Z1=T(()=>{"use strict";NO();uu();Q1();vn={[ds]:"opentelemetry",[J1]:"node",[hs]:Km,[fs]:MO}});var An,eI=T(()=>{"use strict";OO();bO();Z1();An=performance});var Xm=T(()=>{"use strict";eI()});function It(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*fQ);return[r,n]}function rI(){return An.timeOrigin}function Jm(t){let e=It(An.timeOrigin),r=It(typeof t=="number"?t:An.now());return Qm(e,r)}function nI(t){if(fu(t))return t;if(typeof t=="number")return t<An.timeOrigin?Jm(t):It(t);if(t instanceof Date)return It(t.getTime());throw TypeError("Invalid input type")}function iI(t,e){let r=e[0]-t[0],n=e[1]-t[1];return n<0&&(r-=1,n+=hu),[r,n]}function sI(t){let e=tI,r=`${"0".repeat(e)}${t[1]}Z`,n=r.substring(r.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",n)}function du(t){return t[0]*hu+t[1]}function oI(t){return t[0]*1e3+t[1]/1e6}function ui(t){return t[0]*1e6+t[1]/1e3}function fu(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}function aI(t){return fu(t)||typeof t=="number"||t instanceof Date}function Qm(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=hu&&(r[1]-=hu,r[0]+=1),r}var tI,dQ,fQ,hu,cI=T(()=>{"use strict";Xm();tI=9,dQ=6,fQ=Math.pow(10,dQ),hu=Math.pow(10,tI)});function lI(t){typeof t!="number"&&t.unref()}var uI=T(()=>{"use strict"});var Ie,hI=T(()=>{"use strict";(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Ie||(Ie={}))});var pu,dI=T(()=>{"use strict";Q();pu=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let r=new Set;for(let n of this._propagators){let i=typeof n.fields=="function"?n.fields():[];for(let s of i)r.add(s)}this._fields=Array.from(r)}inject(e,r,n){for(let i of this._propagators)try{i.inject(e,r,n)}catch(s){P.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,r,n)}catch(o){P.warn(`Failed to extract with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}}});function eg(t){return gQ.test(t)}function tg(t){return _Q.test(t)&&!EQ.test(t)}var Zm,pQ,mQ,gQ,_Q,EQ,fI=T(()=>{"use strict";Zm="[_0-9a-z-*/]",pQ=`[a-z]${Zm}{0,255}`,mQ=`[a-z0-9]${Zm}{0,240}@[a-z]${Zm}{0,13}`,gQ=new RegExp(`^(?:${pQ}|${mQ})$`),_Q=/^[ -~]{0,255}[!-~]$/,EQ=/,|=/});var SQ,pI,mI,gI,ps,rg=T(()=>{"use strict";fI();SQ=32,pI=512,mI=",",gI="=",ps=class t{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e=="string"?e:"",this._length=this._rawTraceState.length}set(e,r){if(!eg(e)||!tg(r))return this;let n=this._getState(),i=n.get(e),s=this._length;if(typeof i=="string"?s+=r.length-i.length:s+=e.length+r.length+(n.size>0?2:1),s>pI)return this;let o=new Map(n);return o.delete(e),o.set(e,r),this._fromState(o,s)}unset(e){let r=this._getState(),n=r.get(e);if(typeof n!="string")return this;let i=this._length-(e.length+n.length+1);r.size>1&&(i=i-1);let s=new Map(r);return s.delete(e),this._fromState(s,i)}get(e){return this._getState().get(e)}serialize(){let e="",r=0;for(let n of this._getState())r>0&&(e=mI+e),e=`${n[0]}${gI}${n[1]}`+e,r++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(mI),r=new Map,n=0;for(let i of e){let s=i.trim(),o=s.indexOf(gI);if(o===-1)continue;let a=s.slice(0,o),c=s.slice(o+1);if(!eg(a)||!tg(c))continue;let l=n+s.length+(r.size>0?1:0);if(!(l>pI)&&(r.set(a,c),n=l,r.size>=SQ))break}return this._length=n,this._internalState=new Map(Array.from(r.entries()).reverse()),this._internalState}_fromState(e,r){let n=Object.create(t.prototype);return n._internalState=e,n._length=r,n}}});function ng(t){let e=RQ.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var sa,oa,TQ,yQ,vQ,AQ,CQ,RQ,mu,_I=T(()=>{"use strict";Q();na();rg();sa="traceparent",oa="tracestate",TQ="00",yQ="(?!ff)[\\da-f]{2}",vQ="(?![0]{32})[\\da-f]{32}",AQ="(?![0]{16})[\\da-f]{16}",CQ="[\\da-f]{2}",RQ=new RegExp(`^\\s?(${yQ})-(${vQ})-(${AQ})-(${CQ})(-.*)?\\s?$`);mu=class{inject(e,r,n){let i=Qf.getSpanContext(e);if(!i||cs(e)||!Ky(i))return;let s=`${TQ}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||Yy.NONE).toString(16)}`;n.set(r,sa,s),i.traceState&&n.set(r,oa,i.traceState.serialize())}extract(e,r,n){let i=n.get(r,sa);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=ng(s);if(!o)return e;o.isRemote=!0;let a=n.get(r,oa);if(a){let c=Array.isArray(a)?a.join(","):a;o.traceState=new ps(typeof c=="string"?c:void 0)}return Qf.setSpanContext(e,o)}fields(){return[sa,oa]}}});function EI(t,e){return t.setValue(ig,e)}function SI(t){return t.deleteValue(ig)}function TI(t){return t.getValue(ig)}var ig,gu,yI=T(()=>{"use strict";Q();ig=Uc("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(gu||(gu={}))});function sg(t){if(!xQ(t)||IQ(t)!==OQ)return!1;let e=PQ(t);if(e===null)return!0;let r=CI.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&vI.call(r)===wQ}function xQ(t){return t!=null&&typeof t=="object"}function IQ(t){return t==null?t===void 0?MQ:bQ:hi&&hi in Object(t)?LQ(t):DQ(t)}function LQ(t){let e=CI.call(t,hi),r=t[hi],n=!1;try{t[hi]=void 0,n=!0}catch{}let i=RI.call(t);return n&&(e?t[hi]=r:delete t[hi]),i}function DQ(t){return RI.call(t)}var OQ,bQ,MQ,NQ,vI,wQ,PQ,AI,CI,hi,RI,OI=T(()=>{"use strict";OQ="[object Object]",bQ="[object Null]",MQ="[object Undefined]",NQ=Function.prototype,vI=NQ.toString,wQ=vI.call(Object),PQ=Object.getPrototypeOf,AI=Object.prototype,CI=AI.hasOwnProperty,hi=Symbol?Symbol.toStringTag:void 0,RI=AI.toString});function MI(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=NI(e,t.shift(),0,r);return e}function og(t){return Eu(t)?t.slice():t}function NI(t,e,r=0,n){let i;if(!(r>UQ)){if(r++,_u(t)||_u(e)||wI(e))i=og(e);else if(Eu(t)){if(i=t.slice(),Eu(e))for(let s=0,o=e.length;s<o;s++)i.push(og(e[s]));else if(aa(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];c==="__proto__"||c==="constructor"||c==="prototype"||(i[c]=og(e[c]))}}}else if(aa(t))if(aa(e)){if(!kQ(t,e))return e;i=Object.assign({},t);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let c=s[o];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let l=e[c];if(_u(l))typeof l>"u"?delete i[c]:i[c]=l;else{let h=i[c],d=l;if(bI(t,c,n)||bI(e,c,n))delete i[c];else{if(aa(h)&&aa(d)){let f=n.get(h)||[],p=n.get(d)||[];f.push({obj:t,key:c}),p.push({obj:e,key:c}),n.set(h,f),n.set(d,p)}i[c]=NI(i[c],l,r,n)}}}}else i=e;return i}}function bI(t,e,r){let n=r.get(t[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===t)return!0}return!1}function Eu(t){return Array.isArray(t)}function wI(t){return typeof t=="function"}function aa(t){return!_u(t)&&!Eu(t)&&!wI(t)&&typeof t=="object"}function _u(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function kQ(t,e){return!(!sg(t)||!sg(e))}var UQ,PI=T(()=>{"use strict";OI();UQ=20});function xI(t,e){let r,n=new Promise(function(s,o){r=setTimeout(function(){o(new ca("Operation timed out."))},e)});return Promise.race([t,n]).then(i=>(clearTimeout(r),i),i=>{throw clearTimeout(r),i})}var ca,II=T(()=>{"use strict";ca=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});function ag(t,e){return typeof e=="string"?t===e:!!t.match(e)}function LI(t,e){if(!e)return!1;for(let r of e)if(ag(t,r))return!0;return!1}var DI=T(()=>{"use strict"});var Su,UI=T(()=>{"use strict";Su=class{_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 Tu,kI=T(()=>{"use strict";UI();Tu=class{_isCalled=!1;_deferred=new Su;_callback;_that;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 BI(t){if(t==null)return;let e=FI[t.toUpperCase()];return e??(P.warn(`Unknown log level "${t}", expected one of ${Object.keys(FI)}, using default`),Ht.INFO)}var FI,VI=T(()=>{"use strict";Q();FI={ALL:Ht.ALL,VERBOSE:Ht.VERBOSE,DEBUG:Ht.DEBUG,INFO:Ht.INFO,WARN:Ht.WARN,ERROR:Ht.ERROR,NONE:Ht.NONE}});function qI(t,e){return new Promise(r=>{Oo.with(ru(Oo.active()),()=>{t.export(e,r)})})}var GI=T(()=>{"use strict";Q();na()});var yu={};kr(yu,{AnchoredClock:()=>su,BindOnceFuture:()=>Tu,CompositePropagator:()=>pu,ExportResultCode:()=>Ie,RPCType:()=>gu,SDK_INFO:()=>vn,TRACE_PARENT_HEADER:()=>sa,TRACE_STATE_HEADER:()=>oa,TimeoutError:()=>ca,TraceState:()=>ps,W3CBaggagePropagator:()=>iu,W3CTraceContextPropagator:()=>mu,_globalThis:()=>lu,addHrTimes:()=>Qm,callWithTimeout:()=>xI,deleteRPCMetadata:()=>SI,diagLogLevelFromString:()=>BI,getBooleanFromEnv:()=>au,getNumberFromEnv:()=>us,getRPCMetadata:()=>TI,getStringFromEnv:()=>tt,getStringListFromEnv:()=>cu,getTimeOrigin:()=>rI,globalErrorHandler:()=>ia,hrTime:()=>Jm,hrTimeDuration:()=>iI,hrTimeToMicroseconds:()=>ui,hrTimeToMilliseconds:()=>oI,hrTimeToNanoseconds:()=>du,hrTimeToTimeStamp:()=>sI,internal:()=>cg,isAttributeValue:()=>jm,isTimeInput:()=>aI,isTimeInputHrTime:()=>fu,isTracingSuppressed:()=>cs,isUrlIgnored:()=>LI,loggingErrorHandler:()=>ou,merge:()=>MI,millisToHrTime:()=>It,otperformance:()=>An,parseKeyPairsIntoRecord:()=>li,parseTraceParent:()=>ng,sanitizeAttributes:()=>SO,setGlobalErrorHandler:()=>AO,setRPCMetadata:()=>EI,suppressTracing:()=>ru,timeInputToHrTime:()=>nI,unrefTimer:()=>lI,unsuppressTracing:()=>fO,urlMatches:()=>ag});var cg,rt=T(()=>{"use strict";_O();EO();yO();CO();$m();cI();uI();hI();zm();Xm();dI();_I();yI();na();rg();PI();II();DI();kI();VI();GI();cg={_export:qI}});var ms,la,HI=T(()=>{"use strict";is();rt();qr();ms=class{startTime;_current;sampleTime;constructor(e,r=0,n=[0,0]){this.startTime=e,this._current=r,this.sampleTime=n}record(e){this._current=e,this.sampleTime=It(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},la=class{kind=xt.LAST_VALUE;createAccumulation(e){return new ms(e)}merge(e,r){let n=ui(r.sampleTime)>=ui(e.sampleTime)?r:e;return new ms(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,r){let n=ui(r.sampleTime)>=ui(e.sampleTime)?r:e;return new ms(r.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,r,n,i){return{descriptor:e,aggregationTemporality:r,dataPointType:Re.GAUGE,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()}))}}}});var Cn,gs,zI=T(()=>{"use strict";is();qr();Cn=class{startTime;monotonic;_current;reset;constructor(e,r,n=0,i=!1){this.startTime=e,this.monotonic=r,this._current=n,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}},gs=class{kind=xt.SUM;monotonic;constructor(e){this.monotonic=e}createAccumulation(e){return new Cn(e,this.monotonic)}merge(e,r){let n=e.toPointValue(),i=r.toPointValue();return r.reset?new Cn(r.startTime,this.monotonic,i,r.reset):new Cn(e.startTime,this.monotonic,n+i)}diff(e,r){let n=e.toPointValue(),i=r.toPointValue();return this.monotonic&&n>i?new Cn(r.startTime,this.monotonic,i,!0):new Cn(r.startTime,this.monotonic,i-n)}toMetricData(e,r,n,i){return{descriptor:e,aggregationTemporality:r,dataPointType:Re.SUM,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()})),isMonotonic:this.monotonic}}}});var jI=T(()=>{"use strict";tO();rO();dO();HI();zI()});var lg,ug,hg,dg,ua,ha,fg,pg,mg,gg,_g,Age,$I,WI=T(()=>{"use strict";Q();jI();qr();lg=class t{static DEFAULT_INSTANCE=new Qo;createAggregator(e){return t.DEFAULT_INSTANCE}},ug=class t{static MONOTONIC_INSTANCE=new gs(!0);static NON_MONOTONIC_INSTANCE=new gs(!1);createAggregator(e){switch(e.type){case j.COUNTER:case j.OBSERVABLE_COUNTER:case j.HISTOGRAM:return t.MONOTONIC_INSTANCE;default:return t.NON_MONOTONIC_INSTANCE}}},hg=class t{static DEFAULT_INSTANCE=new la;createAggregator(e){return t.DEFAULT_INSTANCE}},dg=class t{static DEFAULT_INSTANCE=new os([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(e){return t.DEFAULT_INSTANCE}},ua=class{_boundaries;_recordMinMax;constructor(e,r=!0){if(e==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");e=e.concat(),e=e.sort((s,o)=>s-o);let n=e.lastIndexOf(-1/0),i=e.indexOf(1/0);i===-1&&(i=void 0),this._boundaries=e.slice(n+1,i),this._recordMinMax=r}createAggregator(e){return new os(this._boundaries,this._recordMinMax)}},ha=class{_maxSize;_recordMinMax;constructor(e=160,r=!0){this._maxSize=e,this._recordMinMax=r}createAggregator(e){return new ra(this._maxSize,this._recordMinMax)}},fg=class{_resolve(e){switch(e.type){case j.COUNTER:case j.UP_DOWN_COUNTER:case j.OBSERVABLE_COUNTER:case j.OBSERVABLE_UP_DOWN_COUNTER:return mg;case j.GAUGE:case j.OBSERVABLE_GAUGE:return gg;case j.HISTOGRAM:return e.advice.explicitBucketBoundaries?new ua(e.advice.explicitBucketBoundaries):_g}return P.warn(`Unable to recognize instrument type: ${e.type}`),pg}createAggregator(e){return this._resolve(e).createAggregator(e)}},pg=new lg,mg=new ug,gg=new hg,_g=new dg,Age=new ha,$I=new fg});function vu(t){switch(t.type){case nt.DEFAULT:return $I;case nt.DROP:return pg;case nt.SUM:return mg;case nt.LAST_VALUE:return gg;case nt.EXPONENTIAL_HISTOGRAM:{let e=t;return new ha(e.options?.maxSize,e.options?.recordMinMax)}case nt.EXPLICIT_BUCKET_HISTOGRAM:{let e=t;return e.options==null?_g:new ua(e.options?.boundaries,e.options?.recordMinMax)}default:throw new Error("Unsupported Aggregation")}}var nt,da=T(()=>{"use strict";WI();(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.DROP=1]="DROP",t[t.SUM=2]="SUM",t[t.LAST_VALUE=3]="LAST_VALUE",t[t.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(nt||(nt={}))});var YI,Au,Eg=T(()=>{"use strict";Wl();da();YI=t=>({type:nt.DEFAULT}),Au=t=>xe.CUMULATIVE});var _s,Sg=T(()=>{"use strict";Q();Sr();Eg();_s=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(e){this._aggregationSelector=e?.aggregationSelector??YI,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??Au,this._metricProducers=e?.metricProducers??[],this._cardinalitySelector=e?.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[r,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:e?.timeoutMillis}))]),i=r.errors.concat(n.flatMap(a=>a.errors)),s=r.resourceMetrics.resource,o=r.resourceMetrics.scopeMetrics.concat(n.flatMap(a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:s,scopeMetrics:o},errors:i}}async shutdown(e){if(this._shutdown){P.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await yn(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){P.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await yn(this.onForceFlush(),e.timeoutMillis)}}});var di,KI=T(()=>{"use strict";Q();rt();Sg();Sr();qr();di=class extends _s{_interval;_exporter;_exportInterval;_exportTimeout;constructor(e){let{exporter:r,exportIntervalMillis:n=6e4,metricProducers:i,cardinalityLimits:s}=e,{exportTimeoutMillis:o=3e4}=e;if(super({aggregationSelector:r.selectAggregation?.bind(r),aggregationTemporalitySelector:r.selectAggregationTemporality?.bind(r),metricProducers:i,cardinalitySelector:a=>{let c={default:2e3,...s};switch(a){case j.COUNTER:return c.counter??c.default;case j.GAUGE:return c.gauge??c.default;case j.HISTOGRAM:return c.histogram??c.default;case j.OBSERVABLE_COUNTER:return c.observableCounter??c.default;case j.OBSERVABLE_UP_DOWN_COUNTER:return c.observableUpDownCounter??c.default;case j.OBSERVABLE_GAUGE:return c.observableGauge??c.default;case j.UP_DOWN_COUNTER:return c.upDownCounter??c.default;default:return c.default}}}),n<=0)throw Error("exportIntervalMillis must be greater than 0");if(o<=0)throw Error("exportTimeoutMillis must be greater than 0");if(n<o){if("exportIntervalMillis"in e&&"exportTimeoutMillis"in e)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");P.info(`Timeout of ${o} exceeds the interval of ${n}. Clamping timeout to interval duration.`),o=n}this._exportInterval=n,this._exportTimeout=o,this._exporter=r}async _runOnce(){try{await yn(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof ci){P.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}ia(e)}}async _doRun(){let{resourceMetrics:e,errors:r}=await this.collect({timeoutMillis:this._exportTimeout});if(r.length>0&&P.error("PeriodicExportingMetricReader: metrics collection errors",...r),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(i){P.debug("Error while resolving async portion of resource: ",i),ia(i)}if(e.scopeMetrics.length===0)return;let n=await cg._export(this._exporter,e);if(n.code!==Ie.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${n.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!="number"&&this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}});var Cu,XI=T(()=>{"use strict";rt();Cu=class{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(e){this._aggregationTemporality=e}export(e,r){if(this._shutdown){setTimeout(()=>r({code:Ie.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>r({code:Ie.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}});var Ru,JI=T(()=>{"use strict";rt();Eg();Ru=class t{_shutdown=!1;_temporalitySelector;constructor(e){this._temporalitySelector=e?.temporalitySelector??Au}export(e,r){if(this._shutdown){r({code:Ie.FAILED});return}return t._sendMetrics(e,r)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,r){for(let n of e.scopeMetrics)for(let i of n.metrics)console.dir({descriptor:i.descriptor,dataPointType:i.dataPointType,dataPoints:i.dataPoints},{depth:null});r({code:Ie.SUCCESS})}}});function QI(){if(Ou===void 0)try{let t=globalThis.process.argv0;Ou=t?`unknown_service:${t}`:"unknown_service"}catch{Ou="unknown_service"}return Ou}var Ou,ZI=T(()=>{"use strict"});var Es,eL=T(()=>{"use strict";Es=t=>t!==null&&typeof t=="object"&&typeof t.then=="function"});function rL(t,e){return Tg.FromAttributeList(Object.entries(t),e)}function yg(){return rL({[Ym]:QI(),[hs]:vn[hs],[ds]:vn[ds],[fs]:vn[fs]})}function tL(t){return t.map(([e,r])=>Es(r)?[e,r.catch(n=>{P.debug("promise rejection for resource attribute: %s - %s",e,n)})]:[e,r])}function FQ(t){if(typeof t=="string"||t===void 0)return t;P.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function BQ(t,e){let r=t?.schemaUrl,n=e?.schemaUrl,i=r===void 0||r==="",s=n===void 0||n==="";if(i)return n;if(s||r===n)return r;P.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}var Tg,nL=T(()=>{"use strict";Q();rt();uu();ZI();eL();Tg=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let n=new t({},r);return n._rawAttributes=tL(e),n._asyncAttributesPending=e.filter(([i,s])=>Es(s)).length>0,n}constructor(e,r){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([i,s])=>(Es(s)&&(this._asyncAttributesPending=!0),[i,s])),this._rawAttributes=tL(this._rawAttributes),this._schemaUrl=FQ(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,n]=this._rawAttributes[e];this._rawAttributes[e]=[r,Es(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&P.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,n]of this._rawAttributes){if(Es(n)){P.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(e[r]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(e==null)return this;let r=BQ(this,e),n=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],n)}}});var iL=T(()=>{"use strict";nL()});var bu,sL=T(()=>{"use strict";bu=class{_registeredViews=[];addView(e){this._registeredViews.push(e)}findViews(e,r){return this._registeredViews.filter(i=>this._matchInstrument(i.instrumentSelector,e)&&this._matchMeter(i.meterSelector,r))}_matchInstrument(e,r){return(e.getType()===void 0||r.type===e.getType())&&e.getNameFilter().match(r.name)&&e.getUnitFilter().match(r.unit)}_matchMeter(e,r){return e.getNameFilter().match(r.name)&&(r.version===void 0||e.getVersionFilter().match(r.version))&&(r.schemaUrl===void 0||e.getSchemaUrlFilter().match(r.schemaUrl))}}});function yr(t,e,r){return qQ(t)||P.warn(`Invalid metric name: "${t}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:t,type:e,description:r?.description??"",unit:r?.unit??"",valueType:r?.valueType??Nt.DOUBLE,advice:r?.advice??{}}}function oL(t,e){return{name:t.name??e.name,description:t.description??e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}function aL(t,e){return eO(t.name,e.name)&&t.unit===e.unit&&t.type===e.type&&t.valueType===e.valueType}function qQ(t){return VQ.test(t)}var VQ,fa=T(()=>{"use strict";Q();Sr();VQ=/^[a-z][a-z0-9_.\-/]{0,254}$/i});function pa(t){return t instanceof Ts}var Ss,Mu,Nu,wu,Pu,Ts,xu,Iu,Lu,Du=T(()=>{"use strict";Q();rt();Ss=class{_writableMetricStorage;_descriptor;constructor(e,r){this._writableMetricStorage=e,this._descriptor=r}_record(e,r={},n=Oo.active()){if(typeof e!="number"){P.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Nt.INT&&!Number.isInteger(e)&&(P.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,r,n,It(Date.now()))}},Mu=class extends Ss{add(e,r,n){this._record(e,r,n)}},Nu=class extends Ss{add(e,r,n){if(e<0){P.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,r,n)}},wu=class extends Ss{record(e,r,n){this._record(e,r,n)}},Pu=class extends Ss{record(e,r,n){if(e<0){P.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,r,n)}},Ts=class{_metricStorages;_descriptor;_observableRegistry;constructor(e,r,n){this._descriptor=e,this._metricStorages=r,this._observableRegistry=n}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}},xu=class extends Ts{},Iu=class extends Ts{},Lu=class extends Ts{}});var Uu,cL=T(()=>{"use strict";fa();Du();qr();Uu=class{_meterSharedState;constructor(e){this._meterSharedState=e}createGauge(e,r){let n=yr(e,j.GAUGE,r),i=this._meterSharedState.registerMetricStorage(n);return new wu(i,n)}createHistogram(e,r){let n=yr(e,j.HISTOGRAM,r),i=this._meterSharedState.registerMetricStorage(n);return new Pu(i,n)}createCounter(e,r){let n=yr(e,j.COUNTER,r),i=this._meterSharedState.registerMetricStorage(n);return new Nu(i,n)}createUpDownCounter(e,r){let n=yr(e,j.UP_DOWN_COUNTER,r),i=this._meterSharedState.registerMetricStorage(n);return new Mu(i,n)}createObservableGauge(e,r){let n=yr(e,j.OBSERVABLE_GAUGE,r),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Iu(n,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,r){let n=yr(e,j.OBSERVABLE_COUNTER,r),i=this._meterSharedState.registerAsyncMetricStorage(n);return new xu(n,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,r){let n=yr(e,j.OBSERVABLE_UP_DOWN_COUNTER,r),i=this._meterSharedState.registerAsyncMetricStorage(n);return new Lu(n,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,r){this._meterSharedState.observableRegistry.addBatchCallback(e,r)}removeBatchObservableCallback(e,r){this._meterSharedState.observableRegistry.removeBatchCallback(e,r)}}});var ys,vg=T(()=>{"use strict";fa();ys=class{_instrumentDescriptor;constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=yr(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}});var Ag,yt,ma=T(()=>{"use strict";Sr();Ag=class{_valueMap=new Map;_keyMap=new Map;_hash;constructor(e){this._hash=e}get(e,r){return r??=this._hash(e),this._valueMap.get(r)}getOrDefault(e,r){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let i=r();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,i),i}set(e,r,n){n??=this._hash(e),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,r)}has(e,r){return r??=this._hash(e),this._valueMap.has(r)}*keys(){let e=this._keyMap.entries(),r=e.next();for(;r.done!==!0;)yield[r.value[1],r.value[0]],r=e.next()}*entries(){let e=this._valueMap.entries(),r=e.next();for(;r.done!==!0;)yield[this._keyMap.get(r.value[0]),r.value[1],r.value[0]],r=e.next()}get size(){return this._valueMap.size}},yt=class extends Ag{constructor(){super(Yl)}}});var vs,Cg=T(()=>{"use strict";Sr();ma();vs=class{_activeCollectionStorage=new yt;_cumulativeMemoStorage=new yt;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(e,r){this._aggregator=e,this._cardinalityLimit=(r??2e3)-1,this._overflowHashCode=Yl(this._overflowAttributes)}record(e,r,n,i){let s=this._activeCollectionStorage.get(r);if(!s){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(i))?.record(e);return}s=this._aggregator.createAccumulation(i),this._activeCollectionStorage.set(r,s)}s?.record(e)}batchCumulate(e,r){for(let[n,i,s]of e.entries()){let o=n,a=s,c=this._aggregator.createAccumulation(r);c?.record(i);let l=c;if(this._cumulativeMemoStorage.has(o,a)){let h=this._cumulativeMemoStorage.get(o,a);l=this._aggregator.diff(h,c)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let h=this._cumulativeMemoStorage.get(o,a);l=this._aggregator.diff(h,c)}if(this._activeCollectionStorage.has(o,a)){let h=this._activeCollectionStorage.get(o,a);l=this._aggregator.merge(h,l)}this._cumulativeMemoStorage.set(o,c,a),this._activeCollectionStorage.set(o,l,a)}}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new yt,e}}});function GQ(t){return Array.from(t.entries())}var As,Rg=T(()=>{"use strict";Wl();ma();As=class t{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(e,r){this._aggregator=e,r.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(e,r,n,i){this._stashAccumulations(n);let s=this._getMergedUnreportedAccumulations(e),o=s,a;if(this._reportHistory.has(e)){let l=this._reportHistory.get(e),h=l.collectionTime;a=l.aggregationTemporality,a===xe.CUMULATIVE?o=t.merge(l.accumulations,s,this._aggregator):o=t.calibrateStartTime(l.accumulations,s,h)}else a=e.selectAggregationTemporality(r.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:a});let c=GQ(o);if(c.length!==0)return this._aggregator.toMetricData(r,a,c,i)}_stashAccumulations(e){let r=this._unreportedAccumulations.keys();for(let n of r){let i=this._unreportedAccumulations.get(n);i===void 0&&(i=[],this._unreportedAccumulations.set(n,i)),i.push(e)}}_getMergedUnreportedAccumulations(e){let r=new yt,n=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),n===void 0)return r;for(let i of n)r=t.merge(r,i,this._aggregator);return r}static merge(e,r,n){let i=e,s=r.entries(),o=s.next();for(;o.done!==!0;){let[a,c,l]=o.value;if(e.has(a,l)){let h=e.get(a,l),d=n.merge(h,c);i.set(a,d,l)}else i.set(a,c,l);o=s.next()}return i}static calibrateStartTime(e,r,n){for(let[i,s]of e.keys())r.get(i,s)?.setStartTime(n);return r}}});var ku,lL=T(()=>{"use strict";vg();Cg();Rg();ma();ku=class extends ys{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,r,n,i,s){super(e),this._aggregationCardinalityLimit=s,this._deltaMetricStorage=new vs(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new As(r,i),this._attributesProcessor=n}record(e,r){let n=new yt;for(let[i,s]of e.entries())n.set(this._attributesProcessor.process(i),s);this._deltaMetricStorage.batchCumulate(n,r)}collect(e,r){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,r)}}});function Og(t,e){let r="";return t.unit!==e.unit&&(r+=` - Unit '${t.unit}' does not match '${e.unit}'
|
|
34
|
-
`),t.type!==e.type&&(r+=` - Type '${t.type}' does not match '${e.type}'
|
|
35
|
-
`),t.valueType!==e.valueType&&(r+=` - Value Type '${t.valueType}' does not match '${e.valueType}'
|
|
36
|
-
`),t.description!==e.description&&(r+=` - Description '${t.description}' does not match '${e.description}'
|
|
37
|
-
`),r}function HQ(t,e){return` - use valueType '${t.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}function zQ(t,e){return` - use unit '${t.unit}' on instrument creation or use an instrument name other than '${e.name}'`}function jQ(t,e){let r={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(r);return` - create a new view with a name other than '${t.name}' and InstrumentSelector '${n}'`}function $Q(t,e){let r={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(r);return` - create a new view with a name other than '${t.name}' and InstrumentSelector '${n}'
|
|
38
|
-
- OR - create a new view with the name ${t.name} and description '${t.description}' and InstrumentSelector ${n}
|
|
39
|
-
- OR - create a new view with the name ${e.name} and description '${t.description}' and InstrumentSelector ${n}`}function bg(t,e){return t.valueType!==e.valueType?HQ(t,e):t.unit!==e.unit?zQ(t,e):t.type!==e.type?jQ(t,e):t.description!==e.description?$Q(t,e):""}var uL=T(()=>{"use strict"});var Fu,hL=T(()=>{"use strict";fa();Q();uL();Fu=class t{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new t}getStorages(e){let r=[];for(let i of this._sharedRegistry.values())r=r.concat(i);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let i of n.values())r=r.concat(i);return r}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,r){let n=this._perCollectorRegistry.get(e);n==null&&(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(r,n)}findOrUpdateCompatibleStorage(e){let r=this._sharedRegistry.get(e.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(e,r)}findOrUpdateCompatibleCollectorStorage(e,r){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let i=n.get(r.name);return i===void 0?null:this._findOrUpdateCompatibleStorage(r,i)}_registerStorage(e,r){let n=e.getInstrumentDescriptor(),i=r.get(n.name);if(i===void 0){r.set(n.name,[e]);return}i.push(e)}_findOrUpdateCompatibleStorage(e,r){let n=null;for(let i of r){let s=i.getInstrumentDescriptor();aL(s,e)?(s.description!==e.description&&(e.description.length>s.description.length&&i.updateDescription(e.description),P.warn("A view or instrument with the name ",e.name,` has already been registered, but has a different description and is incompatible with another registered view.
|
|
40
|
-
`,`Details:
|
|
41
|
-
`,Og(s,e),`The longer description will be used.
|
|
42
|
-
To resolve the conflict:`,bg(s,e))),n=i):P.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
|
|
43
|
-
`,`Details:
|
|
44
|
-
`,Og(s,e),`To resolve the conflict:
|
|
45
|
-
`,bg(s,e))}return n}}});var Bu,dL=T(()=>{"use strict";Bu=class{_backingStorages;constructor(e){this._backingStorages=e}record(e,r,n,i){let s=this._backingStorages;for(let o=0;o<s.length;o++)s[o].record(e,r,n,i)}}});var Vu,qu,fL=T(()=>{"use strict";Q();ma();Du();Vu=class{_buffer=new yt;_instrumentName;_valueType;constructor(e,r){this._instrumentName=e,this._valueType=r}observe(e,r={}){if(typeof e!="number"){P.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Nt.INT&&!Number.isInteger(e)&&(P.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(r,e)}},qu=class{_buffer=new Map;observe(e,r,n={}){if(!pa(e))return;let i=this._buffer.get(e);if(i==null&&(i=new yt,this._buffer.set(e,i)),typeof r!="number"){P.warn(`non-number value provided to metric ${e._descriptor.name}: ${r}`);return}e._descriptor.valueType===Nt.INT&&!Number.isInteger(r)&&(P.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),r=Math.trunc(r),!Number.isInteger(r))||i.set(n,r)}}});var Gu,pL=T(()=>{"use strict";Q();Du();fL();Sr();Gu=class{_callbacks=[];_batchCallbacks=[];addCallback(e,r){this._findCallback(e,r)>=0||this._callbacks.push({callback:e,instrument:r})}removeCallback(e,r){let n=this._findCallback(e,r);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,r){let n=new Set(r.filter(pa));if(n.size===0){P.error("BatchObservableCallback is not associated with valid instruments",r);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,r){let n=new Set(r.filter(pa)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,r){let n=this._observeCallbacks(e,r),i=this._observeBatchCallbacks(e,r);return(await Promise.allSettled([...n,...i])).filter(a=>a.status==="rejected").map(a=>a.reason)}_observeCallbacks(e,r){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new Vu(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));r!=null&&(o=yn(o,r)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,r){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new qu,o=Promise.resolve(n(s));r!=null&&(o=yn(o,r)),await o,i.forEach(a=>{let c=s._buffer.get(a);c!=null&&a._metricStorages.forEach(l=>{l.record(c,e)})})})}_findCallback(e,r){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===r)}_findBatchCallback(e,r){return this._batchCallbacks.findIndex(n=>n.callback===e&&QR(n.instruments,r))}}});var Hu,mL=T(()=>{"use strict";vg();Cg();Rg();Hu=class extends ys{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,r,n,i,s){super(e),this._aggregationCardinalityLimit=s,this._deltaMetricStorage=new vs(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new As(r,i),this._attributesProcessor=n}record(e,r,n,i){r=this._attributesProcessor.process(r,n),this._deltaMetricStorage.record(e,r,n,i)}collect(e,r){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,r)}}});function zu(){return WQ}function gL(t){return new Ng(t)}function _L(t){return new wg(t)}function EL(t){return new Pg(t)}var Mg,Ng,wg,Pg,WQ,ju=T(()=>{"use strict";Mg=class{process(e,r){return e}},Ng=class{_processors;constructor(e){this._processors=e}process(e,r){let n=e;for(let i of this._processors)n=i.process(n,r);return n}},wg=class{_allowedAttributeNames;constructor(e){this._allowedAttributeNames=new Set(e)}process(e,r){let n={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&this._allowedAttributeNames.has(i)&&(n[i]=e[i]);return n}},Pg=class{_deniedAttributeNames;constructor(e){this._deniedAttributeNames=new Set(e)}process(e,r){let n={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&!this._deniedAttributeNames.has(i)&&(n[i]=e[i]);return n}};WQ=new Mg});var $u,SL=T(()=>{"use strict";fa();cL();lL();hL();dL();pL();mL();ju();$u=class{metricStorageRegistry=new Fu;observableRegistry=new Gu;meter;_meterProviderSharedState;_instrumentationScope;constructor(e,r){this.meter=new Uu(this),this._meterProviderSharedState=e,this._instrumentationScope=r}registerMetricStorage(e){let r=this._registerMetricStorage(e,Hu);return r.length===1?r[0]:new Bu(r)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,ku)}async collect(e,r,n){let i=await this.observableRegistry.observe(r,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=[];return s.forEach(a=>{let c=a.collect(e,r);c!=null&&o.push(c)}),o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,r){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=oL(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let c=s.aggregation.createAggregator(o),l=new r(o,c,s.attributesProcessor,this._meterProviderSharedState.metricCollectors,s.aggregationCardinalityLimit);return this.metricStorageRegistry.register(l),l});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,c])=>{let l=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(l!=null)return l;let h=c.createAggregator(e),d=a.selectCardinalityLimit(e.type),f=new r(e,h,zu(),[a],d);return this.metricStorageRegistry.registerForCollector(a,f),f});i=i.concat(o)}return i}}});var Wu,TL=T(()=>{"use strict";Sr();sL();SL();da();Wu=class{viewRegistry=new bu;metricCollectors=[];meterSharedStates=new Map;resource;constructor(e){this.resource=e}getMeterSharedState(e){let r=JR(e),n=this.meterSharedStates.get(r);return n==null&&(n=new $u(this,e),this.meterSharedStates.set(r,n)),n}selectAggregations(e){let r=[];for(let n of this.metricCollectors)r.push([n,vu(n.selectAggregation(e))]);return r}}});var Yu,yL=T(()=>{"use strict";rt();Yu=class{_sharedState;_metricReader;constructor(e,r){this._sharedState=e,this._metricReader=r}async collect(e){let r=It(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,r,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){return this._metricReader.selectCardinalityLimit?.(e)??2e3}}});var YQ,Cs,Rn,Ku=T(()=>{"use strict";YQ=/[\^$\\.+?()[\]{}|]/g,Cs=class t{_matchAll;_regexp;constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(t.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(YQ,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}},Rn=class{_matchAll;_pattern;constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}});var Xu,vL=T(()=>{"use strict";Ku();Xu=class{_nameFilter;_type;_unitFilter;constructor(e){this._nameFilter=new Cs(e?.name??"*"),this._type=e?.type,this._unitFilter=new Rn(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}});var Ju,AL=T(()=>{"use strict";Ku();Ju=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(e){this._nameFilter=new Rn(e?.name),this._versionFilter=new Rn(e?.version),this._schemaUrlFilter=new Rn(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}});function KQ(t){return t.instrumentName==null&&t.instrumentType==null&&t.instrumentUnit==null&&t.meterName==null&&t.meterVersion==null&&t.meterSchemaUrl==null}function XQ(t){if(KQ(t))throw new Error("Cannot create view with no selector arguments supplied");if(t.name!=null&&(t?.instrumentName==null||Cs.hasWildcard(t.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.")}var Qu,CL=T(()=>{"use strict";Ku();ju();vL();AL();da();Qu=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(e){XQ(e),e.attributesProcessors!=null?this.attributesProcessor=gL(e.attributesProcessors):this.attributesProcessor=zu(),this.name=e.name,this.description=e.description,this.aggregation=vu(e.aggregation??{type:nt.DEFAULT}),this.instrumentSelector=new Xu({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new Ju({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}});var Rs,RL=T(()=>{"use strict";Q();iL();TL();yL();CL();Rs=class{_sharedState;_shutdown=!1;constructor(e){if(this._sharedState=new Wu(e?.resource??yg()),e?.views!=null&&e.views.length>0)for(let r of e.views)this._sharedState.viewRegistry.addView(new Qu(r));if(e?.readers!=null&&e.readers.length>0)for(let r of e.readers){let n=new Yu(this._sharedState,r);r.setMetricProducer(n),this._sharedState.metricCollectors.push(n)}}getMeter(e,r="",n={}){return this._shutdown?(P.warn("A shutdown MeterProvider cannot provide a Meter"),Wy()):this._sharedState.getMeterSharedState({name:e,version:r,schemaUrl:n.schemaUrl}).meter}async shutdown(e){if(this._shutdown){P.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(r=>r.shutdown(e)))}async forceFlush(e){if(this._shutdown){P.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(r=>r.forceFlush(e)))}}});var xg={};kr(xg,{AggregationTemporality:()=>xe,AggregationType:()=>nt,ConsoleMetricExporter:()=>Ru,DataPointType:()=>Re,InMemoryMetricExporter:()=>Cu,InstrumentType:()=>j,MeterProvider:()=>Rs,MetricReader:()=>_s,PeriodicExportingMetricReader:()=>di,TimeoutError:()=>ci,createAllowListAttributesProcessor:()=>_L,createDenyListAttributesProcessor:()=>EL});var fi=T(()=>{"use strict";Wl();qr();Sg();KI();XI();JI();RL();da();ju();Sr()});var pi,Ig=T(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE",t[t.LOWMEMORY=2]="LOWMEMORY"})(pi||(pi={}))});var Os,OL=T(()=>{"use strict";Os=class{_delegate;constructor(e){this._delegate=e}export(e,r){this._delegate.export(e,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}});var Gr,Zu=T(()=>{"use strict";Gr=class extends Error{code;name="OTLPExporterError";data;constructor(e,r,n){super(e),this.data=n,this.code=r}}});function JQ(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function eh(t){if(t!=null)return async()=>t}function th(t,e,r){return{timeoutMillis:JQ(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function rh(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var ga=T(()=>{"use strict"});var nh,bL=T(()=>{"use strict";(function(t){t.NONE="none",t.GZIP="gzip"})(nh||(nh={}))});function ih(t){return new Lg(t.concurrencyLimit)}var Lg,Dg=T(()=>{"use strict";Lg=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);let r=()=>{let n=this._sendingPromises.indexOf(e);this._sendingPromises.splice(n,1)};e.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}});function QQ(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function ML(){return{handleResponse(t){t==null||!QQ(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||P.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}var NL=T(()=>{"use strict";Q()});function sh(t,e){return new Ug(t.transport,t.serializer,ML(),t.promiseHandler,e.timeout)}var Ug,kg=T(()=>{"use strict";rt();Zu();NL();Q();Ug=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,r,n,i,s){this._transport=e,this._serializer=r,this._responseHandler=n,this._promiseQueue=i,this._timeout=s,this._diagLogger=P.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:Ie.FAILED,error:new Error("Concurrent export limit reached")});return}let n=this._serializer.serializeRequest(e);if(n==null){r({code:Ie.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(i=>{if(i.status==="success"){if(i.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(i.data))}catch(s){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",s,i.data)}r({code:Ie.SUCCESS});return}else if(i.status==="failure"&&i.error){r({code:Ie.FAILED,error:i.error});return}else i.status==="retryable"?r({code:Ie.FAILED,error:i.error??new Gr("Export failed with retryable status")}):r({code:Ie.FAILED,error:new Gr("Export failed with unknown error")})},i=>r({code:Ie.FAILED,error:i})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}});function wL(t,e,r){return sh({transport:r,serializer:e,promiseHandler:ih(t)},{timeout:t.timeoutMillis})}var PL=T(()=>{"use strict";Dg();kg()});var Fg={};kr(Fg,{CompressionAlgorithm:()=>nh,OTLPExporterBase:()=>Os,OTLPExporterError:()=>Gr,createOtlpNetworkExportDelegate:()=>wL,getSharedConfigurationDefaults:()=>rh,mergeOtlpSharedConfigurationWithDefaults:()=>th});var oh=T(()=>{"use strict";OL();Zu();ga();bL();PL()});function ZQ(){let t=(tt("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE")??"cumulative").toLowerCase();return t==="cumulative"?_a:t==="delta"?ah:t==="lowmemory"?ch:(P.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${t}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),_a)}function eZ(t){return t!=null?t===pi.DELTA?ah:t===pi.LOWMEMORY?ch:_a:ZQ()}function rZ(t){return t?.aggregationPreference??(()=>tZ)}var _a,ah,ch,tZ,bs,Bg=T(()=>{"use strict";rt();fi();Ig();oh();Q();_a=()=>xe.CUMULATIVE,ah=t=>{switch(t){case j.COUNTER:case j.OBSERVABLE_COUNTER:case j.GAUGE:case j.HISTOGRAM:case j.OBSERVABLE_GAUGE:return xe.DELTA;case j.UP_DOWN_COUNTER:case j.OBSERVABLE_UP_DOWN_COUNTER:return xe.CUMULATIVE}},ch=t=>{switch(t){case j.COUNTER:case j.HISTOGRAM:return xe.DELTA;case j.GAUGE:case j.UP_DOWN_COUNTER:case j.OBSERVABLE_UP_DOWN_COUNTER:case j.OBSERVABLE_COUNTER:case j.OBSERVABLE_GAUGE:return xe.CUMULATIVE}};tZ=Object.freeze({type:nt.DEFAULT});bs=class extends Os{_aggregationTemporalitySelector;_aggregationSelector;constructor(e,r){super(e),this._aggregationSelector=rZ(r),this._aggregationTemporalitySelector=eZ(r?.temporalityPreference)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}}});function Hr(t){return t<0?10:t<128?1:t<16384?2:t<2097152?3:t<268435456?4:t<34359738368?5:t<4398046511104?6:t<562949953421312?7:t<72057594037927940?8:9}var Vg=T(()=>{"use strict"});var nZ,Ea,On,lh=T(()=>{"use strict";Q();Vg();nZ="ProtobufWriter: estimated size was too small, growing buffer.",Ea=1,On=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(e){let r=this.pos+e;if(r<=this._buffer.length)return;P.debug(nZ);let n=this._buffer.length*2;for(;n<r;)n*=2;let i=new Uint8Array(n);i.set(this._buffer),this._buffer=i,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(Ea),this.pos+=Ea,e}finishLengthDelimited(e,r){let n=r>>>0,i=Hr(n);if(i>Ea){let o=i-Ea;this._ensureCapacity(o),this._buffer.copyWithin(e+i,e+Ea,this.pos),this.pos+=o}let s=e;n<128?this._buffer[s]=n:n<16384?(this._buffer[s++]=n&127|128,this._buffer[s]=n>>>7):n<2097152?(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s]=n>>>14):n<268435456?(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s++]=n>>>14&127|128,this._buffer[s]=n>>>21):(this._buffer[s++]=n&127|128,this._buffer[s++]=n>>>7&127|128,this._buffer[s++]=n>>>14&127|128,this._buffer[s++]=n>>>21&127|128,this._buffer[s]=n>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}this.writeFixed64(r,n)}writeVarint(e){if(this._ensureCapacity(Hr(e)),e>=0&&e<=4294967295){let r=e>>>0;for(;r>127;)this._buffer[this.pos++]=r&127|128,r>>>=7;this._buffer[this.pos++]=r}else{let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}for(;n>0||r>127;)this._buffer[this.pos++]=r&127|128,r=(r>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=r&127}}writeFixed32(e){this._ensureCapacity(4);let r=e>>>0;this._buffer[this.pos++]=r&255,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255}writeFixed64(e,r){this._ensureCapacity(8);let n=e>>>0,i=r>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=i&255,this._buffer[this.pos++]=i>>>8&255,this._buffer[this.pos++]=i>>>16&255,this._buffer[this.pos++]=i>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let r=!0,n=e.length;for(let i=0;i<n;i++)if(e.charCodeAt(i)>127){r=!1;break}if(r){this.writeVarint(n),this._ensureCapacity(n);for(let i=0;i<n;i++)this._buffer[this.pos++]=e.charCodeAt(i)}else{let i=this._textEncoder.encode(e);this.writeBytes(i)}}}});function xL(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function zr(t){let e=new Uint8Array(t.length/2),r=0;for(let n=0;n<t.length;n+=2){let i=xL(t.charCodeAt(n)),s=xL(t.charCodeAt(n+1));e[r++]=i<<4|s}return e}var qg=T(()=>{"use strict"});var Sa,IL=T(()=>{"use strict";(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Sa||(Sa={}))});var Ta,LL,Gg=T(()=>{"use strict";Ta=class{emit(e){}enabled(){return!1}},LL=new Ta});function DL(t,e,r){return n=>n===t?e:r}var ya,Ms,Hg,UL=T(()=>{"use strict";ya=Symbol.for("io.opentelemetry.js.api.logs"),Ms=globalThis;Hg=1});var zg,uh,jg=T(()=>{"use strict";Gg();zg=class{getLogger(e,r,n){return new Ta}},uh=new zg});var hh,kL=T(()=>{"use strict";Gg();hh=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(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):LL}}});var va,FL=T(()=>{"use strict";jg();kL();va=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new hh(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:uh}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}}});var dh,BL=T(()=>{"use strict";UL();jg();FL();dh=class t{constructor(){this._proxyLoggerProvider=new va}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Ms[ya]?this.getLoggerProvider():(Ms[ya]=DL(Hg,e,uh),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Ms[ya])===null||e===void 0?void 0:e.call(Ms,Hg))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Ms[ya],this._proxyLoggerProvider=new va}}});var bSe,VL=T(()=>{"use strict";IL();BL();bSe=dh.getInstance()});function gt(t,e){let r=e[0],n=e[1],i=1e9,s=r&65535,o=r/65536>>>0,a=s*i,c=o*i,l=a>>>0,h=Math.floor(a/4294967296),d=(c&65535)*65536>>>0,f=c/65536>>>0,p=l+d+n,g=p>>>0,S=Math.floor(p/4294967296),A=h+f+S>>>0;t.writeFixed64(g,A)}function Yt(t,e,r){for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=e[n];t.writeTag(r,2);let s=t.startLengthDelimited(),o=t.pos;iZ(t,n,i),t.finishLengthDelimited(s,t.pos-o)}}function iZ(t,e,r){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),i=t.pos;Aa(t,r),t.finishLengthDelimited(n,t.pos-i)}function Aa(t,e){let r=typeof e;if(r==="string")t.writeTag(1,2),t.writeString(e);else if(r==="boolean")t.writeTag(2,0),t.writeVarint(e?1:0);else if(r==="number"){let n=e;Number.isInteger(n)&&n>=sZ&&n<oZ?(t.writeTag(3,0),t.writeVarint(n)):(t.writeTag(4,1),t.writeDouble(n))}else if(e instanceof Uint8Array)t.writeTag(7,2),t.writeBytes(e);else if(Array.isArray(e)){t.writeTag(5,2);let n=t.startLengthDelimited(),i=t.pos;for(let s of e){t.writeTag(1,2);let o=t.startLengthDelimited(),a=t.pos;Aa(t,s),t.finishLengthDelimited(o,t.pos-a)}t.finishLengthDelimited(n,t.pos-i)}else if(r==="object"&&e!=null){t.writeTag(6,2);let n=t.startLengthDelimited(),i=t.pos,s=e;for(let o in s){if(!Object.prototype.hasOwnProperty.call(s,o))continue;let a=s[o];t.writeTag(1,2);let c=t.startLengthDelimited(),l=t.pos;t.writeTag(1,2),t.writeString(o),t.writeTag(2,2);let h=t.startLengthDelimited(),d=t.pos;Aa(t,a),t.finishLengthDelimited(h,t.pos-d),t.finishLengthDelimited(c,t.pos-l)}t.finishLengthDelimited(n,t.pos-i)}}function Ns(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;t.writeTag(1,2),t.writeString(e.name),e.version&&(t.writeTag(2,2),t.writeString(e.version)),t.finishLengthDelimited(n,t.pos-i)}function ws(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;e.attributes&&Yt(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-i)}var sZ,oZ,fh=T(()=>{"use strict";sZ=-(2**63),oZ=2**63});function aZ(t){let e=t.length,r=0;for(let n=0;n<e;n++){let i=t.charCodeAt(n);i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4)}return r}var bn,ph=T(()=>{"use strict";Vg();bn=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,r){this.pos+=Hr(r)}writeVarint(e){this.pos+=Hr(e)}writeSint32(e){this.pos+=Hr((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,r){this.pos+=8}writeBytes(e){this.pos+=Hr(e.length),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this.pos+=8}writeString(e){let r=aZ(e);this.pos+=Hr(r),this.pos+=r}}});function cZ(t,e){let r=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),gt(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==Sa.UNSPECIFIED&&(t.writeTag(2,0),t.writeVarint(e.severityNumber)),e.severityText&&(t.writeTag(3,2),t.writeString(e.severityText)),e.body!==void 0){t.writeTag(5,2);let i=t.startLengthDelimited(),s=t.pos;Aa(t,e.body),t.finishLengthDelimited(i,t.pos-s)}e.attributes&&Yt(t,e.attributes,6),t.writeTag(7,0),t.writeVarint(e.droppedAttributesCount),e.spanContext?.traceFlags&&(t.writeTag(8,5),t.writeFixed32(e.spanContext.traceFlags)),e.spanContext?.traceId&&(t.writeTag(9,2),t.writeBytes(zr(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(zr(e.spanContext.spanId))),t.writeTag(11,1),gt(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(r,t.pos-n)}function lZ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Ns(t,e,1);for(let s of r)t.writeTag(2,2),cZ(t,s);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function qL(t,e,r){let n=t.startLengthDelimited(),i=t.pos;ws(t,e,1);for(let s of r.values()){t.writeTag(2,2);let o=s[0].instrumentationScope;lZ(t,o,s)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function uZ(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,s=e.get(n);s||(s=new Map,e.set(n,s));let o=s.get(i);o||(o=[],s.set(i,o)),o.push(r)}return e}function GL(t){let e=uZ(t),r=new bn;for(let[i,s]of e)r.writeTag(1,2),qL(r,i,s);let n=new On(r.pos);for(let[i,s]of e)n.writeTag(1,2),qL(n,i,s);return n.finish()}var HL=T(()=>{"use strict";lh();qg();VL();fh();ph()});var Kt,mh=T(()=>{"use strict";Kt=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,r=0,n=!1;for(;this.pos<this._buf.length;){let i=this._buf[this.pos++];if(e+=(i&127)*Math.pow(2,r),r+=7,!(i&128)){n=!0;break}}if(!n)throw new Error("Truncated buffer: unexpected end of data while reading varint");return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw new Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let r=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,r}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:r}=this.readTag();if(r===4)break;this.skip(r)}break;case 4:break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${e}, cannot safely skip`)}}}});function hZ(t){let e=new Kt(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedLogRecords=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function zL(t){let e=new Kt(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===2?r.partialSuccess=hZ(e.readBytes()):e.skip(i);break;default:e.skip(i);break}}return r}var jL=T(()=>{"use strict";mh()});var $g,$L=T(()=>{"use strict";HL();jL();$g={serializeRequest:t=>GL(t),deserializeResponse:t=>zL(t)}});var WL=T(()=>{"use strict";$L()});function XL(t,e,r){let n=t.startLengthDelimited(),i=t.pos;t.writeTag(2,1),gt(t,e.startTime),t.writeTag(3,1),gt(t,e.endTime),r===Nt.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&Yt(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-i)}function dZ(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;if(t.writeTag(2,1),gt(t,e.startTime),t.writeTag(3,1),gt(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.buckets.counts.length>0){t.writeTag(6,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of i.buckets.counts)t.writeFixed64(a>>>0,a/4294967296>>>0);t.finishLengthDelimited(s,t.pos-o)}if(i.buckets.boundaries.length>0){t.writeTag(7,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of i.buckets.boundaries)t.writeDouble(a);t.finishLengthDelimited(s,t.pos-o)}e.attributes&&Yt(t,e.attributes,9),i.min!==void 0&&(t.writeTag(11,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(12,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function YL(t,e,r){let n=t.startLengthDelimited(),i=t.pos;if(e!==0&&(t.writeTag(1,0),t.writeSint32(e)),r.length>0){t.writeTag(2,2);let s=t.startLengthDelimited(),o=t.pos;for(let a of r)t.writeVarint(a);t.finishLengthDelimited(s,t.pos-o)}t.finishLengthDelimited(n,t.pos-i)}function fZ(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;e.attributes&&Yt(t,e.attributes,1),t.writeTag(2,1),gt(t,e.startTime),t.writeTag(3,1),gt(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.scale!==0&&(t.writeTag(6,0),t.writeSint32(i.scale)),t.writeTag(7,1),t.writeFixed64(i.zeroCount>>>0,i.zeroCount/4294967296>>>0),t.writeTag(8,2),YL(t,i.positive.offset,i.positive.bucketCounts),t.writeTag(9,2),YL(t,i.negative.offset,i.negative.bucketCounts),i.min!==void 0&&(t.writeTag(12,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(13,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function pZ(t,e){let r=t.startLengthDelimited(),n=t.pos;switch(t.writeTag(1,2),t.writeString(e.descriptor.name),e.descriptor.description&&(t.writeTag(2,2),t.writeString(e.descriptor.description)),e.descriptor.unit&&(t.writeTag(3,2),t.writeString(e.descriptor.unit)),e.dataPointType){case Re.GAUGE:t.writeTag(5,2),mZ(t,e);break;case Re.SUM:t.writeTag(7,2),gZ(t,e);break;case Re.HISTOGRAM:t.writeTag(9,2),_Z(t,e);break;case Re.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),EZ(t,e);break;default:{let i=e}}t.finishLengthDelimited(r,t.pos-n)}function mZ(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let i of e.dataPoints)t.writeTag(1,2),XL(t,i,e.descriptor.valueType);t.finishLengthDelimited(r,t.pos-n)}function gZ(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),XL(t,s,e.descriptor.valueType);let i=Wg(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),e.isMonotonic&&(t.writeTag(3,0),t.writeVarint(1)),t.finishLengthDelimited(r,t.pos-n)}function _Z(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),dZ(t,s);let i=Wg(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function EZ(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let s of e.dataPoints)t.writeTag(1,2),fZ(t,s);let i=Wg(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function SZ(t,e){let r=t.startLengthDelimited(),n=t.pos;Ns(t,e.scope,1);for(let i of e.metrics)t.writeTag(2,2),pZ(t,i);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function KL(t,e){let r=t.startLengthDelimited(),n=t.pos;ws(t,e.resource,1);for(let i of e.scopeMetrics)t.writeTag(2,2),SZ(t,i);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function Wg(t){switch(t){case xe.DELTA:return 1;case xe.CUMULATIVE:return 2;default:return 0}}function JL(t){let e=new bn;e.writeTag(1,2),KL(e,t);let r=new On(e.pos);return r.writeTag(1,2),KL(r,t),r.finish()}var QL=T(()=>{"use strict";Q();fi();fh();ph();lh()});function TZ(t){let e=new Kt(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedDataPoints=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function ZL(t){let e=new Kt(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===2?r.partialSuccess=TZ(e.readBytes()):e.skip(i);break;default:e.skip(i);break}}return r}var eD=T(()=>{"use strict";mh()});var Yg,tD=T(()=>{"use strict";QL();eD();Yg={serializeRequest:t=>JL(t),deserializeResponse:t=>ZL(t)}});var rD=T(()=>{"use strict";tD()});function iD(t,e){let r=t&255|yZ;return e&&(r|=vZ),r}function AZ(t,e){let r=t.startLengthDelimited(),n=t.pos;e.message&&(t.writeTag(2,2),t.writeString(e.message)),t.writeTag(3,0),t.writeVarint(e.code),t.finishLengthDelimited(r,t.pos-n)}function CZ(t,e){let r=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),gt(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&Yt(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(r,t.pos-n)}function RZ(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.context;t.writeTag(1,2),t.writeBytes(zr(i.traceId)),t.writeTag(2,2),t.writeBytes(zr(i.spanId));let s=i.traceState?.serialize();s&&(t.writeTag(3,2),t.writeString(s)),e.attributes&&Yt(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let o=iD(i.traceFlags,i.isRemote);o&&(t.writeTag(6,5),t.writeFixed32(o)),t.finishLengthDelimited(r,t.pos-n)}function OZ(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.spanContext();t.writeTag(1,2),t.writeBytes(zr(i.traceId)),t.writeTag(2,2),t.writeBytes(zr(i.spanId));let s=i.traceState?.serialize();s&&(t.writeTag(3,2),t.writeString(s)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(zr(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let o=e.kind==null?0:e.kind+1;o!==0&&(t.writeTag(6,0),t.writeVarint(o)),t.writeTag(7,1),gt(t,e.startTime),t.writeTag(8,1),gt(t,e.endTime),e.attributes&&Yt(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),CZ(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),RZ(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),AZ(t,e.status);let a=iD(i.traceFlags,e.parentSpanContext?.isRemote);a&&(t.writeTag(16,5),t.writeFixed32(a)),t.finishLengthDelimited(r,t.pos-n)}function bZ(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Ns(t,e,1);for(let s of r)t.writeTag(2,2),OZ(t,s);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function nD(t,e,r){let n=t.startLengthDelimited(),i=t.pos;ws(t,e,1);for(let s of r.values()){t.writeTag(2,2);let o=s[0].instrumentationScope;bZ(t,o,s)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function MZ(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,s=e.get(n);s||(s=new Map,e.set(n,s));let o=s.get(i);o||(o=[],s.set(i,o)),o.push(r)}return e}function sD(t){let e=MZ(t),r=new bn;for(let[i,s]of e)r.writeTag(1,2),nD(r,i,s);let n=new On(r.pos);for(let[i,s]of e)n.writeTag(1,2),nD(n,i,s);return n.finish()}var yZ,vZ,oD=T(()=>{"use strict";lh();qg();fh();ph();yZ=256,vZ=512});function NZ(t){let e=new Kt(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedSpans=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function aD(t){let e=new Kt(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===2?r.partialSuccess=NZ(e.readBytes()):e.skip(i);break;default:e.skip(i);break}}return r}var cD=T(()=>{"use strict";mh()});var Kg,lD=T(()=>{"use strict";oD();cD();Kg={serializeRequest:t=>sD(t),deserializeResponse:t=>aD(t)}});var uD=T(()=>{"use strict";lD()});function Ps(t,e){let r={attributes:jr(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function xs(t){return{name:t.name,version:t.version}}function jr(t,e){return Object.keys(t).map(r=>Xg(r,t[r],e))}function Xg(t,e,r){return{key:t,value:Ca(e,r)}}function Ca(t,e){let r=typeof t;if(r==="string")return{stringValue:t};if(r==="number")return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if(r==="boolean")return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:e.encodeUint8Array(t)};if(Array.isArray(t)){let n=new Array(t.length);for(let i=0;i<t.length;i++)n[i]=Ca(t[i],e);return{arrayValue:{values:n}}}if(r==="object"&&t!=null){let n=Object.keys(t),i=new Array(n.length);for(let s=0;s<n.length;s++)i[s]={key:n[s],value:Ca(t[n[s]],e)};return{kvlistValue:{values:i}}}return{}}var gh=T(()=>{"use strict"});function hD(t,e){return{resourceLogs:PZ(t,e)}}function wZ(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:s="",schemaUrl:o=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${s}:${o}`,l=a.get(c);l||(l=[],a.set(c,l)),l.push(r)}return e}function PZ(t,e){let r=wZ(t);return Array.from(r,([n,i])=>{let s=Ps(n,e);return{resource:s,scopeLogs:Array.from(i,([,o])=>({scope:xs(o[0].instrumentationScope),logRecords:o.map(a=>xZ(a,e)),schemaUrl:o[0].instrumentationScope.schemaUrl})),schemaUrl:s.schemaUrl}})}function xZ(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:Ca(t.body,e),eventName:t.eventName,attributes:IZ(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function IZ(t,e){return Object.keys(t).map(r=>Xg(r,t[r],e))}var dD=T(()=>{"use strict";gh()});function LZ(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function DZ(t){return LZ(t).toString()}function fD(t){return t}var UZ,Is,_h=T(()=>{"use strict";rt();UZ=typeof BigInt<"u"?DZ:du;Is={encodeHrTime:UZ,encodeSpanContext:fD,encodeOptionalSpanContext:fD,encodeUint8Array:t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64");let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=String.fromCharCode(t[r]);return btoa(e.join(""))}}});var Jg,pD=T(()=>{"use strict";dD();_h();Q();Jg={serializeRequest:t=>{let e=hD(t,Is);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return P.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}}});var mD=T(()=>{"use strict";pD()});var Ra,gD=T(()=>{"use strict";(function(t){t[t.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",t[t.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",t[t.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(Ra||(Ra={}))});function kZ(t,e){let r=Ps(t.resource,e);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:FZ(t.scopeMetrics,e)}}function FZ(t,e){return Array.from(t.map(r=>({scope:xs(r.scope),metrics:r.metrics.map(n=>BZ(n,e)),schemaUrl:r.scope.schemaUrl})))}function BZ(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=HZ(t.aggregationTemporality);switch(t.dataPointType){case Re.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:_D(t,e)};break;case Re.GAUGE:r.gauge={dataPoints:_D(t,e)};break;case Re.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:qZ(t,e)};break;case Re.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:GZ(t,e)};break}return r}function VZ(t,e,r){let n={attributes:jr(t.attributes,r),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case Nt.INT:n.asInt=t.value;break;case Nt.DOUBLE:n.asDouble=t.value;break}return n}function _D(t,e){return t.dataPoints.map(r=>VZ(r,t.descriptor.valueType,e))}function qZ(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:jr(r.attributes,e),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function GZ(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:jr(r.attributes,e),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function HZ(t){switch(t){case xe.DELTA:return Ra.AGGREGATION_TEMPORALITY_DELTA;case xe.CUMULATIVE:return Ra.AGGREGATION_TEMPORALITY_CUMULATIVE}}function ED(t,e){return{resourceMetrics:t.map(r=>kZ(r,e))}}var SD=T(()=>{"use strict";Q();fi();gD();gh()});var Oa,TD=T(()=>{"use strict";SD();_h();Q();Oa={serializeRequest:t=>{let e=ED([t],Is);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return P.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}}});var yD=T(()=>{"use strict";TD()});function vD(t,e){let r=t&255|zZ;return e&&(r|=jZ),r}function $Z(t,e){let r=t.spanContext(),n=t.status,i=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:i,traceState:r.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:jr(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(s=>YZ(s,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(s=>WZ(s,e)),droppedLinksCount:t.droppedLinksCount,flags:vD(r.traceFlags,t.parentSpanContext?.isRemote)}}function WZ(t,e){return{attributes:t.attributes?jr(t.attributes,e):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0,flags:vD(t.context.traceFlags,t.context.isRemote)}}function YZ(t,e){return{attributes:t.attributes?jr(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function AD(t,e){return{resourceSpans:XZ(t,e)}}function KZ(t){let e=new Map;for(let r of t){let n=e.get(r.resource);n||(n=new Map,e.set(r.resource,n));let i=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(r)}return e}function XZ(t,e){let r=KZ(t),n=[],i=r.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,c=[],l=a.values(),h=l.next();for(;!h.done;){let p=h.value;if(p.length>0){let g=p.map(S=>$Z(S,e));c.push({scope:xs(p[0].instrumentationScope),spans:g,schemaUrl:p[0].instrumentationScope.schemaUrl})}h=l.next()}let d=Ps(o,e),f={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};n.push(f),s=i.next()}return n}var zZ,jZ,CD=T(()=>{"use strict";gh();zZ=256,jZ=512});var Qg,RD=T(()=>{"use strict";CD();_h();Q();Qg={serializeRequest:t=>{let e=AD(t,Is);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return P.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}}});var OD=T(()=>{"use strict";RD()});var bD={};kr(bD,{JsonLogsSerializer:()=>Jg,JsonMetricsSerializer:()=>Oa,JsonTraceSerializer:()=>Qg,ProtobufLogsSerializer:()=>$g,ProtobufMetricsSerializer:()=>Yg,ProtobufTraceSerializer:()=>Kg});var Zg=T(()=>{"use strict";WL();rD();uD();mD();yD();OD()});function MD(t){let e={};return Object.entries(t??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):P.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}var ND=T(()=>{"use strict";Q()});function JZ(t,e,r){return async()=>{let n={...await r()},i={};return e!=null&&Object.assign(i,await e()),t!=null&&Object.assign(i,MD(await t())),Object.assign(i,n)}}function QZ(t){if(t!=null)try{let e=globalThis.location?.href;return new URL(t,e).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function wD(t,e,r){return{...th(t,e,r),headers:JZ(t.headers,e.headers,r.headers),url:QZ(t.url)??e.url??r.url}}function PD(t,e){return{...rh(),headers:async()=>t,url:"http://localhost:4318/"+e}}var xD=T(()=>{"use strict";ga();ND()});function mi(t){return async e=>{let r=e==="http:",n=r?import("http"):import("https"),{Agent:i}=await n;if(r){let{ca:s,cert:o,key:a,...c}=t;return new i(c)}return new i(t)}}function ID(t,e,r){return{...wD(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory,userAgent:t.userAgent}}function LD(t,e){return{...PD(t,e),agentFactory:mi({keepAlive:!0})}}var Eh=T(()=>{"use strict";xD()});function e_(t){return t===429||t===502||t===503||t===504}function t_(t){if(t==null)return;let e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let r=new Date(t).getTime()-Date.now();return r>=0?r:0}var DD=T(()=>{"use strict"});var UD,kD=T(()=>{"use strict";UD="0.218.0"});import*as VD from"zlib";import{Readable as ZZ}from"stream";function qD(t,e,r,n,i,s,o,a){return new Promise(c=>{let l=new URL(e);i?r["User-Agent"]=`${i} ${FD}`:r["User-Agent"]=FD;let d=t(l,{method:"POST",headers:r,agent:s},f=>{let p=[],g=0;f.on("data",S=>{if(g+=S.length,g>BD){let A=new Error(`OTLP export response body exceeded size limit of ${BD} bytes`);c({status:"failure",error:A}),f.destroy();return}p.push(S)}),f.on("end",()=>{if(f.statusCode&&f.statusCode<=299)c({status:"success",data:Buffer.concat(p)});else if(f.statusCode&&e_(f.statusCode))c({status:"retryable",retryInMillis:t_(f.headers["retry-after"])});else{let S=new Gr(f.statusMessage,f.statusCode,Buffer.concat(p).toString());c({status:"failure",error:S})}}),f.on("error",S=>{f.statusCode&&f.statusCode<=299?c({status:"success"}):f.statusCode&&e_(f.statusCode)?c({status:"retryable",error:S,retryInMillis:t_(f.headers["retry-after"])}):c({status:"failure",error:S})})});d.setTimeout(a,()=>{d.destroy(),c({status:"retryable",error:new Error("Request timed out")})}),d.on("error",f=>{ree(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),eee(d,n,o,f=>{c({status:"failure",error:f})})})}function eee(t,e,r,n){let i=tee(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),i=i.on("error",n).pipe(VD.createGzip()).on("error",n)),i.pipe(t).on("error",n)}function tee(t){let e=new ZZ;return e.push(t),e.push(null),e}function ree(t){let e=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in t&&typeof t.code=="string"?e.has(t.code):!1}var FD,BD,GD=T(()=>{"use strict";DD();Zu();kD();FD=`OTel-OTLP-Exporter-JavaScript/${UD}`,BD=4*1024*1024});async function nee(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function HD(t){return new r_(t)}var r_,zD=T(()=>{"use strict";GD();r_=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,r){let{agent:n,request:i}=await this._loadUtils(),s=await this._parameters.headers();return qD(i,this._parameters.url,s,this._parameters.compression,this._parameters.userAgent,n,e,r)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let r=new URL(this._parameters.url).protocol,[n,i]=await Promise.all([this._parameters.agentFactory(r),nee(r)]);e=this._utils={agent:n,request:i}}return e}}});function aee(){return Math.random()*(2*jD)-jD}function $D(t){return new i_(t.transport)}var n_,iee,see,oee,jD,i_,WD=T(()=>{"use strict";Q();n_=5,iee=1e3,see=5e3,oee=1.5,jD=.2;i_=class{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,s)=>{setTimeout(()=>{this._transport.send(e,r).then(i,s)},n)})}async send(e,r){let n=n_,i=iee,s=Date.now()+r,o=await this._transport.send(e,r);for(;o.status==="retryable"&&n>0;){n--;let a=Math.max(Math.min(i*(1+aee()),see),0);i=i*oee;let c=o.retryInMillis??a,l=s-Date.now();if(c>l)return P.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),o;P.verbose(`Scheduling export retry in ${Math.round(c)}ms`),o=await this.retry(e,l,c)}return o.status==="success"?P.verbose(`Export succeeded after ${n_-n} retry attempts.`):o.status==="retryable"?P.info(`Export failed after maximum retry attempts (${n_}).`):P.info(`Export failed with non-retryable error: ${o.error}`),o}shutdown(){return this._transport.shutdown()}}});function Sh(t,e){return sh({transport:$D({transport:HD(t)}),serializer:e,promiseHandler:ih(t)},{timeout:t.timeoutMillis})}var YD=T(()=>{"use strict";kg();zD();Dg();WD()});function KD(t){let e=us(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;P.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function cee(t){let e=KD(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=KD("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function XD(t){let e=tt(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;P.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function lee(t){let e=XD(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=XD("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function Th(t){return{timeoutMillis:cee(t),compression:lee(t)}}var s_=T(()=>{"use strict";rt();Q()});import*as JD from"fs";import*as QD from"path";function uee(t){let e=tt(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=tt("OTEL_EXPORTER_OTLP_HEADERS"),n=li(e),i=li(r);if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return Object.assign({},li(r),li(e))}function hee(t){try{return new URL(t).toString()}catch{P.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function dee(t,e){try{new URL(t)}catch{P.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith("/")||(t=t+"/"),t+=e;try{new URL(t)}catch{P.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function fee(t){let e=tt("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return dee(e,t)}function pee(t){let e=tt(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return hee(e)}function o_(t,e,r){let n=tt(t),i=tt(e),s=n??i;if(s!=null)try{return JD.readFileSync(QD.resolve(process.cwd(),s))}catch{P.warn(r);return}else return}function mee(t){return o_(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function gee(t){return o_(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function _ee(t){return o_(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function ZD(t,e){return{...Th(t),url:pee(t)??fee(e),headers:eh(uee(t)),agentFactory:mi({keepAlive:!0,ca:_ee(t),cert:mee(t),key:gee(t)})}}var eU=T(()=>{"use strict";rt();Q();s_();ga();Eh()});function tU(t){return typeof t.headers=="function"?t.headers:eh(t.headers)}var rU=T(()=>{"use strict";ga()});function Eee(t){if(typeof t.httpAgentOptions=="function")return t.httpAgentOptions;let e=t.httpAgentOptions;if(t.keepAlive!=null&&(e={keepAlive:t.keepAlive,...e}),e!=null)return mi(e)}function yh(t,e,r,n){return t.metadata&&P.warn("Metadata cannot be set when using http"),ID({url:t.url,headers:tU(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:Eee(t),userAgent:t.userAgent},ZD(e,r),LD(n,r))}var nU=T(()=>{"use strict";Q();Eh();vh();eU();rU()});var iU={};kr(iU,{convertLegacyHttpOptions:()=>yh,createOtlpHttpExportDelegate:()=>Sh,getSharedConfigurationFromEnvironment:()=>Th,httpAgentFactoryFromOptions:()=>mi});var vh=T(()=>{"use strict";Eh();YD();s_();nU()});var Ls,sU=T(()=>{"use strict";Bg();Zg();vh();Ls=class extends bs{constructor(e){super(Sh(yh(e??{},"METRICS","v1/metrics",{"Content-Type":"application/json"}),Oa),e)}}});var oU=T(()=>{"use strict";sU()});var aU=T(()=>{"use strict";oU()});var cU={};kr(cU,{AggregationTemporalityPreference:()=>pi,CumulativeTemporalitySelector:()=>_a,DeltaTemporalitySelector:()=>ah,LowMemoryTemporalitySelector:()=>ch,OTLPMetricExporter:()=>Ls,OTLPMetricExporterBase:()=>bs});var lU=T(()=>{"use strict";aU();Ig();Bg()});var uU=m(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.VERSION=void 0;Ah.VERSION="0.218.0"});var te=m(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=Lt.DEFAULT_MAX_SEND_MESSAGE_LENGTH=Lt.Propagate=Lt.LogVerbosity=Lt.Status=void 0;var hU;(function(t){t[t.OK=0]="OK",t[t.CANCELLED=1]="CANCELLED",t[t.UNKNOWN=2]="UNKNOWN",t[t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",t[t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",t[t.NOT_FOUND=5]="NOT_FOUND",t[t.ALREADY_EXISTS=6]="ALREADY_EXISTS",t[t.PERMISSION_DENIED=7]="PERMISSION_DENIED",t[t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",t[t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",t[t.ABORTED=10]="ABORTED",t[t.OUT_OF_RANGE=11]="OUT_OF_RANGE",t[t.UNIMPLEMENTED=12]="UNIMPLEMENTED",t[t.INTERNAL=13]="INTERNAL",t[t.UNAVAILABLE=14]="UNAVAILABLE",t[t.DATA_LOSS=15]="DATA_LOSS",t[t.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(hU||(Lt.Status=hU={}));var dU;(function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.ERROR=2]="ERROR",t[t.NONE=3]="NONE"})(dU||(Lt.LogVerbosity=dU={}));var fU;(function(t){t[t.DEADLINE=1]="DEADLINE",t[t.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",t[t.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",t[t.CANCELLATION=8]="CANCELLATION",t[t.DEFAULTS=65535]="DEFAULTS"})(fU||(Lt.Propagate=fU={}));Lt.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;Lt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var a_=m((i0e,See)=>{See.exports={name:"@grpc/grpc-js",version:"1.14.4",description:"gRPC Library for Node - pure JS implementation",homepage:"https://grpc.io/",repository:"https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",main:"build/src/index.js",engines:{node:">=12.10.0"},keywords:[],author:{name:"Google Inc."},types:"build/src/index.d.ts",license:"Apache-2.0",devDependencies:{"@grpc/proto-loader":"file:../proto-loader","@types/gulp":"^4.0.17","@types/gulp-mocha":"0.0.37","@types/lodash":"^4.14.202","@types/mocha":"^10.0.6","@types/ncp":"^2.0.8","@types/node":">=20.11.20","@types/pify":"^5.0.4","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0","@typescript-eslint/typescript-estree":"^7.1.0","clang-format":"^1.8.0",eslint:"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^4.2.1",execa:"^2.0.3",gulp:"^4.0.2","gulp-mocha":"^6.0.0",lodash:"^4.17.21",madge:"^5.0.1","mocha-jenkins-reporter":"^0.4.1",ncp:"^2.0.0",pify:"^4.0.1",prettier:"^2.8.8",rimraf:"^3.0.2",semver:"^7.6.0","ts-node":"^10.9.2",typescript:"^5.3.3"},contributors:[{name:"Google Inc."}],scripts:{build:"npm run compile",clean:"rimraf ./build",compile:"tsc -p .",format:'clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts',lint:"eslint src/*.ts test/*.ts",prepare:"npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile",test:"gulp test",check:"npm run lint",fix:"eslint --fix src/*.ts test/*.ts",pretest:"npm run generate-types && npm run generate-test-types && npm run compile",posttest:"npm run check && madge -c ./build/src","generate-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto","generate-test-types":"proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto","copy-protos":"node ./copy-protos"},dependencies:{"@grpc/proto-loader":"^0.8.0","@js-sdsl/ordered-map":"^4.4.2"},files:["src/**/*.ts","build/src/**/*.{js,d.ts,js.map}","proto/**/*.proto","proto/**/LICENSE","LICENSE","deps/envoy-api/envoy/api/v2/**/*.proto","deps/envoy-api/envoy/config/**/*.proto","deps/envoy-api/envoy/service/**/*.proto","deps/envoy-api/envoy/type/**/*.proto","deps/udpa/udpa/**/*.proto","deps/googleapis/google/api/*.proto","deps/googleapis/google/rpc/*.proto","deps/protoc-gen-validate/validate/**/*.proto"]}});var Ee=m(vt=>{"use strict";var c_,l_,u_,h_;Object.defineProperty(vt,"__esModule",{value:!0});vt.log=vt.setLoggerVerbosity=vt.setLogger=vt.getLogger=void 0;vt.trace=wee;vt.isTracerEnabled=mU;var Mn=te(),Tee=L("process"),yee=a_().version,vee={error:(t,...e)=>{console.error("E "+t,...e)},info:(t,...e)=>{console.error("I "+t,...e)},debug:(t,...e)=>{console.error("D "+t,...e)}},gi=vee,Ds=Mn.LogVerbosity.ERROR,Aee=(l_=(c_=process.env.GRPC_NODE_VERBOSITY)!==null&&c_!==void 0?c_:process.env.GRPC_VERBOSITY)!==null&&l_!==void 0?l_:"";switch(Aee.toUpperCase()){case"DEBUG":Ds=Mn.LogVerbosity.DEBUG;break;case"INFO":Ds=Mn.LogVerbosity.INFO;break;case"ERROR":Ds=Mn.LogVerbosity.ERROR;break;case"NONE":Ds=Mn.LogVerbosity.NONE;break;default:}var Cee=()=>gi;vt.getLogger=Cee;var Ree=t=>{gi=t};vt.setLogger=Ree;var Oee=t=>{Ds=t};vt.setLoggerVerbosity=Oee;var bee=(t,...e)=>{let r;if(t>=Ds){switch(t){case Mn.LogVerbosity.DEBUG:r=gi.debug;break;case Mn.LogVerbosity.INFO:r=gi.info;break;case Mn.LogVerbosity.ERROR:r=gi.error;break}r||(r=gi.error),r&&r.bind(gi)(...e)}};vt.log=bee;var Mee=(h_=(u_=process.env.GRPC_NODE_TRACE)!==null&&u_!==void 0?u_:process.env.GRPC_TRACE)!==null&&h_!==void 0?h_:"",d_=new Set,pU=new Set;for(let t of Mee.split(","))t.startsWith("-")?pU.add(t.substring(1)):d_.add(t);var Nee=d_.has("all");function wee(t,e,r){mU(e)&&(0,vt.log)(t,new Date().toISOString()+" | v"+yee+" "+Tee.pid+" | "+e+" | "+r)}function mU(t){return!pU.has(t)&&(Nee||d_.has(t))}});var Rh=m(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.getErrorMessage=Pee;Ch.getErrorCode=xee;function Pee(t){return t instanceof Error?t.message:String(t)}function xee(t){return typeof t=="object"&&t!==null&&"code"in t&&typeof t.code=="number"?t.code:null}});var He=m(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.Metadata=void 0;var Iee=Ee(),Lee=te(),Dee=Rh(),Uee=/^[:0-9a-z_.-]+$/,kee=/^[ -~]*$/;function Fee(t){return Uee.test(t)}function Bee(t){return kee.test(t)}function _U(t){return t.endsWith("-bin")}function Vee(t){return!t.startsWith("grpc-")}function Oh(t){return t.toLowerCase()}function gU(t,e){if(!Fee(t))throw new Error('Metadata key "'+t+'" contains illegal characters');if(e!=null)if(_U(t)){if(!Buffer.isBuffer(e))throw new Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(e))throw new Error("keys that don't end with '-bin' must have String values");if(!Bee(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var f_=class t{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,r){e=Oh(e),gU(e,r),this.internalRepr.set(e,[r])}add(e,r){e=Oh(e),gU(e,r);let n=this.internalRepr.get(e);n===void 0?this.internalRepr.set(e,[r]):n.push(r)}remove(e){e=Oh(e),this.internalRepr.delete(e)}get(e){return e=Oh(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[r,n]of this.internalRepr)if(n.length>0){let i=n[0];e[r]=Buffer.isBuffer(i)?Buffer.from(i):i}return e}clone(){let e=new t(this.options),r=e.internalRepr;for(let[n,i]of this.internalRepr){let s=i.map(o=>Buffer.isBuffer(o)?Buffer.from(o):o);r.set(n,s)}return e}merge(e){for(let[r,n]of e.internalRepr){let i=(this.internalRepr.get(r)||[]).concat(n);this.internalRepr.set(r,i)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[r,n]of this.internalRepr)r.startsWith(":")||(e[r]=n.map(qee));return e}toJSON(){let e={};for(let[r,n]of this.internalRepr)e[r]=n;return e}setOpaque(e,r){this.opaqueData.set(e,r)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(e){let r=new t;for(let n of Object.keys(e)){if(n.charAt(0)===":")continue;let i=e[n];try{_U(n)?Array.isArray(i)?i.forEach(s=>{r.add(n,Buffer.from(s,"base64"))}):i!==void 0&&(Vee(n)?i.split(",").forEach(s=>{r.add(n,Buffer.from(s.trim(),"base64"))}):r.add(n,Buffer.from(i,"base64"))):Array.isArray(i)?i.forEach(s=>{r.add(n,s)}):i!==void 0&&r.add(n,i)}catch(s){let o=`Failed to add metadata entry ${n}: ${i}. ${(0,Dee.getErrorMessage)(s)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,Iee.log)(Lee.LogVerbosity.ERROR,o)}}return r}};bh.Metadata=f_;var qee=t=>Buffer.isBuffer(t)?t.toString("base64"):t});var Nh=m(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.CallCredentials=void 0;var __=He();function Gee(t){return"getRequestHeaders"in t&&typeof t.getRequestHeaders=="function"}var Us=class t{static createFromMetadataGenerator(e){return new m_(e)}static createFromGoogleCredential(e){return t.createFromMetadataGenerator((r,n)=>{let i;Gee(e)?i=e.getRequestHeaders(r.service_url):i=new Promise((s,o)=>{e.getRequestMetadata(r.service_url,(a,c)=>{if(a){o(a);return}if(!c){o(new Error("Headers not set by metadata plugin"));return}s(c)})}),i.then(s=>{let o=new __.Metadata;for(let a of Object.keys(s))o.add(a,s[a]);n(null,o)},s=>{n(s)})})}static createEmpty(){return new g_}};Mh.CallCredentials=Us;var p_=class t extends Us{constructor(e){super(),this.creds=e}async generateMetadata(e){let r=new __.Metadata,n=await Promise.all(this.creds.map(i=>i.generateMetadata(e)));for(let i of n)r.merge(i);return r}compose(e){return new t(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof t?this.creds.every((r,n)=>r._equals(e.creds[n])):!1}},m_=class t extends Us{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((r,n)=>{this.metadataGenerator(e,(i,s)=>{s!==void 0?r(s):n(i)})})}compose(e){return new p_([this,e])}_equals(e){return this===e?!0:e instanceof t?this.metadataGenerator===e.metadataGenerator:!1}},g_=class t extends Us{generateMetadata(e){return Promise.resolve(new __.Metadata)}compose(e){return e}_equals(e){return e instanceof t}}});var S_=m(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.CIPHER_SUITES=void 0;ba.getDefaultRootsData=zee;var Hee=L("fs");ba.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var EU=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,E_=null;function zee(){return EU?(E_===null&&(E_=Hee.readFileSync(EU)),E_):null}});var ot=m(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.parseUri=$ee;ks.splitHostPort=Wee;ks.combineHostPort=Yee;ks.uriToString=Kee;var jee=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function $ee(t){let e=jee.exec(t);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var SU=/^\d+$/;function Wee(t){if(t.startsWith("[")){let e=t.indexOf("]");if(e===-1)return null;let r=t.substring(1,e);if(r.indexOf(":")===-1)return null;if(t.length>e+1)if(t[e+1]===":"){let n=t.substring(e+2);return SU.test(n)?{host:r,port:+n}:null}else return null;else return{host:r}}else{let e=t.split(":");return e.length===2?SU.test(e[1])?{host:e[0],port:+e[1]}:null:{host:t}}}function Yee(t){return t.port===void 0?t.host:t.host.includes(":")?`[${t.host}]:${t.port}`:`${t.host}:${t.port}`}function Kee(t){let e="";return t.scheme!==void 0&&(e+=t.scheme+":"),t.authority!==void 0&&(e+="//"+t.authority+"/"),e+=t.path,e}});var Xt=m($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;$r.registerResolver=Xee;$r.registerDefaultScheme=Jee;$r.createResolver=Qee;$r.getDefaultAuthority=Zee;$r.mapUriDefaultScheme=ete;var y_=ot();$r.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var Fs={},T_=null;function Xee(t,e){Fs[t]=e}function Jee(t){T_=t}function Qee(t,e,r){if(t.scheme!==void 0&&t.scheme in Fs)return new Fs[t.scheme](t,e,r);throw new Error(`No resolver could be created for target ${(0,y_.uriToString)(t)}`)}function Zee(t){if(t.scheme!==void 0&&t.scheme in Fs)return Fs[t.scheme].getDefaultAuthority(t);throw new Error(`Invalid target ${(0,y_.uriToString)(t)}`)}function ete(t){return t.scheme===void 0||!(t.scheme in Fs)?T_!==null?{scheme:T_,authority:void 0,path:(0,y_.uriToString)(t)}:null:t}});var Bs=m(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.ChannelCredentials=void 0;Na.createCertificateProviderChannelCredentials=ite;var Ma=L("tls"),xh=Nh(),A_=S_(),TU=ot(),tte=Xt(),rte=Ee(),nte=te();function v_(t,e){if(t&&!(t instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var _i=class{compose(e){return new O_(this,e)}static createSsl(e,r,n,i){var s;if(v_(e,"Root certificate"),v_(r,"Private key"),v_(n,"Certificate chain"),r&&!n)throw new Error("Private key must be given with accompanying certificate chain");if(!r&&n)throw new Error("Certificate chain must be given with accompanying private key");let o=(0,Ma.createSecureContext)({ca:(s=e??(0,A_.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,key:r??void 0,cert:n??void 0,ciphers:A_.CIPHER_SUITES});return new wh(o,i??{})}static createFromSecureContext(e,r){return new wh(e,r??{})}static createInsecure(){return new C_}};Na.ChannelCredentials=_i;var C_=class t extends _i{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof t}_createSecureConnector(e,r,n){return{connect(i){return Promise.resolve({socket:i,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>n??xh.CallCredentials.createEmpty(),destroy(){}}}};function yU(t,e,r,n){var i,s;let o={secureContext:t},a=r;if("grpc.http_connect_target"in n){let d=(0,TU.parseUri)(n["grpc.http_connect_target"]);d&&(a=d)}let c=(0,tte.getDefaultAuthority)(a),l=(0,TU.splitHostPort)(c),h=(i=l?.host)!==null&&i!==void 0?i:c;if(o.host=h,e.checkServerIdentity&&(o.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(o.rejectUnauthorized=e.rejectUnauthorized),o.ALPNProtocols=["h2"],n["grpc.ssl_target_name_override"]){let d=n["grpc.ssl_target_name_override"],f=(s=o.checkServerIdentity)!==null&&s!==void 0?s:Ma.checkServerIdentity;o.checkServerIdentity=(p,g)=>f(d,g),o.servername=d}else o.servername=h;return n["grpc-node.tls_enable_trace"]&&(o.enableTrace=!0),o}var R_=class{constructor(e,r){this.connectionOptions=e,this.callCredentials=r}connect(e){let r=Object.assign({socket:e},this.connectionOptions);return new Promise((n,i)=>{let s=(0,Ma.connect)(r,()=>{var o;if((!((o=this.connectionOptions.rejectUnauthorized)!==null&&o!==void 0)||o)&&!s.authorized){i(s.authorizationError);return}n({socket:s,secure:!0})});s.on("error",o=>{i(o)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},wh=class t extends _i{constructor(e,r){super(),this.secureContext=e,this.verifyOptions=r}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof t?this.secureContext===e.secureContext&&this.verifyOptions.checkServerIdentity===e.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,r,n){let i=yU(this.secureContext,this.verifyOptions,e,r);return new R_(i,n??xh.CallCredentials.createEmpty())}},Ph=class t extends _i{constructor(e,r,n){super(),this.caCertificateProvider=e,this.identityCertificateProvider=r,this.verifyOptions=n,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(e){var r,n;return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&((r=this.verifyOptions)===null||r===void 0?void 0:r.checkServerIdentity)===((n=e.verifyOptions)===null||n===void 0?void 0:n.checkServerIdentity):!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;this.refcount-=1,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)===null||e===void 0||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(e,r,n){return this.ref(),new t.SecureConnectorImpl(this,e,r,n??xh.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){var e,r;if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,Ma.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(e=this.latestIdentityUpdate)===null||e===void 0?void 0:e.privateKey,cert:(r=this.latestIdentityUpdate)===null||r===void 0?void 0:r.certificate,ciphers:A_.CIPHER_SUITES})}catch(n){return(0,rte.log)(nte.LogVerbosity.ERROR,"Failed to createSecureContext with error "+n.message),null}}};Ph.SecureConnectorImpl=class{constructor(t,e,r,n){this.parent=t,this.channelTarget=e,this.options=r,this.callCredentials=n}connect(t){return new Promise((e,r)=>{let n=this.parent.getLatestSecureContext();if(!n){r(new Error("Failed to load credentials"));return}t.closed&&r(new Error("Socket closed while loading credentials"));let i=yU(n,this.parent.verifyOptions,this.channelTarget,this.options),s=Object.assign({socket:t},i),o=()=>{r(new Error("Socket closed"))},a=l=>{r(l)},c=(0,Ma.connect)(s,()=>{var l;if(c.removeListener("close",o),c.removeListener("error",a),(!((l=this.parent.verifyOptions.rejectUnauthorized)!==null&&l!==void 0)||l)&&!c.authorized){r(c.authorizationError);return}e({socket:c,secure:!0})});c.once("close",o),c.once("error",a)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function ite(t,e,r){return new Ph(t,e,r??{})}var O_=class t extends _i{constructor(e,r){if(super(),this.channelCredentials=e,this.callCredentials=r,!e._isSecure())throw new Error("Cannot compose insecure credentials")}compose(e){let r=this.callCredentials.compose(e);return new t(this.channelCredentials,r)}_isSecure(){return!0}_equals(e){return this===e?!0:e instanceof t?this.channelCredentials._equals(e.channelCredentials)&&this.callCredentials._equals(e.callCredentials):!1}_createSecureConnector(e,r,n){let i=this.callCredentials.compose(n??xh.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,i)}}});var wn=m(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.createChildChannelControlHelper=ate;vr.registerLoadBalancerType=cte;vr.registerDefaultLoadBalancerType=lte;vr.createLoadBalancer=ute;vr.isLoadBalancerNameRegistered=hte;vr.parseLoadBalancingConfig=vU;vr.getDefaultConfig=dte;vr.selectLbConfigFromList=fte;var ste=Ee(),ote=te();function ate(t,e){var r,n,i,s,o,a,c,l,h,d;return{createSubchannel:(n=(r=e.createSubchannel)===null||r===void 0?void 0:r.bind(e))!==null&&n!==void 0?n:t.createSubchannel.bind(t),updateState:(s=(i=e.updateState)===null||i===void 0?void 0:i.bind(e))!==null&&s!==void 0?s:t.updateState.bind(t),requestReresolution:(a=(o=e.requestReresolution)===null||o===void 0?void 0:o.bind(e))!==null&&a!==void 0?a:t.requestReresolution.bind(t),addChannelzChild:(l=(c=e.addChannelzChild)===null||c===void 0?void 0:c.bind(e))!==null&&l!==void 0?l:t.addChannelzChild.bind(t),removeChannelzChild:(d=(h=e.removeChannelzChild)===null||h===void 0?void 0:h.bind(e))!==null&&d!==void 0?d:t.removeChannelzChild.bind(t)}}var Nn={},wa=null;function cte(t,e,r){Nn[t]={LoadBalancer:e,LoadBalancingConfig:r}}function lte(t){wa=t}function ute(t,e){let r=t.getLoadBalancerName();return r in Nn?new Nn[r].LoadBalancer(e):null}function hte(t){return t in Nn}function vU(t){let e=Object.keys(t);if(e.length!==1)throw new Error("Provided load balancing config has multiple conflicting entries");let r=e[0];if(r in Nn)try{return Nn[r].LoadBalancingConfig.createFromJson(t[r])}catch(n){throw new Error(`${r}: ${n.message}`)}else throw new Error(`Unrecognized load balancing config name ${r}`)}function dte(){if(!wa)throw new Error("No default load balancer type registered");return new Nn[wa].LoadBalancingConfig}function fte(t,e=!1){for(let r of t)try{return vU(r)}catch(n){(0,ste.log)(ote.LogVerbosity.DEBUG,"Config parsing failed with error",n.message);continue}return e&&wa?new Nn[wa].LoadBalancingConfig:null}});var b_=m(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.validateRetryThrottling=AU;Pa.validateServiceConfig=CU;Pa.extractAndSelectServiceConfig=Ate;var pte=L("os"),Ih=te(),Lh=/^\d+(\.\d{1,9})?s$/,mte="node";function gte(t){if("service"in t&&t.service!==""){if(typeof t.service!="string")throw new Error(`Invalid method config name: invalid service: expected type string, got ${typeof t.service}`);if("method"in t&&t.method!==""){if(typeof t.method!="string")throw new Error(`Invalid method config name: invalid method: expected type string, got ${typeof t.service}`);return{service:t.service,method:t.method}}else return{service:t.service}}else{if("method"in t&&t.method!==void 0)throw new Error("Invalid method config name: method set with empty or unset service");return{}}}function _te(t){if(!("maxAttempts"in t)||!Number.isInteger(t.maxAttempts)||t.maxAttempts<2)throw new Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in t)||typeof t.initialBackoff!="string"||!Lh.test(t.initialBackoff))throw new Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in t)||typeof t.maxBackoff!="string"||!Lh.test(t.maxBackoff))throw new Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in t)||typeof t.backoffMultiplier!="number"||t.backoffMultiplier<=0)throw new Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!("retryableStatusCodes"in t&&Array.isArray(t.retryableStatusCodes)))throw new Error("Invalid method config retry policy: retryableStatusCodes is required");if(t.retryableStatusCodes.length===0)throw new Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let e of t.retryableStatusCodes)if(typeof e=="number"){if(!Object.values(Ih.Status).includes(e))throw new Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof e=="string"){if(!Object.values(Ih.Status).includes(e.toUpperCase()))throw new Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw new Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:t.maxAttempts,initialBackoff:t.initialBackoff,maxBackoff:t.maxBackoff,backoffMultiplier:t.backoffMultiplier,retryableStatusCodes:t.retryableStatusCodes}}function Ete(t){if(!("maxAttempts"in t)||!Number.isInteger(t.maxAttempts)||t.maxAttempts<2)throw new Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in t&&(typeof t.hedgingDelay!="string"||!Lh.test(t.hedgingDelay)))throw new Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in t&&Array.isArray(t.nonFatalStatusCodes))for(let r of t.nonFatalStatusCodes)if(typeof r=="number"){if(!Object.values(Ih.Status).includes(r))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof r=="string"){if(!Object.values(Ih.Status).includes(r.toUpperCase()))throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw new Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let e={maxAttempts:t.maxAttempts};return t.hedgingDelay&&(e.hedgingDelay=t.hedgingDelay),t.nonFatalStatusCodes&&(e.nonFatalStatusCodes=t.nonFatalStatusCodes),e}function Ste(t){var e;let r={name:[]};if(!("name"in t)||!Array.isArray(t.name))throw new Error("Invalid method config: invalid name array");for(let n of t.name)r.name.push(gte(n));if("waitForReady"in t){if(typeof t.waitForReady!="boolean")throw new Error("Invalid method config: invalid waitForReady");r.waitForReady=t.waitForReady}if("timeout"in t)if(typeof t.timeout=="object"){if(!("seconds"in t.timeout)||typeof t.timeout.seconds!="number")throw new Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in t.timeout)||typeof t.timeout.nanos!="number")throw new Error("Invalid method config: invalid timeout.nanos");r.timeout=t.timeout}else if(typeof t.timeout=="string"&&Lh.test(t.timeout)){let n=t.timeout.substring(0,t.timeout.length-1).split(".");r.timeout={seconds:n[0]|0,nanos:((e=n[1])!==null&&e!==void 0?e:0)|0}}else throw new Error("Invalid method config: invalid timeout");if("maxRequestBytes"in t){if(typeof t.maxRequestBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");r.maxRequestBytes=t.maxRequestBytes}if("maxResponseBytes"in t){if(typeof t.maxResponseBytes!="number")throw new Error("Invalid method config: invalid maxRequestBytes");r.maxResponseBytes=t.maxResponseBytes}if("retryPolicy"in t){if("hedgingPolicy"in t)throw new Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");r.retryPolicy=_te(t.retryPolicy)}else"hedgingPolicy"in t&&(r.hedgingPolicy=Ete(t.hedgingPolicy));return r}function AU(t){if(!("maxTokens"in t)||typeof t.maxTokens!="number"||t.maxTokens<=0||t.maxTokens>1e3)throw new Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in t)||typeof t.tokenRatio!="number"||t.tokenRatio<=0)throw new Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+t.maxTokens.toFixed(3),tokenRatio:+t.tokenRatio.toFixed(3)}}function Tte(t){if(!(typeof t=="object"&&t!==null))throw new Error(`Invalid loadBalancingConfig: unexpected type ${typeof t}`);let e=Object.keys(t);if(e.length>1)throw new Error(`Invalid loadBalancingConfig: unexpected multiple keys ${e}`);if(e.length===0)throw new Error("Invalid loadBalancingConfig: load balancing policy name required");return{[e[0]]:t[e[0]]}}function CU(t){let e={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in t)if(typeof t.loadBalancingPolicy=="string")e.loadBalancingPolicy=t.loadBalancingPolicy;else throw new Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in t)if(Array.isArray(t.loadBalancingConfig))for(let n of t.loadBalancingConfig)e.loadBalancingConfig.push(Tte(n));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in t&&Array.isArray(t.methodConfig))for(let n of t.methodConfig)e.methodConfig.push(Ste(n));"retryThrottling"in t&&(e.retryThrottling=AU(t.retryThrottling));let r=[];for(let n of e.methodConfig)for(let i of n.name){for(let s of r)if(i.service===s.service&&i.method===s.method)throw new Error(`Invalid service config: duplicate name ${i.service}/${i.method}`);r.push(i)}return e}function yte(t){if(!("serviceConfig"in t))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:CU(t.serviceConfig)};if("clientLanguage"in t)if(Array.isArray(t.clientLanguage)){e.clientLanguage=[];for(let n of t.clientLanguage)if(typeof n=="string")e.clientLanguage.push(n);else throw new Error("Invalid service config choice: invalid clientLanguage")}else throw new Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in t)if(Array.isArray(t.clientHostname)){e.clientHostname=[];for(let n of t.clientHostname)if(typeof n=="string")e.clientHostname.push(n);else throw new Error("Invalid service config choice: invalid clientHostname")}else throw new Error("Invalid service config choice: invalid clientHostname");if("percentage"in t)if(typeof t.percentage=="number"&&0<=t.percentage&&t.percentage<=100)e.percentage=t.percentage;else throw new Error("Invalid service config choice: invalid percentage");let r=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let n in t)if(!r.includes(n))throw new Error(`Invalid service config choice: unexpected field ${n}`);return e}function vte(t,e){if(!Array.isArray(t))throw new Error("Invalid service config list");for(let r of t){let n=yte(r);if(!(typeof n.percentage=="number"&&e>n.percentage)){if(Array.isArray(n.clientHostname)){let i=!1;for(let s of n.clientHostname)s===pte.hostname()&&(i=!0);if(!i)continue}if(Array.isArray(n.clientLanguage)){let i=!1;for(let s of n.clientLanguage)s===mte&&(i=!0);if(!i)continue}return n.serviceConfig}}throw new Error("No matching service config found")}function Ate(t,e){for(let r of t)if(r.length>0&&r[0].startsWith("grpc_config=")){let n=r.join("").substring(12),i=JSON.parse(n);return vte(i,e)}return null}});var at=m(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.ConnectivityState=void 0;var RU;(function(t){t[t.IDLE=0]="IDLE",t[t.CONNECTING=1]="CONNECTING",t[t.READY=2]="READY",t[t.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",t[t.SHUTDOWN=4]="SHUTDOWN"})(RU||(Dh.ConnectivityState=RU={}))});var Wr=m(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.QueuePicker=Pn.UnavailablePicker=Pn.PickResultType=void 0;var Cte=He(),Rte=te(),Uh;(function(t){t[t.COMPLETE=0]="COMPLETE",t[t.QUEUE=1]="QUEUE",t[t.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",t[t.DROP=3]="DROP"})(Uh||(Pn.PickResultType=Uh={}));var M_=class{constructor(e){this.status=Object.assign({code:Rte.Status.UNAVAILABLE,details:"No connection established",metadata:new Cte.Metadata},e)}pick(e){return{pickResultType:Uh.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};Pn.UnavailablePicker=M_;var N_=class{constructor(e,r){this.loadBalancer=e,this.childPicker=r,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||(process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0),this.childPicker?this.childPicker.pick(e):{pickResultType:Uh.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};Pn.QueuePicker=N_});var Vs=m(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.BackoffTimeout=void 0;var Ote=te(),bte=Ee(),Mte="backoff",Nte=1e3,wte=1.6,Pte=12e4,xte=.2;function Ite(t,e){return Math.random()*(e-t)+t}var kh=class t{constructor(e,r){this.callback=e,this.initialDelay=Nte,this.multiplier=wte,this.maxDelay=Pte,this.jitter=xte,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=t.getNextId(),r&&(r.initialDelay&&(this.initialDelay=r.initialDelay),r.multiplier&&(this.multiplier=r.multiplier),r.jitter&&(this.jitter=r.jitter),r.maxDelay&&(this.maxDelay=r.maxDelay)),this.trace("constructed initialDelay="+this.initialDelay+" multiplier="+this.multiplier+" jitter="+this.jitter+" maxDelay="+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){bte.trace(Ote.LogVerbosity.DEBUG,Mte,"{"+this.id+"} "+e)}runTimer(e){var r,n;this.trace("runTimer(delay="+e+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},e),this.hasRef||(n=(r=this.timerId).unref)===null||n===void 0||n.call(r)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),r=e*this.jitter;this.nextDelay=e+Ite(-r,r)}stop(){this.trace("stop()"),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace("reset() running="+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,r=this.startTime;r.setMilliseconds(r.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<r?this.runTimer(r.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,r;this.hasRef=!0,(r=(e=this.timerId).ref)===null||r===void 0||r.call(e)}unref(){var e,r;this.hasRef=!1,(r=(e=this.timerId).unref)===null||r===void 0||r.call(e)}getEndTime(){return this.endTime}};Fh.BackoffTimeout=kh;kh.nextId=0});var Vh=m(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.ChildLoadBalancerHandler=void 0;var Lte=wn(),Dte=at(),Ute="child_load_balancer_helper",w_=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(r){this.parent=r,this.child=null}createSubchannel(r,n){return this.parent.channelControlHelper.createSubchannel(r,n)}updateState(r,n,i){var s;if(this.calledByPendingChild()){if(r===Dte.ConnectivityState.CONNECTING)return;(s=this.parent.currentChild)===null||s===void 0||s.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(r,n,i)}requestReresolution(){var r;let n=(r=this.parent.pendingChild)!==null&&r!==void 0?r:this.parent.currentChild;this.child===n&&this.parent.channelControlHelper.requestReresolution()}setChild(r){this.child=r}addChannelzChild(r){this.parent.channelControlHelper.addChannelzChild(r)}removeChannelzChild(r){this.parent.channelControlHelper.removeChannelzChild(r)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,r){return e.getLoadBalancerName()!==r.getLoadBalancerName()}updateAddressList(e,r,n,i){let s;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){let o=new this.ChildPolicyHelper(this),a=(0,Lte.createLoadBalancer)(r,o);o.setChild(a),this.currentChild===null?(this.currentChild=a,s=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=a,s=this.pendingChild)}else this.pendingChild===null?s=this.currentChild:s=this.pendingChild;return this.latestConfig=r,s.updateAddressList(e,r,n,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&(this.currentChild.destroy(),this.currentChild=null),this.pendingChild&&(this.pendingChild.destroy(),this.pendingChild=null)}getTypeName(){return Ute}};Bh.ChildLoadBalancerHandler=w_});var MU=m(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.ResolvingLoadBalancer=void 0;var kte=wn(),Fte=b_(),_t=at(),OU=Xt(),xa=Wr(),Bte=Vs(),P_=te(),Vte=He(),qte=Ee(),Gte=te(),Hte=ot(),zte=Vh(),jte="resolving_load_balancer";function bU(t){qte.trace(Gte.LogVerbosity.DEBUG,jte,t)}var $te=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function Wte(t,e,r,n){for(let i of r.name)switch(n){case"EMPTY":if(!i.service&&!i.method)return!0;break;case"SERVICE":if(i.service===t&&!i.method)return!0;break;case"SERVICE_AND_METHOD":if(i.service===t&&i.method===e)return!0}return!1}function Yte(t,e,r,n){for(let i of r)if(Wte(t,e,i,n))return i;return null}function Kte(t){return{invoke(e,r){var n,i;let s=e.split("/").filter(c=>c.length>0),o=(n=s[0])!==null&&n!==void 0?n:"",a=(i=s[1])!==null&&i!==void 0?i:"";if(t&&t.methodConfig)for(let c of $te){let l=Yte(o,a,t.methodConfig,c);if(l)return{methodConfig:l,pickInformation:{},status:P_.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:P_.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var x_=class{constructor(e,r,n,i,s){this.target=e,this.channelControlHelper=r,this.channelOptions=n,this.onSuccessfulResolution=i,this.onFailedResolution=s,this.latestChildState=_t.ConnectivityState.IDLE,this.latestChildPicker=new xa.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=_t.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,n["grpc.service_config"]?this.defaultServiceConfig=(0,Fte.validateServiceConfig)(JSON.parse(n["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(_t.ConnectivityState.IDLE,new xa.QueuePicker(this),null),this.childLoadBalancer=new zte.ChildLoadBalancerHandler({createSubchannel:r.createSubchannel.bind(r),requestReresolution:()=>{this.backoffTimeout.isRunning()?(bU("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(a,c,l)=>{this.latestChildState=a,this.latestChildPicker=c,this.latestChildErrorMessage=l,this.updateState(a,c,l)},addChannelzChild:r.addChannelzChild.bind(r),removeChannelzChild:r.removeChannelzChild.bind(r)}),this.innerResolver=(0,OU.createResolver)(e,this.handleResolverResult.bind(this),n);let o={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new Bte.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},o),this.backoffTimeout.unref()}handleResolverResult(e,r,n,i){var s,o;this.backoffTimeout.stop(),this.backoffTimeout.reset();let a=!0,c=null;if(n===null?c=this.defaultServiceConfig:n.ok?c=n.value:this.previousServiceConfig!==null?c=this.previousServiceConfig:(a=!1,this.handleResolutionFailure(n.error)),c!==null){let l=(s=c?.loadBalancingConfig)!==null&&s!==void 0?s:[],h=(0,kte.selectLbConfigFromList)(l,!0);h===null?(a=!1,this.handleResolutionFailure({code:P_.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new Vte.Metadata})):a=this.childLoadBalancer.updateAddressList(e,h,Object.assign(Object.assign({},this.channelOptions),r),i)}return a&&this.onSuccessfulResolution(c,(o=r[OU.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&o!==void 0?o:Kte(c)),a}updateResolution(){this.innerResolver.updateResolution(),this.currentState===_t.ConnectivityState.IDLE&&this.updateState(_t.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,r,n){bU((0,Hte.uriToString)(this.target)+" "+_t.ConnectivityState[this.currentState]+" -> "+_t.ConnectivityState[e]),e===_t.ConnectivityState.IDLE&&(r=new xa.QueuePicker(this,r)),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}handleResolutionFailure(e){this.latestChildState===_t.ConnectivityState.IDLE&&(this.updateState(_t.ConnectivityState.TRANSIENT_FAILURE,new xa.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===_t.ConnectivityState.IDLE||this.currentState===_t.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,r){throw new Error("updateAddressList not supported on ResolvingLoadBalancer")}resetBackoff(){this.backoffTimeout.reset(),this.childLoadBalancer.resetBackoff()}destroy(){this.childLoadBalancer.destroy(),this.innerResolver.destroy(),this.backoffTimeout.reset(),this.backoffTimeout.stop(),this.latestChildState=_t.ConnectivityState.IDLE,this.latestChildPicker=new xa.QueuePicker(this),this.currentState=_t.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};qh.ResolvingLoadBalancer=x_});var NU=m(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.recognizedOptions=void 0;Ia.channelOptionsEqual=Xte;Ia.recognizedOptions={"grpc.ssl_target_name_override":!0,"grpc.primary_user_agent":!0,"grpc.secondary_user_agent":!0,"grpc.default_authority":!0,"grpc.keepalive_time_ms":!0,"grpc.keepalive_timeout_ms":!0,"grpc.keepalive_permit_without_calls":!0,"grpc.service_config":!0,"grpc.max_concurrent_streams":!0,"grpc.initial_reconnect_backoff_ms":!0,"grpc.max_reconnect_backoff_ms":!0,"grpc.use_local_subchannel_pool":!0,"grpc.max_send_message_length":!0,"grpc.max_receive_message_length":!0,"grpc.enable_http_proxy":!0,"grpc.enable_channelz":!0,"grpc.dns_min_time_between_resolutions_ms":!0,"grpc.enable_retries":!0,"grpc.per_rpc_retry_buffer_size":!0,"grpc.retry_buffer_size":!0,"grpc.max_connection_age_ms":!0,"grpc.max_connection_age_grace_ms":!0,"grpc-node.max_session_memory":!0,"grpc.service_config_disable_resolution":!0,"grpc.client_idle_timeout_ms":!0,"grpc-node.tls_enable_trace":!0,"grpc.lb.ring_hash.ring_size_cap":!0,"grpc-node.retry_max_attempts_limit":!0,"grpc-node.flow_control_window":!0,"grpc.server_call_metric_recording":!0};function Xte(t,e){let r=Object.keys(t).sort(),n=Object.keys(e).sort();if(r.length!==n.length)return!1;for(let i=0;i<r.length;i+=1)if(r[i]!==n[i]||t[r[i]]!==e[n[i]])return!1;return!0}});var Et=m(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.EndpointMap=void 0;Jt.isTcpSubchannelAddress=Da;Jt.subchannelAddressEqual=Gh;Jt.subchannelAddressToString=PU;Jt.stringToSubchannelAddress=Qte;Jt.endpointEqual=Zte;Jt.endpointToString=ere;Jt.endpointHasAddress=xU;var wU=L("net");function Da(t){return"port"in t}function Gh(t,e){return!t&&!e?!0:!t||!e?!1:Da(t)?Da(e)&&t.host===e.host&&t.port===e.port:!Da(e)&&t.path===e.path}function PU(t){return Da(t)?(0,wU.isIPv6)(t.host)?"["+t.host+"]:"+t.port:t.host+":"+t.port:t.path}var Jte=443;function Qte(t,e){return(0,wU.isIP)(t)?{host:t,port:e??Jte}:{path:t}}function Zte(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r=0;r<t.addresses.length;r++)if(!Gh(t.addresses[r],e.addresses[r]))return!1;return!0}function ere(t){return"["+t.addresses.map(PU).join(", ")+"]"}function xU(t,e){for(let r of t.addresses)if(Gh(r,e))return!0;return!1}function La(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r of t.addresses){let n=!1;for(let i of e.addresses)if(Gh(r,i)){n=!0;break}if(!n)return!1}return!0}var I_=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let r of this.map)if(xU(r.key,e))return r.value}deleteMissing(e){let r=[];for(let n of this.map){let i=!1;for(let s of e)La(s,n.key)&&(i=!0);i||(r.push(n.value),this.map.delete(n))}return r}get(e){for(let r of this.map)if(La(e,r.key))return r.value}set(e,r){for(let n of this.map)if(La(e,n.key)){n.value=r;return}this.map.add({key:e,value:r})}delete(e){for(let r of this.map)if(La(e,r.key)){this.map.delete(r);return}}has(e){for(let r of this.map)if(La(e,r.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}};Jt.EndpointMap=I_});var LU={};kr(LU,{OrderedMap:()=>cre});function qs(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");L_(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function tre(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(h){return c([l,h])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(h){l=[6,h],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ei(){throw new RangeError("Iterator access denied!")}var L_,IU,rre,nre,ire,sre,ore,are,Yr,cre,DU=T(()=>{"use strict";L_=function(t,e){return L_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},L_(t,e)};IU=function(){function t(e,r,n){n===void 0&&(n=1),this.t=void 0,this.i=void 0,this.h=void 0,this.u=e,this.o=r,this.l=n}return t.prototype.v=function(){var e=this,r=e.h.h===e;if(r&&e.l===1)e=e.i;else if(e.t)for(e=e.t;e.i;)e=e.i;else{if(r)return e.h;for(var n=e.h;n.t===e;)e=n,n=e.h;e=n}return e},t.prototype.p=function(){var e=this;if(e.i){for(e=e.i;e.t;)e=e.t;return e}else{for(var r=e.h;r.i===e;)e=r,r=e.h;return e.i!==r?r:e}},t.prototype.T=function(){var e=this.h,r=this.i,n=r.t;return e.h===this?e.h=r:e.t===this?e.t=r:e.i=r,r.h=e,r.t=this,this.h=r,this.i=n,n&&(n.h=this),r},t.prototype.I=function(){var e=this.h,r=this.t,n=r.i;return e.h===this?e.h=r:e.t===this?e.t=r:e.i=r,r.h=e,r.i=this,this.h=r,this.t=n,n&&(n.h=this),r},t}(),rre=function(t){qs(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.O=1,r}return e.prototype.T=function(){var r=t.prototype.T.call(this);return this.M(),r.M(),r},e.prototype.I=function(){var r=t.prototype.I.call(this);return this.M(),r.M(),r},e.prototype.M=function(){this.O=1,this.t&&(this.O+=this.t.O),this.i&&(this.O+=this.i.O)},e}(IU),nre=function(){function t(e){e===void 0&&(e=0),this.iteratorType=e}return t.prototype.equals=function(e){return this.C===e.C},t}(),ire=function(){function t(){this._=0}return Object.defineProperty(t.prototype,"length",{get:function(){return this._},enumerable:!1,configurable:!0}),t.prototype.size=function(){return this._},t.prototype.empty=function(){return this._===0},t}(),sre=function(t){qs(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(ire);ore=function(t){qs(e,t);function e(r,n){r===void 0&&(r=function(s,o){return s<o?-1:s>o?1:0}),n===void 0&&(n=!1);var i=t.call(this)||this;return i.N=void 0,i.g=r,i.enableIndex=n,i.S=n?rre:IU,i.A=new i.S,i}return e.prototype.m=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);if(s<0)r=r.i;else if(s>0)i=r,r=r.t;else return r}return i},e.prototype.B=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);s<=0?r=r.i:(i=r,r=r.t)}return i},e.prototype.j=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);if(s<0)i=r,r=r.i;else if(s>0)r=r.t;else return r}return i},e.prototype.k=function(r,n){for(var i=this.A;r;){var s=this.g(r.u,n);s<0?(i=r,r=r.i):r=r.t}return i},e.prototype.R=function(r){for(;;){var n=r.h;if(n===this.A)return;if(r.l===1){r.l=0;return}if(r===n.t){var i=n.i;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.T():n.T();else if(i.i&&i.i.l===1){i.l=n.l,n.l=0,i.i.l=0,n===this.N?this.N=n.T():n.T();return}else i.t&&i.t.l===1?(i.l=1,i.t.l=0,i.I()):(i.l=1,r=n)}else{var i=n.t;if(i.l===1)i.l=0,n.l=1,n===this.N?this.N=n.I():n.I();else if(i.t&&i.t.l===1){i.l=n.l,n.l=0,i.t.l=0,n===this.N?this.N=n.I():n.I();return}else i.i&&i.i.l===1?(i.l=1,i.i.l=0,i.T()):(i.l=1,r=n)}}},e.prototype.G=function(r){if(this._===1){this.clear();return}for(var n=r;n.t||n.i;){if(n.i)for(n=n.i;n.t;)n=n.t;else n=n.t;var i=r.u;r.u=n.u,n.u=i;var s=r.o;r.o=n.o,n.o=s,r=n}this.A.t===n?this.A.t=n.h:this.A.i===n&&(this.A.i=n.h),this.R(n);var o=n.h;if(n===o.t?o.t=void 0:o.i=void 0,this._-=1,this.N.l=0,this.enableIndex)for(;o!==this.A;)o.O-=1,o=o.h},e.prototype.P=function(r){for(var n=typeof r=="number"?r:void 0,i=typeof r=="function"?r:void 0,s=typeof r>"u"?[]:void 0,o=0,a=this.N,c=[];c.length||a;)if(a)c.push(a),a=a.t;else{if(a=c.pop(),o===n)return a;s&&s.push(a),i&&i(a,o,this),o+=1,a=a.i}return s},e.prototype.q=function(r){for(;;){var n=r.h;if(n.l===0)return;var i=n.h;if(n===i.t){var s=i.i;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,r=i;continue}else if(r===n.i){if(r.l=0,r.t&&(r.t.h=n),r.i&&(r.i.h=i),n.i=r.t,i.t=r.i,r.t=n,r.i=i,i===this.N)this.N=r,this.A.h=r;else{var o=i.h;o.t===i?o.t=r:o.i=r}r.h=i.h,n.h=r,i.h=r,i.l=1}else{n.l=0,i===this.N?this.N=i.I():i.I(),i.l=1;return}}else{var s=i.t;if(s&&s.l===1){if(s.l=n.l=0,i===this.N)return;i.l=1,r=i;continue}else if(r===n.t){if(r.l=0,r.t&&(r.t.h=i),r.i&&(r.i.h=n),i.i=r.t,n.t=r.i,r.t=i,r.i=n,i===this.N)this.N=r,this.A.h=r;else{var o=i.h;o.t===i?o.t=r:o.i=r}r.h=i.h,n.h=r,i.h=r,i.l=1}else{n.l=0,i===this.N?this.N=i.T():i.T(),i.l=1;return}}this.enableIndex&&(n.M(),i.M(),r.M());return}},e.prototype.D=function(r,n,i){if(this.N===void 0)return this._+=1,this.N=new this.S(r,n,0),this.N.h=this.A,this.A.h=this.A.t=this.A.i=this.N,this._;var s,o=this.A.t,a=this.g(o.u,r);if(a===0)return o.o=n,this._;if(a>0)o.t=new this.S(r,n),o.t.h=o,s=o.t,this.A.t=s;else{var c=this.A.i,l=this.g(c.u,r);if(l===0)return c.o=n,this._;if(l<0)c.i=new this.S(r,n),c.i.h=c,s=c.i,this.A.i=s;else{if(i!==void 0){var h=i.C;if(h!==this.A){var d=this.g(h.u,r);if(d===0)return h.o=n,this._;if(d>0){var f=h.v(),p=this.g(f.u,r);if(p===0)return f.o=n,this._;p<0&&(s=new this.S(r,n),f.i===void 0?(f.i=s,s.h=f):(h.t=s,s.h=h))}}}if(s===void 0)for(s=this.N;;){var g=this.g(s.u,r);if(g>0){if(s.t===void 0){s.t=new this.S(r,n),s.t.h=s,s=s.t;break}s=s.t}else if(g<0){if(s.i===void 0){s.i=new this.S(r,n),s.i.h=s,s=s.i;break}s=s.i}else return s.o=n,this._}}}if(this.enableIndex)for(var S=s.h;S!==this.A;)S.O+=1,S=S.h;return this.q(s),this._+=1,this._},e.prototype.F=function(r,n){for(;r;){var i=this.g(r.u,n);if(i<0)r=r.i;else if(i>0)r=r.t;else return r}return r||this.A},e.prototype.clear=function(){this._=0,this.N=void 0,this.A.h=void 0,this.A.t=this.A.i=void 0},e.prototype.updateKeyByIterator=function(r,n){var i=r.C;if(i===this.A&&Ei(),this._===1)return i.u=n,!0;var s=i.p().u;if(i===this.A.t)return this.g(s,n)>0?(i.u=n,!0):!1;var o=i.v().u;return i===this.A.i?this.g(o,n)<0?(i.u=n,!0):!1:this.g(o,n)>=0||this.g(s,n)<=0?!1:(i.u=n,!0)},e.prototype.eraseElementByPos=function(r){if(r<0||r>this._-1)throw new RangeError;var n=this.P(r);return this.G(n),this._},e.prototype.eraseElementByKey=function(r){if(this._===0)return!1;var n=this.F(this.N,r);return n===this.A?!1:(this.G(n),!0)},e.prototype.eraseElementByIterator=function(r){var n=r.C;n===this.A&&Ei();var i=n.i===void 0,s=r.iteratorType===0;return s?i&&r.next():(!i||n.t===void 0)&&r.next(),this.G(n),r},e.prototype.getHeight=function(){if(this._===0)return 0;function r(n){return n?Math.max(r(n.t),r(n.i))+1:0}return r(this.N)},e}(sre),are=function(t){qs(e,t);function e(r,n,i){var s=t.call(this,i)||this;return s.C=r,s.A=n,s.iteratorType===0?(s.pre=function(){return this.C===this.A.t&&Ei(),this.C=this.C.v(),this},s.next=function(){return this.C===this.A&&Ei(),this.C=this.C.p(),this}):(s.pre=function(){return this.C===this.A.i&&Ei(),this.C=this.C.p(),this},s.next=function(){return this.C===this.A&&Ei(),this.C=this.C.v(),this}),s}return Object.defineProperty(e.prototype,"index",{get:function(){var r=this.C,n=this.A.h;if(r===this.A)return n?n.O-1:0;var i=0;for(r.t&&(i+=r.t.O);r!==n;){var s=r.h;r===s.i&&(i+=1,s.t&&(i+=s.t.O)),r=s}return i},enumerable:!1,configurable:!0}),e.prototype.isAccessible=function(){return this.C!==this.A},e}(nre),Yr=function(t){qs(e,t);function e(r,n,i,s){var o=t.call(this,r,n,s)||this;return o.container=i,o}return Object.defineProperty(e.prototype,"pointer",{get:function(){this.C===this.A&&Ei();var r=this;return new Proxy([],{get:function(n,i){return i==="0"?r.C.u:i==="1"?r.C.o:(n[0]=r.C.u,n[1]=r.C.o,n[i])},set:function(n,i,s){if(i!=="1")throw new TypeError("prop must be 1");return r.C.o=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.C,this.A,this.container,this.iteratorType)},e}(are),cre=function(t){qs(e,t);function e(r,n,i){r===void 0&&(r=[]);var s=t.call(this,n,i)||this,o=s;return r.forEach(function(a){o.setElement(a[0],a[1])}),s}return e.prototype.begin=function(){return new Yr(this.A.t||this.A,this.A,this)},e.prototype.end=function(){return new Yr(this.A,this.A,this)},e.prototype.rBegin=function(){return new Yr(this.A.i||this.A,this.A,this,1)},e.prototype.rEnd=function(){return new Yr(this.A,this.A,this,1)},e.prototype.front=function(){if(this._!==0){var r=this.A.t;return[r.u,r.o]}},e.prototype.back=function(){if(this._!==0){var r=this.A.i;return[r.u,r.o]}},e.prototype.lowerBound=function(r){var n=this.m(this.N,r);return new Yr(n,this.A,this)},e.prototype.upperBound=function(r){var n=this.B(this.N,r);return new Yr(n,this.A,this)},e.prototype.reverseLowerBound=function(r){var n=this.j(this.N,r);return new Yr(n,this.A,this)},e.prototype.reverseUpperBound=function(r){var n=this.k(this.N,r);return new Yr(n,this.A,this)},e.prototype.forEach=function(r){this.P(function(n,i,s){r([n.u,n.o],i,s)})},e.prototype.setElement=function(r,n,i){return this.D(r,n,i)},e.prototype.getElementByPos=function(r){if(r<0||r>this._-1)throw new RangeError;var n=this.P(r);return[n.u,n.o]},e.prototype.find=function(r){var n=this.F(this.N,r);return new Yr(n,this.A,this)},e.prototype.getElementByKey=function(r){var n=this.F(this.N,r);return n.o},e.prototype.union=function(r){var n=this;return r.forEach(function(i){n.setElement(i[0],i[1])}),this._},e.prototype[Symbol.iterator]=function(){var r,n,i,s;return tre(this,function(o){switch(o.label){case 0:r=this._,n=this.P(),i=0,o.label=1;case 1:return i<r?(s=n[i],[4,[s.u,s.o]]):[3,4];case 2:o.sent(),o.label=3;case 3:return++i,[3,1];case 4:return[2]}})},e}(ore)});var zh=m(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.registerAdminService=lre;Hh.addAdminServicesToServer=ure;var UU=[];function lre(t,e){UU.push({getServiceDefinition:t,getHandlers:e})}function ure(t){for(let{getServiceDefinition:e,getHandlers:r}of UU)t.addService(e(),r())}});var kU=m(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.ClientDuplexStreamImpl=Qt.ClientWritableStreamImpl=Qt.ClientReadableStreamImpl=Qt.ClientUnaryCallImpl=void 0;Qt.callErrorFromStatus=dre;var hre=L("events"),B_=L("stream"),Ua=te();function dre(t,e){let r=`${t.code} ${Ua.Status[t.code]}: ${t.details}`,i=`${new Error(r).stack}
|
|
46
|
-
for call at
|
|
47
|
-
${e}`;return Object.assign(new Error(r),t,{stack:i})}var D_=class extends hre.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Ua.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}};Qt.ClientUnaryCallImpl=D_;var U_=class extends B_.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Ua.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_read(e){var r;(r=this.call)===null||r===void 0||r.startRead()}};Qt.ClientReadableStreamImpl=U_;var k_=class extends B_.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Ua.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_write(e,r,n){var i;let s={callback:n},o=Number(r);Number.isNaN(o)||(s.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(s,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};Qt.ClientWritableStreamImpl=k_;var F_=class extends B_.Duplex{constructor(e,r){super({objectMode:!0}),this.serialize=e,this.deserialize=r}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Ua.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_read(e){var r;(r=this.call)===null||r===void 0||r.startRead()}_write(e,r,n){var i;let s={callback:n},o=Number(r);Number.isNaN(o)||(s.flags=o),(i=this.call)===null||i===void 0||i.sendMessageWithContext(s,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};Qt.ClientDuplexStreamImpl=F_});var Ti=m(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.InterceptingListenerImpl=void 0;Si.statusOrFromValue=pre;Si.statusOrFromError=mre;Si.isInterceptingListener=gre;var fre=He();function pre(t){return{ok:!0,value:t}}function mre(t){var e;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:(e=t.metadata)!==null&&e!==void 0?e:new fre.Metadata})}}function gre(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var V_=class{constructor(e,r){this.listener=e,this.nextListener=r,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextListener.onReceiveStatus(r)})}};Si.InterceptingListenerImpl=V_});var W_=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.InterceptingCall=Zt.RequesterBuilder=Zt.ListenerBuilder=Zt.InterceptorConfigurationError=void 0;Zt.getInterceptingCall=Tre;var _re=He(),FU=Ti(),BU=te(),VU=Rh(),Fa=class t extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,t)}};Zt.InterceptorConfigurationError=Fa;var G_=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};Zt.ListenerBuilder=G_;var H_=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};Zt.RequesterBuilder=H_;var q_={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveStatus:(t,e)=>{e(t)}},ka={start:(t,e,r)=>{r(t,e)},sendMessage:(t,e)=>{e(t)},halfClose:t=>{t()},cancel:t=>{t()}},z_=class{constructor(e,r){var n,i,s,o;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,r?this.requester={start:(n=r.start)!==null&&n!==void 0?n:ka.start,sendMessage:(i=r.sendMessage)!==null&&i!==void 0?i:ka.sendMessage,halfClose:(s=r.halfClose)!==null&&s!==void 0?s:ka.halfClose,cancel:(o=r.cancel)!==null&&o!==void 0?o:ka.cancel}:this.requester=ka}cancelWithStatus(e,r){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,r)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,r){var n,i,s,o,a,c;let l={onReceiveMetadata:(i=(n=r?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(r))!==null&&i!==void 0?i:h=>{},onReceiveMessage:(o=(s=r?.onReceiveMessage)===null||s===void 0?void 0:s.bind(r))!==null&&o!==void 0?o:h=>{},onReceiveStatus:(c=(a=r?.onReceiveStatus)===null||a===void 0?void 0:a.bind(r))!==null&&c!==void 0?c:h=>{}};this.processingMetadata=!0,this.requester.start(e,l,(h,d)=>{var f,p,g;this.processingMetadata=!1;let S;if((0,FU.isInterceptingListener)(d))S=d;else{let A={onReceiveMetadata:(f=d.onReceiveMetadata)!==null&&f!==void 0?f:q_.onReceiveMetadata,onReceiveMessage:(p=d.onReceiveMessage)!==null&&p!==void 0?p:q_.onReceiveMessage,onReceiveStatus:(g=d.onReceiveStatus)!==null&&g!==void 0?g:q_.onReceiveStatus};S=new FU.InterceptingListenerImpl(A,l)}this.nextCall.start(h,S),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,r){this.processingMessage=!0,this.requester.sendMessage(r,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=r):(this.nextCall.sendMessageWithContext(e,n),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};Zt.InterceptingCall=z_;function Ere(t,e,r){var n,i;let s=(n=r.deadline)!==null&&n!==void 0?n:1/0,o=r.host,a=(i=r.parent)!==null&&i!==void 0?i:null,c=r.propagate_flags,l=r.credentials,h=t.createCall(e,s,o,a,c);return l&&h.setCredentials(l),h}var jh=class{constructor(e,r){this.call=e,this.methodDefinition=r}cancelWithStatus(e,r){this.call.cancelWithStatus(e,r)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,r){let n;try{n=this.methodDefinition.requestSerialize(r)}catch(i){this.call.cancelWithStatus(BU.Status.INTERNAL,`Request message serialization failure: ${(0,VU.getErrorMessage)(i)}`);return}this.call.sendMessageWithContext(e,n)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,r){let n=null;this.call.start(e,{onReceiveMetadata:i=>{var s;(s=r?.onReceiveMetadata)===null||s===void 0||s.call(r,i)},onReceiveMessage:i=>{var s;let o;try{o=this.methodDefinition.responseDeserialize(i)}catch(a){n={code:BU.Status.INTERNAL,details:`Response message parsing error: ${(0,VU.getErrorMessage)(a)}`,metadata:new _re.Metadata},this.call.cancelWithStatus(n.code,n.details);return}(s=r?.onReceiveMessage)===null||s===void 0||s.call(r,o)},onReceiveStatus:i=>{var s,o;n?(s=r?.onReceiveStatus)===null||s===void 0||s.call(r,n):(o=r?.onReceiveStatus)===null||o===void 0||o.call(r,i)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},j_=class extends jh{constructor(e,r){super(e,r)}start(e,r){var n,i;let s=!1,o={onReceiveMetadata:(i=(n=r?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(r))!==null&&i!==void 0?i:a=>{},onReceiveMessage:a=>{var c;s=!0,(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,a)},onReceiveStatus:a=>{var c,l;s||(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,null),(l=r?.onReceiveStatus)===null||l===void 0||l.call(r,a)}};super.start(e,o),this.call.startRead()}},$_=class extends jh{};function Sre(t,e,r){let n=Ere(t,r.path,e);return r.responseStream?new $_(n,r):new j_(n,r)}function Tre(t,e,r,n){if(t.clientInterceptors.length>0&&t.clientInterceptorProviders.length>0)throw new Fa("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(t.callInterceptors.length>0&&t.callInterceptorProviders.length>0)throw new Fa("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];t.callInterceptors.length>0||t.callInterceptorProviders.length>0?i=[].concat(t.callInterceptors,t.callInterceptorProviders.map(a=>a(e))).filter(a=>a):i=[].concat(t.clientInterceptors,t.clientInterceptorProviders.map(a=>a(e))).filter(a=>a);let s=Object.assign({},r,{method_definition:e});return i.reduceRight((a,c)=>l=>c(l,a),a=>Sre(n,a,e))(s)}});var X_=m(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.Client=void 0;var Ar=kU(),yre=J_(),vre=at(),xn=te(),Gs=He(),$h=W_(),er=Symbol(),Hs=Symbol(),zs=Symbol(),Kr=Symbol();function Y_(t){return typeof t=="function"}function js(t){var e;return((e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
48
|
-
`).slice(1).join(`
|
|
49
|
-
`))||"no stack trace available"}var K_=class{constructor(e,r,n={}){var i,s;if(n=Object.assign({},n),this[Hs]=(i=n.interceptors)!==null&&i!==void 0?i:[],delete n.interceptors,this[zs]=(s=n.interceptor_providers)!==null&&s!==void 0?s:[],delete n.interceptor_providers,this[Hs].length>0&&this[zs].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[Kr]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[er]=n.channelOverride;else if(n.channelFactoryOverride){let o=n.channelFactoryOverride;delete n.channelFactoryOverride,this[er]=o(e,r,n)}else this[er]=new yre.ChannelImplementation(e,r,n)}close(){this[er].close()}getChannel(){return this[er]}waitForReady(e,r){let n=i=>{if(i){r(new Error("Failed to connect before the deadline"));return}let s;try{s=this[er].getConnectivityState(!0)}catch{r(new Error("The channel has been closed"));return}if(s===vre.ConnectivityState.READY)r();else try{this[er].watchConnectivityState(s,e,n)}catch{r(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,r,n){if(Y_(e))return{metadata:new Gs.Metadata,options:{},callback:e};if(Y_(r))return e instanceof Gs.Metadata?{metadata:e,options:{},callback:r}:{metadata:new Gs.Metadata,options:e,callback:r};if(!(e instanceof Gs.Metadata&&r instanceof Object&&Y_(n)))throw new Error("Incorrect arguments passed");return{metadata:e,options:r,callback:n}}makeUnaryRequest(e,r,n,i,s,o,a){var c,l;let h=this.checkOptionalUnaryResponseArguments(s,o,a),d={path:e,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:n},f={argument:i,metadata:h.metadata,call:new Ar.ClientUnaryCallImpl,channel:this[er],methodDefinition:d,callOptions:h.options,callback:h.callback};this[Kr]&&(f=this[Kr](f));let p=f.call,g={clientInterceptors:this[Hs],clientInterceptorProviders:this[zs],callInterceptors:(c=f.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},S=(0,$h.getInterceptingCall)(g,f.methodDefinition,f.callOptions,f.channel);p.call=S;let A=null,C=!1,R=new Error;return S.start(f.metadata,{onReceiveMetadata:M=>{p.emit("metadata",M)},onReceiveMessage(M){A!==null&&S.cancelWithStatus(xn.Status.UNIMPLEMENTED,"Too many responses received"),A=M},onReceiveStatus(M){if(!C){if(C=!0,M.code===xn.Status.OK)if(A===null){let v=js(R);f.callback((0,Ar.callErrorFromStatus)({code:xn.Status.UNIMPLEMENTED,details:"No message received",metadata:M.metadata},v))}else f.callback(null,A);else{let v=js(R);f.callback((0,Ar.callErrorFromStatus)(M,v))}R=null,p.emit("status",M)}}}),S.sendMessage(i),S.halfClose(),p}makeClientStreamRequest(e,r,n,i,s,o){var a,c;let l=this.checkOptionalUnaryResponseArguments(i,s,o),h={path:e,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:n},d={metadata:l.metadata,call:new Ar.ClientWritableStreamImpl(r),channel:this[er],methodDefinition:h,callOptions:l.options,callback:l.callback};this[Kr]&&(d=this[Kr](d));let f=d.call,p={clientInterceptors:this[Hs],clientInterceptorProviders:this[zs],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},g=(0,$h.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=g;let S=null,A=!1,C=new Error;return g.start(d.metadata,{onReceiveMetadata:R=>{f.emit("metadata",R)},onReceiveMessage(R){S!==null&&g.cancelWithStatus(xn.Status.UNIMPLEMENTED,"Too many responses received"),S=R,g.startRead()},onReceiveStatus(R){if(!A){if(A=!0,R.code===xn.Status.OK)if(S===null){let M=js(C);d.callback((0,Ar.callErrorFromStatus)({code:xn.Status.UNIMPLEMENTED,details:"No message received",metadata:R.metadata},M))}else d.callback(null,S);else{let M=js(C);d.callback((0,Ar.callErrorFromStatus)(R,M))}C=null,f.emit("status",R)}}}),f}checkMetadataAndOptions(e,r){let n,i;return e instanceof Gs.Metadata?(n=e,r?i=r:i={}):(e?i=e:i={},n=new Gs.Metadata),{metadata:n,options:i}}makeServerStreamRequest(e,r,n,i,s,o){var a,c;let l=this.checkMetadataAndOptions(s,o),h={path:e,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:n},d={argument:i,metadata:l.metadata,call:new Ar.ClientReadableStreamImpl(n),channel:this[er],methodDefinition:h,callOptions:l.options};this[Kr]&&(d=this[Kr](d));let f=d.call,p={clientInterceptors:this[Hs],clientInterceptorProviders:this[zs],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},g=(0,$h.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=g;let S=!1,A=new Error;return g.start(d.metadata,{onReceiveMetadata(C){f.emit("metadata",C)},onReceiveMessage(C){f.push(C)},onReceiveStatus(C){if(!S){if(S=!0,f.push(null),C.code!==xn.Status.OK){let R=js(A);f.emit("error",(0,Ar.callErrorFromStatus)(C,R))}A=null,f.emit("status",C)}}}),g.sendMessage(i),g.halfClose(),f}makeBidiStreamRequest(e,r,n,i,s){var o,a;let c=this.checkMetadataAndOptions(i,s),l={path:e,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:n},h={metadata:c.metadata,call:new Ar.ClientDuplexStreamImpl(r,n),channel:this[er],methodDefinition:l,callOptions:c.options};this[Kr]&&(h=this[Kr](h));let d=h.call,f={clientInterceptors:this[Hs],clientInterceptorProviders:this[zs],callInterceptors:(o=h.callOptions.interceptors)!==null&&o!==void 0?o:[],callInterceptorProviders:(a=h.callOptions.interceptor_providers)!==null&&a!==void 0?a:[]},p=(0,$h.getInterceptingCall)(f,h.methodDefinition,h.callOptions,h.channel);d.call=p;let g=!1,S=new Error;return p.start(h.metadata,{onReceiveMetadata(A){d.emit("metadata",A)},onReceiveMessage(A){d.push(A)},onReceiveStatus(A){if(!g){if(g=!0,d.push(null),A.code!==xn.Status.OK){let C=js(S);d.emit("error",(0,Ar.callErrorFromStatus)(A,C))}S=null,d.emit("status",A)}}}),d}};Wh.Client=K_});var Kh=m(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.makeClientConstructor=qU;Yh.loadPackageDefinition=Ore;var Ba=X_(),Are={unary:Ba.Client.prototype.makeUnaryRequest,server_stream:Ba.Client.prototype.makeServerStreamRequest,client_stream:Ba.Client.prototype.makeClientStreamRequest,bidi:Ba.Client.prototype.makeBidiStreamRequest};function Q_(t){return["__proto__","prototype","constructor"].includes(t)}function qU(t,e,r){r||(r={});class n extends Ba.Client{}return Object.keys(t).forEach(i=>{if(Q_(i))return;let s=t[i],o;if(typeof i=="string"&&i.charAt(0)==="$")throw new Error("Method names cannot start with $");s.requestStream?s.responseStream?o="bidi":o="client_stream":s.responseStream?o="server_stream":o="unary";let a=s.requestSerialize,c=s.responseDeserialize,l=Cre(Are[o],s.path,a,c);n.prototype[i]=l,Object.assign(n.prototype[i],s),s.originalName&&!Q_(s.originalName)&&(n.prototype[s.originalName]=n.prototype[i])}),n.service=t,n.serviceName=e,n}function Cre(t,e,r,n){return function(...i){return t.call(this,e,r,n,...i)}}function Rre(t){return"format"in t}function Ore(t){let e={};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r],i=r.split(".");if(i.some(a=>Q_(a)))continue;let s=i[i.length-1],o=e;for(let a of i.slice(0,-1))o[a]||(o[a]={}),o=o[a];Rre(n)?o[s]=n:o[s]=qU(n,s,{})}return e}});var d2=m((w0e,h2)=>{"use strict";var bre=1/0,Mre="[object Symbol]",Nre=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wre=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jh="\\ud800-\\udfff",KU="\\u0300-\\u036f\\ufe20-\\ufe23",XU="\\u20d0-\\u20f0",JU="\\u2700-\\u27bf",QU="a-z\\xdf-\\xf6\\xf8-\\xff",Pre="\\xac\\xb1\\xd7\\xf7",xre="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ire="\\u2000-\\u206f",Lre=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ZU="A-Z\\xc0-\\xd6\\xd8-\\xde",e2="\\ufe0e\\ufe0f",t2=Pre+xre+Ire+Lre,eE="['\u2019]",Dre="["+Jh+"]",GU="["+t2+"]",Xh="["+KU+XU+"]",r2="\\d+",Ure="["+JU+"]",n2="["+QU+"]",i2="[^"+Jh+t2+r2+JU+QU+ZU+"]",Z_="\\ud83c[\\udffb-\\udfff]",kre="(?:"+Xh+"|"+Z_+")",s2="[^"+Jh+"]",tE="(?:\\ud83c[\\udde6-\\uddff]){2}",rE="[\\ud800-\\udbff][\\udc00-\\udfff]",$s="["+ZU+"]",o2="\\u200d",HU="(?:"+n2+"|"+i2+")",Fre="(?:"+$s+"|"+i2+")",zU="(?:"+eE+"(?:d|ll|m|re|s|t|ve))?",jU="(?:"+eE+"(?:D|LL|M|RE|S|T|VE))?",a2=kre+"?",c2="["+e2+"]?",Bre="(?:"+o2+"(?:"+[s2,tE,rE].join("|")+")"+c2+a2+")*",l2=c2+a2+Bre,Vre="(?:"+[Ure,tE,rE].join("|")+")"+l2,qre="(?:"+[s2+Xh+"?",Xh,tE,rE,Dre].join("|")+")",Gre=RegExp(eE,"g"),Hre=RegExp(Xh,"g"),zre=RegExp(Z_+"(?="+Z_+")|"+qre+l2,"g"),jre=RegExp([$s+"?"+n2+"+"+zU+"(?="+[GU,$s,"$"].join("|")+")",Fre+"+"+jU+"(?="+[GU,$s+HU,"$"].join("|")+")",$s+"?"+HU+"+"+zU,$s+"+"+jU,r2,Vre].join("|"),"g"),$re=RegExp("["+o2+Jh+KU+XU+e2+"]"),Wre=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yre={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},Kre=typeof global=="object"&&global&&global.Object===Object&&global,Xre=typeof self=="object"&&self&&self.Object===Object&&self,Jre=Kre||Xre||Function("return this")();function Qre(t,e,r,n){var i=-1,s=t?t.length:0;for(n&&s&&(r=t[++i]);++i<s;)r=e(r,t[i],i,t);return r}function Zre(t){return t.split("")}function ene(t){return t.match(Nre)||[]}function tne(t){return function(e){return t?.[e]}}var rne=tne(Yre);function u2(t){return $re.test(t)}function nne(t){return Wre.test(t)}function ine(t){return u2(t)?sne(t):Zre(t)}function sne(t){return t.match(zre)||[]}function one(t){return t.match(jre)||[]}var ane=Object.prototype,cne=ane.toString,$U=Jre.Symbol,WU=$U?$U.prototype:void 0,YU=WU?WU.toString:void 0;function lne(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=Array(i);++n<i;)s[n]=t[n+e];return s}function une(t){if(typeof t=="string")return t;if(mne(t))return YU?YU.call(t):"";var e=t+"";return e=="0"&&1/t==-bre?"-0":e}function hne(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:lne(t,e,r)}function dne(t){return function(e){e=Qh(e);var r=u2(e)?ine(e):void 0,n=r?r[0]:e.charAt(0),i=r?hne(r,1).join(""):e.slice(1);return n[t]()+i}}function fne(t){return function(e){return Qre(Tne(Ene(e).replace(Gre,"")),t,"")}}function pne(t){return!!t&&typeof t=="object"}function mne(t){return typeof t=="symbol"||pne(t)&&cne.call(t)==Mre}function Qh(t){return t==null?"":une(t)}var gne=fne(function(t,e,r){return e=e.toLowerCase(),t+(r?_ne(e):e)});function _ne(t){return Sne(Qh(t).toLowerCase())}function Ene(t){return t=Qh(t),t&&t.replace(wre,rne).replace(Hre,"")}var Sne=dne("toUpperCase");function Tne(t,e,r){return t=Qh(t),e=r?void 0:e,e===void 0?nne(t)?one(t):ene(t):t.match(e)||[]}h2.exports=gne});var nE=m((P0e,f2)=>{"use strict";f2.exports=yne;function yne(t,e){for(var r=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(a,c){r[n]=function(h){if(s)if(s=!1,h)c(h);else{for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f++]=arguments[f];a.apply(null,d)}};try{t.apply(e||null,r)}catch(l){s&&(s=!1,c(l))}})}});var _2=m(g2=>{"use strict";var Zh=g2;Zh.length=function(e){var r=e.length;if(!r)return 0;for(var n=0;--r%4>1&&e.charAt(r)==="=";)++n;return Math.ceil(e.length*3)/4-n};var Ws=new Array(64),m2=new Array(123);for(tr=0;tr<64;)m2[Ws[tr]=tr<26?tr+65:tr<52?tr+71:tr<62?tr-4:tr-59|43]=tr++;var tr;Zh.encode=function(e,r,n){for(var i=null,s=[],o=0,a=0,c;r<n;){var l=e[r++];switch(a){case 0:s[o++]=Ws[l>>2],c=(l&3)<<4,a=1;break;case 1:s[o++]=Ws[c|l>>4],c=(l&15)<<2,a=2;break;case 2:s[o++]=Ws[c|l>>6],s[o++]=Ws[l&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=Ws[c],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var p2="invalid encoding";Zh.decode=function(e,r,n){for(var i=n,s=0,o,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&s>1)break;if((c=m2[c])===void 0)throw Error(p2);switch(s){case 0:o=c,s=1;break;case 1:r[n++]=o<<2|(c&48)>>4,o=c,s=2;break;case 2:r[n++]=(o&15)<<4|(c&60)>>2,o=c,s=3;break;case 3:r[n++]=(o&3)<<6|c,s=0;break}}if(s===1)throw Error(p2);return n-i};Zh.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var S2=m((I0e,E2)=>{"use strict";E2.exports=ed;function ed(){this._listeners=Object.create(null)}ed.prototype.on=function(e,r,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:n||this}),this};ed.prototype.off=function(e,r){if(e===void 0)this._listeners=Object.create(null);else if(r===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var i=0;i<n.length;)n[i].fn===r?n.splice(i,1):++i}return this};ed.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<r.length;)r[i].fn.apply(r[i++].ctx,n)}return this}});var O2=m((L0e,R2)=>{"use strict";R2.exports=T2(T2);function T2(t){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=r[3]===128;function i(c,l,h){e[0]=c,l[h]=r[0],l[h+1]=r[1],l[h+2]=r[2],l[h+3]=r[3]}function s(c,l,h){e[0]=c,l[h]=r[3],l[h+1]=r[2],l[h+2]=r[1],l[h+3]=r[0]}t.writeFloatLE=n?i:s,t.writeFloatBE=n?s:i;function o(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],e[0]}function a(c,l){return r[3]=c[l],r[2]=c[l+1],r[1]=c[l+2],r[0]=c[l+3],e[0]}t.readFloatLE=n?o:a,t.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var c=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-c)*8388608)&8388607;n((a<<31|c+127<<23|l)>>>0,s,o)}}t.writeFloatLE=e.bind(null,y2),t.writeFloatBE=e.bind(null,v2);function r(n,i,s){var o=n(i,s),a=(o>>31)*2+1,c=o>>>23&255,l=o&8388607;return c===255?l?NaN:a*(1/0):c===0?a*1401298464324817e-60*l:a*Math.pow(2,c-150)*(l+8388608)}t.readFloatLE=r.bind(null,A2),t.readFloatBE=r.bind(null,C2)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=r[7]===128;function i(c,l,h){e[0]=c,l[h]=r[0],l[h+1]=r[1],l[h+2]=r[2],l[h+3]=r[3],l[h+4]=r[4],l[h+5]=r[5],l[h+6]=r[6],l[h+7]=r[7]}function s(c,l,h){e[0]=c,l[h]=r[7],l[h+1]=r[6],l[h+2]=r[5],l[h+3]=r[4],l[h+4]=r[3],l[h+5]=r[2],l[h+6]=r[1],l[h+7]=r[0]}t.writeDoubleLE=n?i:s,t.writeDoubleBE=n?s:i;function o(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],r[4]=c[l+4],r[5]=c[l+5],r[6]=c[l+6],r[7]=c[l+7],e[0]}function a(c,l){return r[7]=c[l],r[6]=c[l+1],r[5]=c[l+2],r[4]=c[l+3],r[3]=c[l+4],r[2]=c[l+5],r[1]=c[l+6],r[0]=c[l+7],e[0]}t.readDoubleLE=n?o:a,t.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,c){var l=o<0?1:0;if(l&&(o=-o),o===0)n(0,a,c+i),n(1/o>0?0:2147483648,a,c+s);else if(isNaN(o))n(0,a,c+i),n(2146959360,a,c+s);else if(o>17976931348623157e292)n(0,a,c+i),n((l<<31|2146435072)>>>0,a,c+s);else{var h;if(o<22250738585072014e-324)h=o/5e-324,n(h>>>0,a,c+i),n((l<<31|h/4294967296)>>>0,a,c+s);else{var d=Math.floor(Math.log(o)/Math.LN2);d===1024&&(d=1023),h=o*Math.pow(2,-d),n(h*4503599627370496>>>0,a,c+i),n((l<<31|d+1023<<20|h*1048576&1048575)>>>0,a,c+s)}}}t.writeDoubleLE=e.bind(null,y2,0,4),t.writeDoubleBE=e.bind(null,v2,4,0);function r(n,i,s,o,a){var c=n(o,a+i),l=n(o,a+s),h=(l>>31)*2+1,d=l>>>20&2047,f=4294967296*(l&1048575)+c;return d===2047?f?NaN:h*(1/0):d===0?h*5e-324*f:h*Math.pow(2,d-1075)*(f+4503599627370496)}t.readDoubleLE=r.bind(null,A2,0,4),t.readDoubleBE=r.bind(null,C2,4,0)}(),t}function y2(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function v2(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function A2(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function C2(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var M2=m((D0e,b2)=>{"use strict";b2.exports=vne;function vne(t){try{if(typeof L!="function")return null;var e=L(t);return e&&(e.length||Object.keys(e).length)?e:null}catch{return null}}});var w2=m(N2=>{"use strict";var sE=N2,iE="\uFFFD";sE.length=function(e){for(var r=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?r+=1:n<2048?r+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,r+=4):r+=3;return r};sE.read=function(e,r,n){if(n-r<1)return"";for(var i="",s=r;s<n;){var o=e[s++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var a=(o&31)<<6|e[s++]&63;i+=a>=128?String.fromCharCode(a):iE}else if(o>=224&&o<240){var c=(o&15)<<12|(e[s++]&63)<<6|e[s++]&63;i+=c>=2048?String.fromCharCode(c):iE}else if(o>=240){var l=(o&7)<<18|(e[s++]&63)<<12|(e[s++]&63)<<6|e[s++]&63;l<65536||l>1114111?i+=iE:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i};sE.write=function(e,r,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128);return n-i}});var x2=m((F0e,P2)=>{"use strict";P2.exports=Ane;function Ane(t,e,r){var n=r||8192,i=n>>>1,s=null,o=n;return function(c){if(c<1||c>i)return t(c);o+c>n&&(s=t(n),o=0);var l=e.call(s,o,o+=c);return o&7&&(o=(o|7)+1),l}}});var L2=m((B0e,I2)=>{"use strict";I2.exports=ze;var Va=rr();function ze(t,e){this.lo=t>>>0,this.hi=e>>>0}var yi=ze.zero=new ze(0,0);yi.toNumber=function(){return 0};yi.zzEncode=yi.zzDecode=function(){return this};yi.length=function(){return 1};var Cne=ze.zeroHash="\0\0\0\0\0\0\0\0";ze.fromNumber=function(e){if(e===0)return yi;var r=e<0;r&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new ze(n,i)};ze.from=function(e){if(typeof e=="number")return ze.fromNumber(e);if(Va.isString(e))if(Va.Long)e=Va.Long.fromString(e);else return ze.fromNumber(parseInt(e,10));return e.low||e.high?new ze(e.low>>>0,e.high>>>0):yi};ze.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,n=~this.hi>>>0;return r||(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296};ze.prototype.toLong=function(e){return Va.Long?new Va.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var In=String.prototype.charCodeAt;ze.fromHash=function(e){return e===Cne?yi:new ze((In.call(e,0)|In.call(e,1)<<8|In.call(e,2)<<16|In.call(e,3)<<24)>>>0,(In.call(e,4)|In.call(e,5)<<8|In.call(e,6)<<16|In.call(e,7)<<24)>>>0)};ze.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};ze.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};ze.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};ze.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}});var D2=m((qa,oE)=>{"use strict";(function(t,e){function r(n){return n.default||n}typeof define=="function"&&define.amd?define([],function(){var n={};return e(n),r(n)}):typeof qa=="object"?(e(qa),typeof oE=="object"&&(oE.exports=r(qa))):function(){var n={};e(n),t.Long=r(n)}()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:qa,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(E,u,y){this.low=E|0,this.high=u|0,this.unsigned=!!y}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n(E){return(E&&E.__isLong__)===!0}function i(E){var u=Math.clz32(E&-E);return E?31-u:u}r.isLong=n;var s={},o={};function a(E,u){var y,B,G;return u?(E>>>=0,(G=0<=E&&E<256)&&(B=o[E],B)?B:(y=l(E,0,!0),G&&(o[E]=y),y)):(E|=0,(G=-128<=E&&E<128)&&(B=s[E],B)?B:(y=l(E,E<0?-1:0,!1),G&&(s[E]=y),y))}r.fromInt=a;function c(E,u){if(isNaN(E))return u?v:M;if(u){if(E<0)return v;if(E>=A)return Y}else{if(E<=-C)return F;if(E+1>=C)return q}return E<0?c(-E,u).neg():l(E%S|0,E/S|0,u)}r.fromNumber=c;function l(E,u,y){return new r(E,u,y)}r.fromBits=l;var h=Math.pow;function d(E,u,y){if(E.length===0)throw Error("empty string");if(typeof u=="number"?(y=u,u=!1):u=!!u,E==="NaN"||E==="Infinity"||E==="+Infinity"||E==="-Infinity")return u?v:M;if(y=y||10,y<2||36<y)throw RangeError("radix");var B;if((B=E.indexOf("-"))>0)throw Error("interior hyphen");if(B===0)return d(E.substring(1),u,y).neg();for(var G=c(h(y,8)),$=M,X=0;X<E.length;X+=8){var le=Math.min(8,E.length-X),fe=parseInt(E.substring(X,X+le),y);if(le<8){var ie=c(h(y,le));$=$.mul(ie).add(c(fe))}else $=$.mul(G),$=$.add(c(fe))}return $.unsigned=u,$}r.fromString=d;function f(E,u){return typeof E=="number"?c(E,u):typeof E=="string"?d(E,u):l(E.low,E.high,typeof u=="boolean"?u:E.unsigned)}r.fromValue=f;var p=65536,g=1<<24,S=p*p,A=S*S,C=A/2,R=a(g),M=a(0);r.ZERO=M;var v=a(0,!0);r.UZERO=v;var w=a(1);r.ONE=w;var I=a(1,!0);r.UONE=I;var V=a(-1);r.NEG_ONE=V;var q=l(-1,2147483647,!1);r.MAX_VALUE=q;var Y=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=Y;var F=l(0,-2147483648,!1);r.MIN_VALUE=F;var _=r.prototype;_.toInt=function(){return this.unsigned?this.low>>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*S+(this.low>>>0):this.high*S+(this.low>>>0)},_.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(F)){var y=c(u),B=this.div(y),G=B.mul(y).sub(this);return B.toString(u)+G.toInt().toString(u)}else return"-"+this.neg().toString(u);for(var $=c(h(u,6),this.unsigned),X=this,le="";;){var fe=X.div($),ie=X.sub(fe.mul($)).toInt()>>>0,W=ie.toString(u);if(X=fe,X.isZero())return W+le;for(;W.length<6;)W="0"+W;le=""+W+le}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(F)?64:this.neg().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,y=31;y>0&&!(u&1<<y);y--);return this.high!=0?y+33:y+1},_.isSafeInteger=function(){var u=this.high>>21;return u?this.unsigned?!1:u===-1&&!(this.low===0&&this.high===-2097152):!0},_.isZero=function(){return this.high===0&&this.low===0},_.eqz=_.isZero,_.isNegative=function(){return!this.unsigned&&this.high<0},_.isPositive=function(){return this.unsigned||this.high>=0},_.isOdd=function(){return(this.low&1)===1},_.isEven=function(){return(this.low&1)===0},_.equals=function(u){return n(u)||(u=f(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},_.eq=_.equals,_.notEquals=function(u){return!this.eq(u)},_.neq=_.notEquals,_.ne=_.notEquals,_.lessThan=function(u){return this.comp(u)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(u){return this.comp(u)<=0},_.lte=_.lessThanOrEqual,_.le=_.lessThanOrEqual,_.greaterThan=function(u){return this.comp(u)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(u){return this.comp(u)>=0},_.gte=_.greaterThanOrEqual,_.ge=_.greaterThanOrEqual,_.compare=function(u){if(n(u)||(u=f(u)),this.eq(u))return 0;var y=this.isNegative(),B=u.isNegative();return y&&!B?-1:!y&&B?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.sub(u).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(F)?F:this.not().add(w)},_.neg=_.negate,_.add=function(u){n(u)||(u=f(u));var y=this.high>>>16,B=this.high&65535,G=this.low>>>16,$=this.low&65535,X=u.high>>>16,le=u.high&65535,fe=u.low>>>16,ie=u.low&65535,W=0,pe=0,J=0,he=0;return he+=$+ie,J+=he>>>16,he&=65535,J+=G+fe,pe+=J>>>16,J&=65535,pe+=B+le,W+=pe>>>16,pe&=65535,W+=y+X,W&=65535,l(J<<16|he,W<<16|pe,this.unsigned)},_.subtract=function(u){return n(u)||(u=f(u)),this.add(u.neg())},_.sub=_.subtract,_.multiply=function(u){if(this.isZero())return this;if(n(u)||(u=f(u)),e){var y=e.mul(this.low,this.high,u.low,u.high);return l(y,e.get_high(),this.unsigned)}if(u.isZero())return this.unsigned?v:M;if(this.eq(F))return u.isOdd()?F:M;if(u.eq(F))return this.isOdd()?F:M;if(this.isNegative())return u.isNegative()?this.neg().mul(u.neg()):this.neg().mul(u).neg();if(u.isNegative())return this.mul(u.neg()).neg();if(this.lt(R)&&u.lt(R))return c(this.toNumber()*u.toNumber(),this.unsigned);var B=this.high>>>16,G=this.high&65535,$=this.low>>>16,X=this.low&65535,le=u.high>>>16,fe=u.high&65535,ie=u.low>>>16,W=u.low&65535,pe=0,J=0,he=0,ht=0;return ht+=X*W,he+=ht>>>16,ht&=65535,he+=$*W,J+=he>>>16,he&=65535,he+=X*ie,J+=he>>>16,he&=65535,J+=G*W,pe+=J>>>16,J&=65535,J+=$*ie,pe+=J>>>16,J&=65535,J+=X*fe,pe+=J>>>16,J&=65535,pe+=B*W+G*ie+$*fe+X*le,pe&=65535,l(he<<16|ht,pe<<16|J,this.unsigned)},_.mul=_.multiply,_.divide=function(u){if(n(u)||(u=f(u)),u.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&u.low===-1&&u.high===-1)return this;var y=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,u.low,u.high);return l(y,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?v:M;var B,G,$;if(this.unsigned){if(u.unsigned||(u=u.toUnsigned()),u.gt(this))return v;if(u.gt(this.shru(1)))return I;$=v}else{if(this.eq(F)){if(u.eq(w)||u.eq(V))return F;if(u.eq(F))return w;var X=this.shr(1);return B=X.div(u).shl(1),B.eq(M)?u.isNegative()?w:V:(G=this.sub(u.mul(B)),$=B.add(G.div(u)),$)}else if(u.eq(F))return this.unsigned?v:M;if(this.isNegative())return u.isNegative()?this.neg().div(u.neg()):this.neg().div(u).neg();if(u.isNegative())return this.div(u.neg()).neg();$=M}for(G=this;G.gte(u);){B=Math.max(1,Math.floor(G.toNumber()/u.toNumber()));for(var le=Math.ceil(Math.log(B)/Math.LN2),fe=le<=48?1:h(2,le-48),ie=c(B),W=ie.mul(u);W.isNegative()||W.gt(G);)B-=fe,ie=c(B,this.unsigned),W=ie.mul(u);ie.isZero()&&(ie=w),$=$.add(ie),G=G.sub(W)}return $},_.div=_.divide,_.modulo=function(u){if(n(u)||(u=f(u)),e){var y=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,u.low,u.high);return l(y,e.get_high(),this.unsigned)}return this.sub(this.div(u).mul(u))},_.mod=_.modulo,_.rem=_.modulo,_.not=function(){return l(~this.low,~this.high,this.unsigned)},_.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},_.clz=_.countLeadingZeros,_.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},_.ctz=_.countTrailingZeros,_.and=function(u){return n(u)||(u=f(u)),l(this.low&u.low,this.high&u.high,this.unsigned)},_.or=function(u){return n(u)||(u=f(u)),l(this.low|u.low,this.high|u.high,this.unsigned)},_.xor=function(u){return n(u)||(u=f(u)),l(this.low^u.low,this.high^u.high,this.unsigned)},_.shiftLeft=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?l(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):l(0,this.low<<u-32,this.unsigned)},_.shl=_.shiftLeft,_.shiftRight=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?l(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):l(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?l(this.low>>>u|this.high<<32-u,this.high>>>u,this.unsigned):u===32?l(this.high,0,this.unsigned):l(this.high>>>u-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.shr_u=_.shiftRightUnsigned,_.rotateLeft=function(u){var y;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?l(this.high,this.low,this.unsigned):u<32?(y=32-u,l(this.low<<u|this.high>>>y,this.high<<u|this.low>>>y,this.unsigned)):(u-=32,y=32-u,l(this.high<<u|this.low>>>y,this.low<<u|this.high>>>y,this.unsigned))},_.rotl=_.rotateLeft,_.rotateRight=function(u){var y;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?l(this.high,this.low,this.unsigned):u<32?(y=32-u,l(this.high<<y|this.low>>>u,this.low<<y|this.high>>>u,this.unsigned)):(u-=32,y=32-u,l(this.low<<y|this.high>>>u,this.high<<y|this.low>>>u,this.unsigned))},_.rotr=_.rotateRight,_.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},_.toBytes=function(u){return u?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var u=this.high,y=this.low;return[y&255,y>>>8&255,y>>>16&255,y>>>24,u&255,u>>>8&255,u>>>16&255,u>>>24]},_.toBytesBE=function(){var u=this.high,y=this.low;return[u>>>24,u>>>16&255,u>>>8&255,u&255,y>>>24,y>>>16&255,y>>>8&255,y&255]},r.fromBytes=function(u,y,B){return B?r.fromBytesLE(u,y):r.fromBytesBE(u,y)},r.fromBytesLE=function(u,y){return new r(u[0]|u[1]<<8|u[2]<<16|u[3]<<24,u[4]|u[5]<<8|u[6]<<16|u[7]<<24,y)},r.fromBytesBE=function(u,y){return new r(u[4]<<24|u[5]<<16|u[6]<<8|u[7],u[0]<<24|u[1]<<16|u[2]<<8|u[3],y)},typeof BigInt=="function"&&(r.fromBigInt=function(u,y){var B=Number(BigInt.asIntN(32,u)),G=Number(BigInt.asIntN(32,u>>BigInt(32)));return l(B,G,y)},r.fromValue=function(u,y){return typeof u=="bigint"?r.fromBigInt(u,y):f(u,y)},_.toBigInt=function(){var u=BigInt(this.low>>>0),y=BigInt(this.unsigned?this.high>>>0:this.high);return y<<BigInt(32)|u});var de=t.default=r})});var rr=m(aE=>{"use strict";var H=aE;H.asPromise=nE();H.base64=_2();H.EventEmitter=S2();H.float=O2();H.inquire=M2();H.utf8=w2();H.pool=x2();H.LongBits=L2();function U2(t){return t==="__proto__"||t==="prototype"||t==="constructor"}H.isUnsafeProperty=U2;H.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);H.global=H.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||aE;H.emptyArray=Object.freeze?Object.freeze([]):[];H.emptyObject=Object.freeze?Object.freeze({}):{};H.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};H.isString=function(e){return typeof e=="string"||e instanceof String};H.isObject=function(e){return e&&typeof e=="object"};H.isset=H.isSet=function(e,r){var n=e[r];return n!=null&&e.hasOwnProperty(r)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};H.Buffer=function(){try{var t=H.global.Buffer;return t.prototype.utf8Write?t:null}catch{return null}}();H._Buffer_from=null;H._Buffer_allocUnsafe=null;H.newBuffer=function(e){return typeof e=="number"?H.Buffer?H._Buffer_allocUnsafe(e):new H.Array(e):H.Buffer?H._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};H.Array=typeof Uint8Array<"u"?Uint8Array:Array;H.Long=H.global.dcodeIO&&H.global.dcodeIO.Long||H.global.Long||function(){try{var t=D2();return t&&t.isLong?t:null}catch{return null}}();H.key2Re=/^true|false|0|1$/;H.key32Re=/^-?(?:0|[1-9][0-9]*)$/;H.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;H.longToHash=function(e){return e?H.LongBits.from(e).toHash():H.LongBits.zeroHash};H.longFromHash=function(e,r){var n=H.LongBits.fromHash(e);return H.Long?H.Long.fromBits(n.lo,n.hi,r):n.toNumber(!!r)};function k2(t){var e=typeof arguments[arguments.length-1]=="boolean",r=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var n=1;n<r;++n){var i=arguments[n];if(i)for(var s=Object.keys(i),o=0;o<s.length;++o)!U2(s[o])&&(t[s[o]]===void 0||!e)&&(t[s[o]]=i[s[o]])}return t}H.merge=k2;H.nestingLimit=32;H.recursionLimit=100;H.makeProp=function(e,r){Object.defineProperty(e,r,{enumerable:!0,configurable:!0,writable:!0})};H.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function F2(t){function e(r,n){if(!(this instanceof e))return new e(r,n);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&k2(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}H.newError=F2;H.ProtocolError=F2("ProtocolError");H.oneOfGetter=function(e){for(var r={},n=0;n<e.length;++n)r[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(r[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};H.oneOfSetter=function(e){return function(r){for(var n=0;n<e.length;++n)e[n]!==r&&delete this[e[n]]}};H.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};H._configure=function(){var t=H.Buffer;if(!t){H._Buffer_from=H._Buffer_allocUnsafe=null;return}H._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,n){return new t(r,n)},H._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var rd=m((q0e,G2)=>{"use strict";G2.exports=ce;var Dt=rr(),cE,td=Dt.LongBits,B2=Dt.base64,V2=Dt.utf8;function Ga(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function uE(){}function Rne(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function ce(){this.len=0,this.head=new Ga(uE,0,0),this.tail=this.head,this.states=null}var q2=function(){return Dt.Buffer?function(){return(ce.create=function(){return new cE})()}:function(){return new ce}};ce.create=q2();ce.alloc=function(e){return new Dt.Array(e)};Dt.Array!==Array&&(ce.alloc=Dt.pool(ce.alloc,Dt.Array.prototype.subarray));ce.prototype._push=function(e,r,n){return this.tail=this.tail.next=new Ga(e,r,n),this.len+=r,this};function hE(t,e,r){e[r]=t&255}function One(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function dE(t,e){this.len=t,this.next=void 0,this.val=e}dE.prototype=Object.create(Ga.prototype);dE.prototype.fn=One;ce.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new dE((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};ce.prototype.int32=function(e){return(e|=0)<0?this._push(fE,10,td.fromNumber(e)):this.uint32(e)};ce.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function fE(t,e,r){for(var n=t.lo,i=t.hi;i;)e[r++]=n&127|128,n=(n>>>7|i<<25)>>>0,i>>>=7;for(;n>127;)e[r++]=n&127|128,n=n>>>7;e[r++]=n}ce.prototype.uint64=function(e){var r=td.from(e);return this._push(fE,r.length(),r)};ce.prototype.int64=ce.prototype.uint64;ce.prototype.sint64=function(e){var r=td.from(e).zzEncode();return this._push(fE,r.length(),r)};ce.prototype.bool=function(e){return this._push(hE,1,e?1:0)};function lE(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}ce.prototype.fixed32=function(e){return this._push(lE,4,e>>>0)};ce.prototype.sfixed32=ce.prototype.fixed32;ce.prototype.fixed64=function(e){var r=td.from(e);return this._push(lE,4,r.lo)._push(lE,4,r.hi)};ce.prototype.sfixed64=ce.prototype.fixed64;ce.prototype.float=function(e){return this._push(Dt.float.writeFloatLE,4,e)};ce.prototype.double=function(e){return this._push(Dt.float.writeDoubleLE,8,e)};var bne=Dt.Array.prototype.set?function(e,r,n){r.set(e,n)}:function(e,r,n){for(var i=0;i<e.length;++i)r[n+i]=e[i]};ce.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(hE,1,0);if(Dt.isString(e)){var n=ce.alloc(r=B2.length(e));B2.decode(e,n,0),e=n}return this.uint32(r)._push(bne,r,e)};ce.prototype.string=function(e){var r=V2.length(e);return r?this.uint32(r)._push(V2.write,r,e):this._push(hE,1,0)};ce.prototype.fork=function(){return this.states=new Rne(this),this.head=this.tail=new Ga(uE,0,0),this.len=0,this};ce.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Ga(uE,0,0),this.len=0),this};ce.prototype.ldelim=function(){var e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=r,this.len+=n),this};ce.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r};ce._configure=function(t){cE=t,ce.create=q2(),cE._configure()}});var j2=m((G0e,z2)=>{"use strict";z2.exports=Cr;var H2=rd();(Cr.prototype=Object.create(H2.prototype)).constructor=Cr;var Ln=rr();function Cr(){H2.call(this)}Cr._configure=function(){Cr.alloc=Ln._Buffer_allocUnsafe,Cr.writeBytesBuffer=Ln.Buffer&&Ln.Buffer.prototype instanceof Uint8Array&&Ln.Buffer.prototype.set.name==="set"?function(e,r,n){r.set(e,n)}:function(e,r,n){if(e.copy)e.copy(r,n,0,e.length);else for(var i=0;i<e.length;)r[n++]=e[i++]}};Cr.prototype.bytes=function(e){Ln.isString(e)&&(e=Ln._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(Cr.writeBytesBuffer,r,e),this};function Mne(t,e,r){t.length<40?Ln.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}Cr.prototype.string=function(e){var r=Ln.Buffer.byteLength(e);return this.uint32(r),r&&this._push(Mne,r,e),this};Cr._configure()});var id=m((H0e,X2)=>{"use strict";X2.exports=ve;var Ut=rr(),mE,Y2=Ut.LongBits,Nne=Ut.utf8;function nr(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function ve(t){this.buf=t,this.pos=0,this.len=t.length}var $2=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new ve(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new ve(e);throw Error("illegal buffer")},K2=function(){return Ut.Buffer?function(r){return(ve.create=function(i){return Ut.Buffer.isBuffer(i)?new mE(i):$2(i)})(r)}:$2};ve.create=K2();ve.prototype._slice=Ut.Array.prototype.subarray||Ut.Array.prototype.slice;ve.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,nr(this,10);return e}}();ve.prototype.int32=function(){return this.uint32()|0};ve.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function pE(){var t=new Y2(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw nr(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw nr(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}ve.prototype.bool=function(){return this.uint32()!==0};function nd(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}ve.prototype.fixed32=function(){if(this.pos+4>this.len)throw nr(this,4);return nd(this.buf,this.pos+=4)};ve.prototype.sfixed32=function(){if(this.pos+4>this.len)throw nr(this,4);return nd(this.buf,this.pos+=4)|0};function W2(){if(this.pos+8>this.len)throw nr(this,8);return new Y2(nd(this.buf,this.pos+=4),nd(this.buf,this.pos+=4))}ve.prototype.float=function(){if(this.pos+4>this.len)throw nr(this,4);var e=Ut.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};ve.prototype.double=function(){if(this.pos+8>this.len)throw nr(this,4);var e=Ut.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};ve.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw nr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=Ut.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)};ve.prototype.string=function(){var e=this.bytes();return Nne.read(e,0,e.length)};ve.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw nr(this,e);this.pos+=e}else do if(this.pos>=this.len)throw nr(this);while(this.buf[this.pos++]&128);return this};ve.recursionLimit=Ut.recursionLimit;ve.prototype.skipType=function(t,e){if(e===void 0&&(e=0),e>ve.recursionLimit)throw Error("maximum nesting depth exceeded");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t,e+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};ve._configure=function(t){mE=t,ve.create=K2(),mE._configure();var e=Ut.Long?"toLong":"toNumber";Ut.merge(ve.prototype,{int64:function(){return pE.call(this)[e](!1)},uint64:function(){return pE.call(this)[e](!0)},sint64:function(){return pE.call(this).zzDecode()[e](!1)},fixed64:function(){return W2.call(this)[e](!0)},sfixed64:function(){return W2.call(this)[e](!1)}})}});var ek=m((z0e,Z2)=>{"use strict";Z2.exports=vi;var Q2=id();(vi.prototype=Object.create(Q2.prototype)).constructor=vi;var J2=rr();function vi(t){Q2.call(this,t)}vi._configure=function(){J2.Buffer&&(vi.prototype._slice=J2.Buffer.prototype.slice)};vi.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};vi._configure()});var rk=m((j0e,tk)=>{"use strict";tk.exports=Ha;var gE=rr();(Ha.prototype=Object.create(gE.EventEmitter.prototype)).constructor=Ha;function Ha(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");gE.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!r}Ha.prototype.rpcCall=function t(e,r,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return gE.asPromise(t,o,e,r,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,r[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(c,l){if(c)return o.emit("error",c,e),s(c);if(l===null){o.end(!0);return}if(!(l instanceof n))try{l=n[o.responseDelimited?"decodeDelimited":"decode"](l)}catch(h){return o.emit("error",h,e),s(h)}return o.emit("data",l,e),s(null,l)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Ha.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var _E=m(nk=>{"use strict";var wne=nk;wne.Service=rk()});var EE=m((W0e,ik)=>{"use strict";ik.exports={}});var ak=m(ok=>{"use strict";var St=ok;St.build="minimal";St.Writer=rd();St.BufferWriter=j2();St.Reader=id();St.BufferReader=ek();St.util=rr();St.rpc=_E();St.roots=EE();St.configure=sk;function sk(){St.util._configure(),St.Writer._configure(St.BufferWriter),St.Reader._configure(St.BufferReader)}sk()});var lk=m((K0e,ck)=>{"use strict";ck.exports=SE;var Pne=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;function SE(t,e){typeof t=="string"&&(e=t,t=void 0);var r=[];function n(s){if(typeof s!="string"){var o=i();if(SE.verbose&&console.log("codegen: "+o),o="return "+o,s){for(var a=Object.keys(s),c=new Array(a.length+1),l=new Array(a.length),h=0;h<a.length;)c[h]=a[h],l[h]=s[a[h++]];return c[h]=o,Function.apply(null,c).apply(null,l)}return Function(o)()}for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f]=arguments[++f];if(f=0,s=s.replace(/%([%dfijs])/g,function(g,S){var A=d[f++];switch(S){case"d":case"f":return String(Number(A));case"i":return String(Math.floor(A));case"j":return JSON.stringify(A);case"s":return String(A)}return"%"}),f!==d.length)throw Error("parameter count mismatch");return r.push(s),n}function i(s){return"function "+xne(s||e)+"("+(t&&t.join(",")||"")+`){
|
|
50
|
-
`+r.join(`
|
|
51
|
-
`)+`
|
|
52
|
-
}`}return n.toString=i,n}SE.verbose=!1;function xne(t){return!t||(t=String(t).replace(/[^\w$]/g,""),!t)?"":(/^\d/.test(t)&&(t="_"+t),Pne.test(t)?t+"_":t)}});var hk=m((X0e,uk)=>{"use strict";var Ys=null;try{Ys=L("fs"),(!Ys||!Ys.readFile||!Ys.readFileSync)&&(Ys=null)}catch{}uk.exports=Ys});var fk=m((J0e,dk)=>{"use strict";dk.exports=za;var Ine=nE(),TE=hk();function za(t,e,r){return typeof e=="function"?(r=e,e={}):e||(e={}),r?!e.xhr&&TE&&TE.readFile?TE.readFile(t,function(i,s){return i&&typeof XMLHttpRequest<"u"?za.xhr(t,e,r):i?r(i):r(null,e.binary?s:s.toString("utf8"))}):za.xhr(t,e,r):Ine(za,this,t,e)}za.xhr=function(e,r,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4){if(i.status!==0&&i.status!==200)return n(Error("status "+i.status));if(r.binary){var o=i.response;if(!o){o=[];for(var a=0;a<i.responseText.length;++a)o.push(i.responseText.charCodeAt(a)&255)}return n(null,typeof Uint8Array<"u"?new Uint8Array(o):o)}return n(null,i.responseText)}},r.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",e),i.send()}});var gk=m(mk=>{"use strict";var vE=mk,pk=vE.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},yE=vE.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var r=e.split("/"),n=pk(e),i="";n&&(i=r.shift()+"/");for(var s=0;s<r.length;)r[s]===".."?s>0&&r[s-1]!==".."?r.splice(--s,2):n?r.splice(s,1):++s:r[s]==="."?r.splice(s,1):++s;return i+r.join("/")};vE.resolve=function(e,r,n){return n||(r=yE(r)),pk(r)?r:(n||(e=yE(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?yE(e+"/"+r):r)}});var Ek=m(_k=>{"use strict";var AE=_k;AE.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;AE.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;AE.reservedRe=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/});var Tk=m((eve,Sk)=>{"use strict";var Ks=null;try{Ks=L("fs"),(!Ks||!Ks.readFile||!Ks.readFileSync)&&(Ks=null)}catch{}Sk.exports=Ks});var Js=m((tve,Ak)=>{"use strict";Ak.exports=se;var sd=Un();((se.prototype=Object.create(sd.prototype)).constructor=se).className="Namespace";var CE=Dn(),Ci=je(),Lne=Oi(),Ai,Xs,Ri;se.fromJSON=function(e,r,n){return n=Ci.checkDepth(n),new se(e,r.options).addJSON(r.nested,n)};function yk(t,e){if(t&&t.length){for(var r={},n=0;n<t.length;++n)r[t[n].name]=t[n].toJSON(e);return r}}se.arrayToJSON=yk;se.isReservedId=function(e,r){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!="string"&&e[n][0]<=r&&e[n][1]>r)return!0}return!1};se.isReservedName=function(e,r){if(e){for(var n=0;n<e.length;++n)if(e[n]===r)return!0}return!1};function se(t,e){sd.call(this,t,e),this.nested=void 0,this._nestedArray=null,this._lookupCache=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function vk(t){t._nestedArray=null,t._lookupCache=Object.create(null);for(var e=t;e=e.parent;)e._lookupCache=Object.create(null);return t}Object.defineProperty(se.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=Ci.toArray(this.nested))}});se.prototype.toJSON=function(e){return Ci.toObject(["options",this.options,"nested",yk(this.nestedArray,e)])};se.prototype.addJSON=function(e,r){r=Ci.checkDepth(r);var n=this;if(e)for(var i=Object.keys(e),s=0,o;s<i.length;++s)o=e[i[s]],n.add((o.fields!==void 0?Ai.fromJSON:o.values!==void 0?Ri.fromJSON:o.methods!==void 0?Xs.fromJSON:o.id!==void 0?CE.fromJSON:se.fromJSON)(i[s],o,r+1));return this};se.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};se.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&this.nested[e]instanceof Ri)return this.nested[e].values;throw Error("no such enum: "+e)};se.prototype.add=function(e){if(!(e instanceof CE&&e.extend!==void 0||e instanceof Ai||e instanceof Lne||e instanceof Ri||e instanceof Xs||e instanceof se))throw TypeError("object must be a valid nested object");if(e.name==="__proto__")return this;if(!this.nested)this.nested={};else{var r=this.get(e.name);if(r)if(r instanceof se&&e instanceof se&&!(r instanceof Ai||r instanceof Xs)){for(var n=r.nestedArray,i=0;i<n.length;++i)e.add(n[i]);this.remove(r),this.nested||(this.nested={}),e.setOptions(r.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof Ai||this instanceof Xs||this instanceof Ri||this instanceof CE||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var s=this;s=s.parent;)s._needsRecursiveFeatureResolution=!0,s._needsRecursiveResolve=!0;return e.onAdd(this),vk(this)};se.prototype.remove=function(e){if(!(e instanceof sd))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),vk(this)};se.prototype.define=function(e,r){if(Ci.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");if(e.length>Ci.recursionLimit)throw Error("max depth exceeded");for(var n=this;e.length>0;){var i=e.shift();if(n.nested&&n.nested[i]){if(n=n.nested[i],!(n instanceof se))throw Error("path conflicts with non-namespace objects")}else n.add(n=new se(i))}return r&&n.addJSON(r),n};se.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,r=0;for(this.resolve();r<e.length;)e[r]instanceof se?e[r++].resolveAll():e[r++].resolve();return this._needsRecursiveResolve=!1,this};se.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,sd.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};se.prototype.lookup=function(e,r,n){if(typeof r=="boolean"?(n=r,r=void 0):r&&!Array.isArray(r)&&(r=[r]),Ci.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var i=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),r);var s=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+i];if(s&&(!r||r.indexOf(s.constructor)>-1)||(s=this._lookupImpl(e,i),s&&(!r||r.indexOf(s.constructor)>-1)))return s;if(n)return null;for(var o=this;o.parent;){if(s=o.parent._lookupImpl(e,i),s&&(!r||r.indexOf(s.constructor)>-1))return s;o=o.parent}return null};se.prototype._lookupImpl=function(e,r){if(Object.prototype.hasOwnProperty.call(this._lookupCache,r))return this._lookupCache[r];var n=this.get(e[0]),i=null;if(n)e.length===1?i=n:n instanceof se&&(e=e.slice(1),i=n._lookupImpl(e,e.join(".")));else for(var s=0;s<this.nestedArray.length;++s)if(this._nestedArray[s]instanceof se&&(n=this._nestedArray[s]._lookupImpl(e,r))){i=n;break}return this._lookupCache[r]=i,i};se.prototype.lookupType=function(e){var r=this.lookup(e,[Ai]);if(!r)throw Error("no such type: "+e);return r};se.prototype.lookupEnum=function(e){var r=this.lookup(e,[Ri]);if(!r)throw Error("no such Enum '"+e+"' in "+this);return r};se.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[Ai,Ri]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r};se.prototype.lookupService=function(e){var r=this.lookup(e,[Xs]);if(!r)throw Error("no such Service '"+e+"' in "+this);return r};se._configure=function(t,e,r){Ai=t,Xs=e,Ri=r}});var od=m((rve,Ck)=>{"use strict";Ck.exports=Xr;var RE=Dn();((Xr.prototype=Object.create(RE.prototype)).constructor=Xr).className="MapField";var Dne=bi(),ja=je();function Xr(t,e,r,n,i,s){if(RE.call(this,t,e,n,void 0,void 0,i,s),!ja.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}Xr.fromJSON=function(e,r){return new Xr(e,r.id,r.keyType,r.type,r.options,r.comment)};Xr.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return ja.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",r?this.comment:void 0])};Xr.prototype.resolve=function(){if(this.resolved)return this;if(Dne.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return RE.prototype.resolve.call(this)};Xr.d=function(e,r,n){return typeof n=="function"?n=ja.decorateType(n).name:n&&typeof n=="object"&&(n=ja.decorateEnum(n).name),function(s,o){ja.decorateType(s.constructor).add(new Xr(o,e,r,n))}}});var ad=m((nve,Rk)=>{"use strict";Rk.exports=Mi;var OE=Un();((Mi.prototype=Object.create(OE.prototype)).constructor=Mi).className="Method";var Qs=je();function Mi(t,e,r,n,i,s,o,a,c){if(Qs.isObject(i)?(o=i,i=s=void 0):Qs.isObject(s)&&(o=s,s=void 0),!(e===void 0||Qs.isString(e)))throw TypeError("type must be a string");if(!Qs.isString(r))throw TypeError("requestType must be a string");if(!Qs.isString(n))throw TypeError("responseType must be a string");OE.call(this,t,o),this.type=e||"rpc",this.requestType=r,this.requestStream=i?!0:void 0,this.responseType=n,this.responseStream=s?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=c}Mi.fromJSON=function(e,r){return new Mi(e,r.type,r.requestType,r.responseType,r.requestStream,r.responseStream,r.options,r.comment,r.parsedOptions)};Mi.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Qs.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])};Mi.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),OE.prototype.resolve.call(this))}});var cd=m((ive,bk)=>{"use strict";bk.exports=At;var Jr=Js();((At.prototype=Object.create(Jr.prototype)).constructor=At).className="Service";var bE=ad(),Zs=je(),Une=_E(),kne=Zs.patterns.reservedRe;function At(t,e){Jr.call(this,t,e),this.methods={},this._methodsArray=null}At.fromJSON=function(e,r,n){n=Zs.checkDepth(n);var i=new At(e,r.options);if(r.methods)for(var s=Object.keys(r.methods),o=0;o<s.length;++o)i.add(bE.fromJSON(s[o],r.methods[s[o]]));return r.nested&&i.addJSON(r.nested,n),r.edition&&(i._edition=r.edition),i.comment=r.comment,i._defaultEdition="proto3",i};At.prototype.toJSON=function(e){var r=Jr.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return Zs.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"methods",Jr.arrayToJSON(this.methodsArray,e)||{},"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])};Object.defineProperty(At.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=Zs.toArray(this.methods))}});function Ok(t){return t._methodsArray=null,t}At.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:Jr.prototype.get.call(this,e)};At.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Jr.prototype.resolve.call(this);for(var e=this.methodsArray,r=0;r<e.length;++r)e[r].resolve();return this};At.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Jr.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};At.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof bE?e.name==="__proto__"?this:(this.methods[e.name]=e,e.parent=this,Ok(this)):Jr.prototype.add.call(this,e)};At.prototype.remove=function(e){if(e instanceof bE){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,Ok(this)}return Jr.prototype.remove.call(this,e)};At.prototype.create=function(e,r,n){for(var i=new Une.Service(e,r,n),s=0,o;s<this.methodsArray.length;++s){var a=Zs.lcFirst((o=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[a]=Zs.codegen(["r","c"],kne.test(a)?a+"_":a)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return i}});var ld=m((sve,Mk)=>{"use strict";Mk.exports=Rr;var Fne=rr();function Rr(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r){var n=e[r];n!=="__proto__"&&(this[n]=t[n])}}Rr.create=function(e){return this.$type.create(e)};Rr.encode=function(e,r){return this.$type.encode(e,r)};Rr.encodeDelimited=function(e,r){return this.$type.encodeDelimited(e,r)};Rr.decode=function(e){return this.$type.decode(e)};Rr.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Rr.verify=function(e){return this.$type.verify(e)};Rr.fromObject=function(e){return this.$type.fromObject(e)};Rr.toObject=function(e,r){return this.$type.toObject(e,r)};Rr.prototype.toJSON=function(){return this.$type.toObject(this,Fne.toJSONOptions)}});var ME=m((ove,wk)=>{"use strict";wk.exports=qne;var Bne=ir(),Qr=bi(),Nk=je();function Vne(t){return"missing required '"+t.name+"'"}function qne(t){for(var e=Nk.codegen(["r","l","e","n"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(n===undefined)n=0")("if(n>Reader.recursionLimit)")('throw Error("maximum nesting depth exceeded")')("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(a){return a.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),r=0;r<t.fieldsArray.length;++r){var n=t._fieldsArray[r].resolve(),i=n.resolvedType instanceof Bne?"int32":n.type,s="m"+Nk.safeProp(n.name);e("case %i: {",n.id),n.map?(e("if(%s===util.emptyObject)",s)("%s={}",s)("var c2 = r.uint32()+r.pos"),Qr.defaults[n.keyType]!==void 0?e("k=%j",Qr.defaults[n.keyType]):e("k=null"),Qr.defaults[i]!==void 0?e("value=%j",Qr.defaults[i]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",n.keyType)("case 2:"),Qr.basic[i]===void 0?e("value=types[%i].decode(r,r.uint32(),undefined,n+1)",r):e("value=r.%s()",i),e("break")("default:")("r.skipType(tag2&7,n)")("break")("}")("}"),Qr.long[n.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',s):(n.keyType==="string"&&e('if(k==="__proto__")')("util.makeProp(%s,k)",s),e("%s[k]=value",s))):n.repeated?(e("if(!(%s&&%s.length))",s,s)("%s=[]",s),Qr.packed[i]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",s,i)("}else"),Qr.basic[i]===void 0?e(n.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))":"%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))",s,r):e("%s.push(r.%s())",s,i)):Qr.basic[i]===void 0?e(n.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)":"%s=types[%i].decode(r,r.uint32(),undefined,n+1)",s,r):e("%s=r.%s()",s,i),e("break")("}")}for(e("default:")("r.skipType(t&7,n)")("break")("}")("}"),r=0;r<t._fieldsArray.length;++r){var o=t._fieldsArray[r];o.required&&e("if(!m.hasOwnProperty(%j))",o.name)("throw util.ProtocolError(%j,{instance:m})",Vne(o))}return e("return m")}});var PE=m((ave,Pk)=>{"use strict";Pk.exports=zne;var Gne=ir(),NE=je();function kt(t,e){return t.name+": "+e+(t.repeated&&e!=="array"?"[]":t.map&&e!=="object"?"{k:"+t.keyType+"}":"")+" expected"}function wE(t,e,r,n){if(e.resolvedType)if(e.resolvedType instanceof Gne){t("switch(%s){",n)("default:")("return%j",kt(e,"enum value"));for(var i=Object.keys(e.resolvedType.values),s=0;s<i.length;++s)t("case %i:",e.resolvedType.values[i[s]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s,n+1);",r,n)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",n)("return%j",kt(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",kt(e,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',n)("return%j",kt(e,"number"));break;case"bool":t('if(typeof %s!=="boolean")',n)("return%j",kt(e,"boolean"));break;case"string":t("if(!util.isString(%s))",n)("return%j",kt(e,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",kt(e,"buffer"));break}return t}function Hne(t,e,r){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",r)("return%j",kt(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",r)("return%j",kt(e,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",r)("return%j",kt(e,"boolean key"));break}return t}function zne(t){var e=NE.codegen(["m","n"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected")("if(n===undefined)n=0")("if(n>util.recursionLimit)")("return%j","maximum nesting depth exceeded"),r=t.oneofsArray,n={};r.length&&e("var p={}");for(var i=0;i<t.fieldsArray.length;++i){var s=t._fieldsArray[i].resolve(),o="m"+NE.safeProp(s.name);if(s.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",o,s.name),s.map)e("if(!util.isObject(%s))",o)("return%j",kt(s,"object"))("var k=Object.keys(%s)",o)("for(var i=0;i<k.length;++i){"),Hne(e,s,"k[i]"),wE(e,s,i,o+"[k[i]]")("}");else if(s.repeated)e("if(!Array.isArray(%s))",o)("return%j",kt(s,"array"))("for(var i=0;i<%s.length;++i){",o),wE(e,s,i,o+"[i]")("}");else{if(s.partOf){var a=NE.safeProp(s.partOf.name);n[s.partOf.name]===1&&e("if(p%s===1)",a)("return%j",s.partOf.name+": multiple values"),n[s.partOf.name]=1,e("p%s=1",a)}wE(e,s,i,o)}s.optional&&e("}")}return e("return null")}});var LE=m(Ik=>{"use strict";var xk=Ik,$a=ir(),Or=je();function xE(t,e,r,n){var i=!1;if(e.resolvedType)if(e.resolvedType instanceof $a){t("switch(d%s){",n);for(var s=e.resolvedType.values,o=Object.keys(s),a=0;a<o.length;++a)s[o[a]]===e.typeDefault&&!i&&(t("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),e.repeated||t("break"),i=!0),t("case%j:",o[a])("case %i:",s[o[a]])("m%s=%j",n,s[o[a]])("break");t("}")}else t('if(typeof d%s!=="object")',n)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s,n+1)",n,r,n);else{var c=!1;switch(e.type){case"double":case"float":t("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",n,n);break;case"uint64":case"fixed64":c=!0;case"int64":case"sint64":case"sfixed64":t("if(util.Long)")("m%s=util.Long.fromValue(d%s,%j)",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":t('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":t("m%s=String(d%s)",n,n);break;case"bool":t("m%s=Boolean(d%s)",n,n);break}}return t}xk.fromObject=function(e){var r=e.fieldsArray,n=Or.codegen(["d","n"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d")("if(n===undefined)n=0")("if(n>util.recursionLimit)")('throw Error("maximum nesting depth exceeded")');if(!r.length)return n("return new this.ctor");n("var m=new this.ctor");for(var i=0;i<r.length;++i){var s=r[i].resolve(),o=Or.safeProp(s.name);s.map?(n("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),n('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[i])",o),xE(n,s,i,o+"[ks[i]]")("}")("}")):s.repeated?(n("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),xE(n,s,i,o+"[i]")("}")("}")):(s.resolvedType instanceof $a||n("if(d%s!=null){",o),xE(n,s,i,o),s.resolvedType instanceof $a||n("}"))}return n("return m")};function IE(t,e,r,n){if(e.resolvedType)e.resolvedType instanceof $a?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):t("d%s=types[%i].toObject(m%s,o,q+1)",n,r,n);else{var i=!1;switch(e.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":case"fixed64":i=!0;case"int64":case"sint64":case"sfixed64":t('if(typeof BigInt!=="undefined"&&o.longs===BigInt)')('d%s=typeof m%s==="number"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()',n,n,n,n,n,i)('else if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:t("d%s=m%s",n,n);break}}return t}xk.toObject=function(e){var r=e.fieldsArray.slice().sort(Or.compareFieldsById);if(!r.length)return Or.codegen()("return {}");for(var n=Or.codegen(["m","o","q"],e.name+"$toObject")("if(!o)")("o={}")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")')("var d={}"),i=[],s=[],o=[],a=0;a<r.length;++a)r[a].partOf||(r[a].resolve().repeated?i:r[a].map?s:o).push(r[a]);if(i.length){for(n("if(o.arrays||o.defaults){"),a=0;a<i.length;++a)n("d%s=[]",Or.safeProp(i[a].name));n("}")}if(s.length){for(n("if(o.objects||o.defaults){"),a=0;a<s.length;++a)n("d%s={}",Or.safeProp(s[a].name));n("}")}if(o.length){for(n("if(o.defaults){"),a=0;a<o.length;++a){var c=o[a],l=Or.safeProp(c.name);if(c.resolvedType instanceof $a)n("d%s=o.enums===String?%j:%j",l,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)('d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!=="undefined"&&o.longs===BigInt?n.toBigInt():n',l)("}else")('d%s=o.longs===String?%j:typeof BigInt!=="undefined"&&o.longs===BigInt?BigInt(%j):%i',l,c.typeDefault.toString(),c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var h=Array.prototype.slice.call(c.typeDefault);n("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%j",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else n("d%s=%j",l,c.typeDefault)}n("}")}var d=!1;for(a=0;a<r.length;++a){var c=r[a],f=e._fieldsArray.indexOf(c),l=Or.safeProp(c.name);c.map?(d||(d=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),n('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",l),IE(n,c,f,l+"[ks2[j]]")("}")):c.repeated?(n("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),IE(n,c,f,l+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",l,c.name),IE(n,c,f,l),c.partOf&&n("if(o.oneofs)")("d%s=%j",Or.safeProp(c.partOf.name),c.name)),n("}")}return n("return d")}});var DE=m(Lk=>{"use strict";var jne=Lk,$ne=ld(),Wne=rr();jne[".google.protobuf.Any"]={fromObject:function(t,e){if(t&&t["@type"]){var r=t["@type"].substring(t["@type"].lastIndexOf("/")+1),n=this.lookup(r);if(n){var i=t["@type"].charAt(0)==="."?t["@type"].slice(1):t["@type"];return i.indexOf("/")===-1&&(i="/"+i),this.create({type_url:i,value:n.encode(n.fromObject(t,e===void 0?1:e+1)).finish()})}}return this.fromObject(t,e)},toObject:function(t,e,r){if(r===void 0&&(r=0),r>Wne.recursionLimit)throw Error("max depth exceeded");var n="type.googleapis.com/",i="",s="";if(e&&e.json&&t.type_url&&t.value){s=t.type_url.substring(t.type_url.lastIndexOf("/")+1),i=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var o=this.lookup(s);o&&(t=o.decode(t.value,void 0,void 0,r+1))}if(!(t instanceof this.ctor)&&t instanceof $ne){var a=t.$type.toObject(t,e,r+1),c=t.$type.fullName[0]==="."?t.$type.fullName.slice(1):t.$type.fullName;return i===""&&(i=n),s=i+c,a["@type"]=s,a}return this.toObject(t,e,r)}}});var dd=m((uve,Uk)=>{"use strict";Uk.exports=Se;var Ft=Js();((Se.prototype=Object.create(Ft.prototype)).constructor=Se).className="Type";var Yne=ir(),FE=Oi(),ud=Dn(),Kne=od(),Xne=cd(),UE=ld(),kE=id(),Jne=rd(),Qe=je(),Qne=BE(),Zne=ME(),eie=PE(),Dk=LE(),tie=DE();function Se(t,e){t=t.replace(/\W/g,""),Ft.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Se.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var t=Object.keys(this.fields),e=0;e<t.length;++e){var r=this.fields[t[e]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=Qe.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=Qe.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Se.generateConstructor(this)())},set:function(t){var e=t.prototype;e instanceof UE||((t.prototype=new UE).constructor=t,Qe.merge(t.prototype,e)),t.$type=t.prototype.$type=this,Qe.merge(t,UE,!0),this._ctor=t;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:Qe.oneOfGetter(this._oneofsArray[r].oneof),set:Qe.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(t.prototype,n)}}});Se.generateConstructor=function(e){for(var r=Qe.codegen(["p"],e.name),n=0,i;n<e.fieldsArray.length;++n)(i=e._fieldsArray[n]).map?r("this%s={}",Qe.safeProp(i.name)):i.repeated&&r("this%s=[]",Qe.safeProp(i.name));return r('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")};function hd(t){return t._fieldsById=t._fieldsArray=t._oneofsArray=null,delete t.encode,delete t.decode,delete t.verify,t}Se.fromJSON=function(e,r,n){if(n===void 0&&(n=0),n>Qe.nestingLimit)throw Error("max depth exceeded");var i=new Se(e,r.options);i.extensions=r.extensions,i.reserved=r.reserved;for(var s=Object.keys(r.fields),o=0;o<s.length;++o)i.add((typeof r.fields[s[o]].keyType<"u"?Kne.fromJSON:ud.fromJSON)(s[o],r.fields[s[o]]));if(r.oneofs)for(s=Object.keys(r.oneofs),o=0;o<s.length;++o)i.add(FE.fromJSON(s[o],r.oneofs[s[o]]));if(r.nested)for(s=Object.keys(r.nested),o=0;o<s.length;++o){var a=r.nested[s[o]];i.add((a.id!==void 0?ud.fromJSON:a.fields!==void 0?Se.fromJSON:a.values!==void 0?Yne.fromJSON:a.methods!==void 0?Xne.fromJSON:Ft.fromJSON)(s[o],a,n+1))}return r.extensions&&r.extensions.length&&(i.extensions=r.extensions),r.reserved&&r.reserved.length&&(i.reserved=r.reserved),r.group&&(i.group=!0),r.comment&&(i.comment=r.comment),r.edition&&(i._edition=r.edition),i._defaultEdition="proto3",i};Se.prototype.toJSON=function(e){var r=Ft.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return Qe.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",Ft.arrayToJSON(this.oneofsArray,e),"fields",Ft.arrayToJSON(this.fieldsArray.filter(function(i){return!i.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])};Se.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Ft.prototype.resolveAll.call(this);var e=this.oneofsArray;for(n=0;n<e.length;)e[n++].resolve();for(var r=this.fieldsArray,n=0;n<r.length;)r[n++].resolve();return this};Se.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Ft.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(r=>{r._resolveFeatures(e)}),this.fieldsArray.forEach(r=>{r._resolveFeatures(e)}),this):this};Se.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};Se.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof ud&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.name==="__proto__"?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),hd(this))}return e instanceof FE?e.name==="__proto__"?this:(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),hd(this)):Ft.prototype.add.call(this,e)};Se.prototype.remove=function(e){if(e instanceof ud&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),hd(this)}if(e instanceof FE){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),hd(this)}return Ft.prototype.remove.call(this,e)};Se.prototype.isReservedId=function(e){return Ft.isReservedId(this.reserved,e)};Se.prototype.isReservedName=function(e){return Ft.isReservedName(this.reserved,e)};Se.prototype.create=function(e){return new this.ctor(e)};Se.prototype.setup=function(){for(var e=this.fullName,r=[],n=0;n<this.fieldsArray.length;++n)r.push(this._fieldsArray[n].resolve().resolvedType);this.encode=Qne(this)({Writer:Jne,types:r,util:Qe}),this.decode=Zne(this)({Reader:kE,types:r,util:Qe}),this.verify=eie(this)({types:r,util:Qe}),this.fromObject=Dk.fromObject(this)({types:r,util:Qe}),this.toObject=Dk.toObject(this)({types:r,util:Qe});var i=tie[e];if(i){var s=Object.create(this);s.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(s),s.toObject=this.toObject,this.toObject=i.toObject.bind(s)}return this};Se.prototype.encode=function(e,r){return this.setup().encode.apply(this,arguments)};Se.prototype.encodeDelimited=function(e,r){return this.encode(e,r&&r.len?r.fork():r).ldelim()};Se.prototype.decode=function(e,r,n,i){return this.setup().decode(e,r,n,i)};Se.prototype.decodeDelimited=function(e){return e instanceof kE||(e=kE.create(e)),this.decode(e,e.uint32())};Se.prototype.verify=function(e,r){return this.setup().verify(e,r)};Se.prototype.fromObject=function(e,r){return this.setup().fromObject(e,r)};Se.prototype.toObject=function(e,r){return this.setup().toObject.apply(this,arguments)};Se.d=function(e){return function(n){Qe.decorateType(n,e)}}});var gd=m((hve,Bk)=>{"use strict";Bk.exports=Ct;var md=Js();((Ct.prototype=Object.create(md.prototype)).constructor=Ct).className="Root";var fd=Dn(),VE=ir(),rie=Oi(),br=je(),qE,GE,Wa;function Ct(t){md.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}Ct.fromJSON=function(e,r,n){return n=br.checkDepth(n),r||(r=new Ct),e.options&&r.setOptions(e.options),r.addJSON(e.nested,n).resolveAll()};Ct.prototype.resolvePath=br.path.resolve;Ct.prototype.fetch=br.fetch;function Fk(){}Ct.prototype.load=function t(e,r,n){typeof r=="function"&&(n=r,r=void 0);var i=this;if(!n)return br.asPromise(t,i,e,r);var s=n===Fk;function o(p,g){if(n){if(s)throw p;g&&g.resolveAll();var S=n;n=null,S(p,g)}}function a(p){var g=p.lastIndexOf("google/protobuf/");if(g>-1){var S=p.substring(g);if(S in Wa)return S}return null}function c(p,g,S){S===void 0&&(S=0);try{if(S>br.recursionLimit)throw Error("max depth exceeded");if(br.isString(g)&&g.charAt(0)==="{"&&(g=JSON.parse(g)),!br.isString(g))i.setOptions(g.options).addJSON(g.nested);else{GE.filename=p;var A=GE(g,i,r),C,R=0;if(A.imports)for(;R<A.imports.length;++R)(C=a(A.imports[R])||i.resolvePath(p,A.imports[R]))&&l(C,!1,S+1);if(A.weakImports)for(R=0;R<A.weakImports.length;++R)(C=a(A.weakImports[R])||i.resolvePath(p,A.weakImports[R]))&&l(C,!0,S+1)}}catch(M){o(M)}!s&&!h&&o(null,i)}function l(p,g,S){if(S===void 0&&(S=0),p=a(p)||p,!(i.files.indexOf(p)>-1)){if(i.files.push(p),p in Wa){s?c(p,Wa[p],S):(++h,setTimeout(function(){--h,c(p,Wa[p],S)}));return}if(s){var A;try{A=br.fs.readFileSync(p).toString("utf8")}catch(C){g||o(C);return}c(p,A,S)}else++h,i.fetch(p,function(C,R){if(--h,!!n){if(C){g?h||o(null,i):o(C);return}c(p,R,S)}})}}var h=0;br.isString(e)&&(e=[e]);for(var d=0,f;d<e.length;++d)(f=i.resolvePath("",e[d]))&&l(f);return s?(i.resolveAll(),i):(h||o(null,i),i)};Ct.prototype.loadSync=function(e,r){if(!br.isNode)throw Error("not supported");return this.load(e,r,Fk)};Ct.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return md.prototype.resolveAll.call(this)};var pd=/^[A-Z]/;function kk(t,e){var r=e.parent.lookup(e.extend);if(r){var n=new fd(e.fullName,e.id,e.type,e.rule,void 0,e.options);return r.get(n.name)||(n.declaringField=e,e.extensionField=n,r.add(n)),!0}return!1}Ct.prototype._handleAdd=function(e){if(e instanceof fd)e.extend!==void 0&&!e.extensionField&&(kk(this,e)||this.deferred.push(e));else if(e instanceof VE)pd.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof rie)){if(e instanceof qE)for(var r=0;r<this.deferred.length;)kk(this,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);pd.test(e.name)&&(e.parent[e.name]=e)}(e instanceof qE||e instanceof VE||e instanceof fd)&&(this._fullyQualifiedObjects[e.fullName]=e)};Ct.prototype._handleRemove=function(e){if(e instanceof fd){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var r=this.deferred.indexOf(e);r>-1&&this.deferred.splice(r,1)}}else if(e instanceof VE)pd.test(e.name)&&delete e.parent[e.name];else if(e instanceof md){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);pd.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};Ct._configure=function(t,e,r){qE=t,GE=e,Wa=r}});var je=m((dve,Gk)=>{"use strict";var ye=Gk.exports=rr(),Vk=EE(),HE,zE;ye.codegen=lk();ye.fetch=fk();ye.path=gk();ye.patterns=Ek();var qk=ye.patterns.reservedRe;ye.fs=Tk();ye.checkDepth=function(e){if(e===void 0&&(e=0),e>ye.recursionLimit)throw Error("max depth exceeded");return e};ye.toArray=function(e){if(e){for(var r=Object.keys(e),n=new Array(r.length),i=0;i<r.length;)n[i]=e[r[i++]];return n}return[]};ye.toObject=function(e){for(var r={},n=0;n<e.length;){var i=e[n++],s=e[n++];s!==void 0&&(r[i]=s)}return r};ye.isReserved=function(e){return qk.test(e)};ye.safeProp=function(e){return!/^[$\w_]+$/.test(e)||qk.test(e)?"["+JSON.stringify(e)+"]":"."+e};ye.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var nie=/_([a-z])/g;ye.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(nie,function(r,n){return n.toUpperCase()})};ye.compareFieldsById=function(e,r){return e.id-r.id};ye.decorateType=function(e,r){if(e.$type)return r&&e.$type.name!==r&&(ye.decorateRoot.remove(e.$type),e.$type.name=r,ye.decorateRoot.add(e.$type)),e.$type;HE||(HE=dd());var n=new HE(r||e.name);return ye.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var iie=0;ye.decorateEnum=function(e){if(e.$type)return e.$type;zE||(zE=ir());var r=new zE("Enum"+iie++,e);return ye.decorateRoot.add(r),Object.defineProperty(e,"$type",{value:r,enumerable:!1}),r};ye.setProperty=function(e,r,n,i){function s(o,a,c){var l=a.shift();if(ye.isUnsafeProperty(l))return o;if(a.length>0)o[l]=s(o[l]||{},a,c);else{var h=o[l];if(h&&i)return o;h&&(c=[].concat(h).concat(c)),o[l]=c}return o}if(typeof e!="object")throw TypeError("dst must be an object");if(!r)throw TypeError("path must be specified");if(r=r.split("."),r.length>ye.recursionLimit)throw Error("max depth exceeded");return s(e,r,n)};Object.defineProperty(ye,"decorateRoot",{get:function(){return Vk.decorated||(Vk.decorated=new(gd()))}})});var bi=m(Hk=>{"use strict";var Ya=Hk,sie=je(),oie=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function Ka(t,e){var r=0,n=Object.create(null);for(e|=0;r<t.length;)n[oie[r+e]]=t[r++];return n}Ya.basic=Ka([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Ya.defaults=Ka([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",sie.emptyArray,null]);Ya.long=Ka([0,0,0,1,1],7);Ya.mapKey=Ka([0,0,0,5,5,0,0,0,1,1,0,2],2);Ya.packed=Ka([1,5,0,0,0,5,5,0,0,0,1,1,0])});var Dn=m((pve,jk)=>{"use strict";jk.exports=$e;var Ja=Un();(($e.prototype=Object.create(Ja.prototype)).constructor=$e).className="Field";var zk=ir(),jE=bi(),Le=je(),Xa,aie=/^required|optional|repeated$/;$e.fromJSON=function(e,r){var n=new $e(e,r.id,r.type,r.rule,r.extend,r.options,r.comment);return r.edition&&(n._edition=r.edition),n._defaultEdition="proto3",n};function $e(t,e,r,n,i,s,o){if(Le.isObject(n)?(o=i,s=n,n=i=void 0):Le.isObject(i)&&(o=s,s=i,i=void 0),Ja.call(this,t,s),!Le.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Le.isString(r))throw TypeError("type must be a string");if(n!==void 0&&!aie.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(i!==void 0&&!Le.isString(i))throw TypeError("extend must be a string");n==="proto3_optional"&&(n="optional"),this.rule=n&&n!=="optional"?n:void 0,this.type=r,this.id=e,this.extend=i||void 0,this.repeated=n==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Le.Long?jE.long[r]!==void 0:!1,this.bytes=r==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=o}Object.defineProperty($e.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty($e.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty($e.prototype,"delimited",{get:function(){return this.resolvedType instanceof Xa&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty($e.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty($e.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});$e.prototype.setOption=function(e,r,n){return Ja.prototype.setOption.call(this,e,r,n)};$e.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Le.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",r?this.comment:void 0])};$e.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=jE.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof Xa?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof zk&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof zk)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Le.Long.fromNumber(this.typeDefault,this.type==="uint64"||this.type==="fixed64"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;Le.base64.test(this.typeDefault)?Le.base64.decode(this.typeDefault,e=Le.newBuffer(Le.base64.length(this.typeDefault)),0):Le.utf8.write(this.typeDefault,e=Le.newBuffer(Le.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=Le.emptyObject:this.repeated?this.defaultValue=Le.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof Xa&&(this.parent.ctor.prototype[this.name]=this.defaultValue),Ja.prototype.resolve.call(this)};$e.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var r={};if(this.rule==="required"&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&jE.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof Xa&&n.group&&(r.message_encoding="DELIMITED")}return this.getOption("packed")===!0?r.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(r.repeated_field_encoding="EXPANDED"),r};$e.prototype._resolveFeatures=function(e){return Ja.prototype._resolveFeatures.call(this,this._edition||e)};$e.d=function(e,r,n,i){return typeof r=="function"?r=Le.decorateType(r).name:r&&typeof r=="object"&&(r=Le.decorateEnum(r).name),function(o,a){Le.decorateType(o.constructor).add(new $e(a,e,r,n,{default:i}))}};$e._configure=function(e){Xa=e}});var Oi=m((mve,Yk)=>{"use strict";Yk.exports=Rt;var Ed=Un();((Rt.prototype=Object.create(Ed.prototype)).constructor=Rt).className="OneOf";var $k=Dn(),_d=je();function Rt(t,e,r,n){if(Array.isArray(e)||(r=e,e=void 0),Ed.call(this,t,r),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=n}Rt.fromJSON=function(e,r){return new Rt(e,r.oneof,r.options,r.comment)};Rt.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return _d.toObject(["options",this.options,"oneof",this.oneof,"comment",r?this.comment:void 0])};function Wk(t){if(t.parent)for(var e=0;e<t.fieldsArray.length;++e)t.fieldsArray[e].parent||t.parent.add(t.fieldsArray[e])}Rt.prototype.add=function(e){if(!(e instanceof $k))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,Wk(this),this};Rt.prototype.remove=function(e){if(!(e instanceof $k))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),r=this.oneof.indexOf(e.name),r>-1&&this.oneof.splice(r,1),e.partOf=null,this};Rt.prototype.onAdd=function(e){Ed.prototype.onAdd.call(this,e);for(var r=this,n=0;n<this.oneof.length;++n){var i=e.get(this.oneof[n]);i&&!i.partOf&&(i.partOf=r,r.fieldsArray.push(i))}Wk(this)};Rt.prototype.onRemove=function(e){for(var r=0,n;r<this.fieldsArray.length;++r)(n=this.fieldsArray[r]).parent&&n.parent.remove(n);Ed.prototype.onRemove.call(this,e)};Object.defineProperty(Rt.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var t=this.fieldsArray[0];return t.options!=null&&t.options.proto3_optional===!0}});Rt.d=function(){for(var e=new Array(arguments.length),r=0;r<arguments.length;)e[r]=arguments[r++];return function(i,s){_d.decorateType(i.constructor).add(new Rt(s,e)),Object.defineProperty(i,s,{get:_d.oneOfGetter(e),set:_d.oneOfSetter(e)})}}});var Un=m((gve,Kk)=>{"use strict";Kk.exports=Ze;Ze.className="ReflectionObject";var cie=Oi(),sr=je(),Sd,lie={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},uie={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},hie={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function Ze(t,e){if(!sr.isString(t))throw TypeError("name must be a string");if(e&&!sr.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=t,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(Ze.prototype,{root:{get:function(){for(var t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],e=this.parent;e;)t.unshift(e.name),e=e.parent;return t.join(".")}}});Ze.prototype.toJSON=function(){throw Error()};Ze.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof Sd&&r._handleAdd(this)};Ze.prototype.onRemove=function(e){var r=e.root;r instanceof Sd&&r._handleRemove(this),this.parent=null,this.resolved=!1};Ze.prototype.resolve=function(){return this.resolved?this:(this.root instanceof Sd&&(this.resolved=!0),this)};Ze.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};Ze.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var r={};if(!e)throw new Error("Unknown edition for "+this.fullName);var n=sr.merge({},this.options&&this.options.features,this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")r=Object.assign({},uie);else if(e==="proto3")r=Object.assign({},hie);else if(e==="2023")r=Object.assign({},lie);else throw new Error("Unknown edition: "+e);this._features=sr.merge(r,n),this._featuresResolved=!0;return}if(this.partOf instanceof cie){var i=sr.merge({},this.partOf._features);this._features=sr.merge(i,n)}else if(!this.declaringField)if(this.parent){var s=sr.merge({},this.parent._features);this._features=sr.merge(s,n)}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};Ze.prototype._inferLegacyProtoFeatures=function(){return{}};Ze.prototype.getOption=function(e){if(this.options)return this.options[e]};Ze.prototype.setOption=function(e,r,n){return e==="__proto__"?this:(this.options||(this.options={}),/^features\./.test(e)?sr.setProperty(this.options,e,r,n):(!n||this.options[e]===void 0)&&(this.getOption(e)!==r&&(this.resolved=!1),this.options[e]=r),this)};Ze.prototype.setParsedOption=function(e,r,n){if(e==="__proto__")return this;this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var s=i.find(function(c){return Object.prototype.hasOwnProperty.call(c,e)});if(s){var o=s[e];sr.setProperty(o,n,r)}else s={},s[e]=sr.setProperty({},n,r),i.push(s)}else{var a={};a[e]=r,i.push(a)}return this};Ze.prototype.setOptions=function(e,r){if(e)for(var n=Object.keys(e),i=0;i<n.length;++i)this.setOption(n[i],e[n[i]],r);return this};Ze.prototype.toString=function(){var e=this.constructor.className,r=this.fullName;return r.length?e+" "+r:e};Ze.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};Ze._configure=function(t){Sd=t}});var ir=m((_ve,Jk)=>{"use strict";Jk.exports=or;var $E=Un();((or.prototype=Object.create($E.prototype)).constructor=or).className="Enum";var Xk=Js(),eo=je();function or(t,e,r,n,i,s){if($E.call(this,t,r),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.valuesOptions=s,this._valuesFeatures={},this.reserved=void 0,e)for(var o=Object.keys(e),a=0;a<o.length;++a)o[a]!=="__proto__"&&typeof e[o[a]]=="number"&&(this.valuesById[this.values[o[a]]=e[o[a]]]=o[a])}or.prototype._resolveFeatures=function(e){return e=this._edition||e,$E.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(r=>{var n=eo.merge({},this._features);this._valuesFeatures[r]=eo.merge(n,this.valuesOptions&&this.valuesOptions[r]&&this.valuesOptions[r].features||{})}),this};or.fromJSON=function(e,r){var n=new or(e,r.values,r.options,r.comment,r.comments);return n.reserved=r.reserved,r.edition&&(n._edition=r.edition),n._defaultEdition="proto3",n};or.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return eo.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",r?this.comment:void 0,"comments",r?this.comments:void 0])};or.prototype.add=function(e,r,n,i){if(!eo.isString(e))throw TypeError("name must be a string");if(!eo.isInteger(r))throw TypeError("id must be an integer");if(e==="__proto__")return this;if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(r))throw Error("id "+r+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[r]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+r+" in "+this);this.values[e]=r}else this.valuesById[this.values[e]=r]=e;return i&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=i||null),this.comments[e]=n||null,this};or.prototype.remove=function(e){if(!eo.isString(e))throw TypeError("name must be a string");var r=this.values[e];if(r==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[r],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};or.prototype.isReservedId=function(e){return Xk.isReservedId(this.reserved,e)};or.prototype.isReservedName=function(e){return Xk.isReservedName(this.reserved,e)}});var BE=m((Eve,Zk)=>{"use strict";Zk.exports=fie;var die=ir(),WE=bi(),YE=je();function Qk(t,e,r,n){return e.delimited?t("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)",r,n,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()",r,n,(e.id<<3|2)>>>0)}function fie(t){for(var e=YE.codegen(["m","w","q"],t.name+"$encode")("if(!w)")("w=Writer.create()")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")'),r,n,i=t.fieldsArray.slice().sort(YE.compareFieldsById),r=0;r<i.length;++r){var s=i[r].resolve(),o=t._fieldsArray.indexOf(s),a=s.resolvedType instanceof die?"int32":s.type,c=WE.basic[a];n="m"+YE.safeProp(s.name),s.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,s.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(s.id<<3|2)>>>0,8|WE.mapKey[s.keyType],s.keyType),c===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()",o,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,a,n),e("}")("}")):s.repeated?(e("if(%s!=null&&%s.length){",n,n),s.packed&&WE.packed[a]!==void 0?e("w.uint32(%i).fork()",(s.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),c===void 0?Qk(e,s,o,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(s.id<<3|c)>>>0,a,n)),e("}")):(s.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,s.name),c===void 0?Qk(e,s,o,n):e("w.uint32(%i).%s(%s)",(s.id<<3|c)>>>0,a,n))}return e("return w")}});var tF=m((Sve,eF)=>{"use strict";var oe=eF.exports=ak();oe.build="light";function pie(t,e,r){return typeof e=="function"?(r=e,e=new oe.Root):e||(e=new oe.Root),e.load(t,r)}oe.load=pie;function mie(t,e){return e||(e=new oe.Root),e.loadSync(t)}oe.loadSync=mie;oe.encoder=BE();oe.decoder=ME();oe.verifier=PE();oe.converter=LE();oe.ReflectionObject=Un();oe.Namespace=Js();oe.Root=gd();oe.Enum=ir();oe.Type=dd();oe.Field=Dn();oe.OneOf=Oi();oe.MapField=od();oe.Service=cd();oe.Method=ad();oe.Message=ld();oe.wrappers=DE();oe.types=bi();oe.util=je();oe.ReflectionObject._configure(oe.Root);oe.Namespace._configure(oe.Type,oe.Service,oe.Enum);oe.Root._configure(oe.Type);oe.Field._configure(oe.Type)});var XE=m((Tve,iF)=>{"use strict";iF.exports=nF;var KE=/[\s{}=;:[\],'"()<>]/g,gie=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,_ie=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,Eie=/^ *[*/]+ */,Sie=/^\s*\*?\/*/,Tie=/\n/g,yie=/\s/,vie=/\\(.?)/g,Aie={0:"\0",r:"\r",n:`
|
|
53
|
-
`,t:" "};function rF(t){return t.replace(vie,function(e,r){switch(r){case"\\":case"":return r;default:return Aie[r]||""}})}nF.unescape=rF;function nF(t,e){t=t.toString();var r=0,n=t.length,i=1,s=0,o={},a=[],c=null;function l(v){return Error("illegal "+v+" (line "+i+")")}function h(){var v=c==="'"?_ie:gie;v.lastIndex=r-1;var w=v.exec(t);if(!w)throw l("string");return r=v.lastIndex,A(c),c=null,rF(w[1])}function d(v){return t.charAt(v)}function f(v,w,I){var V={type:t.charAt(v++),lineEmpty:!1,leading:I},q;e?q=2:q=3;var Y=v-q,F;do if(--Y<0||(F=t.charAt(Y))===`
|
|
54
|
-
`){V.lineEmpty=!0;break}while(F===" "||F===" ");for(var _=t.substring(v,w).split(Tie),de=0;de<_.length;++de)_[de]=_[de].replace(e?Sie:Eie,"").trim();V.text=_.join(`
|
|
55
|
-
`).trim(),o[i]=V,s=i}function p(v){var w=g(v),I=t.substring(v,w),V=/^\s*\/\//.test(I);return V}function g(v){for(var w=v;w<n&&d(w)!==`
|
|
56
|
-
`;)w++;return w}function S(){if(a.length>0)return a.shift();if(c)return h();var v,w,I,V,q,Y=r===0;do{if(r===n)return null;for(v=!1;yie.test(I=d(r));)if(I===`
|
|
57
|
-
`&&(Y=!0,++i),++r===n)return null;if(d(r)==="/"){if(++r===n)throw l("comment");if(d(r)==="/")if(e){if(V=r,q=!1,p(r-1)){q=!0;do if(r=g(r),r===n||(r++,!Y))break;while(p(r))}else r=Math.min(n,g(r)+1);q&&(f(V,r,Y),Y=!0),i++,v=!0}else{for(q=d(V=r+1)==="/";d(++r)!==`
|
|
58
|
-
`;)if(r===n)return null;++r,q&&(f(V,r-1,Y),Y=!0),++i,v=!0}else if((I=d(r))==="*"){V=r+1,q=e||d(V)==="*";do{if(I===`
|
|
59
|
-
`&&++i,++r===n)throw l("comment");w=I,I=d(r)}while(w!=="*"||I!=="/");++r,q&&(f(V,r-2,Y),Y=!0),v=!0}else return"/"}}while(v);var F=r;KE.lastIndex=0;var _=KE.test(d(F++));if(!_)for(;F<n&&!KE.test(d(F));)++F;var de=t.substring(r,r=F);return(de==='"'||de==="'")&&(c=de),de}function A(v){a.push(v)}function C(){if(!a.length){var v=S();if(v===null)return null;A(v)}return a[0]}function R(v,w){var I=C(),V=I===v;if(V)return S(),!0;if(!w)throw l("token '"+I+"', '"+v+"' expected");return!1}function M(v){var w=null,I;return v===void 0?(I=o[i-1],delete o[i-1],I&&(e||I.type==="*"||I.lineEmpty)&&(w=I.leading?I.text:null)):(s<v&&C(),I=o[v],delete o[v],I&&!I.lineEmpty&&(e||I.type==="/")&&(w=I.leading?null:I.text)),w}return Object.defineProperty({next:S,peek:C,push:A,skip:R,cmnt:M},"line",{get:function(){return i}})}});var uF=m((yve,lF)=>{"use strict";lF.exports=en;en.filename=null;en.defaults={keepCase:!1};var Cie=XE(),sF=gd(),oF=dd(),aF=Dn(),Rie=od(),cF=Oi(),Oie=ir(),bie=cd(),Mie=ad(),Nie=Un(),wie=bi(),Zr=je(),Pie=/^[1-9][0-9]*$/,xie=/^-?[1-9][0-9]*$/,Iie=/^0[x][0-9a-fA-F]+$/,Lie=/^-?0[x][0-9a-fA-F]+$/,Die=/^0[0-7]+$/,Uie=/^-?0[0-7]+$/,kie=Zr.patterns.numberRe,Mr=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Nr=Zr.patterns.typeRefRe;function en(t,e,r){e instanceof sF||(r=e,e=new sF),r||(r=en.defaults);var n=r.preferTrailingComment||!1,i=Cie(t,r.alternateCommentMode||!1),s=i.next,o=i.push,a=i.peek,c=i.skip,l=i.cmnt,h=!0,d,f,p,g="proto2",S=e,A=[],C={},R=r.keepCase?function(b){return b}:Zr.camelCase;function M(){A.forEach(b=>{b._edition=g,Object.keys(C).forEach(O=>{b.getOption(O)===void 0&&b.setOption(O,C[O],!0)})})}function v(b,O,N){var x=en.filename;return N||(en.filename=null),Error("illegal "+(O||"token")+" '"+b+"' ("+(x?x+", ":"")+"line "+i.line+")")}function w(){var b=[],O;do{if((O=s())!=='"'&&O!=="'")throw v(O);b.push(s()),c(O),O=a()}while(O==='"'||O==="'");return b.join("")}function I(b){var O=s();switch(O){case"'":case'"':return o(O),w();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return q(O,!0)}catch{if(b&&Nr.test(O))return O;throw v(O,"value")}}function V(b,O){var N,x;do if(O&&((N=a())==='"'||N==="'")){var K=w();if(b.push(K),g>=2023)throw v(K,"id")}else try{b.push([x=Y(s()),c("to",!0)?Y(s()):x])}catch(Z){if(O&&Nr.test(N)&&g>=2023)b.push(N);else throw Z}while(c(",",!0));var z={options:void 0};z.setOption=function(Z,De){this.options===void 0&&(this.options={}),this.options[Z]=De},y(z,function(De){if(De==="option")W(z,De),c(";");else throw v(De)},function(){ht(z)})}function q(b,O){var N=1;switch(b.charAt(0)==="-"&&(N=-1,b=b.substring(1)),b){case"inf":case"INF":case"Inf":return N*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(Pie.test(b))return N*parseInt(b,10);if(Iie.test(b))return N*parseInt(b,16);if(Die.test(b))return N*parseInt(b,8);if(kie.test(b))return N*parseFloat(b);throw v(b,"number",O)}function Y(b,O){switch(b){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!O&&b.charAt(0)==="-")throw v(b,"id");if(xie.test(b))return parseInt(b,10);if(Lie.test(b))return parseInt(b,16);if(Uie.test(b))return parseInt(b,8);throw v(b,"id")}function F(){if(d!==void 0)throw v("package");if(d=s(),!Nr.test(d))throw v(d,"name");S=S.define(d),c(";")}function _(){var b=a(),O;switch(b){case"weak":O=p||(p=[]),s();break;case"public":s();default:O=f||(f=[]);break}b=w(),c(";"),O.push(b)}function de(){if(c("="),g=w(),g<2023)throw v(g,"syntax");c(";")}function E(){if(c("="),g=w(),!["2023"].includes(g))throw v(g,"edition");c(";")}function u(b,O,N){switch(N===void 0&&(N=0),O){case"option":return W(b,O),c(";"),!0;case"message":return B(b,O,N+1),!0;case"enum":return fe(b,O),!0;case"service":return _3(b,O,N+1),!0;case"extend":return S3(b,O,N),!0}return!1}function y(b,O,N){var x=i.line;if(b&&(typeof b.comment!="string"&&(b.comment=l()),b.filename=en.filename),c("{",!0)){for(var K;(K=s())!=="}";)O(K);c(";",!0)}else N&&N(),c(";"),b&&(typeof b.comment!="string"||n)&&(b.comment=l(x)||b.comment)}function B(b,O,N){if(N===void 0&&(N=0),N>Zr.nestingLimit)throw Error("max depth exceeded");if(!Mr.test(O=s()))throw v(O,"type name");var x=new oF(O);y(x,function(z){if(!u(x,z,N))switch(z){case"map":X(x,z);break;case"required":if(g!=="proto2")throw v(z);case"repeated":G(x,z,void 0,N+1);break;case"optional":if(g==="proto3")G(x,"proto3_optional",void 0,N+1);else{if(g!=="proto2")throw v(z);G(x,"optional",void 0,N+1)}break;case"oneof":le(x,z,N+1);break;case"extensions":V(x.extensions||(x.extensions=[]));break;case"reserved":V(x.reserved||(x.reserved=[]),!0);break;default:if(g==="proto2"||!Nr.test(z))throw v(z);o(z),G(x,"optional",void 0,N+1);break}}),b.add(x),b===S&&A.push(x)}function G(b,O,N,x){var K=s();if(K==="group"){$(b,O,x);return}for(;K.endsWith(".")||a().startsWith(".");)K+=s();if(!Nr.test(K))throw v(K,"type");var z=s();if(!Mr.test(z))throw v(z,"name");z=R(z),c("=");var Z=new aF(z,Y(s()),K,O,N);if(y(Z,function(it){if(it==="option")W(Z,it),c(";");else throw v(it)},function(){ht(Z)}),O==="proto3_optional"){var De=new cF("_"+z);Z.setOption("proto3_optional",!0),De.add(Z),b.add(De)}else b.add(Z);b===S&&A.push(Z)}function $(b,O,N){if(N===void 0&&(N=0),N>Zr.nestingLimit)throw Error("max depth exceeded");if(g>=2023)throw v("group");var x=s();if(!Mr.test(x))throw v(x,"name");var K=Zr.lcFirst(x);x===K&&(x=Zr.ucFirst(x)),c("=");var z=Y(s()),Z=new oF(x);Z.group=!0;var De=new aF(K,z,x,O);De.filename=en.filename,y(Z,function(it){switch(it){case"option":W(Z,it),c(";");break;case"required":case"repeated":G(Z,it,void 0,N+1);break;case"optional":g==="proto3"?G(Z,"proto3_optional",void 0,N+1):G(Z,"optional",void 0,N+1);break;case"message":B(Z,it,N+1);break;case"enum":fe(Z,it);break;case"reserved":V(Z.reserved||(Z.reserved=[]),!0);break;default:throw v(it)}}),b.add(Z).add(De)}function X(b){c("<");var O=s();if(wie.mapKey[O]===void 0)throw v(O,"type");c(",");var N=s();if(!Nr.test(N))throw v(N,"type");c(">");var x=s();if(!Mr.test(x))throw v(x,"name");c("=");var K=new Rie(R(x),Y(s()),O,N);y(K,function(Z){if(Z==="option")W(K,Z),c(";");else throw v(Z)},function(){ht(K)}),b.add(K)}function le(b,O,N){if(!Mr.test(O=s()))throw v(O,"name");var x=new cF(R(O));y(x,function(z){z==="option"?(W(x,z),c(";")):(o(z),G(x,"optional",void 0,N))}),b.add(x)}function fe(b,O){if(!Mr.test(O=s()))throw v(O,"name");var N=new Oie(O);y(N,function(K){switch(K){case"option":W(N,K),c(";");break;case"reserved":V(N.reserved||(N.reserved=[]),!0),N.reserved===void 0&&(N.reserved=[]);break;default:ie(N,K)}}),b.add(N),b===S&&A.push(N)}function ie(b,O){if(!Mr.test(O))throw v(O,"name");c("=");var N=Y(s(),!0),x={options:void 0};x.getOption=function(K){return this.options[K]},x.setOption=function(K,z){Nie.prototype.setOption.call(x,K,z)},x.setParsedOption=function(){},y(x,function(z){if(z==="option")W(x,z),c(";");else throw v(z)},function(){ht(x)}),b.add(O,N,x.comment,x.parsedOptions||x.options)}function W(b,O){var N,x,K=!0;for(O==="option"&&(O=s());O!=="=";){if(O==="("){var z=s();c(")"),O="("+z+")"}if(K){if(K=!1,O.includes(".")&&!O.includes("(")){var Z=O.split(".");N=Z[0]+".",O=Z[1];continue}N=O}else x=x?x+=O:O;O=s()}var De=x?N.concat(x):N,dr=pe(b,De);x=x&&x[0]==="."?x.slice(1):x,N=N&&N[N.length-1]==="."?N.slice(0,-1):N,he(b,N,dr,x)}function pe(b,O,N){if(N===void 0&&(N=0),N>Zr.recursionLimit)throw Error("max depth exceeded");if(c("{",!0)){for(var x={};!c("}",!0);){if(!Mr.test(Ke=s()))throw v(Ke,"name");if(Ke===null)throw v(Ke,"end of input");var K,z=Ke;if(c(":",!0),a()==="{")K=pe(b,O+"."+Ke,N+1);else if(a()==="["){K=[];var Z;if(c("[",!0)){do Z=I(!0),K.push(Z);while(c(",",!0));c("]"),typeof Z<"u"&&J(b,O+"."+Ke,Z)}}else K=I(!0),J(b,O+"."+Ke,K);var De=x[z];De&&(K=[].concat(De).concat(K)),z!=="__proto__"&&(x[z]=K),c(",",!0),c(";",!0)}return x}var dr=I(!0);return J(b,O,dr),dr}function J(b,O,N){if(S===b&&/^features\./.test(O)){C[O]=N;return}b.setOption&&b.setOption(O,N)}function he(b,O,N,x){b.setParsedOption&&b.setParsedOption(O,N,x)}function ht(b){if(c("[",!0)){do W(b,"option");while(c(",",!0));c("]")}return b}function _3(b,O,N){if(N===void 0&&(N=0),N>Zr.recursionLimit)throw Error("max depth exceeded");if(!Mr.test(O=s()))throw v(O,"service name");var x=new bie(O);y(x,function(z){if(!u(x,z,N))if(z==="rpc")E3(x,z);else throw v(z)}),b.add(x),b===S&&A.push(x)}function E3(b,O){var N=l(),x=O;if(!Mr.test(O=s()))throw v(O,"name");var K=O,z,Z,De,dr;if(c("("),c("stream",!0)&&(Z=!0),!Nr.test(O=s())||(z=O,c(")"),c("returns"),c("("),c("stream",!0)&&(dr=!0),!Nr.test(O=s())))throw v(O);De=O,c(")");var it=new Mie(K,x,z,De,Z,dr);it.comment=N,y(it,function(Wf){if(Wf==="option")W(it,Wf),c(";");else throw v(Wf)}),b.add(it)}function S3(b,O,N){if(!Nr.test(O=s()))throw v(O,"reference");var x=O;y(null,function(z){switch(z){case"required":case"repeated":G(b,z,x,N+1);break;case"optional":g==="proto3"?G(b,"proto3_optional",x,N+1):G(b,"optional",x,N+1);break;default:if(g==="proto2"||!Nr.test(z))throw v(z);o(z),G(b,"optional",x,N+1);break}})}for(var Ke;(Ke=s())!==null;)switch(Ke){case"package":if(!h)throw v(Ke);F();break;case"import":if(!h)throw v(Ke);_();break;case"syntax":if(!h)throw v(Ke);de();break;case"edition":if(!h)throw v(Ke);E();break;case"option":W(S,Ke),c(";",!0);break;default:if(u(S,Ke,0)){h=!1;continue}throw v(Ke)}return M(),en.filename=null,{package:d,imports:f,weakImports:p,root:e}}});var fF=m((vve,dF)=>{"use strict";dF.exports=ar;var Fie=/\/|\./;function ar(t,e){Fie.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),ar[t]=e}ar("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var hF;ar("duration",{Duration:hF={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});ar("timestamp",{Timestamp:hF});ar("empty",{Empty:{fields:{}}});ar("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});ar("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});ar("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});ar.get=function(e){return ar[e]||null}});var mF=m((Ave,pF)=>{"use strict";var kn=pF.exports=tF();kn.build="full";kn.tokenize=XE();kn.parse=uF();kn.common=fF();kn.Root._configure(kn.Type,kn.parse,kn.common)});var Td=m((Cve,gF)=>{"use strict";gF.exports=mF()});var JE=m((Rve,Bie)=>{Bie.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var CF=m((ee,AF)=>{"use strict";var ct=Td();AF.exports=ee=ct.descriptor=ct.Root.fromJSON(JE()).lookup(".google.protobuf");var _F=ct.Namespace,Qa=ct.Root,tn=ct.Enum,cr=ct.Type,Fn=ct.Field,Vie=ct.MapField,yd=ct.OneOf,Za=ct.Service,vd=ct.Method,EF=ct.util.patterns,qie=EF.numberRe,Ad=EF.typeRefRe;Qa.fromDescriptor=function(e){typeof e.length=="number"&&(e=ee.FileDescriptorSet.decode(e));var r=new Qa;if(e.file)for(var n,i,s=0,o;s<e.file.length;++s){i=r,(n=e.file[s]).package&&n.package.length&&(i=r.define(n.package));var a=Xie(n);if(n.name&&n.name.length&&r.files.push(i.filename=n.name),n.messageType)for(o=0;o<n.messageType.length;++o)i.add(cr.fromDescriptor(n.messageType[o],a));if(n.enumType)for(o=0;o<n.enumType.length;++o)i.add(tn.fromDescriptor(n.enumType[o],a));if(n.extension)for(o=0;o<n.extension.length;++o)i.add(Fn.fromDescriptor(n.extension[o],a));if(n.service)for(o=0;o<n.service.length;++o)i.add(Za.fromDescriptor(n.service[o],a));var c=to(n.options,ee.FileOptions);if(c){var l=Object.keys(c);for(o=0;o<l.length;++o)i.setOption(l[o],c[l[o]])}}return r.resolveAll()};Qa.prototype.toDescriptor=function(e){var r=ee.FileDescriptorSet.create();return SF(this,r.file,e),r};function SF(t,e,r){var n=ee.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});Jie(r,n),t instanceof Qa||(n.package=t.fullName.substring(1));for(var i=0,s;i<t.nestedArray.length;++i)(s=t._nestedArray[i])instanceof cr?n.messageType.push(s.toDescriptor(r)):s instanceof tn?n.enumType.push(s.toDescriptor()):s instanceof Fn?n.extension.push(s.toDescriptor(r)):s instanceof Za?n.service.push(s.toDescriptor()):s instanceof _F&&SF(s,e,r);n.options=ro(t.options,ee.FileOptions),n.messageType.length+n.enumType.length+n.extension.length+n.service.length&&e.push(n)}var Gie=0;cr.fromDescriptor=function(e,r,n,i){if(i===void 0&&(i=0),i>ct.util.nestingLimit)throw Error("max depth exceeded");typeof e.length=="number"&&(e=ee.DescriptorProto.decode(e));var s=new cr(e.name.length?e.name:"Type"+Gie++,to(e.options,ee.MessageOptions)),o;if(n||(s._edition=r),e.oneofDecl)for(o=0;o<e.oneofDecl.length;++o)s.add(yd.fromDescriptor(e.oneofDecl[o]));if(e.field)for(o=0;o<e.field.length;++o){var a=Fn.fromDescriptor(e.field[o],r,!0);s.add(a),e.field[o].hasOwnProperty("oneofIndex")&&s.oneofsArray[e.field[o].oneofIndex].add(a)}if(e.extension)for(o=0;o<e.extension.length;++o)s.add(Fn.fromDescriptor(e.extension[o],r,!0));if(e.nestedType)for(o=0;o<e.nestedType.length;++o)s.add(cr.fromDescriptor(e.nestedType[o],r,!0,i+1)),e.nestedType[o].options&&e.nestedType[o].options.mapEntry&&s.setOption("map_entry",!0);if(e.enumType)for(o=0;o<e.enumType.length;++o)s.add(tn.fromDescriptor(e.enumType[o],r,!0));if(e.extensionRange&&e.extensionRange.length)for(s.extensions=[],o=0;o<e.extensionRange.length;++o)s.extensions.push([e.extensionRange[o].start,e.extensionRange[o].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(s.reserved=[],e.reservedRange)for(o=0;o<e.reservedRange.length;++o)s.reserved.push([e.reservedRange[o].start,e.reservedRange[o].end]);if(e.reservedName)for(o=0;o<e.reservedName.length;++o)s.reserved.push(e.reservedName[o])}return s};cr.prototype.toDescriptor=function(e){var r=ee.DescriptorProto.create({name:this.name}),n;for(n=0;n<this.fieldsArray.length;++n){var i;if(r.field.push(i=this._fieldsArray[n].toDescriptor(e)),this._fieldsArray[n]instanceof Vie){var s=QE(this._fieldsArray[n].keyType,this._fieldsArray[n].resolvedKeyType,!1),o=QE(this._fieldsArray[n].type,this._fieldsArray[n].resolvedType,!1),a=o===11||o===14?this._fieldsArray[n].resolvedType&&vF(this.parent,this._fieldsArray[n].resolvedType)||this._fieldsArray[n].type:void 0;r.nestedType.push(ee.DescriptorProto.create({name:i.typeName,field:[ee.FieldDescriptorProto.create({name:"key",number:1,label:1,type:s}),ee.FieldDescriptorProto.create({name:"value",number:2,label:1,type:o,typeName:a})],options:ee.MessageOptions.create({mapEntry:!0})}))}}for(n=0;n<this.oneofsArray.length;++n)r.oneofDecl.push(this._oneofsArray[n].toDescriptor());for(n=0;n<this.nestedArray.length;++n)this._nestedArray[n]instanceof Fn?r.field.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof cr?r.nestedType.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof tn&&r.enumType.push(this._nestedArray[n].toDescriptor());if(this.extensions)for(n=0;n<this.extensions.length;++n)r.extensionRange.push(ee.DescriptorProto.ExtensionRange.create({start:this.extensions[n][0],end:this.extensions[n][1]}));if(this.reserved)for(n=0;n<this.reserved.length;++n)typeof this.reserved[n]=="string"?r.reservedName.push(this.reserved[n]):r.reservedRange.push(ee.DescriptorProto.ReservedRange.create({start:this.reserved[n][0],end:this.reserved[n][1]}));return r.options=ro(this.options,ee.MessageOptions),r};Fn.fromDescriptor=function(e,r,n){if(typeof e.length=="number"&&(e=ee.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var i=e.typeName,s;if(i!=null&&i!==""){if(typeof i!="string"||!Ad.test(i))throw Error("illegal type name: "+i);s=i}else s=Wie(e.type);var o;switch(e.label){case 1:o=void 0;break;case 2:o="required";break;case 3:o="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;if(a!=null&&a!==""){if(typeof a!="string"||!Ad.test(a))throw Error("illegal type name: "+a)}else a=void 0;var c=new Fn(e.name.length?e.name:"field"+e.number,e.number,s,o,a);if(n||(c._edition=r),c.options=to(e.options,ee.FieldOptions),e.proto3_optional&&(c.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var h=qie.exec(l);h&&(l=parseInt(l));break}c.setOption("default",l)}return Yie(e.type)&&(r==="proto3"?e.options&&!e.options.packed&&c.setOption("packed",!1):(!r||r==="proto2")&&e.options&&e.options.packed&&c.setOption("packed",!0)),c};Fn.prototype.toDescriptor=function(e){var r=ee.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=ct.util.ucFirst(this.name),r.label=3;else{switch(r.type=QE(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?vF(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?r.label=3:this.required&&e==="proto2"?r.label=2:r.label=1}if(r.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&this.parent instanceof cr&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(r.options=ro(this.options,ee.FieldOptions),this.options.default!=null&&(r.defaultValue=String(this.options.default)),this.options.proto3_optional&&(r.proto3_optional=!0)),e==="proto3"?this.packed||((r.options||(r.options=ee.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((r.options||(r.options=ee.FieldOptions.create())).packed=!0),r};var Hie=0;tn.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=ee.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var s=0;s<e.value.length;++s){var o=e.value[s].name,a=e.value[s].number||0;i[o&&o.length?o:"NAME"+a]=a}var c=new tn(e.name&&e.name.length?e.name:"Enum"+Hie++,i,to(e.options,ee.EnumOptions));return n||(c._edition=r),c};tn.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(ee.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return ee.EnumDescriptorProto.create({name:this.name,value:e,options:ro(this.options,ee.EnumOptions)})};var zie=0;yd.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ee.OneofDescriptorProto.decode(e)),new yd(e.name&&e.name.length?e.name:"oneof"+zie++)};yd.prototype.toDescriptor=function(){return ee.OneofDescriptorProto.create({name:this.name})};var jie=0;Za.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=ee.ServiceDescriptorProto.decode(e));var i=new Za(e.name&&e.name.length?e.name:"Service"+jie++,to(e.options,ee.ServiceOptions));if(n||(i._edition=r),e.method)for(var s=0;s<e.method.length;++s)i.add(vd.fromDescriptor(e.method[s]));return i};Za.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return ee.ServiceDescriptorProto.create({name:this.name,method:e,options:ro(this.options,ee.ServiceOptions)})};var $ie=0;vd.fromDescriptor=function(e){typeof e.length=="number"&&(e=ee.MethodDescriptorProto.decode(e));var r=e.inputType,n=e.outputType;if(r!=null&&r!==""&&(typeof r!="string"||!Ad.test(r)))throw Error("illegal type name: "+r);if(n!=null&&n!==""&&(typeof n!="string"||!Ad.test(n)))throw Error("illegal type name: "+n);return new vd(e.name&&e.name.length?e.name:"Method"+$ie++,"rpc",r,n,!!e.clientStreaming,!!e.serverStreaming,to(e.options,ee.MethodOptions))};vd.prototype.toDescriptor=function(){return ee.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:ro(this.options,ee.MethodOptions)})};function Wie(t){switch(t){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+t)}function Yie(t){switch(t){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function QE(t,e,r){switch(t){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof tn)return 14;if(e instanceof cr)return r?10:11;throw Error("illegal type: "+t)}function TF(t,e){for(var r={},n=0,i,s;n<e.fieldsArray.length;++n)if((s=(i=e._fieldsArray[n]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(t,s)){var o=Kie(s);i.resolvedType instanceof cr?r[o]=TF(t[s],i.resolvedType):i.resolvedType instanceof tn?r[o]=i.resolvedType.valuesById[t[s]]:r[o]=t[s]}return r}function to(t,e){if(t)return TF(e.toObject(t),e)}function yF(t,e){for(var r={},n=Object.keys(t),i=0;i<n.length;++i){var s=n[i],o=ct.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(e.fields,o)){var a=e.fields[o];a.resolvedType instanceof cr?r[o]=yF(t[s],a.resolvedType):r[o]=t[s],a.repeated&&!Array.isArray(r[o])&&(r[o]=[r[o]])}}return r}function ro(t,e){if(t)return e.fromObject(yF(t,e))}function vF(t,e){var r=t.fullName.split("."),n=e.fullName.split("."),i=0,s=0,o=n.length-1;if(!(t instanceof Qa)&&e instanceof _F)for(;i<r.length&&s<o&&r[i]===n[s];){var a=e.lookup(r[i++],!0);if(a!==null&&a!==e)break;++s}else for(;i<r.length&&s<o&&r[i]===n[s];++i,++s);return n.slice(s).join(".")}function Kie(t){return t.substring(0,1)+t.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,r){return"_"+r.toLowerCase()})}function Xie(t){if(t.syntax==="editions")switch(t.edition){case ee.Edition.EDITION_2023:return"2023";default:throw new Error("Unsupported edition "+t.edition)}return t.syntax==="proto3"?"proto3":"proto2"}function Jie(t,e){if(t)if(t==="proto2"||t==="proto3")e.syntax=t;else switch(e.syntax="editions",t){case"2023":e.edition=ee.Edition.EDITION_2023;break;default:throw new Error("Unsupported edition "+t)}}});var RF=m((Ove,Qie)=>{Qie.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var OF=m((bve,Zie)=>{Zie.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var bF=m((Mve,ese)=>{ese.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var PF=m(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.addCommonProtos=Bn.loadProtosWithOptionsSync=Bn.loadProtosWithOptions=void 0;var MF=L("fs"),NF=L("path"),no=Td();function wF(t,e){let r=t.resolvePath;t.resolvePath=(n,i)=>{if(NF.isAbsolute(i))return i;for(let s of e){let o=NF.join(s,i);try{return MF.accessSync(o,MF.constants.R_OK),o}catch{continue}}return process.emitWarning(`${i} not found in any of the include paths ${e}`),r(n,i)}}async function tse(t,e){let r=new no.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));wF(r,e.includeDirs)}let n=await r.load(t,e);return n.resolveAll(),n}Bn.loadProtosWithOptions=tse;function rse(t,e){let r=new no.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");wF(r,e.includeDirs)}let n=r.loadSync(t,e);return n.resolveAll(),n}Bn.loadProtosWithOptionsSync=rse;function nse(){let t=RF(),e=JE(),r=OF(),n=bF();no.common("api",t.nested.google.nested.protobuf.nested),no.common("descriptor",e.nested.google.nested.protobuf.nested),no.common("source_context",r.nested.google.nested.protobuf.nested),no.common("type",n.nested.google.nested.protobuf.nested)}Bn.addCommonProtos=nse});var LF=m((IF,ZE)=>{"use strict";var xF=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(E,u,y){this.low=E|0,this.high=u|0,this.unsigned=!!y}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n(E){return(E&&E.__isLong__)===!0}function i(E){var u=Math.clz32(E&-E);return E?31-u:u}r.isLong=n;var s={},o={};function a(E,u){var y,B,G;return u?(E>>>=0,(G=0<=E&&E<256)&&(B=o[E],B)?B:(y=l(E,0,!0),G&&(o[E]=y),y)):(E|=0,(G=-128<=E&&E<128)&&(B=s[E],B)?B:(y=l(E,E<0?-1:0,!1),G&&(s[E]=y),y))}r.fromInt=a;function c(E,u){if(isNaN(E))return u?v:M;if(u){if(E<0)return v;if(E>=A)return Y}else{if(E<=-C)return F;if(E+1>=C)return q}return E<0?c(-E,u).neg():l(E%S|0,E/S|0,u)}r.fromNumber=c;function l(E,u,y){return new r(E,u,y)}r.fromBits=l;var h=Math.pow;function d(E,u,y){if(E.length===0)throw Error("empty string");if(typeof u=="number"?(y=u,u=!1):u=!!u,E==="NaN"||E==="Infinity"||E==="+Infinity"||E==="-Infinity")return u?v:M;if(y=y||10,y<2||36<y)throw RangeError("radix");var B;if((B=E.indexOf("-"))>0)throw Error("interior hyphen");if(B===0)return d(E.substring(1),u,y).neg();for(var G=c(h(y,8)),$=M,X=0;X<E.length;X+=8){var le=Math.min(8,E.length-X),fe=parseInt(E.substring(X,X+le),y);if(le<8){var ie=c(h(y,le));$=$.mul(ie).add(c(fe))}else $=$.mul(G),$=$.add(c(fe))}return $.unsigned=u,$}r.fromString=d;function f(E,u){return typeof E=="number"?c(E,u):typeof E=="string"?d(E,u):l(E.low,E.high,typeof u=="boolean"?u:E.unsigned)}r.fromValue=f;var p=65536,g=1<<24,S=p*p,A=S*S,C=A/2,R=a(g),M=a(0);r.ZERO=M;var v=a(0,!0);r.UZERO=v;var w=a(1);r.ONE=w;var I=a(1,!0);r.UONE=I;var V=a(-1);r.NEG_ONE=V;var q=l(-1,2147483647,!1);r.MAX_VALUE=q;var Y=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=Y;var F=l(0,-2147483648,!1);r.MIN_VALUE=F;var _=r.prototype;_.toInt=function(){return this.unsigned?this.low>>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*S+(this.low>>>0):this.high*S+(this.low>>>0)},_.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(F)){var y=c(u),B=this.div(y),G=B.mul(y).sub(this);return B.toString(u)+G.toInt().toString(u)}else return"-"+this.neg().toString(u);for(var $=c(h(u,6),this.unsigned),X=this,le="";;){var fe=X.div($),ie=X.sub(fe.mul($)).toInt()>>>0,W=ie.toString(u);if(X=fe,X.isZero())return W+le;for(;W.length<6;)W="0"+W;le=""+W+le}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(F)?64:this.neg().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,y=31;y>0&&!(u&1<<y);y--);return this.high!=0?y+33:y+1},_.isZero=function(){return this.high===0&&this.low===0},_.eqz=_.isZero,_.isNegative=function(){return!this.unsigned&&this.high<0},_.isPositive=function(){return this.unsigned||this.high>=0},_.isOdd=function(){return(this.low&1)===1},_.isEven=function(){return(this.low&1)===0},_.equals=function(u){return n(u)||(u=f(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},_.eq=_.equals,_.notEquals=function(u){return!this.eq(u)},_.neq=_.notEquals,_.ne=_.notEquals,_.lessThan=function(u){return this.comp(u)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(u){return this.comp(u)<=0},_.lte=_.lessThanOrEqual,_.le=_.lessThanOrEqual,_.greaterThan=function(u){return this.comp(u)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(u){return this.comp(u)>=0},_.gte=_.greaterThanOrEqual,_.ge=_.greaterThanOrEqual,_.compare=function(u){if(n(u)||(u=f(u)),this.eq(u))return 0;var y=this.isNegative(),B=u.isNegative();return y&&!B?-1:!y&&B?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.sub(u).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(F)?F:this.not().add(w)},_.neg=_.negate,_.add=function(u){n(u)||(u=f(u));var y=this.high>>>16,B=this.high&65535,G=this.low>>>16,$=this.low&65535,X=u.high>>>16,le=u.high&65535,fe=u.low>>>16,ie=u.low&65535,W=0,pe=0,J=0,he=0;return he+=$+ie,J+=he>>>16,he&=65535,J+=G+fe,pe+=J>>>16,J&=65535,pe+=B+le,W+=pe>>>16,pe&=65535,W+=y+X,W&=65535,l(J<<16|he,W<<16|pe,this.unsigned)},_.subtract=function(u){return n(u)||(u=f(u)),this.add(u.neg())},_.sub=_.subtract,_.multiply=function(u){if(this.isZero())return this;if(n(u)||(u=f(u)),e){var y=e.mul(this.low,this.high,u.low,u.high);return l(y,e.get_high(),this.unsigned)}if(u.isZero())return this.unsigned?v:M;if(this.eq(F))return u.isOdd()?F:M;if(u.eq(F))return this.isOdd()?F:M;if(this.isNegative())return u.isNegative()?this.neg().mul(u.neg()):this.neg().mul(u).neg();if(u.isNegative())return this.mul(u.neg()).neg();if(this.lt(R)&&u.lt(R))return c(this.toNumber()*u.toNumber(),this.unsigned);var B=this.high>>>16,G=this.high&65535,$=this.low>>>16,X=this.low&65535,le=u.high>>>16,fe=u.high&65535,ie=u.low>>>16,W=u.low&65535,pe=0,J=0,he=0,ht=0;return ht+=X*W,he+=ht>>>16,ht&=65535,he+=$*W,J+=he>>>16,he&=65535,he+=X*ie,J+=he>>>16,he&=65535,J+=G*W,pe+=J>>>16,J&=65535,J+=$*ie,pe+=J>>>16,J&=65535,J+=X*fe,pe+=J>>>16,J&=65535,pe+=B*W+G*ie+$*fe+X*le,pe&=65535,l(he<<16|ht,pe<<16|J,this.unsigned)},_.mul=_.multiply,_.divide=function(u){if(n(u)||(u=f(u)),u.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&u.low===-1&&u.high===-1)return this;var y=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,u.low,u.high);return l(y,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?v:M;var B,G,$;if(this.unsigned){if(u.unsigned||(u=u.toUnsigned()),u.gt(this))return v;if(u.gt(this.shru(1)))return I;$=v}else{if(this.eq(F)){if(u.eq(w)||u.eq(V))return F;if(u.eq(F))return w;var X=this.shr(1);return B=X.div(u).shl(1),B.eq(M)?u.isNegative()?w:V:(G=this.sub(u.mul(B)),$=B.add(G.div(u)),$)}else if(u.eq(F))return this.unsigned?v:M;if(this.isNegative())return u.isNegative()?this.neg().div(u.neg()):this.neg().div(u).neg();if(u.isNegative())return this.div(u.neg()).neg();$=M}for(G=this;G.gte(u);){B=Math.max(1,Math.floor(G.toNumber()/u.toNumber()));for(var le=Math.ceil(Math.log(B)/Math.LN2),fe=le<=48?1:h(2,le-48),ie=c(B),W=ie.mul(u);W.isNegative()||W.gt(G);)B-=fe,ie=c(B,this.unsigned),W=ie.mul(u);ie.isZero()&&(ie=w),$=$.add(ie),G=G.sub(W)}return $},_.div=_.divide,_.modulo=function(u){if(n(u)||(u=f(u)),e){var y=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,u.low,u.high);return l(y,e.get_high(),this.unsigned)}return this.sub(this.div(u).mul(u))},_.mod=_.modulo,_.rem=_.modulo,_.not=function(){return l(~this.low,~this.high,this.unsigned)},_.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},_.clz=_.countLeadingZeros,_.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},_.ctz=_.countTrailingZeros,_.and=function(u){return n(u)||(u=f(u)),l(this.low&u.low,this.high&u.high,this.unsigned)},_.or=function(u){return n(u)||(u=f(u)),l(this.low|u.low,this.high|u.high,this.unsigned)},_.xor=function(u){return n(u)||(u=f(u)),l(this.low^u.low,this.high^u.high,this.unsigned)},_.shiftLeft=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?l(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):l(0,this.low<<u-32,this.unsigned)},_.shl=_.shiftLeft,_.shiftRight=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?l(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):l(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?l(this.low>>>u|this.high<<32-u,this.high>>>u,this.unsigned):u===32?l(this.high,0,this.unsigned):l(this.high>>>u-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.shr_u=_.shiftRightUnsigned,_.rotateLeft=function(u){var y;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?l(this.high,this.low,this.unsigned):u<32?(y=32-u,l(this.low<<u|this.high>>>y,this.high<<u|this.low>>>y,this.unsigned)):(u-=32,y=32-u,l(this.high<<u|this.low>>>y,this.low<<u|this.high>>>y,this.unsigned))},_.rotl=_.rotateLeft,_.rotateRight=function(u){var y;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?l(this.high,this.low,this.unsigned):u<32?(y=32-u,l(this.high<<y|this.low>>>u,this.low<<y|this.high>>>u,this.unsigned)):(u-=32,y=32-u,l(this.low<<y|this.high>>>u,this.high<<y|this.low>>>u,this.unsigned))},_.rotr=_.rotateRight,_.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},_.toBytes=function(u){return u?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var u=this.high,y=this.low;return[y&255,y>>>8&255,y>>>16&255,y>>>24,u&255,u>>>8&255,u>>>16&255,u>>>24]},_.toBytesBE=function(){var u=this.high,y=this.low;return[u>>>24,u>>>16&255,u>>>8&255,u&255,y>>>24,y>>>16&255,y>>>8&255,y&255]},r.fromBytes=function(u,y,B){return B?r.fromBytesLE(u,y):r.fromBytesBE(u,y)},r.fromBytesLE=function(u,y){return new r(u[0]|u[1]<<8|u[2]<<16|u[3]<<24,u[4]|u[5]<<8|u[6]<<16|u[7]<<24,y)},r.fromBytesBE=function(u,y){return new r(u[4]<<24|u[5]<<16|u[6]<<8|u[7],u[0]<<24|u[1]<<16|u[2]<<8|u[3],y)};var de=r;return t.default=de,"default"in t?t.default:t}({});typeof define=="function"&&define.amd?define([],function(){return xF}):typeof ZE=="object"&&typeof IF=="object"&&(ZE.exports=xF)});var sS=m(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.loadFileDescriptorSetFromObject=Be.loadFileDescriptorSetFromBuffer=Be.fromJSON=Be.loadSync=Be.load=Be.IdempotencyLevel=Be.isAnyExtension=Be.Long=void 0;var ise=d2(),wr=Td(),nS=CF(),iS=PF(),sse=LF();Be.Long=sse;function ose(t){return"@type"in t&&typeof t["@type"]=="string"}Be.isAnyExtension=ose;var DF;(function(t){t.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",t.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",t.IDEMPOTENT="IDEMPOTENT"})(DF=Be.IdempotencyLevel||(Be.IdempotencyLevel={}));var UF={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function ase(t,e){return t===""?e:t+"."+e}function cse(t){return t instanceof wr.Service||t instanceof wr.Type||t instanceof wr.Enum}function lse(t){return t instanceof wr.Namespace||t instanceof wr.Root}function kF(t,e){let r=ase(e,t.name);return cse(t)?[[r,t]]:lse(t)&&typeof t.nested<"u"?Object.keys(t.nested).map(n=>kF(t.nested[n],r)).reduce((n,i)=>n.concat(i),[]):[]}function eS(t,e){return function(n){return t.toObject(t.decode(n),e)}}function tS(t){return function(r){if(Array.isArray(r))throw new Error(`Failed to serialize message: expected object with ${t.name} structure, got array instead`);let n=t.fromObject(r);return t.encode(n).finish()}}function use(t){return(t||[]).reduce((e,r)=>{for(let[n,i]of Object.entries(r))switch(n){case"uninterpreted_option":e.uninterpreted_option.push(r.uninterpreted_option);break;default:e[n]=i}return e},{deprecated:!1,idempotency_level:DF.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function hse(t,e,r,n){let i=t.resolvedRequestType,s=t.resolvedResponseType;return{path:"/"+e+"/"+t.name,requestStream:!!t.requestStream,responseStream:!!t.responseStream,requestSerialize:tS(i),requestDeserialize:eS(i,r),responseSerialize:tS(s),responseDeserialize:eS(s,r),originalName:ise(t.name),requestType:rS(i,r,n),responseType:rS(s,r,n),options:use(t.parsedOptions)}}function dse(t,e,r,n){let i={};for(let s of t.methodsArray)i[s.name]=hse(s,e,r,n);return i}function rS(t,e,r){let n=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:n.$type.toObject(n,UF),fileDescriptorProtos:r,serialize:tS(t),deserialize:eS(t,e)}}function fse(t,e){let r=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:r.$type.toObject(r,UF),fileDescriptorProtos:e}}function pse(t,e,r,n){if(t instanceof wr.Service)return dse(t,e,r,n);if(t instanceof wr.Type)return rS(t,r,n);if(t instanceof wr.Enum)return fse(t,n);throw new Error("Type mismatch in reflection object handling")}function Cd(t,e){let r={};t.resolveAll();let i=t.toDescriptor("proto3").file.map(s=>Buffer.from(nS.FileDescriptorProto.encode(s).finish()));for(let[s,o]of kF(t,""))r[s]=pse(o,s,e,i);return r}function FF(t,e){e=e||{};let r=wr.Root.fromDescriptor(t);return r.resolveAll(),Cd(r,e)}function mse(t,e){return(0,iS.loadProtosWithOptions)(t,e).then(r=>Cd(r,e))}Be.load=mse;function gse(t,e){let r=(0,iS.loadProtosWithOptionsSync)(t,e);return Cd(r,e)}Be.loadSync=gse;function _se(t,e){e=e||{};let r=wr.Root.fromJSON(t);return r.resolveAll(),Cd(r,e)}Be.fromJSON=_se;function Ese(t,e){let r=nS.FileDescriptorSet.decode(t);return FF(r,e)}Be.loadFileDescriptorSetFromBuffer=Ese;function Sse(t,e){let r=nS.FileDescriptorSet.fromObject(t);return FF(r,e)}Be.loadFileDescriptorSetFromObject=Sse;(0,iS.addCommonProtos)()});var Vn=m(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.registerChannelzSocket=Te.registerChannelzServer=Te.registerChannelzSubchannel=Te.registerChannelzChannel=Te.ChannelzCallTrackerStub=Te.ChannelzCallTracker=Te.ChannelzChildrenTrackerStub=Te.ChannelzChildrenTracker=Te.ChannelzTrace=Te.ChannelzTraceStub=void 0;Te.unregisterChannelzRef=Cse;Te.getChannelzHandlers=$F;Te.getChannelzServiceDefinition=WF;Te.setup=Dse;var Od=L("net"),Ni=(DU(),Xe(LU)),ec=at(),tc=te(),Tse=Et(),yse=zh(),vse=Kh();function oS(t){return{channel_id:t.id,name:t.name}}function hS(t){return{subchannel_id:t.id,name:t.name}}function Ase(t){return{server_id:t.id}}function Nd(t){return{socket_id:t.id,name:t.name}}var BF=32,dS=100,aS=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Pr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Te.ChannelzTraceStub=aS;var cS=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,r,n){let i=new Date;this.events.push({description:r,severity:e,timestamp:i,childChannel:n?.kind==="channel"?n:void 0,childSubchannel:n?.kind==="subchannel"?n:void 0}),this.events.length>=BF*2&&(this.events=this.events.slice(BF)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Pr(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Pr(e.timestamp),channel_ref:e.childChannel?oS(e.childChannel):null,subchannel_ref:e.childSubchannel?hS(e.childSubchannel):null}))}}};Te.ChannelzTrace=cS;var bd=class{constructor(){this.channelChildren=new Ni.OrderedMap,this.subchannelChildren=new Ni.OrderedMap,this.socketChildren=new Ni.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let r=this.trackerMap[e.kind],n=r.find(e.id);n.equals(r.end())?r.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let r=this.trackerMap[e.kind],n=r.getElementByKey(e.id);n!==void 0&&(n.count-=1,n.count===0&&r.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Te.ChannelzChildrenTracker=bd;var lS=class extends bd{refChild(){}unrefChild(){}};Te.ChannelzChildrenTrackerStub=lS;var Md=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Te.ChannelzCallTracker=Md;var uS=class extends Md{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Te.ChannelzCallTrackerStub=uS;var rn={channel:new Ni.OrderedMap,subchannel:new Ni.OrderedMap,server:new Ni.OrderedMap,socket:new Ni.OrderedMap},wd=t=>{let e=1;function r(){return e++}let n=rn[t];return(i,s,o)=>{let a=r(),c={id:a,name:i,kind:t};return o&&n.setElement(a,{ref:c,getInfo:s}),c}};Te.registerChannelzChannel=wd("channel");Te.registerChannelzSubchannel=wd("subchannel");Te.registerChannelzServer=wd("server");Te.registerChannelzSocket=wd("socket");function Cse(t){rn[t.kind].eraseElementByKey(t.id)}function Rse(t){let e=Number.parseInt(t,16);return[e/256|0,e%256]}function VF(t){if(t==="")return[];let e=t.split(":").map(n=>Rse(n));return[].concat(...e)}function Ose(t){return(0,Od.isIPv6)(t)&&t.toLowerCase().startsWith("::ffff:")&&(0,Od.isIPv4)(t.substring(7))}function qF(t){return Buffer.from(Uint8Array.from(t.split(".").map(e=>Number.parseInt(e))))}function bse(t){if((0,Od.isIPv4)(t))return qF(t);if(Ose(t))return qF(t.substring(7));if((0,Od.isIPv6)(t)){let e,r,n=t.indexOf("::");n===-1?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+2));let i=Buffer.from(VF(e)),s=Buffer.from(VF(r)),o=Buffer.alloc(16-i.length-s.length,0);return Buffer.concat([i,o,s])}else return null}function HF(t){switch(t){case ec.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case ec.ConnectivityState.IDLE:return{state:"IDLE"};case ec.ConnectivityState.READY:return{state:"READY"};case ec.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case ec.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Pr(t){if(!t)return null;let e=t.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function zF(t){let e=t.getInfo(),r=[],n=[];return e.children.channels.forEach(i=>{r.push(oS(i[1].ref))}),e.children.subchannels.forEach(i=>{n.push(hS(i[1].ref))}),{ref:oS(t.ref),data:{target:e.target,state:HF(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Pr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:r,subchannel_ref:n}}function Mse(t,e){let r=parseInt(t.request.channel_id,10),n=rn.channel.getElementByKey(r);if(n===void 0){e({code:tc.Status.NOT_FOUND,details:"No channel data found for id "+r});return}e(null,{channel:zF(n)})}function Nse(t,e){let r=parseInt(t.request.max_results,10)||dS,n=[],i=parseInt(t.request.start_channel_id,10),s=rn.channel,o;for(o=s.lowerBound(i);!o.equals(s.end())&&n.length<r;o=o.next())n.push(zF(o.pointer[1]));e(null,{channel:n,end:o.equals(s.end())})}function jF(t){let e=t.getInfo(),r=[];return e.listenerChildren.sockets.forEach(n=>{r.push(Nd(n[1].ref))}),{ref:Ase(t.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Pr(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:r}}function wse(t,e){let r=parseInt(t.request.server_id,10),i=rn.server.getElementByKey(r);if(i===void 0){e({code:tc.Status.NOT_FOUND,details:"No server data found for id "+r});return}e(null,{server:jF(i)})}function Pse(t,e){let r=parseInt(t.request.max_results,10)||dS,n=parseInt(t.request.start_server_id,10),i=rn.server,s=[],o;for(o=i.lowerBound(n);!o.equals(i.end())&&s.length<r;o=o.next())s.push(jF(o.pointer[1]));e(null,{server:s,end:o.equals(i.end())})}function xse(t,e){let r=parseInt(t.request.subchannel_id,10),n=rn.subchannel.getElementByKey(r);if(n===void 0){e({code:tc.Status.NOT_FOUND,details:"No subchannel data found for id "+r});return}let i=n.getInfo(),s=[];i.children.sockets.forEach(a=>{s.push(Nd(a[1].ref))});let o={ref:hS(n.ref),data:{target:i.target,state:HF(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:Pr(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:s};e(null,{subchannel:o})}function GF(t){var e;return(0,Tse.isTcpSubchannelAddress)(t)?{address:"tcpip_address",tcpip_address:{ip_address:(e=bse(t.host))!==null&&e!==void 0?e:void 0,port:t.port}}:{address:"uds_address",uds_address:{filename:t.path}}}function Ise(t,e){var r,n,i,s,o;let a=parseInt(t.request.socket_id,10),c=rn.socket.getElementByKey(a);if(c===void 0){e({code:tc.Status.NOT_FOUND,details:"No socket data found for id "+a});return}let l=c.getInfo(),h=l.security?{model:"tls",tls:{cipher_suite:l.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(r=l.security.cipherSuiteStandardName)!==null&&r!==void 0?r:void 0,other_name:(n=l.security.cipherSuiteOtherName)!==null&&n!==void 0?n:void 0,local_certificate:(i=l.security.localCertificate)!==null&&i!==void 0?i:void 0,remote_certificate:(s=l.security.remoteCertificate)!==null&&s!==void 0?s:void 0}}:null,d={ref:Nd(c.ref),local:l.localAddress?GF(l.localAddress):null,remote:l.remoteAddress?GF(l.remoteAddress):null,remote_name:(o=l.remoteName)!==null&&o!==void 0?o:void 0,security:h,data:{keep_alives_sent:l.keepAlivesSent,streams_started:l.streamsStarted,streams_succeeded:l.streamsSucceeded,streams_failed:l.streamsFailed,last_local_stream_created_timestamp:Pr(l.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Pr(l.lastRemoteStreamCreatedTimestamp),messages_received:l.messagesReceived,messages_sent:l.messagesSent,last_message_received_timestamp:Pr(l.lastMessageReceivedTimestamp),last_message_sent_timestamp:Pr(l.lastMessageSentTimestamp),local_flow_control_window:l.localFlowControlWindow?{value:l.localFlowControlWindow}:null,remote_flow_control_window:l.remoteFlowControlWindow?{value:l.remoteFlowControlWindow}:null}};e(null,{socket:d})}function Lse(t,e){let r=parseInt(t.request.server_id,10),n=rn.server.getElementByKey(r);if(n===void 0){e({code:tc.Status.NOT_FOUND,details:"No server data found for id "+r});return}let i=parseInt(t.request.start_socket_id,10),s=parseInt(t.request.max_results,10)||dS,a=n.getInfo().sessionChildren.sockets,c=[],l;for(l=a.lowerBound(i);!l.equals(a.end())&&c.length<s;l=l.next())c.push(Nd(l.pointer[1].ref));e(null,{socket_ref:c,end:l.equals(a.end())})}function $F(){return{GetChannel:Mse,GetTopChannels:Nse,GetServer:wse,GetServers:Pse,GetSubchannel:xse,GetSocket:Ise,GetServerSockets:Lse}}var Rd=null;function WF(){if(Rd)return Rd;let t=sS().loadSync,e=t("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return Rd=(0,vse.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,Rd}function Dse(){(0,yse.registerAdminService)(WF,$F)}});var Pd=m(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});fS.getNextCallNumber=kse;var Use=0;function kse(){return Use++}});var pS=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.CompressionAlgorithms=void 0;var YF;(function(t){t[t.identity=0]="identity",t[t.deflate=1]="deflate",t[t.gzip=2]="gzip"})(YF||(xd.CompressionAlgorithms=YF={}))});var gS=m(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.BaseFilter=void 0;var mS=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};Id.BaseFilter=mS});var yS=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.CompressionFilterFactory=so.CompressionFilter=void 0;var Ld=L("zlib"),XF=pS(),qn=te(),Fse=gS(),Bse=Ee(),Vse=t=>typeof t=="number"&&typeof XF.CompressionAlgorithms[t]=="string",io=class{async writeMessage(e,r){let n=e;r&&(n=await this.compressMessage(n));let i=Buffer.allocUnsafe(n.length+5);return i.writeUInt8(r?1:0,0),i.writeUInt32BE(n.length,1),n.copy(i,5),i}async readMessage(e){let r=e.readUInt8(0)===1,n=e.slice(5);return r&&(n=await this.decompressMessage(n)),n}},wi=class extends io{async compressMessage(e){return e}async writeMessage(e,r){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},_S=class extends io{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{Ld.deflate(e,(i,s)=>{i?n(i):r(s)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,s=[],o=Ld.createInflate();o.on("error",a=>{n({code:qn.Status.INTERNAL,details:"Failed to decompress deflate-encoded message"})}),o.on("data",a=>{s.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(o.destroy(),n({code:qn.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{r(Buffer.concat(s))}),o.write(e),o.end()})}},ES=class extends io{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{Ld.gzip(e,(i,s)=>{i?n(i):r(s)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,s=[],o=Ld.createGunzip();o.on("error",a=>{n({code:qn.Status.INTERNAL,details:"Failed to decompress gzip-encoded message"})}),o.on("data",a=>{s.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(o.destroy(),n({code:qn.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),o.on("end",()=>{r(Buffer.concat(s))}),o.write(e),o.end()})}},SS=class extends io{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function KF(t,e){switch(t){case"identity":return new wi;case"deflate":return new _S(e);case"gzip":return new ES(e);default:return new SS(t)}}var Dd=class extends Fse.BaseFilter{constructor(e,r){var n,i,s;super(),this.sharedFilterConfig=r,this.sendCompression=new wi,this.receiveCompression=new wi,this.currentCompressionAlgorithm="identity";let o=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(n=e["grpc.max_receive_message_length"])!==null&&n!==void 0?n:qn.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(i=e["grpc.max_send_message_length"])!==null&&i!==void 0?i:qn.DEFAULT_MAX_SEND_MESSAGE_LENGTH,o!==void 0)if(Vse(o)){let a=XF.CompressionAlgorithms[o],c=(s=r.serverSupportedEncodingHeader)===null||s===void 0?void 0:s.split(",");(!c||c.includes(a))&&(this.currentCompressionAlgorithm=a,this.sendCompression=KF(this.currentCompressionAlgorithm,-1))}else Bse.log(qn.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${o}`)}async sendMetadata(e){let r=await e;return r.set("grpc-accept-encoding","identity,deflate,gzip"),r.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?r.remove("grpc-encoding"):r.set("grpc-encoding",this.currentCompressionAlgorithm),r}receiveMetadata(e){let r=e.get("grpc-encoding");if(r.length>0){let i=r[0];typeof i=="string"&&(this.receiveCompression=KF(i,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let n=e.get("grpc-accept-encoding")[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new wi,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var r;let n=await e;if(this.maxSendMessageLength!==-1&&n.message.length>this.maxSendMessageLength)throw{code:qn.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return this.sendCompression instanceof wi?i=!1:i=(((r=n.flags)!==null&&r!==void 0?r:0)&2)===0,{message:await this.sendCompression.writeMessage(n.message,i),flags:n.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};so.CompressionFilter=Dd;var TS=class{constructor(e,r){this.options=r,this.sharedFilterConfig={}}createFilter(){return new Dd(this.options,this.sharedFilterConfig)}};so.CompressionFilterFactory=TS});var rc=m(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});vS.restrictControlPlaneStatusCode=Gse;var xr=te(),qse=[xr.Status.OK,xr.Status.INVALID_ARGUMENT,xr.Status.NOT_FOUND,xr.Status.ALREADY_EXISTS,xr.Status.FAILED_PRECONDITION,xr.Status.ABORTED,xr.Status.OUT_OF_RANGE,xr.Status.DATA_LOSS];function Gse(t,e){return qse.includes(t)?{code:xr.Status.INTERNAL,details:`Invalid status from control plane: ${t} ${xr.Status[t]} ${e}`}:{code:t,details:e}}});var oo=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.minDeadline=Hse;Pi.getDeadlineTimeoutString=jse;Pi.getRelativeTimeout=Wse;Pi.deadlineToString=Yse;Pi.formatDateDifference=Kse;function Hse(...t){let e=1/0;for(let r of t){let n=r instanceof Date?r.getTime():r;n<e&&(e=n)}return e}var zse=[["m",1],["S",1e3],["M",60*1e3],["H",60*60*1e3]];function jse(t){let e=new Date().getTime();t instanceof Date&&(t=t.getTime());let r=Math.max(t-e,0);for(let[n,i]of zse){let s=r/i;if(s<1e8)return String(Math.ceil(s))+n}throw new Error("Deadline is too far in the future")}var $se=2147483647;function Wse(t){let e=t instanceof Date?t.getTime():t,r=new Date().getTime(),n=e-r;return n<0?0:n>$se?1/0:n}function Yse(t){if(t instanceof Date)return t.toISOString();{let e=new Date(t);return Number.isNaN(e.getTime())?""+t:e.toISOString()}}function Kse(t,e){return((e.getTime()-t.getTime())/1e3).toFixed(3)+"s"}});var kd=m(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.FilterStackFactory=ao.FilterStack=void 0;var Ud=class{constructor(e){this.filters=e}sendMetadata(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMetadata(r);return r}receiveMetadata(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMetadata(r);return r}sendMessage(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMessage(r);return r}receiveMessage(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMessage(r);return r}receiveTrailers(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveTrailers(r);return r}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};ao.FilterStack=Ud;var AS=class t{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new t([...this.factories])}createFilter(){return new Ud(this.factories.map(e=>e.createFilter()))}};ao.FilterStackFactory=AS});var JF=m(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.SingleSubchannelChannel=void 0;var Xse=Pd(),nc=Vn(),Jse=yS(),Qse=at(),ic=te(),Zse=rc(),eoe=oo(),toe=kd(),CS=He(),roe=Xt(),Fd=ot(),RS=class{constructor(e,r,n,i,s){var o,a;this.subchannel=e,this.method=r,this.options=i,this.callNumber=s,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let c=this.method.split("/"),l="";c.length>=2&&(l=c[1]);let h=(a=(o=(0,Fd.splitHostPort)(this.options.host))===null||o===void 0?void 0:o.host)!==null&&a!==void 0?a:"localhost";this.serviceUrl=`https://${h}/${l}`;let d=(0,eoe.getRelativeTimeout)(i.deadline);d!==1/0&&(d<=0?this.cancelWithStatus(ic.Status.DEADLINE_EXCEEDED,"Deadline exceeded"):setTimeout(()=>{this.cancelWithStatus(ic.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},d)),this.filterStack=n.createFilter()}cancelWithStatus(e,r){this.childCall?this.childCall.cancelWithStatus(e,r):this.pendingStatus={code:e,details:r,metadata:new CS.Metadata}}getPeer(){var e,r;return(r=(e=this.childCall)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.subchannel.getAddress()}async start(e,r){if(this.pendingStatus){r.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==Qse.ConnectivityState.READY){r.onReceiveStatus({code:ic.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new CS.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),i;try{i=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(o){let a=o,{code:c,details:l}=(0,Zse.restrictControlPlaneStatusCode)(typeof a.code=="number"?a.code:ic.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${a.message}`);r.onReceiveStatus({code:c,details:l,metadata:new CS.Metadata});return}i.merge(n);let s={onReceiveMetadata:async o=>{r.onReceiveMetadata(await this.filterStack.receiveMetadata(o))},onReceiveMessage:async o=>{this.readFilterPending=!0;let a=await this.filterStack.receiveMessage(o);this.readFilterPending=!1,r.onReceiveMessage(a),this.pendingStatus&&r.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async o=>{let a=await this.filterStack.receiveTrailers(o);this.readFilterPending?this.pendingStatus=a:r.onReceiveStatus(a)}};this.childCall=this.subchannel.createCall(i,this.options.host,this.method,s),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,r){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw new Error("Method not implemented.")}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}},OS=class{constructor(e,r,n){this.subchannel=e,this.target=r,this.channelzEnabled=!1,this.channelzTrace=new nc.ChannelzTrace,this.callTracker=new nc.ChannelzCallTracker,this.childrenTracker=new nc.ChannelzChildrenTracker,this.channelzEnabled=n["grpc.enable_channelz"]!==0,this.channelzRef=(0,nc.registerChannelzChannel)((0,Fd.uriToString)(r),()=>({target:`${(0,Fd.uriToString)(r)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new toe.FilterStackFactory([new Jse.CompressionFilterFactory(this,n)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,nc.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,Fd.uriToString)(this.target)}getConnectivityState(e){throw new Error("Method not implemented.")}watchConnectivityState(e,r,n){throw new Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(e,r){let n={deadline:r,host:(0,roe.getDefaultAuthority)(this.target),flags:ic.Propagate.DEFAULTS,parentCall:null};return new RS(this.subchannel,e,this.filterStackFactory,n,(0,Xse.getNextCallNumber)())}};Bd.SingleSubchannelChannel=OS});var QF=m(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.Subchannel=void 0;var me=at(),noe=Vs(),bS=Ee(),Vd=te(),ioe=ot(),soe=Et(),Ir=Vn(),ooe=JF(),aoe="subchannel",coe=~(1<<31),MS=class{constructor(e,r,n,i,s){var o;this.channelTarget=e,this.subchannelAddress=r,this.options=n,this.connector=s,this.connectivityState=me.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let a={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new noe.BackoffTimeout(()=>{this.handleBackoffTimer()},a),this.backoffTimeout.unref(),this.subchannelAddressString=(0,soe.subchannelAddressToString)(r),this.keepaliveTime=(o=n["grpc.keepalive_time_ms"])!==null&&o!==void 0?o:-1,n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Ir.ChannelzTraceStub,this.callTracker=new Ir.ChannelzCallTrackerStub,this.childrenTracker=new Ir.ChannelzChildrenTrackerStub,this.streamTracker=new Ir.ChannelzCallTrackerStub):(this.channelzTrace=new Ir.ChannelzTrace,this.callTracker=new Ir.ChannelzCallTracker,this.childrenTracker=new Ir.ChannelzChildrenTracker,this.streamTracker=new Ir.ChannelzCallTracker),this.channelzRef=(0,Ir.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(n,void 0,2)),this.secureConnector=i._createSecureConnector(e,n)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){bS.trace(Vd.LogVerbosity.DEBUG,aoe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){bS.trace(Vd.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([me.ConnectivityState.TRANSIENT_FAILURE],me.ConnectivityState.CONNECTING):this.transitionToState([me.ConnectivityState.TRANSIENT_FAILURE],me.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let r=Math.min(this.keepaliveTime,coe);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":r})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(r=>{this.transitionToState([me.ConnectivityState.CONNECTING],me.ConnectivityState.READY)?(this.transport=r,this.channelzEnabled&&this.childrenTracker.refChild(r.getChannelzRef()),r.addDisconnectListener(n=>{this.transitionToState([me.ConnectivityState.READY],me.ConnectivityState.IDLE),n&&this.keepaliveTime>0&&(this.keepaliveTime*=2,bS.log(Vd.LogVerbosity.ERROR,`Connection to ${(0,ioe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):r.shutdown()},r=>{this.transitionToState([me.ConnectivityState.CONNECTING],me.ConnectivityState.TRANSIENT_FAILURE,`${r}`)})}transitionToState(e,r,n){var i,s;if(e.indexOf(this.connectivityState)===-1)return!1;n?this.trace(me.ConnectivityState[this.connectivityState]+" -> "+me.ConnectivityState[r]+' with error "'+n+'"'):this.trace(me.ConnectivityState[this.connectivityState]+" -> "+me.ConnectivityState[r]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+me.ConnectivityState[r]);let o=this.connectivityState;switch(this.connectivityState=r,r){case me.ConnectivityState.READY:this.stopBackoff();break;case me.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case me.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)===null||i===void 0||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case me.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(s=this.transport)===null||s===void 0||s.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${r}`)}for(let a of this.stateListeners)a(this,o,r,this.keepaliveTime,n);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,Ir.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([me.ConnectivityState.CONNECTING,me.ConnectivityState.READY],me.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,r,n,i){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let s;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),s={onCallEnd:o=>{o.code===Vd.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):s={},this.transport.createCall(e,r,n,i,s)}startConnecting(){process.nextTick(()=>{this.transitionToState([me.ConnectivityState.IDLE],me.ConnectivityState.CONNECTING)||this.connectivityState===me.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([me.ConnectivityState.TRANSIENT_FAILURE],me.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||(this.subchannelChannel=new ooe.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw new Error("Not implemented")}getOrCreateDataProducer(e,r){let n=this.dataProducers.get(e);if(n)return n;let i=r(this);return this.dataProducers.set(e,i),i}removeDataProducer(e){this.dataProducers.delete(e)}};qd.Subchannel=MS});var ZF=m(Gd=>{"use strict";var NS;Object.defineProperty(Gd,"__esModule",{value:!0});Gd.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;Gd.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((NS=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&NS!==void 0?NS:"false")==="true"});var IS=m(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.DEFAULT_PORT=void 0;xi.setup=goe;var eB=Xt(),wS=L("dns"),loe=b_(),PS=te(),co=Ti(),uoe=He(),hoe=Ee(),doe=te(),Gn=ot(),tB=L("net"),foe=Vs(),rB=ZF(),poe="dns_resolver";function Lr(t){hoe.trace(doe.LogVerbosity.DEBUG,poe,t)}xi.DEFAULT_PORT=443;var moe=3e4,xS=class{constructor(e,r,n){var i,s,o;this.target=e,this.listener=r,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new wS.promises.Resolver,Lr("Resolver constructed for target "+(0,Gn.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let a=(0,Gn.splitHostPort)(e.path);a===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,tB.isIPv4)(a.host)||(0,tB.isIPv6)(a.host)?(this.ipResult=[{addresses:[{host:a.host,port:(i=a.port)!==null&&i!==void 0?i:xi.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=a.host,this.port=(s=a.port)!==null&&s!==void 0?s:xi.DEFAULT_PORT),this.percentage=Math.random()*100,n["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:PS.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,Gn.uriToString)(this.target)}`,metadata:new uoe.Metadata};let c={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoff=new foe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(o=n["grpc.dns_min_time_between_resolutions_ms"])!==null&&o!==void 0?o:moe,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(Lr("Returning IP address for target "+(0,Gn.uriToString)(this.target)),setImmediate(()=>{this.listener((0,co.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)Lr("Failed to parse DNS address "+(0,Gn.uriToString)(this.target)),setImmediate(()=>{this.listener((0,co.statusOrFromError)({code:PS.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,Gn.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;Lr("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(r=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,co.statusOrFromValue)(r.map(s=>({addresses:[s]})));let n="["+r.map(s=>s.host+":"+s.port).join(",")+"]";Lr("Resolved addresses for target "+(0,Gn.uriToString)(this.target)+": "+n);let i=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(i)},r=>{this.pendingLookupPromise!==null&&(Lr("Resolution error for target "+(0,Gn.uriToString)(this.target)+": "+r.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,co.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,""))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(r=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let n;try{n=(0,loe.extractAndSelectServiceConfig)(r,this.percentage),n?this.latestServiceConfigResult=(0,co.statusOrFromValue)(n):this.latestServiceConfigResult=null}catch(i){this.latestServiceConfigResult=(0,co.statusOrFromError)({code:PS.Status.UNAVAILABLE,details:`Parsing service config failed with error ${i.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},r=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(rB.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){Lr("Using alternative DNS resolver.");let n=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(n.every(i=>i.status==="rejected"))throw new Error(n[0].reason);return n.reduce((i,s)=>s.status==="fulfilled"?[...i,...s.value]:i,[]).map(i=>({host:i,port:+this.port}))}return(await wS.promises.lookup(e,{all:!0})).map(n=>({host:n.address,port:+this.port}))}async resolveTxt(e){return rB.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(Lr("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):wS.promises.resolveTxt(e)}startNextResolutionTimer(){var e,r;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(r=(e=this.nextResolutionTimer).unref)===null||r===void 0||r.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?Lr('resolution update delayed by "min time between resolutions" rate limit'):Lr("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function goe(){(0,eB.registerResolver)("dns",xS),(0,eB.registerDefaultScheme)("dns")}});var LS=m(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.parseCIDR=sB;ac.mapProxyName=Ooe;ac.getProxiedConnection=boe;var sc=Ee(),lo=te(),iB=L("net"),_oe=L("http"),Eoe=Ee(),nB=Et(),oc=ot(),Soe=L("url"),Toe=IS(),yoe="proxy";function uo(t){Eoe.trace(lo.LogVerbosity.DEBUG,yoe,t)}function voe(){let t="",e="";if(process.env.grpc_proxy)e="grpc_proxy",t=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",t=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",t=process.env.http_proxy;else return{};let r;try{r=new Soe.URL(t)}catch{return(0,sc.log)(lo.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(r.protocol!=="http:")return(0,sc.log)(lo.LogVerbosity.ERROR,`"${r.protocol}" scheme not supported in proxy URI`),{};let n=null;r.username&&(r.password?((0,sc.log)(lo.LogVerbosity.INFO,"userinfo found in proxy URI"),n=decodeURIComponent(`${r.username}:${r.password}`)):n=r.username);let i=r.hostname,s=r.port;s===""&&(s="80");let o={address:`${i}:${s}`};return n&&(o.creds=n),uo("Proxy server "+o.address+" set by environment variable "+e),o}function Aoe(){let t=process.env.no_grpc_proxy,e="no_grpc_proxy";return t||(t=process.env.no_proxy,e="no_proxy"),t?(uo("No proxy server list set by environment variable "+e),t.split(",")):[]}function sB(t){let e=t.split("/");if(e.length!==2)return null;let r=parseInt(e[1],10);return!(0,iB.isIPv4)(e[0])||Number.isNaN(r)||r<0||r>32?null:{ip:oB(e[0]),prefixLength:r}}function oB(t){return t.split(".").reduce((e,r)=>(e<<8)+parseInt(r,10),0)}function Coe(t,e){let r=t.ip,n=-1<<32-t.prefixLength;return(oB(e)&n)===(r&n)}function Roe(t){for(let e of Aoe()){let r=sB(e);if((0,iB.isIPv4)(t)&&r&&Coe(r,t))return!0;if(t.endsWith(e))return!0}return!1}function Ooe(t,e){var r;let n={target:t,extraOptions:{}};if(((r=e["grpc.enable_http_proxy"])!==null&&r!==void 0?r:1)===0||t.scheme==="unix")return n;let i=voe();if(!i.address)return n;let s=(0,oc.splitHostPort)(t.path);if(!s)return n;let o=s.host;if(Roe(o))return uo("Not using proxy for target in no_proxy list: "+(0,oc.uriToString)(t)),n;let a={"grpc.http_connect_target":(0,oc.uriToString)(t)};return i.creds&&(a["grpc.http_connect_creds"]=i.creds),{target:{scheme:"dns",path:i.address},extraOptions:a}}function boe(t,e){var r;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let n=e["grpc.http_connect_target"],i=(0,oc.parseUri)(n);if(i===null)return Promise.resolve(null);let s=(0,oc.splitHostPort)(i.path);if(s===null)return Promise.resolve(null);let o=`${s.host}:${(r=s.port)!==null&&r!==void 0?r:Toe.DEFAULT_PORT}`,a={method:"CONNECT",path:o},c={Host:o};(0,nB.isTcpSubchannelAddress)(t)?(a.host=t.host,a.port=t.port):a.socketPath=t.path,"grpc.http_connect_creds"in e&&(c["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),a.headers=c;let l=(0,nB.subchannelAddressToString)(t);return uo("Using proxy "+l+" to connect to "+a.path),new Promise((h,d)=>{let f=_oe.request(a);f.once("connect",(p,g,S)=>{f.removeAllListeners(),g.removeAllListeners(),p.statusCode===200?(uo("Successfully connected to "+a.path+" through proxy "+l),S.length>0&&g.unshift(S),uo("Successfully established a plaintext connection to "+a.path+" through proxy "+l),h(g)):((0,sc.log)(lo.LogVerbosity.ERROR,"Failed to connect to "+a.path+" through proxy "+l+" with status "+p.statusCode),d())}),f.once("error",p=>{f.removeAllListeners(),(0,sc.log)(lo.LogVerbosity.ERROR,"Failed to connect to proxy "+l+" with error "+p.message),d()}),f.end()})}});var US=m(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.StreamDecoder=void 0;var Dr;(function(t){t[t.NO_DATA=0]="NO_DATA",t[t.READING_SIZE=1]="READING_SIZE",t[t.READING_MESSAGE=2]="READING_MESSAGE"})(Dr||(Dr={}));var DS=class{constructor(e){this.maxReadMessageLength=e,this.readState=Dr.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let r=0,n,i=[];for(;r<e.length;)switch(this.readState){case Dr.NO_DATA:this.readCompressFlag=e.slice(r,r+1),r+=1,this.readState=Dr.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case Dr.READING_SIZE:if(n=Math.min(e.length-r,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,r,r+n),this.readSizeRemaining-=n,r+=n,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=Dr.READING_MESSAGE;else{let s=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=Dr.NO_DATA,i.push(s)}}break;case Dr.READING_MESSAGE:if(n=Math.min(e.length-r,this.readMessageRemaining),this.readPartialMessage.push(e.slice(r,r+n)),this.readMessageRemaining-=n,r+=n,this.readMessageRemaining===0){let s=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),o=Buffer.concat(s,this.readMessageSize+5);this.readState=Dr.NO_DATA,i.push(o)}break;default:throw new Error("Unexpected read state")}return i}};Hd.StreamDecoder=DS});var aB=m(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.Http2SubchannelCall=void 0;var nn=L("http2"),Moe=L("os"),ge=te(),sn=He(),Noe=US(),woe=Ee(),Poe=te(),xoe="subchannel_call";function Ioe(t){for(let[e,r]of Object.entries(Moe.constants.errno))if(r===t)return e;return"Unknown system error "+t}function kS(t){let e=`Received HTTP status code ${t}`,r;switch(t){case 400:r=ge.Status.INTERNAL;break;case 401:r=ge.Status.UNAUTHENTICATED;break;case 403:r=ge.Status.PERMISSION_DENIED;break;case 404:r=ge.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:r=ge.Status.UNAVAILABLE;break;default:r=ge.Status.UNKNOWN}return{code:r,details:e,metadata:new sn.Metadata}}var FS=class{constructor(e,r,n,i,s){var o;this.http2Stream=e,this.callEventTracker=r,this.listener=n,this.transport=i,this.callId=s,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let a=(o=i.getOptions()["grpc.max_receive_message_length"])!==null&&o!==void 0?o:ge.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Noe.StreamDecoder(a),e.on("response",(c,l)=>{let h="";for(let d of Object.keys(c))h+=" "+d+": "+c[d]+`
|
|
60
|
-
`;if(this.trace(`Received server headers:
|
|
61
|
-
`+h),this.httpStatusCode=c[":status"],l&nn.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(c);else{let d;try{d=sn.Metadata.fromHttp2Headers(c)}catch(f){this.endCall({code:ge.Status.UNKNOWN,details:f.message,metadata:new sn.Metadata});return}this.listener.onReceiveMetadata(d)}}),e.on("trailers",c=>{this.handleTrailers(c)}),e.on("data",c=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+c.length);let l;try{l=this.decoder.write(c)}catch(h){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let d=kS(this.httpStatusCode);this.cancelWithStatus(d.code,d.details)}else this.cancelWithStatus(ge.Status.RESOURCE_EXHAUSTED,h.message);return}for(let h of l)this.trace("parsed message of length "+h.length),this.callEventTracker.addMessageReceived(),this.tryPush(h)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var c;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((c=this.finalStatus)===null||c===void 0?void 0:c.code)===ge.Status.OK)return;let l,h="";switch(e.rstCode){case nn.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let d=kS(this.httpStatusCode);l=d.code,h=d.details}else l=ge.Status.INTERNAL,h=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case nn.constants.NGHTTP2_REFUSED_STREAM:l=ge.Status.UNAVAILABLE,h="Stream refused by server";break;case nn.constants.NGHTTP2_CANCEL:this.connectionDropped?(l=ge.Status.UNAVAILABLE,h="Connection dropped"):(l=ge.Status.CANCELLED,h="Call cancelled");break;case nn.constants.NGHTTP2_ENHANCE_YOUR_CALM:l=ge.Status.RESOURCE_EXHAUSTED,h="Bandwidth exhausted or memory limit exceeded";break;case nn.constants.NGHTTP2_INADEQUATE_SECURITY:l=ge.Status.PERMISSION_DENIED,h="Protocol not secure enough";break;case nn.constants.NGHTTP2_INTERNAL_ERROR:l=ge.Status.INTERNAL,this.internalError===null?h=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(l=ge.Status.UNAVAILABLE,h=this.internalError.message):h=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:l=ge.Status.INTERNAL,h=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:l,details:h,metadata:new sn.Metadata,rstCode:e.rstCode})})}),e.on("error",c=>{c.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+c.message+" code="+c.code+" errno="+Ioe(c.errno)+" syscall="+c.syscall),this.internalError=c),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:ge.Status.UNAVAILABLE,details:"Connection dropped",metadata:new sn.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){woe.trace(Poe.LogVerbosity.DEBUG,xoe,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===ge.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==ge.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let r="";for(let o of Object.keys(e))r+=" "+o+": "+e[o]+`
|
|
62
|
-
`;this.trace(`Received server trailers:
|
|
63
|
-
`+r);let n;try{n=sn.Metadata.fromHttp2Headers(e)}catch{n=new sn.Metadata}let i=n.getMap(),s;if(typeof i["grpc-status"]=="string"){let o=Number(i["grpc-status"]);this.trace("received status code "+o+" from server"),n.remove("grpc-status");let a="";if(typeof i["grpc-message"]=="string"){try{a=decodeURI(i["grpc-message"])}catch{a=i["grpc-message"]}n.remove("grpc-message"),this.trace('received status details string "'+a+'" from server')}s={code:o,details:a,metadata:n}}else this.httpStatusCode?(s=kS(this.httpStatusCode),s.metadata=n):s={code:ge.Status.UNKNOWN,details:"No status information received",metadata:n};this.endCall(s)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let r;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===ge.Status.OK?r=nn.constants.NGHTTP2_NO_ERROR:r=nn.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+r),this.http2Stream.close(r)}}cancelWithStatus(e,r){this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),this.endCall({code:e,details:r,metadata:new sn.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}getAuthContext(){return this.transport.getAuthContext()}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==ge.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length);let n=i=>{process.nextTick(()=>{var s;let o=ge.Status.UNAVAILABLE;i?.code==="ERR_STREAM_WRITE_AFTER_END"&&(o=ge.Status.INTERNAL),i&&this.cancelWithStatus(o,`Write error: ${i.message}`),(s=e.callback)===null||s===void 0||s.call(e)})};this.trace("sending data chunk of length "+r.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(r,n)}catch(i){this.endCall({code:ge.Status.UNAVAILABLE,details:`Write failed with error ${i.message}`,metadata:new sn.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};zd.Http2SubchannelCall=FS});var cB=m(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.Http2SubchannelConnector=void 0;var Ii=L("http2"),Loe=L("tls"),jd=Vn(),cc=te(),Doe=LS(),ho=Ee(),Uoe=Xt(),$d=Et(),BS=ot(),koe=L("net"),Foe=aB(),Boe=Pd(),VS="transport",Voe="transport_flowctrl",qoe=a_().version,{HTTP2_HEADER_AUTHORITY:Goe,HTTP2_HEADER_CONTENT_TYPE:Hoe,HTTP2_HEADER_METHOD:zoe,HTTP2_HEADER_PATH:joe,HTTP2_HEADER_TE:$oe,HTTP2_HEADER_USER_AGENT:Woe}=Ii.constants,Yoe=2e4,Koe=Buffer.from("too_many_pings","ascii"),qS=class{constructor(e,r,n,i){this.session=e,this.options=n,this.remoteName=i,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,$d.subchannelAddressToString)(r),n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new jd.ChannelzCallTrackerStub):this.streamTracker=new jd.ChannelzCallTracker,this.channelzRef=(0,jd.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[n["grpc.primary_user_agent"],`grpc-node-js/${qoe}`,n["grpc.secondary_user_agent"]].filter(s=>s).join(" "),"grpc.keepalive_time_ms"in n?this.keepaliveTimeMs=n["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in n?this.keepaliveTimeoutMs=n["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=Yoe,"grpc.keepalive_permit_without_calls"in n?this.keepaliveWithoutCalls=n["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(s,o,a)=>{let c=!1;s===Ii.constants.NGHTTP2_ENHANCE_YOUR_CALM&&a&&a.equals(Koe)&&(c=!0),this.trace("connection closed by GOAWAY with code "+s+" and data "+a?.toString()),this.reportDisconnectToOwner(c)}),e.once("error",s=>{this.trace("connection closed with error "+s.message),this.handleDisconnect()}),e.socket.once("close",s=>{this.trace("connection closed. hadError="+s),this.handleDisconnect()}),ho.isTracerEnabled(VS)&&(e.on("remoteSettings",s=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))}),e.on("localSettings",s=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(s))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof Loe.TLSSocket?this.authContext={transportSecurityType:"ssl",sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){var e,r,n;let i=this.session.socket,s=i.remoteAddress?(0,$d.stringToSubchannelAddress)(i.remoteAddress,i.remotePort):null,o=i.localAddress?(0,$d.stringToSubchannelAddress)(i.localAddress,i.localPort):null,a;if(this.session.encrypted){let l=i,h=l.getCipher(),d=l.getCertificate(),f=l.getPeerCertificate();a={cipherSuiteStandardName:(e=h.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:h.standardName?null:h.name,localCertificate:d&&"raw"in d?d.raw:null,remoteCertificate:f&&"raw"in f?f.raw:null}}else a=null;return{remoteAddress:s,localAddress:o,security:a,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(r=this.session.state.localWindowSize)!==null&&r!==void 0?r:null,remoteFlowControlWindow:(n=this.session.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(e){ho.trace(cc.LogVerbosity.DEBUG,VS,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){ho.trace(cc.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){ho.trace(cc.LogVerbosity.DEBUG,Voe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){ho.trace(cc.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(r=>r(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,r;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(r=(e=this.keepaliveTimer).unref)===null||r===void 0||r.call(e);let n="";try{this.session.ping((s,o,a)=>{this.clearKeepaliveTimeout(),s?(this.keepaliveTrace("Ping failed with error "+s.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(n="Ping returned false")}catch(i){n=(i instanceof Error?i.message:"")||"Unknown error"}n&&(this.keepaliveTrace("Ping send failed: "+n),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,r;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(r=(e=this.keepaliveTimer).unref)===null||r===void 0||r.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,r,n,i,s){let o=e.toHttp2Headers();o[Goe]=r,o[Woe]=this.userAgent,o[Hoe]="application/grpc",o[zoe]="POST",o[joe]=n,o[$oe]="trailers";let a;try{a=this.session.request(o)}catch(h){throw this.handleDisconnect(),h}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let c,l;return this.channelzEnabled?(this.streamTracker.addCallStarted(),c={addMessageSent:()=>{var h;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(h=s.addMessageSent)===null||h===void 0||h.call(s)},addMessageReceived:()=>{var h;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(h=s.addMessageReceived)===null||h===void 0||h.call(s)},onCallEnd:h=>{var d;(d=s.onCallEnd)===null||d===void 0||d.call(s,h),this.removeActiveCall(l)},onStreamEnd:h=>{var d;h?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(d=s.onStreamEnd)===null||d===void 0||d.call(s,h)}}):c={addMessageSent:()=>{var h;(h=s.addMessageSent)===null||h===void 0||h.call(s)},addMessageReceived:()=>{var h;(h=s.addMessageReceived)===null||h===void 0||h.call(s)},onCallEnd:h=>{var d;(d=s.onCallEnd)===null||d===void 0||d.call(s,h),this.removeActiveCall(l)},onStreamEnd:h=>{var d;(d=s.onStreamEnd)===null||d===void 0||d.call(s,h)}},l=new Foe.Http2SubchannelCall(a,c,i,this,(0,Boe.getNextCallNumber)()),this.addActiveCall(l),l}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,jd.unregisterChannelzRef)(this.channelzRef)}},GS=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){ho.trace(cc.LogVerbosity.DEBUG,VS,(0,BS.uriToString)(this.channelTarget)+" "+e)}createSession(e,r,n){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((i,s)=>{var o,a,c,l,h,d,f,p;let g=null,S=this.channelTarget;if("grpc.http_connect_target"in n){let F=(0,BS.parseUri)(n["grpc.http_connect_target"]);F&&(S=F,g=(0,BS.uriToString)(F))}let A=e.secure?"https":"http",C=(0,Uoe.getDefaultAuthority)(S),R=()=>{var F;(F=this.session)===null||F===void 0||F.destroy(),this.session=null,setImmediate(()=>{Y||(Y=!0,s(`${q.trim()} (${new Date().toISOString()})`))})},M=F=>{var _;(_=this.session)===null||_===void 0||_.destroy(),q=F.message,this.trace("connection failed with error "+q),Y||(Y=!0,s(`${q} (${new Date().toISOString()})`))},v={createConnection:(F,_)=>e.socket,settings:{initialWindowSize:(l=(o=n["grpc-node.flow_control_window"])!==null&&o!==void 0?o:(c=(a=Ii.getDefaultSettings)===null||a===void 0?void 0:a.call(Ii))===null||c===void 0?void 0:c.initialWindowSize)!==null&&l!==void 0?l:65535},maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER,maxSessionMemory:(h=n["grpc-node.max_session_memory"])!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER},w=Ii.connect(`${A}://${C}`,v),I=(p=(f=(d=Ii.getDefaultSettings)===null||d===void 0?void 0:d.call(Ii))===null||f===void 0?void 0:f.initialWindowSize)!==null&&p!==void 0?p:65535,V=n["grpc-node.flow_control_window"];this.session=w;let q="Failed to connect",Y=!1;w.unref(),w.once("remoteSettings",()=>{var F;if(V&&V>I)try{w.setLocalWindowSize(V)}catch{let de=V-((F=w.state.localWindowSize)!==null&&F!==void 0?F:I);de>0&&w.incrementWindowSize(de)}w.removeAllListeners(),e.socket.removeListener("close",R),e.socket.removeListener("error",M),i(new qS(w,r,n,g)),this.session=null}),w.once("close",R),w.once("error",M),e.socket.once("close",R),e.socket.once("error",M)})}tcpConnect(e,r){return(0,Doe.getProxiedConnection)(e,r).then(n=>n||new Promise((i,s)=>{let o=()=>{s(new Error("Socket closed"))},a=l=>{s(l)},c=koe.connect(e,()=>{c.removeListener("close",o),c.removeListener("error",a),i(c)});c.once("close",o),c.once("error",a)}))}async connect(e,r,n){if(this.isShutdown)return Promise.reject();let i=null,s=null,o=(0,$d.subchannelAddressToString)(e);try{return this.trace(o+" Waiting for secureConnector to be ready"),await r.waitForReady(),this.trace(o+" secureConnector is ready"),i=await this.tcpConnect(e,n),i.setNoDelay(),this.trace(o+" Established TCP connection"),s=await r.connect(i),this.trace(o+" Established secure connection"),this.createSession(s,e,n)}catch(a){throw i?.destroy(),s?.socket.destroy(),a}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};Wd.Http2SubchannelConnector=GS});var lB=m(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.SubchannelPool=void 0;uc.getSubchannelPool=nae;var Xoe=NU(),Joe=QF(),Qoe=Et(),Zoe=ot(),eae=cB(),tae=1e4,lc=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let r in this.pool){let i=this.pool[r].filter(s=>!s.subchannel.unrefIfOneRef());i.length>0&&(e=!1),this.pool[r]=i}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,r;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},tae),(r=(e=this.cleanupTimer).unref)===null||r===void 0||r.call(e))}getOrCreateSubchannel(e,r,n,i){this.ensureCleanupTask();let s=(0,Zoe.uriToString)(e);if(s in this.pool){let a=this.pool[s];for(let c of a)if((0,Qoe.subchannelAddressEqual)(r,c.subchannelAddress)&&(0,Xoe.channelOptionsEqual)(n,c.channelArguments)&&i._equals(c.channelCredentials))return c.subchannel}let o=new Joe.Subchannel(e,r,n,i,new eae.Http2SubchannelConnector(e));return s in this.pool||(this.pool[s]=[]),this.pool[s].push({subchannelAddress:r,channelArguments:n,channelCredentials:i,subchannel:o}),o.ref(),o}};uc.SubchannelPool=lc;var rae=new lc;function nae(t){return t?rae:new lc}});var dB=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.LoadBalancingCall=void 0;var uB=at(),Yd=te(),hB=oo(),Kd=He(),hc=Wr(),iae=ot(),sae=Ee(),HS=rc(),oae=L("http2"),aae="load_balancing_call",zS=class{constructor(e,r,n,i,s,o,a){var c,l;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=s,this.deadline=o,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let h=this.methodName.split("/"),d="";h.length>=2&&(d=h[1]);let f=(l=(c=(0,iae.splitHostPort)(this.host))===null||c===void 0?void 0:c.host)!==null&&l!==void 0?l:"localhost";this.serviceUrl=`https://${f}/${d}`,this.startTime=new Date}getDeadlineInfo(){var e,r;let n=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&n.push("wait_for_ready"),n.push(`LB pick: ${(0,hB.formatDateDifference)(this.startTime,this.childStartTime)}`)),n.push(...this.child.getDeadlineInfo()),n):(!((r=this.metadata)===null||r===void 0)&&r.getOptions().waitForReady&&n.push("wait_for_ready"),n.push("Waiting for LB pick"),n)}trace(e){sae.trace(Yd.LogVerbosity.DEBUG,aae,"["+this.callNumber+"] "+e)}outputStatus(e,r){var n,i;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let s=Object.assign(Object.assign({},e),{progress:r});(n=this.listener)===null||n===void 0||n.onReceiveStatus(s),(i=this.onCallEnded)===null||i===void 0||i.call(this,s.code,s.details,s.metadata)}}doPick(){var e,r;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let n=this.metadata.clone(),i=this.channel.doPick(n,this.callConfig.pickInformation),s=i.subchannel?"("+i.subchannel.getChannelzRef().id+") "+i.subchannel.getAddress():""+i.subchannel;switch(this.trace("Pick result: "+hc.PickResultType[i.pickResultType]+" subchannel: "+s+" status: "+((e=i.status)===null||e===void 0?void 0:e.code)+" "+((r=i.status)===null||r===void 0?void 0:r.details)),i.pickResultType){case hc.PickResultType.COMPLETE:this.credentials.compose(i.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(l=>{var h;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(n.merge(l),n.get("authorization").length>1&&this.outputStatus({code:Yd.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new Kd.Metadata},"PROCESSED"),i.subchannel.getConnectivityState()!==uB.ConnectivityState.READY){this.trace("Picked subchannel "+s+" has state "+uB.ConnectivityState[i.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&n.set("grpc-timeout",(0,hB.getDeadlineTimeoutString)(this.deadline));try{this.child=i.subchannel.getRealSubchannel().createCall(n,this.host,this.methodName,{onReceiveMetadata:d=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(d)},onReceiveMessage:d=>{this.trace("Received message"),this.listener.onReceiveMessage(d)},onReceiveStatus:d=>{this.trace("Received status"),d.rstCode===oae.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(d,"REFUSED"):this.outputStatus(d,"PROCESSED")}}),this.childStartTime=new Date}catch(d){this.trace("Failed to start call on picked subchannel "+s+" with error "+d.message),this.outputStatus({code:Yd.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+d.message,metadata:new Kd.Metadata},"NOT_STARTED");return}(h=i.onCallStarted)===null||h===void 0||h.call(i),this.onCallEnded=i.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},l=>{let{code:h,details:d}=(0,HS.restrictControlPlaneStatusCode)(typeof l.code=="number"?l.code:Yd.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${l.message}`);this.outputStatus({code:h,details:d,metadata:new Kd.Metadata},"PROCESSED")});break;case hc.PickResultType.DROP:let{code:a,details:c}=(0,HS.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:a,details:c,metadata:i.status.metadata},"DROP")});break;case hc.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:l,details:h}=(0,HS.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:l,details:h,metadata:i.status.metadata},"PROCESSED")})}break;case hc.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,r){var n;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new Kd.Metadata},"PROCESSED")}getPeer(){var e,r;return(r=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.channel.getTarget()}start(e,r){this.trace("start called"),this.listener=r,this.metadata=e,this.doPick()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length),this.child?this.child.sendMessageWithContext(e,r):this.pendingMessage={context:e,message:r}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}};Xd.LoadBalancingCall=zS});var pB=m(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.ResolvingCall=void 0;var cae=Nh(),Li=te(),Di=oo(),fB=He(),lae=Ee(),uae=rc(),hae="resolving_call",jS=class{constructor(e,r,n,i,s){this.channel=e,this.method=r,this.filterStackFactory=i,this.callNumber=s,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=cae.CallCredentials.createEmpty(),this.deadline=n.deadline,this.host=n.host,n.parentCall&&(n.flags&Li.Propagate.CANCELLATION&&n.parentCall.on("cancelled",()=>{this.cancelWithStatus(Li.Status.CANCELLED,"Cancelled by parent call")}),n.flags&Li.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+n.parentCall.getDeadline()),this.deadline=(0,Di.minDeadline)(this.deadline,n.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){lae.trace(Li.LogVerbosity.DEBUG,hae,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,Di.deadlineToString)(this.deadline));let e=(0,Di.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let r=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(Li.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let n=[],i=new Date;n.push(`Deadline exceeded after ${(0,Di.formatDateDifference)(this.deadlineStartTime,i)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&n.push(`name resolution: ${(0,Di.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&n.push(`metadata filters: ${(0,Di.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):n.push("waiting for metadata filters")):n.push("waiting for name resolution"),this.child&&n.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(Li.Status.DEADLINE_EXCEEDED,n.join(","))};e<=0?process.nextTick(r):this.deadlineTimer=setTimeout(r,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let r=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+r.code+' details="'+r.details+'"'),this.statusWatchers.forEach(n=>n(r)),process.nextTick(()=>{var n;(n=this.listener)===null||n===void 0||n.onReceiveStatus(r)})}}sendMessageOnChild(e,r){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let n=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags})).then(i=>{this.writeFilterPending=!1,n.sendMessageWithContext(e,i.message),this.pendingHalfClose&&n.halfClose()},i=>{this.cancelWithStatus(i.code,i.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let r=e.config;if(r.status!==Li.Status.OK){let{code:n,details:i}=(0,uae.restrictControlPlaneStatusCode)(r.status,"Failed to route call to method "+this.method);this.outputStatus({code:n,details:i,metadata:new fB.Metadata});return}if(r.methodConfig.timeout){let n=new Date;n.setSeconds(n.getSeconds()+r.methodConfig.timeout.seconds),n.setMilliseconds(n.getMilliseconds()+r.methodConfig.timeout.nanos/1e6),this.deadline=(0,Di.minDeadline)(this.deadline,n),this.runDeadlineTimer()}this.filterStackFactory.push(r.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(n=>{this.child=this.channel.createRetryingCall(r,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(n,{onReceiveMetadata:i=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(i))},onReceiveMessage:i=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(i).then(s=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(s),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},s=>{this.cancelWithStatus(s.code,s.details)})},onReceiveStatus:i=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=i:this.outputStatus(i)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},n=>{this.outputStatus(n)})}reportResolverError(e){var r;!((r=this.metadata)===null||r===void 0)&&r.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,r){var n;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new fB.Metadata})}getPeer(){var e,r;return(r=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.channel.getTarget()}start(e,r){this.trace("start called"),this.metadata=e.clone(),this.listener=r,this.getConfig()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length),this.child?this.sendMessageOnChild(e,r):this.pendingMessage={context:e,message:r}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}};Jd.ResolvingCall=jS});var mB=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.RetryingCall=Hn.MessageBufferTracker=Hn.RetryThrottler=void 0;var Qd=te(),dae=oo(),fae=He(),pae=Ee(),mae="retrying_call",WS=class{constructor(e,r,n){this.maxTokens=e,this.tokenRatio=r,n?this.tokens=n.tokens*(e/n.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};Hn.RetryThrottler=WS;var YS=class{constructor(e,r){this.totalLimit=e,this.limitPerCall=r,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,r){var n;let i=(n=this.allocatedPerCall.get(r))!==null&&n!==void 0?n:0;return this.limitPerCall-i<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(r,i+e),this.totalAllocated+=e,!0)}free(e,r){var n;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let i=(n=this.allocatedPerCall.get(r))!==null&&n!==void 0?n:0;if(i<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > allocated for call ${i}`);this.allocatedPerCall.set(r,i-e)}freeAll(e){var r;let n=(r=this.allocatedPerCall.get(e))!==null&&r!==void 0?r:0;if(this.totalAllocated<n)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${n} > total allocated ${this.totalAllocated}`);this.totalAllocated-=n,this.allocatedPerCall.delete(e)}};Hn.MessageBufferTracker=YS;var $S="grpc-previous-rpc-attempts",gae=5,KS=class{constructor(e,r,n,i,s,o,a,c,l){var h;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=s,this.deadline=o,this.callNumber=a,this.bufferTracker=c,this.retryThrottler=l,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let d=(h=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&h!==void 0?h:gae;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(r.methodConfig.retryPolicy){this.state="RETRY";let f=r.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(f.initialBackoff.substring(0,f.initialBackoff.length-1)),this.maxAttempts=Math.min(f.maxAttempts,d)}else r.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(r.methodConfig.hedgingPolicy.maxAttempts,d)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],r=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),r.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,dae.formatDateDifference)(this.startTime,r.startTime)}`),e.push(...r.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){pae.trace(Qd.LogVerbosity.DEBUG,mae,"["+this.callNumber+"] "+e)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var r;(r=this.listener)===null||r===void 0||r.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,r){this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),this.reportStatus({code:e,details:r,metadata:new fae.Metadata});for(let{call:n}of this.underlyingCalls)n.cancelWithStatus(e,r)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var r;return(r=this.writeBuffer[e-this.writeBufferOffset])!==null&&r!==void 0?r:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e;this.underlyingCalls[this.committedCallIndex].state==="COMPLETED"?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let r=this.writeBufferOffset;r<e;r++){let n=this.getBufferEntry(r);n.allocated&&this.bufferTracker.free(n.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var r,n;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(n=(r=this.callConfig).onCommitted)===null||n===void 0||n.call(r),this.committedCallIndex=e;for(let i=0;i<this.underlyingCalls.length;i++)i!==e&&this.underlyingCalls[i].state!=="COMPLETED"&&(this.underlyingCalls[i].state="COMPLETED",this.underlyingCalls[i].call.cancelWithStatus(Qd.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,r=-1;for(let[n,i]of this.underlyingCalls.entries())i.state==="ACTIVE"&&i.nextMessageToSend>e&&(e=i.nextMessageToSend,r=n);r===-1?this.state="TRANSPARENT_ONLY":this.commitCall(r)}isStatusCodeInList(e,r){return e.some(n=>{var i;return n===r||n.toString().toLowerCase()===((i=Qd.Status[r])===null||i===void 0?void 0:i.toLowerCase())})}getNextRetryJitter(){return Math.random()*(1.2-.8)+.8}getNextRetryBackoffMs(){var e;let r=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!r)return 0;let i=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,s=Number(r.maxBackoff.substring(0,r.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*r.backoffMultiplier,s),i}maybeRetryCall(e,r){if(this.state!=="RETRY"){r(!1);return}if(this.attempts>=this.maxAttempts){r(!1);return}let n;if(e===null)n=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",r(!1);return}else n=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var i,s;if(this.state!=="RETRY"){r(!1);return}!((s=(i=this.retryThrottler)===null||i===void 0?void 0:i.canRetryCall())!==null&&s!==void 0)||s?(r(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),r(!1))},n)}countActiveCalls(){let e=0;for(let r of this.underlyingCalls)r?.state==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,r,n){var i,s,o;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(r),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((i=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&i!==void 0?i:[],e.code)){(s=this.retryThrottler)===null||s===void 0||s.addCallFailed();let a;if(n===null)a=0;else if(n<0){this.state="TRANSPARENT_ONLY",this.commitCall(r),this.reportStatus(e);return}else a=n;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(r),this.reportStatus(e))},a)}else this.commitCall(r),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((o=this.retryThrottler)===null||o===void 0||o.addCallFailed(),this.maybeRetryCall(n,a=>{a||(this.commitCall(r),this.reportStatus(e))})):(this.commitCall(r),this.reportStatus(e));break}}getPushback(e){let r=e.get("grpc-retry-pushback-ms");if(r.length===0)return null;try{return parseInt(r[0])}catch{return-1}}handleChildStatus(e,r){var n;if(this.underlyingCalls[r].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[r].call.getCallNumber()+"] in state "+this.underlyingCalls[r].state),this.underlyingCalls[r].state="COMPLETED",e.code===Qd.Status.OK){(n=this.retryThrottler)===null||n===void 0||n.addCallSucceeded(),this.commitCall(r),this.reportStatus(e);return}if(this.state==="NO_RETRY"){this.commitCall(r),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let i=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,r,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(r),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,r,i);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,r,n;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let i=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let s=(e=i.hedgingDelay)!==null&&e!==void 0?e:"0s",o=Number(s.substring(0,s.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},o*1e3),(n=(r=this.hedgingTimer).unref)===null||n===void 0||n.call(r)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);let r=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let n=this.attempts-1,i=this.initialMetadata.clone();n>0&&i.set($S,`${n}`);let s=!1;e.start(i,{onReceiveMetadata:o=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(r),s=!0,n>0&&o.set($S,`${n}`),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMetadata(o)},onReceiveMessage:o=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(r),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMessage(o)},onReceiveStatus:o=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!s&&n>0&&o.metadata.set($S,`${n}`),this.handleChildStatus(o,r)}}),this.sendNextChildMessage(r),this.readStarted&&e.startRead()}start(e,r){this.trace("start called"),this.listener=r,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e,r){var n,i;(i=(n=this.getBufferEntry(r)).callback)===null||i===void 0||i.call(n),this.clearSentMessages();let s=this.underlyingCalls[e];s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let r=this.underlyingCalls[e];if(r.state==="COMPLETED")return;let n=r.nextMessageToSend;if(this.getBufferEntry(n)){let i=this.getBufferEntry(n);switch(i.entryType){case"MESSAGE":r.call.sendMessageWithContext({callback:o=>{this.handleChildWriteCompleted(e,n)}},i.message.message),this.getBufferEntry(n+1).entryType==="HALF_CLOSE"&&(this.trace("Sending halfClose immediately after message to child ["+r.call.getCallNumber()+"] - optimizing for unary/final message"),r.nextMessageToSend+=1,r.call.halfClose());break;case"HALF_CLOSE":r.nextMessageToSend+=1,r.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length);let n={message:r,flags:e.flags},i=this.getNextBufferIndex(),s={entryType:"MESSAGE",message:n,allocated:this.bufferTracker.allocate(r.length,this.callNumber)};if(this.writeBuffer.push(s),s.allocated){process.nextTick(()=>{var o;(o=e.callback)===null||o===void 0||o.call(e)});for(let[o,a]of this.underlyingCalls.entries())a.state==="ACTIVE"&&a.nextMessageToSend===i&&a.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(o,i)}},r)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let o=this.underlyingCalls[this.committedCallIndex];s.callback=e.callback,o.state==="ACTIVE"&&o.nextMessageToSend===i&&o.call.sendMessageWithContext({callback:a=>{this.handleChildWriteCompleted(this.committedCallIndex,i)}},r)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let r of this.underlyingCalls)r?.state==="ACTIVE"&&(r.nextMessageToSend===e||r.nextMessageToSend===e-1)&&(this.trace("Sending halfClose immediately to child ["+r.call.getCallNumber()+"] - all messages already sent"),r.nextMessageToSend+=1,r.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getAuthContext():null}};Hn.RetryingCall=KS});var dc=m(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.BaseSubchannelWrapper=void 0;var XS=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,e.addHealthStateWatcher(r=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref(),this.refcount+=1}unref(){this.child.unref(),this.refcount-=1,this.refcount===0&&this.destroy()}destroy(){for(let e of this.dataWatchers)e.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}addDataWatcher(e){e.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}};Zd.BaseSubchannelWrapper=XS});var iT=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.InternalChannel=Ui.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var _ae=Bs(),Eae=MU(),Sae=lB(),ZS=Wr(),Tae=He(),zn=te(),yae=kd(),vae=yS(),gB=Xt(),ef=Ee(),Aae=LS(),tf=ot(),Bt=at(),fc=Vn(),Cae=dB(),Rae=oo(),Oae=pB(),JS=Pd(),bae=rc(),QS=mB(),Mae=dc(),Nae=2147483647,wae=1e3,Pae=30*60*1e3,rf=new Map,xae=1<<24,Iae=1<<20,eT=class extends Mae.BaseSubchannelWrapper{constructor(e,r){super(e),this.channel=r,this.refCount=0,this.subchannelStateListener=(n,i,s,o)=>{r.throttleKeepalive(o)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},tT=class{pick(e){return{pickResultType:ZS.PickResultType.DROP,status:{code:zn.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new Tae.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};Ui.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var rT=class{constructor(e){this.target=e,this.trace=new fc.ChannelzTrace,this.callTracker=new fc.ChannelzCallTracker,this.childrenTracker=new fc.ChannelzChildrenTracker,this.state=Bt.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},nT=class{constructor(e,r,n){var i,s,o,a,c,l;if(this.credentials=r,this.options=n,this.connectivityState=Bt.ConnectivityState.IDLE,this.currentPicker=new ZS.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof _ae.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new rT(e);let h=(0,tf.parseUri)(e);if(h===null)throw new Error(`Could not parse target name "${e}"`);let d=(0,gB.mapUriDefaultScheme)(h);if(d===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,fc.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,gB.getDefaultAuthority)(d);let f=(0,Aae.mapProxyName)(d,n);this.target=f.target,this.options=Object.assign({},this.options,f.extraOptions),this.subchannelPool=(0,Sae.getSubchannelPool)(((i=this.options["grpc.use_local_subchannel_pool"])!==null&&i!==void 0?i:0)===0),this.retryBufferTracker=new QS.MessageBufferTracker((s=this.options["grpc.retry_buffer_size"])!==null&&s!==void 0?s:xae,(o=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&o!==void 0?o:Iae),this.keepaliveTime=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:-1,this.idleTimeoutMs=Math.max((c=this.options["grpc.client_idle_timeout_ms"])!==null&&c!==void 0?c:Pae,wae);let p={createSubchannel:(S,A)=>{let C={};for(let[v,w]of Object.entries(A))v.startsWith(Ui.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(C[v]=w);let R=this.subchannelPool.getOrCreateSubchannel(this.target,S,C,this.credentials);return R.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",R.getChannelzRef()),new eT(R,this)},updateState:(S,A)=>{this.currentPicker=A;let C=this.pickQueue.slice();this.pickQueue=[],C.length>0&&this.callRefTimerUnref();for(let R of C)R.doPick();this.updateState(S)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:S=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(S)},removeChannelzChild:S=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(S)}};this.resolvingLoadBalancer=new Eae.ResolvingLoadBalancer(this.target,p,this.options,(S,A)=>{var C;S.retryThrottling?rf.set(this.getTarget(),new QS.RetryThrottler(S.retryThrottling.maxTokens,S.retryThrottling.tokenRatio,rf.get(this.getTarget()))):rf.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(C=this.configSelector)===null||C===void 0||C.unref(),this.configSelector=A,this.currentResolutionError=null,process.nextTick(()=>{let R=this.configSelectionQueue;this.configSelectionQueue=[],R.length>0&&this.callRefTimerUnref();for(let M of R)M.getConfig()})},S=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+S.code+' and details "'+S.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,bae.restrictControlPlaneStatusCode)(S.code,S.details)),{metadata:S.metadata}));let A=this.configSelectionQueue;this.configSelectionQueue=[],A.length>0&&this.callRefTimerUnref();for(let C of A)C.reportResolverError(S)}),this.filterStackFactory=new yae.FilterStackFactory([new vae.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(n,void 0,2));let g=new Error;(0,ef.isTracerEnabled)("channel_stacktrace")&&(0,ef.trace)(zn.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
|
|
64
|
-
`+((l=g.stack)===null||l===void 0?void 0:l.substring(g.stack.indexOf(`
|
|
65
|
-
`)+1))),this.lastActivityTimestamp=new Date}trace(e,r){(0,ef.trace)(r??zn.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,tf.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},Nae)),!((r=(e=this.callRefTimer).hasRef)===null||r===void 0)&&r.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(i=(n=this.callRefTimer).ref)===null||i===void 0||i.call(n))}callRefTimerUnref(){var e,r,n;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(r=this.callRefTimer)===null||r===void 0?void 0:r.unref)===null||n===void 0||n.call(r))}removeConnectivityStateWatcher(e){let r=this.connectivityStateWatchers.findIndex(n=>n===e);r>=0&&this.connectivityStateWatchers.splice(r,1)}updateState(e){(0,ef.trace)(zn.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,tf.uriToString)(this.target)+" "+Bt.ConnectivityState[this.connectivityState]+" -> "+Bt.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Bt.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let r=this.connectivityStateWatchers.slice();for(let n of r)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==Bt.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let r of this.wrappedSubchannels)r.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,r){return this.currentPicker.pick({metadata:e,extraPickInfo:r})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,r){return this.connectivityState!==Bt.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,r,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(Bt.ConnectivityState.IDLE),this.currentPicker=new ZS.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var r,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let s=new Date().valueOf()-this.lastActivityTimestamp.valueOf();s>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-s)},e),(n=(r=this.idleTimer).unref)===null||n===void 0||n.call(r)}maybeStartIdleTimer(){this.connectivityState!==Bt.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===zn.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,n,i,s){let o=(0,JS.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+o+'] method="'+r+'"'),new Cae.LoadBalancingCall(this,e,r,n,i,s,o)}createRetryingCall(e,r,n,i,s){let o=(0,JS.getNextCallNumber)();return this.trace("createRetryingCall ["+o+'] method="'+r+'"'),new QS.RetryingCall(this,e,r,n,i,s,o,this.retryBufferTracker,rf.get(this.getTarget()))}createResolvingCall(e,r,n,i,s){let o=(0,JS.getNextCallNumber)();this.trace("createResolvingCall ["+o+'] method="'+e+'", deadline='+(0,Rae.deadlineToString)(r));let a={deadline:r,flags:s??zn.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new Oae.ResolvingCall(this,e,a,this.filterStackFactory.clone(),o);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Bt.ConnectivityState.SHUTDOWN),this.currentPicker=new tT;for(let r of this.configSelectionQueue)r.cancelWithStatus(zn.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(zn.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,fc.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tf.uriToString)(this.target)}getConnectivityState(e){let r=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),r}watchConnectivityState(e,r,n){if(this.connectivityState===Bt.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(r!==1/0){let o=r instanceof Date?r:new Date(r),a=new Date;if(r===-1/0||o<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(s),n(new Error("Deadline passed without connectivity state change"))},o.getTime()-a.getTime())}let s={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(s)}getChannelzRef(){return this.channelzRef}createCall(e,r,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Bt.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,n,i,s)}getOptions(){return this.options}};Ui.InternalChannel=nT});var J_=m(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.ChannelImplementation=void 0;var Lae=Bs(),Dae=iT(),sT=class{constructor(e,r,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof Lae.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new Dae.InternalChannel(e,r,n)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,r,n){this.internalChannel.watchConnectivityState(e,r,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,r,n,i,s){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,r,n,i,s)}};nf.ChannelImplementation=sT});var EB=m(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.ServerDuplexStreamImpl=lr.ServerWritableStreamImpl=lr.ServerReadableStreamImpl=lr.ServerUnaryCallImpl=void 0;lr.serverErrorToStatus=dT;var Uae=L("events"),uT=L("stream"),hT=te(),_B=He();function dT(t,e){var r;let n={code:hT.Status.UNKNOWN,details:"message"in t?t.message:"Unknown Error",metadata:(r=e??t.metadata)!==null&&r!==void 0?r:null};return"code"in t&&typeof t.code=="number"&&Number.isInteger(t.code)&&(n.code=t.code,"details"in t&&typeof t.details=="string"&&(n.details=t.details)),n}var oT=class extends Uae.EventEmitter{constructor(e,r,n,i){super(),this.path=e,this.call=r,this.metadata=n,this.request=i,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};lr.ServerUnaryCallImpl=oT;var aT=class extends uT.Readable{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};lr.ServerReadableStreamImpl=aT;var cT=class extends uT.Writable{constructor(e,r,n,i){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.request=i,this.pendingStatus={code:hT.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new _B.Metadata,this.on("error",s=>{this.pendingStatus=dT(s),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};lr.ServerWritableStreamImpl=cT;var lT=class extends uT.Duplex{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.pendingStatus={code:hT.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new _B.Metadata,this.on("error",i=>{this.pendingStatus=dT(i),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};lr.ServerDuplexStreamImpl=lT});var sf=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ServerCredentials=void 0;fo.createCertificateProviderServerCredentials=kae;fo.createServerCredentialsWithInterceptors=Fae;var fT=S_(),ki=class{constructor(e,r){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=r??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let r of this.watchers)r(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new pT}static createSsl(e,r,n=!1){var i;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(r))throw new TypeError("keyCertPairs must be an array");if(typeof n!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let s=[],o=[];for(let a=0;a<r.length;a++){let c=r[a];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${a}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${a}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${a}].cert_chain must be a Buffer`);s.push(c.cert_chain),o.push(c.private_key)}return new mT({requestCert:n,ciphers:fT.CIPHER_SUITES},{ca:(i=e??(0,fT.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:s,key:o})}};fo.ServerCredentials=ki;var pT=class t extends ki{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},mT=class t extends ki{constructor(e,r){super(e,r),this.options=Object.assign(Object.assign({},e),r)}_equals(e){if(this===e)return!0;if(!(e instanceof t))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let r=0;r<this.options.cert.length;r++){let n=this.options.cert[r],i=e.options.cert[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let r=0;r<this.options.key.length;r++){let n=this.options.key[r],i=e.options.key[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},gT=class t extends ki{constructor(e,r,n){super({requestCert:r!==null,rejectUnauthorized:n,ciphers:fT.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=r,this.requireClientCertificate=n,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var r;this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var r;super._removeWatcher(e),this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function kae(t,e,r){return new gT(t,e,r)}var _T=class t extends ki{constructor(e,r){super({}),this.childCredentials=e,this.interceptors=r}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof t)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r]!==e.interceptors[r])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function Fae(t,e){return new _T(t,e)}});var pc=m(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.durationMessageToDuration=Bae;on.msToDuration=Vae;on.durationToMs=qae;on.isDuration=Gae;on.isDurationMessage=Hae;on.parseDuration=jae;on.durationToString=$ae;function Bae(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function Vae(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function qae(t){return t.seconds*1e3+t.nanos/1e6|0}function Gae(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function Hae(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var zae=/^(\d+)(?:\.(\d+))?s$/;function jae(t){let e=t.match(zae);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function $ae(t){if(t.nanos===0)return`${t.seconds}s`;let e;return t.nanos%1e6===0?e=1e6:t.nanos%1e3===0?e=1e3:e=1,`${t.seconds}.${t.nanos/e}s`}});var af=m(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.OrcaOobMetricsSubchannelWrapper=Ot.GRPC_METRICS_HEADER=Ot.ServerMetricRecorder=Ot.PerRequestMetricRecorder=void 0;Ot.createOrcaClient=vB;Ot.createMetricsReader=Zae;var Wae=Kh(),ET=pc(),Yae=Bs(),Kae=dc(),SB=te(),Xae=Vs(),Jae=at(),TB=null;function of(){if(TB)return TB;let t=sS().loadSync,e=t("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,Wae.loadPackageDefinition)(e)}var ST=class{constructor(){this.message={}}recordRequestCostMetric(e,r){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=r}recordUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}recordNamedMetric(e,r){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=r}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return of().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};Ot.PerRequestMetricRecorder=ST;var Qae=3e4,TT=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,ET.durationToMs)((0,ET.durationMessageToDuration)(e.request.report_interval)):Qae,n=setInterval(()=>{e.write(this.message)},r);e.on("cancelled",()=>{clearInterval(n)})}}}putUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var r;(r=this.message.utilization)===null||r===void 0||delete r[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let r=of().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};Ot.ServerMetricRecorder=TT;function vB(t){let e=of().xds.service.orca.v3.OpenRcaService;return new e("unused",Yae.ChannelCredentials.createInsecure(),{channelOverride:t})}Ot.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var yB="grpc_orca_load_report";function Zae(t,e){return(r,n,i)=>{let s=i.getOpaque(yB);if(s)t(s);else{let o=i.get(Ot.GRPC_METRICS_HEADER);o.length>0&&(s=of().xds.data.orca.v3.OrcaLoadReport.deserialize(o[0]),t(s),i.setOpaque(yB,s))}e&&e(r,n,i)}}var AB="orca_oob_metrics",yT=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(AB,ece);this.dataProducer=r,r.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)===null||e===void 0||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},vT=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new Xae.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=vB(r),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var r;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(AB),(r=this.metricsCall)===null||r===void 0||r.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==Jae.ConnectivityState.READY)return;let r=Math.min(...Array.from(this.dataWatchers).map(n=>n.getInterval()));if(!this.metricsCall||r!==this.currentInterval){(e=this.metricsCall)===null||e===void 0||e.cancel(),this.currentInterval=r;let n=this.client.streamCoreMetrics({report_interval:(0,ET.msToDuration)(r)});this.metricsCall=n,n.on("data",i=>{this.dataWatchers.forEach(s=>{s.onMetricsUpdate(i)})}),n.on("error",i=>{if(this.metricsCall=null,i.code===SB.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}i.code!==SB.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},AT=class extends Kae.BaseSubchannelWrapper{constructor(e,r,n){super(e),this.addDataWatcher(new yT(r,n))}getWrappedSubchannel(){return this.child}};Ot.OrcaOobMetricsSubchannelWrapper=AT;function ece(t){return new vT(t)}});var wT=m(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.BaseServerInterceptingCall=Vt.ServerInterceptingCall=Vt.ResponderBuilder=Vt.ServerListenerBuilder=void 0;Vt.isInterceptingServerListener=nce;Vt.getServerInterceptingCall=cce;var uf=He(),lt=te(),po=L("http2"),CB=Rh(),RB=L("zlib"),tce=US(),wB=Ee(),rce=L("tls"),OB=af(),PB="server_call";function Fi(t){wB.trace(lt.LogVerbosity.DEBUG,PB,t)}var RT=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};Vt.ServerListenerBuilder=RT;function nce(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var OT=class{constructor(e,r){this.listener=e,this.nextListener=r,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},bT=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};Vt.ResponderBuilder=bT;var cf={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},lf={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},MT=class{constructor(e,r){var n,i,s,o;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(n=r?.start)!==null&&n!==void 0?n:lf.start,sendMetadata:(i=r?.sendMetadata)!==null&&i!==void 0?i:lf.sendMetadata,sendMessage:(s=r?.sendMessage)!==null&&s!==void 0?s:lf.sendMessage,sendStatus:(o=r?.sendStatus)!==null&&o!==void 0?o:lf.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(r=>{var n,i,s,o;let a={onReceiveMetadata:(n=r?.onReceiveMetadata)!==null&&n!==void 0?n:cf.onReceiveMetadata,onReceiveMessage:(i=r?.onReceiveMessage)!==null&&i!==void 0?i:cf.onReceiveMessage,onReceiveHalfClose:(s=r?.onReceiveHalfClose)!==null&&s!==void 0?s:cf.onReceiveHalfClose,onCancel:(o=r?.onCancel)!==null&&o!==void 0?o:cf.onCancel},c=new OT(a,e);this.nextCall.start(c)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,r=>{this.processingMetadata=!1,this.nextCall.sendMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,r){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new uf.Metadata),this.responder.sendMessage(e,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=n,this.pendingMessageCallback=r):this.nextCall.sendMessage(n,r)})}sendStatus(e){this.responder.sendStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextCall.sendStatus(r)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}};Vt.ServerInterceptingCall=MT;var xB="grpc-accept-encoding",NT="grpc-encoding",bB="grpc-message",MB="grpc-status",CT="grpc-timeout",ice=/(\d{1,8})\s*([HMSmun])/,sce={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},oce={[xB]:"identity,deflate,gzip",[NT]:"identity"},NB={[po.constants.HTTP2_HEADER_STATUS]:po.constants.HTTP_STATUS_OK,[po.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},ace={waitForTrailers:!0},hf=class{constructor(e,r,n,i,s){var o,a;this.stream=e,this.callEventTracker=n,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=lt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=lt.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new OB.PerRequestMetricRecorder,this.stream.once("close",()=>{var f;Fi("Request to method "+((f=this.handler)===null||f===void 0?void 0:f.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:lt.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",f=>{this.handleDataFrame(f)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in s&&(this.maxSendMessageSize=s["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in s&&(this.maxReceiveMessageSize=s["grpc.max_receive_message_length"]),this.host=(o=r[":authority"])!==null&&o!==void 0?o:r.host,this.decoder=new tce.StreamDecoder(this.maxReceiveMessageSize);let c=uf.Metadata.fromHttp2Headers(r);wB.isTracerEnabled(PB)&&Fi("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let l=c.get(CT);l.length>0&&this.handleTimeoutHeader(l[0]);let h=c.get(NT);h.length>0&&(this.incomingEncoding=h[0]),c.remove(CT),c.remove(NT),c.remove(xB),c.remove(po.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove(po.constants.HTTP2_HEADER_TE),c.remove(po.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=c;let d=(a=e.session)===null||a===void 0?void 0:a.socket;this.connectionInfo={localAddress:d?.localAddress,localPort:d?.localPort,remoteAddress:d?.remoteAddress,remotePort:d?.remotePort},this.shouldSendMetrics=!!s["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(ice);if(r===null){let s={code:lt.Status.INTERNAL,details:`Invalid ${CT} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(s)});return}let n=+r[1]*sce[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let s={code:lt.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(s)},n)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new uf.Metadata)}serializeMessage(e){let r=this.handler.serialize(e),n=r.byteLength,i=Buffer.allocUnsafe(n+5);return i.writeUInt8(0,0),i.writeUInt32BE(n,1),r.copy(i,5),i}decompressMessage(e,r){let n=e.subarray(5);if(r==="identity")return n;if(r==="deflate"||r==="gzip"){let i;return r==="deflate"?i=RB.createInflate():i=RB.createGunzip(),new Promise((s,o)=>{let a=0,c=[];i.on("error",l=>{o({code:lt.Status.INTERNAL,details:"Failed to decompress message"})}),i.on("data",l=>{c.push(l),a+=l.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(i.destroy(),o({code:lt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{s(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:lt.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${r}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let n=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",i;try{i=await this.decompressMessage(e.compressedMessage,n)}catch(s){this.sendStatus(s);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(s){this.sendStatus({code:lt.Status.INTERNAL,details:`Error deserializing request: ${s.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var r;if(this.checkCancelled())return;Fi("Request to "+this.handler.path+" received data frame of size "+e.length);let n;try{n=this.decoder.write(e)}catch(i){this.sendStatus({code:lt.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let s={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(s),this.decompressAndMaybePush(s),(r=this.callEventTracker)===null||r===void 0||r.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){Fi("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let r=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},NB),oce),r);this.stream.respond(n,ace)}sendMessage(e,r){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:lt.Status.INTERNAL,details:`Error serializing response: ${(0,CB.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:lt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),Fi("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var s;if(i){this.sendStatus({code:lt.Status.INTERNAL,details:`Error writing message: ${(0,CB.getErrorMessage)(i)}`,metadata:null});return}(s=this.callEventTracker)===null||s===void 0||s.addMessageSent(),r()})}sendStatus(e){var r,n,i;if(this.checkCancelled())return;Fi("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+lt.Status[e.code]+" details: "+e.details);let s=(i=(n=e.metadata)===null||n===void 0?void 0:n.clone())!==null&&i!==void 0?i:new uf.Metadata;if(this.shouldSendMetrics&&s.set(OB.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let o=Object.assign({[MB]:e.code,[bB]:encodeURI(e.details)},s.toHttp2Headers());this.stream.sendTrailers(o),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let o=Object.assign(Object.assign({[MB]:e.code,[bB]:encodeURI(e.details)},NB),s.toHttp2Headers());this.stream.respond(o,{endStream:!0}),this.notifyOnCancel()}}startRead(){Fi("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let r=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return r?.remoteAddress?r.remotePort?`${r.remoteAddress}:${r.remotePort}`:r.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var e;if(((e=this.stream.session)===null||e===void 0?void 0:e.socket)instanceof rce.TLSSocket){let r=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:r.raw?r:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};Vt.BaseServerInterceptingCall=hf;function cce(t,e,r,n,i,s){let o={path:i.path,requestStream:i.type==="clientStream"||i.type==="bidi",responseStream:i.type==="serverStream"||i.type==="bidi",requestDeserialize:i.deserialize,responseSerialize:i.serialize},a=new hf(e,r,n,i,s);return t.reduce((c,l)=>l(o,c),a)}});var BB=m($n=>{"use strict";var lce=$n&&$n.__runInitializers||function(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0},uce=$n&&$n.__esDecorate||function(t,e,r,n,i,s){function o(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,h=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,p=r.length-1;p>=0;p--){var g={};for(var S in n)g[S]=S==="access"?{}:n[S];for(var S in n.access)g.access[S]=n.access[S];g.addInitializer=function(C){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(C||null))};var A=(0,r[p])(a==="accessor"?{get:h.get,set:h.set}:h[c],g);if(a==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(d=o(A.get))&&(h.get=d),(d=o(A.set))&&(h.set=d),(d=o(A.init))&&i.unshift(d)}else(d=o(A))&&(a==="field"?i.unshift(d):h[c]=d)}l&&Object.defineProperty(l,n.name,h),f=!0};Object.defineProperty($n,"__esModule",{value:!0});$n.Server=void 0;var Tt=L("http2"),hce=L("util"),be=te(),_o=EB(),PT=sf(),IB=Xt(),go=Ee(),jn=Et(),ur=ot(),Ve=Vn(),LB=wT(),mo=~(1<<31),xT=~(1<<31),dce=2e4,DB=~(1<<31),{HTTP2_HEADER_PATH:UB}=Tt.constants,fce="server",kB=Buffer.from("max_age");function FB(t){go.trace(be.LogVerbosity.DEBUG,"server_call",t)}function pce(){}function mce(t){return function(e,r){return hce.deprecate(e,t)}}function IT(t){return{code:be.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function gce(t,e){let r=IT(e);switch(t){case"unary":return(n,i)=>{i(r,null)};case"clientStream":return(n,i)=>{i(r,null)};case"serverStream":return n=>{n.emit("error",r)};case"bidi":return n=>{n.emit("error",r)};default:throw new Error(`Invalid handlerType ${t}`)}}var _ce=(()=>{var t;let e=[],r;return t=class{constructor(i){var s,o,a,c,l,h;this.boundPorts=(lce(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=i??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Ve.ChannelzTraceStub,this.callTracker=new Ve.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Ve.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Ve.ChannelzChildrenTrackerStub):(this.channelzTrace=new Ve.ChannelzTrace,this.callTracker=new Ve.ChannelzCallTracker,this.listenerChildrenTracker=new Ve.ChannelzChildrenTracker,this.sessionChildrenTracker=new Ve.ChannelzChildrenTracker),this.channelzRef=(0,Ve.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(s=this.options["grpc.max_connection_age_ms"])!==null&&s!==void 0?s:mo,this.maxConnectionAgeGraceMs=(o=this.options["grpc.max_connection_age_grace_ms"])!==null&&o!==void 0?o:mo,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:xT,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:dce,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:DB,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(h=this.options.interceptors)!==null&&h!==void 0?h:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(i){var s,o,a;let c=this.sessions.get(i),l=i.socket,h=l.remoteAddress?(0,jn.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,jn.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let g=l,S=g.getCipher(),A=g.getCertificate(),C=g.getPeerCertificate();f={cipherSuiteStandardName:(s=S.standardName)!==null&&s!==void 0?s:null,cipherSuiteOtherName:S.standardName?null:S.name,localCertificate:A&&"raw"in A?A.raw:null,remoteCertificate:C&&"raw"in C?C.raw:null}}else f=null;return{remoteAddress:h,localAddress:d,security:f,remoteName:null,streamsStarted:c.streamTracker.callsStarted,streamsSucceeded:c.streamTracker.callsSucceeded,streamsFailed:c.streamTracker.callsFailed,messagesSent:c.messagesSent,messagesReceived:c.messagesReceived,keepAlivesSent:c.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:c.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:c.lastMessageSentTimestamp,lastMessageReceivedTimestamp:c.lastMessageReceivedTimestamp,localFlowControlWindow:(o=i.state.localWindowSize)!==null&&o!==void 0?o:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){go.trace(be.LogVerbosity.DEBUG,fce,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){go.trace(be.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,s){if(i===null||typeof i!="object"||s===null||typeof s!="object")throw new Error("addService() requires two objects as arguments");let o=Object.keys(i);if(o.length===0)throw new Error("Cannot add an empty service to a server");o.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let h=s[a],d;if(h===void 0&&typeof c.originalName=="string"&&(h=s[c.originalName]),h!==void 0?d=h.bind(s):d=gce(l,a),this.register(c.path,d,c.responseSerialize,c.requestDeserialize,l)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(i){if(i===null||typeof i!="object")throw new Error("removeService() requires object as argument");Object.keys(i).forEach(o=>{let a=i[o];this.unregister(a.path)})}bind(i,s){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,Ve.registerChannelzSocket)((0,jn.subchannelAddressToString)(i),()=>({localAddress:i,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(i){(0,Ve.unregisterChannelzRef)(i)}createHttp2Server(i){let s;if(i._isSecure()){let o=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),o),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),s=Tt.createSecureServer(c),s.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),s.on("secureConnection",d=>{d.on("error",f=>{this.trace("An incoming TLS connection closed with error: "+f.message)})});let h=d=>{if(d){let f=s;try{f.setSecureContext(d)}catch(p){go.log(be.LogVerbosity.ERROR,"Failed to set secure context with error "+p.message),d=null}}l=d!==null,this.trace("Post-update credentials valid: "+l)};i._addWatcher(h),s.on("close",()=>{i._removeWatcher(h)})}else s=Tt.createServer(this.commonServerOptions);return s.setTimeout(0,pce),this._setupHandlers(s,i._getInterceptors()),s}bindOneAddress(i,s){this.trace("Attempting to bind "+(0,jn.subchannelAddressToString)(i));let o=this.createHttp2Server(s.credentials);return new Promise((a,c)=>{let l=h=>{this.trace("Failed to bind "+(0,jn.subchannelAddressToString)(i)+" with error "+h.message),a({port:"port"in i?i.port:1,error:h.message})};o.once("error",l),o.listen(i,()=>{let h=o.address(),d;typeof h=="string"?d={path:h}:d={host:h.address,port:h.port};let f=this.experimentalRegisterListenerToChannelz(d);this.listenerChildrenTracker.refChild(f),this.http2Servers.set(o,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),s.listeningServers.add(o),this.trace("Successfully bound "+(0,jn.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),o.removeListener("error",l)})})}async bindManyPorts(i,s){if(i.length===0)return{count:0,port:0,errors:[]};if((0,jn.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let o=await this.bindOneAddress(i[0],s);if(o.error){let a=await this.bindManyPorts(i.slice(1),s);return Object.assign(Object.assign({},a),{errors:[o.error,...a.errors]})}else{let a=i.slice(1).map(h=>(0,jn.isTcpSubchannelAddress)(h)?{host:h.host,port:o.port}:h),c=await Promise.all(a.map(h=>this.bindOneAddress(h,s))),l=[o,...c];return{count:l.filter(h=>h.error===void 0).length,port:o.port,errors:l.filter(h=>h.error).map(h=>h.error)}}}else{let o=await Promise.all(i.map(a=>this.bindOneAddress(a,s)));return{count:o.filter(a=>a.error===void 0).length,port:o[0].port,errors:o.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,s){let o=await this.bindManyPorts(i,s);if(o.count>0)return o.count<i.length&&go.log(be.LogVerbosity.INFO,`WARNING Only ${o.count} addresses added out of total ${i.length} resolved`),o.port;{let a=`No address added out of total ${i.length} resolved`;throw go.log(be.LogVerbosity.ERROR,a),new Error(`${a} errors: [${o.errors.join(",")}]`)}}resolvePort(i){return new Promise((s,o)=>{let a=!1,c=(h,d,f,p)=>{if(a)return!0;if(a=!0,!h.ok)return o(new Error(h.error.details)),!0;let g=[].concat(...h.value.map(S=>S.addresses));return g.length===0?(o(new Error(`No addresses resolved for port ${i}`)),!0):(s(g),!0)};(0,IB.createResolver)(i,c,this.options).updateResolution()})}async bindPort(i,s){let o=await this.resolvePort(i);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(o,s);if(s.cancelled)throw this.completeUnbind(s),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let s=(0,ur.parseUri)(i);if(s===null)throw new Error(`Could not parse port "${i}"`);let o=(0,IB.mapUriDefaultScheme)(s);if(o===null)throw new Error(`Could not get a default scheme for port "${i}"`);return o}bindAsync(i,s,o){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(s===null||!(s instanceof PT.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof o!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,p)=>{process.nextTick(()=>o(f,p))},l=this.boundPorts.get((0,ur.uriToString)(a));if(l){if(!s._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>o(null,f),f=>o(f,0)):c(null,l.portNumber);return}l={mapKey:(0,ur.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:s,listeningServers:new Set};let h=(0,ur.splitHostPort)(a.path),d=this.bindPort(a,l);l.completionPromise=d,h?.port===0?d.then(f=>{let p={scheme:a.scheme,authority:a.authority,path:(0,ur.combineHostPort)({host:h.host,port:f})};l.mapKey=(0,ur.uriToString)(p),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),o(null,f)},f=>{o(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,o(null,f)},f=>{o(f,0)}))}registerInjectorToChannelz(){return(0,Ve.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(i,s,o=!1){if(i===null||!(i instanceof PT.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(s);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:s,sessions:c,ownsChannelzRef:o}),{injectConnection:l=>{a.emit("connection",l)},drain:l=>{var h,d;for(let f of c)this.closeSession(f);(d=(h=setTimeout(()=>{for(let f of c)f.destroy(Tt.constants.NGHTTP2_CANCEL)},l)).unref)===null||d===void 0||d.call(h)},destroy:()=>{this.closeServer(a);for(let l of c)this.closeSession(l)}}}createConnectionInjector(i){if(i===null||!(i instanceof PT.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let s=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,s,!0)}closeServer(i,s){this.trace("Closing server with address "+JSON.stringify(i.address()));let o=this.http2Servers.get(i);i.close(()=>{o&&o.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(o.channelzRef),(0,Ve.unregisterChannelzRef)(o.channelzRef)),this.http2Servers.delete(i),s?.()})}closeSession(i,s){var o;this.trace("Closing session initiated by "+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,Ve.unregisterChannelzRef)(a.ref)),s?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let s of i.listeningServers){let o=this.http2Servers.get(s);if(this.closeServer(s,()=>{i.listeningServers.delete(s)}),o)for(let a of o.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let s=this.normalizePort(i),o=(0,ur.splitHostPort)(s.path);if(o?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,ur.uriToString)(s));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,ur.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,s){var o,a;this.trace("drain port="+i+" graceTimeMs="+s);let c=this.normalizePort(i),l=(0,ur.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let h=this.boundPorts.get((0,ur.uriToString)(c));if(!h)return;let d=new Set;for(let f of h.listeningServers){let p=this.http2Servers.get(f);if(p)for(let g of p.sessions)d.add(g),this.closeSession(g,()=>{d.delete(g)})}(a=(o=setTimeout(()=>{for(let f of d)f.destroy(Tt.constants.NGHTTP2_CANCEL)},s)).unref)===null||a===void 0||a.call(o)}forceShutdown(){for(let i of this.boundPorts.values())i.cancelled=!0;this.boundPorts.clear();for(let i of this.http2Servers.keys())this.closeServer(i);this.sessions.forEach((i,s)=>{this.closeSession(s),s.destroy(Tt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Ve.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,s,o,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:s,serialize:o,deserialize:a,type:c,path:i}),!0)}unregister(i){return this.handlers.delete(i)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(i=>!i.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(i){var s;let o=l=>{(0,Ve.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&o()}this.shutdown=!0;for(let[l,h]of this.http2Servers.entries()){a++;let d=h.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(l,()=>{this.trace("Server "+d+" finished closing"),c()});for(let f of h.sessions.keys()){a++;let p=(s=f.socket)===null||s===void 0?void 0:s.remoteAddress;this.trace("Waiting for session "+p+" to close"),this.closeSession(f,()=>{this.trace("Session "+p+" finished closing"),c()})}}a===0&&o()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,s){let o=s[Tt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof o!="string"||!o.startsWith("application/grpc")?(i.respond({[Tt.constants.HTTP2_HEADER_STATUS]:Tt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){FB("Received call to method "+i+" at address "+this.serverAddressString);let s=this.handlers.get(i);return s===void 0?(FB("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):s}_respondWithError(i,s,o=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:be.Status.INTERNAL,"grpc-message":i.details,[Tt.constants.HTTP2_HEADER_STATUS]:Tt.constants.HTTP_STATUS_OK,[Tt.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());s.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),o?.streamTracker.addCallFailed()}_channelzHandler(i,s,o){s.once("error",f=>{}),this.onStreamOpened(s);let a=this.sessions.get(s.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(s,o)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=o[UB],l=this._retrieveHandler(c);if(!l){this._respondWithError(IT(c),s,a);return}let h={addMessageSent:()=>{a&&(a.messagesSent+=1,a.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{a&&(a.messagesReceived+=1,a.lastMessageReceivedTimestamp=new Date)},onCallEnd:f=>{f.code===be.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,LB.getServerInterceptingCall)([...i,...this.interceptors],s,o,h,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:be.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,s,o){if(s.once("error",h=>{}),this.onStreamOpened(s),this._verifyContentType(s,o)!==!0)return;let a=o[UB],c=this._retrieveHandler(a);if(!c){this._respondWithError(IT(a),s,null);return}let l=(0,LB.getServerInterceptingCall)([...i,...this.interceptors],s,o,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:be.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,s){let{type:o}=s;if(o==="unary")Ece(i,s);else if(o==="clientStream")Sce(i,s);else if(o==="serverStream")Tce(i,s);else if(o==="bidi")yce(i,s);else return!1;return!0}_setupHandlers(i,s){if(i===null)return;let o=i.address(),a="null";o&&(typeof o=="string"?a=o:a=o.address+":"+o.port),this.serverAddressString=a;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,l=this.channelzEnabled?this._channelzSessionHandler(i):this._sessionHandler(i);i.on("stream",c.bind(this,s)),i.on("session",l)}_sessionHandler(i){return s=>{var o,a;(o=this.http2Servers.get(i))===null||o===void 0||o.sessions.add(s);let c=null,l=null,h=null,d=!1,f=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==mo){let C=this.maxConnectionAgeMs/10,R=Math.random()*C*2-C;c=setTimeout(()=>{var M,v;d=!0,this.trace("Connection dropped by max connection age: "+((M=s.socket)===null||M===void 0?void 0:M.remoteAddress));try{s.goaway(Tt.constants.NGHTTP2_NO_ERROR,~(1<<31),kB)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==mo&&(l=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(v=l.unref)===null||v===void 0||v.call(l))},this.maxConnectionAgeMs+R),(a=c.unref)===null||a===void 0||a.call(c)}let p=()=>{h&&(clearTimeout(h),h=null)},g=()=>!s.destroyed&&this.keepaliveTimeMs<xT&&this.keepaliveTimeMs>0,S,A=()=>{var C;g()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),h=setTimeout(()=>{p(),S()},this.keepaliveTimeMs),(C=h.unref)===null||C===void 0||C.call(h))};S=()=>{var C;if(!g())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let R="";try{s.ping((v,w,I)=>{p(),v?(this.keepaliveTrace("Ping failed with error: "+v.message),d=!0,s.destroy()):(this.keepaliveTrace("Received ping response"),A())})||(R="Ping returned false")}catch(M){R=(M instanceof Error?M.message:"")||"Unknown error"}if(R){this.keepaliveTrace("Ping send failed: "+R),this.trace("Connection dropped due to ping send error: "+R),d=!0,s.destroy();return}h=setTimeout(()=>{p(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,s.destroy()},this.keepaliveTimeoutMs),(C=h.unref)===null||C===void 0||C.call(h)},A(),s.on("close",()=>{var C,R;d||this.trace(`Connection dropped by client ${(C=s.socket)===null||C===void 0?void 0:C.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),p(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(s)),(R=this.http2Servers.get(i))===null||R===void 0||R.sessions.delete(s)})}}_channelzSessionHandler(i){return s=>{var o,a,c,l;let h=(0,Ve.registerChannelzSocket)((a=(o=s.socket)===null||o===void 0?void 0:o.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,s),this.channelzEnabled),d={ref:h,streamTracker:new Ve.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(s),this.sessions.set(s,d);let f=`${s.socket.remoteAddress}:${s.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+f),this.trace("Connection established by client "+f),this.sessionChildrenTracker.refChild(h);let p=null,g=null,S=null,A=!1,C=this.enableIdleTimeout(s);if(this.maxConnectionAgeMs!==mo){let I=this.maxConnectionAgeMs/10,V=Math.random()*I*2-I;p=setTimeout(()=>{var q;A=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{s.goaway(Tt.constants.NGHTTP2_NO_ERROR,~(1<<31),kB)}catch{s.destroy();return}s.close(),this.maxConnectionAgeGraceMs!==mo&&(g=setTimeout(()=>{s.destroy()},this.maxConnectionAgeGraceMs),(q=g.unref)===null||q===void 0||q.call(g))},this.maxConnectionAgeMs+V),(l=p.unref)===null||l===void 0||l.call(p)}let R=()=>{S&&(clearTimeout(S),S=null)},M=()=>!s.destroyed&&this.keepaliveTimeMs<xT&&this.keepaliveTimeMs>0,v,w=()=>{var I;M()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),S=setTimeout(()=>{R(),v()},this.keepaliveTimeMs),(I=S.unref)===null||I===void 0||I.call(S))};v=()=>{var I;if(!M())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let V="";try{s.ping((Y,F,_)=>{R(),Y?(this.keepaliveTrace("Ping failed with error: "+Y.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+Y.message+" return in "+F),A=!0,s.destroy()):(this.keepaliveTrace("Received ping response"),w())})||(V="Ping returned false")}catch(q){V=(q instanceof Error?q.message:"")||"Unknown error"}if(V){this.keepaliveTrace("Ping send failed: "+V),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+V),A=!0,s.destroy();return}d.keepAlivesSent+=1,S=setTimeout(()=>{R(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+f),A=!0,s.destroy()},this.keepaliveTimeoutMs),(I=S.unref)===null||I===void 0||I.call(S)},w(),s.on("close",()=>{var I;A||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(h),(0,Ve.unregisterChannelzRef)(h),p&&clearTimeout(p),g&&clearTimeout(g),R(),C!==null&&(clearTimeout(C.timeout),this.sessionIdleTimeouts.delete(s)),(I=this.http2Servers.get(i))===null||I===void 0||I.sessions.delete(s),this.sessions.delete(s)})}}enableIdleTimeout(i){var s,o;if(this.sessionIdleTimeout>=DB)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(o=(s=a.timeout).unref)===null||o===void 0||o.call(s),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,s){let{socket:o}=s,a=i.sessionIdleTimeouts.get(s);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+o?.remoteAddress+":"+o?.remotePort+" last idle at "+a.lastIdle),i.closeSession(s)):a.timeout.refresh())}onStreamOpened(i){let s=i.session,o=this.sessionIdleTimeouts.get(s);o&&(o.activeStreams+=1,i.once("close",o.onClose))}onStreamClose(i){var s,o;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress)+":"+((o=i.socket)===null||o===void 0?void 0:o.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[mce("Calling start() is no longer necessary. It can be safely omitted.")],uce(t,null,r,{kind:"method",name:"start",static:!1,private:!1,access:{has:i=>"start"in i,get:i=>i.start},metadata:n},null,e),n&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),t})();$n.Server=_ce;async function Ece(t,e){let r;function n(o,a,c,l){if(o){t.sendStatus((0,_o.serverErrorToStatus)(o,c));return}t.sendMessage(a,()=>{t.sendStatus({code:be.Status.OK,details:"OK",metadata:c??null})})}let i,s=null;t.start({onReceiveMetadata(o){i=o,t.startRead()},onReceiveMessage(o){if(s){t.sendStatus({code:be.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=o,t.startRead()},onReceiveHalfClose(){if(!s){t.sendStatus({code:be.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new _o.ServerWritableStreamImpl(e.path,t,i,s);try{e.func(r,n)}catch(o){t.sendStatus({code:be.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function Sce(t,e){let r;function n(i,s,o,a){if(i){t.sendStatus((0,_o.serverErrorToStatus)(i,o));return}t.sendMessage(s,()=>{t.sendStatus({code:be.Status.OK,details:"OK",metadata:o??null})})}t.start({onReceiveMetadata(i){r=new _o.ServerDuplexStreamImpl(e.path,t,i);try{e.func(r,n)}catch(s){t.sendStatus({code:be.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(i){r.push(i)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function Tce(t,e){let r,n,i=null;t.start({onReceiveMetadata(s){n=s,t.startRead()},onReceiveMessage(s){if(i){t.sendStatus({code:be.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=s,t.startRead()},onReceiveHalfClose(){if(!i){t.sendStatus({code:be.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new _o.ServerWritableStreamImpl(e.path,t,n,i);try{e.func(r)}catch(s){t.sendStatus({code:be.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function yce(t,e){let r;t.start({onReceiveMetadata(n){r=new _o.ServerDuplexStreamImpl(e.path,t,n);try{e.func(r)}catch(i){t.sendStatus({code:be.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onReceiveMessage(n){r.push(n)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}});var VB=m(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.StatusBuilder=void 0;var LT=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};df.StatusBuilder=LT});var Ec=m(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.LeafLoadBalancer=Ur.PickFirstLoadBalancer=Ur.PickFirstLoadBalancingConfig=void 0;Ur.shuffled=zB;Ur.setup=Nce;var DT=wn(),Me=at(),Wn=Wr(),qB=Et(),vce=Ee(),Ace=te(),GB=Et(),HB=L("net"),Cce=Ti(),Rce="pick_first";function mc(t){vce.trace(Ace.LogVerbosity.DEBUG,Rce,t)}var gc="pick_first",Oce=250,Eo=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return gc}toJsonObject(){return{[gc]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new t(e.shuffleAddressList===!0)}};Ur.PickFirstLoadBalancingConfig=Eo;var UT=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Wn.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function zB(t){let e=t.slice();for(let r=e.length-1;r>1;r--){let n=Math.floor(Math.random()*(r+1)),i=e[r];e[r]=e[n],e[n]=i}return e}function bce(t){if(t.length===0)return[];let e=[],r=[],n=[],i=(0,GB.isTcpSubchannelAddress)(t[0])&&(0,HB.isIPv6)(t[0].host);for(let a of t)(0,GB.isTcpSubchannelAddress)(a)&&(0,HB.isIPv6)(a.host)?r.push(a):n.push(a);let s=i?r:n,o=i?n:r;for(let a=0;a<Math.max(s.length,o.length);a++)a<s.length&&e.push(s[a]),a<o.length&&e.push(o[a]);return e}var jB="grpc-node.internal.pick-first.report_health_status",_c=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Me.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,n,i,s,o)=>{this.onSubchannelStateUpdate(r,n,i,o)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let r=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(Me.ConnectivityState.TRANSIENT_FAILURE,new Wn.UnavailablePicker({details:r}),r)}else this.updateState(Me.ConnectivityState.READY,new UT(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(Me.ConnectivityState.TRANSIENT_FAILURE,new Wn.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(Me.ConnectivityState.IDLE,new Wn.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(Me.ConnectivityState.TRANSIENT_FAILURE,new Wn.UnavailablePicker({details:r}),r)}else this.updateState(Me.ConnectivityState.CONNECTING,new Wn.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,r,n,i){var s;if(!((s=this.currentPick)===null||s===void 0)&&s.realSubchannelEquals(e)){n!==Me.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[o,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===Me.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===Me.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),o===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(o+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[r,n]of this.children.entries())if(r>=e){let i=n.subchannel.getConnectivityState();if(i===Me.ConnectivityState.IDLE||i===Me.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===Me.ConnectivityState.IDLE&&(mc("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var i;(i=this.children[e])===null||i===void 0||i.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},Oce),(n=(r=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(r)}pickSubchannel(e){mc("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,r,n){mc(Me.ConnectivityState[this.currentState]+" -> "+Me.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,r){mc("connectToAddressList(["+e.map(i=>(0,qB.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,r),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===Me.ConnectivityState.READY){this.pickSubchannel(i);return}for(let{subchannel:i}of n)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:i}of this.children)i.addConnectivityStateListener(this.subchannelStateListener);for(let i of this.children)i.subchannel.getConnectivityState()===Me.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,n,i){if(!(r instanceof Eo))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(Me.ConnectivityState.TRANSIENT_FAILURE,new Wn.UnavailablePicker(e.error),e.error.details),!0;let s=e.value;this.reportHealthStatus=n[jB],r.getShuffleAddressList()&&(s=zB(s));let o=[].concat(...s.map(c=>c.addresses));mc("updateAddressList(["+o.map(c=>(0,qB.subchannelAddressToString)(c))+"])");let a=bce(o);return this.latestAddressList=a,this.latestOptions=n,this.connectToAddressList(a,n),this.latestResolutionNote=i,o.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===Me.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return gc}};Ur.PickFirstLoadBalancer=_c;var Mce=new Eo(!1),kT=class{constructor(e,r,n,i){this.endpoint=e,this.options=n,this.resolutionNote=i,this.latestState=Me.ConnectivityState.IDLE;let s=(0,DT.createChildChannelControlHelper)(r,{updateState:(o,a,c)=>{this.latestState=o,this.latestPicker=a,r.updateState(o,a,c)}});this.pickFirstBalancer=new _c(s),this.latestPicker=new Wn.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,Cce.statusOrFromValue)([this.endpoint]),Mce,Object.assign(Object.assign({},this.options),{[jB]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==Me.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};Ur.LeafLoadBalancer=kT;function Nce(){(0,DT.registerLoadBalancerType)(gc,_c,Eo),(0,DT.registerDefaultLoadBalancerType)(gc)}});var $B=m(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.FileWatcherCertificateProvider=void 0;var wce=L("fs"),Pce=Ee(),xce=te(),Ice=L("util"),Lce="certificate_provider";function ff(t){Pce.trace(xce.LogVerbosity.DEBUG,Lce,t)}var FT=(0,Ice.promisify)(wce.readFile),BT=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");ff("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?FT(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?FT(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?FT(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,n])=>{if(this.refreshTimer){ff("File watcher read certificates certificate "+e.status+", privateKey "+r.status+", CA certificate "+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&r.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:r.value}:this.latestIdentityUpdate=null,n.status==="fulfilled"?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let i of this.identityListeners)i(this.latestIdentityUpdate);for(let i of this.caListeners)i(this.latestCaUpdate)}}),ff("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),ff("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};pf.FileWatcherCertificateProvider=BT});var GT=m(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=k.createCertificateProviderChannelCredentials=k.FileWatcherCertificateProvider=k.createCertificateProviderServerCredentials=k.createServerCredentialsWithInterceptors=k.BaseSubchannelWrapper=k.registerAdminService=k.FilterStackFactory=k.BaseFilter=k.statusOrFromError=k.statusOrFromValue=k.PickResultType=k.QueuePicker=k.UnavailablePicker=k.ChildLoadBalancerHandler=k.EndpointMap=k.endpointHasAddress=k.endpointToString=k.subchannelAddressToString=k.LeafLoadBalancer=k.isLoadBalancerNameRegistered=k.parseLoadBalancingConfig=k.selectLbConfigFromList=k.registerLoadBalancerType=k.createChildChannelControlHelper=k.BackoffTimeout=k.parseDuration=k.durationToMs=k.splitHostPort=k.uriToString=k.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=k.createResolver=k.registerResolver=k.log=k.trace=void 0;var WB=Ee();Object.defineProperty(k,"trace",{enumerable:!0,get:function(){return WB.trace}});Object.defineProperty(k,"log",{enumerable:!0,get:function(){return WB.log}});var VT=Xt();Object.defineProperty(k,"registerResolver",{enumerable:!0,get:function(){return VT.registerResolver}});Object.defineProperty(k,"createResolver",{enumerable:!0,get:function(){return VT.createResolver}});Object.defineProperty(k,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return VT.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var YB=ot();Object.defineProperty(k,"uriToString",{enumerable:!0,get:function(){return YB.uriToString}});Object.defineProperty(k,"splitHostPort",{enumerable:!0,get:function(){return YB.splitHostPort}});var KB=pc();Object.defineProperty(k,"durationToMs",{enumerable:!0,get:function(){return KB.durationToMs}});Object.defineProperty(k,"parseDuration",{enumerable:!0,get:function(){return KB.parseDuration}});var Dce=Vs();Object.defineProperty(k,"BackoffTimeout",{enumerable:!0,get:function(){return Dce.BackoffTimeout}});var Sc=wn();Object.defineProperty(k,"createChildChannelControlHelper",{enumerable:!0,get:function(){return Sc.createChildChannelControlHelper}});Object.defineProperty(k,"registerLoadBalancerType",{enumerable:!0,get:function(){return Sc.registerLoadBalancerType}});Object.defineProperty(k,"selectLbConfigFromList",{enumerable:!0,get:function(){return Sc.selectLbConfigFromList}});Object.defineProperty(k,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return Sc.parseLoadBalancingConfig}});Object.defineProperty(k,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return Sc.isLoadBalancerNameRegistered}});var Uce=Ec();Object.defineProperty(k,"LeafLoadBalancer",{enumerable:!0,get:function(){return Uce.LeafLoadBalancer}});var mf=Et();Object.defineProperty(k,"subchannelAddressToString",{enumerable:!0,get:function(){return mf.subchannelAddressToString}});Object.defineProperty(k,"endpointToString",{enumerable:!0,get:function(){return mf.endpointToString}});Object.defineProperty(k,"endpointHasAddress",{enumerable:!0,get:function(){return mf.endpointHasAddress}});Object.defineProperty(k,"EndpointMap",{enumerable:!0,get:function(){return mf.EndpointMap}});var kce=Vh();Object.defineProperty(k,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return kce.ChildLoadBalancerHandler}});var qT=Wr();Object.defineProperty(k,"UnavailablePicker",{enumerable:!0,get:function(){return qT.UnavailablePicker}});Object.defineProperty(k,"QueuePicker",{enumerable:!0,get:function(){return qT.QueuePicker}});Object.defineProperty(k,"PickResultType",{enumerable:!0,get:function(){return qT.PickResultType}});var XB=Ti();Object.defineProperty(k,"statusOrFromValue",{enumerable:!0,get:function(){return XB.statusOrFromValue}});Object.defineProperty(k,"statusOrFromError",{enumerable:!0,get:function(){return XB.statusOrFromError}});var Fce=gS();Object.defineProperty(k,"BaseFilter",{enumerable:!0,get:function(){return Fce.BaseFilter}});var Bce=kd();Object.defineProperty(k,"FilterStackFactory",{enumerable:!0,get:function(){return Bce.FilterStackFactory}});var Vce=zh();Object.defineProperty(k,"registerAdminService",{enumerable:!0,get:function(){return Vce.registerAdminService}});var qce=dc();Object.defineProperty(k,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return qce.BaseSubchannelWrapper}});var JB=sf();Object.defineProperty(k,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return JB.createServerCredentialsWithInterceptors}});Object.defineProperty(k,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return JB.createCertificateProviderServerCredentials}});var Gce=$B();Object.defineProperty(k,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return Gce.FileWatcherCertificateProvider}});var Hce=Bs();Object.defineProperty(k,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return Hce.createCertificateProviderChannelCredentials}});var zce=iT();Object.defineProperty(k,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return zce.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var QB=m(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});zT.setup=Wce;var jce=Xt(),$ce=Ti(),HT=class{constructor(e,r,n){this.listener=r,this.hasReturnedResult=!1,this.endpoints=[];let i;e.authority===""?i="/"+e.path:i=e.path,this.endpoints=[{addresses:[{path:i}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,$ce.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function Wce(){(0,jce.registerResolver)("unix",HT)}});var iV=m(YT=>{"use strict";Object.defineProperty(YT,"__esModule",{value:!0});YT.setup=Qce;var ZB=L("net"),eV=Ti(),gf=te(),jT=He(),tV=Xt(),Yce=Et(),rV=ot(),Kce=Ee(),Xce="ip_resolver";function nV(t){Kce.trace(gf.LogVerbosity.DEBUG,Xce,t)}var $T="ipv4",WT="ipv6",Jce=443,_f=class{constructor(e,r,n){var i;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,nV("Resolver constructed for target "+(0,rV.uriToString)(e));let s=[];if(!(e.scheme===$T||e.scheme===WT)){this.error={code:gf.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new jT.Metadata};return}let o=e.path.split(",");for(let a of o){let c=(0,rV.splitHostPort)(a);if(c===null){this.error={code:gf.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new jT.Metadata};return}if(e.scheme===$T&&!(0,ZB.isIPv4)(c.host)||e.scheme===WT&&!(0,ZB.isIPv6)(c.host)){this.error={code:gf.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new jT.Metadata};return}s.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:Jce})}this.endpoints=s.map(a=>({addresses:[a]})),nV("Parsed "+e.scheme+" address list "+s.map(Yce.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,eV.statusOrFromError)(this.error),{},null,""):this.listener((0,eV.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function Qce(){(0,tV.registerResolver)($T,_f),(0,tV.registerResolver)(WT,_f)}});var cV=m(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.RoundRobinLoadBalancer=void 0;yc.setup=ile;var aV=wn(),et=at(),Tc=Wr(),Zce=Ee(),ele=te(),sV=Et(),tle=Ec(),rle="round_robin";function oV(t){Zce.trace(ele.LogVerbosity.DEBUG,rle,t)}var Ef="round_robin",Sf=class t{getLoadBalancerName(){return Ef}constructor(){}toJsonObject(){return{[Ef]:{}}}static createFromJson(e){return new t}},KT=class{constructor(e,r=0){this.children=e,this.nextIndex=r}pick(e){let r=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,r.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function nle(t,e){return[...t.slice(e),...t.slice(0,e)]}var Tf=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=et.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,aV.createChildChannelControlHelper)(e,{updateState:(r,n,i)=>{this.currentState===et.ConnectivityState.READY&&r!==et.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),i&&(this.lastError=i),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(r=>r.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(et.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===et.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(i=>(0,sV.endpointEqual)(i.getEndpoint(),n)),r<0&&(r=0)}this.updateState(et.ConnectivityState.READY,new KT(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),r),null)}else if(this.countChildrenWithState(et.ConnectivityState.CONNECTING)>0)this.updateState(et.ConnectivityState.CONNECTING,new Tc.QueuePicker(this),null);else if(this.countChildrenWithState(et.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(et.ConnectivityState.TRANSIENT_FAILURE,new Tc.UnavailablePicker({details:e}),e)}else this.updateState(et.ConnectivityState.IDLE,new Tc.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===et.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){oV(et.ConnectivityState[this.currentState]+" -> "+et.ConnectivityState[e]),e===et.ConnectivityState.READY?this.currentReadyPicker=r:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,r,n,i){if(!(r instanceof Sf))return!1;if(!e.ok)return this.children.length===0&&this.updateState(et.ConnectivityState.TRANSIENT_FAILURE,new Tc.UnavailablePicker(e.error),e.error.details),!0;let s=Math.random()*e.value.length|0,o=nle(e.value,s);if(this.resetSubchannelList(),o.length===0){let a=`No addresses resolved. Resolution note: ${i}`;this.updateState(et.ConnectivityState.TRANSIENT_FAILURE,new Tc.UnavailablePicker({details:a}),a)}oV("Connect to endpoint list "+o.map(sV.endpointToString)),this.updatesPaused=!0,this.children=o.map(a=>new tle.LeafLoadBalancer(a,this.childChannelControlHelper,n,i));for(let a of this.children)a.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return Ef}};yc.RoundRobinLoadBalancer=Tf;function ile(){(0,aV.registerLoadBalancerType)(Ef,Tf,Sf)}});var hV=m(Vi=>{"use strict";var XT;Object.defineProperty(Vi,"__esModule",{value:!0});Vi.OutlierDetectionLoadBalancer=Vi.OutlierDetectionLoadBalancingConfig=void 0;Vi.setup=mle;var sle=at(),lV=te(),Bi=pc(),uV=GT(),ole=wn(),ale=Vh(),cle=Wr(),JT=Et(),lle=dc(),ule=Ee(),hle="outlier_detection";function We(t){ule.trace(lV.LogVerbosity.DEBUG,hle,t)}var ny="outlier_detection",dle=((XT=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&XT!==void 0?XT:"true")==="true",fle={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},ple={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function So(t,e,r,n){if(e in t&&t[e]!==void 0&&typeof t[e]!==r){let i=n?`${n}.${e}`:e;throw new Error(`outlier detection config ${i} parse error: expected ${r}, got ${typeof t[e]}`)}}function QT(t,e,r){let n=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,Bi.isDuration)(t[e]))throw new Error(`outlier detection config ${n} parse error: expected Duration, got ${typeof t[e]}`);if(!(t[e].seconds>=0&&t[e].seconds<=315576e6&&t[e].nanos>=0&&t[e].nanos<=999999999))throw new Error(`outlier detection config ${n} parse error: values out of range for non-negative Duaration`)}}function yf(t,e,r){let n=r?`${r}.${e}`:e;if(So(t,e,"number",r),e in t&&t[e]!==void 0&&!(t[e]>=0&&t[e]<=100))throw new Error(`outlier detection config ${n} parse error: value out of range for percentage (0-100)`)}var vc=class t{constructor(e,r,n,i,s,o,a){if(this.childPolicy=a,a.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=r??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=i??10,this.successRateEjection=s?Object.assign(Object.assign({},fle),s):null,this.failurePercentageEjection=o?Object.assign(Object.assign({},ple),o):null}getLoadBalancerName(){return ny}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,Bi.msToDuration)(this.intervalMs),base_ejection_time:(0,Bi.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,Bi.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(r=this.failurePercentageEjection)!==null&&r!==void 0?r:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var r;if(QT(e,"interval"),QT(e,"base_ejection_time"),QT(e,"max_ejection_time"),yf(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");So(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),yf(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),So(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),So(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");yf(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),yf(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),So(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),So(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let n=(0,ole.selectLbConfigFromList)(e.child_policy);if(!n)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new t(e.interval?(0,Bi.durationToMs)(e.interval):null,e.base_ejection_time?(0,Bi.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,Bi.durationToMs)(e.max_ejection_time):null,(r=e.max_ejection_percent)!==null&&r!==void 0?r:null,e.success_rate_ejection,e.failure_percentage_ejection,n)}};Vi.OutlierDetectionLoadBalancingConfig=vc;var ey=class extends lle.BaseSubchannelWrapper{constructor(e,r){super(e),this.mapEntry=r,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function ZT(){return{success:0,failure:0}}var ty=class{constructor(){this.activeBucket=ZT(),this.inactiveBucket=ZT()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=ZT()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},ry=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===cle.PickResultType.COMPLETE){let n=r.subchannel,i=n.getMapEntry();if(i){let s=r.onCallEnded;return this.countCalls&&(s=(o,a,c)=>{var l;o===lV.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(l=r.onCallEnded)===null||l===void 0||l.call(r,o,a,c)}),Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel(),onCallEnded:s})}else return Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel()})}else return r}},vf=class{constructor(e){this.entryMap=new JT.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new ale.ChildLoadBalancerHandler((0,uV.createChildChannelControlHelper)(e,{createSubchannel:(r,n)=>{let i=e.createSubchannel(r,n),s=this.entryMap.getForSubchannelAddress(r),o=new ey(i,s);return s?.currentEjectionTimestamp!==null&&o.eject(),s?.subchannelWrappers.push(o),o},updateState:(r,n,i)=>{r===sle.ConnectivityState.READY?e.updateState(r,new ry(n,this.isCountingEnabled()),i):e.updateState(r,n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let r of this.entryMap.values())r.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getSuccessRateEjectionConfig();if(!r)return;We("Running success rate check");let n=r.request_volume,i=0,s=[];for(let[d,f]of this.entryMap.entries()){let p=f.counter.getLastSuccesses(),g=f.counter.getLastFailures();We("Stats for "+(0,JT.endpointToString)(d)+": successes="+p+" failures="+g+" targetRequestVolume="+n),p+g>=n&&(i+=1,s.push(p/(p+g)))}if(We("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+s+"]"),i<r.minimum_hosts)return;let o=s.reduce((d,f)=>d+f)/s.length,a=0;for(let d of s){let f=d-o;a+=f*f}let c=a/s.length,l=Math.sqrt(c),h=o-l*(r.stdev_factor/1e3);We("stdev="+l+" ejectionThreshold="+h);for(let[d,f]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let p=f.counter.getLastSuccesses(),g=f.counter.getLastFailures();if(p+g<n)continue;let S=p/(p+g);if(We("Checking candidate "+d+" successRate="+S),S<h){let A=Math.random()*100;We("Candidate "+d+" randomNumber="+A+" enforcement_percentage="+r.enforcement_percentage),A<r.enforcement_percentage&&(We("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;We("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let n=0;for(let i of this.entryMap.values()){let s=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();s+o>=r.request_volume&&(n+=1)}if(!(n<r.minimum_hosts))for(let[i,s]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let o=s.counter.getLastSuccesses(),a=s.counter.getLastFailures();if(We("Candidate successes="+o+" failures="+a),o+a<r.request_volume)continue;if(a*100/(a+o)>r.threshold){let l=Math.random()*100;We("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+r.enforcement_percentage),l<r.enforcement_percentage&&(We("Ejecting candidate "+i),this.eject(s,e))}}}eject(e,r){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let n of e.subchannelWrappers)n.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let r of e.subchannelWrappers)r.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var r,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(r=this.ejectionTimer).unref)===null||n===void 0||n.call(r)}runChecks(){let e=new Date;if(We("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[r,n]of this.entryMap.entries())if(n.currentEjectionTimestamp===null)n.ejectionTimeMultiplier>0&&(n.ejectionTimeMultiplier-=1);else{let i=this.latestConfig.getBaseEjectionTimeMs(),s=this.latestConfig.getMaxEjectionTimeMs(),o=new Date(n.currentEjectionTimestamp.getTime());o.setMilliseconds(o.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,s))),o<new Date&&(We("Unejecting "+r),this.uneject(n))}}}updateAddressList(e,r,n,i){if(!(r instanceof vc))return!1;if(We("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let o of e.value)this.entryMap.has(o)||(We("Adding map entry for "+(0,JT.endpointToString)(o)),this.entryMap.set(o,{counter:new ty,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let s=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,s,n,i),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){We("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let o=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(o)}else We("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{We("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let o of this.entryMap.values())this.uneject(o),o.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return ny}};Vi.OutlierDetectionLoadBalancer=vf;function mle(){dle&&(0,uV.registerLoadBalancerType)(ny,vf,vc)}});var dV=m(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.PriorityQueue=void 0;var To=0,iy=t=>Math.floor(t/2),Af=t=>t*2+1,Ac=t=>t*2+2,sy=class{constructor(e=(r,n)=>r>n){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[To]}push(...e){return e.forEach(r=>{this.heap.push(r),this.siftUp()}),this.size()}pop(){let e=this.peek(),r=this.size()-1;return r>To&&this.swap(To,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[To]=e,this.siftDown(),r}greater(e,r){return this.comparator(this.heap[e],this.heap[r])}swap(e,r){[this.heap[e],this.heap[r]]=[this.heap[r],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>To&&this.greater(e,iy(e));)this.swap(e,iy(e)),e=iy(e)}siftDown(){let e=To;for(;Af(e)<this.size()&&this.greater(Af(e),e)||Ac(e)<this.size()&&this.greater(Ac(e),e);){let r=Ac(e)<this.size()&&this.greater(Ac(e),Af(e))?Ac(e):Af(e);this.swap(e,r),e=r}}};Cf.PriorityQueue=sy});var _V=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.WeightedRoundRobinLoadBalancingConfig=void 0;Rc.setup=Ole;var Ye=at(),gle=te(),bt=pc(),mV=wn(),_le=Ec(),Ele=Ee(),gV=af(),yo=Wr(),Sle=dV(),fV=Et(),Tle="weighted_round_robin";function oy(t){Ele.trace(gle.LogVerbosity.DEBUG,Tle,t)}var ly="weighted_round_robin",yle=1e4,vle=1e4,Ale=3*6e4,Cle=1e3,Rle=1;function pV(t,e,r){if(e in t&&t[e]!==void 0&&typeof t[e]!==r)throw new Error(`weighted round robin config ${e} parse error: expected ${r}, got ${typeof t[e]}`)}function Rf(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,bt.isDuration)(t[e]))r=t[e];else if((0,bt.isDurationMessage)(t[e]))r=(0,bt.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let n=(0,bt.parseDuration)(t[e]);if(!n)throw new Error(`weighted round robin config ${e}: failed to parse duration string ${t[e]}`);r=n}else throw new Error(`weighted round robin config ${e}: expected duration, got ${typeof t[e]}`);return(0,bt.durationToMs)(r)}return null}var Cc=class t{constructor(e,r,n,i,s,o){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??yle,this.blackoutPeriodMs=n??vle,this.weightExpirationPeriodMs=i??Ale,this.weightUpdatePeriodMs=Math.max(s??Cle,100),this.errorUtilizationPenalty=o??Rle}getLoadBalancerName(){return ly}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,bt.durationToString)((0,bt.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,bt.durationToString)((0,bt.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,bt.durationToString)((0,bt.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,bt.durationToString)((0,bt.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if(pV(e,"enable_oob_load_report","boolean"),pV(e,"error_utilization_penalty","number"),e.error_utilization_penalty<0)throw new Error("weighted round robin config error_utilization_penalty < 0");return new t(e.enable_oob_load_report,Rf(e,"oob_load_reporting_period"),Rf(e,"blackout_period"),Rf(e,"weight_expiration_period"),Rf(e,"weight_update_period"),e.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}};Rc.WeightedRoundRobinLoadBalancingConfig=Cc;var ay=class{constructor(e,r){this.metricsHandler=r,this.queue=new Sle.PriorityQueue((s,o)=>s.deadline<o.deadline);let n=e.filter(s=>s.weight>0),i;if(n.length<2)i=1;else{let s=0;for(let{weight:o}of n)s+=o;i=s/n.length}for(let s of e){let o=s.weight>0?1/s.weight:i;this.queue.push({endpointName:s.endpointName,picker:s.picker,period:o,deadline:Math.random()*o})}}pick(e){let r=this.queue.pop();this.queue.push(Object.assign(Object.assign({},r),{deadline:r.deadline+r.period}));let n=r.picker.pick(e);if(n.pickResultType===yo.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,gV.createMetricsReader)(i=>this.metricsHandler(i,r.endpointName),n.onCallEnded)});{let i=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:i.getWrappedSubchannel()})}}else return n}},cy=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=Ye.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let r=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(r+=1);return r}updateWeight(e,r){var n,i;let s=r.rps_fractional,o=r.application_utilization;o>0&&s>0&&(o+=r.eps/s*((i=(n=this.latestConfig)===null||n===void 0?void 0:n.getErrorUtilizationPenalty())!==null&&i!==void 0?i:0));let a=o===0?0:s/o;if(a===0)return;let c=new Date;e.nonEmptySince===null&&(e.nonEmptySince=c),e.lastUpdated=c,e.weight=a}getWeight(e){if(!this.latestConfig)return 0;let r=new Date().getTime();if(r-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||r-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(Ye.ConnectivityState.READY)>0){let e=[];for(let[n,i]of this.children)i.child.getConnectivityState()===Ye.ConnectivityState.READY&&e.push({endpointName:n,picker:i.child.getPicker(),weight:this.getWeight(i)});oy("Created picker with weights: "+e.map(n=>n.endpointName+":"+n.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(n,i)=>{let s=this.children.get(i);s&&this.updateWeight(s,n)},this.updateState(Ye.ConnectivityState.READY,new ay(e,r),null)}else if(this.countChildrenWithState(Ye.ConnectivityState.CONNECTING)>0)this.updateState(Ye.ConnectivityState.CONNECTING,new yo.QueuePicker(this),null);else if(this.countChildrenWithState(Ye.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Ye.ConnectivityState.TRANSIENT_FAILURE,new yo.UnavailablePicker({details:e}),e)}else this.updateState(Ye.ConnectivityState.IDLE,new yo.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===Ye.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){oy(Ye.ConnectivityState[this.currentState]+" -> "+Ye.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}updateAddressList(e,r,n,i){var s,o;if(!(r instanceof Cc))return!1;if(!e.ok)return this.children.size===0&&this.updateState(Ye.ConnectivityState.TRANSIENT_FAILURE,new yo.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let l=`No addresses resolved. Resolution note: ${i}`;return this.updateState(Ye.ConnectivityState.TRANSIENT_FAILURE,new yo.UnavailablePicker({details:l}),l),!1}oy("Connect to endpoint list "+e.value.map(fV.endpointToString));let a=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let l of e.value){let h=(0,fV.endpointToString)(l);c.add(h);let d=this.children.get(h);d||(d={child:new _le.LeafLoadBalancer(l,(0,mV.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(f,p,g)=>{this.currentState===Ye.ConnectivityState.READY&&f!==Ye.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),f===Ye.ConnectivityState.READY&&(d.nonEmptySince=null),g&&(this.lastError=g),this.calculateAndUpdateState()},createSubchannel:(f,p)=>{let g=this.channelControlHelper.createSubchannel(f,p);return d?.oobMetricsListener?new gV.OrcaOobMetricsSubchannelWrapper(g,d.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):g}}),n,i),lastUpdated:a,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(h,d)),r.getEnableOobLoadReport()?d.oobMetricsListener=f=>{this.updateWeight(d,f)}:d.oobMetricsListener=null}for(let[l,h]of this.children)c.has(l)?h.child.startConnecting():(h.child.destroy(),this.children.delete(l));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(o=(s=setInterval(()=>{this.currentState===Ye.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||o===void 0?void 0:o.call(s),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return ly}};function Ole(){(0,mV.registerLoadBalancerType)(ly,cy,Cc)}});var Oc=m(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.experimental=U.ServerMetricRecorder=U.ServerInterceptingCall=U.ResponderBuilder=U.ServerListenerBuilder=U.addAdminServicesToServer=U.getChannelzHandlers=U.getChannelzServiceDefinition=U.InterceptorConfigurationError=U.InterceptingCall=U.RequesterBuilder=U.ListenerBuilder=U.StatusBuilder=U.getClientChannel=U.ServerCredentials=U.Server=U.setLogVerbosity=U.setLogger=U.load=U.loadObject=U.CallCredentials=U.ChannelCredentials=U.waitForClientReady=U.closeClient=U.Channel=U.makeGenericClientConstructor=U.makeClientConstructor=U.loadPackageDefinition=U.Client=U.compressionAlgorithms=U.propagate=U.connectivityState=U.status=U.logVerbosity=U.Metadata=U.credentials=void 0;var Of=Nh();Object.defineProperty(U,"CallCredentials",{enumerable:!0,get:function(){return Of.CallCredentials}});var ble=J_();Object.defineProperty(U,"Channel",{enumerable:!0,get:function(){return ble.ChannelImplementation}});var Mle=pS();Object.defineProperty(U,"compressionAlgorithms",{enumerable:!0,get:function(){return Mle.CompressionAlgorithms}});var Nle=at();Object.defineProperty(U,"connectivityState",{enumerable:!0,get:function(){return Nle.ConnectivityState}});var bf=Bs();Object.defineProperty(U,"ChannelCredentials",{enumerable:!0,get:function(){return bf.ChannelCredentials}});var EV=X_();Object.defineProperty(U,"Client",{enumerable:!0,get:function(){return EV.Client}});var uy=te();Object.defineProperty(U,"logVerbosity",{enumerable:!0,get:function(){return uy.LogVerbosity}});Object.defineProperty(U,"status",{enumerable:!0,get:function(){return uy.Status}});Object.defineProperty(U,"propagate",{enumerable:!0,get:function(){return uy.Propagate}});var SV=Ee(),hy=Kh();Object.defineProperty(U,"loadPackageDefinition",{enumerable:!0,get:function(){return hy.loadPackageDefinition}});Object.defineProperty(U,"makeClientConstructor",{enumerable:!0,get:function(){return hy.makeClientConstructor}});Object.defineProperty(U,"makeGenericClientConstructor",{enumerable:!0,get:function(){return hy.makeClientConstructor}});var wle=He();Object.defineProperty(U,"Metadata",{enumerable:!0,get:function(){return wle.Metadata}});var Ple=BB();Object.defineProperty(U,"Server",{enumerable:!0,get:function(){return Ple.Server}});var xle=sf();Object.defineProperty(U,"ServerCredentials",{enumerable:!0,get:function(){return xle.ServerCredentials}});var Ile=VB();Object.defineProperty(U,"StatusBuilder",{enumerable:!0,get:function(){return Ile.StatusBuilder}});U.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),combineCallCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),createInsecure:bf.ChannelCredentials.createInsecure,createSsl:bf.ChannelCredentials.createSsl,createFromSecureContext:bf.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:Of.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:Of.CallCredentials.createFromGoogleCredential,createEmpty:Of.CallCredentials.createEmpty};var Lle=t=>t.close();U.closeClient=Lle;var Dle=(t,e,r)=>t.waitForReady(e,r);U.waitForClientReady=Dle;var Ule=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};U.loadObject=Ule;var kle=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};U.load=kle;var Fle=t=>{SV.setLogger(t)};U.setLogger=Fle;var Ble=t=>{SV.setLoggerVerbosity(t)};U.setLogVerbosity=Ble;var Vle=t=>EV.Client.prototype.getChannel.call(t);U.getClientChannel=Vle;var Mf=W_();Object.defineProperty(U,"ListenerBuilder",{enumerable:!0,get:function(){return Mf.ListenerBuilder}});Object.defineProperty(U,"RequesterBuilder",{enumerable:!0,get:function(){return Mf.RequesterBuilder}});Object.defineProperty(U,"InterceptingCall",{enumerable:!0,get:function(){return Mf.InterceptingCall}});Object.defineProperty(U,"InterceptorConfigurationError",{enumerable:!0,get:function(){return Mf.InterceptorConfigurationError}});var TV=Vn();Object.defineProperty(U,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return TV.getChannelzServiceDefinition}});Object.defineProperty(U,"getChannelzHandlers",{enumerable:!0,get:function(){return TV.getChannelzHandlers}});var qle=zh();Object.defineProperty(U,"addAdminServicesToServer",{enumerable:!0,get:function(){return qle.addAdminServicesToServer}});var dy=wT();Object.defineProperty(U,"ServerListenerBuilder",{enumerable:!0,get:function(){return dy.ServerListenerBuilder}});Object.defineProperty(U,"ResponderBuilder",{enumerable:!0,get:function(){return dy.ResponderBuilder}});Object.defineProperty(U,"ServerInterceptingCall",{enumerable:!0,get:function(){return dy.ServerInterceptingCall}});var Gle=af();Object.defineProperty(U,"ServerMetricRecorder",{enumerable:!0,get:function(){return Gle.ServerMetricRecorder}});var Hle=GT();U.experimental=Hle;var zle=IS(),jle=QB(),$le=iV(),Wle=Ec(),Yle=cV(),Kle=hV(),Xle=_V(),Jle=Vn();zle.setup(),jle.setup(),$le.setup(),Wle.setup(),Yle.setup(),Kle.setup(),Xle.setup(),Jle.setup()});var yV=m(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.createServiceClientConstructor=void 0;var Qle=Oc();function Zle(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:n=>n,requestDeserialize:n=>n,responseSerialize:n=>n,responseDeserialize:n=>n}};return Qle.makeGenericClientConstructor(r,e)}Nf.createServiceClientConstructor=Zle});var bc=m(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.createOtlpGrpcExporterTransport=qt.GrpcExporterTransport=qt.createEmptyMetadata=qt.createSslCredentials=qt.createInsecureCredentials=void 0;var eue=uU(),vV=`OTel-OTLP-Exporter-JavaScript/${eue.VERSION}`;function tue(t){return t?`${t} ${vV}`:vV}var rue=0,nue=2;function iue(t){return t==="gzip"?nue:rue}function sue(){let{credentials:t}=Oc();return t.createInsecure()}qt.createInsecureCredentials=sue;function oue(t,e,r){let{credentials:n}=Oc();return n.createSsl(t,e,r)}qt.createSslCredentials=oue;function aue(){let{Metadata:t}=Oc();return new t}qt.createEmptyMetadata=aue;var wf=class{_client;_metadata;_parameters;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,r){let n=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:i}=yV();try{this._metadata=this._parameters.metadata()}catch(o){return Promise.resolve({status:"failure",error:o})}let s=i(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new s(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":iue(this._parameters.compression),"grpc.primary_user_agent":tue(this._parameters.userAgent)})}catch(o){return Promise.resolve({status:"failure",error:o})}}return new Promise(i=>{let s=Date.now()+r;if(this._metadata==null)return i({error:new Error("metadata was null"),status:"failure"});this._client.export(n,this._metadata,{deadline:s},(o,a)=>{i(o?{status:"failure",error:o}:{data:a,status:"success"})})})}};qt.GrpcExporterTransport=wf;function cue(t){return new wf(t)}qt.createOtlpGrpcExporterTransport=cue});var bV=m(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getOtlpGrpcDefaultConfiguration=Yn.mergeOtlpGrpcConfigurationWithDefaults=Yn.validateAndNormalizeUrl=void 0;var RV=(oh(),Xe(Fg)),Mc=bc(),lue=L("url"),AV=(Q(),Xe(cn));function OV(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new lue.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&AV.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),r.protocol!==""&&!r.protocol?.match(/^(http)s?:$/)&&AV.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}Yn.validateAndNormalizeUrl=OV;function CV(t,e){for(let[r,n]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,n)}function uue(t,e,r){let n=t.url??e.url??r.url;return{...(0,RV.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let i=r.metadata();return CV(i,t.metadata?.().clone()??(0,Mc.createEmptyMetadata)()),CV(i,e.metadata?.()??(0,Mc.createEmptyMetadata)()),i},url:OV(n),credentials:t.credentials??e.credentials?.(n)??r.credentials(n),userAgent:t.userAgent}}Yn.mergeOtlpGrpcConfigurationWithDefaults=uue;function hue(){return{...(0,RV.getSharedConfigurationDefaults)(),metadata:()=>(0,Mc.createEmptyMetadata)(),url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,Mc.createInsecureCredentials)():()=>(0,Mc.createSslCredentials)()}}Yn.getOtlpGrpcDefaultConfiguration=hue});var xV=m(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.getOtlpGrpcConfigurationFromEnv=void 0;var MV=(rt(),Xe(yu)),Nc=bc(),due=(vh(),Xe(iU)),fue=L("fs"),pue=L("path"),wV=(Q(),Xe(cn));function fy(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function mue(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),n=(0,MV.parseKeyPairsIntoRecord)(e),i=(0,MV.parseKeyPairsIntoRecord)(r);if(Object.keys(n).length===0&&Object.keys(i).length===0)return;let s=Object.assign({},i,n),o=(0,Nc.createEmptyMetadata)();for(let[a,c]of Object.entries(s))o.set(a,c);return o}function gue(t){let e=mue(t);if(e!=null)return()=>e}function _ue(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return fy(e,r)}function Eue(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return fy(e,r)==="true"}function py(t,e,r){let n=process.env[t]?.trim(),i=process.env[e]?.trim(),s=fy(n,i);if(s!=null)try{return fue.readFileSync(pue.resolve(process.cwd(),s))}catch{wV.diag.warn(r);return}else return}function Sue(t){return py(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function Tue(t){return py(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function NV(t){return py(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function PV(t){let e=Tue(t),r=Sue(t),n=NV(t),i=e!=null&&r!=null;return n!=null&&!i?(wV.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,Nc.createSslCredentials)(NV(t))):(0,Nc.createSslCredentials)(n,e,r)}function yue(t){return Eue(t)?(0,Nc.createInsecureCredentials)():PV(t)}function vue(t){return{...(0,due.getSharedConfigurationFromEnvironment)(t),metadata:gue(t),url:_ue(t),credentials:e=>e.startsWith("http://")?()=>(0,Nc.createInsecureCredentials)():e.startsWith("https://")?()=>PV(t):()=>yue(t)}}Pf.getOtlpGrpcConfigurationFromEnv=vue});var LV=m(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.convertLegacyOtlpGrpcOptions=void 0;var IV=bV(),Aue=bc(),Cue=xV();function Rue(t,e){let r=t.credentials;return(0,IV.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,Aue.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0,userAgent:t.userAgent},(0,Cue.getOtlpGrpcConfigurationFromEnv)(e),(0,IV.getOtlpGrpcDefaultConfiguration)())}xf.convertLegacyOtlpGrpcOptions=Rue});var DV=m(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.createOtlpGrpcExportDelegate=void 0;var Oue=(oh(),Xe(Fg)),bue=bc();function Mue(t,e,r,n){return(0,Oue.createOtlpNetworkExportDelegate)(t,e,(0,bue.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,userAgent:t.userAgent,grpcName:r,grpcPath:n}))}If.createOtlpGrpcExportDelegate=Mue});var UV=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.createOtlpGrpcExportDelegate=vo.convertLegacyOtlpGrpcOptions=void 0;var Nue=LV();Object.defineProperty(vo,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return Nue.convertLegacyOtlpGrpcOptions}});var wue=DV();Object.defineProperty(vo,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return wue.createOtlpGrpcExportDelegate}})});var FV=m(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.OTLPMetricExporter=void 0;var Pue=(lU(),Xe(cU)),kV=UV(),xue=(Zg(),Xe(bD)),my=class extends Pue.OTLPMetricExporterBase{constructor(e){super((0,kV.createOtlpGrpcExportDelegate)((0,kV.convertLegacyOtlpGrpcOptions)(e??{},"METRICS"),xue.ProtobufMetricsSerializer,"MetricsExportService","/opentelemetry.proto.collector.metrics.v1.MetricsService/Export"),e)}};Lf.OTLPMetricExporter=my});var BV=m(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.OTLPMetricExporter=void 0;var Iue=FV();Object.defineProperty(Df,"OTLPMetricExporter",{enumerable:!0,get:function(){return Iue.OTLPMetricExporter}})});var Ey=m(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.PrometheusSerializer=void 0;var Lue=(Q(),Xe(cn)),qi=(fi(),Xe(xg)),VV=(rt(),Xe(yu)),qV=(uu(),Xe(X1)),Due="otel.scope.schema_url";function kf(t){return t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n")}function GV(t=""){return typeof t!="string"&&(t=JSON.stringify(t)),kf(t).replace(/"/g,'\\"')}var Uue=/[^a-z0-9_]/gi,kue=/_{2,}/g;function gy(t){return t.replace(Uue,"_").replace(kue,"_")}function Fue(t,e){return!t.endsWith("_total")&&e.dataPointType===qi.DataPointType.SUM&&e.isMonotonic&&(t=t+"_total"),t}function Bue(t){return t===1/0?"+Inf":t===-1/0?"-Inf":`${t}`}function Vue(t){switch(t.dataPointType){case qi.DataPointType.SUM:return t.isMonotonic?"counter":"gauge";case qi.DataPointType.GAUGE:return"gauge";case qi.DataPointType.HISTOGRAM:return"histogram";default:return"untyped"}}function Uf(t,e,r,n,i){let s=!1,o="";for(let[a,c]of Object.entries(e)){let l=gy(a);s=!0,o+=`${o.length>0?",":""}${l}="${GV(c)}"`}if(i)for(let[a,c]of Object.entries(i)){let l=gy(a);s=!0,o+=`${o.length>0?",":""}${l}="${GV(c)}"`}return s&&(t+=`{${o}}`),`${t} ${Bue(r)}${n!==void 0?" "+String(n):""}
|
|
66
|
-
`}var que="# no registered metrics",_y=class{_prefix;_appendTimestamp;_additionalAttributes;_withResourceConstantLabels;_withoutScopeInfo;_withoutTargetInfo;constructor(e,r=!1,n,i,s){e&&(this._prefix=e+"_"),this._appendTimestamp=r,this._withResourceConstantLabels=n,this._withoutScopeInfo=!!s,this._withoutTargetInfo=!!i}serialize(e){let r="";this._additionalAttributes=this._filterResourceConstantLabels(e.resource.attributes,this._withResourceConstantLabels);for(let n of e.scopeMetrics)r+=this._serializeScopeMetrics(n);return r===""&&(r+=que),this._serializeResource(e.resource)+r}_filterResourceConstantLabels(e,r){if(r){let n={};for(let[i,s]of Object.entries(e))i.match(r)&&(n[i]=s);return n}}_serializeScopeMetrics(e){let r="";for(let n of e.metrics)r+=this._serializeMetricData(n,e.scope)+`
|
|
67
|
-
`;return r}_serializeMetricData(e,r){let n=gy(kf(e.descriptor.name));this._prefix&&(n=`${this._prefix}${n}`);let i=e.dataPointType;n=Fue(n,e);let s=`# HELP ${n} ${kf(e.descriptor.description||"description missing")}`,o=e.descriptor.unit?`
|
|
68
|
-
# UNIT ${n} ${kf(e.descriptor.unit)}`:"",a=`# TYPE ${n} ${Vue(e)}`,c;if(this._withoutScopeInfo)c=this._additionalAttributes;else{let h={[qV.ATTR_OTEL_SCOPE_NAME]:r.name};r.schemaUrl&&(h[Due]=r.schemaUrl),r.version&&(h[qV.ATTR_OTEL_SCOPE_VERSION]=r.version),c=Object.assign(h,this._additionalAttributes)}let l="";switch(i){case qi.DataPointType.SUM:case qi.DataPointType.GAUGE:{l=e.dataPoints.map(h=>this._serializeSingularDataPoint(n,e,h,c)).join("");break}case qi.DataPointType.HISTOGRAM:{l=e.dataPoints.map(h=>this._serializeHistogramDataPoint(n,e,h,c)).join("");break}default:Lue.diag.error(`Unrecognizable DataPointType: ${i} for metric "${n}"`)}return`${s}${o}
|
|
69
|
-
${a}
|
|
70
|
-
${l}`.trim()}_serializeSingularDataPoint(e,r,n,i){let s="",{value:o,attributes:a}=n,c=(0,VV.hrTimeToMilliseconds)(n.endTime);return s+=Uf(e,a,o,this._appendTimestamp?c:void 0,i),s}_serializeHistogramDataPoint(e,r,n,i){let s="",o=n.attributes,a=n.value,c=(0,VV.hrTimeToMilliseconds)(n.endTime);for(let f of["count","sum"]){let p=a[f];p!=null&&(s+=Uf(e+"_"+f,o,p,this._appendTimestamp?c:void 0,i))}let l=0,h=a.buckets.counts.entries(),d=!1;for(let[f,p]of h){l+=p;let g=a.buckets.boundaries[f];if(g===void 0&&d)break;g===1/0&&(d=!0),s+=Uf(e+"_bucket",o,l,this._appendTimestamp?c:void 0,Object.assign({},i,{le:g===void 0||g===1/0?"+Inf":String(g)}))}return s}_serializeResource(e){if(this._withoutTargetInfo===!0)return"";let r="target_info",n=`# HELP ${r} Target metadata`,i=`# TYPE ${r} gauge`,s=Uf(r,e.attributes,1).trim();return`${n}
|
|
71
|
-
${i}
|
|
72
|
-
${s}
|
|
73
|
-
`}};Ff.PrometheusSerializer=_y});var HV=m(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.PrometheusExporter=void 0;var wc=(Q(),Xe(cn)),Gue=(rt(),Xe(yu)),Sy=(fi(),Xe(xg)),Hue=L("http"),zue=Ey(),jue=L("url"),Ty=class t extends Sy.MetricReader{static DEFAULT_OPTIONS={host:void 0,port:9464,endpoint:"/metrics",prefix:"",appendTimestamp:!1,withResourceConstantLabels:void 0,withoutScopeInfo:!1,withoutTargetInfo:!1};_host;_port;_baseUrl;_endpoint;_server;_prefix;_appendTimestamp;_serializer;_startServerPromise;constructor(e={},r=()=>{}){super({aggregationSelector:o=>({type:Sy.AggregationType.DEFAULT}),aggregationTemporalitySelector:o=>Sy.AggregationTemporality.CUMULATIVE,metricProducers:e.metricProducers}),this._host=e.host||process.env.OTEL_EXPORTER_PROMETHEUS_HOST||t.DEFAULT_OPTIONS.host,this._port=e.port||Number(process.env.OTEL_EXPORTER_PROMETHEUS_PORT)||t.DEFAULT_OPTIONS.port,this._prefix=e.prefix||t.DEFAULT_OPTIONS.prefix,this._appendTimestamp=typeof e.appendTimestamp=="boolean"?e.appendTimestamp:t.DEFAULT_OPTIONS.appendTimestamp;let n=e.withResourceConstantLabels||t.DEFAULT_OPTIONS.withResourceConstantLabels,i=e.withoutScopeInfo||t.DEFAULT_OPTIONS.withoutScopeInfo,s=e.withoutTargetInfo||t.DEFAULT_OPTIONS.withoutTargetInfo;this._server=(0,Hue.createServer)(this._requestHandler).unref(),this._serializer=new zue.PrometheusSerializer(this._prefix,this._appendTimestamp,n,s,i),this._baseUrl=`http://${this._host}:${this._port}/`,this._endpoint=(e.endpoint||t.DEFAULT_OPTIONS.endpoint).replace(/^([^/])/,"/$1"),e.preventServerStart!==!0?this.startServer().then(r,o=>{wc.diag.error(o),r(o)}):r&&queueMicrotask(r)}async onForceFlush(){}onShutdown(){return this.stopServer()}stopServer(){return this._server?new Promise(e=>{this._server.close(r=>{r?r.code!=="ERR_SERVER_NOT_RUNNING"&&(0,Gue.globalErrorHandler)(r):wc.diag.debug("Prometheus exporter was stopped"),e()})}):(wc.diag.debug("Prometheus stopServer() was called but server was never started."),Promise.resolve())}startServer(){return this._startServerPromise??=new Promise((e,r)=>{this._server.once("error",r),this._server.listen({port:this._port,host:this._host},()=>{wc.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`),e()})}),this._startServerPromise}getMetricsRequestHandler(e,r){this._exportMetrics(r)}_requestHandler=(e,r)=>{let n;try{e.url!=null&&(n=new jue.URL(e.url,this._baseUrl).pathname)}catch{r.statusCode=400,r.end("Bad Request");return}n===this._endpoint?this._exportMetrics(r):this._notFound(r)};_exportMetrics=e=>{e.statusCode=200,e.setHeader("content-type","text/plain"),this.collect().then(r=>{let{resourceMetrics:n,errors:i}=r;i.length&&wc.diag.error("PrometheusExporter: metrics collection errors",...i),e.end(this._serializer.serialize(n))},r=>{e.end(`# failed to export metrics: ${r}`)})};_notFound=e=>{e.statusCode=404,e.end()}};Bf.PrometheusExporter=Ty});var zV=m(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.PrometheusSerializer=Ao.PrometheusExporter=void 0;var $ue=HV();Object.defineProperty(Ao,"PrometheusExporter",{enumerable:!0,get:function(){return $ue.PrometheusExporter}});var Wue=Ey();Object.defineProperty(Ao,"PrometheusSerializer",{enumerable:!0,get:function(){return Wue.PrometheusSerializer}})});var Pc=m(Ay=>{"use strict";var qf=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},vy=class extends qf{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ay.CommanderError=qf;Ay.InvalidArgumentError=vy});var Gf=m(Ry=>{"use strict";var{InvalidArgumentError:Yue}=Pc(),Cy=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Yue(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Kue(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Ry.Argument=Cy;Ry.humanReadableArgName=Kue});var My=m(by=>{"use strict";var{humanReadableArgName:Xue}=Gf(),Oy=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?r.push(n):n.long&&!s?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Xue(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[])}),r.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function s(d,f){return r.formatItem(d,n,f,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(g=>s(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));o=o.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>s(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));o=o.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(g=>s(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));o=o.concat(this.formatItemList(f,p,r))}),o.join(`
|
|
74
|
-
`)}displayWidth(e){return WV(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let o=" ".repeat(2);if(!n)return o+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,h=(this.helpWidth??80)-r-c-2,d;return h<this.minWidthToWrap||i.preformatted(n)?d=n:d=i.boxWrap(n,h).replace(/\n/g,`
|
|
75
|
-
`+" ".repeat(r+c)),o+a+" ".repeat(c)+d.replace(/\n/g,`
|
|
76
|
-
${o}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return n.forEach(o=>{let a=o.match(i);if(a===null){s.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(h=>{let d=this.displayWidth(h);if(l+d<=r){c.push(h),l+=d;return}s.push(c.join(""));let f=h.trimStart();c=[f],l=this.displayWidth(f)}),s.push(c.join(""))}),s.join(`
|
|
77
|
-
`)}};function WV(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}by.Help=Oy;by.stripColor=WV});var xy=m(Py=>{"use strict";var{InvalidArgumentError:Jue}=Pc(),Ny=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Que(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Jue(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?YV(this.name().replace(/^no-/,"")):YV(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},wy=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return r.negate===(s===e)}};function YV(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Que(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(e=s.shift()),i.test(s[0])&&(r=s.shift()),!e&&n.test(s[0])&&(e=s.shift()),!e&&i.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${t}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
|
|
78
|
-
- a short flag is a single dash and a single character
|
|
79
|
-
- either use a single dash and a single character (for a short flag)
|
|
80
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(o)?new Error(`${a}
|
|
81
|
-
- too many short flags`):i.test(o)?new Error(`${a}
|
|
82
|
-
- too many long flags`):new Error(`${a}
|
|
83
|
-
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}Py.Option=Ny;Py.DualOptions=wy});var XV=m(KV=>{"use strict";function Zue(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let s=1;t[i-1]===e[n-1]?s=0:s=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+s),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function ehe(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let n=[],i=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=Zue(t,o),c=Math.max(t.length,o.length);(c-a)/c>s&&(a<i?(i=a,n=[o]):a===i&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
|
|
84
|
-
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
85
|
-
(Did you mean ${n[0]}?)`:""}KV.suggestSimilar=ehe});var e3=m(ky=>{"use strict";var the=L("node:events").EventEmitter,Iy=L("node:child_process"),an=L("node:path"),Hf=L("node:fs"),ue=L("node:process"),{Argument:rhe,humanReadableArgName:nhe}=Gf(),{CommanderError:Ly}=Pc(),{Help:ihe,stripColor:she}=My(),{Option:JV,DualOptions:ohe}=xy(),{suggestSimilar:QV}=XV(),Dy=class t extends the{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ue.stdout.write(r),writeErr:r=>ue.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>ue.stdout.isTTY?ue.stdout.columns:void 0,getErrHelpWidth:()=>ue.stderr.isTTY?ue.stderr.columns:void 0,getOutHasColors:()=>Uy()??(ue.stdout.isTTY&&ue.stdout.hasColors?.()),getErrHasColors:()=>Uy()??(ue.stderr.isTTY&&ue.stderr.hasColors?.()),stripColor:r=>she(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return i&&(c.description(i),c._executableHandler=!0),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new ihe,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration=Object.assign({},this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
86
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new rhe(e,r)}argument(e,r,n,i){let s=this.createArgument(e,r);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,s]=n.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),s&&a.arguments(s),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
87
|
-
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Ly(e,r,n)),ue.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new JV(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${i} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
88
|
-
- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let c=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,c,o):s!==null&&e.variadic&&(s=e._concatValue(s,c)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,o,"env")}),this}_optionEx(e,r,n,i,s){if(typeof r=="object"&&r instanceof JV)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!e.mandatory),typeof i=="function")o.default(s).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let h=a.exec(c);return h?h[0]:l},o.default(s).argParser(i)}else o.default(i);return this.addOption(o)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){ue.versions?.electron&&(r.from="electron");let i=ue.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=ue.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":ue.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
89
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(Hf.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
|
|
90
|
-
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
91
|
-
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
92
|
-
- ${i}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(h,d){let f=an.resolve(h,d);if(Hf.existsSync(f))return f;if(i.includes(an.extname(d)))return;let p=i.find(g=>Hf.existsSync(`${f}${g}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let h;try{h=Hf.realpathSync(this._scriptPath)}catch{h=this._scriptPath}a=an.resolve(an.dirname(h),a)}if(a){let h=s(a,o);if(!h&&!e._executableFile&&this._scriptPath){let d=an.basename(this._scriptPath,an.extname(this._scriptPath));d!==this._name&&(h=s(a,`${d}-${e._name}`))}o=h||o}n=i.includes(an.extname(o));let c;ue.platform!=="win32"?n?(r.unshift(o),r=ZV(ue.execArgv).concat(r),c=Iy.spawn(ue.argv[0],r,{stdio:"inherit"})):c=Iy.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,e._name),r.unshift(o),r=ZV(ue.execArgv).concat(r),c=Iy.spawn(ue.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{ue.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",h=>{h=h??1,l?l(new Ly(h,"commander.executeSubCommandAsync","(close)")):ue.exit(h)}),c.on("error",h=>{if(h.code==="ENOENT")this._checkForMissingExecutable(o,a,e._name);else if(h.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)ue.exit(1);else{let d=new Ly(1,"commander.executeSubCommandAsync","(error)");d.nestedError=h,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,s)=>{let o=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,i,s,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((o,a)=>e(n,a,o),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=e(n,s,n.defaultValue))),r[i]=s}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{i.push({hookedCommand:s,callback:o})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r,s=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=l=>/^-\d*\.?\d+(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(h=>h.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,c=null;for(;s.length;){let l=s.shift();if(l==="--"){i===n&&i.push(l),i.push(...s);break}if(c&&(!o(l)||a(l))){this.emit(`option:${c.name()}`,l);continue}if(c=null,o(l)){let h=this._findOption(l);if(h){if(h.required){let d=s.shift();d===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,d)}else if(h.optional){let d=null;s.length>0&&(!o(s[0])||a(s[0]))&&(d=s.shift()),this.emit(`option:${h.name()}`,d)}else this.emit(`option:${h.name()}`);c=h.variadic?h:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let h=this._findOption(`-${l[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,l.slice(2)):(this.emit(`option:${h.name()}`),s.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let h=l.indexOf("="),d=this._findOption(l.slice(0,h));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,l.slice(h+1));continue}}if(i===r&&o(l)&&!(this.commands.length===0&&a(l))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){n.push(l),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){i.push(l),s.length>0&&i.push(...s);break}i.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
93
|
-
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
94
|
-
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
95
|
-
`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in ue.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,ue.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new ohe(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=o=>{let a=o.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),h=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:h||o},i=o=>{let a=n(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);r=QV(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=QV(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
96
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>nhe(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=an.basename(e,an.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,s;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:s}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(ue.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
97
|
-
Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
|
|
98
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ZV(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],i=s[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function Uy(){if(ue.env.NO_COLOR||ue.env.FORCE_COLOR==="0"||ue.env.FORCE_COLOR==="false")return!1;if(ue.env.FORCE_COLOR||ue.env.CLICOLOR_FORCE!==void 0)return!0}ky.Command=Dy;ky.useColor=Uy});var i3=m(Gt=>{"use strict";var{Argument:t3}=Gf(),{Command:Fy}=e3(),{CommanderError:ahe,InvalidArgumentError:r3}=Pc(),{Help:che}=My(),{Option:n3}=xy();Gt.program=new Fy;Gt.createCommand=t=>new Fy(t);Gt.createOption=(t,e)=>new n3(t,e);Gt.createArgument=(t,e)=>new t3(t,e);Gt.Command=Fy;Gt.Option=n3;Gt.Argument=t3;Gt.Help=che;Gt.CommanderError=ahe;Gt.InvalidArgumentError=r3;Gt.InvalidOptionArgumentError=r3});var o3=m((Mt,s3)=>{"use strict";var hr=i3();Mt=s3.exports={};Mt.program=new hr.Command;Mt.Argument=hr.Argument;Mt.Command=hr.Command;Mt.CommanderError=hr.CommanderError;Mt.Help=hr.Help;Mt.InvalidArgumentError=hr.InvalidArgumentError;Mt.InvalidOptionArgumentError=hr.InvalidArgumentError;Mt.Option=hr.Option;Mt.createCommand=t=>new hr.Command(t);Mt.createOption=(t,e)=>new hr.Option(t,e);Mt.createArgument=(t,e)=>new hr.Argument(t,e)});var Co=Ro(T3(),1);import*as ln from"node:zlib";import{promisify as Vc}from"node:util";function Fc(t){let e=Ne.Internal,r=y3(t).map(Zf);r.some(i=>i.code=="ERR_STREAM_WRITE_AFTER_END")?e=Ne.Aborted:r.some(i=>i.code=="ERR_STREAM_DESTROYED"||i.code=="ERR_HTTP2_INVALID_STREAM"||i.code=="ECONNRESET")?e=Ne.Aborted:r.some(i=>i.code=="ETIMEDOUT"||i.code=="ENOTFOUND"||i.code=="EAI_AGAIN"||i.code=="ECONNREFUSED")&&(e=Ne.Unavailable);let n=dt.from(t,e);return n!==t&&(n.cause=t),n}function y3(t){let e=[];for(;!(!(t instanceof Error)||e.includes(t)||(e.push(t),!("cause"in t)));)t=t.cause;return e}function Zf(t){let e={};return t instanceof Error&&("code"in t&&typeof t.code=="string"&&(e.code=t.code),"syscall"in t&&typeof t.syscall=="string"&&(e.syscall=t.syscall)),e}function Qy(t){switch(t){case we.PROTOCOL_ERROR:case we.INTERNAL_ERROR:case we.FLOW_CONTROL_ERROR:case we.SETTINGS_TIMEOUT:case we.FRAME_SIZE_ERROR:case we.COMPRESSION_ERROR:case we.CONNECT_ERROR:return new dt(`http/2 stream closed with error code ${we[t]} (0x${t.toString(16)})`,Ne.Internal);case we.REFUSED_STREAM:return new dt(`http/2 stream closed with error code ${we[t]} (0x${t.toString(16)})`,Ne.Unavailable);case we.CANCEL:return new dt(`http/2 stream closed with error code ${we[t]} (0x${t.toString(16)})`,Ne.Canceled);case we.ENHANCE_YOUR_CALM:return new dt(`http/2 stream closed with error code ${we[t]} (0x${t.toString(16)})`,Ne.ResourceExhausted);case we.INADEQUATE_SECURITY:return new dt(`http/2 stream closed with error code ${we[t]} (0x${t.toString(16)})`,Ne.PermissionDenied);case we.HTTP_1_1_REQUIRED:return new dt(`http/2 stream closed with error code ${we[t]} (0x${t.toString(16)})`,Ne.PermissionDenied);default:break}}var we;(function(t){t[t.PROTOCOL_ERROR=1]="PROTOCOL_ERROR",t[t.INTERNAL_ERROR=2]="INTERNAL_ERROR",t[t.FLOW_CONTROL_ERROR=3]="FLOW_CONTROL_ERROR",t[t.SETTINGS_TIMEOUT=4]="SETTINGS_TIMEOUT",t[t.STREAM_CLOSED=5]="STREAM_CLOSED",t[t.FRAME_SIZE_ERROR=6]="FRAME_SIZE_ERROR",t[t.REFUSED_STREAM=7]="REFUSED_STREAM",t[t.CANCEL=8]="CANCEL",t[t.COMPRESSION_ERROR=9]="COMPRESSION_ERROR",t[t.CONNECT_ERROR=10]="CONNECT_ERROR",t[t.ENHANCE_YOUR_CALM=11]="ENHANCE_YOUR_CALM",t[t.INADEQUATE_SECURITY=12]="INADEQUATE_SECURITY",t[t.HTTP_1_1_REQUIRED=13]="HTTP_1_1_REQUIRED"})(we||(we={}));var v3=Vc(ln.gzip),A3=Vc(ln.gunzip),C3=Vc(ln.brotliCompress),R3=Vc(ln.brotliDecompress),Zy={name:"gzip",compress(t){return Bc(v3(t,{}))},decompress(t,e){return t.length==0?Promise.resolve(new Uint8Array(0)):Bc(t0(A3(t,{maxOutputLength:e}),e))}},e0={name:"br",compress(t){return Bc(C3(t,{}))},decompress(t,e){return t.length==0?Promise.resolve(new Uint8Array(0)):Bc(t0(R3(t,{maxOutputLength:e}),e))}};function Bc(t){return t.then(e=>e.buffer instanceof ArrayBuffer?e:new Uint8Array(e))}function t0(t,e){return t.catch(r=>{var n;let i=Zf(r),s=Ne.Internal,o="decompression failed";switch(i.code){case"ERR_BUFFER_TOO_LARGE":s=Ne.ResourceExhausted,o=`message is larger than configured readMaxBytes ${e} after decompression`;break;case"Z_DATA_ERROR":case"ERR_PADDING_2":s=Ne.InvalidArgument;break;default:!((n=i.code)===null||n===void 0)&&n.startsWith("ERR__ERROR_FORMAT_")&&(s=Ne.InvalidArgument);break}return Promise.reject(new dt(o,s,void 0,void 0,r))})}function r0(t){let e=new Headers;for(let[r,n]of Object.entries(t))if(!r.startsWith(":")&&n!==void 0)if(typeof n=="string")e.append(r,n);else if(typeof n=="number")e.append(r,String(n));else for(let i of n)e.append(r,i);return e}function qc(t,e){if(t===void 0&&e===void 0)return;let r=Object.create(null);if(e!==void 0)if(Array.isArray(e))for(let n=0;n+1<e.length;n+=2){let i=e[n],s=e[n+1];Array.isArray(r[i])?r[i].push(s):typeof r[i]=="string"?r[i]=[r[i],s]:r[i]=s}else for(let[n,i]of Object.entries(e))Array.isArray(i)?r[n]=i.concat():i!==void 0&&(r[n]=i);if(t!==void 0)if(Array.isArray(t))for(let[n,i]of t)ep(r,n,i);else if("forEach"in t)typeof t.forEach=="function"&&t.forEach((n,i)=>{ep(r,i,n)});else for(let[n,i]of Object.entries(t))ep(r,n,i);return r}function ep(t,e,r){e=e.toLowerCase();let n=t[e];Array.isArray(n)?n.push(r):n===void 0?t[e]=r:t[e]=[n.toString(),r]}var O3=function(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 __values=="function"?__values(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(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}},Gi=function(t){return this instanceof Gi?(this.v=t,this):new Gi(t)},b3=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(p){return function(g){return Promise.resolve(g).then(p,d)}}function a(p,g){n[p]&&(i[p]=function(S){return new Promise(function(A,C){s.push([p,S,A,C])>1||c(p,S)})},g&&(i[p]=g(i[p])))}function c(p,g){try{l(n[p](g))}catch(S){f(s[0][3],S)}}function l(p){p.value instanceof Gi?Promise.resolve(p.value.v).then(h,d):f(s[0][2],p)}function h(p){c("next",p)}function d(p){c("throw",p)}function f(p,g){p(g),s.shift(),s.length&&c(s[0][0],s[0][1])}};function n0(t,...e){var r,n;let i=e.length===3?e[0]:void 0,s=e.length===3?e[1]:e[0],o=e.length===3?e[2]:e[1],c="encrypted"in t.socket&&t.socket.encrypted?"https":"http",l="authority"in t?t.authority:t.headers.host,h=(r=t.url)!==null&&r!==void 0?r:"";if(l===void 0)throw new dt("unable to determine request authority from Node.js server request",Ne.Internal);let d=s!==void 0?s:M3(t),f=new AbortController;if("stream"in t)t.once("close",()=>{let p=Qy(t.stream.rstCode);p!==void 0?f.abort(p):f.abort()});else{let p=i??t,g=A=>{t.off("error",g),p.off("close",S),f.abort(Fc(A))},S=()=>{t.off("error",g),p.off("close",S),f.abort(t.errored?Fc(t.errored):void 0)};t.once("error",g),p.once("close",S)}return{httpVersion:t.httpVersion,method:(n=t.method)!==null&&n!==void 0?n:"",url:new URL(h,`${c}://${l}`).toString(),header:r0(t.headers),body:d,signal:f.signal,contextValues:o}}async function i0(t,e){var r,n,i;let s=(r=t.body)===null||r===void 0?void 0:r[Symbol.asyncIterator](),o=!1;try{if(s!==void 0){let a=await s.next();for(o=!0,e.writeHead(t.status,qc(t.header)),o=!1;a.done!==!0;a=await s.next())o=!0,await N3(e,a.value),"flush"in e&&typeof e.flush=="function"&&e.flush(),o=!1}e.headersSent||e.writeHead(t.status,qc(t.header)),t.trailer&&e.addTrailers(qc(t.trailer)),await new Promise(a=>{e.once("end",a),e.end()})}catch(a){throw o&&((n=s?.throw)===null||n===void 0||n.call(s,a).catch(()=>{})),Fc(a)}finally{(i=s?.return)===null||i===void 0||i.call(s).catch(()=>{})}}function M3(t){return b3(this,arguments,function*(){var r,n,i,s;try{for(var o=!0,a=O3(t),c;c=yield Gi(a.next()),r=c.done,!r;o=!0)s=c.value,o=!1,yield yield Gi(s)}catch(l){n={error:l}}finally{try{!o&&!r&&(i=a.return)&&(yield Gi(i.call(a)))}finally{if(n)throw n.error}}})}function N3(t,e){return new Promise((r,n)=>{if(t.errored)return s(t.errored);t.once("error",s),t.once("drain",o);let i=t.write(e,"binary",a=>{a&&!i&&(s(a),t.once("error",()=>{}))});i&&o();function s(a){t.off("error",s),t.off("drain",o),n(a)}function o(){t.off("error",s),t.off("drain",o),r()}})}function tp(t){var e;t.acceptCompression===void 0&&(t.acceptCompression=[Zy,e0]);let r=zy(t);t.routes(r);let n=(e=t.requestPathPrefix)!==null&&e!==void 0?e:"",i=new Map;for(let s of r.handlers)i.set(n+s.requestPath,s);return function(o,a){var c,l,h,d;let f=i.get((l=(c=o.url)===null||c===void 0?void 0:c.split("?",2)[0])!==null&&l!==void 0?l:"");if(!f){((h=t.fallback)!==null&&h!==void 0?h:w3)(o,a);return}let p=n0(o,a,void 0,(d=t.contextValues)===null||d===void 0?void 0:d.call(t,o));f(p).then(g=>i0(g,a)).catch(g=>{dt.from(g).code!=Ne.Aborted&&console.error(`handler for rpc ${f.method.name} of ${f.service.typeName} failed`,g)})}}var w3=(t,e)=>{e.writeHead(Xf.status),e.end()};import lhe from"http";import uhe from"node:http2";import{Session as g3}from"node:inspector/promises";import{fork as hhe}from"child_process";import{fileURLToPath as dhe}from"url";var Gc=class{constructor(e){this.instance=e}async start(e,r){return this.instance.start(e,r)}async getConfig(e,r){let n=await this.instance.getConfig(e,r);return n.executionConfig=Dc(Vy,Xy.execution),n}async*processBindingsStream(e,r){yield*this.instance.processBindingsStream(e,r)}async updateTemplates(e,r){return this.instance.updateTemplates(e,r)}};import("node:process").then(t=>t.stdout.write(""));var Wt=Ro(YR(),1);function KR(t){let e=new WeakSet;return JSON.stringify(t,function(r,n){if(typeof n=="object"&&n!==null){if(e.has(n))return"[Circular]";e.add(n)}return n})}function XR(t,e,r){let n={transform:o=>{let a=[];typeof o.message=="object"?a.push(KR(o.message)):a.push(o.message);let c=o[Symbol.for("splat")];if(c)for(let l in c){let h=c[l];typeof h=="object"?a.push(KR(h)):a.push(h)}return o.message=a.join(" "),o}},i=(0,Wt.createLogger)({format:Wt.format.combine(Wt.format.timestamp({format:"YYYY-MM-DDTHH:mm:ss.SSSZ"}),n,Wt.format.errors({stack:!0}),t?Wt.format.json():Wt.format.simple(),Wt.format.label({label:r?"worker #{workerId}":""})),level:e?"debug":"info",transports:[new Wt.transports.Console]}),s=o=>(...a)=>{o.apply(i,a)};console.log=s(i.info),console.info=s(i.info),console.warn=s(i.warn),console.error=s(i.error),console.debug=s(i.debug)}import("node:process").then(t=>t.stdout.write(""));fi();var yy=Ro(BV(),1),jV=Ro(zV(),1);Q();async function $V(t){console.log("Setting up OTLP metrics, debug=",!!t),t&&P.setLogger(new $y,Ht.DEBUG);let e=[new di({exporter:new yy.OTLPMetricExporter,exportIntervalMillis:6e4})];t&&e.push(new jV.PrometheusExporter({host:"0.0.0.0",port:4041}));let r=new Rs({readers:[new di({exporter:new yy.OTLPMetricExporter,exportIntervalMillis:6e4})]});Jf.setGlobalMeterProvider(r),["SIGINT","SIGTERM"].forEach(n=>{process.on(n,()=>r.forceFlush().catch(console.error))}),Jf.getMeter("processor").createGauge("up").record(1)}import("node:process").then(t=>t.stdout.write(""));var Vf=class{constructor(e){this.loader=e}async listen(e){let r=Yf.INSTANCE;await this.loader(),await r.configure(Dc(qy)),console.log("Starting Action Server at:",e),await r.startServer(e)}forceShutdown(){Yf.INSTANCE.shutdown()}};import("node:process").then(t=>t.stdout.write(""));import{dirname as fhe,join as phe}from"path";var a3=Ro(o3(),1),{program:jAe,createCommand:$Ae,createArgument:WAe,createOption:YAe,CommanderError:KAe,InvalidArgumentError:c3,InvalidOptionArgumentError:XAe,Command:l3,Argument:JAe,Option:QAe,Help:ZAe}=a3.default;var u3=1;try{u3=parseInt(process.env.PROCESSOR_WORKER?.trim()??"1")}catch(t){console.error("Failed to parse worker number",t)}function xc(t,e){let r=parseInt(t,10);if(isNaN(r))throw new c3("Not a number.");return r}var Ic=new l3("processor-runner").allowUnknownOption().allowExcessArguments().name("processor-runner").description("Sentio Processor Runtime").argument("<target>","Path to the processor module to load").option("-p, --port <port>","Port to listen on","4000").option("--concurrency <number>","Number of concurrent workers(V2 only, deprecated)",xc,4).option("--batch-count <number>","Batch count for processing",xc,1).option("-c, --chains-config <path>","Path to chains configuration file","chains-config.json").option("--pricefeed-server <url>","Price feed server URL").option("--log-format <format>","Log format (console|json)","console").option("--debug","Enable debug mode").option("--otlp-debug","Enable OTLP debug mode").option("--start-action-server","Start action server instead of processor server").option("--worker <number>","Number of processor worker threads ",xc,u3).option("--process-timeout <seconds>","Process timeout in seconds",xc,60).option("--worker-timeout <seconds>","Worker timeout in seconds",xc,parseInt(process.env.WORKER_TIMEOUT_SECONDS||"60")).option("--enable-partition","Enable binding data partition",process.env.SENTIO_ENABLE_BINDING_DATA_PARTITION==="true");import("node:process").then(t=>t.stdout.write(""));Ic.parse();var ut={...Ic.opts(),target:Ic.args[Ic.args.length-1]},mhe=process.env.LOG_LEVEL?.toLowerCase(),Kn=!1,h3=!1,zf=()=>{};XR(ut.logFormat==="json",mhe==="debug"?!0:ut.debug);console.debug("Starting with",ut.target);await $V(ut.otlpDebug);Error.stackTraceLimit=20;Hy(ut);console.debug("Starting Server",ut);var $f=process.env.IS_CHILD==="true";function d3(t){$f||(Kn=!0,zf()),process.exit(t)}if(!$f){let t=Kf("@sentio/sdk"),e=Kf("@sentio/runtime");console.log("Runtime version:",e.version,"SDK version:",t.version)}var jf,Lc,By,f3=async()=>{let t=await import(ut.target);return console.debug("Module loaded",t),t};if(ut.startActionServer)jf=new Vf(f3),jf.listen(ut.port);else{let t=()=>Lc?.close(),e=new Gc(new Jy(f3,ut,t)),n=tp({routes:i=>{i.service(Gy,e)},readMaxBytes:768*1024*1024,writeMaxBytes:768*1024*1024});Lc=uhe.createServer(n),Lc.listen(Number(ut.port)),console.log("Processor Server Started at:",ut.port)}if(!$f&&(By=lhe.createServer(async function(e,r){if(e.url){let n=new URL(e.url,`http://${e.headers.host}`),i=n.searchParams;switch(n.pathname){case"/heap":{try{let s="/tmp/"+Date.now()+".heapsnapshot";await p3(s);let o=Co.default.createReadStream(s);r.writeHead(200,{"Content-Type":"application/json"}),o.pipe(r),r.end()}catch{r.writeHead(500),r.end()}break}case"/profile":{try{let s=parseInt(i.get("t")||"1000",10)||1e3,o=new g3;o.connect(),await o.post("Profiler.enable"),await o.post("Profiler.start"),await new Promise(c=>setTimeout(c,s));let{profile:a}=await o.post("Profiler.stop");r.writeHead(200,{"Content-Type":"application/json"}),r.write(JSON.stringify(a)),o.disconnect()}catch{r.writeHead(500)}break}default:r.writeHead(404)}}else r.writeHead(404);r.end()}).listen(4040),console.log("Metric Server Started at:",4040),process.env.OOM_DUMP_MEMORY_SIZE_GB)){let e=!1,r=parseFloat(process.env.OOM_DUMP_MEMORY_SIZE_GB);console.log("heap dumping is enabled, limit set to ",r,"gb");let n=process.env.OOM_DUMP_DIR||"/tmp";setInterval(async()=>{let i=process.memoryUsage();if(console.log("Current Memory Usage",i),i.heapTotal>r*1024*1024*1024&&!e){let s=phe(n,`${Date.now()}.heapsnapshot`);e=!0,await p3(s),process.exit(11)}},1e3*60)}process.once("SIGINT",function(){Kn||(Kn=!0,zf(),m3(0))}).once("SIGTERM",function(){Kn||(Kn=!0,zf(),m3(0))}).on("uncaughtException",t=>{console.error("Uncaught Exception, please checking if await is properly used",t)}).on("unhandledRejection",(t,e)=>{t?.message.startsWith('invalid ENS name (disallowed character: "*"')||console.error("Unhandled Rejection, please checking if await is properly",t)});async function p3(t){console.log("Heap dumping to",t);let e=new g3;Co.default.mkdirSync(fhe(t),{recursive:!0});let r=Co.default.openSync(t,"w");try{e.connect(),e.on("HeapProfiler.addHeapSnapshotChunk",n=>{Co.default.writeSync(r,n.params.chunk)}),await e.post("HeapProfiler.takeHeapSnapshot"),console.log("Heap dumped to",t)}finally{e.disconnect(),Co.default.closeSync(r)}}function m3(t){Lc?Lc.close():jf?.forceShutdown&&jf.forceShutdown(),console.log("RPC server shut down"),By?By.close(function(){console.log("Http server shut down"),d3(t)}):d3(t)}if(ut.worker>1&&!$f){let t=new Map,e=new Map,r=parseInt(ut.port),n=1e3,i=s=>{let o=process.argv.slice(2),a=["--port="+String(s)];for(let l=0;l<o.length;l++){let h=o[l];if(h==="-p"||h==="--port"){l++;continue}else if(h.startsWith("--port=")||h.startsWith("--inspect="))continue;a.push(h)}let c=hhe(dhe(import.meta.url),a,{env:{...process.env,IS_CHILD:"true"},stdio:"inherit"});c.on("error",l=>{console.error(`Child process on port ${s} error:`,l)}),c.on("exit",(l,h)=>{if(t.delete(s),console.log(`Child process on port ${s} exited with code ${l}, signal ${h??"none"}`),Kn||e.has(s))return;console.log(`Scheduling restart for child process on port ${s} in ${n}ms`);let d=setTimeout(()=>{e.delete(s),!Kn&&(console.log(`Restarting child process on port ${s}`),i(s))},n);e.set(s,d)}),t.set(s,c),console.log(`Spawned child server process for port ${s} (pid: ${c.pid})`)};for(let s=1;s<ut.worker;s++){let o=r+s;i(o)}zf=()=>{if(!h3){h3=!0,Kn=!0;for(let s of e.values())clearTimeout(s);e.clear();for(let s of t.values())s.kill("SIGINT")}}}import("node:process").then(t=>t.stdout.write(""));
|
|
99
|
-
/*! Bundled license information:
|
|
100
|
-
|
|
101
|
-
safe-buffer/index.js:
|
|
102
|
-
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
103
|
-
|
|
104
|
-
long/umd/index.js:
|
|
105
|
-
(**
|
|
106
|
-
* @license
|
|
107
|
-
* Copyright 2009 The Closure Library Authors
|
|
108
|
-
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
|
109
|
-
*
|
|
110
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
111
|
-
* you may not use this file except in compliance with the License.
|
|
112
|
-
* You may obtain a copy of the License at
|
|
113
|
-
*
|
|
114
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
115
|
-
*
|
|
116
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
117
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
118
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
119
|
-
* See the License for the specific language governing permissions and
|
|
120
|
-
* limitations under the License.
|
|
121
|
-
*
|
|
122
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
123
|
-
*)
|
|
124
|
-
|
|
125
|
-
@grpc/proto-loader/build/src/util.js:
|
|
126
|
-
(**
|
|
127
|
-
* @license
|
|
128
|
-
* Copyright 2018 gRPC authors.
|
|
129
|
-
*
|
|
130
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
131
|
-
* you may not use this file except in compliance with the License.
|
|
132
|
-
* You may obtain a copy of the License at
|
|
133
|
-
*
|
|
134
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
135
|
-
*
|
|
136
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
137
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
138
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
139
|
-
* See the License for the specific language governing permissions and
|
|
140
|
-
* limitations under the License.
|
|
141
|
-
*
|
|
142
|
-
*)
|
|
143
|
-
|
|
144
|
-
long/umd/index.js:
|
|
145
|
-
(**
|
|
146
|
-
* @license
|
|
147
|
-
* Copyright 2009 The Closure Library Authors
|
|
148
|
-
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
|
149
|
-
*
|
|
150
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
151
|
-
* you may not use this file except in compliance with the License.
|
|
152
|
-
* You may obtain a copy of the License at
|
|
153
|
-
*
|
|
154
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
155
|
-
*
|
|
156
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
157
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
158
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
159
|
-
* See the License for the specific language governing permissions and
|
|
160
|
-
* limitations under the License.
|
|
161
|
-
*
|
|
162
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
163
|
-
*)
|
|
164
|
-
|
|
165
|
-
@grpc/proto-loader/build/src/index.js:
|
|
166
|
-
(**
|
|
167
|
-
* @license
|
|
168
|
-
* Copyright 2018 gRPC authors.
|
|
169
|
-
*
|
|
170
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
171
|
-
* you may not use this file except in compliance with the License.
|
|
172
|
-
* You may obtain a copy of the License at
|
|
173
|
-
*
|
|
174
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
175
|
-
*
|
|
176
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
177
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
178
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
|
-
* See the License for the specific language governing permissions and
|
|
180
|
-
* limitations under the License.
|
|
181
|
-
*
|
|
182
|
-
*)
|
|
183
|
-
*/
|
|
184
|
-
//# sourceMappingURL=processor-runner.js.map
|