@iflow-ai/iflow-cli 0.3.31-beta.3 → 0.4.0-beta.0
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/bundle/entry.cjs
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";var Qee=Object.create;var Qd=Object.defineProperty;var Zee=Object.getOwnPropertyDescriptor;var ete=Object.getOwnPropertyNames;var tte=Object.getPrototypeOf,rte=Object.prototype.hasOwnProperty;var U=(t,e)=>()=>(t&&(e=t(t=0)),e);var p=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zd=(t,e)=>{for(var r in e)Qd(t,r,{get:e[r],enumerable:!0})},Hw=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ete(e))!rte.call(t,s)&&s!==r&&Qd(t,s,{get:()=>e[s],enumerable:!(o=Zee(e,s))||o.enumerable});return t};var J=(t,e,r)=>(r=t!=null?Qee(tte(t)):{},Hw(e||!t||!t.__esModule?Qd(r,"default",{value:t,enumerable:!0}):r,t)),y=t=>Hw(Qd({},"__esModule",{value:!0}),t);var CL=p((dHe,PL)=>{PL.exports=RL;RL.sync=Kte;var OL=require("fs");function Wte(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var o=0;o<r.length;o++){var s=r[o].toLowerCase();if(s&&t.substr(-s.length).toLowerCase()===s)return!0}return!1}function bL(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Wte(e,r)}function RL(t,e,r){OL.stat(t,function(o,s){r(o,o?!1:bL(s,t,e))})}function Kte(t,e){return bL(OL.statSync(t),t,e)}});var wL=p((pHe,xL)=>{xL.exports=ML;ML.sync=Xte;var NL=require("fs");function ML(t,e,r){NL.stat(t,function(o,s){r(o,o?!1:IL(s,e))})}function Xte(t,e){return IL(NL.statSync(t),e)}function IL(t,e){return t.isFile()&&Jte(t,e)}function Jte(t,e){var r=t.mode,o=t.uid,s=t.gid,a=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),i=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),n=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=n|c,d=r&u||r&c&&s===i||r&n&&o===a||r&l&&a===0;return d}});var DL=p((hHe,LL)=>{var fHe=require("fs"),fp;process.platform==="win32"||global.TESTING_WINDOWS?fp=CL():fp=wL();LL.exports=Bv;Bv.sync=Qte;function Bv(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,s){Bv(t,e||{},function(a,i){a?s(a):o(i)})})}fp(t,e||{},function(o,s){o&&(o.code==="EACCES"||e&&e.ignoreErrors)&&(o=null,s=!1),r(o,s)})}function Qte(t,e){try{return fp.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var qL=p((mHe,GL)=>{var Ks=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",UL=require("path"),Zte=Ks?";":":",kL=DL(),BL=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),FL=(t,e)=>{let r=e.colon||Zte,o=t.match(/\//)||Ks&&t.match(/\\/)?[""]:[...Ks?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],s=Ks?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=Ks?s.split(r):[""];return Ks&&t.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:o,pathExt:a,pathExtExe:s}},VL=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:o,pathExt:s,pathExtExe:a}=FL(t,e),i=[],n=u=>new Promise((l,d)=>{if(u===o.length)return e.all&&i.length?l(i):d(BL(t));let h=o[u],g=/^".*"$/.test(h)?h.slice(1,-1):h,E=UL.join(g,t),S=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+E:E;l(c(S,u,0))}),c=(u,l,d)=>new Promise((h,g)=>{if(d===s.length)return h(n(l+1));let E=s[d];kL(u+E,{pathExt:a},(S,v)=>{if(!S&&v)if(e.all)i.push(u+E);else return h(u+E);return h(c(u,l,d+1))})});return r?n(0).then(u=>r(null,u),r):n(0)},ere=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:o,pathExtExe:s}=FL(t,e),a=[];for(let i=0;i<r.length;i++){let n=r[i],c=/^".*"$/.test(n)?n.slice(1,-1):n,u=UL.join(c,t),l=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let d=0;d<o.length;d++){let h=l+o[d];try{if(kL.sync(h,{pathExt:s}))if(e.all)a.push(h);else return h}catch{}}}if(e.all&&a.length)return a;if(e.nothrow)return null;throw BL(t)};GL.exports=VL;VL.sync=ere});var HL=p((_He,Fv)=>{"use strict";var jL=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};Fv.exports=jL;Fv.exports.default=jL});var WL=p((gHe,YL)=>{"use strict";var zL=require("path"),tre=qL(),rre=HL();function $L(t,e){let r=t.options.env||process.env,o=process.cwd(),s=t.options.cwd!=null,a=s&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(t.options.cwd)}catch{}let i;try{i=tre.sync(t.command,{path:r[rre({env:r})],pathExt:e?zL.delimiter:void 0})}catch{}finally{a&&process.chdir(o)}return i&&(i=zL.resolve(s?t.options.cwd:"",i)),i}function nre(t){return $L(t)||$L(t,!0)}YL.exports=nre});var KL=p((EHe,Gv)=>{"use strict";var Vv=/([()\][%!^"`<>&|;, *?])/g;function ire(t){return t=t.replace(Vv,"^$1"),t}function ore(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Vv,"^$1"),e&&(t=t.replace(Vv,"^$1")),t}Gv.exports.command=ire;Gv.exports.argument=ore});var JL=p((SHe,XL)=>{"use strict";XL.exports=/^#!(.*)/});var ZL=p((THe,QL)=>{"use strict";var sre=JL();QL.exports=(t="")=>{let e=t.match(sre);if(!e)return null;let[r,o]=e[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?o:o?`${s} ${o}`:s}});var tD=p((yHe,eD)=>{"use strict";var qv=require("fs"),are=ZL();function cre(t){let r=Buffer.alloc(150),o;try{o=qv.openSync(t,"r"),qv.readSync(o,r,0,150,0),qv.closeSync(o)}catch{}return are(r.toString())}eD.exports=cre});var oD=p((vHe,iD)=>{"use strict";var ure=require("path"),rD=WL(),nD=KL(),lre=tD(),dre=process.platform==="win32",pre=/\.(?:com|exe)$/i,fre=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function hre(t){t.file=rD(t);let e=t.file&&lre(t.file);return e?(t.args.unshift(t.file),t.command=e,rD(t)):t.file}function mre(t){if(!dre)return t;let e=hre(t),r=!pre.test(e);if(t.options.forceShell||r){let o=fre.test(e);t.command=ure.normalize(t.command),t.command=nD.command(t.command),t.args=t.args.map(a=>nD.argument(a,o));let s=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${s}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function _re(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let o={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?o:mre(o)}iD.exports=_re});var cD=p((AHe,aD)=>{"use strict";var jv=process.platform==="win32";function Hv(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function gre(t,e){if(!jv)return;let r=t.emit;t.emit=function(o,s){if(o==="exit"){let a=sD(s,e);if(a)return r.call(t,"error",a)}return r.apply(t,arguments)}}function sD(t,e){return jv&&t===1&&!e.file?Hv(e.original,"spawn"):null}function Ere(t,e){return jv&&t===1&&!e.file?Hv(e.original,"spawnSync"):null}aD.exports={hookChildProcess:gre,verifyENOENT:sD,verifyENOENTSync:Ere,notFoundError:Hv}});var dD=p((OHe,Xs)=>{"use strict";var uD=require("child_process"),zv=oD(),$v=cD();function lD(t,e,r){let o=zv(t,e,r),s=uD.spawn(o.command,o.args,o.options);return $v.hookChildProcess(s,o),s}function Sre(t,e,r){let o=zv(t,e,r),s=uD.spawnSync(o.command,o.args,o.options);return s.error=s.error||$v.verifyENOENTSync(s.status,o),s}Xs.exports=lD;Xs.exports.spawn=lD;Xs.exports.sync=Sre;Xs.exports._parse=zv;Xs.exports._enoent=$v});var wB,LB=U(()=>{wB=typeof globalThis=="object"?globalThis:global});var DB=U(()=>{LB()});var UB=U(()=>{DB()});var hi,fO=U(()=>{hi="1.9.0"});function fae(t){var e=new Set([t]),r=new Set,o=t.match(kB);if(!o)return function(){return!1};var s={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(s.prerelease!=null)return function(c){return c===t};function a(n){return r.add(n),!1}function i(n){return e.add(n),!0}return function(c){if(e.has(c))return!0;if(r.has(c))return!1;var u=c.match(kB);if(!u)return a(c);var l={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return l.prerelease!=null||s.major!==l.major?a(c):s.major===0?s.minor===l.minor&&s.patch<=l.patch?i(c):a(c):s.minor<=l.minor?i(c):a(c)}}var kB,BB,FB=U(()=>{fO();kB=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;BB=fae(hi)});function fn(t,e,r,o){var s;o===void 0&&(o=!1);var a=Iu[Mu]=(s=Iu[Mu])!==null&&s!==void 0?s:{version:hi};if(!o&&a[t]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(i.stack||i.message),!1}if(a.version!==hi){var i=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+t+" does not match previously registered API v"+hi);return r.error(i.stack||i.message),!1}return a[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+hi+"."),!0}function ir(t){var e,r,o=(e=Iu[Mu])===null||e===void 0?void 0:e.version;if(!(!o||!BB(o)))return(r=Iu[Mu])===null||r===void 0?void 0:r[t]}function hn(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+hi+".");var r=Iu[Mu];r&&delete r[t]}var hae,Mu,Iu,Do=U(()=>{UB();fO();FB();hae=hi.split(".")[0],Mu=Symbol.for("opentelemetry.js.api."+hae),Iu=wB});function xu(t,e,r){var o=ir("diag");if(o)return r.unshift(e),o[t].apply(o,_ae([],mae(r),!1))}var mae,_ae,VB,GB=U(()=>{Do();mae=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var o=r.call(t),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},_ae=function(t,e,r){if(r||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return t.concat(a||Array.prototype.slice.call(e))},VB=(function(){function t(e){this._namespace=e.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xu("debug",this._namespace,e)},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xu("error",this._namespace,e)},t.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xu("info",this._namespace,e)},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xu("warn",this._namespace,e)},t.prototype.verbose=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return xu("verbose",this._namespace,e)},t})()});var lt,mf=U(()=>{(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(lt||(lt={}))});function qB(t,e){t<lt.NONE?t=lt.NONE:t>lt.ALL&&(t=lt.ALL),e=e||{};function r(o,s){var a=e[o];return typeof a=="function"&&t>=s?a.bind(e):function(){}}return{error:r("error",lt.ERROR),warn:r("warn",lt.WARN),info:r("info",lt.INFO),debug:r("debug",lt.DEBUG),verbose:r("verbose",lt.VERBOSE)}}var jB=U(()=>{mf()});var gae,Eae,Sae,St,Uo=U(()=>{GB();jB();mf();Do();gae=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var o=r.call(t),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Eae=function(t,e,r){if(r||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return t.concat(a||Array.prototype.slice.call(e))},Sae="diag",St=(function(){function t(){function e(s){return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];var n=ir("diag");if(n)return n[s].apply(n,Eae([],gae(a),!1))}}var r=this,o=function(s,a){var i,n,c;if(a===void 0&&(a={logLevel:lt.INFO}),s===r){var u=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((i=u.stack)!==null&&i!==void 0?i:u.message),!1}typeof a=="number"&&(a={logLevel:a});var l=ir("diag"),d=qB((n=a.logLevel)!==null&&n!==void 0?n:lt.INFO,s);if(l&&!a.suppressOverrideMessage){var h=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";l.warn("Current logger will be overwritten from "+h),d.warn("Current logger will overwrite one already registered from "+h)}return fn("diag",d,r,!0)};r.setLogger=o,r.disable=function(){hn(Sae,r)},r.createComponentLogger=function(s){return new VB(s)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})()});var Tae,yae,HB,zB=U(()=>{Tae=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var o=r.call(t),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},yae=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],o=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},HB=(function(){function t(e){this._entries=e?new Map(e):new Map}return t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=Tae(e,2),o=r[0],s=r[1];return[o,s]})},t.prototype.setEntry=function(e,r){var o=new t(this._entries);return o._entries.set(e,r),o},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=new t(this._entries);try{for(var i=yae(o),n=i.next();!n.done;n=i.next()){var c=n.value;a._entries.delete(c)}}catch(u){e={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return a},t.prototype.clear=function(){return new t},t})()});var $B,YB=U(()=>{$B=Symbol("BaggageEntryMetadata")});function WB(t){return t===void 0&&(t={}),new HB(new Map(Object.entries(t)))}function KB(t){return typeof t!="string"&&(vae.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:$B,toString:function(){return t}}}var vae,hO=U(()=>{Uo();zB();YB();vae=St.instance()});function la(t){return Symbol.for(t)}var Aae,_f,wu=U(()=>{Aae=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(o){return r._currentContext.get(o)},r.setValue=function(o,s){var a=new t(r._currentContext);return a._currentContext.set(o,s),a},r.deleteValue=function(o){var s=new t(r._currentContext);return s._currentContext.delete(o),s}}return t})(),_f=new Aae});var mO,XB,JB=U(()=>{mO=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],XB=(function(){function t(){function e(o){return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(console){var i=console[o];if(typeof i!="function"&&(i=console.log),typeof i=="function")return i.apply(console,s)}}}for(var r=0;r<mO.length;r++)this[mO[r].n]=e(mO[r].c)}return t})()});function QB(){return gO}var ko,Oae,gf,bae,Rae,Pae,Cae,_O,Nae,Mae,Iae,gO,xae,wae,Lae,Dae,Uae,kae,Bae,EO=U(()=>{ko=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function o(){this.constructor=e}e.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}})(),Oae=(function(){function t(){}return t.prototype.createGauge=function(e,r){return wae},t.prototype.createHistogram=function(e,r){return Lae},t.prototype.createCounter=function(e,r){return xae},t.prototype.createUpDownCounter=function(e,r){return Dae},t.prototype.createObservableGauge=function(e,r){return kae},t.prototype.createObservableCounter=function(e,r){return Uae},t.prototype.createObservableUpDownCounter=function(e,r){return Bae},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),gf=(function(){function t(){}return t})(),bae=(function(t){ko(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,o){},e})(gf),Rae=(function(t){ko(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.add=function(r,o){},e})(gf),Pae=(function(t){ko(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,o){},e})(gf),Cae=(function(t){ko(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.record=function(r,o){},e})(gf),_O=(function(){function t(){}return t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),Nae=(function(t){ko(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(_O),Mae=(function(t){ko(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(_O),Iae=(function(t){ko(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(_O),gO=new Oae,xae=new bae,wae=new Pae,Lae=new Cae,Dae=new Rae,Uae=new Nae,kae=new Mae,Bae=new Iae});var Ef,ZB=U(()=>{(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Ef||(Ef={}))});var Sf,Tf,SO=U(()=>{Sf={get:function(t,e){if(t!=null)return t[e]},keys:function(t){return t==null?[]:Object.keys(t)}},Tf={set:function(t,e,r){t!=null&&(t[e]=r)}}});var Fae,Vae,eF,tF=U(()=>{wu();Fae=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var o=r.call(t),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},Vae=function(t,e,r){if(r||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return t.concat(a||Array.prototype.slice.call(e))},eF=(function(){function t(){}return t.prototype.active=function(){return _f},t.prototype.with=function(e,r,o){for(var s=[],a=3;a<arguments.length;a++)s[a-3]=arguments[a];return r.call.apply(r,Vae([o],Fae(s),!1))},t.prototype.bind=function(e,r){return r},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t})()});var Gae,qae,TO,jae,qi,Lu=U(()=>{tF();Do();Uo();Gae=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var o=r.call(t),s,a=[],i;try{for(;(e===void 0||e-- >0)&&!(s=o.next()).done;)a.push(s.value)}catch(n){i={error:n}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a},qae=function(t,e,r){if(r||arguments.length===2)for(var o=0,s=e.length,a;o<s;o++)(a||!(o in e))&&(a||(a=Array.prototype.slice.call(e,0,o)),a[o]=e[o]);return t.concat(a||Array.prototype.slice.call(e))},TO="context",jae=new eF,qi=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(e){return fn(TO,e,St.instance())},t.prototype.active=function(){return this._getContextManager().active()},t.prototype.with=function(e,r,o){for(var s,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];return(s=this._getContextManager()).with.apply(s,qae([e,r,o],Gae(a),!1))},t.prototype.bind=function(e,r){return this._getContextManager().bind(e,r)},t.prototype._getContextManager=function(){return ir(TO)||jae},t.prototype.disable=function(){this._getContextManager().disable(),hn(TO,St.instance())},t})()});var da,yO=U(()=>{(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(da||(da={}))});var Du,Uu,yf,vf=U(()=>{yO();Du="0000000000000000",Uu="00000000000000000000000000000000",yf={traceId:Uu,spanId:Du,traceFlags:da.NONE}});var ji,Af=U(()=>{vf();ji=(function(){function t(e){e===void 0&&(e=yf),this._spanContext=e}return t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})()});function Of(t){return t.getValue(vO)||void 0}function rF(){return Of(qi.getInstance().active())}function ku(t,e){return t.setValue(vO,e)}function nF(t){return t.deleteValue(vO)}function iF(t,e){return ku(t,new ji(e))}function bf(t){var e;return(e=Of(t))===null||e===void 0?void 0:e.spanContext()}var vO,AO=U(()=>{wu();Af();Lu();vO=la("OpenTelemetry Context Key SPAN")});function OO(t){return Hae.test(t)&&t!==Uu}function bO(t){return zae.test(t)&&t!==Du}function pa(t){return OO(t.traceId)&&bO(t.spanId)}function oF(t){return new ji(t)}var Hae,zae,Rf=U(()=>{vf();Af();Hae=/^([0-9a-f]{32})$/i,zae=/^[0-9a-f]{16}$/i});function $ae(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var RO,Pf,PO=U(()=>{Lu();AO();Af();Rf();RO=qi.getInstance(),Pf=(function(){function t(){}return t.prototype.startSpan=function(e,r,o){o===void 0&&(o=RO.active());var s=!!r?.root;if(s)return new ji;var a=o&&bf(o);return $ae(a)&&pa(a)?new ji(a):new ji},t.prototype.startActiveSpan=function(e,r,o,s){var a,i,n;if(!(arguments.length<2)){arguments.length===2?n=r:arguments.length===3?(a=r,n=o):(a=r,i=o,n=s);var c=i??RO.active(),u=this.startSpan(e,a,c),l=ku(c,u);return RO.with(l,n,void 0,u)}},t})()});var Yae,Cf,CO=U(()=>{PO();Yae=new Pf,Cf=(function(){function t(e,r,o,s){this._provider=e,this.name=r,this.version=o,this.options=s}return t.prototype.startSpan=function(e,r,o){return this._getTracer().startSpan(e,r,o)},t.prototype.startActiveSpan=function(e,r,o,s){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Yae},t})()});var sF,aF=U(()=>{PO();sF=(function(){function t(){}return t.prototype.getTracer=function(e,r,o){return new Pf},t})()});var Wae,Bu,NO=U(()=>{CO();aF();Wae=new sF,Bu=(function(){function t(){}return t.prototype.getTracer=function(e,r,o){var s;return(s=this.getDelegateTracer(e,r,o))!==null&&s!==void 0?s:new Cf(this,e,r,o)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Wae},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(e,r,o)},t})()});var Nf,cF=U(()=>{(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Nf||(Nf={}))});var Mf,uF=U(()=>{(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(Mf||(Mf={}))});var If,lF=U(()=>{(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(If||(If={}))});function dF(t){return Jae.test(t)}function pF(t){return Qae.test(t)&&!Zae.test(t)}var MO,Kae,Xae,Jae,Qae,Zae,fF=U(()=>{MO="[_0-9a-z-*/]",Kae="[a-z]"+MO+"{0,255}",Xae="[a-z0-9]"+MO+"{0,240}@[a-z]"+MO+"{0,13}",Jae=new RegExp("^(?:"+Kae+"|"+Xae+")$"),Qae=/^[ -~]{0,255}[!-~]$/,Zae=/,|=/});var hF,ece,mF,_F,gF,EF=U(()=>{fF();hF=32,ece=512,mF=",",_F="=",gF=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return t.prototype.set=function(e,r){var o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,r),o},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,o){return r.push(o+_F+e.get(o)),r},[]).join(mF)},t.prototype._parse=function(e){e.length>ece||(this._internalState=e.split(mF).reverse().reduce(function(r,o){var s=o.trim(),a=s.indexOf(_F);if(a!==-1){var i=s.slice(0,a),n=s.slice(a+1,o.length);dF(i)&&pF(n)&&r.set(i,n)}return r},new Map),this._internalState.size>hF&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,hF))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function SF(t){return new gF(t)}var TF=U(()=>{EF()});var IO,yF=U(()=>{Lu();IO=qi.getInstance()});var Je,vF=U(()=>{Uo();Je=St.instance()});var tce,AF,OF=U(()=>{EO();tce=(function(){function t(){}return t.prototype.getMeter=function(e,r,o){return gO},t})(),AF=new tce});var xO,bF,RF=U(()=>{OF();Do();Uo();xO="metrics",bF=(function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return fn(xO,e,St.instance())},t.prototype.getMeterProvider=function(){return ir(xO)||AF},t.prototype.getMeter=function(e,r,o){return this.getMeterProvider().getMeter(e,r,o)},t.prototype.disable=function(){hn(xO,St.instance())},t})()});var fa,PF=U(()=>{RF();fa=bF.getInstance()});var CF,NF=U(()=>{CF=(function(){function t(){}return t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})()});function LO(t){return t.getValue(wO)||void 0}function MF(){return LO(qi.getInstance().active())}function IF(t,e){return t.setValue(wO,e)}function xF(t){return t.deleteValue(wO)}var wO,wF=U(()=>{Lu();wu();wO=la("OpenTelemetry Baggage Key")});var DO,rce,LF,DF=U(()=>{Do();NF();SO();wF();hO();Uo();DO="propagation",rce=new CF,LF=(function(){function t(){this.createBaggage=WB,this.getBaggage=LO,this.getActiveBaggage=MF,this.setBaggage=IF,this.deleteBaggage=xF}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return fn(DO,e,St.instance())},t.prototype.inject=function(e,r,o){return o===void 0&&(o=Tf),this._getGlobalPropagator().inject(e,r,o)},t.prototype.extract=function(e,r,o){return o===void 0&&(o=Sf),this._getGlobalPropagator().extract(e,r,o)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){hn(DO,St.instance())},t.prototype._getGlobalPropagator=function(){return ir(DO)||rce},t})()});var UO,UF=U(()=>{DF();UO=LF.getInstance()});var kO,kF,BF=U(()=>{Do();NO();Rf();AO();Uo();kO="trace",kF=(function(){function t(){this._proxyTracerProvider=new Bu,this.wrapSpanContext=oF,this.isSpanContextValid=pa,this.deleteSpan=nF,this.getSpan=Of,this.getActiveSpan=rF,this.getSpanContext=bf,this.setSpan=ku,this.setSpanContext=iF}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=fn(kO,this._proxyTracerProvider,St.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return ir(kO)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){hn(kO,St.instance()),this._proxyTracerProvider=new Bu},t})()});var BO,FF=U(()=>{BF();BO=kF.getInstance()});var P={};Zd(P,{DiagConsoleLogger:()=>XB,DiagLogLevel:()=>lt,INVALID_SPANID:()=>Du,INVALID_SPAN_CONTEXT:()=>yf,INVALID_TRACEID:()=>Uu,ProxyTracer:()=>Cf,ProxyTracerProvider:()=>Bu,ROOT_CONTEXT:()=>_f,SamplingDecision:()=>Nf,SpanKind:()=>Mf,SpanStatusCode:()=>If,TraceFlags:()=>da,ValueType:()=>Ef,baggageEntryMetadataFromString:()=>KB,context:()=>IO,createContextKey:()=>la,createNoopMeter:()=>QB,createTraceState:()=>SF,default:()=>nce,defaultTextMapGetter:()=>Sf,defaultTextMapSetter:()=>Tf,diag:()=>Je,isSpanContextValid:()=>pa,isValidSpanId:()=>bO,isValidTraceId:()=>OO,metrics:()=>fa,propagation:()=>UO,trace:()=>BO});var nce,b=U(()=>{hO();wu();JB();mf();EO();ZB();SO();CO();NO();cF();uF();lF();yO();TF();Rf();vf();yF();vF();PF();UF();FF();nce={context:IO,diag:Je,metrics:fa,propagation:UO,trace:BO}});var Fu=p(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.isTracingSuppressed=Hi.unsuppressTracing=Hi.suppressTracing=void 0;var ice=(b(),y(P)),FO=(0,ice.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function oce(t){return t.setValue(FO,!0)}Hi.suppressTracing=oce;function sce(t){return t.deleteValue(FO)}Hi.unsuppressTracing=sce;function ace(t){return t.getValue(FO)===!0}Hi.isTracingSuppressed=ace});var VO=p(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.BAGGAGE_MAX_TOTAL_LENGTH=Tt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Tt.BAGGAGE_MAX_NAME_VALUE_PAIRS=Tt.BAGGAGE_HEADER=Tt.BAGGAGE_ITEMS_SEPARATOR=Tt.BAGGAGE_PROPERTIES_SEPARATOR=Tt.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Tt.BAGGAGE_KEY_PAIR_SEPARATOR="=";Tt.BAGGAGE_PROPERTIES_SEPARATOR=";";Tt.BAGGAGE_ITEMS_SEPARATOR=",";Tt.BAGGAGE_HEADER="baggage";Tt.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Tt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Tt.BAGGAGE_MAX_TOTAL_LENGTH=8192});var GO=p(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.parseKeyPairsIntoRecord=mn.parsePairKeyValue=mn.getKeyPairs=mn.serializeKeyPairs=void 0;var cce=(b(),y(P)),Bo=VO();function uce(t){return t.reduce((e,r)=>{let o=`${e}${e!==""?Bo.BAGGAGE_ITEMS_SEPARATOR:""}${r}`;return o.length>Bo.BAGGAGE_MAX_TOTAL_LENGTH?e:o},"")}mn.serializeKeyPairs=uce;function lce(t){return t.getAllEntries().map(([e,r])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(o+=Bo.BAGGAGE_PROPERTIES_SEPARATOR+r.metadata.toString()),o})}mn.getKeyPairs=lce;function VF(t){let e=t.split(Bo.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let r=e.shift();if(!r)return;let o=r.indexOf(Bo.BAGGAGE_KEY_PAIR_SEPARATOR);if(o<=0)return;let s=decodeURIComponent(r.substring(0,o).trim()),a=decodeURIComponent(r.substring(o+1).trim()),i;return e.length>0&&(i=(0,cce.baggageEntryMetadataFromString)(e.join(Bo.BAGGAGE_PROPERTIES_SEPARATOR))),{key:s,value:a,metadata:i}}mn.parsePairKeyValue=VF;function dce(t){let e={};return typeof t=="string"&&t.length>0&&t.split(Bo.BAGGAGE_ITEMS_SEPARATOR).forEach(r=>{let o=VF(r);o!==void 0&&o.value.length>0&&(e[o.key]=o.value)}),e}mn.parseKeyPairsIntoRecord=dce});var GF=p(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.W3CBaggagePropagator=void 0;var qO=(b(),y(P)),pce=Fu(),Fo=VO(),jO=GO(),HO=class{inject(e,r,o){let s=qO.propagation.getBaggage(e);if(!s||(0,pce.isTracingSuppressed)(e))return;let a=(0,jO.getKeyPairs)(s).filter(n=>n.length<=Fo.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Fo.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,jO.serializeKeyPairs)(a);i.length>0&&o.set(r,Fo.BAGGAGE_HEADER,i)}extract(e,r,o){let s=o.get(r,Fo.BAGGAGE_HEADER),a=Array.isArray(s)?s.join(Fo.BAGGAGE_ITEMS_SEPARATOR):s;if(!a)return e;let i={};return a.length===0||(a.split(Fo.BAGGAGE_ITEMS_SEPARATOR).forEach(c=>{let u=(0,jO.parsePairKeyValue)(c);if(u){let l={value:u.value};u.metadata&&(l.metadata=u.metadata),i[u.key]=l}}),Object.entries(i).length===0)?e:qO.propagation.setBaggage(e,qO.propagation.createBaggage(i))}fields(){return[Fo.BAGGAGE_HEADER]}};xf.W3CBaggagePropagator=HO});var qF=p(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.AnchoredClock=void 0;var zO=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}};wf.AnchoredClock=zO});var YF=p(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.isAttributeValue=zi.isAttributeKey=zi.sanitizeAttributes=void 0;var jF=(b(),y(P));function fce(t){let e={};if(typeof t!="object"||t==null)return e;for(let[r,o]of Object.entries(t)){if(!HF(r)){jF.diag.warn(`Invalid attribute key: ${r}`);continue}if(!zF(o)){jF.diag.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(o)?e[r]=o.slice():e[r]=o}return e}zi.sanitizeAttributes=fce;function HF(t){return typeof t=="string"&&t.length>0}zi.isAttributeKey=HF;function zF(t){return t==null?!0:Array.isArray(t)?hce(t):$F(t)}zi.isAttributeValue=zF;function hce(t){let e;for(let r of t)if(r!=null){if(!e){if($F(r)){e=typeof r;continue}return!1}if(typeof r!==e)return!1}return!0}function $F(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}});var $O=p(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.loggingErrorHandler=void 0;var mce=(b(),y(P));function _ce(){return t=>{mce.diag.error(gce(t))}}Lf.loggingErrorHandler=_ce;function gce(t){return typeof t=="string"?t:JSON.stringify(Ece(t))}function Ece(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(o=>{if(e[o])return;let s=r[o];s&&(e[o]=String(s))}),r=Object.getPrototypeOf(r);return e}});var KF=p(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.globalErrorHandler=ha.setGlobalErrorHandler=void 0;var Sce=$O(),WF=(0,Sce.loggingErrorHandler)();function Tce(t){WF=t}ha.setGlobalErrorHandler=Tce;function yce(t){try{WF(t)}catch{}}ha.globalErrorHandler=yce});var ZF=p(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.getStringListFromEnv=_n.getBooleanFromEnv=_n.getStringFromEnv=_n.getNumberFromEnv=void 0;var XF=(b(),y(P)),JF=require("util");function vce(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){XF.diag.warn(`Unknown value ${(0,JF.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}_n.getNumberFromEnv=vce;function QF(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}_n.getStringFromEnv=QF;function Ace(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||XF.diag.warn(`Unknown value ${(0,JF.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}_n.getBooleanFromEnv=Ace;function Oce(t){return QF(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}_n.getStringListFromEnv=Oce});var eV=p(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df._globalThis=void 0;Df._globalThis=typeof globalThis=="object"?globalThis:global});var tV=p(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.otperformance=void 0;var bce=require("perf_hooks");Uf.otperformance=bce.performance});var rV=p(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.VERSION=void 0;kf.VERSION="2.1.0"});function Ue(t){let e={},r=t.length;for(let o=0;o<r;o++){let s=t[o];s&&(e[String(s).toUpperCase().replace(/[-.]/g,"_")]=s)}return e}var YO=U(()=>{});var nV,iV,oV,sV,aV,cV,uV,lV,dV,pV,fV,hV,mV,_V,gV,EV,SV,TV,yV,vV,AV,OV,bV,RV,PV,CV,NV,MV,IV,xV,wV,LV,DV,UV,kV,BV,FV,VV,GV,qV,jV,HV,zV,$V,YV,WV,KV,XV,JV,QV,ZV,eG,tG,rG,nG,iG,oG,sG,aG,cG,uG,lG,dG,pG,fG,hG,mG,_G,gG,EG,SG,TG,yG,vG,AG,OG,bG,RG,PG,CG,NG,MG,IG,xG,wG,LG,DG,UG,kG,BG,FG,VG,GG,qG,jG,HG,zG,$G,YG,WG,KG,XG,JG,QG,ZG,eq,tq,rq,nq,iq,oq,sq,aq,cq,uq,lq,dq,pq,fq,hq,mq,_q,gq,Eq,Sq,Tq,yq,vq,Rce,Pce,Cce,Nce,Mce,Ice,xce,wce,Lce,Dce,Uce,kce,Bce,Fce,Vce,Gce,qce,jce,Hce,zce,$ce,Yce,Wce,Kce,Xce,Jce,Qce,Zce,eue,tue,rue,nue,iue,oue,sue,aue,cue,uue,lue,due,pue,fue,hue,mue,_ue,gue,Eue,Sue,Tue,yue,vue,Aue,Oue,bue,Rue,Pue,Cue,Nue,Mue,Iue,xue,wue,Lue,Due,Uue,kue,Bue,Fue,Vue,Gue,que,jue,Hue,zue,$ue,Yue,Wue,Kue,Xue,Jue,Que,Zue,ele,tle,rle,nle,ile,ole,sle,ale,cle,ule,lle,dle,ple,fle,hle,mle,_le,gle,Ele,Sle,Tle,yle,vle,Ale,Ole,ble,Rle,Ple,Cle,Nle,Mle,Ile,xle,wle,Lle,Dle,Ule,kle,Ble,Fle,Vle,Gle,qle,jle,Hle,zle,$le,Aq,Oq,bq,Rq,Pq,Cq,Nq,Mq,Iq,xq,wq,Lq,Dq,Uq,kq,Bq,Fq,Vq,Gq,qq,jq,Hq,zq,$q,Yq,Wq,Kq,Xq,Jq,Qq,Zq,e2,t2,r2,n2,i2,o2,s2,a2,c2,u2,l2,d2,p2,f2,h2,m2,Yle,Wle,Kle,Xle,Jle,Qle,Zle,ede,tde,rde,nde,ide,ode,sde,ade,cde,ude,lde,dde,pde,fde,hde,mde,_de,gde,Ede,Sde,Tde,yde,vde,Ade,Ode,bde,Rde,Pde,Cde,Nde,Mde,Ide,xde,wde,Lde,Dde,Ude,kde,Bde,Fde,Vde,_2,g2,E2,S2,T2,y2,v2,A2,O2,b2,R2,Gde,qde,jde,Hde,zde,$de,Yde,Wde,Kde,Xde,Jde,Qde,P2,C2,N2,M2,I2,Zde,epe,tpe,rpe,npe,ipe,x2,w2,L2,ope,spe,ape,cpe,D2,U2,k2,B2,upe,lpe,dpe,ppe,fpe,F2,V2,G2,q2,j2,H2,z2,hpe,mpe,_pe,gpe,Epe,Spe,Tpe,ype,$2,Y2,W2,K2,X2,vpe,Ape,Ope,bpe,Rpe,Ppe,J2,Q2,Z2,ej,tj,rj,nj,ij,oj,sj,aj,cj,uj,lj,dj,pj,fj,hj,mj,_j,gj,Cpe,Npe,Mpe,Ipe,xpe,wpe,Lpe,Dpe,Upe,kpe,Bpe,Fpe,Vpe,Gpe,qpe,jpe,Hpe,zpe,$pe,Ype,Wpe,Kpe,Ej,Sj,Tj,yj,vj,Xpe,Jpe,Qpe,Zpe,efe,tfe,Aj,Oj,rfe,nfe,ife,bj,Rj,ofe,sfe,afe,Pj,Cj,Nj,Mj,Ij,xj,wj,Lj,Dj,Uj,kj,Bj,Fj,Vj,Gj,qj,jj,cfe,ufe,lfe,dfe,pfe,ffe,hfe,mfe,_fe,gfe,Efe,Sfe,Tfe,yfe,vfe,Afe,Ofe,bfe,Hj,zj,Rfe,Pfe,Cfe,$j=U(()=>{YO();nV="aws.lambda.invoked_arn",iV="db.system",oV="db.connection_string",sV="db.user",aV="db.jdbc.driver_classname",cV="db.name",uV="db.statement",lV="db.operation",dV="db.mssql.instance_name",pV="db.cassandra.keyspace",fV="db.cassandra.page_size",hV="db.cassandra.consistency_level",mV="db.cassandra.table",_V="db.cassandra.idempotence",gV="db.cassandra.speculative_execution_count",EV="db.cassandra.coordinator.id",SV="db.cassandra.coordinator.dc",TV="db.hbase.namespace",yV="db.redis.database_index",vV="db.mongodb.collection",AV="db.sql.table",OV="exception.type",bV="exception.message",RV="exception.stacktrace",PV="exception.escaped",CV="faas.trigger",NV="faas.execution",MV="faas.document.collection",IV="faas.document.operation",xV="faas.document.time",wV="faas.document.name",LV="faas.time",DV="faas.cron",UV="faas.coldstart",kV="faas.invoked_name",BV="faas.invoked_provider",FV="faas.invoked_region",VV="net.transport",GV="net.peer.ip",qV="net.peer.port",jV="net.peer.name",HV="net.host.ip",zV="net.host.port",$V="net.host.name",YV="net.host.connection.type",WV="net.host.connection.subtype",KV="net.host.carrier.name",XV="net.host.carrier.mcc",JV="net.host.carrier.mnc",QV="net.host.carrier.icc",ZV="peer.service",eG="enduser.id",tG="enduser.role",rG="enduser.scope",nG="thread.id",iG="thread.name",oG="code.function",sG="code.namespace",aG="code.filepath",cG="code.lineno",uG="http.method",lG="http.url",dG="http.target",pG="http.host",fG="http.scheme",hG="http.status_code",mG="http.flavor",_G="http.user_agent",gG="http.request_content_length",EG="http.request_content_length_uncompressed",SG="http.response_content_length",TG="http.response_content_length_uncompressed",yG="http.server_name",vG="http.route",AG="http.client_ip",OG="aws.dynamodb.table_names",bG="aws.dynamodb.consumed_capacity",RG="aws.dynamodb.item_collection_metrics",PG="aws.dynamodb.provisioned_read_capacity",CG="aws.dynamodb.provisioned_write_capacity",NG="aws.dynamodb.consistent_read",MG="aws.dynamodb.projection",IG="aws.dynamodb.limit",xG="aws.dynamodb.attributes_to_get",wG="aws.dynamodb.index_name",LG="aws.dynamodb.select",DG="aws.dynamodb.global_secondary_indexes",UG="aws.dynamodb.local_secondary_indexes",kG="aws.dynamodb.exclusive_start_table",BG="aws.dynamodb.table_count",FG="aws.dynamodb.scan_forward",VG="aws.dynamodb.segment",GG="aws.dynamodb.total_segments",qG="aws.dynamodb.count",jG="aws.dynamodb.scanned_count",HG="aws.dynamodb.attribute_definitions",zG="aws.dynamodb.global_secondary_index_updates",$G="messaging.system",YG="messaging.destination",WG="messaging.destination_kind",KG="messaging.temp_destination",XG="messaging.protocol",JG="messaging.protocol_version",QG="messaging.url",ZG="messaging.message_id",eq="messaging.conversation_id",tq="messaging.message_payload_size_bytes",rq="messaging.message_payload_compressed_size_bytes",nq="messaging.operation",iq="messaging.consumer_id",oq="messaging.rabbitmq.routing_key",sq="messaging.kafka.message_key",aq="messaging.kafka.consumer_group",cq="messaging.kafka.client_id",uq="messaging.kafka.partition",lq="messaging.kafka.tombstone",dq="rpc.system",pq="rpc.service",fq="rpc.method",hq="rpc.grpc.status_code",mq="rpc.jsonrpc.version",_q="rpc.jsonrpc.request_id",gq="rpc.jsonrpc.error_code",Eq="rpc.jsonrpc.error_message",Sq="message.type",Tq="message.id",yq="message.compressed_size",vq="message.uncompressed_size",Rce=nV,Pce=iV,Cce=oV,Nce=sV,Mce=aV,Ice=cV,xce=uV,wce=lV,Lce=dV,Dce=pV,Uce=fV,kce=hV,Bce=mV,Fce=_V,Vce=gV,Gce=EV,qce=SV,jce=TV,Hce=yV,zce=vV,$ce=AV,Yce=OV,Wce=bV,Kce=RV,Xce=PV,Jce=CV,Qce=NV,Zce=MV,eue=IV,tue=xV,rue=wV,nue=LV,iue=DV,oue=UV,sue=kV,aue=BV,cue=FV,uue=VV,lue=GV,due=qV,pue=jV,fue=HV,hue=zV,mue=$V,_ue=YV,gue=WV,Eue=KV,Sue=XV,Tue=JV,yue=QV,vue=ZV,Aue=eG,Oue=tG,bue=rG,Rue=nG,Pue=iG,Cue=oG,Nue=sG,Mue=aG,Iue=cG,xue=uG,wue=lG,Lue=dG,Due=pG,Uue=fG,kue=hG,Bue=mG,Fue=_G,Vue=gG,Gue=EG,que=SG,jue=TG,Hue=yG,zue=vG,$ue=AG,Yue=OG,Wue=bG,Kue=RG,Xue=PG,Jue=CG,Que=NG,Zue=MG,ele=IG,tle=xG,rle=wG,nle=LG,ile=DG,ole=UG,sle=kG,ale=BG,cle=FG,ule=VG,lle=GG,dle=qG,ple=jG,fle=HG,hle=zG,mle=$G,_le=YG,gle=WG,Ele=KG,Sle=XG,Tle=JG,yle=QG,vle=ZG,Ale=eq,Ole=tq,ble=rq,Rle=nq,Ple=iq,Cle=oq,Nle=sq,Mle=aq,Ile=cq,xle=uq,wle=lq,Lle=dq,Dle=pq,Ule=fq,kle=hq,Ble=mq,Fle=_q,Vle=gq,Gle=Eq,qle=Sq,jle=Tq,Hle=yq,zle=vq,$le=Ue([nV,iV,oV,sV,aV,cV,uV,lV,dV,pV,fV,hV,mV,_V,gV,EV,SV,TV,yV,vV,AV,OV,bV,RV,PV,CV,NV,MV,IV,xV,wV,LV,DV,UV,kV,BV,FV,VV,GV,qV,jV,HV,zV,$V,YV,WV,KV,XV,JV,QV,ZV,eG,tG,rG,nG,iG,oG,sG,aG,cG,uG,lG,dG,pG,fG,hG,mG,_G,gG,EG,SG,TG,yG,vG,AG,OG,bG,RG,PG,CG,NG,MG,IG,xG,wG,LG,DG,UG,kG,BG,FG,VG,GG,qG,jG,HG,zG,$G,YG,WG,KG,XG,JG,QG,ZG,eq,tq,rq,nq,iq,oq,sq,aq,cq,uq,lq,dq,pq,fq,hq,mq,_q,gq,Eq,Sq,Tq,yq,vq]),Aq="other_sql",Oq="mssql",bq="mysql",Rq="oracle",Pq="db2",Cq="postgresql",Nq="redshift",Mq="hive",Iq="cloudscape",xq="hsqldb",wq="progress",Lq="maxdb",Dq="hanadb",Uq="ingres",kq="firstsql",Bq="edb",Fq="cache",Vq="adabas",Gq="firebird",qq="derby",jq="filemaker",Hq="informix",zq="instantdb",$q="interbase",Yq="mariadb",Wq="netezza",Kq="pervasive",Xq="pointbase",Jq="sqlite",Qq="sybase",Zq="teradata",e2="vertica",t2="h2",r2="coldfusion",n2="cassandra",i2="hbase",o2="mongodb",s2="redis",a2="couchbase",c2="couchdb",u2="cosmosdb",l2="dynamodb",d2="neo4j",p2="geode",f2="elasticsearch",h2="memcached",m2="cockroachdb",Yle=Aq,Wle=Oq,Kle=bq,Xle=Rq,Jle=Pq,Qle=Cq,Zle=Nq,ede=Mq,tde=Iq,rde=xq,nde=wq,ide=Lq,ode=Dq,sde=Uq,ade=kq,cde=Bq,ude=Fq,lde=Vq,dde=Gq,pde=qq,fde=jq,hde=Hq,mde=zq,_de=$q,gde=Yq,Ede=Wq,Sde=Kq,Tde=Xq,yde=Jq,vde=Qq,Ade=Zq,Ode=e2,bde=t2,Rde=r2,Pde=n2,Cde=i2,Nde=o2,Mde=s2,Ide=a2,xde=c2,wde=u2,Lde=l2,Dde=d2,Ude=p2,kde=f2,Bde=h2,Fde=m2,Vde=Ue([Aq,Oq,bq,Rq,Pq,Cq,Nq,Mq,Iq,xq,wq,Lq,Dq,Uq,kq,Bq,Fq,Vq,Gq,qq,jq,Hq,zq,$q,Yq,Wq,Kq,Xq,Jq,Qq,Zq,e2,t2,r2,n2,i2,o2,s2,a2,c2,u2,l2,d2,p2,f2,h2,m2]),_2="all",g2="each_quorum",E2="quorum",S2="local_quorum",T2="one",y2="two",v2="three",A2="local_one",O2="any",b2="serial",R2="local_serial",Gde=_2,qde=g2,jde=E2,Hde=S2,zde=T2,$de=y2,Yde=v2,Wde=A2,Kde=O2,Xde=b2,Jde=R2,Qde=Ue([_2,g2,E2,S2,T2,y2,v2,A2,O2,b2,R2]),P2="datasource",C2="http",N2="pubsub",M2="timer",I2="other",Zde=P2,epe=C2,tpe=N2,rpe=M2,npe=I2,ipe=Ue([P2,C2,N2,M2,I2]),x2="insert",w2="edit",L2="delete",ope=x2,spe=w2,ape=L2,cpe=Ue([x2,w2,L2]),D2="alibaba_cloud",U2="aws",k2="azure",B2="gcp",upe=D2,lpe=U2,dpe=k2,ppe=B2,fpe=Ue([D2,U2,k2,B2]),F2="ip_tcp",V2="ip_udp",G2="ip",q2="unix",j2="pipe",H2="inproc",z2="other",hpe=F2,mpe=V2,_pe=G2,gpe=q2,Epe=j2,Spe=H2,Tpe=z2,ype=Ue([F2,V2,G2,q2,j2,H2,z2]),$2="wifi",Y2="wired",W2="cell",K2="unavailable",X2="unknown",vpe=$2,Ape=Y2,Ope=W2,bpe=K2,Rpe=X2,Ppe=Ue([$2,Y2,W2,K2,X2]),J2="gprs",Q2="edge",Z2="umts",ej="cdma",tj="evdo_0",rj="evdo_a",nj="cdma2000_1xrtt",ij="hsdpa",oj="hsupa",sj="hspa",aj="iden",cj="evdo_b",uj="lte",lj="ehrpd",dj="hspap",pj="gsm",fj="td_scdma",hj="iwlan",mj="nr",_j="nrnsa",gj="lte_ca",Cpe=J2,Npe=Q2,Mpe=Z2,Ipe=ej,xpe=tj,wpe=rj,Lpe=nj,Dpe=ij,Upe=oj,kpe=sj,Bpe=aj,Fpe=cj,Vpe=uj,Gpe=lj,qpe=dj,jpe=pj,Hpe=fj,zpe=hj,$pe=mj,Ype=_j,Wpe=gj,Kpe=Ue([J2,Q2,Z2,ej,tj,rj,nj,ij,oj,sj,aj,cj,uj,lj,dj,pj,fj,hj,mj,_j,gj]),Ej="1.0",Sj="1.1",Tj="2.0",yj="SPDY",vj="QUIC",Xpe=Ej,Jpe=Sj,Qpe=Tj,Zpe=yj,efe=vj,tfe={HTTP_1_0:Ej,HTTP_1_1:Sj,HTTP_2_0:Tj,SPDY:yj,QUIC:vj},Aj="queue",Oj="topic",rfe=Aj,nfe=Oj,ife=Ue([Aj,Oj]),bj="receive",Rj="process",ofe=bj,sfe=Rj,afe=Ue([bj,Rj]),Pj=0,Cj=1,Nj=2,Mj=3,Ij=4,xj=5,wj=6,Lj=7,Dj=8,Uj=9,kj=10,Bj=11,Fj=12,Vj=13,Gj=14,qj=15,jj=16,cfe=Pj,ufe=Cj,lfe=Nj,dfe=Mj,pfe=Ij,ffe=xj,hfe=wj,mfe=Lj,_fe=Dj,gfe=Uj,Efe=kj,Sfe=Bj,Tfe=Fj,yfe=Vj,vfe=Gj,Afe=qj,Ofe=jj,bfe={OK:Pj,CANCELLED:Cj,UNKNOWN:Nj,INVALID_ARGUMENT:Mj,DEADLINE_EXCEEDED:Ij,NOT_FOUND:xj,ALREADY_EXISTS:wj,PERMISSION_DENIED:Lj,RESOURCE_EXHAUSTED:Dj,FAILED_PRECONDITION:Uj,ABORTED:kj,OUT_OF_RANGE:Bj,UNIMPLEMENTED:Fj,INTERNAL:Vj,UNAVAILABLE:Gj,DATA_LOSS:qj,UNAUTHENTICATED:jj},Hj="SENT",zj="RECEIVED",Rfe=Hj,Pfe=zj,Cfe=Ue([Hj,zj])});var Yj=U(()=>{$j()});var Wj,Kj,Xj,Jj,Qj,Zj,eH,tH,rH,nH,iH,oH,sH,aH,cH,uH,lH,dH,pH,fH,hH,mH,_H,gH,EH,SH,TH,yH,vH,AH,OH,bH,RH,PH,CH,NH,MH,IH,xH,wH,LH,DH,UH,kH,BH,FH,VH,GH,qH,jH,HH,zH,$H,YH,WH,KH,XH,JH,QH,ZH,e3,t3,r3,n3,i3,o3,s3,a3,c3,u3,l3,d3,p3,f3,h3,m3,_3,g3,E3,S3,T3,Nfe,Mfe,Ife,xfe,wfe,Lfe,Dfe,Ufe,kfe,Bfe,Ffe,Vfe,Gfe,qfe,jfe,Hfe,zfe,$fe,Yfe,Wfe,Kfe,Xfe,Jfe,Qfe,Zfe,ehe,the,rhe,nhe,ihe,ohe,she,ahe,che,uhe,lhe,dhe,phe,fhe,hhe,mhe,_he,ghe,Ehe,She,The,yhe,vhe,Ahe,Ohe,bhe,Rhe,Phe,Che,Nhe,Mhe,Ihe,xhe,whe,Lhe,Dhe,Uhe,khe,Bhe,Fhe,Vhe,Ghe,qhe,jhe,Hhe,zhe,$he,Yhe,Whe,Khe,Xhe,Jhe,Qhe,Zhe,eme,tme,rme,y3,v3,A3,O3,nme,ime,ome,sme,ame,b3,R3,P3,C3,N3,M3,I3,x3,w3,L3,D3,U3,k3,B3,F3,V3,G3,cme,ume,lme,dme,pme,fme,hme,mme,_me,gme,Eme,Sme,Tme,yme,vme,Ame,Ome,bme,q3,j3,Rme,Pme,Cme,H3,z3,$3,Y3,W3,K3,X3,Nme,Mme,Ime,xme,wme,Lme,Dme,Ume,J3,Q3,Z3,ez,tz,rz,nz,iz,oz,sz,az,kme,Bme,Fme,Vme,Gme,qme,jme,Hme,zme,$me,Yme,Wme,cz,uz,lz,dz,pz,fz,hz,mz,_z,gz,Kme,Xme,Jme,Qme,Zme,e_e,t_e,r_e,n_e,i_e,o_e,Ez=U(()=>{YO();Wj="cloud.provider",Kj="cloud.account.id",Xj="cloud.region",Jj="cloud.availability_zone",Qj="cloud.platform",Zj="aws.ecs.container.arn",eH="aws.ecs.cluster.arn",tH="aws.ecs.launchtype",rH="aws.ecs.task.arn",nH="aws.ecs.task.family",iH="aws.ecs.task.revision",oH="aws.eks.cluster.arn",sH="aws.log.group.names",aH="aws.log.group.arns",cH="aws.log.stream.names",uH="aws.log.stream.arns",lH="container.name",dH="container.id",pH="container.runtime",fH="container.image.name",hH="container.image.tag",mH="deployment.environment",_H="device.id",gH="device.model.identifier",EH="device.model.name",SH="faas.name",TH="faas.id",yH="faas.version",vH="faas.instance",AH="faas.max_memory",OH="host.id",bH="host.name",RH="host.type",PH="host.arch",CH="host.image.name",NH="host.image.id",MH="host.image.version",IH="k8s.cluster.name",xH="k8s.node.name",wH="k8s.node.uid",LH="k8s.namespace.name",DH="k8s.pod.uid",UH="k8s.pod.name",kH="k8s.container.name",BH="k8s.replicaset.uid",FH="k8s.replicaset.name",VH="k8s.deployment.uid",GH="k8s.deployment.name",qH="k8s.statefulset.uid",jH="k8s.statefulset.name",HH="k8s.daemonset.uid",zH="k8s.daemonset.name",$H="k8s.job.uid",YH="k8s.job.name",WH="k8s.cronjob.uid",KH="k8s.cronjob.name",XH="os.type",JH="os.description",QH="os.name",ZH="os.version",e3="process.pid",t3="process.executable.name",r3="process.executable.path",n3="process.command",i3="process.command_line",o3="process.command_args",s3="process.owner",a3="process.runtime.name",c3="process.runtime.version",u3="process.runtime.description",l3="service.name",d3="service.namespace",p3="service.instance.id",f3="service.version",h3="telemetry.sdk.name",m3="telemetry.sdk.language",_3="telemetry.sdk.version",g3="telemetry.auto.version",E3="webengine.name",S3="webengine.version",T3="webengine.description",Nfe=Wj,Mfe=Kj,Ife=Xj,xfe=Jj,wfe=Qj,Lfe=Zj,Dfe=eH,Ufe=tH,kfe=rH,Bfe=nH,Ffe=iH,Vfe=oH,Gfe=sH,qfe=aH,jfe=cH,Hfe=uH,zfe=lH,$fe=dH,Yfe=pH,Wfe=fH,Kfe=hH,Xfe=mH,Jfe=_H,Qfe=gH,Zfe=EH,ehe=SH,the=TH,rhe=yH,nhe=vH,ihe=AH,ohe=OH,she=bH,ahe=RH,che=PH,uhe=CH,lhe=NH,dhe=MH,phe=IH,fhe=xH,hhe=wH,mhe=LH,_he=DH,ghe=UH,Ehe=kH,She=BH,The=FH,yhe=VH,vhe=GH,Ahe=qH,Ohe=jH,bhe=HH,Rhe=zH,Phe=$H,Che=YH,Nhe=WH,Mhe=KH,Ihe=XH,xhe=JH,whe=QH,Lhe=ZH,Dhe=e3,Uhe=t3,khe=r3,Bhe=n3,Fhe=i3,Vhe=o3,Ghe=s3,qhe=a3,jhe=c3,Hhe=u3,zhe=l3,$he=d3,Yhe=p3,Whe=f3,Khe=h3,Xhe=m3,Jhe=_3,Qhe=g3,Zhe=E3,eme=S3,tme=T3,rme=Ue([Wj,Kj,Xj,Jj,Qj,Zj,eH,tH,rH,nH,iH,oH,sH,aH,cH,uH,lH,dH,pH,fH,hH,mH,_H,gH,EH,SH,TH,yH,vH,AH,OH,bH,RH,PH,CH,NH,MH,IH,xH,wH,LH,DH,UH,kH,BH,FH,VH,GH,qH,jH,HH,zH,$H,YH,WH,KH,XH,JH,QH,ZH,e3,t3,r3,n3,i3,o3,s3,a3,c3,u3,l3,d3,p3,f3,h3,m3,_3,g3,E3,S3,T3]),y3="alibaba_cloud",v3="aws",A3="azure",O3="gcp",nme=y3,ime=v3,ome=A3,sme=O3,ame=Ue([y3,v3,A3,O3]),b3="alibaba_cloud_ecs",R3="alibaba_cloud_fc",P3="aws_ec2",C3="aws_ecs",N3="aws_eks",M3="aws_lambda",I3="aws_elastic_beanstalk",x3="azure_vm",w3="azure_container_instances",L3="azure_aks",D3="azure_functions",U3="azure_app_service",k3="gcp_compute_engine",B3="gcp_cloud_run",F3="gcp_kubernetes_engine",V3="gcp_cloud_functions",G3="gcp_app_engine",cme=b3,ume=R3,lme=P3,dme=C3,pme=N3,fme=M3,hme=I3,mme=x3,_me=w3,gme=L3,Eme=D3,Sme=U3,Tme=k3,yme=B3,vme=F3,Ame=V3,Ome=G3,bme=Ue([b3,R3,P3,C3,N3,M3,I3,x3,w3,L3,D3,U3,k3,B3,F3,V3,G3]),q3="ec2",j3="fargate",Rme=q3,Pme=j3,Cme=Ue([q3,j3]),H3="amd64",z3="arm32",$3="arm64",Y3="ia64",W3="ppc32",K3="ppc64",X3="x86",Nme=H3,Mme=z3,Ime=$3,xme=Y3,wme=W3,Lme=K3,Dme=X3,Ume=Ue([H3,z3,$3,Y3,W3,K3,X3]),J3="windows",Q3="linux",Z3="darwin",ez="freebsd",tz="netbsd",rz="openbsd",nz="dragonflybsd",iz="hpux",oz="aix",sz="solaris",az="z_os",kme=J3,Bme=Q3,Fme=Z3,Vme=ez,Gme=tz,qme=rz,jme=nz,Hme=iz,zme=oz,$me=sz,Yme=az,Wme=Ue([J3,Q3,Z3,ez,tz,rz,nz,iz,oz,sz,az]),cz="cpp",uz="dotnet",lz="erlang",dz="go",pz="java",fz="nodejs",hz="php",mz="python",_z="ruby",gz="webjs",Kme=cz,Xme=uz,Jme=lz,Qme=dz,Zme=pz,e_e=fz,t_e=hz,r_e=mz,n_e=_z,i_e=gz,o_e=Ue([cz,uz,lz,dz,pz,fz,hz,mz,_z,gz])});var Sz=U(()=>{Ez()});var s_e,a_e,c_e,u_e,l_e,d_e,p_e,f_e,h_e,m_e,__e,g_e,E_e,S_e,T_e,y_e,v_e,A_e,O_e,b_e,R_e,P_e,C_e,N_e,M_e,I_e,x_e,w_e,L_e,D_e,U_e,k_e,B_e,F_e,V_e,G_e,q_e,j_e,H_e,z_e,$_e,Y_e,ZXe,e5e,W_e,K_e,X_e,J_e,Q_e,Z_e,ege,tge,rge,nge,ige,t5e,oge,sge,age,cge,r5e,uge,lge,dge,pge,fge,hge,mge,_ge,gge,Ege,Sge,Tge,yge,vge,Age,n5e,Oge,bge,Rge,Pge,Cge,Nge,Mge,Ige,xge,wge,Lge,Dge,Uge,i5e,o5e,kge,Bge,Fge,Vge,Gge,qge,jge,Hge,s5e,zge,$ge,Yge,WO,KO,Wge,Kge,Xge,Jge,Qge,Zge,eEe,tEe,rEe,a5e,nEe,iEe,c5e,oEe,sEe,u5e,aEe,cEe,uEe,lEe,dEe,pEe,fEe,hEe,mEe,_Ee,gEe,EEe,SEe,Tz=U(()=>{s_e="aspnetcore.diagnostics.exception.result",a_e="aborted",c_e="handled",u_e="skipped",l_e="unhandled",d_e="aspnetcore.diagnostics.handler.type",p_e="aspnetcore.rate_limiting.policy",f_e="aspnetcore.rate_limiting.result",h_e="acquired",m_e="endpoint_limiter",__e="global_limiter",g_e="request_canceled",E_e="aspnetcore.request.is_unhandled",S_e="aspnetcore.routing.is_fallback",T_e="aspnetcore.routing.match_status",y_e="failure",v_e="success",A_e="aspnetcore.user.is_authenticated",O_e="client.address",b_e="client.port",R_e="code.column.number",P_e="code.file.path",C_e="code.function.name",N_e="code.line.number",M_e="code.stacktrace",I_e="db.collection.name",x_e="db.namespace",w_e="db.operation.batch.size",L_e="db.operation.name",D_e="db.query.summary",U_e="db.query.text",k_e="db.response.status_code",B_e="db.stored_procedure.name",F_e="db.system.name",V_e="mariadb",G_e="microsoft.sql_server",q_e="mysql",j_e="postgresql",H_e="dotnet.gc.heap.generation",z_e="gen0",$_e="gen1",Y_e="gen2",ZXe="loh",e5e="poh",W_e="error.type",K_e="_OTHER",X_e="exception.escaped",J_e="exception.message",Q_e="exception.stacktrace",Z_e="exception.type",ege=t=>`http.request.header.${t}`,tge="http.request.method",rge="_OTHER",nge="CONNECT",ige="DELETE",t5e="GET",oge="HEAD",sge="OPTIONS",age="PATCH",cge="POST",r5e="PUT",uge="TRACE",lge="http.request.method_original",dge="http.request.resend_count",pge=t=>`http.response.header.${t}`,fge="http.response.status_code",hge="http.route",mge="jvm.gc.action",_ge="jvm.gc.name",gge="jvm.memory.pool.name",Ege="jvm.memory.type",Sge="heap",Tge="non_heap",yge="jvm.thread.daemon",vge="jvm.thread.state",Age="blocked",n5e="new",Oge="runnable",bge="terminated",Rge="timed_waiting",Pge="waiting",Cge="network.local.address",Nge="network.local.port",Mge="network.peer.address",Ige="network.peer.port",xge="network.protocol.name",wge="network.protocol.version",Lge="network.transport",Dge="pipe",Uge="quic",i5e="tcp",o5e="udp",kge="unix",Bge="network.type",Fge="ipv4",Vge="ipv6",Gge="otel.scope.name",qge="otel.scope.version",jge="otel.status_code",Hge="ERROR",s5e="OK",zge="otel.status_description",$ge="server.address",Yge="server.port",WO="service.name",KO="service.version",Wge="signalr.connection.status",Kge="app_shutdown",Xge="normal_closure",Jge="timeout",Qge="signalr.transport",Zge="long_polling",eEe="server_sent_events",tEe="web_sockets",rEe="telemetry.sdk.language",a5e="cpp",nEe="dotnet",iEe="erlang",c5e="go",oEe="java",sEe="nodejs",u5e="php",aEe="python",cEe="ruby",uEe="rust",lEe="swift",dEe="webjs",pEe="telemetry.sdk.name",fEe="telemetry.sdk.version",hEe="url.fragment",mEe="url.full",_Ee="url.path",gEe="url.query",EEe="url.scheme",SEe="user_agent.original"});var TEe,yEe,vEe,AEe,OEe,bEe,REe,PEe,CEe,NEe,MEe,IEe,xEe,wEe,LEe,DEe,UEe,kEe,BEe,FEe,VEe,GEe,qEe,jEe,HEe,zEe,$Ee,YEe,WEe,KEe,XEe,JEe,QEe,ZEe,eSe,tSe,rSe,nSe,iSe,oSe,sSe,aSe,cSe,uSe,lSe,dSe,pSe,fSe,hSe,mSe,_Se,yz=U(()=>{TEe="aspnetcore.diagnostics.exceptions",yEe="aspnetcore.rate_limiting.active_request_leases",vEe="aspnetcore.rate_limiting.queued_requests",AEe="aspnetcore.rate_limiting.request.time_in_queue",OEe="aspnetcore.rate_limiting.request_lease.duration",bEe="aspnetcore.rate_limiting.requests",REe="aspnetcore.routing.match_attempts",PEe="db.client.operation.duration",CEe="dotnet.assembly.count",NEe="dotnet.exceptions",MEe="dotnet.gc.collections",IEe="dotnet.gc.heap.total_allocated",xEe="dotnet.gc.last_collection.heap.fragmentation.size",wEe="dotnet.gc.last_collection.heap.size",LEe="dotnet.gc.last_collection.memory.committed_size",DEe="dotnet.gc.pause.time",UEe="dotnet.jit.compilation.time",kEe="dotnet.jit.compiled_il.size",BEe="dotnet.jit.compiled_methods",FEe="dotnet.monitor.lock_contentions",VEe="dotnet.process.cpu.count",GEe="dotnet.process.cpu.time",qEe="dotnet.process.memory.working_set",jEe="dotnet.thread_pool.queue.length",HEe="dotnet.thread_pool.thread.count",zEe="dotnet.thread_pool.work_item.count",$Ee="dotnet.timer.count",YEe="http.client.request.duration",WEe="http.server.request.duration",KEe="jvm.class.count",XEe="jvm.class.loaded",JEe="jvm.class.unloaded",QEe="jvm.cpu.count",ZEe="jvm.cpu.recent_utilization",eSe="jvm.cpu.time",tSe="jvm.gc.duration",rSe="jvm.memory.committed",nSe="jvm.memory.limit",iSe="jvm.memory.used",oSe="jvm.memory.used_after_last_gc",sSe="jvm.thread.count",aSe="kestrel.active_connections",cSe="kestrel.active_tls_handshakes",uSe="kestrel.connection.duration",lSe="kestrel.queued_connections",dSe="kestrel.queued_requests",pSe="kestrel.rejected_connections",fSe="kestrel.tls_handshake.duration",hSe="kestrel.upgraded_connections",mSe="signalr.server.active_connections",_Se="signalr.server.connection.duration"});var gSe,vz=U(()=>{gSe="exception"});var Dt={};Zd(Dt,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>a_e,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>c_e,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>u_e,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>l_e,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>h_e,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>m_e,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>__e,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>g_e,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>y_e,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>v_e,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>s_e,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>d_e,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>p_e,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>f_e,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>E_e,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>S_e,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>T_e,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>A_e,ATTR_CLIENT_ADDRESS:()=>O_e,ATTR_CLIENT_PORT:()=>b_e,ATTR_CODE_COLUMN_NUMBER:()=>R_e,ATTR_CODE_FILE_PATH:()=>P_e,ATTR_CODE_FUNCTION_NAME:()=>C_e,ATTR_CODE_LINE_NUMBER:()=>N_e,ATTR_CODE_STACKTRACE:()=>M_e,ATTR_DB_COLLECTION_NAME:()=>I_e,ATTR_DB_NAMESPACE:()=>x_e,ATTR_DB_OPERATION_BATCH_SIZE:()=>w_e,ATTR_DB_OPERATION_NAME:()=>L_e,ATTR_DB_QUERY_SUMMARY:()=>D_e,ATTR_DB_QUERY_TEXT:()=>U_e,ATTR_DB_RESPONSE_STATUS_CODE:()=>k_e,ATTR_DB_STORED_PROCEDURE_NAME:()=>B_e,ATTR_DB_SYSTEM_NAME:()=>F_e,ATTR_DOTNET_GC_HEAP_GENERATION:()=>H_e,ATTR_ERROR_TYPE:()=>W_e,ATTR_EXCEPTION_ESCAPED:()=>X_e,ATTR_EXCEPTION_MESSAGE:()=>J_e,ATTR_EXCEPTION_STACKTRACE:()=>Q_e,ATTR_EXCEPTION_TYPE:()=>Z_e,ATTR_HTTP_REQUEST_HEADER:()=>ege,ATTR_HTTP_REQUEST_METHOD:()=>tge,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>lge,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>dge,ATTR_HTTP_RESPONSE_HEADER:()=>pge,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>fge,ATTR_HTTP_ROUTE:()=>hge,ATTR_JVM_GC_ACTION:()=>mge,ATTR_JVM_GC_NAME:()=>_ge,ATTR_JVM_MEMORY_POOL_NAME:()=>gge,ATTR_JVM_MEMORY_TYPE:()=>Ege,ATTR_JVM_THREAD_DAEMON:()=>yge,ATTR_JVM_THREAD_STATE:()=>vge,ATTR_NETWORK_LOCAL_ADDRESS:()=>Cge,ATTR_NETWORK_LOCAL_PORT:()=>Nge,ATTR_NETWORK_PEER_ADDRESS:()=>Mge,ATTR_NETWORK_PEER_PORT:()=>Ige,ATTR_NETWORK_PROTOCOL_NAME:()=>xge,ATTR_NETWORK_PROTOCOL_VERSION:()=>wge,ATTR_NETWORK_TRANSPORT:()=>Lge,ATTR_NETWORK_TYPE:()=>Bge,ATTR_OTEL_SCOPE_NAME:()=>Gge,ATTR_OTEL_SCOPE_VERSION:()=>qge,ATTR_OTEL_STATUS_CODE:()=>jge,ATTR_OTEL_STATUS_DESCRIPTION:()=>zge,ATTR_SERVER_ADDRESS:()=>$ge,ATTR_SERVER_PORT:()=>Yge,ATTR_SERVICE_NAME:()=>WO,ATTR_SERVICE_VERSION:()=>KO,ATTR_SIGNALR_CONNECTION_STATUS:()=>Wge,ATTR_SIGNALR_TRANSPORT:()=>Qge,ATTR_TELEMETRY_SDK_LANGUAGE:()=>rEe,ATTR_TELEMETRY_SDK_NAME:()=>pEe,ATTR_TELEMETRY_SDK_VERSION:()=>fEe,ATTR_URL_FRAGMENT:()=>hEe,ATTR_URL_FULL:()=>mEe,ATTR_URL_PATH:()=>_Ee,ATTR_URL_QUERY:()=>gEe,ATTR_URL_SCHEME:()=>EEe,ATTR_USER_AGENT_ORIGINAL:()=>SEe,AWSECSLAUNCHTYPEVALUES_EC2:()=>Rme,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Pme,AwsEcsLaunchtypeValues:()=>Cme,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>cme,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>ume,CLOUDPLATFORMVALUES_AWS_EC2:()=>lme,CLOUDPLATFORMVALUES_AWS_ECS:()=>dme,CLOUDPLATFORMVALUES_AWS_EKS:()=>pme,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>hme,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>fme,CLOUDPLATFORMVALUES_AZURE_AKS:()=>gme,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Sme,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>_me,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Eme,CLOUDPLATFORMVALUES_AZURE_VM:()=>mme,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Ome,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Ame,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>yme,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Tme,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>vme,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>nme,CLOUDPROVIDERVALUES_AWS:()=>ime,CLOUDPROVIDERVALUES_AZURE:()=>ome,CLOUDPROVIDERVALUES_GCP:()=>sme,CloudPlatformValues:()=>bme,CloudProviderValues:()=>ame,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Gde,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Kde,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>qde,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Wde,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Hde,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Jde,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>zde,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>jde,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Xde,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Yde,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>$de,DBSYSTEMVALUES_ADABAS:()=>lde,DBSYSTEMVALUES_CACHE:()=>ude,DBSYSTEMVALUES_CASSANDRA:()=>Pde,DBSYSTEMVALUES_CLOUDSCAPE:()=>tde,DBSYSTEMVALUES_COCKROACHDB:()=>Fde,DBSYSTEMVALUES_COLDFUSION:()=>Rde,DBSYSTEMVALUES_COSMOSDB:()=>wde,DBSYSTEMVALUES_COUCHBASE:()=>Ide,DBSYSTEMVALUES_COUCHDB:()=>xde,DBSYSTEMVALUES_DB2:()=>Jle,DBSYSTEMVALUES_DERBY:()=>pde,DBSYSTEMVALUES_DYNAMODB:()=>Lde,DBSYSTEMVALUES_EDB:()=>cde,DBSYSTEMVALUES_ELASTICSEARCH:()=>kde,DBSYSTEMVALUES_FILEMAKER:()=>fde,DBSYSTEMVALUES_FIREBIRD:()=>dde,DBSYSTEMVALUES_FIRSTSQL:()=>ade,DBSYSTEMVALUES_GEODE:()=>Ude,DBSYSTEMVALUES_H2:()=>bde,DBSYSTEMVALUES_HANADB:()=>ode,DBSYSTEMVALUES_HBASE:()=>Cde,DBSYSTEMVALUES_HIVE:()=>ede,DBSYSTEMVALUES_HSQLDB:()=>rde,DBSYSTEMVALUES_INFORMIX:()=>hde,DBSYSTEMVALUES_INGRES:()=>sde,DBSYSTEMVALUES_INSTANTDB:()=>mde,DBSYSTEMVALUES_INTERBASE:()=>_de,DBSYSTEMVALUES_MARIADB:()=>gde,DBSYSTEMVALUES_MAXDB:()=>ide,DBSYSTEMVALUES_MEMCACHED:()=>Bde,DBSYSTEMVALUES_MONGODB:()=>Nde,DBSYSTEMVALUES_MSSQL:()=>Wle,DBSYSTEMVALUES_MYSQL:()=>Kle,DBSYSTEMVALUES_NEO4J:()=>Dde,DBSYSTEMVALUES_NETEZZA:()=>Ede,DBSYSTEMVALUES_ORACLE:()=>Xle,DBSYSTEMVALUES_OTHER_SQL:()=>Yle,DBSYSTEMVALUES_PERVASIVE:()=>Sde,DBSYSTEMVALUES_POINTBASE:()=>Tde,DBSYSTEMVALUES_POSTGRESQL:()=>Qle,DBSYSTEMVALUES_PROGRESS:()=>nde,DBSYSTEMVALUES_REDIS:()=>Mde,DBSYSTEMVALUES_REDSHIFT:()=>Zle,DBSYSTEMVALUES_SQLITE:()=>yde,DBSYSTEMVALUES_SYBASE:()=>vde,DBSYSTEMVALUES_TERADATA:()=>Ade,DBSYSTEMVALUES_VERTICA:()=>Ode,DB_SYSTEM_NAME_VALUE_MARIADB:()=>V_e,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>G_e,DB_SYSTEM_NAME_VALUE_MYSQL:()=>q_e,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>j_e,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>z_e,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>$_e,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Y_e,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>ZXe,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>e5e,DbCassandraConsistencyLevelValues:()=>Qde,DbSystemValues:()=>Vde,ERROR_TYPE_VALUE_OTHER:()=>K_e,EVENT_EXCEPTION:()=>gSe,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>ape,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>spe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>ope,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>upe,FAASINVOKEDPROVIDERVALUES_AWS:()=>lpe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>dpe,FAASINVOKEDPROVIDERVALUES_GCP:()=>ppe,FAASTRIGGERVALUES_DATASOURCE:()=>Zde,FAASTRIGGERVALUES_HTTP:()=>epe,FAASTRIGGERVALUES_OTHER:()=>npe,FAASTRIGGERVALUES_PUBSUB:()=>tpe,FAASTRIGGERVALUES_TIMER:()=>rpe,FaasDocumentOperationValues:()=>cpe,FaasInvokedProviderValues:()=>fpe,FaasTriggerValues:()=>ipe,HOSTARCHVALUES_AMD64:()=>Nme,HOSTARCHVALUES_ARM32:()=>Mme,HOSTARCHVALUES_ARM64:()=>Ime,HOSTARCHVALUES_IA64:()=>xme,HOSTARCHVALUES_PPC32:()=>wme,HOSTARCHVALUES_PPC64:()=>Lme,HOSTARCHVALUES_X86:()=>Dme,HTTPFLAVORVALUES_HTTP_1_0:()=>Xpe,HTTPFLAVORVALUES_HTTP_1_1:()=>Jpe,HTTPFLAVORVALUES_HTTP_2_0:()=>Qpe,HTTPFLAVORVALUES_QUIC:()=>efe,HTTPFLAVORVALUES_SPDY:()=>Zpe,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>nge,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>ige,HTTP_REQUEST_METHOD_VALUE_GET:()=>t5e,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>oge,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>sge,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>rge,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>age,HTTP_REQUEST_METHOD_VALUE_POST:()=>cge,HTTP_REQUEST_METHOD_VALUE_PUT:()=>r5e,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>uge,HostArchValues:()=>Ume,HttpFlavorValues:()=>tfe,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Sge,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Tge,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Age,JVM_THREAD_STATE_VALUE_NEW:()=>n5e,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Oge,JVM_THREAD_STATE_VALUE_TERMINATED:()=>bge,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>Rge,JVM_THREAD_STATE_VALUE_WAITING:()=>Pge,MESSAGETYPEVALUES_RECEIVED:()=>Pfe,MESSAGETYPEVALUES_SENT:()=>Rfe,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>rfe,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>nfe,MESSAGINGOPERATIONVALUES_PROCESS:()=>sfe,MESSAGINGOPERATIONVALUES_RECEIVE:()=>ofe,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>TEe,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>yEe,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>vEe,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>bEe,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>OEe,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>AEe,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>REe,METRIC_DB_CLIENT_OPERATION_DURATION:()=>PEe,METRIC_DOTNET_ASSEMBLY_COUNT:()=>CEe,METRIC_DOTNET_EXCEPTIONS:()=>NEe,METRIC_DOTNET_GC_COLLECTIONS:()=>MEe,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>IEe,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>xEe,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>wEe,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>LEe,METRIC_DOTNET_GC_PAUSE_TIME:()=>DEe,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>UEe,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>kEe,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>BEe,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>FEe,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>VEe,METRIC_DOTNET_PROCESS_CPU_TIME:()=>GEe,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>qEe,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>jEe,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>HEe,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>zEe,METRIC_DOTNET_TIMER_COUNT:()=>$Ee,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>YEe,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>WEe,METRIC_JVM_CLASS_COUNT:()=>KEe,METRIC_JVM_CLASS_LOADED:()=>XEe,METRIC_JVM_CLASS_UNLOADED:()=>JEe,METRIC_JVM_CPU_COUNT:()=>QEe,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>ZEe,METRIC_JVM_CPU_TIME:()=>eSe,METRIC_JVM_GC_DURATION:()=>tSe,METRIC_JVM_MEMORY_COMMITTED:()=>rSe,METRIC_JVM_MEMORY_LIMIT:()=>nSe,METRIC_JVM_MEMORY_USED:()=>iSe,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>oSe,METRIC_JVM_THREAD_COUNT:()=>sSe,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>aSe,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>cSe,METRIC_KESTREL_CONNECTION_DURATION:()=>uSe,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>lSe,METRIC_KESTREL_QUEUED_REQUESTS:()=>dSe,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>pSe,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>fSe,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>hSe,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>mSe,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>_Se,MessageTypeValues:()=>Cfe,MessagingDestinationKindValues:()=>ife,MessagingOperationValues:()=>afe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Ipe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Lpe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Npe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Gpe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>xpe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>wpe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Fpe,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Cpe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>jpe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Dpe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>kpe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>qpe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Upe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Bpe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>zpe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Vpe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Wpe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>$pe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Ype,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Hpe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Mpe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Ope,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>bpe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Rpe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>vpe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Ape,NETTRANSPORTVALUES_INPROC:()=>Spe,NETTRANSPORTVALUES_IP:()=>_pe,NETTRANSPORTVALUES_IP_TCP:()=>hpe,NETTRANSPORTVALUES_IP_UDP:()=>mpe,NETTRANSPORTVALUES_OTHER:()=>Tpe,NETTRANSPORTVALUES_PIPE:()=>Epe,NETTRANSPORTVALUES_UNIX:()=>gpe,NETWORK_TRANSPORT_VALUE_PIPE:()=>Dge,NETWORK_TRANSPORT_VALUE_QUIC:()=>Uge,NETWORK_TRANSPORT_VALUE_TCP:()=>i5e,NETWORK_TRANSPORT_VALUE_UDP:()=>o5e,NETWORK_TRANSPORT_VALUE_UNIX:()=>kge,NETWORK_TYPE_VALUE_IPV4:()=>Fge,NETWORK_TYPE_VALUE_IPV6:()=>Vge,NetHostConnectionSubtypeValues:()=>Kpe,NetHostConnectionTypeValues:()=>Ppe,NetTransportValues:()=>ype,OSTYPEVALUES_AIX:()=>zme,OSTYPEVALUES_DARWIN:()=>Fme,OSTYPEVALUES_DRAGONFLYBSD:()=>jme,OSTYPEVALUES_FREEBSD:()=>Vme,OSTYPEVALUES_HPUX:()=>Hme,OSTYPEVALUES_LINUX:()=>Bme,OSTYPEVALUES_NETBSD:()=>Gme,OSTYPEVALUES_OPENBSD:()=>qme,OSTYPEVALUES_SOLARIS:()=>$me,OSTYPEVALUES_WINDOWS:()=>kme,OSTYPEVALUES_Z_OS:()=>Yme,OTEL_STATUS_CODE_VALUE_ERROR:()=>Hge,OTEL_STATUS_CODE_VALUE_OK:()=>s5e,OsTypeValues:()=>Wme,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Efe,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>hfe,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>ufe,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Afe,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>pfe,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>gfe,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>yfe,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>dfe,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>ffe,RPCGRPCSTATUSCODEVALUES_OK:()=>cfe,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Sfe,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>mfe,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>_fe,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Ofe,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>vfe,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Tfe,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>lfe,RpcGrpcStatusCodeValues:()=>bfe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>tle,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>fle,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>Que,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Wue,SEMATTRS_AWS_DYNAMODB_COUNT:()=>dle,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>sle,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>ile,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>hle,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>rle,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Kue,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>ele,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>ole,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Zue,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Xue,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Jue,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>ple,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>cle,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>ule,SEMATTRS_AWS_DYNAMODB_SELECT:()=>nle,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>ale,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Yue,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>lle,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Rce,SEMATTRS_CODE_FILEPATH:()=>Mue,SEMATTRS_CODE_FUNCTION:()=>Cue,SEMATTRS_CODE_LINENO:()=>Iue,SEMATTRS_CODE_NAMESPACE:()=>Nue,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>kce,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>qce,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Gce,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Fce,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Dce,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Uce,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Vce,SEMATTRS_DB_CASSANDRA_TABLE:()=>Bce,SEMATTRS_DB_CONNECTION_STRING:()=>Cce,SEMATTRS_DB_HBASE_NAMESPACE:()=>jce,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Mce,SEMATTRS_DB_MONGODB_COLLECTION:()=>zce,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Lce,SEMATTRS_DB_NAME:()=>Ice,SEMATTRS_DB_OPERATION:()=>wce,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Hce,SEMATTRS_DB_SQL_TABLE:()=>$ce,SEMATTRS_DB_STATEMENT:()=>xce,SEMATTRS_DB_SYSTEM:()=>Pce,SEMATTRS_DB_USER:()=>Nce,SEMATTRS_ENDUSER_ID:()=>Aue,SEMATTRS_ENDUSER_ROLE:()=>Oue,SEMATTRS_ENDUSER_SCOPE:()=>bue,SEMATTRS_EXCEPTION_ESCAPED:()=>Xce,SEMATTRS_EXCEPTION_MESSAGE:()=>Wce,SEMATTRS_EXCEPTION_STACKTRACE:()=>Kce,SEMATTRS_EXCEPTION_TYPE:()=>Yce,SEMATTRS_FAAS_COLDSTART:()=>oue,SEMATTRS_FAAS_CRON:()=>iue,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Zce,SEMATTRS_FAAS_DOCUMENT_NAME:()=>rue,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>eue,SEMATTRS_FAAS_DOCUMENT_TIME:()=>tue,SEMATTRS_FAAS_EXECUTION:()=>Qce,SEMATTRS_FAAS_INVOKED_NAME:()=>sue,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>aue,SEMATTRS_FAAS_INVOKED_REGION:()=>cue,SEMATTRS_FAAS_TIME:()=>nue,SEMATTRS_FAAS_TRIGGER:()=>Jce,SEMATTRS_HTTP_CLIENT_IP:()=>$ue,SEMATTRS_HTTP_FLAVOR:()=>Bue,SEMATTRS_HTTP_HOST:()=>Due,SEMATTRS_HTTP_METHOD:()=>xue,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Vue,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Gue,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>que,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>jue,SEMATTRS_HTTP_ROUTE:()=>zue,SEMATTRS_HTTP_SCHEME:()=>Uue,SEMATTRS_HTTP_SERVER_NAME:()=>Hue,SEMATTRS_HTTP_STATUS_CODE:()=>kue,SEMATTRS_HTTP_TARGET:()=>Lue,SEMATTRS_HTTP_URL:()=>wue,SEMATTRS_HTTP_USER_AGENT:()=>Fue,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Hle,SEMATTRS_MESSAGE_ID:()=>jle,SEMATTRS_MESSAGE_TYPE:()=>qle,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>zle,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Ple,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Ale,SEMATTRS_MESSAGING_DESTINATION:()=>_le,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>gle,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Ile,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Mle,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Nle,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>xle,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>wle,SEMATTRS_MESSAGING_MESSAGE_ID:()=>vle,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>ble,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Ole,SEMATTRS_MESSAGING_OPERATION:()=>Rle,SEMATTRS_MESSAGING_PROTOCOL:()=>Sle,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Tle,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Cle,SEMATTRS_MESSAGING_SYSTEM:()=>mle,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Ele,SEMATTRS_MESSAGING_URL:()=>yle,SEMATTRS_NET_HOST_CARRIER_ICC:()=>yue,SEMATTRS_NET_HOST_CARRIER_MCC:()=>Sue,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Tue,SEMATTRS_NET_HOST_CARRIER_NAME:()=>Eue,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>gue,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>_ue,SEMATTRS_NET_HOST_IP:()=>fue,SEMATTRS_NET_HOST_NAME:()=>mue,SEMATTRS_NET_HOST_PORT:()=>hue,SEMATTRS_NET_PEER_IP:()=>lue,SEMATTRS_NET_PEER_NAME:()=>pue,SEMATTRS_NET_PEER_PORT:()=>due,SEMATTRS_NET_TRANSPORT:()=>uue,SEMATTRS_PEER_SERVICE:()=>vue,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>kle,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Vle,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Gle,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Fle,SEMATTRS_RPC_JSONRPC_VERSION:()=>Ble,SEMATTRS_RPC_METHOD:()=>Ule,SEMATTRS_RPC_SERVICE:()=>Dle,SEMATTRS_RPC_SYSTEM:()=>Lle,SEMATTRS_THREAD_ID:()=>Rue,SEMATTRS_THREAD_NAME:()=>Pue,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Dfe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Lfe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Ufe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>kfe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Bfe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Ffe,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Vfe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>qfe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Gfe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Hfe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>jfe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Mfe,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>xfe,SEMRESATTRS_CLOUD_PLATFORM:()=>wfe,SEMRESATTRS_CLOUD_PROVIDER:()=>Nfe,SEMRESATTRS_CLOUD_REGION:()=>Ife,SEMRESATTRS_CONTAINER_ID:()=>$fe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Wfe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Kfe,SEMRESATTRS_CONTAINER_NAME:()=>zfe,SEMRESATTRS_CONTAINER_RUNTIME:()=>Yfe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Xfe,SEMRESATTRS_DEVICE_ID:()=>Jfe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Qfe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Zfe,SEMRESATTRS_FAAS_ID:()=>the,SEMRESATTRS_FAAS_INSTANCE:()=>nhe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>ihe,SEMRESATTRS_FAAS_NAME:()=>ehe,SEMRESATTRS_FAAS_VERSION:()=>rhe,SEMRESATTRS_HOST_ARCH:()=>che,SEMRESATTRS_HOST_ID:()=>ohe,SEMRESATTRS_HOST_IMAGE_ID:()=>lhe,SEMRESATTRS_HOST_IMAGE_NAME:()=>uhe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>dhe,SEMRESATTRS_HOST_NAME:()=>she,SEMRESATTRS_HOST_TYPE:()=>ahe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>phe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Ehe,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Mhe,SEMRESATTRS_K8S_CRONJOB_UID:()=>Nhe,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Rhe,SEMRESATTRS_K8S_DAEMONSET_UID:()=>bhe,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>vhe,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>yhe,SEMRESATTRS_K8S_JOB_NAME:()=>Che,SEMRESATTRS_K8S_JOB_UID:()=>Phe,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>mhe,SEMRESATTRS_K8S_NODE_NAME:()=>fhe,SEMRESATTRS_K8S_NODE_UID:()=>hhe,SEMRESATTRS_K8S_POD_NAME:()=>ghe,SEMRESATTRS_K8S_POD_UID:()=>_he,SEMRESATTRS_K8S_REPLICASET_NAME:()=>The,SEMRESATTRS_K8S_REPLICASET_UID:()=>She,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Ohe,SEMRESATTRS_K8S_STATEFULSET_UID:()=>Ahe,SEMRESATTRS_OS_DESCRIPTION:()=>xhe,SEMRESATTRS_OS_NAME:()=>whe,SEMRESATTRS_OS_TYPE:()=>Ihe,SEMRESATTRS_OS_VERSION:()=>Lhe,SEMRESATTRS_PROCESS_COMMAND:()=>Bhe,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Vhe,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Fhe,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Uhe,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>khe,SEMRESATTRS_PROCESS_OWNER:()=>Ghe,SEMRESATTRS_PROCESS_PID:()=>Dhe,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Hhe,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>qhe,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>jhe,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Yhe,SEMRESATTRS_SERVICE_NAME:()=>zhe,SEMRESATTRS_SERVICE_NAMESPACE:()=>$he,SEMRESATTRS_SERVICE_VERSION:()=>Whe,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Qhe,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Xhe,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Khe,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Jhe,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>tme,SEMRESATTRS_WEBENGINE_NAME:()=>Zhe,SEMRESATTRS_WEBENGINE_VERSION:()=>eme,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Kge,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Xge,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Jge,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Zge,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>eEe,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>tEe,SemanticAttributes:()=>$le,SemanticResourceAttributes:()=>rme,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Kme,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Xme,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Jme,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Qme,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Zme,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>e_e,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>t_e,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>r_e,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>n_e,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>i_e,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>a5e,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>nEe,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>iEe,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>c5e,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>oEe,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>sEe,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>u5e,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>aEe,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>cEe,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>uEe,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>lEe,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>dEe,TelemetrySdkLanguageValues:()=>o_e});var yt=U(()=>{Yj();Sz();Tz();yz();vz()});var Az=p(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.ATTR_PROCESS_RUNTIME_NAME=void 0;Bf.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var Oz=p(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.SDK_INFO=void 0;var ESe=rV(),Ff=(yt(),y(Dt)),SSe=Az();Vf.SDK_INFO={[Ff.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[SSe.ATTR_PROCESS_RUNTIME_NAME]:"node",[Ff.ATTR_TELEMETRY_SDK_LANGUAGE]:Ff.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[Ff.ATTR_TELEMETRY_SDK_VERSION]:ESe.VERSION}});var bz=p(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.unrefTimer=void 0;function TSe(t){t.unref()}Gf.unrefTimer=TSe});var Rz=p(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.unrefTimer=Qe.SDK_INFO=Qe.otperformance=Qe._globalThis=Qe.getStringListFromEnv=Qe.getNumberFromEnv=Qe.getBooleanFromEnv=Qe.getStringFromEnv=void 0;var qf=ZF();Object.defineProperty(Qe,"getStringFromEnv",{enumerable:!0,get:function(){return qf.getStringFromEnv}});Object.defineProperty(Qe,"getBooleanFromEnv",{enumerable:!0,get:function(){return qf.getBooleanFromEnv}});Object.defineProperty(Qe,"getNumberFromEnv",{enumerable:!0,get:function(){return qf.getNumberFromEnv}});Object.defineProperty(Qe,"getStringListFromEnv",{enumerable:!0,get:function(){return qf.getStringListFromEnv}});var ySe=eV();Object.defineProperty(Qe,"_globalThis",{enumerable:!0,get:function(){return ySe._globalThis}});var vSe=tV();Object.defineProperty(Qe,"otperformance",{enumerable:!0,get:function(){return vSe.otperformance}});var ASe=Oz();Object.defineProperty(Qe,"SDK_INFO",{enumerable:!0,get:function(){return ASe.SDK_INFO}});var OSe=bz();Object.defineProperty(Qe,"unrefTimer",{enumerable:!0,get:function(){return OSe.unrefTimer}})});var XO=p(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.getStringListFromEnv=Ze.getNumberFromEnv=Ze.getStringFromEnv=Ze.getBooleanFromEnv=Ze.unrefTimer=Ze.otperformance=Ze._globalThis=Ze.SDK_INFO=void 0;var $i=Rz();Object.defineProperty(Ze,"SDK_INFO",{enumerable:!0,get:function(){return $i.SDK_INFO}});Object.defineProperty(Ze,"_globalThis",{enumerable:!0,get:function(){return $i._globalThis}});Object.defineProperty(Ze,"otperformance",{enumerable:!0,get:function(){return $i.otperformance}});Object.defineProperty(Ze,"unrefTimer",{enumerable:!0,get:function(){return $i.unrefTimer}});Object.defineProperty(Ze,"getBooleanFromEnv",{enumerable:!0,get:function(){return $i.getBooleanFromEnv}});Object.defineProperty(Ze,"getStringFromEnv",{enumerable:!0,get:function(){return $i.getStringFromEnv}});Object.defineProperty(Ze,"getNumberFromEnv",{enumerable:!0,get:function(){return $i.getNumberFromEnv}});Object.defineProperty(Ze,"getStringListFromEnv",{enumerable:!0,get:function(){return $i.getStringListFromEnv}})});var Mz=p(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.addHrTimes=Te.isTimeInput=Te.isTimeInputHrTime=Te.hrTimeToMicroseconds=Te.hrTimeToMilliseconds=Te.hrTimeToNanoseconds=Te.hrTimeToTimeStamp=Te.hrTimeDuration=Te.timeInputToHrTime=Te.hrTime=Te.getTimeOrigin=Te.millisToHrTime=void 0;var JO=XO(),Pz=9,bSe=6,RSe=Math.pow(10,bSe),jf=Math.pow(10,Pz);function Vu(t){let e=t/1e3,r=Math.trunc(e),o=Math.round(t%1e3*RSe);return[r,o]}Te.millisToHrTime=Vu;function QO(){let t=JO.otperformance.timeOrigin;if(typeof t!="number"){let e=JO.otperformance;t=e.timing&&e.timing.fetchStart}return t}Te.getTimeOrigin=QO;function Cz(t){let e=Vu(QO()),r=Vu(typeof t=="number"?t:JO.otperformance.now());return Nz(e,r)}Te.hrTime=Cz;function PSe(t){if(ZO(t))return t;if(typeof t=="number")return t<QO()?Cz(t):Vu(t);if(t instanceof Date)return Vu(t.getTime());throw TypeError("Invalid input type")}Te.timeInputToHrTime=PSe;function CSe(t,e){let r=e[0]-t[0],o=e[1]-t[1];return o<0&&(r-=1,o+=jf),[r,o]}Te.hrTimeDuration=CSe;function NSe(t){let e=Pz,r=`${"0".repeat(e)}${t[1]}Z`,o=r.substring(r.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",o)}Te.hrTimeToTimeStamp=NSe;function MSe(t){return t[0]*jf+t[1]}Te.hrTimeToNanoseconds=MSe;function ISe(t){return t[0]*1e3+t[1]/1e6}Te.hrTimeToMilliseconds=ISe;function xSe(t){return t[0]*1e6+t[1]/1e3}Te.hrTimeToMicroseconds=xSe;function ZO(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}Te.isTimeInputHrTime=ZO;function wSe(t){return ZO(t)||typeof t=="number"||t instanceof Date}Te.isTimeInput=wSe;function Nz(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=jf&&(r[1]-=jf,r[0]+=1),r}Te.addHrTimes=Nz});var Iz=p(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.ExportResultCode=void 0;var LSe;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(LSe=Gu.ExportResultCode||(Gu.ExportResultCode={}))});var wz=p(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.CompositePropagator=void 0;var xz=(b(),y(P)),eb=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,o)=>r.concat(o),[])))}inject(e,r,o){for(let s of this._propagators)try{s.inject(e,r,o)}catch(a){xz.diag.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,r,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,r,o)}catch(i){xz.diag.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}};Hf.CompositePropagator=eb});var Lz=p(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.validateValue=ma.validateKey=void 0;var tb="[_0-9a-z-*/]",DSe=`[a-z]${tb}{0,255}`,USe=`[a-z0-9]${tb}{0,240}@[a-z]${tb}{0,13}`,kSe=new RegExp(`^(?:${DSe}|${USe})$`),BSe=/^[ -~]{0,255}[!-~]$/,FSe=/,|=/;function VSe(t){return kSe.test(t)}ma.validateKey=VSe;function GSe(t){return BSe.test(t)&&!FSe.test(t)}ma.validateValue=GSe});var nb=p(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.TraceState=void 0;var Dz=Lz(),Uz=32,qSe=512,kz=",",Bz="=",rb=class t{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,r),o}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+Bz+this.get(r)),e),[]).join(kz)}_parse(e){e.length>qSe||(this._internalState=e.split(kz).reverse().reduce((r,o)=>{let s=o.trim(),a=s.indexOf(Bz);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);(0,Dz.validateKey)(i)&&(0,Dz.validateValue)(n)&&r.set(i,n)}return r},new Map),this._internalState.size>Uz&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Uz))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};zf.TraceState=rb});var Vz=p(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.W3CTraceContextPropagator=vt.parseTraceParent=vt.TRACE_STATE_HEADER=vt.TRACE_PARENT_HEADER=void 0;var $f=(b(),y(P)),jSe=Fu(),HSe=nb();vt.TRACE_PARENT_HEADER="traceparent";vt.TRACE_STATE_HEADER="tracestate";var zSe="00",$Se="(?!ff)[\\da-f]{2}",YSe="(?![0]{32})[\\da-f]{32}",WSe="(?![0]{16})[\\da-f]{16}",KSe="[\\da-f]{2}",XSe=new RegExp(`^\\s?(${$Se})-(${YSe})-(${WSe})-(${KSe})(-.*)?\\s?$`);function Fz(t){let e=XSe.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}vt.parseTraceParent=Fz;var ib=class{inject(e,r,o){let s=$f.trace.getSpanContext(e);if(!s||(0,jSe.isTracingSuppressed)(e)||!(0,$f.isSpanContextValid)(s))return;let a=`${zSe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||$f.TraceFlags.NONE).toString(16)}`;o.set(r,vt.TRACE_PARENT_HEADER,a),s.traceState&&o.set(r,vt.TRACE_STATE_HEADER,s.traceState.serialize())}extract(e,r,o){let s=o.get(r,vt.TRACE_PARENT_HEADER);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=Fz(a);if(!i)return e;i.isRemote=!0;let n=o.get(r,vt.TRACE_STATE_HEADER);if(n){let c=Array.isArray(n)?n.join(","):n;i.traceState=new HSe.TraceState(typeof c=="string"?c:void 0)}return $f.trace.setSpanContext(e,i)}fields(){return[vt.TRACE_PARENT_HEADER,vt.TRACE_STATE_HEADER]}};vt.W3CTraceContextPropagator=ib});var Gz=p(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.getRPCMetadata=Vr.deleteRPCMetadata=Vr.setRPCMetadata=Vr.RPCType=void 0;var JSe=(b(),y(P)),ob=(0,JSe.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),QSe;(function(t){t.HTTP="http"})(QSe=Vr.RPCType||(Vr.RPCType={}));function ZSe(t,e){return t.setValue(ob,e)}Vr.setRPCMetadata=ZSe;function eTe(t){return t.deleteValue(ob)}Vr.deleteRPCMetadata=eTe;function tTe(t){return t.getValue(ob)}Vr.getRPCMetadata=tTe});var $z=p(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.isPlainObject=void 0;var rTe="[object Object]",nTe="[object Null]",iTe="[object Undefined]",oTe=Function.prototype,qz=oTe.toString,sTe=qz.call(Object),aTe=Object.getPrototypeOf,jz=Object.prototype,Hz=jz.hasOwnProperty,Vo=Symbol?Symbol.toStringTag:void 0,zz=jz.toString;function cTe(t){if(!uTe(t)||lTe(t)!==rTe)return!1;let e=aTe(t);if(e===null)return!0;let r=Hz.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&qz.call(r)===sTe}Yf.isPlainObject=cTe;function uTe(t){return t!=null&&typeof t=="object"}function lTe(t){return t==null?t===void 0?iTe:nTe:Vo&&Vo in Object(t)?dTe(t):pTe(t)}function dTe(t){let e=Hz.call(t,Vo),r=t[Vo],o=!1;try{t[Vo]=void 0,o=!0}catch{}let s=zz.call(t);return o&&(e?t[Vo]=r:delete t[Vo]),s}function pTe(t){return zz.call(t)}});var Jz=p(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.merge=void 0;var Yz=$z(),fTe=20;function hTe(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Kz(e,t.shift(),0,r);return e}Xf.merge=hTe;function sb(t){return Kf(t)?t.slice():t}function Kz(t,e,r=0,o){let s;if(!(r>fTe)){if(r++,Wf(t)||Wf(e)||Xz(e))s=sb(e);else if(Kf(t)){if(s=t.slice(),Kf(e))for(let a=0,i=e.length;a<i;a++)s.push(sb(e[a]));else if(qu(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let c=a[i];s[c]=sb(e[c])}}}else if(qu(t))if(qu(e)){if(!mTe(t,e))return e;s=Object.assign({},t);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let c=a[i],u=e[c];if(Wf(u))typeof u>"u"?delete s[c]:s[c]=u;else{let l=s[c],d=u;if(Wz(t,c,o)||Wz(e,c,o))delete s[c];else{if(qu(l)&&qu(d)){let h=o.get(l)||[],g=o.get(d)||[];h.push({obj:t,key:c}),g.push({obj:e,key:c}),o.set(l,h),o.set(d,g)}s[c]=Kz(s[c],u,r,o)}}}}else s=e;return s}}function Wz(t,e,r){let o=r.get(t[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===t)return!0}return!1}function Kf(t){return Array.isArray(t)}function Xz(t){return typeof t=="function"}function qu(t){return!Wf(t)&&!Kf(t)&&!Xz(t)&&typeof t=="object"}function Wf(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function mTe(t,e){return!(!(0,Yz.isPlainObject)(t)||!(0,Yz.isPlainObject)(e))}});var Qz=p(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.callWithTimeout=_a.TimeoutError=void 0;var Jf=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};_a.TimeoutError=Jf;function _Te(t,e){let r,o=new Promise(function(a,i){r=setTimeout(function(){i(new Jf("Operation timed out."))},e)});return Promise.race([t,o]).then(s=>(clearTimeout(r),s),s=>{throw clearTimeout(r),s})}_a.callWithTimeout=_Te});var e$=p(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.isUrlIgnored=ga.urlMatches=void 0;function Zz(t,e){return typeof e=="string"?t===e:!!t.match(e)}ga.urlMatches=Zz;function gTe(t,e){if(!e)return!1;for(let r of e)if(Zz(t,r))return!0;return!1}ga.isUrlIgnored=gTe});var t$=p(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.Deferred=void 0;var ab=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)}};Qf.Deferred=ab});var r$=p(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.BindOnceFuture=void 0;var ETe=t$(),cb=class{_callback;_that;_isCalled=!1;_deferred=new ETe.Deferred;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}};Zf.BindOnceFuture=cb});var i$=p(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.diagLogLevelFromString=void 0;var mi=(b(),y(P)),n$={ALL:mi.DiagLogLevel.ALL,VERBOSE:mi.DiagLogLevel.VERBOSE,DEBUG:mi.DiagLogLevel.DEBUG,INFO:mi.DiagLogLevel.INFO,WARN:mi.DiagLogLevel.WARN,ERROR:mi.DiagLogLevel.ERROR,NONE:mi.DiagLogLevel.NONE};function STe(t){if(t==null)return;let e=n$[t.toUpperCase()];return e??(mi.diag.warn(`Unknown log level "${t}", expected one of ${Object.keys(n$)}, using default`),mi.DiagLogLevel.INFO)}eh.diagLogLevelFromString=STe});var s$=p(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th._export=void 0;var o$=(b(),y(P)),TTe=Fu();function yTe(t,e){return new Promise(r=>{o$.context.with((0,TTe.suppressTracing)(o$.context.active()),()=>{t.export(e,o=>{r(o)})})})}th._export=yTe});var W=p(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.internal=x.diagLogLevelFromString=x.BindOnceFuture=x.urlMatches=x.isUrlIgnored=x.callWithTimeout=x.TimeoutError=x.merge=x.TraceState=x.unsuppressTracing=x.suppressTracing=x.isTracingSuppressed=x.setRPCMetadata=x.getRPCMetadata=x.deleteRPCMetadata=x.RPCType=x.parseTraceParent=x.W3CTraceContextPropagator=x.TRACE_STATE_HEADER=x.TRACE_PARENT_HEADER=x.CompositePropagator=x.unrefTimer=x.otperformance=x.getStringListFromEnv=x.getNumberFromEnv=x.getBooleanFromEnv=x.getStringFromEnv=x._globalThis=x.SDK_INFO=x.parseKeyPairsIntoRecord=x.ExportResultCode=x.timeInputToHrTime=x.millisToHrTime=x.isTimeInputHrTime=x.isTimeInput=x.hrTimeToTimeStamp=x.hrTimeToNanoseconds=x.hrTimeToMilliseconds=x.hrTimeToMicroseconds=x.hrTimeDuration=x.hrTime=x.getTimeOrigin=x.addHrTimes=x.loggingErrorHandler=x.setGlobalErrorHandler=x.globalErrorHandler=x.sanitizeAttributes=x.isAttributeValue=x.AnchoredClock=x.W3CBaggagePropagator=void 0;var vTe=GF();Object.defineProperty(x,"W3CBaggagePropagator",{enumerable:!0,get:function(){return vTe.W3CBaggagePropagator}});var ATe=qF();Object.defineProperty(x,"AnchoredClock",{enumerable:!0,get:function(){return ATe.AnchoredClock}});var a$=YF();Object.defineProperty(x,"isAttributeValue",{enumerable:!0,get:function(){return a$.isAttributeValue}});Object.defineProperty(x,"sanitizeAttributes",{enumerable:!0,get:function(){return a$.sanitizeAttributes}});var c$=KF();Object.defineProperty(x,"globalErrorHandler",{enumerable:!0,get:function(){return c$.globalErrorHandler}});Object.defineProperty(x,"setGlobalErrorHandler",{enumerable:!0,get:function(){return c$.setGlobalErrorHandler}});var OTe=$O();Object.defineProperty(x,"loggingErrorHandler",{enumerable:!0,get:function(){return OTe.loggingErrorHandler}});var _r=Mz();Object.defineProperty(x,"addHrTimes",{enumerable:!0,get:function(){return _r.addHrTimes}});Object.defineProperty(x,"getTimeOrigin",{enumerable:!0,get:function(){return _r.getTimeOrigin}});Object.defineProperty(x,"hrTime",{enumerable:!0,get:function(){return _r.hrTime}});Object.defineProperty(x,"hrTimeDuration",{enumerable:!0,get:function(){return _r.hrTimeDuration}});Object.defineProperty(x,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return _r.hrTimeToMicroseconds}});Object.defineProperty(x,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return _r.hrTimeToMilliseconds}});Object.defineProperty(x,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return _r.hrTimeToNanoseconds}});Object.defineProperty(x,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return _r.hrTimeToTimeStamp}});Object.defineProperty(x,"isTimeInput",{enumerable:!0,get:function(){return _r.isTimeInput}});Object.defineProperty(x,"isTimeInputHrTime",{enumerable:!0,get:function(){return _r.isTimeInputHrTime}});Object.defineProperty(x,"millisToHrTime",{enumerable:!0,get:function(){return _r.millisToHrTime}});Object.defineProperty(x,"timeInputToHrTime",{enumerable:!0,get:function(){return _r.timeInputToHrTime}});var bTe=Iz();Object.defineProperty(x,"ExportResultCode",{enumerable:!0,get:function(){return bTe.ExportResultCode}});var RTe=GO();Object.defineProperty(x,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return RTe.parseKeyPairsIntoRecord}});var Yi=XO();Object.defineProperty(x,"SDK_INFO",{enumerable:!0,get:function(){return Yi.SDK_INFO}});Object.defineProperty(x,"_globalThis",{enumerable:!0,get:function(){return Yi._globalThis}});Object.defineProperty(x,"getStringFromEnv",{enumerable:!0,get:function(){return Yi.getStringFromEnv}});Object.defineProperty(x,"getBooleanFromEnv",{enumerable:!0,get:function(){return Yi.getBooleanFromEnv}});Object.defineProperty(x,"getNumberFromEnv",{enumerable:!0,get:function(){return Yi.getNumberFromEnv}});Object.defineProperty(x,"getStringListFromEnv",{enumerable:!0,get:function(){return Yi.getStringListFromEnv}});Object.defineProperty(x,"otperformance",{enumerable:!0,get:function(){return Yi.otperformance}});Object.defineProperty(x,"unrefTimer",{enumerable:!0,get:function(){return Yi.unrefTimer}});var PTe=wz();Object.defineProperty(x,"CompositePropagator",{enumerable:!0,get:function(){return PTe.CompositePropagator}});var rh=Vz();Object.defineProperty(x,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return rh.TRACE_PARENT_HEADER}});Object.defineProperty(x,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return rh.TRACE_STATE_HEADER}});Object.defineProperty(x,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return rh.W3CTraceContextPropagator}});Object.defineProperty(x,"parseTraceParent",{enumerable:!0,get:function(){return rh.parseTraceParent}});var nh=Gz();Object.defineProperty(x,"RPCType",{enumerable:!0,get:function(){return nh.RPCType}});Object.defineProperty(x,"deleteRPCMetadata",{enumerable:!0,get:function(){return nh.deleteRPCMetadata}});Object.defineProperty(x,"getRPCMetadata",{enumerable:!0,get:function(){return nh.getRPCMetadata}});Object.defineProperty(x,"setRPCMetadata",{enumerable:!0,get:function(){return nh.setRPCMetadata}});var ub=Fu();Object.defineProperty(x,"isTracingSuppressed",{enumerable:!0,get:function(){return ub.isTracingSuppressed}});Object.defineProperty(x,"suppressTracing",{enumerable:!0,get:function(){return ub.suppressTracing}});Object.defineProperty(x,"unsuppressTracing",{enumerable:!0,get:function(){return ub.unsuppressTracing}});var CTe=nb();Object.defineProperty(x,"TraceState",{enumerable:!0,get:function(){return CTe.TraceState}});var NTe=Jz();Object.defineProperty(x,"merge",{enumerable:!0,get:function(){return NTe.merge}});var u$=Qz();Object.defineProperty(x,"TimeoutError",{enumerable:!0,get:function(){return u$.TimeoutError}});Object.defineProperty(x,"callWithTimeout",{enumerable:!0,get:function(){return u$.callWithTimeout}});var l$=e$();Object.defineProperty(x,"isUrlIgnored",{enumerable:!0,get:function(){return l$.isUrlIgnored}});Object.defineProperty(x,"urlMatches",{enumerable:!0,get:function(){return l$.urlMatches}});var MTe=r$();Object.defineProperty(x,"BindOnceFuture",{enumerable:!0,get:function(){return MTe.BindOnceFuture}});var ITe=i$();Object.defineProperty(x,"diagLogLevelFromString",{enumerable:!0,get:function(){return ITe.diagLogLevelFromString}});var xTe=s$();x.internal={_export:xTe._export}});var d$=p(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.SeverityNumber=void 0;var wTe;(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"})(wTe=ju.SeverityNumber||(ju.SeverityNumber={}))});var oh=p(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.NOOP_LOGGER=Ea.NoopLogger=void 0;var ih=class{emit(e){}};Ea.NoopLogger=ih;Ea.NOOP_LOGGER=new ih});var ah=p(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.NOOP_LOGGER_PROVIDER=Sa.NoopLoggerProvider=void 0;var LTe=oh(),sh=class{getLogger(e,r,o){return new LTe.NoopLogger}};Sa.NoopLoggerProvider=sh;Sa.NOOP_LOGGER_PROVIDER=new sh});var db=p(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.ProxyLogger=void 0;var DTe=oh(),lb=class{constructor(e,r,o,s){this._provider=e,this.name=r,this.version=o,this.options=s}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):DTe.NOOP_LOGGER}};ch.ProxyLogger=lb});var fb=p(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.ProxyLoggerProvider=void 0;var UTe=ah(),kTe=db(),pb=class{getLogger(e,r,o){var s;return(s=this._getDelegateLogger(e,r,o))!==null&&s!==void 0?s:new kTe.ProxyLogger(this,e,r,o)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:UTe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,o){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(e,r,o)}};uh.ProxyLoggerProvider=pb});var p$=p(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh._globalThis=void 0;lh._globalThis=typeof globalThis=="object"?globalThis:global});var f$=p(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh._globalThis=void 0;var BTe=p$();Object.defineProperty(dh,"_globalThis",{enumerable:!0,get:function(){return BTe._globalThis}})});var h$=p(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph._globalThis=void 0;var FTe=f$();Object.defineProperty(ph,"_globalThis",{enumerable:!0,get:function(){return FTe._globalThis}})});var m$=p(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.API_BACKWARDS_COMPATIBILITY_VERSION=gn.makeGetter=gn._global=gn.GLOBAL_LOGS_API_KEY=void 0;var VTe=h$();gn.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");gn._global=VTe._globalThis;function GTe(t,e,r){return o=>o===t?e:r}gn.makeGetter=GTe;gn.API_BACKWARDS_COMPATIBILITY_VERSION=1});var g$=p(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.LogsAPI=void 0;var gr=m$(),qTe=ah(),_$=fb(),hb=class t{constructor(){this._proxyLoggerProvider=new _$.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return gr._global[gr.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(gr._global[gr.GLOBAL_LOGS_API_KEY]=(0,gr.makeGetter)(gr.API_BACKWARDS_COMPATIBILITY_VERSION,e,qTe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=gr._global[gr.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(gr._global,gr.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,o){return this.getLoggerProvider().getLogger(e,r,o)}disable(){delete gr._global[gr.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new _$.ProxyLoggerProvider}};fh.LogsAPI=hb});var Hu=p(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.logs=et.ProxyLoggerProvider=et.ProxyLogger=et.NoopLoggerProvider=et.NOOP_LOGGER_PROVIDER=et.NoopLogger=et.NOOP_LOGGER=et.SeverityNumber=void 0;var jTe=d$();Object.defineProperty(et,"SeverityNumber",{enumerable:!0,get:function(){return jTe.SeverityNumber}});var E$=oh();Object.defineProperty(et,"NOOP_LOGGER",{enumerable:!0,get:function(){return E$.NOOP_LOGGER}});Object.defineProperty(et,"NoopLogger",{enumerable:!0,get:function(){return E$.NoopLogger}});var S$=ah();Object.defineProperty(et,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return S$.NOOP_LOGGER_PROVIDER}});Object.defineProperty(et,"NoopLoggerProvider",{enumerable:!0,get:function(){return S$.NoopLoggerProvider}});var HTe=db();Object.defineProperty(et,"ProxyLogger",{enumerable:!0,get:function(){return HTe.ProxyLogger}});var zTe=fb();Object.defineProperty(et,"ProxyLoggerProvider",{enumerable:!0,get:function(){return zTe.ProxyLoggerProvider}});var $Te=g$();et.logs=$Te.LogsAPI.getInstance()});var T$=p(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.defaultServiceName=void 0;function YTe(){return`unknown_service:${process.argv0}`}hh.defaultServiceName=YTe});var y$=p(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.defaultServiceName=void 0;var WTe=T$();Object.defineProperty(mh,"defaultServiceName",{enumerable:!0,get:function(){return WTe.defaultServiceName}})});var mb=p(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.defaultServiceName=void 0;var KTe=y$();Object.defineProperty(_h,"defaultServiceName",{enumerable:!0,get:function(){return KTe.defaultServiceName}})});var v$=p(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.identity=Ta.isPromiseLike=void 0;var XTe=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";Ta.isPromiseLike=XTe;function JTe(t){return t}Ta.identity=JTe});var Eb=p(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.defaultResource=En.emptyResource=En.resourceFromDetectedResource=En.resourceFromAttributes=void 0;var $u=(b(),y(P)),_b=W(),Go=(yt(),y(Dt)),QTe=mb(),zu=v$(),gh=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let o=new t({},r);return o._rawAttributes=A$(e),o._asyncAttributesPending=e.filter(([s,a])=>(0,zu.isPromiseLike)(a)).length>0,o}constructor(e,r){let o=e.attributes??{};this._rawAttributes=Object.entries(o).map(([s,a])=>((0,zu.isPromiseLike)(a)&&(this._asyncAttributesPending=!0),[s,a])),this._rawAttributes=A$(this._rawAttributes),this._schemaUrl=rye(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,o]=this._rawAttributes[e];this._rawAttributes[e]=[r,(0,zu.isPromiseLike)(o)?await o:o]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&$u.diag.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,o]of this._rawAttributes){if((0,zu.isPromiseLike)(o)){$u.diag.debug(`Unsettled resource attribute ${r} skipped`);continue}o!=null&&(e[r]??=o)}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=nye(this,e),o=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}};function gb(t,e){return gh.FromAttributeList(Object.entries(t),e)}En.resourceFromAttributes=gb;function ZTe(t,e){return new gh(t,e)}En.resourceFromDetectedResource=ZTe;function eye(){return gb({})}En.emptyResource=eye;function tye(){return gb({[Go.ATTR_SERVICE_NAME]:(0,QTe.defaultServiceName)(),[Go.ATTR_TELEMETRY_SDK_LANGUAGE]:_b.SDK_INFO[Go.ATTR_TELEMETRY_SDK_LANGUAGE],[Go.ATTR_TELEMETRY_SDK_NAME]:_b.SDK_INFO[Go.ATTR_TELEMETRY_SDK_NAME],[Go.ATTR_TELEMETRY_SDK_VERSION]:_b.SDK_INFO[Go.ATTR_TELEMETRY_SDK_VERSION]})}En.defaultResource=tye;function A$(t){return t.map(([e,r])=>(0,zu.isPromiseLike)(r)?[e,r.catch(o=>{$u.diag.debug("promise rejection for resource attribute: %s - %s",e,o)})]:[e,r])}function rye(t){if(typeof t=="string"||t===void 0)return t;$u.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function nye(t,e){let r=t?.schemaUrl,o=e?.schemaUrl,s=r===void 0||r==="",a=o===void 0||o==="";if(s)return o;if(a||r===o)return r;$u.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,o)}});var b$=p(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.detectResources=void 0;var O$=(b(),y(P)),Sb=Eb(),iye=(t={})=>(t.detectors||[]).map(r=>{try{let o=(0,Sb.resourceFromDetectedResource)(r.detect(t));return O$.diag.debug(`${r.constructor.name} found resource.`,o),o}catch(o){return O$.diag.debug(`${r.constructor.name} failed: ${o.message}`),(0,Sb.emptyResource)()}}).reduce((r,o)=>r.merge(o),(0,Sb.emptyResource)());Eh.detectResources=iye});var P$=p(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.envDetector=void 0;var oye=(b(),y(P)),sye=(yt(),y(Dt)),R$=W(),Tb=class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";_ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.";_ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters.";detect(e){let r={},o=(0,R$.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),s=(0,R$.getStringFromEnv)("OTEL_SERVICE_NAME");if(o)try{let a=this._parseResourceAttributes(o);Object.assign(r,a)}catch(a){oye.diag.debug(`EnvDetector failed: ${a.message}`)}return s&&(r[sye.ATTR_SERVICE_NAME]=s),{attributes:r}}_parseResourceAttributes(e){if(!e)return{};let r={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);r[i]=decodeURIComponent(n)}return r}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o<33||o===44||o===59||o===92||o>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};Sh.envDetector=new Tb});var Yu=p(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.ATTR_WEBENGINE_VERSION=B.ATTR_WEBENGINE_NAME=B.ATTR_WEBENGINE_DESCRIPTION=B.ATTR_SERVICE_NAMESPACE=B.ATTR_SERVICE_INSTANCE_ID=B.ATTR_PROCESS_RUNTIME_VERSION=B.ATTR_PROCESS_RUNTIME_NAME=B.ATTR_PROCESS_RUNTIME_DESCRIPTION=B.ATTR_PROCESS_PID=B.ATTR_PROCESS_OWNER=B.ATTR_PROCESS_EXECUTABLE_PATH=B.ATTR_PROCESS_EXECUTABLE_NAME=B.ATTR_PROCESS_COMMAND_ARGS=B.ATTR_PROCESS_COMMAND=B.ATTR_OS_VERSION=B.ATTR_OS_TYPE=B.ATTR_K8S_POD_NAME=B.ATTR_K8S_NAMESPACE_NAME=B.ATTR_K8S_DEPLOYMENT_NAME=B.ATTR_K8S_CLUSTER_NAME=B.ATTR_HOST_TYPE=B.ATTR_HOST_NAME=B.ATTR_HOST_IMAGE_VERSION=B.ATTR_HOST_IMAGE_NAME=B.ATTR_HOST_IMAGE_ID=B.ATTR_HOST_ID=B.ATTR_HOST_ARCH=B.ATTR_CONTAINER_NAME=B.ATTR_CONTAINER_IMAGE_TAGS=B.ATTR_CONTAINER_IMAGE_NAME=B.ATTR_CONTAINER_ID=B.ATTR_CLOUD_REGION=B.ATTR_CLOUD_PROVIDER=B.ATTR_CLOUD_AVAILABILITY_ZONE=B.ATTR_CLOUD_ACCOUNT_ID=void 0;B.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";B.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";B.ATTR_CLOUD_PROVIDER="cloud.provider";B.ATTR_CLOUD_REGION="cloud.region";B.ATTR_CONTAINER_ID="container.id";B.ATTR_CONTAINER_IMAGE_NAME="container.image.name";B.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";B.ATTR_CONTAINER_NAME="container.name";B.ATTR_HOST_ARCH="host.arch";B.ATTR_HOST_ID="host.id";B.ATTR_HOST_IMAGE_ID="host.image.id";B.ATTR_HOST_IMAGE_NAME="host.image.name";B.ATTR_HOST_IMAGE_VERSION="host.image.version";B.ATTR_HOST_NAME="host.name";B.ATTR_HOST_TYPE="host.type";B.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";B.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";B.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";B.ATTR_K8S_POD_NAME="k8s.pod.name";B.ATTR_OS_TYPE="os.type";B.ATTR_OS_VERSION="os.version";B.ATTR_PROCESS_COMMAND="process.command";B.ATTR_PROCESS_COMMAND_ARGS="process.command_args";B.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";B.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";B.ATTR_PROCESS_OWNER="process.owner";B.ATTR_PROCESS_PID="process.pid";B.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";B.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";B.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";B.ATTR_SERVICE_INSTANCE_ID="service.instance.id";B.ATTR_SERVICE_NAMESPACE="service.namespace";B.ATTR_WEBENGINE_DESCRIPTION="webengine.description";B.ATTR_WEBENGINE_NAME="webengine.name";B.ATTR_WEBENGINE_VERSION="webengine.version"});var yh=p(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.execAsync=void 0;var aye=require("child_process"),cye=require("util");Th.execAsync=cye.promisify(aye.exec)});var C$=p(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.getMachineId=void 0;var uye=yh(),lye=(b(),y(P));async function dye(){try{let e=(await(0,uye.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
|
|
2
|
+
`).find(o=>o.includes("IOPlatformUUID"));if(!e)return;let r=e.split('" = "');if(r.length===2)return r[1].slice(0,-1)}catch(t){lye.diag.debug(`error reading machine id: ${t}`)}}vh.getMachineId=dye});var N$=p(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.getMachineId=void 0;var pye=require("fs"),fye=(b(),y(P));async function hye(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await pye.promises.readFile(e,{encoding:"utf8"})).trim()}catch(r){fye.diag.debug(`error reading machine id: ${r}`)}}Ah.getMachineId=hye});var I$=p(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.getMachineId=void 0;var mye=require("fs"),_ye=yh(),M$=(b(),y(P));async function gye(){try{return(await mye.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){M$.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,_ye.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){M$.diag.debug(`error reading machine id: ${t}`)}}Oh.getMachineId=gye});var w$=p(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.getMachineId=void 0;var x$=require("process"),Eye=yh(),Sye=(b(),y(P));async function Tye(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";x$.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in x$.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let o=(await(0,Eye.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(r){Sye.diag.debug(`error reading machine id: ${r}`)}}bh.getMachineId=Tye});var L$=p(Rh=>{"use strict";Object.defineProperty(Rh,"__esModule",{value:!0});Rh.getMachineId=void 0;var yye=(b(),y(P));async function vye(){yye.diag.debug("could not read machine-id: unsupported platform")}Rh.getMachineId=vye});var D$=p(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.getMachineId=void 0;var Aye=require("process"),qo;async function Oye(){if(!qo)switch(Aye.platform){case"darwin":qo=(await Promise.resolve().then(()=>J(C$()))).getMachineId;break;case"linux":qo=(await Promise.resolve().then(()=>J(N$()))).getMachineId;break;case"freebsd":qo=(await Promise.resolve().then(()=>J(I$()))).getMachineId;break;case"win32":qo=(await Promise.resolve().then(()=>J(w$()))).getMachineId;break;default:qo=(await Promise.resolve().then(()=>J(L$()))).getMachineId;break}return qo()}Ph.getMachineId=Oye});var yb=p(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.normalizeType=ya.normalizeArch=void 0;var bye=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};ya.normalizeArch=bye;var Rye=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};ya.normalizeType=Rye});var k$=p(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.hostDetector=void 0;var vb=Yu(),U$=require("os"),Pye=D$(),Cye=yb(),Ab=class{detect(e){return{attributes:{[vb.ATTR_HOST_NAME]:(0,U$.hostname)(),[vb.ATTR_HOST_ARCH]:(0,Cye.normalizeArch)((0,U$.arch)()),[vb.ATTR_HOST_ID]:(0,Pye.getMachineId)()}}}};Ch.hostDetector=new Ab});var V$=p(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.osDetector=void 0;var B$=Yu(),F$=require("os"),Nye=yb(),Ob=class{detect(e){return{attributes:{[B$.ATTR_OS_TYPE]:(0,Nye.normalizeType)((0,F$.platform)()),[B$.ATTR_OS_VERSION]:(0,F$.release)()}}}};Nh.osDetector=new Ob});var G$=p(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.processDetector=void 0;var Mye=(b(),y(P)),_i=Yu(),Iye=require("os"),bb=class{detect(e){let r={[_i.ATTR_PROCESS_PID]:process.pid,[_i.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[_i.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[_i.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[_i.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[_i.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[_i.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(r[_i.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let o=Iye.userInfo();r[_i.ATTR_PROCESS_OWNER]=o.username}catch(o){Mye.diag.debug(`error obtaining process owner: ${o}`)}return{attributes:r}}};Mh.processDetector=new bb});var q$=p(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});Ih.serviceInstanceIdDetector=void 0;var xye=Yu(),wye=require("crypto"),Rb=class{detect(e){return{attributes:{[xye.ATTR_SERVICE_INSTANCE_ID]:(0,wye.randomUUID)()}}}};Ih.serviceInstanceIdDetector=new Rb});var j$=p(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.serviceInstanceIdDetector=Sn.processDetector=Sn.osDetector=Sn.hostDetector=void 0;var Lye=k$();Object.defineProperty(Sn,"hostDetector",{enumerable:!0,get:function(){return Lye.hostDetector}});var Dye=V$();Object.defineProperty(Sn,"osDetector",{enumerable:!0,get:function(){return Dye.osDetector}});var Uye=G$();Object.defineProperty(Sn,"processDetector",{enumerable:!0,get:function(){return Uye.processDetector}});var kye=q$();Object.defineProperty(Sn,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return kye.serviceInstanceIdDetector}})});var H$=p(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.serviceInstanceIdDetector=Tn.processDetector=Tn.osDetector=Tn.hostDetector=void 0;var xh=j$();Object.defineProperty(Tn,"hostDetector",{enumerable:!0,get:function(){return xh.hostDetector}});Object.defineProperty(Tn,"osDetector",{enumerable:!0,get:function(){return xh.osDetector}});Object.defineProperty(Tn,"processDetector",{enumerable:!0,get:function(){return xh.processDetector}});Object.defineProperty(Tn,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return xh.serviceInstanceIdDetector}})});var z$=p(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.noopDetector=va.NoopDetector=void 0;var wh=class{detect(){return{attributes:{}}}};va.NoopDetector=wh;va.noopDetector=new wh});var $$=p(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.noopDetector=Gt.serviceInstanceIdDetector=Gt.processDetector=Gt.osDetector=Gt.hostDetector=Gt.envDetector=void 0;var Bye=P$();Object.defineProperty(Gt,"envDetector",{enumerable:!0,get:function(){return Bye.envDetector}});var Lh=H$();Object.defineProperty(Gt,"hostDetector",{enumerable:!0,get:function(){return Lh.hostDetector}});Object.defineProperty(Gt,"osDetector",{enumerable:!0,get:function(){return Lh.osDetector}});Object.defineProperty(Gt,"processDetector",{enumerable:!0,get:function(){return Lh.processDetector}});Object.defineProperty(Gt,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Lh.serviceInstanceIdDetector}});var Fye=z$();Object.defineProperty(Gt,"noopDetector",{enumerable:!0,get:function(){return Fye.noopDetector}})});var Aa=p(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.defaultServiceName=Ne.emptyResource=Ne.defaultResource=Ne.resourceFromAttributes=Ne.serviceInstanceIdDetector=Ne.processDetector=Ne.osDetector=Ne.hostDetector=Ne.envDetector=Ne.detectResources=void 0;var Vye=b$();Object.defineProperty(Ne,"detectResources",{enumerable:!0,get:function(){return Vye.detectResources}});var Wu=$$();Object.defineProperty(Ne,"envDetector",{enumerable:!0,get:function(){return Wu.envDetector}});Object.defineProperty(Ne,"hostDetector",{enumerable:!0,get:function(){return Wu.hostDetector}});Object.defineProperty(Ne,"osDetector",{enumerable:!0,get:function(){return Wu.osDetector}});Object.defineProperty(Ne,"processDetector",{enumerable:!0,get:function(){return Wu.processDetector}});Object.defineProperty(Ne,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Wu.serviceInstanceIdDetector}});var Pb=Eb();Object.defineProperty(Ne,"resourceFromAttributes",{enumerable:!0,get:function(){return Pb.resourceFromAttributes}});Object.defineProperty(Ne,"defaultResource",{enumerable:!0,get:function(){return Pb.defaultResource}});Object.defineProperty(Ne,"emptyResource",{enumerable:!0,get:function(){return Pb.emptyResource}});var Gye=mb();Object.defineProperty(Ne,"defaultServiceName",{enumerable:!0,get:function(){return Gye.defaultServiceName}})});var Y$=p(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.LogRecordImpl=void 0;var jo=(b(),y(P)),Dh=W(),Cb=class{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;totalAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,r,o){let{timestamp:s,observedTimestamp:a,eventName:i,severityNumber:n,severityText:c,body:u,attributes:l={},context:d}=o,h=Date.now();if(this.hrTime=(0,Dh.timeInputToHrTime)(s??h),this.hrTimeObserved=(0,Dh.timeInputToHrTime)(a??h),d){let g=jo.trace.getSpanContext(d);g&&jo.isSpanContextValid(g)&&(this.spanContext=g)}this.severityNumber=n,this.severityText=c,this.body=u,this.resource=e.resource,this.instrumentationScope=r,this._logRecordLimits=e.logRecordLimits,this._eventName=i,this.setAttributes(l)}setAttribute(e,r){return this._isLogRecordReadonly()?this:r===null?this:e.length===0?(jo.diag.warn(`Invalid attribute key: ${e}`),this):!(0,Dh.isAttributeValue)(r)&&!(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length>0)?(jo.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&&jo.diag.warn("Dropping extra attributes."),this):((0,Dh.isAttributeValue)(r)?this.attributes[e]=this._truncateToSize(r):this.attributes[e]=r,this))}setAttributes(e){for(let[r,o]of Object.entries(e))this.setAttribute(r,o);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let r=this._logRecordLimits.attributeValueLengthLimit;return r<=0?(jo.diag.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,r):o):e}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_isLogRecordReadonly(){return this._isReadonly&&jo.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};Uh.LogRecordImpl=Cb});var W$=p(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.Logger=void 0;var qye=(b(),y(P)),jye=Y$(),Nb=class{instrumentationScope;_sharedState;constructor(e,r){this.instrumentationScope=e,this._sharedState=r}emit(e){let r=e.context||qye.context.active(),o=new jye.LogRecordImpl(this._sharedState,this.instrumentationScope,{context:r,...e});this._sharedState.activeProcessor.onEmit(o,r),o._makeReadonly()}};kh.Logger=Nb});var K$=p(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.reconfigureLimits=ba.loadDefaultConfig=void 0;var Oa=W();function Hye(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Oa.getNumberFromEnv)("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,Oa.getNumberFromEnv)("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??128},includeTraceContext:!0}}ba.loadDefaultConfig=Hye;function zye(t){return{attributeCountLimit:t.attributeCountLimit??(0,Oa.getNumberFromEnv)("OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT")??(0,Oa.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,attributeValueLengthLimit:t.attributeValueLengthLimit??(0,Oa.getNumberFromEnv)("OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,Oa.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0}}ba.reconfigureLimits=zye});var Ib=p(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.NoopLogRecordProcessor=void 0;var Mb=class{forceFlush(){return Promise.resolve()}onEmit(e,r){}shutdown(){return Promise.resolve()}};Bh.NoopLogRecordProcessor=Mb});var X$=p(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.MultiLogRecordProcessor=void 0;var $ye=W(),xb=class{processors;forceFlushTimeoutMillis;constructor(e,r){this.processors=e,this.forceFlushTimeoutMillis=r}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(r=>(0,$ye.callWithTimeout)(r.forceFlush(),e)))}onEmit(e,r){this.processors.forEach(o=>o.onEmit(e,r))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};Fh.MultiLogRecordProcessor=xb});var J$=p(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.LoggerProviderSharedState=void 0;var Yye=Ib(),Wye=X$(),wb=class{resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];constructor(e,r,o,s){this.resource=e,this.forceFlushTimeoutMillis=r,this.logRecordLimits=o,this.processors=s,s.length>0?(this.registeredLogRecordProcessors=s,this.activeProcessor=new Wye.MultiLogRecordProcessor(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Yye.NoopLogRecordProcessor}};Vh.LoggerProviderSharedState=wb});var eY=p(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.LoggerProvider=Ho.DEFAULT_LOGGER_NAME=void 0;var Gh=(b(),y(P)),Kye=Hu(),Xye=Aa(),Q$=W(),Jye=W$(),Z$=K$(),Qye=J$();Ho.DEFAULT_LOGGER_NAME="unknown";var Lb=class{_shutdownOnce;_sharedState;constructor(e={}){let r=(0,Q$.merge)({},(0,Z$.loadDefaultConfig)(),e),o=e.resource??(0,Xye.defaultResource)();this._sharedState=new Qye.LoggerProviderSharedState(o,r.forceFlushTimeoutMillis,(0,Z$.reconfigureLimits)(r.logRecordLimits),e?.processors??[]),this._shutdownOnce=new Q$.BindOnceFuture(this._shutdown,this)}getLogger(e,r,o){if(this._shutdownOnce.isCalled)return Gh.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),Kye.NOOP_LOGGER;e||Gh.diag.warn("Logger requested without instrumentation scope name.");let s=e||Ho.DEFAULT_LOGGER_NAME,a=`${s}@${r||""}:${o?.schemaUrl||""}`;return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new Jye.Logger({name:s,version:r,schemaUrl:o?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(a)}forceFlush(){return this._shutdownOnce.isCalled?(Gh.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Gh.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};Ho.LoggerProvider=Lb});var rY=p(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.ConsoleLogRecordExporter=void 0;var tY=W(),Db=class{export(e,r){this._sendLogRecords(e,r)}shutdown(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:(0,tY.hrTimeToMicroseconds)(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,r){for(let o of e)console.dir(this._exportInfo(o),{depth:3});r?.({code:tY.ExportResultCode.SUCCESS})}};qh.ConsoleLogRecordExporter=Db});var nY=p(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.SimpleLogRecordProcessor=void 0;var Ra=W(),Ub=class{_exporter;_shutdownOnce;_unresolvedExports;constructor(e){this._exporter=e,this._shutdownOnce=new Ra.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){if(this._shutdownOnce.isCalled)return;let r=()=>Ra.internal._export(this._exporter,[e]).then(o=>{o.code!==Ra.ExportResultCode.SUCCESS&&(0,Ra.globalErrorHandler)(o.error??new Error(`SimpleLogRecordProcessor: log record export failed (status ${o})`))}).catch(Ra.globalErrorHandler);if(e.resource.asyncAttributesPending){let o=e.resource.waitForAsyncAttributes?.().then(()=>(this._unresolvedExports.delete(o),r()),Ra.globalErrorHandler);o!=null&&this._unresolvedExports.add(o)}else r()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};jh.SimpleLogRecordProcessor=Ub});var oY=p(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.InMemoryLogRecordExporter=void 0;var iY=W(),kb=class{_finishedLogRecords=[];_stopped=!1;export(e,r){if(this._stopped)return r({code:iY.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),r({code:iY.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};Hh.InMemoryLogRecordExporter=kb});var sY=p(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.BatchLogRecordProcessorBase=void 0;var Zye=(b(),y(P)),or=W(),Bb=class{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_finishedLogRecords=[];_timer;_shutdownOnce;constructor(e,r){this._exporter=e,this._maxExportBatchSize=r?.maxExportBatchSize??(0,or.getNumberFromEnv)("OTEL_BLRP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=r?.maxQueueSize??(0,or.getNumberFromEnv)("OTEL_BLRP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=r?.scheduledDelayMillis??(0,or.getNumberFromEnv)("OTEL_BLRP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=r?.exportTimeoutMillis??(0,or.getNumberFromEnv)("OTEL_BLRP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new or.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Zye.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,r)=>{let o=[],s=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let a=0;a<s;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,r)=>{(0,or.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(r)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,or.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,or.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){let r=()=>or.internal._export(this._exporter,e).then(s=>{s.code!==or.ExportResultCode.SUCCESS&&(0,or.globalErrorHandler)(s.error??new Error(`BatchLogRecordProcessor: log record export failed (status ${s})`))}).catch(or.globalErrorHandler),o=e.map(s=>s.resource).filter(s=>s.asyncAttributesPending);return o.length===0?r():Promise.all(o.map(s=>s.waitForAsyncAttributes?.())).then(r,or.globalErrorHandler)}};zh.BatchLogRecordProcessorBase=Bb});var aY=p($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.BatchLogRecordProcessor=void 0;var eve=sY(),Fb=class extends eve.BatchLogRecordProcessorBase{onShutdown(){}};$h.BatchLogRecordProcessor=Fb});var cY=p(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.BatchLogRecordProcessor=void 0;var tve=aY();Object.defineProperty(Yh,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return tve.BatchLogRecordProcessor}})});var uY=p(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.BatchLogRecordProcessor=void 0;var rve=cY();Object.defineProperty(Wh,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return rve.BatchLogRecordProcessor}})});var Vb=p(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.BatchLogRecordProcessor=qt.InMemoryLogRecordExporter=qt.SimpleLogRecordProcessor=qt.ConsoleLogRecordExporter=qt.NoopLogRecordProcessor=qt.LoggerProvider=void 0;var nve=eY();Object.defineProperty(qt,"LoggerProvider",{enumerable:!0,get:function(){return nve.LoggerProvider}});var ive=Ib();Object.defineProperty(qt,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return ive.NoopLogRecordProcessor}});var ove=rY();Object.defineProperty(qt,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return ove.ConsoleLogRecordExporter}});var sve=nY();Object.defineProperty(qt,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return sve.SimpleLogRecordProcessor}});var ave=oY();Object.defineProperty(qt,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return ave.InMemoryLogRecordExporter}});var cve=uY();Object.defineProperty(qt,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return cve.BatchLogRecordProcessor}})});var Kh=p(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.AggregationTemporality=void 0;var uve;(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(uve=Ku.AggregationTemporality||(Ku.AggregationTemporality={}))});var Ki=p(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.DataPointType=Wi.InstrumentType=void 0;var lve;(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"})(lve=Wi.InstrumentType||(Wi.InstrumentType={}));var dve;(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(dve=Wi.DataPointType||(Wi.DataPointType={}))});var Gr=p(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.equalsCaseInsensitive=Pe.binarySearchUB=Pe.setEquals=Pe.FlatMap=Pe.isPromiseAllSettledRejectionResult=Pe.PromiseAllSettled=Pe.callWithTimeout=Pe.TimeoutError=Pe.instrumentationScopeId=Pe.hashAttributes=Pe.isNotNullish=void 0;function pve(t){return t!=null}Pe.isNotNullish=pve;function fve(t){let e=Object.keys(t);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(r=>[r,t[r]])))}Pe.hashAttributes=fve;function hve(t){return`${t.name}:${t.version??""}:${t.schemaUrl??""}`}Pe.instrumentationScopeId=hve;var Xh=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};Pe.TimeoutError=Xh;function mve(t,e){let r,o=new Promise(function(a,i){r=setTimeout(function(){i(new Xh("Operation timed out."))},e)});return Promise.race([t,o]).then(s=>(clearTimeout(r),s),s=>{throw clearTimeout(r),s})}Pe.callWithTimeout=mve;async function _ve(t){return Promise.all(t.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(r){return{status:"rejected",reason:r}}}))}Pe.PromiseAllSettled=_ve;function gve(t){return t.status==="rejected"}Pe.isPromiseAllSettledRejectionResult=gve;function Eve(t,e){let r=[];return t.forEach(o=>{r.push(...e(o))}),r}Pe.FlatMap=Eve;function Sve(t,e){if(t.size!==e.size)return!1;for(let r of t)if(!e.has(r))return!1;return!0}Pe.setEquals=Sve;function Tve(t,e){let r=0,o=t.length-1,s=t.length;for(;o>=r;){let a=r+Math.trunc((o-r)/2);t[a]<e?r=a+1:(s=a,o=a-1)}return s}Pe.binarySearchUB=Tve;function yve(t,e){return t.toLowerCase()===e.toLowerCase()}Pe.equalsCaseInsensitive=yve});var Pa=p(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.AggregatorKind=void 0;var vve;(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"})(vve=Xu.AggregatorKind||(Xu.AggregatorKind={}))});var lY=p(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.DropAggregator=void 0;var Ave=Pa(),Gb=class{kind=Ave.AggregatorKind.DROP;createAccumulation(){}merge(e,r){}diff(e,r){}toMetricData(e,r,o,s){}};Jh.DropAggregator=Gb});var dY=p(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.HistogramAggregator=Na.HistogramAccumulation=void 0;var Ove=Pa(),Ju=Ki(),bve=Gr();function Rve(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 Ca=class{startTime;_boundaries;_recordMinMax;_current;constructor(e,r,o=!0,s=Rve(r)){this.startTime=e,this._boundaries=r,this._recordMinMax=o,this._current=s}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=(0,bve.binarySearchUB)(this._boundaries,e);this._current.buckets.counts[r]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Na.HistogramAccumulation=Ca;var qb=class{_boundaries;_recordMinMax;kind=Ove.AggregatorKind.HISTOGRAM;constructor(e,r){this._boundaries=e,this._recordMinMax=r}createAccumulation(e){return new Ca(e,this._boundaries,this._recordMinMax)}merge(e,r){let o=e.toPointValue(),s=r.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let l=0;l<a.length;l++)n[l]=a[l]+i[l];let c=1/0,u=-1/0;return this._recordMinMax&&(o.hasMinMax&&s.hasMinMax?(c=Math.min(o.min,s.min),u=Math.max(o.max,s.max)):o.hasMinMax?(c=o.min,u=o.max):s.hasMinMax&&(c=s.min,u=s.max)),new Ca(e.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:o.count+s.count,sum:o.sum+s.sum,hasMinMax:this._recordMinMax&&(o.hasMinMax||s.hasMinMax),min:c,max:u})}diff(e,r){let o=e.toPointValue(),s=r.toPointValue(),a=o.buckets.counts,i=s.buckets.counts,n=new Array(a.length);for(let c=0;c<a.length;c++)n[c]=i[c]-a[c];return new Ca(r.startTime,o.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:o.buckets.boundaries,counts:n},count:s.count-o.count,sum:s.sum-o.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,r,o,s){return{descriptor:e,aggregationTemporality:r,dataPointType:Ju.DataPointType.HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),c=e.type===Ju.InstrumentType.GAUGE||e.type===Ju.InstrumentType.UP_DOWN_COUNTER||e.type===Ju.InstrumentType.OBSERVABLE_GAUGE||e.type===Ju.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:c?void 0:n.sum,buckets:n.buckets,count:n.count}}})}}};Na.HistogramAggregator=qb});var pY=p(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.Buckets=void 0;var jb=class t{backing;indexBase;indexStart;indexEnd;constructor(e=new Hb,r=0,o=0,s=0){this.backing=e,this.indexBase=r,this.indexStart=o,this.indexEnd=s}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,o=1<<e,s=0,a=0;for(let i=this.indexStart;i<=this.indexEnd;){let n=i%o;n<0&&(n+=o);for(let c=n;c<o&&s<r;c++)this._relocateBucket(a,s),s++,i++;a++}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))}};Qh.Buckets=jb;var Hb=class t{_counts;constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,r,o){let s=new Array(e).fill(0);s.splice(o,this._counts.length-r,...this._counts.slice(r)),s.splice(0,r,...this._counts.slice(0,r)),this._counts=s}reverse(e,r){let o=Math.floor((e+r)/2)-e;for(let s=0;s<o;s++){let a=this._counts[e+s];this._counts[e+s]=this._counts[r-s-1],this._counts[r-s-1]=a}}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])}}});var $b=p(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.getSignificand=jt.getNormalBase2=jt.MIN_VALUE=jt.MAX_NORMAL_EXPONENT=jt.MIN_NORMAL_EXPONENT=jt.SIGNIFICAND_WIDTH=void 0;jt.SIGNIFICAND_WIDTH=52;var Pve=2146435072,Cve=1048575,zb=1023;jt.MIN_NORMAL_EXPONENT=-zb+1;jt.MAX_NORMAL_EXPONENT=zb;jt.MIN_VALUE=Math.pow(2,-1022);function Nve(t){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,t),((e.getUint32(0)&Pve)>>20)-zb}jt.getNormalBase2=Nve;function Mve(t){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,t);let r=e.getUint32(0),o=e.getUint32(4);return(r&Cve)*Math.pow(2,32)+o}jt.getSignificand=Mve});var Zh=p(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.nextGreaterSquare=Ma.ldexp=void 0;function Ive(t,e){return t===0||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY||Number.isNaN(t)?t:t*Math.pow(2,e)}Ma.ldexp=Ive;function xve(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t}Ma.nextGreaterSquare=xve});var tm=p(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.MappingError=void 0;var Yb=class extends Error{};em.MappingError=Yb});var hY=p(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.ExponentMapping=void 0;var Ia=$b(),wve=Zh(),fY=tm(),Wb=class{_shift;constructor(e){this._shift=-e}mapToIndex(e){if(e<Ia.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let r=Ia.getNormalBase2(e),o=this._rightShift(Ia.getSignificand(e)-1,Ia.SIGNIFICAND_WIDTH);return r+o>>this._shift}lowerBoundary(e){let r=this._minNormalLowerBoundaryIndex();if(e<r)throw new fY.MappingError(`underflow: ${e} is < minimum lower boundary: ${r}`);let o=this._maxNormalLowerBoundaryIndex();if(e>o)throw new fY.MappingError(`overflow: ${e} is > maximum lower boundary: ${o}`);return wve.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=Ia.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return Ia.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,r){return Math.floor(e*Math.pow(2,-r))}};rm.ExponentMapping=Wb});var gY=p(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.LogarithmMapping=void 0;var xa=$b(),mY=Zh(),_Y=tm(),Kb=class{_scale;_scaleFactor;_inverseFactor;constructor(e){this._scale=e,this._scaleFactor=mY.ldexp(Math.LOG2E,e),this._inverseFactor=mY.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=xa.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(xa.getSignificand(e)===0)return(xa.getNormalBase2(e)<<this._scale)-1;let r=Math.floor(Math.log(e)*this._scaleFactor),o=this._maxNormalLowerBoundaryIndex();return r>=o?o: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 _Y.MappingError(`overflow: ${e} is > maximum lower boundary: ${r}`)}let o=this._minNormalLowerBoundaryIndex();if(e<=o){if(e===o)return xa.MIN_VALUE;if(e===o-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new _Y.MappingError(`overflow: ${e} is < minimum lower boundary: ${o}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return xa.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(xa.MAX_NORMAL_EXPONENT+1<<this._scale)-1}};nm.LogarithmMapping=Kb});var TY=p(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.getMapping=void 0;var Lve=hY(),Dve=gY(),Uve=tm(),EY=-10,SY=20,kve=Array.from({length:31},(t,e)=>e>10?new Dve.LogarithmMapping(e-10):new Lve.ExponentMapping(e-10));function Bve(t){if(t>SY||t<EY)throw new Uve.MappingError(`expected scale >= ${EY} && <= ${SY}, got: ${t}`);return kve[t+10]}im.getMapping=Bve});var AY=p(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.ExponentialHistogramAggregator=La.ExponentialHistogramAccumulation=void 0;var Fve=Pa(),Qu=Ki(),Vve=(b(),y(P)),yY=pY(),vY=TY(),Gve=Zh(),wa=class t{low;high;static combine(e,r){return new t(Math.min(e.low,r.low),Math.max(e.high,r.high))}constructor(e,r){this.low=e,this.high=r}},qve=20,jve=160,Xb=2,om=class t{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(e,r=jve,o=!0,s=0,a=0,i=0,n=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=new yY.Buckets,l=new yY.Buckets,d=(0,vY.getMapping)(qve)){this.startTime=e,this._maxSize=r,this._recordMinMax=o,this._sum=s,this._count=a,this._zeroCount=i,this._min=n,this._max=c,this._positive=u,this._negative=l,this._mapping=d,this._maxSize<Xb&&(Vve.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${Xb}`),this._maxSize=Xb)}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,o){let s=this._mapping.mapToIndex(r),a=!1,i=0,n=0;if(e.length===0?(e.indexStart=s,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):s<e.indexStart&&e.indexEnd-s>=this._maxSize?(a=!0,n=s,i=e.indexEnd):s>e.indexEnd&&s-e.indexStart>=this._maxSize&&(a=!0,n=e.indexStart,i=s),a){let c=this._changeScale(i,n);this._downscale(c),s=this._mapping.mapToIndex(r)}this._incrementIndexBy(e,s,o)}_incrementIndexBy(e,r,o){if(o===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=r),r<e.indexStart){let a=e.indexEnd-r;a>=e.backing.length&&this._grow(e,a+1),e.indexStart=r}else if(r>e.indexEnd){let a=r-e.indexStart;a>=e.backing.length&&this._grow(e,a+1),e.indexEnd=r}let s=r-e.indexBase;s<0&&(s+=e.backing.length),e.incrementBucket(s,o)}_grow(e,r){let o=e.backing.length,s=e.indexBase-e.indexStart,a=o-s,i=(0,Gve.nextGreaterSquare)(r);i>this._maxSize&&(i=this._maxSize);let n=i-s;e.backing.growTo(i,a,n)}_changeScale(e,r){let o=0;for(;e-r>=this._maxSize;)e>>=1,r>>=1,o++;return o}_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=(0,vY.getMapping)(r)}_minScale(e){let r=Math.min(this.scale,e.scale),o=wa.combine(this._highLowAtScale(this.positive,this.scale,r),this._highLowAtScale(e.positive,e.scale,r)),s=wa.combine(this._highLowAtScale(this.negative,this.scale,r),this._highLowAtScale(e.negative,e.scale,r));return Math.min(r-this._changeScale(o.high,o.low),r-this._changeScale(s.high,s.low))}_highLowAtScale(e,r,o){if(e.length===0)return new wa(0,-1);let s=r-o;return new wa(e.indexStart>>s,e.indexEnd>>s)}_mergeBuckets(e,r,o,s){let a=o.offset,i=r.scale-s;for(let n=0;n<o.length;n++)this._incrementIndexBy(e,a+n>>i,o.at(n))}_diffBuckets(e,r,o,s){let a=o.offset,i=r.scale-s;for(let n=0;n<o.length;n++){let u=(a+n>>i)-e.indexBase;u<0&&(u+=e.backing.length),e.decrementBucket(u,o.at(n))}e.trim()}};La.ExponentialHistogramAccumulation=om;var Jb=class{_maxSize;_recordMinMax;kind=Fve.AggregatorKind.EXPONENTIAL_HISTOGRAM;constructor(e,r){this._maxSize=e,this._recordMinMax=r}createAccumulation(e){return new om(e,this._maxSize,this._recordMinMax)}merge(e,r){let o=r.clone();return o.merge(e),o}diff(e,r){let o=r.clone();return o.diff(e),o}toMetricData(e,r,o,s){return{descriptor:e,aggregationTemporality:r,dataPointType:Qu.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:o.map(([a,i])=>{let n=i.toPointValue(),c=e.type===Qu.InstrumentType.GAUGE||e.type===Qu.InstrumentType.UP_DOWN_COUNTER||e.type===Qu.InstrumentType.OBSERVABLE_GAUGE||e.type===Qu.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:a,startTime:i.startTime,endTime:s,value:{min:n.hasMinMax?n.min:void 0,max:n.hasMinMax?n.max:void 0,sum:c?void 0:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},count:n.count,scale:n.scale,zeroCount:n.zeroCount}}})}}};La.ExponentialHistogramAggregator=Jb});var OY=p(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.LastValueAggregator=Ua.LastValueAccumulation=void 0;var Hve=Pa(),Zu=W(),zve=Ki(),Da=class{startTime;_current;sampleTime;constructor(e,r=0,o=[0,0]){this.startTime=e,this._current=r,this.sampleTime=o}record(e){this._current=e,this.sampleTime=(0,Zu.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ua.LastValueAccumulation=Da;var Qb=class{kind=Hve.AggregatorKind.LAST_VALUE;createAccumulation(e){return new Da(e)}merge(e,r){let o=(0,Zu.hrTimeToMicroseconds)(r.sampleTime)>=(0,Zu.hrTimeToMicroseconds)(e.sampleTime)?r:e;return new Da(e.startTime,o.toPointValue(),o.sampleTime)}diff(e,r){let o=(0,Zu.hrTimeToMicroseconds)(r.sampleTime)>=(0,Zu.hrTimeToMicroseconds)(e.sampleTime)?r:e;return new Da(r.startTime,o.toPointValue(),o.sampleTime)}toMetricData(e,r,o,s){return{descriptor:e,aggregationTemporality:r,dataPointType:zve.DataPointType.GAUGE,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()}))}}};Ua.LastValueAggregator=Qb});var bY=p(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.SumAggregator=ka.SumAccumulation=void 0;var $ve=Pa(),Yve=Ki(),Xi=class{startTime;monotonic;_current;reset;constructor(e,r,o=0,s=!1){this.startTime=e,this.monotonic=r,this._current=o,this.reset=s}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};ka.SumAccumulation=Xi;var Zb=class{monotonic;kind=$ve.AggregatorKind.SUM;constructor(e){this.monotonic=e}createAccumulation(e){return new Xi(e,this.monotonic)}merge(e,r){let o=e.toPointValue(),s=r.toPointValue();return r.reset?new Xi(r.startTime,this.monotonic,s,r.reset):new Xi(e.startTime,this.monotonic,o+s)}diff(e,r){let o=e.toPointValue(),s=r.toPointValue();return this.monotonic&&o>s?new Xi(r.startTime,this.monotonic,s,!0):new Xi(r.startTime,this.monotonic,s-o)}toMetricData(e,r,o,s){return{descriptor:e,aggregationTemporality:r,dataPointType:Yve.DataPointType.SUM,dataPoints:o.map(([a,i])=>({attributes:a,startTime:i.startTime,endTime:s,value:i.toPointValue()})),isMonotonic:this.monotonic}}};ka.SumAggregator=Zb});var MY=p(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.SumAggregator=qe.SumAccumulation=qe.LastValueAggregator=qe.LastValueAccumulation=qe.ExponentialHistogramAggregator=qe.ExponentialHistogramAccumulation=qe.HistogramAggregator=qe.HistogramAccumulation=qe.DropAggregator=void 0;var Wve=lY();Object.defineProperty(qe,"DropAggregator",{enumerable:!0,get:function(){return Wve.DropAggregator}});var RY=dY();Object.defineProperty(qe,"HistogramAccumulation",{enumerable:!0,get:function(){return RY.HistogramAccumulation}});Object.defineProperty(qe,"HistogramAggregator",{enumerable:!0,get:function(){return RY.HistogramAggregator}});var PY=AY();Object.defineProperty(qe,"ExponentialHistogramAccumulation",{enumerable:!0,get:function(){return PY.ExponentialHistogramAccumulation}});Object.defineProperty(qe,"ExponentialHistogramAggregator",{enumerable:!0,get:function(){return PY.ExponentialHistogramAggregator}});var CY=OY();Object.defineProperty(qe,"LastValueAccumulation",{enumerable:!0,get:function(){return CY.LastValueAccumulation}});Object.defineProperty(qe,"LastValueAggregator",{enumerable:!0,get:function(){return CY.LastValueAggregator}});var NY=bY();Object.defineProperty(qe,"SumAccumulation",{enumerable:!0,get:function(){return NY.SumAccumulation}});Object.defineProperty(qe,"SumAggregator",{enumerable:!0,get:function(){return NY.SumAggregator}})});var IY=p(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.DEFAULT_AGGREGATION=fe.EXPONENTIAL_HISTOGRAM_AGGREGATION=fe.HISTOGRAM_AGGREGATION=fe.LAST_VALUE_AGGREGATION=fe.SUM_AGGREGATION=fe.DROP_AGGREGATION=fe.DefaultAggregation=fe.ExponentialHistogramAggregation=fe.ExplicitBucketHistogramAggregation=fe.HistogramAggregation=fe.LastValueAggregation=fe.SumAggregation=fe.DropAggregation=void 0;var Kve=(b(),y(P)),zo=MY(),yn=Ki(),sm=class t{static DEFAULT_INSTANCE=new zo.DropAggregator;createAggregator(e){return t.DEFAULT_INSTANCE}};fe.DropAggregation=sm;var am=class t{static MONOTONIC_INSTANCE=new zo.SumAggregator(!0);static NON_MONOTONIC_INSTANCE=new zo.SumAggregator(!1);createAggregator(e){switch(e.type){case yn.InstrumentType.COUNTER:case yn.InstrumentType.OBSERVABLE_COUNTER:case yn.InstrumentType.HISTOGRAM:return t.MONOTONIC_INSTANCE;default:return t.NON_MONOTONIC_INSTANCE}}};fe.SumAggregation=am;var cm=class t{static DEFAULT_INSTANCE=new zo.LastValueAggregator;createAggregator(e){return t.DEFAULT_INSTANCE}};fe.LastValueAggregation=cm;var um=class t{static DEFAULT_INSTANCE=new zo.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(e){return t.DEFAULT_INSTANCE}};fe.HistogramAggregation=um;var lm=class{_recordMinMax;_boundaries;constructor(e,r=!0){if(this._recordMinMax=r,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((a,i)=>a-i);let o=e.lastIndexOf(-1/0),s=e.indexOf(1/0);s===-1&&(s=void 0),this._boundaries=e.slice(o+1,s)}createAggregator(e){return new zo.HistogramAggregator(this._boundaries,this._recordMinMax)}};fe.ExplicitBucketHistogramAggregation=lm;var dm=class{_maxSize;_recordMinMax;constructor(e=160,r=!0){this._maxSize=e,this._recordMinMax=r}createAggregator(e){return new zo.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};fe.ExponentialHistogramAggregation=dm;var pm=class{_resolve(e){switch(e.type){case yn.InstrumentType.COUNTER:case yn.InstrumentType.UP_DOWN_COUNTER:case yn.InstrumentType.OBSERVABLE_COUNTER:case yn.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return fe.SUM_AGGREGATION;case yn.InstrumentType.GAUGE:case yn.InstrumentType.OBSERVABLE_GAUGE:return fe.LAST_VALUE_AGGREGATION;case yn.InstrumentType.HISTOGRAM:return e.advice.explicitBucketBoundaries?new lm(e.advice.explicitBucketBoundaries):fe.HISTOGRAM_AGGREGATION}return Kve.diag.warn(`Unable to recognize instrument type: ${e.type}`),fe.DROP_AGGREGATION}createAggregator(e){return this._resolve(e).createAggregator(e)}};fe.DefaultAggregation=pm;fe.DROP_AGGREGATION=new sm;fe.SUM_AGGREGATION=new am;fe.LAST_VALUE_AGGREGATION=new cm;fe.HISTOGRAM_AGGREGATION=new um;fe.EXPONENTIAL_HISTOGRAM_AGGREGATION=new dm;fe.DEFAULT_AGGREGATION=new pm});var el=p(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.toAggregation=Wo.AggregationType=void 0;var $o=IY(),Yo;(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"})(Yo=Wo.AggregationType||(Wo.AggregationType={}));function Xve(t){switch(t.type){case Yo.DEFAULT:return $o.DEFAULT_AGGREGATION;case Yo.DROP:return $o.DROP_AGGREGATION;case Yo.SUM:return $o.SUM_AGGREGATION;case Yo.LAST_VALUE:return $o.LAST_VALUE_AGGREGATION;case Yo.EXPONENTIAL_HISTOGRAM:{let e=t;return new $o.ExponentialHistogramAggregation(e.options?.maxSize,e.options?.recordMinMax)}case Yo.EXPLICIT_BUCKET_HISTOGRAM:{let e=t;return e.options==null?$o.HISTOGRAM_AGGREGATION:new $o.ExplicitBucketHistogramAggregation(e.options?.boundaries,e.options?.recordMinMax)}default:throw new Error("Unsupported Aggregation")}}Wo.toAggregation=Xve});var eR=p(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Ba.DEFAULT_AGGREGATION_SELECTOR=void 0;var Jve=Kh(),Qve=el(),Zve=t=>({type:Qve.AggregationType.DEFAULT});Ba.DEFAULT_AGGREGATION_SELECTOR=Zve;var eAe=t=>Jve.AggregationTemporality.CUMULATIVE;Ba.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=eAe});var rR=p(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.MetricReader=void 0;var xY=(b(),y(P)),fm=Gr(),wY=eR(),tR=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(e){this._aggregationSelector=e?.aggregationSelector??wY.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??wY.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,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,...o]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(n=>n.collect({timeoutMillis:e?.timeoutMillis}))]),s=r.errors.concat((0,fm.FlatMap)(o,n=>n.errors)),a=r.resourceMetrics.resource,i=r.resourceMetrics.scopeMetrics.concat((0,fm.FlatMap)(o,n=>n.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:a,scopeMetrics:i},errors:s}}async shutdown(e){if(this._shutdown){xY.diag.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await(0,fm.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){xY.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,fm.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};hm.MetricReader=tR});var DY=p(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.PeriodicExportingMetricReader=void 0;var nR=(b(),y(P)),tl=W(),tAe=rR(),LY=Gr(),iR=class extends tAe.MetricReader{_interval;_exporter;_exportInterval;_exportTimeout;constructor(e){if(super({aggregationSelector:e.exporter.selectAggregation?.bind(e.exporter),aggregationTemporalitySelector:e.exporter.selectAggregationTemporality?.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=e.exportIntervalMillis??6e4,this._exportTimeout=e.exportTimeoutMillis??3e4,this._exporter=e.exporter}async _runOnce(){try{await(0,LY.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof LY.TimeoutError){nR.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,tl.globalErrorHandler)(e)}}async _doRun(){let{resourceMetrics:e,errors:r}=await this.collect({timeoutMillis:this._exportTimeout});if(r.length>0&&nR.diag.error("PeriodicExportingMetricReader: metrics collection errors",...r),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(s){nR.diag.debug("Error while resolving async portion of resource: ",s),(0,tl.globalErrorHandler)(s)}if(e.scopeMetrics.length===0)return;let o=await tl.internal._export(this._exporter,e);if(o.code!==tl.ExportResultCode.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${o.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,tl.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}};mm.PeriodicExportingMetricReader=iR});var kY=p(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.InMemoryMetricExporter=void 0;var UY=W(),oR=class{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(e){this._aggregationTemporality=e}export(e,r){if(this._shutdown){setTimeout(()=>r({code:UY.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>r({code:UY.ExportResultCode.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()}};_m.InMemoryMetricExporter=oR});var FY=p(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.ConsoleMetricExporter=void 0;var BY=W(),rAe=eR(),sR=class t{_shutdown=!1;_temporalitySelector;constructor(e){this._temporalitySelector=e?.temporalitySelector??rAe.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(e,r){if(this._shutdown){setImmediate(r,{code:BY.ExportResultCode.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 o of e.scopeMetrics)for(let s of o.metrics)console.dir({descriptor:s.descriptor,dataPointType:s.dataPointType,dataPoints:s.dataPoints},{depth:null});r({code:BY.ExportResultCode.SUCCESS})}};gm.ConsoleMetricExporter=sR});var VY=p(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.defaultServiceName=void 0;function nAe(){return`unknown_service:${process.argv0}`}Em.defaultServiceName=nAe});var GY=p(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.defaultServiceName=void 0;var iAe=VY();Object.defineProperty(Sm,"defaultServiceName",{enumerable:!0,get:function(){return iAe.defaultServiceName}})});var aR=p(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.defaultServiceName=void 0;var oAe=GY();Object.defineProperty(Tm,"defaultServiceName",{enumerable:!0,get:function(){return oAe.defaultServiceName}})});var qY=p(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.identity=Fa.isPromiseLike=void 0;var sAe=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";Fa.isPromiseLike=sAe;function aAe(t){return t}Fa.identity=aAe});var lR=p(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.defaultResource=vn.emptyResource=vn.resourceFromDetectedResource=vn.resourceFromAttributes=void 0;var nl=(b(),y(P)),cR=W(),Ko=(yt(),y(Dt)),cAe=aR(),rl=qY(),ym=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let o=new t({},r);return o._rawAttributes=jY(e),o._asyncAttributesPending=e.filter(([s,a])=>(0,rl.isPromiseLike)(a)).length>0,o}constructor(e,r){let o=e.attributes??{};this._rawAttributes=Object.entries(o).map(([s,a])=>((0,rl.isPromiseLike)(a)&&(this._asyncAttributesPending=!0),[s,a])),this._rawAttributes=jY(this._rawAttributes),this._schemaUrl=pAe(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,o]=this._rawAttributes[e];this._rawAttributes[e]=[r,(0,rl.isPromiseLike)(o)?await o:o]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&nl.diag.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,o]of this._rawAttributes){if((0,rl.isPromiseLike)(o)){nl.diag.debug(`Unsettled resource attribute ${r} skipped`);continue}o!=null&&(e[r]??=o)}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=fAe(this,e),o=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}};function uR(t,e){return ym.FromAttributeList(Object.entries(t),e)}vn.resourceFromAttributes=uR;function uAe(t,e){return new ym(t,e)}vn.resourceFromDetectedResource=uAe;function lAe(){return uR({})}vn.emptyResource=lAe;function dAe(){return uR({[Ko.ATTR_SERVICE_NAME]:(0,cAe.defaultServiceName)(),[Ko.ATTR_TELEMETRY_SDK_LANGUAGE]:cR.SDK_INFO[Ko.ATTR_TELEMETRY_SDK_LANGUAGE],[Ko.ATTR_TELEMETRY_SDK_NAME]:cR.SDK_INFO[Ko.ATTR_TELEMETRY_SDK_NAME],[Ko.ATTR_TELEMETRY_SDK_VERSION]:cR.SDK_INFO[Ko.ATTR_TELEMETRY_SDK_VERSION]})}vn.defaultResource=dAe;function jY(t){return t.map(([e,r])=>(0,rl.isPromiseLike)(r)?[e,r.catch(o=>{nl.diag.debug("promise rejection for resource attribute: %s - %s",e,o)})]:[e,r])}function pAe(t){if(typeof t=="string"||t===void 0)return t;nl.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function fAe(t,e){let r=t?.schemaUrl,o=e?.schemaUrl,s=r===void 0||r==="",a=o===void 0||o==="";if(s)return o;if(a||r===o)return r;nl.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,o)}});var zY=p(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.detectResources=void 0;var HY=(b(),y(P)),dR=lR(),hAe=(t={})=>(t.detectors||[]).map(r=>{try{let o=(0,dR.resourceFromDetectedResource)(r.detect(t));return HY.diag.debug(`${r.constructor.name} found resource.`,o),o}catch(o){return HY.diag.debug(`${r.constructor.name} failed: ${o.message}`),(0,dR.emptyResource)()}}).reduce((r,o)=>r.merge(o),(0,dR.emptyResource)());vm.detectResources=hAe});var YY=p(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.envDetector=void 0;var mAe=(b(),y(P)),_Ae=(yt(),y(Dt)),$Y=W(),pR=class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";_ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.";_ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters.";detect(e){let r={},o=(0,$Y.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),s=(0,$Y.getStringFromEnv)("OTEL_SERVICE_NAME");if(o)try{let a=this._parseResourceAttributes(o);Object.assign(r,a)}catch(a){mAe.diag.debug(`EnvDetector failed: ${a.message}`)}return s&&(r[_Ae.ATTR_SERVICE_NAME]=s),{attributes:r}}_parseResourceAttributes(e){if(!e)return{};let r={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);r[i]=decodeURIComponent(n)}return r}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o<33||o===44||o===59||o===92||o>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};Am.envDetector=new pR});var il=p(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.ATTR_WEBENGINE_VERSION=F.ATTR_WEBENGINE_NAME=F.ATTR_WEBENGINE_DESCRIPTION=F.ATTR_SERVICE_NAMESPACE=F.ATTR_SERVICE_INSTANCE_ID=F.ATTR_PROCESS_RUNTIME_VERSION=F.ATTR_PROCESS_RUNTIME_NAME=F.ATTR_PROCESS_RUNTIME_DESCRIPTION=F.ATTR_PROCESS_PID=F.ATTR_PROCESS_OWNER=F.ATTR_PROCESS_EXECUTABLE_PATH=F.ATTR_PROCESS_EXECUTABLE_NAME=F.ATTR_PROCESS_COMMAND_ARGS=F.ATTR_PROCESS_COMMAND=F.ATTR_OS_VERSION=F.ATTR_OS_TYPE=F.ATTR_K8S_POD_NAME=F.ATTR_K8S_NAMESPACE_NAME=F.ATTR_K8S_DEPLOYMENT_NAME=F.ATTR_K8S_CLUSTER_NAME=F.ATTR_HOST_TYPE=F.ATTR_HOST_NAME=F.ATTR_HOST_IMAGE_VERSION=F.ATTR_HOST_IMAGE_NAME=F.ATTR_HOST_IMAGE_ID=F.ATTR_HOST_ID=F.ATTR_HOST_ARCH=F.ATTR_CONTAINER_NAME=F.ATTR_CONTAINER_IMAGE_TAGS=F.ATTR_CONTAINER_IMAGE_NAME=F.ATTR_CONTAINER_ID=F.ATTR_CLOUD_REGION=F.ATTR_CLOUD_PROVIDER=F.ATTR_CLOUD_AVAILABILITY_ZONE=F.ATTR_CLOUD_ACCOUNT_ID=void 0;F.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";F.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";F.ATTR_CLOUD_PROVIDER="cloud.provider";F.ATTR_CLOUD_REGION="cloud.region";F.ATTR_CONTAINER_ID="container.id";F.ATTR_CONTAINER_IMAGE_NAME="container.image.name";F.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";F.ATTR_CONTAINER_NAME="container.name";F.ATTR_HOST_ARCH="host.arch";F.ATTR_HOST_ID="host.id";F.ATTR_HOST_IMAGE_ID="host.image.id";F.ATTR_HOST_IMAGE_NAME="host.image.name";F.ATTR_HOST_IMAGE_VERSION="host.image.version";F.ATTR_HOST_NAME="host.name";F.ATTR_HOST_TYPE="host.type";F.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";F.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";F.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";F.ATTR_K8S_POD_NAME="k8s.pod.name";F.ATTR_OS_TYPE="os.type";F.ATTR_OS_VERSION="os.version";F.ATTR_PROCESS_COMMAND="process.command";F.ATTR_PROCESS_COMMAND_ARGS="process.command_args";F.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";F.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";F.ATTR_PROCESS_OWNER="process.owner";F.ATTR_PROCESS_PID="process.pid";F.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";F.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";F.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";F.ATTR_SERVICE_INSTANCE_ID="service.instance.id";F.ATTR_SERVICE_NAMESPACE="service.namespace";F.ATTR_WEBENGINE_DESCRIPTION="webengine.description";F.ATTR_WEBENGINE_NAME="webengine.name";F.ATTR_WEBENGINE_VERSION="webengine.version"});var bm=p(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.execAsync=void 0;var gAe=require("child_process"),EAe=require("util");Om.execAsync=EAe.promisify(gAe.exec)});var WY=p(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.getMachineId=void 0;var SAe=bm(),TAe=(b(),y(P));async function yAe(){try{let e=(await(0,SAe.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
|
|
3
|
+
`).find(o=>o.includes("IOPlatformUUID"));if(!e)return;let r=e.split('" = "');if(r.length===2)return r[1].slice(0,-1)}catch(t){TAe.diag.debug(`error reading machine id: ${t}`)}}Rm.getMachineId=yAe});var KY=p(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.getMachineId=void 0;var vAe=require("fs"),AAe=(b(),y(P));async function OAe(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await vAe.promises.readFile(e,{encoding:"utf8"})).trim()}catch(r){AAe.diag.debug(`error reading machine id: ${r}`)}}Pm.getMachineId=OAe});var JY=p(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.getMachineId=void 0;var bAe=require("fs"),RAe=bm(),XY=(b(),y(P));async function PAe(){try{return(await bAe.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){XY.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,RAe.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){XY.diag.debug(`error reading machine id: ${t}`)}}Cm.getMachineId=PAe});var ZY=p(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.getMachineId=void 0;var QY=require("process"),CAe=bm(),NAe=(b(),y(P));async function MAe(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";QY.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in QY.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let o=(await(0,CAe.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(r){NAe.diag.debug(`error reading machine id: ${r}`)}}Nm.getMachineId=MAe});var eW=p(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});Mm.getMachineId=void 0;var IAe=(b(),y(P));async function xAe(){IAe.diag.debug("could not read machine-id: unsupported platform")}Mm.getMachineId=xAe});var tW=p(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.getMachineId=void 0;var wAe=require("process"),Xo;async function LAe(){if(!Xo)switch(wAe.platform){case"darwin":Xo=(await Promise.resolve().then(()=>J(WY()))).getMachineId;break;case"linux":Xo=(await Promise.resolve().then(()=>J(KY()))).getMachineId;break;case"freebsd":Xo=(await Promise.resolve().then(()=>J(JY()))).getMachineId;break;case"win32":Xo=(await Promise.resolve().then(()=>J(ZY()))).getMachineId;break;default:Xo=(await Promise.resolve().then(()=>J(eW()))).getMachineId;break}return Xo()}Im.getMachineId=LAe});var fR=p(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.normalizeType=Va.normalizeArch=void 0;var DAe=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};Va.normalizeArch=DAe;var UAe=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};Va.normalizeType=UAe});var nW=p(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.hostDetector=void 0;var hR=il(),rW=require("os"),kAe=tW(),BAe=fR(),mR=class{detect(e){return{attributes:{[hR.ATTR_HOST_NAME]:(0,rW.hostname)(),[hR.ATTR_HOST_ARCH]:(0,BAe.normalizeArch)((0,rW.arch)()),[hR.ATTR_HOST_ID]:(0,kAe.getMachineId)()}}}};xm.hostDetector=new mR});var sW=p(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.osDetector=void 0;var iW=il(),oW=require("os"),FAe=fR(),_R=class{detect(e){return{attributes:{[iW.ATTR_OS_TYPE]:(0,FAe.normalizeType)((0,oW.platform)()),[iW.ATTR_OS_VERSION]:(0,oW.release)()}}}};wm.osDetector=new _R});var aW=p(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.processDetector=void 0;var VAe=(b(),y(P)),gi=il(),GAe=require("os"),gR=class{detect(e){let r={[gi.ATTR_PROCESS_PID]:process.pid,[gi.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[gi.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[gi.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[gi.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[gi.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[gi.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(r[gi.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let o=GAe.userInfo();r[gi.ATTR_PROCESS_OWNER]=o.username}catch(o){VAe.diag.debug(`error obtaining process owner: ${o}`)}return{attributes:r}}};Lm.processDetector=new gR});var cW=p(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.serviceInstanceIdDetector=void 0;var qAe=il(),jAe=require("crypto"),ER=class{detect(e){return{attributes:{[qAe.ATTR_SERVICE_INSTANCE_ID]:(0,jAe.randomUUID)()}}}};Dm.serviceInstanceIdDetector=new ER});var uW=p(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.serviceInstanceIdDetector=An.processDetector=An.osDetector=An.hostDetector=void 0;var HAe=nW();Object.defineProperty(An,"hostDetector",{enumerable:!0,get:function(){return HAe.hostDetector}});var zAe=sW();Object.defineProperty(An,"osDetector",{enumerable:!0,get:function(){return zAe.osDetector}});var $Ae=aW();Object.defineProperty(An,"processDetector",{enumerable:!0,get:function(){return $Ae.processDetector}});var YAe=cW();Object.defineProperty(An,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return YAe.serviceInstanceIdDetector}})});var lW=p(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.serviceInstanceIdDetector=On.processDetector=On.osDetector=On.hostDetector=void 0;var Um=uW();Object.defineProperty(On,"hostDetector",{enumerable:!0,get:function(){return Um.hostDetector}});Object.defineProperty(On,"osDetector",{enumerable:!0,get:function(){return Um.osDetector}});Object.defineProperty(On,"processDetector",{enumerable:!0,get:function(){return Um.processDetector}});Object.defineProperty(On,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Um.serviceInstanceIdDetector}})});var dW=p(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.noopDetector=Ga.NoopDetector=void 0;var km=class{detect(){return{attributes:{}}}};Ga.NoopDetector=km;Ga.noopDetector=new km});var pW=p(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.noopDetector=Ht.serviceInstanceIdDetector=Ht.processDetector=Ht.osDetector=Ht.hostDetector=Ht.envDetector=void 0;var WAe=YY();Object.defineProperty(Ht,"envDetector",{enumerable:!0,get:function(){return WAe.envDetector}});var Bm=lW();Object.defineProperty(Ht,"hostDetector",{enumerable:!0,get:function(){return Bm.hostDetector}});Object.defineProperty(Ht,"osDetector",{enumerable:!0,get:function(){return Bm.osDetector}});Object.defineProperty(Ht,"processDetector",{enumerable:!0,get:function(){return Bm.processDetector}});Object.defineProperty(Ht,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Bm.serviceInstanceIdDetector}});var KAe=dW();Object.defineProperty(Ht,"noopDetector",{enumerable:!0,get:function(){return KAe.noopDetector}})});var fW=p(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.defaultServiceName=Me.emptyResource=Me.defaultResource=Me.resourceFromAttributes=Me.serviceInstanceIdDetector=Me.processDetector=Me.osDetector=Me.hostDetector=Me.envDetector=Me.detectResources=void 0;var XAe=zY();Object.defineProperty(Me,"detectResources",{enumerable:!0,get:function(){return XAe.detectResources}});var ol=pW();Object.defineProperty(Me,"envDetector",{enumerable:!0,get:function(){return ol.envDetector}});Object.defineProperty(Me,"hostDetector",{enumerable:!0,get:function(){return ol.hostDetector}});Object.defineProperty(Me,"osDetector",{enumerable:!0,get:function(){return ol.osDetector}});Object.defineProperty(Me,"processDetector",{enumerable:!0,get:function(){return ol.processDetector}});Object.defineProperty(Me,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return ol.serviceInstanceIdDetector}});var SR=lR();Object.defineProperty(Me,"resourceFromAttributes",{enumerable:!0,get:function(){return SR.resourceFromAttributes}});Object.defineProperty(Me,"defaultResource",{enumerable:!0,get:function(){return SR.defaultResource}});Object.defineProperty(Me,"emptyResource",{enumerable:!0,get:function(){return SR.emptyResource}});var JAe=aR();Object.defineProperty(Me,"defaultServiceName",{enumerable:!0,get:function(){return JAe.defaultServiceName}})});var hW=p(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.ViewRegistry=void 0;var TR=class{_registeredViews=[];addView(e){this._registeredViews.push(e)}findViews(e,r){return this._registeredViews.filter(s=>this._matchInstrument(s.instrumentSelector,e)&&this._matchMeter(s.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))}};Fm.ViewRegistry=TR});var sl=p(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.isValidName=bn.isDescriptorCompatibleWith=bn.createInstrumentDescriptorWithView=bn.createInstrumentDescriptor=void 0;var mW=(b(),y(P)),QAe=Gr();function ZAe(t,e,r){return _W(t)||mW.diag.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??mW.ValueType.DOUBLE,advice:r?.advice??{}}}bn.createInstrumentDescriptor=ZAe;function eOe(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}}bn.createInstrumentDescriptorWithView=eOe;function tOe(t,e){return(0,QAe.equalsCaseInsensitive)(t.name,e.name)&&t.unit===e.unit&&t.type===e.type&&t.valueType===e.valueType}bn.isDescriptorCompatibleWith=tOe;var rOe=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function _W(t){return t.match(rOe)!=null}bn.isValidName=_W});var Vm=p(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.isObservableInstrument=Ie.ObservableUpDownCounterInstrument=Ie.ObservableGaugeInstrument=Ie.ObservableCounterInstrument=Ie.ObservableInstrument=Ie.HistogramInstrument=Ie.GaugeInstrument=Ie.CounterInstrument=Ie.UpDownCounterInstrument=Ie.SyncInstrument=void 0;var qa=(b(),y(P)),nOe=W(),Jo=class{_writableMetricStorage;_descriptor;constructor(e,r){this._writableMetricStorage=e,this._descriptor=r}_record(e,r={},o=qa.context.active()){if(typeof e!="number"){qa.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===qa.ValueType.INT&&!Number.isInteger(e)&&(qa.diag.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,o,(0,nOe.millisToHrTime)(Date.now()))}};Ie.SyncInstrument=Jo;var yR=class extends Jo{add(e,r,o){this._record(e,r,o)}};Ie.UpDownCounterInstrument=yR;var vR=class extends Jo{add(e,r,o){if(e<0){qa.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,r,o)}};Ie.CounterInstrument=vR;var AR=class extends Jo{record(e,r,o){this._record(e,r,o)}};Ie.GaugeInstrument=AR;var OR=class extends Jo{record(e,r,o){if(e<0){qa.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,r,o)}};Ie.HistogramInstrument=OR;var Qo=class{_observableRegistry;_metricStorages;_descriptor;constructor(e,r,o){this._observableRegistry=o,this._descriptor=e,this._metricStorages=r}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};Ie.ObservableInstrument=Qo;var bR=class extends Qo{};Ie.ObservableCounterInstrument=bR;var RR=class extends Qo{};Ie.ObservableGaugeInstrument=RR;var PR=class extends Qo{};Ie.ObservableUpDownCounterInstrument=PR;function iOe(t){return t instanceof Qo}Ie.isObservableInstrument=iOe});var gW=p(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.Meter=void 0;var Zo=sl(),es=Vm(),ts=Ki(),CR=class{_meterSharedState;constructor(e){this._meterSharedState=e}createGauge(e,r){let o=(0,Zo.createInstrumentDescriptor)(e,ts.InstrumentType.GAUGE,r),s=this._meterSharedState.registerMetricStorage(o);return new es.GaugeInstrument(s,o)}createHistogram(e,r){let o=(0,Zo.createInstrumentDescriptor)(e,ts.InstrumentType.HISTOGRAM,r),s=this._meterSharedState.registerMetricStorage(o);return new es.HistogramInstrument(s,o)}createCounter(e,r){let o=(0,Zo.createInstrumentDescriptor)(e,ts.InstrumentType.COUNTER,r),s=this._meterSharedState.registerMetricStorage(o);return new es.CounterInstrument(s,o)}createUpDownCounter(e,r){let o=(0,Zo.createInstrumentDescriptor)(e,ts.InstrumentType.UP_DOWN_COUNTER,r),s=this._meterSharedState.registerMetricStorage(o);return new es.UpDownCounterInstrument(s,o)}createObservableGauge(e,r){let o=(0,Zo.createInstrumentDescriptor)(e,ts.InstrumentType.OBSERVABLE_GAUGE,r),s=this._meterSharedState.registerAsyncMetricStorage(o);return new es.ObservableGaugeInstrument(o,s,this._meterSharedState.observableRegistry)}createObservableCounter(e,r){let o=(0,Zo.createInstrumentDescriptor)(e,ts.InstrumentType.OBSERVABLE_COUNTER,r),s=this._meterSharedState.registerAsyncMetricStorage(o);return new es.ObservableCounterInstrument(o,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,r){let o=(0,Zo.createInstrumentDescriptor)(e,ts.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,r),s=this._meterSharedState.registerAsyncMetricStorage(o);return new es.ObservableUpDownCounterInstrument(o,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,r){this._meterSharedState.observableRegistry.addBatchCallback(e,r)}removeBatchObservableCallback(e,r){this._meterSharedState.observableRegistry.removeBatchCallback(e,r)}};Gm.Meter=CR});var MR=p(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.MetricStorage=void 0;var oOe=sl(),NR=class{_instrumentDescriptor;constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,oOe.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};qm.MetricStorage=NR});var al=p(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.AttributeHashMap=ja.HashMap=void 0;var sOe=Gr(),jm=class{_hash;_valueMap=new Map;_keyMap=new Map;constructor(e){this._hash=e}get(e,r){return r??=this._hash(e),this._valueMap.get(r)}getOrDefault(e,r){let o=this._hash(e);if(this._valueMap.has(o))return this._valueMap.get(o);let s=r();return this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,s),s}set(e,r,o){o??=this._hash(e),this._keyMap.has(o)||this._keyMap.set(o,e),this._valueMap.set(o,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}};ja.HashMap=jm;var IR=class extends jm{constructor(){super(sOe.hashAttributes)}};ja.AttributeHashMap=IR});var LR=p(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.DeltaMetricProcessor=void 0;var aOe=Gr(),xR=al(),wR=class{_aggregator;_activeCollectionStorage=new xR.AttributeHashMap;_cumulativeMemoStorage=new xR.AttributeHashMap;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;constructor(e,r){this._aggregator=e,this._cardinalityLimit=(r??2e3)-1,this._overflowHashCode=(0,aOe.hashAttributes)(this._overflowAttributes)}record(e,r,o,s){let a=this._activeCollectionStorage.get(r);if(!a){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(s))?.record(e);return}a=this._aggregator.createAccumulation(s),this._activeCollectionStorage.set(r,a)}a?.record(e)}batchCumulate(e,r){Array.from(e.entries()).forEach(([o,s,a])=>{let i=this._aggregator.createAccumulation(r);i?.record(s);let n=i;if(this._cumulativeMemoStorage.has(o,a)){let c=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(c,i)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){let c=this._cumulativeMemoStorage.get(o,a);n=this._aggregator.diff(c,i)}if(this._activeCollectionStorage.has(o,a)){let c=this._activeCollectionStorage.get(o,a);n=this._aggregator.merge(c,n)}this._cumulativeMemoStorage.set(o,i,a),this._activeCollectionStorage.set(o,n,a)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new xR.AttributeHashMap,e}};Hm.DeltaMetricProcessor=wR});var UR=p(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.TemporalMetricProcessor=void 0;var cOe=Kh(),uOe=al(),DR=class t{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(e,r){this._aggregator=e,r.forEach(o=>{this._unreportedAccumulations.set(o,[])})}buildMetrics(e,r,o,s){this._stashAccumulations(o);let a=this._getMergedUnreportedAccumulations(e),i=a,n;if(this._reportHistory.has(e)){let u=this._reportHistory.get(e),l=u.collectionTime;n=u.aggregationTemporality,n===cOe.AggregationTemporality.CUMULATIVE?i=t.merge(u.accumulations,a,this._aggregator):i=t.calibrateStartTime(u.accumulations,a,l)}else n=e.selectAggregationTemporality(r.type);this._reportHistory.set(e,{accumulations:i,collectionTime:s,aggregationTemporality:n});let c=lOe(i);if(c.length!==0)return this._aggregator.toMetricData(r,n,c,s)}_stashAccumulations(e){let r=this._unreportedAccumulations.keys();for(let o of r){let s=this._unreportedAccumulations.get(o);s===void 0&&(s=[],this._unreportedAccumulations.set(o,s)),s.push(e)}}_getMergedUnreportedAccumulations(e){let r=new uOe.AttributeHashMap,o=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),o===void 0)return r;for(let s of o)r=t.merge(r,s,this._aggregator);return r}static merge(e,r,o){let s=e,a=r.entries(),i=a.next();for(;i.done!==!0;){let[n,c,u]=i.value;if(e.has(n,u)){let l=e.get(n,u),d=o.merge(l,c);s.set(n,d,u)}else s.set(n,c,u);i=a.next()}return s}static calibrateStartTime(e,r,o){for(let[s,a]of e.keys())r.get(s,a)?.setStartTime(o);return r}};zm.TemporalMetricProcessor=DR;function lOe(t){return Array.from(t.entries())}});var EW=p($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.AsyncMetricStorage=void 0;var dOe=MR(),pOe=LR(),fOe=UR(),hOe=al(),kR=class extends dOe.MetricStorage{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(e,r,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new pOe.DeltaMetricProcessor(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new fOe.TemporalMetricProcessor(r,s)}record(e,r){let o=new hOe.AttributeHashMap;Array.from(e.entries()).forEach(([s,a])=>{o.set(this._attributesProcessor.process(s),a)}),this._deltaMetricStorage.batchCumulate(o,r)}collect(e,r){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,r)}};$m.AsyncMetricStorage=kR});var AW=p(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.getConflictResolutionRecipe=zt.getDescriptionResolutionRecipe=zt.getTypeConflictResolutionRecipe=zt.getUnitConflictResolutionRecipe=zt.getValueTypeConflictResolutionRecipe=zt.getIncompatibilityDetails=void 0;function mOe(t,e){let r="";return t.unit!==e.unit&&(r+=` - Unit '${t.unit}' does not match '${e.unit}'
|
|
4
|
+
`),t.type!==e.type&&(r+=` - Type '${t.type}' does not match '${e.type}'
|
|
5
|
+
`),t.valueType!==e.valueType&&(r+=` - Value Type '${t.valueType}' does not match '${e.valueType}'
|
|
6
|
+
`),t.description!==e.description&&(r+=` - Description '${t.description}' does not match '${e.description}'
|
|
7
|
+
`),r}zt.getIncompatibilityDetails=mOe;function SW(t,e){return` - use valueType '${t.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}zt.getValueTypeConflictResolutionRecipe=SW;function TW(t,e){return` - use unit '${t.unit}' on instrument creation or use an instrument name other than '${e.name}'`}zt.getUnitConflictResolutionRecipe=TW;function yW(t,e){let r={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(r);return` - create a new view with a name other than '${t.name}' and InstrumentSelector '${o}'`}zt.getTypeConflictResolutionRecipe=yW;function vW(t,e){let r={name:e.name,type:e.type,unit:e.unit},o=JSON.stringify(r);return` - create a new view with a name other than '${t.name}' and InstrumentSelector '${o}'
|
|
8
|
+
- OR - create a new view with the name ${t.name} and description '${t.description}' and InstrumentSelector ${o}
|
|
9
|
+
- OR - create a new view with the name ${e.name} and description '${t.description}' and InstrumentSelector ${o}`}zt.getDescriptionResolutionRecipe=vW;function _Oe(t,e){return t.valueType!==e.valueType?SW(t,e):t.unit!==e.unit?TW(t,e):t.type!==e.type?yW(t,e):t.description!==e.description?vW(t,e):""}zt.getConflictResolutionRecipe=_Oe});var bW=p(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.MetricStorageRegistry=void 0;var gOe=sl(),OW=(b(),y(P)),Ym=AW(),BR=class t{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new t}getStorages(e){let r=[];for(let s of this._sharedRegistry.values())r=r.concat(s);let o=this._perCollectorRegistry.get(e);if(o!=null)for(let s of o.values())r=r.concat(s);return r}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,r){let o=this._perCollectorRegistry.get(e);o==null&&(o=new Map,this._perCollectorRegistry.set(e,o)),this._registerStorage(r,o)}findOrUpdateCompatibleStorage(e){let r=this._sharedRegistry.get(e.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(e,r)}findOrUpdateCompatibleCollectorStorage(e,r){let o=this._perCollectorRegistry.get(e);if(o===void 0)return null;let s=o.get(r.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(r,s)}_registerStorage(e,r){let o=e.getInstrumentDescriptor(),s=r.get(o.name);if(s===void 0){r.set(o.name,[e]);return}s.push(e)}_findOrUpdateCompatibleStorage(e,r){let o=null;for(let s of r){let a=s.getInstrumentDescriptor();(0,gOe.isDescriptorCompatibleWith)(a,e)?(a.description!==e.description&&(e.description.length>a.description.length&&s.updateDescription(e.description),OW.diag.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.
|
|
10
|
+
`,`Details:
|
|
11
|
+
`,(0,Ym.getIncompatibilityDetails)(a,e),`The longer description will be used.
|
|
12
|
+
To resolve the conflict:`,(0,Ym.getConflictResolutionRecipe)(a,e))),o=s):OW.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
|
|
13
|
+
`,`Details:
|
|
14
|
+
`,(0,Ym.getIncompatibilityDetails)(a,e),`To resolve the conflict:
|
|
15
|
+
`,(0,Ym.getConflictResolutionRecipe)(a,e))}return o}};Wm.MetricStorageRegistry=BR});var RW=p(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.MultiMetricStorage=void 0;var FR=class{_backingStorages;constructor(e){this._backingStorages=e}record(e,r,o,s){this._backingStorages.forEach(a=>{a.record(e,r,o,s)})}};Km.MultiMetricStorage=FR});var CW=p(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.BatchObservableResultImpl=za.ObservableResultImpl=void 0;var Ha=(b(),y(P)),PW=al(),EOe=Vm(),VR=class{_instrumentName;_valueType;_buffer=new PW.AttributeHashMap;constructor(e,r){this._instrumentName=e,this._valueType=r}observe(e,r={}){if(typeof e!="number"){Ha.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Ha.ValueType.INT&&!Number.isInteger(e)&&(Ha.diag.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)}};za.ObservableResultImpl=VR;var GR=class{_buffer=new Map;observe(e,r,o={}){if(!(0,EOe.isObservableInstrument)(e))return;let s=this._buffer.get(e);if(s==null&&(s=new PW.AttributeHashMap,this._buffer.set(e,s)),typeof r!="number"){Ha.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${r}`);return}e._descriptor.valueType===Ha.ValueType.INT&&!Number.isInteger(r)&&(Ha.diag.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))||s.set(o,r)}};za.BatchObservableResultImpl=GR});var IW=p(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.ObservableRegistry=void 0;var SOe=(b(),y(P)),NW=Vm(),MW=CW(),cl=Gr(),qR=class{_callbacks=[];_batchCallbacks=[];addCallback(e,r){this._findCallback(e,r)>=0||this._callbacks.push({callback:e,instrument:r})}removeCallback(e,r){let o=this._findCallback(e,r);o<0||this._callbacks.splice(o,1)}addBatchCallback(e,r){let o=new Set(r.filter(NW.isObservableInstrument));if(o.size===0){SOe.diag.error("BatchObservableCallback is not associated with valid instruments",r);return}this._findBatchCallback(e,o)>=0||this._batchCallbacks.push({callback:e,instruments:o})}removeBatchCallback(e,r){let o=new Set(r.filter(NW.isObservableInstrument)),s=this._findBatchCallback(e,o);s<0||this._batchCallbacks.splice(s,1)}async observe(e,r){let o=this._observeCallbacks(e,r),s=this._observeBatchCallbacks(e,r);return(await(0,cl.PromiseAllSettled)([...o,...s])).filter(cl.isPromiseAllSettledRejectionResult).map(n=>n.reason)}_observeCallbacks(e,r){return this._callbacks.map(async({callback:o,instrument:s})=>{let a=new MW.ObservableResultImpl(s._descriptor.name,s._descriptor.valueType),i=Promise.resolve(o(a));r!=null&&(i=(0,cl.callWithTimeout)(i,r)),await i,s._metricStorages.forEach(n=>{n.record(a._buffer,e)})})}_observeBatchCallbacks(e,r){return this._batchCallbacks.map(async({callback:o,instruments:s})=>{let a=new MW.BatchObservableResultImpl,i=Promise.resolve(o(a));r!=null&&(i=(0,cl.callWithTimeout)(i,r)),await i,s.forEach(n=>{let c=a._buffer.get(n);c!=null&&n._metricStorages.forEach(u=>{u.record(c,e)})})})}_findCallback(e,r){return this._callbacks.findIndex(o=>o.callback===e&&o.instrument===r)}_findBatchCallback(e,r){return this._batchCallbacks.findIndex(o=>o.callback===e&&(0,cl.setEquals)(o.instruments,r))}};Xm.ObservableRegistry=qR});var xW=p(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.SyncMetricStorage=void 0;var TOe=MR(),yOe=LR(),vOe=UR(),jR=class extends TOe.MetricStorage{_attributesProcessor;_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;constructor(e,r,o,s,a){super(e),this._attributesProcessor=o,this._aggregationCardinalityLimit=a,this._deltaMetricStorage=new yOe.DeltaMetricProcessor(r,this._aggregationCardinalityLimit),this._temporalMetricStorage=new vOe.TemporalMetricProcessor(r,s)}record(e,r,o,s){r=this._attributesProcessor.process(r,o),this._deltaMetricStorage.record(e,r,o,s)}collect(e,r){let o=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,o,r)}};Jm.SyncMetricStorage=jR});var Qm=p(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.createDenyListAttributesProcessor=Rn.createAllowListAttributesProcessor=Rn.createMultiAttributesProcessor=Rn.createNoopAttributesProcessor=void 0;var HR=class{process(e,r){return e}},zR=class{_processors;constructor(e){this._processors=e}process(e,r){let o=e;for(let s of this._processors)o=s.process(o,r);return o}},$R=class{_allowedAttributeNames;constructor(e){this._allowedAttributeNames=e}process(e,r){let o={};return Object.keys(e).filter(s=>this._allowedAttributeNames.includes(s)).forEach(s=>o[s]=e[s]),o}},YR=class{_deniedAttributeNames;constructor(e){this._deniedAttributeNames=e}process(e,r){let o={};return Object.keys(e).filter(s=>!this._deniedAttributeNames.includes(s)).forEach(s=>o[s]=e[s]),o}};function AOe(){return POe}Rn.createNoopAttributesProcessor=AOe;function OOe(t){return new zR(t)}Rn.createMultiAttributesProcessor=OOe;function bOe(t){return new $R(t)}Rn.createAllowListAttributesProcessor=bOe;function ROe(t){return new YR(t)}Rn.createDenyListAttributesProcessor=ROe;var POe=new HR});var wW=p(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.MeterSharedState=void 0;var COe=sl(),NOe=gW(),MOe=Gr(),IOe=EW(),xOe=bW(),wOe=RW(),LOe=IW(),DOe=xW(),UOe=Qm(),WR=class{_meterProviderSharedState;_instrumentationScope;metricStorageRegistry=new xOe.MetricStorageRegistry;observableRegistry=new LOe.ObservableRegistry;meter;constructor(e,r){this._meterProviderSharedState=e,this._instrumentationScope=r,this.meter=new NOe.Meter(this)}registerMetricStorage(e){let r=this._registerMetricStorage(e,DOe.SyncMetricStorage);return r.length===1?r[0]:new wOe.MultiMetricStorage(r)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,IOe.AsyncMetricStorage)}async collect(e,r,o){let s=await this.observableRegistry.observe(r,o?.timeoutMillis),a=this.metricStorageRegistry.getStorages(e);if(a.length===0)return null;let i=a.map(n=>n.collect(e,r)).filter(MOe.isNotNullish);return i.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:i},errors:s}}_registerMetricStorage(e,r){let s=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(a=>{let i=(0,COe.createInstrumentDescriptorWithView)(a,e),n=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(n!=null)return n;let c=a.aggregation.createAggregator(i),u=new r(i,c,a.attributesProcessor,this._meterProviderSharedState.metricCollectors,a.aggregationCardinalityLimit);return this.metricStorageRegistry.register(u),u});if(s.length===0){let i=this._meterProviderSharedState.selectAggregations(e.type).map(([n,c])=>{let u=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(n,e);if(u!=null)return u;let l=c.createAggregator(e),d=n.selectCardinalityLimit(e.type),h=new r(e,l,(0,UOe.createNoopAttributesProcessor)(),[n],d);return this.metricStorageRegistry.registerForCollector(n,h),h});s=s.concat(i)}return s}};Zm.MeterSharedState=WR});var LW=p(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});e_.MeterProviderSharedState=void 0;var kOe=Gr(),BOe=hW(),FOe=wW(),VOe=el(),KR=class{resource;viewRegistry=new BOe.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;constructor(e){this.resource=e}getMeterSharedState(e){let r=(0,kOe.instrumentationScopeId)(e),o=this.meterSharedStates.get(r);return o==null&&(o=new FOe.MeterSharedState(this,e),this.meterSharedStates.set(r,o)),o}selectAggregations(e){let r=[];for(let o of this.metricCollectors)r.push([o,(0,VOe.toAggregation)(o.selectAggregation(e))]);return r}};e_.MeterProviderSharedState=KR});var DW=p(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.MetricCollector=void 0;var GOe=W(),XR=class{_sharedState;_metricReader;constructor(e,r){this._sharedState=e,this._metricReader=r}async collect(e){let r=(0,GOe.millisToHrTime)(Date.now()),o=[],s=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async i=>{let n=await i.collect(this,r,e);n?.scopeMetrics!=null&&o.push(n.scopeMetrics),n?.errors!=null&&s.push(...n.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:o},errors:s}}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}};t_.MetricCollector=XR});var r_=p($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.ExactPredicate=$a.PatternPredicate=void 0;var qOe=/[\^$\\.+?()[\]{}|]/g,JR=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(qOe,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};$a.PatternPredicate=JR;var QR=class{_matchAll;_pattern;constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};$a.ExactPredicate=QR});var kW=p(n_=>{"use strict";Object.defineProperty(n_,"__esModule",{value:!0});n_.InstrumentSelector=void 0;var UW=r_(),ZR=class{_nameFilter;_type;_unitFilter;constructor(e){this._nameFilter=new UW.PatternPredicate(e?.name??"*"),this._type=e?.type,this._unitFilter=new UW.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};n_.InstrumentSelector=ZR});var BW=p(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});i_.MeterSelector=void 0;var eP=r_(),tP=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(e){this._nameFilter=new eP.ExactPredicate(e?.name),this._versionFilter=new eP.ExactPredicate(e?.version),this._schemaUrlFilter=new eP.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};i_.MeterSelector=tP});var GW=p(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});o_.View=void 0;var jOe=r_(),FW=Qm(),HOe=kW(),zOe=BW(),VW=el();function $Oe(t){return t.instrumentName==null&&t.instrumentType==null&&t.instrumentUnit==null&&t.meterName==null&&t.meterVersion==null&&t.meterSchemaUrl==null}function YOe(t){if($Oe(t))throw new Error("Cannot create view with no selector arguments supplied");if(t.name!=null&&(t?.instrumentName==null||jOe.PatternPredicate.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 rP=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(e){YOe(e),e.attributesProcessors!=null?this.attributesProcessor=(0,FW.createMultiAttributesProcessor)(e.attributesProcessors):this.attributesProcessor=(0,FW.createNoopAttributesProcessor)(),this.name=e.name,this.description=e.description,this.aggregation=(0,VW.toAggregation)(e.aggregation??{type:VW.AggregationType.DEFAULT}),this.instrumentSelector=new HOe.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new zOe.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}};o_.View=rP});var qW=p(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});a_.MeterProvider=void 0;var s_=(b(),y(P)),WOe=fW(),KOe=LW(),XOe=DW(),JOe=GW(),nP=class{_sharedState;_shutdown=!1;constructor(e){if(this._sharedState=new KOe.MeterProviderSharedState(e?.resource??(0,WOe.defaultResource)()),e?.views!=null&&e.views.length>0)for(let r of e.views)this._sharedState.viewRegistry.addView(new JOe.View(r));if(e?.readers!=null&&e.readers.length>0)for(let r of e.readers){let o=new XOe.MetricCollector(this._sharedState,r);r.setMetricProducer(o),this._sharedState.metricCollectors.push(o)}}getMeter(e,r="",o={}){return this._shutdown?(s_.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,s_.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:r,schemaUrl:o.schemaUrl}).meter}async shutdown(e){if(this._shutdown){s_.diag.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){s_.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(r=>r.forceFlush(e)))}};a_.MeterProvider=nP});var Ei=p(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.TimeoutError=ye.createDenyListAttributesProcessor=ye.createAllowListAttributesProcessor=ye.AggregationType=ye.MeterProvider=ye.ConsoleMetricExporter=ye.InMemoryMetricExporter=ye.PeriodicExportingMetricReader=ye.MetricReader=ye.InstrumentType=ye.DataPointType=ye.AggregationTemporality=void 0;var QOe=Kh();Object.defineProperty(ye,"AggregationTemporality",{enumerable:!0,get:function(){return QOe.AggregationTemporality}});var jW=Ki();Object.defineProperty(ye,"DataPointType",{enumerable:!0,get:function(){return jW.DataPointType}});Object.defineProperty(ye,"InstrumentType",{enumerable:!0,get:function(){return jW.InstrumentType}});var ZOe=rR();Object.defineProperty(ye,"MetricReader",{enumerable:!0,get:function(){return ZOe.MetricReader}});var ebe=DY();Object.defineProperty(ye,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return ebe.PeriodicExportingMetricReader}});var tbe=kY();Object.defineProperty(ye,"InMemoryMetricExporter",{enumerable:!0,get:function(){return tbe.InMemoryMetricExporter}});var rbe=FY();Object.defineProperty(ye,"ConsoleMetricExporter",{enumerable:!0,get:function(){return rbe.ConsoleMetricExporter}});var nbe=qW();Object.defineProperty(ye,"MeterProvider",{enumerable:!0,get:function(){return nbe.MeterProvider}});var ibe=el();Object.defineProperty(ye,"AggregationType",{enumerable:!0,get:function(){return ibe.AggregationType}});var HW=Qm();Object.defineProperty(ye,"createAllowListAttributesProcessor",{enumerable:!0,get:function(){return HW.createAllowListAttributesProcessor}});Object.defineProperty(ye,"createDenyListAttributesProcessor",{enumerable:!0,get:function(){return HW.createDenyListAttributesProcessor}});var obe=Gr();Object.defineProperty(ye,"TimeoutError",{enumerable:!0,get:function(){return obe.TimeoutError}})});var oP=p(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.AbstractAsyncHooksContextManager=void 0;var sbe=require("events"),abe=["addListener","on","once","prependListener","prependOnceListener"],iP=class{bind(e,r){return r instanceof sbe.EventEmitter?this._bindEventEmitter(e,r):typeof r=="function"?this._bindFunction(e,r):r}_bindFunction(e,r){let o=this,s=function(...a){return o.with(e,()=>r.apply(this,a))};return Object.defineProperty(s,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),s}_bindEventEmitter(e,r){return this._getPatchMap(r)!==void 0||(this._createPatchMap(r),abe.forEach(s=>{r[s]!==void 0&&(r[s]=this._patchAddListener(r,r[s],e))}),typeof r.removeListener=="function"&&(r.removeListener=this._patchRemoveListener(r,r.removeListener)),typeof r.off=="function"&&(r.off=this._patchRemoveListener(r,r.off)),typeof r.removeAllListeners=="function"&&(r.removeAllListeners=this._patchRemoveAllListeners(r,r.removeAllListeners))),r}_patchRemoveListener(e,r){let o=this;return function(s,a){let i=o._getPatchMap(e)?.[s];if(i===void 0)return r.call(this,s,a);let n=i.get(a);return r.call(this,s,n||a)}}_patchRemoveAllListeners(e,r){let o=this;return function(s){let a=o._getPatchMap(e);return a!==void 0&&(arguments.length===0?o._createPatchMap(e):a[s]!==void 0&&delete a[s]),r.apply(this,arguments)}}_patchAddListener(e,r,o){let s=this;return function(a,i){if(s._wrapped)return r.call(this,a,i);let n=s._getPatchMap(e);n===void 0&&(n=s._createPatchMap(e));let c=n[a];c===void 0&&(c=new WeakMap,n[a]=c);let u=s.bind(o,i);c.set(i,u),s._wrapped=!0;try{return r.call(this,a,u)}finally{s._wrapped=!1}}}_createPatchMap(e){let r=Object.create(null);return e[this._kOtListeners]=r,r}_getPatchMap(e){return e[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1};c_.AbstractAsyncHooksContextManager=iP});var zW=p(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});u_.AsyncHooksContextManager=void 0;var cbe=(b(),y(P)),ube=require("async_hooks"),lbe=oP(),sP=class extends lbe.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super(),this._asyncHook=ube.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){return this._stack[this._stack.length-1]??cbe.ROOT_CONTEXT}with(e,r,o,...s){this._enterContext(e);try{return r.call(o,...s)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,r){if(r==="TIMERWRAP")return;let o=this._stack[this._stack.length-1];o!==void 0&&this._contexts.set(e,o)}_destroy(e){this._contexts.delete(e)}_before(e){let r=this._contexts.get(e);r!==void 0&&this._enterContext(r)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};u_.AsyncHooksContextManager=sP});var $W=p(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});l_.AsyncLocalStorageContextManager=void 0;var dbe=(b(),y(P)),pbe=require("async_hooks"),fbe=oP(),aP=class extends fbe.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super(),this._asyncLocalStorage=new pbe.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??dbe.ROOT_CONTEXT}with(e,r,o,...s){let a=o==null?r:r.bind(o);return this._asyncLocalStorage.run(e,a,...s)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};l_.AsyncLocalStorageContextManager=aP});var YW=p(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.AsyncLocalStorageContextManager=Ya.AsyncHooksContextManager=void 0;var hbe=zW();Object.defineProperty(Ya,"AsyncHooksContextManager",{enumerable:!0,get:function(){return hbe.AsyncHooksContextManager}});var mbe=$W();Object.defineProperty(Ya,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return mbe.AsyncLocalStorageContextManager}})});var WW=p(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});d_.defaultServiceName=void 0;function _be(){return`unknown_service:${process.argv0}`}d_.defaultServiceName=_be});var KW=p(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.defaultServiceName=void 0;var gbe=WW();Object.defineProperty(p_,"defaultServiceName",{enumerable:!0,get:function(){return gbe.defaultServiceName}})});var cP=p(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});f_.defaultServiceName=void 0;var Ebe=KW();Object.defineProperty(f_,"defaultServiceName",{enumerable:!0,get:function(){return Ebe.defaultServiceName}})});var XW=p(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.identity=Wa.isPromiseLike=void 0;var Sbe=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";Wa.isPromiseLike=Sbe;function Tbe(t){return t}Wa.identity=Tbe});var dP=p(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.defaultResource=Pn.emptyResource=Pn.resourceFromDetectedResource=Pn.resourceFromAttributes=void 0;var ll=(b(),y(P)),uP=W(),rs=(yt(),y(Dt)),ybe=cP(),ul=XW(),h_=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let o=new t({},r);return o._rawAttributes=JW(e),o._asyncAttributesPending=e.filter(([s,a])=>(0,ul.isPromiseLike)(a)).length>0,o}constructor(e,r){let o=e.attributes??{};this._rawAttributes=Object.entries(o).map(([s,a])=>((0,ul.isPromiseLike)(a)&&(this._asyncAttributesPending=!0),[s,a])),this._rawAttributes=JW(this._rawAttributes),this._schemaUrl=bbe(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,o]=this._rawAttributes[e];this._rawAttributes[e]=[r,(0,ul.isPromiseLike)(o)?await o:o]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&ll.diag.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,o]of this._rawAttributes){if((0,ul.isPromiseLike)(o)){ll.diag.debug(`Unsettled resource attribute ${r} skipped`);continue}o!=null&&(e[r]??=o)}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=Rbe(this,e),o=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}};function lP(t,e){return h_.FromAttributeList(Object.entries(t),e)}Pn.resourceFromAttributes=lP;function vbe(t,e){return new h_(t,e)}Pn.resourceFromDetectedResource=vbe;function Abe(){return lP({})}Pn.emptyResource=Abe;function Obe(){return lP({[rs.ATTR_SERVICE_NAME]:(0,ybe.defaultServiceName)(),[rs.ATTR_TELEMETRY_SDK_LANGUAGE]:uP.SDK_INFO[rs.ATTR_TELEMETRY_SDK_LANGUAGE],[rs.ATTR_TELEMETRY_SDK_NAME]:uP.SDK_INFO[rs.ATTR_TELEMETRY_SDK_NAME],[rs.ATTR_TELEMETRY_SDK_VERSION]:uP.SDK_INFO[rs.ATTR_TELEMETRY_SDK_VERSION]})}Pn.defaultResource=Obe;function JW(t){return t.map(([e,r])=>(0,ul.isPromiseLike)(r)?[e,r.catch(o=>{ll.diag.debug("promise rejection for resource attribute: %s - %s",e,o)})]:[e,r])}function bbe(t){if(typeof t=="string"||t===void 0)return t;ll.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function Rbe(t,e){let r=t?.schemaUrl,o=e?.schemaUrl,s=r===void 0||r==="",a=o===void 0||o==="";if(s)return o;if(a||r===o)return r;ll.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,o)}});var ZW=p(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});m_.detectResources=void 0;var QW=(b(),y(P)),pP=dP(),Pbe=(t={})=>(t.detectors||[]).map(r=>{try{let o=(0,pP.resourceFromDetectedResource)(r.detect(t));return QW.diag.debug(`${r.constructor.name} found resource.`,o),o}catch(o){return QW.diag.debug(`${r.constructor.name} failed: ${o.message}`),(0,pP.emptyResource)()}}).reduce((r,o)=>r.merge(o),(0,pP.emptyResource)());m_.detectResources=Pbe});var tK=p(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});__.envDetector=void 0;var Cbe=(b(),y(P)),Nbe=(yt(),y(Dt)),eK=W(),fP=class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";_ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.";_ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters.";detect(e){let r={},o=(0,eK.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),s=(0,eK.getStringFromEnv)("OTEL_SERVICE_NAME");if(o)try{let a=this._parseResourceAttributes(o);Object.assign(r,a)}catch(a){Cbe.diag.debug(`EnvDetector failed: ${a.message}`)}return s&&(r[Nbe.ATTR_SERVICE_NAME]=s),{attributes:r}}_parseResourceAttributes(e){if(!e)return{};let r={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);r[i]=decodeURIComponent(n)}return r}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o<33||o===44||o===59||o===92||o>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};__.envDetector=new fP});var dl=p(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.ATTR_WEBENGINE_VERSION=V.ATTR_WEBENGINE_NAME=V.ATTR_WEBENGINE_DESCRIPTION=V.ATTR_SERVICE_NAMESPACE=V.ATTR_SERVICE_INSTANCE_ID=V.ATTR_PROCESS_RUNTIME_VERSION=V.ATTR_PROCESS_RUNTIME_NAME=V.ATTR_PROCESS_RUNTIME_DESCRIPTION=V.ATTR_PROCESS_PID=V.ATTR_PROCESS_OWNER=V.ATTR_PROCESS_EXECUTABLE_PATH=V.ATTR_PROCESS_EXECUTABLE_NAME=V.ATTR_PROCESS_COMMAND_ARGS=V.ATTR_PROCESS_COMMAND=V.ATTR_OS_VERSION=V.ATTR_OS_TYPE=V.ATTR_K8S_POD_NAME=V.ATTR_K8S_NAMESPACE_NAME=V.ATTR_K8S_DEPLOYMENT_NAME=V.ATTR_K8S_CLUSTER_NAME=V.ATTR_HOST_TYPE=V.ATTR_HOST_NAME=V.ATTR_HOST_IMAGE_VERSION=V.ATTR_HOST_IMAGE_NAME=V.ATTR_HOST_IMAGE_ID=V.ATTR_HOST_ID=V.ATTR_HOST_ARCH=V.ATTR_CONTAINER_NAME=V.ATTR_CONTAINER_IMAGE_TAGS=V.ATTR_CONTAINER_IMAGE_NAME=V.ATTR_CONTAINER_ID=V.ATTR_CLOUD_REGION=V.ATTR_CLOUD_PROVIDER=V.ATTR_CLOUD_AVAILABILITY_ZONE=V.ATTR_CLOUD_ACCOUNT_ID=void 0;V.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";V.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";V.ATTR_CLOUD_PROVIDER="cloud.provider";V.ATTR_CLOUD_REGION="cloud.region";V.ATTR_CONTAINER_ID="container.id";V.ATTR_CONTAINER_IMAGE_NAME="container.image.name";V.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";V.ATTR_CONTAINER_NAME="container.name";V.ATTR_HOST_ARCH="host.arch";V.ATTR_HOST_ID="host.id";V.ATTR_HOST_IMAGE_ID="host.image.id";V.ATTR_HOST_IMAGE_NAME="host.image.name";V.ATTR_HOST_IMAGE_VERSION="host.image.version";V.ATTR_HOST_NAME="host.name";V.ATTR_HOST_TYPE="host.type";V.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";V.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";V.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";V.ATTR_K8S_POD_NAME="k8s.pod.name";V.ATTR_OS_TYPE="os.type";V.ATTR_OS_VERSION="os.version";V.ATTR_PROCESS_COMMAND="process.command";V.ATTR_PROCESS_COMMAND_ARGS="process.command_args";V.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";V.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";V.ATTR_PROCESS_OWNER="process.owner";V.ATTR_PROCESS_PID="process.pid";V.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";V.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";V.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";V.ATTR_SERVICE_INSTANCE_ID="service.instance.id";V.ATTR_SERVICE_NAMESPACE="service.namespace";V.ATTR_WEBENGINE_DESCRIPTION="webengine.description";V.ATTR_WEBENGINE_NAME="webengine.name";V.ATTR_WEBENGINE_VERSION="webengine.version"});var E_=p(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.execAsync=void 0;var Mbe=require("child_process"),Ibe=require("util");g_.execAsync=Ibe.promisify(Mbe.exec)});var rK=p(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});S_.getMachineId=void 0;var xbe=E_(),wbe=(b(),y(P));async function Lbe(){try{let e=(await(0,xbe.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
|
|
16
|
+
`).find(o=>o.includes("IOPlatformUUID"));if(!e)return;let r=e.split('" = "');if(r.length===2)return r[1].slice(0,-1)}catch(t){wbe.diag.debug(`error reading machine id: ${t}`)}}S_.getMachineId=Lbe});var nK=p(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});T_.getMachineId=void 0;var Dbe=require("fs"),Ube=(b(),y(P));async function kbe(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await Dbe.promises.readFile(e,{encoding:"utf8"})).trim()}catch(r){Ube.diag.debug(`error reading machine id: ${r}`)}}T_.getMachineId=kbe});var oK=p(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});y_.getMachineId=void 0;var Bbe=require("fs"),Fbe=E_(),iK=(b(),y(P));async function Vbe(){try{return(await Bbe.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){iK.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,Fbe.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){iK.diag.debug(`error reading machine id: ${t}`)}}y_.getMachineId=Vbe});var aK=p(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.getMachineId=void 0;var sK=require("process"),Gbe=E_(),qbe=(b(),y(P));async function jbe(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";sK.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in sK.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let o=(await(0,Gbe.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(r){qbe.diag.debug(`error reading machine id: ${r}`)}}v_.getMachineId=jbe});var cK=p(A_=>{"use strict";Object.defineProperty(A_,"__esModule",{value:!0});A_.getMachineId=void 0;var Hbe=(b(),y(P));async function zbe(){Hbe.diag.debug("could not read machine-id: unsupported platform")}A_.getMachineId=zbe});var uK=p(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.getMachineId=void 0;var $be=require("process"),ns;async function Ybe(){if(!ns)switch($be.platform){case"darwin":ns=(await Promise.resolve().then(()=>J(rK()))).getMachineId;break;case"linux":ns=(await Promise.resolve().then(()=>J(nK()))).getMachineId;break;case"freebsd":ns=(await Promise.resolve().then(()=>J(oK()))).getMachineId;break;case"win32":ns=(await Promise.resolve().then(()=>J(aK()))).getMachineId;break;default:ns=(await Promise.resolve().then(()=>J(cK()))).getMachineId;break}return ns()}O_.getMachineId=Ybe});var hP=p(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.normalizeType=Ka.normalizeArch=void 0;var Wbe=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};Ka.normalizeArch=Wbe;var Kbe=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};Ka.normalizeType=Kbe});var dK=p(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});b_.hostDetector=void 0;var mP=dl(),lK=require("os"),Xbe=uK(),Jbe=hP(),_P=class{detect(e){return{attributes:{[mP.ATTR_HOST_NAME]:(0,lK.hostname)(),[mP.ATTR_HOST_ARCH]:(0,Jbe.normalizeArch)((0,lK.arch)()),[mP.ATTR_HOST_ID]:(0,Xbe.getMachineId)()}}}};b_.hostDetector=new _P});var hK=p(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});R_.osDetector=void 0;var pK=dl(),fK=require("os"),Qbe=hP(),gP=class{detect(e){return{attributes:{[pK.ATTR_OS_TYPE]:(0,Qbe.normalizeType)((0,fK.platform)()),[pK.ATTR_OS_VERSION]:(0,fK.release)()}}}};R_.osDetector=new gP});var mK=p(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});P_.processDetector=void 0;var Zbe=(b(),y(P)),Si=dl(),eRe=require("os"),EP=class{detect(e){let r={[Si.ATTR_PROCESS_PID]:process.pid,[Si.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[Si.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[Si.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Si.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[Si.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[Si.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(r[Si.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let o=eRe.userInfo();r[Si.ATTR_PROCESS_OWNER]=o.username}catch(o){Zbe.diag.debug(`error obtaining process owner: ${o}`)}return{attributes:r}}};P_.processDetector=new EP});var _K=p(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.serviceInstanceIdDetector=void 0;var tRe=dl(),rRe=require("crypto"),SP=class{detect(e){return{attributes:{[tRe.ATTR_SERVICE_INSTANCE_ID]:(0,rRe.randomUUID)()}}}};C_.serviceInstanceIdDetector=new SP});var gK=p(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.serviceInstanceIdDetector=Cn.processDetector=Cn.osDetector=Cn.hostDetector=void 0;var nRe=dK();Object.defineProperty(Cn,"hostDetector",{enumerable:!0,get:function(){return nRe.hostDetector}});var iRe=hK();Object.defineProperty(Cn,"osDetector",{enumerable:!0,get:function(){return iRe.osDetector}});var oRe=mK();Object.defineProperty(Cn,"processDetector",{enumerable:!0,get:function(){return oRe.processDetector}});var sRe=_K();Object.defineProperty(Cn,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return sRe.serviceInstanceIdDetector}})});var EK=p(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.serviceInstanceIdDetector=Nn.processDetector=Nn.osDetector=Nn.hostDetector=void 0;var N_=gK();Object.defineProperty(Nn,"hostDetector",{enumerable:!0,get:function(){return N_.hostDetector}});Object.defineProperty(Nn,"osDetector",{enumerable:!0,get:function(){return N_.osDetector}});Object.defineProperty(Nn,"processDetector",{enumerable:!0,get:function(){return N_.processDetector}});Object.defineProperty(Nn,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return N_.serviceInstanceIdDetector}})});var SK=p(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.noopDetector=Xa.NoopDetector=void 0;var M_=class{detect(){return{attributes:{}}}};Xa.NoopDetector=M_;Xa.noopDetector=new M_});var TK=p($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.noopDetector=$t.serviceInstanceIdDetector=$t.processDetector=$t.osDetector=$t.hostDetector=$t.envDetector=void 0;var aRe=tK();Object.defineProperty($t,"envDetector",{enumerable:!0,get:function(){return aRe.envDetector}});var I_=EK();Object.defineProperty($t,"hostDetector",{enumerable:!0,get:function(){return I_.hostDetector}});Object.defineProperty($t,"osDetector",{enumerable:!0,get:function(){return I_.osDetector}});Object.defineProperty($t,"processDetector",{enumerable:!0,get:function(){return I_.processDetector}});Object.defineProperty($t,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return I_.serviceInstanceIdDetector}});var cRe=SK();Object.defineProperty($t,"noopDetector",{enumerable:!0,get:function(){return cRe.noopDetector}})});var yK=p(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.defaultServiceName=xe.emptyResource=xe.defaultResource=xe.resourceFromAttributes=xe.serviceInstanceIdDetector=xe.processDetector=xe.osDetector=xe.hostDetector=xe.envDetector=xe.detectResources=void 0;var uRe=ZW();Object.defineProperty(xe,"detectResources",{enumerable:!0,get:function(){return uRe.detectResources}});var pl=TK();Object.defineProperty(xe,"envDetector",{enumerable:!0,get:function(){return pl.envDetector}});Object.defineProperty(xe,"hostDetector",{enumerable:!0,get:function(){return pl.hostDetector}});Object.defineProperty(xe,"osDetector",{enumerable:!0,get:function(){return pl.osDetector}});Object.defineProperty(xe,"processDetector",{enumerable:!0,get:function(){return pl.processDetector}});Object.defineProperty(xe,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return pl.serviceInstanceIdDetector}});var TP=dP();Object.defineProperty(xe,"resourceFromAttributes",{enumerable:!0,get:function(){return TP.resourceFromAttributes}});Object.defineProperty(xe,"defaultResource",{enumerable:!0,get:function(){return TP.defaultResource}});Object.defineProperty(xe,"emptyResource",{enumerable:!0,get:function(){return TP.emptyResource}});var lRe=cP();Object.defineProperty(xe,"defaultServiceName",{enumerable:!0,get:function(){return lRe.defaultServiceName}})});var vK=p(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});x_.ExceptionEventName=void 0;x_.ExceptionEventName="exception"});var AK=p(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.SpanImpl=void 0;var Er=(b(),y(P)),At=W(),is=(yt(),y(Dt)),dRe=vK(),yP=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:Er.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let r=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=At.otperformance.now(),this._performanceOffset=r-(this._performanceStartTime+(0,At.getTimeOrigin)()),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??r),this.resource=e.resource,this.instrumentationScope=e.scope,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,r){if(r==null||this._isSpanEnded())return this;if(e.length===0)return Er.diag.warn(`Invalid attribute key: ${e}`),this;if(!(0,At.isAttributeValue)(r))return Er.diag.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:o}=this._spanLimits;return o!==void 0&&Object.keys(this.attributes).length>=o&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this)}setAttributes(e){for(let[r,o]of Object.entries(e))this.setAttribute(r,o);return this}addEvent(e,r,o){if(this._isSpanEnded())return this;let{eventCountLimit:s}=this._spanLimits;if(s===0)return Er.diag.warn("No events allowed."),this._droppedEventsCount++,this;s!==void 0&&this.events.length>=s&&(this._droppedEventsCount===0&&Er.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,At.isTimeInput)(r)&&((0,At.isTimeInput)(o)||(o=r),r=void 0);let a=(0,At.sanitizeAttributes)(r);return this.events.push({name:e,attributes:a,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status={...e},this.status.message!=null&&typeof e.message!="string"&&(Er.diag.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Er.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,At.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(Er.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Er.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=At.otperformance.now())return(0,At.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,At.millisToHrTime)(e);if(e instanceof Date)return(0,At.millisToHrTime)(e.getTime());if((0,At.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,At.millisToHrTime)(Date.now());let r=At.otperformance.now()-this._performanceStartTime;return(0,At.addHrTimes)(this.startTime,(0,At.millisToHrTime)(r))}isRecording(){return this._ended===!1}recordException(e,r){let o={};typeof e=="string"?o[is.ATTR_EXCEPTION_MESSAGE]=e:e&&(e.code?o[is.ATTR_EXCEPTION_TYPE]=e.code.toString():e.name&&(o[is.ATTR_EXCEPTION_TYPE]=e.name),e.message&&(o[is.ATTR_EXCEPTION_MESSAGE]=e.message),e.stack&&(o[is.ATTR_EXCEPTION_STACKTRACE]=e.stack)),o[is.ATTR_EXCEPTION_TYPE]||o[is.ATTR_EXCEPTION_MESSAGE]?this.addEvent(dRe.ExceptionEventName,o,r):Er.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Er.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_truncateToSize(e){let r=this._attributeValueLengthLimit;return r<=0?(Er.diag.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,r):o):e}};w_.SpanImpl=yP});var hl=p(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.SamplingDecision=void 0;var pRe;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(pRe=fl.SamplingDecision||(fl.SamplingDecision={}))});var D_=p(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});L_.AlwaysOffSampler=void 0;var fRe=hl(),vP=class{shouldSample(){return{decision:fRe.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};L_.AlwaysOffSampler=vP});var k_=p(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});U_.AlwaysOnSampler=void 0;var hRe=hl(),AP=class{shouldSample(){return{decision:hRe.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};U_.AlwaysOnSampler=AP});var RP=p(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.ParentBasedSampler=void 0;var B_=(b(),y(P)),mRe=W(),OK=D_(),OP=k_(),bP=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||((0,mRe.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new OP.AlwaysOnSampler),this._remoteParentSampled=e.remoteParentSampled??new OP.AlwaysOnSampler,this._remoteParentNotSampled=e.remoteParentNotSampled??new OK.AlwaysOffSampler,this._localParentSampled=e.localParentSampled??new OP.AlwaysOnSampler,this._localParentNotSampled=e.localParentNotSampled??new OK.AlwaysOffSampler}shouldSample(e,r,o,s,a,i){let n=B_.trace.getSpanContext(e);return!n||!(0,B_.isSpanContextValid)(n)?this._root.shouldSample(e,r,o,s,a,i):n.isRemote?n.traceFlags&B_.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,r,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,r,o,s,a,i):n.traceFlags&B_.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,r,o,s,a,i):this._localParentNotSampled.shouldSample(e,r,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};F_.ParentBasedSampler=bP});var CP=p(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});V_.TraceIdRatioBasedSampler=void 0;var _Re=(b(),y(P)),bK=hl(),PP=class{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,r){return{decision:(0,_Re.isValidTraceId)(r)&&this._accumulate(r)<this._upperBound?bK.SamplingDecision.RECORD_AND_SAMPLED:bK.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let r=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);r=(r^a)>>>0}return r}};V_.TraceIdRatioBasedSampler=PP});var IP=p(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.buildSamplerFromEnv=Ja.loadDefaultConfig=void 0;var MP=(b(),y(P)),Mn=W(),RK=D_(),NP=k_(),G_=RP(),PK=CP(),In;(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(In||(In={}));var q_=1;function gRe(){return{sampler:NK(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,Mn.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,Mn.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,Mn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,Mn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,Mn.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,Mn.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,Mn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,Mn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}Ja.loadDefaultConfig=gRe;function NK(){let t=(0,Mn.getStringFromEnv)("OTEL_TRACES_SAMPLER")??In.ParentBasedAlwaysOn;switch(t){case In.AlwaysOn:return new NP.AlwaysOnSampler;case In.AlwaysOff:return new RK.AlwaysOffSampler;case In.ParentBasedAlwaysOn:return new G_.ParentBasedSampler({root:new NP.AlwaysOnSampler});case In.ParentBasedAlwaysOff:return new G_.ParentBasedSampler({root:new RK.AlwaysOffSampler});case In.TraceIdRatio:return new PK.TraceIdRatioBasedSampler(CK());case In.ParentBasedTraceIdRatio:return new G_.ParentBasedSampler({root:new PK.TraceIdRatioBasedSampler(CK())});default:return MP.diag.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${In.ParentBasedAlwaysOn}".`),new G_.ParentBasedSampler({root:new NP.AlwaysOnSampler})}}Ja.buildSamplerFromEnv=NK;function CK(){let t=(0,Mn.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");return t==null?(MP.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${q_}.`),q_):t<0||t>1?(MP.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t} was given, but it is out of range ([0..1]), defaulting to ${q_}.`),q_):t}});var xP=p(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.reconfigureLimits=Sr.mergeConfig=Sr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=Sr.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var MK=IP(),j_=W();Sr.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;Sr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function ERe(t){let e={sampler:(0,MK.buildSamplerFromEnv)()},r=(0,MK.loadDefaultConfig)(),o=Object.assign({},r,e,t);return o.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),o.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),o}Sr.mergeConfig=ERe;function SRe(t){let e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??(0,j_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,j_.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??Sr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??(0,j_.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,j_.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Sr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},t,{spanLimits:e})}Sr.reconfigureLimits=SRe});var IK=p(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.BatchSpanProcessorBase=void 0;var Qa=(b(),y(P)),xn=W(),wP=class{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,r){this._exporter=e,this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:(0,xn.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:(0,xn.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:(0,xn.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:(0,xn.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new xn.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Qa.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,r){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Qa.TraceFlags.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Qa.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Qa.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,r)=>{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a<i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,r)=>{let o=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);Qa.context.with((0,xn.suppressTracing)(Qa.context.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=>this._exporter.export(s,n=>{clearTimeout(o),n.code===xn.ExportResultCode.SUCCESS?e():r(n.error??new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let n=0,c=s.length;n<c;n++){let u=s[n];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(i??=[],i.push(u.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=>{(0,xn.globalErrorHandler)(n),r(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,(0,xn.globalErrorHandler)(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,xn.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};H_.BatchSpanProcessorBase=wP});var xK=p(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});z_.BatchSpanProcessor=void 0;var TRe=IK(),LP=class extends TRe.BatchSpanProcessorBase{onShutdown(){}};z_.BatchSpanProcessor=LP});var DK=p(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});Y_.RandomIdGenerator=void 0;var yRe=8,LK=16,DP=class{generateTraceId=wK(LK);generateSpanId=wK(yRe)};Y_.RandomIdGenerator=DP;var $_=Buffer.allocUnsafe(LK);function wK(t){return function(){for(let r=0;r<t/4;r++)$_.writeUInt32BE(Math.random()*2**32>>>0,r*4);for(let r=0;r<t&&!($_[r]>0);r++)r===t-1&&($_[t-1]=1);return $_.toString("hex",0,t)}}});var UK=p(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.RandomIdGenerator=Za.BatchSpanProcessor=void 0;var vRe=xK();Object.defineProperty(Za,"BatchSpanProcessor",{enumerable:!0,get:function(){return vRe.BatchSpanProcessor}});var ARe=DK();Object.defineProperty(Za,"RandomIdGenerator",{enumerable:!0,get:function(){return ARe.RandomIdGenerator}})});var UP=p(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.RandomIdGenerator=ec.BatchSpanProcessor=void 0;var kK=UK();Object.defineProperty(ec,"BatchSpanProcessor",{enumerable:!0,get:function(){return kK.BatchSpanProcessor}});Object.defineProperty(ec,"RandomIdGenerator",{enumerable:!0,get:function(){return kK.RandomIdGenerator}})});var BK=p(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});K_.Tracer=void 0;var dt=(b(),y(P)),W_=W(),ORe=AK(),bRe=xP(),RRe=UP(),kP=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,o,s){let a=(0,bRe.mergeConfig)(r);this._sampler=a.sampler,this._generalLimits=a.generalLimits,this._spanLimits=a.spanLimits,this._idGenerator=r.idGenerator||new RRe.RandomIdGenerator,this._resource=o,this._spanProcessor=s,this.instrumentationScope=e}startSpan(e,r={},o=dt.context.active()){r.root&&(o=dt.trace.deleteSpan(o));let s=dt.trace.getSpan(o);if((0,W_.isTracingSuppressed)(o))return dt.diag.debug("Instrumentation suppressed, returning Noop Span"),dt.trace.wrapSpanContext(dt.INVALID_SPAN_CONTEXT);let a=s?.spanContext(),i=this._idGenerator.generateSpanId(),n,c,u;!a||!dt.trace.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,n=a);let l=r.kind??dt.SpanKind.INTERNAL,d=(r.links??[]).map(I=>({context:I.context,attributes:(0,W_.sanitizeAttributes)(I.attributes)})),h=(0,W_.sanitizeAttributes)(r.attributes),g=this._sampler.shouldSample(o,c,e,l,h,d);u=g.traceState??u;let E=g.decision===dt.SamplingDecision.RECORD_AND_SAMPLED?dt.TraceFlags.SAMPLED:dt.TraceFlags.NONE,S={traceId:c,spanId:i,traceFlags:E,traceState:u};if(g.decision===dt.SamplingDecision.NOT_RECORD)return dt.diag.debug("Recording is off, propagating context in a non-recording span"),dt.trace.wrapSpanContext(S);let v=(0,W_.sanitizeAttributes)(Object.assign(h,g.attributes));return new ORe.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:o,spanContext:S,name:e,kind:l,links:d,parentSpanContext:n,attributes:v,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,r,o,s){let a,i,n;if(arguments.length<2)return;arguments.length===2?n=r:arguments.length===3?(a=r,n=o):(a=r,i=o,n=s);let c=i??dt.context.active(),u=this.startSpan(e,a,c),l=dt.trace.setSpan(c,u);return dt.context.with(l,n,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};K_.Tracer=kP});var FK=p(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.MultiSpanProcessor=void 0;var PRe=W(),BP=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let r of this._spanProcessors)e.push(r.forceFlush());return new Promise(r=>{Promise.all(e).then(()=>{r()}).catch(o=>{(0,PRe.globalErrorHandler)(o||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(e,r){for(let o of this._spanProcessors)o.onStart(e,r)}onEnd(e){for(let r of this._spanProcessors)r.onEnd(e)}shutdown(){let e=[];for(let r of this._spanProcessors)e.push(r.shutdown());return new Promise((r,o)=>{Promise.all(e).then(()=>{r()},o)})}};X_.MultiSpanProcessor=BP});var VK=p(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.BasicTracerProvider=os.ForceFlushState=void 0;var CRe=W(),NRe=yK(),MRe=BK(),IRe=IP(),xRe=FK(),wRe=xP(),tc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(tc=os.ForceFlushState||(os.ForceFlushState={}));var FP=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let r=(0,CRe.merge)({},(0,IRe.loadDefaultConfig)(),(0,wRe.reconfigureLimits)(e));this._resource=r.resource??(0,NRe.defaultResource)(),this._config=Object.assign({},r,{resource:this._resource});let o=[];e.spanProcessors?.length&&o.push(...e.spanProcessors),this._activeSpanProcessor=new xRe.MultiSpanProcessor(o)}getTracer(e,r,o){let s=`${e}@${r||""}:${o?.schemaUrl||""}`;return this._tracers.has(s)||this._tracers.set(s,new MRe.Tracer({name:e,version:r,schemaUrl:o?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(s)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(o=>new Promise(s=>{let a,i=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=tc.timeout},e);o.forceFlush().then(()=>{clearTimeout(i),a!==tc.timeout&&(a=tc.resolved,s(a))}).catch(n=>{clearTimeout(i),a=tc.error,s(n)})}));return new Promise((o,s)=>{Promise.all(r).then(a=>{let i=a.filter(n=>n!==tc.resolved);i.length>0?s(i):o()}).catch(a=>s([a]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};os.BasicTracerProvider=FP});var GK=p(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});J_.ConsoleSpanExporter=void 0;var VP=W(),GP=class{export(e,r){return this._sendSpans(e,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,VP.hrTimeToMicroseconds)(e.startTime),duration:(0,VP.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,r){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(r)return r({code:VP.ExportResultCode.SUCCESS})}};J_.ConsoleSpanExporter=GP});var jK=p(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});Q_.InMemorySpanExporter=void 0;var qK=W(),qP=class{_finishedSpans=[];_stopped=!1;export(e,r){if(this._stopped)return r({code:qK.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>r({code:qK.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};Q_.InMemorySpanExporter=qP});var HK=p(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.SimpleSpanProcessor=void 0;var LRe=(b(),y(P)),Z_=W(),jP=class{_exporter;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e,this._shutdownOnce=new Z_.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,r){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&LRe.TraceFlags.SAMPLED)===0)return;let r=this._doExport(e).catch(o=>(0,Z_.globalErrorHandler)(o));this._pendingExports.add(r),r.finally(()=>this._pendingExports.delete(r))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let r=await Z_.internal._export(this._exporter,[e]);if(r.code!==Z_.ExportResultCode.SUCCESS)throw r.error??new Error(`SimpleSpanProcessor: span export failed (status ${r})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};eg.SimpleSpanProcessor=jP});var zK=p(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.NoopSpanProcessor=void 0;var HP=class{onStart(e,r){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};tg.NoopSpanProcessor=HP});var zP=p(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.SamplingDecision=ve.TraceIdRatioBasedSampler=ve.ParentBasedSampler=ve.AlwaysOnSampler=ve.AlwaysOffSampler=ve.NoopSpanProcessor=ve.SimpleSpanProcessor=ve.InMemorySpanExporter=ve.ConsoleSpanExporter=ve.RandomIdGenerator=ve.BatchSpanProcessor=ve.BasicTracerProvider=void 0;var DRe=VK();Object.defineProperty(ve,"BasicTracerProvider",{enumerable:!0,get:function(){return DRe.BasicTracerProvider}});var $K=UP();Object.defineProperty(ve,"BatchSpanProcessor",{enumerable:!0,get:function(){return $K.BatchSpanProcessor}});Object.defineProperty(ve,"RandomIdGenerator",{enumerable:!0,get:function(){return $K.RandomIdGenerator}});var URe=GK();Object.defineProperty(ve,"ConsoleSpanExporter",{enumerable:!0,get:function(){return URe.ConsoleSpanExporter}});var kRe=jK();Object.defineProperty(ve,"InMemorySpanExporter",{enumerable:!0,get:function(){return kRe.InMemorySpanExporter}});var BRe=HK();Object.defineProperty(ve,"SimpleSpanProcessor",{enumerable:!0,get:function(){return BRe.SimpleSpanProcessor}});var FRe=zK();Object.defineProperty(ve,"NoopSpanProcessor",{enumerable:!0,get:function(){return FRe.NoopSpanProcessor}});var VRe=D_();Object.defineProperty(ve,"AlwaysOffSampler",{enumerable:!0,get:function(){return VRe.AlwaysOffSampler}});var GRe=k_();Object.defineProperty(ve,"AlwaysOnSampler",{enumerable:!0,get:function(){return GRe.AlwaysOnSampler}});var qRe=RP();Object.defineProperty(ve,"ParentBasedSampler",{enumerable:!0,get:function(){return qRe.ParentBasedSampler}});var jRe=CP();Object.defineProperty(ve,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return jRe.TraceIdRatioBasedSampler}});var HRe=hl();Object.defineProperty(ve,"SamplingDecision",{enumerable:!0,get:function(){return HRe.SamplingDecision}})});var YK=p(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.NodeTracerProvider=void 0;var zRe=YW(),$Re=zP(),ml=(b(),y(P)),$P=W();function YRe(t){if(t!==null){if(t===void 0){let e=new zRe.AsyncLocalStorageContextManager;e.enable(),ml.context.setGlobalContextManager(e);return}t.enable(),ml.context.setGlobalContextManager(t)}}function WRe(t){if(t!==null){if(t===void 0){ml.propagation.setGlobalPropagator(new $P.CompositePropagator({propagators:[new $P.W3CTraceContextPropagator,new $P.W3CBaggagePropagator]}));return}ml.propagation.setGlobalPropagator(t)}}var YP=class extends $Re.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){ml.trace.setGlobalTracerProvider(this),YRe(e.contextManager),WRe(e.propagator)}};rg.NodeTracerProvider=YP});var WP=p(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.TraceIdRatioBasedSampler=he.SimpleSpanProcessor=he.SamplingDecision=he.RandomIdGenerator=he.ParentBasedSampler=he.NoopSpanProcessor=he.InMemorySpanExporter=he.ConsoleSpanExporter=he.BatchSpanProcessor=he.BasicTracerProvider=he.AlwaysOnSampler=he.AlwaysOffSampler=he.NodeTracerProvider=void 0;var KRe=YK();Object.defineProperty(he,"NodeTracerProvider",{enumerable:!0,get:function(){return KRe.NodeTracerProvider}});var Tr=zP();Object.defineProperty(he,"AlwaysOffSampler",{enumerable:!0,get:function(){return Tr.AlwaysOffSampler}});Object.defineProperty(he,"AlwaysOnSampler",{enumerable:!0,get:function(){return Tr.AlwaysOnSampler}});Object.defineProperty(he,"BasicTracerProvider",{enumerable:!0,get:function(){return Tr.BasicTracerProvider}});Object.defineProperty(he,"BatchSpanProcessor",{enumerable:!0,get:function(){return Tr.BatchSpanProcessor}});Object.defineProperty(he,"ConsoleSpanExporter",{enumerable:!0,get:function(){return Tr.ConsoleSpanExporter}});Object.defineProperty(he,"InMemorySpanExporter",{enumerable:!0,get:function(){return Tr.InMemorySpanExporter}});Object.defineProperty(he,"NoopSpanProcessor",{enumerable:!0,get:function(){return Tr.NoopSpanProcessor}});Object.defineProperty(he,"ParentBasedSampler",{enumerable:!0,get:function(){return Tr.ParentBasedSampler}});Object.defineProperty(he,"RandomIdGenerator",{enumerable:!0,get:function(){return Tr.RandomIdGenerator}});Object.defineProperty(he,"SamplingDecision",{enumerable:!0,get:function(){return Tr.SamplingDecision}});Object.defineProperty(he,"SimpleSpanProcessor",{enumerable:!0,get:function(){return Tr.SimpleSpanProcessor}});Object.defineProperty(he,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return Tr.TraceIdRatioBasedSampler}})});var WK=p(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.ExceptionEventName=void 0;ng.ExceptionEventName="exception"});var KK=p(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.SpanImpl=void 0;var yr=(b(),y(P)),Ot=W(),ss=(yt(),y(Dt)),XRe=WK(),KP=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:yr.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let r=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=Ot.otperformance.now(),this._performanceOffset=r-(this._performanceStartTime+(0,Ot.getTimeOrigin)()),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,this.links=e.links||[],this.startTime=this._getTime(e.startTime??r),this.resource=e.resource,this.instrumentationScope=e.scope,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,r){if(r==null||this._isSpanEnded())return this;if(e.length===0)return yr.diag.warn(`Invalid attribute key: ${e}`),this;if(!(0,Ot.isAttributeValue)(r))return yr.diag.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:o}=this._spanLimits;return o!==void 0&&Object.keys(this.attributes).length>=o&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this)}setAttributes(e){for(let[r,o]of Object.entries(e))this.setAttribute(r,o);return this}addEvent(e,r,o){if(this._isSpanEnded())return this;let{eventCountLimit:s}=this._spanLimits;if(s===0)return yr.diag.warn("No events allowed."),this._droppedEventsCount++,this;s!==void 0&&this.events.length>=s&&(this._droppedEventsCount===0&&yr.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,Ot.isTimeInput)(r)&&((0,Ot.isTimeInput)(o)||(o=r),r=void 0);let a=(0,Ot.sanitizeAttributes)(r);return this.events.push({name:e,attributes:a,time:this._getTime(o),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status={...e},this.status.message!=null&&typeof e.message!="string"&&(yr.diag.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){yr.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,Ot.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(yr.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&yr.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=Ot.otperformance.now())return(0,Ot.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,Ot.millisToHrTime)(e);if(e instanceof Date)return(0,Ot.millisToHrTime)(e.getTime());if((0,Ot.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,Ot.millisToHrTime)(Date.now());let r=Ot.otperformance.now()-this._performanceStartTime;return(0,Ot.addHrTimes)(this.startTime,(0,Ot.millisToHrTime)(r))}isRecording(){return this._ended===!1}recordException(e,r){let o={};typeof e=="string"?o[ss.ATTR_EXCEPTION_MESSAGE]=e:e&&(e.code?o[ss.ATTR_EXCEPTION_TYPE]=e.code.toString():e.name&&(o[ss.ATTR_EXCEPTION_TYPE]=e.name),e.message&&(o[ss.ATTR_EXCEPTION_MESSAGE]=e.message),e.stack&&(o[ss.ATTR_EXCEPTION_STACKTRACE]=e.stack)),o[ss.ATTR_EXCEPTION_TYPE]||o[ss.ATTR_EXCEPTION_MESSAGE]?this.addEvent(XRe.ExceptionEventName,o,r):yr.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);yr.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_truncateToSize(e){let r=this._attributeValueLengthLimit;return r<=0?(yr.diag.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,r):o):e}};ig.SpanImpl=KP});var gl=p(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.SamplingDecision=void 0;var JRe;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(JRe=_l.SamplingDecision||(_l.SamplingDecision={}))});var sg=p(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});og.AlwaysOffSampler=void 0;var QRe=gl(),XP=class{shouldSample(){return{decision:QRe.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};og.AlwaysOffSampler=XP});var cg=p(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.AlwaysOnSampler=void 0;var ZRe=gl(),JP=class{shouldSample(){return{decision:ZRe.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};ag.AlwaysOnSampler=JP});var eC=p(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.ParentBasedSampler=void 0;var ug=(b(),y(P)),ePe=W(),XK=sg(),QP=cg(),ZP=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||((0,ePe.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new QP.AlwaysOnSampler),this._remoteParentSampled=e.remoteParentSampled??new QP.AlwaysOnSampler,this._remoteParentNotSampled=e.remoteParentNotSampled??new XK.AlwaysOffSampler,this._localParentSampled=e.localParentSampled??new QP.AlwaysOnSampler,this._localParentNotSampled=e.localParentNotSampled??new XK.AlwaysOffSampler}shouldSample(e,r,o,s,a,i){let n=ug.trace.getSpanContext(e);return!n||!(0,ug.isSpanContextValid)(n)?this._root.shouldSample(e,r,o,s,a,i):n.isRemote?n.traceFlags&ug.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,r,o,s,a,i):this._remoteParentNotSampled.shouldSample(e,r,o,s,a,i):n.traceFlags&ug.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,r,o,s,a,i):this._localParentNotSampled.shouldSample(e,r,o,s,a,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};lg.ParentBasedSampler=ZP});var rC=p(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.TraceIdRatioBasedSampler=void 0;var tPe=(b(),y(P)),JK=gl(),tC=class{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,r){return{decision:(0,tPe.isValidTraceId)(r)&&this._accumulate(r)<this._upperBound?JK.SamplingDecision.RECORD_AND_SAMPLED:JK.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let r=0;for(let o=0;o<e.length/8;o++){let s=o*8,a=parseInt(e.slice(s,s+8),16);r=(r^a)>>>0}return r}};dg.TraceIdRatioBasedSampler=tC});var oC=p(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.buildSamplerFromEnv=rc.loadDefaultConfig=void 0;var iC=(b(),y(P)),wn=W(),QK=sg(),nC=cg(),pg=eC(),ZK=rC(),Ln;(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Ln||(Ln={}));var fg=1;function rPe(){return{sampler:t6(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,wn.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,wn.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,wn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,wn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,wn.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,wn.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,wn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,wn.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}rc.loadDefaultConfig=rPe;function t6(){let t=(0,wn.getStringFromEnv)("OTEL_TRACES_SAMPLER")??Ln.ParentBasedAlwaysOn;switch(t){case Ln.AlwaysOn:return new nC.AlwaysOnSampler;case Ln.AlwaysOff:return new QK.AlwaysOffSampler;case Ln.ParentBasedAlwaysOn:return new pg.ParentBasedSampler({root:new nC.AlwaysOnSampler});case Ln.ParentBasedAlwaysOff:return new pg.ParentBasedSampler({root:new QK.AlwaysOffSampler});case Ln.TraceIdRatio:return new ZK.TraceIdRatioBasedSampler(e6());case Ln.ParentBasedTraceIdRatio:return new pg.ParentBasedSampler({root:new ZK.TraceIdRatioBasedSampler(e6())});default:return iC.diag.error(`OTEL_TRACES_SAMPLER value "${t}" invalid, defaulting to "${Ln.ParentBasedAlwaysOn}".`),new pg.ParentBasedSampler({root:new nC.AlwaysOnSampler})}}rc.buildSamplerFromEnv=t6;function e6(){let t=(0,wn.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");return t==null?(iC.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${fg}.`),fg):t<0||t>1?(iC.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t} was given, but it is out of range ([0..1]), defaulting to ${fg}.`),fg):t}});var sC=p(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.reconfigureLimits=vr.mergeConfig=vr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=vr.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var r6=oC(),hg=W();vr.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;vr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function nPe(t){let e={sampler:(0,r6.buildSamplerFromEnv)()},r=(0,r6.loadDefaultConfig)(),o=Object.assign({},r,e,t);return o.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),o.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),o}vr.mergeConfig=nPe;function iPe(t){let e=Object.assign({},t.spanLimits);return e.attributeCountLimit=t.spanLimits?.attributeCountLimit??t.generalLimits?.attributeCountLimit??(0,hg.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,hg.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??vr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,e.attributeValueLengthLimit=t.spanLimits?.attributeValueLengthLimit??t.generalLimits?.attributeValueLengthLimit??(0,hg.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,hg.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??vr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},t,{spanLimits:e})}vr.reconfigureLimits=iPe});var n6=p(mg=>{"use strict";Object.defineProperty(mg,"__esModule",{value:!0});mg.BatchSpanProcessorBase=void 0;var nc=(b(),y(P)),Dn=W(),aC=class{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,r){this._exporter=e,this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:(0,Dn.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:(0,Dn.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:(0,Dn.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:(0,Dn.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new Dn.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(nc.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,r){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&nc.TraceFlags.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&nc.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(nc.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,r)=>{let o=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let a=0,i=s;a<i;a++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,r)=>{let o=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);nc.context.with((0,Dn.suppressTracing)(nc.context.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);let a=()=>this._exporter.export(s,n=>{clearTimeout(o),n.code===Dn.ExportResultCode.SUCCESS?e():r(n.error??new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let n=0,c=s.length;n<c;n++){let u=s[n];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(i??=[],i.push(u.resource.waitForAsyncAttributes()))}i===null?a():Promise.all(i).then(a,n=>{(0,Dn.globalErrorHandler)(n),r(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,(0,Dn.globalErrorHandler)(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,Dn.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};mg.BatchSpanProcessorBase=aC});var i6=p(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.BatchSpanProcessor=void 0;var oPe=n6(),cC=class extends oPe.BatchSpanProcessorBase{onShutdown(){}};_g.BatchSpanProcessor=cC});var a6=p(Eg=>{"use strict";Object.defineProperty(Eg,"__esModule",{value:!0});Eg.RandomIdGenerator=void 0;var sPe=8,s6=16,uC=class{generateTraceId=o6(s6);generateSpanId=o6(sPe)};Eg.RandomIdGenerator=uC;var gg=Buffer.allocUnsafe(s6);function o6(t){return function(){for(let r=0;r<t/4;r++)gg.writeUInt32BE(Math.random()*2**32>>>0,r*4);for(let r=0;r<t&&!(gg[r]>0);r++)r===t-1&&(gg[t-1]=1);return gg.toString("hex",0,t)}}});var c6=p(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.RandomIdGenerator=ic.BatchSpanProcessor=void 0;var aPe=i6();Object.defineProperty(ic,"BatchSpanProcessor",{enumerable:!0,get:function(){return aPe.BatchSpanProcessor}});var cPe=a6();Object.defineProperty(ic,"RandomIdGenerator",{enumerable:!0,get:function(){return cPe.RandomIdGenerator}})});var lC=p(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.RandomIdGenerator=oc.BatchSpanProcessor=void 0;var u6=c6();Object.defineProperty(oc,"BatchSpanProcessor",{enumerable:!0,get:function(){return u6.BatchSpanProcessor}});Object.defineProperty(oc,"RandomIdGenerator",{enumerable:!0,get:function(){return u6.RandomIdGenerator}})});var l6=p(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});Tg.Tracer=void 0;var pt=(b(),y(P)),Sg=W(),uPe=KK(),lPe=sC(),dPe=lC(),dC=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,r,o,s){let a=(0,lPe.mergeConfig)(r);this._sampler=a.sampler,this._generalLimits=a.generalLimits,this._spanLimits=a.spanLimits,this._idGenerator=r.idGenerator||new dPe.RandomIdGenerator,this._resource=o,this._spanProcessor=s,this.instrumentationScope=e}startSpan(e,r={},o=pt.context.active()){r.root&&(o=pt.trace.deleteSpan(o));let s=pt.trace.getSpan(o);if((0,Sg.isTracingSuppressed)(o))return pt.diag.debug("Instrumentation suppressed, returning Noop Span"),pt.trace.wrapSpanContext(pt.INVALID_SPAN_CONTEXT);let a=s?.spanContext(),i=this._idGenerator.generateSpanId(),n,c,u;!a||!pt.trace.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,n=a);let l=r.kind??pt.SpanKind.INTERNAL,d=(r.links??[]).map(I=>({context:I.context,attributes:(0,Sg.sanitizeAttributes)(I.attributes)})),h=(0,Sg.sanitizeAttributes)(r.attributes),g=this._sampler.shouldSample(o,c,e,l,h,d);u=g.traceState??u;let E=g.decision===pt.SamplingDecision.RECORD_AND_SAMPLED?pt.TraceFlags.SAMPLED:pt.TraceFlags.NONE,S={traceId:c,spanId:i,traceFlags:E,traceState:u};if(g.decision===pt.SamplingDecision.NOT_RECORD)return pt.diag.debug("Recording is off, propagating context in a non-recording span"),pt.trace.wrapSpanContext(S);let v=(0,Sg.sanitizeAttributes)(Object.assign(h,g.attributes));return new uPe.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:o,spanContext:S,name:e,kind:l,links:d,parentSpanContext:n,attributes:v,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,r,o,s){let a,i,n;if(arguments.length<2)return;arguments.length===2?n=r:arguments.length===3?(a=r,n=o):(a=r,i=o,n=s);let c=i??pt.context.active(),u=this.startSpan(e,a,c),l=pt.trace.setSpan(c,u);return pt.context.with(l,n,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};Tg.Tracer=dC});var d6=p(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});yg.MultiSpanProcessor=void 0;var pPe=W(),pC=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let r of this._spanProcessors)e.push(r.forceFlush());return new Promise(r=>{Promise.all(e).then(()=>{r()}).catch(o=>{(0,pPe.globalErrorHandler)(o||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(e,r){for(let o of this._spanProcessors)o.onStart(e,r)}onEnd(e){for(let r of this._spanProcessors)r.onEnd(e)}shutdown(){let e=[];for(let r of this._spanProcessors)e.push(r.shutdown());return new Promise((r,o)=>{Promise.all(e).then(()=>{r()},o)})}};yg.MultiSpanProcessor=pC});var p6=p(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.BasicTracerProvider=as.ForceFlushState=void 0;var fPe=W(),hPe=Aa(),mPe=l6(),_Pe=oC(),gPe=d6(),EPe=sC(),sc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(sc=as.ForceFlushState||(as.ForceFlushState={}));var fC=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let r=(0,fPe.merge)({},(0,_Pe.loadDefaultConfig)(),(0,EPe.reconfigureLimits)(e));this._resource=r.resource??(0,hPe.defaultResource)(),this._config=Object.assign({},r,{resource:this._resource});let o=[];e.spanProcessors?.length&&o.push(...e.spanProcessors),this._activeSpanProcessor=new gPe.MultiSpanProcessor(o)}getTracer(e,r,o){let s=`${e}@${r||""}:${o?.schemaUrl||""}`;return this._tracers.has(s)||this._tracers.set(s,new mPe.Tracer({name:e,version:r,schemaUrl:o?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(s)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(o=>new Promise(s=>{let a,i=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${e} ms`)),a=sc.timeout},e);o.forceFlush().then(()=>{clearTimeout(i),a!==sc.timeout&&(a=sc.resolved,s(a))}).catch(n=>{clearTimeout(i),a=sc.error,s(n)})}));return new Promise((o,s)=>{Promise.all(r).then(a=>{let i=a.filter(n=>n!==sc.resolved);i.length>0?s(i):o()}).catch(a=>s([a]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};as.BasicTracerProvider=fC});var f6=p(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.ConsoleSpanExporter=void 0;var hC=W(),mC=class{export(e,r){return this._sendSpans(e,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,traceId:e.spanContext().traceId,parentSpanContext:e.parentSpanContext,traceState:e.spanContext().traceState?.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,hC.hrTimeToMicroseconds)(e.startTime),duration:(0,hC.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,r){for(let o of e)console.dir(this._exportInfo(o),{depth:3});if(r)return r({code:hC.ExportResultCode.SUCCESS})}};vg.ConsoleSpanExporter=mC});var m6=p(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});Ag.InMemorySpanExporter=void 0;var h6=W(),_C=class{_finishedSpans=[];_stopped=!1;export(e,r){if(this._stopped)return r({code:h6.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>r({code:h6.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};Ag.InMemorySpanExporter=_C});var _6=p(bg=>{"use strict";Object.defineProperty(bg,"__esModule",{value:!0});bg.SimpleSpanProcessor=void 0;var SPe=(b(),y(P)),Og=W(),gC=class{_exporter;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e,this._shutdownOnce=new Og.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,r){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&SPe.TraceFlags.SAMPLED)===0)return;let r=this._doExport(e).catch(o=>(0,Og.globalErrorHandler)(o));this._pendingExports.add(r),r.finally(()=>this._pendingExports.delete(r))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let r=await Og.internal._export(this._exporter,[e]);if(r.code!==Og.ExportResultCode.SUCCESS)throw r.error??new Error(`SimpleSpanProcessor: span export failed (status ${r})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};bg.SimpleSpanProcessor=gC});var g6=p(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.NoopSpanProcessor=void 0;var EC=class{onStart(e,r){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};Rg.NoopSpanProcessor=EC});var Pg=p(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.SamplingDecision=Ae.TraceIdRatioBasedSampler=Ae.ParentBasedSampler=Ae.AlwaysOnSampler=Ae.AlwaysOffSampler=Ae.NoopSpanProcessor=Ae.SimpleSpanProcessor=Ae.InMemorySpanExporter=Ae.ConsoleSpanExporter=Ae.RandomIdGenerator=Ae.BatchSpanProcessor=Ae.BasicTracerProvider=void 0;var TPe=p6();Object.defineProperty(Ae,"BasicTracerProvider",{enumerable:!0,get:function(){return TPe.BasicTracerProvider}});var E6=lC();Object.defineProperty(Ae,"BatchSpanProcessor",{enumerable:!0,get:function(){return E6.BatchSpanProcessor}});Object.defineProperty(Ae,"RandomIdGenerator",{enumerable:!0,get:function(){return E6.RandomIdGenerator}});var yPe=f6();Object.defineProperty(Ae,"ConsoleSpanExporter",{enumerable:!0,get:function(){return yPe.ConsoleSpanExporter}});var vPe=m6();Object.defineProperty(Ae,"InMemorySpanExporter",{enumerable:!0,get:function(){return vPe.InMemorySpanExporter}});var APe=_6();Object.defineProperty(Ae,"SimpleSpanProcessor",{enumerable:!0,get:function(){return APe.SimpleSpanProcessor}});var OPe=g6();Object.defineProperty(Ae,"NoopSpanProcessor",{enumerable:!0,get:function(){return OPe.NoopSpanProcessor}});var bPe=sg();Object.defineProperty(Ae,"AlwaysOffSampler",{enumerable:!0,get:function(){return bPe.AlwaysOffSampler}});var RPe=cg();Object.defineProperty(Ae,"AlwaysOnSampler",{enumerable:!0,get:function(){return RPe.AlwaysOnSampler}});var PPe=eC();Object.defineProperty(Ae,"ParentBasedSampler",{enumerable:!0,get:function(){return PPe.ParentBasedSampler}});var CPe=rC();Object.defineProperty(Ae,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return CPe.TraceIdRatioBasedSampler}});var NPe=gl();Object.defineProperty(Ae,"SamplingDecision",{enumerable:!0,get:function(){return NPe.SamplingDecision}})});var S6=p(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.disableInstrumentations=ac.enableInstrumentations=void 0;function MPe(t,e,r,o){for(let s=0,a=t.length;s<a;s++){let i=t[s];e&&i.setTracerProvider(e),r&&i.setMeterProvider(r),o&&i.setLoggerProvider&&i.setLoggerProvider(o),i.getConfig().enabled||i.enable()}}ac.enableInstrumentations=MPe;function IPe(t){t.forEach(e=>e.disable())}ac.disableInstrumentations=IPe});var v6=p(Cg=>{"use strict";Object.defineProperty(Cg,"__esModule",{value:!0});Cg.registerInstrumentations=void 0;var T6=(b(),y(P)),xPe=Hu(),y6=S6();function wPe(t){let e=t.tracerProvider||T6.trace.getTracerProvider(),r=t.meterProvider||T6.metrics.getMeterProvider(),o=t.loggerProvider||xPe.logs.getLoggerProvider(),s=t.instrumentations?.flat()??[];return(0,y6.enableInstrumentations)(s,e,r,o),()=>{(0,y6.disableInstrumentations)(s)}}Cg.registerInstrumentations=wPe});var I6=p(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.satisfies=void 0;var vC=(b(),y(P)),P6=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,LPe=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,DPe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function UPe(t,e,r){if(!kPe(t))return vC.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let o=GPe(t);if(!o)return!1;let s=[],a=C6(o,e,s,r);return a&&!r?.includePrerelease?FPe(o,s):a}Ng.satisfies=UPe;function kPe(t){return typeof t=="string"&&P6.test(t)}function C6(t,e,r,o){if(e.includes("||")){let s=e.trim().split("||");for(let a of s)if(SC(t,a,r,o))return!0;return!1}else if(e.includes(" - "))e=cCe(e,o);else if(e.includes(" ")){let s=e.trim().replace(/\s{2,}/g," ").split(" ");for(let a of s)if(!SC(t,a,r,o))return!1;return!0}return SC(t,e,r,o)}function SC(t,e,r,o){if(e=VPe(e,o),e.includes(" "))return C6(t,e,r,o);{let s=qPe(e);return r.push(s),BPe(t,s)}}function BPe(t,e){if(e.invalid)return!1;if(!e.version||yC(e.version))return!0;let r=O6(t.versionSegments||[],e.versionSegments||[]);if(r===0){let o=t.prereleaseSegments||[],s=e.prereleaseSegments||[];!o.length&&!s.length?r=0:!o.length&&s.length?r=1:o.length&&!s.length?r=-1:r=O6(o,s)}return DPe[e.op]?.includes(r)}function FPe(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function VPe(t,e){return t=t.trim(),t=sCe(t,e),t=oCe(t),t=aCe(t,e),t=t.trim(),t}function Ut(t){return!t||t.toLowerCase()==="x"||t==="*"}function GPe(t){let e=t.match(P6);if(!e){vC.diag.error(`Invalid version: ${t}`);return}let r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,a=r.split("."),i=o?.split(".");return{op:void 0,version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:s}}function qPe(t){if(!t)return{};let e=t.match(LPe);if(!e)return vC.diag.error(`Invalid range: ${t}`),{invalid:!0};let r=e.groups.op,o=e.groups.version,s=e.groups.prerelease,a=e.groups.build,i=o.split("."),n=s?.split(".");return r==="=="&&(r="="),{op:r||"=",version:o,versionSegments:i,versionSegmentCount:i.length,prerelease:s,prereleaseSegments:n,prereleaseSegmentCount:n?n.length:0,build:a}}function yC(t){return t==="*"||t==="x"||t==="X"}function A6(t){let e=parseInt(t,10);return isNaN(e)?t:e}function jPe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function HPe(t,e){if(yC(t)||yC(e))return 0;let[r,o]=jPe(A6(t),A6(e));return r>o?1:r<o?-1:0}function O6(t,e){for(let r=0;r<Math.max(t.length,e.length);r++){let o=HPe(t[r]||"0",e[r]||"0");if(o!==0)return o}return 0}var N6="[a-zA-Z0-9-]",M6="0|[1-9]\\d*",zPe=`\\d*[a-zA-Z-]${N6}*`,$Pe="((?:<|>)?=?)",b6=`(?:${M6}|${zPe})`,YPe=`(?:-(${b6}(?:\\.${b6})*))`,R6=`${N6}+`,WPe=`(?:\\+(${R6}(?:\\.${R6})*))`,TC=`${M6}|x|X|\\*`,El=`[v=\\s]*(${TC})(?:\\.(${TC})(?:\\.(${TC})(?:${YPe})?${WPe}?)?)?`,KPe=`^${$Pe}\\s*${El}$`,XPe=new RegExp(KPe),JPe=`^\\s*(${El})\\s+-\\s+(${El})\\s*$`,QPe=new RegExp(JPe),ZPe="(?:~>?)",eCe=`^${ZPe}${El}$`,tCe=new RegExp(eCe),rCe="(?:\\^)",nCe=`^${rCe}${El}$`,iCe=new RegExp(nCe);function oCe(t){let e=tCe;return t.replace(e,(r,o,s,a,i)=>{let n;return Ut(o)?n="":Ut(s)?n=`>=${o}.0.0 <${+o+1}.0.0-0`:Ut(a)?n=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:i?n=`>=${o}.${s}.${a}-${i} <${o}.${+s+1}.0-0`:n=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,n})}function sCe(t,e){let r=iCe,o=e?.includePrerelease?"-0":"";return t.replace(r,(s,a,i,n,c)=>{let u;return Ut(a)?u="":Ut(i)?u=`>=${a}.0.0${o} <${+a+1}.0.0-0`:Ut(n)?a==="0"?u=`>=${a}.${i}.0${o} <${a}.${+i+1}.0-0`:u=`>=${a}.${i}.0${o} <${+a+1}.0.0-0`:c?a==="0"?i==="0"?u=`>=${a}.${i}.${n}-${c} <${a}.${i}.${+n+1}-0`:u=`>=${a}.${i}.${n}-${c} <${a}.${+i+1}.0-0`:u=`>=${a}.${i}.${n}-${c} <${+a+1}.0.0-0`:a==="0"?i==="0"?u=`>=${a}.${i}.${n}${o} <${a}.${i}.${+n+1}-0`:u=`>=${a}.${i}.${n}${o} <${a}.${+i+1}.0-0`:u=`>=${a}.${i}.${n} <${+a+1}.0.0-0`,u})}function aCe(t,e){let r=XPe;return t.replace(r,(o,s,a,i,n,c)=>{let u=Ut(a),l=u||Ut(i),d=l||Ut(n),h=d;return s==="="&&h&&(s=""),c=e?.includePrerelease?"-0":"",u?s===">"||s==="<"?o="<0.0.0-0":o="*":s&&h?(l&&(i=0),n=0,s===">"?(s=">=",l?(a=+a+1,i=0,n=0):(i=+i+1,n=0)):s==="<="&&(s="<",l?a=+a+1:i=+i+1),s==="<"&&(c="-0"),o=`${s+a}.${i}.${n}${c}`):l?o=`>=${a}.0.0${c} <${+a+1}.0.0-0`:d&&(o=`>=${a}.${i}.0${c} <${a}.${+i+1}.0-0`),o})}function cCe(t,e){let r=QPe;return t.replace(r,(o,s,a,i,n,c,u,l,d,h,g,E)=>(Ut(a)?s="":Ut(i)?s=`>=${a}.0.0${e?.includePrerelease?"-0":""}`:Ut(n)?s=`>=${a}.${i}.0${e?.includePrerelease?"-0":""}`:c?s=`>=${s}`:s=`>=${s}${e?.includePrerelease?"-0":""}`,Ut(d)?l="":Ut(h)?l=`<${+d+1}.0.0-0`:Ut(g)?l=`<${d}.${+h+1}.0-0`:E?l=`<=${d}.${h}.${g}-${E}`:e?.includePrerelease?l=`<${d}.${h}.${+g+1}-0`:l=`<=${l}`,`${s} ${l}`.trim()))}});var AC=p(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.massUnwrap=ft.unwrap=ft.massWrap=ft.wrap=void 0;var kt=console.error.bind(console);function Sl(t,e,r){let o=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:o,writable:!0,value:r})}var uCe=(t,e,r)=>{if(!t||!t[e]){kt("no original function "+String(e)+" to wrap");return}if(!r){kt("no wrapper function"),kt(new Error().stack);return}let o=t[e];if(typeof o!="function"||typeof r!="function"){kt("original object and wrapper must be functions");return}let s=r(o,e);return Sl(s,"__original",o),Sl(s,"__unwrap",()=>{t[e]===s&&Sl(t,e,o)}),Sl(s,"__wrapped",!0),Sl(t,e,s),s};ft.wrap=uCe;var lCe=(t,e,r)=>{if(t)Array.isArray(t)||(t=[t]);else{kt("must provide one or more modules to patch"),kt(new Error().stack);return}if(!(e&&Array.isArray(e))){kt("must provide one or more functions to wrap on modules");return}t.forEach(o=>{e.forEach(s=>{(0,ft.wrap)(o,s,r)})})};ft.massWrap=lCe;var dCe=(t,e)=>{if(!t||!t[e]){kt("no function to unwrap."),kt(new Error().stack);return}let r=t[e];if(!r.__unwrap)kt("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{r.__unwrap();return}};ft.unwrap=dCe;var pCe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{kt("must provide one or more modules to patch"),kt(new Error().stack);return}if(!(e&&Array.isArray(e))){kt("must provide one or more functions to unwrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,ft.unwrap)(r,o)})})};ft.massUnwrap=pCe;function Tl(t){t&&t.logger&&(typeof t.logger!="function"?kt("new logger isn't a function, not replacing"):kt=t.logger)}ft.default=Tl;Tl.wrap=ft.wrap;Tl.massWrap=ft.massWrap;Tl.unwrap=ft.unwrap;Tl.massUnwrap=ft.massUnwrap});var x6=p(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});Ig.InstrumentationAbstract=void 0;var OC=(b(),y(P)),fCe=Hu(),Mg=AC(),bC=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,o){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(o),this._diag=OC.diag.createComponentLogger({namespace:e}),this._tracer=OC.trace.getTracer(e,r),this._meter=OC.metrics.getMeter(e,r),this._logger=fCe.logs.getLogger(e,r),this._updateMetricInstruments()}_wrap=Mg.wrap;_unwrap=Mg.unwrap;_massWrap=Mg.massWrap;_massUnwrap=Mg.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,o,s){if(e)try{e(o,s)}catch(a){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},a)}}};Ig.InstrumentationAbstract=bC});var L6=p((CQe,w6)=>{var cc=1e3,uc=cc*60,lc=uc*60,cs=lc*24,hCe=cs*7,mCe=cs*365.25;w6.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return _Ce(t);if(r==="number"&&isFinite(t))return e.long?ECe(t):gCe(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function _Ce(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]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return r*mCe;case"weeks":case"week":case"w":return r*hCe;case"days":case"day":case"d":return r*cs;case"hours":case"hour":case"hrs":case"hr":case"h":return r*lc;case"minutes":case"minute":case"mins":case"min":case"m":return r*uc;case"seconds":case"second":case"secs":case"sec":case"s":return r*cc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function gCe(t){var e=Math.abs(t);return e>=cs?Math.round(t/cs)+"d":e>=lc?Math.round(t/lc)+"h":e>=uc?Math.round(t/uc)+"m":e>=cc?Math.round(t/cc)+"s":t+"ms"}function ECe(t){var e=Math.abs(t);return e>=cs?xg(t,e,cs,"day"):e>=lc?xg(t,e,lc,"hour"):e>=uc?xg(t,e,uc,"minute"):e>=cc?xg(t,e,cc,"second"):t+" ms"}function xg(t,e,r,o){var s=e>=r*1.5;return Math.round(t/r)+" "+o+(s?"s":"")}});var RC=p((NQe,D6)=>{function SCe(t){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=s,r.enabled=n,r.humanize=L6(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let d=0;for(let h=0;h<l.length;h++)d=(d<<5)-d+l.charCodeAt(h),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(l){let d,h=null,g,E;function S(...v){if(!S.enabled)return;let O=S,I=Number(new Date),j=I-(d||I);O.diff=j,O.prev=d,O.curr=I,d=I,v[0]=r.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let A=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(H,Q)=>{if(H==="%%")return"%";A++;let oe=r.formatters[Q];if(typeof oe=="function"){let te=v[A];H=oe.call(O,te),v.splice(A,1),A--}return H}),r.formatArgs.call(O,v),(O.log||r.log).apply(O,v)}return S.namespace=l,S.useColors=r.useColors(),S.color=r.selectColor(l),S.extend=o,S.destroy=r.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,E=r.enabled(l)),E),set:v=>{h=v}}),typeof r.init=="function"&&r.init(S),S}function o(l,d){let h=r(this.namespace+(typeof d>"u"?":":d)+l);return h.log=this.log,h}function s(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of d)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}function a(l,d){let h=0,g=0,E=-1,S=0;for(;h<l.length;)if(g<d.length&&(d[g]===l[h]||d[g]==="*"))d[g]==="*"?(E=g,S=h,g++):(h++,g++);else if(E!==-1)g=E+1,S++,h=S;else return!1;for(;g<d.length&&d[g]==="*";)g++;return g===d.length}function i(){let l=[...r.names,...r.skips.map(d=>"-"+d)].join(",");return r.enable(""),l}function n(l){for(let d of r.skips)if(a(l,d))return!1;for(let d of r.names)if(a(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}D6.exports=SCe});var U6=p((Yt,wg)=>{Yt.formatArgs=yCe;Yt.save=vCe;Yt.load=ACe;Yt.useColors=TCe;Yt.storage=OCe();Yt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Yt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function TCe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function yCe(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+wg.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(r++,s==="%c"&&(o=r))}),t.splice(o,0,e)}Yt.log=console.debug||console.log||(()=>{});function vCe(t){try{t?Yt.storage.setItem("debug",t):Yt.storage.removeItem("debug")}catch{}}function ACe(){let t;try{t=Yt.storage.getItem("debug")||Yt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function OCe(){try{return localStorage}catch{}}wg.exports=RC()(Yt);var{formatters:bCe}=wg.exports;bCe.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var B6=p((tt,Dg)=>{var RCe=require("tty"),Lg=require("util");tt.init=wCe;tt.log=MCe;tt.formatArgs=CCe;tt.save=ICe;tt.load=xCe;tt.useColors=PCe;tt.destroy=Lg.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");tt.colors=[6,2,3,4,5,1];try{let t=require("supports-color");t&&(t.stderr||t).level>=2&&(tt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}tt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=>a.toUpperCase()),o=process.env[e];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o==="null"?o=null:o=Number(o),t[r]=o,t},{});function PCe(){return"colors"in tt.inspectOpts?!!tt.inspectOpts.colors:RCe.isatty(process.stderr.fd)}function CCe(t){let{namespace:e,useColors:r}=this;if(r){let o=this.color,s="\x1B[3"+(o<8?o:"8;5;"+o),a=` ${s};1m${e} \x1B[0m`;t[0]=a+t[0].split(`
|
|
17
|
+
`).join(`
|
|
18
|
+
`+a),t.push(s+"m+"+Dg.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=NCe()+e+" "+t[0]}function NCe(){return tt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function MCe(...t){return process.stderr.write(Lg.formatWithOptions(tt.inspectOpts,...t)+`
|
|
19
|
+
`)}function ICe(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function xCe(){return process.env.DEBUG}function wCe(t){t.inspectOpts={};let e=Object.keys(tt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=tt.inspectOpts[e[r]]}Dg.exports=RC()(tt);var{formatters:k6}=Dg.exports;k6.o=function(t){return this.inspectOpts.colors=this.useColors,Lg.inspect(t,this.inspectOpts).split(`
|
|
20
|
+
`).map(e=>e.trim()).join(" ")};k6.O=function(t){return this.inspectOpts.colors=this.useColors,Lg.inspect(t,this.inspectOpts)}});var F6=p((MQe,PC)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?PC.exports=U6():PC.exports=B6()});var NC=p((IQe,V6)=>{"use strict";var CC=require("path").sep;V6.exports=function(t){var e=t.split(CC),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var o=e[r+1][0]==="@",s=o?e[r+1]+"/"+e[r+2]:e[r+1],a=o?3:2,i="",n=r+a-1,c=0;c<=n;c++)c===n?i+=e[c]:i+=e[c]+CC;for(var u="",l=e.length-1,d=r+a;d<=l;d++)d===l?u+=e[d]:u+=e[d]+CC;return{name:s,basedir:i,path:u}}}});var wC=p((xQe,xC)=>{"use strict";var dc=require("path"),qr=require("module"),ke=F6()("require-in-the-middle"),LCe=NC();xC.exports=yl;xC.exports.Hook=yl;var MC,Ug;if(qr.isBuiltin)Ug=qr.isBuiltin;else if(qr.builtinModules)Ug=t=>t.startsWith("node:")?!0:(MC===void 0&&(MC=new Set(qr.builtinModules)),MC.has(t));else throw new Error("'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0");var DCe=/([/\\]index)?(\.js)?$/,IC=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let o=require.cache[e];return!!(o&&this._kRitmExports in o)}}get(e,r){let o=this._localCache.get(e);if(o!==void 0)return o;if(!r){let s=require.cache[e];return s&&s[this._kRitmExports]}}set(e,r,o){o?this._localCache.set(e,r):e in require.cache?require.cache[e][this._kRitmExports]=r:(ke('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function yl(t,e,r){if(!(this instanceof yl))return new yl(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof qr._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof qr._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues",process.version);return}this._cache=new IC,this._unhooked=!1,this._origRequire=qr.prototype.require;let o=this,s=new Set,a=e?e.internals===!0:!1,i=Array.isArray(t);ke("registering require hook"),this._require=qr.prototype.require=function(c){return o._unhooked===!0?(ke("ignoring require call - module is soft-unhooked"),o._origRequire.apply(this,arguments)):n.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(c){return o._unhooked===!0?(ke("ignoring process.getBuiltinModule call - module is soft-unhooked"),o._origGetBuiltinModule.apply(this,arguments)):n.call(this,arguments,!0)});function n(c,u){let l=c[0],d=Ug(l),h;if(d){if(h=l,l.startsWith("node:")){let I=l.slice(5);Ug(I)&&(h=I)}}else{if(u)return ke("call to process.getBuiltinModule with unknown built-in id"),o._origGetBuiltinModule.apply(this,c);try{h=qr._resolveFilename(l,this)}catch(I){return ke('Module._resolveFilename("%s") threw %j, calling original Module.require',l,I.message),o._origRequire.apply(this,c)}}let g,E;if(ke("processing %s module require('%s'): %s",d===!0?"core":"non-core",l,h),o._cache.has(h,d)===!0)return ke("returning already patched cached module: %s",h),o._cache.get(h,d);let S=s.has(h);S===!1&&s.add(h);let v=u?o._origGetBuiltinModule.apply(this,c):o._origRequire.apply(this,c);if(S===!0)return ke("module is in the process of being patched already - ignoring: %s",h),v;if(s.delete(h),d===!0){if(i===!0&&t.includes(h)===!1)return ke("ignoring core module not on whitelist: %s",h),v;g=h}else if(i===!0&&t.includes(h)){let I=dc.parse(h);g=I.name,E=I.dir}else{let I=LCe(h);if(I===void 0)return ke("could not parse filename: %s",h),v;g=I.name,E=I.basedir;let j=UCe(I);ke("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,l,j,E);let A=!1;if(i){if(!l.startsWith(".")&&t.includes(l)&&(g=l,A=!0),!t.includes(g)&&!t.includes(j))return v;t.includes(j)&&j!==g&&(g=j,A=!0)}if(!A){let z;try{z=require.resolve(g,{paths:[E]})}catch{return ke("could not resolve module: %s",g),o._cache.set(h,v,d),v}if(z!==h)if(a===!0)g=g+dc.sep+dc.relative(E,h),ke("preparing to process require of internal file: %s",g);else return ke("ignoring require of non-main module file: %s",z),o._cache.set(h,v,d),v}}o._cache.set(h,v,d),ke("calling require hook: %s",g);let O=r(v,g,E);return o._cache.set(h,O,d),ke("returning module: %s",g),O}}yl.prototype.unhook=function(){this._unhooked=!0,this._require===qr.prototype.require?(qr.prototype.require=this._origRequire,ke("require unhook successful")):ke("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,ke("process.getBuiltinModule unhook successful")):ke("process.getBuiltinModule unhook unsuccessful"))};function UCe(t){let e=dc.sep!=="/"?t.path.split(dc.sep).join("/"):t.path;return dc.posix.join(t.name,e).replace(DCe,"")}});var G6=p(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ModuleNameTrie=Ji.ModuleNameSeparator=void 0;Ji.ModuleNameSeparator="/";var kg=class{hooks=[];children=new Map},LC=class{_trie=new kg;_counter=0;insert(e){let r=this._trie;for(let o of e.moduleName.split(Ji.ModuleNameSeparator)){let s=r.children.get(o);s||(s=new kg,r.children.set(o,s)),r=s}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:o}={}){let s=this._trie,a=[],i=!0;for(let n of e.split(Ji.ModuleNameSeparator)){let c=s.children.get(n);if(!c){i=!1;break}o||a.push(...c.hooks),s=c}return o&&i&&a.push(...s.hooks),a.length===0?[]:a.length===1?[a[0].hook]:(r&&a.sort((n,c)=>n.insertedId-c.insertedId),a.map(({hook:n})=>n))}};Ji.ModuleNameTrie=LC});var j6=p(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.RequireInTheMiddleSingleton=void 0;var kCe=wC(),q6=require("path"),DC=G6(),BCe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),UC=class t{_moduleNameTrie=new DC.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new kCe.Hook(null,{internals:!0},(e,r,o)=>{let s=FCe(r),a=this._moduleNameTrie.search(s,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:i}of a)e=i(e,r,o);return e})}register(e,r){let o={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(o),o}static getInstance(){return BCe?new t:this._instance=this._instance??new t}};Bg.RequireInTheMiddleSingleton=UC;function FCe(t){return q6.sep!==DC.ModuleNameSeparator?t.split(q6.sep).join(DC.ModuleNameSeparator):t}});var K6=p(us=>{var H6=[],kC=new WeakMap,z6=new WeakMap,$6=new Map,Y6=[],VCe={set(t,e,r){return kC.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=z6.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return kC.get(t)[e](r.value)}};function GCe(t,e,r,o,s){$6.set(t,s),kC.set(e,r),z6.set(e,o);let a=new Proxy(e,VCe);H6.forEach(i=>i(t,a)),Y6.push([t,a])}var W6=!1;function qCe(){return W6}function jCe(t){W6=t}us.register=GCe;us.importHooks=H6;us.specifiers=$6;us.toHook=Y6;us.getExperimentalPatchInternals=qCe;us.setExperimentalPatchInternals=jCe});var t4=p((UQe,pc)=>{var X6=require("path"),HCe=NC(),{fileURLToPath:J6}=require("url"),{MessageChannel:zCe}=require("worker_threads"),{importHooks:BC,specifiers:$Ce,toHook:YCe,getExperimentalPatchInternals:WCe}=K6();function Z6(t){BC.push(t),YCe.forEach(([e,r])=>t(e,r))}function e4(t){let e=BC.indexOf(t);e>-1&&BC.splice(e,1)}function Q6(t,e,r,o){let s=t(e,r,o);s&&s!==e&&(e.default=s)}var FC;function KCe(){let{port1:t,port2:e}=new zCe,r=0,o;FC=n=>{r++,t.postMessage(n)},t.on("message",()=>{r--,o&&r<=0&&o()}).unref();function s(){let n=setInterval(()=>{},1e3),c=new Promise(u=>{o=u}).then(()=>{clearInterval(n)});return r===0&&o(),c}let a=e;return{registerOptions:{data:{addHookMessagePort:a,include:[]},transferList:[a]},addHookMessagePort:a,waitForAllMessagesAcknowledged:s}}function vl(t,e,r){if(!(this instanceof vl))return new vl(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let o=e?e.internals===!0:!1;FC&&Array.isArray(t)&&FC(t),this._iitmHook=(s,a)=>{let i=s,n=s.startsWith("node:"),c;if(n)s=s.replace(/^node:/,"");else{if(s.startsWith("file://"))try{s=J6(s)}catch{}let u=HCe(s);u&&(s=u.name,c=u.basedir)}if(t){for(let u of t)if(u===s){if(c){if(o)s=s+X6.sep+X6.relative(c,J6(i));else if(!WCe()&&!c.endsWith($Ce.get(i)))continue}Q6(r,a,s,c)}}else Q6(r,a,s,c)},Z6(this._iitmHook)}vl.prototype.unhook=function(){e4(this._iitmHook)};pc.exports=vl;pc.exports.Hook=vl;pc.exports.addHook=Z6;pc.exports.removeHook=e4;pc.exports.createAddHookMessageChannel=KCe});var VC=p(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.isWrapped=Qi.safeExecuteInTheMiddleAsync=Qi.safeExecuteInTheMiddle=void 0;function XCe(t,e,r){let o,s;try{s=t()}catch(a){o=a}finally{if(e(o,s),o&&!r)throw o;return s}}Qi.safeExecuteInTheMiddle=XCe;async function JCe(t,e,r){let o,s;try{s=await t()}catch(a){o=a}finally{if(e(o,s),o&&!r)throw o;return s}}Qi.safeExecuteInTheMiddleAsync=JCe;function QCe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}Qi.isWrapped=QCe});var i4=p(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});Fg.InstrumentationBase=void 0;var Al=require("path"),r4=require("util"),ZCe=I6(),GC=AC(),eNe=x6(),tNe=j6(),rNe=t4(),Ol=(b(),y(P)),nNe=wC(),iNe=require("fs"),oNe=VC(),qC=class extends eNe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=tNe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,r,o){super(e,r,o);let s=this.init();s&&!Array.isArray(s)&&(s=[s]),this._modules=s||[],this._config.enabled&&this.enable()}_wrap=(e,r,o)=>{if((0,oNe.isWrapped)(e[r])&&this._unwrap(e,r),r4.types.isProxy(e)){let s=(0,GC.wrap)(Object.assign({},e),r,o);return Object.defineProperty(e,r,{value:s}),s}else return(0,GC.wrap)(e,r,o)};_unwrap=(e,r)=>r4.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,GC.unwrap)(e,r);_massWrap=(e,r,o)=>{if(e)Array.isArray(e)||(e=[e]);else{Ol.diag.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Ol.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(s=>{r.forEach(a=>{this._wrap(s,a,o)})})};_massUnwrap=(e,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Ol.diag.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Ol.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{r.forEach(s=>{this._unwrap(o,s)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let o=require.resolve(r);require.cache[o]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,iNe.readFileSync)(Al.join(e,"package.json"),{encoding:"utf8"}),o=JSON.parse(r).version;return typeof o=="string"?o:void 0}catch{Ol.diag.warn("Failed extracting version",e)}}_onRequire(e,r,o,s){if(!s)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let a=this._extractPackageVersion(s);if(e.moduleVersion=a,e.name===o)return n4(e.supportedVersions,a,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:s}),e.patch(r,e.moduleVersion)):r;let i=e.files??[],n=Al.normalize(o);return i.filter(u=>u.name===n).filter(u=>n4(u.supportedVersions,a,e.includePrerelease)).reduce((u,l)=>(l.moduleExports=u,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:l.name,baseDir:s}),l.patch(u,e.moduleVersion)):u),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=(i,n,c)=>{if(!c&&Al.isAbsolute(n)){let u=Al.parse(n);n=u.name,c=u.dir}return this._onRequire(e,i,n,c)},o=(i,n,c)=>this._onRequire(e,i,n,c),s=Al.isAbsolute(e.name)?new nNe.Hook([e.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(e.name,o);this._hooks.push(s);let a=new rNe.Hook([e.name],{internals:!1},r);this._hooks.push(a)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};Fg.InstrumentationBase=qC;function n4(t,e,r){return typeof e>"u"?t.includes("*"):t.some(o=>(0,ZCe.satisfies)(e,o,{includePrerelease:r}))}});var o4=p(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.normalize=void 0;var sNe=require("path");Object.defineProperty(Vg,"normalize",{enumerable:!0,get:function(){return sNe.normalize}})});var s4=p(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.normalize=fc.InstrumentationBase=void 0;var aNe=i4();Object.defineProperty(fc,"InstrumentationBase",{enumerable:!0,get:function(){return aNe.InstrumentationBase}});var cNe=o4();Object.defineProperty(fc,"normalize",{enumerable:!0,get:function(){return cNe.normalize}})});var jC=p(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.normalize=hc.InstrumentationBase=void 0;var a4=s4();Object.defineProperty(hc,"InstrumentationBase",{enumerable:!0,get:function(){return a4.InstrumentationBase}});Object.defineProperty(hc,"normalize",{enumerable:!0,get:function(){return a4.normalize}})});var c4=p(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});Gg.InstrumentationNodeModuleDefinition=void 0;var HC=class{name;supportedVersions;patch;unpatch;files;constructor(e,r,o,s,a){this.name=e,this.supportedVersions=r,this.patch=o,this.unpatch=s,this.files=a||[]}};Gg.InstrumentationNodeModuleDefinition=HC});var u4=p(qg=>{"use strict";Object.defineProperty(qg,"__esModule",{value:!0});qg.InstrumentationNodeModuleFile=void 0;var uNe=jC(),zC=class{supportedVersions;patch;unpatch;name;constructor(e,r,o,s){this.supportedVersions=r,this.patch=o,this.unpatch=s,this.name=(0,uNe.normalize)(e)}};qg.InstrumentationNodeModuleFile=zC});var l4=p(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.semconvStabilityFromStr=ls.SemconvStability=void 0;var jg;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(jg=ls.SemconvStability||(ls.SemconvStability={}));function lNe(t,e){let r=jg.OLD,o=e?.split(",").map(s=>s.trim()).filter(s=>s!=="");for(let s of o??[])if(s.toLowerCase()===t+"/dup"){r=jg.DUPLICATE;break}else s.toLowerCase()===t&&(r=jg.STABLE);return r}ls.semconvStabilityFromStr=lNe});var p4=p(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.semconvStabilityFromStr=je.SemconvStability=je.safeExecuteInTheMiddleAsync=je.safeExecuteInTheMiddle=je.isWrapped=je.InstrumentationNodeModuleFile=je.InstrumentationNodeModuleDefinition=je.InstrumentationBase=je.registerInstrumentations=void 0;var dNe=v6();Object.defineProperty(je,"registerInstrumentations",{enumerable:!0,get:function(){return dNe.registerInstrumentations}});var pNe=jC();Object.defineProperty(je,"InstrumentationBase",{enumerable:!0,get:function(){return pNe.InstrumentationBase}});var fNe=c4();Object.defineProperty(je,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return fNe.InstrumentationNodeModuleDefinition}});var hNe=u4();Object.defineProperty(je,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return hNe.InstrumentationNodeModuleFile}});var $C=VC();Object.defineProperty(je,"isWrapped",{enumerable:!0,get:function(){return $C.isWrapped}});Object.defineProperty(je,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return $C.safeExecuteInTheMiddle}});Object.defineProperty(je,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return $C.safeExecuteInTheMiddleAsync}});var d4=l4();Object.defineProperty(je,"SemconvStability",{enumerable:!0,get:function(){return d4.SemconvStability}});Object.defineProperty(je,"semconvStabilityFromStr",{enumerable:!0,get:function(){return d4.semconvStabilityFromStr}})});var Hg,f4=U(()=>{Hg=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 Ti,zg=U(()=>{Ti=class extends Error{code;name="OTLPExporterError";data;constructor(e,r,o){super(e),this.data=o,this.code=r}}});function mNe(t){if(Number.isFinite(t)&&t>0)return t;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${t}')`)}function $g(t){if(t!=null)return()=>t}function Yg(t,e,r){return{timeoutMillis:mNe(t.timeoutMillis??e.timeoutMillis??r.timeoutMillis),concurrencyLimit:t.concurrencyLimit??e.concurrencyLimit??r.concurrencyLimit,compression:t.compression??e.compression??r.compression}}function Wg(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var bl=U(()=>{});var Kg,h4=U(()=>{(function(t){t.NONE="none",t.GZIP="gzip"})(Kg||(Kg={}))});function Xg(t){return new YC(t.concurrencyLimit)}var YC,WC=U(()=>{YC=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 o=this._sendingPromises.indexOf(e);this._sendingPromises.splice(o,1)};e.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}});function _Ne(t){return Object.prototype.hasOwnProperty.call(t,"partialSuccess")}function m4(){return{handleResponse(t){t==null||!_Ne(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||Je.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}}}var _4=U(()=>{b()});function Jg(t,e){return new KC(t.transport,t.serializer,m4(),t.promiseHandler,e.timeout)}var Zi,KC,XC=U(()=>{Zi=J(W());zg();_4();b();KC=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,r,o,s,a){this._transport=e,this._serializer=r,this._responseHandler=o,this._promiseQueue=s,this._timeout=a,this._diagLogger=Je.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,r){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){r({code:Zi.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}let o=this._serializer.serializeRequest(e);if(o==null){r({code:Zi.ExportResultCode.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(o,this._timeout).then(s=>{if(s.status==="success"){if(s.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(s.data))}catch(a){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",a,s.data)}r({code:Zi.ExportResultCode.SUCCESS});return}else if(s.status==="failure"&&s.error){r({code:Zi.ExportResultCode.FAILED,error:s.error});return}else s.status==="retryable"?r({code:Zi.ExportResultCode.FAILED,error:new Ti("Export failed with retryable status")}):r({code:Zi.ExportResultCode.FAILED,error:new Ti("Export failed with unknown error")})},s=>r({code:Zi.ExportResultCode.FAILED,error:s})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}});function g4(t,e,r){return Jg({transport:r,serializer:e,promiseHandler:Xg(t)},{timeout:t.timeoutMillis})}var E4=U(()=>{WC();XC()});var Un={};Zd(Un,{CompressionAlgorithm:()=>Kg,OTLPExporterBase:()=>Hg,OTLPExporterError:()=>Ti,createOtlpNetworkExportDelegate:()=>g4,getSharedConfigurationDefaults:()=>Wg,mergeOtlpSharedConfigurationWithDefaults:()=>Yg});var kn=U(()=>{f4();zg();bl();h4();E4()});var JC=p((dZe,S4)=>{"use strict";S4.exports=gNe;function gNe(t,e){for(var r=new Array(arguments.length-1),o=0,s=2,a=!0;s<arguments.length;)r[o++]=arguments[s++];return new Promise(function(n,c){r[o]=function(l){if(a)if(a=!1,l)c(l);else{for(var d=new Array(arguments.length-1),h=0;h<d.length;)d[h++]=arguments[h];n.apply(null,d)}};try{t.apply(e||null,r)}catch(u){a&&(a=!1,c(u))}})}});var A4=p(v4=>{"use strict";var Qg=v4;Qg.length=function(e){var r=e.length;if(!r)return 0;for(var o=0;--r%4>1&&e.charAt(r)==="=";)++o;return Math.ceil(e.length*3)/4-o};var mc=new Array(64),y4=new Array(123);for(jr=0;jr<64;)y4[mc[jr]=jr<26?jr+65:jr<52?jr+71:jr<62?jr-4:jr-59|43]=jr++;var jr;Qg.encode=function(e,r,o){for(var s=null,a=[],i=0,n=0,c;r<o;){var u=e[r++];switch(n){case 0:a[i++]=mc[u>>2],c=(u&3)<<4,n=1;break;case 1:a[i++]=mc[c|u>>4],c=(u&15)<<2,n=2;break;case 2:a[i++]=mc[c|u>>6],a[i++]=mc[u&63],n=0;break}i>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,a)),i=0)}return n&&(a[i++]=mc[c],a[i++]=61,n===1&&(a[i++]=61)),s?(i&&s.push(String.fromCharCode.apply(String,a.slice(0,i))),s.join("")):String.fromCharCode.apply(String,a.slice(0,i))};var T4="invalid encoding";Qg.decode=function(e,r,o){for(var s=o,a=0,i,n=0;n<e.length;){var c=e.charCodeAt(n++);if(c===61&&a>1)break;if((c=y4[c])===void 0)throw Error(T4);switch(a){case 0:i=c,a=1;break;case 1:r[o++]=i<<2|(c&48)>>4,i=c,a=2;break;case 2:r[o++]=(i&15)<<4|(c&60)>>2,i=c,a=3;break;case 3:r[o++]=(i&3)<<6|c,a=0;break}}if(a===1)throw Error(T4);return o-s};Qg.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var b4=p((fZe,O4)=>{"use strict";O4.exports=Zg;function Zg(){this._listeners={}}Zg.prototype.on=function(e,r,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:o||this}),this};Zg.prototype.off=function(e,r){if(e===void 0)this._listeners={};else if(r===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],s=0;s<o.length;)o[s].fn===r?o.splice(s,1):++s;return this};Zg.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var o=[],s=1;s<arguments.length;)o.push(arguments[s++]);for(s=0;s<r.length;)r[s].fn.apply(r[s++].ctx,o)}return this}});var x4=p((hZe,I4)=>{"use strict";I4.exports=R4(R4);function R4(t){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),o=r[3]===128;function s(c,u,l){e[0]=c,u[l]=r[0],u[l+1]=r[1],u[l+2]=r[2],u[l+3]=r[3]}function a(c,u,l){e[0]=c,u[l]=r[3],u[l+1]=r[2],u[l+2]=r[1],u[l+3]=r[0]}t.writeFloatLE=o?s:a,t.writeFloatBE=o?a:s;function i(c,u){return r[0]=c[u],r[1]=c[u+1],r[2]=c[u+2],r[3]=c[u+3],e[0]}function n(c,u){return r[3]=c[u],r[2]=c[u+1],r[1]=c[u+2],r[0]=c[u+3],e[0]}t.readFloatLE=o?i:n,t.readFloatBE=o?n:i})():(function(){function e(o,s,a,i){var n=s<0?1:0;if(n&&(s=-s),s===0)o(1/s>0?0:2147483648,a,i);else if(isNaN(s))o(2143289344,a,i);else if(s>34028234663852886e22)o((n<<31|2139095040)>>>0,a,i);else if(s<11754943508222875e-54)o((n<<31|Math.round(s/1401298464324817e-60))>>>0,a,i);else{var c=Math.floor(Math.log(s)/Math.LN2),u=Math.round(s*Math.pow(2,-c)*8388608)&8388607;o((n<<31|c+127<<23|u)>>>0,a,i)}}t.writeFloatLE=e.bind(null,P4),t.writeFloatBE=e.bind(null,C4);function r(o,s,a){var i=o(s,a),n=(i>>31)*2+1,c=i>>>23&255,u=i&8388607;return c===255?u?NaN:n*(1/0):c===0?n*1401298464324817e-60*u:n*Math.pow(2,c-150)*(u+8388608)}t.readFloatLE=r.bind(null,N4),t.readFloatBE=r.bind(null,M4)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),o=r[7]===128;function s(c,u,l){e[0]=c,u[l]=r[0],u[l+1]=r[1],u[l+2]=r[2],u[l+3]=r[3],u[l+4]=r[4],u[l+5]=r[5],u[l+6]=r[6],u[l+7]=r[7]}function a(c,u,l){e[0]=c,u[l]=r[7],u[l+1]=r[6],u[l+2]=r[5],u[l+3]=r[4],u[l+4]=r[3],u[l+5]=r[2],u[l+6]=r[1],u[l+7]=r[0]}t.writeDoubleLE=o?s:a,t.writeDoubleBE=o?a:s;function i(c,u){return r[0]=c[u],r[1]=c[u+1],r[2]=c[u+2],r[3]=c[u+3],r[4]=c[u+4],r[5]=c[u+5],r[6]=c[u+6],r[7]=c[u+7],e[0]}function n(c,u){return r[7]=c[u],r[6]=c[u+1],r[5]=c[u+2],r[4]=c[u+3],r[3]=c[u+4],r[2]=c[u+5],r[1]=c[u+6],r[0]=c[u+7],e[0]}t.readDoubleLE=o?i:n,t.readDoubleBE=o?n:i})():(function(){function e(o,s,a,i,n,c){var u=i<0?1:0;if(u&&(i=-i),i===0)o(0,n,c+s),o(1/i>0?0:2147483648,n,c+a);else if(isNaN(i))o(0,n,c+s),o(2146959360,n,c+a);else if(i>17976931348623157e292)o(0,n,c+s),o((u<<31|2146435072)>>>0,n,c+a);else{var l;if(i<22250738585072014e-324)l=i/5e-324,o(l>>>0,n,c+s),o((u<<31|l/4294967296)>>>0,n,c+a);else{var d=Math.floor(Math.log(i)/Math.LN2);d===1024&&(d=1023),l=i*Math.pow(2,-d),o(l*4503599627370496>>>0,n,c+s),o((u<<31|d+1023<<20|l*1048576&1048575)>>>0,n,c+a)}}}t.writeDoubleLE=e.bind(null,P4,0,4),t.writeDoubleBE=e.bind(null,C4,4,0);function r(o,s,a,i,n){var c=o(i,n+s),u=o(i,n+a),l=(u>>31)*2+1,d=u>>>20&2047,h=4294967296*(u&1048575)+c;return d===2047?h?NaN:l*(1/0):d===0?l*5e-324*h:l*Math.pow(2,d-1075)*(h+4503599627370496)}t.readDoubleLE=r.bind(null,N4,0,4),t.readDoubleBE=r.bind(null,M4,4,0)})(),t}function P4(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 C4(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 N4(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function M4(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var QC=p((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}});var L4=p(w4=>{"use strict";var ZC=w4;ZC.length=function(e){for(var r=0,o=0,s=0;s<e.length;++s)o=e.charCodeAt(s),o<128?r+=1:o<2048?r+=2:(o&64512)===55296&&(e.charCodeAt(s+1)&64512)===56320?(++s,r+=4):r+=3;return r};ZC.read=function(e,r,o){var s=o-r;if(s<1)return"";for(var a=null,i=[],n=0,c;r<o;)c=e[r++],c<128?i[n++]=c:c>191&&c<224?i[n++]=(c&31)<<6|e[r++]&63:c>239&&c<365?(c=((c&7)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,i[n++]=55296+(c>>10),i[n++]=56320+(c&1023)):i[n++]=(c&15)<<12|(e[r++]&63)<<6|e[r++]&63,n>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,i)),n=0);return a?(n&&a.push(String.fromCharCode.apply(String,i.slice(0,n))),a.join("")):String.fromCharCode.apply(String,i.slice(0,n))};ZC.write=function(e,r,o){for(var s=o,a,i,n=0;n<e.length;++n)a=e.charCodeAt(n),a<128?r[o++]=a:a<2048?(r[o++]=a>>6|192,r[o++]=a&63|128):(a&64512)===55296&&((i=e.charCodeAt(n+1))&64512)===56320?(a=65536+((a&1023)<<10)+(i&1023),++n,r[o++]=a>>18|240,r[o++]=a>>12&63|128,r[o++]=a>>6&63|128,r[o++]=a&63|128):(r[o++]=a>>12|224,r[o++]=a>>6&63|128,r[o++]=a&63|128);return o-s}});var U4=p((_Ze,D4)=>{"use strict";D4.exports=ENe;function ENe(t,e,r){var o=r||8192,s=o>>>1,a=null,i=o;return function(c){if(c<1||c>s)return t(c);i+c>o&&(a=t(o),i=0);var u=e.call(a,i,i+=c);return i&7&&(i=(i|7)+1),u}}});var B4=p((gZe,k4)=>{"use strict";k4.exports=rt;var Rl=Bn();function rt(t,e){this.lo=t>>>0,this.hi=e>>>0}var ds=rt.zero=new rt(0,0);ds.toNumber=function(){return 0};ds.zzEncode=ds.zzDecode=function(){return this};ds.length=function(){return 1};var SNe=rt.zeroHash="\0\0\0\0\0\0\0\0";rt.fromNumber=function(e){if(e===0)return ds;var r=e<0;r&&(e=-e);var o=e>>>0,s=(e-o)/4294967296>>>0;return r&&(s=~s>>>0,o=~o>>>0,++o>4294967295&&(o=0,++s>4294967295&&(s=0))),new rt(o,s)};rt.from=function(e){if(typeof e=="number")return rt.fromNumber(e);if(Rl.isString(e))if(Rl.Long)e=Rl.Long.fromString(e);else return rt.fromNumber(parseInt(e,10));return e.low||e.high?new rt(e.low>>>0,e.high>>>0):ds};rt.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,o=~this.hi>>>0;return r||(o=o+1>>>0),-(r+o*4294967296)}return this.lo+this.hi*4294967296};rt.prototype.toLong=function(e){return Rl.Long?new Rl.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var eo=String.prototype.charCodeAt;rt.fromHash=function(e){return e===SNe?ds:new rt((eo.call(e,0)|eo.call(e,1)<<8|eo.call(e,2)<<16|eo.call(e,3)<<24)>>>0,(eo.call(e,4)|eo.call(e,5)<<8|eo.call(e,6)<<16|eo.call(e,7)<<24)>>>0)};rt.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)};rt.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};rt.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};rt.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:o<128?9:10}});var Bn=p(eN=>{"use strict";var K=eN;K.asPromise=JC();K.base64=A4();K.EventEmitter=b4();K.float=x4();K.inquire=QC();K.utf8=L4();K.pool=U4();K.LongBits=B4();K.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);K.global=K.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||eN;K.emptyArray=Object.freeze?Object.freeze([]):[];K.emptyObject=Object.freeze?Object.freeze({}):{};K.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};K.isString=function(e){return typeof e=="string"||e instanceof String};K.isObject=function(e){return e&&typeof e=="object"};K.isset=K.isSet=function(e,r){var o=e[r];return o!=null&&e.hasOwnProperty(r)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1};K.Buffer=(function(){try{var t=K.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch{return null}})();K._Buffer_from=null;K._Buffer_allocUnsafe=null;K.newBuffer=function(e){return typeof e=="number"?K.Buffer?K._Buffer_allocUnsafe(e):new K.Array(e):K.Buffer?K._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};K.Array=typeof Uint8Array<"u"?Uint8Array:Array;K.Long=K.global.dcodeIO&&K.global.dcodeIO.Long||K.global.Long||K.inquire("long");K.key2Re=/^true|false|0|1$/;K.key32Re=/^-?(?:0|[1-9][0-9]*)$/;K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;K.longToHash=function(e){return e?K.LongBits.from(e).toHash():K.LongBits.zeroHash};K.longFromHash=function(e,r){var o=K.LongBits.fromHash(e);return K.Long?K.Long.fromBits(o.lo,o.hi,r):o.toNumber(!!r)};function F4(t,e,r){for(var o=Object.keys(e),s=0;s<o.length;++s)(t[o[s]]===void 0||!r)&&(t[o[s]]=e[o[s]]);return t}K.merge=F4;K.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function V4(t){function e(r,o){if(!(this instanceof e))return new e(r,o);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&F4(this,o)}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}K.newError=V4;K.ProtocolError=V4("ProtocolError");K.oneOfGetter=function(e){for(var r={},o=0;o<e.length;++o)r[e[o]]=1;return function(){for(var s=Object.keys(this),a=s.length-1;a>-1;--a)if(r[s[a]]===1&&this[s[a]]!==void 0&&this[s[a]]!==null)return s[a]}};K.oneOfSetter=function(e){return function(r){for(var o=0;o<e.length;++o)e[o]!==r&&delete this[e[o]]}};K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};K._configure=function(){var t=K.Buffer;if(!t){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,o){return new t(r,o)},K._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var tE=p((SZe,H4)=>{"use strict";H4.exports=de;var Ar=Bn(),tN,eE=Ar.LongBits,G4=Ar.base64,q4=Ar.utf8;function Pl(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function nN(){}function TNe(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function de(){this.len=0,this.head=new Pl(nN,0,0),this.tail=this.head,this.states=null}var j4=function(){return Ar.Buffer?function(){return(de.create=function(){return new tN})()}:function(){return new de}};de.create=j4();de.alloc=function(e){return new Ar.Array(e)};Ar.Array!==Array&&(de.alloc=Ar.pool(de.alloc,Ar.Array.prototype.subarray));de.prototype._push=function(e,r,o){return this.tail=this.tail.next=new Pl(e,r,o),this.len+=r,this};function iN(t,e,r){e[r]=t&255}function yNe(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function oN(t,e){this.len=t,this.next=void 0,this.val=e}oN.prototype=Object.create(Pl.prototype);oN.prototype.fn=yNe;de.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new oN((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};de.prototype.int32=function(e){return e<0?this._push(sN,10,eE.fromNumber(e)):this.uint32(e)};de.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function sN(t,e,r){for(;t.hi;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}de.prototype.uint64=function(e){var r=eE.from(e);return this._push(sN,r.length(),r)};de.prototype.int64=de.prototype.uint64;de.prototype.sint64=function(e){var r=eE.from(e).zzEncode();return this._push(sN,r.length(),r)};de.prototype.bool=function(e){return this._push(iN,1,e?1:0)};function rN(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}de.prototype.fixed32=function(e){return this._push(rN,4,e>>>0)};de.prototype.sfixed32=de.prototype.fixed32;de.prototype.fixed64=function(e){var r=eE.from(e);return this._push(rN,4,r.lo)._push(rN,4,r.hi)};de.prototype.sfixed64=de.prototype.fixed64;de.prototype.float=function(e){return this._push(Ar.float.writeFloatLE,4,e)};de.prototype.double=function(e){return this._push(Ar.float.writeDoubleLE,8,e)};var vNe=Ar.Array.prototype.set?function(e,r,o){r.set(e,o)}:function(e,r,o){for(var s=0;s<e.length;++s)r[o+s]=e[s]};de.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(iN,1,0);if(Ar.isString(e)){var o=de.alloc(r=G4.length(e));G4.decode(e,o,0),e=o}return this.uint32(r)._push(vNe,r,e)};de.prototype.string=function(e){var r=q4.length(e);return r?this.uint32(r)._push(q4.write,r,e):this._push(iN,1,0)};de.prototype.fork=function(){return this.states=new TNe(this),this.head=this.tail=new Pl(nN,0,0),this.len=0,this};de.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 Pl(nN,0,0),this.len=0),this};de.prototype.ldelim=function(){var e=this.head,r=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=r,this.len+=o),this};de.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,r,o),o+=e.len,e=e.next;return r};de._configure=function(t){tN=t,de.create=j4(),tN._configure()}});var Y4=p((TZe,$4)=>{"use strict";$4.exports=Fn;var z4=tE();(Fn.prototype=Object.create(z4.prototype)).constructor=Fn;var to=Bn();function Fn(){z4.call(this)}Fn._configure=function(){Fn.alloc=to._Buffer_allocUnsafe,Fn.writeBytesBuffer=to.Buffer&&to.Buffer.prototype instanceof Uint8Array&&to.Buffer.prototype.set.name==="set"?function(e,r,o){r.set(e,o)}:function(e,r,o){if(e.copy)e.copy(r,o,0,e.length);else for(var s=0;s<e.length;)r[o++]=e[s++]}};Fn.prototype.bytes=function(e){to.isString(e)&&(e=to._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(Fn.writeBytesBuffer,r,e),this};function ANe(t,e,r){t.length<40?to.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}Fn.prototype.string=function(e){var r=to.Buffer.byteLength(e);return this.uint32(r),r&&this._push(ANe,r,e),this};Fn._configure()});var nE=p((yZe,Q4)=>{"use strict";Q4.exports=Be;var Hr=Bn(),cN,X4=Hr.LongBits,ONe=Hr.utf8;function zr(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Be(t){this.buf=t,this.pos=0,this.len=t.length}var W4=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Be(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Be(e);throw Error("illegal buffer")},J4=function(){return Hr.Buffer?function(r){return(Be.create=function(s){return Hr.Buffer.isBuffer(s)?new cN(s):W4(s)})(r)}:W4};Be.create=J4();Be.prototype._slice=Hr.Array.prototype.subarray||Hr.Array.prototype.slice;Be.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,zr(this,10);return e}})();Be.prototype.int32=function(){return this.uint32()|0};Be.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function aN(){var t=new X4(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 zr(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 zr(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")}Be.prototype.bool=function(){return this.uint32()!==0};function rE(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Be.prototype.fixed32=function(){if(this.pos+4>this.len)throw zr(this,4);return rE(this.buf,this.pos+=4)};Be.prototype.sfixed32=function(){if(this.pos+4>this.len)throw zr(this,4);return rE(this.buf,this.pos+=4)|0};function K4(){if(this.pos+8>this.len)throw zr(this,8);return new X4(rE(this.buf,this.pos+=4),rE(this.buf,this.pos+=4))}Be.prototype.float=function(){if(this.pos+4>this.len)throw zr(this,4);var e=Hr.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Be.prototype.double=function(){if(this.pos+8>this.len)throw zr(this,4);var e=Hr.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Be.prototype.bytes=function(){var e=this.uint32(),r=this.pos,o=this.pos+e;if(o>this.len)throw zr(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,o);if(r===o){var s=Hr.Buffer;return s?s.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,o)};Be.prototype.string=function(){var e=this.bytes();return ONe.read(e,0,e.length)};Be.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw zr(this,e);this.pos+=e}else do if(this.pos>=this.len)throw zr(this);while(this.buf[this.pos++]&128);return this};Be.prototype.skipType=function(t){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);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Be._configure=function(t){cN=t,Be.create=J4(),cN._configure();var e=Hr.Long?"toLong":"toNumber";Hr.merge(Be.prototype,{int64:function(){return aN.call(this)[e](!1)},uint64:function(){return aN.call(this)[e](!0)},sint64:function(){return aN.call(this).zzDecode()[e](!1)},fixed64:function(){return K4.call(this)[e](!0)},sfixed64:function(){return K4.call(this)[e](!1)}})}});var r8=p((vZe,t8)=>{"use strict";t8.exports=ps;var e8=nE();(ps.prototype=Object.create(e8.prototype)).constructor=ps;var Z4=Bn();function ps(t){e8.call(this,t)}ps._configure=function(){Z4.Buffer&&(ps.prototype._slice=Z4.Buffer.prototype.slice)};ps.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))};ps._configure()});var i8=p((AZe,n8)=>{"use strict";n8.exports=Cl;var uN=Bn();(Cl.prototype=Object.create(uN.EventEmitter.prototype)).constructor=Cl;function Cl(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");uN.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!r}Cl.prototype.rpcCall=function t(e,r,o,s,a){if(!s)throw TypeError("request must be specified");var i=this;if(!a)return uN.asPromise(t,i,e,r,o,s);if(!i.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return i.rpcImpl(e,r[i.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(c,u){if(c)return i.emit("error",c,e),a(c);if(u===null){i.end(!0);return}if(!(u instanceof o))try{u=o[i.responseDelimited?"decodeDelimited":"decode"](u)}catch(l){return i.emit("error",l,e),a(l)}return i.emit("data",u,e),a(null,u)})}catch(n){i.emit("error",n,e),setTimeout(function(){a(n)},0);return}};Cl.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var lN=p(o8=>{"use strict";var bNe=o8;bNe.Service=i8()});var dN=p((bZe,s8)=>{"use strict";s8.exports={}});var pN=p(c8=>{"use strict";var Wt=c8;Wt.build="minimal";Wt.Writer=tE();Wt.BufferWriter=Y4();Wt.Reader=nE();Wt.BufferReader=r8();Wt.util=Bn();Wt.rpc=lN();Wt.roots=dN();Wt.configure=a8;function a8(){Wt.util._configure(),Wt.Writer._configure(Wt.BufferWriter),Wt.Reader._configure(Wt.BufferReader)}a8()});var l8=p((PZe,u8)=>{"use strict";u8.exports=pN()});var iE=p((d8,p8)=>{"use strict";Object.defineProperty(d8,"__esModule",{value:!0});var X=l8(),T=X.Reader,ee=X.Writer,m=X.util,f=X.roots.default||(X.roots.default={});f.opentelemetry=(function(){var t={};return t.proto=(function(){var e={};return e.common=(function(){var r={};return r.v1=(function(){var o={};return o.AnyValue=(function(){function s(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}s.prototype.stringValue=null,s.prototype.boolValue=null,s.prototype.intValue=null,s.prototype.doubleValue=null,s.prototype.arrayValue=null,s.prototype.kvlistValue=null,s.prototype.bytesValue=null;var a;return Object.defineProperty(s.prototype,"value",{get:m.oneOfGetter(a=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:m.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,c){return c||(c=ee.create()),n.stringValue!=null&&Object.hasOwnProperty.call(n,"stringValue")&&c.uint32(10).string(n.stringValue),n.boolValue!=null&&Object.hasOwnProperty.call(n,"boolValue")&&c.uint32(16).bool(n.boolValue),n.intValue!=null&&Object.hasOwnProperty.call(n,"intValue")&&c.uint32(24).int64(n.intValue),n.doubleValue!=null&&Object.hasOwnProperty.call(n,"doubleValue")&&c.uint32(33).double(n.doubleValue),n.arrayValue!=null&&Object.hasOwnProperty.call(n,"arrayValue")&&f.opentelemetry.proto.common.v1.ArrayValue.encode(n.arrayValue,c.uint32(42).fork()).ldelim(),n.kvlistValue!=null&&Object.hasOwnProperty.call(n,"kvlistValue")&&f.opentelemetry.proto.common.v1.KeyValueList.encode(n.kvlistValue,c.uint32(50).fork()).ldelim(),n.bytesValue!=null&&Object.hasOwnProperty.call(n,"bytesValue")&&c.uint32(58).bytes(n.bytesValue),c},s.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},s.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.common.v1.AnyValue;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.stringValue=n.string();break}case 2:{d.boolValue=n.bool();break}case 3:{d.intValue=n.int64();break}case 4:{d.doubleValue=n.double();break}case 5:{d.arrayValue=f.opentelemetry.proto.common.v1.ArrayValue.decode(n,n.uint32());break}case 6:{d.kvlistValue=f.opentelemetry.proto.common.v1.KeyValueList.decode(n,n.uint32());break}case 7:{d.bytesValue=n.bytes();break}default:n.skipType(h&7);break}}return d},s.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var c={};if(n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(c.value=1,!m.isString(n.stringValue)))return"stringValue: string expected";if(n.boolValue!=null&&n.hasOwnProperty("boolValue")){if(c.value===1)return"value: multiple values";if(c.value=1,typeof n.boolValue!="boolean")return"boolValue: boolean expected"}if(n.intValue!=null&&n.hasOwnProperty("intValue")){if(c.value===1)return"value: multiple values";if(c.value=1,!m.isInteger(n.intValue)&&!(n.intValue&&m.isInteger(n.intValue.low)&&m.isInteger(n.intValue.high)))return"intValue: integer|Long expected"}if(n.doubleValue!=null&&n.hasOwnProperty("doubleValue")){if(c.value===1)return"value: multiple values";if(c.value=1,typeof n.doubleValue!="number")return"doubleValue: number expected"}if(n.arrayValue!=null&&n.hasOwnProperty("arrayValue")){if(c.value===1)return"value: multiple values";c.value=1;{var u=f.opentelemetry.proto.common.v1.ArrayValue.verify(n.arrayValue);if(u)return"arrayValue."+u}}if(n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")){if(c.value===1)return"value: multiple values";c.value=1;{var u=f.opentelemetry.proto.common.v1.KeyValueList.verify(n.kvlistValue);if(u)return"kvlistValue."+u}}if(n.bytesValue!=null&&n.hasOwnProperty("bytesValue")){if(c.value===1)return"value: multiple values";if(c.value=1,!(n.bytesValue&&typeof n.bytesValue.length=="number"||m.isString(n.bytesValue)))return"bytesValue: buffer expected"}return null},s.fromObject=function(n){if(n instanceof f.opentelemetry.proto.common.v1.AnyValue)return n;var c=new f.opentelemetry.proto.common.v1.AnyValue;if(n.stringValue!=null&&(c.stringValue=String(n.stringValue)),n.boolValue!=null&&(c.boolValue=!!n.boolValue),n.intValue!=null&&(m.Long?(c.intValue=m.Long.fromValue(n.intValue)).unsigned=!1:typeof n.intValue=="string"?c.intValue=parseInt(n.intValue,10):typeof n.intValue=="number"?c.intValue=n.intValue:typeof n.intValue=="object"&&(c.intValue=new m.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber())),n.doubleValue!=null&&(c.doubleValue=Number(n.doubleValue)),n.arrayValue!=null){if(typeof n.arrayValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");c.arrayValue=f.opentelemetry.proto.common.v1.ArrayValue.fromObject(n.arrayValue)}if(n.kvlistValue!=null){if(typeof n.kvlistValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");c.kvlistValue=f.opentelemetry.proto.common.v1.KeyValueList.fromObject(n.kvlistValue)}return n.bytesValue!=null&&(typeof n.bytesValue=="string"?m.base64.decode(n.bytesValue,c.bytesValue=m.newBuffer(m.base64.length(n.bytesValue)),0):n.bytesValue.length>=0&&(c.bytesValue=n.bytesValue)),c},s.toObject=function(n,c){c||(c={});var u={};return n.stringValue!=null&&n.hasOwnProperty("stringValue")&&(u.stringValue=n.stringValue,c.oneofs&&(u.value="stringValue")),n.boolValue!=null&&n.hasOwnProperty("boolValue")&&(u.boolValue=n.boolValue,c.oneofs&&(u.value="boolValue")),n.intValue!=null&&n.hasOwnProperty("intValue")&&(typeof n.intValue=="number"?u.intValue=c.longs===String?String(n.intValue):n.intValue:u.intValue=c.longs===String?m.Long.prototype.toString.call(n.intValue):c.longs===Number?new m.LongBits(n.intValue.low>>>0,n.intValue.high>>>0).toNumber():n.intValue,c.oneofs&&(u.value="intValue")),n.doubleValue!=null&&n.hasOwnProperty("doubleValue")&&(u.doubleValue=c.json&&!isFinite(n.doubleValue)?String(n.doubleValue):n.doubleValue,c.oneofs&&(u.value="doubleValue")),n.arrayValue!=null&&n.hasOwnProperty("arrayValue")&&(u.arrayValue=f.opentelemetry.proto.common.v1.ArrayValue.toObject(n.arrayValue,c),c.oneofs&&(u.value="arrayValue")),n.kvlistValue!=null&&n.hasOwnProperty("kvlistValue")&&(u.kvlistValue=f.opentelemetry.proto.common.v1.KeyValueList.toObject(n.kvlistValue,c),c.oneofs&&(u.value="kvlistValue")),n.bytesValue!=null&&n.hasOwnProperty("bytesValue")&&(u.bytesValue=c.bytes===String?m.base64.encode(n.bytesValue,0,n.bytesValue.length):c.bytes===Array?Array.prototype.slice.call(n.bytesValue):n.bytesValue,c.oneofs&&(u.value="bytesValue")),u},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.common.v1.AnyValue"},s})(),o.ArrayValue=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.values!=null&&i.values.length)for(var c=0;c<i.values.length;++c)f.opentelemetry.proto.common.v1.AnyValue.encode(i.values[c],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.common.v1.ArrayValue;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.values&&l.values.length||(l.values=[]),l.values.push(f.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var c=f.opentelemetry.proto.common.v1.AnyValue.verify(i.values[n]);if(c)return"values."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.common.v1.ArrayValue)return i;var n=new f.opentelemetry.proto.common.v1.ArrayValue;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");n.values=[];for(var c=0;c<i.values.length;++c){if(typeof i.values[c]!="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");n.values[c]=f.opentelemetry.proto.common.v1.AnyValue.fromObject(i.values[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.values=[]),i.values&&i.values.length){c.values=[];for(var u=0;u<i.values.length;++u)c.values[u]=f.opentelemetry.proto.common.v1.AnyValue.toObject(i.values[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.ArrayValue"},s})(),o.KeyValueList=(function(){function s(a){if(this.values=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.values=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.values!=null&&i.values.length)for(var c=0;c<i.values.length;++c)f.opentelemetry.proto.common.v1.KeyValue.encode(i.values[c],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.common.v1.KeyValueList;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.values&&l.values.length||(l.values=[]),l.values.push(f.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.values!=null&&i.hasOwnProperty("values")){if(!Array.isArray(i.values))return"values: array expected";for(var n=0;n<i.values.length;++n){var c=f.opentelemetry.proto.common.v1.KeyValue.verify(i.values[n]);if(c)return"values."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.common.v1.KeyValueList)return i;var n=new f.opentelemetry.proto.common.v1.KeyValueList;if(i.values){if(!Array.isArray(i.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");n.values=[];for(var c=0;c<i.values.length;++c){if(typeof i.values[c]!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");n.values[c]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(i.values[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.values=[]),i.values&&i.values.length){c.values=[];for(var u=0;u<i.values.length;++u)c.values[u]=f.opentelemetry.proto.common.v1.KeyValue.toObject(i.values[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValueList"},s})(),o.KeyValue=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.key=null,s.prototype.value=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=ee.create()),i.key!=null&&Object.hasOwnProperty.call(i,"key")&&n.uint32(10).string(i.key),i.value!=null&&Object.hasOwnProperty.call(i,"value")&&f.opentelemetry.proto.common.v1.AnyValue.encode(i.value,n.uint32(18).fork()).ldelim(),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.common.v1.KeyValue;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.key=i.string();break}case 2:{l.value=f.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.key!=null&&i.hasOwnProperty("key")&&!m.isString(i.key))return"key: string expected";if(i.value!=null&&i.hasOwnProperty("value")){var n=f.opentelemetry.proto.common.v1.AnyValue.verify(i.value);if(n)return"value."+n}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.common.v1.KeyValue)return i;var n=new f.opentelemetry.proto.common.v1.KeyValue;if(i.key!=null&&(n.key=String(i.key)),i.value!=null){if(typeof i.value!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");n.value=f.opentelemetry.proto.common.v1.AnyValue.fromObject(i.value)}return n},s.toObject=function(i,n){n||(n={});var c={};return n.defaults&&(c.key="",c.value=null),i.key!=null&&i.hasOwnProperty("key")&&(c.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(c.value=f.opentelemetry.proto.common.v1.AnyValue.toObject(i.value,n)),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.KeyValue"},s})(),o.InstrumentationScope=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.name=null,s.prototype.version=null,s.prototype.attributes=m.emptyArray,s.prototype.droppedAttributesCount=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(10).string(i.name),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&n.uint32(18).string(i.version),i.attributes!=null&&i.attributes.length)for(var c=0;c<i.attributes.length;++c)f.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[c],n.uint32(26).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(32).uint32(i.droppedAttributesCount),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.common.v1.InstrumentationScope;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.name=i.string();break}case 2:{l.version=i.string();break}case 3:{l.attributes&&l.attributes.length||(l.attributes=[]),l.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 4:{l.droppedAttributesCount=i.uint32();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.name!=null&&i.hasOwnProperty("name")&&!m.isString(i.name))return"name: string expected";if(i.version!=null&&i.hasOwnProperty("version")&&!m.isString(i.version))return"version: string expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var c=f.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(c)return"attributes."+c}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!m.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.common.v1.InstrumentationScope)return i;var n=new f.opentelemetry.proto.common.v1.InstrumentationScope;if(i.name!=null&&(n.name=String(i.name)),i.version!=null&&(n.version=String(i.version)),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");n.attributes=[];for(var c=0;c<i.attributes.length;++c){if(typeof i.attributes[c]!="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");n.attributes[c]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[c])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.attributes=[]),n.defaults&&(c.name="",c.version="",c.droppedAttributesCount=0),i.name!=null&&i.hasOwnProperty("name")&&(c.name=i.name),i.version!=null&&i.hasOwnProperty("version")&&(c.version=i.version),i.attributes&&i.attributes.length){c.attributes=[];for(var u=0;u<i.attributes.length;++u)c.attributes[u]=f.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=i.droppedAttributesCount),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.InstrumentationScope"},s})(),o.EntityRef=(function(){function s(a){if(this.idKeys=[],this.descriptionKeys=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.schemaUrl=null,s.prototype.type=null,s.prototype.idKeys=m.emptyArray,s.prototype.descriptionKeys=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(10).string(i.schemaUrl),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&n.uint32(18).string(i.type),i.idKeys!=null&&i.idKeys.length)for(var c=0;c<i.idKeys.length;++c)n.uint32(26).string(i.idKeys[c]);if(i.descriptionKeys!=null&&i.descriptionKeys.length)for(var c=0;c<i.descriptionKeys.length;++c)n.uint32(34).string(i.descriptionKeys[c]);return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.common.v1.EntityRef;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.schemaUrl=i.string();break}case 2:{l.type=i.string();break}case 3:{l.idKeys&&l.idKeys.length||(l.idKeys=[]),l.idKeys.push(i.string());break}case 4:{l.descriptionKeys&&l.descriptionKeys.length||(l.descriptionKeys=[]),l.descriptionKeys.push(i.string());break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!m.isString(i.schemaUrl))return"schemaUrl: string expected";if(i.type!=null&&i.hasOwnProperty("type")&&!m.isString(i.type))return"type: string expected";if(i.idKeys!=null&&i.hasOwnProperty("idKeys")){if(!Array.isArray(i.idKeys))return"idKeys: array expected";for(var n=0;n<i.idKeys.length;++n)if(!m.isString(i.idKeys[n]))return"idKeys: string[] expected"}if(i.descriptionKeys!=null&&i.hasOwnProperty("descriptionKeys")){if(!Array.isArray(i.descriptionKeys))return"descriptionKeys: array expected";for(var n=0;n<i.descriptionKeys.length;++n)if(!m.isString(i.descriptionKeys[n]))return"descriptionKeys: string[] expected"}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.common.v1.EntityRef)return i;var n=new f.opentelemetry.proto.common.v1.EntityRef;if(i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),i.type!=null&&(n.type=String(i.type)),i.idKeys){if(!Array.isArray(i.idKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected");n.idKeys=[];for(var c=0;c<i.idKeys.length;++c)n.idKeys[c]=String(i.idKeys[c])}if(i.descriptionKeys){if(!Array.isArray(i.descriptionKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected");n.descriptionKeys=[];for(var c=0;c<i.descriptionKeys.length;++c)n.descriptionKeys[c]=String(i.descriptionKeys[c])}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.idKeys=[],c.descriptionKeys=[]),n.defaults&&(c.schemaUrl="",c.type=""),i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(c.schemaUrl=i.schemaUrl),i.type!=null&&i.hasOwnProperty("type")&&(c.type=i.type),i.idKeys&&i.idKeys.length){c.idKeys=[];for(var u=0;u<i.idKeys.length;++u)c.idKeys[u]=i.idKeys[u]}if(i.descriptionKeys&&i.descriptionKeys.length){c.descriptionKeys=[];for(var u=0;u<i.descriptionKeys.length;++u)c.descriptionKeys[u]=i.descriptionKeys[u]}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.common.v1.EntityRef"},s})(),o})(),r})(),e.resource=(function(){var r={};return r.v1=(function(){var o={};return o.Resource=(function(){function s(a){if(this.attributes=[],this.entityRefs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=m.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.entityRefs=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.attributes!=null&&i.attributes.length)for(var c=0;c<i.attributes.length;++c)f.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[c],n.uint32(10).fork()).ldelim();if(i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(16).uint32(i.droppedAttributesCount),i.entityRefs!=null&&i.entityRefs.length)for(var c=0;c<i.entityRefs.length;++c)f.opentelemetry.proto.common.v1.EntityRef.encode(i.entityRefs[c],n.uint32(26).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.resource.v1.Resource;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.attributes&&l.attributes.length||(l.attributes=[]),l.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{l.droppedAttributesCount=i.uint32();break}case 3:{l.entityRefs&&l.entityRefs.length||(l.entityRefs=[]),l.entityRefs.push(f.opentelemetry.proto.common.v1.EntityRef.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var c=f.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(c)return"attributes."+c}}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!m.isInteger(i.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(i.entityRefs!=null&&i.hasOwnProperty("entityRefs")){if(!Array.isArray(i.entityRefs))return"entityRefs: array expected";for(var n=0;n<i.entityRefs.length;++n){var c=f.opentelemetry.proto.common.v1.EntityRef.verify(i.entityRefs[n]);if(c)return"entityRefs."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.resource.v1.Resource)return i;var n=new f.opentelemetry.proto.resource.v1.Resource;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");n.attributes=[];for(var c=0;c<i.attributes.length;++c){if(typeof i.attributes[c]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");n.attributes[c]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[c])}}if(i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.entityRefs){if(!Array.isArray(i.entityRefs))throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected");n.entityRefs=[];for(var c=0;c<i.entityRefs.length;++c){if(typeof i.entityRefs[c]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected");n.entityRefs[c]=f.opentelemetry.proto.common.v1.EntityRef.fromObject(i.entityRefs[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.attributes=[],c.entityRefs=[]),n.defaults&&(c.droppedAttributesCount=0),i.attributes&&i.attributes.length){c.attributes=[];for(var u=0;u<i.attributes.length;++u)c.attributes[u]=f.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[u],n)}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=i.droppedAttributesCount),i.entityRefs&&i.entityRefs.length){c.entityRefs=[];for(var u=0;u<i.entityRefs.length;++u)c.entityRefs[u]=f.opentelemetry.proto.common.v1.EntityRef.toObject(i.entityRefs[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.resource.v1.Resource"},s})(),o})(),r})(),e.trace=(function(){var r={};return r.v1=(function(){var o={};return o.TracesData=(function(){function s(a){if(this.resourceSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceSpans=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.resourceSpans!=null&&i.resourceSpans.length)for(var c=0;c<i.resourceSpans.length;++c)f.opentelemetry.proto.trace.v1.ResourceSpans.encode(i.resourceSpans[c],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.trace.v1.TracesData;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.resourceSpans&&l.resourceSpans.length||(l.resourceSpans=[]),l.resourceSpans.push(f.opentelemetry.proto.trace.v1.ResourceSpans.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceSpans!=null&&i.hasOwnProperty("resourceSpans")){if(!Array.isArray(i.resourceSpans))return"resourceSpans: array expected";for(var n=0;n<i.resourceSpans.length;++n){var c=f.opentelemetry.proto.trace.v1.ResourceSpans.verify(i.resourceSpans[n]);if(c)return"resourceSpans."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.trace.v1.TracesData)return i;var n=new f.opentelemetry.proto.trace.v1.TracesData;if(i.resourceSpans){if(!Array.isArray(i.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");n.resourceSpans=[];for(var c=0;c<i.resourceSpans.length;++c){if(typeof i.resourceSpans[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");n.resourceSpans[c]=f.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(i.resourceSpans[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.resourceSpans=[]),i.resourceSpans&&i.resourceSpans.length){c.resourceSpans=[];for(var u=0;u<i.resourceSpans.length;++u)c.resourceSpans[u]=f.opentelemetry.proto.trace.v1.ResourceSpans.toObject(i.resourceSpans[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.TracesData"},s})(),o.ResourceSpans=(function(){function s(a){if(this.scopeSpans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeSpans=m.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&f.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeSpans!=null&&i.scopeSpans.length)for(var c=0;c<i.scopeSpans.length;++c)f.opentelemetry.proto.trace.v1.ScopeSpans.encode(i.scopeSpans[c],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.trace.v1.ResourceSpans;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.resource=f.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{l.scopeSpans&&l.scopeSpans.length||(l.scopeSpans=[]),l.scopeSpans.push(f.opentelemetry.proto.trace.v1.ScopeSpans.decode(i,i.uint32()));break}case 3:{l.schemaUrl=i.string();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=f.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeSpans!=null&&i.hasOwnProperty("scopeSpans")){if(!Array.isArray(i.scopeSpans))return"scopeSpans: array expected";for(var c=0;c<i.scopeSpans.length;++c){var n=f.opentelemetry.proto.trace.v1.ScopeSpans.verify(i.scopeSpans[c]);if(n)return"scopeSpans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!m.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.trace.v1.ResourceSpans)return i;var n=new f.opentelemetry.proto.trace.v1.ResourceSpans;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");n.resource=f.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeSpans){if(!Array.isArray(i.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");n.scopeSpans=[];for(var c=0;c<i.scopeSpans.length;++c){if(typeof i.scopeSpans[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");n.scopeSpans[c]=f.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(i.scopeSpans[c])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.scopeSpans=[]),n.defaults&&(c.resource=null,c.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(c.resource=f.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeSpans&&i.scopeSpans.length){c.scopeSpans=[];for(var u=0;u<i.scopeSpans.length;++u)c.scopeSpans[u]=f.opentelemetry.proto.trace.v1.ScopeSpans.toObject(i.scopeSpans[u],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(c.schemaUrl=i.schemaUrl),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ResourceSpans"},s})(),o.ScopeSpans=(function(){function s(a){if(this.spans=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.spans=m.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&f.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.spans!=null&&i.spans.length)for(var c=0;c<i.spans.length;++c)f.opentelemetry.proto.trace.v1.Span.encode(i.spans[c],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.trace.v1.ScopeSpans;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{l.spans&&l.spans.length||(l.spans=[]),l.spans.push(f.opentelemetry.proto.trace.v1.Span.decode(i,i.uint32()));break}case 3:{l.schemaUrl=i.string();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=f.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.spans!=null&&i.hasOwnProperty("spans")){if(!Array.isArray(i.spans))return"spans: array expected";for(var c=0;c<i.spans.length;++c){var n=f.opentelemetry.proto.trace.v1.Span.verify(i.spans[c]);if(n)return"spans."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!m.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.trace.v1.ScopeSpans)return i;var n=new f.opentelemetry.proto.trace.v1.ScopeSpans;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");n.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.spans){if(!Array.isArray(i.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");n.spans=[];for(var c=0;c<i.spans.length;++c){if(typeof i.spans[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");n.spans[c]=f.opentelemetry.proto.trace.v1.Span.fromObject(i.spans[c])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.spans=[]),n.defaults&&(c.scope=null,c.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(c.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.spans&&i.spans.length){c.spans=[];for(var u=0;u<i.spans.length;++u)c.spans[u]=f.opentelemetry.proto.trace.v1.Span.toObject(i.spans[u],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(c.schemaUrl=i.schemaUrl),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.ScopeSpans"},s})(),o.Span=(function(){function s(a){if(this.attributes=[],this.events=[],this.links=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.traceState=null,s.prototype.parentSpanId=null,s.prototype.flags=null,s.prototype.name=null,s.prototype.kind=null,s.prototype.startTimeUnixNano=null,s.prototype.endTimeUnixNano=null,s.prototype.attributes=m.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.events=m.emptyArray,s.prototype.droppedEventsCount=null,s.prototype.links=m.emptyArray,s.prototype.droppedLinksCount=null,s.prototype.status=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(10).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(18).bytes(i.spanId),i.traceState!=null&&Object.hasOwnProperty.call(i,"traceState")&&n.uint32(26).string(i.traceState),i.parentSpanId!=null&&Object.hasOwnProperty.call(i,"parentSpanId")&&n.uint32(34).bytes(i.parentSpanId),i.name!=null&&Object.hasOwnProperty.call(i,"name")&&n.uint32(42).string(i.name),i.kind!=null&&Object.hasOwnProperty.call(i,"kind")&&n.uint32(48).int32(i.kind),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(57).fixed64(i.startTimeUnixNano),i.endTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"endTimeUnixNano")&&n.uint32(65).fixed64(i.endTimeUnixNano),i.attributes!=null&&i.attributes.length)for(var c=0;c<i.attributes.length;++c)f.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[c],n.uint32(74).fork()).ldelim();if(i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(80).uint32(i.droppedAttributesCount),i.events!=null&&i.events.length)for(var c=0;c<i.events.length;++c)f.opentelemetry.proto.trace.v1.Span.Event.encode(i.events[c],n.uint32(90).fork()).ldelim();if(i.droppedEventsCount!=null&&Object.hasOwnProperty.call(i,"droppedEventsCount")&&n.uint32(96).uint32(i.droppedEventsCount),i.links!=null&&i.links.length)for(var c=0;c<i.links.length;++c)f.opentelemetry.proto.trace.v1.Span.Link.encode(i.links[c],n.uint32(106).fork()).ldelim();return i.droppedLinksCount!=null&&Object.hasOwnProperty.call(i,"droppedLinksCount")&&n.uint32(112).uint32(i.droppedLinksCount),i.status!=null&&Object.hasOwnProperty.call(i,"status")&&f.opentelemetry.proto.trace.v1.Status.encode(i.status,n.uint32(122).fork()).ldelim(),i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(133).fixed32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.trace.v1.Span;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.traceId=i.bytes();break}case 2:{l.spanId=i.bytes();break}case 3:{l.traceState=i.string();break}case 4:{l.parentSpanId=i.bytes();break}case 16:{l.flags=i.fixed32();break}case 5:{l.name=i.string();break}case 6:{l.kind=i.int32();break}case 7:{l.startTimeUnixNano=i.fixed64();break}case 8:{l.endTimeUnixNano=i.fixed64();break}case 9:{l.attributes&&l.attributes.length||(l.attributes=[]),l.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 10:{l.droppedAttributesCount=i.uint32();break}case 11:{l.events&&l.events.length||(l.events=[]),l.events.push(f.opentelemetry.proto.trace.v1.Span.Event.decode(i,i.uint32()));break}case 12:{l.droppedEventsCount=i.uint32();break}case 13:{l.links&&l.links.length||(l.links=[]),l.links.push(f.opentelemetry.proto.trace.v1.Span.Link.decode(i,i.uint32()));break}case 14:{l.droppedLinksCount=i.uint32();break}case 15:{l.status=f.opentelemetry.proto.trace.v1.Status.decode(i,i.uint32());break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||m.isString(i.traceId)))return"traceId: buffer expected";if(i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||m.isString(i.spanId)))return"spanId: buffer expected";if(i.traceState!=null&&i.hasOwnProperty("traceState")&&!m.isString(i.traceState))return"traceState: string expected";if(i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&!(i.parentSpanId&&typeof i.parentSpanId.length=="number"||m.isString(i.parentSpanId)))return"parentSpanId: buffer expected";if(i.flags!=null&&i.hasOwnProperty("flags")&&!m.isInteger(i.flags))return"flags: integer expected";if(i.name!=null&&i.hasOwnProperty("name")&&!m.isString(i.name))return"name: string expected";if(i.kind!=null&&i.hasOwnProperty("kind"))switch(i.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!m.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&m.isInteger(i.startTimeUnixNano.low)&&m.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&!m.isInteger(i.endTimeUnixNano)&&!(i.endTimeUnixNano&&m.isInteger(i.endTimeUnixNano.low)&&m.isInteger(i.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var c=f.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(c)return"attributes."+c}}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!m.isInteger(i.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(i.events!=null&&i.hasOwnProperty("events")){if(!Array.isArray(i.events))return"events: array expected";for(var n=0;n<i.events.length;++n){var c=f.opentelemetry.proto.trace.v1.Span.Event.verify(i.events[n]);if(c)return"events."+c}}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&!m.isInteger(i.droppedEventsCount))return"droppedEventsCount: integer expected";if(i.links!=null&&i.hasOwnProperty("links")){if(!Array.isArray(i.links))return"links: array expected";for(var n=0;n<i.links.length;++n){var c=f.opentelemetry.proto.trace.v1.Span.Link.verify(i.links[n]);if(c)return"links."+c}}if(i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&!m.isInteger(i.droppedLinksCount))return"droppedLinksCount: integer expected";if(i.status!=null&&i.hasOwnProperty("status")){var c=f.opentelemetry.proto.trace.v1.Status.verify(i.status);if(c)return"status."+c}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.trace.v1.Span)return i;var n=new f.opentelemetry.proto.trace.v1.Span;switch(i.traceId!=null&&(typeof i.traceId=="string"?m.base64.decode(i.traceId,n.traceId=m.newBuffer(m.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?m.base64.decode(i.spanId,n.spanId=m.newBuffer(m.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),i.traceState!=null&&(n.traceState=String(i.traceState)),i.parentSpanId!=null&&(typeof i.parentSpanId=="string"?m.base64.decode(i.parentSpanId,n.parentSpanId=m.newBuffer(m.base64.length(i.parentSpanId)),0):i.parentSpanId.length>=0&&(n.parentSpanId=i.parentSpanId)),i.flags!=null&&(n.flags=i.flags>>>0),i.name!=null&&(n.name=String(i.name)),i.kind){default:if(typeof i.kind=="number"){n.kind=i.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:n.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:n.kind=1;break;case"SPAN_KIND_SERVER":case 2:n.kind=2;break;case"SPAN_KIND_CLIENT":case 3:n.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:n.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:n.kind=5;break}if(i.startTimeUnixNano!=null&&(m.Long?(n.startTimeUnixNano=m.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new m.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.endTimeUnixNano!=null&&(m.Long?(n.endTimeUnixNano=m.Long.fromValue(i.endTimeUnixNano)).unsigned=!1:typeof i.endTimeUnixNano=="string"?n.endTimeUnixNano=parseInt(i.endTimeUnixNano,10):typeof i.endTimeUnixNano=="number"?n.endTimeUnixNano=i.endTimeUnixNano:typeof i.endTimeUnixNano=="object"&&(n.endTimeUnixNano=new m.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber())),i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");n.attributes=[];for(var c=0;c<i.attributes.length;++c){if(typeof i.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");n.attributes[c]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[c])}}if(i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.events){if(!Array.isArray(i.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");n.events=[];for(var c=0;c<i.events.length;++c){if(typeof i.events[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");n.events[c]=f.opentelemetry.proto.trace.v1.Span.Event.fromObject(i.events[c])}}if(i.droppedEventsCount!=null&&(n.droppedEventsCount=i.droppedEventsCount>>>0),i.links){if(!Array.isArray(i.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");n.links=[];for(var c=0;c<i.links.length;++c){if(typeof i.links[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");n.links[c]=f.opentelemetry.proto.trace.v1.Span.Link.fromObject(i.links[c])}}if(i.droppedLinksCount!=null&&(n.droppedLinksCount=i.droppedLinksCount>>>0),i.status!=null){if(typeof i.status!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");n.status=f.opentelemetry.proto.trace.v1.Status.fromObject(i.status)}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.attributes=[],c.events=[],c.links=[]),n.defaults){if(n.bytes===String?c.traceId="":(c.traceId=[],n.bytes!==Array&&(c.traceId=m.newBuffer(c.traceId))),n.bytes===String?c.spanId="":(c.spanId=[],n.bytes!==Array&&(c.spanId=m.newBuffer(c.spanId))),c.traceState="",n.bytes===String?c.parentSpanId="":(c.parentSpanId=[],n.bytes!==Array&&(c.parentSpanId=m.newBuffer(c.parentSpanId))),c.name="",c.kind=n.enums===String?"SPAN_KIND_UNSPECIFIED":0,m.Long){var u=new m.Long(0,0,!1);c.startTimeUnixNano=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else c.startTimeUnixNano=n.longs===String?"0":0;if(m.Long){var u=new m.Long(0,0,!1);c.endTimeUnixNano=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else c.endTimeUnixNano=n.longs===String?"0":0;c.droppedAttributesCount=0,c.droppedEventsCount=0,c.droppedLinksCount=0,c.status=null,c.flags=0}if(i.traceId!=null&&i.hasOwnProperty("traceId")&&(c.traceId=n.bytes===String?m.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(c.spanId=n.bytes===String?m.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.traceState!=null&&i.hasOwnProperty("traceState")&&(c.traceState=i.traceState),i.parentSpanId!=null&&i.hasOwnProperty("parentSpanId")&&(c.parentSpanId=n.bytes===String?m.base64.encode(i.parentSpanId,0,i.parentSpanId.length):n.bytes===Array?Array.prototype.slice.call(i.parentSpanId):i.parentSpanId),i.name!=null&&i.hasOwnProperty("name")&&(c.name=i.name),i.kind!=null&&i.hasOwnProperty("kind")&&(c.kind=n.enums===String?f.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]===void 0?i.kind:f.opentelemetry.proto.trace.v1.Span.SpanKind[i.kind]:i.kind),i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?c.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:c.startTimeUnixNano=n.longs===String?m.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new m.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.endTimeUnixNano!=null&&i.hasOwnProperty("endTimeUnixNano")&&(typeof i.endTimeUnixNano=="number"?c.endTimeUnixNano=n.longs===String?String(i.endTimeUnixNano):i.endTimeUnixNano:c.endTimeUnixNano=n.longs===String?m.Long.prototype.toString.call(i.endTimeUnixNano):n.longs===Number?new m.LongBits(i.endTimeUnixNano.low>>>0,i.endTimeUnixNano.high>>>0).toNumber():i.endTimeUnixNano),i.attributes&&i.attributes.length){c.attributes=[];for(var l=0;l<i.attributes.length;++l)c.attributes[l]=f.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[l],n)}if(i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=i.droppedAttributesCount),i.events&&i.events.length){c.events=[];for(var l=0;l<i.events.length;++l)c.events[l]=f.opentelemetry.proto.trace.v1.Span.Event.toObject(i.events[l],n)}if(i.droppedEventsCount!=null&&i.hasOwnProperty("droppedEventsCount")&&(c.droppedEventsCount=i.droppedEventsCount),i.links&&i.links.length){c.links=[];for(var l=0;l<i.links.length;++l)c.links[l]=f.opentelemetry.proto.trace.v1.Span.Link.toObject(i.links[l],n)}return i.droppedLinksCount!=null&&i.hasOwnProperty("droppedLinksCount")&&(c.droppedLinksCount=i.droppedLinksCount),i.status!=null&&i.hasOwnProperty("status")&&(c.status=f.opentelemetry.proto.trace.v1.Status.toObject(i.status,n)),i.flags!=null&&i.hasOwnProperty("flags")&&(c.flags=i.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Span"},s.SpanKind=(function(){var a={},i=Object.create(a);return i[a[0]="SPAN_KIND_UNSPECIFIED"]=0,i[a[1]="SPAN_KIND_INTERNAL"]=1,i[a[2]="SPAN_KIND_SERVER"]=2,i[a[3]="SPAN_KIND_CLIENT"]=3,i[a[4]="SPAN_KIND_PRODUCER"]=4,i[a[5]="SPAN_KIND_CONSUMER"]=5,i})(),s.Event=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.timeUnixNano=null,a.prototype.name=null,a.prototype.attributes=m.emptyArray,a.prototype.droppedAttributesCount=null,a.create=function(n){return new a(n)},a.encode=function(n,c){if(c||(c=ee.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&c.uint32(9).fixed64(n.timeUnixNano),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&c.uint32(18).string(n.name),n.attributes!=null&&n.attributes.length)for(var u=0;u<n.attributes.length;++u)f.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[u],c.uint32(26).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&c.uint32(32).uint32(n.droppedAttributesCount),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.trace.v1.Span.Event;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.timeUnixNano=n.fixed64();break}case 2:{d.name=n.string();break}case 3:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 4:{d.droppedAttributesCount=n.uint32();break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!m.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&m.isInteger(n.timeUnixNano.low)&&m.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.name!=null&&n.hasOwnProperty("name")&&!m.isString(n.name))return"name: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=f.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!m.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.trace.v1.Span.Event)return n;var c=new f.opentelemetry.proto.trace.v1.Span.Event;if(n.timeUnixNano!=null&&(m.Long?(c.timeUnixNano=m.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?c.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?c.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(c.timeUnixNano=new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.name!=null&&(c.name=String(n.name)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");c.attributes=[];for(var u=0;u<n.attributes.length;++u){if(typeof n.attributes[u]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");c.attributes[u]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[u])}}return n.droppedAttributesCount!=null&&(c.droppedAttributesCount=n.droppedAttributesCount>>>0),c},a.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.attributes=[]),c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.timeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.timeUnixNano=c.longs===String?"0":0;u.name="",u.droppedAttributesCount=0}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(n.timeUnixNano):n.timeUnixNano:u.timeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.timeUnixNano):c.longs===Number?new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.name!=null&&n.hasOwnProperty("name")&&(u.name=n.name),n.attributes&&n.attributes.length){u.attributes=[];for(var d=0;d<n.attributes.length;++d)u.attributes[d]=f.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[d],c)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(u.droppedAttributesCount=n.droppedAttributesCount),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Event"},a})(),s.Link=(function(){function a(i){if(this.attributes=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.traceId=null,a.prototype.spanId=null,a.prototype.traceState=null,a.prototype.attributes=m.emptyArray,a.prototype.droppedAttributesCount=null,a.prototype.flags=null,a.create=function(n){return new a(n)},a.encode=function(n,c){if(c||(c=ee.create()),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&c.uint32(10).bytes(n.traceId),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&c.uint32(18).bytes(n.spanId),n.traceState!=null&&Object.hasOwnProperty.call(n,"traceState")&&c.uint32(26).string(n.traceState),n.attributes!=null&&n.attributes.length)for(var u=0;u<n.attributes.length;++u)f.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[u],c.uint32(34).fork()).ldelim();return n.droppedAttributesCount!=null&&Object.hasOwnProperty.call(n,"droppedAttributesCount")&&c.uint32(40).uint32(n.droppedAttributesCount),n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&c.uint32(53).fixed32(n.flags),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.trace.v1.Span.Link;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.traceId=n.bytes();break}case 2:{d.spanId=n.bytes();break}case 3:{d.traceState=n.string();break}case 4:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 5:{d.droppedAttributesCount=n.uint32();break}case 6:{d.flags=n.fixed32();break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||m.isString(n.traceId)))return"traceId: buffer expected";if(n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||m.isString(n.spanId)))return"spanId: buffer expected";if(n.traceState!=null&&n.hasOwnProperty("traceState")&&!m.isString(n.traceState))return"traceState: string expected";if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var c=0;c<n.attributes.length;++c){var u=f.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[c]);if(u)return"attributes."+u}}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&!m.isInteger(n.droppedAttributesCount)?"droppedAttributesCount: integer expected":n.flags!=null&&n.hasOwnProperty("flags")&&!m.isInteger(n.flags)?"flags: integer expected":null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.trace.v1.Span.Link)return n;var c=new f.opentelemetry.proto.trace.v1.Span.Link;if(n.traceId!=null&&(typeof n.traceId=="string"?m.base64.decode(n.traceId,c.traceId=m.newBuffer(m.base64.length(n.traceId)),0):n.traceId.length>=0&&(c.traceId=n.traceId)),n.spanId!=null&&(typeof n.spanId=="string"?m.base64.decode(n.spanId,c.spanId=m.newBuffer(m.base64.length(n.spanId)),0):n.spanId.length>=0&&(c.spanId=n.spanId)),n.traceState!=null&&(c.traceState=String(n.traceState)),n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");c.attributes=[];for(var u=0;u<n.attributes.length;++u){if(typeof n.attributes[u]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");c.attributes[u]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[u])}}return n.droppedAttributesCount!=null&&(c.droppedAttributesCount=n.droppedAttributesCount>>>0),n.flags!=null&&(c.flags=n.flags>>>0),c},a.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.attributes=[]),c.defaults&&(c.bytes===String?u.traceId="":(u.traceId=[],c.bytes!==Array&&(u.traceId=m.newBuffer(u.traceId))),c.bytes===String?u.spanId="":(u.spanId=[],c.bytes!==Array&&(u.spanId=m.newBuffer(u.spanId))),u.traceState="",u.droppedAttributesCount=0,u.flags=0),n.traceId!=null&&n.hasOwnProperty("traceId")&&(u.traceId=c.bytes===String?m.base64.encode(n.traceId,0,n.traceId.length):c.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.spanId!=null&&n.hasOwnProperty("spanId")&&(u.spanId=c.bytes===String?m.base64.encode(n.spanId,0,n.spanId.length):c.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceState!=null&&n.hasOwnProperty("traceState")&&(u.traceState=n.traceState),n.attributes&&n.attributes.length){u.attributes=[];for(var l=0;l<n.attributes.length;++l)u.attributes[l]=f.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[l],c)}return n.droppedAttributesCount!=null&&n.hasOwnProperty("droppedAttributesCount")&&(u.droppedAttributesCount=n.droppedAttributesCount),n.flags!=null&&n.hasOwnProperty("flags")&&(u.flags=n.flags),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.trace.v1.Span.Link"},a})(),s})(),o.Status=(function(){function s(a){if(a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.message=null,s.prototype.code=null,s.create=function(i){return new s(i)},s.encode=function(i,n){return n||(n=ee.create()),i.message!=null&&Object.hasOwnProperty.call(i,"message")&&n.uint32(18).string(i.message),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&n.uint32(24).int32(i.code),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.trace.v1.Status;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 2:{l.message=i.string();break}case 3:{l.code=i.int32();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.message!=null&&i.hasOwnProperty("message")&&!m.isString(i.message))return"message: string expected";if(i.code!=null&&i.hasOwnProperty("code"))switch(i.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.trace.v1.Status)return i;var n=new f.opentelemetry.proto.trace.v1.Status;switch(i.message!=null&&(n.message=String(i.message)),i.code){default:if(typeof i.code=="number"){n.code=i.code;break}break;case"STATUS_CODE_UNSET":case 0:n.code=0;break;case"STATUS_CODE_OK":case 1:n.code=1;break;case"STATUS_CODE_ERROR":case 2:n.code=2;break}return n},s.toObject=function(i,n){n||(n={});var c={};return n.defaults&&(c.message="",c.code=n.enums===String?"STATUS_CODE_UNSET":0),i.message!=null&&i.hasOwnProperty("message")&&(c.message=i.message),i.code!=null&&i.hasOwnProperty("code")&&(c.code=n.enums===String?f.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]===void 0?i.code:f.opentelemetry.proto.trace.v1.Status.StatusCode[i.code]:i.code),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.trace.v1.Status"},s.StatusCode=(function(){var a={},i=Object.create(a);return i[a[0]="STATUS_CODE_UNSET"]=0,i[a[1]="STATUS_CODE_OK"]=1,i[a[2]="STATUS_CODE_ERROR"]=2,i})(),s})(),o.SpanFlags=(function(){var s={},a=Object.create(s);return a[s[0]="SPAN_FLAGS_DO_NOT_USE"]=0,a[s[255]="SPAN_FLAGS_TRACE_FLAGS_MASK"]=255,a[s[256]="SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"]=256,a[s[512]="SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"]=512,a})(),o})(),r})(),e.collector=(function(){var r={};return r.trace=(function(){var o={};return o.v1=(function(){var s={};return s.TraceService=(function(){function a(i,n,c){X.rpc.Service.call(this,i,n,c)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,c,u){return new this(n,c,u)},Object.defineProperty(a.prototype.export=function i(n,c){return this.rpcCall(i,f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,n,c)},"name",{value:"Export"}),a})(),s.ExportTraceServiceRequest=(function(){function a(i){if(this.resourceSpans=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.resourceSpans=m.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,c){if(c||(c=ee.create()),n.resourceSpans!=null&&n.resourceSpans.length)for(var u=0;u<n.resourceSpans.length;++u)f.opentelemetry.proto.trace.v1.ResourceSpans.encode(n.resourceSpans[u],c.uint32(10).fork()).ldelim();return c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.resourceSpans&&d.resourceSpans.length||(d.resourceSpans=[]),d.resourceSpans.push(f.opentelemetry.proto.trace.v1.ResourceSpans.decode(n,n.uint32()));break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceSpans!=null&&n.hasOwnProperty("resourceSpans")){if(!Array.isArray(n.resourceSpans))return"resourceSpans: array expected";for(var c=0;c<n.resourceSpans.length;++c){var u=f.opentelemetry.proto.trace.v1.ResourceSpans.verify(n.resourceSpans[c]);if(u)return"resourceSpans."+u}}return null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return n;var c=new f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(n.resourceSpans){if(!Array.isArray(n.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");c.resourceSpans=[];for(var u=0;u<n.resourceSpans.length;++u){if(typeof n.resourceSpans[u]!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");c.resourceSpans[u]=f.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(n.resourceSpans[u])}}return c},a.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.resourceSpans=[]),n.resourceSpans&&n.resourceSpans.length){u.resourceSpans=[];for(var l=0;l<n.resourceSpans.length;++l)u.resourceSpans[l]=f.opentelemetry.proto.trace.v1.ResourceSpans.toObject(n.resourceSpans[l],c)}return u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},a})(),s.ExportTraceServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,c){return c||(c=ee.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(n.partialSuccess,c.uint32(10).fork()).ldelim(),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.partialSuccess=f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(n,n.uint32());break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var c=f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(n.partialSuccess);if(c)return"partialSuccess."+c}return null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return n;var c=new f.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");c.partialSuccess=f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(n.partialSuccess)}return c},a.toObject=function(n,c){c||(c={});var u={};return c.defaults&&(u.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(u.partialSuccess=f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(n.partialSuccess,c)),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},a})(),s.ExportTracePartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.rejectedSpans=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,c){return c||(c=ee.create()),n.rejectedSpans!=null&&Object.hasOwnProperty.call(n,"rejectedSpans")&&c.uint32(8).int64(n.rejectedSpans),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&c.uint32(18).string(n.errorMessage),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.rejectedSpans=n.int64();break}case 2:{d.errorMessage=n.string();break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&!m.isInteger(n.rejectedSpans)&&!(n.rejectedSpans&&m.isInteger(n.rejectedSpans.low)&&m.isInteger(n.rejectedSpans.high))?"rejectedSpans: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!m.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return n;var c=new f.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return n.rejectedSpans!=null&&(m.Long?(c.rejectedSpans=m.Long.fromValue(n.rejectedSpans)).unsigned=!1:typeof n.rejectedSpans=="string"?c.rejectedSpans=parseInt(n.rejectedSpans,10):typeof n.rejectedSpans=="number"?c.rejectedSpans=n.rejectedSpans:typeof n.rejectedSpans=="object"&&(c.rejectedSpans=new m.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber())),n.errorMessage!=null&&(c.errorMessage=String(n.errorMessage)),c},a.toObject=function(n,c){c||(c={});var u={};if(c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.rejectedSpans=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.rejectedSpans=c.longs===String?"0":0;u.errorMessage=""}return n.rejectedSpans!=null&&n.hasOwnProperty("rejectedSpans")&&(typeof n.rejectedSpans=="number"?u.rejectedSpans=c.longs===String?String(n.rejectedSpans):n.rejectedSpans:u.rejectedSpans=c.longs===String?m.Long.prototype.toString.call(n.rejectedSpans):c.longs===Number?new m.LongBits(n.rejectedSpans.low>>>0,n.rejectedSpans.high>>>0).toNumber():n.rejectedSpans),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(u.errorMessage=n.errorMessage),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},a})(),s})(),o})(),r.metrics=(function(){var o={};return o.v1=(function(){var s={};return s.MetricsService=(function(){function a(i,n,c){X.rpc.Service.call(this,i,n,c)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,c,u){return new this(n,c,u)},Object.defineProperty(a.prototype.export=function i(n,c){return this.rpcCall(i,f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,n,c)},"name",{value:"Export"}),a})(),s.ExportMetricsServiceRequest=(function(){function a(i){if(this.resourceMetrics=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.resourceMetrics=m.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,c){if(c||(c=ee.create()),n.resourceMetrics!=null&&n.resourceMetrics.length)for(var u=0;u<n.resourceMetrics.length;++u)f.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(n.resourceMetrics[u],c.uint32(10).fork()).ldelim();return c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.resourceMetrics&&d.resourceMetrics.length||(d.resourceMetrics=[]),d.resourceMetrics.push(f.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(n,n.uint32()));break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceMetrics!=null&&n.hasOwnProperty("resourceMetrics")){if(!Array.isArray(n.resourceMetrics))return"resourceMetrics: array expected";for(var c=0;c<n.resourceMetrics.length;++c){var u=f.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(n.resourceMetrics[c]);if(u)return"resourceMetrics."+u}}return null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return n;var c=new f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(n.resourceMetrics){if(!Array.isArray(n.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");c.resourceMetrics=[];for(var u=0;u<n.resourceMetrics.length;++u){if(typeof n.resourceMetrics[u]!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");c.resourceMetrics[u]=f.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(n.resourceMetrics[u])}}return c},a.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.resourceMetrics=[]),n.resourceMetrics&&n.resourceMetrics.length){u.resourceMetrics=[];for(var l=0;l<n.resourceMetrics.length;++l)u.resourceMetrics[l]=f.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(n.resourceMetrics[l],c)}return u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},a})(),s.ExportMetricsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,c){return c||(c=ee.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(n.partialSuccess,c.uint32(10).fork()).ldelim(),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.partialSuccess=f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var c=f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(n.partialSuccess);if(c)return"partialSuccess."+c}return null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return n;var c=new f.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");c.partialSuccess=f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(n.partialSuccess)}return c},a.toObject=function(n,c){c||(c={});var u={};return c.defaults&&(u.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(u.partialSuccess=f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(n.partialSuccess,c)),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},a})(),s.ExportMetricsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.rejectedDataPoints=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,c){return c||(c=ee.create()),n.rejectedDataPoints!=null&&Object.hasOwnProperty.call(n,"rejectedDataPoints")&&c.uint32(8).int64(n.rejectedDataPoints),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&c.uint32(18).string(n.errorMessage),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.rejectedDataPoints=n.int64();break}case 2:{d.errorMessage=n.string();break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&!m.isInteger(n.rejectedDataPoints)&&!(n.rejectedDataPoints&&m.isInteger(n.rejectedDataPoints.low)&&m.isInteger(n.rejectedDataPoints.high))?"rejectedDataPoints: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!m.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return n;var c=new f.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return n.rejectedDataPoints!=null&&(m.Long?(c.rejectedDataPoints=m.Long.fromValue(n.rejectedDataPoints)).unsigned=!1:typeof n.rejectedDataPoints=="string"?c.rejectedDataPoints=parseInt(n.rejectedDataPoints,10):typeof n.rejectedDataPoints=="number"?c.rejectedDataPoints=n.rejectedDataPoints:typeof n.rejectedDataPoints=="object"&&(c.rejectedDataPoints=new m.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber())),n.errorMessage!=null&&(c.errorMessage=String(n.errorMessage)),c},a.toObject=function(n,c){c||(c={});var u={};if(c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.rejectedDataPoints=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.rejectedDataPoints=c.longs===String?"0":0;u.errorMessage=""}return n.rejectedDataPoints!=null&&n.hasOwnProperty("rejectedDataPoints")&&(typeof n.rejectedDataPoints=="number"?u.rejectedDataPoints=c.longs===String?String(n.rejectedDataPoints):n.rejectedDataPoints:u.rejectedDataPoints=c.longs===String?m.Long.prototype.toString.call(n.rejectedDataPoints):c.longs===Number?new m.LongBits(n.rejectedDataPoints.low>>>0,n.rejectedDataPoints.high>>>0).toNumber():n.rejectedDataPoints),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(u.errorMessage=n.errorMessage),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},a})(),s})(),o})(),r.logs=(function(){var o={};return o.v1=(function(){var s={};return s.LogsService=(function(){function a(i,n,c){X.rpc.Service.call(this,i,n,c)}return(a.prototype=Object.create(X.rpc.Service.prototype)).constructor=a,a.create=function(n,c,u){return new this(n,c,u)},Object.defineProperty(a.prototype.export=function i(n,c){return this.rpcCall(i,f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,n,c)},"name",{value:"Export"}),a})(),s.ExportLogsServiceRequest=(function(){function a(i){if(this.resourceLogs=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.resourceLogs=m.emptyArray,a.create=function(n){return new a(n)},a.encode=function(n,c){if(c||(c=ee.create()),n.resourceLogs!=null&&n.resourceLogs.length)for(var u=0;u<n.resourceLogs.length;++u)f.opentelemetry.proto.logs.v1.ResourceLogs.encode(n.resourceLogs[u],c.uint32(10).fork()).ldelim();return c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.resourceLogs&&d.resourceLogs.length||(d.resourceLogs=[]),d.resourceLogs.push(f.opentelemetry.proto.logs.v1.ResourceLogs.decode(n,n.uint32()));break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.resourceLogs!=null&&n.hasOwnProperty("resourceLogs")){if(!Array.isArray(n.resourceLogs))return"resourceLogs: array expected";for(var c=0;c<n.resourceLogs.length;++c){var u=f.opentelemetry.proto.logs.v1.ResourceLogs.verify(n.resourceLogs[c]);if(u)return"resourceLogs."+u}}return null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return n;var c=new f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(n.resourceLogs){if(!Array.isArray(n.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");c.resourceLogs=[];for(var u=0;u<n.resourceLogs.length;++u){if(typeof n.resourceLogs[u]!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");c.resourceLogs[u]=f.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(n.resourceLogs[u])}}return c},a.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.resourceLogs=[]),n.resourceLogs&&n.resourceLogs.length){u.resourceLogs=[];for(var l=0;l<n.resourceLogs.length;++l)u.resourceLogs[l]=f.opentelemetry.proto.logs.v1.ResourceLogs.toObject(n.resourceLogs[l],c)}return u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},a})(),s.ExportLogsServiceResponse=(function(){function a(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.partialSuccess=null,a.create=function(n){return new a(n)},a.encode=function(n,c){return c||(c=ee.create()),n.partialSuccess!=null&&Object.hasOwnProperty.call(n,"partialSuccess")&&f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(n.partialSuccess,c.uint32(10).fork()).ldelim(),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.partialSuccess=f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(n,n.uint32());break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")){var c=f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(n.partialSuccess);if(c)return"partialSuccess."+c}return null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return n;var c=new f.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(n.partialSuccess!=null){if(typeof n.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");c.partialSuccess=f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(n.partialSuccess)}return c},a.toObject=function(n,c){c||(c={});var u={};return c.defaults&&(u.partialSuccess=null),n.partialSuccess!=null&&n.hasOwnProperty("partialSuccess")&&(u.partialSuccess=f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(n.partialSuccess,c)),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},a})(),s.ExportLogsPartialSuccess=(function(){function a(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.rejectedLogRecords=null,a.prototype.errorMessage=null,a.create=function(n){return new a(n)},a.encode=function(n,c){return c||(c=ee.create()),n.rejectedLogRecords!=null&&Object.hasOwnProperty.call(n,"rejectedLogRecords")&&c.uint32(8).int64(n.rejectedLogRecords),n.errorMessage!=null&&Object.hasOwnProperty.call(n,"errorMessage")&&c.uint32(18).string(n.errorMessage),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.rejectedLogRecords=n.int64();break}case 2:{d.errorMessage=n.string();break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&!m.isInteger(n.rejectedLogRecords)&&!(n.rejectedLogRecords&&m.isInteger(n.rejectedLogRecords.low)&&m.isInteger(n.rejectedLogRecords.high))?"rejectedLogRecords: integer|Long expected":n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&!m.isString(n.errorMessage)?"errorMessage: string expected":null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return n;var c=new f.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return n.rejectedLogRecords!=null&&(m.Long?(c.rejectedLogRecords=m.Long.fromValue(n.rejectedLogRecords)).unsigned=!1:typeof n.rejectedLogRecords=="string"?c.rejectedLogRecords=parseInt(n.rejectedLogRecords,10):typeof n.rejectedLogRecords=="number"?c.rejectedLogRecords=n.rejectedLogRecords:typeof n.rejectedLogRecords=="object"&&(c.rejectedLogRecords=new m.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber())),n.errorMessage!=null&&(c.errorMessage=String(n.errorMessage)),c},a.toObject=function(n,c){c||(c={});var u={};if(c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.rejectedLogRecords=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.rejectedLogRecords=c.longs===String?"0":0;u.errorMessage=""}return n.rejectedLogRecords!=null&&n.hasOwnProperty("rejectedLogRecords")&&(typeof n.rejectedLogRecords=="number"?u.rejectedLogRecords=c.longs===String?String(n.rejectedLogRecords):n.rejectedLogRecords:u.rejectedLogRecords=c.longs===String?m.Long.prototype.toString.call(n.rejectedLogRecords):c.longs===Number?new m.LongBits(n.rejectedLogRecords.low>>>0,n.rejectedLogRecords.high>>>0).toNumber():n.rejectedLogRecords),n.errorMessage!=null&&n.hasOwnProperty("errorMessage")&&(u.errorMessage=n.errorMessage),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},a})(),s})(),o})(),r})(),e.metrics=(function(){var r={};return r.v1=(function(){var o={};return o.MetricsData=(function(){function s(a){if(this.resourceMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceMetrics=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.resourceMetrics!=null&&i.resourceMetrics.length)for(var c=0;c<i.resourceMetrics.length;++c)f.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(i.resourceMetrics[c],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.MetricsData;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.resourceMetrics&&l.resourceMetrics.length||(l.resourceMetrics=[]),l.resourceMetrics.push(f.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceMetrics!=null&&i.hasOwnProperty("resourceMetrics")){if(!Array.isArray(i.resourceMetrics))return"resourceMetrics: array expected";for(var n=0;n<i.resourceMetrics.length;++n){var c=f.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(i.resourceMetrics[n]);if(c)return"resourceMetrics."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.MetricsData)return i;var n=new f.opentelemetry.proto.metrics.v1.MetricsData;if(i.resourceMetrics){if(!Array.isArray(i.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");n.resourceMetrics=[];for(var c=0;c<i.resourceMetrics.length;++c){if(typeof i.resourceMetrics[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");n.resourceMetrics[c]=f.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(i.resourceMetrics[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.resourceMetrics=[]),i.resourceMetrics&&i.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u<i.resourceMetrics.length;++u)c.resourceMetrics[u]=f.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(i.resourceMetrics[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.MetricsData"},s})(),o.ResourceMetrics=(function(){function s(a){if(this.scopeMetrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeMetrics=m.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&f.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeMetrics!=null&&i.scopeMetrics.length)for(var c=0;c<i.scopeMetrics.length;++c)f.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(i.scopeMetrics[c],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.ResourceMetrics;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.resource=f.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{l.scopeMetrics&&l.scopeMetrics.length||(l.scopeMetrics=[]),l.scopeMetrics.push(f.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(i,i.uint32()));break}case 3:{l.schemaUrl=i.string();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=f.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeMetrics!=null&&i.hasOwnProperty("scopeMetrics")){if(!Array.isArray(i.scopeMetrics))return"scopeMetrics: array expected";for(var c=0;c<i.scopeMetrics.length;++c){var n=f.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(i.scopeMetrics[c]);if(n)return"scopeMetrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!m.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.ResourceMetrics)return i;var n=new f.opentelemetry.proto.metrics.v1.ResourceMetrics;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");n.resource=f.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeMetrics){if(!Array.isArray(i.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");n.scopeMetrics=[];for(var c=0;c<i.scopeMetrics.length;++c){if(typeof i.scopeMetrics[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");n.scopeMetrics[c]=f.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(i.scopeMetrics[c])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.scopeMetrics=[]),n.defaults&&(c.resource=null,c.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(c.resource=f.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeMetrics&&i.scopeMetrics.length){c.scopeMetrics=[];for(var u=0;u<i.scopeMetrics.length;++u)c.scopeMetrics[u]=f.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(i.scopeMetrics[u],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(c.schemaUrl=i.schemaUrl),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},s})(),o.ScopeMetrics=(function(){function s(a){if(this.metrics=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.metrics=m.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&f.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.metrics!=null&&i.metrics.length)for(var c=0;c<i.metrics.length;++c)f.opentelemetry.proto.metrics.v1.Metric.encode(i.metrics[c],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.ScopeMetrics;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{l.metrics&&l.metrics.length||(l.metrics=[]),l.metrics.push(f.opentelemetry.proto.metrics.v1.Metric.decode(i,i.uint32()));break}case 3:{l.schemaUrl=i.string();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=f.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.metrics!=null&&i.hasOwnProperty("metrics")){if(!Array.isArray(i.metrics))return"metrics: array expected";for(var c=0;c<i.metrics.length;++c){var n=f.opentelemetry.proto.metrics.v1.Metric.verify(i.metrics[c]);if(n)return"metrics."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!m.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.ScopeMetrics)return i;var n=new f.opentelemetry.proto.metrics.v1.ScopeMetrics;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");n.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.metrics){if(!Array.isArray(i.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");n.metrics=[];for(var c=0;c<i.metrics.length;++c){if(typeof i.metrics[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");n.metrics[c]=f.opentelemetry.proto.metrics.v1.Metric.fromObject(i.metrics[c])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.metrics=[]),n.defaults&&(c.scope=null,c.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(c.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.metrics&&i.metrics.length){c.metrics=[];for(var u=0;u<i.metrics.length;++u)c.metrics[u]=f.opentelemetry.proto.metrics.v1.Metric.toObject(i.metrics[u],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(c.schemaUrl=i.schemaUrl),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},s})(),o.Metric=(function(){function s(i){if(this.metadata=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}s.prototype.name=null,s.prototype.description=null,s.prototype.unit=null,s.prototype.gauge=null,s.prototype.sum=null,s.prototype.histogram=null,s.prototype.exponentialHistogram=null,s.prototype.summary=null,s.prototype.metadata=m.emptyArray;var a;return Object.defineProperty(s.prototype,"data",{get:m.oneOfGetter(a=["gauge","sum","histogram","exponentialHistogram","summary"]),set:m.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,c){if(c||(c=ee.create()),n.name!=null&&Object.hasOwnProperty.call(n,"name")&&c.uint32(10).string(n.name),n.description!=null&&Object.hasOwnProperty.call(n,"description")&&c.uint32(18).string(n.description),n.unit!=null&&Object.hasOwnProperty.call(n,"unit")&&c.uint32(26).string(n.unit),n.gauge!=null&&Object.hasOwnProperty.call(n,"gauge")&&f.opentelemetry.proto.metrics.v1.Gauge.encode(n.gauge,c.uint32(42).fork()).ldelim(),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&f.opentelemetry.proto.metrics.v1.Sum.encode(n.sum,c.uint32(58).fork()).ldelim(),n.histogram!=null&&Object.hasOwnProperty.call(n,"histogram")&&f.opentelemetry.proto.metrics.v1.Histogram.encode(n.histogram,c.uint32(74).fork()).ldelim(),n.exponentialHistogram!=null&&Object.hasOwnProperty.call(n,"exponentialHistogram")&&f.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(n.exponentialHistogram,c.uint32(82).fork()).ldelim(),n.summary!=null&&Object.hasOwnProperty.call(n,"summary")&&f.opentelemetry.proto.metrics.v1.Summary.encode(n.summary,c.uint32(90).fork()).ldelim(),n.metadata!=null&&n.metadata.length)for(var u=0;u<n.metadata.length;++u)f.opentelemetry.proto.common.v1.KeyValue.encode(n.metadata[u],c.uint32(98).fork()).ldelim();return c},s.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},s.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.metrics.v1.Metric;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.name=n.string();break}case 2:{d.description=n.string();break}case 3:{d.unit=n.string();break}case 5:{d.gauge=f.opentelemetry.proto.metrics.v1.Gauge.decode(n,n.uint32());break}case 7:{d.sum=f.opentelemetry.proto.metrics.v1.Sum.decode(n,n.uint32());break}case 9:{d.histogram=f.opentelemetry.proto.metrics.v1.Histogram.decode(n,n.uint32());break}case 10:{d.exponentialHistogram=f.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(n,n.uint32());break}case 11:{d.summary=f.opentelemetry.proto.metrics.v1.Summary.decode(n,n.uint32());break}case 12:{d.metadata&&d.metadata.length||(d.metadata=[]),d.metadata.push(f.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}default:n.skipType(h&7);break}}return d},s.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var c={};if(n.name!=null&&n.hasOwnProperty("name")&&!m.isString(n.name))return"name: string expected";if(n.description!=null&&n.hasOwnProperty("description")&&!m.isString(n.description))return"description: string expected";if(n.unit!=null&&n.hasOwnProperty("unit")&&!m.isString(n.unit))return"unit: string expected";if(n.gauge!=null&&n.hasOwnProperty("gauge")){c.data=1;{var u=f.opentelemetry.proto.metrics.v1.Gauge.verify(n.gauge);if(u)return"gauge."+u}}if(n.sum!=null&&n.hasOwnProperty("sum")){if(c.data===1)return"data: multiple values";c.data=1;{var u=f.opentelemetry.proto.metrics.v1.Sum.verify(n.sum);if(u)return"sum."+u}}if(n.histogram!=null&&n.hasOwnProperty("histogram")){if(c.data===1)return"data: multiple values";c.data=1;{var u=f.opentelemetry.proto.metrics.v1.Histogram.verify(n.histogram);if(u)return"histogram."+u}}if(n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")){if(c.data===1)return"data: multiple values";c.data=1;{var u=f.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(n.exponentialHistogram);if(u)return"exponentialHistogram."+u}}if(n.summary!=null&&n.hasOwnProperty("summary")){if(c.data===1)return"data: multiple values";c.data=1;{var u=f.opentelemetry.proto.metrics.v1.Summary.verify(n.summary);if(u)return"summary."+u}}if(n.metadata!=null&&n.hasOwnProperty("metadata")){if(!Array.isArray(n.metadata))return"metadata: array expected";for(var l=0;l<n.metadata.length;++l){var u=f.opentelemetry.proto.common.v1.KeyValue.verify(n.metadata[l]);if(u)return"metadata."+u}}return null},s.fromObject=function(n){if(n instanceof f.opentelemetry.proto.metrics.v1.Metric)return n;var c=new f.opentelemetry.proto.metrics.v1.Metric;if(n.name!=null&&(c.name=String(n.name)),n.description!=null&&(c.description=String(n.description)),n.unit!=null&&(c.unit=String(n.unit)),n.gauge!=null){if(typeof n.gauge!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");c.gauge=f.opentelemetry.proto.metrics.v1.Gauge.fromObject(n.gauge)}if(n.sum!=null){if(typeof n.sum!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");c.sum=f.opentelemetry.proto.metrics.v1.Sum.fromObject(n.sum)}if(n.histogram!=null){if(typeof n.histogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");c.histogram=f.opentelemetry.proto.metrics.v1.Histogram.fromObject(n.histogram)}if(n.exponentialHistogram!=null){if(typeof n.exponentialHistogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");c.exponentialHistogram=f.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(n.exponentialHistogram)}if(n.summary!=null){if(typeof n.summary!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");c.summary=f.opentelemetry.proto.metrics.v1.Summary.fromObject(n.summary)}if(n.metadata){if(!Array.isArray(n.metadata))throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected");c.metadata=[];for(var u=0;u<n.metadata.length;++u){if(typeof n.metadata[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected");c.metadata[u]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(n.metadata[u])}}return c},s.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.metadata=[]),c.defaults&&(u.name="",u.description="",u.unit=""),n.name!=null&&n.hasOwnProperty("name")&&(u.name=n.name),n.description!=null&&n.hasOwnProperty("description")&&(u.description=n.description),n.unit!=null&&n.hasOwnProperty("unit")&&(u.unit=n.unit),n.gauge!=null&&n.hasOwnProperty("gauge")&&(u.gauge=f.opentelemetry.proto.metrics.v1.Gauge.toObject(n.gauge,c),c.oneofs&&(u.data="gauge")),n.sum!=null&&n.hasOwnProperty("sum")&&(u.sum=f.opentelemetry.proto.metrics.v1.Sum.toObject(n.sum,c),c.oneofs&&(u.data="sum")),n.histogram!=null&&n.hasOwnProperty("histogram")&&(u.histogram=f.opentelemetry.proto.metrics.v1.Histogram.toObject(n.histogram,c),c.oneofs&&(u.data="histogram")),n.exponentialHistogram!=null&&n.hasOwnProperty("exponentialHistogram")&&(u.exponentialHistogram=f.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(n.exponentialHistogram,c),c.oneofs&&(u.data="exponentialHistogram")),n.summary!=null&&n.hasOwnProperty("summary")&&(u.summary=f.opentelemetry.proto.metrics.v1.Summary.toObject(n.summary,c),c.oneofs&&(u.data="summary")),n.metadata&&n.metadata.length){u.metadata=[];for(var l=0;l<n.metadata.length;++l)u.metadata[l]=f.opentelemetry.proto.common.v1.KeyValue.toObject(n.metadata[l],c)}return u},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Metric"},s})(),o.Gauge=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.dataPoints!=null&&i.dataPoints.length)for(var c=0;c<i.dataPoints.length;++c)f.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[c],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.Gauge;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.dataPoints&&l.dataPoints.length||(l.dataPoints=[]),l.dataPoints.push(f.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var c=f.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(c)return"dataPoints."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.Gauge)return i;var n=new f.opentelemetry.proto.metrics.v1.Gauge;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");n.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c){if(typeof i.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");n.dataPoints[c]=f.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.dataPoints=[]),i.dataPoints&&i.dataPoints.length){c.dataPoints=[];for(var u=0;u<i.dataPoints.length;++u)c.dataPoints[u]=f.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Gauge"},s})(),o.Sum=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=m.emptyArray,s.prototype.aggregationTemporality=null,s.prototype.isMonotonic=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.dataPoints!=null&&i.dataPoints.length)for(var c=0;c<i.dataPoints.length;++c)f.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(i.dataPoints[c],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),i.isMonotonic!=null&&Object.hasOwnProperty.call(i,"isMonotonic")&&n.uint32(24).bool(i.isMonotonic),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.Sum;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.dataPoints&&l.dataPoints.length||(l.dataPoints=[]),l.dataPoints.push(f.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(i,i.uint32()));break}case 2:{l.aggregationTemporality=i.int32();break}case 3:{l.isMonotonic=i.bool();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var c=f.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(i.dataPoints[n]);if(c)return"dataPoints."+c}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&typeof i.isMonotonic!="boolean"?"isMonotonic: boolean expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.Sum)return i;var n=new f.opentelemetry.proto.metrics.v1.Sum;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");n.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c){if(typeof i.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");n.dataPoints[c]=f.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(i.dataPoints[c])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return i.isMonotonic!=null&&(n.isMonotonic=!!i.isMonotonic),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.dataPoints=[]),n.defaults&&(c.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,c.isMonotonic=!1),i.dataPoints&&i.dataPoints.length){c.dataPoints=[];for(var u=0;u<i.dataPoints.length;++u)c.dataPoints[u]=f.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(i.dataPoints[u],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(c.aggregationTemporality=n.enums===String?f.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:f.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),i.isMonotonic!=null&&i.hasOwnProperty("isMonotonic")&&(c.isMonotonic=i.isMonotonic),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Sum"},s})(),o.Histogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=m.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.dataPoints!=null&&i.dataPoints.length)for(var c=0;c<i.dataPoints.length;++c)f.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(i.dataPoints[c],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.Histogram;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.dataPoints&&l.dataPoints.length||(l.dataPoints=[]),l.dataPoints.push(f.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(i,i.uint32()));break}case 2:{l.aggregationTemporality=i.int32();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var c=f.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(i.dataPoints[n]);if(c)return"dataPoints."+c}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.Histogram)return i;var n=new f.opentelemetry.proto.metrics.v1.Histogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");n.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c){if(typeof i.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");n.dataPoints[c]=f.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(i.dataPoints[c])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.dataPoints=[]),n.defaults&&(c.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){c.dataPoints=[];for(var u=0;u<i.dataPoints.length;++u)c.dataPoints[u]=f.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(i.dataPoints[u],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(c.aggregationTemporality=n.enums===String?f.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:f.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Histogram"},s})(),o.ExponentialHistogram=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=m.emptyArray,s.prototype.aggregationTemporality=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.dataPoints!=null&&i.dataPoints.length)for(var c=0;c<i.dataPoints.length;++c)f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(i.dataPoints[c],n.uint32(10).fork()).ldelim();return i.aggregationTemporality!=null&&Object.hasOwnProperty.call(i,"aggregationTemporality")&&n.uint32(16).int32(i.aggregationTemporality),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.ExponentialHistogram;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.dataPoints&&l.dataPoints.length||(l.dataPoints=[]),l.dataPoints.push(f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(i,i.uint32()));break}case 2:{l.aggregationTemporality=i.int32();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var c=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(i.dataPoints[n]);if(c)return"dataPoints."+c}}if(i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality"))switch(i.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.ExponentialHistogram)return i;var n=new f.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");n.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c){if(typeof i.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");n.dataPoints[c]=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(i.dataPoints[c])}}switch(i.aggregationTemporality){default:if(typeof i.aggregationTemporality=="number"){n.aggregationTemporality=i.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:n.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:n.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:n.aggregationTemporality=2;break}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.dataPoints=[]),n.defaults&&(c.aggregationTemporality=n.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),i.dataPoints&&i.dataPoints.length){c.dataPoints=[];for(var u=0;u<i.dataPoints.length;++u)c.dataPoints[u]=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(i.dataPoints[u],n)}return i.aggregationTemporality!=null&&i.hasOwnProperty("aggregationTemporality")&&(c.aggregationTemporality=n.enums===String?f.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]===void 0?i.aggregationTemporality:f.opentelemetry.proto.metrics.v1.AggregationTemporality[i.aggregationTemporality]:i.aggregationTemporality),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},s})(),o.Summary=(function(){function s(a){if(this.dataPoints=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.dataPoints=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.dataPoints!=null&&i.dataPoints.length)for(var c=0;c<i.dataPoints.length;++c)f.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(i.dataPoints[c],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.Summary;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.dataPoints&&l.dataPoints.length||(l.dataPoints=[]),l.dataPoints.push(f.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.dataPoints!=null&&i.hasOwnProperty("dataPoints")){if(!Array.isArray(i.dataPoints))return"dataPoints: array expected";for(var n=0;n<i.dataPoints.length;++n){var c=f.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(i.dataPoints[n]);if(c)return"dataPoints."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.Summary)return i;var n=new f.opentelemetry.proto.metrics.v1.Summary;if(i.dataPoints){if(!Array.isArray(i.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");n.dataPoints=[];for(var c=0;c<i.dataPoints.length;++c){if(typeof i.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");n.dataPoints[c]=f.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(i.dataPoints[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.dataPoints=[]),i.dataPoints&&i.dataPoints.length){c.dataPoints=[];for(var u=0;u<i.dataPoints.length;++u)c.dataPoints[u]=f.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(i.dataPoints[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.Summary"},s})(),o.AggregationTemporality=(function(){var s={},a=Object.create(s);return a[s[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,a[s[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,a[s[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,a})(),o.DataPointFlags=(function(){var s={},a=Object.create(s);return a[s[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,a[s[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,a})(),o.NumberDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}s.prototype.attributes=m.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.exemplars=m.emptyArray,s.prototype.flags=null;var a;return Object.defineProperty(s.prototype,"value",{get:m.oneOfGetter(a=["asDouble","asInt"]),set:m.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,c){if(c||(c=ee.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&c.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&c.uint32(25).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&c.uint32(33).double(n.asDouble),n.exemplars!=null&&n.exemplars.length)for(var u=0;u<n.exemplars.length;++u)f.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[u],c.uint32(42).fork()).ldelim();if(n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&c.uint32(49).sfixed64(n.asInt),n.attributes!=null&&n.attributes.length)for(var u=0;u<n.attributes.length;++u)f.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[u],c.uint32(58).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&c.uint32(64).uint32(n.flags),c},s.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},s.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.metrics.v1.NumberDataPoint;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 7:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{d.startTimeUnixNano=n.fixed64();break}case 3:{d.timeUnixNano=n.fixed64();break}case 4:{d.asDouble=n.double();break}case 6:{d.asInt=n.sfixed64();break}case 5:{d.exemplars&&d.exemplars.length||(d.exemplars=[]),d.exemplars.push(f.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 8:{d.flags=n.uint32();break}default:n.skipType(h&7);break}}return d},s.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var c={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var u=0;u<n.attributes.length;++u){var l=f.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[u]);if(l)return"attributes."+l}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!m.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&m.isInteger(n.startTimeUnixNano.low)&&m.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!m.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&m.isInteger(n.timeUnixNano.low)&&m.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(c.value===1)return"value: multiple values";if(c.value=1,!m.isInteger(n.asInt)&&!(n.asInt&&m.isInteger(n.asInt.low)&&m.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var u=0;u<n.exemplars.length;++u){var l=f.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[u]);if(l)return"exemplars."+l}}return n.flags!=null&&n.hasOwnProperty("flags")&&!m.isInteger(n.flags)?"flags: integer expected":null},s.fromObject=function(n){if(n instanceof f.opentelemetry.proto.metrics.v1.NumberDataPoint)return n;var c=new f.opentelemetry.proto.metrics.v1.NumberDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");c.attributes=[];for(var u=0;u<n.attributes.length;++u){if(typeof n.attributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");c.attributes[u]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[u])}}if(n.startTimeUnixNano!=null&&(m.Long?(c.startTimeUnixNano=m.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?c.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(c.startTimeUnixNano=new m.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(m.Long?(c.timeUnixNano=m.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?c.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?c.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(c.timeUnixNano=new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(c.asDouble=Number(n.asDouble)),n.asInt!=null&&(m.Long?(c.asInt=m.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?c.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?c.asInt=n.asInt:typeof n.asInt=="object"&&(c.asInt=new m.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");c.exemplars=[];for(var u=0;u<n.exemplars.length;++u){if(typeof n.exemplars[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");c.exemplars[u]=f.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[u])}}return n.flags!=null&&(c.flags=n.flags>>>0),c},s.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.exemplars=[],u.attributes=[]),c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.startTimeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.startTimeUnixNano=c.longs===String?"0":0;if(m.Long){var l=new m.Long(0,0,!1);u.timeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.timeUnixNano=c.longs===String?"0":0;u.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?u.startTimeUnixNano=c.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:u.startTimeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.startTimeUnixNano):c.longs===Number?new m.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(n.timeUnixNano):n.timeUnixNano:u.timeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.timeUnixNano):c.longs===Number?new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(u.asDouble=c.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,c.oneofs&&(u.value="asDouble")),n.exemplars&&n.exemplars.length){u.exemplars=[];for(var d=0;d<n.exemplars.length;++d)u.exemplars[d]=f.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[d],c)}if(n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?u.asInt=c.longs===String?String(n.asInt):n.asInt:u.asInt=c.longs===String?m.Long.prototype.toString.call(n.asInt):c.longs===Number?new m.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,c.oneofs&&(u.value="asInt")),n.attributes&&n.attributes.length){u.attributes=[];for(var d=0;d<n.attributes.length;++d)u.attributes[d]=f.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[d],c)}return n.flags!=null&&n.hasOwnProperty("flags")&&(u.flags=n.flags),u},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},s})(),o.HistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}s.prototype.attributes=m.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.bucketCounts=m.emptyArray,s.prototype.explicitBounds=m.emptyArray,s.prototype.exemplars=m.emptyArray,s.prototype.flags=null,s.prototype.min=null,s.prototype.max=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:m.oneOfGetter(a=["sum"]),set:m.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:m.oneOfGetter(a=["min"]),set:m.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:m.oneOfGetter(a=["max"]),set:m.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,c){if(c||(c=ee.create()),n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&c.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&c.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&c.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&c.uint32(41).double(n.sum),n.bucketCounts!=null&&n.bucketCounts.length){c.uint32(50).fork();for(var u=0;u<n.bucketCounts.length;++u)c.fixed64(n.bucketCounts[u]);c.ldelim()}if(n.explicitBounds!=null&&n.explicitBounds.length){c.uint32(58).fork();for(var u=0;u<n.explicitBounds.length;++u)c.double(n.explicitBounds[u]);c.ldelim()}if(n.exemplars!=null&&n.exemplars.length)for(var u=0;u<n.exemplars.length;++u)f.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[u],c.uint32(66).fork()).ldelim();if(n.attributes!=null&&n.attributes.length)for(var u=0;u<n.attributes.length;++u)f.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[u],c.uint32(74).fork()).ldelim();return n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&c.uint32(80).uint32(n.flags),n.min!=null&&Object.hasOwnProperty.call(n,"min")&&c.uint32(89).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&c.uint32(97).double(n.max),c},s.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},s.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.metrics.v1.HistogramDataPoint;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 9:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{d.startTimeUnixNano=n.fixed64();break}case 3:{d.timeUnixNano=n.fixed64();break}case 4:{d.count=n.fixed64();break}case 5:{d.sum=n.double();break}case 6:{if(d.bucketCounts&&d.bucketCounts.length||(d.bucketCounts=[]),(h&7)===2)for(var g=n.uint32()+n.pos;n.pos<g;)d.bucketCounts.push(n.fixed64());else d.bucketCounts.push(n.fixed64());break}case 7:{if(d.explicitBounds&&d.explicitBounds.length||(d.explicitBounds=[]),(h&7)===2)for(var g=n.uint32()+n.pos;n.pos<g;)d.explicitBounds.push(n.double());else d.explicitBounds.push(n.double());break}case 8:{d.exemplars&&d.exemplars.length||(d.exemplars=[]),d.exemplars.push(f.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 10:{d.flags=n.uint32();break}case 11:{d.min=n.double();break}case 12:{d.max=n.double();break}default:n.skipType(h&7);break}}return d},s.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var c={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var u=0;u<n.attributes.length;++u){var l=f.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[u]);if(l)return"attributes."+l}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!m.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&m.isInteger(n.startTimeUnixNano.low)&&m.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!m.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&m.isInteger(n.timeUnixNano.low)&&m.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!m.isInteger(n.count)&&!(n.count&&m.isInteger(n.count.low)&&m.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(c._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.bucketCounts!=null&&n.hasOwnProperty("bucketCounts")){if(!Array.isArray(n.bucketCounts))return"bucketCounts: array expected";for(var u=0;u<n.bucketCounts.length;++u)if(!m.isInteger(n.bucketCounts[u])&&!(n.bucketCounts[u]&&m.isInteger(n.bucketCounts[u].low)&&m.isInteger(n.bucketCounts[u].high)))return"bucketCounts: integer|Long[] expected"}if(n.explicitBounds!=null&&n.hasOwnProperty("explicitBounds")){if(!Array.isArray(n.explicitBounds))return"explicitBounds: array expected";for(var u=0;u<n.explicitBounds.length;++u)if(typeof n.explicitBounds[u]!="number")return"explicitBounds: number[] expected"}if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var u=0;u<n.exemplars.length;++u){var l=f.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[u]);if(l)return"exemplars."+l}}return n.flags!=null&&n.hasOwnProperty("flags")&&!m.isInteger(n.flags)?"flags: integer expected":n.min!=null&&n.hasOwnProperty("min")&&(c._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(c._max=1,typeof n.max!="number")?"max: number expected":null},s.fromObject=function(n){if(n instanceof f.opentelemetry.proto.metrics.v1.HistogramDataPoint)return n;var c=new f.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");c.attributes=[];for(var u=0;u<n.attributes.length;++u){if(typeof n.attributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");c.attributes[u]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[u])}}if(n.startTimeUnixNano!=null&&(m.Long?(c.startTimeUnixNano=m.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?c.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(c.startTimeUnixNano=new m.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(m.Long?(c.timeUnixNano=m.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?c.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?c.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(c.timeUnixNano=new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(m.Long?(c.count=m.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?c.count=parseInt(n.count,10):typeof n.count=="number"?c.count=n.count:typeof n.count=="object"&&(c.count=new m.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(c.sum=Number(n.sum)),n.bucketCounts){if(!Array.isArray(n.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");c.bucketCounts=[];for(var u=0;u<n.bucketCounts.length;++u)m.Long?(c.bucketCounts[u]=m.Long.fromValue(n.bucketCounts[u])).unsigned=!1:typeof n.bucketCounts[u]=="string"?c.bucketCounts[u]=parseInt(n.bucketCounts[u],10):typeof n.bucketCounts[u]=="number"?c.bucketCounts[u]=n.bucketCounts[u]:typeof n.bucketCounts[u]=="object"&&(c.bucketCounts[u]=new m.LongBits(n.bucketCounts[u].low>>>0,n.bucketCounts[u].high>>>0).toNumber())}if(n.explicitBounds){if(!Array.isArray(n.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");c.explicitBounds=[];for(var u=0;u<n.explicitBounds.length;++u)c.explicitBounds[u]=Number(n.explicitBounds[u])}if(n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");c.exemplars=[];for(var u=0;u<n.exemplars.length;++u){if(typeof n.exemplars[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");c.exemplars[u]=f.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[u])}}return n.flags!=null&&(c.flags=n.flags>>>0),n.min!=null&&(c.min=Number(n.min)),n.max!=null&&(c.max=Number(n.max)),c},s.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.bucketCounts=[],u.explicitBounds=[],u.exemplars=[],u.attributes=[]),c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.startTimeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.startTimeUnixNano=c.longs===String?"0":0;if(m.Long){var l=new m.Long(0,0,!1);u.timeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.timeUnixNano=c.longs===String?"0":0;if(m.Long){var l=new m.Long(0,0,!1);u.count=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.count=c.longs===String?"0":0;u.flags=0}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?u.startTimeUnixNano=c.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:u.startTimeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.startTimeUnixNano):c.longs===Number?new m.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(n.timeUnixNano):n.timeUnixNano:u.timeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.timeUnixNano):c.longs===Number?new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?u.count=c.longs===String?String(n.count):n.count:u.count=c.longs===String?m.Long.prototype.toString.call(n.count):c.longs===Number?new m.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(u.sum=c.json&&!isFinite(n.sum)?String(n.sum):n.sum,c.oneofs&&(u._sum="sum")),n.bucketCounts&&n.bucketCounts.length){u.bucketCounts=[];for(var d=0;d<n.bucketCounts.length;++d)typeof n.bucketCounts[d]=="number"?u.bucketCounts[d]=c.longs===String?String(n.bucketCounts[d]):n.bucketCounts[d]:u.bucketCounts[d]=c.longs===String?m.Long.prototype.toString.call(n.bucketCounts[d]):c.longs===Number?new m.LongBits(n.bucketCounts[d].low>>>0,n.bucketCounts[d].high>>>0).toNumber():n.bucketCounts[d]}if(n.explicitBounds&&n.explicitBounds.length){u.explicitBounds=[];for(var d=0;d<n.explicitBounds.length;++d)u.explicitBounds[d]=c.json&&!isFinite(n.explicitBounds[d])?String(n.explicitBounds[d]):n.explicitBounds[d]}if(n.exemplars&&n.exemplars.length){u.exemplars=[];for(var d=0;d<n.exemplars.length;++d)u.exemplars[d]=f.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[d],c)}if(n.attributes&&n.attributes.length){u.attributes=[];for(var d=0;d<n.attributes.length;++d)u.attributes[d]=f.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[d],c)}return n.flags!=null&&n.hasOwnProperty("flags")&&(u.flags=n.flags),n.min!=null&&n.hasOwnProperty("min")&&(u.min=c.json&&!isFinite(n.min)?String(n.min):n.min,c.oneofs&&(u._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(u.max=c.json&&!isFinite(n.max)?String(n.max):n.max,c.oneofs&&(u._max="max")),u},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},s})(),o.ExponentialHistogramDataPoint=(function(){function s(i){if(this.attributes=[],this.exemplars=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}s.prototype.attributes=m.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.scale=null,s.prototype.zeroCount=null,s.prototype.positive=null,s.prototype.negative=null,s.prototype.flags=null,s.prototype.exemplars=m.emptyArray,s.prototype.min=null,s.prototype.max=null,s.prototype.zeroThreshold=null;var a;return Object.defineProperty(s.prototype,"_sum",{get:m.oneOfGetter(a=["sum"]),set:m.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_min",{get:m.oneOfGetter(a=["min"]),set:m.oneOfSetter(a)}),Object.defineProperty(s.prototype,"_max",{get:m.oneOfGetter(a=["max"]),set:m.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,c){if(c||(c=ee.create()),n.attributes!=null&&n.attributes.length)for(var u=0;u<n.attributes.length;++u)f.opentelemetry.proto.common.v1.KeyValue.encode(n.attributes[u],c.uint32(10).fork()).ldelim();if(n.startTimeUnixNano!=null&&Object.hasOwnProperty.call(n,"startTimeUnixNano")&&c.uint32(17).fixed64(n.startTimeUnixNano),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&c.uint32(25).fixed64(n.timeUnixNano),n.count!=null&&Object.hasOwnProperty.call(n,"count")&&c.uint32(33).fixed64(n.count),n.sum!=null&&Object.hasOwnProperty.call(n,"sum")&&c.uint32(41).double(n.sum),n.scale!=null&&Object.hasOwnProperty.call(n,"scale")&&c.uint32(48).sint32(n.scale),n.zeroCount!=null&&Object.hasOwnProperty.call(n,"zeroCount")&&c.uint32(57).fixed64(n.zeroCount),n.positive!=null&&Object.hasOwnProperty.call(n,"positive")&&f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.positive,c.uint32(66).fork()).ldelim(),n.negative!=null&&Object.hasOwnProperty.call(n,"negative")&&f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(n.negative,c.uint32(74).fork()).ldelim(),n.flags!=null&&Object.hasOwnProperty.call(n,"flags")&&c.uint32(80).uint32(n.flags),n.exemplars!=null&&n.exemplars.length)for(var u=0;u<n.exemplars.length;++u)f.opentelemetry.proto.metrics.v1.Exemplar.encode(n.exemplars[u],c.uint32(90).fork()).ldelim();return n.min!=null&&Object.hasOwnProperty.call(n,"min")&&c.uint32(97).double(n.min),n.max!=null&&Object.hasOwnProperty.call(n,"max")&&c.uint32(105).double(n.max),n.zeroThreshold!=null&&Object.hasOwnProperty.call(n,"zeroThreshold")&&c.uint32(113).double(n.zeroThreshold),c},s.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},s.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{d.startTimeUnixNano=n.fixed64();break}case 3:{d.timeUnixNano=n.fixed64();break}case 4:{d.count=n.fixed64();break}case 5:{d.sum=n.double();break}case 6:{d.scale=n.sint32();break}case 7:{d.zeroCount=n.fixed64();break}case 8:{d.positive=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 9:{d.negative=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(n,n.uint32());break}case 10:{d.flags=n.uint32();break}case 11:{d.exemplars&&d.exemplars.length||(d.exemplars=[]),d.exemplars.push(f.opentelemetry.proto.metrics.v1.Exemplar.decode(n,n.uint32()));break}case 12:{d.min=n.double();break}case 13:{d.max=n.double();break}case 14:{d.zeroThreshold=n.double();break}default:n.skipType(h&7);break}}return d},s.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var c={};if(n.attributes!=null&&n.hasOwnProperty("attributes")){if(!Array.isArray(n.attributes))return"attributes: array expected";for(var u=0;u<n.attributes.length;++u){var l=f.opentelemetry.proto.common.v1.KeyValue.verify(n.attributes[u]);if(l)return"attributes."+l}}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&!m.isInteger(n.startTimeUnixNano)&&!(n.startTimeUnixNano&&m.isInteger(n.startTimeUnixNano.low)&&m.isInteger(n.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!m.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&m.isInteger(n.timeUnixNano.low)&&m.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.count!=null&&n.hasOwnProperty("count")&&!m.isInteger(n.count)&&!(n.count&&m.isInteger(n.count.low)&&m.isInteger(n.count.high)))return"count: integer|Long expected";if(n.sum!=null&&n.hasOwnProperty("sum")&&(c._sum=1,typeof n.sum!="number"))return"sum: number expected";if(n.scale!=null&&n.hasOwnProperty("scale")&&!m.isInteger(n.scale))return"scale: integer expected";if(n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&!m.isInteger(n.zeroCount)&&!(n.zeroCount&&m.isInteger(n.zeroCount.low)&&m.isInteger(n.zeroCount.high)))return"zeroCount: integer|Long expected";if(n.positive!=null&&n.hasOwnProperty("positive")){var l=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.positive);if(l)return"positive."+l}if(n.negative!=null&&n.hasOwnProperty("negative")){var l=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(n.negative);if(l)return"negative."+l}if(n.flags!=null&&n.hasOwnProperty("flags")&&!m.isInteger(n.flags))return"flags: integer expected";if(n.exemplars!=null&&n.hasOwnProperty("exemplars")){if(!Array.isArray(n.exemplars))return"exemplars: array expected";for(var u=0;u<n.exemplars.length;++u){var l=f.opentelemetry.proto.metrics.v1.Exemplar.verify(n.exemplars[u]);if(l)return"exemplars."+l}}return n.min!=null&&n.hasOwnProperty("min")&&(c._min=1,typeof n.min!="number")?"min: number expected":n.max!=null&&n.hasOwnProperty("max")&&(c._max=1,typeof n.max!="number")?"max: number expected":n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&typeof n.zeroThreshold!="number"?"zeroThreshold: number expected":null},s.fromObject=function(n){if(n instanceof f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return n;var c=new f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(n.attributes){if(!Array.isArray(n.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");c.attributes=[];for(var u=0;u<n.attributes.length;++u){if(typeof n.attributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");c.attributes[u]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(n.attributes[u])}}if(n.startTimeUnixNano!=null&&(m.Long?(c.startTimeUnixNano=m.Long.fromValue(n.startTimeUnixNano)).unsigned=!1:typeof n.startTimeUnixNano=="string"?c.startTimeUnixNano=parseInt(n.startTimeUnixNano,10):typeof n.startTimeUnixNano=="number"?c.startTimeUnixNano=n.startTimeUnixNano:typeof n.startTimeUnixNano=="object"&&(c.startTimeUnixNano=new m.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber())),n.timeUnixNano!=null&&(m.Long?(c.timeUnixNano=m.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?c.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?c.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(c.timeUnixNano=new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.count!=null&&(m.Long?(c.count=m.Long.fromValue(n.count)).unsigned=!1:typeof n.count=="string"?c.count=parseInt(n.count,10):typeof n.count=="number"?c.count=n.count:typeof n.count=="object"&&(c.count=new m.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber())),n.sum!=null&&(c.sum=Number(n.sum)),n.scale!=null&&(c.scale=n.scale|0),n.zeroCount!=null&&(m.Long?(c.zeroCount=m.Long.fromValue(n.zeroCount)).unsigned=!1:typeof n.zeroCount=="string"?c.zeroCount=parseInt(n.zeroCount,10):typeof n.zeroCount=="number"?c.zeroCount=n.zeroCount:typeof n.zeroCount=="object"&&(c.zeroCount=new m.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber())),n.positive!=null){if(typeof n.positive!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");c.positive=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.positive)}if(n.negative!=null){if(typeof n.negative!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");c.negative=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(n.negative)}if(n.flags!=null&&(c.flags=n.flags>>>0),n.exemplars){if(!Array.isArray(n.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");c.exemplars=[];for(var u=0;u<n.exemplars.length;++u){if(typeof n.exemplars[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");c.exemplars[u]=f.opentelemetry.proto.metrics.v1.Exemplar.fromObject(n.exemplars[u])}}return n.min!=null&&(c.min=Number(n.min)),n.max!=null&&(c.max=Number(n.max)),n.zeroThreshold!=null&&(c.zeroThreshold=Number(n.zeroThreshold)),c},s.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.attributes=[],u.exemplars=[]),c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.startTimeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.startTimeUnixNano=c.longs===String?"0":0;if(m.Long){var l=new m.Long(0,0,!1);u.timeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.timeUnixNano=c.longs===String?"0":0;if(m.Long){var l=new m.Long(0,0,!1);u.count=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.count=c.longs===String?"0":0;if(u.scale=0,m.Long){var l=new m.Long(0,0,!1);u.zeroCount=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.zeroCount=c.longs===String?"0":0;u.positive=null,u.negative=null,u.flags=0,u.zeroThreshold=0}if(n.attributes&&n.attributes.length){u.attributes=[];for(var d=0;d<n.attributes.length;++d)u.attributes[d]=f.opentelemetry.proto.common.v1.KeyValue.toObject(n.attributes[d],c)}if(n.startTimeUnixNano!=null&&n.hasOwnProperty("startTimeUnixNano")&&(typeof n.startTimeUnixNano=="number"?u.startTimeUnixNano=c.longs===String?String(n.startTimeUnixNano):n.startTimeUnixNano:u.startTimeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.startTimeUnixNano):c.longs===Number?new m.LongBits(n.startTimeUnixNano.low>>>0,n.startTimeUnixNano.high>>>0).toNumber():n.startTimeUnixNano),n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(n.timeUnixNano):n.timeUnixNano:u.timeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.timeUnixNano):c.longs===Number?new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.count!=null&&n.hasOwnProperty("count")&&(typeof n.count=="number"?u.count=c.longs===String?String(n.count):n.count:u.count=c.longs===String?m.Long.prototype.toString.call(n.count):c.longs===Number?new m.LongBits(n.count.low>>>0,n.count.high>>>0).toNumber():n.count),n.sum!=null&&n.hasOwnProperty("sum")&&(u.sum=c.json&&!isFinite(n.sum)?String(n.sum):n.sum,c.oneofs&&(u._sum="sum")),n.scale!=null&&n.hasOwnProperty("scale")&&(u.scale=n.scale),n.zeroCount!=null&&n.hasOwnProperty("zeroCount")&&(typeof n.zeroCount=="number"?u.zeroCount=c.longs===String?String(n.zeroCount):n.zeroCount:u.zeroCount=c.longs===String?m.Long.prototype.toString.call(n.zeroCount):c.longs===Number?new m.LongBits(n.zeroCount.low>>>0,n.zeroCount.high>>>0).toNumber():n.zeroCount),n.positive!=null&&n.hasOwnProperty("positive")&&(u.positive=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.positive,c)),n.negative!=null&&n.hasOwnProperty("negative")&&(u.negative=f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(n.negative,c)),n.flags!=null&&n.hasOwnProperty("flags")&&(u.flags=n.flags),n.exemplars&&n.exemplars.length){u.exemplars=[];for(var d=0;d<n.exemplars.length;++d)u.exemplars[d]=f.opentelemetry.proto.metrics.v1.Exemplar.toObject(n.exemplars[d],c)}return n.min!=null&&n.hasOwnProperty("min")&&(u.min=c.json&&!isFinite(n.min)?String(n.min):n.min,c.oneofs&&(u._min="min")),n.max!=null&&n.hasOwnProperty("max")&&(u.max=c.json&&!isFinite(n.max)?String(n.max):n.max,c.oneofs&&(u._max="max")),n.zeroThreshold!=null&&n.hasOwnProperty("zeroThreshold")&&(u.zeroThreshold=c.json&&!isFinite(n.zeroThreshold)?String(n.zeroThreshold):n.zeroThreshold),u},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},s.Buckets=(function(){function i(n){if(this.bucketCounts=[],n)for(var c=Object.keys(n),u=0;u<c.length;++u)n[c[u]]!=null&&(this[c[u]]=n[c[u]])}return i.prototype.offset=null,i.prototype.bucketCounts=m.emptyArray,i.create=function(c){return new i(c)},i.encode=function(c,u){if(u||(u=ee.create()),c.offset!=null&&Object.hasOwnProperty.call(c,"offset")&&u.uint32(8).sint32(c.offset),c.bucketCounts!=null&&c.bucketCounts.length){u.uint32(18).fork();for(var l=0;l<c.bucketCounts.length;++l)u.uint64(c.bucketCounts[l]);u.ldelim()}return u},i.encodeDelimited=function(c,u){return this.encode(c,u).ldelim()},i.decode=function(c,u,l){c instanceof T||(c=T.create(c));for(var d=u===void 0?c.len:c.pos+u,h=new f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;c.pos<d;){var g=c.uint32();if(g===l)break;switch(g>>>3){case 1:{h.offset=c.sint32();break}case 2:{if(h.bucketCounts&&h.bucketCounts.length||(h.bucketCounts=[]),(g&7)===2)for(var E=c.uint32()+c.pos;c.pos<E;)h.bucketCounts.push(c.uint64());else h.bucketCounts.push(c.uint64());break}default:c.skipType(g&7);break}}return h},i.decodeDelimited=function(c){return c instanceof T||(c=new T(c)),this.decode(c,c.uint32())},i.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.offset!=null&&c.hasOwnProperty("offset")&&!m.isInteger(c.offset))return"offset: integer expected";if(c.bucketCounts!=null&&c.hasOwnProperty("bucketCounts")){if(!Array.isArray(c.bucketCounts))return"bucketCounts: array expected";for(var u=0;u<c.bucketCounts.length;++u)if(!m.isInteger(c.bucketCounts[u])&&!(c.bucketCounts[u]&&m.isInteger(c.bucketCounts[u].low)&&m.isInteger(c.bucketCounts[u].high)))return"bucketCounts: integer|Long[] expected"}return null},i.fromObject=function(c){if(c instanceof f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return c;var u=new f.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(c.offset!=null&&(u.offset=c.offset|0),c.bucketCounts){if(!Array.isArray(c.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");u.bucketCounts=[];for(var l=0;l<c.bucketCounts.length;++l)m.Long?(u.bucketCounts[l]=m.Long.fromValue(c.bucketCounts[l])).unsigned=!0:typeof c.bucketCounts[l]=="string"?u.bucketCounts[l]=parseInt(c.bucketCounts[l],10):typeof c.bucketCounts[l]=="number"?u.bucketCounts[l]=c.bucketCounts[l]:typeof c.bucketCounts[l]=="object"&&(u.bucketCounts[l]=new m.LongBits(c.bucketCounts[l].low>>>0,c.bucketCounts[l].high>>>0).toNumber(!0))}return u},i.toObject=function(c,u){u||(u={});var l={};if((u.arrays||u.defaults)&&(l.bucketCounts=[]),u.defaults&&(l.offset=0),c.offset!=null&&c.hasOwnProperty("offset")&&(l.offset=c.offset),c.bucketCounts&&c.bucketCounts.length){l.bucketCounts=[];for(var d=0;d<c.bucketCounts.length;++d)typeof c.bucketCounts[d]=="number"?l.bucketCounts[d]=u.longs===String?String(c.bucketCounts[d]):c.bucketCounts[d]:l.bucketCounts[d]=u.longs===String?m.Long.prototype.toString.call(c.bucketCounts[d]):u.longs===Number?new m.LongBits(c.bucketCounts[d].low>>>0,c.bucketCounts[d].high>>>0).toNumber(!0):c.bucketCounts[d]}return l},i.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},i.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},i})(),s})(),o.SummaryDataPoint=(function(){function s(a){if(this.attributes=[],this.quantileValues=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.attributes=m.emptyArray,s.prototype.startTimeUnixNano=null,s.prototype.timeUnixNano=null,s.prototype.count=null,s.prototype.sum=null,s.prototype.quantileValues=m.emptyArray,s.prototype.flags=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.startTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"startTimeUnixNano")&&n.uint32(17).fixed64(i.startTimeUnixNano),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(25).fixed64(i.timeUnixNano),i.count!=null&&Object.hasOwnProperty.call(i,"count")&&n.uint32(33).fixed64(i.count),i.sum!=null&&Object.hasOwnProperty.call(i,"sum")&&n.uint32(41).double(i.sum),i.quantileValues!=null&&i.quantileValues.length)for(var c=0;c<i.quantileValues.length;++c)f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(i.quantileValues[c],n.uint32(50).fork()).ldelim();if(i.attributes!=null&&i.attributes.length)for(var c=0;c<i.attributes.length;++c)f.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[c],n.uint32(58).fork()).ldelim();return i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(64).uint32(i.flags),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.metrics.v1.SummaryDataPoint;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 7:{l.attributes&&l.attributes.length||(l.attributes=[]),l.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 2:{l.startTimeUnixNano=i.fixed64();break}case 3:{l.timeUnixNano=i.fixed64();break}case 4:{l.count=i.fixed64();break}case 5:{l.sum=i.double();break}case 6:{l.quantileValues&&l.quantileValues.length||(l.quantileValues=[]),l.quantileValues.push(f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(i,i.uint32()));break}case 8:{l.flags=i.uint32();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var n=0;n<i.attributes.length;++n){var c=f.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[n]);if(c)return"attributes."+c}}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&!m.isInteger(i.startTimeUnixNano)&&!(i.startTimeUnixNano&&m.isInteger(i.startTimeUnixNano.low)&&m.isInteger(i.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!m.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&m.isInteger(i.timeUnixNano.low)&&m.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.count!=null&&i.hasOwnProperty("count")&&!m.isInteger(i.count)&&!(i.count&&m.isInteger(i.count.low)&&m.isInteger(i.count.high)))return"count: integer|Long expected";if(i.sum!=null&&i.hasOwnProperty("sum")&&typeof i.sum!="number")return"sum: number expected";if(i.quantileValues!=null&&i.hasOwnProperty("quantileValues")){if(!Array.isArray(i.quantileValues))return"quantileValues: array expected";for(var n=0;n<i.quantileValues.length;++n){var c=f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(i.quantileValues[n]);if(c)return"quantileValues."+c}}return i.flags!=null&&i.hasOwnProperty("flags")&&!m.isInteger(i.flags)?"flags: integer expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.metrics.v1.SummaryDataPoint)return i;var n=new f.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");n.attributes=[];for(var c=0;c<i.attributes.length;++c){if(typeof i.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");n.attributes[c]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[c])}}if(i.startTimeUnixNano!=null&&(m.Long?(n.startTimeUnixNano=m.Long.fromValue(i.startTimeUnixNano)).unsigned=!1:typeof i.startTimeUnixNano=="string"?n.startTimeUnixNano=parseInt(i.startTimeUnixNano,10):typeof i.startTimeUnixNano=="number"?n.startTimeUnixNano=i.startTimeUnixNano:typeof i.startTimeUnixNano=="object"&&(n.startTimeUnixNano=new m.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber())),i.timeUnixNano!=null&&(m.Long?(n.timeUnixNano=m.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new m.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.count!=null&&(m.Long?(n.count=m.Long.fromValue(i.count)).unsigned=!1:typeof i.count=="string"?n.count=parseInt(i.count,10):typeof i.count=="number"?n.count=i.count:typeof i.count=="object"&&(n.count=new m.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber())),i.sum!=null&&(n.sum=Number(i.sum)),i.quantileValues){if(!Array.isArray(i.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");n.quantileValues=[];for(var c=0;c<i.quantileValues.length;++c){if(typeof i.quantileValues[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");n.quantileValues[c]=f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(i.quantileValues[c])}}return i.flags!=null&&(n.flags=i.flags>>>0),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.quantileValues=[],c.attributes=[]),n.defaults){if(m.Long){var u=new m.Long(0,0,!1);c.startTimeUnixNano=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else c.startTimeUnixNano=n.longs===String?"0":0;if(m.Long){var u=new m.Long(0,0,!1);c.timeUnixNano=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else c.timeUnixNano=n.longs===String?"0":0;if(m.Long){var u=new m.Long(0,0,!1);c.count=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else c.count=n.longs===String?"0":0;c.sum=0,c.flags=0}if(i.startTimeUnixNano!=null&&i.hasOwnProperty("startTimeUnixNano")&&(typeof i.startTimeUnixNano=="number"?c.startTimeUnixNano=n.longs===String?String(i.startTimeUnixNano):i.startTimeUnixNano:c.startTimeUnixNano=n.longs===String?m.Long.prototype.toString.call(i.startTimeUnixNano):n.longs===Number?new m.LongBits(i.startTimeUnixNano.low>>>0,i.startTimeUnixNano.high>>>0).toNumber():i.startTimeUnixNano),i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?c.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:c.timeUnixNano=n.longs===String?m.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new m.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.count!=null&&i.hasOwnProperty("count")&&(typeof i.count=="number"?c.count=n.longs===String?String(i.count):i.count:c.count=n.longs===String?m.Long.prototype.toString.call(i.count):n.longs===Number?new m.LongBits(i.count.low>>>0,i.count.high>>>0).toNumber():i.count),i.sum!=null&&i.hasOwnProperty("sum")&&(c.sum=n.json&&!isFinite(i.sum)?String(i.sum):i.sum),i.quantileValues&&i.quantileValues.length){c.quantileValues=[];for(var l=0;l<i.quantileValues.length;++l)c.quantileValues[l]=f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(i.quantileValues[l],n)}if(i.attributes&&i.attributes.length){c.attributes=[];for(var l=0;l<i.attributes.length;++l)c.attributes[l]=f.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[l],n)}return i.flags!=null&&i.hasOwnProperty("flags")&&(c.flags=i.flags),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},s.ValueAtQuantile=(function(){function a(i){if(i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}return a.prototype.quantile=null,a.prototype.value=null,a.create=function(n){return new a(n)},a.encode=function(n,c){return c||(c=ee.create()),n.quantile!=null&&Object.hasOwnProperty.call(n,"quantile")&&c.uint32(9).double(n.quantile),n.value!=null&&Object.hasOwnProperty.call(n,"value")&&c.uint32(17).double(n.value),c},a.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},a.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 1:{d.quantile=n.double();break}case 2:{d.value=n.double();break}default:n.skipType(h&7);break}}return d},a.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},a.verify=function(n){return typeof n!="object"||n===null?"object expected":n.quantile!=null&&n.hasOwnProperty("quantile")&&typeof n.quantile!="number"?"quantile: number expected":n.value!=null&&n.hasOwnProperty("value")&&typeof n.value!="number"?"value: number expected":null},a.fromObject=function(n){if(n instanceof f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return n;var c=new f.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return n.quantile!=null&&(c.quantile=Number(n.quantile)),n.value!=null&&(c.value=Number(n.value)),c},a.toObject=function(n,c){c||(c={});var u={};return c.defaults&&(u.quantile=0,u.value=0),n.quantile!=null&&n.hasOwnProperty("quantile")&&(u.quantile=c.json&&!isFinite(n.quantile)?String(n.quantile):n.quantile),n.value!=null&&n.hasOwnProperty("value")&&(u.value=c.json&&!isFinite(n.value)?String(n.value):n.value),u},a.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},a.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},a})(),s})(),o.Exemplar=(function(){function s(i){if(this.filteredAttributes=[],i)for(var n=Object.keys(i),c=0;c<n.length;++c)i[n[c]]!=null&&(this[n[c]]=i[n[c]])}s.prototype.filteredAttributes=m.emptyArray,s.prototype.timeUnixNano=null,s.prototype.asDouble=null,s.prototype.asInt=null,s.prototype.spanId=null,s.prototype.traceId=null;var a;return Object.defineProperty(s.prototype,"value",{get:m.oneOfGetter(a=["asDouble","asInt"]),set:m.oneOfSetter(a)}),s.create=function(n){return new s(n)},s.encode=function(n,c){if(c||(c=ee.create()),n.timeUnixNano!=null&&Object.hasOwnProperty.call(n,"timeUnixNano")&&c.uint32(17).fixed64(n.timeUnixNano),n.asDouble!=null&&Object.hasOwnProperty.call(n,"asDouble")&&c.uint32(25).double(n.asDouble),n.spanId!=null&&Object.hasOwnProperty.call(n,"spanId")&&c.uint32(34).bytes(n.spanId),n.traceId!=null&&Object.hasOwnProperty.call(n,"traceId")&&c.uint32(42).bytes(n.traceId),n.asInt!=null&&Object.hasOwnProperty.call(n,"asInt")&&c.uint32(49).sfixed64(n.asInt),n.filteredAttributes!=null&&n.filteredAttributes.length)for(var u=0;u<n.filteredAttributes.length;++u)f.opentelemetry.proto.common.v1.KeyValue.encode(n.filteredAttributes[u],c.uint32(58).fork()).ldelim();return c},s.encodeDelimited=function(n,c){return this.encode(n,c).ldelim()},s.decode=function(n,c,u){n instanceof T||(n=T.create(n));for(var l=c===void 0?n.len:n.pos+c,d=new f.opentelemetry.proto.metrics.v1.Exemplar;n.pos<l;){var h=n.uint32();if(h===u)break;switch(h>>>3){case 7:{d.filteredAttributes&&d.filteredAttributes.length||(d.filteredAttributes=[]),d.filteredAttributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(n,n.uint32()));break}case 2:{d.timeUnixNano=n.fixed64();break}case 3:{d.asDouble=n.double();break}case 6:{d.asInt=n.sfixed64();break}case 4:{d.spanId=n.bytes();break}case 5:{d.traceId=n.bytes();break}default:n.skipType(h&7);break}}return d},s.decodeDelimited=function(n){return n instanceof T||(n=new T(n)),this.decode(n,n.uint32())},s.verify=function(n){if(typeof n!="object"||n===null)return"object expected";var c={};if(n.filteredAttributes!=null&&n.hasOwnProperty("filteredAttributes")){if(!Array.isArray(n.filteredAttributes))return"filteredAttributes: array expected";for(var u=0;u<n.filteredAttributes.length;++u){var l=f.opentelemetry.proto.common.v1.KeyValue.verify(n.filteredAttributes[u]);if(l)return"filteredAttributes."+l}}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&!m.isInteger(n.timeUnixNano)&&!(n.timeUnixNano&&m.isInteger(n.timeUnixNano.low)&&m.isInteger(n.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(c.value=1,typeof n.asDouble!="number"))return"asDouble: number expected";if(n.asInt!=null&&n.hasOwnProperty("asInt")){if(c.value===1)return"value: multiple values";if(c.value=1,!m.isInteger(n.asInt)&&!(n.asInt&&m.isInteger(n.asInt.low)&&m.isInteger(n.asInt.high)))return"asInt: integer|Long expected"}return n.spanId!=null&&n.hasOwnProperty("spanId")&&!(n.spanId&&typeof n.spanId.length=="number"||m.isString(n.spanId))?"spanId: buffer expected":n.traceId!=null&&n.hasOwnProperty("traceId")&&!(n.traceId&&typeof n.traceId.length=="number"||m.isString(n.traceId))?"traceId: buffer expected":null},s.fromObject=function(n){if(n instanceof f.opentelemetry.proto.metrics.v1.Exemplar)return n;var c=new f.opentelemetry.proto.metrics.v1.Exemplar;if(n.filteredAttributes){if(!Array.isArray(n.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");c.filteredAttributes=[];for(var u=0;u<n.filteredAttributes.length;++u){if(typeof n.filteredAttributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");c.filteredAttributes[u]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(n.filteredAttributes[u])}}return n.timeUnixNano!=null&&(m.Long?(c.timeUnixNano=m.Long.fromValue(n.timeUnixNano)).unsigned=!1:typeof n.timeUnixNano=="string"?c.timeUnixNano=parseInt(n.timeUnixNano,10):typeof n.timeUnixNano=="number"?c.timeUnixNano=n.timeUnixNano:typeof n.timeUnixNano=="object"&&(c.timeUnixNano=new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber())),n.asDouble!=null&&(c.asDouble=Number(n.asDouble)),n.asInt!=null&&(m.Long?(c.asInt=m.Long.fromValue(n.asInt)).unsigned=!1:typeof n.asInt=="string"?c.asInt=parseInt(n.asInt,10):typeof n.asInt=="number"?c.asInt=n.asInt:typeof n.asInt=="object"&&(c.asInt=new m.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber())),n.spanId!=null&&(typeof n.spanId=="string"?m.base64.decode(n.spanId,c.spanId=m.newBuffer(m.base64.length(n.spanId)),0):n.spanId.length>=0&&(c.spanId=n.spanId)),n.traceId!=null&&(typeof n.traceId=="string"?m.base64.decode(n.traceId,c.traceId=m.newBuffer(m.base64.length(n.traceId)),0):n.traceId.length>=0&&(c.traceId=n.traceId)),c},s.toObject=function(n,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.filteredAttributes=[]),c.defaults){if(m.Long){var l=new m.Long(0,0,!1);u.timeUnixNano=c.longs===String?l.toString():c.longs===Number?l.toNumber():l}else u.timeUnixNano=c.longs===String?"0":0;c.bytes===String?u.spanId="":(u.spanId=[],c.bytes!==Array&&(u.spanId=m.newBuffer(u.spanId))),c.bytes===String?u.traceId="":(u.traceId=[],c.bytes!==Array&&(u.traceId=m.newBuffer(u.traceId)))}if(n.timeUnixNano!=null&&n.hasOwnProperty("timeUnixNano")&&(typeof n.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(n.timeUnixNano):n.timeUnixNano:u.timeUnixNano=c.longs===String?m.Long.prototype.toString.call(n.timeUnixNano):c.longs===Number?new m.LongBits(n.timeUnixNano.low>>>0,n.timeUnixNano.high>>>0).toNumber():n.timeUnixNano),n.asDouble!=null&&n.hasOwnProperty("asDouble")&&(u.asDouble=c.json&&!isFinite(n.asDouble)?String(n.asDouble):n.asDouble,c.oneofs&&(u.value="asDouble")),n.spanId!=null&&n.hasOwnProperty("spanId")&&(u.spanId=c.bytes===String?m.base64.encode(n.spanId,0,n.spanId.length):c.bytes===Array?Array.prototype.slice.call(n.spanId):n.spanId),n.traceId!=null&&n.hasOwnProperty("traceId")&&(u.traceId=c.bytes===String?m.base64.encode(n.traceId,0,n.traceId.length):c.bytes===Array?Array.prototype.slice.call(n.traceId):n.traceId),n.asInt!=null&&n.hasOwnProperty("asInt")&&(typeof n.asInt=="number"?u.asInt=c.longs===String?String(n.asInt):n.asInt:u.asInt=c.longs===String?m.Long.prototype.toString.call(n.asInt):c.longs===Number?new m.LongBits(n.asInt.low>>>0,n.asInt.high>>>0).toNumber():n.asInt,c.oneofs&&(u.value="asInt")),n.filteredAttributes&&n.filteredAttributes.length){u.filteredAttributes=[];for(var d=0;d<n.filteredAttributes.length;++d)u.filteredAttributes[d]=f.opentelemetry.proto.common.v1.KeyValue.toObject(n.filteredAttributes[d],c)}return u},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/opentelemetry.proto.metrics.v1.Exemplar"},s})(),o})(),r})(),e.logs=(function(){var r={};return r.v1=(function(){var o={};return o.LogsData=(function(){function s(a){if(this.resourceLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resourceLogs=m.emptyArray,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.resourceLogs!=null&&i.resourceLogs.length)for(var c=0;c<i.resourceLogs.length;++c)f.opentelemetry.proto.logs.v1.ResourceLogs.encode(i.resourceLogs[c],n.uint32(10).fork()).ldelim();return n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.logs.v1.LogsData;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.resourceLogs&&l.resourceLogs.length||(l.resourceLogs=[]),l.resourceLogs.push(f.opentelemetry.proto.logs.v1.ResourceLogs.decode(i,i.uint32()));break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resourceLogs!=null&&i.hasOwnProperty("resourceLogs")){if(!Array.isArray(i.resourceLogs))return"resourceLogs: array expected";for(var n=0;n<i.resourceLogs.length;++n){var c=f.opentelemetry.proto.logs.v1.ResourceLogs.verify(i.resourceLogs[n]);if(c)return"resourceLogs."+c}}return null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.logs.v1.LogsData)return i;var n=new f.opentelemetry.proto.logs.v1.LogsData;if(i.resourceLogs){if(!Array.isArray(i.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");n.resourceLogs=[];for(var c=0;c<i.resourceLogs.length;++c){if(typeof i.resourceLogs[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");n.resourceLogs[c]=f.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(i.resourceLogs[c])}}return n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.resourceLogs=[]),i.resourceLogs&&i.resourceLogs.length){c.resourceLogs=[];for(var u=0;u<i.resourceLogs.length;++u)c.resourceLogs[u]=f.opentelemetry.proto.logs.v1.ResourceLogs.toObject(i.resourceLogs[u],n)}return c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogsData"},s})(),o.ResourceLogs=(function(){function s(a){if(this.scopeLogs=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.resource=null,s.prototype.scopeLogs=m.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.resource!=null&&Object.hasOwnProperty.call(i,"resource")&&f.opentelemetry.proto.resource.v1.Resource.encode(i.resource,n.uint32(10).fork()).ldelim(),i.scopeLogs!=null&&i.scopeLogs.length)for(var c=0;c<i.scopeLogs.length;++c)f.opentelemetry.proto.logs.v1.ScopeLogs.encode(i.scopeLogs[c],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.logs.v1.ResourceLogs;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.resource=f.opentelemetry.proto.resource.v1.Resource.decode(i,i.uint32());break}case 2:{l.scopeLogs&&l.scopeLogs.length||(l.scopeLogs=[]),l.scopeLogs.push(f.opentelemetry.proto.logs.v1.ScopeLogs.decode(i,i.uint32()));break}case 3:{l.schemaUrl=i.string();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.resource!=null&&i.hasOwnProperty("resource")){var n=f.opentelemetry.proto.resource.v1.Resource.verify(i.resource);if(n)return"resource."+n}if(i.scopeLogs!=null&&i.hasOwnProperty("scopeLogs")){if(!Array.isArray(i.scopeLogs))return"scopeLogs: array expected";for(var c=0;c<i.scopeLogs.length;++c){var n=f.opentelemetry.proto.logs.v1.ScopeLogs.verify(i.scopeLogs[c]);if(n)return"scopeLogs."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!m.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.logs.v1.ResourceLogs)return i;var n=new f.opentelemetry.proto.logs.v1.ResourceLogs;if(i.resource!=null){if(typeof i.resource!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");n.resource=f.opentelemetry.proto.resource.v1.Resource.fromObject(i.resource)}if(i.scopeLogs){if(!Array.isArray(i.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");n.scopeLogs=[];for(var c=0;c<i.scopeLogs.length;++c){if(typeof i.scopeLogs[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");n.scopeLogs[c]=f.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(i.scopeLogs[c])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.scopeLogs=[]),n.defaults&&(c.resource=null,c.schemaUrl=""),i.resource!=null&&i.hasOwnProperty("resource")&&(c.resource=f.opentelemetry.proto.resource.v1.Resource.toObject(i.resource,n)),i.scopeLogs&&i.scopeLogs.length){c.scopeLogs=[];for(var u=0;u<i.scopeLogs.length;++u)c.scopeLogs[u]=f.opentelemetry.proto.logs.v1.ScopeLogs.toObject(i.scopeLogs[u],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(c.schemaUrl=i.schemaUrl),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ResourceLogs"},s})(),o.ScopeLogs=(function(){function s(a){if(this.logRecords=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.scope=null,s.prototype.logRecords=m.emptyArray,s.prototype.schemaUrl=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.scope!=null&&Object.hasOwnProperty.call(i,"scope")&&f.opentelemetry.proto.common.v1.InstrumentationScope.encode(i.scope,n.uint32(10).fork()).ldelim(),i.logRecords!=null&&i.logRecords.length)for(var c=0;c<i.logRecords.length;++c)f.opentelemetry.proto.logs.v1.LogRecord.encode(i.logRecords[c],n.uint32(18).fork()).ldelim();return i.schemaUrl!=null&&Object.hasOwnProperty.call(i,"schemaUrl")&&n.uint32(26).string(i.schemaUrl),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.logs.v1.ScopeLogs;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.decode(i,i.uint32());break}case 2:{l.logRecords&&l.logRecords.length||(l.logRecords=[]),l.logRecords.push(f.opentelemetry.proto.logs.v1.LogRecord.decode(i,i.uint32()));break}case 3:{l.schemaUrl=i.string();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.scope!=null&&i.hasOwnProperty("scope")){var n=f.opentelemetry.proto.common.v1.InstrumentationScope.verify(i.scope);if(n)return"scope."+n}if(i.logRecords!=null&&i.hasOwnProperty("logRecords")){if(!Array.isArray(i.logRecords))return"logRecords: array expected";for(var c=0;c<i.logRecords.length;++c){var n=f.opentelemetry.proto.logs.v1.LogRecord.verify(i.logRecords[c]);if(n)return"logRecords."+n}}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&!m.isString(i.schemaUrl)?"schemaUrl: string expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.logs.v1.ScopeLogs)return i;var n=new f.opentelemetry.proto.logs.v1.ScopeLogs;if(i.scope!=null){if(typeof i.scope!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");n.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(i.scope)}if(i.logRecords){if(!Array.isArray(i.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");n.logRecords=[];for(var c=0;c<i.logRecords.length;++c){if(typeof i.logRecords[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");n.logRecords[c]=f.opentelemetry.proto.logs.v1.LogRecord.fromObject(i.logRecords[c])}}return i.schemaUrl!=null&&(n.schemaUrl=String(i.schemaUrl)),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.logRecords=[]),n.defaults&&(c.scope=null,c.schemaUrl=""),i.scope!=null&&i.hasOwnProperty("scope")&&(c.scope=f.opentelemetry.proto.common.v1.InstrumentationScope.toObject(i.scope,n)),i.logRecords&&i.logRecords.length){c.logRecords=[];for(var u=0;u<i.logRecords.length;++u)c.logRecords[u]=f.opentelemetry.proto.logs.v1.LogRecord.toObject(i.logRecords[u],n)}return i.schemaUrl!=null&&i.hasOwnProperty("schemaUrl")&&(c.schemaUrl=i.schemaUrl),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.ScopeLogs"},s})(),o.SeverityNumber=(function(){var s={},a=Object.create(s);return a[s[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,a[s[1]="SEVERITY_NUMBER_TRACE"]=1,a[s[2]="SEVERITY_NUMBER_TRACE2"]=2,a[s[3]="SEVERITY_NUMBER_TRACE3"]=3,a[s[4]="SEVERITY_NUMBER_TRACE4"]=4,a[s[5]="SEVERITY_NUMBER_DEBUG"]=5,a[s[6]="SEVERITY_NUMBER_DEBUG2"]=6,a[s[7]="SEVERITY_NUMBER_DEBUG3"]=7,a[s[8]="SEVERITY_NUMBER_DEBUG4"]=8,a[s[9]="SEVERITY_NUMBER_INFO"]=9,a[s[10]="SEVERITY_NUMBER_INFO2"]=10,a[s[11]="SEVERITY_NUMBER_INFO3"]=11,a[s[12]="SEVERITY_NUMBER_INFO4"]=12,a[s[13]="SEVERITY_NUMBER_WARN"]=13,a[s[14]="SEVERITY_NUMBER_WARN2"]=14,a[s[15]="SEVERITY_NUMBER_WARN3"]=15,a[s[16]="SEVERITY_NUMBER_WARN4"]=16,a[s[17]="SEVERITY_NUMBER_ERROR"]=17,a[s[18]="SEVERITY_NUMBER_ERROR2"]=18,a[s[19]="SEVERITY_NUMBER_ERROR3"]=19,a[s[20]="SEVERITY_NUMBER_ERROR4"]=20,a[s[21]="SEVERITY_NUMBER_FATAL"]=21,a[s[22]="SEVERITY_NUMBER_FATAL2"]=22,a[s[23]="SEVERITY_NUMBER_FATAL3"]=23,a[s[24]="SEVERITY_NUMBER_FATAL4"]=24,a})(),o.LogRecordFlags=(function(){var s={},a=Object.create(s);return a[s[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,a[s[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,a})(),o.LogRecord=(function(){function s(a){if(this.attributes=[],a)for(var i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]!=null&&(this[i[n]]=a[i[n]])}return s.prototype.timeUnixNano=null,s.prototype.observedTimeUnixNano=null,s.prototype.severityNumber=null,s.prototype.severityText=null,s.prototype.body=null,s.prototype.attributes=m.emptyArray,s.prototype.droppedAttributesCount=null,s.prototype.flags=null,s.prototype.traceId=null,s.prototype.spanId=null,s.prototype.eventName=null,s.create=function(i){return new s(i)},s.encode=function(i,n){if(n||(n=ee.create()),i.timeUnixNano!=null&&Object.hasOwnProperty.call(i,"timeUnixNano")&&n.uint32(9).fixed64(i.timeUnixNano),i.severityNumber!=null&&Object.hasOwnProperty.call(i,"severityNumber")&&n.uint32(16).int32(i.severityNumber),i.severityText!=null&&Object.hasOwnProperty.call(i,"severityText")&&n.uint32(26).string(i.severityText),i.body!=null&&Object.hasOwnProperty.call(i,"body")&&f.opentelemetry.proto.common.v1.AnyValue.encode(i.body,n.uint32(42).fork()).ldelim(),i.attributes!=null&&i.attributes.length)for(var c=0;c<i.attributes.length;++c)f.opentelemetry.proto.common.v1.KeyValue.encode(i.attributes[c],n.uint32(50).fork()).ldelim();return i.droppedAttributesCount!=null&&Object.hasOwnProperty.call(i,"droppedAttributesCount")&&n.uint32(56).uint32(i.droppedAttributesCount),i.flags!=null&&Object.hasOwnProperty.call(i,"flags")&&n.uint32(69).fixed32(i.flags),i.traceId!=null&&Object.hasOwnProperty.call(i,"traceId")&&n.uint32(74).bytes(i.traceId),i.spanId!=null&&Object.hasOwnProperty.call(i,"spanId")&&n.uint32(82).bytes(i.spanId),i.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(i,"observedTimeUnixNano")&&n.uint32(89).fixed64(i.observedTimeUnixNano),i.eventName!=null&&Object.hasOwnProperty.call(i,"eventName")&&n.uint32(98).string(i.eventName),n},s.encodeDelimited=function(i,n){return this.encode(i,n).ldelim()},s.decode=function(i,n,c){i instanceof T||(i=T.create(i));for(var u=n===void 0?i.len:i.pos+n,l=new f.opentelemetry.proto.logs.v1.LogRecord;i.pos<u;){var d=i.uint32();if(d===c)break;switch(d>>>3){case 1:{l.timeUnixNano=i.fixed64();break}case 11:{l.observedTimeUnixNano=i.fixed64();break}case 2:{l.severityNumber=i.int32();break}case 3:{l.severityText=i.string();break}case 5:{l.body=f.opentelemetry.proto.common.v1.AnyValue.decode(i,i.uint32());break}case 6:{l.attributes&&l.attributes.length||(l.attributes=[]),l.attributes.push(f.opentelemetry.proto.common.v1.KeyValue.decode(i,i.uint32()));break}case 7:{l.droppedAttributesCount=i.uint32();break}case 8:{l.flags=i.fixed32();break}case 9:{l.traceId=i.bytes();break}case 10:{l.spanId=i.bytes();break}case 12:{l.eventName=i.string();break}default:i.skipType(d&7);break}}return l},s.decodeDelimited=function(i){return i instanceof T||(i=new T(i)),this.decode(i,i.uint32())},s.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&!m.isInteger(i.timeUnixNano)&&!(i.timeUnixNano&&m.isInteger(i.timeUnixNano.low)&&m.isInteger(i.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&!m.isInteger(i.observedTimeUnixNano)&&!(i.observedTimeUnixNano&&m.isInteger(i.observedTimeUnixNano.low)&&m.isInteger(i.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected";if(i.severityNumber!=null&&i.hasOwnProperty("severityNumber"))switch(i.severityNumber){default:return"severityNumber: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(i.severityText!=null&&i.hasOwnProperty("severityText")&&!m.isString(i.severityText))return"severityText: string expected";if(i.body!=null&&i.hasOwnProperty("body")){var n=f.opentelemetry.proto.common.v1.AnyValue.verify(i.body);if(n)return"body."+n}if(i.attributes!=null&&i.hasOwnProperty("attributes")){if(!Array.isArray(i.attributes))return"attributes: array expected";for(var c=0;c<i.attributes.length;++c){var n=f.opentelemetry.proto.common.v1.KeyValue.verify(i.attributes[c]);if(n)return"attributes."+n}}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&!m.isInteger(i.droppedAttributesCount)?"droppedAttributesCount: integer expected":i.flags!=null&&i.hasOwnProperty("flags")&&!m.isInteger(i.flags)?"flags: integer expected":i.traceId!=null&&i.hasOwnProperty("traceId")&&!(i.traceId&&typeof i.traceId.length=="number"||m.isString(i.traceId))?"traceId: buffer expected":i.spanId!=null&&i.hasOwnProperty("spanId")&&!(i.spanId&&typeof i.spanId.length=="number"||m.isString(i.spanId))?"spanId: buffer expected":i.eventName!=null&&i.hasOwnProperty("eventName")&&!m.isString(i.eventName)?"eventName: string expected":null},s.fromObject=function(i){if(i instanceof f.opentelemetry.proto.logs.v1.LogRecord)return i;var n=new f.opentelemetry.proto.logs.v1.LogRecord;switch(i.timeUnixNano!=null&&(m.Long?(n.timeUnixNano=m.Long.fromValue(i.timeUnixNano)).unsigned=!1:typeof i.timeUnixNano=="string"?n.timeUnixNano=parseInt(i.timeUnixNano,10):typeof i.timeUnixNano=="number"?n.timeUnixNano=i.timeUnixNano:typeof i.timeUnixNano=="object"&&(n.timeUnixNano=new m.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber())),i.observedTimeUnixNano!=null&&(m.Long?(n.observedTimeUnixNano=m.Long.fromValue(i.observedTimeUnixNano)).unsigned=!1:typeof i.observedTimeUnixNano=="string"?n.observedTimeUnixNano=parseInt(i.observedTimeUnixNano,10):typeof i.observedTimeUnixNano=="number"?n.observedTimeUnixNano=i.observedTimeUnixNano:typeof i.observedTimeUnixNano=="object"&&(n.observedTimeUnixNano=new m.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber())),i.severityNumber){default:if(typeof i.severityNumber=="number"){n.severityNumber=i.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:n.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:n.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:n.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:n.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:n.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:n.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:n.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:n.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:n.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:n.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:n.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:n.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:n.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:n.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:n.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:n.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:n.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:n.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:n.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:n.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:n.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:n.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:n.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:n.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:n.severityNumber=24;break}if(i.severityText!=null&&(n.severityText=String(i.severityText)),i.body!=null){if(typeof i.body!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");n.body=f.opentelemetry.proto.common.v1.AnyValue.fromObject(i.body)}if(i.attributes){if(!Array.isArray(i.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");n.attributes=[];for(var c=0;c<i.attributes.length;++c){if(typeof i.attributes[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");n.attributes[c]=f.opentelemetry.proto.common.v1.KeyValue.fromObject(i.attributes[c])}}return i.droppedAttributesCount!=null&&(n.droppedAttributesCount=i.droppedAttributesCount>>>0),i.flags!=null&&(n.flags=i.flags>>>0),i.traceId!=null&&(typeof i.traceId=="string"?m.base64.decode(i.traceId,n.traceId=m.newBuffer(m.base64.length(i.traceId)),0):i.traceId.length>=0&&(n.traceId=i.traceId)),i.spanId!=null&&(typeof i.spanId=="string"?m.base64.decode(i.spanId,n.spanId=m.newBuffer(m.base64.length(i.spanId)),0):i.spanId.length>=0&&(n.spanId=i.spanId)),i.eventName!=null&&(n.eventName=String(i.eventName)),n},s.toObject=function(i,n){n||(n={});var c={};if((n.arrays||n.defaults)&&(c.attributes=[]),n.defaults){if(m.Long){var u=new m.Long(0,0,!1);c.timeUnixNano=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else c.timeUnixNano=n.longs===String?"0":0;if(c.severityNumber=n.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,c.severityText="",c.body=null,c.droppedAttributesCount=0,c.flags=0,n.bytes===String?c.traceId="":(c.traceId=[],n.bytes!==Array&&(c.traceId=m.newBuffer(c.traceId))),n.bytes===String?c.spanId="":(c.spanId=[],n.bytes!==Array&&(c.spanId=m.newBuffer(c.spanId))),m.Long){var u=new m.Long(0,0,!1);c.observedTimeUnixNano=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else c.observedTimeUnixNano=n.longs===String?"0":0;c.eventName=""}if(i.timeUnixNano!=null&&i.hasOwnProperty("timeUnixNano")&&(typeof i.timeUnixNano=="number"?c.timeUnixNano=n.longs===String?String(i.timeUnixNano):i.timeUnixNano:c.timeUnixNano=n.longs===String?m.Long.prototype.toString.call(i.timeUnixNano):n.longs===Number?new m.LongBits(i.timeUnixNano.low>>>0,i.timeUnixNano.high>>>0).toNumber():i.timeUnixNano),i.severityNumber!=null&&i.hasOwnProperty("severityNumber")&&(c.severityNumber=n.enums===String?f.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]===void 0?i.severityNumber:f.opentelemetry.proto.logs.v1.SeverityNumber[i.severityNumber]:i.severityNumber),i.severityText!=null&&i.hasOwnProperty("severityText")&&(c.severityText=i.severityText),i.body!=null&&i.hasOwnProperty("body")&&(c.body=f.opentelemetry.proto.common.v1.AnyValue.toObject(i.body,n)),i.attributes&&i.attributes.length){c.attributes=[];for(var l=0;l<i.attributes.length;++l)c.attributes[l]=f.opentelemetry.proto.common.v1.KeyValue.toObject(i.attributes[l],n)}return i.droppedAttributesCount!=null&&i.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=i.droppedAttributesCount),i.flags!=null&&i.hasOwnProperty("flags")&&(c.flags=i.flags),i.traceId!=null&&i.hasOwnProperty("traceId")&&(c.traceId=n.bytes===String?m.base64.encode(i.traceId,0,i.traceId.length):n.bytes===Array?Array.prototype.slice.call(i.traceId):i.traceId),i.spanId!=null&&i.hasOwnProperty("spanId")&&(c.spanId=n.bytes===String?m.base64.encode(i.spanId,0,i.spanId.length):n.bytes===Array?Array.prototype.slice.call(i.spanId):i.spanId),i.observedTimeUnixNano!=null&&i.hasOwnProperty("observedTimeUnixNano")&&(typeof i.observedTimeUnixNano=="number"?c.observedTimeUnixNano=n.longs===String?String(i.observedTimeUnixNano):i.observedTimeUnixNano:c.observedTimeUnixNano=n.longs===String?m.Long.prototype.toString.call(i.observedTimeUnixNano):n.longs===Number?new m.LongBits(i.observedTimeUnixNano.low>>>0,i.observedTimeUnixNano.high>>>0).toNumber():i.observedTimeUnixNano),i.eventName!=null&&i.hasOwnProperty("eventName")&&(c.eventName=i.eventName),c},s.prototype.toJSON=function(){return this.constructor.toObject(this,X.util.toJSONOptions)},s.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/opentelemetry.proto.logs.v1.LogRecord"},s})(),o})(),r})(),e})(),t})();p8.exports=f});var h8=p(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.hexToBinary=void 0;function f8(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function RNe(t){let e=new Uint8Array(t.length/2),r=0;for(let o=0;o<t.length;o+=2){let s=f8(t.charCodeAt(o)),a=f8(t.charCodeAt(o+1));e[r++]=s<<4|a}return e}oE.hexToBinary=RNe});var sE=p(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.getOtlpEncoder=Or.encodeAsString=Or.encodeAsLongBits=Or.toLongBits=Or.hrTimeToNanos=void 0;var PNe=W(),fN=h8();function hN(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}Or.hrTimeToNanos=hN;function _8(t){let e=Number(BigInt.asUintN(32,t)),r=Number(BigInt.asUintN(32,t>>BigInt(32)));return{low:e,high:r}}Or.toLongBits=_8;function mN(t){let e=hN(t);return _8(e)}Or.encodeAsLongBits=mN;function g8(t){return hN(t).toString()}Or.encodeAsString=g8;var CNe=typeof BigInt<"u"?g8:PNe.hrTimeToNanoseconds;function m8(t){return t}function E8(t){if(t!==void 0)return(0,fN.hexToBinary)(t)}var NNe={encodeHrTime:mN,encodeSpanContext:fN.hexToBinary,encodeOptionalSpanContext:E8};function MNe(t){if(t===void 0)return NNe;let e=t.useLongBits??!0,r=t.useHex??!1;return{encodeHrTime:e?mN:CNe,encodeSpanContext:r?m8:fN.hexToBinary,encodeOptionalSpanContext:r?m8:E8}}Or.getOtlpEncoder=MNe});var aE=p(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.toAnyValue=br.toKeyValue=br.toAttributes=br.createInstrumentationScope=br.createResource=void 0;function INe(t){let e={attributes:S8(t.attributes),droppedAttributesCount:0},r=t.schemaUrl;return r&&r!==""&&(e.schemaUrl=r),e}br.createResource=INe;function xNe(t){return{name:t.name,version:t.version}}br.createInstrumentationScope=xNe;function S8(t){return Object.keys(t).map(e=>_N(e,t[e]))}br.toAttributes=S8;function _N(t,e){return{key:t,value:gN(e)}}br.toKeyValue=_N;function gN(t){let e=typeof t;return e==="string"?{stringValue:t}:e==="number"?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:e==="boolean"?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(gN)}}:e==="object"&&t!=null?{kvlistValue:{values:Object.entries(t).map(([r,o])=>_N(r,o))}}:{}}br.toAnyValue=gN});var EN=p(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.toLogAttributes=_c.createExportLogsServiceRequest=void 0;var wNe=sE(),cE=aE();function LNe(t,e){let r=(0,wNe.getOtlpEncoder)(e);return{resourceLogs:UNe(t,r)}}_c.createExportLogsServiceRequest=LNe;function DNe(t){let e=new Map;for(let r of t){let{resource:o,instrumentationScope:{name:s,version:a="",schemaUrl:i=""}}=r,n=e.get(o);n||(n=new Map,e.set(o,n));let c=`${s}@${a}:${i}`,u=n.get(c);u||(u=[],n.set(c,u)),u.push(r)}return e}function UNe(t,e){let r=DNe(t);return Array.from(r,([o,s])=>{let a=(0,cE.createResource)(o);return{resource:a,scopeLogs:Array.from(s,([,i])=>({scope:(0,cE.createInstrumentationScope)(i[0].instrumentationScope),logRecords:i.map(n=>kNe(n,e)),schemaUrl:i[0].instrumentationScope.schemaUrl})),schemaUrl:a.schemaUrl}})}function kNe(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:(0,cE.toAnyValue)(t.body),eventName:t.eventName,attributes:T8(t.attributes),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function T8(t){return Object.keys(t).map(e=>(0,cE.toKeyValue)(e,t[e]))}_c.toLogAttributes=T8});var v8=p(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});uE.ProtobufLogsSerializer=void 0;var y8=iE(),BNe=EN(),FNe=y8.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,VNe=y8.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;uE.ProtobufLogsSerializer={serializeRequest:t=>{let e=(0,BNe.createExportLogsServiceRequest)(t);return VNe.encode(e).finish()},deserializeResponse:t=>FNe.decode(t)}});var A8=p(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});lE.ProtobufLogsSerializer=void 0;var GNe=v8();Object.defineProperty(lE,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return GNe.ProtobufLogsSerializer}})});var O8=p(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.EAggregationTemporality=void 0;var qNe;(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"})(qNe=Nl.EAggregationTemporality||(Nl.EAggregationTemporality={}))});var SN=p(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createExportMetricsServiceRequest=Vn.toMetric=Vn.toScopeMetrics=Vn.toResourceMetrics=void 0;var b8=(b(),y(P)),gc=Ei(),R8=O8(),jNe=sE(),Ml=aE();function C8(t,e){let r=(0,jNe.getOtlpEncoder)(e),o=(0,Ml.createResource)(t.resource);return{resource:o,schemaUrl:o.schemaUrl,scopeMetrics:N8(t.scopeMetrics,r)}}Vn.toResourceMetrics=C8;function N8(t,e){return Array.from(t.map(r=>({scope:(0,Ml.createInstrumentationScope)(r.scope),metrics:r.metrics.map(o=>M8(o,e)),schemaUrl:r.scope.schemaUrl})))}Vn.toScopeMetrics=N8;function M8(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},o=YNe(t.aggregationTemporality);switch(t.dataPointType){case gc.DataPointType.SUM:r.sum={aggregationTemporality:o,isMonotonic:t.isMonotonic,dataPoints:P8(t,e)};break;case gc.DataPointType.GAUGE:r.gauge={dataPoints:P8(t,e)};break;case gc.DataPointType.HISTOGRAM:r.histogram={aggregationTemporality:o,dataPoints:zNe(t,e)};break;case gc.DataPointType.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:o,dataPoints:$Ne(t,e)};break}return r}Vn.toMetric=M8;function HNe(t,e,r){let o={attributes:(0,Ml.toAttributes)(t.attributes),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case b8.ValueType.INT:o.asInt=t.value;break;case b8.ValueType.DOUBLE:o.asDouble=t.value;break}return o}function P8(t,e){return t.dataPoints.map(r=>HNe(r,t.descriptor.valueType,e))}function zNe(t,e){return t.dataPoints.map(r=>{let o=r.value;return{attributes:(0,Ml.toAttributes)(r.attributes),bucketCounts:o.buckets.counts,explicitBounds:o.buckets.boundaries,count:o.count,sum:o.sum,min:o.min,max:o.max,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function $Ne(t,e){return t.dataPoints.map(r=>{let o=r.value;return{attributes:(0,Ml.toAttributes)(r.attributes),count:o.count,min:o.min,max:o.max,sum:o.sum,positive:{offset:o.positive.offset,bucketCounts:o.positive.bucketCounts},negative:{offset:o.negative.offset,bucketCounts:o.negative.bucketCounts},scale:o.scale,zeroCount:o.zeroCount,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function YNe(t){switch(t){case gc.AggregationTemporality.DELTA:return R8.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;case gc.AggregationTemporality.CUMULATIVE:return R8.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE}}function WNe(t,e){return{resourceMetrics:t.map(r=>C8(r,e))}}Vn.createExportMetricsServiceRequest=WNe});var x8=p(dE=>{"use strict";Object.defineProperty(dE,"__esModule",{value:!0});dE.ProtobufMetricsSerializer=void 0;var I8=iE(),KNe=SN(),XNe=I8.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,JNe=I8.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;dE.ProtobufMetricsSerializer={serializeRequest:t=>{let e=(0,KNe.createExportMetricsServiceRequest)([t]);return JNe.encode(e).finish()},deserializeResponse:t=>XNe.decode(t)}});var w8=p(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});pE.ProtobufMetricsSerializer=void 0;var QNe=x8();Object.defineProperty(pE,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return QNe.ProtobufMetricsSerializer}})});var TN=p(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createExportTraceServiceRequest=Gn.toOtlpSpanEvent=Gn.toOtlpLink=Gn.sdkSpanToOtlpSpan=void 0;var Il=aE(),ZNe=sE(),eMe=256,tMe=512;function L8(t,e){let r=t&255|eMe;return e&&(r|=tMe),r}function D8(t,e){let r=t.spanContext(),o=t.status,s=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:s,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:(0,Il.toAttributes)(t.attributes),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(a=>k8(a,e)),droppedEventsCount:t.droppedEventsCount,status:{code:o.code,message:o.message},links:t.links.map(a=>U8(a,e)),droppedLinksCount:t.droppedLinksCount,flags:L8(r.traceFlags,t.parentSpanContext?.isRemote)}}Gn.sdkSpanToOtlpSpan=D8;function U8(t,e){return{attributes:t.attributes?(0,Il.toAttributes)(t.attributes):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0,flags:L8(t.context.traceFlags,t.context.isRemote)}}Gn.toOtlpLink=U8;function k8(t,e){return{attributes:t.attributes?(0,Il.toAttributes)(t.attributes):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}Gn.toOtlpSpanEvent=k8;function rMe(t,e){let r=(0,ZNe.getOtlpEncoder)(e);return{resourceSpans:iMe(t,r)}}Gn.createExportTraceServiceRequest=rMe;function nMe(t){let e=new Map;for(let r of t){let o=e.get(r.resource);o||(o=new Map,e.set(r.resource,o));let s=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,a=o.get(s);a||(a=[],o.set(s,a)),a.push(r)}return e}function iMe(t,e){let r=nMe(t),o=[],s=r.entries(),a=s.next();for(;!a.done;){let[i,n]=a.value,c=[],u=n.values(),l=u.next();for(;!l.done;){let g=l.value;if(g.length>0){let E=g.map(S=>D8(S,e));c.push({scope:(0,Il.createInstrumentationScope)(g[0].instrumentationScope),spans:E,schemaUrl:g[0].instrumentationScope.schemaUrl})}l=u.next()}let d=(0,Il.createResource)(i),h={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};o.push(h),a=s.next()}return o}});var F8=p(fE=>{"use strict";Object.defineProperty(fE,"__esModule",{value:!0});fE.ProtobufTraceSerializer=void 0;var B8=iE(),oMe=TN(),sMe=B8.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,aMe=B8.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;fE.ProtobufTraceSerializer={serializeRequest:t=>{let e=(0,oMe.createExportTraceServiceRequest)(t);return aMe.encode(e).finish()},deserializeResponse:t=>sMe.decode(t)}});var V8=p(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.ProtobufTraceSerializer=void 0;var cMe=F8();Object.defineProperty(hE,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return cMe.ProtobufTraceSerializer}})});var G8=p(mE=>{"use strict";Object.defineProperty(mE,"__esModule",{value:!0});mE.JsonLogsSerializer=void 0;var uMe=EN();mE.JsonLogsSerializer={serializeRequest:t=>{let e=(0,uMe.createExportLogsServiceRequest)(t,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;return JSON.parse(e.decode(t))}}});var q8=p(_E=>{"use strict";Object.defineProperty(_E,"__esModule",{value:!0});_E.JsonLogsSerializer=void 0;var lMe=G8();Object.defineProperty(_E,"JsonLogsSerializer",{enumerable:!0,get:function(){return lMe.JsonLogsSerializer}})});var j8=p(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0});gE.JsonMetricsSerializer=void 0;var dMe=SN();gE.JsonMetricsSerializer={serializeRequest:t=>{let e=(0,dMe.createExportMetricsServiceRequest)([t],{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;return JSON.parse(e.decode(t))}}});var H8=p(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});EE.JsonMetricsSerializer=void 0;var pMe=j8();Object.defineProperty(EE,"JsonMetricsSerializer",{enumerable:!0,get:function(){return pMe.JsonMetricsSerializer}})});var z8=p(SE=>{"use strict";Object.defineProperty(SE,"__esModule",{value:!0});SE.JsonTraceSerializer=void 0;var fMe=TN();SE.JsonTraceSerializer={serializeRequest:t=>{let e=(0,fMe.createExportTraceServiceRequest)(t,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;return JSON.parse(e.decode(t))}}});var $8=p(TE=>{"use strict";Object.defineProperty(TE,"__esModule",{value:!0});TE.JsonTraceSerializer=void 0;var hMe=z8();Object.defineProperty(TE,"JsonTraceSerializer",{enumerable:!0,get:function(){return hMe.JsonTraceSerializer}})});var qn=p(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.JsonTraceSerializer=Kt.JsonMetricsSerializer=Kt.JsonLogsSerializer=Kt.ProtobufTraceSerializer=Kt.ProtobufMetricsSerializer=Kt.ProtobufLogsSerializer=void 0;var mMe=A8();Object.defineProperty(Kt,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return mMe.ProtobufLogsSerializer}});var _Me=w8();Object.defineProperty(Kt,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return _Me.ProtobufMetricsSerializer}});var gMe=V8();Object.defineProperty(Kt,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return gMe.ProtobufTraceSerializer}});var EMe=q8();Object.defineProperty(Kt,"JsonLogsSerializer",{enumerable:!0,get:function(){return EMe.JsonLogsSerializer}});var SMe=H8();Object.defineProperty(Kt,"JsonMetricsSerializer",{enumerable:!0,get:function(){return SMe.JsonMetricsSerializer}});var TMe=$8();Object.defineProperty(Kt,"JsonTraceSerializer",{enumerable:!0,get:function(){return TMe.JsonTraceSerializer}})});var Y8=p(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:!0});yE.VERSION=void 0;yE.VERSION="0.206.0"});function W8(t){return()=>{let e={};return Object.entries(t?.()??{}).forEach(([r,o])=>{typeof o<"u"?e[r]=String(o):Je.warn(`Header "${r}" has invalid value (${o}) and will be ignored`)}),e}}var K8=U(()=>{b()});function yMe(t,e,r){let o={...r()},s={};return()=>(e!=null&&Object.assign(s,e()),t!=null&&Object.assign(s,t()),Object.assign(s,o))}function vMe(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 X8(t,e,r){return{...Yg(t,e,r),headers:yMe(W8(t.headers),e.headers,r.headers),url:vMe(t.url)??e.url??r.url}}function J8(t,e){return{...Wg(),headers:()=>t,url:"http://localhost:4318/"+e}}var Q8=U(()=>{bl();K8()});function xl(t){return async e=>{let r=e==="http:"?import("http"):import("https"),{Agent:o}=await r;return new o(t)}}function Z8(t,e,r){return{...X8(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory}}function eX(t,e){return{...J8(t,e),agentFactory:xl({keepAlive:!0})}}var yN=U(()=>{Q8()});function tX(t){return[429,502,503,504].includes(t)}function rX(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 nX=U(()=>{});function sX(t,e,r,o,s,a){let i=new URL(e.url),n={hostname:i.hostname,port:i.port,path:i.pathname,method:"POST",headers:{...e.headers()},agent:r},c=t(n,u=>{let l=[];u.on("data",d=>l.push(d)),u.on("end",()=>{if(u.statusCode&&u.statusCode<299)s({status:"success",data:Buffer.concat(l)});else if(u.statusCode&&tX(u.statusCode))s({status:"retryable",retryInMillis:rX(u.headers["retry-after"])});else{let d=new Ti(u.statusMessage,u.statusCode,Buffer.concat(l).toString());s({status:"failure",error:d})}})});c.setTimeout(a,()=>{c.destroy(),s({status:"failure",error:new Error("Request Timeout")})}),c.on("error",u=>{s({status:"failure",error:u})}),AMe(c,e.compression,o,u=>{s({status:"failure",error:u})})}function AMe(t,e,r,o){let s=OMe(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),s=s.on("error",o).pipe(iX.createGzip()).on("error",o)),s.pipe(t).on("error",o)}function OMe(t){let e=new oX.Readable;return e.push(t),e.push(null),e}var iX,oX,aX=U(()=>{iX=J(require("zlib")),oX=require("stream");nX();zg()});async function bMe(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function cX(t){return new vN(t)}var vN,uX=U(()=>{aX();vN=class{_parameters;_utils=null;constructor(e){this._parameters=e}async send(e,r){let{agent:o,request:s}=await this._loadUtils();return new Promise(a=>{sX(s,this._parameters,o,e,i=>{a(i)},r)})}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let r=new URL(this._parameters.url).protocol,[o,s]=await Promise.all([this._parameters.agentFactory(r),bMe(r)]);e=this._utils={agent:o,request:s}}return e}}});function RMe(){return Math.random()*(2*.2)-.2}function lX(t){return new AN(t.transport)}var AN,dX=U(()=>{AN=class{_transport;constructor(e){this._transport=e}retry(e,r,o){return new Promise((s,a)=>{setTimeout(()=>{this._transport.send(e,r).then(s,a)},o)})}async send(e,r){let o=Date.now()+r,s=await this._transport.send(e,r),a=5,i=1e3;for(;s.status==="retryable"&&a>0;){a--;let n=Math.max(Math.min(i,5e3)+RMe(),0);i=i*1.5;let c=s.retryInMillis??n,u=o-Date.now();if(c>u)return s;s=await this.retry(e,u,c)}return s}shutdown(){return this._transport.shutdown()}}});function pX(t,e){return Jg({transport:lX({transport:cX(t)}),serializer:e,promiseHandler:Xg(t)},{timeout:t.timeoutMillis})}var fX=U(()=>{XC();uX();WC();dX()});function hX(t){let e=(0,vE.getNumberFromEnv)(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;Je.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function PMe(t){let e=hX(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=hX("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function mX(t){let e=(0,vE.getStringFromEnv)(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;Je.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function CMe(t){let e=mX(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=mX("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function AE(t){return{timeoutMillis:PMe(t),compression:CMe(t)}}var vE,ON=U(()=>{vE=J(W());b()});function NMe(t){let e=(0,jn.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=(0,jn.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"),o=(0,jn.parseKeyPairsIntoRecord)(e),s=(0,jn.parseKeyPairsIntoRecord)(r);if(!(Object.keys(o).length===0&&Object.keys(s).length===0))return Object.assign({},(0,jn.parseKeyPairsIntoRecord)(r),(0,jn.parseKeyPairsIntoRecord)(e))}function MMe(t){try{return new URL(t).toString()}catch{Je.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function IMe(t,e){try{new URL(t)}catch{Je.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{Je.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function xMe(t){let e=(0,jn.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return IMe(e,t)}function wMe(t){let e=(0,jn.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return MMe(e)}function _X(t,e){return{...AE(t),url:wMe(t)??xMe(e),headers:$g(NMe(t))}}var jn,gX=U(()=>{jn=J(W());b();ON();bl()});function LMe(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 xl(e)}function EX(t,e,r,o){return t.metadata&&Je.warn("Metadata cannot be set when using http"),Z8({url:t.url,headers:$g(t.headers),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:LMe(t)},_X(e,r),eX(o,r))}var SX=U(()=>{b();bl();yN();yi();gX()});var ro={};Zd(ro,{convertLegacyHttpOptions:()=>EX,createOtlpHttpExportDelegate:()=>pX,getSharedConfigurationFromEnvironment:()=>AE,httpAgentFactoryFromOptions:()=>xl});var yi=U(()=>{yN();fX();ON();SX()});var yX=p(OE=>{"use strict";Object.defineProperty(OE,"__esModule",{value:!0});OE.OTLPLogExporter=void 0;var DMe=(kn(),y(Un)),UMe=qn(),kMe=Y8(),TX=(yi(),y(ro)),bN=class extends DMe.OTLPExporterBase{constructor(e={}){super((0,TX.createOtlpHttpExportDelegate)((0,TX.convertLegacyHttpOptions)(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${kMe.VERSION}`,"Content-Type":"application/json"}),UMe.JsonLogsSerializer))}};OE.OTLPLogExporter=bN});var vX=p(bE=>{"use strict";Object.defineProperty(bE,"__esModule",{value:!0});bE.OTLPLogExporter=void 0;var BMe=yX();Object.defineProperty(bE,"OTLPLogExporter",{enumerable:!0,get:function(){return BMe.OTLPLogExporter}})});var AX=p(RE=>{"use strict";Object.defineProperty(RE,"__esModule",{value:!0});RE.OTLPLogExporter=void 0;var FMe=vX();Object.defineProperty(RE,"OTLPLogExporter",{enumerable:!0,get:function(){return FMe.OTLPLogExporter}})});var OX=p(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});PE.OTLPLogExporter=void 0;var VMe=AX();Object.defineProperty(PE,"OTLPLogExporter",{enumerable:!0,get:function(){return VMe.OTLPLogExporter}})});var se=p(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=Rr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=Rr.Propagate=Rr.LogVerbosity=Rr.Status=void 0;var bX;(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"})(bX||(Rr.Status=bX={}));var RX;(function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.ERROR=2]="ERROR",t[t.NONE=3]="NONE"})(RX||(Rr.LogVerbosity=RX={}));var PX;(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"})(PX||(Rr.Propagate=PX={}));Rr.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;Rr.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024});var RN=p((ket,GMe)=>{GMe.exports={name:"@grpc/grpc-js",version:"1.14.1",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=p(sr=>{"use strict";var PN,CN,NN,MN;Object.defineProperty(sr,"__esModule",{value:!0});sr.log=sr.setLoggerVerbosity=sr.setLogger=sr.getLogger=void 0;sr.trace=QMe;sr.isTracerEnabled=NX;var no=se(),qMe=require("process"),jMe=RN().version,HMe={error:(t,...e)=>{console.error("E "+t,...e)},info:(t,...e)=>{console.error("I "+t,...e)},debug:(t,...e)=>{console.error("D "+t,...e)}},fs=HMe,Ec=no.LogVerbosity.ERROR,zMe=(CN=(PN=process.env.GRPC_NODE_VERBOSITY)!==null&&PN!==void 0?PN:process.env.GRPC_VERBOSITY)!==null&&CN!==void 0?CN:"";switch(zMe.toUpperCase()){case"DEBUG":Ec=no.LogVerbosity.DEBUG;break;case"INFO":Ec=no.LogVerbosity.INFO;break;case"ERROR":Ec=no.LogVerbosity.ERROR;break;case"NONE":Ec=no.LogVerbosity.NONE;break;default:}var $Me=()=>fs;sr.getLogger=$Me;var YMe=t=>{fs=t};sr.setLogger=YMe;var WMe=t=>{Ec=t};sr.setLoggerVerbosity=WMe;var KMe=(t,...e)=>{let r;if(t>=Ec){switch(t){case no.LogVerbosity.DEBUG:r=fs.debug;break;case no.LogVerbosity.INFO:r=fs.info;break;case no.LogVerbosity.ERROR:r=fs.error;break}r||(r=fs.error),r&&r.bind(fs)(...e)}};sr.log=KMe;var XMe=(MN=(NN=process.env.GRPC_NODE_TRACE)!==null&&NN!==void 0?NN:process.env.GRPC_TRACE)!==null&&MN!==void 0?MN:"",IN=new Set,CX=new Set;for(let t of XMe.split(","))t.startsWith("-")?CX.add(t.substring(1)):IN.add(t);var JMe=IN.has("all");function QMe(t,e,r){NX(e)&&(0,sr.log)(t,new Date().toISOString()+" | v"+jMe+" "+qMe.pid+" | "+e+" | "+r)}function NX(t){return!CX.has(t)&&(JMe||IN.has(t))}});var NE=p(CE=>{"use strict";Object.defineProperty(CE,"__esModule",{value:!0});CE.getErrorMessage=ZMe;CE.getErrorCode=eIe;function ZMe(t){return t instanceof Error?t.message:String(t)}function eIe(t){return typeof t=="object"&&t!==null&&"code"in t&&typeof t.code=="number"?t.code:null}});var nt=p(IE=>{"use strict";Object.defineProperty(IE,"__esModule",{value:!0});IE.Metadata=void 0;var tIe=Ee(),rIe=se(),nIe=NE(),iIe=/^[:0-9a-z_.-]+$/,oIe=/^[ -~]*$/;function sIe(t){return iIe.test(t)}function aIe(t){return oIe.test(t)}function IX(t){return t.endsWith("-bin")}function cIe(t){return!t.startsWith("grpc-")}function ME(t){return t.toLowerCase()}function MX(t,e){if(!sIe(t))throw new Error('Metadata key "'+t+'" contains illegal characters');if(e!=null)if(IX(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(!aIe(e))throw new Error('Metadata string value "'+e+'" contains illegal characters')}}var xN=class t{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,r){e=ME(e),MX(e,r),this.internalRepr.set(e,[r])}add(e,r){e=ME(e),MX(e,r);let o=this.internalRepr.get(e);o===void 0?this.internalRepr.set(e,[r]):o.push(r)}remove(e){e=ME(e),this.internalRepr.delete(e)}get(e){return e=ME(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[r,o]of this.internalRepr)if(o.length>0){let s=o[0];e[r]=Buffer.isBuffer(s)?Buffer.from(s):s}return e}clone(){let e=new t(this.options),r=e.internalRepr;for(let[o,s]of this.internalRepr){let a=s.map(i=>Buffer.isBuffer(i)?Buffer.from(i):i);r.set(o,a)}return e}merge(e){for(let[r,o]of e.internalRepr){let s=(this.internalRepr.get(r)||[]).concat(o);this.internalRepr.set(r,s)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[r,o]of this.internalRepr)r.startsWith(":")||(e[r]=o.map(uIe));return e}toJSON(){let e={};for(let[r,o]of this.internalRepr)e[r]=o;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 o of Object.keys(e)){if(o.charAt(0)===":")continue;let s=e[o];try{IX(o)?Array.isArray(s)?s.forEach(a=>{r.add(o,Buffer.from(a,"base64"))}):s!==void 0&&(cIe(o)?s.split(",").forEach(a=>{r.add(o,Buffer.from(a.trim(),"base64"))}):r.add(o,Buffer.from(s,"base64"))):Array.isArray(s)?s.forEach(a=>{r.add(o,a)}):s!==void 0&&r.add(o,s)}catch(a){let i=`Failed to add metadata entry ${o}: ${s}. ${(0,nIe.getErrorMessage)(a)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,tIe.log)(rIe.LogVerbosity.ERROR,i)}}return r}};IE.Metadata=xN;var uIe=t=>Buffer.isBuffer(t)?t.toString("base64"):t});var wE=p(xE=>{"use strict";Object.defineProperty(xE,"__esModule",{value:!0});xE.CallCredentials=void 0;var UN=nt();function lIe(t){return"getRequestHeaders"in t&&typeof t.getRequestHeaders=="function"}var Sc=class t{static createFromMetadataGenerator(e){return new LN(e)}static createFromGoogleCredential(e){return t.createFromMetadataGenerator((r,o)=>{let s;lIe(e)?s=e.getRequestHeaders(r.service_url):s=new Promise((a,i)=>{e.getRequestMetadata(r.service_url,(n,c)=>{if(n){i(n);return}if(!c){i(new Error("Headers not set by metadata plugin"));return}a(c)})}),s.then(a=>{let i=new UN.Metadata;for(let n of Object.keys(a))i.add(n,a[n]);o(null,i)},a=>{o(a)})})}static createEmpty(){return new DN}};xE.CallCredentials=Sc;var wN=class t extends Sc{constructor(e){super(),this.creds=e}async generateMetadata(e){let r=new UN.Metadata,o=await Promise.all(this.creds.map(s=>s.generateMetadata(e)));for(let s of o)r.merge(s);return r}compose(e){return new t(this.creds.concat([e]))}_equals(e){return this===e?!0:e instanceof t?this.creds.every((r,o)=>r._equals(e.creds[o])):!1}},LN=class t extends Sc{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((r,o)=>{this.metadataGenerator(e,(s,a)=>{a!==void 0?r(a):o(s)})})}compose(e){return new wN([this,e])}_equals(e){return this===e?!0:e instanceof t?this.metadataGenerator===e.metadataGenerator:!1}},DN=class t extends Sc{generateMetadata(e){return Promise.resolve(new UN.Metadata)}compose(e){return e}_equals(e){return e instanceof t}}});var BN=p(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.CIPHER_SUITES=void 0;wl.getDefaultRootsData=pIe;var dIe=require("fs");wl.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var xX=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,kN=null;function pIe(){return xX?(kN===null&&(kN=dIe.readFileSync(xX)),kN):null}});var Bt=p(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.parseUri=hIe;Tc.splitHostPort=mIe;Tc.combineHostPort=_Ie;Tc.uriToString=gIe;var fIe=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function hIe(t){let e=fIe.exec(t);return e===null?null:{scheme:e[1],authority:e[2],path:e[3]}}var wX=/^\d+$/;function mIe(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 o=t.substring(e+2);return wX.test(o)?{host:r,port:+o}:null}else return null;else return{host:r}}else{let e=t.split(":");return e.length===2?wX.test(e[1])?{host:e[0],port:+e[1]}:null:{host:t}}}function _Ie(t){return t.port===void 0?t.host:t.host.includes(":")?`[${t.host}]:${t.port}`:`${t.host}:${t.port}`}function gIe(t){let e="";return t.scheme!==void 0&&(e+=t.scheme+":"),t.authority!==void 0&&(e+="//"+t.authority+"/"),e+=t.path,e}});var $r=p(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;vi.registerResolver=EIe;vi.registerDefaultScheme=SIe;vi.createResolver=TIe;vi.getDefaultAuthority=yIe;vi.mapUriDefaultScheme=vIe;var VN=Bt();vi.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var yc={},FN=null;function EIe(t,e){yc[t]=e}function SIe(t){FN=t}function TIe(t,e,r){if(t.scheme!==void 0&&t.scheme in yc)return new yc[t.scheme](t,e,r);throw new Error(`No resolver could be created for target ${(0,VN.uriToString)(t)}`)}function yIe(t){if(t.scheme!==void 0&&t.scheme in yc)return yc[t.scheme].getDefaultAuthority(t);throw new Error(`Invalid target ${(0,VN.uriToString)(t)}`)}function vIe(t){return t.scheme===void 0||!(t.scheme in yc)?FN!==null?{scheme:FN,authority:void 0,path:(0,VN.uriToString)(t)}:null:t}});var vc=p(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.ChannelCredentials=void 0;Dl.createCertificateProviderChannelCredentials=RIe;var Ll=require("tls"),UE=wE(),qN=BN(),LX=Bt(),AIe=$r(),OIe=Ee(),bIe=se();function GN(t,e){if(t&&!(t instanceof Buffer))throw new TypeError(`${e}, if provided, must be a Buffer.`)}var hs=class{compose(e){return new zN(this,e)}static createSsl(e,r,o,s){var a;if(GN(e,"Root certificate"),GN(r,"Private key"),GN(o,"Certificate chain"),r&&!o)throw new Error("Private key must be given with accompanying certificate chain");if(!r&&o)throw new Error("Certificate chain must be given with accompanying private key");let i=(0,Ll.createSecureContext)({ca:(a=e??(0,qN.getDefaultRootsData)())!==null&&a!==void 0?a:void 0,key:r??void 0,cert:o??void 0,ciphers:qN.CIPHER_SUITES});return new LE(i,s??{})}static createFromSecureContext(e,r){return new LE(e,r??{})}static createInsecure(){return new jN}};Dl.ChannelCredentials=hs;var jN=class t extends hs{constructor(){super()}compose(e){throw new Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(e){return e instanceof t}_createSecureConnector(e,r,o){return{connect(s){return Promise.resolve({socket:s,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>o??UE.CallCredentials.createEmpty(),destroy(){}}}};function DX(t,e,r,o){var s,a;let i={secureContext:t},n=r;if("grpc.http_connect_target"in o){let d=(0,LX.parseUri)(o["grpc.http_connect_target"]);d&&(n=d)}let c=(0,AIe.getDefaultAuthority)(n),u=(0,LX.splitHostPort)(c),l=(s=u?.host)!==null&&s!==void 0?s:c;if(i.host=l,e.checkServerIdentity&&(i.checkServerIdentity=e.checkServerIdentity),e.rejectUnauthorized!==void 0&&(i.rejectUnauthorized=e.rejectUnauthorized),i.ALPNProtocols=["h2"],o["grpc.ssl_target_name_override"]){let d=o["grpc.ssl_target_name_override"],h=(a=i.checkServerIdentity)!==null&&a!==void 0?a:Ll.checkServerIdentity;i.checkServerIdentity=(g,E)=>h(d,E),i.servername=d}else i.servername=l;return o["grpc-node.tls_enable_trace"]&&(i.enableTrace=!0),i}var HN=class{constructor(e,r){this.connectionOptions=e,this.callCredentials=r}connect(e){let r=Object.assign({socket:e},this.connectionOptions);return new Promise((o,s)=>{let a=(0,Ll.connect)(r,()=>{var i;if((!((i=this.connectionOptions.rejectUnauthorized)!==null&&i!==void 0)||i)&&!a.authorized){s(a.authorizationError);return}o({socket:a,secure:!0})});a.on("error",i=>{s(i)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},LE=class t extends hs{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,o){let s=DX(this.secureContext,this.verifyOptions,e,r);return new HN(s,o??UE.CallCredentials.createEmpty())}},DE=class t extends hs{constructor(e,r,o){super(),this.caCertificateProvider=e,this.identityCertificateProvider=r,this.verifyOptions=o,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,o;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)===((o=e.verifyOptions)===null||o===void 0?void 0:o.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,o){return this.ref(),new t.SecureConnectorImpl(this,e,r,o??UE.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,Ll.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:qN.CIPHER_SUITES})}catch(o){return(0,OIe.log)(bIe.LogVerbosity.ERROR,"Failed to createSecureContext with error "+o.message),null}}};DE.SecureConnectorImpl=class{constructor(t,e,r,o){this.parent=t,this.channelTarget=e,this.options=r,this.callCredentials=o}connect(t){return new Promise((e,r)=>{let o=this.parent.getLatestSecureContext();if(!o){r(new Error("Failed to load credentials"));return}t.closed&&r(new Error("Socket closed while loading credentials"));let s=DX(o,this.parent.verifyOptions,this.channelTarget,this.options),a=Object.assign({socket:t},s),i=()=>{r(new Error("Socket closed"))},n=u=>{r(u)},c=(0,Ll.connect)(a,()=>{var u;if(c.removeListener("close",i),c.removeListener("error",n),(!((u=this.parent.verifyOptions.rejectUnauthorized)!==null&&u!==void 0)||u)&&!c.authorized){r(c.authorizationError);return}e({socket:c,secure:!0})});c.once("close",i),c.once("error",n)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function RIe(t,e,r){return new DE(t,e,r??{})}var zN=class t extends hs{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,o){let s=this.callCredentials.compose(o??UE.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,r,s)}}});var oo=p(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.createChildChannelControlHelper=NIe;Hn.registerLoadBalancerType=MIe;Hn.registerDefaultLoadBalancerType=IIe;Hn.createLoadBalancer=xIe;Hn.isLoadBalancerNameRegistered=wIe;Hn.parseLoadBalancingConfig=UX;Hn.getDefaultConfig=LIe;Hn.selectLbConfigFromList=DIe;var PIe=Ee(),CIe=se();function NIe(t,e){var r,o,s,a,i,n,c,u,l,d;return{createSubchannel:(o=(r=e.createSubchannel)===null||r===void 0?void 0:r.bind(e))!==null&&o!==void 0?o:t.createSubchannel.bind(t),updateState:(a=(s=e.updateState)===null||s===void 0?void 0:s.bind(e))!==null&&a!==void 0?a:t.updateState.bind(t),requestReresolution:(n=(i=e.requestReresolution)===null||i===void 0?void 0:i.bind(e))!==null&&n!==void 0?n:t.requestReresolution.bind(t),addChannelzChild:(u=(c=e.addChannelzChild)===null||c===void 0?void 0:c.bind(e))!==null&&u!==void 0?u:t.addChannelzChild.bind(t),removeChannelzChild:(d=(l=e.removeChannelzChild)===null||l===void 0?void 0:l.bind(e))!==null&&d!==void 0?d:t.removeChannelzChild.bind(t)}}var io={},Ul=null;function MIe(t,e,r){io[t]={LoadBalancer:e,LoadBalancingConfig:r}}function IIe(t){Ul=t}function xIe(t,e){let r=t.getLoadBalancerName();return r in io?new io[r].LoadBalancer(e):null}function wIe(t){return t in io}function UX(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 io)try{return io[r].LoadBalancingConfig.createFromJson(t[r])}catch(o){throw new Error(`${r}: ${o.message}`)}else throw new Error(`Unrecognized load balancing config name ${r}`)}function LIe(){if(!Ul)throw new Error("No default load balancer type registered");return new io[Ul].LoadBalancingConfig}function DIe(t,e=!1){for(let r of t)try{return UX(r)}catch(o){(0,PIe.log)(CIe.LogVerbosity.DEBUG,"Config parsing failed with error",o.message);continue}return e&&Ul?new io[Ul].LoadBalancingConfig:null}});var $N=p(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.validateRetryThrottling=kX;kl.validateServiceConfig=BX;kl.extractAndSelectServiceConfig=zIe;var UIe=require("os"),kE=se(),BE=/^\d+(\.\d{1,9})?s$/,kIe="node";function BIe(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 FIe(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"||!BE.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"||!BE.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(kE.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(kE.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 VIe(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"||!BE.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(kE.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(kE.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 GIe(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 o of t.name)r.name.push(BIe(o));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"&&BE.test(t.timeout)){let o=t.timeout.substring(0,t.timeout.length-1).split(".");r.timeout={seconds:o[0]|0,nanos:((e=o[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=FIe(t.retryPolicy)}else"hedgingPolicy"in t&&(r.hedgingPolicy=VIe(t.hedgingPolicy));return r}function kX(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 qIe(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 BX(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 o of t.loadBalancingConfig)e.loadBalancingConfig.push(qIe(o));else throw new Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in t&&Array.isArray(t.methodConfig))for(let o of t.methodConfig)e.methodConfig.push(GIe(o));"retryThrottling"in t&&(e.retryThrottling=kX(t.retryThrottling));let r=[];for(let o of e.methodConfig)for(let s of o.name){for(let a of r)if(s.service===a.service&&s.method===a.method)throw new Error(`Invalid service config: duplicate name ${s.service}/${s.method}`);r.push(s)}return e}function jIe(t){if(!("serviceConfig"in t))throw new Error("Invalid service config choice: missing service config");let e={serviceConfig:BX(t.serviceConfig)};if("clientLanguage"in t)if(Array.isArray(t.clientLanguage)){e.clientLanguage=[];for(let o of t.clientLanguage)if(typeof o=="string")e.clientLanguage.push(o);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 o of t.clientHostname)if(typeof o=="string")e.clientHostname.push(o);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 o in t)if(!r.includes(o))throw new Error(`Invalid service config choice: unexpected field ${o}`);return e}function HIe(t,e){if(!Array.isArray(t))throw new Error("Invalid service config list");for(let r of t){let o=jIe(r);if(!(typeof o.percentage=="number"&&e>o.percentage)){if(Array.isArray(o.clientHostname)){let s=!1;for(let a of o.clientHostname)a===UIe.hostname()&&(s=!0);if(!s)continue}if(Array.isArray(o.clientLanguage)){let s=!1;for(let a of o.clientLanguage)a===kIe&&(s=!0);if(!s)continue}return o.serviceConfig}}throw new Error("No matching service config found")}function zIe(t,e){for(let r of t)if(r.length>0&&r[0].startsWith("grpc_config=")){let o=r.join("").substring(12),s=JSON.parse(o);return HIe(s,e)}return null}});var Ft=p(FE=>{"use strict";Object.defineProperty(FE,"__esModule",{value:!0});FE.ConnectivityState=void 0;var FX;(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"})(FX||(FE.ConnectivityState=FX={}))});var Ai=p(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.QueuePicker=so.UnavailablePicker=so.PickResultType=void 0;var $Ie=nt(),YIe=se(),VE;(function(t){t[t.COMPLETE=0]="COMPLETE",t[t.QUEUE=1]="QUEUE",t[t.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",t[t.DROP=3]="DROP"})(VE||(so.PickResultType=VE={}));var YN=class{constructor(e){this.status=Object.assign({code:YIe.Status.UNAVAILABLE,details:"No connection established",metadata:new $Ie.Metadata},e)}pick(e){return{pickResultType:VE.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}};so.UnavailablePicker=YN;var WN=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:VE.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}};so.QueuePicker=WN});var Ac=p(qE=>{"use strict";Object.defineProperty(qE,"__esModule",{value:!0});qE.BackoffTimeout=void 0;var WIe=se(),KIe=Ee(),XIe="backoff",JIe=1e3,QIe=1.6,ZIe=12e4,e0e=.2;function t0e(t,e){return Math.random()*(e-t)+t}var GE=class t{constructor(e,r){this.callback=e,this.initialDelay=JIe,this.multiplier=QIe,this.maxDelay=ZIe,this.jitter=e0e,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){KIe.trace(WIe.LogVerbosity.DEBUG,XIe,"{"+this.id+"} "+e)}runTimer(e){var r,o;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||(o=(r=this.timerId).unref)===null||o===void 0||o.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+t0e(-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}};qE.BackoffTimeout=GE;GE.nextId=0});var HE=p(jE=>{"use strict";Object.defineProperty(jE,"__esModule",{value:!0});jE.ChildLoadBalancerHandler=void 0;var r0e=oo(),n0e=Ft(),i0e="child_load_balancer_helper",KN=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,o){return this.parent.channelControlHelper.createSubchannel(r,o)}updateState(r,o,s){var a;if(this.calledByPendingChild()){if(r===n0e.ConnectivityState.CONNECTING)return;(a=this.parent.currentChild)===null||a===void 0||a.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(r,o,s)}requestReresolution(){var r;let o=(r=this.parent.pendingChild)!==null&&r!==void 0?r:this.parent.currentChild;this.child===o&&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,o,s){let a;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,r)){let i=new this.ChildPolicyHelper(this),n=(0,r0e.createLoadBalancer)(r,i);i.setChild(n),this.currentChild===null?(this.currentChild=n,a=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=n,a=this.pendingChild)}else this.pendingChild===null?a=this.currentChild:a=this.pendingChild;return this.latestConfig=r,a.updateAddressList(e,r,o,s)}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 i0e}};jE.ChildLoadBalancerHandler=KN});var qX=p(zE=>{"use strict";Object.defineProperty(zE,"__esModule",{value:!0});zE.ResolvingLoadBalancer=void 0;var o0e=oo(),s0e=$N(),Xt=Ft(),VX=$r(),Bl=Ai(),a0e=Ac(),XN=se(),c0e=nt(),u0e=Ee(),l0e=se(),d0e=Bt(),p0e=HE(),f0e="resolving_load_balancer";function GX(t){u0e.trace(l0e.LogVerbosity.DEBUG,f0e,t)}var h0e=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function m0e(t,e,r,o){for(let s of r.name)switch(o){case"EMPTY":if(!s.service&&!s.method)return!0;break;case"SERVICE":if(s.service===t&&!s.method)return!0;break;case"SERVICE_AND_METHOD":if(s.service===t&&s.method===e)return!0}return!1}function _0e(t,e,r,o){for(let s of r)if(m0e(t,e,s,o))return s;return null}function g0e(t){return{invoke(e,r){var o,s;let a=e.split("/").filter(c=>c.length>0),i=(o=a[0])!==null&&o!==void 0?o:"",n=(s=a[1])!==null&&s!==void 0?s:"";if(t&&t.methodConfig)for(let c of h0e){let u=_0e(i,n,t.methodConfig,c);if(u)return{methodConfig:u,pickInformation:{},status:XN.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:XN.Status.OK,dynamicFilterFactories:[]}},unref(){}}}var JN=class{constructor(e,r,o,s,a){this.target=e,this.channelControlHelper=r,this.channelOptions=o,this.onSuccessfulResolution=s,this.onFailedResolution=a,this.latestChildState=Xt.ConnectivityState.IDLE,this.latestChildPicker=new Bl.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=Xt.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,o["grpc.service_config"]?this.defaultServiceConfig=(0,s0e.validateServiceConfig)(JSON.parse(o["grpc.service_config"])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(Xt.ConnectivityState.IDLE,new Bl.QueuePicker(this),null),this.childLoadBalancer=new p0e.ChildLoadBalancerHandler({createSubchannel:r.createSubchannel.bind(r),requestReresolution:()=>{this.backoffTimeout.isRunning()?(GX("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(n,c,u)=>{this.latestChildState=n,this.latestChildPicker=c,this.latestChildErrorMessage=u,this.updateState(n,c,u)},addChannelzChild:r.addChannelzChild.bind(r),removeChannelzChild:r.removeChannelzChild.bind(r)}),this.innerResolver=(0,VX.createResolver)(e,this.handleResolverResult.bind(this),o);let i={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new a0e.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},i),this.backoffTimeout.unref()}handleResolverResult(e,r,o,s){var a,i;this.backoffTimeout.stop(),this.backoffTimeout.reset();let n=!0,c=null;if(o===null?c=this.defaultServiceConfig:o.ok?c=o.value:this.previousServiceConfig!==null?c=this.previousServiceConfig:(n=!1,this.handleResolutionFailure(o.error)),c!==null){let u=(a=c?.loadBalancingConfig)!==null&&a!==void 0?a:[],l=(0,o0e.selectLbConfigFromList)(u,!0);l===null?(n=!1,this.handleResolutionFailure({code:XN.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new c0e.Metadata})):n=this.childLoadBalancer.updateAddressList(e,l,Object.assign(Object.assign({},this.channelOptions),r),s)}return n&&this.onSuccessfulResolution(c,(i=r[VX.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&i!==void 0?i:g0e(c)),n}updateResolution(){this.innerResolver.updateResolution(),this.currentState===Xt.ConnectivityState.IDLE&&this.updateState(Xt.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,r,o){GX((0,d0e.uriToString)(this.target)+" "+Xt.ConnectivityState[this.currentState]+" -> "+Xt.ConnectivityState[e]),e===Xt.ConnectivityState.IDLE&&(r=new Bl.QueuePicker(this,r)),this.currentState=e,this.channelControlHelper.updateState(e,r,o)}handleResolutionFailure(e){this.latestChildState===Xt.ConnectivityState.IDLE&&(this.updateState(Xt.ConnectivityState.TRANSIENT_FAILURE,new Bl.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===Xt.ConnectivityState.IDLE||this.currentState===Xt.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=Xt.ConnectivityState.IDLE,this.latestChildPicker=new Bl.QueuePicker(this),this.currentState=Xt.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}};zE.ResolvingLoadBalancer=JN});var jX=p(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.recognizedOptions=void 0;Fl.channelOptionsEqual=E0e;Fl.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 E0e(t,e){let r=Object.keys(t).sort(),o=Object.keys(e).sort();if(r.length!==o.length)return!1;for(let s=0;s<r.length;s+=1)if(r[s]!==o[s]||t[r[s]]!==e[o[s]])return!1;return!0}});var Jt=p(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.EndpointMap=void 0;Yr.isTcpSubchannelAddress=Gl;Yr.subchannelAddressEqual=$E;Yr.subchannelAddressToString=zX;Yr.stringToSubchannelAddress=T0e;Yr.endpointEqual=y0e;Yr.endpointToString=v0e;Yr.endpointHasAddress=$X;var HX=require("net");function Gl(t){return"port"in t}function $E(t,e){return!t&&!e?!0:!t||!e?!1:Gl(t)?Gl(e)&&t.host===e.host&&t.port===e.port:!Gl(e)&&t.path===e.path}function zX(t){return Gl(t)?(0,HX.isIPv6)(t.host)?"["+t.host+"]:"+t.port:t.host+":"+t.port:t.path}var S0e=443;function T0e(t,e){return(0,HX.isIP)(t)?{host:t,port:e??S0e}:{path:t}}function y0e(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r=0;r<t.addresses.length;r++)if(!$E(t.addresses[r],e.addresses[r]))return!1;return!0}function v0e(t){return"["+t.addresses.map(zX).join(", ")+"]"}function $X(t,e){for(let r of t.addresses)if($E(r,e))return!0;return!1}function Vl(t,e){if(t.addresses.length!==e.addresses.length)return!1;for(let r of t.addresses){let o=!1;for(let s of e.addresses)if($E(r,s)){o=!0;break}if(!o)return!1}return!0}var QN=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let r of this.map)if($X(r.key,e))return r.value}deleteMissing(e){let r=[];for(let o of this.map){let s=!1;for(let a of e)Vl(a,o.key)&&(s=!0);s||(r.push(o.value),this.map.delete(o))}return r}get(e){for(let r of this.map)if(Vl(e,r.key))return r.value}set(e,r){for(let o of this.map)if(Vl(e,o.key)){o.value=r;return}this.map.add({key:e,value:r})}delete(e){for(let r of this.map)if(Vl(e,r.key)){this.map.delete(r);return}}has(e){for(let r of this.map)if(Vl(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]}};Yr.EndpointMap=QN});var YX=p(sM=>{"use strict";Object.defineProperty(sM,"t",{value:!0});var YE=class{constructor(e,r,o=1){this.i=void 0,this.h=void 0,this.o=void 0,this.u=e,this.l=r,this.p=o}I(){let e=this,r=e.o.o===e;if(r&&e.p===1)e=e.h;else if(e.i)for(e=e.i;e.h;)e=e.h;else{if(r)return e.o;let o=e.o;for(;o.i===e;)e=o,o=e.o;e=o}return e}B(){let e=this;if(e.h){for(e=e.h;e.i;)e=e.i;return e}else{let r=e.o;for(;r.h===e;)e=r,r=e.o;return e.h!==r?r:e}}_(){let e=this.o,r=this.h,o=r.i;return e.o===this?e.o=r:e.i===this?e.i=r:e.h=r,r.o=e,r.i=this,this.o=r,this.h=o,o&&(o.o=this),r}g(){let e=this.o,r=this.i,o=r.h;return e.o===this?e.o=r:e.i===this?e.i=r:e.h=r,r.o=e,r.h=this,this.o=r,this.i=o,o&&(o.o=this),r}},ZN=class extends YE{constructor(){super(...arguments),this.M=1}_(){let e=super._();return this.O(),e.O(),e}g(){let e=super.g();return this.O(),e.O(),e}O(){this.M=1,this.i&&(this.M+=this.i.M),this.h&&(this.M+=this.h.M)}},eM=class{constructor(e=0){this.iteratorType=e}equals(e){return this.T===e.T}},tM=class{constructor(){this.m=0}get length(){return this.m}size(){return this.m}empty(){return this.m===0}},rM=class extends tM{};function ms(){throw new RangeError("Iterator access denied!")}var nM=class extends rM{constructor(e=function(o,s){return o<s?-1:o>s?1:0},r=!1){super(),this.v=void 0,this.A=e,this.enableIndex=r,this.N=r?ZN:YE,this.C=new this.N}R(e,r){let o=this.C;for(;e;){let s=this.A(e.u,r);if(s<0)e=e.h;else if(s>0)o=e,e=e.i;else return e}return o}K(e,r){let o=this.C;for(;e;)this.A(e.u,r)<=0?e=e.h:(o=e,e=e.i);return o}L(e,r){let o=this.C;for(;e;){let s=this.A(e.u,r);if(s<0)o=e,e=e.h;else if(s>0)e=e.i;else return e}return o}k(e,r){let o=this.C;for(;e;)this.A(e.u,r)<0?(o=e,e=e.h):e=e.i;return o}P(e){for(;;){let r=e.o;if(r===this.C)return;if(e.p===1){e.p=0;return}if(e===r.i){let o=r.h;if(o.p===1)o.p=0,r.p=1,r===this.v?this.v=r._():r._();else if(o.h&&o.h.p===1){o.p=r.p,r.p=0,o.h.p=0,r===this.v?this.v=r._():r._();return}else o.i&&o.i.p===1?(o.p=1,o.i.p=0,o.g()):(o.p=1,e=r)}else{let o=r.i;if(o.p===1)o.p=0,r.p=1,r===this.v?this.v=r.g():r.g();else if(o.i&&o.i.p===1){o.p=r.p,r.p=0,o.i.p=0,r===this.v?this.v=r.g():r.g();return}else o.h&&o.h.p===1?(o.p=1,o.h.p=0,o._()):(o.p=1,e=r)}}}S(e){if(this.m===1){this.clear();return}let r=e;for(;r.i||r.h;){if(r.h)for(r=r.h;r.i;)r=r.i;else r=r.i;let s=e.u;e.u=r.u,r.u=s;let a=e.l;e.l=r.l,r.l=a,e=r}this.C.i===r?this.C.i=r.o:this.C.h===r&&(this.C.h=r.o),this.P(r);let o=r.o;if(r===o.i?o.i=void 0:o.h=void 0,this.m-=1,this.v.p=0,this.enableIndex)for(;o!==this.C;)o.M-=1,o=o.o}U(e){let r=typeof e=="number"?e:void 0,o=typeof e=="function"?e:void 0,s=typeof e>"u"?[]:void 0,a=0,i=this.v,n=[];for(;n.length||i;)if(i)n.push(i),i=i.i;else{if(i=n.pop(),a===r)return i;s&&s.push(i),o&&o(i,a,this),a+=1,i=i.h}return s}j(e){for(;;){let r=e.o;if(r.p===0)return;let o=r.o;if(r===o.i){let s=o.h;if(s&&s.p===1){if(s.p=r.p=0,o===this.v)return;o.p=1,e=o;continue}else if(e===r.h){if(e.p=0,e.i&&(e.i.o=r),e.h&&(e.h.o=o),r.h=e.i,o.i=e.h,e.i=r,e.h=o,o===this.v)this.v=e,this.C.o=e;else{let a=o.o;a.i===o?a.i=e:a.h=e}e.o=o.o,r.o=e,o.o=e,o.p=1}else{r.p=0,o===this.v?this.v=o.g():o.g(),o.p=1;return}}else{let s=o.i;if(s&&s.p===1){if(s.p=r.p=0,o===this.v)return;o.p=1,e=o;continue}else if(e===r.i){if(e.p=0,e.i&&(e.i.o=o),e.h&&(e.h.o=r),o.h=e.i,r.i=e.h,e.i=o,e.h=r,o===this.v)this.v=e,this.C.o=e;else{let a=o.o;a.i===o?a.i=e:a.h=e}e.o=o.o,r.o=e,o.o=e,o.p=1}else{r.p=0,o===this.v?this.v=o._():o._(),o.p=1;return}}this.enableIndex&&(r.O(),o.O(),e.O());return}}q(e,r,o){if(this.v===void 0)return this.m+=1,this.v=new this.N(e,r,0),this.v.o=this.C,this.C.o=this.C.i=this.C.h=this.v,this.m;let s,a=this.C.i,i=this.A(a.u,e);if(i===0)return a.l=r,this.m;if(i>0)a.i=new this.N(e,r),a.i.o=a,s=a.i,this.C.i=s;else{let n=this.C.h,c=this.A(n.u,e);if(c===0)return n.l=r,this.m;if(c<0)n.h=new this.N(e,r),n.h.o=n,s=n.h,this.C.h=s;else{if(o!==void 0){let u=o.T;if(u!==this.C){let l=this.A(u.u,e);if(l===0)return u.l=r,this.m;if(l>0){let d=u.I(),h=this.A(d.u,e);if(h===0)return d.l=r,this.m;h<0&&(s=new this.N(e,r),d.h===void 0?(d.h=s,s.o=d):(u.i=s,s.o=u))}}}if(s===void 0)for(s=this.v;;){let u=this.A(s.u,e);if(u>0){if(s.i===void 0){s.i=new this.N(e,r),s.i.o=s,s=s.i;break}s=s.i}else if(u<0){if(s.h===void 0){s.h=new this.N(e,r),s.h.o=s,s=s.h;break}s=s.h}else return s.l=r,this.m}}}if(this.enableIndex){let n=s.o;for(;n!==this.C;)n.M+=1,n=n.o}return this.j(s),this.m+=1,this.m}H(e,r){for(;e;){let o=this.A(e.u,r);if(o<0)e=e.h;else if(o>0)e=e.i;else return e}return e||this.C}clear(){this.m=0,this.v=void 0,this.C.o=void 0,this.C.i=this.C.h=void 0}updateKeyByIterator(e,r){let o=e.T;if(o===this.C&&ms(),this.m===1)return o.u=r,!0;let s=o.B().u;if(o===this.C.i)return this.A(s,r)>0?(o.u=r,!0):!1;let a=o.I().u;return o===this.C.h?this.A(a,r)<0?(o.u=r,!0):!1:this.A(a,r)>=0||this.A(s,r)<=0?!1:(o.u=r,!0)}eraseElementByPos(e){if(e<0||e>this.m-1)throw new RangeError;let r=this.U(e);return this.S(r),this.m}eraseElementByKey(e){if(this.m===0)return!1;let r=this.H(this.v,e);return r===this.C?!1:(this.S(r),!0)}eraseElementByIterator(e){let r=e.T;r===this.C&&ms();let o=r.h===void 0;return e.iteratorType===0?o&&e.next():(!o||r.i===void 0)&&e.next(),this.S(r),e}getHeight(){if(this.m===0)return 0;function e(r){return r?Math.max(e(r.i),e(r.h))+1:0}return e(this.v)}},iM=class extends eM{constructor(e,r,o){super(o),this.T=e,this.C=r,this.iteratorType===0?(this.pre=function(){return this.T===this.C.i&&ms(),this.T=this.T.I(),this},this.next=function(){return this.T===this.C&&ms(),this.T=this.T.B(),this}):(this.pre=function(){return this.T===this.C.h&&ms(),this.T=this.T.B(),this},this.next=function(){return this.T===this.C&&ms(),this.T=this.T.I(),this})}get index(){let e=this.T,r=this.C.o;if(e===this.C)return r?r.M-1:0;let o=0;for(e.i&&(o+=e.i.M);e!==r;){let s=e.o;e===s.h&&(o+=1,s.i&&(o+=s.i.M)),e=s}return o}isAccessible(){return this.T!==this.C}},Wr=class t extends iM{constructor(e,r,o,s){super(e,r,s),this.container=o}get pointer(){this.T===this.C&&ms();let e=this;return new Proxy([],{get(r,o){return o==="0"?e.T.u:o==="1"?e.T.l:(r[0]=e.T.u,r[1]=e.T.l,r[o])},set(r,o,s){if(o!=="1")throw new TypeError("prop must be 1");return e.T.l=s,!0}})}copy(){return new t(this.T,this.C,this.container,this.iteratorType)}},oM=class extends nM{constructor(e=[],r,o){super(r,o);let s=this;e.forEach((function(a){s.setElement(a[0],a[1])}))}begin(){return new Wr(this.C.i||this.C,this.C,this)}end(){return new Wr(this.C,this.C,this)}rBegin(){return new Wr(this.C.h||this.C,this.C,this,1)}rEnd(){return new Wr(this.C,this.C,this,1)}front(){if(this.m===0)return;let e=this.C.i;return[e.u,e.l]}back(){if(this.m===0)return;let e=this.C.h;return[e.u,e.l]}lowerBound(e){let r=this.R(this.v,e);return new Wr(r,this.C,this)}upperBound(e){let r=this.K(this.v,e);return new Wr(r,this.C,this)}reverseLowerBound(e){let r=this.L(this.v,e);return new Wr(r,this.C,this)}reverseUpperBound(e){let r=this.k(this.v,e);return new Wr(r,this.C,this)}forEach(e){this.U((function(r,o,s){e([r.u,r.l],o,s)}))}setElement(e,r,o){return this.q(e,r,o)}getElementByPos(e){if(e<0||e>this.m-1)throw new RangeError;let r=this.U(e);return[r.u,r.l]}find(e){let r=this.H(this.v,e);return new Wr(r,this.C,this)}getElementByKey(e){return this.H(this.v,e).l}union(e){let r=this;return e.forEach((function(o){r.setElement(o[0],o[1])})),this.m}*[Symbol.iterator](){let e=this.m,r=this.U();for(let o=0;o<e;++o){let s=r[o];yield[s.u,s.l]}}};sM.OrderedMap=oM});var KE=p(WE=>{"use strict";Object.defineProperty(WE,"__esModule",{value:!0});WE.registerAdminService=A0e;WE.addAdminServicesToServer=O0e;var WX=[];function A0e(t,e){WX.push({getServiceDefinition:t,getHandlers:e})}function O0e(t){for(let{getServiceDefinition:e,getHandlers:r}of WX)t.addService(e(),r())}});var KX=p(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ClientDuplexStreamImpl=Kr.ClientWritableStreamImpl=Kr.ClientReadableStreamImpl=Kr.ClientUnaryCallImpl=void 0;Kr.callErrorFromStatus=R0e;var b0e=require("events"),dM=require("stream"),ql=se();function R0e(t,e){let r=`${t.code} ${ql.Status[t.code]}: ${t.details}`,s=`${new Error(r).stack}
|
|
21
|
+
for call at
|
|
22
|
+
${e}`;return Object.assign(new Error(r),t,{stack:s})}var aM=class extends b0e.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(ql.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}};Kr.ClientUnaryCallImpl=aM;var cM=class extends dM.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(ql.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()}};Kr.ClientReadableStreamImpl=cM;var uM=class extends dM.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(ql.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,o){var s;let a={callback:o},i=Number(r);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};Kr.ClientWritableStreamImpl=uM;var lM=class extends dM.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(ql.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,o){var s;let a={callback:o},i=Number(r);Number.isNaN(i)||(a.flags=i),(s=this.call)===null||s===void 0||s.sendMessageWithContext(a,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};Kr.ClientDuplexStreamImpl=lM});var gs=p(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.InterceptingListenerImpl=void 0;_s.statusOrFromValue=C0e;_s.statusOrFromError=N0e;_s.isInterceptingListener=M0e;var P0e=nt();function C0e(t){return{ok:!0,value:t}}function N0e(t){var e;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:(e=t.metadata)!==null&&e!==void 0?e:new P0e.Metadata})}}function M0e(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var pM=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)})}};_s.InterceptingListenerImpl=pM});var SM=p(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.InterceptingCall=Xr.RequesterBuilder=Xr.ListenerBuilder=Xr.InterceptorConfigurationError=void 0;Xr.getInterceptingCall=L0e;var I0e=nt(),XX=gs(),JX=se(),QX=NE(),Hl=class t extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,t)}};Xr.InterceptorConfigurationError=Hl;var hM=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}}};Xr.ListenerBuilder=hM;var mM=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}}};Xr.RequesterBuilder=mM;var fM={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveStatus:(t,e)=>{e(t)}},jl={start:(t,e,r)=>{r(t,e)},sendMessage:(t,e)=>{e(t)},halfClose:t=>{t()},cancel:t=>{t()}},_M=class{constructor(e,r){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,r?this.requester={start:(o=r.start)!==null&&o!==void 0?o:jl.start,sendMessage:(s=r.sendMessage)!==null&&s!==void 0?s:jl.sendMessage,halfClose:(a=r.halfClose)!==null&&a!==void 0?a:jl.halfClose,cancel:(i=r.cancel)!==null&&i!==void 0?i:jl.cancel}:this.requester=jl}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 o,s,a,i,n,c;let u={onReceiveMetadata:(s=(o=r?.onReceiveMetadata)===null||o===void 0?void 0:o.bind(r))!==null&&s!==void 0?s:(l=>{}),onReceiveMessage:(i=(a=r?.onReceiveMessage)===null||a===void 0?void 0:a.bind(r))!==null&&i!==void 0?i:(l=>{}),onReceiveStatus:(c=(n=r?.onReceiveStatus)===null||n===void 0?void 0:n.bind(r))!==null&&c!==void 0?c:(l=>{})};this.processingMetadata=!0,this.requester.start(e,u,(l,d)=>{var h,g,E;this.processingMetadata=!1;let S;if((0,XX.isInterceptingListener)(d))S=d;else{let v={onReceiveMetadata:(h=d.onReceiveMetadata)!==null&&h!==void 0?h:fM.onReceiveMetadata,onReceiveMessage:(g=d.onReceiveMessage)!==null&&g!==void 0?g:fM.onReceiveMessage,onReceiveStatus:(E=d.onReceiveStatus)!==null&&E!==void 0?E:fM.onReceiveStatus};S=new XX.InterceptingListenerImpl(v,u)}this.nextCall.start(l,S),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,r){this.processingMessage=!0,this.requester.sendMessage(r,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=r):(this.nextCall.sendMessageWithContext(e,o),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()}};Xr.InterceptingCall=_M;function x0e(t,e,r){var o,s;let a=(o=r.deadline)!==null&&o!==void 0?o:1/0,i=r.host,n=(s=r.parent)!==null&&s!==void 0?s:null,c=r.propagate_flags,u=r.credentials,l=t.createCall(e,a,i,n,c);return u&&l.setCredentials(u),l}var XE=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 o;try{o=this.methodDefinition.requestSerialize(r)}catch(s){this.call.cancelWithStatus(JX.Status.INTERNAL,`Request message serialization failure: ${(0,QX.getErrorMessage)(s)}`);return}this.call.sendMessageWithContext(e,o)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,r){let o=null;this.call.start(e,{onReceiveMetadata:s=>{var a;(a=r?.onReceiveMetadata)===null||a===void 0||a.call(r,s)},onReceiveMessage:s=>{var a;let i;try{i=this.methodDefinition.responseDeserialize(s)}catch(n){o={code:JX.Status.INTERNAL,details:`Response message parsing error: ${(0,QX.getErrorMessage)(n)}`,metadata:new I0e.Metadata},this.call.cancelWithStatus(o.code,o.details);return}(a=r?.onReceiveMessage)===null||a===void 0||a.call(r,i)},onReceiveStatus:s=>{var a,i;o?(a=r?.onReceiveStatus)===null||a===void 0||a.call(r,o):(i=r?.onReceiveStatus)===null||i===void 0||i.call(r,s)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},gM=class extends XE{constructor(e,r){super(e,r)}start(e,r){var o,s;let a=!1,i={onReceiveMetadata:(s=(o=r?.onReceiveMetadata)===null||o===void 0?void 0:o.bind(r))!==null&&s!==void 0?s:(n=>{}),onReceiveMessage:n=>{var c;a=!0,(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,n)},onReceiveStatus:n=>{var c,u;a||(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,null),(u=r?.onReceiveStatus)===null||u===void 0||u.call(r,n)}};super.start(e,i),this.call.startRead()}},EM=class extends XE{};function w0e(t,e,r){let o=x0e(t,r.path,e);return r.responseStream?new EM(o,r):new gM(o,r)}function L0e(t,e,r,o){if(t.clientInterceptors.length>0&&t.clientInterceptorProviders.length>0)throw new Hl("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 Hl("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let s=[];t.callInterceptors.length>0||t.callInterceptorProviders.length>0?s=[].concat(t.callInterceptors,t.callInterceptorProviders.map(n=>n(e))).filter(n=>n):s=[].concat(t.clientInterceptors,t.clientInterceptorProviders.map(n=>n(e))).filter(n=>n);let a=Object.assign({},r,{method_definition:e});return s.reduceRight((n,c)=>u=>c(u,n),n=>w0e(o,n,e))(a)}});var vM=p(QE=>{"use strict";Object.defineProperty(QE,"__esModule",{value:!0});QE.Client=void 0;var zn=KX(),D0e=AM(),U0e=Ft(),ao=se(),Oc=nt(),JE=SM(),Jr=Symbol(),bc=Symbol(),Rc=Symbol(),Oi=Symbol();function TM(t){return typeof t=="function"}function Pc(t){var e;return((e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
23
|
+
`).slice(1).join(`
|
|
24
|
+
`))||"no stack trace available"}var yM=class{constructor(e,r,o={}){var s,a;if(o=Object.assign({},o),this[bc]=(s=o.interceptors)!==null&&s!==void 0?s:[],delete o.interceptors,this[Rc]=(a=o.interceptor_providers)!==null&&a!==void 0?a:[],delete o.interceptor_providers,this[bc].length>0&&this[Rc].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[Oi]=o.callInvocationTransformer,delete o.callInvocationTransformer,o.channelOverride)this[Jr]=o.channelOverride;else if(o.channelFactoryOverride){let i=o.channelFactoryOverride;delete o.channelFactoryOverride,this[Jr]=i(e,r,o)}else this[Jr]=new D0e.ChannelImplementation(e,r,o)}close(){this[Jr].close()}getChannel(){return this[Jr]}waitForReady(e,r){let o=s=>{if(s){r(new Error("Failed to connect before the deadline"));return}let a;try{a=this[Jr].getConnectivityState(!0)}catch{r(new Error("The channel has been closed"));return}if(a===U0e.ConnectivityState.READY)r();else try{this[Jr].watchConnectivityState(a,e,o)}catch{r(new Error("The channel has been closed"))}};setImmediate(o)}checkOptionalUnaryResponseArguments(e,r,o){if(TM(e))return{metadata:new Oc.Metadata,options:{},callback:e};if(TM(r))return e instanceof Oc.Metadata?{metadata:e,options:{},callback:r}:{metadata:new Oc.Metadata,options:e,callback:r};if(!(e instanceof Oc.Metadata&&r instanceof Object&&TM(o)))throw new Error("Incorrect arguments passed");return{metadata:e,options:r,callback:o}}makeUnaryRequest(e,r,o,s,a,i,n){var c,u;let l=this.checkOptionalUnaryResponseArguments(a,i,n),d={path:e,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:o},h={argument:s,metadata:l.metadata,call:new zn.ClientUnaryCallImpl,channel:this[Jr],methodDefinition:d,callOptions:l.options,callback:l.callback};this[Oi]&&(h=this[Oi](h));let g=h.call,E={clientInterceptors:this[bc],clientInterceptorProviders:this[Rc],callInterceptors:(c=h.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(u=h.callOptions.interceptor_providers)!==null&&u!==void 0?u:[]},S=(0,JE.getInterceptingCall)(E,h.methodDefinition,h.callOptions,h.channel);g.call=S;let v=null,O=!1,I=new Error;return S.start(h.metadata,{onReceiveMetadata:j=>{g.emit("metadata",j)},onReceiveMessage(j){v!==null&&S.cancelWithStatus(ao.Status.UNIMPLEMENTED,"Too many responses received"),v=j},onReceiveStatus(j){if(!O){if(O=!0,j.code===ao.Status.OK)if(v===null){let A=Pc(I);h.callback((0,zn.callErrorFromStatus)({code:ao.Status.UNIMPLEMENTED,details:"No message received",metadata:j.metadata},A))}else h.callback(null,v);else{let A=Pc(I);h.callback((0,zn.callErrorFromStatus)(j,A))}I=null,g.emit("status",j)}}}),S.sendMessage(s),S.halfClose(),g}makeClientStreamRequest(e,r,o,s,a,i){var n,c;let u=this.checkOptionalUnaryResponseArguments(s,a,i),l={path:e,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:o},d={metadata:u.metadata,call:new zn.ClientWritableStreamImpl(r),channel:this[Jr],methodDefinition:l,callOptions:u.options,callback:u.callback};this[Oi]&&(d=this[Oi](d));let h=d.call,g={clientInterceptors:this[bc],clientInterceptorProviders:this[Rc],callInterceptors:(n=d.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},E=(0,JE.getInterceptingCall)(g,d.methodDefinition,d.callOptions,d.channel);h.call=E;let S=null,v=!1,O=new Error;return E.start(d.metadata,{onReceiveMetadata:I=>{h.emit("metadata",I)},onReceiveMessage(I){S!==null&&E.cancelWithStatus(ao.Status.UNIMPLEMENTED,"Too many responses received"),S=I,E.startRead()},onReceiveStatus(I){if(!v){if(v=!0,I.code===ao.Status.OK)if(S===null){let j=Pc(O);d.callback((0,zn.callErrorFromStatus)({code:ao.Status.UNIMPLEMENTED,details:"No message received",metadata:I.metadata},j))}else d.callback(null,S);else{let j=Pc(O);d.callback((0,zn.callErrorFromStatus)(I,j))}O=null,h.emit("status",I)}}}),h}checkMetadataAndOptions(e,r){let o,s;return e instanceof Oc.Metadata?(o=e,r?s=r:s={}):(e?s=e:s={},o=new Oc.Metadata),{metadata:o,options:s}}makeServerStreamRequest(e,r,o,s,a,i){var n,c;let u=this.checkMetadataAndOptions(a,i),l={path:e,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:o},d={argument:s,metadata:u.metadata,call:new zn.ClientReadableStreamImpl(o),channel:this[Jr],methodDefinition:l,callOptions:u.options};this[Oi]&&(d=this[Oi](d));let h=d.call,g={clientInterceptors:this[bc],clientInterceptorProviders:this[Rc],callInterceptors:(n=d.callOptions.interceptors)!==null&&n!==void 0?n:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},E=(0,JE.getInterceptingCall)(g,d.methodDefinition,d.callOptions,d.channel);h.call=E;let S=!1,v=new Error;return E.start(d.metadata,{onReceiveMetadata(O){h.emit("metadata",O)},onReceiveMessage(O){h.push(O)},onReceiveStatus(O){if(!S){if(S=!0,h.push(null),O.code!==ao.Status.OK){let I=Pc(v);h.emit("error",(0,zn.callErrorFromStatus)(O,I))}v=null,h.emit("status",O)}}}),E.sendMessage(s),E.halfClose(),h}makeBidiStreamRequest(e,r,o,s,a){var i,n;let c=this.checkMetadataAndOptions(s,a),u={path:e,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:o},l={metadata:c.metadata,call:new zn.ClientDuplexStreamImpl(r,o),channel:this[Jr],methodDefinition:u,callOptions:c.options};this[Oi]&&(l=this[Oi](l));let d=l.call,h={clientInterceptors:this[bc],clientInterceptorProviders:this[Rc],callInterceptors:(i=l.callOptions.interceptors)!==null&&i!==void 0?i:[],callInterceptorProviders:(n=l.callOptions.interceptor_providers)!==null&&n!==void 0?n:[]},g=(0,JE.getInterceptingCall)(h,l.methodDefinition,l.callOptions,l.channel);d.call=g;let E=!1,S=new Error;return g.start(l.metadata,{onReceiveMetadata(v){d.emit("metadata",v)},onReceiveMessage(v){d.push(v)},onReceiveStatus(v){if(!E){if(E=!0,d.push(null),v.code!==ao.Status.OK){let O=Pc(S);d.emit("error",(0,zn.callErrorFromStatus)(v,O))}S=null,d.emit("status",v)}}}),d}};QE.Client=yM});var eS=p(ZE=>{"use strict";Object.defineProperty(ZE,"__esModule",{value:!0});ZE.makeClientConstructor=ZX;ZE.loadPackageDefinition=V0e;var zl=vM(),k0e={unary:zl.Client.prototype.makeUnaryRequest,server_stream:zl.Client.prototype.makeServerStreamRequest,client_stream:zl.Client.prototype.makeClientStreamRequest,bidi:zl.Client.prototype.makeBidiStreamRequest};function OM(t){return["__proto__","prototype","constructor"].includes(t)}function ZX(t,e,r){r||(r={});class o extends zl.Client{}return Object.keys(t).forEach(s=>{if(OM(s))return;let a=t[s],i;if(typeof s=="string"&&s.charAt(0)==="$")throw new Error("Method names cannot start with $");a.requestStream?a.responseStream?i="bidi":i="client_stream":a.responseStream?i="server_stream":i="unary";let n=a.requestSerialize,c=a.responseDeserialize,u=B0e(k0e[i],a.path,n,c);o.prototype[s]=u,Object.assign(o.prototype[s],a),a.originalName&&!OM(a.originalName)&&(o.prototype[a.originalName]=o.prototype[s])}),o.service=t,o.serviceName=e,o}function B0e(t,e,r,o){return function(...s){return t.call(this,e,r,o,...s)}}function F0e(t){return"format"in t}function V0e(t){let e={};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=r.split(".");if(s.some(n=>OM(n)))continue;let a=s[s.length-1],i=e;for(let n of s.slice(0,-1))i[n]||(i[n]={}),i=i[n];F0e(o)?i[a]=o:i[a]=ZX(o,a,{})}return e}});var O5=p((ltt,A5)=>{var G0e=1/0,q0e="[object Symbol]",j0e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,H0e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rS="\\ud800-\\udfff",a5="\\u0300-\\u036f\\ufe20-\\ufe23",c5="\\u20d0-\\u20f0",u5="\\u2700-\\u27bf",l5="a-z\\xdf-\\xf6\\xf8-\\xff",z0e="\\xac\\xb1\\xd7\\xf7",$0e="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Y0e="\\u2000-\\u206f",W0e=" \\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",d5="A-Z\\xc0-\\xd6\\xd8-\\xde",p5="\\ufe0e\\ufe0f",f5=z0e+$0e+Y0e+W0e,RM="['\u2019]",K0e="["+rS+"]",e5="["+f5+"]",tS="["+a5+c5+"]",h5="\\d+",X0e="["+u5+"]",m5="["+l5+"]",_5="[^"+rS+f5+h5+u5+l5+d5+"]",bM="\\ud83c[\\udffb-\\udfff]",J0e="(?:"+tS+"|"+bM+")",g5="[^"+rS+"]",PM="(?:\\ud83c[\\udde6-\\uddff]){2}",CM="[\\ud800-\\udbff][\\udc00-\\udfff]",Cc="["+d5+"]",E5="\\u200d",t5="(?:"+m5+"|"+_5+")",Q0e="(?:"+Cc+"|"+_5+")",r5="(?:"+RM+"(?:d|ll|m|re|s|t|ve))?",n5="(?:"+RM+"(?:D|LL|M|RE|S|T|VE))?",S5=J0e+"?",T5="["+p5+"]?",Z0e="(?:"+E5+"(?:"+[g5,PM,CM].join("|")+")"+T5+S5+")*",y5=T5+S5+Z0e,exe="(?:"+[X0e,PM,CM].join("|")+")"+y5,txe="(?:"+[g5+tS+"?",tS,PM,CM,K0e].join("|")+")",rxe=RegExp(RM,"g"),nxe=RegExp(tS,"g"),ixe=RegExp(bM+"(?="+bM+")|"+txe+y5,"g"),oxe=RegExp([Cc+"?"+m5+"+"+r5+"(?="+[e5,Cc,"$"].join("|")+")",Q0e+"+"+n5+"(?="+[e5,Cc+t5,"$"].join("|")+")",Cc+"?"+t5+"+"+r5,Cc+"+"+n5,h5,exe].join("|"),"g"),sxe=RegExp("["+E5+rS+a5+c5+p5+"]"),axe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cxe={\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"},uxe=typeof global=="object"&&global&&global.Object===Object&&global,lxe=typeof self=="object"&&self&&self.Object===Object&&self,dxe=uxe||lxe||Function("return this")();function pxe(t,e,r,o){var s=-1,a=t?t.length:0;for(o&&a&&(r=t[++s]);++s<a;)r=e(r,t[s],s,t);return r}function fxe(t){return t.split("")}function hxe(t){return t.match(j0e)||[]}function mxe(t){return function(e){return t?.[e]}}var _xe=mxe(cxe);function v5(t){return sxe.test(t)}function gxe(t){return axe.test(t)}function Exe(t){return v5(t)?Sxe(t):fxe(t)}function Sxe(t){return t.match(ixe)||[]}function Txe(t){return t.match(oxe)||[]}var yxe=Object.prototype,vxe=yxe.toString,i5=dxe.Symbol,o5=i5?i5.prototype:void 0,s5=o5?o5.toString:void 0;function Axe(t,e,r){var o=-1,s=t.length;e<0&&(e=-e>s?0:s+e),r=r>s?s:r,r<0&&(r+=s),s=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(s);++o<s;)a[o]=t[o+e];return a}function Oxe(t){if(typeof t=="string")return t;if(Nxe(t))return s5?s5.call(t):"";var e=t+"";return e=="0"&&1/t==-G0e?"-0":e}function bxe(t,e,r){var o=t.length;return r=r===void 0?o:r,!e&&r>=o?t:Axe(t,e,r)}function Rxe(t){return function(e){e=nS(e);var r=v5(e)?Exe(e):void 0,o=r?r[0]:e.charAt(0),s=r?bxe(r,1).join(""):e.slice(1);return o[t]()+s}}function Pxe(t){return function(e){return pxe(Lxe(xxe(e).replace(rxe,"")),t,"")}}function Cxe(t){return!!t&&typeof t=="object"}function Nxe(t){return typeof t=="symbol"||Cxe(t)&&vxe.call(t)==q0e}function nS(t){return t==null?"":Oxe(t)}var Mxe=Pxe(function(t,e,r){return e=e.toLowerCase(),t+(r?Ixe(e):e)});function Ixe(t){return wxe(nS(t).toLowerCase())}function xxe(t){return t=nS(t),t&&t.replace(H0e,_xe).replace(nxe,"")}var wxe=Rxe("toUpperCase");function Lxe(t,e,r){return t=nS(t),e=r?void 0:e,e===void 0?gxe(t)?Txe(t):hxe(t):t.match(e)||[]}A5.exports=Mxe});var R5=p((dtt,b5)=>{"use strict";b5.exports=NM;function NM(t,e){typeof t=="string"&&(e=t,t=void 0);var r=[];function o(a){if(typeof a!="string"){var i=s();if(NM.verbose&&console.log("codegen: "+i),i="return "+i,a){for(var n=Object.keys(a),c=new Array(n.length+1),u=new Array(n.length),l=0;l<n.length;)c[l]=n[l],u[l]=a[n[l++]];return c[l]=i,Function.apply(null,c).apply(null,u)}return Function(i)()}for(var d=new Array(arguments.length-1),h=0;h<d.length;)d[h]=arguments[++h];if(h=0,a=a.replace(/%([%dfijs])/g,function(E,S){var v=d[h++];switch(S){case"d":case"f":return String(Number(v));case"i":return String(Math.floor(v));case"j":return JSON.stringify(v);case"s":return String(v)}return"%"}),h!==d.length)throw Error("parameter count mismatch");return r.push(a),o}function s(a){return"function "+(a||e||"")+"("+(t&&t.join(",")||"")+`){
|
|
25
|
+
`+r.join(`
|
|
26
|
+
`)+`
|
|
27
|
+
}`}return o.toString=s,o}NM.verbose=!1});var C5=p((ptt,P5)=>{"use strict";P5.exports=$l;var Dxe=JC(),Uxe=QC(),MM=Uxe("fs");function $l(t,e,r){return typeof e=="function"?(r=e,e={}):e||(e={}),r?!e.xhr&&MM&&MM.readFile?MM.readFile(t,function(s,a){return s&&typeof XMLHttpRequest<"u"?$l.xhr(t,e,r):s?r(s):r(null,e.binary?a:a.toString("utf8"))}):$l.xhr(t,e,r):Dxe($l,this,t,e)}$l.xhr=function(e,r,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState===4){if(s.status!==0&&s.status!==200)return o(Error("status "+s.status));if(r.binary){var i=s.response;if(!i){i=[];for(var n=0;n<s.responseText.length;++n)i.push(s.responseText.charCodeAt(n)&255)}return o(null,typeof Uint8Array<"u"?new Uint8Array(i):i)}return o(null,s.responseText)}},r.binary&&("overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),s.responseType="arraybuffer"),s.open("GET",e),s.send()}});var I5=p(M5=>{"use strict";var xM=M5,N5=xM.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},IM=xM.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var r=e.split("/"),o=N5(e),s="";o&&(s=r.shift()+"/");for(var a=0;a<r.length;)r[a]===".."?a>0&&r[a-1]!==".."?r.splice(--a,2):o?r.splice(a,1):++a:r[a]==="."?r.splice(a,1):++a;return s+r.join("/")};xM.resolve=function(e,r,o){return o||(r=IM(r)),N5(r)?r:(o||(e=IM(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?IM(e+"/"+r):r)}});var Mc=p((htt,L5)=>{"use strict";L5.exports=ue;var iS=uo();((ue.prototype=Object.create(iS.prototype)).constructor=ue).className="Namespace";var wM=co(),oS=it(),kxe=Ts(),Es,Nc,Ss;ue.fromJSON=function(e,r){return new ue(e,r.options).addJSON(r.nested)};function x5(t,e){if(t&&t.length){for(var r={},o=0;o<t.length;++o)r[t[o].name]=t[o].toJSON(e);return r}}ue.arrayToJSON=x5;ue.isReservedId=function(e,r){if(e){for(var o=0;o<e.length;++o)if(typeof e[o]!="string"&&e[o][0]<=r&&e[o][1]>r)return!0}return!1};ue.isReservedName=function(e,r){if(e){for(var o=0;o<e.length;++o)if(e[o]===r)return!0}return!1};function ue(t,e){iS.call(this,t,e),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function w5(t){t._nestedArray=null,t._lookupCache={};for(var e=t;e=e.parent;)e._lookupCache={};return t}Object.defineProperty(ue.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=oS.toArray(this.nested))}});ue.prototype.toJSON=function(e){return oS.toObject(["options",this.options,"nested",x5(this.nestedArray,e)])};ue.prototype.addJSON=function(e){var r=this;if(e)for(var o=Object.keys(e),s=0,a;s<o.length;++s)a=e[o[s]],r.add((a.fields!==void 0?Es.fromJSON:a.values!==void 0?Ss.fromJSON:a.methods!==void 0?Nc.fromJSON:a.id!==void 0?wM.fromJSON:ue.fromJSON)(o[s],a));return this};ue.prototype.get=function(e){return this.nested&&this.nested[e]||null};ue.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof Ss)return this.nested[e].values;throw Error("no such enum: "+e)};ue.prototype.add=function(e){if(!(e instanceof wM&&e.extend!==void 0||e instanceof Es||e instanceof kxe||e instanceof Ss||e instanceof Nc||e instanceof ue))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var r=this.get(e.name);if(r)if(r instanceof ue&&e instanceof ue&&!(r instanceof Es||r instanceof Nc)){for(var o=r.nestedArray,s=0;s<o.length;++s)e.add(o[s]);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 Es||this instanceof Nc||this instanceof Ss||this instanceof wM||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var a=this;a=a.parent;)a._needsRecursiveFeatureResolution=!0,a._needsRecursiveResolve=!0;return e.onAdd(this),w5(this)};ue.prototype.remove=function(e){if(!(e instanceof iS))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),w5(this)};ue.prototype.define=function(e,r){if(oS.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");for(var o=this;e.length>0;){var s=e.shift();if(o.nested&&o.nested[s]){if(o=o.nested[s],!(o instanceof ue))throw Error("path conflicts with non-namespace objects")}else o.add(o=new ue(s))}return r&&o.addJSON(r),o};ue.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 ue?e[r++].resolveAll():e[r++].resolve();return this._needsRecursiveResolve=!1,this};ue.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,iS.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};ue.prototype.lookup=function(e,r,o){if(typeof r=="boolean"?(o=r,r=void 0):r&&!Array.isArray(r)&&(r=[r]),oS.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var s=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),r);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+s];if(a&&(!r||r.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,s),a&&(!r||r.indexOf(a.constructor)>-1)))return a;if(o)return null;for(var i=this;i.parent;){if(a=i.parent._lookupImpl(e,s),a&&(!r||r.indexOf(a.constructor)>-1))return a;i=i.parent}return null};ue.prototype._lookupImpl=function(e,r){if(Object.prototype.hasOwnProperty.call(this._lookupCache,r))return this._lookupCache[r];var o=this.get(e[0]),s=null;if(o)e.length===1?s=o:o instanceof ue&&(e=e.slice(1),s=o._lookupImpl(e,e.join(".")));else for(var a=0;a<this.nestedArray.length;++a)this._nestedArray[a]instanceof ue&&(o=this._nestedArray[a]._lookupImpl(e,r))&&(s=o);return this._lookupCache[r]=s,s};ue.prototype.lookupType=function(e){var r=this.lookup(e,[Es]);if(!r)throw Error("no such type: "+e);return r};ue.prototype.lookupEnum=function(e){var r=this.lookup(e,[Ss]);if(!r)throw Error("no such Enum '"+e+"' in "+this);return r};ue.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[Es,Ss]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r};ue.prototype.lookupService=function(e){var r=this.lookup(e,[Nc]);if(!r)throw Error("no such Service '"+e+"' in "+this);return r};ue._configure=function(t,e,r){Es=t,Nc=e,Ss=r}});var sS=p((mtt,D5)=>{"use strict";D5.exports=bi;var LM=co();((bi.prototype=Object.create(LM.prototype)).constructor=bi).className="MapField";var Bxe=ys(),Yl=it();function bi(t,e,r,o,s,a){if(LM.call(this,t,e,o,void 0,void 0,s,a),!Yl.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}bi.fromJSON=function(e,r){return new bi(e,r.id,r.keyType,r.type,r.options,r.comment)};bi.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Yl.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",r?this.comment:void 0])};bi.prototype.resolve=function(){if(this.resolved)return this;if(Bxe.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return LM.prototype.resolve.call(this)};bi.d=function(e,r,o){return typeof o=="function"?o=Yl.decorateType(o).name:o&&typeof o=="object"&&(o=Yl.decorateEnum(o).name),function(a,i){Yl.decorateType(a.constructor).add(new bi(i,e,r,o))}}});var aS=p((_tt,U5)=>{"use strict";U5.exports=vs;var DM=uo();((vs.prototype=Object.create(DM.prototype)).constructor=vs).className="Method";var Ic=it();function vs(t,e,r,o,s,a,i,n,c){if(Ic.isObject(s)?(i=s,s=a=void 0):Ic.isObject(a)&&(i=a,a=void 0),!(e===void 0||Ic.isString(e)))throw TypeError("type must be a string");if(!Ic.isString(r))throw TypeError("requestType must be a string");if(!Ic.isString(o))throw TypeError("responseType must be a string");DM.call(this,t,i),this.type=e||"rpc",this.requestType=r,this.requestStream=s?!0:void 0,this.responseType=o,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=n,this.parsedOptions=c}vs.fromJSON=function(e,r){return new vs(e,r.type,r.requestType,r.responseType,r.requestStream,r.responseStream,r.options,r.comment,r.parsedOptions)};vs.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Ic.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])};vs.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),DM.prototype.resolve.call(this))}});var cS=p((gtt,B5)=>{"use strict";B5.exports=ar;var Ri=Mc();((ar.prototype=Object.create(Ri.prototype)).constructor=ar).className="Service";var UM=aS(),Wl=it(),Fxe=lN();function ar(t,e){Ri.call(this,t,e),this.methods={},this._methodsArray=null}ar.fromJSON=function(e,r){var o=new ar(e,r.options);if(r.methods)for(var s=Object.keys(r.methods),a=0;a<s.length;++a)o.add(UM.fromJSON(s[a],r.methods[s[a]]));return r.nested&&o.addJSON(r.nested),r.edition&&(o._edition=r.edition),o.comment=r.comment,o._defaultEdition="proto3",o};ar.prototype.toJSON=function(e){var r=Ri.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return Wl.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"methods",Ri.arrayToJSON(this.methodsArray,e)||{},"nested",r&&r.nested||void 0,"comment",o?this.comment:void 0])};Object.defineProperty(ar.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=Wl.toArray(this.methods))}});function k5(t){return t._methodsArray=null,t}ar.prototype.get=function(e){return this.methods[e]||Ri.prototype.get.call(this,e)};ar.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Ri.prototype.resolve.call(this);for(var e=this.methodsArray,r=0;r<e.length;++r)e[r].resolve();return this};ar.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Ri.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};ar.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof UM?(this.methods[e.name]=e,e.parent=this,k5(this)):Ri.prototype.add.call(this,e)};ar.prototype.remove=function(e){if(e instanceof UM){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,k5(this)}return Ri.prototype.remove.call(this,e)};ar.prototype.create=function(e,r,o){for(var s=new Fxe.Service(e,r,o),a=0,i;a<this.methodsArray.length;++a){var n=Wl.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");s[n]=Wl.codegen(["r","c"],Wl.isReserved(n)?n+"_":n)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return s}});var uS=p((Ett,F5)=>{"use strict";F5.exports=$n;var Vxe=Bn();function $n(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r)this[e[r]]=t[e[r]]}$n.create=function(e){return this.$type.create(e)};$n.encode=function(e,r){return this.$type.encode(e,r)};$n.encodeDelimited=function(e,r){return this.$type.encodeDelimited(e,r)};$n.decode=function(e){return this.$type.decode(e)};$n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};$n.verify=function(e){return this.$type.verify(e)};$n.fromObject=function(e){return this.$type.fromObject(e)};$n.toObject=function(e,r){return this.$type.toObject(e,r)};$n.prototype.toJSON=function(){return this.$type.toObject(this,Vxe.toJSONOptions)}});var kM=p((Stt,G5)=>{"use strict";G5.exports=jxe;var Gxe=Qr(),Pi=ys(),V5=it();function qxe(t){return"missing required '"+t.name+"'"}function jxe(t){for(var e=V5.codegen(["r","l","e"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(n){return n.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 o=t._fieldsArray[r].resolve(),s=o.resolvedType instanceof Gxe?"int32":o.type,a="m"+V5.safeProp(o.name);e("case %i: {",o.id),o.map?(e("if(%s===util.emptyObject)",a)("%s={}",a)("var c2 = r.uint32()+r.pos"),Pi.defaults[o.keyType]!==void 0?e("k=%j",Pi.defaults[o.keyType]):e("k=null"),Pi.defaults[s]!==void 0?e("value=%j",Pi.defaults[s]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",o.keyType)("case 2:"),Pi.basic[s]===void 0?e("value=types[%i].decode(r,r.uint32())",r):e("value=r.%s()",s),e("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),Pi.long[o.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',a):e("%s[k]=value",a)):o.repeated?(e("if(!(%s&&%s.length))",a,a)("%s=[]",a),Pi.packed[s]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",a,s)("}else"),Pi.basic[s]===void 0?e(o.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",a,r):e("%s.push(r.%s())",a,s)):Pi.basic[s]===void 0?e(o.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",a,r):e("%s=r.%s()",a,s),e("break")("}")}for(e("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<t._fieldsArray.length;++r){var i=t._fieldsArray[r];i.required&&e("if(!m.hasOwnProperty(%j))",i.name)("throw util.ProtocolError(%j,{instance:m})",qxe(i))}return e("return m")}});var VM=p((Ttt,q5)=>{"use strict";q5.exports=$xe;var Hxe=Qr(),BM=it();function Pr(t,e){return t.name+": "+e+(t.repeated&&e!=="array"?"[]":t.map&&e!=="object"?"{k:"+t.keyType+"}":"")+" expected"}function FM(t,e,r,o){if(e.resolvedType)if(e.resolvedType instanceof Hxe){t("switch(%s){",o)("default:")("return%j",Pr(e,"enum value"));for(var s=Object.keys(e.resolvedType.values),a=0;a<s.length;++a)t("case %i:",e.resolvedType.values[s[a]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s);",r,o)("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))",o)("return%j",Pr(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)))",o,o,o,o)("return%j",Pr(e,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',o)("return%j",Pr(e,"number"));break;case"bool":t('if(typeof %s!=="boolean")',o)("return%j",Pr(e,"boolean"));break;case"string":t("if(!util.isString(%s))",o)("return%j",Pr(e,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",Pr(e,"buffer"));break}return t}function zxe(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",Pr(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",r)("return%j",Pr(e,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",r)("return%j",Pr(e,"boolean key"));break}return t}function $xe(t){var e=BM.codegen(["m"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=t.oneofsArray,o={};r.length&&e("var p={}");for(var s=0;s<t.fieldsArray.length;++s){var a=t._fieldsArray[s].resolve(),i="m"+BM.safeProp(a.name);if(a.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",i,a.name),a.map)e("if(!util.isObject(%s))",i)("return%j",Pr(a,"object"))("var k=Object.keys(%s)",i)("for(var i=0;i<k.length;++i){"),zxe(e,a,"k[i]"),FM(e,a,s,i+"[k[i]]")("}");else if(a.repeated)e("if(!Array.isArray(%s))",i)("return%j",Pr(a,"array"))("for(var i=0;i<%s.length;++i){",i),FM(e,a,s,i+"[i]")("}");else{if(a.partOf){var n=BM.safeProp(a.partOf.name);o[a.partOf.name]===1&&e("if(p%s===1)",n)("return%j",a.partOf.name+": multiple values"),o[a.partOf.name]=1,e("p%s=1",n)}FM(e,a,s,i)}a.optional&&e("}")}return e("return null")}});var jM=p(H5=>{"use strict";var j5=H5,Kl=Qr(),Yn=it();function GM(t,e,r,o){var s=!1;if(e.resolvedType)if(e.resolvedType instanceof Kl){t("switch(d%s){",o);for(var a=e.resolvedType.values,i=Object.keys(a),n=0;n<i.length;++n)a[i[n]]===e.typeDefault&&!s&&(t("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',o,o,o),e.repeated||t("break"),s=!0),t("case%j:",i[n])("case %i:",a[i[n]])("m%s=%j",o,a[i[n]])("break");t("}")}else t('if(typeof d%s!=="object")',o)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,r,o);else{var c=!1;switch(e.type){case"double":case"float":t("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",o,o);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,c)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,c?"true":"");break;case"bytes":t('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length >= 0)",o)("m%s=d%s",o,o);break;case"string":t("m%s=String(d%s)",o,o);break;case"bool":t("m%s=Boolean(d%s)",o,o);break}}return t}j5.fromObject=function(e){var r=e.fieldsArray,o=Yn.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!r.length)return o("return new this.ctor");o("var m=new this.ctor");for(var s=0;s<r.length;++s){var a=r[s].resolve(),i=Yn.safeProp(a.name);a.map?(o("if(d%s){",i)('if(typeof d%s!=="object")',i)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",i)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",i),GM(o,a,s,i+"[ks[i]]")("}")("}")):a.repeated?(o("if(d%s){",i)("if(!Array.isArray(d%s))",i)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",i)("for(var i=0;i<d%s.length;++i){",i),GM(o,a,s,i+"[i]")("}")("}")):(a.resolvedType instanceof Kl||o("if(d%s!=null){",i),GM(o,a,s,i),a.resolvedType instanceof Kl||o("}"))}return o("return m")};function qM(t,e,r,o){if(e.resolvedType)e.resolvedType instanceof Kl?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",o,r,o,o,r,o,o):t("d%s=types[%i].toObject(m%s,o)",o,r,o);else{var s=!1;switch(e.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":t('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("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",o,o,o,o,s?"true":"",o);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",o,o,o,o,o);break;default:t("d%s=m%s",o,o);break}}return t}j5.toObject=function(e){var r=e.fieldsArray.slice().sort(Yn.compareFieldsById);if(!r.length)return Yn.codegen()("return {}");for(var o=Yn.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),s=[],a=[],i=[],n=0;n<r.length;++n)r[n].partOf||(r[n].resolve().repeated?s:r[n].map?a:i).push(r[n]);if(s.length){for(o("if(o.arrays||o.defaults){"),n=0;n<s.length;++n)o("d%s=[]",Yn.safeProp(s[n].name));o("}")}if(a.length){for(o("if(o.objects||o.defaults){"),n=0;n<a.length;++n)o("d%s={}",Yn.safeProp(a[n].name));o("}")}if(i.length){for(o("if(o.defaults){"),n=0;n<i.length;++n){var c=i[n],u=Yn.safeProp(c.name);if(c.resolvedType instanceof Kl)o("d%s=o.enums===String?%j:%j",u,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)o("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():n",u)("}else")("d%s=o.longs===String?%j:%i",u,c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var l="["+Array.prototype.slice.call(c.typeDefault).join(",")+"]";o("if(o.bytes===String)d%s=%j",u,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%s",u,l)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else o("d%s=%j",u,c.typeDefault)}o("}")}var d=!1;for(n=0;n<r.length;++n){var c=r[n],h=e._fieldsArray.indexOf(c),u=Yn.safeProp(c.name);c.map?(d||(d=!0,o("var ks2")),o("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u)("for(var j=0;j<ks2.length;++j){"),qM(o,c,h,u+"[ks2[j]]")("}")):c.repeated?(o("if(m%s&&m%s.length){",u,u)("d%s=[]",u)("for(var j=0;j<m%s.length;++j){",u),qM(o,c,h,u+"[j]")("}")):(o("if(m%s!=null&&m.hasOwnProperty(%j)){",u,c.name),qM(o,c,h,u),c.partOf&&o("if(o.oneofs)")("d%s=%j",Yn.safeProp(c.partOf.name),c.name)),o("}")}return o("return d")}});var HM=p(z5=>{"use strict";var Yxe=z5,Wxe=uS();Yxe[".google.protobuf.Any"]={fromObject:function(t){if(t&&t["@type"]){var e=t["@type"].substring(t["@type"].lastIndexOf("/")+1),r=this.lookup(e);if(r){var o=t["@type"].charAt(0)==="."?t["@type"].slice(1):t["@type"];return o.indexOf("/")===-1&&(o="/"+o),this.create({type_url:o,value:r.encode(r.fromObject(t)).finish()})}}return this.fromObject(t)},toObject:function(t,e){var r="type.googleapis.com/",o="",s="";if(e&&e.json&&t.type_url&&t.value){s=t.type_url.substring(t.type_url.lastIndexOf("/")+1),o=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var a=this.lookup(s);a&&(t=a.decode(t.value))}if(!(t instanceof this.ctor)&&t instanceof Wxe){var i=t.$type.toObject(t,e),n=t.$type.fullName[0]==="."?t.$type.fullName.slice(1):t.$type.fullName;return o===""&&(o=r),s=o+n,i["@type"]=s,i}return this.toObject(t,e)}}});var pS=p((Att,Y5)=>{"use strict";Y5.exports=Se;var Cr=Mc();((Se.prototype=Object.create(Cr.prototype)).constructor=Se).className="Type";var Kxe=Qr(),YM=Ts(),lS=co(),Xxe=sS(),Jxe=cS(),zM=uS(),$M=nE(),Qxe=tE(),bt=it(),Zxe=WM(),ewe=kM(),twe=VM(),$5=jM(),rwe=HM();function Se(t,e){Cr.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]],o=r.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=bt.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=bt.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Se.generateConstructor(this)())},set:function(t){var e=t.prototype;e instanceof zM||((t.prototype=new zM).constructor=t,bt.merge(t.prototype,e)),t.$type=t.prototype.$type=this,bt.merge(t,zM,!0),this._ctor=t;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var o={};for(r=0;r<this.oneofsArray.length;++r)o[this._oneofsArray[r].resolve().name]={get:bt.oneOfGetter(this._oneofsArray[r].oneof),set:bt.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(t.prototype,o)}}});Se.generateConstructor=function(e){for(var r=bt.codegen(["p"],e.name),o=0,s;o<e.fieldsArray.length;++o)(s=e._fieldsArray[o]).map?r("this%s={}",bt.safeProp(s.name)):s.repeated&&r("this%s=[]",bt.safeProp(s.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function dS(t){return t._fieldsById=t._fieldsArray=t._oneofsArray=null,delete t.encode,delete t.decode,delete t.verify,t}Se.fromJSON=function(e,r){var o=new Se(e,r.options);o.extensions=r.extensions,o.reserved=r.reserved;for(var s=Object.keys(r.fields),a=0;a<s.length;++a)o.add((typeof r.fields[s[a]].keyType<"u"?Xxe.fromJSON:lS.fromJSON)(s[a],r.fields[s[a]]));if(r.oneofs)for(s=Object.keys(r.oneofs),a=0;a<s.length;++a)o.add(YM.fromJSON(s[a],r.oneofs[s[a]]));if(r.nested)for(s=Object.keys(r.nested),a=0;a<s.length;++a){var i=r.nested[s[a]];o.add((i.id!==void 0?lS.fromJSON:i.fields!==void 0?Se.fromJSON:i.values!==void 0?Kxe.fromJSON:i.methods!==void 0?Jxe.fromJSON:Cr.fromJSON)(s[a],i))}return r.extensions&&r.extensions.length&&(o.extensions=r.extensions),r.reserved&&r.reserved.length&&(o.reserved=r.reserved),r.group&&(o.group=!0),r.comment&&(o.comment=r.comment),r.edition&&(o._edition=r.edition),o._defaultEdition="proto3",o};Se.prototype.toJSON=function(e){var r=Cr.prototype.toJSON.call(this,e),o=e?!!e.keepComments:!1;return bt.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",Cr.arrayToJSON(this.oneofsArray,e),"fields",Cr.arrayToJSON(this.fieldsArray.filter(function(s){return!s.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",o?this.comment:void 0])};Se.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Cr.prototype.resolveAll.call(this);var e=this.oneofsArray;for(o=0;o<e.length;)e[o++].resolve();for(var r=this.fieldsArray,o=0;o<r.length;)r[o++].resolve();return this};Se.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Cr.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 this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&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 lS&&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.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),dS(this)}return e instanceof YM?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),dS(this)):Cr.prototype.add.call(this,e)};Se.prototype.remove=function(e){if(e instanceof lS&&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),dS(this)}if(e instanceof YM){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),dS(this)}return Cr.prototype.remove.call(this,e)};Se.prototype.isReservedId=function(e){return Cr.isReservedId(this.reserved,e)};Se.prototype.isReservedName=function(e){return Cr.isReservedName(this.reserved,e)};Se.prototype.create=function(e){return new this.ctor(e)};Se.prototype.setup=function(){for(var e=this.fullName,r=[],o=0;o<this.fieldsArray.length;++o)r.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Zxe(this)({Writer:Qxe,types:r,util:bt}),this.decode=ewe(this)({Reader:$M,types:r,util:bt}),this.verify=twe(this)({types:r,util:bt}),this.fromObject=$5.fromObject(this)({types:r,util:bt}),this.toObject=$5.toObject(this)({types:r,util:bt});var s=rwe[e];if(s){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};Se.prototype.encode=function(e,r){return this.setup().encode(e,r)};Se.prototype.encodeDelimited=function(e,r){return this.encode(e,r&&r.len?r.fork():r).ldelim()};Se.prototype.decode=function(e,r){return this.setup().decode(e,r)};Se.prototype.decodeDelimited=function(e){return e instanceof $M||(e=$M.create(e)),this.decode(e,e.uint32())};Se.prototype.verify=function(e){return this.setup().verify(e)};Se.prototype.fromObject=function(e){return this.setup().fromObject(e)};Se.prototype.toObject=function(e,r){return this.setup().toObject(e,r)};Se.d=function(e){return function(o){bt.decorateType(o,e)}}});var _S=p((Ott,X5)=>{"use strict";X5.exports=cr;var mS=Mc();((cr.prototype=Object.create(mS.prototype)).constructor=cr).className="Root";var fS=co(),KM=Qr(),nwe=Ts(),lo=it(),XM,JM,Xl;function cr(t){mS.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}cr.fromJSON=function(e,r){return r||(r=new cr),e.options&&r.setOptions(e.options),r.addJSON(e.nested).resolveAll()};cr.prototype.resolvePath=lo.path.resolve;cr.prototype.fetch=lo.fetch;function K5(){}cr.prototype.load=function t(e,r,o){typeof r=="function"&&(o=r,r=void 0);var s=this;if(!o)return lo.asPromise(t,s,e,r);var a=o===K5;function i(g,E){if(o){if(a)throw g;E&&E.resolveAll();var S=o;o=null,S(g,E)}}function n(g){var E=g.lastIndexOf("google/protobuf/");if(E>-1){var S=g.substring(E);if(S in Xl)return S}return null}function c(g,E){try{if(lo.isString(E)&&E.charAt(0)==="{"&&(E=JSON.parse(E)),!lo.isString(E))s.setOptions(E.options).addJSON(E.nested);else{JM.filename=g;var S=JM(E,s,r),v,O=0;if(S.imports)for(;O<S.imports.length;++O)(v=n(S.imports[O])||s.resolvePath(g,S.imports[O]))&&u(v);if(S.weakImports)for(O=0;O<S.weakImports.length;++O)(v=n(S.weakImports[O])||s.resolvePath(g,S.weakImports[O]))&&u(v,!0)}}catch(I){i(I)}!a&&!l&&i(null,s)}function u(g,E){if(g=n(g)||g,!(s.files.indexOf(g)>-1)){if(s.files.push(g),g in Xl){a?c(g,Xl[g]):(++l,setTimeout(function(){--l,c(g,Xl[g])}));return}if(a){var S;try{S=lo.fs.readFileSync(g).toString("utf8")}catch(v){E||i(v);return}c(g,S)}else++l,s.fetch(g,function(v,O){if(--l,!!o){if(v){E?l||i(null,s):i(v);return}c(g,O)}})}}var l=0;lo.isString(e)&&(e=[e]);for(var d=0,h;d<e.length;++d)(h=s.resolvePath("",e[d]))&&u(h);return a?(s.resolveAll(),s):(l||i(null,s),s)};cr.prototype.loadSync=function(e,r){if(!lo.isNode)throw Error("not supported");return this.load(e,r,K5)};cr.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 mS.prototype.resolveAll.call(this)};var hS=/^[A-Z]/;function W5(t,e){var r=e.parent.lookup(e.extend);if(r){var o=new fS(e.fullName,e.id,e.type,e.rule,void 0,e.options);return r.get(o.name)||(o.declaringField=e,e.extensionField=o,r.add(o)),!0}return!1}cr.prototype._handleAdd=function(e){if(e instanceof fS)e.extend!==void 0&&!e.extensionField&&(W5(this,e)||this.deferred.push(e));else if(e instanceof KM)hS.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof nwe)){if(e instanceof XM)for(var r=0;r<this.deferred.length;)W5(this,this.deferred[r])?this.deferred.splice(r,1):++r;for(var o=0;o<e.nestedArray.length;++o)this._handleAdd(e._nestedArray[o]);hS.test(e.name)&&(e.parent[e.name]=e)}(e instanceof XM||e instanceof KM||e instanceof fS)&&(this._fullyQualifiedObjects[e.fullName]=e)};cr.prototype._handleRemove=function(e){if(e instanceof fS){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 KM)hS.test(e.name)&&delete e.parent[e.name];else if(e instanceof mS){for(var o=0;o<e.nestedArray.length;++o)this._handleRemove(e._nestedArray[o]);hS.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};cr._configure=function(t,e,r){XM=t,JM=e,Xl=r}});var it=p((btt,Q5)=>{"use strict";var Fe=Q5.exports=Bn(),J5=dN(),QM,ZM;Fe.codegen=R5();Fe.fetch=C5();Fe.path=I5();Fe.fs=Fe.inquire("fs");Fe.toArray=function(e){if(e){for(var r=Object.keys(e),o=new Array(r.length),s=0;s<r.length;)o[s]=e[r[s++]];return o}return[]};Fe.toObject=function(e){for(var r={},o=0;o<e.length;){var s=e[o++],a=e[o++];a!==void 0&&(r[s]=a)}return r};var iwe=/\\/g,owe=/"/g;Fe.isReserved=function(e){return/^(?: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)$/.test(e)};Fe.safeProp=function(e){return!/^[$\w_]+$/.test(e)||Fe.isReserved(e)?'["'+e.replace(iwe,"\\\\").replace(owe,'\\"')+'"]':"."+e};Fe.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var swe=/_([a-z])/g;Fe.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(swe,function(r,o){return o.toUpperCase()})};Fe.compareFieldsById=function(e,r){return e.id-r.id};Fe.decorateType=function(e,r){if(e.$type)return r&&e.$type.name!==r&&(Fe.decorateRoot.remove(e.$type),e.$type.name=r,Fe.decorateRoot.add(e.$type)),e.$type;QM||(QM=pS());var o=new QM(r||e.name);return Fe.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var awe=0;Fe.decorateEnum=function(e){if(e.$type)return e.$type;ZM||(ZM=Qr());var r=new ZM("Enum"+awe++,e);return Fe.decorateRoot.add(r),Object.defineProperty(e,"$type",{value:r,enumerable:!1}),r};Fe.setProperty=function(e,r,o,s){function a(i,n,c){var u=n.shift();if(u==="__proto__"||u==="prototype")return i;if(n.length>0)i[u]=a(i[u]||{},n,c);else{var l=i[u];if(l&&s)return i;l&&(c=[].concat(l).concat(c)),i[u]=c}return i}if(typeof e!="object")throw TypeError("dst must be an object");if(!r)throw TypeError("path must be specified");return r=r.split("."),a(e,r,o)};Object.defineProperty(Fe,"decorateRoot",{get:function(){return J5.decorated||(J5.decorated=new(_S()))}})});var ys=p(Z5=>{"use strict";var Jl=Z5,cwe=it(),uwe=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function Ql(t,e){var r=0,o={};for(e|=0;r<t.length;)o[uwe[r+e]]=t[r++];return o}Jl.basic=Ql([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Jl.defaults=Ql([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",cwe.emptyArray,null]);Jl.long=Ql([0,0,0,1,1],7);Jl.mapKey=Ql([0,0,0,5,5,0,0,0,1,1,0,2],2);Jl.packed=Ql([1,5,0,0,0,5,5,0,0,0,1,1,0])});var co=p((Ptt,t9)=>{"use strict";t9.exports=ot;var ed=uo();((ot.prototype=Object.create(ed.prototype)).constructor=ot).className="Field";var e9=Qr(),eI=ys(),He=it(),Zl,lwe=/^required|optional|repeated$/;ot.fromJSON=function(e,r){var o=new ot(e,r.id,r.type,r.rule,r.extend,r.options,r.comment);return r.edition&&(o._edition=r.edition),o._defaultEdition="proto3",o};function ot(t,e,r,o,s,a,i){if(He.isObject(o)?(i=s,a=o,o=s=void 0):He.isObject(s)&&(i=a,a=s,s=void 0),ed.call(this,t,a),!He.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!He.isString(r))throw TypeError("type must be a string");if(o!==void 0&&!lwe.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(s!==void 0&&!He.isString(s))throw TypeError("extend must be a string");o==="proto3_optional"&&(o="optional"),this.rule=o&&o!=="optional"?o:void 0,this.type=r,this.id=e,this.extend=s||void 0,this.repeated=o==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=He.Long?eI.long[r]!==void 0:!1,this.bytes=r==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=i}Object.defineProperty(ot.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(ot.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(ot.prototype,"delimited",{get:function(){return this.resolvedType instanceof Zl&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(ot.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(ot.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});ot.prototype.setOption=function(e,r,o){return ed.prototype.setOption.call(this,e,r,o)};ot.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return He.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])};ot.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=eI.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof Zl?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 e9&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof e9)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=He.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;He.base64.test(this.typeDefault)?He.base64.decode(this.typeDefault,e=He.newBuffer(He.base64.length(this.typeDefault)),0):He.utf8.write(this.typeDefault,e=He.newBuffer(He.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=He.emptyObject:this.repeated?this.defaultValue=He.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof Zl&&(this.parent.ctor.prototype[this.name]=this.defaultValue),ed.prototype.resolve.call(this)};ot.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var r={};if(this.rule==="required"&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&eI.defaults[this.type]===void 0){var o=this.parent.get(this.type.split(".").pop());o&&o instanceof Zl&&o.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};ot.prototype._resolveFeatures=function(e){return ed.prototype._resolveFeatures.call(this,this._edition||e)};ot.d=function(e,r,o,s){return typeof r=="function"?r=He.decorateType(r).name:r&&typeof r=="object"&&(r=He.decorateEnum(r).name),function(i,n){He.decorateType(i.constructor).add(new ot(n,e,r,o,{default:s}))}};ot._configure=function(e){Zl=e}});var Ts=p((Ctt,i9)=>{"use strict";i9.exports=ur;var ES=uo();((ur.prototype=Object.create(ES.prototype)).constructor=ur).className="OneOf";var r9=co(),gS=it();function ur(t,e,r,o){if(Array.isArray(e)||(r=e,e=void 0),ES.call(this,t,r),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=o}ur.fromJSON=function(e,r){return new ur(e,r.oneof,r.options,r.comment)};ur.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return gS.toObject(["options",this.options,"oneof",this.oneof,"comment",r?this.comment:void 0])};function n9(t){if(t.parent)for(var e=0;e<t.fieldsArray.length;++e)t.fieldsArray[e].parent||t.parent.add(t.fieldsArray[e])}ur.prototype.add=function(e){if(!(e instanceof r9))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,n9(this),this};ur.prototype.remove=function(e){if(!(e instanceof r9))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};ur.prototype.onAdd=function(e){ES.prototype.onAdd.call(this,e);for(var r=this,o=0;o<this.oneof.length;++o){var s=e.get(this.oneof[o]);s&&!s.partOf&&(s.partOf=r,r.fieldsArray.push(s))}n9(this)};ur.prototype.onRemove=function(e){for(var r=0,o;r<this.fieldsArray.length;++r)(o=this.fieldsArray[r]).parent&&o.parent.remove(o);ES.prototype.onRemove.call(this,e)};Object.defineProperty(ur.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}});ur.d=function(){for(var e=new Array(arguments.length),r=0;r<arguments.length;)e[r]=arguments[r++];return function(s,a){gS.decorateType(s.constructor).add(new ur(a,e)),Object.defineProperty(s,a,{get:gS.oneOfGetter(e),set:gS.oneOfSetter(e)})}}});var uo=p((Ntt,o9)=>{"use strict";o9.exports=ht;ht.className="ReflectionObject";var dwe=Ts(),td=it(),SS,pwe={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},fwe={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},hwe={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function ht(t,e){if(!td.isString(t))throw TypeError("name must be a string");if(e&&!td.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(ht.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(".")}}});ht.prototype.toJSON=function(){throw Error()};ht.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 SS&&r._handleAdd(this)};ht.prototype.onRemove=function(e){var r=e.root;r instanceof SS&&r._handleRemove(this),this.parent=null,this.resolved=!1};ht.prototype.resolve=function(){return this.resolved?this:(this.root instanceof SS&&(this.resolved=!0),this)};ht.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};ht.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var r={};if(!e)throw new Error("Unknown edition for "+this.fullName);var o=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")r=Object.assign({},fwe);else if(e==="proto3")r=Object.assign({},hwe);else if(e==="2023")r=Object.assign({},pwe);else throw new Error("Unknown edition: "+e);this._features=Object.assign(r,o||{}),this._featuresResolved=!0;return}if(this.partOf instanceof dwe){var s=Object.assign({},this.partOf._features);this._features=Object.assign(s,o||{})}else if(!this.declaringField)if(this.parent){var a=Object.assign({},this.parent._features);this._features=Object.assign(a,o||{})}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};ht.prototype._inferLegacyProtoFeatures=function(){return{}};ht.prototype.getOption=function(e){if(this.options)return this.options[e]};ht.prototype.setOption=function(e,r,o){return this.options||(this.options={}),/^features\./.test(e)?td.setProperty(this.options,e,r,o):(!o||this.options[e]===void 0)&&(this.getOption(e)!==r&&(this.resolved=!1),this.options[e]=r),this};ht.prototype.setParsedOption=function(e,r,o){this.parsedOptions||(this.parsedOptions=[]);var s=this.parsedOptions;if(o){var a=s.find(function(c){return Object.prototype.hasOwnProperty.call(c,e)});if(a){var i=a[e];td.setProperty(i,o,r)}else a={},a[e]=td.setProperty({},o,r),s.push(a)}else{var n={};n[e]=r,s.push(n)}return this};ht.prototype.setOptions=function(e,r){if(e)for(var o=Object.keys(e),s=0;s<o.length;++s)this.setOption(o[s],e[o[s]],r);return this};ht.prototype.toString=function(){var e=this.constructor.className,r=this.fullName;return r.length?e+" "+r:e};ht.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};ht._configure=function(t){SS=t}});var Qr=p((Mtt,a9)=>{"use strict";a9.exports=Zr;var tI=uo();((Zr.prototype=Object.create(tI.prototype)).constructor=Zr).className="Enum";var s9=Mc(),TS=it();function Zr(t,e,r,o,s,a){if(tI.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=o,this.comments=s||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,e)for(var i=Object.keys(e),n=0;n<i.length;++n)typeof e[i[n]]=="number"&&(this.valuesById[this.values[i[n]]=e[i[n]]]=i[n])}Zr.prototype._resolveFeatures=function(e){return e=this._edition||e,tI.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(r=>{var o=Object.assign({},this._features);this._valuesFeatures[r]=Object.assign(o,this.valuesOptions&&this.valuesOptions[r]&&this.valuesOptions[r].features)}),this};Zr.fromJSON=function(e,r){var o=new Zr(e,r.values,r.options,r.comment,r.comments);return o.reserved=r.reserved,r.edition&&(o._edition=r.edition),o._defaultEdition="proto3",o};Zr.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return TS.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])};Zr.prototype.add=function(e,r,o,s){if(!TS.isString(e))throw TypeError("name must be a string");if(!TS.isInteger(r))throw TypeError("id must be an integer");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 s&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=s||null),this.comments[e]=o||null,this};Zr.prototype.remove=function(e){if(!TS.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};Zr.prototype.isReservedId=function(e){return s9.isReservedId(this.reserved,e)};Zr.prototype.isReservedName=function(e){return s9.isReservedName(this.reserved,e)}});var WM=p((Itt,u9)=>{"use strict";u9.exports=_we;var mwe=Qr(),rI=ys(),nI=it();function c9(t,e,r,o){return e.delimited?t("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,o,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,o,(e.id<<3|2)>>>0)}function _we(t){for(var e=nI.codegen(["m","w"],t.name+"$encode")("if(!w)")("w=Writer.create()"),r,o,s=t.fieldsArray.slice().sort(nI.compareFieldsById),r=0;r<s.length;++r){var a=s[r].resolve(),i=t._fieldsArray.indexOf(a),n=a.resolvedType instanceof mwe?"int32":a.type,c=rI.basic[n];o="m"+nI.safeProp(a.name),a.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",o,a.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",o)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(a.id<<3|2)>>>0,8|rI.mapKey[a.keyType],a.keyType),c===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",i,o):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,n,o),e("}")("}")):a.repeated?(e("if(%s!=null&&%s.length){",o,o),a.packed&&rI.packed[n]!==void 0?e("w.uint32(%i).fork()",(a.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",o)("w.%s(%s[i])",n,o)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",o),c===void 0?c9(e,a,i,o+"[i]"):e("w.uint32(%i).%s(%s[i])",(a.id<<3|c)>>>0,n,o)),e("}")):(a.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",o,a.name),c===void 0?c9(e,a,i,o):e("w.uint32(%i).%s(%s)",(a.id<<3|c)>>>0,n,o))}return e("return w")}});var d9=p((xtt,l9)=>{"use strict";var le=l9.exports=pN();le.build="light";function gwe(t,e,r){return typeof e=="function"?(r=e,e=new le.Root):e||(e=new le.Root),e.load(t,r)}le.load=gwe;function Ewe(t,e){return e||(e=new le.Root),e.loadSync(t)}le.loadSync=Ewe;le.encoder=WM();le.decoder=kM();le.verifier=VM();le.converter=jM();le.ReflectionObject=uo();le.Namespace=Mc();le.Root=_S();le.Enum=Qr();le.Type=pS();le.Field=co();le.OneOf=Ts();le.MapField=sS();le.Service=cS();le.Method=aS();le.Message=uS();le.wrappers=HM();le.types=ys();le.util=it();le.ReflectionObject._configure(le.Root);le.Namespace._configure(le.Type,le.Service,le.Enum);le.Root._configure(le.Type);le.Field._configure(le.Type)});var oI=p((wtt,h9)=>{"use strict";h9.exports=f9;var iI=/[\s{}=;:[\],'"()<>]/g,Swe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,Twe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,ywe=/^ *[*/]+ */,vwe=/^\s*\*?\/*/,Awe=/\n/g,Owe=/\s/,bwe=/\\(.?)/g,Rwe={0:"\0",r:"\r",n:`
|
|
28
|
+
`,t:" "};function p9(t){return t.replace(bwe,function(e,r){switch(r){case"\\":case"":return r;default:return Rwe[r]||""}})}f9.unescape=p9;function f9(t,e){t=t.toString();var r=0,o=t.length,s=1,a=0,i={},n=[],c=null;function u(A){return Error("illegal "+A+" (line "+s+")")}function l(){var A=c==="'"?Twe:Swe;A.lastIndex=r-1;var z=A.exec(t);if(!z)throw u("string");return r=A.lastIndex,v(c),c=null,p9(z[1])}function d(A){return t.charAt(A)}function h(A,z,H){var Q={type:t.charAt(A++),lineEmpty:!1,leading:H},oe;e?oe=2:oe=3;var te=A-oe,Z;do if(--te<0||(Z=t.charAt(te))===`
|
|
29
|
+
`){Q.lineEmpty=!0;break}while(Z===" "||Z===" ");for(var R=t.substring(A,z).split(Awe),Mt=0;Mt<R.length;++Mt)R[Mt]=R[Mt].replace(e?vwe:ywe,"").trim();Q.text=R.join(`
|
|
30
|
+
`).trim(),i[s]=Q,a=s}function g(A){var z=E(A),H=t.substring(A,z),Q=/^\s*\/\//.test(H);return Q}function E(A){for(var z=A;z<o&&d(z)!==`
|
|
31
|
+
`;)z++;return z}function S(){if(n.length>0)return n.shift();if(c)return l();var A,z,H,Q,oe,te=r===0;do{if(r===o)return null;for(A=!1;Owe.test(H=d(r));)if(H===`
|
|
32
|
+
`&&(te=!0,++s),++r===o)return null;if(d(r)==="/"){if(++r===o)throw u("comment");if(d(r)==="/")if(e){if(Q=r,oe=!1,g(r-1)){oe=!0;do if(r=E(r),r===o||(r++,!te))break;while(g(r))}else r=Math.min(o,E(r)+1);oe&&(h(Q,r,te),te=!0),s++,A=!0}else{for(oe=d(Q=r+1)==="/";d(++r)!==`
|
|
33
|
+
`;)if(r===o)return null;++r,oe&&(h(Q,r-1,te),te=!0),++s,A=!0}else if((H=d(r))==="*"){Q=r+1,oe=e||d(Q)==="*";do{if(H===`
|
|
34
|
+
`&&++s,++r===o)throw u("comment");z=H,H=d(r)}while(z!=="*"||H!=="/");++r,oe&&(h(Q,r-2,te),te=!0),A=!0}else return"/"}}while(A);var Z=r;iI.lastIndex=0;var R=iI.test(d(Z++));if(!R)for(;Z<o&&!iI.test(d(Z));)++Z;var Mt=t.substring(r,r=Z);return(Mt==='"'||Mt==="'")&&(c=Mt),Mt}function v(A){n.push(A)}function O(){if(!n.length){var A=S();if(A===null)return null;v(A)}return n[0]}function I(A,z){var H=O(),Q=H===A;if(Q)return S(),!0;if(!z)throw u("token '"+H+"', '"+A+"' expected");return!1}function j(A){var z=null,H;return A===void 0?(H=i[s-1],delete i[s-1],H&&(e||H.type==="*"||H.lineEmpty)&&(z=H.leading?H.text:null)):(a<A&&O(),H=i[A],delete i[A],H&&!H.lineEmpty&&(e||H.type==="/")&&(z=H.leading?null:H.text)),z}return Object.defineProperty({next:S,peek:O,push:v,skip:I,cmnt:j},"line",{get:function(){return s}})}});var T9=p((Ltt,S9)=>{"use strict";S9.exports=Ci;Ci.filename=null;Ci.defaults={keepCase:!1};var Pwe=oI(),m9=_S(),_9=pS(),g9=co(),Cwe=sS(),E9=Ts(),Nwe=Qr(),Mwe=cS(),Iwe=aS(),xwe=uo(),wwe=ys(),sI=it(),Lwe=/^[1-9][0-9]*$/,Dwe=/^-?[1-9][0-9]*$/,Uwe=/^0[x][0-9a-fA-F]+$/,kwe=/^-?0[x][0-9a-fA-F]+$/,Bwe=/^0[0-7]+$/,Fwe=/^-?0[0-7]+$/,Vwe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,Wn=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Kn=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function Ci(t,e,r){e instanceof m9||(r=e,e=new m9),r||(r=Ci.defaults);var o=r.preferTrailingComment||!1,s=Pwe(t,r.alternateCommentMode||!1),a=s.next,i=s.push,n=s.peek,c=s.skip,u=s.cmnt,l=!0,d,h,g,E="proto2",S=e,v=[],O={},I=r.keepCase?function(N){return N}:sI.camelCase;function j(){v.forEach(N=>{N._edition=E,Object.keys(O).forEach(C=>{N.getOption(C)===void 0&&N.setOption(C,O[C],!0)})})}function A(N,C,L){var Y=Ci.filename;return L||(Ci.filename=null),Error("illegal "+(C||"token")+" '"+N+"' ("+(Y?Y+", ":"")+"line "+s.line+")")}function z(){var N=[],C;do{if((C=a())!=='"'&&C!=="'")throw A(C);N.push(a()),c(C),C=n()}while(C==='"'||C==="'");return N.join("")}function H(N){var C=a();switch(C){case"'":case'"':return i(C),z();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return oe(C,!0)}catch{if(N&&Kn.test(C))return C;throw A(C,"value")}}function Q(N,C){var L,Y;do if(C&&((L=n())==='"'||L==="'")){var $=z();if(N.push($),E>=2023)throw A($,"id")}else try{N.push([Y=te(a()),c("to",!0)?te(a()):Y])}catch(Re){if(C&&Kn.test(L)&&E>=2023)N.push(L);else throw Re}while(c(",",!0));var re={options:void 0};re.setOption=function(Re,Et){this.options===void 0&&(this.options={}),this.options[Re]=Et},D(re,function(Et){if(Et==="option")pe(re,Et),c(";");else throw A(Et)},function(){ui(re)})}function oe(N,C){var L=1;switch(N.charAt(0)==="-"&&(L=-1,N=N.substring(1)),N){case"inf":case"INF":case"Inf":return L*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(Lwe.test(N))return L*parseInt(N,10);if(Uwe.test(N))return L*parseInt(N,16);if(Bwe.test(N))return L*parseInt(N,8);if(Vwe.test(N))return L*parseFloat(N);throw A(N,"number",C)}function te(N,C){switch(N){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!C&&N.charAt(0)==="-")throw A(N,"id");if(Dwe.test(N))return parseInt(N,10);if(kwe.test(N))return parseInt(N,16);if(Fwe.test(N))return parseInt(N,8);throw A(N,"id")}function Z(){if(d!==void 0)throw A("package");if(d=a(),!Kn.test(d))throw A(d,"name");S=S.define(d),c(";")}function R(){var N=n(),C;switch(N){case"weak":C=g||(g=[]),a();break;case"public":a();default:C=h||(h=[]);break}N=z(),c(";"),C.push(N)}function Mt(){if(c("="),E=z(),E<2023)throw A(E,"syntax");c(";")}function M(){if(c("="),E=z(),!["2023"].includes(E))throw A(E,"edition");c(";")}function _(N,C){switch(C){case"option":return pe(N,C),c(";"),!0;case"message":return ce(N,C),!0;case"enum":return It(N,C),!0;case"service":return Kee(N,C),!0;case"extend":return Jee(N,C),!0}return!1}function D(N,C,L){var Y=s.line;if(N&&(typeof N.comment!="string"&&(N.comment=u()),N.filename=Ci.filename),c("{",!0)){for(var $;($=a())!=="}";)C($);c(";",!0)}else L&&L(),c(";"),N&&(typeof N.comment!="string"||o)&&(N.comment=u(Y)||N.comment)}function ce(N,C){if(!Wn.test(C=a()))throw A(C,"type name");var L=new _9(C);D(L,function($){if(!_(L,$))switch($){case"map":Le(L,$);break;case"required":if(E!=="proto2")throw A($);case"repeated":ae(L,$);break;case"optional":if(E==="proto3")ae(L,"proto3_optional");else{if(E!=="proto2")throw A($);ae(L,"optional")}break;case"oneof":gt(L,$);break;case"extensions":Q(L.extensions||(L.extensions=[]));break;case"reserved":Q(L.reserved||(L.reserved=[]),!0);break;default:if(E==="proto2"||!Kn.test($))throw A($);i($),ae(L,"optional");break}}),N.add(L),N===S&&v.push(L)}function ae(N,C,L){var Y=a();if(Y==="group"){ge(N,C);return}for(;Y.endsWith(".")||n().startsWith(".");)Y+=a();if(!Kn.test(Y))throw A(Y,"type");var $=a();if(!Wn.test($))throw A($,"name");$=I($),c("=");var re=new g9($,te(a()),Y,C,L);if(D(re,function(Lt){if(Lt==="option")pe(re,Lt),c(";");else throw A(Lt)},function(){ui(re)}),C==="proto3_optional"){var Re=new E9("_"+$);re.setOption("proto3_optional",!0),Re.add(re),N.add(Re)}else N.add(re);N===S&&v.push(re)}function ge(N,C){if(E>=2023)throw A("group");var L=a();if(!Wn.test(L))throw A(L,"name");var Y=sI.lcFirst(L);L===Y&&(L=sI.ucFirst(L)),c("=");var $=te(a()),re=new _9(L);re.group=!0;var Re=new g9(Y,$,L,C);Re.filename=Ci.filename,D(re,function(Lt){switch(Lt){case"option":pe(re,Lt),c(";");break;case"required":case"repeated":ae(re,Lt);break;case"optional":E==="proto3"?ae(re,"proto3_optional"):ae(re,"optional");break;case"message":ce(re,Lt);break;case"enum":It(re,Lt);break;case"reserved":Q(re.reserved||(re.reserved=[]),!0);break;default:throw A(Lt)}}),N.add(re).add(Re)}function Le(N){c("<");var C=a();if(wwe.mapKey[C]===void 0)throw A(C,"type");c(",");var L=a();if(!Kn.test(L))throw A(L,"type");c(">");var Y=a();if(!Wn.test(Y))throw A(Y,"name");c("=");var $=new Cwe(I(Y),te(a()),C,L);D($,function(Re){if(Re==="option")pe($,Re),c(";");else throw A(Re)},function(){ui($)}),N.add($)}function gt(N,C){if(!Wn.test(C=a()))throw A(C,"name");var L=new E9(I(C));D(L,function($){$==="option"?(pe(L,$),c(";")):(i($),ae(L,"optional"))}),N.add(L)}function It(N,C){if(!Wn.test(C=a()))throw A(C,"name");var L=new Nwe(C);D(L,function($){switch($){case"option":pe(L,$),c(";");break;case"reserved":Q(L.reserved||(L.reserved=[]),!0),L.reserved===void 0&&(L.reserved=[]);break;default:Xe(L,$)}}),N.add(L),N===S&&v.push(L)}function Xe(N,C){if(!Wn.test(C))throw A(C,"name");c("=");var L=te(a(),!0),Y={options:void 0};Y.getOption=function($){return this.options[$]},Y.setOption=function($,re){xwe.prototype.setOption.call(Y,$,re)},Y.setParsedOption=function(){},D(Y,function(re){if(re==="option")pe(Y,re),c(";");else throw A(re)},function(){ui(Y)}),N.add(C,L,Y.comment,Y.parsedOptions||Y.options)}function pe(N,C){var L,Y,$=!0;for(C==="option"&&(C=a());C!=="=";){if(C==="("){var re=a();c(")"),C="("+re+")"}if($){if($=!1,C.includes(".")&&!C.includes("(")){var Re=C.split(".");L=Re[0]+".",C=Re[1];continue}L=C}else Y=Y?Y+=C:C;C=a()}var Et=Y?L.concat(Y):L,Lt=xt(N,Et);Y=Y&&Y[0]==="."?Y.slice(1):Y,L=L&&L[L.length-1]==="."?L.slice(0,-1):L,wt(N,L,Lt,Y)}function xt(N,C){if(c("{",!0)){for(var L={};!c("}",!0);){if(!Wn.test(ut=a()))throw A(ut,"name");if(ut===null)throw A(ut,"end of input");var Y,$=ut;if(c(":",!0),n()==="{")Y=xt(N,C+"."+ut);else if(n()==="["){Y=[];var re;if(c("[",!0)){do re=H(!0),Y.push(re);while(c(",",!0));c("]"),typeof re<"u"&&Ce(N,C+"."+ut,re)}}else Y=H(!0),Ce(N,C+"."+ut,Y);var Re=L[$];Re&&(Y=[].concat(Re).concat(Y)),L[$]=Y,c(",",!0),c(";",!0)}return L}var Et=H(!0);return Ce(N,C,Et),Et}function Ce(N,C,L){if(S===N&&/^features\./.test(C)){O[C]=L;return}N.setOption&&N.setOption(C,L)}function wt(N,C,L,Y){N.setParsedOption&&N.setParsedOption(C,L,Y)}function ui(N){if(c("[",!0)){do pe(N,"option");while(c(",",!0));c("]")}return N}function Kee(N,C){if(!Wn.test(C=a()))throw A(C,"service name");var L=new Mwe(C);D(L,function($){if(!_(L,$))if($==="rpc")Xee(L,$);else throw A($)}),N.add(L),N===S&&v.push(L)}function Xee(N,C){var L=u(),Y=C;if(!Wn.test(C=a()))throw A(C,"name");var $=C,re,Re,Et,Lt;if(c("("),c("stream",!0)&&(Re=!0),!Kn.test(C=a())||(re=C,c(")"),c("returns"),c("("),c("stream",!0)&&(Lt=!0),!Kn.test(C=a())))throw A(C);Et=C,c(")");var Jd=new Iwe($,Y,re,Et,Re,Lt);Jd.comment=L,D(Jd,function(Rv){if(Rv==="option")pe(Jd,Rv),c(";");else throw A(Rv)}),N.add(Jd)}function Jee(N,C){if(!Kn.test(C=a()))throw A(C,"reference");var L=C;D(null,function($){switch($){case"required":case"repeated":ae(N,$,L);break;case"optional":E==="proto3"?ae(N,"proto3_optional",L):ae(N,"optional",L);break;default:if(E==="proto2"||!Kn.test($))throw A($);i($),ae(N,"optional",L);break}})}for(var ut;(ut=a())!==null;)switch(ut){case"package":if(!l)throw A(ut);Z();break;case"import":if(!l)throw A(ut);R();break;case"syntax":if(!l)throw A(ut);Mt();break;case"edition":if(!l)throw A(ut);M();break;case"option":pe(S,ut),c(";",!0);break;default:if(_(S,ut)){l=!1;continue}throw A(ut)}return j(),Ci.filename=null,{package:d,imports:h,weakImports:g,root:e}}});var A9=p((Dtt,v9)=>{"use strict";v9.exports=en;var Gwe=/\/|\./;function en(t,e){Gwe.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),en[t]=e}en("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var y9;en("duration",{Duration:y9={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});en("timestamp",{Timestamp:y9});en("empty",{Empty:{fields:{}}});en("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}}}});en("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}}}});en("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});en.get=function(e){return en[e]||null}});var b9=p((Utt,O9)=>{"use strict";var po=O9.exports=d9();po.build="full";po.tokenize=oI();po.parse=T9();po.common=A9();po.Root._configure(po.Type,po.parse,po.common)});var yS=p((ktt,R9)=>{"use strict";R9.exports=b9()});var aI=p((Btt,qwe)=>{qwe.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 w9=p((ie,x9)=>{"use strict";var lr=yS();x9.exports=ie=lr.descriptor=lr.Root.fromJSON(aI()).lookup(".google.protobuf");var P9=lr.Namespace,rd=lr.Root,Ni=lr.Enum,Xn=lr.Type,fo=lr.Field,jwe=lr.MapField,vS=lr.OneOf,nd=lr.Service,AS=lr.Method;rd.fromDescriptor=function(e){typeof e.length=="number"&&(e=ie.FileDescriptorSet.decode(e));var r=new rd;if(e.file)for(var o,s,a=0,i;a<e.file.length;++a){s=r,(o=e.file[a]).package&&o.package.length&&(s=r.define(o.package));var n=Zwe(o);if(o.name&&o.name.length&&r.files.push(s.filename=o.name),o.messageType)for(i=0;i<o.messageType.length;++i)s.add(Xn.fromDescriptor(o.messageType[i],n));if(o.enumType)for(i=0;i<o.enumType.length;++i)s.add(Ni.fromDescriptor(o.enumType[i],n));if(o.extension)for(i=0;i<o.extension.length;++i)s.add(fo.fromDescriptor(o.extension[i],n));if(o.service)for(i=0;i<o.service.length;++i)s.add(nd.fromDescriptor(o.service[i],n));var c=xc(o.options,ie.FileOptions);if(c){var u=Object.keys(c);for(i=0;i<u.length;++i)s.setOption(u[i],c[u[i]])}}return r.resolveAll()};rd.prototype.toDescriptor=function(e){var r=ie.FileDescriptorSet.create();return C9(this,r.file,e),r};function C9(t,e,r){var o=ie.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});eLe(r,o),t instanceof rd||(o.package=t.fullName.substring(1));for(var s=0,a;s<t.nestedArray.length;++s)(a=t._nestedArray[s])instanceof Xn?o.messageType.push(a.toDescriptor(r)):a instanceof Ni?o.enumType.push(a.toDescriptor()):a instanceof fo?o.extension.push(a.toDescriptor(r)):a instanceof nd?o.service.push(a.toDescriptor()):a instanceof P9&&C9(a,e,r);o.options=wc(t.options,ie.FileOptions),o.messageType.length+o.enumType.length+o.extension.length+o.service.length&&e.push(o)}var Hwe=0;Xn.fromDescriptor=function(e,r,o){typeof e.length=="number"&&(e=ie.DescriptorProto.decode(e));var s=new Xn(e.name.length?e.name:"Type"+Hwe++,xc(e.options,ie.MessageOptions)),a;if(o||(s._edition=r),e.oneofDecl)for(a=0;a<e.oneofDecl.length;++a)s.add(vS.fromDescriptor(e.oneofDecl[a]));if(e.field)for(a=0;a<e.field.length;++a){var i=fo.fromDescriptor(e.field[a],r,!0);s.add(i),e.field[a].hasOwnProperty("oneofIndex")&&s.oneofsArray[e.field[a].oneofIndex].add(i)}if(e.extension)for(a=0;a<e.extension.length;++a)s.add(fo.fromDescriptor(e.extension[a],r,!0));if(e.nestedType)for(a=0;a<e.nestedType.length;++a)s.add(Xn.fromDescriptor(e.nestedType[a],r,!0)),e.nestedType[a].options&&e.nestedType[a].options.mapEntry&&s.setOption("map_entry",!0);if(e.enumType)for(a=0;a<e.enumType.length;++a)s.add(Ni.fromDescriptor(e.enumType[a],r,!0));if(e.extensionRange&&e.extensionRange.length)for(s.extensions=[],a=0;a<e.extensionRange.length;++a)s.extensions.push([e.extensionRange[a].start,e.extensionRange[a].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(s.reserved=[],e.reservedRange)for(a=0;a<e.reservedRange.length;++a)s.reserved.push([e.reservedRange[a].start,e.reservedRange[a].end]);if(e.reservedName)for(a=0;a<e.reservedName.length;++a)s.reserved.push(e.reservedName[a])}return s};Xn.prototype.toDescriptor=function(e){var r=ie.DescriptorProto.create({name:this.name}),o;for(o=0;o<this.fieldsArray.length;++o){var s;if(r.field.push(s=this._fieldsArray[o].toDescriptor(e)),this._fieldsArray[o]instanceof jwe){var a=cI(this._fieldsArray[o].keyType,this._fieldsArray[o].resolvedKeyType,!1),i=cI(this._fieldsArray[o].type,this._fieldsArray[o].resolvedType,!1),n=i===11||i===14?this._fieldsArray[o].resolvedType&&I9(this.parent,this._fieldsArray[o].resolvedType)||this._fieldsArray[o].type:void 0;r.nestedType.push(ie.DescriptorProto.create({name:s.typeName,field:[ie.FieldDescriptorProto.create({name:"key",number:1,label:1,type:a}),ie.FieldDescriptorProto.create({name:"value",number:2,label:1,type:i,typeName:n})],options:ie.MessageOptions.create({mapEntry:!0})}))}}for(o=0;o<this.oneofsArray.length;++o)r.oneofDecl.push(this._oneofsArray[o].toDescriptor());for(o=0;o<this.nestedArray.length;++o)this._nestedArray[o]instanceof fo?r.field.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Xn?r.nestedType.push(this._nestedArray[o].toDescriptor(e)):this._nestedArray[o]instanceof Ni&&r.enumType.push(this._nestedArray[o].toDescriptor());if(this.extensions)for(o=0;o<this.extensions.length;++o)r.extensionRange.push(ie.DescriptorProto.ExtensionRange.create({start:this.extensions[o][0],end:this.extensions[o][1]}));if(this.reserved)for(o=0;o<this.reserved.length;++o)typeof this.reserved[o]=="string"?r.reservedName.push(this.reserved[o]):r.reservedRange.push(ie.DescriptorProto.ReservedRange.create({start:this.reserved[o][0],end:this.reserved[o][1]}));return r.options=wc(this.options,ie.MessageOptions),r};var zwe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;fo.fromDescriptor=function(e,r,o){if(typeof e.length=="number"&&(e=ie.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var s;e.typeName&&e.typeName.length?s=e.typeName:s=Xwe(e.type);var a;switch(e.label){case 1:a=void 0;break;case 2:a="required";break;case 3:a="repeated";break;default:throw Error("illegal label: "+e.label)}var i=e.extendee;e.extendee!==void 0&&(i=i.length?i:void 0);var n=new fo(e.name.length?e.name:"field"+e.number,e.number,s,a,i);if(o||(n._edition=r),n.options=xc(e.options,ie.FieldOptions),e.proto3_optional&&(n.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var c=e.defaultValue;switch(c){case"true":case"TRUE":c=!0;break;case"false":case"FALSE":c=!1;break;default:var u=zwe.exec(c);u&&(c=parseInt(c));break}n.setOption("default",c)}return Jwe(e.type)&&(r==="proto3"?e.options&&!e.options.packed&&n.setOption("packed",!1):(!r||r==="proto2")&&e.options&&e.options.packed&&n.setOption("packed",!0)),n};fo.prototype.toDescriptor=function(e){var r=ie.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=lr.util.ucFirst(this.name),r.label=3;else{switch(r.type=cI(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?I9(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&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(r.options=wc(this.options,ie.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=ie.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((r.options||(r.options=ie.FieldOptions.create())).packed=!0),r};var $we=0;Ni.fromDescriptor=function(e,r,o){typeof e.length=="number"&&(e=ie.EnumDescriptorProto.decode(e));var s={};if(e.value)for(var a=0;a<e.value.length;++a){var i=e.value[a].name,n=e.value[a].number||0;s[i&&i.length?i:"NAME"+n]=n}var c=new Ni(e.name&&e.name.length?e.name:"Enum"+$we++,s,xc(e.options,ie.EnumOptions));return o||(c._edition=r),c};Ni.prototype.toDescriptor=function(){for(var e=[],r=0,o=Object.keys(this.values);r<o.length;++r)e.push(ie.EnumValueDescriptorProto.create({name:o[r],number:this.values[o[r]]}));return ie.EnumDescriptorProto.create({name:this.name,value:e,options:wc(this.options,ie.EnumOptions)})};var Ywe=0;vS.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ie.OneofDescriptorProto.decode(e)),new vS(e.name&&e.name.length?e.name:"oneof"+Ywe++)};vS.prototype.toDescriptor=function(){return ie.OneofDescriptorProto.create({name:this.name})};var Wwe=0;nd.fromDescriptor=function(e,r,o){typeof e.length=="number"&&(e=ie.ServiceDescriptorProto.decode(e));var s=new nd(e.name&&e.name.length?e.name:"Service"+Wwe++,xc(e.options,ie.ServiceOptions));if(o||(s._edition=r),e.method)for(var a=0;a<e.method.length;++a)s.add(AS.fromDescriptor(e.method[a]));return s};nd.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return ie.ServiceDescriptorProto.create({name:this.name,method:e,options:wc(this.options,ie.ServiceOptions)})};var Kwe=0;AS.fromDescriptor=function(e){return typeof e.length=="number"&&(e=ie.MethodDescriptorProto.decode(e)),new AS(e.name&&e.name.length?e.name:"Method"+Kwe++,"rpc",e.inputType,e.outputType,!!e.clientStreaming,!!e.serverStreaming,xc(e.options,ie.MethodOptions))};AS.prototype.toDescriptor=function(){return ie.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:wc(this.options,ie.MethodOptions)})};function Xwe(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 Jwe(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 cI(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 Ni)return 14;if(e instanceof Xn)return r?10:11;throw Error("illegal type: "+t)}function N9(t,e){for(var r={},o=0,s,a;o<e.fieldsArray.length;++o)if((a=(s=e._fieldsArray[o]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(t,a)){var i=Qwe(a);s.resolvedType instanceof Xn?r[i]=N9(t[a],s.resolvedType):s.resolvedType instanceof Ni?r[i]=s.resolvedType.valuesById[t[a]]:r[i]=t[a]}return r}function xc(t,e){if(t)return N9(e.toObject(t),e)}function M9(t,e){for(var r={},o=Object.keys(t),s=0;s<o.length;++s){var a=o[s],i=lr.util.camelCase(a);if(Object.prototype.hasOwnProperty.call(e.fields,i)){var n=e.fields[i];n.resolvedType instanceof Xn?r[i]=M9(t[a],n.resolvedType):r[i]=t[a],n.repeated&&!Array.isArray(r[i])&&(r[i]=[r[i]])}}return r}function wc(t,e){if(t)return e.fromObject(M9(t,e))}function I9(t,e){var r=t.fullName.split("."),o=e.fullName.split("."),s=0,a=0,i=o.length-1;if(!(t instanceof rd)&&e instanceof P9)for(;s<r.length&&a<i&&r[s]===o[a];){var n=e.lookup(r[s++],!0);if(n!==null&&n!==e)break;++a}else for(;s<r.length&&a<i&&r[s]===o[a];++s,++a);return o.slice(a).join(".")}function Qwe(t){return t.substring(0,1)+t.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,r){return"_"+r.toLowerCase()})}function Zwe(t){if(t.syntax==="editions")switch(t.edition){case ie.Edition.EDITION_2023:return"2023";default:throw new Error("Unsupported edition "+t.edition)}return t.syntax==="proto3"?"proto3":"proto2"}function eLe(t,e){if(t)if(t==="proto2"||t==="proto3")e.syntax=t;else switch(e.syntax="editions",t){case"2023":e.edition=ie.Edition.EDITION_2023;break;default:throw new Error("Unsupported edition "+t)}}});var L9=p((Ftt,tLe)=>{tLe.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 D9=p((Vtt,rLe)=>{rLe.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var U9=p((Gtt,nLe)=>{nLe.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 V9=p(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.addCommonProtos=ho.loadProtosWithOptionsSync=ho.loadProtosWithOptions=void 0;var k9=require("fs"),B9=require("path"),Lc=yS();function F9(t,e){let r=t.resolvePath;t.resolvePath=(o,s)=>{if(B9.isAbsolute(s))return s;for(let a of e){let i=B9.join(a,s);try{return k9.accessSync(i,k9.constants.R_OK),i}catch{continue}}return process.emitWarning(`${s} not found in any of the include paths ${e}`),r(o,s)}}async function iLe(t,e){let r=new Lc.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));F9(r,e.includeDirs)}let o=await r.load(t,e);return o.resolveAll(),o}ho.loadProtosWithOptions=iLe;function oLe(t,e){let r=new Lc.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");F9(r,e.includeDirs)}let o=r.loadSync(t,e);return o.resolveAll(),o}ho.loadProtosWithOptionsSync=oLe;function sLe(){let t=L9(),e=aI(),r=D9(),o=U9();Lc.common("api",t.nested.google.nested.protobuf.nested),Lc.common("descriptor",e.nested.google.nested.protobuf.nested),Lc.common("source_context",r.nested.google.nested.protobuf.nested),Lc.common("type",o.nested.google.nested.protobuf.nested)}ho.addCommonProtos=sLe});var G9=p((id,uI)=>{(function(t,e){function r(o){return o.default||o}typeof define=="function"&&define.amd?define([],function(){var o={};return e(o),r(o)}):typeof id=="object"?(e(id),typeof uI=="object"&&(uI.exports=r(id))):(function(){var o={};e(o),t.Long=r(o)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:id,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(M,_,D){this.low=M|0,this.high=_|0,this.unsigned=!!D}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function o(M){return(M&&M.__isLong__)===!0}function s(M){var _=Math.clz32(M&-M);return M?31-_:_}r.isLong=o;var a={},i={};function n(M,_){var D,ce,ae;return _?(M>>>=0,(ae=0<=M&&M<256)&&(ce=i[M],ce)?ce:(D=u(M,0,!0),ae&&(i[M]=D),D)):(M|=0,(ae=-128<=M&&M<128)&&(ce=a[M],ce)?ce:(D=u(M,M<0?-1:0,!1),ae&&(a[M]=D),D))}r.fromInt=n;function c(M,_){if(isNaN(M))return _?A:j;if(_){if(M<0)return A;if(M>=v)return te}else{if(M<=-O)return Z;if(M+1>=O)return oe}return M<0?c(-M,_).neg():u(M%S|0,M/S|0,_)}r.fromNumber=c;function u(M,_,D){return new r(M,_,D)}r.fromBits=u;var l=Math.pow;function d(M,_,D){if(M.length===0)throw Error("empty string");if(typeof _=="number"?(D=_,_=!1):_=!!_,M==="NaN"||M==="Infinity"||M==="+Infinity"||M==="-Infinity")return _?A:j;if(D=D||10,D<2||36<D)throw RangeError("radix");var ce;if((ce=M.indexOf("-"))>0)throw Error("interior hyphen");if(ce===0)return d(M.substring(1),_,D).neg();for(var ae=c(l(D,8)),ge=j,Le=0;Le<M.length;Le+=8){var gt=Math.min(8,M.length-Le),It=parseInt(M.substring(Le,Le+gt),D);if(gt<8){var Xe=c(l(D,gt));ge=ge.mul(Xe).add(c(It))}else ge=ge.mul(ae),ge=ge.add(c(It))}return ge.unsigned=_,ge}r.fromString=d;function h(M,_){return typeof M=="number"?c(M,_):typeof M=="string"?d(M,_):u(M.low,M.high,typeof _=="boolean"?_:M.unsigned)}r.fromValue=h;var g=65536,E=1<<24,S=g*g,v=S*S,O=v/2,I=n(E),j=n(0);r.ZERO=j;var A=n(0,!0);r.UZERO=A;var z=n(1);r.ONE=z;var H=n(1,!0);r.UONE=H;var Q=n(-1);r.NEG_ONE=Q;var oe=u(-1,2147483647,!1);r.MAX_VALUE=oe;var te=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=te;var Z=u(0,-2147483648,!1);r.MIN_VALUE=Z;var R=r.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*S+(this.low>>>0):this.high*S+(this.low>>>0)},R.toString=function(_){if(_=_||10,_<2||36<_)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Z)){var D=c(_),ce=this.div(D),ae=ce.mul(D).sub(this);return ce.toString(_)+ae.toInt().toString(_)}else return"-"+this.neg().toString(_);for(var ge=c(l(_,6),this.unsigned),Le=this,gt="";;){var It=Le.div(ge),Xe=Le.sub(It.mul(ge)).toInt()>>>0,pe=Xe.toString(_);if(Le=It,Le.isZero())return pe+gt;for(;pe.length<6;)pe="0"+pe;gt=""+pe+gt}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Z)?64:this.neg().getNumBitsAbs();for(var _=this.high!=0?this.high:this.low,D=31;D>0&&(_&1<<D)==0;D--);return this.high!=0?D+33:D+1},R.isSafeInteger=function(){var _=this.high>>21;return _?this.unsigned?!1:_===-1&&!(this.low===0&&this.high===-2097152):!0},R.isZero=function(){return this.high===0&&this.low===0},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return(this.low&1)===1},R.isEven=function(){return(this.low&1)===0},R.equals=function(_){return o(_)||(_=h(_)),this.unsigned!==_.unsigned&&this.high>>>31===1&&_.high>>>31===1?!1:this.high===_.high&&this.low===_.low},R.eq=R.equals,R.notEquals=function(_){return!this.eq(_)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(_){return this.comp(_)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(_){return this.comp(_)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(_){return this.comp(_)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(_){return this.comp(_)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(_){if(o(_)||(_=h(_)),this.eq(_))return 0;var D=this.isNegative(),ce=_.isNegative();return D&&!ce?-1:!D&&ce?1:this.unsigned?_.high>>>0>this.high>>>0||_.high===this.high&&_.low>>>0>this.low>>>0?-1:1:this.sub(_).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(Z)?Z:this.not().add(z)},R.neg=R.negate,R.add=function(_){o(_)||(_=h(_));var D=this.high>>>16,ce=this.high&65535,ae=this.low>>>16,ge=this.low&65535,Le=_.high>>>16,gt=_.high&65535,It=_.low>>>16,Xe=_.low&65535,pe=0,xt=0,Ce=0,wt=0;return wt+=ge+Xe,Ce+=wt>>>16,wt&=65535,Ce+=ae+It,xt+=Ce>>>16,Ce&=65535,xt+=ce+gt,pe+=xt>>>16,xt&=65535,pe+=D+Le,pe&=65535,u(Ce<<16|wt,pe<<16|xt,this.unsigned)},R.subtract=function(_){return o(_)||(_=h(_)),this.add(_.neg())},R.sub=R.subtract,R.multiply=function(_){if(this.isZero())return this;if(o(_)||(_=h(_)),e){var D=e.mul(this.low,this.high,_.low,_.high);return u(D,e.get_high(),this.unsigned)}if(_.isZero())return this.unsigned?A:j;if(this.eq(Z))return _.isOdd()?Z:j;if(_.eq(Z))return this.isOdd()?Z:j;if(this.isNegative())return _.isNegative()?this.neg().mul(_.neg()):this.neg().mul(_).neg();if(_.isNegative())return this.mul(_.neg()).neg();if(this.lt(I)&&_.lt(I))return c(this.toNumber()*_.toNumber(),this.unsigned);var ce=this.high>>>16,ae=this.high&65535,ge=this.low>>>16,Le=this.low&65535,gt=_.high>>>16,It=_.high&65535,Xe=_.low>>>16,pe=_.low&65535,xt=0,Ce=0,wt=0,ui=0;return ui+=Le*pe,wt+=ui>>>16,ui&=65535,wt+=ge*pe,Ce+=wt>>>16,wt&=65535,wt+=Le*Xe,Ce+=wt>>>16,wt&=65535,Ce+=ae*pe,xt+=Ce>>>16,Ce&=65535,Ce+=ge*Xe,xt+=Ce>>>16,Ce&=65535,Ce+=Le*It,xt+=Ce>>>16,Ce&=65535,xt+=ce*pe+ae*Xe+ge*It+Le*gt,xt&=65535,u(wt<<16|ui,xt<<16|Ce,this.unsigned)},R.mul=R.multiply,R.divide=function(_){if(o(_)||(_=h(_)),_.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&_.low===-1&&_.high===-1)return this;var D=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,_.low,_.high);return u(D,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?A:j;var ce,ae,ge;if(this.unsigned){if(_.unsigned||(_=_.toUnsigned()),_.gt(this))return A;if(_.gt(this.shru(1)))return H;ge=A}else{if(this.eq(Z)){if(_.eq(z)||_.eq(Q))return Z;if(_.eq(Z))return z;var Le=this.shr(1);return ce=Le.div(_).shl(1),ce.eq(j)?_.isNegative()?z:Q:(ae=this.sub(_.mul(ce)),ge=ce.add(ae.div(_)),ge)}else if(_.eq(Z))return this.unsigned?A:j;if(this.isNegative())return _.isNegative()?this.neg().div(_.neg()):this.neg().div(_).neg();if(_.isNegative())return this.div(_.neg()).neg();ge=j}for(ae=this;ae.gte(_);){ce=Math.max(1,Math.floor(ae.toNumber()/_.toNumber()));for(var gt=Math.ceil(Math.log(ce)/Math.LN2),It=gt<=48?1:l(2,gt-48),Xe=c(ce),pe=Xe.mul(_);pe.isNegative()||pe.gt(ae);)ce-=It,Xe=c(ce,this.unsigned),pe=Xe.mul(_);Xe.isZero()&&(Xe=z),ge=ge.add(Xe),ae=ae.sub(pe)}return ge},R.div=R.divide,R.modulo=function(_){if(o(_)||(_=h(_)),e){var D=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,_.low,_.high);return u(D,e.get_high(),this.unsigned)}return this.sub(this.div(_).mul(_))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return u(~this.low,~this.high,this.unsigned)},R.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},R.clz=R.countLeadingZeros,R.countTrailingZeros=function(){return this.low?s(this.low):s(this.high)+32},R.ctz=R.countTrailingZeros,R.and=function(_){return o(_)||(_=h(_)),u(this.low&_.low,this.high&_.high,this.unsigned)},R.or=function(_){return o(_)||(_=h(_)),u(this.low|_.low,this.high|_.high,this.unsigned)},R.xor=function(_){return o(_)||(_=h(_)),u(this.low^_.low,this.high^_.high,this.unsigned)},R.shiftLeft=function(_){return o(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?u(this.low<<_,this.high<<_|this.low>>>32-_,this.unsigned):u(0,this.low<<_-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(_){return o(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?u(this.low>>>_|this.high<<32-_,this.high>>_,this.unsigned):u(this.high>>_-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(_){return o(_)&&(_=_.toInt()),(_&=63)===0?this:_<32?u(this.low>>>_|this.high<<32-_,this.high>>>_,this.unsigned):_===32?u(this.high,0,this.unsigned):u(this.high>>>_-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.rotateLeft=function(_){var D;return o(_)&&(_=_.toInt()),(_&=63)===0?this:_===32?u(this.high,this.low,this.unsigned):_<32?(D=32-_,u(this.low<<_|this.high>>>D,this.high<<_|this.low>>>D,this.unsigned)):(_-=32,D=32-_,u(this.high<<_|this.low>>>D,this.low<<_|this.high>>>D,this.unsigned))},R.rotl=R.rotateLeft,R.rotateRight=function(_){var D;return o(_)&&(_=_.toInt()),(_&=63)===0?this:_===32?u(this.high,this.low,this.unsigned):_<32?(D=32-_,u(this.high<<D|this.low>>>_,this.low<<D|this.high>>>_,this.unsigned)):(_-=32,D=32-_,u(this.low<<D|this.high>>>_,this.high<<D|this.low>>>_,this.unsigned))},R.rotr=R.rotateRight,R.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},R.toBytes=function(_){return _?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var _=this.high,D=this.low;return[D&255,D>>>8&255,D>>>16&255,D>>>24,_&255,_>>>8&255,_>>>16&255,_>>>24]},R.toBytesBE=function(){var _=this.high,D=this.low;return[_>>>24,_>>>16&255,_>>>8&255,_&255,D>>>24,D>>>16&255,D>>>8&255,D&255]},r.fromBytes=function(_,D,ce){return ce?r.fromBytesLE(_,D):r.fromBytesBE(_,D)},r.fromBytesLE=function(_,D){return new r(_[0]|_[1]<<8|_[2]<<16|_[3]<<24,_[4]|_[5]<<8|_[6]<<16|_[7]<<24,D)},r.fromBytesBE=function(_,D){return new r(_[4]<<24|_[5]<<16|_[6]<<8|_[7],_[0]<<24|_[1]<<16|_[2]<<8|_[3],D)},typeof BigInt=="function"&&(r.fromBigInt=function(_,D){var ce=Number(BigInt.asIntN(32,_)),ae=Number(BigInt.asIntN(32,_>>BigInt(32)));return u(ce,ae,D)},r.fromValue=function(_,D){return typeof _=="bigint"?r.fromBigInt(_,D):h(_,D)},R.toBigInt=function(){var _=BigInt(this.low>>>0),D=BigInt(this.unsigned?this.high>>>0:this.high);return D<<BigInt(32)|_});var Mt=t.default=r})});var mI=p(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.loadFileDescriptorSetFromObject=We.loadFileDescriptorSetFromBuffer=We.fromJSON=We.loadSync=We.load=We.IdempotencyLevel=We.isAnyExtension=We.Long=void 0;var aLe=O5(),Jn=yS(),fI=w9(),hI=V9(),cLe=G9();We.Long=cLe;function uLe(t){return"@type"in t&&typeof t["@type"]=="string"}We.isAnyExtension=uLe;var q9;(function(t){t.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",t.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",t.IDEMPOTENT="IDEMPOTENT"})(q9=We.IdempotencyLevel||(We.IdempotencyLevel={}));var j9={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function lLe(t,e){return t===""?e:t+"."+e}function dLe(t){return t instanceof Jn.Service||t instanceof Jn.Type||t instanceof Jn.Enum}function pLe(t){return t instanceof Jn.Namespace||t instanceof Jn.Root}function H9(t,e){let r=lLe(e,t.name);return dLe(t)?[[r,t]]:pLe(t)&&typeof t.nested<"u"?Object.keys(t.nested).map(o=>H9(t.nested[o],r)).reduce((o,s)=>o.concat(s),[]):[]}function lI(t,e){return function(o){return t.toObject(t.decode(o),e)}}function dI(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 o=t.fromObject(r);return t.encode(o).finish()}}function fLe(t){return(t||[]).reduce((e,r)=>{for(let[o,s]of Object.entries(r))switch(o){case"uninterpreted_option":e.uninterpreted_option.push(r.uninterpreted_option);break;default:e[o]=s}return e},{deprecated:!1,idempotency_level:q9.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function hLe(t,e,r,o){let s=t.resolvedRequestType,a=t.resolvedResponseType;return{path:"/"+e+"/"+t.name,requestStream:!!t.requestStream,responseStream:!!t.responseStream,requestSerialize:dI(s),requestDeserialize:lI(s,r),responseSerialize:dI(a),responseDeserialize:lI(a,r),originalName:aLe(t.name),requestType:pI(s,r,o),responseType:pI(a,r,o),options:fLe(t.parsedOptions)}}function mLe(t,e,r,o){let s={};for(let a of t.methodsArray)s[a.name]=hLe(a,e,r,o);return s}function pI(t,e,r){let o=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:o.$type.toObject(o,j9),fileDescriptorProtos:r,serialize:dI(t),deserialize:lI(t,e)}}function _Le(t,e){let r=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:r.$type.toObject(r,j9),fileDescriptorProtos:e}}function gLe(t,e,r,o){if(t instanceof Jn.Service)return mLe(t,e,r,o);if(t instanceof Jn.Type)return pI(t,r,o);if(t instanceof Jn.Enum)return _Le(t,o);throw new Error("Type mismatch in reflection object handling")}function OS(t,e){let r={};t.resolveAll();let s=t.toDescriptor("proto3").file.map(a=>Buffer.from(fI.FileDescriptorProto.encode(a).finish()));for(let[a,i]of H9(t,""))r[a]=gLe(i,a,e,s);return r}function z9(t,e){e=e||{};let r=Jn.Root.fromDescriptor(t);return r.resolveAll(),OS(r,e)}function ELe(t,e){return(0,hI.loadProtosWithOptions)(t,e).then(r=>OS(r,e))}We.load=ELe;function SLe(t,e){let r=(0,hI.loadProtosWithOptionsSync)(t,e);return OS(r,e)}We.loadSync=SLe;function TLe(t,e){e=e||{};let r=Jn.Root.fromJSON(t);return r.resolveAll(),OS(r,e)}We.fromJSON=TLe;function yLe(t,e){let r=fI.FileDescriptorSet.decode(t);return z9(r,e)}We.loadFileDescriptorSetFromBuffer=yLe;function vLe(t,e){let r=fI.FileDescriptorSet.fromObject(t);return z9(r,e)}We.loadFileDescriptorSetFromObject=vLe;(0,hI.addCommonProtos)()});var mo=p(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.registerChannelzSocket=Oe.registerChannelzServer=Oe.registerChannelzSubchannel=Oe.registerChannelzChannel=Oe.ChannelzCallTrackerStub=Oe.ChannelzCallTracker=Oe.ChannelzChildrenTrackerStub=Oe.ChannelzChildrenTracker=Oe.ChannelzTrace=Oe.ChannelzTraceStub=void 0;Oe.unregisterChannelzRef=PLe;Oe.getChannelzHandlers=Z9;Oe.getChannelzServiceDefinition=eJ;Oe.setup=BLe;var RS=require("net"),As=YX(),od=Ft(),sd=se(),ALe=Jt(),OLe=KE(),bLe=eS();function _I(t){return{channel_id:t.id,name:t.name}}function yI(t){return{subchannel_id:t.id,name:t.name}}function RLe(t){return{server_id:t.id}}function NS(t){return{socket_id:t.id,name:t.name}}var $9=32,vI=100,gI=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Qn(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Oe.ChannelzTraceStub=gI;var EI=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,r,o){let s=new Date;this.events.push({description:r,severity:e,timestamp:s,childChannel:o?.kind==="channel"?o:void 0,childSubchannel:o?.kind==="subchannel"?o:void 0}),this.events.length>=$9*2&&(this.events=this.events.slice($9)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Qn(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Qn(e.timestamp),channel_ref:e.childChannel?_I(e.childChannel):null,subchannel_ref:e.childSubchannel?yI(e.childSubchannel):null}))}}};Oe.ChannelzTrace=EI;var PS=class{constructor(){this.channelChildren=new As.OrderedMap,this.subchannelChildren=new As.OrderedMap,this.socketChildren=new As.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let r=this.trackerMap[e.kind],o=r.find(e.id);o.equals(r.end())?r.setElement(e.id,{ref:e,count:1},o):o.pointer[1].count+=1}unrefChild(e){let r=this.trackerMap[e.kind],o=r.getElementByKey(e.id);o!==void 0&&(o.count-=1,o.count===0&&r.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Oe.ChannelzChildrenTracker=PS;var SI=class extends PS{refChild(){}unrefChild(){}};Oe.ChannelzChildrenTrackerStub=SI;var CS=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}};Oe.ChannelzCallTracker=CS;var TI=class extends CS{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Oe.ChannelzCallTrackerStub=TI;var Mi={channel:new As.OrderedMap,subchannel:new As.OrderedMap,server:new As.OrderedMap,socket:new As.OrderedMap},MS=t=>{let e=1;function r(){return e++}let o=Mi[t];return(s,a,i)=>{let n=r(),c={id:n,name:s,kind:t};return i&&o.setElement(n,{ref:c,getInfo:a}),c}};Oe.registerChannelzChannel=MS("channel");Oe.registerChannelzSubchannel=MS("subchannel");Oe.registerChannelzServer=MS("server");Oe.registerChannelzSocket=MS("socket");function PLe(t){Mi[t.kind].eraseElementByKey(t.id)}function CLe(t){let e=Number.parseInt(t,16);return[e/256|0,e%256]}function Y9(t){if(t==="")return[];let e=t.split(":").map(o=>CLe(o));return[].concat(...e)}function NLe(t){return(0,RS.isIPv6)(t)&&t.toLowerCase().startsWith("::ffff:")&&(0,RS.isIPv4)(t.substring(7))}function W9(t){return Buffer.from(Uint8Array.from(t.split(".").map(e=>Number.parseInt(e))))}function MLe(t){if((0,RS.isIPv4)(t))return W9(t);if(NLe(t))return W9(t.substring(7));if((0,RS.isIPv6)(t)){let e,r,o=t.indexOf("::");o===-1?(e=t,r=""):(e=t.substring(0,o),r=t.substring(o+2));let s=Buffer.from(Y9(e)),a=Buffer.from(Y9(r)),i=Buffer.alloc(16-s.length-a.length,0);return Buffer.concat([s,i,a])}else return null}function X9(t){switch(t){case od.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case od.ConnectivityState.IDLE:return{state:"IDLE"};case od.ConnectivityState.READY:return{state:"READY"};case od.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case od.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Qn(t){if(!t)return null;let e=t.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function J9(t){let e=t.getInfo(),r=[],o=[];return e.children.channels.forEach(s=>{r.push(_I(s[1].ref))}),e.children.subchannels.forEach(s=>{o.push(yI(s[1].ref))}),{ref:_I(t.ref),data:{target:e.target,state:X9(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Qn(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:r,subchannel_ref:o}}function ILe(t,e){let r=parseInt(t.request.channel_id,10),o=Mi.channel.getElementByKey(r);if(o===void 0){e({code:sd.Status.NOT_FOUND,details:"No channel data found for id "+r});return}e(null,{channel:J9(o)})}function xLe(t,e){let r=parseInt(t.request.max_results,10)||vI,o=[],s=parseInt(t.request.start_channel_id,10),a=Mi.channel,i;for(i=a.lowerBound(s);!i.equals(a.end())&&o.length<r;i=i.next())o.push(J9(i.pointer[1]));e(null,{channel:o,end:i.equals(a.end())})}function Q9(t){let e=t.getInfo(),r=[];return e.listenerChildren.sockets.forEach(o=>{r.push(NS(o[1].ref))}),{ref:RLe(t.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Qn(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:r}}function wLe(t,e){let r=parseInt(t.request.server_id,10),s=Mi.server.getElementByKey(r);if(s===void 0){e({code:sd.Status.NOT_FOUND,details:"No server data found for id "+r});return}e(null,{server:Q9(s)})}function LLe(t,e){let r=parseInt(t.request.max_results,10)||vI,o=parseInt(t.request.start_server_id,10),s=Mi.server,a=[],i;for(i=s.lowerBound(o);!i.equals(s.end())&&a.length<r;i=i.next())a.push(Q9(i.pointer[1]));e(null,{server:a,end:i.equals(s.end())})}function DLe(t,e){let r=parseInt(t.request.subchannel_id,10),o=Mi.subchannel.getElementByKey(r);if(o===void 0){e({code:sd.Status.NOT_FOUND,details:"No subchannel data found for id "+r});return}let s=o.getInfo(),a=[];s.children.sockets.forEach(n=>{a.push(NS(n[1].ref))});let i={ref:yI(o.ref),data:{target:s.target,state:X9(s.state),calls_started:s.callTracker.callsStarted,calls_succeeded:s.callTracker.callsSucceeded,calls_failed:s.callTracker.callsFailed,last_call_started_timestamp:Qn(s.callTracker.lastCallStartedTimestamp),trace:s.trace.getTraceMessage()},socket_ref:a};e(null,{subchannel:i})}function K9(t){var e;return(0,ALe.isTcpSubchannelAddress)(t)?{address:"tcpip_address",tcpip_address:{ip_address:(e=MLe(t.host))!==null&&e!==void 0?e:void 0,port:t.port}}:{address:"uds_address",uds_address:{filename:t.path}}}function ULe(t,e){var r,o,s,a,i;let n=parseInt(t.request.socket_id,10),c=Mi.socket.getElementByKey(n);if(c===void 0){e({code:sd.Status.NOT_FOUND,details:"No socket data found for id "+n});return}let u=c.getInfo(),l=u.security?{model:"tls",tls:{cipher_suite:u.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(r=u.security.cipherSuiteStandardName)!==null&&r!==void 0?r:void 0,other_name:(o=u.security.cipherSuiteOtherName)!==null&&o!==void 0?o:void 0,local_certificate:(s=u.security.localCertificate)!==null&&s!==void 0?s:void 0,remote_certificate:(a=u.security.remoteCertificate)!==null&&a!==void 0?a:void 0}}:null,d={ref:NS(c.ref),local:u.localAddress?K9(u.localAddress):null,remote:u.remoteAddress?K9(u.remoteAddress):null,remote_name:(i=u.remoteName)!==null&&i!==void 0?i:void 0,security:l,data:{keep_alives_sent:u.keepAlivesSent,streams_started:u.streamsStarted,streams_succeeded:u.streamsSucceeded,streams_failed:u.streamsFailed,last_local_stream_created_timestamp:Qn(u.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Qn(u.lastRemoteStreamCreatedTimestamp),messages_received:u.messagesReceived,messages_sent:u.messagesSent,last_message_received_timestamp:Qn(u.lastMessageReceivedTimestamp),last_message_sent_timestamp:Qn(u.lastMessageSentTimestamp),local_flow_control_window:u.localFlowControlWindow?{value:u.localFlowControlWindow}:null,remote_flow_control_window:u.remoteFlowControlWindow?{value:u.remoteFlowControlWindow}:null}};e(null,{socket:d})}function kLe(t,e){let r=parseInt(t.request.server_id,10),o=Mi.server.getElementByKey(r);if(o===void 0){e({code:sd.Status.NOT_FOUND,details:"No server data found for id "+r});return}let s=parseInt(t.request.start_socket_id,10),a=parseInt(t.request.max_results,10)||vI,n=o.getInfo().sessionChildren.sockets,c=[],u;for(u=n.lowerBound(s);!u.equals(n.end())&&c.length<a;u=u.next())c.push(NS(u.pointer[1].ref));e(null,{socket_ref:c,end:u.equals(n.end())})}function Z9(){return{GetChannel:ILe,GetTopChannels:xLe,GetServer:wLe,GetServers:LLe,GetSubchannel:DLe,GetSocket:ULe,GetServerSockets:kLe}}var bS=null;function eJ(){if(bS)return bS;let t=mI().loadSync,e=t("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return bS=(0,bLe.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,bS}function BLe(){(0,OLe.registerAdminService)(eJ,Z9)}});var IS=p(AI=>{"use strict";Object.defineProperty(AI,"__esModule",{value:!0});AI.getNextCallNumber=VLe;var FLe=0;function VLe(){return FLe++}});var OI=p(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});xS.CompressionAlgorithms=void 0;var tJ;(function(t){t[t.identity=0]="identity",t[t.deflate=1]="deflate",t[t.gzip=2]="gzip"})(tJ||(xS.CompressionAlgorithms=tJ={}))});var RI=p(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});wS.BaseFilter=void 0;var bI=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};wS.BaseFilter=bI});var II=p(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.CompressionFilterFactory=kc.CompressionFilter=void 0;var LS=require("zlib"),nJ=OI(),Dc=se(),GLe=RI(),qLe=Ee(),jLe=t=>typeof t=="number"&&typeof nJ.CompressionAlgorithms[t]=="string",Uc=class{async writeMessage(e,r){let o=e;r&&(o=await this.compressMessage(o));let s=Buffer.allocUnsafe(o.length+5);return s.writeUInt8(r?1:0,0),s.writeUInt32BE(o.length,1),o.copy(s,5),s}async readMessage(e){let r=e.readUInt8(0)===1,o=e.slice(5);return r&&(o=await this.decompressMessage(o)),o}},Os=class extends Uc{async compressMessage(e){return e}async writeMessage(e,r){let o=Buffer.allocUnsafe(e.length+5);return o.writeUInt8(0,0),o.writeUInt32BE(e.length,1),e.copy(o,5),o}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},PI=class extends Uc{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,o)=>{LS.deflate(e,(s,a)=>{s?o(s):r(a)})})}decompressMessage(e){return new Promise((r,o)=>{let s=0,a=[],i=LS.createInflate();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Dc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{r(Buffer.concat(a))}),i.write(e),i.end()})}},CI=class extends Uc{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,o)=>{LS.gzip(e,(s,a)=>{s?o(s):r(a)})})}decompressMessage(e){return new Promise((r,o)=>{let s=0,a=[],i=LS.createGunzip();i.on("data",n=>{a.push(n),s+=n.byteLength,this.maxRecvMessageLength!==-1&&s>this.maxRecvMessageLength&&(i.destroy(),o({code:Dc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),i.on("end",()=>{r(Buffer.concat(a))}),i.write(e),i.end()})}},NI=class extends Uc{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 rJ(t,e){switch(t){case"identity":return new Os;case"deflate":return new PI(e);case"gzip":return new CI(e);default:return new NI(t)}}var DS=class extends GLe.BaseFilter{constructor(e,r){var o,s,a;super(),this.sharedFilterConfig=r,this.sendCompression=new Os,this.receiveCompression=new Os,this.currentCompressionAlgorithm="identity";let i=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(o=e["grpc.max_receive_message_length"])!==null&&o!==void 0?o:Dc.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(s=e["grpc.max_send_message_length"])!==null&&s!==void 0?s:Dc.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(jLe(i)){let n=nJ.CompressionAlgorithms[i],c=(a=r.serverSupportedEncodingHeader)===null||a===void 0?void 0:a.split(",");(!c||c.includes(n))&&(this.currentCompressionAlgorithm=n,this.sendCompression=rJ(this.currentCompressionAlgorithm,-1))}else qLe.log(Dc.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}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 s=r[0];typeof s=="string"&&(this.receiveCompression=rJ(s,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let o=e.get("grpc-accept-encoding")[0];return o&&(this.sharedFilterConfig.serverSupportedEncodingHeader=o,o.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new Os,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var r;let o=await e;if(this.maxSendMessageLength!==-1&&o.message.length>this.maxSendMessageLength)throw{code:Dc.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let s;return this.sendCompression instanceof Os?s=!1:s=(((r=o.flags)!==null&&r!==void 0?r:0)&2)===0,{message:await this.sendCompression.writeMessage(o.message,s),flags:o.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};kc.CompressionFilter=DS;var MI=class{constructor(e,r){this.options=r,this.sharedFilterConfig={}}createFilter(){return new DS(this.options,this.sharedFilterConfig)}};kc.CompressionFilterFactory=MI});var ad=p(xI=>{"use strict";Object.defineProperty(xI,"__esModule",{value:!0});xI.restrictControlPlaneStatusCode=zLe;var Zn=se(),HLe=[Zn.Status.OK,Zn.Status.INVALID_ARGUMENT,Zn.Status.NOT_FOUND,Zn.Status.ALREADY_EXISTS,Zn.Status.FAILED_PRECONDITION,Zn.Status.ABORTED,Zn.Status.OUT_OF_RANGE,Zn.Status.DATA_LOSS];function zLe(t,e){return HLe.includes(t)?{code:Zn.Status.INTERNAL,details:`Invalid status from control plane: ${t} ${Zn.Status[t]} ${e}`}:{code:t,details:e}}});var Bc=p(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.minDeadline=$Le;bs.getDeadlineTimeoutString=WLe;bs.getRelativeTimeout=XLe;bs.deadlineToString=JLe;bs.formatDateDifference=QLe;function $Le(...t){let e=1/0;for(let r of t){let o=r instanceof Date?r.getTime():r;o<e&&(e=o)}return e}var YLe=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function WLe(t){let e=new Date().getTime();t instanceof Date&&(t=t.getTime());let r=Math.max(t-e,0);for(let[o,s]of YLe){let a=r/s;if(a<1e8)return String(Math.ceil(a))+o}throw new Error("Deadline is too far in the future")}var KLe=2147483647;function XLe(t){let e=t instanceof Date?t.getTime():t,r=new Date().getTime(),o=e-r;return o<0?0:o>KLe?1/0:o}function JLe(t){if(t instanceof Date)return t.toISOString();{let e=new Date(t);return Number.isNaN(e.getTime())?""+t:e.toISOString()}}function QLe(t,e){return((e.getTime()-t.getTime())/1e3).toFixed(3)+"s"}});var kS=p(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.FilterStackFactory=Fc.FilterStack=void 0;var US=class{constructor(e){this.filters=e}sendMetadata(e){let r=e;for(let o=0;o<this.filters.length;o++)r=this.filters[o].sendMetadata(r);return r}receiveMetadata(e){let r=e;for(let o=this.filters.length-1;o>=0;o--)r=this.filters[o].receiveMetadata(r);return r}sendMessage(e){let r=e;for(let o=0;o<this.filters.length;o++)r=this.filters[o].sendMessage(r);return r}receiveMessage(e){let r=e;for(let o=this.filters.length-1;o>=0;o--)r=this.filters[o].receiveMessage(r);return r}receiveTrailers(e){let r=e;for(let o=this.filters.length-1;o>=0;o--)r=this.filters[o].receiveTrailers(r);return r}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Fc.FilterStack=US;var wI=class t{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new t([...this.factories])}createFilter(){return new US(this.factories.map(e=>e.createFilter()))}};Fc.FilterStackFactory=wI});var iJ=p(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});FS.SingleSubchannelChannel=void 0;var ZLe=IS(),cd=mo(),eDe=II(),tDe=Ft(),ud=se(),rDe=ad(),nDe=Bc(),iDe=kS(),LI=nt(),oDe=$r(),BS=Bt(),DI=class{constructor(e,r,o,s,a){var i,n;this.subchannel=e,this.method=r,this.options=s,this.callNumber=a,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("/"),u="";c.length>=2&&(u=c[1]);let l=(n=(i=(0,BS.splitHostPort)(this.options.host))===null||i===void 0?void 0:i.host)!==null&&n!==void 0?n:"localhost";this.serviceUrl=`https://${l}/${u}`;let d=(0,nDe.getRelativeTimeout)(s.deadline);d!==1/0&&(d<=0?this.cancelWithStatus(ud.Status.DEADLINE_EXCEEDED,"Deadline exceeded"):setTimeout(()=>{this.cancelWithStatus(ud.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},d)),this.filterStack=o.createFilter()}cancelWithStatus(e,r){this.childCall?this.childCall.cancelWithStatus(e,r):this.pendingStatus={code:e,details:r,metadata:new LI.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()!==tDe.ConnectivityState.READY){r.onReceiveStatus({code:ud.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new LI.Metadata});return}let o=await this.filterStack.sendMetadata(Promise.resolve(e)),s;try{s=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(i){let n=i,{code:c,details:u}=(0,rDe.restrictControlPlaneStatusCode)(typeof n.code=="number"?n.code:ud.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${n.message}`);r.onReceiveStatus({code:c,details:u,metadata:new LI.Metadata});return}s.merge(o);let a={onReceiveMetadata:async i=>{r.onReceiveMetadata(await this.filterStack.receiveMetadata(i))},onReceiveMessage:async i=>{this.readFilterPending=!0;let n=await this.filterStack.receiveMessage(i);this.readFilterPending=!1,r.onReceiveMessage(n),this.pendingStatus&&r.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async i=>{let n=await this.filterStack.receiveTrailers(i);this.readFilterPending?this.pendingStatus=n:r.onReceiveStatus(n)}};this.childCall=this.subchannel.createCall(s,this.options.host,this.method,a),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 o=await this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,o.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:o.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}},UI=class{constructor(e,r,o){this.subchannel=e,this.target=r,this.channelzEnabled=!1,this.channelzTrace=new cd.ChannelzTrace,this.callTracker=new cd.ChannelzCallTracker,this.childrenTracker=new cd.ChannelzChildrenTracker,this.channelzEnabled=o["grpc.enable_channelz"]!==0,this.channelzRef=(0,cd.registerChannelzChannel)((0,BS.uriToString)(r),()=>({target:`${(0,BS.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 iDe.FilterStackFactory([new eDe.CompressionFilterFactory(this,o)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,cd.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,BS.uriToString)(this.target)}getConnectivityState(e){throw new Error("Method not implemented.")}watchConnectivityState(e,r,o){throw new Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(e,r){let o={deadline:r,host:(0,oDe.getDefaultAuthority)(this.target),flags:ud.Propagate.DEFAULTS,parentCall:null};return new DI(this.subchannel,e,this.filterStackFactory,o,(0,ZLe.getNextCallNumber)())}};FS.SingleSubchannelChannel=UI});var oJ=p(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});GS.Subchannel=void 0;var me=Ft(),sDe=Ac(),kI=Ee(),VS=se(),aDe=Bt(),cDe=Jt(),ei=mo(),uDe=iJ(),lDe="subchannel",dDe=~(1<<31),BI=class{constructor(e,r,o,s,a){var i;this.channelTarget=e,this.subchannelAddress=r,this.options=o,this.connector=a,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 n={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new sDe.BackoffTimeout(()=>{this.handleBackoffTimer()},n),this.backoffTimeout.unref(),this.subchannelAddressString=(0,cDe.subchannelAddressToString)(r),this.keepaliveTime=(i=o["grpc.keepalive_time_ms"])!==null&&i!==void 0?i:-1,o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new ei.ChannelzTraceStub,this.callTracker=new ei.ChannelzCallTrackerStub,this.childrenTracker=new ei.ChannelzChildrenTrackerStub,this.streamTracker=new ei.ChannelzCallTrackerStub):(this.channelzTrace=new ei.ChannelzTrace,this.callTracker=new ei.ChannelzCallTracker,this.childrenTracker=new ei.ChannelzChildrenTracker,this.streamTracker=new ei.ChannelzCallTracker),this.channelzRef=(0,ei.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(o,void 0,2)),this.secureConnector=s._createSecureConnector(e,o)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){kI.trace(VS.LogVerbosity.DEBUG,lDe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){kI.trace(VS.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,dDe);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(o=>{this.transitionToState([me.ConnectivityState.READY],me.ConnectivityState.IDLE),o&&this.keepaliveTime>0&&(this.keepaliveTime*=2,kI.log(VS.LogVerbosity.ERROR,`Connection to ${(0,aDe.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,o){var s,a;if(e.indexOf(this.connectivityState)===-1)return!1;o?this.trace(me.ConnectivityState[this.connectivityState]+" -> "+me.ConnectivityState[r]+' with error "'+o+'"'):this.trace(me.ConnectivityState[this.connectivityState]+" -> "+me.ConnectivityState[r]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+me.ConnectivityState[r]);let i=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()),(s=this.transport)===null||s===void 0||s.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()),(a=this.transport)===null||a===void 0||a.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${r}`)}for(let n of this.stateListeners)n(this,i,r,this.keepaliveTime,o);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,ei.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,o,s){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:i=>{i.code===VS.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,r,o,s,a)}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 uDe.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw new Error("Not implemented")}getOrCreateDataProducer(e,r){let o=this.dataProducers.get(e);if(o)return o;let s=r(this);return this.dataProducers.set(e,s),s}removeDataProducer(e){this.dataProducers.delete(e)}};GS.Subchannel=BI});var sJ=p(qS=>{"use strict";var FI;Object.defineProperty(qS,"__esModule",{value:!0});qS.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;qS.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((FI=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&FI!==void 0?FI:"false")==="true"});var jI=p(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.DEFAULT_PORT=void 0;Rs.setup=SDe;var aJ=$r(),VI=require("dns"),pDe=$N(),GI=se(),Vc=gs(),fDe=nt(),hDe=Ee(),mDe=se(),_o=Bt(),cJ=require("net"),_De=Ac(),uJ=sJ(),gDe="dns_resolver";function ti(t){hDe.trace(mDe.LogVerbosity.DEBUG,gDe,t)}Rs.DEFAULT_PORT=443;var EDe=3e4,qI=class{constructor(e,r,o){var s,a,i;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 VI.promises.Resolver,ti("Resolver constructed for target "+(0,_o.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let n=(0,_o.splitHostPort)(e.path);n===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,cJ.isIPv4)(n.host)||(0,cJ.isIPv6)(n.host)?(this.ipResult=[{addresses:[{host:n.host,port:(s=n.port)!==null&&s!==void 0?s:Rs.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=n.host,this.port=(a=n.port)!==null&&a!==void 0?a:Rs.DEFAULT_PORT),this.percentage=Math.random()*100,o["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:GI.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,_o.uriToString)(this.target)}`,metadata:new fDe.Metadata};let c={initialDelay:o["grpc.initial_reconnect_backoff_ms"],maxDelay:o["grpc.max_reconnect_backoff_ms"]};this.backoff=new _De.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(i=o["grpc.dns_min_time_between_resolutions_ms"])!==null&&i!==void 0?i:EDe,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(ti("Returning IP address for target "+(0,_o.uriToString)(this.target)),setImmediate(()=>{this.listener((0,Vc.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)ti("Failed to parse DNS address "+(0,_o.uriToString)(this.target)),setImmediate(()=>{this.listener((0,Vc.statusOrFromError)({code:GI.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,_o.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;ti("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,Vc.statusOrFromValue)(r.map(a=>({addresses:[a]})));let o="["+r.map(a=>a.host+":"+a.port).join(",")+"]";ti("Resolved addresses for target "+(0,_o.uriToString)(this.target)+": "+o);let s=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(s)},r=>{this.pendingLookupPromise!==null&&(ti("Resolution error for target "+(0,_o.uriToString)(this.target)+": "+r.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,Vc.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 o;try{o=(0,pDe.extractAndSelectServiceConfig)(r,this.percentage),o?this.latestServiceConfigResult=(0,Vc.statusOrFromValue)(o):this.latestServiceConfigResult=null}catch(s){this.latestServiceConfigResult=(0,Vc.statusOrFromError)({code:GI.Status.UNAVAILABLE,details:`Parsing service config failed with error ${s.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(uJ.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){ti("Using alternative DNS resolver.");let o=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(o.every(s=>s.status==="rejected"))throw new Error(o[0].reason);return o.reduce((s,a)=>a.status==="fulfilled"?[...s,...a.value]:s,[]).map(s=>({host:s,port:+this.port}))}return(await VI.promises.lookup(e,{all:!0})).map(o=>({host:o.address,port:+this.port}))}async resolveTxt(e){return uJ.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(ti("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):VI.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?ti('resolution update delayed by "min time between resolutions" rate limit'):ti("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 SDe(){(0,aJ.registerResolver)("dns",qI),(0,aJ.registerDefaultScheme)("dns")}});var HI=p(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.parseCIDR=pJ;pd.mapProxyName=NDe;pd.getProxiedConnection=MDe;var ld=Ee(),Gc=se(),dJ=require("net"),TDe=require("http"),yDe=Ee(),lJ=Jt(),dd=Bt(),vDe=require("url"),ADe=jI(),ODe="proxy";function qc(t){yDe.trace(Gc.LogVerbosity.DEBUG,ODe,t)}function bDe(){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 vDe.URL(t)}catch{return(0,ld.log)(Gc.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(r.protocol!=="http:")return(0,ld.log)(Gc.LogVerbosity.ERROR,`"${r.protocol}" scheme not supported in proxy URI`),{};let o=null;r.username&&(r.password?((0,ld.log)(Gc.LogVerbosity.INFO,"userinfo found in proxy URI"),o=decodeURIComponent(`${r.username}:${r.password}`)):o=r.username);let s=r.hostname,a=r.port;a===""&&(a="80");let i={address:`${s}:${a}`};return o&&(i.creds=o),qc("Proxy server "+i.address+" set by environment variable "+e),i}function RDe(){let t=process.env.no_grpc_proxy,e="no_grpc_proxy";return t||(t=process.env.no_proxy,e="no_proxy"),t?(qc("No proxy server list set by environment variable "+e),t.split(",")):[]}function pJ(t){let e=t.split("/");if(e.length!==2)return null;let r=parseInt(e[1],10);return!(0,dJ.isIPv4)(e[0])||Number.isNaN(r)||r<0||r>32?null:{ip:fJ(e[0]),prefixLength:r}}function fJ(t){return t.split(".").reduce((e,r)=>(e<<8)+parseInt(r,10),0)}function PDe(t,e){let r=t.ip,o=-1<<32-t.prefixLength;return(fJ(e)&o)===(r&o)}function CDe(t){for(let e of RDe()){let r=pJ(e);if((0,dJ.isIPv4)(t)&&r&&PDe(r,t))return!0;if(t.endsWith(e))return!0}return!1}function NDe(t,e){var r;let o={target:t,extraOptions:{}};if(((r=e["grpc.enable_http_proxy"])!==null&&r!==void 0?r:1)===0||t.scheme==="unix")return o;let s=bDe();if(!s.address)return o;let a=(0,dd.splitHostPort)(t.path);if(!a)return o;let i=a.host;if(CDe(i))return qc("Not using proxy for target in no_proxy list: "+(0,dd.uriToString)(t)),o;let n={"grpc.http_connect_target":(0,dd.uriToString)(t)};return s.creds&&(n["grpc.http_connect_creds"]=s.creds),{target:{scheme:"dns",path:s.address},extraOptions:n}}function MDe(t,e){var r;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let o=e["grpc.http_connect_target"],s=(0,dd.parseUri)(o);if(s===null)return Promise.resolve(null);let a=(0,dd.splitHostPort)(s.path);if(a===null)return Promise.resolve(null);let i=`${a.host}:${(r=a.port)!==null&&r!==void 0?r:ADe.DEFAULT_PORT}`,n={method:"CONNECT",path:i},c={Host:i};(0,lJ.isTcpSubchannelAddress)(t)?(n.host=t.host,n.port=t.port):n.socketPath=t.path,"grpc.http_connect_creds"in e&&(c["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),n.headers=c;let u=(0,lJ.subchannelAddressToString)(t);return qc("Using proxy "+u+" to connect to "+n.path),new Promise((l,d)=>{let h=TDe.request(n);h.once("connect",(g,E,S)=>{h.removeAllListeners(),E.removeAllListeners(),g.statusCode===200?(qc("Successfully connected to "+n.path+" through proxy "+u),S.length>0&&E.unshift(S),qc("Successfully established a plaintext connection to "+n.path+" through proxy "+u),l(E)):((0,ld.log)(Gc.LogVerbosity.ERROR,"Failed to connect to "+n.path+" through proxy "+u+" with status "+g.statusCode),d())}),h.once("error",g=>{h.removeAllListeners(),(0,ld.log)(Gc.LogVerbosity.ERROR,"Failed to connect to proxy "+u+" with error "+g.message),d()}),h.end()})}});var $I=p(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});jS.StreamDecoder=void 0;var ri;(function(t){t[t.NO_DATA=0]="NO_DATA",t[t.READING_SIZE=1]="READING_SIZE",t[t.READING_MESSAGE=2]="READING_MESSAGE"})(ri||(ri={}));var zI=class{constructor(e){this.maxReadMessageLength=e,this.readState=ri.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,o,s=[];for(;r<e.length;)switch(this.readState){case ri.NO_DATA:this.readCompressFlag=e.slice(r,r+1),r+=1,this.readState=ri.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case ri.READING_SIZE:if(o=Math.min(e.length-r,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,r,r+o),this.readSizeRemaining-=o,r+=o,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=ri.READING_MESSAGE;else{let a=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=ri.NO_DATA,s.push(a)}}break;case ri.READING_MESSAGE:if(o=Math.min(e.length-r,this.readMessageRemaining),this.readPartialMessage.push(e.slice(r,r+o)),this.readMessageRemaining-=o,r+=o,this.readMessageRemaining===0){let a=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),i=Buffer.concat(a,this.readMessageSize+5);this.readState=ri.NO_DATA,s.push(i)}break;default:throw new Error("Unexpected read state")}return s}};jS.StreamDecoder=zI});var hJ=p(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});HS.Http2SubchannelCall=void 0;var Ii=require("http2"),IDe=require("os"),_e=se(),xi=nt(),xDe=$I(),wDe=Ee(),LDe=se(),DDe="subchannel_call";function UDe(t){for(let[e,r]of Object.entries(IDe.constants.errno))if(r===t)return e;return"Unknown system error "+t}function YI(t){let e=`Received HTTP status code ${t}`,r;switch(t){case 400:r=_e.Status.INTERNAL;break;case 401:r=_e.Status.UNAUTHENTICATED;break;case 403:r=_e.Status.PERMISSION_DENIED;break;case 404:r=_e.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:r=_e.Status.UNAVAILABLE;break;default:r=_e.Status.UNKNOWN}return{code:r,details:e,metadata:new xi.Metadata}}var WI=class{constructor(e,r,o,s,a){var i;this.http2Stream=e,this.callEventTracker=r,this.listener=o,this.transport=s,this.callId=a,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 n=(i=s.getOptions()["grpc.max_receive_message_length"])!==null&&i!==void 0?i:_e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new xDe.StreamDecoder(n),e.on("response",(c,u)=>{let l="";for(let d of Object.keys(c))l+=" "+d+": "+c[d]+`
|
|
35
|
+
`;if(this.trace(`Received server headers:
|
|
36
|
+
`+l),this.httpStatusCode=c[":status"],u&Ii.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(c);else{let d;try{d=xi.Metadata.fromHttp2Headers(c)}catch(h){this.endCall({code:_e.Status.UNKNOWN,details:h.message,metadata:new xi.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 u;try{u=this.decoder.write(c)}catch(l){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let d=YI(this.httpStatusCode);this.cancelWithStatus(d.code,d.details)}else this.cancelWithStatus(_e.Status.RESOURCE_EXHAUSTED,l.message);return}for(let l of u)this.trace("parsed message of length "+l.length),this.callEventTracker.addMessageReceived(),this.tryPush(l)}),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)===_e.Status.OK)return;let u,l="";switch(e.rstCode){case Ii.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let d=YI(this.httpStatusCode);u=d.code,l=d.details}else u=_e.Status.INTERNAL,l=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case Ii.constants.NGHTTP2_REFUSED_STREAM:u=_e.Status.UNAVAILABLE,l="Stream refused by server";break;case Ii.constants.NGHTTP2_CANCEL:this.connectionDropped?(u=_e.Status.UNAVAILABLE,l="Connection dropped"):(u=_e.Status.CANCELLED,l="Call cancelled");break;case Ii.constants.NGHTTP2_ENHANCE_YOUR_CALM:u=_e.Status.RESOURCE_EXHAUSTED,l="Bandwidth exhausted or memory limit exceeded";break;case Ii.constants.NGHTTP2_INADEQUATE_SECURITY:u=_e.Status.PERMISSION_DENIED,l="Protocol not secure enough";break;case Ii.constants.NGHTTP2_INTERNAL_ERROR:u=_e.Status.INTERNAL,this.internalError===null?l=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(u=_e.Status.UNAVAILABLE,l=this.internalError.message):l=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:u=_e.Status.INTERNAL,l=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:u,details:l,metadata:new xi.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="+UDe(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:_e.Status.UNAVAILABLE,details:"Connection dropped",metadata:new xi.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){wDe.trace(LDe.LogVerbosity.DEBUG,DDe,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===_e.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==_e.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 i of Object.keys(e))r+=" "+i+": "+e[i]+`
|
|
37
|
+
`;this.trace(`Received server trailers:
|
|
38
|
+
`+r);let o;try{o=xi.Metadata.fromHttp2Headers(e)}catch{o=new xi.Metadata}let s=o.getMap(),a;if(typeof s["grpc-status"]=="string"){let i=Number(s["grpc-status"]);this.trace("received status code "+i+" from server"),o.remove("grpc-status");let n="";if(typeof s["grpc-message"]=="string"){try{n=decodeURI(s["grpc-message"])}catch{n=s["grpc-message"]}o.remove("grpc-message"),this.trace('received status details string "'+n+'" from server')}a={code:i,details:n,metadata:o}}else this.httpStatusCode?(a=YI(this.httpStatusCode),a.metadata=o):a={code:_e.Status.UNKNOWN,details:"No status information received",metadata:o};this.endCall(a)}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)===_e.Status.OK?r=Ii.constants.NGHTTP2_NO_ERROR:r=Ii.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 xi.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!==_e.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 o=s=>{process.nextTick(()=>{var a;let i=_e.Status.UNAVAILABLE;s?.code==="ERR_STREAM_WRITE_AFTER_END"&&(i=_e.Status.INTERNAL),s&&this.cancelWithStatus(i,`Write error: ${s.message}`),(a=e.callback)===null||a===void 0||a.call(e)})};this.trace("sending data chunk of length "+r.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(r,o)}catch(s){this.endCall({code:_e.Status.UNAVAILABLE,details:`Write failed with error ${s.message}`,metadata:new xi.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};HS.Http2SubchannelCall=WI});var mJ=p(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});YS.Http2SubchannelConnector=void 0;var Ps=require("http2"),kDe=require("tls"),zS=mo(),fd=se(),BDe=HI(),jc=Ee(),FDe=$r(),$S=Jt(),KI=Bt(),VDe=require("net"),GDe=hJ(),qDe=IS(),XI="transport",jDe="transport_flowctrl",HDe=RN().version,{HTTP2_HEADER_AUTHORITY:zDe,HTTP2_HEADER_CONTENT_TYPE:$De,HTTP2_HEADER_METHOD:YDe,HTTP2_HEADER_PATH:WDe,HTTP2_HEADER_TE:KDe,HTTP2_HEADER_USER_AGENT:XDe}=Ps.constants,JDe=2e4,QDe=Buffer.from("too_many_pings","ascii"),JI=class{constructor(e,r,o,s){this.session=e,this.options=o,this.remoteName=s,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,$S.subchannelAddressToString)(r),o["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new zS.ChannelzCallTrackerStub):this.streamTracker=new zS.ChannelzCallTracker,this.channelzRef=(0,zS.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[o["grpc.primary_user_agent"],`grpc-node-js/${HDe}`,o["grpc.secondary_user_agent"]].filter(a=>a).join(" "),"grpc.keepalive_time_ms"in o?this.keepaliveTimeMs=o["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in o?this.keepaliveTimeoutMs=o["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=JDe,"grpc.keepalive_permit_without_calls"in o?this.keepaliveWithoutCalls=o["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(a,i,n)=>{let c=!1;a===Ps.constants.NGHTTP2_ENHANCE_YOUR_CALM&&n&&n.equals(QDe)&&(c=!0),this.trace("connection closed by GOAWAY with code "+a+" and data "+n?.toString()),this.reportDisconnectToOwner(c)}),e.once("error",a=>{this.trace("connection closed with error "+a.message),this.handleDisconnect()}),e.socket.once("close",a=>{this.trace("connection closed. hadError="+a),this.handleDisconnect()}),jc.isTracerEnabled(XI)&&(e.on("remoteSettings",a=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))}),e.on("localSettings",a=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(a))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof kDe.TLSSocket?this.authContext={transportSecurityType:"ssl",sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){var e,r,o;let s=this.session.socket,a=s.remoteAddress?(0,$S.stringToSubchannelAddress)(s.remoteAddress,s.remotePort):null,i=s.localAddress?(0,$S.stringToSubchannelAddress)(s.localAddress,s.localPort):null,n;if(this.session.encrypted){let u=s,l=u.getCipher(),d=u.getCertificate(),h=u.getPeerCertificate();n={cipherSuiteStandardName:(e=l.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:l.standardName?null:l.name,localCertificate:d&&"raw"in d?d.raw:null,remoteCertificate:h&&"raw"in h?h.raw:null}}else n=null;return{remoteAddress:a,localAddress:i,security:n,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:(o=this.session.state.remoteWindowSize)!==null&&o!==void 0?o:null}}trace(e){jc.trace(fd.LogVerbosity.DEBUG,XI,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){jc.trace(fd.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){jc.trace(fd.LogVerbosity.DEBUG,jDe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){jc.trace(fd.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 o="";try{this.session.ping((a,i,n)=>{this.clearKeepaliveTimeout(),a?(this.keepaliveTrace("Ping failed with error "+a.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(o="Ping returned false")}catch(s){o=(s instanceof Error?s.message:"")||"Unknown error"}o&&(this.keepaliveTrace("Ping send failed: "+o),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,o,s,a){let i=e.toHttp2Headers();i[zDe]=r,i[XDe]=this.userAgent,i[$De]="application/grpc",i[YDe]="POST",i[WDe]=o,i[KDe]="trailers";let n;try{n=this.session.request(i)}catch(l){throw this.handleDisconnect(),l}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,u;return this.channelzEnabled?(this.streamTracker.addCallStarted(),c={addMessageSent:()=>{var l;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(l=a.addMessageSent)===null||l===void 0||l.call(a)},addMessageReceived:()=>{var l;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(l=a.addMessageReceived)===null||l===void 0||l.call(a)},onCallEnd:l=>{var d;(d=a.onCallEnd)===null||d===void 0||d.call(a,l),this.removeActiveCall(u)},onStreamEnd:l=>{var d;l?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(d=a.onStreamEnd)===null||d===void 0||d.call(a,l)}}):c={addMessageSent:()=>{var l;(l=a.addMessageSent)===null||l===void 0||l.call(a)},addMessageReceived:()=>{var l;(l=a.addMessageReceived)===null||l===void 0||l.call(a)},onCallEnd:l=>{var d;(d=a.onCallEnd)===null||d===void 0||d.call(a,l),this.removeActiveCall(u)},onStreamEnd:l=>{var d;(d=a.onStreamEnd)===null||d===void 0||d.call(a,l)}},u=new GDe.Http2SubchannelCall(n,c,s,this,(0,qDe.getNextCallNumber)()),this.addActiveCall(u),u}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,zS.unregisterChannelzRef)(this.channelzRef)}},QI=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){jc.trace(fd.LogVerbosity.DEBUG,XI,(0,KI.uriToString)(this.channelTarget)+" "+e)}createSession(e,r,o){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((s,a)=>{var i,n,c,u,l,d,h,g;let E=null,S=this.channelTarget;if("grpc.http_connect_target"in o){let Z=(0,KI.parseUri)(o["grpc.http_connect_target"]);Z&&(S=Z,E=(0,KI.uriToString)(Z))}let v=e.secure?"https":"http",O=(0,FDe.getDefaultAuthority)(S),I=()=>{var Z;(Z=this.session)===null||Z===void 0||Z.destroy(),this.session=null,setImmediate(()=>{te||(te=!0,a(`${oe.trim()} (${new Date().toISOString()})`))})},j=Z=>{var R;(R=this.session)===null||R===void 0||R.destroy(),oe=Z.message,this.trace("connection failed with error "+oe),te||(te=!0,a(`${oe} (${new Date().toISOString()})`))},A={createConnection:(Z,R)=>e.socket,settings:{initialWindowSize:(u=(i=o["grpc-node.flow_control_window"])!==null&&i!==void 0?i:(c=(n=Ps.getDefaultSettings)===null||n===void 0?void 0:n.call(Ps))===null||c===void 0?void 0:c.initialWindowSize)!==null&&u!==void 0?u:65535},maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER,maxSessionMemory:(l=o["grpc-node.max_session_memory"])!==null&&l!==void 0?l:Number.MAX_SAFE_INTEGER},z=Ps.connect(`${v}://${O}`,A),H=(g=(h=(d=Ps.getDefaultSettings)===null||d===void 0?void 0:d.call(Ps))===null||h===void 0?void 0:h.initialWindowSize)!==null&&g!==void 0?g:65535,Q=o["grpc-node.flow_control_window"];this.session=z;let oe="Failed to connect",te=!1;z.unref(),z.once("remoteSettings",()=>{var Z;if(Q&&Q>H)try{z.setLocalWindowSize(Q)}catch{let Mt=Q-((Z=z.state.localWindowSize)!==null&&Z!==void 0?Z:H);Mt>0&&z.incrementWindowSize(Mt)}z.removeAllListeners(),e.socket.removeListener("close",I),e.socket.removeListener("error",j),s(new JI(z,r,o,E)),this.session=null}),z.once("close",I),z.once("error",j),e.socket.once("close",I),e.socket.once("error",j)})}tcpConnect(e,r){return(0,BDe.getProxiedConnection)(e,r).then(o=>o||new Promise((s,a)=>{let i=()=>{a(new Error("Socket closed"))},n=u=>{a(u)},c=VDe.connect(e,()=>{c.removeListener("close",i),c.removeListener("error",n),s(c)});c.once("close",i),c.once("error",n)}))}async connect(e,r,o){if(this.isShutdown)return Promise.reject();let s=null,a=null,i=(0,$S.subchannelAddressToString)(e);try{return this.trace(i+" Waiting for secureConnector to be ready"),await r.waitForReady(),this.trace(i+" secureConnector is ready"),s=await this.tcpConnect(e,o),s.setNoDelay(),this.trace(i+" Established TCP connection"),a=await r.connect(s),this.trace(i+" Established secure connection"),this.createSession(a,e,o)}catch(n){throw s?.destroy(),a?.socket.destroy(),n}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};YS.Http2SubchannelConnector=QI});var _J=p(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.SubchannelPool=void 0;md.getSubchannelPool=s1e;var ZDe=jX(),e1e=oJ(),t1e=Jt(),r1e=Bt(),n1e=mJ(),i1e=1e4,hd=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let r in this.pool){let s=this.pool[r].filter(a=>!a.subchannel.unrefIfOneRef());s.length>0&&(e=!1),this.pool[r]=s}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,r;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},i1e),(r=(e=this.cleanupTimer).unref)===null||r===void 0||r.call(e))}getOrCreateSubchannel(e,r,o,s){this.ensureCleanupTask();let a=(0,r1e.uriToString)(e);if(a in this.pool){let n=this.pool[a];for(let c of n)if((0,t1e.subchannelAddressEqual)(r,c.subchannelAddress)&&(0,ZDe.channelOptionsEqual)(o,c.channelArguments)&&s._equals(c.channelCredentials))return c.subchannel}let i=new e1e.Subchannel(e,r,o,s,new n1e.Http2SubchannelConnector(e));return a in this.pool||(this.pool[a]=[]),this.pool[a].push({subchannelAddress:r,channelArguments:o,channelCredentials:s,subchannel:i}),i.ref(),i}};md.SubchannelPool=hd;var o1e=new hd;function s1e(t){return t?o1e:new hd}});var SJ=p(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});XS.LoadBalancingCall=void 0;var gJ=Ft(),WS=se(),EJ=Bc(),KS=nt(),_d=Ai(),a1e=Bt(),c1e=Ee(),ZI=ad(),u1e=require("http2"),l1e="load_balancing_call",e0=class{constructor(e,r,o,s,a,i,n){var c,u;this.channel=e,this.callConfig=r,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,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 l=this.methodName.split("/"),d="";l.length>=2&&(d=l[1]);let h=(u=(c=(0,a1e.splitHostPort)(this.host))===null||c===void 0?void 0:c.host)!==null&&u!==void 0?u:"localhost";this.serviceUrl=`https://${h}/${d}`,this.startTime=new Date}getDeadlineInfo(){var e,r;let o=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&o.push("wait_for_ready"),o.push(`LB pick: ${(0,EJ.formatDateDifference)(this.startTime,this.childStartTime)}`)),o.push(...this.child.getDeadlineInfo()),o):(!((r=this.metadata)===null||r===void 0)&&r.getOptions().waitForReady&&o.push("wait_for_ready"),o.push("Waiting for LB pick"),o)}trace(e){c1e.trace(WS.LogVerbosity.DEBUG,l1e,"["+this.callNumber+"] "+e)}outputStatus(e,r){var o,s;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let a=Object.assign(Object.assign({},e),{progress:r});(o=this.listener)===null||o===void 0||o.onReceiveStatus(a),(s=this.onCallEnded)===null||s===void 0||s.call(this,a.code,a.details,a.metadata)}}doPick(){var e,r;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let o=this.metadata.clone(),s=this.channel.doPick(o,this.callConfig.pickInformation),a=s.subchannel?"("+s.subchannel.getChannelzRef().id+") "+s.subchannel.getAddress():""+s.subchannel;switch(this.trace("Pick result: "+_d.PickResultType[s.pickResultType]+" subchannel: "+a+" status: "+((e=s.status)===null||e===void 0?void 0:e.code)+" "+((r=s.status)===null||r===void 0?void 0:r.details)),s.pickResultType){case _d.PickResultType.COMPLETE:this.credentials.compose(s.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(u=>{var l;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(o.merge(u),o.get("authorization").length>1&&this.outputStatus({code:WS.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new KS.Metadata},"PROCESSED"),s.subchannel.getConnectivityState()!==gJ.ConnectivityState.READY){this.trace("Picked subchannel "+a+" has state "+gJ.ConnectivityState[s.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&o.set("grpc-timeout",(0,EJ.getDeadlineTimeoutString)(this.deadline));try{this.child=s.subchannel.getRealSubchannel().createCall(o,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===u1e.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 "+a+" with error "+d.message),this.outputStatus({code:WS.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+d.message,metadata:new KS.Metadata},"NOT_STARTED");return}(l=s.onCallStarted)===null||l===void 0||l.call(s),this.onCallEnded=s.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()},u=>{let{code:l,details:d}=(0,ZI.restrictControlPlaneStatusCode)(typeof u.code=="number"?u.code:WS.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${u.message}`);this.outputStatus({code:l,details:d,metadata:new KS.Metadata},"PROCESSED")});break;case _d.PickResultType.DROP:let{code:n,details:c}=(0,ZI.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:n,details:c,metadata:s.status.metadata},"DROP")});break;case _d.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:u,details:l}=(0,ZI.restrictControlPlaneStatusCode)(s.status.code,s.status.details);setImmediate(()=>{this.outputStatus({code:u,details:l,metadata:s.status.metadata},"PROCESSED")})}break;case _d.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,r){var o;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new KS.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}};XS.LoadBalancingCall=e0});var yJ=p(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});JS.ResolvingCall=void 0;var d1e=wE(),Cs=se(),Ns=Bc(),TJ=nt(),p1e=Ee(),f1e=ad(),h1e="resolving_call",t0=class{constructor(e,r,o,s,a){this.channel=e,this.method=r,this.filterStackFactory=s,this.callNumber=a,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=d1e.CallCredentials.createEmpty(),this.deadline=o.deadline,this.host=o.host,o.parentCall&&(o.flags&Cs.Propagate.CANCELLATION&&o.parentCall.on("cancelled",()=>{this.cancelWithStatus(Cs.Status.CANCELLED,"Cancelled by parent call")}),o.flags&Cs.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+o.parentCall.getDeadline()),this.deadline=(0,Ns.minDeadline)(this.deadline,o.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){p1e.trace(Cs.LogVerbosity.DEBUG,h1e,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,Ns.deadlineToString)(this.deadline));let e=(0,Ns.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let r=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(Cs.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let o=[],s=new Date;o.push(`Deadline exceeded after ${(0,Ns.formatDateDifference)(this.deadlineStartTime,s)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&o.push(`name resolution: ${(0,Ns.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&o.push(`metadata filters: ${(0,Ns.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):o.push("waiting for metadata filters")):o.push("waiting for name resolution"),this.child&&o.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(Cs.Status.DEADLINE_EXCEEDED,o.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(o=>o(r)),process.nextTick(()=>{var o;(o=this.listener)===null||o===void 0||o.onReceiveStatus(r)})}}sendMessageOnChild(e,r){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let o=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags})).then(s=>{this.writeFilterPending=!1,o.sendMessageWithContext(e,s.message),this.pendingHalfClose&&o.halfClose()},s=>{this.cancelWithStatus(s.code,s.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!==Cs.Status.OK){let{code:o,details:s}=(0,f1e.restrictControlPlaneStatusCode)(r.status,"Failed to route call to method "+this.method);this.outputStatus({code:o,details:s,metadata:new TJ.Metadata});return}if(r.methodConfig.timeout){let o=new Date;o.setSeconds(o.getSeconds()+r.methodConfig.timeout.seconds),o.setMilliseconds(o.getMilliseconds()+r.methodConfig.timeout.nanos/1e6),this.deadline=(0,Ns.minDeadline)(this.deadline,o),this.runDeadlineTimer()}this.filterStackFactory.push(r.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(o=>{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(o,{onReceiveMetadata:s=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(s))},onReceiveMessage:s=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(s).then(a=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(a),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},a=>{this.cancelWithStatus(a.code,a.details)})},onReceiveStatus:s=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=s:this.outputStatus(s)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},o=>{this.outputStatus(o)})}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 o;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(o=this.child)===null||o===void 0||o.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new TJ.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}};JS.ResolvingCall=t0});var vJ=p(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.RetryingCall=go.MessageBufferTracker=go.RetryThrottler=void 0;var QS=se(),m1e=Bc(),_1e=nt(),g1e=Ee(),E1e="retrying_call",n0=class{constructor(e,r,o){this.maxTokens=e,this.tokenRatio=r,o?this.tokens=o.tokens*(e/o.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}};go.RetryThrottler=n0;var i0=class{constructor(e,r){this.totalLimit=e,this.limitPerCall=r,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,r){var o;let s=(o=this.allocatedPerCall.get(r))!==null&&o!==void 0?o:0;return this.limitPerCall-s<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(r,s+e),this.totalAllocated+=e,!0)}free(e,r){var o;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let s=(o=this.allocatedPerCall.get(r))!==null&&o!==void 0?o:0;if(s<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > allocated for call ${s}`);this.allocatedPerCall.set(r,s-e)}freeAll(e){var r;let o=(r=this.allocatedPerCall.get(e))!==null&&r!==void 0?r:0;if(this.totalAllocated<o)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${o} > total allocated ${this.totalAllocated}`);this.totalAllocated-=o,this.allocatedPerCall.delete(e)}};go.MessageBufferTracker=i0;var r0="grpc-previous-rpc-attempts",S1e=5,o0=class{constructor(e,r,o,s,a,i,n,c,u){var l;this.channel=e,this.callConfig=r,this.methodName=o,this.host=s,this.credentials=a,this.deadline=i,this.callNumber=n,this.bufferTracker=c,this.retryThrottler=u,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=(l=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&l!==void 0?l:S1e;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(r.methodConfig.retryPolicy){this.state="RETRY";let h=r.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(h.initialBackoff.substring(0,h.initialBackoff.length-1)),this.maxAttempts=Math.min(h.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,m1e.formatDateDifference)(this.startTime,r.startTime)}`),e.push(...r.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){g1e.trace(QS.LogVerbosity.DEBUG,E1e,"["+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 _1e.Metadata});for(let{call:o}of this.underlyingCalls)o.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 o=this.getBufferEntry(r);o.allocated&&this.bufferTracker.free(o.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var r,o;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(o=(r=this.callConfig).onCommitted)===null||o===void 0||o.call(r),this.committedCallIndex=e;for(let s=0;s<this.underlyingCalls.length;s++)s!==e&&this.underlyingCalls[s].state!=="COMPLETED"&&(this.underlyingCalls[s].state="COMPLETED",this.underlyingCalls[s].call.cancelWithStatus(QS.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,r=-1;for(let[o,s]of this.underlyingCalls.entries())s.state==="ACTIVE"&&s.nextMessageToSend>e&&(e=s.nextMessageToSend,r=o);r===-1?this.state="TRANSPARENT_ONLY":this.commitCall(r)}isStatusCodeInList(e,r){return e.some(o=>{var s;return o===r||o.toString().toLowerCase()===((s=QS.Status[r])===null||s===void 0?void 0:s.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 s=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,a=Number(r.maxBackoff.substring(0,r.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*r.backoffMultiplier,a),s}maybeRetryCall(e,r){if(this.state!=="RETRY"){r(!1);return}if(this.attempts>=this.maxAttempts){r(!1);return}let o;if(e===null)o=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",r(!1);return}else o=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var s,a;if(this.state!=="RETRY"){r(!1);return}!((a=(s=this.retryThrottler)===null||s===void 0?void 0:s.canRetryCall())!==null&&a!==void 0)||a?(r(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),r(!1))},o)}countActiveCalls(){let e=0;for(let r of this.underlyingCalls)r?.state==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,r,o){var s,a,i;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(r),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((s=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&s!==void 0?s:[],e.code)){(a=this.retryThrottler)===null||a===void 0||a.addCallFailed();let n;if(o===null)n=0;else if(o<0){this.state="TRANSPARENT_ONLY",this.commitCall(r),this.reportStatus(e);return}else n=o;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(r),this.reportStatus(e))},n)}else this.commitCall(r),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)===null||i===void 0||i.addCallFailed(),this.maybeRetryCall(o,n=>{n||(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 o;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===QS.Status.OK){(o=this.retryThrottler)===null||o===void 0||o.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 s=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,r,s):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(r),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,r,s);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,r,o;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let s=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let a=(e=s.hedgingDelay)!==null&&e!==void 0?e:"0s",i=Number(a.substring(0,a.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},i*1e3),(o=(r=this.hedgingTimer).unref)===null||o===void 0||o.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 o=this.attempts-1,s=this.initialMetadata.clone();o>0&&s.set(r0,`${o}`);let a=!1;e.start(s,{onReceiveMetadata:i=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(r),a=!0,o>0&&i.set(r0,`${o}`),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMetadata(i)},onReceiveMessage:i=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(r),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMessage(i)},onReceiveStatus:i=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!a&&o>0&&i.metadata.set(r0,`${o}`),this.handleChildStatus(i,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){var r,o;let s=this.underlyingCalls[e],a=s.nextMessageToSend;(o=(r=this.getBufferEntry(a)).callback)===null||o===void 0||o.call(r),this.clearSentMessages(),s.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let r=this.underlyingCalls[e];if(r.state!=="COMPLETED"&&this.getBufferEntry(r.nextMessageToSend)){let o=this.getBufferEntry(r.nextMessageToSend);switch(o.entryType){case"MESSAGE":r.call.sendMessageWithContext({callback:s=>{this.handleChildWriteCompleted(e)}},o.message.message);break;case"HALF_CLOSE":r.nextMessageToSend+=1,r.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,r){var o;this.trace("write() called with message of length "+r.length);let s={message:r,flags:e.flags},a=this.getNextBufferIndex(),i={entryType:"MESSAGE",message:s,allocated:this.bufferTracker.allocate(r.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){(o=e.callback)===null||o===void 0||o.call(e);for(let[n,c]of this.underlyingCalls.entries())c.state==="ACTIVE"&&c.nextMessageToSend===a&&c.call.sendMessageWithContext({callback:u=>{this.handleChildWriteCompleted(n)}},r)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state==="ACTIVE"&&n.nextMessageToSend===a&&n.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(this.committedCallIndex)}},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+=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}};go.RetryingCall=o0});var gd=p(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});ZS.BaseSubchannelWrapper=void 0;var s0=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()}};ZS.BaseSubchannelWrapper=s0});var h0=p(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.InternalChannel=Ms.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var T1e=vc(),y1e=qX(),v1e=_J(),u0=Ai(),A1e=nt(),Eo=se(),O1e=kS(),b1e=II(),AJ=$r(),eT=Ee(),R1e=HI(),tT=Bt(),Nr=Ft(),Ed=mo(),P1e=SJ(),C1e=Bc(),N1e=yJ(),a0=IS(),M1e=ad(),c0=vJ(),I1e=gd(),x1e=2147483647,w1e=1e3,L1e=1800*1e3,rT=new Map,D1e=1<<24,U1e=1<<20,l0=class extends I1e.BaseSubchannelWrapper{constructor(e,r){super(e),this.channel=r,this.refCount=0,this.subchannelStateListener=(o,s,a,i)=>{r.throttleKeepalive(i)}}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))}},d0=class{pick(e){return{pickResultType:u0.PickResultType.DROP,status:{code:Eo.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new A1e.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};Ms.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var p0=class{constructor(e){this.target=e,this.trace=new Ed.ChannelzTrace,this.callTracker=new Ed.ChannelzCallTracker,this.childrenTracker=new Ed.ChannelzChildrenTracker,this.state=Nr.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},f0=class{constructor(e,r,o){var s,a,i,n,c,u;if(this.credentials=r,this.options=o,this.connectivityState=Nr.ConnectivityState.IDLE,this.currentPicker=new u0.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 T1e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new p0(e);let l=(0,tT.parseUri)(e);if(l===null)throw new Error(`Could not parse target name "${e}"`);let d=(0,AJ.mapUriDefaultScheme)(l);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,Ed.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,AJ.getDefaultAuthority)(d);let h=(0,R1e.mapProxyName)(d,o);this.target=h.target,this.options=Object.assign({},this.options,h.extraOptions),this.subchannelPool=(0,v1e.getSubchannelPool)(((s=this.options["grpc.use_local_subchannel_pool"])!==null&&s!==void 0?s:0)===0),this.retryBufferTracker=new c0.MessageBufferTracker((a=this.options["grpc.retry_buffer_size"])!==null&&a!==void 0?a:D1e,(i=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&i!==void 0?i:U1e),this.keepaliveTime=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:-1,this.idleTimeoutMs=Math.max((c=this.options["grpc.client_idle_timeout_ms"])!==null&&c!==void 0?c:L1e,w1e);let g={createSubchannel:(S,v)=>{let O={};for(let[A,z]of Object.entries(v))A.startsWith(Ms.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(O[A]=z);let I=this.subchannelPool.getOrCreateSubchannel(this.target,S,O,this.credentials);return I.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",I.getChannelzRef()),new l0(I,this)},updateState:(S,v)=>{this.currentPicker=v;let O=this.pickQueue.slice();this.pickQueue=[],O.length>0&&this.callRefTimerUnref();for(let I of O)I.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 y1e.ResolvingLoadBalancer(this.target,g,this.options,(S,v)=>{var O;S.retryThrottling?rT.set(this.getTarget(),new c0.RetryThrottler(S.retryThrottling.maxTokens,S.retryThrottling.tokenRatio,rT.get(this.getTarget()))):rT.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(O=this.configSelector)===null||O===void 0||O.unref(),this.configSelector=v,this.currentResolutionError=null,process.nextTick(()=>{let I=this.configSelectionQueue;this.configSelectionQueue=[],I.length>0&&this.callRefTimerUnref();for(let j of I)j.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,M1e.restrictControlPlaneStatusCode)(S.code,S.details)),{metadata:S.metadata}));let v=this.configSelectionQueue;this.configSelectionQueue=[],v.length>0&&this.callRefTimerUnref();for(let O of v)O.reportResolverError(S)}),this.filterStackFactory=new O1e.FilterStackFactory([new b1e.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(o,void 0,2));let E=new Error;(0,eT.isTracerEnabled)("channel_stacktrace")&&(0,eT.trace)(Eo.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
|
|
39
|
+
`+((u=E.stack)===null||u===void 0?void 0:u.substring(E.stack.indexOf(`
|
|
40
|
+
`)+1))),this.lastActivityTimestamp=new Date}trace(e,r){(0,eT.trace)(r??Eo.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,tT.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,o,s;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},x1e)),!((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),(s=(o=this.callRefTimer).ref)===null||s===void 0||s.call(o))}callRefTimerUnref(){var e,r,o;(!(!((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),(o=(r=this.callRefTimer)===null||r===void 0?void 0:r.unref)===null||o===void 0||o.call(r))}removeConnectivityStateWatcher(e){let r=this.connectivityStateWatchers.findIndex(o=>o===e);r>=0&&this.connectivityStateWatchers.splice(r,1)}updateState(e){(0,eT.trace)(Eo.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,tT.uriToString)(this.target)+" "+Nr.ConnectivityState[this.connectivityState]+" -> "+Nr.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Nr.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let r=this.connectivityStateWatchers.slice();for(let o of r)e!==o.currentState&&(o.timer&&clearTimeout(o.timer),this.removeConnectivityStateWatcher(o),o.callback());e!==Nr.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!==Nr.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(Nr.ConnectivityState.IDLE),this.currentPicker=new u0.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var r,o;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let a=new Date().valueOf()-this.lastActivityTimestamp.valueOf();a>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-a)},e),(o=(r=this.idleTimer).unref)===null||o===void 0||o.call(r)}maybeStartIdleTimer(){this.connectivityState!==Nr.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===Eo.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,o,s,a){let i=(0,a0.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+i+'] method="'+r+'"'),new P1e.LoadBalancingCall(this,e,r,o,s,a,i)}createRetryingCall(e,r,o,s,a){let i=(0,a0.getNextCallNumber)();return this.trace("createRetryingCall ["+i+'] method="'+r+'"'),new c0.RetryingCall(this,e,r,o,s,a,i,this.retryBufferTracker,rT.get(this.getTarget()))}createResolvingCall(e,r,o,s,a){let i=(0,a0.getNextCallNumber)();this.trace("createResolvingCall ["+i+'] method="'+e+'", deadline='+(0,C1e.deadlineToString)(r));let n={deadline:r,flags:a??Eo.Propagate.DEFAULTS,host:o??this.defaultAuthority,parentCall:s},c=new N1e.ResolvingCall(this,e,n,this.filterStackFactory.clone(),i);return this.onCallStart(),c.addStatusWatcher(u=>{this.onCallEnd(u)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Nr.ConnectivityState.SHUTDOWN),this.currentPicker=new d0;for(let r of this.configSelectionQueue)r.cancelWithStatus(Eo.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(Eo.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,Ed.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,tT.uriToString)(this.target)}getConnectivityState(e){let r=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),r}watchConnectivityState(e,r,o){if(this.connectivityState===Nr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let s=null;if(r!==1/0){let i=r instanceof Date?r:new Date(r),n=new Date;if(r===-1/0||i<=n){process.nextTick(o,new Error("Deadline passed without connectivity state change"));return}s=setTimeout(()=>{this.removeConnectivityStateWatcher(a),o(new Error("Deadline passed without connectivity state change"))},i.getTime()-n.getTime())}let a={currentState:e,callback:o,timer:s};this.connectivityStateWatchers.push(a)}getChannelzRef(){return this.channelzRef}createCall(e,r,o,s,a){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===Nr.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,o,s,a)}getOptions(){return this.options}};Ms.InternalChannel=f0});var AM=p(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});nT.ChannelImplementation=void 0;var k1e=vc(),B1e=h0(),m0=class{constructor(e,r,o){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof k1e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(o&&typeof o!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new B1e.InternalChannel(e,r,o)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,r,o){this.internalChannel.watchConnectivityState(e,r,o)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,r,o,s,a){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,o,s,a)}};nT.ChannelImplementation=m0});var bJ=p(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.ServerDuplexStreamImpl=tn.ServerWritableStreamImpl=tn.ServerReadableStreamImpl=tn.ServerUnaryCallImpl=void 0;tn.serverErrorToStatus=v0;var F1e=require("events"),T0=require("stream"),y0=se(),OJ=nt();function v0(t,e){var r;let o={code:y0.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)&&(o.code=t.code,"details"in t&&typeof t.details=="string"&&(o.details=t.details)),o}var _0=class extends F1e.EventEmitter{constructor(e,r,o,s){super(),this.path=e,this.call=r,this.metadata=o,this.request=s,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()}};tn.ServerUnaryCallImpl=_0;var g0=class extends T0.Readable{constructor(e,r,o){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=o,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()}};tn.ServerReadableStreamImpl=g0;var E0=class extends T0.Writable{constructor(e,r,o,s){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=o,this.request=s,this.pendingStatus={code:y0.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new OJ.Metadata,this.on("error",a=>{this.pendingStatus=v0(a),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,o){this.call.sendMessage(e,o)}_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()}};tn.ServerWritableStreamImpl=E0;var S0=class extends T0.Duplex{constructor(e,r,o){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=o,this.pendingStatus={code:y0.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new OJ.Metadata,this.on("error",s=>{this.pendingStatus=v0(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()}_read(e){this.call.startRead()}_write(e,r,o){this.call.sendMessage(e,o)}_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()}};tn.ServerDuplexStreamImpl=S0});var iT=p(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.ServerCredentials=void 0;Hc.createCertificateProviderServerCredentials=V1e;Hc.createServerCredentialsWithInterceptors=G1e;var A0=BN(),Is=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 O0}static createSsl(e,r,o=!1){var s;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 o!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let a=[],i=[];for(let n=0;n<r.length;n++){let c=r[n];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${n}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${n}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${n}].cert_chain must be a Buffer`);a.push(c.cert_chain),i.push(c.private_key)}return new b0({requestCert:o,ciphers:A0.CIPHER_SUITES},{ca:(s=e??(0,A0.getDefaultRootsData)())!==null&&s!==void 0?s:void 0,cert:a,key:i})}};Hc.ServerCredentials=Is;var O0=class t extends Is{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},b0=class t extends Is{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 o=this.options.cert[r],s=e.options.cert[r];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)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 o=this.options.key[r],s=e.options.key[r];if(Buffer.isBuffer(o)&&Buffer.isBuffer(s)){if(!o.equals(s))return!1}else if(o!==s)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},R0=class t extends Is{constructor(e,r,o){super({requestCert:r!==null,rejectUnauthorized:o,ciphers:A0.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=r,this.requireClientCertificate=o,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 V1e(t,e,r){return new R0(t,e,r)}var P0=class t extends Is{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 G1e(t,e){return new P0(t,e)}});var Sd=p(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.durationMessageToDuration=q1e;wi.msToDuration=j1e;wi.durationToMs=H1e;wi.isDuration=z1e;wi.isDurationMessage=$1e;wi.parseDuration=W1e;wi.durationToString=K1e;function q1e(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function j1e(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function H1e(t){return t.seconds*1e3+t.nanos/1e6|0}function z1e(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function $1e(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var Y1e=/^(\d+)(?:\.(\d+))?s$/;function W1e(t){let e=t.match(Y1e);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function K1e(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 sT=p(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.OrcaOobMetricsSubchannelWrapper=dr.GRPC_METRICS_HEADER=dr.ServerMetricRecorder=dr.PerRequestMetricRecorder=void 0;dr.createOrcaClient=NJ;dr.createMetricsReader=rUe;var X1e=eS(),C0=Sd(),J1e=vc(),Q1e=gd(),RJ=se(),Z1e=Ac(),eUe=Ft(),PJ=null;function oT(){if(PJ)return PJ;let t=mI().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,X1e.loadPackageDefinition)(e)}var N0=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 oT().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};dr.PerRequestMetricRecorder=N0;var tUe=3e4,M0=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,C0.durationToMs)((0,C0.durationMessageToDuration)(e.request.report_interval)):tUe,o=setInterval(()=>{e.write(this.message)},r);e.on("cancelled",()=>{clearInterval(o)})}}}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=oT().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};dr.ServerMetricRecorder=M0;function NJ(t){let e=oT().xds.service.orca.v3.OpenRcaService;return new e("unused",J1e.ChannelCredentials.createInsecure(),{channelOverride:t})}dr.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var CJ="grpc_orca_load_report";function rUe(t,e){return(r,o,s)=>{let a=s.getOpaque(CJ);if(a)t(a);else{let i=s.get(dr.GRPC_METRICS_HEADER);i.length>0&&(a=oT().xds.data.orca.v3.OrcaLoadReport.deserialize(i[0]),t(a),s.setOpaque(CJ,a))}e&&e(r,o,s)}}var MJ="orca_oob_metrics",I0=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(MJ,nUe);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)}},x0=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new Z1e.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=NJ(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(MJ),(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()!==eUe.ConnectivityState.READY)return;let r=Math.min(...Array.from(this.dataWatchers).map(o=>o.getInterval()));if(!this.metricsCall||r!==this.currentInterval){(e=this.metricsCall)===null||e===void 0||e.cancel(),this.currentInterval=r;let o=this.client.streamCoreMetrics({report_interval:(0,C0.msToDuration)(r)});this.metricsCall=o,o.on("data",s=>{this.dataWatchers.forEach(a=>{a.onMetricsUpdate(s)})}),o.on("error",s=>{if(this.metricsCall=null,s.code===RJ.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}s.code!==RJ.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},w0=class extends Q1e.BaseSubchannelWrapper{constructor(e,r,o){super(e),this.addDataWatcher(new I0(r,o))}getWrappedSubchannel(){return this.child}};dr.OrcaOobMetricsSubchannelWrapper=w0;function nUe(t){return new x0(t)}});var V0=p(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.BaseServerInterceptingCall=Mr.ServerInterceptingCall=Mr.ResponderBuilder=Mr.ServerListenerBuilder=void 0;Mr.isInterceptingServerListener=sUe;Mr.getServerInterceptingCall=dUe;var uT=nt(),Qt=se(),zc=require("http2"),IJ=NE(),xJ=require("zlib"),iUe=$I(),kJ=Ee(),oUe=require("tls"),wJ=sT(),BJ="server_call";function xs(t){kJ.trace(Qt.LogVerbosity.DEBUG,BJ,t)}var D0=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}}};Mr.ServerListenerBuilder=D0;function sUe(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var U0=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()}},k0=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}}};Mr.ResponderBuilder=k0;var aT={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},cT={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},B0=class{constructor(e,r){var o,s,a,i;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(o=r?.start)!==null&&o!==void 0?o:cT.start,sendMetadata:(s=r?.sendMetadata)!==null&&s!==void 0?s:cT.sendMetadata,sendMessage:(a=r?.sendMessage)!==null&&a!==void 0?a:cT.sendMessage,sendStatus:(i=r?.sendStatus)!==null&&i!==void 0?i:cT.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 o,s,a,i;let n={onReceiveMetadata:(o=r?.onReceiveMetadata)!==null&&o!==void 0?o:aT.onReceiveMetadata,onReceiveMessage:(s=r?.onReceiveMessage)!==null&&s!==void 0?s:aT.onReceiveMessage,onReceiveHalfClose:(a=r?.onReceiveHalfClose)!==null&&a!==void 0?a:aT.onReceiveHalfClose,onCancel:(i=r?.onCancel)!==null&&i!==void 0?i:aT.onCancel},c=new U0(n,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 uT.Metadata),this.responder.sendMessage(e,o=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=o,this.pendingMessageCallback=r):this.nextCall.sendMessage(o,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()}};Mr.ServerInterceptingCall=B0;var FJ="grpc-accept-encoding",F0="grpc-encoding",LJ="grpc-message",DJ="grpc-status",L0="grpc-timeout",aUe=/(\d{1,8})\s*([HMSmun])/,cUe={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},uUe={[FJ]:"identity,deflate,gzip",[F0]:"identity"},UJ={[zc.constants.HTTP2_HEADER_STATUS]:zc.constants.HTTP_STATUS_OK,[zc.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},lUe={waitForTrailers:!0},lT=class{constructor(e,r,o,s,a){var i,n;this.stream=e,this.callEventTracker=o,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=Qt.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=Qt.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 wJ.PerRequestMetricRecorder,this.stream.once("error",h=>{}),this.stream.once("close",()=>{var h;xs("Request to method "+((h=this.handler)===null||h===void 0?void 0:h.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:Qt.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",h=>{this.handleDataFrame(h)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in a&&(this.maxSendMessageSize=a["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in a&&(this.maxReceiveMessageSize=a["grpc.max_receive_message_length"]),this.host=(i=r[":authority"])!==null&&i!==void 0?i:r.host,this.decoder=new iUe.StreamDecoder(this.maxReceiveMessageSize);let c=uT.Metadata.fromHttp2Headers(r);kJ.isTracerEnabled(BJ)&&xs("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let u=c.get(L0);u.length>0&&this.handleTimeoutHeader(u[0]);let l=c.get(F0);l.length>0&&(this.incomingEncoding=l[0]),c.remove(L0),c.remove(F0),c.remove(FJ),c.remove(zc.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove(zc.constants.HTTP2_HEADER_TE),c.remove(zc.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=c;let d=(n=e.session)===null||n===void 0?void 0:n.socket;this.connectionInfo={localAddress:d?.localAddress,localPort:d?.localPort,remoteAddress:d?.remoteAddress,remotePort:d?.remotePort},this.shouldSendMetrics=!!a["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(aUe);if(r===null){let a={code:Qt.Status.INTERNAL,details:`Invalid ${L0} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(a)});return}let o=+r[1]*cUe[r[2]]|0,s=new Date;this.deadline=s.setMilliseconds(s.getMilliseconds()+o),this.deadlineTimer=setTimeout(()=>{let a={code:Qt.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(a)},o)}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 uT.Metadata)}serializeMessage(e){let r=this.handler.serialize(e),o=r.byteLength,s=Buffer.allocUnsafe(o+5);return s.writeUInt8(0,0),s.writeUInt32BE(o,1),r.copy(s,5),s}decompressMessage(e,r){let o=e.subarray(5);if(r==="identity")return o;if(r==="deflate"||r==="gzip"){let s;return r==="deflate"?s=xJ.createInflate():s=xJ.createGunzip(),new Promise((a,i)=>{let n=0,c=[];s.on("data",u=>{c.push(u),n+=u.byteLength,this.maxReceiveMessageSize!==-1&&n>this.maxReceiveMessageSize&&(s.destroy(),i({code:Qt.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),s.on("end",()=>{a(Buffer.concat(c))}),s.write(o),s.end()})}else return Promise.reject({code:Qt.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 o=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",s;try{s=await this.decompressMessage(e.compressedMessage,o)}catch(a){this.sendStatus(a);return}try{e.parsedMessage=this.handler.deserialize(s)}catch(a){this.sendStatus({code:Qt.Status.INTERNAL,details:`Error deserializing request: ${a.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;xs("Request to "+this.handler.path+" received data frame of size "+e.length);let o;try{o=this.decoder.write(e)}catch(s){this.sendStatus({code:Qt.Status.RESOURCE_EXHAUSTED,details:s.message});return}for(let s of o){this.stream.pause();let a={type:"COMPRESSED",compressedMessage:s,parsedMessage:null};this.readQueue.push(a),this.decompressAndMaybePush(a),(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){xs("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,o=Object.assign(Object.assign(Object.assign({},UJ),uUe),r);this.stream.respond(o,lUe)}sendMessage(e,r){if(this.checkCancelled())return;let o;try{o=this.serializeMessage(e)}catch(s){this.sendStatus({code:Qt.Status.INTERNAL,details:`Error serializing response: ${(0,IJ.getErrorMessage)(s)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&o.length-5>this.maxSendMessageSize){this.sendStatus({code:Qt.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${o.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),xs("Request to "+this.handler.path+" sent data frame of size "+o.length),this.stream.write(o,s=>{var a;if(s){this.sendStatus({code:Qt.Status.INTERNAL,details:`Error writing message: ${(0,IJ.getErrorMessage)(s)}`,metadata:null});return}(a=this.callEventTracker)===null||a===void 0||a.addMessageSent(),r()})}sendStatus(e){var r,o,s;if(this.checkCancelled())return;xs("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+Qt.Status[e.code]+" details: "+e.details);let a=(s=(o=e.metadata)===null||o===void 0?void 0:o.clone())!==null&&s!==void 0?s:new uT.Metadata;if(this.shouldSendMetrics&&a.set(wJ.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 i=Object.assign({[DJ]:e.code,[LJ]:encodeURI(e.details)},a.toHttp2Headers());this.stream.sendTrailers(i),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let i=Object.assign(Object.assign({[DJ]:e.code,[LJ]:encodeURI(e.details)},UJ),a.toHttp2Headers());this.stream.respond(i,{endStream:!0}),this.notifyOnCancel()}}startRead(){xs("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 oUe.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}};Mr.BaseServerInterceptingCall=lT;function dUe(t,e,r,o,s,a){let i={path:s.path,requestStream:s.type==="clientStream"||s.type==="bidi",responseStream:s.type==="serverStream"||s.type==="bidi",requestDeserialize:s.deserialize,responseSerialize:s.serialize},n=new lT(e,r,o,s,a);return t.reduce((c,u)=>u(i,c),n)}});var $J=p(To=>{"use strict";var pUe=To&&To.__runInitializers||function(t,e,r){for(var o=arguments.length>2,s=0;s<e.length;s++)r=o?e[s].call(t,r):e[s].call(t);return o?r:void 0},fUe=To&&To.__esDecorate||function(t,e,r,o,s,a){function i(O){if(O!==void 0&&typeof O!="function")throw new TypeError("Function expected");return O}for(var n=o.kind,c=n==="getter"?"get":n==="setter"?"set":"value",u=!e&&t?o.static?t:t.prototype:null,l=e||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),d,h=!1,g=r.length-1;g>=0;g--){var E={};for(var S in o)E[S]=S==="access"?{}:o[S];for(var S in o.access)E.access[S]=o.access[S];E.addInitializer=function(O){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(O||null))};var v=(0,r[g])(n==="accessor"?{get:l.get,set:l.set}:l[c],E);if(n==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(d=i(v.get))&&(l.get=d),(d=i(v.set))&&(l.set=d),(d=i(v.init))&&s.unshift(d)}else(d=i(v))&&(n==="field"?s.unshift(d):l[c]=d)}u&&Object.defineProperty(u,o.name,l),h=!0};Object.defineProperty(To,"__esModule",{value:!0});To.Server=void 0;var Zt=require("http2"),hUe=require("util"),Ve=se(),Wc=bJ(),G0=iT(),VJ=$r(),Yc=Ee(),So=Jt(),rn=Bt(),Ke=mo(),GJ=V0(),$c=~(1<<31),q0=~(1<<31),mUe=2e4,qJ=~(1<<31),{HTTP2_HEADER_PATH:jJ}=Zt.constants,_Ue="server",HJ=Buffer.from("max_age");function zJ(t){Yc.trace(Ve.LogVerbosity.DEBUG,"server_call",t)}function gUe(){}function EUe(t){return function(e,r){return hUe.deprecate(e,t)}}function j0(t){return{code:Ve.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function SUe(t,e){let r=j0(e);switch(t){case"unary":return(o,s)=>{s(r,null)};case"clientStream":return(o,s)=>{s(r,null)};case"serverStream":return o=>{o.emit("error",r)};case"bidi":return o=>{o.emit("error",r)};default:throw new Error(`Invalid handlerType ${t}`)}}var TUe=(()=>{var t;let e=[],r;return t=class{constructor(s){var a,i,n,c,u,l;this.boundPorts=(pUe(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=s??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new Ke.ChannelzTraceStub,this.callTracker=new Ke.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Ke.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Ke.ChannelzChildrenTrackerStub):(this.channelzTrace=new Ke.ChannelzTrace,this.callTracker=new Ke.ChannelzCallTracker,this.listenerChildrenTracker=new Ke.ChannelzChildrenTracker,this.sessionChildrenTracker=new Ke.ChannelzChildrenTracker),this.channelzRef=(0,Ke.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(a=this.options["grpc.max_connection_age_ms"])!==null&&a!==void 0?a:$c,this.maxConnectionAgeGraceMs=(i=this.options["grpc.max_connection_age_grace_ms"])!==null&&i!==void 0?i:$c,this.keepaliveTimeMs=(n=this.options["grpc.keepalive_time_ms"])!==null&&n!==void 0?n:q0,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:mUe,this.sessionIdleTimeout=(u=this.options["grpc.max_connection_idle_ms"])!==null&&u!==void 0?u:qJ,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=(l=this.options.interceptors)!==null&&l!==void 0?l:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(s){var a,i,n;let c=this.sessions.get(s),u=s.socket,l=u.remoteAddress?(0,So.stringToSubchannelAddress)(u.remoteAddress,u.remotePort):null,d=u.localAddress?(0,So.stringToSubchannelAddress)(u.localAddress,u.localPort):null,h;if(s.encrypted){let E=u,S=E.getCipher(),v=E.getCertificate(),O=E.getPeerCertificate();h={cipherSuiteStandardName:(a=S.standardName)!==null&&a!==void 0?a:null,cipherSuiteOtherName:S.standardName?null:S.name,localCertificate:v&&"raw"in v?v.raw:null,remoteCertificate:O&&"raw"in O?O.raw:null}}else h=null;return{remoteAddress:l,localAddress:d,security:h,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:(i=s.state.localWindowSize)!==null&&i!==void 0?i:null,remoteFlowControlWindow:(n=s.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(s){Yc.trace(Ve.LogVerbosity.DEBUG,_Ue,"("+this.channelzRef.id+") "+s)}keepaliveTrace(s){Yc.trace(Ve.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+s)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(s,a){if(s===null||typeof s!="object"||a===null||typeof a!="object")throw new Error("addService() requires two objects as arguments");let i=Object.keys(s);if(i.length===0)throw new Error("Cannot add an empty service to a server");i.forEach(n=>{let c=s[n],u;c.requestStream?c.responseStream?u="bidi":u="clientStream":c.responseStream?u="serverStream":u="unary";let l=a[n],d;if(l===void 0&&typeof c.originalName=="string"&&(l=a[c.originalName]),l!==void 0?d=l.bind(a):d=SUe(u,n),this.register(c.path,d,c.responseSerialize,c.requestDeserialize,u)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(s){if(s===null||typeof s!="object")throw new Error("removeService() requires object as argument");Object.keys(s).forEach(i=>{let n=s[i];this.unregister(n.path)})}bind(s,a){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(s){return(0,Ke.registerChannelzSocket)((0,So.subchannelAddressToString)(s),()=>({localAddress:s,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(s){(0,Ke.unregisterChannelzRef)(s)}createHttp2Server(s){let a;if(s._isSecure()){let i=s._getConstructorOptions(),n=s._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),i),n),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),u=n!==null;this.trace("Initial credentials valid: "+u),a=Zt.createSecureServer(c),a.prependListener("connection",d=>{u||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),a.on("secureConnection",d=>{d.on("error",h=>{this.trace("An incoming TLS connection closed with error: "+h.message)})});let l=d=>{if(d){let h=a;try{h.setSecureContext(d)}catch(g){Yc.log(Ve.LogVerbosity.ERROR,"Failed to set secure context with error "+g.message),d=null}}u=d!==null,this.trace("Post-update credentials valid: "+u)};s._addWatcher(l),a.on("close",()=>{s._removeWatcher(l)})}else a=Zt.createServer(this.commonServerOptions);return a.setTimeout(0,gUe),this._setupHandlers(a,s._getInterceptors()),a}bindOneAddress(s,a){this.trace("Attempting to bind "+(0,So.subchannelAddressToString)(s));let i=this.createHttp2Server(a.credentials);return new Promise((n,c)=>{let u=l=>{this.trace("Failed to bind "+(0,So.subchannelAddressToString)(s)+" with error "+l.message),n({port:"port"in s?s.port:1,error:l.message})};i.once("error",u),i.listen(s,()=>{let l=i.address(),d;typeof l=="string"?d={path:l}:d={host:l.address,port:l.port};let h=this.experimentalRegisterListenerToChannelz(d);this.listenerChildrenTracker.refChild(h),this.http2Servers.set(i,{channelzRef:h,sessions:new Set,ownsChannelzRef:!0}),a.listeningServers.add(i),this.trace("Successfully bound "+(0,So.subchannelAddressToString)(d)),n({port:"port"in d?d.port:1}),i.removeListener("error",u)})})}async bindManyPorts(s,a){if(s.length===0)return{count:0,port:0,errors:[]};if((0,So.isTcpSubchannelAddress)(s[0])&&s[0].port===0){let i=await this.bindOneAddress(s[0],a);if(i.error){let n=await this.bindManyPorts(s.slice(1),a);return Object.assign(Object.assign({},n),{errors:[i.error,...n.errors]})}else{let n=s.slice(1).map(l=>(0,So.isTcpSubchannelAddress)(l)?{host:l.host,port:i.port}:l),c=await Promise.all(n.map(l=>this.bindOneAddress(l,a))),u=[i,...c];return{count:u.filter(l=>l.error===void 0).length,port:i.port,errors:u.filter(l=>l.error).map(l=>l.error)}}}else{let i=await Promise.all(s.map(n=>this.bindOneAddress(n,a)));return{count:i.filter(n=>n.error===void 0).length,port:i[0].port,errors:i.filter(n=>n.error).map(n=>n.error)}}}async bindAddressList(s,a){let i=await this.bindManyPorts(s,a);if(i.count>0)return i.count<s.length&&Yc.log(Ve.LogVerbosity.INFO,`WARNING Only ${i.count} addresses added out of total ${s.length} resolved`),i.port;{let n=`No address added out of total ${s.length} resolved`;throw Yc.log(Ve.LogVerbosity.ERROR,n),new Error(`${n} errors: [${i.errors.join(",")}]`)}}resolvePort(s){return new Promise((a,i)=>{let n=!1,c=(l,d,h,g)=>{if(n)return!0;if(n=!0,!l.ok)return i(new Error(l.error.details)),!0;let E=[].concat(...l.value.map(S=>S.addresses));return E.length===0?(i(new Error(`No addresses resolved for port ${s}`)),!0):(a(E),!0)};(0,VJ.createResolver)(s,c,this.options).updateResolution()})}async bindPort(s,a){let i=await this.resolvePort(s);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");let n=await this.bindAddressList(i,a);if(a.cancelled)throw this.completeUnbind(a),new Error("bindAsync operation cancelled by unbind call");return n}normalizePort(s){let a=(0,rn.parseUri)(s);if(a===null)throw new Error(`Could not parse port "${s}"`);let i=(0,VJ.mapUriDefaultScheme)(a);if(i===null)throw new Error(`Could not get a default scheme for port "${s}"`);return i}bindAsync(s,a,i){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof s!="string")throw new TypeError("port must be a string");if(a===null||!(a instanceof G0.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof i!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+s);let n=this.normalizePort(s),c=(h,g)=>{process.nextTick(()=>i(h,g))},u=this.boundPorts.get((0,rn.uriToString)(n));if(u){if(!a._equals(u.credentials)){c(new Error(`${s} already bound with incompatible credentials`),0);return}u.cancelled=!1,u.completionPromise?u.completionPromise.then(h=>i(null,h),h=>i(h,0)):c(null,u.portNumber);return}u={mapKey:(0,rn.uriToString)(n),originalUri:n,completionPromise:null,cancelled:!1,portNumber:0,credentials:a,listeningServers:new Set};let l=(0,rn.splitHostPort)(n.path),d=this.bindPort(n,u);u.completionPromise=d,l?.port===0?d.then(h=>{let g={scheme:n.scheme,authority:n.authority,path:(0,rn.combineHostPort)({host:l.host,port:h})};u.mapKey=(0,rn.uriToString)(g),u.completionPromise=null,u.portNumber=h,this.boundPorts.set(u.mapKey,u),i(null,h)},h=>{i(h,0)}):(this.boundPorts.set(u.mapKey,u),d.then(h=>{u.completionPromise=null,u.portNumber=h,i(null,h)},h=>{i(h,0)}))}registerInjectorToChannelz(){return(0,Ke.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(s,a,i=!1){if(s===null||!(s instanceof G0.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(a);let n=this.createHttp2Server(s),c=new Set;return this.http2Servers.set(n,{channelzRef:a,sessions:c,ownsChannelzRef:i}),{injectConnection:u=>{n.emit("connection",u)},drain:u=>{var l,d;for(let h of c)this.closeSession(h);(d=(l=setTimeout(()=>{for(let h of c)h.destroy(Zt.constants.NGHTTP2_CANCEL)},u)).unref)===null||d===void 0||d.call(l)},destroy:()=>{this.closeServer(n);for(let u of c)this.closeSession(u)}}}createConnectionInjector(s){if(s===null||!(s instanceof G0.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let a=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(s,a,!0)}closeServer(s,a){this.trace("Closing server with address "+JSON.stringify(s.address()));let i=this.http2Servers.get(s);s.close(()=>{i&&i.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(i.channelzRef),(0,Ke.unregisterChannelzRef)(i.channelzRef)),this.http2Servers.delete(s),a?.()})}closeSession(s,a){var i;this.trace("Closing session initiated by "+((i=s.socket)===null||i===void 0?void 0:i.remoteAddress));let n=this.sessions.get(s),c=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,Ke.unregisterChannelzRef)(n.ref)),a?.()};s.closed?queueMicrotask(c):s.close(c)}completeUnbind(s){for(let a of s.listeningServers){let i=this.http2Servers.get(a);if(this.closeServer(a,()=>{s.listeningServers.delete(a)}),i)for(let n of i.sessions)this.closeSession(n)}this.boundPorts.delete(s.mapKey)}unbind(s){this.trace("unbind port="+s);let a=this.normalizePort(s),i=(0,rn.splitHostPort)(a.path);if(i?.port===0)throw new Error("Cannot unbind port 0");let n=this.boundPorts.get((0,rn.uriToString)(a));n&&(this.trace("unbinding "+n.mapKey+" originally bound as "+(0,rn.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(s,a){var i,n;this.trace("drain port="+s+" graceTimeMs="+a);let c=this.normalizePort(s),u=(0,rn.splitHostPort)(c.path);if(u?.port===0)throw new Error("Cannot drain port 0");let l=this.boundPorts.get((0,rn.uriToString)(c));if(!l)return;let d=new Set;for(let h of l.listeningServers){let g=this.http2Servers.get(h);if(g)for(let E of g.sessions)d.add(E),this.closeSession(E,()=>{d.delete(E)})}(n=(i=setTimeout(()=>{for(let h of d)h.destroy(Zt.constants.NGHTTP2_CANCEL)},a)).unref)===null||n===void 0||n.call(i)}forceShutdown(){for(let s of this.boundPorts.values())s.cancelled=!0;this.boundPorts.clear();for(let s of this.http2Servers.keys())this.closeServer(s);this.sessions.forEach((s,a)=>{this.closeSession(a),a.destroy(Zt.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Ke.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(s,a,i,n,c){return this.handlers.has(s)?!1:(this.handlers.set(s,{func:a,serialize:i,deserialize:n,type:c,path:s}),!0)}unregister(s){return this.handlers.delete(s)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(s=>!s.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(s){var a;let i=u=>{(0,Ke.unregisterChannelzRef)(this.channelzRef),s(u)},n=0;function c(){n--,n===0&&i()}this.shutdown=!0;for(let[u,l]of this.http2Servers.entries()){n++;let d=l.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(u,()=>{this.trace("Server "+d+" finished closing"),c()});for(let h of l.sessions.keys()){n++;let g=(a=h.socket)===null||a===void 0?void 0:a.remoteAddress;this.trace("Waiting for session "+g+" to close"),this.closeSession(h,()=>{this.trace("Session "+g+" finished closing"),c()})}}n===0&&i()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(s,a){let i=a[Zt.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof i!="string"||!i.startsWith("application/grpc")?(s.respond({[Zt.constants.HTTP2_HEADER_STATUS]:Zt.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(s){zJ("Received call to method "+s+" at address "+this.serverAddressString);let a=this.handlers.get(s);return a===void 0?(zJ("No handler registered for method "+s+". Sending UNIMPLEMENTED status."),null):a}_respondWithError(s,a,i=null){var n,c;let u=Object.assign({"grpc-status":(n=s.code)!==null&&n!==void 0?n:Ve.Status.INTERNAL,"grpc-message":s.details,[Zt.constants.HTTP2_HEADER_STATUS]:Zt.constants.HTTP_STATUS_OK,[Zt.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=s.metadata)===null||c===void 0?void 0:c.toHttp2Headers());a.respond(u,{endStream:!0}),this.callTracker.addCallFailed(),i?.streamTracker.addCallFailed()}_channelzHandler(s,a,i){this.onStreamOpened(a);let n=this.sessions.get(a.session);if(this.callTracker.addCallStarted(),n?.streamTracker.addCallStarted(),!this._verifyContentType(a,i)){this.callTracker.addCallFailed(),n?.streamTracker.addCallFailed();return}let c=i[jJ],u=this._retrieveHandler(c);if(!u){this._respondWithError(j0(c),a,n);return}let l={addMessageSent:()=>{n&&(n.messagesSent+=1,n.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{n&&(n.messagesReceived+=1,n.lastMessageReceivedTimestamp=new Date)},onCallEnd:h=>{h.code===Ve.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:h=>{n&&(h?n.streamTracker.addCallSucceeded():n.streamTracker.addCallFailed())}},d=(0,GJ.getServerInterceptingCall)([...s,...this.interceptors],a,i,l,u,this.options);this._runHandlerForCall(d,u)||(this.callTracker.addCallFailed(),n?.streamTracker.addCallFailed(),d.sendStatus({code:Ve.Status.INTERNAL,details:`Unknown handler type: ${u.type}`}))}_streamHandler(s,a,i){if(this.onStreamOpened(a),this._verifyContentType(a,i)!==!0)return;let n=i[jJ],c=this._retrieveHandler(n);if(!c){this._respondWithError(j0(n),a,null);return}let u=(0,GJ.getServerInterceptingCall)([...s,...this.interceptors],a,i,null,c,this.options);this._runHandlerForCall(u,c)||u.sendStatus({code:Ve.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(s,a){let{type:i}=a;if(i==="unary")yUe(s,a);else if(i==="clientStream")vUe(s,a);else if(i==="serverStream")AUe(s,a);else if(i==="bidi")OUe(s,a);else return!1;return!0}_setupHandlers(s,a){if(s===null)return;let i=s.address(),n="null";i&&(typeof i=="string"?n=i:n=i.address+":"+i.port),this.serverAddressString=n;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,u=this.channelzEnabled?this._channelzSessionHandler(s):this._sessionHandler(s);s.on("stream",c.bind(this,a)),s.on("session",u)}_sessionHandler(s){return a=>{var i,n;(i=this.http2Servers.get(s))===null||i===void 0||i.sessions.add(a);let c=null,u=null,l=null,d=!1,h=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==$c){let O=this.maxConnectionAgeMs/10,I=Math.random()*O*2-O;c=setTimeout(()=>{var j,A;d=!0,this.trace("Connection dropped by max connection age: "+((j=a.socket)===null||j===void 0?void 0:j.remoteAddress));try{a.goaway(Zt.constants.NGHTTP2_NO_ERROR,~(1<<31),HJ)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==$c&&(u=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(A=u.unref)===null||A===void 0||A.call(u))},this.maxConnectionAgeMs+I),(n=c.unref)===null||n===void 0||n.call(c)}let g=()=>{l&&(clearTimeout(l),l=null)},E=()=>!a.destroyed&&this.keepaliveTimeMs<q0&&this.keepaliveTimeMs>0,S,v=()=>{var O;E()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),l=setTimeout(()=>{g(),S()},this.keepaliveTimeMs),(O=l.unref)===null||O===void 0||O.call(l))};S=()=>{var O;if(!E())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let I="";try{a.ping((A,z,H)=>{g(),A?(this.keepaliveTrace("Ping failed with error: "+A.message),d=!0,a.close()):(this.keepaliveTrace("Received ping response"),v())})||(I="Ping returned false")}catch(j){I=(j instanceof Error?j.message:"")||"Unknown error"}if(I){this.keepaliveTrace("Ping send failed: "+I),this.trace("Connection dropped due to ping send error: "+I),d=!0,a.close();return}l=setTimeout(()=>{g(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,a.close()},this.keepaliveTimeoutMs),(O=l.unref)===null||O===void 0||O.call(l)},v(),a.on("close",()=>{var O,I;d||this.trace(`Connection dropped by client ${(O=a.socket)===null||O===void 0?void 0:O.remoteAddress}`),c&&clearTimeout(c),u&&clearTimeout(u),g(),h!==null&&(clearTimeout(h.timeout),this.sessionIdleTimeouts.delete(a)),(I=this.http2Servers.get(s))===null||I===void 0||I.sessions.delete(a)})}}_channelzSessionHandler(s){return a=>{var i,n,c,u;let l=(0,Ke.registerChannelzSocket)((n=(i=a.socket)===null||i===void 0?void 0:i.remoteAddress)!==null&&n!==void 0?n:"unknown",this.getChannelzSessionInfo.bind(this,a),this.channelzEnabled),d={ref:l,streamTracker:new Ke.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(s))===null||c===void 0||c.sessions.add(a),this.sessions.set(a,d);let h=`${a.socket.remoteAddress}:${a.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+h),this.trace("Connection established by client "+h),this.sessionChildrenTracker.refChild(l);let g=null,E=null,S=null,v=!1,O=this.enableIdleTimeout(a);if(this.maxConnectionAgeMs!==$c){let H=this.maxConnectionAgeMs/10,Q=Math.random()*H*2-H;g=setTimeout(()=>{var oe;v=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+h);try{a.goaway(Zt.constants.NGHTTP2_NO_ERROR,~(1<<31),HJ)}catch{a.destroy();return}a.close(),this.maxConnectionAgeGraceMs!==$c&&(E=setTimeout(()=>{a.destroy()},this.maxConnectionAgeGraceMs),(oe=E.unref)===null||oe===void 0||oe.call(E))},this.maxConnectionAgeMs+Q),(u=g.unref)===null||u===void 0||u.call(g)}let I=()=>{S&&(clearTimeout(S),S=null)},j=()=>!a.destroyed&&this.keepaliveTimeMs<q0&&this.keepaliveTimeMs>0,A,z=()=>{var H;j()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),S=setTimeout(()=>{I(),A()},this.keepaliveTimeMs),(H=S.unref)===null||H===void 0||H.call(S))};A=()=>{var H;if(!j())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let Q="";try{a.ping((te,Z,R)=>{I(),te?(this.keepaliveTrace("Ping failed with error: "+te.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+te.message+" return in "+Z),v=!0,a.close()):(this.keepaliveTrace("Received ping response"),z())})||(Q="Ping returned false")}catch(oe){Q=(oe instanceof Error?oe.message:"")||"Unknown error"}if(Q){this.keepaliveTrace("Ping send failed: "+Q),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+Q),v=!0,a.close();return}d.keepAlivesSent+=1,S=setTimeout(()=>{I(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+h),v=!0,a.close()},this.keepaliveTimeoutMs),(H=S.unref)===null||H===void 0||H.call(S)},z(),a.on("close",()=>{var H;v||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+h),this.sessionChildrenTracker.unrefChild(l),(0,Ke.unregisterChannelzRef)(l),g&&clearTimeout(g),E&&clearTimeout(E),I(),O!==null&&(clearTimeout(O.timeout),this.sessionIdleTimeouts.delete(a)),(H=this.http2Servers.get(s))===null||H===void 0||H.sessions.delete(a),this.sessions.delete(a)})}}enableIdleTimeout(s){var a,i;if(this.sessionIdleTimeout>=qJ)return null;let n={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,s),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,s)};(i=(a=n.timeout).unref)===null||i===void 0||i.call(a),this.sessionIdleTimeouts.set(s,n);let{socket:c}=s;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),n}onIdleTimeout(s,a){let{socket:i}=a,n=s.sessionIdleTimeouts.get(a);n!==void 0&&n.activeStreams===0&&(Date.now()-n.lastIdle>=s.sessionIdleTimeout?(s.trace("Session idle timeout triggered for "+i?.remoteAddress+":"+i?.remotePort+" last idle at "+n.lastIdle),s.closeSession(a)):n.timeout.refresh())}onStreamOpened(s){let a=s.session,i=this.sessionIdleTimeouts.get(a);i&&(i.activeStreams+=1,s.once("close",i.onClose))}onStreamClose(s){var a,i;let n=this.sessionIdleTimeouts.get(s);n&&(n.activeStreams-=1,n.activeStreams===0&&(n.lastIdle=Date.now(),n.timeout.refresh(),this.trace("Session onStreamClose"+((a=s.socket)===null||a===void 0?void 0:a.remoteAddress)+":"+((i=s.socket)===null||i===void 0?void 0:i.remotePort)+" at "+n.lastIdle)))}},(()=>{let o=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[EUe("Calling start() is no longer necessary. It can be safely omitted.")],fUe(t,null,r,{kind:"method",name:"start",static:!1,private:!1,access:{has:s=>"start"in s,get:s=>s.start},metadata:o},null,e),o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})})(),t})();To.Server=TUe;async function yUe(t,e){let r;function o(i,n,c,u){if(i){t.sendStatus((0,Wc.serverErrorToStatus)(i,c));return}t.sendMessage(n,()=>{t.sendStatus({code:Ve.Status.OK,details:"OK",metadata:c??null})})}let s,a=null;t.start({onReceiveMetadata(i){s=i,t.startRead()},onReceiveMessage(i){if(a){t.sendStatus({code:Ve.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}a=i,t.startRead()},onReceiveHalfClose(){if(!a){t.sendStatus({code:Ve.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Wc.ServerWritableStreamImpl(e.path,t,s,a);try{e.func(r,o)}catch(i){t.sendStatus({code:Ve.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function vUe(t,e){let r;function o(s,a,i,n){if(s){t.sendStatus((0,Wc.serverErrorToStatus)(s,i));return}t.sendMessage(a,()=>{t.sendStatus({code:Ve.Status.OK,details:"OK",metadata:i??null})})}t.start({onReceiveMetadata(s){r=new Wc.ServerDuplexStreamImpl(e.path,t,s);try{e.func(r,o)}catch(a){t.sendStatus({code:Ve.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onReceiveMessage(s){r.push(s)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function AUe(t,e){let r,o,s=null;t.start({onReceiveMetadata(a){o=a,t.startRead()},onReceiveMessage(a){if(s){t.sendStatus({code:Ve.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}s=a,t.startRead()},onReceiveHalfClose(){if(!s){t.sendStatus({code:Ve.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new Wc.ServerWritableStreamImpl(e.path,t,o,s);try{e.func(r)}catch(a){t.sendStatus({code:Ve.Status.UNKNOWN,details:`Server method handler threw error ${a.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function OUe(t,e){let r;t.start({onReceiveMetadata(o){r=new Wc.ServerDuplexStreamImpl(e.path,t,o);try{e.func(r)}catch(s){t.sendStatus({code:Ve.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onReceiveMessage(o){r.push(o)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}});var YJ=p(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});dT.StatusBuilder=void 0;var H0=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}};dT.StatusBuilder=H0});var Ad=p(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.LeafLoadBalancer=ni.PickFirstLoadBalancer=ni.PickFirstLoadBalancingConfig=void 0;ni.shuffled=JJ;ni.setup=xUe;var z0=oo(),Ge=Ft(),yo=Ai(),WJ=Jt(),bUe=Ee(),RUe=se(),KJ=Jt(),XJ=require("net"),PUe=gs(),CUe="pick_first";function Td(t){bUe.trace(RUe.LogVerbosity.DEBUG,CUe,t)}var yd="pick_first",NUe=250,Kc=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return yd}toJsonObject(){return{[yd]:{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)}};ni.PickFirstLoadBalancingConfig=Kc;var $0=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:yo.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function JJ(t){let e=t.slice();for(let r=e.length-1;r>1;r--){let o=Math.floor(Math.random()*(r+1)),s=e[r];e[r]=e[o],e[o]=s}return e}function MUe(t){if(t.length===0)return[];let e=[],r=[],o=[],s=(0,KJ.isTcpSubchannelAddress)(t[0])&&(0,XJ.isIPv6)(t[0].host);for(let n of t)(0,KJ.isTcpSubchannelAddress)(n)&&(0,XJ.isIPv6)(n.host)?r.push(n):o.push(n);let a=s?r:o,i=s?o:r;for(let n=0;n<Math.max(a.length,i.length);n++)n<a.length&&e.push(a[n]),n<i.length&&e.push(i[n]);return e}var QJ="grpc-node.internal.pick-first.report_health_status",vd=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Ge.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,o,s,a,i)=>{this.onSubchannelStateUpdate(r,o,s,i)},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(Ge.ConnectivityState.TRANSIENT_FAILURE,new yo.UnavailablePicker({details:r}),r)}else this.updateState(Ge.ConnectivityState.READY,new $0(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(Ge.ConnectivityState.TRANSIENT_FAILURE,new yo.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(Ge.ConnectivityState.IDLE,new yo.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(Ge.ConnectivityState.TRANSIENT_FAILURE,new yo.UnavailablePicker({details:r}),r)}else this.updateState(Ge.ConnectivityState.CONNECTING,new yo.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,o,s){var a;if(!((a=this.currentPick)===null||a===void 0)&&a.realSubchannelEquals(e)){o!==Ge.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[i,n]of this.children.entries())if(e.realSubchannelEquals(n.subchannel)){o===Ge.ConnectivityState.READY&&this.pickSubchannel(n.subchannel),o===Ge.ConnectivityState.TRANSIENT_FAILURE&&(n.hasReportedTransientFailure=!0,s&&(this.lastError=s),this.maybeEnterStickyTransientFailureMode(),i===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(i+1)),n.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[r,o]of this.children.entries())if(r>=e){let s=o.subchannel.getConnectivityState();if(s===Ge.ConnectivityState.IDLE||s===Ge.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,o;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===Ge.ConnectivityState.IDLE&&(Td("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var s;(s=this.children[e])===null||s===void 0||s.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},NUe),(o=(r=this.connectionDelayTimeout).unref)===null||o===void 0||o.call(r)}pickSubchannel(e){Td("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,o){Td(Ge.ConnectivityState[this.currentState]+" -> "+Ge.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,o)}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){Td("connectToAddressList(["+e.map(s=>(0,WJ.subchannelAddressToString)(s))+"])");let o=e.map(s=>({subchannel:this.channelControlHelper.createSubchannel(s,r),hasReportedTransientFailure:!1}));for(let{subchannel:s}of o)if(s.getConnectivityState()===Ge.ConnectivityState.READY){this.pickSubchannel(s);return}for(let{subchannel:s}of o)s.ref(),this.channelControlHelper.addChannelzChild(s.getChannelzRef());this.resetSubchannelList(),this.children=o;for(let{subchannel:s}of this.children)s.addConnectivityStateListener(this.subchannelStateListener);for(let s of this.children)s.subchannel.getConnectivityState()===Ge.ConnectivityState.TRANSIENT_FAILURE&&(s.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,o,s){if(!(r instanceof Kc))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(Ge.ConnectivityState.TRANSIENT_FAILURE,new yo.UnavailablePicker(e.error),e.error.details),!0;let a=e.value;this.reportHealthStatus=o[QJ],r.getShuffleAddressList()&&(a=JJ(a));let i=[].concat(...a.map(c=>c.addresses));Td("updateAddressList(["+i.map(c=>(0,WJ.subchannelAddressToString)(c))+"])");let n=MUe(i);return this.latestAddressList=n,this.latestOptions=o,this.connectToAddressList(n,o),this.latestResolutionNote=s,i.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===Ge.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return yd}};ni.PickFirstLoadBalancer=vd;var IUe=new Kc(!1),Y0=class{constructor(e,r,o,s){this.endpoint=e,this.options=o,this.resolutionNote=s,this.latestState=Ge.ConnectivityState.IDLE;let a=(0,z0.createChildChannelControlHelper)(r,{updateState:(i,n,c)=>{this.latestState=i,this.latestPicker=n,r.updateState(i,n,c)}});this.pickFirstBalancer=new vd(a),this.latestPicker=new yo.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,PUe.statusOrFromValue)([this.endpoint]),IUe,Object.assign(Object.assign({},this.options),{[QJ]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==Ge.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};ni.LeafLoadBalancer=Y0;function xUe(){(0,z0.registerLoadBalancerType)(yd,vd,Kc),(0,z0.registerDefaultLoadBalancerType)(yd)}});var ZJ=p(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});fT.FileWatcherCertificateProvider=void 0;var wUe=require("fs"),LUe=Ee(),DUe=se(),UUe=require("util"),kUe="certificate_provider";function pT(t){LUe.trace(DUe.LogVerbosity.DEBUG,kUe,t)}var W0=(0,UUe.promisify)(wUe.readFile),K0=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");pT("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?W0(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?W0(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?W0(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,o])=>{if(this.refreshTimer){pT("File watcher read certificates certificate "+e.status+", privateKey "+r.status+", CA certificate "+o.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,o.status==="fulfilled"?this.latestCaUpdate={caCertificate:o.value}:this.latestCaUpdate=null;for(let s of this.identityListeners)s(this.latestIdentityUpdate);for(let s of this.caListeners)s(this.latestCaUpdate)}}),pT("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),pT("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()}};fT.FileWatcherCertificateProvider=K0});var Q0=p(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=G.createCertificateProviderChannelCredentials=G.FileWatcherCertificateProvider=G.createCertificateProviderServerCredentials=G.createServerCredentialsWithInterceptors=G.BaseSubchannelWrapper=G.registerAdminService=G.FilterStackFactory=G.BaseFilter=G.statusOrFromError=G.statusOrFromValue=G.PickResultType=G.QueuePicker=G.UnavailablePicker=G.ChildLoadBalancerHandler=G.EndpointMap=G.endpointHasAddress=G.endpointToString=G.subchannelAddressToString=G.LeafLoadBalancer=G.isLoadBalancerNameRegistered=G.parseLoadBalancingConfig=G.selectLbConfigFromList=G.registerLoadBalancerType=G.createChildChannelControlHelper=G.BackoffTimeout=G.parseDuration=G.durationToMs=G.splitHostPort=G.uriToString=G.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=G.createResolver=G.registerResolver=G.log=G.trace=void 0;var e7=Ee();Object.defineProperty(G,"trace",{enumerable:!0,get:function(){return e7.trace}});Object.defineProperty(G,"log",{enumerable:!0,get:function(){return e7.log}});var X0=$r();Object.defineProperty(G,"registerResolver",{enumerable:!0,get:function(){return X0.registerResolver}});Object.defineProperty(G,"createResolver",{enumerable:!0,get:function(){return X0.createResolver}});Object.defineProperty(G,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return X0.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var t7=Bt();Object.defineProperty(G,"uriToString",{enumerable:!0,get:function(){return t7.uriToString}});Object.defineProperty(G,"splitHostPort",{enumerable:!0,get:function(){return t7.splitHostPort}});var r7=Sd();Object.defineProperty(G,"durationToMs",{enumerable:!0,get:function(){return r7.durationToMs}});Object.defineProperty(G,"parseDuration",{enumerable:!0,get:function(){return r7.parseDuration}});var BUe=Ac();Object.defineProperty(G,"BackoffTimeout",{enumerable:!0,get:function(){return BUe.BackoffTimeout}});var Od=oo();Object.defineProperty(G,"createChildChannelControlHelper",{enumerable:!0,get:function(){return Od.createChildChannelControlHelper}});Object.defineProperty(G,"registerLoadBalancerType",{enumerable:!0,get:function(){return Od.registerLoadBalancerType}});Object.defineProperty(G,"selectLbConfigFromList",{enumerable:!0,get:function(){return Od.selectLbConfigFromList}});Object.defineProperty(G,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return Od.parseLoadBalancingConfig}});Object.defineProperty(G,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return Od.isLoadBalancerNameRegistered}});var FUe=Ad();Object.defineProperty(G,"LeafLoadBalancer",{enumerable:!0,get:function(){return FUe.LeafLoadBalancer}});var hT=Jt();Object.defineProperty(G,"subchannelAddressToString",{enumerable:!0,get:function(){return hT.subchannelAddressToString}});Object.defineProperty(G,"endpointToString",{enumerable:!0,get:function(){return hT.endpointToString}});Object.defineProperty(G,"endpointHasAddress",{enumerable:!0,get:function(){return hT.endpointHasAddress}});Object.defineProperty(G,"EndpointMap",{enumerable:!0,get:function(){return hT.EndpointMap}});var VUe=HE();Object.defineProperty(G,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return VUe.ChildLoadBalancerHandler}});var J0=Ai();Object.defineProperty(G,"UnavailablePicker",{enumerable:!0,get:function(){return J0.UnavailablePicker}});Object.defineProperty(G,"QueuePicker",{enumerable:!0,get:function(){return J0.QueuePicker}});Object.defineProperty(G,"PickResultType",{enumerable:!0,get:function(){return J0.PickResultType}});var n7=gs();Object.defineProperty(G,"statusOrFromValue",{enumerable:!0,get:function(){return n7.statusOrFromValue}});Object.defineProperty(G,"statusOrFromError",{enumerable:!0,get:function(){return n7.statusOrFromError}});var GUe=RI();Object.defineProperty(G,"BaseFilter",{enumerable:!0,get:function(){return GUe.BaseFilter}});var qUe=kS();Object.defineProperty(G,"FilterStackFactory",{enumerable:!0,get:function(){return qUe.FilterStackFactory}});var jUe=KE();Object.defineProperty(G,"registerAdminService",{enumerable:!0,get:function(){return jUe.registerAdminService}});var HUe=gd();Object.defineProperty(G,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return HUe.BaseSubchannelWrapper}});var i7=iT();Object.defineProperty(G,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return i7.createServerCredentialsWithInterceptors}});Object.defineProperty(G,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return i7.createCertificateProviderServerCredentials}});var zUe=ZJ();Object.defineProperty(G,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return zUe.FileWatcherCertificateProvider}});var $Ue=vc();Object.defineProperty(G,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return $Ue.createCertificateProviderChannelCredentials}});var YUe=h0();Object.defineProperty(G,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return YUe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var o7=p(ex=>{"use strict";Object.defineProperty(ex,"__esModule",{value:!0});ex.setup=XUe;var WUe=$r(),KUe=gs(),Z0=class{constructor(e,r,o){this.listener=r,this.hasReturnedResult=!1,this.endpoints=[];let s;e.authority===""?s="/"+e.path:s=e.path,this.endpoints=[{addresses:[{path:s}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,KUe.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function XUe(){(0,WUe.registerResolver)("unix",Z0)}});var d7=p(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:!0});ix.setup=tke;var s7=require("net"),a7=gs(),mT=se(),tx=nt(),c7=$r(),JUe=Jt(),u7=Bt(),QUe=Ee(),ZUe="ip_resolver";function l7(t){QUe.trace(mT.LogVerbosity.DEBUG,ZUe,t)}var rx="ipv4",nx="ipv6",eke=443,_T=class{constructor(e,r,o){var s;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,l7("Resolver constructed for target "+(0,u7.uriToString)(e));let a=[];if(!(e.scheme===rx||e.scheme===nx)){this.error={code:mT.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new tx.Metadata};return}let i=e.path.split(",");for(let n of i){let c=(0,u7.splitHostPort)(n);if(c===null){this.error={code:mT.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new tx.Metadata};return}if(e.scheme===rx&&!(0,s7.isIPv4)(c.host)||e.scheme===nx&&!(0,s7.isIPv6)(c.host)){this.error={code:mT.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new tx.Metadata};return}a.push({host:c.host,port:(s=c.port)!==null&&s!==void 0?s:eke})}this.endpoints=a.map(n=>({addresses:[n]})),l7("Parsed "+e.scheme+" address list "+a.map(JUe.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,a7.statusOrFromError)(this.error),{},null,""):this.listener((0,a7.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function tke(){(0,c7.registerResolver)(rx,_T),(0,c7.registerResolver)(nx,_T)}});var m7=p(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.RoundRobinLoadBalancer=void 0;Rd.setup=ake;var h7=oo(),mt=Ft(),bd=Ai(),rke=Ee(),nke=se(),p7=Jt(),ike=Ad(),oke="round_robin";function f7(t){rke.trace(nke.LogVerbosity.DEBUG,oke,t)}var gT="round_robin",ET=class t{getLoadBalancerName(){return gT}constructor(){}toJsonObject(){return{[gT]:{}}}static createFromJson(e){return new t}},ox=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 ske(t,e){return[...t.slice(e),...t.slice(0,e)]}var ST=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=mt.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,h7.createChildChannelControlHelper)(e,{updateState:(r,o,s)=>{this.currentState===mt.ConnectivityState.READY&&r!==mt.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),s&&(this.lastError=s),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(r=>r.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(mt.ConnectivityState.READY)>0){let e=this.children.filter(o=>o.getConnectivityState()===mt.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let o=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(s=>(0,p7.endpointEqual)(s.getEndpoint(),o)),r<0&&(r=0)}this.updateState(mt.ConnectivityState.READY,new ox(e.map(o=>({endpoint:o.getEndpoint(),picker:o.getPicker()})),r),null)}else if(this.countChildrenWithState(mt.ConnectivityState.CONNECTING)>0)this.updateState(mt.ConnectivityState.CONNECTING,new bd.QueuePicker(this),null);else if(this.countChildrenWithState(mt.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(mt.ConnectivityState.TRANSIENT_FAILURE,new bd.UnavailablePicker({details:e}),e)}else this.updateState(mt.ConnectivityState.IDLE,new bd.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===mt.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,o){f7(mt.ConnectivityState[this.currentState]+" -> "+mt.ConnectivityState[e]),e===mt.ConnectivityState.READY?this.currentReadyPicker=r:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,r,o)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,r,o,s){if(!(r instanceof ET))return!1;if(!e.ok)return this.children.length===0&&this.updateState(mt.ConnectivityState.TRANSIENT_FAILURE,new bd.UnavailablePicker(e.error),e.error.details),!0;let a=Math.random()*e.value.length|0,i=ske(e.value,a);if(this.resetSubchannelList(),i.length===0){let n=`No addresses resolved. Resolution note: ${s}`;this.updateState(mt.ConnectivityState.TRANSIENT_FAILURE,new bd.UnavailablePicker({details:n}),n)}f7("Connect to endpoint list "+i.map(p7.endpointToString)),this.updatesPaused=!0,this.children=i.map(n=>new ike.LeafLoadBalancer(n,this.childChannelControlHelper,o,s));for(let n of this.children)n.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return gT}};Rd.RoundRobinLoadBalancer=ST;function ake(){(0,h7.registerLoadBalancerType)(gT,ST,ET)}});var E7=p(Ls=>{"use strict";var sx;Object.defineProperty(Ls,"__esModule",{value:!0});Ls.OutlierDetectionLoadBalancer=Ls.OutlierDetectionLoadBalancingConfig=void 0;Ls.setup=Eke;var cke=Ft(),_7=se(),ws=Sd(),g7=Q0(),uke=oo(),lke=HE(),dke=Ai(),ax=Jt(),pke=gd(),fke=Ee(),hke="outlier_detection";function st(t){fke.trace(_7.LogVerbosity.DEBUG,hke,t)}var fx="outlier_detection",mke=((sx=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&sx!==void 0?sx:"true")==="true",_ke={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},gke={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Xc(t,e,r,o){if(e in t&&t[e]!==void 0&&typeof t[e]!==r){let s=o?`${o}.${e}`:e;throw new Error(`outlier detection config ${s} parse error: expected ${r}, got ${typeof t[e]}`)}}function cx(t,e,r){let o=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,ws.isDuration)(t[e]))throw new Error(`outlier detection config ${o} 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 ${o} parse error: values out of range for non-negative Duaration`)}}function TT(t,e,r){let o=r?`${r}.${e}`:e;if(Xc(t,e,"number",r),e in t&&t[e]!==void 0&&!(t[e]>=0&&t[e]<=100))throw new Error(`outlier detection config ${o} parse error: value out of range for percentage (0-100)`)}var Pd=class t{constructor(e,r,o,s,a,i,n){if(this.childPolicy=n,n.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=o??3e5,this.maxEjectionPercent=s??10,this.successRateEjection=a?Object.assign(Object.assign({},_ke),a):null,this.failurePercentageEjection=i?Object.assign(Object.assign({},gke),i):null}getLoadBalancerName(){return fx}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,ws.msToDuration)(this.intervalMs),base_ejection_time:(0,ws.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,ws.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(cx(e,"interval"),cx(e,"base_ejection_time"),cx(e,"max_ejection_time"),TT(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");Xc(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),TT(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Xc(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Xc(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");TT(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),TT(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Xc(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Xc(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 o=(0,uke.selectLbConfigFromList)(e.child_policy);if(!o)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new t(e.interval?(0,ws.durationToMs)(e.interval):null,e.base_ejection_time?(0,ws.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,ws.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,o)}};Ls.OutlierDetectionLoadBalancingConfig=Pd;var lx=class extends pke.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 ux(){return{success:0,failure:0}}var dx=class{constructor(){this.activeBucket=ux(),this.inactiveBucket=ux()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=ux()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},px=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===dke.PickResultType.COMPLETE){let o=r.subchannel,s=o.getMapEntry();if(s){let a=r.onCallEnded;return this.countCalls&&(a=(i,n,c)=>{var u;i===_7.Status.OK?s.counter.addSuccess():s.counter.addFailure(),(u=r.onCallEnded)===null||u===void 0||u.call(r,i,n,c)}),Object.assign(Object.assign({},r),{subchannel:o.getWrappedSubchannel(),onCallEnded:a})}else return Object.assign(Object.assign({},r),{subchannel:o.getWrappedSubchannel()})}else return r}},yT=class{constructor(e){this.entryMap=new ax.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new lke.ChildLoadBalancerHandler((0,g7.createChildChannelControlHelper)(e,{createSubchannel:(r,o)=>{let s=e.createSubchannel(r,o),a=this.entryMap.getForSubchannelAddress(r),i=new lx(s,a);return a?.currentEjectionTimestamp!==null&&i.eject(),a?.subchannelWrappers.push(i),i},updateState:(r,o,s)=>{r===cke.ConnectivityState.READY?e.updateState(r,new px(o,this.isCountingEnabled()),s):e.updateState(r,o,s)}})),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;st("Running success rate check");let o=r.request_volume,s=0,a=[];for(let[d,h]of this.entryMap.entries()){let g=h.counter.getLastSuccesses(),E=h.counter.getLastFailures();st("Stats for "+(0,ax.endpointToString)(d)+": successes="+g+" failures="+E+" targetRequestVolume="+o),g+E>=o&&(s+=1,a.push(g/(g+E)))}if(st("Found "+s+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+a+"]"),s<r.minimum_hosts)return;let i=a.reduce((d,h)=>d+h)/a.length,n=0;for(let d of a){let h=d-i;n+=h*h}let c=n/a.length,u=Math.sqrt(c),l=i-u*(r.stdev_factor/1e3);st("stdev="+u+" ejectionThreshold="+l);for(let[d,h]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let g=h.counter.getLastSuccesses(),E=h.counter.getLastFailures();if(g+E<o)continue;let S=g/(g+E);if(st("Checking candidate "+d+" successRate="+S),S<l){let v=Math.random()*100;st("Candidate "+d+" randomNumber="+v+" enforcement_percentage="+r.enforcement_percentage),v<r.enforcement_percentage&&(st("Ejecting candidate "+d),this.eject(h,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;st("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let o=0;for(let s of this.entryMap.values()){let a=s.counter.getLastSuccesses(),i=s.counter.getLastFailures();a+i>=r.request_volume&&(o+=1)}if(!(o<r.minimum_hosts))for(let[s,a]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let i=a.counter.getLastSuccesses(),n=a.counter.getLastFailures();if(st("Candidate successes="+i+" failures="+n),i+n<r.request_volume)continue;if(n*100/(n+i)>r.threshold){let u=Math.random()*100;st("Candidate "+s+" randomNumber="+u+" enforcement_percentage="+r.enforcement_percentage),u<r.enforcement_percentage&&(st("Ejecting candidate "+s),this.eject(a,e))}}}eject(e,r){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let o of e.subchannelWrappers)o.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,o;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(o=(r=this.ejectionTimer).unref)===null||o===void 0||o.call(r)}runChecks(){let e=new Date;if(st("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[r,o]of this.entryMap.entries())if(o.currentEjectionTimestamp===null)o.ejectionTimeMultiplier>0&&(o.ejectionTimeMultiplier-=1);else{let s=this.latestConfig.getBaseEjectionTimeMs(),a=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(o.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(s*o.ejectionTimeMultiplier,Math.max(s,a))),i<new Date&&(st("Unejecting "+r),this.uneject(o))}}}updateAddressList(e,r,o,s){if(!(r instanceof Pd))return!1;if(st("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let i of e.value)this.entryMap.has(i)||(st("Adding map entry for "+(0,ax.endpointToString)(i)),this.entryMap.set(i,{counter:new dx,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let a=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,a,o,s),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){st("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let i=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(i)}else st("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{st("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let i of this.entryMap.values())this.uneject(i),i.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return fx}};Ls.OutlierDetectionLoadBalancer=yT;function Eke(){mke&&(0,g7.registerLoadBalancerType)(fx,yT,Pd)}});var S7=p(AT=>{"use strict";Object.defineProperty(AT,"__esModule",{value:!0});AT.PriorityQueue=void 0;var Jc=0,hx=t=>Math.floor(t/2),vT=t=>t*2+1,Cd=t=>t*2+2,mx=class{constructor(e=(r,o)=>r>o){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[Jc]}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>Jc&&this.swap(Jc,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[Jc]=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>Jc&&this.greater(e,hx(e));)this.swap(e,hx(e)),e=hx(e)}siftDown(){let e=Jc;for(;vT(e)<this.size()&&this.greater(vT(e),e)||Cd(e)<this.size()&&this.greater(Cd(e),e);){let r=Cd(e)<this.size()&&this.greater(Cd(e),vT(e))?Cd(e):vT(e);this.swap(e,r),e=r}}};AT.PriorityQueue=mx});var O7=p(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.WeightedRoundRobinLoadBalancingConfig=void 0;Md.setup=Nke;var at=Ft(),Ske=se(),pr=Sd(),v7=oo(),Tke=Ad(),yke=Ee(),A7=sT(),Qc=Ai(),vke=S7(),T7=Jt(),Ake="weighted_round_robin";function _x(t){yke.trace(Ske.LogVerbosity.DEBUG,Ake,t)}var Sx="weighted_round_robin",Oke=1e4,bke=1e4,Rke=3*6e4,Pke=1e3,Cke=1;function y7(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 OT(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,pr.isDuration)(t[e]))r=t[e];else if((0,pr.isDurationMessage)(t[e]))r=(0,pr.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let o=(0,pr.parseDuration)(t[e]);if(!o)throw new Error(`weighted round robin config ${e}: failed to parse duration string ${t[e]}`);r=o}else throw new Error(`weighted round robin config ${e}: expected duration, got ${typeof t[e]}`);return(0,pr.durationToMs)(r)}return null}var Nd=class t{constructor(e,r,o,s,a,i){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??Oke,this.blackoutPeriodMs=o??bke,this.weightExpirationPeriodMs=s??Rke,this.weightUpdatePeriodMs=Math.max(a??Pke,100),this.errorUtilizationPenalty=i??Cke}getLoadBalancerName(){return Sx}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,pr.durationToString)((0,pr.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,pr.durationToString)((0,pr.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,pr.durationToString)((0,pr.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,pr.durationToString)((0,pr.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if(y7(e,"enable_oob_load_report","boolean"),y7(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,OT(e,"oob_load_reporting_period"),OT(e,"blackout_period"),OT(e,"weight_expiration_period"),OT(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}};Md.WeightedRoundRobinLoadBalancingConfig=Nd;var gx=class{constructor(e,r){this.metricsHandler=r,this.queue=new vke.PriorityQueue((a,i)=>a.deadline<i.deadline);let o=e.filter(a=>a.weight>0),s;if(o.length<2)s=1;else{let a=0;for(let{weight:i}of o)a+=i;s=a/o.length}for(let a of e){let i=a.weight>0?1/a.weight:s;this.queue.push({endpointName:a.endpointName,picker:a.picker,period:i,deadline:Math.random()*i})}}pick(e){let r=this.queue.pop();this.queue.push(Object.assign(Object.assign({},r),{deadline:r.deadline+r.period}));let o=r.picker.pick(e);if(o.pickResultType===Qc.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},o),{onCallEnded:(0,A7.createMetricsReader)(s=>this.metricsHandler(s,r.endpointName),o.onCallEnded)});{let s=o.subchannel;return Object.assign(Object.assign({},o),{subchannel:s.getWrappedSubchannel()})}}else return o}},Ex=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=at.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let r=0;for(let o of this.children.values())o.child.getConnectivityState()===e&&(r+=1);return r}updateWeight(e,r){var o,s;let a=r.rps_fractional,i=r.application_utilization;i>0&&a>0&&(i+=r.eps/a*((s=(o=this.latestConfig)===null||o===void 0?void 0:o.getErrorUtilizationPenalty())!==null&&s!==void 0?s:0));let n=i===0?0:a/i;if(n===0)return;let c=new Date;e.nonEmptySince===null&&(e.nonEmptySince=c),e.lastUpdated=c,e.weight=n}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 o=this.latestConfig.getBlackoutPeriodMs();return o>0&&(e.nonEmptySince===null||r-e.nonEmptySince.getTime()<o)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(at.ConnectivityState.READY)>0){let e=[];for(let[o,s]of this.children)s.child.getConnectivityState()===at.ConnectivityState.READY&&e.push({endpointName:o,picker:s.child.getPicker(),weight:this.getWeight(s)});_x("Created picker with weights: "+e.map(o=>o.endpointName+":"+o.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(o,s)=>{let a=this.children.get(s);a&&this.updateWeight(a,o)},this.updateState(at.ConnectivityState.READY,new gx(e,r),null)}else if(this.countChildrenWithState(at.ConnectivityState.CONNECTING)>0)this.updateState(at.ConnectivityState.CONNECTING,new Qc.QueuePicker(this),null);else if(this.countChildrenWithState(at.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(at.ConnectivityState.TRANSIENT_FAILURE,new Qc.UnavailablePicker({details:e}),e)}else this.updateState(at.ConnectivityState.IDLE,new Qc.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===at.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,o){_x(at.ConnectivityState[this.currentState]+" -> "+at.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,o)}updateAddressList(e,r,o,s){var a,i;if(!(r instanceof Nd))return!1;if(!e.ok)return this.children.size===0&&this.updateState(at.ConnectivityState.TRANSIENT_FAILURE,new Qc.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let u=`No addresses resolved. Resolution note: ${s}`;return this.updateState(at.ConnectivityState.TRANSIENT_FAILURE,new Qc.UnavailablePicker({details:u}),u),!1}_x("Connect to endpoint list "+e.value.map(T7.endpointToString));let n=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let u of e.value){let l=(0,T7.endpointToString)(u);c.add(l);let d=this.children.get(l);d||(d={child:new Tke.LeafLoadBalancer(u,(0,v7.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(h,g,E)=>{this.currentState===at.ConnectivityState.READY&&h!==at.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),h===at.ConnectivityState.READY&&(d.nonEmptySince=null),E&&(this.lastError=E),this.calculateAndUpdateState()},createSubchannel:(h,g)=>{let E=this.channelControlHelper.createSubchannel(h,g);return d?.oobMetricsListener?new A7.OrcaOobMetricsSubchannelWrapper(E,d.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):E}}),o,s),lastUpdated:n,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(l,d)),r.getEnableOobLoadReport()?d.oobMetricsListener=h=>{this.updateWeight(d,h)}:d.oobMetricsListener=null}for(let[u,l]of this.children)c.has(u)?l.child.startConnecting():(l.child.destroy(),this.children.delete(u));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(i=(a=setInterval(()=>{this.currentState===at.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||i===void 0?void 0:i.call(a),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return Sx}};function Nke(){(0,v7.registerLoadBalancerType)(Sx,Ex,Nd)}});var Id=p(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.experimental=k.ServerMetricRecorder=k.ServerInterceptingCall=k.ResponderBuilder=k.ServerListenerBuilder=k.addAdminServicesToServer=k.getChannelzHandlers=k.getChannelzServiceDefinition=k.InterceptorConfigurationError=k.InterceptingCall=k.RequesterBuilder=k.ListenerBuilder=k.StatusBuilder=k.getClientChannel=k.ServerCredentials=k.Server=k.setLogVerbosity=k.setLogger=k.load=k.loadObject=k.CallCredentials=k.ChannelCredentials=k.waitForClientReady=k.closeClient=k.Channel=k.makeGenericClientConstructor=k.makeClientConstructor=k.loadPackageDefinition=k.Client=k.compressionAlgorithms=k.propagate=k.connectivityState=k.status=k.logVerbosity=k.Metadata=k.credentials=void 0;var bT=wE();Object.defineProperty(k,"CallCredentials",{enumerable:!0,get:function(){return bT.CallCredentials}});var Mke=AM();Object.defineProperty(k,"Channel",{enumerable:!0,get:function(){return Mke.ChannelImplementation}});var Ike=OI();Object.defineProperty(k,"compressionAlgorithms",{enumerable:!0,get:function(){return Ike.CompressionAlgorithms}});var xke=Ft();Object.defineProperty(k,"connectivityState",{enumerable:!0,get:function(){return xke.ConnectivityState}});var RT=vc();Object.defineProperty(k,"ChannelCredentials",{enumerable:!0,get:function(){return RT.ChannelCredentials}});var b7=vM();Object.defineProperty(k,"Client",{enumerable:!0,get:function(){return b7.Client}});var Tx=se();Object.defineProperty(k,"logVerbosity",{enumerable:!0,get:function(){return Tx.LogVerbosity}});Object.defineProperty(k,"status",{enumerable:!0,get:function(){return Tx.Status}});Object.defineProperty(k,"propagate",{enumerable:!0,get:function(){return Tx.Propagate}});var R7=Ee(),yx=eS();Object.defineProperty(k,"loadPackageDefinition",{enumerable:!0,get:function(){return yx.loadPackageDefinition}});Object.defineProperty(k,"makeClientConstructor",{enumerable:!0,get:function(){return yx.makeClientConstructor}});Object.defineProperty(k,"makeGenericClientConstructor",{enumerable:!0,get:function(){return yx.makeClientConstructor}});var wke=nt();Object.defineProperty(k,"Metadata",{enumerable:!0,get:function(){return wke.Metadata}});var Lke=$J();Object.defineProperty(k,"Server",{enumerable:!0,get:function(){return Lke.Server}});var Dke=iT();Object.defineProperty(k,"ServerCredentials",{enumerable:!0,get:function(){return Dke.ServerCredentials}});var Uke=YJ();Object.defineProperty(k,"StatusBuilder",{enumerable:!0,get:function(){return Uke.StatusBuilder}});k.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,o)=>r.compose(o),t),combineCallCredentials:(t,...e)=>e.reduce((r,o)=>r.compose(o),t),createInsecure:RT.ChannelCredentials.createInsecure,createSsl:RT.ChannelCredentials.createSsl,createFromSecureContext:RT.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:bT.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:bT.CallCredentials.createFromGoogleCredential,createEmpty:bT.CallCredentials.createEmpty};var kke=t=>t.close();k.closeClient=kke;var Bke=(t,e,r)=>t.waitForReady(e,r);k.waitForClientReady=Bke;var Fke=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};k.loadObject=Fke;var Vke=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};k.load=Vke;var Gke=t=>{R7.setLogger(t)};k.setLogger=Gke;var qke=t=>{R7.setLoggerVerbosity(t)};k.setLogVerbosity=qke;var jke=t=>b7.Client.prototype.getChannel.call(t);k.getClientChannel=jke;var PT=SM();Object.defineProperty(k,"ListenerBuilder",{enumerable:!0,get:function(){return PT.ListenerBuilder}});Object.defineProperty(k,"RequesterBuilder",{enumerable:!0,get:function(){return PT.RequesterBuilder}});Object.defineProperty(k,"InterceptingCall",{enumerable:!0,get:function(){return PT.InterceptingCall}});Object.defineProperty(k,"InterceptorConfigurationError",{enumerable:!0,get:function(){return PT.InterceptorConfigurationError}});var P7=mo();Object.defineProperty(k,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return P7.getChannelzServiceDefinition}});Object.defineProperty(k,"getChannelzHandlers",{enumerable:!0,get:function(){return P7.getChannelzHandlers}});var Hke=KE();Object.defineProperty(k,"addAdminServicesToServer",{enumerable:!0,get:function(){return Hke.addAdminServicesToServer}});var vx=V0();Object.defineProperty(k,"ServerListenerBuilder",{enumerable:!0,get:function(){return vx.ServerListenerBuilder}});Object.defineProperty(k,"ResponderBuilder",{enumerable:!0,get:function(){return vx.ResponderBuilder}});Object.defineProperty(k,"ServerInterceptingCall",{enumerable:!0,get:function(){return vx.ServerInterceptingCall}});var zke=sT();Object.defineProperty(k,"ServerMetricRecorder",{enumerable:!0,get:function(){return zke.ServerMetricRecorder}});var $ke=Q0();k.experimental=$ke;var Yke=jI(),Wke=o7(),Kke=d7(),Xke=Ad(),Jke=m7(),Qke=E7(),Zke=O7(),eBe=mo();Yke.setup(),Wke.setup(),Kke.setup(),Xke.setup(),Jke.setup(),Qke.setup(),Zke.setup(),eBe.setup()});var C7=p(CT=>{"use strict";Object.defineProperty(CT,"__esModule",{value:!0});CT.createServiceClientConstructor=void 0;var tBe=Id();function rBe(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:o=>o,requestDeserialize:o=>o,responseSerialize:o=>o,responseDeserialize:o=>o}};return tBe.makeGenericClientConstructor(r,e)}CT.createServiceClientConstructor=rBe});var xd=p(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.createOtlpGrpcExporterTransport=Ir.GrpcExporterTransport=Ir.createEmptyMetadata=Ir.createSslCredentials=Ir.createInsecureCredentials=void 0;var nBe=0,iBe=2;function oBe(t){return t==="gzip"?iBe:nBe}function sBe(){let{credentials:t}=Id();return t.createInsecure()}Ir.createInsecureCredentials=sBe;function aBe(t,e,r){let{credentials:o}=Id();return o.createSsl(t,e,r)}Ir.createSslCredentials=aBe;function cBe(){let{Metadata:t}=Id();return new t}Ir.createEmptyMetadata=cBe;var NT=class{_parameters;_client;_metadata;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,r){let o=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:s}=C7();try{this._metadata=this._parameters.metadata()}catch(i){return Promise.resolve({status:"failure",error:i})}let a=s(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new a(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":oBe(this._parameters.compression)})}catch(i){return Promise.resolve({status:"failure",error:i})}}return new Promise(s=>{let a=Date.now()+r;if(this._metadata==null)return s({error:new Error("metadata was null"),status:"failure"});this._client.export(o,this._metadata,{deadline:a},(i,n)=>{s(i?{status:"failure",error:i}:{data:n,status:"success"})})})}};Ir.GrpcExporterTransport=NT;function uBe(t){return new NT(t)}Ir.createOtlpGrpcExporterTransport=uBe});var N7=p(MT=>{"use strict";Object.defineProperty(MT,"__esModule",{value:!0});MT.VERSION=void 0;MT.VERSION="0.206.0"});var L7=p(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.getOtlpGrpcDefaultConfiguration=vo.mergeOtlpGrpcConfigurationWithDefaults=vo.validateAndNormalizeUrl=void 0;var x7=(kn(),y(Un)),wd=xd(),lBe=N7(),dBe=require("url"),M7=(b(),y(P));function w7(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new dBe.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&M7.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?:$/)&&M7.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}vo.validateAndNormalizeUrl=w7;function I7(t,e){for(let[r,o]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,o)}function pBe(t,e,r){let o=t.url??e.url??r.url;return{...(0,x7.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let s=r.metadata();return I7(s,t.metadata?.().clone()??(0,wd.createEmptyMetadata)()),I7(s,e.metadata?.()??(0,wd.createEmptyMetadata)()),s},url:w7(o),credentials:t.credentials??e.credentials?.(o)??r.credentials(o)}}vo.mergeOtlpGrpcConfigurationWithDefaults=pBe;function fBe(){return{...(0,x7.getSharedConfigurationDefaults)(),metadata:()=>{let t=(0,wd.createEmptyMetadata)();return t.set("User-Agent",`OTel-OTLP-Exporter-JavaScript/${lBe.VERSION}`),t},url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,wd.createInsecureCredentials)():()=>(0,wd.createSslCredentials)()}}vo.getOtlpGrpcDefaultConfiguration=fBe});var F7=p(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});IT.getOtlpGrpcConfigurationFromEnv=void 0;var D7=W(),Ld=xd(),hBe=(yi(),y(ro)),mBe=require("fs"),_Be=require("path"),k7=(b(),y(P));function Ax(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function gBe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),o=(0,D7.parseKeyPairsIntoRecord)(e),s=(0,D7.parseKeyPairsIntoRecord)(r);if(Object.keys(o).length===0&&Object.keys(s).length===0)return;let a=Object.assign({},s,o),i=(0,Ld.createEmptyMetadata)();for(let[n,c]of Object.entries(a))i.set(n,c);return i}function EBe(t){let e=gBe(t);if(e!=null)return()=>e}function SBe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return Ax(e,r)}function TBe(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return Ax(e,r)==="true"}function Ox(t,e,r){let o=process.env[t]?.trim(),s=process.env[e]?.trim(),a=Ax(o,s);if(a!=null)try{return mBe.readFileSync(_Be.resolve(process.cwd(),a))}catch{k7.diag.warn(r);return}else return}function yBe(t){return Ox(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function vBe(t){return Ox(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function U7(t){return Ox(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function B7(t){let e=vBe(t),r=yBe(t),o=U7(t),s=e!=null&&r!=null;return o!=null&&!s?(k7.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,Ld.createSslCredentials)(U7(t))):(0,Ld.createSslCredentials)(o,e,r)}function ABe(t){return TBe(t)?(0,Ld.createInsecureCredentials)():B7(t)}function OBe(t){return{...(0,hBe.getSharedConfigurationFromEnvironment)(t),metadata:EBe(t),url:SBe(t),credentials:e=>e.startsWith("http://")?()=>(0,Ld.createInsecureCredentials)():e.startsWith("https://")?()=>B7(t):()=>ABe(t)}}IT.getOtlpGrpcConfigurationFromEnv=OBe});var G7=p(xT=>{"use strict";Object.defineProperty(xT,"__esModule",{value:!0});xT.convertLegacyOtlpGrpcOptions=void 0;var bBe=(b(),y(P)),V7=L7(),RBe=xd(),PBe=F7();function CBe(t,e){t.headers&&bBe.diag.warn("Headers cannot be set when using grpc");let r=t.credentials;return(0,V7.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,RBe.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0},(0,PBe.getOtlpGrpcConfigurationFromEnv)(e),(0,V7.getOtlpGrpcDefaultConfiguration)())}xT.convertLegacyOtlpGrpcOptions=CBe});var q7=p(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0});wT.createOtlpGrpcExportDelegate=void 0;var NBe=(kn(),y(Un)),MBe=xd();function IBe(t,e,r,o){return(0,NBe.createOtlpNetworkExportDelegate)(t,e,(0,MBe.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,grpcName:r,grpcPath:o}))}wT.createOtlpGrpcExportDelegate=IBe});var LT=p(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.createOtlpGrpcExportDelegate=Zc.convertLegacyOtlpGrpcOptions=void 0;var xBe=G7();Object.defineProperty(Zc,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return xBe.convertLegacyOtlpGrpcOptions}});var wBe=q7();Object.defineProperty(Zc,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return wBe.createOtlpGrpcExportDelegate}})});var H7=p(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0});DT.OTLPLogExporter=void 0;var j7=LT(),LBe=qn(),DBe=(kn(),y(Un)),bx=class extends DBe.OTLPExporterBase{constructor(e={}){super((0,j7.createOtlpGrpcExportDelegate)((0,j7.convertLegacyOtlpGrpcOptions)(e,"LOGS"),LBe.ProtobufLogsSerializer,"LogsExportService","/opentelemetry.proto.collector.logs.v1.LogsService/Export"))}};DT.OTLPLogExporter=bx});var z7=p(UT=>{"use strict";Object.defineProperty(UT,"__esModule",{value:!0});UT.OTLPLogExporter=void 0;var UBe=H7();Object.defineProperty(UT,"OTLPLogExporter",{enumerable:!0,get:function(){return UBe.OTLPLogExporter}})});var $7=p(kT=>{"use strict";Object.defineProperty(kT,"__esModule",{value:!0});kT.VERSION=void 0;kT.VERSION="0.206.0"});var W7=p(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0});BT.OTLPLogExporter=void 0;var kBe=(kn(),y(Un)),BBe=qn(),Y7=(yi(),y(ro)),FBe=$7(),Rx=class extends kBe.OTLPExporterBase{constructor(e={}){super((0,Y7.createOtlpHttpExportDelegate)((0,Y7.convertLegacyHttpOptions)(e,"LOGS","v1/logs",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${FBe.VERSION}`,"Content-Type":"application/x-protobuf"}),BBe.ProtobufLogsSerializer))}};BT.OTLPLogExporter=Rx});var K7=p(FT=>{"use strict";Object.defineProperty(FT,"__esModule",{value:!0});FT.OTLPLogExporter=void 0;var VBe=W7();Object.defineProperty(FT,"OTLPLogExporter",{enumerable:!0,get:function(){return VBe.OTLPLogExporter}})});var X7=p(VT=>{"use strict";Object.defineProperty(VT,"__esModule",{value:!0});VT.OTLPLogExporter=void 0;var GBe=K7();Object.defineProperty(VT,"OTLPLogExporter",{enumerable:!0,get:function(){return GBe.OTLPLogExporter}})});var J7=p(GT=>{"use strict";Object.defineProperty(GT,"__esModule",{value:!0});GT.OTLPLogExporter=void 0;var qBe=X7();Object.defineProperty(GT,"OTLPLogExporter",{enumerable:!0,get:function(){return qBe.OTLPLogExporter}})});var Px=p(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AggregationTemporalityPreference=void 0;var jBe;(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE",t[t.LOWMEMORY=2]="LOWMEMORY"})(jBe=Dd.AggregationTemporalityPreference||(Dd.AggregationTemporalityPreference={}))});var Nx=p(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.OTLPMetricExporterBase=_t.LowMemoryTemporalitySelector=_t.DeltaTemporalitySelector=_t.CumulativeTemporalitySelector=void 0;var HBe=W(),ze=Ei(),Q7=Px(),zBe=(kn(),y(Un)),$Be=(b(),y(P)),YBe=()=>ze.AggregationTemporality.CUMULATIVE;_t.CumulativeTemporalitySelector=YBe;var WBe=t=>{switch(t){case ze.InstrumentType.COUNTER:case ze.InstrumentType.OBSERVABLE_COUNTER:case ze.InstrumentType.GAUGE:case ze.InstrumentType.HISTOGRAM:case ze.InstrumentType.OBSERVABLE_GAUGE:return ze.AggregationTemporality.DELTA;case ze.InstrumentType.UP_DOWN_COUNTER:case ze.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return ze.AggregationTemporality.CUMULATIVE}};_t.DeltaTemporalitySelector=WBe;var KBe=t=>{switch(t){case ze.InstrumentType.COUNTER:case ze.InstrumentType.HISTOGRAM:return ze.AggregationTemporality.DELTA;case ze.InstrumentType.GAUGE:case ze.InstrumentType.UP_DOWN_COUNTER:case ze.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:case ze.InstrumentType.OBSERVABLE_COUNTER:case ze.InstrumentType.OBSERVABLE_GAUGE:return ze.AggregationTemporality.CUMULATIVE}};_t.LowMemoryTemporalitySelector=KBe;function XBe(){let t=((0,HBe.getStringFromEnv)("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE")??"cumulative").toLowerCase();return t==="cumulative"?_t.CumulativeTemporalitySelector:t==="delta"?_t.DeltaTemporalitySelector:t==="lowmemory"?_t.LowMemoryTemporalitySelector:($Be.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${t}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),_t.CumulativeTemporalitySelector)}function JBe(t){return t!=null?t===Q7.AggregationTemporalityPreference.DELTA?_t.DeltaTemporalitySelector:t===Q7.AggregationTemporalityPreference.LOWMEMORY?_t.LowMemoryTemporalitySelector:_t.CumulativeTemporalitySelector:XBe()}var QBe=Object.freeze({type:ze.AggregationType.DEFAULT});function ZBe(t){return t?.aggregationPreference??(()=>QBe)}var Cx=class extends zBe.OTLPExporterBase{_aggregationTemporalitySelector;_aggregationSelector;constructor(e,r){super(e),this._aggregationSelector=ZBe(r),this._aggregationTemporalitySelector=JBe(r?.temporalityPreference)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}};_t.OTLPMetricExporterBase=Cx});var Z7=p(qT=>{"use strict";Object.defineProperty(qT,"__esModule",{value:!0});qT.VERSION=void 0;qT.VERSION="0.206.0"});var tQ=p(jT=>{"use strict";Object.defineProperty(jT,"__esModule",{value:!0});jT.OTLPMetricExporter=void 0;var eFe=Nx(),tFe=qn(),rFe=Z7(),eQ=(yi(),y(ro)),nFe={"User-Agent":`OTel-OTLP-Exporter-JavaScript/${rFe.VERSION}`},Mx=class extends eFe.OTLPMetricExporterBase{constructor(e){super((0,eQ.createOtlpHttpExportDelegate)((0,eQ.convertLegacyHttpOptions)(e??{},"METRICS","v1/metrics",{...nFe,"Content-Type":"application/json"}),tFe.JsonMetricsSerializer),e)}};jT.OTLPMetricExporter=Mx});var rQ=p(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});HT.OTLPMetricExporter=void 0;var iFe=tQ();Object.defineProperty(HT,"OTLPMetricExporter",{enumerable:!0,get:function(){return iFe.OTLPMetricExporter}})});var nQ=p(zT=>{"use strict";Object.defineProperty(zT,"__esModule",{value:!0});zT.OTLPMetricExporter=void 0;var oFe=rQ();Object.defineProperty(zT,"OTLPMetricExporter",{enumerable:!0,get:function(){return oFe.OTLPMetricExporter}})});var YT=p(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.OTLPMetricExporterBase=er.LowMemoryTemporalitySelector=er.DeltaTemporalitySelector=er.CumulativeTemporalitySelector=er.AggregationTemporalityPreference=er.OTLPMetricExporter=void 0;var sFe=nQ();Object.defineProperty(er,"OTLPMetricExporter",{enumerable:!0,get:function(){return sFe.OTLPMetricExporter}});var aFe=Px();Object.defineProperty(er,"AggregationTemporalityPreference",{enumerable:!0,get:function(){return aFe.AggregationTemporalityPreference}});var $T=Nx();Object.defineProperty(er,"CumulativeTemporalitySelector",{enumerable:!0,get:function(){return $T.CumulativeTemporalitySelector}});Object.defineProperty(er,"DeltaTemporalitySelector",{enumerable:!0,get:function(){return $T.DeltaTemporalitySelector}});Object.defineProperty(er,"LowMemoryTemporalitySelector",{enumerable:!0,get:function(){return $T.LowMemoryTemporalitySelector}});Object.defineProperty(er,"OTLPMetricExporterBase",{enumerable:!0,get:function(){return $T.OTLPMetricExporterBase}})});var oQ=p(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});WT.OTLPMetricExporter=void 0;var cFe=YT(),iQ=LT(),uFe=qn(),Ix=class extends cFe.OTLPMetricExporterBase{constructor(e){super((0,iQ.createOtlpGrpcExportDelegate)((0,iQ.convertLegacyOtlpGrpcOptions)(e??{},"METRICS"),uFe.ProtobufMetricsSerializer,"MetricsExportService","/opentelemetry.proto.collector.metrics.v1.MetricsService/Export"),e)}};WT.OTLPMetricExporter=Ix});var sQ=p(KT=>{"use strict";Object.defineProperty(KT,"__esModule",{value:!0});KT.OTLPMetricExporter=void 0;var lFe=oQ();Object.defineProperty(KT,"OTLPMetricExporter",{enumerable:!0,get:function(){return lFe.OTLPMetricExporter}})});var aQ=p(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});XT.VERSION=void 0;XT.VERSION="0.206.0"});var uQ=p(JT=>{"use strict";Object.defineProperty(JT,"__esModule",{value:!0});JT.OTLPMetricExporter=void 0;var dFe=YT(),pFe=qn(),fFe=aQ(),cQ=(yi(),y(ro)),xx=class extends dFe.OTLPMetricExporterBase{constructor(e){super((0,cQ.createOtlpHttpExportDelegate)((0,cQ.convertLegacyHttpOptions)(e??{},"METRICS","v1/metrics",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${fFe.VERSION}`,"Content-Type":"application/x-protobuf"}),pFe.ProtobufMetricsSerializer),e)}};JT.OTLPMetricExporter=xx});var lQ=p(QT=>{"use strict";Object.defineProperty(QT,"__esModule",{value:!0});QT.OTLPMetricExporter=void 0;var hFe=uQ();Object.defineProperty(QT,"OTLPMetricExporter",{enumerable:!0,get:function(){return hFe.OTLPMetricExporter}})});var dQ=p(ZT=>{"use strict";Object.defineProperty(ZT,"__esModule",{value:!0});ZT.OTLPMetricExporter=void 0;var mFe=lQ();Object.defineProperty(ZT,"OTLPMetricExporter",{enumerable:!0,get:function(){return mFe.OTLPMetricExporter}})});var wx=p(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});ey.OTLPMetricExporter=void 0;var _Fe=dQ();Object.defineProperty(ey,"OTLPMetricExporter",{enumerable:!0,get:function(){return _Fe.OTLPMetricExporter}})});var kx=p(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.PrometheusSerializer=void 0;var gFe=(b(),y(P)),Ds=Ei(),pQ=W();function ry(t){return t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n")}function fQ(t=""){return typeof t!="string"&&(t=JSON.stringify(t)),ry(t).replace(/"/g,'\\"')}var EFe=/[^a-z0-9_]/gi,SFe=/_{2,}/g;function Dx(t){return t.replace(EFe,"_").replace(SFe,"_")}function Lx(t,e){return!t.endsWith("_total")&&e.dataPointType===Ds.DataPointType.SUM&&e.isMonotonic&&(t=t+"_total"),t}function TFe(t){return t===1/0?"+Inf":t===-1/0?"-Inf":`${t}`}function yFe(t){switch(t.dataPointType){case Ds.DataPointType.SUM:return t.isMonotonic?"counter":"gauge";case Ds.DataPointType.GAUGE:return"gauge";case Ds.DataPointType.HISTOGRAM:return"histogram";default:return"untyped"}}function ty(t,e,r,o,s){let a=!1,i="";for(let[n,c]of Object.entries(e)){let u=Dx(n);a=!0,i+=`${i.length>0?",":""}${u}="${fQ(c)}"`}if(s)for(let[n,c]of Object.entries(s)){let u=Dx(n);a=!0,i+=`${i.length>0?",":""}${u}="${fQ(c)}"`}return a&&(t+=`{${i}}`),`${t} ${TFe(r)}${o!==void 0?" "+String(o):""}
|
|
41
|
+
`}var vFe="# no registered metrics",Ux=class{_prefix;_appendTimestamp;_additionalAttributes;_withResourceConstantLabels;constructor(e,r=!1,o){e&&(this._prefix=e+"_"),this._appendTimestamp=r,this._withResourceConstantLabels=o}serialize(e){let r="";this._additionalAttributes=this._filterResourceConstantLabels(e.resource.attributes,this._withResourceConstantLabels);for(let o of e.scopeMetrics)r+=this._serializeScopeMetrics(o);return r===""&&(r+=vFe),this._serializeResource(e.resource)+r}_filterResourceConstantLabels(e,r){if(r){let o={};for(let[s,a]of Object.entries(e))s.match(r)&&(o[s]=a);return o}}_serializeScopeMetrics(e){let r="";for(let o of e.metrics)r+=this._serializeMetricData(o)+`
|
|
42
|
+
`;return r}_serializeMetricData(e){let r=Dx(ry(e.descriptor.name));this._prefix&&(r=`${this._prefix}${r}`);let o=e.dataPointType;r=Lx(r,e);let s=`# HELP ${r} ${ry(e.descriptor.description||"description missing")}`,a=e.descriptor.unit?`
|
|
43
|
+
# UNIT ${r} ${ry(e.descriptor.unit)}`:"",i=`# TYPE ${r} ${yFe(e)}`,n="";switch(o){case Ds.DataPointType.SUM:case Ds.DataPointType.GAUGE:{n=e.dataPoints.map(c=>this._serializeSingularDataPoint(r,e,c)).join("");break}case Ds.DataPointType.HISTOGRAM:{n=e.dataPoints.map(c=>this._serializeHistogramDataPoint(r,e,c)).join("");break}default:gFe.diag.error(`Unrecognizable DataPointType: ${o} for metric "${r}"`)}return`${s}${a}
|
|
44
|
+
${i}
|
|
45
|
+
${n}`.trim()}_serializeSingularDataPoint(e,r,o){let s="";e=Lx(e,r);let{value:a,attributes:i}=o,n=(0,pQ.hrTimeToMilliseconds)(o.endTime);return s+=ty(e,i,a,this._appendTimestamp?n:void 0,this._additionalAttributes),s}_serializeHistogramDataPoint(e,r,o){let s="";e=Lx(e,r);let a=o.attributes,i=o.value,n=(0,pQ.hrTimeToMilliseconds)(o.endTime);for(let d of["count","sum"]){let h=i[d];h!=null&&(s+=ty(e+"_"+d,a,h,this._appendTimestamp?n:void 0,this._additionalAttributes))}let c=0,u=i.buckets.counts.entries(),l=!1;for(let[d,h]of u){c+=h;let g=i.buckets.boundaries[d];if(g===void 0&&l)break;g===1/0&&(l=!0),s+=ty(e+"_bucket",a,c,this._appendTimestamp?n:void 0,Object.assign({},this._additionalAttributes??{},{le:g===void 0||g===1/0?"+Inf":String(g)}))}return s}_serializeResource(e){let r="target_info",o=`# HELP ${r} Target metadata`,s=`# TYPE ${r} gauge`,a=ty(r,e.attributes,1).trim();return`${o}
|
|
46
|
+
${s}
|
|
47
|
+
${a}
|
|
48
|
+
`}};ny.PrometheusSerializer=Ux});var hQ=p(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.PrometheusExporter=void 0;var Ud=(b(),y(P)),AFe=W(),Bx=Ei(),OFe=require("http"),bFe=kx(),RFe=require("url"),Fx=class t extends Bx.MetricReader{static DEFAULT_OPTIONS={host:void 0,port:9464,endpoint:"/metrics",prefix:"",appendTimestamp:!1,withResourceConstantLabels:void 0};_host;_port;_baseUrl;_endpoint;_server;_prefix;_appendTimestamp;_serializer;_startServerPromise;constructor(e={},r=()=>{}){super({aggregationSelector:s=>({type:Bx.AggregationType.DEFAULT}),aggregationTemporalitySelector:s=>Bx.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 o=e.withResourceConstantLabels||t.DEFAULT_OPTIONS.withResourceConstantLabels;this._server=(0,OFe.createServer)(this._requestHandler).unref(),this._serializer=new bFe.PrometheusSerializer(this._prefix,this._appendTimestamp,o),this._baseUrl=`http://${this._host}:${this._port}/`,this._endpoint=(e.endpoint||t.DEFAULT_OPTIONS.endpoint).replace(/^([^/])/,"/$1"),e.preventServerStart!==!0?this.startServer().then(r,s=>{Ud.diag.error(s),r(s)}):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,AFe.globalErrorHandler)(r):Ud.diag.debug("Prometheus exporter was stopped"),e()})}):(Ud.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},()=>{Ud.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`),e()})}),this._startServerPromise}getMetricsRequestHandler(e,r){this._exportMetrics(r)}_requestHandler=(e,r)=>{e.url!=null&&new RFe.URL(e.url,this._baseUrl).pathname===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:o,errors:s}=r;s.length&&Ud.diag.error("PrometheusExporter: metrics collection errors",...s),e.end(this._serializer.serialize(o))},r=>{e.end(`# failed to export metrics: ${r}`)})};_notFound=e=>{e.statusCode=404,e.end()}};iy.PrometheusExporter=Fx});var mQ=p(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.PrometheusSerializer=eu.PrometheusExporter=void 0;var PFe=hQ();Object.defineProperty(eu,"PrometheusExporter",{enumerable:!0,get:function(){return PFe.PrometheusExporter}});var CFe=kx();Object.defineProperty(eu,"PrometheusSerializer",{enumerable:!0,get:function(){return CFe.PrometheusSerializer}})});var _Q=p(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.VERSION=void 0;oy.VERSION="0.206.0"});var EQ=p(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.OTLPTraceExporter=void 0;var NFe=(kn(),y(Un)),MFe=qn(),IFe=_Q(),gQ=(yi(),y(ro)),Vx=class extends NFe.OTLPExporterBase{constructor(e={}){super((0,gQ.createOtlpHttpExportDelegate)((0,gQ.convertLegacyHttpOptions)(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${IFe.VERSION}`,"Content-Type":"application/x-protobuf"}),MFe.ProtobufTraceSerializer))}};sy.OTLPTraceExporter=Vx});var SQ=p(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.OTLPTraceExporter=void 0;var xFe=EQ();Object.defineProperty(ay,"OTLPTraceExporter",{enumerable:!0,get:function(){return xFe.OTLPTraceExporter}})});var TQ=p(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.OTLPTraceExporter=void 0;var wFe=SQ();Object.defineProperty(cy,"OTLPTraceExporter",{enumerable:!0,get:function(){return wFe.OTLPTraceExporter}})});var yQ=p(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.OTLPTraceExporter=void 0;var LFe=TQ();Object.defineProperty(uy,"OTLPTraceExporter",{enumerable:!0,get:function(){return LFe.OTLPTraceExporter}})});var vQ=p(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.VERSION=void 0;ly.VERSION="0.206.0"});var OQ=p(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.OTLPTraceExporter=void 0;var DFe=(kn(),y(Un)),UFe=vQ(),kFe=qn(),AQ=(yi(),y(ro)),Gx=class extends DFe.OTLPExporterBase{constructor(e={}){super((0,AQ.createOtlpHttpExportDelegate)((0,AQ.convertLegacyHttpOptions)(e,"TRACES","v1/traces",{"User-Agent":`OTel-OTLP-Exporter-JavaScript/${UFe.VERSION}`,"Content-Type":"application/json"}),kFe.JsonTraceSerializer))}};dy.OTLPTraceExporter=Gx});var bQ=p(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.OTLPTraceExporter=void 0;var BFe=OQ();Object.defineProperty(py,"OTLPTraceExporter",{enumerable:!0,get:function(){return BFe.OTLPTraceExporter}})});var RQ=p(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.OTLPTraceExporter=void 0;var FFe=bQ();Object.defineProperty(fy,"OTLPTraceExporter",{enumerable:!0,get:function(){return FFe.OTLPTraceExporter}})});var PQ=p(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.OTLPTraceExporter=void 0;var VFe=RQ();Object.defineProperty(hy,"OTLPTraceExporter",{enumerable:!0,get:function(){return VFe.OTLPTraceExporter}})});var NQ=p(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.OTLPTraceExporter=void 0;var CQ=LT(),GFe=qn(),qFe=(kn(),y(Un)),qx=class extends qFe.OTLPExporterBase{constructor(e={}){super((0,CQ.createOtlpGrpcExportDelegate)((0,CQ.convertLegacyOtlpGrpcOptions)(e,"TRACES"),GFe.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};my.OTLPTraceExporter=qx});var MQ=p(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.OTLPTraceExporter=void 0;var jFe=NQ();Object.defineProperty(_y,"OTLPTraceExporter",{enumerable:!0,get:function(){return jFe.OTLPTraceExporter}})});var IQ=p(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.prepareSend=void 0;var jx=(b(),y(P)),gy=W(),HFe=require("http"),zFe=require("https");function $Fe(t,e){let r=new URL(t),o=Object.assign({method:"POST",headers:{"Content-Type":"application/json",...e}});return function(a,i){if(a.length===0)return jx.diag.debug("Zipkin send with empty spans"),i({code:gy.ExportResultCode.SUCCESS});let{request:n}=r.protocol==="http:"?HFe:zFe,c=n(r,o,l=>{let d="";l.on("data",h=>{d+=h}),l.on("end",()=>{let h=l.statusCode||0;return jx.diag.debug(`Zipkin response status code: ${h}, body: ${d}`),h<400?i({code:gy.ExportResultCode.SUCCESS}):i({code:gy.ExportResultCode.FAILED,error:new Error(`Got unexpected status code from zipkin: ${h}`)})})});c.on("error",l=>i({code:gy.ExportResultCode.FAILED,error:l}));let u=JSON.stringify(a);jx.diag.debug(`Zipkin request payload: ${u}`),c.write(u,"utf8"),c.end()}}Ey.prepareSend=$Fe});var xQ=p(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.prepareSend=void 0;var YFe=IQ();Object.defineProperty(Sy,"prepareSend",{enumerable:!0,get:function(){return YFe.prepareSend}})});var Hx=p(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.prepareSend=void 0;var WFe=xQ();Object.defineProperty(Ty,"prepareSend",{enumerable:!0,get:function(){return WFe.prepareSend}})});var wQ=p(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.SpanKind=void 0;var KFe;(function(t){t.CLIENT="CLIENT",t.SERVER="SERVER",t.CONSUMER="CONSUMER",t.PRODUCER="PRODUCER"})(KFe=kd.SpanKind||(kd.SpanKind={}))});var UQ=p(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr._toZipkinAnnotations=xr._toZipkinTags=xr.toZipkinSpan=xr.defaultStatusErrorTagName=xr.defaultStatusCodeTagName=void 0;var Ao=(b(),y(P)),zx=W(),yy=wQ(),XFe={[Ao.SpanKind.CLIENT]:yy.SpanKind.CLIENT,[Ao.SpanKind.SERVER]:yy.SpanKind.SERVER,[Ao.SpanKind.CONSUMER]:yy.SpanKind.CONSUMER,[Ao.SpanKind.PRODUCER]:yy.SpanKind.PRODUCER,[Ao.SpanKind.INTERNAL]:void 0};xr.defaultStatusCodeTagName="otel.status_code";xr.defaultStatusErrorTagName="error";function JFe(t,e,r,o){return{traceId:t.spanContext().traceId,parentId:t.parentSpanContext?.spanId,name:t.name,id:t.spanContext().spanId,kind:XFe[t.kind],timestamp:(0,zx.hrTimeToMicroseconds)(t.startTime),duration:Math.round((0,zx.hrTimeToMicroseconds)(t.duration)),localEndpoint:{serviceName:e},tags:LQ(t,r,o),annotations:t.events.length?DQ(t.events):void 0}}xr.toZipkinSpan=JFe;function LQ({attributes:t,resource:e,status:r,droppedAttributesCount:o,droppedEventsCount:s,droppedLinksCount:a},i,n){let c={};for(let u of Object.keys(t))c[u]=String(t[u]);return r.code!==Ao.SpanStatusCode.UNSET&&(c[i]=String(Ao.SpanStatusCode[r.code])),r.code===Ao.SpanStatusCode.ERROR&&r.message&&(c[n]=r.message),o&&(c["otel.dropped_attributes_count"]=String(o)),s&&(c["otel.dropped_events_count"]=String(s)),a&&(c["otel.dropped_links_count"]=String(a)),Object.keys(e.attributes).forEach(u=>c[u]=String(e.attributes[u])),c}xr._toZipkinTags=LQ;function DQ(t){return t.map(e=>({timestamp:Math.round((0,zx.hrTimeToMicroseconds)(e.time)),value:e.name}))}xr._toZipkinAnnotations=DQ});var kQ=p(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.prepareGetHeaders=void 0;function QFe(t){return function(){return t()}}vy.prepareGetHeaders=QFe});var GQ=p(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.ZipkinExporter=void 0;var BQ=(b(),y(P)),FQ=W(),VQ=Hx(),$x=UQ(),Yx=(yt(),y(Dt)),ZFe=kQ(),Wx=class{DEFAULT_SERVICE_NAME="OpenTelemetry Service";_statusCodeTagName;_statusDescriptionTagName;_urlStr;_send;_getHeaders;_serviceName;_isShutdown;_sendingPromises=[];constructor(e={}){this._urlStr=e.url||((0,FQ.getStringFromEnv)("OTEL_EXPORTER_ZIPKIN_ENDPOINT")??"http://localhost:9411/api/v2/spans"),this._send=(0,VQ.prepareSend)(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||$x.defaultStatusCodeTagName,this._statusDescriptionTagName=e.statusDescriptionTagName||$x.defaultStatusErrorTagName,this._isShutdown=!1,typeof e.getExportRequestHeaders=="function"?this._getHeaders=(0,ZFe.prepareGetHeaders)(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,r){let o=String(this._serviceName||e[0].resource.attributes[Yx.ATTR_SERVICE_NAME]||this.DEFAULT_SERVICE_NAME);if(BQ.diag.debug("Zipkin exporter export"),this._isShutdown){setTimeout(()=>r({code:FQ.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")}));return}let s=new Promise(i=>{this._sendSpans(e,o,n=>{i(),r(n)})});this._sendingPromises.push(s);let a=()=>{let i=this._sendingPromises.indexOf(s);this._sendingPromises.splice(i,1)};s.then(a,a)}shutdown(){return BQ.diag.debug("Zipkin exporter shutdown"),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,r)=>{Promise.all(this._sendingPromises).then(()=>{e()},r)})}_beforeSend(){this._getHeaders&&(this._send=(0,VQ.prepareSend)(this._urlStr,this._getHeaders()))}_sendSpans(e,r,o){let s=e.map(a=>(0,$x.toZipkinSpan)(a,String(a.attributes[Yx.ATTR_SERVICE_NAME]||a.resource.attributes[Yx.ATTR_SERVICE_NAME]||r),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(s,a=>{if(o)return o(a)})}};Ay.ZipkinExporter=Wx});var qQ=p(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.ZipkinExporter=tu.prepareSend=void 0;var eVe=Hx();Object.defineProperty(tu,"prepareSend",{enumerable:!0,get:function(){return eVe.prepareSend}});var tVe=GQ();Object.defineProperty(tu,"ZipkinExporter",{enumerable:!0,get:function(){return tVe.ZipkinExporter}})});var Kx=p(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});Oy.B3_DEBUG_FLAG_KEY=void 0;var rVe=(b(),y(P));Oy.B3_DEBUG_FLAG_KEY=(0,rVe.createContextKey)("OpenTelemetry Context Key B3 Debug Flag")});var Bd=p(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.X_B3_FLAGS=tr.X_B3_PARENT_SPAN_ID=tr.X_B3_SAMPLED=tr.X_B3_SPAN_ID=tr.X_B3_TRACE_ID=tr.B3_CONTEXT_HEADER=void 0;tr.B3_CONTEXT_HEADER="b3";tr.X_B3_TRACE_ID="x-b3-traceid";tr.X_B3_SPAN_ID="x-b3-spanid";tr.X_B3_SAMPLED="x-b3-sampled";tr.X_B3_PARENT_SPAN_ID="x-b3-parentspanid";tr.X_B3_FLAGS="x-b3-flags"});var zQ=p(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});Ry.B3MultiPropagator=void 0;var nn=(b(),y(P)),nVe=W(),jQ=Kx(),fr=Bd(),iVe=new Set([!0,"true","True","1",1]),oVe=new Set([!1,"false","False","0",0]);function sVe(t){return t===nn.TraceFlags.SAMPLED||t===nn.TraceFlags.NONE}function aVe(t){return Array.isArray(t)?t[0]:t}function by(t,e,r){let o=e.get(t,r);return aVe(o)}function cVe(t,e){let r=by(t,e,fr.X_B3_TRACE_ID);return typeof r=="string"?r.padStart(32,"0"):""}function uVe(t,e){let r=by(t,e,fr.X_B3_SPAN_ID);return typeof r=="string"?r:""}function HQ(t,e){return by(t,e,fr.X_B3_FLAGS)==="1"?"1":void 0}function lVe(t,e){let r=by(t,e,fr.X_B3_SAMPLED);if(HQ(t,e)==="1"||iVe.has(r))return nn.TraceFlags.SAMPLED;if(r===void 0||oVe.has(r))return nn.TraceFlags.NONE}var Xx=class{inject(e,r,o){let s=nn.trace.getSpanContext(e);if(!s||!(0,nn.isSpanContextValid)(s)||(0,nVe.isTracingSuppressed)(e))return;let a=e.getValue(jQ.B3_DEBUG_FLAG_KEY);o.set(r,fr.X_B3_TRACE_ID,s.traceId),o.set(r,fr.X_B3_SPAN_ID,s.spanId),a==="1"?o.set(r,fr.X_B3_FLAGS,a):s.traceFlags!==void 0&&o.set(r,fr.X_B3_SAMPLED,(nn.TraceFlags.SAMPLED&s.traceFlags)===nn.TraceFlags.SAMPLED?"1":"0")}extract(e,r,o){let s=cVe(r,o),a=uVe(r,o),i=lVe(r,o),n=HQ(r,o);return(0,nn.isValidTraceId)(s)&&(0,nn.isValidSpanId)(a)&&sVe(i)?(e=e.setValue(jQ.B3_DEBUG_FLAG_KEY,n),nn.trace.setSpanContext(e,{traceId:s,spanId:a,isRemote:!0,traceFlags:i})):e}fields(){return[fr.X_B3_TRACE_ID,fr.X_B3_SPAN_ID,fr.X_B3_FLAGS,fr.X_B3_SAMPLED,fr.X_B3_PARENT_SPAN_ID]}};Ry.B3MultiPropagator=Xx});var YQ=p(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.B3SinglePropagator=void 0;var Us=(b(),y(P)),dVe=W(),$Q=Kx(),Jx=Bd(),pVe=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,fVe="0".repeat(16),hVe=new Set(["d","1"]),mVe="d";function _Ve(t){return t.length===32?t:`${fVe}${t}`}function gVe(t){return t&&hVe.has(t)?Us.TraceFlags.SAMPLED:Us.TraceFlags.NONE}var Qx=class{inject(e,r,o){let s=Us.trace.getSpanContext(e);if(!s||!(0,Us.isSpanContextValid)(s)||(0,dVe.isTracingSuppressed)(e))return;let a=e.getValue($Q.B3_DEBUG_FLAG_KEY)||s.traceFlags&1,i=`${s.traceId}-${s.spanId}-${a}`;o.set(r,Jx.B3_CONTEXT_HEADER,i)}extract(e,r,o){let s=o.get(r,Jx.B3_CONTEXT_HEADER),a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=a.match(pVe);if(!i)return e;let[,n,c,u]=i,l=_Ve(n);if(!(0,Us.isValidTraceId)(l)||!(0,Us.isValidSpanId)(c))return e;let d=gVe(u);return u===mVe&&(e=e.setValue($Q.B3_DEBUG_FLAG_KEY,u)),Us.trace.setSpanContext(e,{traceId:l,spanId:c,isRemote:!0,traceFlags:d})}fields(){return[Jx.B3_CONTEXT_HEADER]}};Py.B3SinglePropagator=Qx});var Zx=p(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.B3InjectEncoding=void 0;var EVe;(function(t){t[t.SINGLE_HEADER=0]="SINGLE_HEADER",t[t.MULTI_HEADER=1]="MULTI_HEADER"})(EVe=Fd.B3InjectEncoding||(Fd.B3InjectEncoding={}))});var WQ=p(Cy=>{"use strict";Object.defineProperty(Cy,"__esModule",{value:!0});Cy.B3Propagator=void 0;var SVe=W(),TVe=zQ(),yVe=YQ(),vVe=Bd(),AVe=Zx(),ew=class{_b3MultiPropagator=new TVe.B3MultiPropagator;_b3SinglePropagator=new yVe.B3SinglePropagator;_inject;_fields;constructor(e={}){e.injectEncoding===AVe.B3InjectEncoding.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,r,o){(0,SVe.isTracingSuppressed)(e)||this._inject(e,r,o)}extract(e,r,o){let s=o.get(r,vVe.B3_CONTEXT_HEADER);return(Array.isArray(s)?s[0]:s)?this._b3SinglePropagator.extract(e,r,o):this._b3MultiPropagator.extract(e,r,o)}fields(){return this._fields}};Cy.B3Propagator=ew});var KQ=p(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.B3InjectEncoding=ct.X_B3_TRACE_ID=ct.X_B3_SPAN_ID=ct.X_B3_SAMPLED=ct.X_B3_PARENT_SPAN_ID=ct.X_B3_FLAGS=ct.B3_CONTEXT_HEADER=ct.B3Propagator=void 0;var OVe=WQ();Object.defineProperty(ct,"B3Propagator",{enumerable:!0,get:function(){return OVe.B3Propagator}});var ru=Bd();Object.defineProperty(ct,"B3_CONTEXT_HEADER",{enumerable:!0,get:function(){return ru.B3_CONTEXT_HEADER}});Object.defineProperty(ct,"X_B3_FLAGS",{enumerable:!0,get:function(){return ru.X_B3_FLAGS}});Object.defineProperty(ct,"X_B3_PARENT_SPAN_ID",{enumerable:!0,get:function(){return ru.X_B3_PARENT_SPAN_ID}});Object.defineProperty(ct,"X_B3_SAMPLED",{enumerable:!0,get:function(){return ru.X_B3_SAMPLED}});Object.defineProperty(ct,"X_B3_SPAN_ID",{enumerable:!0,get:function(){return ru.X_B3_SPAN_ID}});Object.defineProperty(ct,"X_B3_TRACE_ID",{enumerable:!0,get:function(){return ru.X_B3_TRACE_ID}});var bVe=Zx();Object.defineProperty(ct,"B3InjectEncoding",{enumerable:!0,get:function(){return bVe.B3InjectEncoding}})});var XQ=p(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.JaegerPropagator=on.UBER_BAGGAGE_HEADER_PREFIX=on.UBER_TRACE_ID_HEADER=void 0;var ks=(b(),y(P)),RVe=W();on.UBER_TRACE_ID_HEADER="uber-trace-id";on.UBER_BAGGAGE_HEADER_PREFIX="uberctx";var tw=class{_jaegerTraceHeader;_jaegerBaggageHeaderPrefix;constructor(e){typeof e=="string"?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=on.UBER_BAGGAGE_HEADER_PREFIX):(this._jaegerTraceHeader=e?.customTraceHeader||on.UBER_TRACE_ID_HEADER,this._jaegerBaggageHeaderPrefix=e?.customBaggageHeaderPrefix||on.UBER_BAGGAGE_HEADER_PREFIX)}inject(e,r,o){let s=ks.trace.getSpanContext(e),a=ks.propagation.getBaggage(e);if(s&&(0,RVe.isTracingSuppressed)(e)===!1){let i=`0${(s.traceFlags||ks.TraceFlags.NONE).toString(16)}`;o.set(r,this._jaegerTraceHeader,`${s.traceId}:${s.spanId}:0:${i}`)}if(a)for(let[i,n]of a.getAllEntries())o.set(r,`${this._jaegerBaggageHeaderPrefix}-${i}`,encodeURIComponent(n.value))}extract(e,r,o){let s=o.get(r,this._jaegerTraceHeader),a=Array.isArray(s)?s[0]:s,i=o.keys(r).filter(u=>u.startsWith(`${this._jaegerBaggageHeaderPrefix}-`)).map(u=>{let l=o.get(r,u);return{key:u.substring(this._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(l)?l[0]:l}}),n=e;if(typeof a=="string"){let u=CVe(a);u&&(n=ks.trace.setSpanContext(n,u))}if(i.length===0)return n;let c=ks.propagation.getBaggage(e)??ks.propagation.createBaggage();for(let u of i)u.value!==void 0&&(c=c.setEntry(u.key,{value:decodeURIComponent(u.value)}));return n=ks.propagation.setBaggage(n,c),n}fields(){return[this._jaegerTraceHeader]}};on.JaegerPropagator=tw;var PVe=/^[0-9a-f]{1,2}$/i;function CVe(t){let e=decodeURIComponent(t).split(":");if(e.length!==4)return null;let[r,o,,s]=e,a=r.padStart(32,"0"),i=o.padStart(16,"0"),n=PVe.test(s)?parseInt(s,16)&1:1;return{traceId:a,spanId:i,isRemote:!0,traceFlags:n}}});var JQ=p(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.UBER_TRACE_ID_HEADER=Oo.UBER_BAGGAGE_HEADER_PREFIX=Oo.JaegerPropagator=void 0;var rw=XQ();Object.defineProperty(Oo,"JaegerPropagator",{enumerable:!0,get:function(){return rw.JaegerPropagator}});Object.defineProperty(Oo,"UBER_BAGGAGE_HEADER_PREFIX",{enumerable:!0,get:function(){return rw.UBER_BAGGAGE_HEADER_PREFIX}});Object.defineProperty(Oo,"UBER_TRACE_ID_HEADER",{enumerable:!0,get:function(){return rw.UBER_TRACE_ID_HEADER}})});var tZ=p(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.getPropagatorFromEnv=wr.getSpanProcessorsFromEnv=wr.getOtlpProtocolFromEnv=wr.filterBlanksAndNulls=wr.getResourceDetectorsFromEnv=void 0;var bo=(b(),y(P)),Ro=W(),QQ=yQ(),NVe=PQ(),MVe=MQ(),IVe=qQ(),Vd=Aa(),Ny=Pg(),nw=KQ(),xVe=JQ(),wVe="env",LVe="host",DVe="os",UVe="process",kVe="serviceinstance";function BVe(){let t=new Map([[wVe,Vd.envDetector],[LVe,Vd.hostDetector],[DVe,Vd.osDetector],[kVe,Vd.serviceInstanceIdDetector],[UVe,Vd.processDetector]]),e=(0,Ro.getStringListFromEnv)("OTEL_NODE_RESOURCE_DETECTORS")??["all"];return e.includes("all")?[...t.values()].flat():e.includes("none")?[]:e.flatMap(r=>{let o=t.get(r);return o||bo.diag.warn(`Invalid resource detector "${r}" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),o||[]})}wr.getResourceDetectorsFromEnv=BVe;function ZQ(t){return t.map(e=>e.trim()).filter(e=>e!=="null"&&e!=="")}wr.filterBlanksAndNulls=ZQ;function eZ(){return(0,Ro.getStringFromEnv)("OTEL_EXPORTER_OTLP_TRACES_PROTOCOL")??(0,Ro.getStringFromEnv)("OTEL_EXPORTER_OTLP_PROTOCOL")??"http/protobuf"}wr.getOtlpProtocolFromEnv=eZ;function FVe(){let t=eZ();switch(t){case"grpc":return new MVe.OTLPTraceExporter;case"http/json":return new NVe.OTLPTraceExporter;case"http/protobuf":return new QQ.OTLPTraceExporter;default:return bo.diag.warn(`Unsupported OTLP traces protocol: ${t}. Using http/protobuf.`),new QQ.OTLPTraceExporter}}function VVe(){try{let{JaegerExporter:t}=require("@opentelemetry/exporter-jaeger");return new t}catch(t){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter's lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${t}`)}}function GVe(){let t=new Map([["otlp",()=>FVe()],["zipkin",()=>new IVe.ZipkinExporter],["console",()=>new Ny.ConsoleSpanExporter],["jaeger",()=>VVe()]]),e=[],r=[],o=ZQ(Array.from(new Set((0,Ro.getStringListFromEnv)("OTEL_TRACES_EXPORTER"))));if(o[0]==="none")return bo.diag.warn('OTEL_TRACES_EXPORTER contains "none". SDK will not be initialized.'),[];o.length===0?(bo.diag.debug("OTEL_TRACES_EXPORTER is empty. Using default otlp exporter."),o=["otlp"]):o.length>1&&o.includes("none")&&(bo.diag.warn('OTEL_TRACES_EXPORTER contains "none" along with other exporters. Using default otlp exporter.'),o=["otlp"]);for(let s of o){let a=t.get(s)?.();a?e.push(a):bo.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${s}.`)}for(let s of e)s instanceof Ny.ConsoleSpanExporter?r.push(new Ny.SimpleSpanProcessor(s)):r.push(new Ny.BatchSpanProcessor(s));return e.length===0&&bo.diag.warn("Unable to set up trace exporter(s) due to invalid exporter and/or protocol values."),r}wr.getSpanProcessorsFromEnv=GVe;function qVe(){let t=(0,Ro.getStringListFromEnv)("OTEL_PROPAGATORS");if(t==null)return;let e=new Map([["tracecontext",()=>new Ro.W3CTraceContextPropagator],["baggage",()=>new Ro.W3CBaggagePropagator],["b3",()=>new nw.B3Propagator],["b3multi",()=>new nw.B3Propagator({injectEncoding:nw.B3InjectEncoding.MULTI_HEADER})],["jaeger",()=>new xVe.JaegerPropagator]]),r=Array.from(new Set(t)),s=r.map(a=>{let i=e.get(a)?.();if(!i){bo.diag.warn(`Propagator "${a}" requested through environment variable is unavailable.`);return}return i}).reduce((a,i)=>(i&&a.push(i),a),[]);return s.length===0?null:r.length===1?s[0]:new Ro.CompositePropagator({propagators:s})}wr.getPropagatorFromEnv=qVe});var iZ=p(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});My.NodeSDK=void 0;var Vt=(b(),y(P)),jVe=Hu(),HVe=p4(),nu=Aa(),Gd=Vb(),zVe=OX(),$Ve=z7(),iw=J7(),YVe=sQ(),rZ=wx(),WVe=YT(),KVe=mQ(),Bs=Ei(),XVe=Pg(),JVe=WP(),QVe=(yt(),y(Dt)),Po=W(),ow=tZ();function nZ(t,e){return parseInt(process.env[t]||"")||e}function ZVe(){let t=[],e=(0,Po.getStringListFromEnv)("OTEL_METRICS_EXPORTER");return e?(e.length===0&&Vt.diag.debug("OTEL_METRICS_EXPORTER is empty. Using default otlp exporter."),e.includes("none")?(Vt.diag.info('OTEL_METRICS_EXPORTER contains "none". Metric provider will not be initialized.'),t):(e.forEach(r=>{if(r==="otlp"){let o=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),s=nZ("OTEL_METRIC_EXPORT_INTERVAL",6e4),a=nZ("OTEL_METRIC_EXPORT_TIMEOUT",3e4);switch(o){case"grpc":t.push(new Bs.PeriodicExportingMetricReader({exporter:new YVe.OTLPMetricExporter,exportIntervalMillis:s,exportTimeoutMillis:a}));break;case"http/json":t.push(new Bs.PeriodicExportingMetricReader({exporter:new WVe.OTLPMetricExporter,exportIntervalMillis:s,exportTimeoutMillis:a}));break;case"http/protobuf":t.push(new Bs.PeriodicExportingMetricReader({exporter:new rZ.OTLPMetricExporter,exportIntervalMillis:s,exportTimeoutMillis:a}));break;default:Vt.diag.warn(`Unsupported OTLP metrics protocol: "${o}". Using http/protobuf.`),t.push(new Bs.PeriodicExportingMetricReader({exporter:new rZ.OTLPMetricExporter,exportIntervalMillis:s,exportTimeoutMillis:a}))}}else r==="console"?t.push(new Bs.PeriodicExportingMetricReader({exporter:new Bs.ConsoleMetricExporter})):r==="prometheus"?t.push(new KVe.PrometheusExporter):Vt.diag.warn(`Unsupported OTEL_METRICS_EXPORTER value: "${r}". Supported values are: otlp, console, prometheus, none.`)}),t)):t}var sw=class{_tracerProviderConfig;_loggerProviderConfig;_meterProviderConfig;_instrumentations;_resource;_resourceDetectors;_autoDetectResources;_tracerProvider;_loggerProvider;_meterProvider;_serviceName;_configuration;_disabled;constructor(e={}){(0,Po.getBooleanFromEnv)("OTEL_SDK_DISABLED")&&(this._disabled=!0);let r=(0,Po.getStringFromEnv)("OTEL_LOG_LEVEL");if(r!=null&&Vt.diag.setLogger(new Vt.DiagConsoleLogger,{logLevel:(0,Po.diagLogLevelFromString)(r)}),this._configuration=e,this._resource=e.resource??(0,nu.defaultResource)(),this._autoDetectResources=e.autoDetectResources??!0,this._autoDetectResources?e.resourceDetectors!=null?this._resourceDetectors=e.resourceDetectors:(0,Po.getStringFromEnv)("OTEL_NODE_RESOURCE_DETECTORS")?this._resourceDetectors=(0,ow.getResourceDetectorsFromEnv)():this._resourceDetectors=[nu.envDetector,nu.processDetector,nu.hostDetector]:this._resourceDetectors=[],this._serviceName=e.serviceName,e.traceExporter||e.spanProcessor||e.spanProcessors){let o={};e.sampler&&(o.sampler=e.sampler),e.spanLimits&&(o.spanLimits=e.spanLimits),e.idGenerator&&(o.idGenerator=e.idGenerator),e.spanProcessor&&Vt.diag.warn("The 'spanProcessor' option is deprecated. Please use 'spanProcessors' instead.");let s=e.spanProcessor??new XVe.BatchSpanProcessor(e.traceExporter),a=e.spanProcessors??[s];this._tracerProviderConfig={tracerConfig:o,spanProcessors:a,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessors?this._loggerProviderConfig={logRecordProcessors:e.logRecordProcessors}:e.logRecordProcessor?(this._loggerProviderConfig={logRecordProcessors:[e.logRecordProcessor]},Vt.diag.warn("The 'logRecordProcessor' option is deprecated. Please use 'logRecordProcessors' instead.")):this.configureLoggerProviderFromEnv(),e.metricReaders||e.metricReader||e.views){let o={};e.metricReaders?o.readers=e.metricReaders:e.metricReader&&(o.readers=[e.metricReader],Vt.diag.warn("The 'metricReader' option is deprecated. Please use 'metricReaders' instead.")),e.views&&(o.views=e.views),this._meterProviderConfig=o}this._instrumentations=e.instrumentations?.flat()??[]}start(){if(this._disabled)return;if((0,HVe.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let o={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,nu.detectResources)(o))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge((0,nu.resourceFromAttributes)({[QVe.ATTR_SERVICE_NAME]:this._serviceName}));let e=this._tracerProviderConfig?this._tracerProviderConfig.spanProcessors:(0,ow.getSpanProcessorsFromEnv)();if(this._tracerProvider=new JVe.NodeTracerProvider({...this._configuration,resource:this._resource,spanProcessors:e}),e.length>0&&this._tracerProvider.register({contextManager:this._tracerProviderConfig?.contextManager??this._configuration?.contextManager,propagator:this._tracerProviderConfig?.textMapPropagator??(0,ow.getPropagatorFromEnv)()}),this._loggerProviderConfig){let o=new Gd.LoggerProvider({resource:this._resource,processors:this._loggerProviderConfig.logRecordProcessors});this._loggerProvider=o,jVe.logs.setGlobalLoggerProvider(o)}let r=ZVe();if(this._meterProviderConfig||r.length>0){let o=[];this._meterProviderConfig?.readers&&o.push(...this._meterProviderConfig.readers),o.length===0&&r.forEach(a=>o.push(a));let s=new Bs.MeterProvider({resource:this._resource,views:this._meterProviderConfig?.views??[],readers:o});this._meterProvider=s,Vt.metrics.setGlobalMeterProvider(s);for(let a of this._instrumentations)a.setMeterProvider(Vt.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&&e.push(this._tracerProvider.shutdown()),this._loggerProvider&&e.push(this._loggerProvider.shutdown()),this._meterProvider&&e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=>{})}configureLoggerProviderFromEnv(){let e=(0,Po.getStringListFromEnv)("OTEL_LOGS_EXPORTER")??[];if(e.length===0&&(Vt.diag.debug("OTEL_LOGS_EXPORTER is empty. Using default otlp exporter."),e.push("otlp")),e.includes("none")){Vt.diag.info('OTEL_LOGS_EXPORTER contains "none". Logger provider will not be initialized.');return}let r=[];e.forEach(o=>{if(o==="otlp"){let s=((0,Po.getStringFromEnv)("OTEL_EXPORTER_OTLP_LOGS_PROTOCOL")??(0,Po.getStringFromEnv)("OTEL_EXPORTER_OTLP_PROTOCOL"))?.trim();switch(s){case"grpc":r.push(new $Ve.OTLPLogExporter);break;case"http/json":r.push(new zVe.OTLPLogExporter);break;case"http/protobuf":r.push(new iw.OTLPLogExporter);break;case void 0:case"":r.push(new iw.OTLPLogExporter);break;default:Vt.diag.warn(`Unsupported OTLP logs protocol: "${s}". Using http/protobuf.`),r.push(new iw.OTLPLogExporter)}}else o==="console"?r.push(new Gd.ConsoleLogRecordExporter):Vt.diag.warn(`Unsupported OTEL_LOGS_EXPORTER value: "${o}". Supported values are: otlp, console, none.`)}),r.length>0&&(this._loggerProviderConfig={logRecordProcessors:r.map(o=>o instanceof Gd.ConsoleLogRecordExporter?new Gd.SimpleLogRecordProcessor(o):new Gd.BatchLogRecordProcessor(o))})}};My.NodeSDK=sw});var oZ=p($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.NodeSDK=$e.tracing=$e.resources=$e.node=$e.metrics=$e.logs=$e.core=$e.contextBase=$e.api=void 0;$e.api=(b(),y(P));$e.contextBase=(b(),y(P));$e.core=W();$e.logs=Vb();$e.metrics=Ei();$e.node=WP();$e.resources=Aa();$e.tracing=Pg();var eGe=iZ();Object.defineProperty($e,"NodeSDK",{enumerable:!0,get:function(){return eGe.NodeSDK}})});var qd=p(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.isTracingSuppressed=Co.unsuppressTracing=Co.suppressTracing=void 0;var tGe=(b(),y(P)),aw=(0,tGe.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function rGe(t){return t.setValue(aw,!0)}Co.suppressTracing=rGe;function nGe(t){return t.deleteValue(aw)}Co.unsuppressTracing=nGe;function iGe(t){return t.getValue(aw)===!0}Co.isTracingSuppressed=iGe});var cw=p(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.BAGGAGE_MAX_TOTAL_LENGTH=Rt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Rt.BAGGAGE_MAX_NAME_VALUE_PAIRS=Rt.BAGGAGE_HEADER=Rt.BAGGAGE_ITEMS_SEPARATOR=Rt.BAGGAGE_PROPERTIES_SEPARATOR=Rt.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Rt.BAGGAGE_KEY_PAIR_SEPARATOR="=";Rt.BAGGAGE_PROPERTIES_SEPARATOR=";";Rt.BAGGAGE_ITEMS_SEPARATOR=",";Rt.BAGGAGE_HEADER="baggage";Rt.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Rt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Rt.BAGGAGE_MAX_TOTAL_LENGTH=8192});var uw=p(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.parseKeyPairsIntoRecord=ii.parsePairKeyValue=ii.getKeyPairs=ii.serializeKeyPairs=void 0;var oGe=(b(),y(P)),Fs=cw();function sGe(t){return t.reduce((e,r)=>{let o=`${e}${e!==""?Fs.BAGGAGE_ITEMS_SEPARATOR:""}${r}`;return o.length>Fs.BAGGAGE_MAX_TOTAL_LENGTH?e:o},"")}ii.serializeKeyPairs=sGe;function aGe(t){return t.getAllEntries().map(([e,r])=>{let o=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(o+=Fs.BAGGAGE_PROPERTIES_SEPARATOR+r.metadata.toString()),o})}ii.getKeyPairs=aGe;function sZ(t){let e=t.split(Fs.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let r=e.shift();if(!r)return;let o=r.indexOf(Fs.BAGGAGE_KEY_PAIR_SEPARATOR);if(o<=0)return;let s=decodeURIComponent(r.substring(0,o).trim()),a=decodeURIComponent(r.substring(o+1).trim()),i;return e.length>0&&(i=(0,oGe.baggageEntryMetadataFromString)(e.join(Fs.BAGGAGE_PROPERTIES_SEPARATOR))),{key:s,value:a,metadata:i}}ii.parsePairKeyValue=sZ;function cGe(t){let e={};return typeof t=="string"&&t.length>0&&t.split(Fs.BAGGAGE_ITEMS_SEPARATOR).forEach(r=>{let o=sZ(r);o!==void 0&&o.value.length>0&&(e[o.key]=o.value)}),e}ii.parseKeyPairsIntoRecord=cGe});var aZ=p(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});Iy.W3CBaggagePropagator=void 0;var lw=(b(),y(P)),uGe=qd(),Vs=cw(),dw=uw(),pw=class{inject(e,r,o){let s=lw.propagation.getBaggage(e);if(!s||(0,uGe.isTracingSuppressed)(e))return;let a=(0,dw.getKeyPairs)(s).filter(n=>n.length<=Vs.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Vs.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,dw.serializeKeyPairs)(a);i.length>0&&o.set(r,Vs.BAGGAGE_HEADER,i)}extract(e,r,o){let s=o.get(r,Vs.BAGGAGE_HEADER),a=Array.isArray(s)?s.join(Vs.BAGGAGE_ITEMS_SEPARATOR):s;if(!a)return e;let i={};return a.length===0||(a.split(Vs.BAGGAGE_ITEMS_SEPARATOR).forEach(c=>{let u=(0,dw.parsePairKeyValue)(c);if(u){let l={value:u.value};u.metadata&&(l.metadata=u.metadata),i[u.key]=l}}),Object.entries(i).length===0)?e:lw.propagation.setBaggage(e,lw.propagation.createBaggage(i))}fields(){return[Vs.BAGGAGE_HEADER]}};Iy.W3CBaggagePropagator=pw});var cZ=p(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});xy.AnchoredClock=void 0;var fw=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}};xy.AnchoredClock=fw});var fZ=p(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.isAttributeValue=No.isAttributeKey=No.sanitizeAttributes=void 0;var uZ=(b(),y(P));function lGe(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(!lZ(r)){uZ.diag.warn(`Invalid attribute key: ${r}`);continue}let o=t[r];if(!dZ(o)){uZ.diag.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(o)?e[r]=o.slice():e[r]=o}return e}No.sanitizeAttributes=lGe;function lZ(t){return typeof t=="string"&&t!==""}No.isAttributeKey=lZ;function dZ(t){return t==null?!0:Array.isArray(t)?dGe(t):pZ(typeof t)}No.isAttributeValue=dZ;function dGe(t){let e;for(let r of t){if(r==null)continue;let o=typeof r;if(o!==e){if(!e){if(pZ(o)){e=o;continue}return!1}return!1}}return!0}function pZ(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}});var hw=p(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});wy.loggingErrorHandler=void 0;var pGe=(b(),y(P));function fGe(){return t=>{pGe.diag.error(hGe(t))}}wy.loggingErrorHandler=fGe;function hGe(t){return typeof t=="string"?t:JSON.stringify(mGe(t))}function mGe(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(o=>{if(e[o])return;let s=r[o];s&&(e[o]=String(s))}),r=Object.getPrototypeOf(r);return e}});var mZ=p(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.globalErrorHandler=iu.setGlobalErrorHandler=void 0;var _Ge=hw(),hZ=(0,_Ge.loggingErrorHandler)();function gGe(t){hZ=t}iu.setGlobalErrorHandler=gGe;function EGe(t){try{hZ(t)}catch{}}iu.globalErrorHandler=EGe});var SZ=p(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.getStringListFromEnv=oi.getBooleanFromEnv=oi.getStringFromEnv=oi.getNumberFromEnv=void 0;var _Z=(b(),y(P)),gZ=require("util");function SGe(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){_Z.diag.warn(`Unknown value ${(0,gZ.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}oi.getNumberFromEnv=SGe;function EZ(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}oi.getStringFromEnv=EZ;function TGe(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||_Z.diag.warn(`Unknown value ${(0,gZ.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}oi.getBooleanFromEnv=TGe;function yGe(t){return EZ(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}oi.getStringListFromEnv=yGe});var TZ=p(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly._globalThis=void 0;Ly._globalThis=typeof globalThis=="object"?globalThis:global});var yZ=p(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.otperformance=void 0;var vGe=require("perf_hooks");Dy.otperformance=vGe.performance});var vZ=p(Uy=>{"use strict";Object.defineProperty(Uy,"__esModule",{value:!0});Uy.VERSION=void 0;Uy.VERSION="2.2.0"});var AZ=p(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});ky.ATTR_PROCESS_RUNTIME_NAME=void 0;ky.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var OZ=p(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.SDK_INFO=void 0;var AGe=vZ(),By=(yt(),y(Dt)),OGe=AZ();Fy.SDK_INFO={[By.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[OGe.ATTR_PROCESS_RUNTIME_NAME]:"node",[By.ATTR_TELEMETRY_SDK_LANGUAGE]:By.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[By.ATTR_TELEMETRY_SDK_VERSION]:AGe.VERSION}});var bZ=p(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.SDK_INFO=Pt.otperformance=Pt._globalThis=Pt.getStringListFromEnv=Pt.getNumberFromEnv=Pt.getBooleanFromEnv=Pt.getStringFromEnv=void 0;var Vy=SZ();Object.defineProperty(Pt,"getStringFromEnv",{enumerable:!0,get:function(){return Vy.getStringFromEnv}});Object.defineProperty(Pt,"getBooleanFromEnv",{enumerable:!0,get:function(){return Vy.getBooleanFromEnv}});Object.defineProperty(Pt,"getNumberFromEnv",{enumerable:!0,get:function(){return Vy.getNumberFromEnv}});Object.defineProperty(Pt,"getStringListFromEnv",{enumerable:!0,get:function(){return Vy.getStringListFromEnv}});var bGe=TZ();Object.defineProperty(Pt,"_globalThis",{enumerable:!0,get:function(){return bGe._globalThis}});var RGe=yZ();Object.defineProperty(Pt,"otperformance",{enumerable:!0,get:function(){return RGe.otperformance}});var PGe=OZ();Object.defineProperty(Pt,"SDK_INFO",{enumerable:!0,get:function(){return PGe.SDK_INFO}})});var mw=p(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.getStringListFromEnv=Ct.getNumberFromEnv=Ct.getStringFromEnv=Ct.getBooleanFromEnv=Ct.otperformance=Ct._globalThis=Ct.SDK_INFO=void 0;var Gs=bZ();Object.defineProperty(Ct,"SDK_INFO",{enumerable:!0,get:function(){return Gs.SDK_INFO}});Object.defineProperty(Ct,"_globalThis",{enumerable:!0,get:function(){return Gs._globalThis}});Object.defineProperty(Ct,"otperformance",{enumerable:!0,get:function(){return Gs.otperformance}});Object.defineProperty(Ct,"getBooleanFromEnv",{enumerable:!0,get:function(){return Gs.getBooleanFromEnv}});Object.defineProperty(Ct,"getStringFromEnv",{enumerable:!0,get:function(){return Gs.getStringFromEnv}});Object.defineProperty(Ct,"getNumberFromEnv",{enumerable:!0,get:function(){return Gs.getNumberFromEnv}});Object.defineProperty(Ct,"getStringListFromEnv",{enumerable:!0,get:function(){return Gs.getStringListFromEnv}})});var NZ=p(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.addHrTimes=be.isTimeInput=be.isTimeInputHrTime=be.hrTimeToMicroseconds=be.hrTimeToMilliseconds=be.hrTimeToNanoseconds=be.hrTimeToTimeStamp=be.hrTimeDuration=be.timeInputToHrTime=be.hrTime=be.getTimeOrigin=be.millisToHrTime=void 0;var _w=mw(),RZ=9,CGe=6,NGe=Math.pow(10,CGe),Gy=Math.pow(10,RZ);function jd(t){let e=t/1e3,r=Math.trunc(e),o=Math.round(t%1e3*NGe);return[r,o]}be.millisToHrTime=jd;function gw(){let t=_w.otperformance.timeOrigin;if(typeof t!="number"){let e=_w.otperformance;t=e.timing&&e.timing.fetchStart}return t}be.getTimeOrigin=gw;function PZ(t){let e=jd(gw()),r=jd(typeof t=="number"?t:_w.otperformance.now());return CZ(e,r)}be.hrTime=PZ;function MGe(t){if(Ew(t))return t;if(typeof t=="number")return t<gw()?PZ(t):jd(t);if(t instanceof Date)return jd(t.getTime());throw TypeError("Invalid input type")}be.timeInputToHrTime=MGe;function IGe(t,e){let r=e[0]-t[0],o=e[1]-t[1];return o<0&&(r-=1,o+=Gy),[r,o]}be.hrTimeDuration=IGe;function xGe(t){let e=RZ,r=`${"0".repeat(e)}${t[1]}Z`,o=r.substring(r.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",o)}be.hrTimeToTimeStamp=xGe;function wGe(t){return t[0]*Gy+t[1]}be.hrTimeToNanoseconds=wGe;function LGe(t){return t[0]*1e3+t[1]/1e6}be.hrTimeToMilliseconds=LGe;function DGe(t){return t[0]*1e6+t[1]/1e3}be.hrTimeToMicroseconds=DGe;function Ew(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}be.isTimeInputHrTime=Ew;function UGe(t){return Ew(t)||typeof t=="number"||t instanceof Date}be.isTimeInput=UGe;function CZ(t,e){let r=[t[0]+e[0],t[1]+e[1]];return r[1]>=Gy&&(r[1]-=Gy,r[0]+=1),r}be.addHrTimes=CZ});var MZ=p(qy=>{"use strict";Object.defineProperty(qy,"__esModule",{value:!0});qy.unrefTimer=void 0;function kGe(t){typeof t!="number"&&t.unref()}qy.unrefTimer=kGe});var IZ=p(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.ExportResultCode=void 0;var BGe;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(BGe=Hd.ExportResultCode||(Hd.ExportResultCode={}))});var wZ=p(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});jy.CompositePropagator=void 0;var xZ=(b(),y(P)),Sw=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,o)=>r.concat(o),[])))}inject(e,r,o){for(let s of this._propagators)try{s.inject(e,r,o)}catch(a){xZ.diag.warn(`Failed to inject with ${s.constructor.name}. Err: ${a.message}`)}}extract(e,r,o){return this._propagators.reduce((s,a)=>{try{return a.extract(s,r,o)}catch(i){xZ.diag.warn(`Failed to extract with ${a.constructor.name}. Err: ${i.message}`)}return s},e)}fields(){return this._fields.slice()}};jy.CompositePropagator=Sw});var LZ=p(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.validateValue=ou.validateKey=void 0;var Tw="[_0-9a-z-*/]",FGe=`[a-z]${Tw}{0,255}`,VGe=`[a-z0-9]${Tw}{0,240}@[a-z]${Tw}{0,13}`,GGe=new RegExp(`^(?:${FGe}|${VGe})$`),qGe=/^[ -~]{0,255}[!-~]$/,jGe=/,|=/;function HGe(t){return GGe.test(t)}ou.validateKey=HGe;function zGe(t){return qGe.test(t)&&!jGe.test(t)}ou.validateValue=zGe});var vw=p(Hy=>{"use strict";Object.defineProperty(Hy,"__esModule",{value:!0});Hy.TraceState=void 0;var DZ=LZ(),UZ=32,$Ge=512,kZ=",",BZ="=",yw=class t{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let o=this._clone();return o._internalState.has(e)&&o._internalState.delete(e),o._internalState.set(e,r),o}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+BZ+this.get(r)),e),[]).join(kZ)}_parse(e){e.length>$Ge||(this._internalState=e.split(kZ).reverse().reduce((r,o)=>{let s=o.trim(),a=s.indexOf(BZ);if(a!==-1){let i=s.slice(0,a),n=s.slice(a+1,o.length);(0,DZ.validateKey)(i)&&(0,DZ.validateValue)(n)&&r.set(i,n)}return r},new Map),this._internalState.size>UZ&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,UZ))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};Hy.TraceState=yw});var VZ=p(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.W3CTraceContextPropagator=Nt.parseTraceParent=Nt.TRACE_STATE_HEADER=Nt.TRACE_PARENT_HEADER=void 0;var zy=(b(),y(P)),YGe=qd(),WGe=vw();Nt.TRACE_PARENT_HEADER="traceparent";Nt.TRACE_STATE_HEADER="tracestate";var KGe="00",XGe="(?!ff)[\\da-f]{2}",JGe="(?![0]{32})[\\da-f]{32}",QGe="(?![0]{16})[\\da-f]{16}",ZGe="[\\da-f]{2}",eqe=new RegExp(`^\\s?(${XGe})-(${JGe})-(${QGe})-(${ZGe})(-.*)?\\s?$`);function FZ(t){let e=eqe.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}Nt.parseTraceParent=FZ;var Aw=class{inject(e,r,o){let s=zy.trace.getSpanContext(e);if(!s||(0,YGe.isTracingSuppressed)(e)||!(0,zy.isSpanContextValid)(s))return;let a=`${KGe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||zy.TraceFlags.NONE).toString(16)}`;o.set(r,Nt.TRACE_PARENT_HEADER,a),s.traceState&&o.set(r,Nt.TRACE_STATE_HEADER,s.traceState.serialize())}extract(e,r,o){let s=o.get(r,Nt.TRACE_PARENT_HEADER);if(!s)return e;let a=Array.isArray(s)?s[0]:s;if(typeof a!="string")return e;let i=FZ(a);if(!i)return e;i.isRemote=!0;let n=o.get(r,Nt.TRACE_STATE_HEADER);if(n){let c=Array.isArray(n)?n.join(","):n;i.traceState=new WGe.TraceState(typeof c=="string"?c:void 0)}return zy.trace.setSpanContext(e,i)}fields(){return[Nt.TRACE_PARENT_HEADER,Nt.TRACE_STATE_HEADER]}};Nt.W3CTraceContextPropagator=Aw});var GZ=p(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.getRPCMetadata=sn.deleteRPCMetadata=sn.setRPCMetadata=sn.RPCType=void 0;var tqe=(b(),y(P)),Ow=(0,tqe.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),rqe;(function(t){t.HTTP="http"})(rqe=sn.RPCType||(sn.RPCType={}));function nqe(t,e){return t.setValue(Ow,e)}sn.setRPCMetadata=nqe;function iqe(t){return t.deleteValue(Ow)}sn.deleteRPCMetadata=iqe;function oqe(t){return t.getValue(Ow)}sn.getRPCMetadata=oqe});var $Z=p($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0});$y.isPlainObject=void 0;var sqe="[object Object]",aqe="[object Null]",cqe="[object Undefined]",uqe=Function.prototype,qZ=uqe.toString,lqe=qZ.call(Object),dqe=Object.getPrototypeOf,jZ=Object.prototype,HZ=jZ.hasOwnProperty,qs=Symbol?Symbol.toStringTag:void 0,zZ=jZ.toString;function pqe(t){if(!fqe(t)||hqe(t)!==sqe)return!1;let e=dqe(t);if(e===null)return!0;let r=HZ.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&qZ.call(r)===lqe}$y.isPlainObject=pqe;function fqe(t){return t!=null&&typeof t=="object"}function hqe(t){return t==null?t===void 0?cqe:aqe:qs&&qs in Object(t)?mqe(t):_qe(t)}function mqe(t){let e=HZ.call(t,qs),r=t[qs],o=!1;try{t[qs]=void 0,o=!0}catch{}let s=zZ.call(t);return o&&(e?t[qs]=r:delete t[qs]),s}function _qe(t){return zZ.call(t)}});var JZ=p(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});Ky.merge=void 0;var YZ=$Z(),gqe=20;function Eqe(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=KZ(e,t.shift(),0,r);return e}Ky.merge=Eqe;function bw(t){return Wy(t)?t.slice():t}function KZ(t,e,r=0,o){let s;if(!(r>gqe)){if(r++,Yy(t)||Yy(e)||XZ(e))s=bw(e);else if(Wy(t)){if(s=t.slice(),Wy(e))for(let a=0,i=e.length;a<i;a++)s.push(bw(e[a]));else if(zd(e)){let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let c=a[i];s[c]=bw(e[c])}}}else if(zd(t))if(zd(e)){if(!Sqe(t,e))return e;s=Object.assign({},t);let a=Object.keys(e);for(let i=0,n=a.length;i<n;i++){let c=a[i],u=e[c];if(Yy(u))typeof u>"u"?delete s[c]:s[c]=u;else{let l=s[c],d=u;if(WZ(t,c,o)||WZ(e,c,o))delete s[c];else{if(zd(l)&&zd(d)){let h=o.get(l)||[],g=o.get(d)||[];h.push({obj:t,key:c}),g.push({obj:e,key:c}),o.set(l,h),o.set(d,g)}s[c]=KZ(s[c],u,r,o)}}}}else s=e;return s}}function WZ(t,e,r){let o=r.get(t[e])||[];for(let s=0,a=o.length;s<a;s++){let i=o[s];if(i.key===e&&i.obj===t)return!0}return!1}function Wy(t){return Array.isArray(t)}function XZ(t){return typeof t=="function"}function zd(t){return!Yy(t)&&!Wy(t)&&!XZ(t)&&typeof t=="object"}function Yy(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function Sqe(t,e){return!(!(0,YZ.isPlainObject)(t)||!(0,YZ.isPlainObject)(e))}});var QZ=p(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.callWithTimeout=su.TimeoutError=void 0;var Xy=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};su.TimeoutError=Xy;function Tqe(t,e){let r,o=new Promise(function(a,i){r=setTimeout(function(){i(new Xy("Operation timed out."))},e)});return Promise.race([t,o]).then(s=>(clearTimeout(r),s),s=>{throw clearTimeout(r),s})}su.callWithTimeout=Tqe});var eee=p(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.isUrlIgnored=au.urlMatches=void 0;function ZZ(t,e){return typeof e=="string"?t===e:!!t.match(e)}au.urlMatches=ZZ;function yqe(t,e){if(!e)return!1;for(let r of e)if(ZZ(t,r))return!0;return!1}au.isUrlIgnored=yqe});var tee=p(Jy=>{"use strict";Object.defineProperty(Jy,"__esModule",{value:!0});Jy.Deferred=void 0;var Rw=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)}};Jy.Deferred=Rw});var ree=p(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.BindOnceFuture=void 0;var vqe=tee(),Pw=class{_callback;_that;_isCalled=!1;_deferred=new vqe.Deferred;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}};Qy.BindOnceFuture=Pw});var iee=p(Zy=>{"use strict";Object.defineProperty(Zy,"__esModule",{value:!0});Zy.diagLogLevelFromString=void 0;var Li=(b(),y(P)),nee={ALL:Li.DiagLogLevel.ALL,VERBOSE:Li.DiagLogLevel.VERBOSE,DEBUG:Li.DiagLogLevel.DEBUG,INFO:Li.DiagLogLevel.INFO,WARN:Li.DiagLogLevel.WARN,ERROR:Li.DiagLogLevel.ERROR,NONE:Li.DiagLogLevel.NONE};function Aqe(t){if(t==null)return;let e=nee[t.toUpperCase()];return e??(Li.diag.warn(`Unknown log level "${t}", expected one of ${Object.keys(nee)}, using default`),Li.DiagLogLevel.INFO)}Zy.diagLogLevelFromString=Aqe});var see=p(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});ev._export=void 0;var oee=(b(),y(P)),Oqe=qd();function bqe(t,e){return new Promise(r=>{oee.context.with((0,Oqe.suppressTracing)(oee.context.active()),()=>{t.export(e,o=>{r(o)})})})}ev._export=bqe});var Nw=p(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.internal=w.diagLogLevelFromString=w.BindOnceFuture=w.urlMatches=w.isUrlIgnored=w.callWithTimeout=w.TimeoutError=w.merge=w.TraceState=w.unsuppressTracing=w.suppressTracing=w.isTracingSuppressed=w.setRPCMetadata=w.getRPCMetadata=w.deleteRPCMetadata=w.RPCType=w.parseTraceParent=w.W3CTraceContextPropagator=w.TRACE_STATE_HEADER=w.TRACE_PARENT_HEADER=w.CompositePropagator=w.otperformance=w.getStringListFromEnv=w.getNumberFromEnv=w.getBooleanFromEnv=w.getStringFromEnv=w._globalThis=w.SDK_INFO=w.parseKeyPairsIntoRecord=w.ExportResultCode=w.unrefTimer=w.timeInputToHrTime=w.millisToHrTime=w.isTimeInputHrTime=w.isTimeInput=w.hrTimeToTimeStamp=w.hrTimeToNanoseconds=w.hrTimeToMilliseconds=w.hrTimeToMicroseconds=w.hrTimeDuration=w.hrTime=w.getTimeOrigin=w.addHrTimes=w.loggingErrorHandler=w.setGlobalErrorHandler=w.globalErrorHandler=w.sanitizeAttributes=w.isAttributeValue=w.AnchoredClock=w.W3CBaggagePropagator=void 0;var Rqe=aZ();Object.defineProperty(w,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Rqe.W3CBaggagePropagator}});var Pqe=cZ();Object.defineProperty(w,"AnchoredClock",{enumerable:!0,get:function(){return Pqe.AnchoredClock}});var aee=fZ();Object.defineProperty(w,"isAttributeValue",{enumerable:!0,get:function(){return aee.isAttributeValue}});Object.defineProperty(w,"sanitizeAttributes",{enumerable:!0,get:function(){return aee.sanitizeAttributes}});var cee=mZ();Object.defineProperty(w,"globalErrorHandler",{enumerable:!0,get:function(){return cee.globalErrorHandler}});Object.defineProperty(w,"setGlobalErrorHandler",{enumerable:!0,get:function(){return cee.setGlobalErrorHandler}});var Cqe=hw();Object.defineProperty(w,"loggingErrorHandler",{enumerable:!0,get:function(){return Cqe.loggingErrorHandler}});var Lr=NZ();Object.defineProperty(w,"addHrTimes",{enumerable:!0,get:function(){return Lr.addHrTimes}});Object.defineProperty(w,"getTimeOrigin",{enumerable:!0,get:function(){return Lr.getTimeOrigin}});Object.defineProperty(w,"hrTime",{enumerable:!0,get:function(){return Lr.hrTime}});Object.defineProperty(w,"hrTimeDuration",{enumerable:!0,get:function(){return Lr.hrTimeDuration}});Object.defineProperty(w,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Lr.hrTimeToMicroseconds}});Object.defineProperty(w,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Lr.hrTimeToMilliseconds}});Object.defineProperty(w,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Lr.hrTimeToNanoseconds}});Object.defineProperty(w,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Lr.hrTimeToTimeStamp}});Object.defineProperty(w,"isTimeInput",{enumerable:!0,get:function(){return Lr.isTimeInput}});Object.defineProperty(w,"isTimeInputHrTime",{enumerable:!0,get:function(){return Lr.isTimeInputHrTime}});Object.defineProperty(w,"millisToHrTime",{enumerable:!0,get:function(){return Lr.millisToHrTime}});Object.defineProperty(w,"timeInputToHrTime",{enumerable:!0,get:function(){return Lr.timeInputToHrTime}});var Nqe=MZ();Object.defineProperty(w,"unrefTimer",{enumerable:!0,get:function(){return Nqe.unrefTimer}});var Mqe=IZ();Object.defineProperty(w,"ExportResultCode",{enumerable:!0,get:function(){return Mqe.ExportResultCode}});var Iqe=uw();Object.defineProperty(w,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Iqe.parseKeyPairsIntoRecord}});var js=mw();Object.defineProperty(w,"SDK_INFO",{enumerable:!0,get:function(){return js.SDK_INFO}});Object.defineProperty(w,"_globalThis",{enumerable:!0,get:function(){return js._globalThis}});Object.defineProperty(w,"getStringFromEnv",{enumerable:!0,get:function(){return js.getStringFromEnv}});Object.defineProperty(w,"getBooleanFromEnv",{enumerable:!0,get:function(){return js.getBooleanFromEnv}});Object.defineProperty(w,"getNumberFromEnv",{enumerable:!0,get:function(){return js.getNumberFromEnv}});Object.defineProperty(w,"getStringListFromEnv",{enumerable:!0,get:function(){return js.getStringListFromEnv}});Object.defineProperty(w,"otperformance",{enumerable:!0,get:function(){return js.otperformance}});var xqe=wZ();Object.defineProperty(w,"CompositePropagator",{enumerable:!0,get:function(){return xqe.CompositePropagator}});var tv=VZ();Object.defineProperty(w,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return tv.TRACE_PARENT_HEADER}});Object.defineProperty(w,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return tv.TRACE_STATE_HEADER}});Object.defineProperty(w,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return tv.W3CTraceContextPropagator}});Object.defineProperty(w,"parseTraceParent",{enumerable:!0,get:function(){return tv.parseTraceParent}});var rv=GZ();Object.defineProperty(w,"RPCType",{enumerable:!0,get:function(){return rv.RPCType}});Object.defineProperty(w,"deleteRPCMetadata",{enumerable:!0,get:function(){return rv.deleteRPCMetadata}});Object.defineProperty(w,"getRPCMetadata",{enumerable:!0,get:function(){return rv.getRPCMetadata}});Object.defineProperty(w,"setRPCMetadata",{enumerable:!0,get:function(){return rv.setRPCMetadata}});var Cw=qd();Object.defineProperty(w,"isTracingSuppressed",{enumerable:!0,get:function(){return Cw.isTracingSuppressed}});Object.defineProperty(w,"suppressTracing",{enumerable:!0,get:function(){return Cw.suppressTracing}});Object.defineProperty(w,"unsuppressTracing",{enumerable:!0,get:function(){return Cw.unsuppressTracing}});var wqe=vw();Object.defineProperty(w,"TraceState",{enumerable:!0,get:function(){return wqe.TraceState}});var Lqe=JZ();Object.defineProperty(w,"merge",{enumerable:!0,get:function(){return Lqe.merge}});var uee=QZ();Object.defineProperty(w,"TimeoutError",{enumerable:!0,get:function(){return uee.TimeoutError}});Object.defineProperty(w,"callWithTimeout",{enumerable:!0,get:function(){return uee.callWithTimeout}});var lee=eee();Object.defineProperty(w,"isUrlIgnored",{enumerable:!0,get:function(){return lee.isUrlIgnored}});Object.defineProperty(w,"urlMatches",{enumerable:!0,get:function(){return lee.urlMatches}});var Dqe=ree();Object.defineProperty(w,"BindOnceFuture",{enumerable:!0,get:function(){return Dqe.BindOnceFuture}});var Uqe=iee();Object.defineProperty(w,"diagLogLevelFromString",{enumerable:!0,get:function(){return Uqe.diagLogLevelFromString}});var kqe=see();w.internal={_export:kqe._export}});var dee=p(nv=>{"use strict";Object.defineProperty(nv,"__esModule",{value:!0});nv.defaultServiceName=void 0;function Bqe(){return`unknown_service:${process.argv0}`}nv.defaultServiceName=Bqe});var pee=p(iv=>{"use strict";Object.defineProperty(iv,"__esModule",{value:!0});iv.defaultServiceName=void 0;var Fqe=dee();Object.defineProperty(iv,"defaultServiceName",{enumerable:!0,get:function(){return Fqe.defaultServiceName}})});var Mw=p(ov=>{"use strict";Object.defineProperty(ov,"__esModule",{value:!0});ov.defaultServiceName=void 0;var Vqe=pee();Object.defineProperty(ov,"defaultServiceName",{enumerable:!0,get:function(){return Vqe.defaultServiceName}})});var fee=p(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.identity=cu.isPromiseLike=void 0;var Gqe=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";cu.isPromiseLike=Gqe;function qqe(t){return t}cu.identity=qqe});var ww=p(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.defaultResource=si.emptyResource=si.resourceFromDetectedResource=si.resourceFromAttributes=void 0;var Yd=(b(),y(P)),Iw=Nw(),Hs=(yt(),y(Dt)),jqe=Mw(),$d=fee(),sv=class t{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,r){let o=new t({},r);return o._rawAttributes=hee(e),o._asyncAttributesPending=e.filter(([s,a])=>(0,$d.isPromiseLike)(a)).length>0,o}constructor(e,r){let o=e.attributes??{};this._rawAttributes=Object.entries(o).map(([s,a])=>((0,$d.isPromiseLike)(a)&&(this._asyncAttributesPending=!0),[s,a])),this._rawAttributes=hee(this._rawAttributes),this._schemaUrl=Yqe(r?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[r,o]=this._rawAttributes[e];this._rawAttributes[e]=[r,(0,$d.isPromiseLike)(o)?await o:o]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Yd.diag.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[r,o]of this._rawAttributes){if((0,$d.isPromiseLike)(o)){Yd.diag.debug(`Unsettled resource attribute ${r} skipped`);continue}o!=null&&(e[r]??=o)}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=Wqe(this,e),o=r?{schemaUrl:r}:void 0;return t.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}};function xw(t,e){return sv.FromAttributeList(Object.entries(t),e)}si.resourceFromAttributes=xw;function Hqe(t,e){return new sv(t,e)}si.resourceFromDetectedResource=Hqe;function zqe(){return xw({})}si.emptyResource=zqe;function $qe(){return xw({[Hs.ATTR_SERVICE_NAME]:(0,jqe.defaultServiceName)(),[Hs.ATTR_TELEMETRY_SDK_LANGUAGE]:Iw.SDK_INFO[Hs.ATTR_TELEMETRY_SDK_LANGUAGE],[Hs.ATTR_TELEMETRY_SDK_NAME]:Iw.SDK_INFO[Hs.ATTR_TELEMETRY_SDK_NAME],[Hs.ATTR_TELEMETRY_SDK_VERSION]:Iw.SDK_INFO[Hs.ATTR_TELEMETRY_SDK_VERSION]})}si.defaultResource=$qe;function hee(t){return t.map(([e,r])=>(0,$d.isPromiseLike)(r)?[e,r.catch(o=>{Yd.diag.debug("promise rejection for resource attribute: %s - %s",e,o)})]:[e,r])}function Yqe(t){if(typeof t=="string"||t===void 0)return t;Yd.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}function Wqe(t,e){let r=t?.schemaUrl,o=e?.schemaUrl,s=r===void 0||r==="",a=o===void 0||o==="";if(s)return o;if(a||r===o)return r;Yd.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,o)}});var _ee=p(av=>{"use strict";Object.defineProperty(av,"__esModule",{value:!0});av.detectResources=void 0;var mee=(b(),y(P)),Lw=ww(),Kqe=(t={})=>(t.detectors||[]).map(r=>{try{let o=(0,Lw.resourceFromDetectedResource)(r.detect(t));return mee.diag.debug(`${r.constructor.name} found resource.`,o),o}catch(o){return mee.diag.debug(`${r.constructor.name} failed: ${o.message}`),(0,Lw.emptyResource)()}}).reduce((r,o)=>r.merge(o),(0,Lw.emptyResource)());av.detectResources=Kqe});var Eee=p(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});cv.envDetector=void 0;var Xqe=(b(),y(P)),Jqe=(yt(),y(Dt)),gee=Nw(),Dw=class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";_ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.";_ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters.";detect(e){let r={},o=(0,gee.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),s=(0,gee.getStringFromEnv)("OTEL_SERVICE_NAME");if(o)try{let a=this._parseResourceAttributes(o);Object.assign(r,a)}catch(a){Xqe.diag.debug(`EnvDetector failed: ${a.message}`)}return s&&(r[Jqe.ATTR_SERVICE_NAME]=s),{attributes:r}}_parseResourceAttributes(e){if(!e)return{};let r={},o=e.split(this._COMMA_SEPARATOR,-1);for(let s of o){let a=s.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(a.length!==2)continue;let[i,n]=a;if(i=i.trim(),n=n.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(n))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);r[i]=decodeURIComponent(n)}return r}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o<33||o===44||o===59||o===92||o>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};cv.envDetector=new Dw});var Wd=p(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.ATTR_WEBENGINE_VERSION=q.ATTR_WEBENGINE_NAME=q.ATTR_WEBENGINE_DESCRIPTION=q.ATTR_SERVICE_NAMESPACE=q.ATTR_SERVICE_INSTANCE_ID=q.ATTR_PROCESS_RUNTIME_VERSION=q.ATTR_PROCESS_RUNTIME_NAME=q.ATTR_PROCESS_RUNTIME_DESCRIPTION=q.ATTR_PROCESS_PID=q.ATTR_PROCESS_OWNER=q.ATTR_PROCESS_EXECUTABLE_PATH=q.ATTR_PROCESS_EXECUTABLE_NAME=q.ATTR_PROCESS_COMMAND_ARGS=q.ATTR_PROCESS_COMMAND=q.ATTR_OS_VERSION=q.ATTR_OS_TYPE=q.ATTR_K8S_POD_NAME=q.ATTR_K8S_NAMESPACE_NAME=q.ATTR_K8S_DEPLOYMENT_NAME=q.ATTR_K8S_CLUSTER_NAME=q.ATTR_HOST_TYPE=q.ATTR_HOST_NAME=q.ATTR_HOST_IMAGE_VERSION=q.ATTR_HOST_IMAGE_NAME=q.ATTR_HOST_IMAGE_ID=q.ATTR_HOST_ID=q.ATTR_HOST_ARCH=q.ATTR_CONTAINER_NAME=q.ATTR_CONTAINER_IMAGE_TAGS=q.ATTR_CONTAINER_IMAGE_NAME=q.ATTR_CONTAINER_ID=q.ATTR_CLOUD_REGION=q.ATTR_CLOUD_PROVIDER=q.ATTR_CLOUD_AVAILABILITY_ZONE=q.ATTR_CLOUD_ACCOUNT_ID=void 0;q.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";q.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";q.ATTR_CLOUD_PROVIDER="cloud.provider";q.ATTR_CLOUD_REGION="cloud.region";q.ATTR_CONTAINER_ID="container.id";q.ATTR_CONTAINER_IMAGE_NAME="container.image.name";q.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";q.ATTR_CONTAINER_NAME="container.name";q.ATTR_HOST_ARCH="host.arch";q.ATTR_HOST_ID="host.id";q.ATTR_HOST_IMAGE_ID="host.image.id";q.ATTR_HOST_IMAGE_NAME="host.image.name";q.ATTR_HOST_IMAGE_VERSION="host.image.version";q.ATTR_HOST_NAME="host.name";q.ATTR_HOST_TYPE="host.type";q.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";q.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";q.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";q.ATTR_K8S_POD_NAME="k8s.pod.name";q.ATTR_OS_TYPE="os.type";q.ATTR_OS_VERSION="os.version";q.ATTR_PROCESS_COMMAND="process.command";q.ATTR_PROCESS_COMMAND_ARGS="process.command_args";q.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";q.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";q.ATTR_PROCESS_OWNER="process.owner";q.ATTR_PROCESS_PID="process.pid";q.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";q.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";q.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";q.ATTR_SERVICE_INSTANCE_ID="service.instance.id";q.ATTR_SERVICE_NAMESPACE="service.namespace";q.ATTR_WEBENGINE_DESCRIPTION="webengine.description";q.ATTR_WEBENGINE_NAME="webengine.name";q.ATTR_WEBENGINE_VERSION="webengine.version"});var lv=p(uv=>{"use strict";Object.defineProperty(uv,"__esModule",{value:!0});uv.execAsync=void 0;var Qqe=require("child_process"),Zqe=require("util");uv.execAsync=Zqe.promisify(Qqe.exec)});var See=p(dv=>{"use strict";Object.defineProperty(dv,"__esModule",{value:!0});dv.getMachineId=void 0;var e2e=lv(),t2e=(b(),y(P));async function r2e(){try{let e=(await(0,e2e.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
|
|
49
|
+
`).find(o=>o.includes("IOPlatformUUID"));if(!e)return;let r=e.split('" = "');if(r.length===2)return r[1].slice(0,-1)}catch(t){t2e.diag.debug(`error reading machine id: ${t}`)}}dv.getMachineId=r2e});var Tee=p(pv=>{"use strict";Object.defineProperty(pv,"__esModule",{value:!0});pv.getMachineId=void 0;var n2e=require("fs"),i2e=(b(),y(P));async function o2e(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await n2e.promises.readFile(e,{encoding:"utf8"})).trim()}catch(r){i2e.diag.debug(`error reading machine id: ${r}`)}}pv.getMachineId=o2e});var vee=p(fv=>{"use strict";Object.defineProperty(fv,"__esModule",{value:!0});fv.getMachineId=void 0;var s2e=require("fs"),a2e=lv(),yee=(b(),y(P));async function c2e(){try{return(await s2e.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){yee.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,a2e.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){yee.diag.debug(`error reading machine id: ${t}`)}}fv.getMachineId=c2e});var Oee=p(hv=>{"use strict";Object.defineProperty(hv,"__esModule",{value:!0});hv.getMachineId=void 0;var Aee=require("process"),u2e=lv(),l2e=(b(),y(P));async function d2e(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Aee.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Aee.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let o=(await(0,u2e.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(r){l2e.diag.debug(`error reading machine id: ${r}`)}}hv.getMachineId=d2e});var bee=p(mv=>{"use strict";Object.defineProperty(mv,"__esModule",{value:!0});mv.getMachineId=void 0;var p2e=(b(),y(P));async function f2e(){p2e.diag.debug("could not read machine-id: unsupported platform")}mv.getMachineId=f2e});var Ree=p(_v=>{"use strict";Object.defineProperty(_v,"__esModule",{value:!0});_v.getMachineId=void 0;var h2e=require("process"),zs;async function m2e(){if(!zs)switch(h2e.platform){case"darwin":zs=(await Promise.resolve().then(()=>J(See()))).getMachineId;break;case"linux":zs=(await Promise.resolve().then(()=>J(Tee()))).getMachineId;break;case"freebsd":zs=(await Promise.resolve().then(()=>J(vee()))).getMachineId;break;case"win32":zs=(await Promise.resolve().then(()=>J(Oee()))).getMachineId;break;default:zs=(await Promise.resolve().then(()=>J(bee()))).getMachineId;break}return zs()}_v.getMachineId=m2e});var Uw=p(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.normalizeType=uu.normalizeArch=void 0;var _2e=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};uu.normalizeArch=_2e;var g2e=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};uu.normalizeType=g2e});var Cee=p(gv=>{"use strict";Object.defineProperty(gv,"__esModule",{value:!0});gv.hostDetector=void 0;var kw=Wd(),Pee=require("os"),E2e=Ree(),S2e=Uw(),Bw=class{detect(e){return{attributes:{[kw.ATTR_HOST_NAME]:(0,Pee.hostname)(),[kw.ATTR_HOST_ARCH]:(0,S2e.normalizeArch)((0,Pee.arch)()),[kw.ATTR_HOST_ID]:(0,E2e.getMachineId)()}}}};gv.hostDetector=new Bw});var Iee=p(Ev=>{"use strict";Object.defineProperty(Ev,"__esModule",{value:!0});Ev.osDetector=void 0;var Nee=Wd(),Mee=require("os"),T2e=Uw(),Fw=class{detect(e){return{attributes:{[Nee.ATTR_OS_TYPE]:(0,T2e.normalizeType)((0,Mee.platform)()),[Nee.ATTR_OS_VERSION]:(0,Mee.release)()}}}};Ev.osDetector=new Fw});var xee=p(Sv=>{"use strict";Object.defineProperty(Sv,"__esModule",{value:!0});Sv.processDetector=void 0;var y2e=(b(),y(P)),Di=Wd(),v2e=require("os"),Vw=class{detect(e){let r={[Di.ATTR_PROCESS_PID]:process.pid,[Di.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[Di.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[Di.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Di.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[Di.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[Di.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(r[Di.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let o=v2e.userInfo();r[Di.ATTR_PROCESS_OWNER]=o.username}catch(o){y2e.diag.debug(`error obtaining process owner: ${o}`)}return{attributes:r}}};Sv.processDetector=new Vw});var wee=p(Tv=>{"use strict";Object.defineProperty(Tv,"__esModule",{value:!0});Tv.serviceInstanceIdDetector=void 0;var A2e=Wd(),O2e=require("crypto"),Gw=class{detect(e){return{attributes:{[A2e.ATTR_SERVICE_INSTANCE_ID]:(0,O2e.randomUUID)()}}}};Tv.serviceInstanceIdDetector=new Gw});var Lee=p(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.serviceInstanceIdDetector=ai.processDetector=ai.osDetector=ai.hostDetector=void 0;var b2e=Cee();Object.defineProperty(ai,"hostDetector",{enumerable:!0,get:function(){return b2e.hostDetector}});var R2e=Iee();Object.defineProperty(ai,"osDetector",{enumerable:!0,get:function(){return R2e.osDetector}});var P2e=xee();Object.defineProperty(ai,"processDetector",{enumerable:!0,get:function(){return P2e.processDetector}});var C2e=wee();Object.defineProperty(ai,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return C2e.serviceInstanceIdDetector}})});var Dee=p(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.serviceInstanceIdDetector=ci.processDetector=ci.osDetector=ci.hostDetector=void 0;var yv=Lee();Object.defineProperty(ci,"hostDetector",{enumerable:!0,get:function(){return yv.hostDetector}});Object.defineProperty(ci,"osDetector",{enumerable:!0,get:function(){return yv.osDetector}});Object.defineProperty(ci,"processDetector",{enumerable:!0,get:function(){return yv.processDetector}});Object.defineProperty(ci,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return yv.serviceInstanceIdDetector}})});var Uee=p(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.noopDetector=lu.NoopDetector=void 0;var vv=class{detect(){return{attributes:{}}}};lu.NoopDetector=vv;lu.noopDetector=new vv});var kee=p(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.noopDetector=rr.serviceInstanceIdDetector=rr.processDetector=rr.osDetector=rr.hostDetector=rr.envDetector=void 0;var N2e=Eee();Object.defineProperty(rr,"envDetector",{enumerable:!0,get:function(){return N2e.envDetector}});var Av=Dee();Object.defineProperty(rr,"hostDetector",{enumerable:!0,get:function(){return Av.hostDetector}});Object.defineProperty(rr,"osDetector",{enumerable:!0,get:function(){return Av.osDetector}});Object.defineProperty(rr,"processDetector",{enumerable:!0,get:function(){return Av.processDetector}});Object.defineProperty(rr,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Av.serviceInstanceIdDetector}});var M2e=Uee();Object.defineProperty(rr,"noopDetector",{enumerable:!0,get:function(){return M2e.noopDetector}})});var Bee=p(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.defaultServiceName=we.emptyResource=we.defaultResource=we.resourceFromAttributes=we.serviceInstanceIdDetector=we.processDetector=we.osDetector=we.hostDetector=we.envDetector=we.detectResources=void 0;var I2e=_ee();Object.defineProperty(we,"detectResources",{enumerable:!0,get:function(){return I2e.detectResources}});var Kd=kee();Object.defineProperty(we,"envDetector",{enumerable:!0,get:function(){return Kd.envDetector}});Object.defineProperty(we,"hostDetector",{enumerable:!0,get:function(){return Kd.hostDetector}});Object.defineProperty(we,"osDetector",{enumerable:!0,get:function(){return Kd.osDetector}});Object.defineProperty(we,"processDetector",{enumerable:!0,get:function(){return Kd.processDetector}});Object.defineProperty(we,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return Kd.serviceInstanceIdDetector}});var qw=ww();Object.defineProperty(we,"resourceFromAttributes",{enumerable:!0,get:function(){return qw.resourceFromAttributes}});Object.defineProperty(we,"defaultResource",{enumerable:!0,get:function(){return qw.defaultResource}});Object.defineProperty(we,"emptyResource",{enumerable:!0,get:function(){return qw.emptyResource}});var x2e=Mw();Object.defineProperty(we,"defaultServiceName",{enumerable:!0,get:function(){return x2e.defaultServiceName}})});var qee=J(require("node:path"),1);function De(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var zw=require("node:url"),$s=(t,e)=>{let r=Cv(nte(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},nte=t=>Pv(t)?t.toString():t,Pv=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,Cv=t=>t instanceof URL?(0,zw.fileURLToPath)(t):t;var ep=(t,e=[],r={})=>{let o=$s(t,"First argument"),[s,a]=De(e)?[[],e]:[e,r];if(!Array.isArray(s))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${s}`);if(s.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${s}`);let i=s.map(String),n=i.find(c=>c.includes("\0"));if(n!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${n}`);if(!De(a))throw new TypeError(`Last argument must be an options object: ${a}`);return[o,i,a]};var eL=require("node:child_process");var $w=require("node:string_decoder"),{toString:Yw}=Object.prototype,Ww=t=>Yw.call(t)==="[object ArrayBuffer]",Ye=t=>Yw.call(t)==="[object Uint8Array]",li=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),ite=new TextEncoder,Kw=t=>ite.encode(t),ote=new TextDecoder,tp=t=>ote.decode(t),Xw=(t,e)=>ste(t,e).join(""),ste=(t,e)=>{if(e==="utf8"&&t.every(a=>typeof a=="string"))return t;let r=new $w.StringDecoder(e),o=t.map(a=>typeof a=="string"?Kw(a):a).map(a=>r.write(a)),s=r.end();return s===""?o:[...o,s]},du=t=>t.length===1&&Ye(t[0])?t[0]:Nv(ate(t)),ate=t=>t.map(e=>typeof e=="string"?Kw(e):e),Nv=t=>{let e=new Uint8Array(cte(t)),r=0;for(let o of t)e.set(o,r),r+=o.length;return e},cte=t=>{let e=0;for(let r of t)e+=r.length;return e};var tL=t=>Array.isArray(t)&&Array.isArray(t.raw),rL=(t,e)=>{let r=[];for(let[a,i]of t.entries())r=ute({templates:t,expressions:e,tokens:r,index:a,template:i});if(r.length===0)throw new TypeError("Template script must not be empty");let[o,...s]=r;return[o,s,{}]},ute=({templates:t,expressions:e,tokens:r,index:o,template:s})=>{if(s===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[o]}`);let{nextTokens:a,leadingWhitespaces:i,trailingWhitespaces:n}=lte(s,t.raw[o]),c=Qw(r,a,i);if(o===e.length)return c;let u=e[o],l=Array.isArray(u)?u.map(d=>Zw(d)):[Zw(u)];return Qw(c,l,n)},lte=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],o=0,s=Jw.has(e[0]);for(let i=0,n=0;i<t.length;i+=1,n+=1){let c=e[n];if(Jw.has(c))o!==i&&r.push(t.slice(o,i)),o=i+1;else if(c==="\\"){let u=e[n+1];u===`
|
|
50
|
+
`?(i-=1,n+=1):u==="u"&&e[n+2]==="{"?n=e.indexOf("}",n+3):n+=dte[u]??1}}let a=o===t.length;return a||r.push(t.slice(o)),{nextTokens:r,leadingWhitespaces:s,trailingWhitespaces:a}},Jw=new Set([" "," ","\r",`
|
|
51
|
+
`]),dte={x:3,u:5},Qw=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Zw=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(De(t)&&("stdout"in t||"isMaxBuffer"in t))return pte(t);throw t instanceof eL.ChildProcess||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},pte=({stdout:t})=>{if(typeof t=="string")return t;if(Ye(t))return tp(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};var fk=require("node:child_process");var iL=require("node:util");var rp=J(require("node:process"),1),Ur=t=>np.includes(t),np=[rp.default.stdin,rp.default.stdout,rp.default.stderr],hr=["stdin","stdout","stderr"],ip=t=>hr[t]??`stdio[${t}]`;var oL=t=>{let e={...t};for(let r of xv)e[r]=Mv(t,r);return e},Mv=(t,e)=>{let r=Array.from({length:fte(t)+1}),o=hte(t[e],r,e);return Ste(o,e)},fte=({stdio:t})=>Array.isArray(t)?Math.max(t.length,hr.length):hr.length,hte=(t,e,r)=>De(t)?mte(t,e,r):e.fill(t),mte=(t,e,r)=>{for(let o of Object.keys(t).sort(_te))for(let s of gte(o,r,e))e[s]=t[o];return e},_te=(t,e)=>nL(t)<nL(e)?1:-1,nL=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,gte=(t,e,r)=>{if(t==="ipc")return[r.length-1];let o=Iv(t);if(o===void 0||o===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
52
|
+
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(o>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
53
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return o==="all"?[1,2]:[o]},Iv=t=>{if(t==="all")return t;if(hr.includes(t))return hr.indexOf(t);let e=Ete.exec(t);if(e!==null)return Number(e[1])},Ete=/^fd(\d+)$/,Ste=(t,e)=>t.map(r=>r===void 0?yte[e]:r),Tte=(0,iL.debuglog)("execa").enabled?"full":"none",yte={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Tte,stripFinalNewline:!0},xv=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],di=(t,e)=>e==="ipc"?t.at(-1):t[e];var Ys=({verbose:t},e)=>wv(t,e)!=="none",Ws=({verbose:t},e)=>!["none","short"].includes(wv(t,e)),sL=({verbose:t},e)=>{let r=wv(t,e);return op(r)?r:void 0},wv=(t,e)=>e===void 0?vte(t):di(t,e),vte=t=>t.find(e=>op(e))??sp.findLast(e=>t.includes(e)),op=t=>typeof t=="function",sp=["none","short","full"];var yL=require("node:util");var aL=require("node:process"),cL=require("node:util"),uL=(t,e)=>{let r=[t,...e],o=r.join(" "),s=r.map(a=>Cte(lL(a))).join(" ");return{command:o,escapedCommand:s}},pu=t=>(0,cL.stripVTControlCharacters)(t).split(`
|
|
54
|
+
`).map(e=>lL(e)).join(`
|
|
55
|
+
`),lL=t=>t.replaceAll(bte,e=>Ate(e)),Ate=t=>{let e=Rte[t];if(e!==void 0)return e;let r=t.codePointAt(0),o=r.toString(16);return r<=Pte?`\\u${o.padStart(4,"0")}`:`\\U${o}`},Ote=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},bte=Ote(),Rte={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Pte=65535,Cte=t=>Nte.test(t)?t:aL.platform==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Nte=/^[\w./-]+$/;var Lv=J(require("node:process"),1);function Dv(){let{env:t}=Lv.default,{TERM:e,TERM_PROGRAM:r}=t;return Lv.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var dL={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},pL={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Mte={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Ite={...dL,...pL},xte={...dL,...Mte},wte=Dv(),Lte=wte?Ite:xte,ap=Lte,ije=Object.entries(pL);var fL=J(require("node:tty"),1),Dte=fL.default?.WriteStream?.prototype?.hasColors?.()??!1,ne=(t,e)=>{if(!Dte)return s=>s;let r=`\x1B[${t}m`,o=`\x1B[${e}m`;return s=>{let a=s+"",i=a.indexOf(o);if(i===-1)return r+a+o;let n=r,c=0,l=(e===22?o:"")+r;for(;i!==-1;)n+=a.slice(c,i)+l,c=i+o.length,i=a.indexOf(o,c);return n+=a.slice(c)+o,n}},sje=ne(0,0),hL=ne(1,22),aje=ne(2,22),cje=ne(3,23),uje=ne(4,24),lje=ne(53,55),dje=ne(7,27),pje=ne(8,28),fje=ne(9,29),hje=ne(30,39),mje=ne(31,39),_je=ne(32,39),gje=ne(33,39),Eje=ne(34,39),Sje=ne(35,39),Tje=ne(36,39),yje=ne(37,39),cp=ne(90,39),vje=ne(40,49),Aje=ne(41,49),Oje=ne(42,49),bje=ne(43,49),Rje=ne(44,49),Pje=ne(45,49),Cje=ne(46,49),Nje=ne(47,49),Mje=ne(100,49),mL=ne(91,39),Ije=ne(92,39),_L=ne(93,39),xje=ne(94,39),wje=ne(95,39),Lje=ne(96,39),Dje=ne(97,39),Uje=ne(101,49),kje=ne(102,49),Bje=ne(103,49),Fje=ne(104,49),Vje=ne(105,49),Gje=ne(106,49),qje=ne(107,49);var SL=({type:t,message:e,timestamp:r,piped:o,commandId:s,result:{failed:a=!1}={},options:{reject:i=!0}})=>{let n=Ute(r),c=kte[t]({failed:a,reject:i,piped:o}),u=Bte[t]({reject:i});return`${cp(`[${n}]`)} ${cp(`[${s}]`)} ${u(c)} ${u(e)}`},Ute=t=>`${up(t.getHours(),2)}:${up(t.getMinutes(),2)}:${up(t.getSeconds(),2)}.${up(t.getMilliseconds(),3)}`,up=(t,e)=>String(t).padStart(e,"0"),gL=({failed:t,reject:e})=>t?e?ap.cross:ap.warning:ap.tick,kte={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:gL,duration:gL},EL=t=>t,Bte={command:()=>hL,output:()=>EL,ipc:()=>EL,error:({reject:t})=>t?mL:_L,duration:()=>cp};var TL=(t,e,r)=>{let o=sL(e,r);return t.map(({verboseLine:s,verboseObject:a})=>Fte(s,a,o)).filter(s=>s!==void 0).map(s=>Vte(s)).join("")},Fte=(t,e,r)=>{if(r===void 0)return t;let o=r(t,e);if(typeof o=="string")return o},Vte=t=>t.endsWith(`
|
|
56
|
+
`)?t:`${t}
|
|
57
|
+
`;var an=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:o,result:s})=>{let a=Gte({type:t,result:s,verboseInfo:o}),i=qte(e,a),n=TL(i,o,r);n!==""&&console.warn(n.slice(0,-1))},Gte=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:o,rawOptions:{piped:s=!1,...a}}})=>({type:t,escapedCommand:r,commandId:`${o}`,timestamp:new Date,piped:s,result:e,options:a}),qte=(t,e)=>t.split(`
|
|
58
|
+
`).map(r=>jte({...e,message:r})),jte=t=>({verboseLine:SL(t),verboseObject:t}),lp=t=>{let e=typeof t=="string"?t:(0,yL.inspect)(t);return pu(e).replaceAll(" "," ".repeat(Hte))},Hte=2;var vL=(t,e)=>{Ys(e)&&an({type:"command",verboseMessage:t,verboseInfo:e})};var AL=(t,e,r)=>{Yte(t);let o=zte(t);return{verbose:t,escapedCommand:e,commandId:o,rawOptions:r}},zte=t=>Ys({verbose:t})?$te++:void 0,$te=0n,Yte=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!sp.includes(e)&&!op(e)){let r=sp.map(o=>`'${o}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};var Uv=require("node:process"),dp=()=>Uv.hrtime.bigint(),kv=t=>Number(Uv.hrtime.bigint()-t)/1e6;var pp=(t,e,r)=>{let o=dp(),{command:s,escapedCommand:a}=uL(t,e),i=Mv(r,"verbose"),n=AL(i,a,{...r});return vL(a,n),{command:s,escapedCommand:a,startTime:o,verboseInfo:n}};var k1=J(require("node:path"),1),aA=J(require("node:process"),1),B1=J(dD(),1);var fu=J(require("node:process"),1),Ui=J(require("node:path"),1);function hp(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"}var pD=require("node:util"),Wv=require("node:child_process"),Yv=J(require("node:path"),1),fD=require("node:url"),RHe=(0,pD.promisify)(Wv.execFile);function mp(t){return t instanceof URL?(0,fD.fileURLToPath)(t):t}function hD(t){return{*[Symbol.iterator](){let e=Yv.default.resolve(mp(t)),r;for(;r!==e;)yield e,r=e,e=Yv.default.resolve(e,"..")}}}var PHe=10*1024*1024;var Tre=({cwd:t=fu.default.cwd(),path:e=fu.default.env[hp()],preferLocal:r=!0,execPath:o=fu.default.execPath,addExecPath:s=!0}={})=>{let a=Ui.default.resolve(mp(t)),i=[],n=e.split(Ui.default.delimiter);return r&&yre(i,n,a),s&&vre(i,n,o,a),e===""||e===Ui.default.delimiter?`${i.join(Ui.default.delimiter)}${e}`:[...i,e].join(Ui.default.delimiter)},yre=(t,e,r)=>{for(let o of hD(r)){let s=Ui.default.join(o,"node_modules/.bin");e.includes(s)||t.push(s)}},vre=(t,e,r,o)=>{let s=Ui.default.resolve(o,mp(r),"..");e.includes(s)||t.push(s)},mD=({env:t=fu.default.env,...e}={})=>{t={...t};let r=hp({env:t});return e.path=t[r],t[r]=Tre(e),t};var ID=require("node:timers/promises");var _D=(t,e,r)=>{let o=r?mu:hu,s=t instanceof kr?{}:{cause:t};return new o(e,s)},kr=class extends Error{},gD=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,SD,{value:!0,writable:!1,enumerable:!1,configurable:!1})},ED=t=>_p(t)&&SD in t,SD=Symbol("isExecaError"),_p=t=>Object.prototype.toString.call(t)==="[object Error]",hu=class extends Error{};gD(hu,hu.name);var mu=class extends Error{};gD(mu,mu.name);var Js=require("node:os");var bD=require("node:os");var TD=()=>{let t=vD-yD+1;return Array.from({length:t},Are)},Are=(t,e)=>({name:`SIGRT${e+1}`,number:yD+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),yD=34,vD=64;var OD=require("node:os");var AD=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Kv=()=>{let t=TD();return[...AD,...t].map(Ore)},Ore=({name:t,number:e,description:r,action:o,forced:s=!1,standard:a})=>{let{signals:{[t]:i}}=OD.constants,n=i!==void 0;return{name:t,number:n?i:e,description:r,supported:n,action:o,forced:s,standard:a}};var bre=()=>{let t=Kv();return Object.fromEntries(t.map(Rre))},Rre=({name:t,number:e,description:r,supported:o,action:s,forced:a,standard:i})=>[t,{name:t,number:e,description:r,supported:o,action:s,forced:a,standard:i}],RD=bre(),Pre=()=>{let t=Kv(),e=65,r=Array.from({length:e},(o,s)=>Cre(s,t));return Object.assign({},...r)},Cre=(t,e)=>{let r=Nre(t,e);if(r===void 0)return{};let{name:o,description:s,supported:a,action:i,forced:n,standard:c}=r;return{[t]:{name:o,number:t,description:s,supported:a,action:i,forced:n,standard:c}}},Nre=(t,e)=>{let r=e.find(({name:o})=>bD.constants.signals[o]===t);return r!==void 0?r:e.find(o=>o.number===t)},VHe=Pre();var CD=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return MD(t,e)},ND=t=>t===0?t:MD(t,"`subprocess.kill()`'s argument"),MD=(t,e)=>{if(Number.isInteger(t))return Mre(t,e);if(typeof t=="string")return xre(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
59
|
+
${Xv()}`)},Mre=(t,e)=>{if(PD.has(t))return PD.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
60
|
+
${Xv()}`)},Ire=()=>new Map(Object.entries(Js.constants.signals).reverse().map(([t,e])=>[e,t])),PD=Ire(),xre=(t,e)=>{if(t in Js.constants.signals)return t;throw t.toUpperCase()in Js.constants.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
61
|
+
${Xv()}`)},Xv=()=>`Available signal names: ${wre()}.
|
|
62
|
+
Available signal numbers: ${Lre()}.`,wre=()=>Object.keys(Js.constants.signals).sort().map(t=>`'${t}'`).join(", "),Lre=()=>[...new Set(Object.values(Js.constants.signals).sort((t,e)=>t-e))].join(", "),gp=t=>RD[t].description;var xD=t=>{if(t===!1)return t;if(t===!0)return Dre;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Dre=1e3*5,wD=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:o,context:s,controller:a},i,n)=>{let{signal:c,error:u}=Ure(i,n,r);kre(u,o);let l=t(c);return Bre({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:l,context:s,controller:a}),l},Ure=(t,e,r)=>{let[o=r,s]=_p(t)?[void 0,t]:[t,e];if(typeof o!="string"&&!Number.isInteger(o))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(o)}`);if(s!==void 0&&!_p(s))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${s}`);return{signal:ND(o),error:s}},kre=(t,e)=>{t!==void 0&&e.reject(t)},Bre=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:o,killResult:s,context:a,controller:i})=>{e===o&&s&&Jv({kill:t,forceKillAfterDelay:r,context:a,controllerSignal:i.signal})},Jv=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:o})=>{if(e!==!1)try{await(0,ID.setTimeout)(e,void 0,{signal:o}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};var LD=require("node:events"),Ep=async(t,e)=>{t.aborted||await(0,LD.once)(t,"abort",{signal:e})};var DD=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},UD=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:o,controller:s})=>e===void 0||r?[]:[Fre(t,e,o,s)],Fre=async(t,e,r,{signal:o})=>{throw await Ep(e,o),r.terminationReason??="cancel",t.kill(),e.reason};var m1=require("node:timers/promises");var f1=require("node:util");var Qs=({methodName:t,isSubprocess:e,ipc:r,isConnected:o})=>{Vre(t,e,r),Qv(t,e,o)},Vre=(t,e,r)=>{if(!r)throw new Error(`${Br(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},Qv=(t,e,r)=>{if(!r)throw new Error(`${Br(t,e)} cannot be used: the ${ki(e)} has already exited or disconnected.`)},kD=t=>{throw new Error(`${Br("getOneMessage",t)} could not complete: the ${ki(t)} exited or disconnected.`)},BD=t=>{throw new Error(`${Br("sendMessage",t)} failed: the ${ki(t)} is sending a message too, instead of listening to incoming messages.
|
|
63
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
64
|
+
|
|
65
|
+
const [receivedMessage] = await Promise.all([
|
|
66
|
+
${Br("getOneMessage",t)},
|
|
67
|
+
${Br("sendMessage",t,"message, {strict: true}")},
|
|
68
|
+
]);`)},Sp=(t,e)=>new Error(`${Br("sendMessage",e)} failed when sending an acknowledgment response to the ${ki(e)}.`,{cause:t}),FD=t=>{throw new Error(`${Br("sendMessage",t)} failed: the ${ki(t)} is not listening to incoming messages.`)},VD=t=>{throw new Error(`${Br("sendMessage",t)} failed: the ${ki(t)} exited without listening to incoming messages.`)},GD=()=>new Error(`\`cancelSignal\` aborted: the ${ki(!0)} disconnected.`),qD=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},jD=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${Br(e,r)} cannot be used: the ${ki(r)} is disconnecting.`,{cause:t})},HD=({error:t,methodName:e,isSubprocess:r,message:o})=>{if(Gre(t))throw new Error(`${Br(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(o)}.`,{cause:t})},Gre=({code:t,message:e})=>qre.has(t)||jre.some(r=>e.includes(r)),qre=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),jre=["could not be cloned","circular structure","call stack size exceeded"],Br=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Hre(e)}${t}(${r})`,Hre=t=>t?"":"subprocess.",ki=t=>t?"parent process":"subprocess",Zs=t=>{t.connected&&t.disconnect()};var cn=()=>{let t={},e=new Promise((r,o)=>{Object.assign(t,{resolve:r,reject:o})});return Object.assign(e,t)};var yp=(t,e="stdin")=>{let{options:o,fileDescriptors:s}=un.get(t),a=zD(s,e,!0),i=t.stdio[a];if(i===null)throw new TypeError($D(a,e,o,!0));return i},ea=(t,e="stdout")=>{let{options:o,fileDescriptors:s}=un.get(t),a=zD(s,e,!1),i=a==="all"?t.all:t.stdio[a];if(i==null)throw new TypeError($D(a,e,o,!1));return i},un=new WeakMap,zD=(t,e,r)=>{let o=zre(e,r);return $re(o,e,r,t),o},zre=(t,e)=>{let r=Iv(t);if(r!==void 0)return r;let{validOptions:o,defaultValue:s}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${_u(e)}" must not be "${t}".
|
|
69
|
+
It must be ${o} or "fd3", "fd4" (and so on).
|
|
70
|
+
It is optional and defaults to "${s}".`)},$re=(t,e,r,o)=>{let s=o[YD(t)];if(s===void 0)throw new TypeError(`"${_u(r)}" must not be ${e}. That file descriptor does not exist.
|
|
71
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(s.direction==="input"&&!r)throw new TypeError(`"${_u(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(s.direction!=="input"&&r)throw new TypeError(`"${_u(r)}" must not be ${e}. It must be a writable stream, not readable.`)},$D=(t,e,r,o)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:s,optionValue:a}=Yre(t,r);return`The "${s}: ${Tp(a)}" option is incompatible with using "${_u(o)}: ${Tp(e)}".
|
|
72
|
+
Please set this option with "pipe" instead.`},Yre=(t,{stdin:e,stdout:r,stderr:o,stdio:s})=>{let a=YD(t);return a===0&&e!==void 0?{optionName:"stdin",optionValue:e}:a===1&&r!==void 0?{optionName:"stdout",optionValue:r}:a===2&&o!==void 0?{optionName:"stderr",optionValue:o}:{optionName:`stdio[${a}]`,optionValue:s[a]}},YD=t=>t==="all"?1:t,_u=t=>t?"to":"from",Tp=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";var s1=require("node:events");var WD=require("node:events"),Mo=(t,e,r)=>{let o=t.getMaxListeners();o===0||o===Number.POSITIVE_INFINITY||(t.setMaxListeners(o+e),(0,WD.addAbortListener)(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))};var o1=require("node:events");var JD=require("node:events"),QD=require("node:timers/promises");var vp=(t,e)=>{e&&Zv(t)},Zv=t=>{t.refCounted()},Ap=(t,e)=>{e&&eA(t)},eA=t=>{t.unrefCounted()},KD=(t,e)=>{e&&(eA(t),eA(t))},XD=(t,e)=>{e&&(Zv(t),Zv(t))};var ZD=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:o},s)=>{if(r1(s)||i1(s))return;Op.has(t)||Op.set(t,[]);let a=Op.get(t);if(a.push(s),!(a.length>1))for(;a.length>0;){await n1(t,o,s),await QD.scheduler.yield();let i=await t1({wrappedMessage:a[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:o});a.shift(),o.emit("message",i),o.emit("message:done")}},e1=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:o,boundOnMessage:s})=>{tA();let a=Op.get(t);for(;a?.length>0;)await(0,JD.once)(o,"message:done");t.removeListener("message",s),XD(e,r),o.connected=!1,o.emit("disconnect")},Op=new WeakMap;var Bi=(t,e,r)=>{if(bp.has(t))return bp.get(t);let o=new o1.EventEmitter;return o.connected=!0,bp.set(t,o),Wre({ipcEmitter:o,anyProcess:t,channel:e,isSubprocess:r}),o},bp=new WeakMap,Wre=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:o})=>{let s=ZD.bind(void 0,{anyProcess:e,channel:r,isSubprocess:o,ipcEmitter:t});e.on("message",s),e.once("disconnect",e1.bind(void 0,{anyProcess:e,channel:r,isSubprocess:o,ipcEmitter:t,boundOnMessage:s})),KD(r,o)},Rp=t=>{let e=bp.get(t);return e===void 0?t.channel!==null:e.connected};var a1=({anyProcess:t,channel:e,isSubprocess:r,message:o,strict:s})=>{if(!s)return o;let a=Bi(t,e,r),i=Np(t,a);return{id:Kre++,type:Cp,message:o,hasListeners:i}},Kre=0n,c1=(t,e)=>{if(!(e?.type!==Cp||e.hasListeners))for(let{id:r}of t)r!==void 0&&Pp[r].resolve({isDeadlock:!0,hasListeners:!1})},t1=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:o,ipcEmitter:s})=>{if(t?.type!==Cp||!e.connected)return t;let{id:a,message:i}=t,n={id:a,type:l1,message:Np(e,s)};try{await Mp({anyProcess:e,channel:r,isSubprocess:o,ipc:!0},n)}catch(c){s.emit("strict:error",c)}return i},r1=t=>{if(t?.type!==l1)return!1;let{id:e,message:r}=t;return Pp[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},u1=async(t,e,r)=>{if(t?.type!==Cp)return;let o=cn();Pp[t.id]=o;let s=new AbortController;try{let{isDeadlock:a,hasListeners:i}=await Promise.race([o,Xre(e,r,s)]);a&&BD(r),i||FD(r)}finally{s.abort(),delete Pp[t.id]}},Pp={},Xre=async(t,e,{signal:r})=>{Mo(t,1,r),await(0,s1.once)(t,"disconnect",{signal:r}),VD(e)},Cp="execa:ipc:request",l1="execa:ipc:response";var d1=(t,e,r)=>{gu.has(t)||gu.set(t,new Set);let o=gu.get(t),s=cn(),a=r?e.id:void 0,i={onMessageSent:s,id:a};return o.add(i),{outgoingMessages:o,outgoingMessage:i}},p1=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},n1=async(t,e,r)=>{for(;!Np(t,e)&&gu.get(t)?.size>0;){let o=[...gu.get(t)];c1(o,r),await Promise.all(o.map(({onMessageSent:s})=>s))}},gu=new WeakMap,Np=(t,e)=>e.listenerCount("message")>Jre(t),Jre=t=>un.has(t)&&!di(un.get(t).options.buffer,"ipc")?1:0;var Mp=({anyProcess:t,channel:e,isSubprocess:r,ipc:o},s,{strict:a=!1}={})=>{let i="sendMessage";return Qs({methodName:i,isSubprocess:r,ipc:o,isConnected:t.connected}),Qre({anyProcess:t,channel:e,methodName:i,isSubprocess:r,message:s,strict:a})},Qre=async({anyProcess:t,channel:e,methodName:r,isSubprocess:o,message:s,strict:a})=>{let i=a1({anyProcess:t,channel:e,isSubprocess:o,message:s,strict:a}),n=d1(t,i,a);try{await nA({anyProcess:t,methodName:r,isSubprocess:o,wrappedMessage:i,message:s})}catch(c){throw Zs(t),c}finally{p1(n)}},nA=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:o,message:s})=>{let a=Zre(t);try{await Promise.all([u1(o,t,r),a(o)])}catch(i){throw jD({error:i,methodName:e,isSubprocess:r}),HD({error:i,methodName:e,isSubprocess:r,message:s}),i}},Zre=t=>{if(rA.has(t))return rA.get(t);let e=(0,f1.promisify)(t.send.bind(t));return rA.set(t,e),e},rA=new WeakMap;var _1=(t,e)=>{let r="cancelSignal";return Qv(r,!1,t.connected),nA({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:E1,message:e},message:e})},g1=async({anyProcess:t,channel:e,isSubprocess:r,ipc:o})=>(await ene({anyProcess:t,channel:e,isSubprocess:r,ipc:o}),iA.signal),ene=async({anyProcess:t,channel:e,isSubprocess:r,ipc:o})=>{if(!h1){if(h1=!0,!o){qD();return}if(e===null){tA();return}Bi(t,e,r),await m1.scheduler.yield()}},h1=!1,i1=t=>t?.type!==E1?!1:(iA.abort(t.message),!0),E1="execa:ipc:cancel",tA=()=>{iA.abort(GD())},iA=new AbortController;var S1=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:o})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(o==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},T1=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:o,context:s,controller:a})=>r?[tne({subprocess:t,cancelSignal:e,forceKillAfterDelay:o,context:s,controller:a})]:[],tne=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:o,controller:{signal:s}})=>{await Ep(e,s);let a=rne(e);throw await _1(t,a),Jv({kill:t.kill,forceKillAfterDelay:r,context:o,controllerSignal:s}),o.terminationReason??="gracefulCancel",e.reason},rne=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e};var y1=require("node:timers/promises");var v1=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},A1=(t,e,r,o)=>e===0||e===void 0?[]:[nne(t,e,r,o)],nne=async(t,e,r,{signal:o})=>{throw await(0,y1.setTimeout)(e,void 0,{signal:o}),r.terminationReason??="timeout",t.kill(),new kr};var Ip=require("node:process"),oA=J(require("node:path"),1);var O1=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},b1=(t,e,{node:r=!1,nodePath:o=Ip.execPath,nodeOptions:s=Ip.execArgv.filter(c=>!c.startsWith("--inspect")),cwd:a,execPath:i,...n})=>{if(i!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=$s(o,'The "nodePath" option'),u=oA.default.resolve(a,c),l={...n,nodePath:u,node:r,cwd:a};if(!r)return[t,e,l];if(oA.default.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...s,t,...e],{ipc:!0,...l,shell:!1}]};var R1=require("node:v8"),P1=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");sne[r](t)}},ine=t=>{try{(0,R1.serialize)(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},one=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},sne={advanced:ine,json:one},C1=async(t,e)=>{e!==void 0&&await t.sendMessage(e)};var M1=({encoding:t})=>{if(sA.has(t))return;let e=cne(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${xp(t)}\`.
|
|
73
|
+
Please rename it to ${xp(e)}.`);let r=[...sA].map(o=>xp(o)).join(", ");throw new TypeError(`Invalid option \`encoding: ${xp(t)}\`.
|
|
74
|
+
Please rename it to one of: ${r}.`)},ane=new Set(["utf8","utf16le"]),nr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),sA=new Set([...ane,...nr]),cne=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in N1)return N1[e];if(sA.has(e))return e},N1={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},xp=t=>typeof t=="string"?`"${t}"`:String(t);var I1=require("node:fs"),x1=J(require("node:path"),1),w1=J(require("node:process"),1);var L1=(t=D1())=>{let e=$s(t,'The "cwd" option');return x1.default.resolve(e)},D1=()=>{try{return w1.default.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
75
|
+
${t.message}`,t}},U1=(t,e)=>{if(e===D1())return t;let r;try{r=(0,I1.statSync)(e)}catch(o){return`The "cwd" option is invalid: ${e}.
|
|
76
|
+
${o.message}
|
|
77
|
+
${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
78
|
+
${t}`};var wp=(t,e,r)=>{r.cwd=L1(r.cwd);let[o,s,a]=b1(t,e,r),{command:i,args:n,options:c}=B1.default._parse(o,s,a),u=oL(c),l=une(u);return v1(l),M1(l),P1(l),DD(l),S1(l),l.shell=Cv(l.shell),l.env=lne(l),l.killSignal=CD(l.killSignal),l.forceKillAfterDelay=xD(l.forceKillAfterDelay),l.lines=l.lines.map((d,h)=>d&&!nr.has(l.encoding)&&l.buffer[h]),aA.default.platform==="win32"&&k1.default.basename(i,".exe")==="cmd"&&n.unshift("/q"),{file:i,commandArguments:n,options:l}},une=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:o=r,encoding:s="utf8",reject:a=!0,cleanup:i=!0,all:n=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:h,ipc:g=h!==void 0||d,serialization:E="advanced",...S})=>({...S,extendEnv:t,preferLocal:e,cwd:r,localDirectory:o,encoding:s,reject:a,cleanup:i,all:n,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:h,ipc:g,serialization:E}),lne=({env:t,extendEnv:e,preferLocal:r,node:o,localDirectory:s,nodePath:a})=>{let i=e?{...aA.default.env,...t}:t;return r||o?mD({env:i,cwd:s,execPath:a,preferLocal:r,addExecPath:o}):i};var Lp=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];var aU=require("node:util");function ta(t){if(typeof t=="string")return dne(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return pne(t)}var dne=t=>t.at(-1)===F1?t.slice(0,t.at(-2)===V1?-2:-1):t,pne=t=>t.at(-1)===fne?t.subarray(0,t.at(-2)===hne?-2:-1):t,F1=`
|
|
79
|
+
`,fne=F1.codePointAt(0),V1="\r",hne=V1.codePointAt(0);var Z1=require("node:events"),eU=require("node:stream/promises");function mne(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function G1(t,{checkOpen:e=!0}={}){return mne(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}var _ne=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),cA=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},uA=Symbol();function q1(){return this[uA].next()}Object.defineProperty(q1,"name",{value:"next"});function j1(t){return this[uA].return(t)}Object.defineProperty(j1,"name",{value:"return"});var gne=Object.create(_ne,{next:{enumerable:!0,configurable:!0,writable:!0,value:q1},return:{enumerable:!0,configurable:!0,writable:!0,value:j1}});function lA({preventCancel:t=!1}={}){let e=this.getReader(),r=new cA(e,t),o=Object.create(gne);return o[uA]=r,o}var H1=t=>{if(G1(t,{checkOpen:!1})&&Eu.on!==void 0)return Sne(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Ene.call(t)==="[object ReadableStream]")return lA.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Ene}=Object.prototype,Sne=async function*(t){let e=new AbortController,r={};Tne(t,e,r);try{for await(let[o]of Eu.on(t,"data",{signal:e.signal}))yield o}catch(o){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw o}finally{t.destroy()}},Tne=async(t,e,r)=>{try{await Eu.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(o){r.error=o}finally{e.abort()}},Eu={};var ra=async(t,{init:e,convertChunk:r,getSize:o,truncateChunk:s,addChunk:a,getFinalChunk:i,finalize:n},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=H1(t),l=e();l.length=0;try{for await(let d of u){let h=vne(d),g=r[h](d,l);Y1({convertedChunk:g,state:l,getSize:o,truncateChunk:s,addChunk:a,maxBuffer:c})}return yne({state:l,convertChunk:r,getSize:o,truncateChunk:s,addChunk:a,getFinalChunk:i,maxBuffer:c}),n(l)}catch(d){let h=typeof d=="object"&&d!==null?d:new Error(d);throw h.bufferedData=n(l),h}},yne=({state:t,getSize:e,truncateChunk:r,addChunk:o,getFinalChunk:s,maxBuffer:a})=>{let i=s(t);i!==void 0&&Y1({convertedChunk:i,state:t,getSize:e,truncateChunk:r,addChunk:o,maxBuffer:a})},Y1=({convertedChunk:t,state:e,getSize:r,truncateChunk:o,addChunk:s,maxBuffer:a})=>{let i=r(t),n=e.length+i;if(n<=a){z1(t,e,s,n);return}let c=o(t,a-e.length);throw c!==void 0&&z1(c,e,s,a),new ln},z1=(t,e,r,o)=>{e.contents=r(t,e,o),e.length=o},vne=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=$1.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&$1.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:$1}=Object.prototype,ln=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var pi=t=>t,Su=()=>{},Dp=({contents:t})=>t,Up=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},kp=t=>t.length;async function Bp(t,e){return ra(t,Rne,e)}var Ane=()=>({contents:[]}),One=()=>1,bne=(t,{contents:e})=>(e.push(t),e),Rne={init:Ane,convertChunk:{string:pi,buffer:pi,arrayBuffer:pi,dataView:pi,typedArray:pi,others:pi},getSize:One,truncateChunk:Su,addChunk:bne,getFinalChunk:Su,finalize:Dp};async function Fp(t,e){return ra(t,Dne,e)}var Pne=()=>({contents:new ArrayBuffer(0)}),Cne=t=>Nne.encode(t),Nne=new TextEncoder,W1=t=>new Uint8Array(t),K1=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Mne=(t,e)=>t.slice(0,e),Ine=(t,{contents:e,length:r},o)=>{let s=Q1()?wne(e,o):xne(e,o);return new Uint8Array(s).set(t,r),s},xne=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(J1(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},wne=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:J1(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},J1=t=>X1**Math.ceil(Math.log(t)/Math.log(X1)),X1=2,Lne=({contents:t,length:e})=>Q1()?t:t.slice(0,e),Q1=()=>"resize"in ArrayBuffer.prototype,Dne={init:Pne,convertChunk:{string:Cne,buffer:W1,arrayBuffer:W1,dataView:K1,typedArray:K1,others:Up},getSize:kp,truncateChunk:Mne,addChunk:Ine,getFinalChunk:Su,finalize:Lne};async function Gp(t,e){return ra(t,Vne,e)}var Une=()=>({contents:"",textDecoder:new TextDecoder}),Vp=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),kne=(t,{contents:e})=>e+t,Bne=(t,e)=>t.slice(0,e),Fne=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Vne={init:Une,convertChunk:{string:pi,buffer:Vp,arrayBuffer:Vp,dataView:Vp,typedArray:Vp,others:Up},getSize:kp,truncateChunk:Bne,addChunk:kne,getFinalChunk:Fne,finalize:Dp};Object.assign(Eu,{on:Z1.on,finished:eU.finished});var tU=({error:t,stream:e,readableObjectMode:r,lines:o,encoding:s,fdNumber:a})=>{if(!(t instanceof ln))throw t;if(a==="all")return t;let i=Gne(r,o,s);throw t.maxBufferInfo={fdNumber:a,unit:i},e.destroy(),t},Gne=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",rU=(t,e,r)=>{if(e.length!==r)return;let o=new ln;throw o.maxBufferInfo={fdNumber:"ipc"},o},nU=(t,e)=>{let{streamName:r,threshold:o,unit:s}=qne(t,e);return`Command's ${r} was larger than ${o} ${s}`},qne=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:o}}=t;delete t.maxBufferInfo;let s=di(e,r);return r==="ipc"?{streamName:"IPC output",threshold:s,unit:"messages"}:{streamName:ip(r),threshold:s,unit:o}},iU=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(o=>o!==null&&o.length>qp(r)),oU=(t,e,r)=>{if(!e)return t;let o=qp(r);return t.length>o?t.slice(0,o):t},qp=([,t])=>t;var cU=({stdio:t,all:e,ipcOutput:r,originalError:o,signal:s,signalDescription:a,exitCode:i,escapedCommand:n,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:h,forceKillAfterDelay:g,killSignal:E,maxBuffer:S,timeout:v,cwd:O})=>{let I=o?.code,j=jne({originalError:o,timedOut:c,timeout:v,isMaxBuffer:d,maxBuffer:S,errorCode:I,signal:s,signalDescription:a,exitCode:i,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:g,killSignal:E}),A=zne(o,O),z=A===void 0?"":`
|
|
80
|
+
${A}`,H=`${j}: ${n}${z}`,Q=e===void 0?[t[2],t[1]]:[e],oe=[H,...Q,...t.slice(3),r.map(te=>$ne(te)).join(`
|
|
81
|
+
`)].map(te=>pu(ta(Yne(te)))).filter(Boolean).join(`
|
|
82
|
+
|
|
83
|
+
`);return{originalMessage:A,shortMessage:H,message:oe}},jne=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:o,maxBuffer:s,errorCode:a,signal:i,signalDescription:n,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:h,killSignal:g})=>{let E=Hne(d,h);return e?`Command timed out after ${r} milliseconds${E}`:l?i===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${E}`:`Command was gracefully canceled with ${i} (${n})`:u?`Command was canceled${E}`:o?`${nU(t,s)}${E}`:a!==void 0?`Command failed with ${a}${E}`:d?`Command was killed with ${g} (${gp(g)})${E}`:i!==void 0?`Command was killed with ${i} (${n})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Hne=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",zne=(t,e)=>{if(t instanceof kr)return;let r=ED(t)?t.originalMessage:String(t?.message??t),o=pu(U1(r,e));return o===""?void 0:o},$ne=t=>typeof t=="string"?t:(0,aU.inspect)(t),Yne=t=>Array.isArray(t)?t.map(e=>ta(sU(e))).filter(Boolean).join(`
|
|
84
|
+
`):sU(t),sU=t=>typeof t=="string"?t:Ye(t)?tp(t):"";var jp=({command:t,escapedCommand:e,stdio:r,all:o,ipcOutput:s,options:{cwd:a},startTime:i})=>uU({command:t,escapedCommand:e,cwd:a,durationMs:kv(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:o,stdio:r,ipcOutput:s,pipedFrom:[]}),na=({error:t,command:e,escapedCommand:r,fileDescriptors:o,options:s,startTime:a,isSync:i})=>Tu({error:t,command:e,escapedCommand:r,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:o.length}),ipcOutput:[],options:s,isSync:i}),Tu=({error:t,command:e,escapedCommand:r,startTime:o,timedOut:s,isCanceled:a,isGracefullyCanceled:i,isMaxBuffer:n,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:h,ipcOutput:g,options:{timeoutDuration:E,timeout:S=E,forceKillAfterDelay:v,killSignal:O,cwd:I,maxBuffer:j},isSync:A})=>{let{exitCode:z,signal:H,signalDescription:Q}=Kne(u,l),{originalMessage:oe,shortMessage:te,message:Z}=cU({stdio:d,all:h,ipcOutput:g,originalError:t,signal:H,signalDescription:Q,exitCode:z,escapedCommand:r,timedOut:s,isCanceled:a,isGracefullyCanceled:i,isMaxBuffer:n,isForcefullyTerminated:c,forceKillAfterDelay:v,killSignal:O,maxBuffer:j,timeout:S,cwd:I}),R=_D(t,Z,A);return Object.assign(R,Wne({error:R,command:e,escapedCommand:r,startTime:o,timedOut:s,isCanceled:a,isGracefullyCanceled:i,isMaxBuffer:n,isForcefullyTerminated:c,exitCode:z,signal:H,signalDescription:Q,stdio:d,all:h,ipcOutput:g,cwd:I,originalMessage:oe,shortMessage:te})),R},Wne=({error:t,command:e,escapedCommand:r,startTime:o,timedOut:s,isCanceled:a,isGracefullyCanceled:i,isMaxBuffer:n,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:h,all:g,ipcOutput:E,cwd:S,originalMessage:v,shortMessage:O})=>uU({shortMessage:O,originalMessage:v,command:e,escapedCommand:r,cwd:S,durationMs:kv(o),failed:!0,timedOut:s,isCanceled:a,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:n,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:h[1],stderr:h[2],all:g,stdio:h,ipcOutput:E,pipedFrom:[]}),uU=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Kne=(t,e)=>{let r=t===null?void 0:t,o=e===null?void 0:e,s=o===void 0?void 0:gp(e);return{exitCode:r,signal:o,signalDescription:s}};var lU=t=>Number.isFinite(t)?t:0;function Xne(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(lU(t*1e3)%1e3),nanoseconds:Math.trunc(lU(t*1e6)%1e3)}}function Jne(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function dA(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Xne(t);break}case"bigint":return Jne(t)}throw new TypeError("Expected a finite number or bigint")}var Qne=t=>t===0||t===0n,Zne=(t,e)=>e===1||e===1n?t:`${t}s`,eie=1e-7,tie=24n*60n*60n*1000n;function pA(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let o=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let s=[],a=(l,d)=>{let h=Math.floor(l*10**d+eie);return(Math.round(h)/10**d).toFixed(d)},i=(l,d,h,g)=>{if(!((s.length===0||!e.colonNotation)&&Qne(l)&&!(e.colonNotation&&h==="m"))){if(g??=String(l),e.colonNotation){let E=g.includes(".")?g.split(".")[0].length:g.length,S=s.length>0?2:1;g="0".repeat(Math.max(0,S-E))+g}else g+=e.verbose?" "+Zne(d,l):h;s.push(g)}},n=dA(t),c=BigInt(n.days);if(e.hideYearAndDays?i(BigInt(c)*24n+BigInt(n.hours),"hour","h"):(e.hideYear?i(c,"day","d"):(i(c/365n,"year","y"),i(c%365n,"day","d")),i(Number(n.hours),"hour","h")),i(Number(n.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(n.seconds),d=Number(n.milliseconds),h=Number(n.microseconds),g=Number(n.nanoseconds);if(i(l,"second","s"),e.formatSubMilliseconds)i(d,"millisecond","ms"),i(h,"microsecond","\xB5s"),i(g,"nanosecond","ns");else{let E=d+h/1e3+g/1e6,S=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,v=E>=1?Math.round(E):Math.ceil(E),O=S?E.toFixed(S):v;i(Number.parseFloat(O),"millisecond","ms",O)}}else{let l=(r?Number(t%tie):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=a(l,d),g=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");i(Number.parseFloat(g),"second","s",g)}if(s.length===0)return o+"0"+(e.verbose?" milliseconds":"ms");let u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(s=s.slice(0,Math.max(e.unitCount,1))),o+s.join(u)}var dU=(t,e)=>{t.failed&&an({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var pU=(t,e)=>{Ys(e)&&(dU(t,e),rie(t,e))},rie=(t,e)=>{let r=`(done in ${pA(t.durationMs)})`;an({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var ia=(t,e,{reject:r})=>{if(pU(t,e),t.failed&&r)throw t;return t};var vA=require("node:fs");function Fr(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function fA(t,{checkOpen:e=!0}={}){return Fr(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function yu(t,{checkOpen:e=!0}={}){return Fr(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function hA(t,e){return fA(t,e)&&yu(t,e)}var mU=(t,e)=>Io(t)?"asyncGenerator":EU(t)?"generator":Hp(t)?"fileUrl":aie(t)?"filePath":lie(t)?"webStream":Fr(t,{checkOpen:!1})?"native":Ye(t)?"uint8Array":die(t)?"asyncIterable":pie(t)?"iterable":gA(t)?_U({transform:t},e):sie(t)?nie(t,e):"native",nie=(t,e)=>hA(t.transform,{checkOpen:!1})?iie(t,e):gA(t.transform)?_U(t,e):oie(t,e),iie=(t,e)=>(gU(t,e,"Duplex stream"),"duplex"),_U=(t,e)=>(gU(t,e,"web TransformStream"),"webTransform"),gU=({final:t,binary:e,objectMode:r},o,s)=>{fU(t,`${o}.final`,s),fU(e,`${o}.binary`,s),mA(r,`${o}.objectMode`)},fU=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},oie=({transform:t,final:e,binary:r,objectMode:o},s)=>{if(t!==void 0&&!hU(t))throw new TypeError(`The \`${s}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(hA(e,{checkOpen:!1}))throw new TypeError(`The \`${s}.final\` option must not be a Duplex stream.`);if(gA(e))throw new TypeError(`The \`${s}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!hU(e))throw new TypeError(`The \`${s}.final\` option must be a generator.`);return mA(r,`${s}.binary`),mA(o,`${s}.objectMode`),Io(t)||Io(e)?"asyncGenerator":"generator"},mA=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},hU=t=>Io(t)||EU(t),Io=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",EU=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",sie=t=>De(t)&&(t.transform!==void 0||t.final!==void 0),Hp=t=>Object.prototype.toString.call(t)==="[object URL]",SU=t=>Hp(t)&&t.protocol!=="file:",aie=t=>De(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>cie.has(e))&&_A(t.file),cie=new Set(["file","append"]),_A=t=>typeof t=="string",TU=(t,e)=>t==="native"&&typeof e=="string"&&!uie.has(e),uie=new Set(["ipc","ignore","inherit","overlapped","pipe"]),yU=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",zp=t=>Object.prototype.toString.call(t)==="[object WritableStream]",lie=t=>yU(t)||zp(t),gA=t=>yU(t?.readable)&&zp(t?.writable),die=t=>vU(t)&&typeof t[Symbol.asyncIterator]=="function",pie=t=>vU(t)&&typeof t[Symbol.iterator]=="function",vU=t=>typeof t=="object"&&t!==null,mr=new Set(["generator","asyncGenerator","duplex","webTransform"]),$p=new Set(["fileUrl","filePath","fileNumber"]),EA=new Set(["fileUrl","filePath"]),AU=new Set([...EA,"webStream","nodeStream"]),OU=new Set(["webTransform","duplex"]),Fi={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var SA=(t,e,r,o)=>o==="output"?fie(t,e,r):hie(t,e,r),fie=(t,e,r)=>{let o=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:o,readableObjectMode:t??o}},hie=(t,e,r)=>{let o=e===0?t===!0:r[e-1].value.readableObjectMode,s=e!==r.length-1&&(t??o);return{writableObjectMode:o,readableObjectMode:s}},bU=(t,e)=>{let r=t.findLast(({type:o})=>mr.has(o));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var RU=(t,e,r,o)=>[...t.filter(({type:s})=>!mr.has(s)),...mie(t,e,r,o)],mie=(t,e,r,{encoding:o})=>{let s=t.filter(({type:i})=>mr.has(i)),a=Array.from({length:s.length});for(let[i,n]of Object.entries(s))a[i]=_ie({stdioItem:n,index:Number(i),newTransforms:a,optionName:e,direction:r,encoding:o});return Tie(a,r)},_ie=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:o,optionName:s,direction:a,encoding:i})=>e==="duplex"?gie({stdioItem:t,optionName:s}):e==="webTransform"?Eie({stdioItem:t,index:r,newTransforms:o,direction:a}):Sie({stdioItem:t,index:r,newTransforms:o,direction:a,encoding:i}),gie=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:o},objectMode:s=o}},optionName:a})=>{if(s&&!o)throw new TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!s&&o)throw new TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:o}}},Eie=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:o,direction:s})=>{let{transform:a,objectMode:i}=De(e)?e:{transform:e},{writableObjectMode:n,readableObjectMode:c}=SA(i,r,o,s);return{...t,value:{transform:a,writableObjectMode:n,readableObjectMode:c}}},Sie=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:o,direction:s,encoding:a})=>{let{transform:i,final:n,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=De(e)?e:{transform:e},d=c||nr.has(a),{writableObjectMode:h,readableObjectMode:g}=SA(l,r,o,s);return{...t,value:{transform:i,final:n,binary:d,preserveNewlines:u,writableObjectMode:h,readableObjectMode:g}}},Tie=(t,e)=>e==="input"?t.reverse():t;var Yp=J(require("node:process"),1);var PU=(t,e,r)=>{let o=t.map(s=>yie(s,e));if(o.includes("input")&&o.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return o.find(Boolean)??Oie},yie=({type:t,value:e},r)=>vie[r]??CU[t](e),vie=["input","output","output"],oa=()=>{},TA=()=>"input",CU={generator:oa,asyncGenerator:oa,fileUrl:oa,filePath:oa,iterable:TA,asyncIterable:TA,uint8Array:TA,webStream:t=>zp(t)?"output":"input",nodeStream(t){return yu(t,{checkOpen:!1})?fA(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:oa,duplex:oa,native(t){let e=Aie(t);if(e!==void 0)return e;if(Fr(t,{checkOpen:!1}))return CU.nodeStream(t)}},Aie=t=>{if([0,Yp.default.stdin].includes(t))return"input";if([1,2,Yp.default.stdout,Yp.default.stderr].includes(t))return"output"},Oie="output";var NU=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var MU=({stdio:t,ipc:e,buffer:r,...o},s,a)=>{let i=bie(t,o).map((n,c)=>IU(n,c));return a?Pie(i,r,s):NU(i,e)},bie=(t,e)=>{if(t===void 0)return hr.map(o=>e[o]);if(Rie(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${hr.map(o=>`\`${o}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,hr.length);return Array.from({length:r},(o,s)=>t[s])},Rie=t=>hr.some(e=>t[e]!==void 0),IU=(t,e)=>Array.isArray(t)?t.map(r=>IU(r,e)):t??(e>=hr.length?"ignore":"pipe"),Pie=(t,e,r)=>t.map((o,s)=>!e[s]&&s!==0&&!Ws(r,s)&&Cie(o)?"ignore":o),Cie=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var wU=require("node:fs"),LU=J(require("node:tty"),1);var DU=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:o,direction:s,isSync:a})=>!r||e!=="native"?t:a?Nie({stdioItem:t,fdNumber:o,direction:s}):xie({stdioItem:t,fdNumber:o}),Nie=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:o,direction:s})=>{let a=Mie({value:e,optionName:r,fdNumber:o,direction:s});if(a!==void 0)return a;if(Fr(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Mie=({value:t,optionName:e,fdNumber:r,direction:o})=>{let s=Iie(t,r);if(s!==void 0){if(o==="output")return{type:"fileNumber",value:s,optionName:e};if(LU.default.isatty(s))throw new TypeError(`The \`${e}: ${Tp(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:li((0,wU.readFileSync)(s)),optionName:e}}},Iie=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=np.indexOf(t);if(r!==-1)return r},xie=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:o})=>e==="inherit"?{type:"nodeStream",value:xU(o,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:xU(e,e,r),optionName:r}:Fr(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,xU=(t,e,r)=>{let o=np[t];if(o===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return o};var UU=({input:t,inputFile:e},r)=>r===0?[...wie(t),...Die(e)]:[],wie=t=>t===void 0?[]:[{type:Lie(t),value:t,optionName:"input"}],Lie=t=>{if(yu(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Ye(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Die=t=>t===void 0?[]:[{...Uie(t),optionName:"inputFile"}],Uie=t=>{if(Hp(t))return{type:"fileUrl",value:t};if(_A(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var kU=t=>t.filter((e,r)=>t.every((o,s)=>e.value!==o.value||r>=s||e.type==="generator"||e.type==="asyncGenerator")),BU=({stdioItem:{type:t,value:e,optionName:r},direction:o,fileDescriptors:s,isSync:a})=>{let i=kie(s,t);if(i.length!==0){if(a){Bie({otherStdioItems:i,type:t,value:e,optionName:r,direction:o});return}if(AU.has(t))return FU({otherStdioItems:i,type:t,value:e,optionName:r,direction:o});OU.has(t)&&Vie({otherStdioItems:i,type:t,value:e,optionName:r})}},kie=(t,e)=>t.flatMap(({direction:r,stdioItems:o})=>o.filter(s=>s.type===e).map((s=>({...s,direction:r})))),Bie=({otherStdioItems:t,type:e,value:r,optionName:o,direction:s})=>{EA.has(e)&&FU({otherStdioItems:t,type:e,value:r,optionName:o,direction:s})},FU=({otherStdioItems:t,type:e,value:r,optionName:o,direction:s})=>{let a=t.filter(n=>Fie(n,r));if(a.length===0)return;let i=a.find(n=>n.direction!==s);return VU(i,o,e),s==="output"?a[0].stream:void 0},Fie=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Vie=({otherStdioItems:t,type:e,value:r,optionName:o})=>{let s=t.find(({value:{transform:a}})=>a===r.transform);VU(s,o,e)},VU=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Fi[r]} that is the same.`)};var Wp=(t,e,r,o)=>{let a=MU(e,r,o).map((n,c)=>Gie({stdioOption:n,fdNumber:c,options:e,isSync:o})),i=Kie({initialFileDescriptors:a,addProperties:t,options:e,isSync:o});return e.stdio=i.map(({stdioItems:n})=>Qie(n)),i},Gie=({stdioOption:t,fdNumber:e,options:r,isSync:o})=>{let s=ip(e),{stdioItems:a,isStdioArray:i}=qie({stdioOption:t,fdNumber:e,options:r,optionName:s}),n=PU(a,e,s),c=a.map(d=>DU({stdioItem:d,isStdioArray:i,fdNumber:e,direction:n,isSync:o})),u=RU(c,s,n,r),l=bU(u,n);return Wie(u,l),{direction:n,objectMode:l,stdioItems:u}},qie=({stdioOption:t,fdNumber:e,options:r,optionName:o})=>{let a=[...(Array.isArray(t)?t:[t]).map(c=>jie(c,o)),...UU(r,e)],i=kU(a),n=i.length>1;return Hie(i,n,o),$ie(i),{stdioItems:i,isStdioArray:n}},jie=(t,e)=>({type:mU(t,e),value:t,optionName:e}),Hie=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:o,optionName:s}of t)if(zie.has(o))throw new Error(`The \`${s}\` option must not include \`${o}\`.`)}},zie=new Set(["ignore","ipc"]),$ie=t=>{for(let e of t)Yie(e)},Yie=({type:t,value:e,optionName:r})=>{if(SU(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
85
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(TU(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Wie=(t,e)=>{if(!e)return;let r=t.find(({type:o})=>$p.has(o));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Kie=({initialFileDescriptors:t,addProperties:e,options:r,isSync:o})=>{let s=[];try{for(let a of t)s.push(Xie({fileDescriptor:a,fileDescriptors:s,addProperties:e,options:r,isSync:o}));return s}catch(a){throw yA(s),a}},Xie=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:o,addProperties:s,options:a,isSync:i})=>{let n=r.map(c=>Jie({stdioItem:c,addProperties:s,direction:t,options:a,fileDescriptors:o,isSync:i}));return{direction:t,objectMode:e,stdioItems:n}},Jie=({stdioItem:t,addProperties:e,direction:r,options:o,fileDescriptors:s,isSync:a})=>{let i=BU({stdioItem:t,direction:r,fileDescriptors:s,isSync:a});return i!==void 0?{...t,stream:i}:{...t,...e[r][t.type](t,o)}},yA=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Ur(r)&&r.destroy()},Qie=t=>{if(t.length>1)return t.some(({value:o})=>o==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var qU=(t,e)=>Wp(eoe,t,e,!0),dn=({type:t,optionName:e})=>{jU(e,Fi[t])},Zie=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&jU(t,`"${e}"`),{}),jU=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},GU={generator(){},asyncGenerator:dn,webStream:dn,nodeStream:dn,webTransform:dn,duplex:dn,asyncIterable:dn,native:Zie},eoe={input:{...GU,fileUrl:({value:t})=>({contents:[li((0,vA.readFileSync)(t))]}),filePath:({value:{file:t}})=>({contents:[li((0,vA.readFileSync)(t))]}),fileNumber:dn,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...GU,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:dn,string:dn,uint8Array:dn}};var fi=(t,{stripFinalNewline:e},r)=>AA(e,r)&&t!==void 0&&!Array.isArray(t)?ta(t):t,AA=(t,e)=>e==="all"?t[1]||t[2]:t[e];var Au=require("node:stream");var Kp=(t,e,r,o)=>t||r?void 0:zU(e,o),bA=(t,e,r)=>r?t.flatMap(o=>HU(o,e)):HU(t,e),HU=(t,e)=>{let{transform:r,final:o}=zU(e,{});return[...r(t),...o()]},zU=(t,e)=>(e.previousChunks="",{transform:toe.bind(void 0,e,t),final:noe.bind(void 0,e)}),toe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:o}=t,s=-1;for(let a=0;a<r.length;a+=1)if(r[a]===`
|
|
86
|
+
`){let i=roe(r,a,e,t),n=r.slice(s+1,a+1-i);o.length>0&&(n=OA(o,n),o=""),yield n,s=a}s!==r.length-1&&(o=OA(o,r.slice(s+1))),t.previousChunks=o},roe=(t,e,r,o)=>r?0:(o.isWindowsNewline=e!==0&&t[e-1]==="\r",o.isWindowsNewline?2:1),noe=function*({previousChunks:t}){t.length>0&&(yield t)},$U=({binary:t,preserveNewlines:e,readableObjectMode:r,state:o})=>t||e||r?void 0:{transform:ioe.bind(void 0,o)},ioe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:o,LF:s,concatBytes:a}=typeof e=="string"?ooe:aoe;if(e.at(-1)===s){yield e;return}yield a(e,t?o:r)},OA=(t,e)=>`${t}${e}`,ooe={windowsNewline:`\r
|
|
87
|
+
`,unixNewline:`
|
|
88
|
+
`,LF:`
|
|
89
|
+
`,concatBytes:OA},soe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},aoe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:soe};var YU=require("node:buffer");var WU=(t,e)=>t?void 0:coe.bind(void 0,e),coe=function*(t,e){if(typeof e!="string"&&!Ye(e)&&!YU.Buffer.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},KU=(t,e)=>t?uoe.bind(void 0,e):loe.bind(void 0,e),uoe=function*(t,e){XU(t,e),yield e},loe=function*(t,e){if(XU(t,e),typeof e!="string"&&!Ye(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},XU=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
90
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
91
|
+
if (condition) { yield value; }`)};var JU=require("node:buffer"),QU=require("node:string_decoder");var Xp=(t,e,r)=>{if(r)return;if(t)return{transform:doe.bind(void 0,new TextEncoder)};let o=new QU.StringDecoder(e);return{transform:poe.bind(void 0,o),final:foe.bind(void 0,o)}},doe=function*(t,e){JU.Buffer.isBuffer(e)?yield li(e):typeof e=="string"?yield t.encode(e):yield e},poe=function*(t,e){yield Ye(e)?t.write(e):e},foe=function*(t){let e=t.end();e!==""&&(yield e)};var RA=require("node:util"),PA=(0,RA.callbackify)(async(t,e,r,o)=>{e.currentIterable=t(...r);try{for await(let s of e.currentIterable)o.push(s)}finally{delete e.currentIterable}}),Jp=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:o=moe}=e[r];for await(let s of o(t))yield*Jp(s,e,r+1)},ZU=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*hoe(r,Number(e),t)},hoe=async function*(t,e,r){if(t!==void 0)for await(let o of t())yield*Jp(o,r,e+1)},ek=(0,RA.callbackify)(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),moe=function*(t){yield t};var CA=(t,e,r,o)=>{try{for(let s of t(...e))r.push(s);o()}catch(s){o(s)}},tk=(t,e)=>[...e.flatMap(r=>[...xo(r,t,0)]),...vu(t)],xo=function*(t,e,r){if(r===e.length){yield t;return}let{transform:o=goe}=e[r];for(let s of o(t))yield*xo(s,e,r+1)},vu=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*_oe(r,Number(e),t)},_oe=function*(t,e,r){if(t!==void 0)for(let o of t())yield*xo(o,r,e+1)},goe=function*(t){yield t};var NA=({value:t,value:{transform:e,final:r,writableObjectMode:o,readableObjectMode:s},optionName:a},{encoding:i})=>{let n={},c=rk(t,i,a),u=Io(e),l=Io(r),d=u?PA.bind(void 0,Jp,n):CA.bind(void 0,xo),h=u||l?PA.bind(void 0,ZU,n):CA.bind(void 0,vu),g=u||l?ek.bind(void 0,n):void 0;return{stream:new Au.Transform({writableObjectMode:o,writableHighWaterMark:(0,Au.getDefaultHighWaterMark)(o),readableObjectMode:s,readableHighWaterMark:(0,Au.getDefaultHighWaterMark)(s),transform(S,v,O){d([S,c,0],this,O)},flush(S){h([c],this,S)},destroy:g})}},Qp=(t,e,r,o)=>{let s=e.filter(({type:i})=>i==="generator"),a=o?s.reverse():s;for(let{value:i,optionName:n}of a){let c=rk(i,r,n);t=tk(c,t)}return t},rk=({transform:t,final:e,binary:r,writableObjectMode:o,readableObjectMode:s,preserveNewlines:a},i,n)=>{let c={};return[{transform:WU(o,n)},Xp(r,i,o),Kp(r,a,o,c),{transform:t,final:e},{transform:KU(s,n)},$U({binary:r,preserveNewlines:a,readableObjectMode:s,state:c})].filter(Boolean)};var nk=(t,e)=>{for(let r of Eoe(t))Soe(t,r,e)},Eoe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Soe=(t,e,r)=>{let{stdioItems:o}=t[e],s=o.filter(({contents:n})=>n!==void 0);if(s.length===0)return;if(e!==0){let[{type:n,optionName:c}]=s;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Fi[n]} with synchronous methods.`)}let i=s.map(({contents:n})=>n).map(n=>Toe(n,o));r.input=du(i)},Toe=(t,e)=>{let r=Qp(t,e,"utf8",!0);return yoe(r),du(r)},yoe=t=>{let e=t.find(r=>typeof r!="string"&&!Ye(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var ef=require("node:fs");var Zp=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:o})=>o!=="all"&&Ws(r,o)&&!nr.has(e)&&voe(o)&&(t.some(({type:s,value:a})=>s==="native"&&Aoe.has(a))||t.every(({type:s})=>mr.has(s))),voe=t=>t===1||t===2,Aoe=new Set(["pipe","overlapped"]),ik=async(t,e,r,o)=>{for await(let s of t)Ooe(e)||sk(s,r,o)},ok=(t,e,r)=>{for(let o of t)sk(o,e,r)},Ooe=t=>t._readableState.pipes.length>0,sk=(t,e,r)=>{let o=lp(t);an({type:"output",verboseMessage:o,fdNumber:e,verboseInfo:r})};var ak=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:o,verboseInfo:s})=>{if(e===null)return{output:Array.from({length:3})};let a={},i=new Set([]);return{output:e.map((c,u)=>boe({result:c,fileDescriptors:t,fdNumber:u,state:a,outputFiles:i,isMaxBuffer:o,verboseInfo:s},r)),...a}},boe=({result:t,fileDescriptors:e,fdNumber:r,state:o,outputFiles:s,isMaxBuffer:a,verboseInfo:i},{buffer:n,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;let h=oU(t,a,d),g=li(h),{stdioItems:E,objectMode:S}=e[r],v=Roe([g],E,c,o),{serializedResult:O,finalResult:I=O}=Poe({chunks:v,objectMode:S,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});Coe({serializedResult:O,fdNumber:r,state:o,verboseInfo:i,encoding:c,stdioItems:E,objectMode:S});let j=n[r]?I:void 0;try{return o.error===void 0&&Noe(O,E,s),j}catch(A){return o.error=A,j}},Roe=(t,e,r,o)=>{try{return Qp(t,e,r,!1)}catch(s){return o.error=s,t}},Poe=({chunks:t,objectMode:e,encoding:r,lines:o,stripFinalNewline:s,fdNumber:a})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:du(t)};let i=Xw(t,r);return o[a]?{serializedResult:i,finalResult:bA(i,!s[a],e)}:{serializedResult:i}},Coe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:o,encoding:s,stdioItems:a,objectMode:i})=>{if(!Zp({stdioItems:a,encoding:s,verboseInfo:o,fdNumber:e}))return;let n=bA(t,!1,i);try{ok(n,e,o)}catch(c){r.error??=c}},Noe=(t,e,r)=>{for(let{path:o,append:s}of e.filter(({type:a})=>$p.has(a))){let a=typeof o=="string"?o:o.toString();s||r.has(a)?(0,ef.appendFileSync)(o,t):(r.add(a),(0,ef.writeFileSync)(o,t))}};var ck=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,fi(e,r,"all")]:Array.isArray(e)?[fi(t,r,"all"),...e]:Ye(t)&&Ye(e)?Nv([t,e]):`${t}${e}`};var tf=require("node:events");var uk=async(t,e)=>{let[r,o]=await Moe(t);return e.isForcefullyTerminated??=!1,[r,o]},Moe=async t=>{let[e,r]=await Promise.allSettled([(0,tf.once)(t,"spawn"),(0,tf.once)(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?lk(t):r.value},lk=async t=>{try{return await(0,tf.once)(t,"exit")}catch{return lk(t)}},dk=async t=>{let[e,r]=await t;if(!Ioe(e,r)&&MA(e,r))throw new kr;return[e,r]},Ioe=(t,e)=>t===void 0&&e===void 0,MA=(t,e)=>t!==0||e!==null;var pk=({error:t,status:e,signal:r,output:o},{maxBuffer:s})=>{let a=xoe(t,e,r),i=a?.code==="ETIMEDOUT",n=iU(a,o,s);return{resultError:a,exitCode:e,signal:r,timedOut:i,isMaxBuffer:n}},xoe=(t,e,r)=>t!==void 0?t:MA(e,r)?new kr:void 0;var hk=(t,e,r)=>{let{file:o,commandArguments:s,command:a,escapedCommand:i,startTime:n,verboseInfo:c,options:u,fileDescriptors:l}=woe(t,e,r),d=Uoe({file:o,commandArguments:s,options:u,command:a,escapedCommand:i,verboseInfo:c,fileDescriptors:l,startTime:n});return ia(d,c,u)},woe=(t,e,r)=>{let{command:o,escapedCommand:s,startTime:a,verboseInfo:i}=pp(t,e,r),n=Loe(r),{file:c,commandArguments:u,options:l}=wp(t,e,n);Doe(l);let d=qU(l,i);return{file:c,commandArguments:u,command:o,escapedCommand:s,startTime:a,verboseInfo:i,options:l,fileDescriptors:d}},Loe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Doe=({ipc:t,ipcInput:e,detached:r,cancelSignal:o})=>{e&&rf("ipcInput"),t&&rf("ipc: true"),r&&rf("detached: true"),o&&rf("cancelSignal")},rf=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Uoe=({file:t,commandArguments:e,options:r,command:o,escapedCommand:s,verboseInfo:a,fileDescriptors:i,startTime:n})=>{let c=koe({file:t,commandArguments:e,options:r,command:o,escapedCommand:s,fileDescriptors:i,startTime:n});if(c.failed)return c;let{resultError:u,exitCode:l,signal:d,timedOut:h,isMaxBuffer:g}=pk(c,r),{output:E,error:S=u}=ak({fileDescriptors:i,syncResult:c,options:r,isMaxBuffer:g,verboseInfo:a}),v=E.map((I,j)=>fi(I,r,j)),O=fi(ck(E,r),r,"all");return Foe({error:S,exitCode:l,signal:d,timedOut:h,isMaxBuffer:g,stdio:v,all:O,options:r,command:o,escapedCommand:s,startTime:n})},koe=({file:t,commandArguments:e,options:r,command:o,escapedCommand:s,fileDescriptors:a,startTime:i})=>{try{nk(a,r);let n=Boe(r);return(0,fk.spawnSync)(...Lp(t,e,n))}catch(n){return na({error:n,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:i,isSync:!0})}},Boe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:qp(e)}),Foe=({error:t,exitCode:e,signal:r,timedOut:o,isMaxBuffer:s,stdio:a,all:i,options:n,command:c,escapedCommand:u,startTime:l})=>t===void 0?jp({command:c,escapedCommand:u,stdio:a,all:i,ipcOutput:[],options:n,startTime:l}):Tu({error:t,command:c,escapedCommand:u,timedOut:o,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:s,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:a,all:i,ipcOutput:[],options:n,startTime:l,isSync:!0});var vB=require("node:events"),AB=require("node:child_process");var xA=J(require("node:process"),1);var sa=require("node:events");var mk=({anyProcess:t,channel:e,isSubprocess:r,ipc:o},{reference:s=!0,filter:a}={})=>(Qs({methodName:"getOneMessage",isSubprocess:r,ipc:o,isConnected:Rp(t)}),Voe({anyProcess:t,channel:e,isSubprocess:r,filter:a,reference:s})),Voe=async({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:s})=>{vp(e,s);let a=Bi(t,e,r),i=new AbortController;try{return await Promise.race([Goe(a,o,i),qoe(a,r,i),joe(a,r,i)])}catch(n){throw Zs(t),n}finally{i.abort(),Ap(e,s)}},Goe=async(t,e,{signal:r})=>{if(e===void 0){let[o]=await(0,sa.once)(t,"message",{signal:r});return o}for await(let[o]of(0,sa.on)(t,"message",{signal:r}))if(e(o))return o},qoe=async(t,e,{signal:r})=>{await(0,sa.once)(t,"disconnect",{signal:r}),kD(e)},joe=async(t,e,{signal:r})=>{let[o]=await(0,sa.once)(t,"strict:error",{signal:r});throw Sp(o,e)};var Ou=require("node:events");var gk=({anyProcess:t,channel:e,isSubprocess:r,ipc:o},{reference:s=!0}={})=>IA({anyProcess:t,channel:e,isSubprocess:r,ipc:o,shouldAwait:!r,reference:s}),IA=({anyProcess:t,channel:e,isSubprocess:r,ipc:o,shouldAwait:s,reference:a})=>{Qs({methodName:"getEachMessage",isSubprocess:r,ipc:o,isConnected:Rp(t)}),vp(e,a);let i=Bi(t,e,r),n=new AbortController,c={};return Hoe(t,i,n),zoe({ipcEmitter:i,isSubprocess:r,controller:n,state:c}),$oe({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:s,controller:n,state:c,reference:a})},Hoe=async(t,e,r)=>{try{await(0,Ou.once)(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},zoe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:o})=>{try{let[s]=await(0,Ou.once)(t,"strict:error",{signal:r.signal});o.error=Sp(s,e),r.abort()}catch{}},$oe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:o,shouldAwait:s,controller:a,state:i,reference:n}){try{for await(let[c]of(0,Ou.on)(r,"message",{signal:a.signal}))_k(i),yield c}catch{_k(i)}finally{a.abort(),Ap(e,n),o||Zs(t),s&&await t}},_k=({error:t})=>{if(t)throw t};var Ek=(t,{ipc:e})=>{Object.assign(t,Tk(t,!1,e))},Sk=()=>{let t=xA.default,e=!0,r=xA.default.channel!==void 0;return{...Tk(t,e,r),getCancelSignal:g1.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Tk=(t,e,r)=>({sendMessage:Mp.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:mk.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:gk.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var yk=require("node:child_process"),Vi=require("node:stream");var vk=({error:t,command:e,escapedCommand:r,fileDescriptors:o,options:s,startTime:a,verboseInfo:i})=>{yA(o);let n=new yk.ChildProcess;Yoe(n,o),Object.assign(n,{readable:Woe,writable:Koe,duplex:Xoe});let c=na({error:t,command:e,escapedCommand:r,fileDescriptors:o,options:s,startTime:a,isSync:!1}),u=Joe(c,i,s);return{subprocess:n,promise:u}},Yoe=(t,e)=>{let r=bu(),o=bu(),s=bu(),a=Array.from({length:e.length-3},bu),i=bu(),n=[r,o,s,...a];Object.assign(t,{stdin:r,stdout:o,stderr:s,all:i,stdio:n})},bu=()=>{let t=new Vi.PassThrough;return t.end(),t},Woe=()=>new Vi.Readable({read(){}}),Koe=()=>new Vi.Writable({write(){}}),Xoe=()=>new Vi.Duplex({read(){},write(){}}),Joe=async(t,e,r)=>ia(t,e,r);var aa=require("node:fs"),Ok=require("node:buffer"),pn=require("node:stream");var bk=(t,e)=>Wp(Qoe,t,e,!1),Ru=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Fi[t]}.`)},Ak={fileNumber:Ru,generator:NA,asyncGenerator:NA,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let o=e||r;return{stream:pn.Duplex.fromWeb(t,{objectMode:o})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Qoe={input:{...Ak,fileUrl:({value:t})=>({stream:(0,aa.createReadStream)(t)}),filePath:({value:{file:t}})=>({stream:(0,aa.createReadStream)(t)}),webStream:({value:t})=>({stream:pn.Readable.fromWeb(t)}),iterable:({value:t})=>({stream:pn.Readable.from(t)}),asyncIterable:({value:t})=>({stream:pn.Readable.from(t)}),string:({value:t})=>({stream:pn.Readable.from(t)}),uint8Array:({value:t})=>({stream:pn.Readable.from(Ok.Buffer.from(t))})},output:{...Ak,fileUrl:({value:t})=>({stream:(0,aa.createWriteStream)(t)}),filePath:({value:{file:t,append:e}})=>({stream:(0,aa.createWriteStream)(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:pn.Writable.fromWeb(t)}),iterable:Ru,asyncIterable:Ru,string:Ru,uint8Array:Ru}};var Pu=require("node:events"),of=require("node:stream"),DA=require("node:stream/promises");function wo(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let s of t)LA(s);let e=t.some(({readableObjectMode:s})=>s),r=Zoe(t,e),o=new wA({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let s of t)o.add(s);return o}var Zoe=(t,e)=>{if(t.length===0)return(0,of.getDefaultHighWaterMark)(e);let r=t.filter(({readableObjectMode:o})=>o===e).map(({readableHighWaterMark:o})=>o);return Math.max(...r)},wA=class extends of.PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(LA(e),this.#t.has(e))return;this.#t.add(e),this.#n??=ese(this,this.#t,this.#o);let r=nse({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(LA(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},ese=async(t,e,r)=>{nf(t,Rk);let o=new AbortController;try{await Promise.race([tse(t,o),rse(t,e,r,o)])}finally{o.abort(),nf(t,-Rk)}},tse=async(t,{signal:e})=>{try{await(0,DA.finished)(t,{signal:e,cleanup:!0})}catch(r){throw Ck(t,r),r}},rse=async(t,e,r,{signal:o})=>{for await(let[s]of(0,Pu.on)(t,"unpipe",{signal:o}))e.has(s)&&s.emit(r)},LA=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},nse=async({passThroughStream:t,stream:e,streams:r,ended:o,aborted:s,onFinished:a,unpipeEvent:i})=>{nf(t,Pk);let n=new AbortController;try{await Promise.race([ise(a,e,n),ose({passThroughStream:t,stream:e,streams:r,ended:o,aborted:s,controller:n}),sse({stream:e,streams:r,ended:o,aborted:s,unpipeEvent:i,controller:n})])}finally{n.abort(),nf(t,-Pk)}r.size>0&&r.size===o.size+s.size&&(o.size===0&&s.size>0?UA(t):ase(t))},ise=async(t,e,{signal:r})=>{try{await t,r.aborted||UA(e)}catch(o){r.aborted||Ck(e,o)}},ose=async({passThroughStream:t,stream:e,streams:r,ended:o,aborted:s,controller:{signal:a}})=>{try{await(0,DA.finished)(e,{signal:a,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&o.add(e)}catch(i){if(a.aborted||!r.has(e))return;Nk(i)?s.add(e):Mk(t,i)}},sse=async({stream:t,streams:e,ended:r,aborted:o,unpipeEvent:s,controller:{signal:a}})=>{if(await(0,Pu.once)(t,s,{signal:a}),!t.readable)return(0,Pu.once)(a,"abort",{signal:a});e.delete(t),r.delete(t),o.delete(t)},ase=t=>{t.writable&&t.end()},Ck=(t,e)=>{Nk(e)?UA(t):Mk(t,e)},Nk=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",UA=t=>{(t.readable||t.writable)&&t.destroy()},Mk=(t,e)=>{t.destroyed||(t.once("error",cse),t.destroy(e))},cse=()=>{},nf=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},Rk=2,Pk=1;var kA=require("node:stream/promises");var ca=(t,e)=>{t.pipe(e),use(t,e),lse(t,e)},use=async(t,e)=>{if(!(Ur(t)||Ur(e))){try{await(0,kA.finished)(t,{cleanup:!0,readable:!0,writable:!1})}catch{}BA(e)}},BA=t=>{t.writable&&t.end()},lse=async(t,e)=>{if(!(Ur(t)||Ur(e))){try{await(0,kA.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}FA(t)}},FA=t=>{t.readable&&t.destroy()};var Ik=(t,e,r)=>{let o=new Map;for(let[s,{stdioItems:a,direction:i}]of Object.entries(e)){for(let{stream:n}of a.filter(({type:c})=>mr.has(c)))dse(t,n,i,s);for(let{stream:n}of a.filter(({type:c})=>!mr.has(c)))fse({subprocess:t,stream:n,direction:i,fdNumber:s,pipeGroups:o,controller:r})}for(let[s,a]of o.entries()){let i=a.length===1?a[0]:wo(a);ca(i,s)}},dse=(t,e,r,o)=>{r==="output"?ca(t.stdio[o],e):ca(e,t.stdio[o]);let s=pse[o];s!==void 0&&(t[s]=e),t.stdio[o]=e},pse=["stdin","stdout","stderr"],fse=({subprocess:t,stream:e,direction:r,fdNumber:o,pipeGroups:s,controller:a})=>{if(e===void 0)return;hse(e,a);let[i,n]=r==="output"?[e,t.stdio[o]]:[t.stdio[o],e],c=s.get(i)??[];s.set(i,[...c,n])},hse=(t,{signal:e})=>{Ur(t)&&Mo(t,mse,e)},mse=2;var wk=require("node:events");var Lo=[];Lo.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Lo.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Lo.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var sf=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",VA=Symbol.for("signal-exit emitter"),GA=globalThis,_se=Object.defineProperty.bind(Object),qA=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(GA[VA])return GA[VA];_se(GA,VA,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let o=this.listeners[e],s=o.indexOf(r);s!==-1&&(s===0&&o.length===1?o.length=0:o.splice(s,1))}emit(e,r,o){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let a of this.listeners[e])s=a(r,o)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,o)||s),s}},af=class{},gse=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),jA=class extends af{onExit(){return()=>{}}load(){}unload(){}},HA=class extends af{#t=zA.platform==="win32"?"SIGINT":"SIGHUP";#r=new qA;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of Lo)this.#i[r]=()=>{let o=this.#e.listeners(r),{count:s}=this.#r,a=e;if(typeof a.__signal_exit_emitter__=="object"&&typeof a.__signal_exit_emitter__.count=="number"&&(s+=a.__signal_exit_emitter__.count),o.length===s){this.unload();let i=this.#r.emit("exit",null,r),n=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,n)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!sf(this.#e))return()=>{};this.#s===!1&&this.load();let o=r?.alwaysLast?"afterExit":"exit";return this.#r.on(o,e),()=>{this.#r.removeListener(o,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of Lo)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,Lo.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return sf(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let o=this.#n;if(e==="exit"&&sf(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=o.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return o.call(this.#e,e,...r)}},zA=globalThis.process,{onExit:xk,load:xWe,unload:wWe}=gse(sf(zA)?new HA(zA):new jA);var Lk=(t,{cleanup:e,detached:r},{signal:o})=>{if(!e||r)return;let s=xk(()=>{t.kill()});(0,wk.addAbortListener)(o,()=>{s()})};var Uk=({source:t,sourcePromise:e,boundOptions:r,createNested:o},...s)=>{let a=dp(),{destination:i,destinationStream:n,destinationError:c,from:u,unpipeSignal:l}=Ese(r,o,s),{sourceStream:d,sourceError:h}=Tse(t,u),{options:g,fileDescriptors:E}=un.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:g,sourceError:h,destination:i,destinationStream:n,destinationError:c,unpipeSignal:l,fileDescriptors:E,startTime:a}},Ese=(t,e,r)=>{try{let{destination:o,pipeOptions:{from:s,to:a,unpipeSignal:i}={}}=Sse(t,e,...r),n=yp(o,a);return{destination:o,destinationStream:n,from:s,unpipeSignal:i}}catch(o){return{destinationError:o}}},Sse=(t,e,r,...o)=>{if(Array.isArray(r))return{destination:e(Dk,t)(r,...o),pipeOptions:t};if(typeof r=="string"||r instanceof URL||Pv(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[s,a,i]=ep(r,...o);return{destination:e(Dk)(s,a,i),pipeOptions:i}}if(un.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:o[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Dk=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Tse=(t,e)=>{try{return{sourceStream:ea(t,e)}}catch(r){return{sourceError:r}}};var Bk=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:o,fileDescriptors:s,sourceOptions:a,startTime:i})=>{let n=yse({sourceStream:t,sourceError:e,destinationStream:r,destinationError:o});if(n!==void 0)throw $A({error:n,fileDescriptors:s,sourceOptions:a,startTime:i})},yse=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:o})=>{if(e!==void 0&&o!==void 0)return o;if(o!==void 0)return FA(t),o;if(e!==void 0)return BA(r),e},$A=({error:t,fileDescriptors:e,sourceOptions:r,startTime:o})=>na({error:t,command:kk,escapedCommand:kk,fileDescriptors:e,options:r,startTime:o,isSync:!1}),kk="source.pipe(destination)";var Fk=async t=>{let[{status:e,reason:r,value:o=r},{status:s,reason:a,value:i=a}]=await t;if(i.pipedFrom.includes(o)||i.pipedFrom.push(o),s==="rejected")throw i;if(e==="rejected")throw o;return i};var Vk=require("node:stream/promises");var Gk=(t,e,r)=>{let o=cf.has(e)?Ase(t,e):vse(t,e);return Mo(t,bse,r.signal),Mo(e,Rse,r.signal),Ose(e),o},vse=(t,e)=>{let r=wo([t]);return ca(r,e),cf.set(e,r),r},Ase=(t,e)=>{let r=cf.get(e);return r.add(t),r},Ose=async t=>{try{await(0,Vk.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}cf.delete(t)},cf=new WeakMap,bse=2,Rse=1;var qk=require("node:util");var jk=(t,e)=>t===void 0?[]:[Pse(t,e)],Pse=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:o,sourceOptions:s,startTime:a})=>{await(0,qk.aborted)(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw $A({error:i,fileDescriptors:o,sourceOptions:s,startTime:a})};var uf=(t,...e)=>{if(De(e[0]))return uf.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...o}=Uk(t,...e),s=Cse({...o,destination:r});return s.pipe=uf.bind(void 0,{...t,source:r,sourcePromise:s,boundOptions:{}}),s},Cse=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:o,destination:s,destinationStream:a,destinationError:i,unpipeSignal:n,fileDescriptors:c,startTime:u})=>{let l=Nse(t,s);Bk({sourceStream:e,sourceError:o,destinationStream:a,destinationError:i,fileDescriptors:c,sourceOptions:r,startTime:u});let d=new AbortController;try{let h=Gk(e,a,d);return await Promise.race([Fk(l),...jk(n,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{d.abort()}},Nse=(t,e)=>Promise.allSettled([t,e]);var Wk=require("node:timers/promises");var zk=require("node:events"),$k=require("node:stream");var lf=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:o,encoding:s,preserveNewlines:a})=>{let i=new AbortController;return Mse(e,i),Yk({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&o,encoding:s,shouldSplit:!t.readableObjectMode,preserveNewlines:a})},Mse=async(t,e)=>{try{await t}catch{}finally{e.abort()}},YA=({stream:t,onStreamEnd:e,lines:r,encoding:o,stripFinalNewline:s,allMixed:a})=>{let i=new AbortController;Ise(e,i,t);let n=t.readableObjectMode&&!a;return Yk({stream:t,controller:i,binary:o==="buffer",shouldEncode:!n,encoding:o,shouldSplit:!n&&r,preserveNewlines:!s})},Ise=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Yk=({stream:t,controller:e,binary:r,shouldEncode:o,encoding:s,shouldSplit:a,preserveNewlines:i})=>{let n=(0,zk.on)(t,"data",{signal:e.signal,highWaterMark:Hk,highWatermark:Hk});return xse({onStdoutChunk:n,controller:e,binary:r,shouldEncode:o,encoding:s,shouldSplit:a,preserveNewlines:i})},WA=(0,$k.getDefaultHighWaterMark)(!0),Hk=WA,xse=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:o,encoding:s,shouldSplit:a,preserveNewlines:i}){let n=wse({binary:r,shouldEncode:o,encoding:s,shouldSplit:a,preserveNewlines:i});try{for await(let[c]of t)yield*xo(c,n,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*vu(n)}},wse=({binary:t,shouldEncode:e,encoding:r,shouldSplit:o,preserveNewlines:s})=>[Xp(t,r,!e),Kp(t,s,!o,{})].filter(Boolean);var Kk=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:o,buffer:s,maxBuffer:a,lines:i,allMixed:n,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let d=Lse({stream:t,onStreamEnd:e,fdNumber:r,encoding:o,allMixed:n,verboseInfo:u,streamInfo:l});if(!s){await Promise.all([Dse(t),d]);return}let h=AA(c,r),g=YA({stream:t,onStreamEnd:e,lines:i,encoding:o,stripFinalNewline:h,allMixed:n}),[E]=await Promise.all([Use({stream:t,iterable:g,fdNumber:r,encoding:o,maxBuffer:a,lines:i}),d]);return E},Lse=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:o,allMixed:s,verboseInfo:a,streamInfo:{fileDescriptors:i}})=>{if(!Zp({stdioItems:i[r]?.stdioItems,encoding:o,verboseInfo:a,fdNumber:r}))return;let n=YA({stream:t,onStreamEnd:e,lines:!0,encoding:o,stripFinalNewline:!0,allMixed:s});await ik(n,t,r,a)},Dse=async t=>{await(0,Wk.setImmediate)(),t.readableFlowing===null&&t.resume()},Use=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:o,encoding:s,maxBuffer:a,lines:i})=>{try{return e||i?await Bp(r,{maxBuffer:a}):s==="buffer"?new Uint8Array(await Fp(r,{maxBuffer:a})):await Gp(r,{maxBuffer:a})}catch(n){return Xk(tU({error:n,stream:t,readableObjectMode:e,lines:i,encoding:s,fdNumber:o}))}},KA=async t=>{try{return await t}catch(e){return Xk(e)}},Xk=({bufferedData:t})=>Ww(t)?new Uint8Array(t):t;var Qk=require("node:stream/promises"),Cu=async(t,e,r,{isSameDirection:o,stopOnExit:s=!1}={})=>{let a=kse(t,r),i=new AbortController;try{await Promise.race([...s?[r.exitPromise]:[],(0,Qk.finished)(t,{cleanup:!0,signal:i.signal})])}catch(n){a.stdinCleanedUp||Vse(n,e,r,o)}finally{i.abort()}},kse=(t,{originalStreams:[e],subprocess:r})=>{let o={stdinCleanedUp:!1};return t===e&&Bse(t,r,o),o},Bse=(t,e,r)=>{let{_destroy:o}=t;t._destroy=(...s)=>{Fse(e,r),o.call(t,...s)}},Fse=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Vse=(t,e,r,o)=>{if(!Gse(t,e,r,o))throw t},Gse=(t,e,r,o=!0)=>r.propagating?Jk(t)||df(t):(r.propagating=!0,XA(r,e)===o?Jk(t):df(t)),XA=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",df=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Jk=t=>t?.code==="EPIPE";var Zk=({subprocess:t,encoding:e,buffer:r,maxBuffer:o,lines:s,stripFinalNewline:a,verboseInfo:i,streamInfo:n})=>t.stdio.map((c,u)=>JA({stream:c,fdNumber:u,encoding:e,buffer:r[u],maxBuffer:o[u],lines:s[u],allMixed:!1,stripFinalNewline:a,verboseInfo:i,streamInfo:n})),JA=async({stream:t,fdNumber:e,encoding:r,buffer:o,maxBuffer:s,lines:a,allMixed:i,stripFinalNewline:n,verboseInfo:c,streamInfo:u})=>{if(!t)return;let l=Cu(t,e,u);if(XA(u,e)){await l;return}let[d]=await Promise.all([Kk({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:o,maxBuffer:s,lines:a,allMixed:i,stripFinalNewline:n,verboseInfo:c,streamInfo:u}),l]);return d};var eB=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?wo([t,e].filter(Boolean)):void 0,tB=({subprocess:t,encoding:e,buffer:r,maxBuffer:o,lines:s,stripFinalNewline:a,verboseInfo:i,streamInfo:n})=>JA({...qse(t,r),fdNumber:"all",encoding:e,maxBuffer:o[1]+o[2],lines:s[1]||s[2],allMixed:jse(t),stripFinalNewline:a,verboseInfo:i,streamInfo:n}),qse=({stdout:t,stderr:e,all:r},[,o,s])=>{let a=o||s;return a?o?s?{stream:r,buffer:a}:{stream:t,buffer:a}:{stream:e,buffer:a}:{stream:r,buffer:a}},jse=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var sB=require("node:events");var rB=t=>Ws(t,"ipc"),nB=(t,e)=>{let r=lp(t);an({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var iB=async({subprocess:t,buffer:e,maxBuffer:r,ipc:o,ipcOutput:s,verboseInfo:a})=>{if(!o)return s;let i=rB(a),n=di(e,"ipc"),c=di(r,"ipc");for await(let u of IA({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:o,shouldAwait:!1,reference:!0}))n&&(rU(t,s,c),s.push(u)),i&&nB(u,a);return s},oB=async(t,e)=>(await Promise.allSettled([t]),e);var aB=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:o,lines:s,timeoutDuration:a,cancelSignal:i,gracefulCancel:n,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:h,verboseInfo:g,fileDescriptors:E,originalStreams:S,onInternalError:v,controller:O})=>{let I=uk(t,h),j={originalStreams:S,fileDescriptors:E,subprocess:t,exitPromise:I,propagating:!1},A=Zk({subprocess:t,encoding:e,buffer:r,maxBuffer:o,lines:s,stripFinalNewline:u,verboseInfo:g,streamInfo:j}),z=tB({subprocess:t,encoding:e,buffer:r,maxBuffer:o,lines:s,stripFinalNewline:u,verboseInfo:g,streamInfo:j}),H=[],Q=iB({subprocess:t,buffer:r,maxBuffer:o,ipc:l,ipcOutput:H,verboseInfo:g}),oe=Hse(S,t,j),te=zse(E,j);try{return await Promise.race([Promise.all([{},dk(I),Promise.all(A),z,Q,C1(t,d),...oe,...te]),v,$se(t,O),...A1(t,a,h,O),...UD({subprocess:t,cancelSignal:i,gracefulCancel:n,context:h,controller:O}),...T1({subprocess:t,cancelSignal:i,gracefulCancel:n,forceKillAfterDelay:c,context:h,controller:O})])}catch(Z){return h.terminationReason??="other",Promise.all([{error:Z},I,Promise.all(A.map(R=>KA(R))),KA(z),oB(Q,H),Promise.allSettled(oe),Promise.allSettled(te)])}},Hse=(t,e,r)=>t.map((o,s)=>o===e.stdio[s]?void 0:Cu(o,s,r)),zse=(t,e)=>t.flatMap(({stdioItems:r},o)=>r.filter(({value:s,stream:a=s})=>Fr(a,{checkOpen:!1})&&!Ur(a)).map(({type:s,value:a,stream:i=a})=>Cu(i,o,e,{isSameDirection:mr.has(s),stopOnExit:s==="native"}))),$se=async(t,{signal:e})=>{let[r]=await(0,sB.once)(t,"error",{signal:e});throw r};var cB=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Nu=(t,e,r)=>{let o=t[r];o.has(e)||o.set(e,[]);let s=o.get(e),a=cn();return s.push(a),{resolve:a.resolve.bind(a),promises:s}},ua=async({resolve:t,promises:e},r)=>{t();let[o]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!o};var lB=require("node:stream"),dB=require("node:util");var QA=require("node:stream/promises");var ZA=async t=>{if(t!==void 0)try{await eO(t)}catch{}},uB=async t=>{if(t!==void 0)try{await tO(t)}catch{}},eO=async t=>{await(0,QA.finished)(t,{cleanup:!0,readable:!1,writable:!0})},tO=async t=>{await(0,QA.finished)(t,{cleanup:!0,readable:!0,writable:!1})},pf=async(t,e)=>{if(await t,e)throw e},ff=(t,e,r)=>{r&&!df(r)?t.destroy(r):e&&t.destroy()};var pB=({subprocess:t,concurrentStreams:e,encoding:r},{from:o,binary:s=!0,preserveNewlines:a=!0}={})=>{let i=s||nr.has(r),{subprocessStdout:n,waitReadableDestroy:c}=rO(t,o,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=nO(n,i),{read:h,onStdoutDataDone:g}=iO({subprocessStdout:n,subprocess:t,binary:i,encoding:r,preserveNewlines:a}),E=new lB.Readable({read:h,destroy:(0,dB.callbackify)(sO.bind(void 0,{subprocessStdout:n,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return oO({subprocessStdout:n,onStdoutDataDone:g,readable:E,subprocess:t}),E},rO=(t,e,r)=>{let o=ea(t,e),s=Nu(r,o,"readableDestroy");return{subprocessStdout:o,waitReadableDestroy:s}},nO=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},o)=>o?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:WA},iO=({subprocessStdout:t,subprocess:e,binary:r,encoding:o,preserveNewlines:s})=>{let a=cn(),i=lf({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:o,preserveNewlines:s});return{read(){Yse(this,i,a)},onStdoutDataDone:a}},Yse=async(t,e,r)=>{try{let{value:o,done:s}=await e.next();s?r.resolve():t.push(o)}catch{}},oO=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:o,subprocessStdin:s})=>{try{await tO(t),await o,await ZA(s),await e,r.readable&&r.push(null)}catch(a){await ZA(s),fB(r,a)}},sO=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},o)=>{await ua(r,e)&&(fB(t,o),await pf(e,o))},fB=(t,e)=>{ff(t,t.readable,e)};var hB=require("node:stream"),aO=require("node:util");var mB=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:o,waitWritableFinal:s,waitWritableDestroy:a}=cO(t,r,e),i=new hB.Writable({...uO(o,t,s),destroy:(0,aO.callbackify)(dO.bind(void 0,{subprocessStdin:o,subprocess:t,waitWritableFinal:s,waitWritableDestroy:a})),highWaterMark:o.writableHighWaterMark,objectMode:o.writableObjectMode});return lO(o,i),i},cO=(t,e,r)=>{let o=yp(t,e),s=Nu(r,o,"writableFinal"),a=Nu(r,o,"writableDestroy");return{subprocessStdin:o,waitWritableFinal:s,waitWritableDestroy:a}},uO=(t,e,r)=>({write:Wse.bind(void 0,t),final:(0,aO.callbackify)(Kse.bind(void 0,t,e,r))}),Wse=(t,e,r,o)=>{t.write(e,r)?o():t.once("drain",o)},Kse=async(t,e,r)=>{await ua(r,e)&&(t.writable&&t.end(),await e)},lO=async(t,e,r)=>{try{await eO(t),e.writable&&e.end()}catch(o){await uB(r),_B(e,o)}},dO=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:o},s)=>{await ua(r,e),await ua(o,e)&&(_B(t,s),await pf(e,s))},_B=(t,e)=>{ff(t,t.writable,e)};var gB=require("node:stream"),EB=require("node:util");var SB=({subprocess:t,concurrentStreams:e,encoding:r},{from:o,to:s,binary:a=!0,preserveNewlines:i=!0}={})=>{let n=a||nr.has(r),{subprocessStdout:c,waitReadableDestroy:u}=rO(t,o,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:h}=cO(t,s,e),{readableEncoding:g,readableObjectMode:E,readableHighWaterMark:S}=nO(c,n),{read:v,onStdoutDataDone:O}=iO({subprocessStdout:c,subprocess:t,binary:n,encoding:r,preserveNewlines:i}),I=new gB.Duplex({read:v,...uO(l,t,d),destroy:(0,EB.callbackify)(Xse.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:h})),readableHighWaterMark:S,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:E,writableObjectMode:l.writableObjectMode,encoding:g});return oO({subprocessStdout:c,onStdoutDataDone:O,readable:I,subprocess:t,subprocessStdin:l}),lO(l,I,c),I},Xse=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:o,waitWritableFinal:s,waitWritableDestroy:a},i)=>{await Promise.all([sO({subprocessStdout:t,subprocess:r,waitReadableDestroy:o},i),dO({subprocessStdin:e,subprocess:r,waitWritableFinal:s,waitWritableDestroy:a},i)])};var pO=(t,e,{from:r,binary:o=!1,preserveNewlines:s=!1}={})=>{let a=o||nr.has(e),i=ea(t,r),n=lf({subprocessStdout:i,subprocess:t,binary:a,shouldEncode:!0,encoding:e,preserveNewlines:s});return Jse(n,i,t)},Jse=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var TB=(t,{encoding:e})=>{let r=cB();t.readable=pB.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=mB.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=SB.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=pO.bind(void 0,t,e),t[Symbol.asyncIterator]=pO.bind(void 0,t,e,{})};var yB=(t,e)=>{for(let[r,o]of Zse){let s=o.value.bind(e);Reflect.defineProperty(t,r,{...o,value:s})}},Qse=(async()=>{})().constructor.prototype,Zse=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Qse,t)]);var OB=(t,e,r,o)=>{let{file:s,commandArguments:a,command:i,escapedCommand:n,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=eae(t,e,r),{subprocess:h,promise:g}=rae({file:s,commandArguments:a,options:l,startTime:c,verboseInfo:u,command:i,escapedCommand:n,fileDescriptors:d});return h.pipe=uf.bind(void 0,{source:h,sourcePromise:g,boundOptions:{},createNested:o}),yB(h,g),un.set(h,{options:l,fileDescriptors:d}),h},eae=(t,e,r)=>{let{command:o,escapedCommand:s,startTime:a,verboseInfo:i}=pp(t,e,r),{file:n,commandArguments:c,options:u}=wp(t,e,r),l=tae(u),d=bk(l,i);return{file:n,commandArguments:c,command:o,escapedCommand:s,startTime:a,verboseInfo:i,options:l,fileDescriptors:d}},tae=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},rae=({file:t,commandArguments:e,options:r,startTime:o,verboseInfo:s,command:a,escapedCommand:i,fileDescriptors:n})=>{let c;try{c=(0,AB.spawn)(...Lp(t,e,r))}catch(E){return vk({error:E,command:a,escapedCommand:i,fileDescriptors:n,options:r,startTime:o,verboseInfo:s})}let u=new AbortController;(0,vB.setMaxListeners)(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];Ik(c,n,u),Lk(c,r,u);let d={},h=cn();c.kill=wD.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:d,controller:u}),c.all=eB(c,r),TB(c,r),Ek(c,r);let g=nae({subprocess:c,options:r,startTime:o,verboseInfo:s,fileDescriptors:n,originalStreams:l,command:a,escapedCommand:i,context:d,onInternalError:h,controller:u});return{subprocess:c,promise:g}},nae=async({subprocess:t,options:e,startTime:r,verboseInfo:o,fileDescriptors:s,originalStreams:a,command:i,escapedCommand:n,context:c,onInternalError:u,controller:l})=>{let[d,[h,g],E,S,v]=await aB({subprocess:t,options:e,context:c,verboseInfo:o,fileDescriptors:s,originalStreams:a,onInternalError:u,controller:l});l.abort(),u.resolve();let O=E.map((A,z)=>fi(A,e,z)),I=fi(S,e,"all"),j=iae({errorInfo:d,exitCode:h,signal:g,stdio:O,all:I,ipcOutput:v,context:c,options:e,command:i,escapedCommand:n,startTime:r});return ia(j,o,e)},iae=({errorInfo:t,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:a,context:i,options:n,command:c,escapedCommand:u,startTime:l})=>"error"in t?Tu({error:t.error,command:c,escapedCommand:u,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof ln,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:a,options:n,startTime:l,isSync:!1}):jp({command:c,escapedCommand:u,stdio:o,all:s,ipcOutput:a,options:n,startTime:l});var hf=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([o,s])=>[o,oae(o,t[o],s)]));return{...t,...r}},oae=(t,e,r)=>sae.has(t)&&De(e)&&De(r)?{...e,...r}:r,sae=new Set(["env",...xv]);var Gi=(t,e,r,o)=>{let s=(i,n,c)=>Gi(i,n,r,c),a=(...i)=>aae({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:o,createNested:s},...i);return o!==void 0&&o(a,s,e),a},aae=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:o,createNested:s},a,...i)=>{if(De(a))return s(t,hf(r,a),o);let{file:n,commandArguments:c,options:u,isSync:l}=cae({mapArguments:t,firstArgument:a,nextArguments:i,deepOptions:e,boundOptions:r});return l?hk(n,c,u):OB(n,c,u,s)},cae=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:o,boundOptions:s})=>{let a=tL(e)?rL(e,r):[e,...r],[i,n,c]=ep(...a),u=hf(hf(o,s),c),{file:l=i,commandArguments:d=n,options:h=u,isSync:g=!1}=t({file:i,commandArguments:n,options:u});return{file:l,commandArguments:d,options:h,isSync:g}};var bB=({file:t,commandArguments:e})=>PB(t,e),RB=({file:t,commandArguments:e})=>({...PB(t,e),isSync:!0}),PB=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...o]=uae(t);return{file:r,commandArguments:o}},uae=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let o of e.split(lae)){let s=r.at(-1);s&&s.endsWith("\\")?r[r.length-1]=`${s.slice(0,-1)} ${o}`:r.push(o)}return r},lae=/ +/g;var CB=(t,e,r)=>{t.sync=e(dae,r),t.s=t.sync},NB=({options:t})=>MB(t),dae=({options:t})=>({...MB(t),isSync:!0}),MB=t=>({options:{...pae(t),...t}}),pae=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},IB={preferLocal:!0};var xB=Gi(()=>({})),o4e=Gi(()=>({isSync:!0})),s4e=Gi(bB),a4e=Gi(RB),c4e=Gi(O1),u4e=Gi(NB,{},IB,CB),{sendMessage:l4e,getOneMessage:d4e,getEachMessage:p4e,getCancelSignal:f4e}=Sk();b();var jee=J(oZ(),1),Hee=J(wx(),1),zee=J(Ei(),1),bv=J(Bee(),1);yt();var Fee=J(Ei(),1);function w2e(t,e){return new Promise((r,o)=>{let s=setTimeout(()=>{o(new Error(`Operation timed out after ${e} ms`))},e);t.then(r).catch(o).finally(()=>clearTimeout(s))})}var Ov=class extends Fee.PeriodicExportingMetricReader{_alignSeconds=[0,20,40];_intervalSeconds=20;constructor(e){if(super({...e,exportIntervalMillis:e.exportIntervalMillis??2e4}),(e.exportIntervalMillis??2e4)!==2e4)throw new Error("Aligned reader only supports 20-second intervals for 0/20/40 alignment")}onInitialized(){let e=new Date,r=e.getSeconds(),o=e.getMilliseconds(),s=this._alignSeconds.find(n=>n>=r),a;s!==void 0?a=(s-r)*1e3-o:(a=(60-r)*1e3-o,s=0),a=Math.max(0,a);let i=setTimeout(()=>{this._alignedExport(),this._interval=setInterval(()=>{this._alignedExport()},this._intervalSeconds*1e3);let n=this._interval;typeof n!="number"&&n?.unref&&n.unref()},a);typeof i!="number"&&i?.unref&&i.unref()}async _alignedExport(){let e=this._exportTimeout;try{await w2e(this._doCollectAndExport(),e)}catch{}}async _doCollectAndExport(){let e=this._exportTimeout,{resourceMetrics:r,errors:o}=await this.collect({timeoutMillis:e});if(o.length>0,r.resource.asyncAttributesPending)try{await r.resource.waitForAsyncAttributes?.()}catch{}if(r.scopeMetrics.length===0)return;await this._exporter.export(r)}async onShutdown(){let e=this._interval;e&&clearInterval(e),await super.onShutdown()}};var L2e="iflow_cli.proc.end.count",D2e="iflow_cli.proc.start.count",U2e=process.env.NODE_OPTIONS?.includes("--inspect"),k2e=qee.default.resolve(__dirname,"iflow.js"),$ee=[k2e,...process.argv.slice(2)];U2e&&$ee.unshift("--inspect=9230");var Yee=xB(process.argv[0],$ee,{stdio:["inherit","inherit","inherit","ipc"],env:process.env}),Dr=null,Vee=null,jw=null,Xd;async function Gee(){if(Xd)try{await Xd.shutdown()}catch{}process.exit(0)}async function Wee(t,e){if(Dr)try{if(t.add(1,{...JSON.parse(Dr.commonAttributes||"{}"),...e}),Xd)try{let r=fa.getMeterProvider();if("forceFlush"in r)for(let o=0;o<3;o++)try{await r.forceFlush();break}catch{o<2&&await new Promise(a=>setTimeout(a,1e3))}await new Promise(o=>setTimeout(o,1e3))}catch{}}catch{}}Yee.on("message",t=>{if(Dr={otelEndpointUrl:t.OTEL_ENDPOINT_URL,otelServiceName:t.OTEL_SERVICE_NAME,otelServiceVersion:t.OTEL_SERVICE_VERSION,sessionId:t.SESSION_ID,pid:t.PID,version:t.VERSION,commonAttributes:t.COMMON_ATTRIBUTES,checkInterval:2e4},!!Dr){try{if(Dr.otelEndpointUrl&&Dr.otelServiceName){let e=(0,bv.defaultResource)().merge((0,bv.resourceFromAttributes)({[WO]:Dr.otelServiceName,[KO]:Dr.otelServiceVersion,"session.id":Dr.sessionId})),r=[];r.push(new Ov({exporter:new Hee.OTLPMetricExporter({url:`${Dr.otelEndpointUrl}/v1/metrics`,temporalityPreference:zee.AggregationTemporality.DELTA}),exportIntervalMillis:Dr.checkInterval})),Xd=new jee.NodeSDK({resource:e,metricReaders:r}),Xd.start();let o=fa.getMeter(Dr.otelServiceName);Vee=o.createCounter(D2e,{description:"Number of CLI process start"}),jw=o.createCounter(L2e,{description:"Number of CLI process end"})}}catch{}Wee(Vee,{})}});Yee.on("exit",(t,e)=>{if(jw){Wee(jw,{code:t===null?"unknown":String(t),signal:e||"unknown"}).finally(Gee);return}Gee()});
|
|
92
|
+
/*! Bundled license information:
|
|
93
|
+
|
|
94
|
+
@grpc/proto-loader/build/src/util.js:
|
|
95
|
+
@grpc/proto-loader/build/src/index.js:
|
|
96
|
+
(**
|
|
97
|
+
* @license
|
|
98
|
+
* Copyright 2018 gRPC authors.
|
|
99
|
+
*
|
|
100
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
101
|
+
* you may not use this file except in compliance with the License.
|
|
102
|
+
* You may obtain a copy of the License at
|
|
103
|
+
*
|
|
104
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
105
|
+
*
|
|
106
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
107
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
108
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
109
|
+
* See the License for the specific language governing permissions and
|
|
110
|
+
* limitations under the License.
|
|
111
|
+
*
|
|
112
|
+
*)
|
|
113
|
+
|
|
114
|
+
long/umd/index.js:
|
|
115
|
+
(**
|
|
116
|
+
* @license
|
|
117
|
+
* Copyright 2009 The Closure Library Authors
|
|
118
|
+
* Copyright 2020 Daniel Wirtz / The long.js Authors.
|
|
119
|
+
*
|
|
120
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
121
|
+
* you may not use this file except in compliance with the License.
|
|
122
|
+
* You may obtain a copy of the License at
|
|
123
|
+
*
|
|
124
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
125
|
+
*
|
|
126
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
127
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
128
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
129
|
+
* See the License for the specific language governing permissions and
|
|
130
|
+
* limitations under the License.
|
|
131
|
+
*
|
|
132
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
133
|
+
*)
|
|
134
|
+
*/
|