@clinebot/core 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{createRequire as i60}from"node:module";var x60=Object.create;var{getPrototypeOf:b60,defineProperty:sG,getOwnPropertyNames:u60}=Object;var m60=Object.prototype.hasOwnProperty;function g60(Y){return this[Y]}var d60,c60,y6=(Y,Z,W)=>{var H=Y!=null&&typeof Y==="object";if(H){var F=Z?d60??=new WeakMap:c60??=new WeakMap,X=F.get(Y);if(X)return X}W=Y!=null?x60(b60(Y)):{};let J=Z||!Y||!Y.__esModule?sG(W,"default",{value:Y,enumerable:!0}):W;for(let Q of u60(Y))if(!m60.call(J,Q))sG(J,Q,{get:g60.bind(Y,Q),enumerable:!0});if(H)F.set(Y,J);return J};var H0=(Y,Z)=>()=>(Z||Y((Z={exports:{}}).exports,Z),Z.exports);var l60=(Y)=>Y;function n60(Y,Z){this[Y]=l60.bind(null,Z)}var p60=(Y,Z)=>{for(var W in Z)sG(Y,W,{get:Z[W],enumerable:!0,configurable:!0,set:n60.bind(Z,W)})};var n7=(Y,Z)=>()=>(Y&&(Z=Y(Y=0)),Z);var V1=i60(import.meta.url);class fZ{name;metadata;meter;logger;enabled;distinctId;commonProperties;counters=new Map;histograms=new Map;gauges=new Map;gaugeValues=new Map;meterProvider;loggerProvider;constructor(Y){this.name=Y.name??"OpenTelemetryAdapter",this.metadata={...Y.metadata},this.meterProvider=Y.meterProvider,this.loggerProvider=Y.loggerProvider,this.meter=Y.meterProvider?.getMeter("cline")??null,this.logger=Y.loggerProvider?.getLogger("cline")??null,this.enabled=Y.enabled??!0,this.distinctId=Y.distinctId,this.commonProperties=Y.commonProperties?{...Y.commonProperties}:{}}emit(Y,Z){if(!this.isEnabled())return;this.emitLog(Y,Z,!1)}emitRequired(Y,Z){this.emitLog(Y,Z,!0)}recordCounter(Y,Z,W,H,F=!1){if(!this.meter||!F&&!this.isEnabled())return;let X=this.counters.get(Y);if(!X)X=this.meter.createCounter(Y,H?{description:H}:void 0),this.counters.set(Y,X);X.add(Z,this.flattenProperties(this.buildAttributes(W)))}recordHistogram(Y,Z,W,H,F=!1){if(!this.meter||!F&&!this.isEnabled())return;let X=this.histograms.get(Y);if(!X)X=this.meter.createHistogram(Y,H?{description:H}:void 0),this.histograms.set(Y,X);X.record(Z,this.flattenProperties(this.buildAttributes(W)))}recordGauge(Y,Z,W,H,F=!1){if(!this.meter||!F&&!this.isEnabled())return;let X=this.buildAttributes(W),J=JSON.stringify(X),Q=this.gaugeValues.get(Y);if(Z===null){if(Q){if(Q.delete(J),Q.size===0)this.gaugeValues.delete(Y),this.gauges.delete(Y)}return}let G=Q;if(!G)G=new Map,this.gaugeValues.set(Y,G);if(!this.gauges.has(Y)){let q=this.meter.createObservableGauge(Y,H?{description:H}:void 0);q.addCallback((K)=>{for(let V of this.snapshotGaugeSeries(Y))K.observe(V.value,this.flattenProperties(V.attributes))}),this.gauges.set(Y,q)}G.set(J,{value:Z,attributes:X})}isEnabled(){return typeof this.enabled==="function"?this.enabled():this.enabled}setDistinctId(Y){this.distinctId=Y}setCommonProperties(Y){this.commonProperties={...Y}}updateCommonProperties(Y){this.commonProperties={...this.commonProperties,...Y}}async flush(){await Promise.all([this.meterProvider?.forceFlush?.(),this.loggerProvider?.forceFlush?.()])}async dispose(){await Promise.all([this.meterProvider?.shutdown?.(),this.loggerProvider?.shutdown?.()])}emitLog(Y,Z,W){if(!this.logger)return;let H=this.flattenProperties(this.buildAttributes(Z,W));this.logger.emit({severityText:"INFO",body:Y,attributes:H})}buildAttributes(Y,Z=!1){return{...this.commonProperties,...Y,...this.metadata,...this.distinctId?{distinct_id:this.distinctId}:{},...Z?{_required:!0}:{}}}snapshotGaugeSeries(Y){let Z=this.gaugeValues.get(Y);if(!Z)return[];return Array.from(Z.values(),(W)=>({value:W.value,attributes:W.attributes?{...W.attributes}:void 0}))}flattenProperties(Y,Z="",W=new WeakSet,H=0){if(!Y)return{};let F={},X=100,J=10;for(let[Q,G]of Object.entries(Y)){if(Q==="__proto__"||Q==="constructor"||Q==="prototype")continue;let q=Z?`${Z}.${Q}`:Q;if(G===null||G===void 0){F[q]=String(G);continue}if(Array.isArray(G)){let K=G.length>X?G.slice(0,X):G;try{F[q]=JSON.stringify(K)}catch{F[q]="[UnserializableArray]"}if(G.length>X)F[`${q}_truncated`]=!0,F[`${q}_original_length`]=G.length;continue}if(typeof G==="object"){if(G instanceof Date){F[q]=G.toISOString();continue}if(G instanceof Error){F[q]=G.message;continue}if(W.has(G)){F[q]="[Circular]";continue}if(H>=J){F[q]="[MaxDepthExceeded]";continue}W.add(G),Object.assign(F,this.flattenProperties(G,q,W,H+1));continue}if(r60(G)){F[q]=G;continue}try{F[q]=JSON.stringify(G)}catch{F[q]=String(G)}}return F}}function r60(Y){return typeof Y==="string"||typeof Y==="number"||typeof Y==="boolean"}var YF=H0((_O)=>{Object.defineProperty(_O,"__esModule",{value:!0});_O.VERSION=void 0;_O.VERSION="1.9.1"});var dO=H0((mO)=>{Object.defineProperty(mO,"__esModule",{value:!0});mO.isCompatible=mO._makeCompatibilityCheck=void 0;var a60=YF(),bO=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function uO(Y){let Z=new Set([Y]),W=new Set,H=Y.match(bO);if(!H)return()=>!1;let F={major:+H[1],minor:+H[2],patch:+H[3],prerelease:H[4]};if(F.prerelease!=null)return function(G){return G===Y};function X(Q){return W.add(Q),!1}function J(Q){return Z.add(Q),!0}return function(G){if(Z.has(G))return!0;if(W.has(G))return!1;let q=G.match(bO);if(!q)return X(G);let K={major:+q[1],minor:+q[2],patch:+q[3],prerelease:q[4]};if(K.prerelease!=null)return X(G);if(F.major!==K.major)return X(G);if(F.major===0){if(F.minor===K.minor&&F.patch<=K.patch)return J(G);return X(G)}if(F.minor<=K.minor)return J(G);return X(G)}}mO._makeCompatibilityCheck=uO;mO.isCompatible=uO(a60.VERSION)});var h5=H0((cO)=>{Object.defineProperty(cO,"__esModule",{value:!0});cO.unregisterGlobal=cO.getGlobal=cO.registerGlobal=void 0;var p7=YF(),t60=dO(),s60=p7.VERSION.split(".")[0],kZ=Symbol.for(`opentelemetry.js.api.${s60}`),yZ=typeof globalThis==="object"?globalThis:typeof self==="object"?self:typeof window==="object"?window:typeof global==="object"?global:{};function e60(Y,Z,W,H=!1){var F;let X=yZ[kZ]=(F=yZ[kZ])!==null&&F!==void 0?F:{version:p7.VERSION};if(!H&&X[Y]){let J=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${Y}`);return W.error(J.stack||J.message),!1}if(X.version!==p7.VERSION){let J=Error(`@opentelemetry/api: Registration of version v${X.version} for ${Y} does not match previously registered API v${p7.VERSION}`);return W.error(J.stack||J.message),!1}return X[Y]=Z,W.debug(`@opentelemetry/api: Registered a global for ${Y} v${p7.VERSION}.`),!0}cO.registerGlobal=e60;function Y80(Y){var Z,W;let H=(Z=yZ[kZ])===null||Z===void 0?void 0:Z.version;if(!H||!(0,t60.isCompatible)(H))return;return(W=yZ[kZ])===null||W===void 0?void 0:W[Y]}cO.getGlobal=Y80;function Z80(Y,Z){Z.debug(`@opentelemetry/api: Unregistering a global for ${Y} v${p7.VERSION}.`);let W=yZ[kZ];if(W)delete W[Y]}cO.unregisterGlobal=Z80});var rO=H0((pO)=>{Object.defineProperty(pO,"__esModule",{value:!0});pO.DiagComponentLogger=void 0;var J80=h5();class nO{constructor(Y){this._namespace=Y.namespace||"DiagComponentLogger"}debug(...Y){return vZ("debug",this._namespace,Y)}error(...Y){return vZ("error",this._namespace,Y)}info(...Y){return vZ("info",this._namespace,Y)}warn(...Y){return vZ("warn",this._namespace,Y)}verbose(...Y){return vZ("verbose",this._namespace,Y)}}pO.DiagComponentLogger=nO;function vZ(Y,Z,W){let H=(0,J80.getGlobal)("diag");if(!H)return;return H[Y](Z,...W)}});var JJ=H0((aO)=>{Object.defineProperty(aO,"__esModule",{value:!0});aO.DiagLogLevel=void 0;var W80;(function(Y){Y[Y.NONE=0]="NONE",Y[Y.ERROR=30]="ERROR",Y[Y.WARN=50]="WARN",Y[Y.INFO=60]="INFO",Y[Y.DEBUG=70]="DEBUG",Y[Y.VERBOSE=80]="VERBOSE",Y[Y.ALL=9999]="ALL"})(W80=aO.DiagLogLevel||(aO.DiagLogLevel={}))});var sO=H0((oO)=>{Object.defineProperty(oO,"__esModule",{value:!0});oO.createLogLevelDiagLogger=void 0;var D4=JJ();function K80(Y,Z){if(Y<D4.DiagLogLevel.NONE)Y=D4.DiagLogLevel.NONE;else if(Y>D4.DiagLogLevel.ALL)Y=D4.DiagLogLevel.ALL;Z=Z||{};function W(H,F){let X=Z[H];if(typeof X==="function"&&Y>=F)return X.bind(Z);return function(){}}return{error:W("error",D4.DiagLogLevel.ERROR),warn:W("warn",D4.DiagLogLevel.WARN),info:W("info",D4.DiagLogLevel.INFO),debug:W("debug",D4.DiagLogLevel.DEBUG),verbose:W("verbose",D4.DiagLogLevel.VERBOSE)}}oO.createLogLevelDiagLogger=K80});var j5=H0((YD)=>{Object.defineProperty(YD,"__esModule",{value:!0});YD.DiagAPI=void 0;var G80=rO(),F80=sO(),eO=JJ(),WJ=h5(),H80="diag";class QF{static instance(){if(!this._instance)this._instance=new QF;return this._instance}constructor(){function Y(H){return function(...F){let X=(0,WJ.getGlobal)("diag");if(!X)return;return X[H](...F)}}let Z=this,W=(H,F={logLevel:eO.DiagLogLevel.INFO})=>{var X,J,Q;if(H===Z){let K=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return Z.error((X=K.stack)!==null&&X!==void 0?X:K.message),!1}if(typeof F==="number")F={logLevel:F};let G=(0,WJ.getGlobal)("diag"),q=(0,F80.createLogLevelDiagLogger)((J=F.logLevel)!==null&&J!==void 0?J:eO.DiagLogLevel.INFO,H);if(G&&!F.suppressOverrideMessage){let K=(Q=Error().stack)!==null&&Q!==void 0?Q:"<failed to generate stacktrace>";G.warn(`Current logger will be overwritten from ${K}`),q.warn(`Current logger will overwrite one already registered from ${K}`)}return(0,WJ.registerGlobal)("diag",q,Z,!0)};Z.setLogger=W,Z.disable=()=>{(0,WJ.unregisterGlobal)(H80,Z)},Z.createComponentLogger=(H)=>{return new G80.DiagComponentLogger(H)},Z.verbose=Y("verbose"),Z.debug=Y("debug"),Z.info=Y("info"),Z.warn=Y("warn"),Z.error=Y("error")}}YD.DiagAPI=QF});var JD=H0((QD)=>{Object.defineProperty(QD,"__esModule",{value:!0});QD.BaggageImpl=void 0;class i7{constructor(Y){this._entries=Y?new Map(Y):new Map}getEntry(Y){let Z=this._entries.get(Y);if(!Z)return;return Object.assign({},Z)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(Y,Z){let W=new i7(this._entries);return W._entries.set(Y,Z),W}removeEntry(Y){let Z=new i7(this._entries);return Z._entries.delete(Y),Z}removeEntries(...Y){let Z=new i7(this._entries);for(let W of Y)Z._entries.delete(W);return Z}clear(){return new i7}}QD.BaggageImpl=i7});var GD=H0((WD)=>{Object.defineProperty(WD,"__esModule",{value:!0});WD.baggageEntryMetadataSymbol=void 0;WD.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var XF=H0((FD)=>{Object.defineProperty(FD,"__esModule",{value:!0});FD.baggageEntryMetadataFromString=FD.createBaggage=void 0;var V80=j5(),q80=JD(),z80=GD(),B80=V80.DiagAPI.instance();function A80(Y={}){return new q80.BaggageImpl(new Map(Object.entries(Y)))}FD.createBaggage=A80;function U80(Y){if(typeof Y!=="string")B80.error(`Cannot create baggage metadata from unknown type: ${typeof Y}`),Y="";return{__TYPE__:z80.baggageEntryMetadataSymbol,toString(){return Y}}}FD.baggageEntryMetadataFromString=U80});var hZ=H0((VD)=>{Object.defineProperty(VD,"__esModule",{value:!0});VD.ROOT_CONTEXT=VD.createContextKey=void 0;function O80(Y){return Symbol.for(Y)}VD.createContextKey=O80;class KJ{constructor(Y){let Z=this;Z._currentContext=Y?new Map(Y):new Map,Z.getValue=(W)=>Z._currentContext.get(W),Z.setValue=(W,H)=>{let F=new KJ(Z._currentContext);return F._currentContext.set(W,H),F},Z.deleteValue=(W)=>{let H=new KJ(Z._currentContext);return H._currentContext.delete(W),H}}}VD.ROOT_CONTEXT=new KJ});var UD=H0((BD)=>{Object.defineProperty(BD,"__esModule",{value:!0});BD.DiagConsoleLogger=BD._originalConsoleMethods=void 0;var JF=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];BD._originalConsoleMethods={};if(typeof console<"u"){let Y=["error","warn","info","debug","trace","log"];for(let Z of Y)if(typeof console[Z]==="function")BD._originalConsoleMethods[Z]=console[Z]}class zD{constructor(){function Y(Z){return function(...W){let H=BD._originalConsoleMethods[Z];if(typeof H!=="function")H=BD._originalConsoleMethods.log;if(typeof H!=="function"&&console){if(H=console[Z],typeof H!=="function")H=console.log}if(typeof H==="function")return H.apply(console,W)}}for(let Z=0;Z<JF.length;Z++)this[JF[Z].n]=Y(JF[Z].c)}}BD.DiagConsoleLogger=zD});var BF=H0((ND)=>{Object.defineProperty(ND,"__esModule",{value:!0});ND.createNoopMeter=ND.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=ND.NOOP_OBSERVABLE_GAUGE_METRIC=ND.NOOP_OBSERVABLE_COUNTER_METRIC=ND.NOOP_UP_DOWN_COUNTER_METRIC=ND.NOOP_HISTOGRAM_METRIC=ND.NOOP_GAUGE_METRIC=ND.NOOP_COUNTER_METRIC=ND.NOOP_METER=ND.NoopObservableUpDownCounterMetric=ND.NoopObservableGaugeMetric=ND.NoopObservableCounterMetric=ND.NoopObservableMetric=ND.NoopHistogramMetric=ND.NoopGaugeMetric=ND.NoopUpDownCounterMetric=ND.NoopCounterMetric=ND.NoopMetric=ND.NoopMeter=void 0;class WF{constructor(){}createGauge(Y,Z){return ND.NOOP_GAUGE_METRIC}createHistogram(Y,Z){return ND.NOOP_HISTOGRAM_METRIC}createCounter(Y,Z){return ND.NOOP_COUNTER_METRIC}createUpDownCounter(Y,Z){return ND.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(Y,Z){return ND.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(Y,Z){return ND.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(Y,Z){return ND.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(Y,Z){}removeBatchObservableCallback(Y){}}ND.NoopMeter=WF;class r7{}ND.NoopMetric=r7;class KF extends r7{add(Y,Z){}}ND.NoopCounterMetric=KF;class GF extends r7{add(Y,Z){}}ND.NoopUpDownCounterMetric=GF;class FF extends r7{record(Y,Z){}}ND.NoopGaugeMetric=FF;class HF extends r7{record(Y,Z){}}ND.NoopHistogramMetric=HF;class jZ{addCallback(Y){}removeCallback(Y){}}ND.NoopObservableMetric=jZ;class VF extends jZ{}ND.NoopObservableCounterMetric=VF;class qF extends jZ{}ND.NoopObservableGaugeMetric=qF;class zF extends jZ{}ND.NoopObservableUpDownCounterMetric=zF;ND.NOOP_METER=new WF;ND.NOOP_COUNTER_METRIC=new KF;ND.NOOP_GAUGE_METRIC=new FF;ND.NOOP_HISTOGRAM_METRIC=new HF;ND.NOOP_UP_DOWN_COUNTER_METRIC=new GF;ND.NOOP_OBSERVABLE_COUNTER_METRIC=new VF;ND.NOOP_OBSERVABLE_GAUGE_METRIC=new qF;ND.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new zF;function T80(){return ND.NOOP_METER}ND.createNoopMeter=T80});var LD=H0((PD)=>{Object.defineProperty(PD,"__esModule",{value:!0});PD.ValueType=void 0;var f80;(function(Y){Y[Y.INT=0]="INT",Y[Y.DOUBLE=1]="DOUBLE"})(f80=PD.ValueType||(PD.ValueType={}))});var UF=H0((wD)=>{Object.defineProperty(wD,"__esModule",{value:!0});wD.defaultTextMapSetter=wD.defaultTextMapGetter=void 0;wD.defaultTextMapGetter={get(Y,Z){if(Y==null)return;return Y[Z]},keys(Y){if(Y==null)return[];return Object.keys(Y)}};wD.defaultTextMapSetter={set(Y,Z,W){if(Y==null)return;Y[Z]=W}}});var vD=H0((kD)=>{Object.defineProperty(kD,"__esModule",{value:!0});kD.NoopContextManager=void 0;var y80=hZ();class fD{active(){return y80.ROOT_CONTEXT}with(Y,Z,W,...H){return Z.call(W,...H)}bind(Y,Z){return Z}enable(){return this}disable(){return this}}kD.NoopContextManager=fD});var _Z=H0((jD)=>{Object.defineProperty(jD,"__esModule",{value:!0});jD.ContextAPI=void 0;var v80=vD(),NF=h5(),hD=j5(),OF="context",h80=new v80.NoopContextManager;class DF{constructor(){}static getInstance(){if(!this._instance)this._instance=new DF;return this._instance}setGlobalContextManager(Y){return(0,NF.registerGlobal)(OF,Y,hD.DiagAPI.instance())}active(){return this._getContextManager().active()}with(Y,Z,W,...H){return this._getContextManager().with(Y,Z,W,...H)}bind(Y,Z){return this._getContextManager().bind(Y,Z)}_getContextManager(){return(0,NF.getGlobal)(OF)||h80}disable(){this._getContextManager().disable(),(0,NF.unregisterGlobal)(OF,hD.DiagAPI.instance())}}jD.ContextAPI=DF});var IF=H0((xD)=>{Object.defineProperty(xD,"__esModule",{value:!0});xD.TraceFlags=void 0;var j80;(function(Y){Y[Y.NONE=0]="NONE",Y[Y.SAMPLED=1]="SAMPLED"})(j80=xD.TraceFlags||(xD.TraceFlags={}))});var FJ=H0((bD)=>{Object.defineProperty(bD,"__esModule",{value:!0});bD.INVALID_SPAN_CONTEXT=bD.INVALID_TRACEID=bD.INVALID_SPANID=void 0;var _80=IF();bD.INVALID_SPANID="0000000000000000";bD.INVALID_TRACEID="00000000000000000000000000000000";bD.INVALID_SPAN_CONTEXT={traceId:bD.INVALID_TRACEID,spanId:bD.INVALID_SPANID,traceFlags:_80.TraceFlags.NONE}});var HJ=H0((cD)=>{Object.defineProperty(cD,"__esModule",{value:!0});cD.NonRecordingSpan=void 0;var x80=FJ();class dD{constructor(Y=x80.INVALID_SPAN_CONTEXT){this._spanContext=Y}spanContext(){return this._spanContext}setAttribute(Y,Z){return this}setAttributes(Y){return this}addEvent(Y,Z){return this}addLink(Y){return this}addLinks(Y){return this}setStatus(Y){return this}updateName(Y){return this}end(Y){}isRecording(){return!1}recordException(Y,Z){}}cD.NonRecordingSpan=dD});var EF=H0((pD)=>{Object.defineProperty(pD,"__esModule",{value:!0});pD.getSpanContext=pD.setSpanContext=pD.deleteSpan=pD.setSpan=pD.getActiveSpan=pD.getSpan=void 0;var b80=hZ(),u80=HJ(),m80=_Z(),$F=(0,b80.createContextKey)("OpenTelemetry Context Key SPAN");function CF(Y){return Y.getValue($F)||void 0}pD.getSpan=CF;function g80(){return CF(m80.ContextAPI.getInstance().active())}pD.getActiveSpan=g80;function nD(Y,Z){return Y.setValue($F,Z)}pD.setSpan=nD;function d80(Y){return Y.deleteValue($F)}pD.deleteSpan=d80;function c80(Y,Z){return nD(Y,new u80.NonRecordingSpan(Z))}pD.setSpanContext=c80;function l80(Y){var Z;return(Z=CF(Y))===null||Z===void 0?void 0:Z.spanContext()}pD.getSpanContext=l80});var qJ=H0((sD)=>{Object.defineProperty(sD,"__esModule",{value:!0});sD.wrapSpanContext=sD.isSpanContextValid=sD.isValidSpanId=sD.isValidTraceId=void 0;var rD=FJ(),o80=HJ(),VJ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function aD(Y,Z){if(typeof Y!=="string"||Y.length!==Z)return!1;let W=0;for(let H=0;H<Y.length;H+=4)W+=(VJ[Y.charCodeAt(H)]|0)+(VJ[Y.charCodeAt(H+1)]|0)+(VJ[Y.charCodeAt(H+2)]|0)+(VJ[Y.charCodeAt(H+3)]|0);return W===Z}function oD(Y){return aD(Y,32)&&Y!==rD.INVALID_TRACEID}sD.isValidTraceId=oD;function tD(Y){return aD(Y,16)&&Y!==rD.INVALID_SPANID}sD.isValidSpanId=tD;function t80(Y){return oD(Y.traceId)&&tD(Y.spanId)}sD.isSpanContextValid=t80;function s80(Y){return new o80.NonRecordingSpan(Y)}sD.wrapSpanContext=s80});var PF=H0((QT)=>{Object.defineProperty(QT,"__esModule",{value:!0});QT.NoopTracer=void 0;var Q90=_Z(),YT=EF(),MF=HJ(),X90=qJ(),RF=Q90.ContextAPI.getInstance();class ZT{startSpan(Y,Z,W=RF.active()){if(Boolean(Z===null||Z===void 0?void 0:Z.root))return new MF.NonRecordingSpan;let F=W&&(0,YT.getSpanContext)(W);if(J90(F)&&(0,X90.isSpanContextValid)(F))return new MF.NonRecordingSpan(F);else return new MF.NonRecordingSpan}startActiveSpan(Y,Z,W,H){let F,X,J;if(arguments.length<2)return;else if(arguments.length===2)J=Z;else if(arguments.length===3)F=Z,J=W;else F=Z,X=W,J=H;let Q=X!==null&&X!==void 0?X:RF.active(),G=this.startSpan(Y,F,Q),q=(0,YT.setSpan)(Q,G);return RF.with(q,J,void 0,G)}}QT.NoopTracer=ZT;function J90(Y){return Y!==null&&typeof Y==="object"&&"spanId"in Y&&typeof Y.spanId==="string"&&"traceId"in Y&&typeof Y.traceId==="string"&&"traceFlags"in Y&&typeof Y.traceFlags==="number"}});var LF=H0((WT)=>{Object.defineProperty(WT,"__esModule",{value:!0});WT.ProxyTracer=void 0;var W90=PF(),K90=new W90.NoopTracer;class JT{constructor(Y,Z,W,H){this._provider=Y,this.name=Z,this.version=W,this.options=H}startSpan(Y,Z,W){return this._getTracer().startSpan(Y,Z,W)}startActiveSpan(Y,Z,W,H){let F=this._getTracer();return Reflect.apply(F.startActiveSpan,F,arguments)}_getTracer(){if(this._delegate)return this._delegate;let Y=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!Y)return K90;return this._delegate=Y,this._delegate}}WT.ProxyTracer=JT});var VT=H0((FT)=>{Object.defineProperty(FT,"__esModule",{value:!0});FT.NoopTracerProvider=void 0;var G90=PF();class GT{getTracer(Y,Z,W){return new G90.NoopTracer}}FT.NoopTracerProvider=GT});var wF=H0((zT)=>{Object.defineProperty(zT,"__esModule",{value:!0});zT.ProxyTracerProvider=void 0;var F90=LF(),H90=VT(),V90=new H90.NoopTracerProvider;class qT{getTracer(Y,Z,W){var H;return(H=this.getDelegateTracer(Y,Z,W))!==null&&H!==void 0?H:new F90.ProxyTracer(this,Y,Z,W)}getDelegate(){var Y;return(Y=this._delegate)!==null&&Y!==void 0?Y:V90}setDelegate(Y){this._delegate=Y}getDelegateTracer(Y,Z,W){var H;return(H=this._delegate)===null||H===void 0?void 0:H.getTracer(Y,Z,W)}}zT.ProxyTracerProvider=qT});var UT=H0((AT)=>{Object.defineProperty(AT,"__esModule",{value:!0});AT.SamplingDecision=void 0;var q90;(function(Y){Y[Y.NOT_RECORD=0]="NOT_RECORD",Y[Y.RECORD=1]="RECORD",Y[Y.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(q90=AT.SamplingDecision||(AT.SamplingDecision={}))});var OT=H0((NT)=>{Object.defineProperty(NT,"__esModule",{value:!0});NT.SpanKind=void 0;var z90;(function(Y){Y[Y.INTERNAL=0]="INTERNAL",Y[Y.SERVER=1]="SERVER",Y[Y.CLIENT=2]="CLIENT",Y[Y.PRODUCER=3]="PRODUCER",Y[Y.CONSUMER=4]="CONSUMER"})(z90=NT.SpanKind||(NT.SpanKind={}))});var TT=H0((DT)=>{Object.defineProperty(DT,"__esModule",{value:!0});DT.SpanStatusCode=void 0;var B90;(function(Y){Y[Y.UNSET=0]="UNSET",Y[Y.OK=1]="OK",Y[Y.ERROR=2]="ERROR"})(B90=DT.SpanStatusCode||(DT.SpanStatusCode={}))});var CT=H0((IT)=>{Object.defineProperty(IT,"__esModule",{value:!0});IT.validateValue=IT.validateKey=void 0;var yF="[_0-9a-z-*/]",A90=`[a-z]${yF}{0,255}`,U90=`[a-z0-9]${yF}{0,240}@[a-z]${yF}{0,13}`,N90=new RegExp(`^(?:${A90}|${U90})$`),O90=/^[ -~]{0,255}[!-~]$/,D90=/,|=/;function T90(Y){return N90.test(Y)}IT.validateKey=T90;function I90(Y){return O90.test(Y)&&!D90.test(Y)}IT.validateValue=I90});var ST=H0((LT)=>{Object.defineProperty(LT,"__esModule",{value:!0});LT.TraceStateImpl=void 0;var ET=CT(),MT=32,C90=512,RT=",",PT="=";class vF{constructor(Y){if(this._internalState=new Map,Y)this._parse(Y)}set(Y,Z){let W=this._clone();if(W._internalState.has(Y))W._internalState.delete(Y);return W._internalState.set(Y,Z),W}unset(Y){let Z=this._clone();return Z._internalState.delete(Y),Z}get(Y){return this._internalState.get(Y)}serialize(){return Array.from(this._internalState.keys()).reduceRight((Y,Z)=>{return Y.push(Z+PT+this.get(Z)),Y},[]).join(RT)}_parse(Y){if(Y.length>C90)return;if(this._internalState=Y.split(RT).reduceRight((Z,W)=>{let H=W.trim(),F=H.indexOf(PT);if(F!==-1){let X=H.slice(0,F),J=H.slice(F+1,W.length);if((0,ET.validateKey)(X)&&(0,ET.validateValue)(J))Z.set(X,J)}return Z},new Map),this._internalState.size>MT)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,MT))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let Y=new vF;return Y._internalState=new Map(this._internalState),Y}}LT.TraceStateImpl=vF});var yT=H0((fT)=>{Object.defineProperty(fT,"__esModule",{value:!0});fT.createTraceState=void 0;var E90=ST();function M90(Y){return new E90.TraceStateImpl(Y)}fT.createTraceState=M90});var jT=H0((vT)=>{Object.defineProperty(vT,"__esModule",{value:!0});vT.context=void 0;var R90=_Z();vT.context=R90.ContextAPI.getInstance()});var bT=H0((_T)=>{Object.defineProperty(_T,"__esModule",{value:!0});_T.diag=void 0;var P90=j5();_T.diag=P90.DiagAPI.instance()});var gT=H0((uT)=>{Object.defineProperty(uT,"__esModule",{value:!0});uT.NOOP_METER_PROVIDER=uT.NoopMeterProvider=void 0;var L90=BF();class hF{getMeter(Y,Z,W){return L90.NOOP_METER}}uT.NoopMeterProvider=hF;uT.NOOP_METER_PROVIDER=new hF});var nT=H0((cT)=>{Object.defineProperty(cT,"__esModule",{value:!0});cT.MetricsAPI=void 0;var S90=gT(),jF=h5(),dT=j5(),_F="metrics";class xF{constructor(){}static getInstance(){if(!this._instance)this._instance=new xF;return this._instance}setGlobalMeterProvider(Y){return(0,jF.registerGlobal)(_F,Y,dT.DiagAPI.instance())}getMeterProvider(){return(0,jF.getGlobal)(_F)||S90.NOOP_METER_PROVIDER}getMeter(Y,Z,W){return this.getMeterProvider().getMeter(Y,Z,W)}disable(){(0,jF.unregisterGlobal)(_F,dT.DiagAPI.instance())}}cT.MetricsAPI=xF});var rT=H0((pT)=>{Object.defineProperty(pT,"__esModule",{value:!0});pT.metrics=void 0;var f90=nT();pT.metrics=f90.MetricsAPI.getInstance()});var sT=H0((oT)=>{Object.defineProperty(oT,"__esModule",{value:!0});oT.NoopTextMapPropagator=void 0;class aT{inject(Y,Z){}extract(Y,Z){return Y}fields(){return[]}}oT.NoopTextMapPropagator=aT});var QI=H0((YI)=>{Object.defineProperty(YI,"__esModule",{value:!0});YI.deleteBaggage=YI.setBaggage=YI.getActiveBaggage=YI.getBaggage=void 0;var k90=_Z(),y90=hZ(),bF=(0,y90.createContextKey)("OpenTelemetry Baggage Key");function eT(Y){return Y.getValue(bF)||void 0}YI.getBaggage=eT;function v90(){return eT(k90.ContextAPI.getInstance().active())}YI.getActiveBaggage=v90;function h90(Y,Z){return Y.setValue(bF,Z)}YI.setBaggage=h90;function j90(Y){return Y.deleteValue(bF)}YI.deleteBaggage=j90});var GI=H0((WI)=>{Object.defineProperty(WI,"__esModule",{value:!0});WI.PropagationAPI=void 0;var uF=h5(),u90=sT(),XI=UF(),zJ=QI(),m90=XF(),JI=j5(),mF="propagation",g90=new u90.NoopTextMapPropagator;class gF{constructor(){this.createBaggage=m90.createBaggage,this.getBaggage=zJ.getBaggage,this.getActiveBaggage=zJ.getActiveBaggage,this.setBaggage=zJ.setBaggage,this.deleteBaggage=zJ.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new gF;return this._instance}setGlobalPropagator(Y){return(0,uF.registerGlobal)(mF,Y,JI.DiagAPI.instance())}inject(Y,Z,W=XI.defaultTextMapSetter){return this._getGlobalPropagator().inject(Y,Z,W)}extract(Y,Z,W=XI.defaultTextMapGetter){return this._getGlobalPropagator().extract(Y,Z,W)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,uF.unregisterGlobal)(mF,JI.DiagAPI.instance())}_getGlobalPropagator(){return(0,uF.getGlobal)(mF)||g90}}WI.PropagationAPI=gF});var VI=H0((FI)=>{Object.defineProperty(FI,"__esModule",{value:!0});FI.propagation=void 0;var d90=GI();FI.propagation=d90.PropagationAPI.getInstance()});var NI=H0((AI)=>{Object.defineProperty(AI,"__esModule",{value:!0});AI.TraceAPI=void 0;var dF=h5(),qI=wF(),zI=qJ(),a7=EF(),BI=j5(),cF="trace";class lF{constructor(){this._proxyTracerProvider=new qI.ProxyTracerProvider,this.wrapSpanContext=zI.wrapSpanContext,this.isSpanContextValid=zI.isSpanContextValid,this.deleteSpan=a7.deleteSpan,this.getSpan=a7.getSpan,this.getActiveSpan=a7.getActiveSpan,this.getSpanContext=a7.getSpanContext,this.setSpan=a7.setSpan,this.setSpanContext=a7.setSpanContext}static getInstance(){if(!this._instance)this._instance=new lF;return this._instance}setGlobalTracerProvider(Y){let Z=(0,dF.registerGlobal)(cF,this._proxyTracerProvider,BI.DiagAPI.instance());if(Z)this._proxyTracerProvider.setDelegate(Y);return Z}getTracerProvider(){return(0,dF.getGlobal)(cF)||this._proxyTracerProvider}getTracer(Y,Z){return this.getTracerProvider().getTracer(Y,Z)}disable(){(0,dF.unregisterGlobal)(cF,BI.DiagAPI.instance()),this._proxyTracerProvider=new qI.ProxyTracerProvider}}AI.TraceAPI=lF});var TI=H0((OI)=>{Object.defineProperty(OI,"__esModule",{value:!0});OI.trace=void 0;var c90=NI();OI.trace=c90.TraceAPI.getInstance()});var f1=H0((N6)=>{Object.defineProperty(N6,"__esModule",{value:!0});N6.trace=N6.propagation=N6.metrics=N6.diag=N6.context=N6.INVALID_SPAN_CONTEXT=N6.INVALID_TRACEID=N6.INVALID_SPANID=N6.isValidSpanId=N6.isValidTraceId=N6.isSpanContextValid=N6.createTraceState=N6.TraceFlags=N6.SpanStatusCode=N6.SpanKind=N6.SamplingDecision=N6.ProxyTracerProvider=N6.ProxyTracer=N6.defaultTextMapSetter=N6.defaultTextMapGetter=N6.ValueType=N6.createNoopMeter=N6.DiagLogLevel=N6.DiagConsoleLogger=N6.ROOT_CONTEXT=N6.createContextKey=N6.baggageEntryMetadataFromString=void 0;var l90=XF();Object.defineProperty(N6,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return l90.baggageEntryMetadataFromString}});var II=hZ();Object.defineProperty(N6,"createContextKey",{enumerable:!0,get:function(){return II.createContextKey}});Object.defineProperty(N6,"ROOT_CONTEXT",{enumerable:!0,get:function(){return II.ROOT_CONTEXT}});var n90=UD();Object.defineProperty(N6,"DiagConsoleLogger",{enumerable:!0,get:function(){return n90.DiagConsoleLogger}});var p90=JJ();Object.defineProperty(N6,"DiagLogLevel",{enumerable:!0,get:function(){return p90.DiagLogLevel}});var i90=BF();Object.defineProperty(N6,"createNoopMeter",{enumerable:!0,get:function(){return i90.createNoopMeter}});var r90=LD();Object.defineProperty(N6,"ValueType",{enumerable:!0,get:function(){return r90.ValueType}});var $I=UF();Object.defineProperty(N6,"defaultTextMapGetter",{enumerable:!0,get:function(){return $I.defaultTextMapGetter}});Object.defineProperty(N6,"defaultTextMapSetter",{enumerable:!0,get:function(){return $I.defaultTextMapSetter}});var a90=LF();Object.defineProperty(N6,"ProxyTracer",{enumerable:!0,get:function(){return a90.ProxyTracer}});var o90=wF();Object.defineProperty(N6,"ProxyTracerProvider",{enumerable:!0,get:function(){return o90.ProxyTracerProvider}});var t90=UT();Object.defineProperty(N6,"SamplingDecision",{enumerable:!0,get:function(){return t90.SamplingDecision}});var s90=OT();Object.defineProperty(N6,"SpanKind",{enumerable:!0,get:function(){return s90.SpanKind}});var e90=TT();Object.defineProperty(N6,"SpanStatusCode",{enumerable:!0,get:function(){return e90.SpanStatusCode}});var Y40=IF();Object.defineProperty(N6,"TraceFlags",{enumerable:!0,get:function(){return Y40.TraceFlags}});var Z40=yT();Object.defineProperty(N6,"createTraceState",{enumerable:!0,get:function(){return Z40.createTraceState}});var nF=qJ();Object.defineProperty(N6,"isSpanContextValid",{enumerable:!0,get:function(){return nF.isSpanContextValid}});Object.defineProperty(N6,"isValidTraceId",{enumerable:!0,get:function(){return nF.isValidTraceId}});Object.defineProperty(N6,"isValidSpanId",{enumerable:!0,get:function(){return nF.isValidSpanId}});var pF=FJ();Object.defineProperty(N6,"INVALID_SPANID",{enumerable:!0,get:function(){return pF.INVALID_SPANID}});Object.defineProperty(N6,"INVALID_TRACEID",{enumerable:!0,get:function(){return pF.INVALID_TRACEID}});Object.defineProperty(N6,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return pF.INVALID_SPAN_CONTEXT}});var CI=jT();Object.defineProperty(N6,"context",{enumerable:!0,get:function(){return CI.context}});var EI=bT();Object.defineProperty(N6,"diag",{enumerable:!0,get:function(){return EI.diag}});var MI=rT();Object.defineProperty(N6,"metrics",{enumerable:!0,get:function(){return MI.metrics}});var RI=VI();Object.defineProperty(N6,"propagation",{enumerable:!0,get:function(){return RI.propagation}});var PI=TI();Object.defineProperty(N6,"trace",{enumerable:!0,get:function(){return PI.trace}});N6.default={context:CI.context,diag:EI.diag,metrics:MI.metrics,propagation:RI.propagation,trace:PI.trace}});var wI=H0((LI)=>{Object.defineProperty(LI,"__esModule",{value:!0});LI.SeverityNumber=void 0;var J40;(function(Y){Y[Y.UNSPECIFIED=0]="UNSPECIFIED",Y[Y.TRACE=1]="TRACE",Y[Y.TRACE2=2]="TRACE2",Y[Y.TRACE3=3]="TRACE3",Y[Y.TRACE4=4]="TRACE4",Y[Y.DEBUG=5]="DEBUG",Y[Y.DEBUG2=6]="DEBUG2",Y[Y.DEBUG3=7]="DEBUG3",Y[Y.DEBUG4=8]="DEBUG4",Y[Y.INFO=9]="INFO",Y[Y.INFO2=10]="INFO2",Y[Y.INFO3=11]="INFO3",Y[Y.INFO4=12]="INFO4",Y[Y.WARN=13]="WARN",Y[Y.WARN2=14]="WARN2",Y[Y.WARN3=15]="WARN3",Y[Y.WARN4=16]="WARN4",Y[Y.ERROR=17]="ERROR",Y[Y.ERROR2=18]="ERROR2",Y[Y.ERROR3=19]="ERROR3",Y[Y.ERROR4=20]="ERROR4",Y[Y.FATAL=21]="FATAL",Y[Y.FATAL2=22]="FATAL2",Y[Y.FATAL3=23]="FATAL3",Y[Y.FATAL4=24]="FATAL4"})(J40=LI.SeverityNumber||(LI.SeverityNumber={}))});var BJ=H0((SI)=>{Object.defineProperty(SI,"__esModule",{value:!0});SI.NOOP_LOGGER=SI.NoopLogger=void 0;class rF{emit(Y){}}SI.NoopLogger=rF;SI.NOOP_LOGGER=new rF});var vI=H0((kI)=>{Object.defineProperty(kI,"__esModule",{value:!0});kI.API_BACKWARDS_COMPATIBILITY_VERSION=kI.makeGetter=kI._global=kI.GLOBAL_LOGS_API_KEY=void 0;kI.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");kI._global=globalThis;function K40(Y,Z,W){return(H)=>H===Y?Z:W}kI.makeGetter=K40;kI.API_BACKWARDS_COMPATIBILITY_VERSION=1});var oF=H0((hI)=>{Object.defineProperty(hI,"__esModule",{value:!0});hI.NOOP_LOGGER_PROVIDER=hI.NoopLoggerProvider=void 0;var V40=BJ();class aF{getLogger(Y,Z,W){return new V40.NoopLogger}}hI.NoopLoggerProvider=aF;hI.NOOP_LOGGER_PROVIDER=new aF});var uI=H0((xI)=>{Object.defineProperty(xI,"__esModule",{value:!0});xI.ProxyLogger=void 0;var z40=BJ();class _I{constructor(Y,Z,W,H){this._provider=Y,this.name=Z,this.version=W,this.options=H}emit(Y){this._getLogger().emit(Y)}_getLogger(){if(this._delegate)return this._delegate;let Y=this._provider._getDelegateLogger(this.name,this.version,this.options);if(!Y)return z40.NOOP_LOGGER;return this._delegate=Y,this._delegate}}xI.ProxyLogger=_I});var cI=H0((gI)=>{Object.defineProperty(gI,"__esModule",{value:!0});gI.ProxyLoggerProvider=void 0;var B40=oF(),A40=uI();class mI{getLogger(Y,Z,W){var H;return(H=this._getDelegateLogger(Y,Z,W))!==null&&H!==void 0?H:new A40.ProxyLogger(this,Y,Z,W)}_getDelegate(){var Y;return(Y=this._delegate)!==null&&Y!==void 0?Y:B40.NOOP_LOGGER_PROVIDER}_setDelegate(Y){this._delegate=Y}_getDelegateLogger(Y,Z,W){var H;return(H=this._delegate)===null||H===void 0?void 0:H.getLogger(Y,Z,W)}}gI.ProxyLoggerProvider=mI});var iI=H0((nI)=>{Object.defineProperty(nI,"__esModule",{value:!0});nI.LogsAPI=void 0;var Q9=vI(),U40=oF(),lI=cI();class tF{constructor(){this._proxyLoggerProvider=new lI.ProxyLoggerProvider}static getInstance(){if(!this._instance)this._instance=new tF;return this._instance}setGlobalLoggerProvider(Y){if(Q9._global[Q9.GLOBAL_LOGS_API_KEY])return this.getLoggerProvider();return Q9._global[Q9.GLOBAL_LOGS_API_KEY]=(0,Q9.makeGetter)(Q9.API_BACKWARDS_COMPATIBILITY_VERSION,Y,U40.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(Y),Y}getLoggerProvider(){var Y,Z;return(Z=(Y=Q9._global[Q9.GLOBAL_LOGS_API_KEY])===null||Y===void 0?void 0:Y.call(Q9._global,Q9.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&Z!==void 0?Z:this._proxyLoggerProvider}getLogger(Y,Z,W){return this.getLoggerProvider().getLogger(Y,Z,W)}disable(){delete Q9._global[Q9.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new lI.ProxyLoggerProvider}}nI.LogsAPI=tF});var o7=H0((xZ)=>{Object.defineProperty(xZ,"__esModule",{value:!0});xZ.logs=xZ.NoopLogger=xZ.NOOP_LOGGER=xZ.SeverityNumber=void 0;var N40=wI();Object.defineProperty(xZ,"SeverityNumber",{enumerable:!0,get:function(){return N40.SeverityNumber}});var rI=BJ();Object.defineProperty(xZ,"NOOP_LOGGER",{enumerable:!0,get:function(){return rI.NOOP_LOGGER}});Object.defineProperty(xZ,"NoopLogger",{enumerable:!0,get:function(){return rI.NoopLogger}});var O40=iI();xZ.logs=O40.LogsAPI.getInstance()});var eI=H0((tI)=>{Object.defineProperty(tI,"__esModule",{value:!0});tI.OTLPExporterBase=void 0;class oI{_delegate;constructor(Y){this._delegate=Y}export(Y,Z){this._delegate.export(Y,Z)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}tI.OTLPExporterBase=oI});var AJ=H0((Z$)=>{Object.defineProperty(Z$,"__esModule",{value:!0});Z$.OTLPExporterError=void 0;class Y$ extends Error{code;name="OTLPExporterError";data;constructor(Y,Z,W){super(Y);this.data=W,this.code=Z}}Z$.OTLPExporterError=Y$});var bZ=H0((J$)=>{Object.defineProperty(J$,"__esModule",{value:!0});J$.getSharedConfigurationDefaults=J$.mergeOtlpSharedConfigurationWithDefaults=J$.wrapStaticHeadersInFunction=J$.validateTimeoutMillis=void 0;function X$(Y){if(Number.isFinite(Y)&&Y>0)return Y;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${Y}')`)}J$.validateTimeoutMillis=X$;function D40(Y){if(Y==null)return;return async()=>Y}J$.wrapStaticHeadersInFunction=D40;function T40(Y,Z,W){return{timeoutMillis:X$(Y.timeoutMillis??Z.timeoutMillis??W.timeoutMillis),concurrencyLimit:Y.concurrencyLimit??Z.concurrencyLimit??W.concurrencyLimit,compression:Y.compression??Z.compression??W.compression}}J$.mergeOtlpSharedConfigurationWithDefaults=T40;function I40(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}J$.getSharedConfigurationDefaults=I40});var G$=H0((K$)=>{Object.defineProperty(K$,"__esModule",{value:!0});K$.CompressionAlgorithm=void 0;var M40;(function(Y){Y.NONE="none",Y.GZIP="gzip"})(M40=K$.CompressionAlgorithm||(K$.CompressionAlgorithm={}))});var eF=H0((H$)=>{Object.defineProperty(H$,"__esModule",{value:!0});H$.createBoundedQueueExportPromiseHandler=void 0;class F${_concurrencyLimit;_sendingPromises=[];constructor(Y){this._concurrencyLimit=Y}pushPromise(Y){if(this.hasReachedLimit())throw Error("Concurrency Limit reached");this._sendingPromises.push(Y);let Z=()=>{let W=this._sendingPromises.indexOf(Y);this._sendingPromises.splice(W,1)};Y.then(Z,Z)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function R40(Y){return new F$(Y.concurrencyLimit)}H$.createBoundedQueueExportPromiseHandler=R40});var uZ=H0((q$)=>{Object.defineProperty(q$,"__esModule",{value:!0});q$.isTracingSuppressed=q$.unsuppressTracing=q$.suppressTracing=void 0;var P40=f1(),YH=(0,P40.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function L40(Y){return Y.setValue(YH,!0)}q$.suppressTracing=L40;function w40(Y){return Y.deleteValue(YH)}q$.unsuppressTracing=w40;function S40(Y){return Y.getValue(YH)===!0}q$.isTracingSuppressed=S40});var ZH=H0((B$)=>{Object.defineProperty(B$,"__esModule",{value:!0});B$.BAGGAGE_MAX_TOTAL_LENGTH=B$.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=B$.BAGGAGE_MAX_NAME_VALUE_PAIRS=B$.BAGGAGE_HEADER=B$.BAGGAGE_ITEMS_SEPARATOR=B$.BAGGAGE_PROPERTIES_SEPARATOR=B$.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;B$.BAGGAGE_KEY_PAIR_SEPARATOR="=";B$.BAGGAGE_PROPERTIES_SEPARATOR=";";B$.BAGGAGE_ITEMS_SEPARATOR=",";B$.BAGGAGE_HEADER="baggage";B$.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;B$.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;B$.BAGGAGE_MAX_TOTAL_LENGTH=8192});var QH=H0((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});N$.parseKeyPairsIntoRecord=N$.parsePairKeyValue=N$.getKeyPairs=N$.serializeKeyPairs=void 0;var b40=f1(),t7=ZH();function u40(Y){return Y.reduce((Z,W)=>{let H=`${Z}${Z!==""?t7.BAGGAGE_ITEMS_SEPARATOR:""}${W}`;return H.length>t7.BAGGAGE_MAX_TOTAL_LENGTH?Z:H},"")}N$.serializeKeyPairs=u40;function m40(Y){return Y.getAllEntries().map(([Z,W])=>{let H=`${encodeURIComponent(Z)}=${encodeURIComponent(W.value)}`;if(W.metadata!==void 0)H+=t7.BAGGAGE_PROPERTIES_SEPARATOR+W.metadata.toString();return H})}N$.getKeyPairs=m40;function U$(Y){if(!Y)return;let Z=Y.indexOf(t7.BAGGAGE_PROPERTIES_SEPARATOR),W=Z===-1?Y:Y.substring(0,Z),H=W.indexOf(t7.BAGGAGE_KEY_PAIR_SEPARATOR);if(H<=0)return;let F=W.substring(0,H).trim(),X=W.substring(H+1).trim();if(!F||!X)return;let J,Q;try{J=decodeURIComponent(F),Q=decodeURIComponent(X)}catch{return}let G;if(Z!==-1&&Z<Y.length-1){let q=Y.substring(Z+1);G=(0,b40.baggageEntryMetadataFromString)(q)}return{key:J,value:Q,metadata:G}}N$.parsePairKeyValue=U$;function g40(Y){let Z={};if(typeof Y==="string"&&Y.length>0)Y.split(t7.BAGGAGE_ITEMS_SEPARATOR).forEach((W)=>{let H=U$(W);if(H!==void 0&&H.value.length>0)Z[H.key]=H.value});return Z}N$.parseKeyPairsIntoRecord=g40});var $$=H0((T$)=>{Object.defineProperty(T$,"__esModule",{value:!0});T$.W3CBaggagePropagator=void 0;var XH=f1(),n40=uZ(),_5=ZH(),JH=QH();class D${inject(Y,Z,W){let H=XH.propagation.getBaggage(Y);if(!H||(0,n40.isTracingSuppressed)(Y))return;let F=(0,JH.getKeyPairs)(H).filter((J)=>{return J.length<=_5.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS}).slice(0,_5.BAGGAGE_MAX_NAME_VALUE_PAIRS),X=(0,JH.serializeKeyPairs)(F);if(X.length>0)W.set(Z,_5.BAGGAGE_HEADER,X)}extract(Y,Z,W){let H=W.get(Z,_5.BAGGAGE_HEADER),F=Array.isArray(H)?H.join(_5.BAGGAGE_ITEMS_SEPARATOR):H;if(!F)return Y;let X={};if(F.length===0)return Y;if(F.split(_5.BAGGAGE_ITEMS_SEPARATOR).forEach((Q)=>{let G=(0,JH.parsePairKeyValue)(Q);if(G){let q={value:G.value};if(G.metadata)q.metadata=G.metadata;X[G.key]=q}}),Object.entries(X).length===0)return Y;return XH.propagation.setBaggage(Y,XH.propagation.createBaggage(X))}fields(){return[_5.BAGGAGE_HEADER]}}T$.W3CBaggagePropagator=D$});var R$=H0((E$)=>{Object.defineProperty(E$,"__esModule",{value:!0});E$.AnchoredClock=void 0;class C${_monotonicClock;_epochMillis;_performanceMillis;constructor(Y,Z){this._monotonicClock=Z,this._epochMillis=Y.now(),this._performanceMillis=Z.now()}now(){let Y=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+Y}}E$.AnchoredClock=C$});var y$=H0((f$)=>{Object.defineProperty(f$,"__esModule",{value:!0});f$.isAttributeValue=f$.isAttributeKey=f$.sanitizeAttributes=void 0;var P$=f1();function p40(Y){let Z={};if(typeof Y!=="object"||Y==null)return Z;for(let W in Y){if(!Object.prototype.hasOwnProperty.call(Y,W))continue;if(!L$(W)){P$.diag.warn(`Invalid attribute key: ${W}`);continue}let H=Y[W];if(!w$(H)){P$.diag.warn(`Invalid attribute value set for key: ${W}`);continue}if(Array.isArray(H))Z[W]=H.slice();else Z[W]=H}return Z}f$.sanitizeAttributes=p40;function L$(Y){return typeof Y==="string"&&Y!==""}f$.isAttributeKey=L$;function w$(Y){if(Y==null)return!0;if(Array.isArray(Y))return i40(Y);return S$(typeof Y)}f$.isAttributeValue=w$;function i40(Y){let Z;for(let W of Y){if(W==null)continue;let H=typeof W;if(H===Z)continue;if(!Z){if(S$(H)){Z=H;continue}return!1}return!1}return!0}function S$(Y){switch(Y){case"number":case"boolean":case"string":return!0}return!1}});var WH=H0((v$)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.loggingErrorHandler=void 0;var o40=f1();function t40(){return(Y)=>{o40.diag.error(s40(Y))}}v$.loggingErrorHandler=t40;function s40(Y){if(typeof Y==="string")return Y;else return JSON.stringify(e40(Y))}function e40(Y){let Z={},W=Y;while(W!==null)Object.getOwnPropertyNames(W).forEach((H)=>{if(Z[H])return;let F=W[H];if(F)Z[H]=String(F)}),W=Object.getPrototypeOf(W);return Z}});var b$=H0((_$)=>{Object.defineProperty(_$,"__esModule",{value:!0});_$.globalErrorHandler=_$.setGlobalErrorHandler=void 0;var Y50=WH(),j$=(0,Y50.loggingErrorHandler)();function Z50(Y){j$=Y}_$.setGlobalErrorHandler=Z50;function Q50(Y){try{j$(Y)}catch{}}_$.globalErrorHandler=Q50});var l$=H0((d$)=>{Object.defineProperty(d$,"__esModule",{value:!0});d$.getStringListFromEnv=d$.getBooleanFromEnv=d$.getStringFromEnv=d$.getNumberFromEnv=void 0;var u$=f1(),m$=V1("util");function J50(Y){let Z=process.env[Y];if(Z==null||Z.trim()==="")return;let W=Number(Z);if(isNaN(W)){u$.diag.warn(`Unknown value ${(0,m$.inspect)(Z)} for ${Y}, expected a number, using defaults`);return}return W}d$.getNumberFromEnv=J50;function g$(Y){let Z=process.env[Y];if(Z==null||Z.trim()==="")return;return Z}d$.getStringFromEnv=g$;function W50(Y){let Z=process.env[Y]?.trim().toLowerCase();if(Z==null||Z==="")return!1;if(Z==="true")return!0;else if(Z==="false")return!1;else return u$.diag.warn(`Unknown value ${(0,m$.inspect)(Z)} for ${Y}, expected 'true' or 'false', falling back to 'false' (default)`),!1}d$.getBooleanFromEnv=W50;function K50(Y){return g$(Y)?.split(",").map((Z)=>Z.trim()).filter((Z)=>Z!=="")}d$.getStringListFromEnv=K50});var i$=H0((n$)=>{Object.defineProperty(n$,"__esModule",{value:!0});n$._globalThis=void 0;n$._globalThis=globalThis});var o$=H0((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.VERSION=void 0;r$.VERSION="2.6.1"});var KH=H0((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.createConstMap=void 0;function V50(Y){let Z={},W=Y.length;for(let H=0;H<W;H++){let F=Y[H];if(F)Z[String(F).toUpperCase().replace(/[-.]/g,"_")]=F}return Z}t$.createConstMap=V50});var a2=H0((d2)=>{Object.defineProperty(d2,"__esModule",{value:!0});d2.SEMATTRS_NET_HOST_CARRIER_ICC=d2.SEMATTRS_NET_HOST_CARRIER_MNC=d2.SEMATTRS_NET_HOST_CARRIER_MCC=d2.SEMATTRS_NET_HOST_CARRIER_NAME=d2.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=d2.SEMATTRS_NET_HOST_CONNECTION_TYPE=d2.SEMATTRS_NET_HOST_NAME=d2.SEMATTRS_NET_HOST_PORT=d2.SEMATTRS_NET_HOST_IP=d2.SEMATTRS_NET_PEER_NAME=d2.SEMATTRS_NET_PEER_PORT=d2.SEMATTRS_NET_PEER_IP=d2.SEMATTRS_NET_TRANSPORT=d2.SEMATTRS_FAAS_INVOKED_REGION=d2.SEMATTRS_FAAS_INVOKED_PROVIDER=d2.SEMATTRS_FAAS_INVOKED_NAME=d2.SEMATTRS_FAAS_COLDSTART=d2.SEMATTRS_FAAS_CRON=d2.SEMATTRS_FAAS_TIME=d2.SEMATTRS_FAAS_DOCUMENT_NAME=d2.SEMATTRS_FAAS_DOCUMENT_TIME=d2.SEMATTRS_FAAS_DOCUMENT_OPERATION=d2.SEMATTRS_FAAS_DOCUMENT_COLLECTION=d2.SEMATTRS_FAAS_EXECUTION=d2.SEMATTRS_FAAS_TRIGGER=d2.SEMATTRS_EXCEPTION_ESCAPED=d2.SEMATTRS_EXCEPTION_STACKTRACE=d2.SEMATTRS_EXCEPTION_MESSAGE=d2.SEMATTRS_EXCEPTION_TYPE=d2.SEMATTRS_DB_SQL_TABLE=d2.SEMATTRS_DB_MONGODB_COLLECTION=d2.SEMATTRS_DB_REDIS_DATABASE_INDEX=d2.SEMATTRS_DB_HBASE_NAMESPACE=d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=d2.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=d2.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=d2.SEMATTRS_DB_CASSANDRA_TABLE=d2.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=d2.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=d2.SEMATTRS_DB_CASSANDRA_KEYSPACE=d2.SEMATTRS_DB_MSSQL_INSTANCE_NAME=d2.SEMATTRS_DB_OPERATION=d2.SEMATTRS_DB_STATEMENT=d2.SEMATTRS_DB_NAME=d2.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=d2.SEMATTRS_DB_USER=d2.SEMATTRS_DB_CONNECTION_STRING=d2.SEMATTRS_DB_SYSTEM=d2.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=void 0;d2.SEMATTRS_MESSAGING_DESTINATION_KIND=d2.SEMATTRS_MESSAGING_DESTINATION=d2.SEMATTRS_MESSAGING_SYSTEM=d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=d2.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=d2.SEMATTRS_AWS_DYNAMODB_COUNT=d2.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=d2.SEMATTRS_AWS_DYNAMODB_SEGMENT=d2.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=d2.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=d2.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=d2.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=d2.SEMATTRS_AWS_DYNAMODB_SELECT=d2.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=d2.SEMATTRS_AWS_DYNAMODB_LIMIT=d2.SEMATTRS_AWS_DYNAMODB_PROJECTION=d2.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=d2.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=d2.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=d2.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=d2.SEMATTRS_HTTP_CLIENT_IP=d2.SEMATTRS_HTTP_ROUTE=d2.SEMATTRS_HTTP_SERVER_NAME=d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=d2.SEMATTRS_HTTP_USER_AGENT=d2.SEMATTRS_HTTP_FLAVOR=d2.SEMATTRS_HTTP_STATUS_CODE=d2.SEMATTRS_HTTP_SCHEME=d2.SEMATTRS_HTTP_HOST=d2.SEMATTRS_HTTP_TARGET=d2.SEMATTRS_HTTP_URL=d2.SEMATTRS_HTTP_METHOD=d2.SEMATTRS_CODE_LINENO=d2.SEMATTRS_CODE_FILEPATH=d2.SEMATTRS_CODE_NAMESPACE=d2.SEMATTRS_CODE_FUNCTION=d2.SEMATTRS_THREAD_NAME=d2.SEMATTRS_THREAD_ID=d2.SEMATTRS_ENDUSER_SCOPE=d2.SEMATTRS_ENDUSER_ROLE=d2.SEMATTRS_ENDUSER_ID=d2.SEMATTRS_PEER_SERVICE=void 0;d2.DBSYSTEMVALUES_FILEMAKER=d2.DBSYSTEMVALUES_DERBY=d2.DBSYSTEMVALUES_FIREBIRD=d2.DBSYSTEMVALUES_ADABAS=d2.DBSYSTEMVALUES_CACHE=d2.DBSYSTEMVALUES_EDB=d2.DBSYSTEMVALUES_FIRSTSQL=d2.DBSYSTEMVALUES_INGRES=d2.DBSYSTEMVALUES_HANADB=d2.DBSYSTEMVALUES_MAXDB=d2.DBSYSTEMVALUES_PROGRESS=d2.DBSYSTEMVALUES_HSQLDB=d2.DBSYSTEMVALUES_CLOUDSCAPE=d2.DBSYSTEMVALUES_HIVE=d2.DBSYSTEMVALUES_REDSHIFT=d2.DBSYSTEMVALUES_POSTGRESQL=d2.DBSYSTEMVALUES_DB2=d2.DBSYSTEMVALUES_ORACLE=d2.DBSYSTEMVALUES_MYSQL=d2.DBSYSTEMVALUES_MSSQL=d2.DBSYSTEMVALUES_OTHER_SQL=d2.SemanticAttributes=d2.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=d2.SEMATTRS_MESSAGE_COMPRESSED_SIZE=d2.SEMATTRS_MESSAGE_ID=d2.SEMATTRS_MESSAGE_TYPE=d2.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=d2.SEMATTRS_RPC_JSONRPC_ERROR_CODE=d2.SEMATTRS_RPC_JSONRPC_REQUEST_ID=d2.SEMATTRS_RPC_JSONRPC_VERSION=d2.SEMATTRS_RPC_GRPC_STATUS_CODE=d2.SEMATTRS_RPC_METHOD=d2.SEMATTRS_RPC_SERVICE=d2.SEMATTRS_RPC_SYSTEM=d2.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=d2.SEMATTRS_MESSAGING_KAFKA_PARTITION=d2.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=d2.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=d2.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=d2.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=d2.SEMATTRS_MESSAGING_CONSUMER_ID=d2.SEMATTRS_MESSAGING_OPERATION=d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=d2.SEMATTRS_MESSAGING_CONVERSATION_ID=d2.SEMATTRS_MESSAGING_MESSAGE_ID=d2.SEMATTRS_MESSAGING_URL=d2.SEMATTRS_MESSAGING_PROTOCOL_VERSION=d2.SEMATTRS_MESSAGING_PROTOCOL=d2.SEMATTRS_MESSAGING_TEMP_DESTINATION=void 0;d2.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=d2.FaasDocumentOperationValues=d2.FAASDOCUMENTOPERATIONVALUES_DELETE=d2.FAASDOCUMENTOPERATIONVALUES_EDIT=d2.FAASDOCUMENTOPERATIONVALUES_INSERT=d2.FaasTriggerValues=d2.FAASTRIGGERVALUES_OTHER=d2.FAASTRIGGERVALUES_TIMER=d2.FAASTRIGGERVALUES_PUBSUB=d2.FAASTRIGGERVALUES_HTTP=d2.FAASTRIGGERVALUES_DATASOURCE=d2.DbCassandraConsistencyLevelValues=d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=d2.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=d2.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=d2.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=d2.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=d2.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=d2.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=d2.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=d2.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=d2.DbSystemValues=d2.DBSYSTEMVALUES_COCKROACHDB=d2.DBSYSTEMVALUES_MEMCACHED=d2.DBSYSTEMVALUES_ELASTICSEARCH=d2.DBSYSTEMVALUES_GEODE=d2.DBSYSTEMVALUES_NEO4J=d2.DBSYSTEMVALUES_DYNAMODB=d2.DBSYSTEMVALUES_COSMOSDB=d2.DBSYSTEMVALUES_COUCHDB=d2.DBSYSTEMVALUES_COUCHBASE=d2.DBSYSTEMVALUES_REDIS=d2.DBSYSTEMVALUES_MONGODB=d2.DBSYSTEMVALUES_HBASE=d2.DBSYSTEMVALUES_CASSANDRA=d2.DBSYSTEMVALUES_COLDFUSION=d2.DBSYSTEMVALUES_H2=d2.DBSYSTEMVALUES_VERTICA=d2.DBSYSTEMVALUES_TERADATA=d2.DBSYSTEMVALUES_SYBASE=d2.DBSYSTEMVALUES_SQLITE=d2.DBSYSTEMVALUES_POINTBASE=d2.DBSYSTEMVALUES_PERVASIVE=d2.DBSYSTEMVALUES_NETEZZA=d2.DBSYSTEMVALUES_MARIADB=d2.DBSYSTEMVALUES_INTERBASE=d2.DBSYSTEMVALUES_INSTANTDB=d2.DBSYSTEMVALUES_INFORMIX=void 0;d2.MESSAGINGOPERATIONVALUES_RECEIVE=d2.MessagingDestinationKindValues=d2.MESSAGINGDESTINATIONKINDVALUES_TOPIC=d2.MESSAGINGDESTINATIONKINDVALUES_QUEUE=d2.HttpFlavorValues=d2.HTTPFLAVORVALUES_QUIC=d2.HTTPFLAVORVALUES_SPDY=d2.HTTPFLAVORVALUES_HTTP_2_0=d2.HTTPFLAVORVALUES_HTTP_1_1=d2.HTTPFLAVORVALUES_HTTP_1_0=d2.NetHostConnectionSubtypeValues=d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_NR=d2.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=d2.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=d2.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=d2.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=d2.NetHostConnectionTypeValues=d2.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=d2.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=d2.NETHOSTCONNECTIONTYPEVALUES_CELL=d2.NETHOSTCONNECTIONTYPEVALUES_WIRED=d2.NETHOSTCONNECTIONTYPEVALUES_WIFI=d2.NetTransportValues=d2.NETTRANSPORTVALUES_OTHER=d2.NETTRANSPORTVALUES_INPROC=d2.NETTRANSPORTVALUES_PIPE=d2.NETTRANSPORTVALUES_UNIX=d2.NETTRANSPORTVALUES_IP=d2.NETTRANSPORTVALUES_IP_UDP=d2.NETTRANSPORTVALUES_IP_TCP=d2.FaasInvokedProviderValues=d2.FAASINVOKEDPROVIDERVALUES_GCP=d2.FAASINVOKEDPROVIDERVALUES_AZURE=d2.FAASINVOKEDPROVIDERVALUES_AWS=void 0;d2.MessageTypeValues=d2.MESSAGETYPEVALUES_RECEIVED=d2.MESSAGETYPEVALUES_SENT=d2.RpcGrpcStatusCodeValues=d2.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=d2.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=d2.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=d2.RPCGRPCSTATUSCODEVALUES_INTERNAL=d2.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=d2.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=d2.RPCGRPCSTATUSCODEVALUES_ABORTED=d2.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=d2.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=d2.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=d2.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=d2.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=d2.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=d2.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=d2.RPCGRPCSTATUSCODEVALUES_UNKNOWN=d2.RPCGRPCSTATUSCODEVALUES_CANCELLED=d2.RPCGRPCSTATUSCODEVALUES_OK=d2.MessagingOperationValues=d2.MESSAGINGOPERATIONVALUES_PROCESS=void 0;var X9=KH(),e$="aws.lambda.invoked_arn",YC="db.system",ZC="db.connection_string",QC="db.user",XC="db.jdbc.driver_classname",JC="db.name",WC="db.statement",KC="db.operation",GC="db.mssql.instance_name",FC="db.cassandra.keyspace",HC="db.cassandra.page_size",VC="db.cassandra.consistency_level",qC="db.cassandra.table",zC="db.cassandra.idempotence",BC="db.cassandra.speculative_execution_count",AC="db.cassandra.coordinator.id",UC="db.cassandra.coordinator.dc",NC="db.hbase.namespace",OC="db.redis.database_index",DC="db.mongodb.collection",TC="db.sql.table",IC="exception.type",$C="exception.message",CC="exception.stacktrace",EC="exception.escaped",MC="faas.trigger",RC="faas.execution",PC="faas.document.collection",LC="faas.document.operation",wC="faas.document.time",SC="faas.document.name",fC="faas.time",kC="faas.cron",yC="faas.coldstart",vC="faas.invoked_name",hC="faas.invoked_provider",jC="faas.invoked_region",_C="net.transport",xC="net.peer.ip",bC="net.peer.port",uC="net.peer.name",mC="net.host.ip",gC="net.host.port",dC="net.host.name",cC="net.host.connection.type",lC="net.host.connection.subtype",nC="net.host.carrier.name",pC="net.host.carrier.mcc",iC="net.host.carrier.mnc",rC="net.host.carrier.icc",aC="peer.service",oC="enduser.id",tC="enduser.role",sC="enduser.scope",eC="thread.id",YE="thread.name",ZE="code.function",QE="code.namespace",XE="code.filepath",JE="code.lineno",WE="http.method",KE="http.url",GE="http.target",FE="http.host",HE="http.scheme",VE="http.status_code",qE="http.flavor",zE="http.user_agent",BE="http.request_content_length",AE="http.request_content_length_uncompressed",UE="http.response_content_length",NE="http.response_content_length_uncompressed",OE="http.server_name",DE="http.route",TE="http.client_ip",IE="aws.dynamodb.table_names",$E="aws.dynamodb.consumed_capacity",CE="aws.dynamodb.item_collection_metrics",EE="aws.dynamodb.provisioned_read_capacity",ME="aws.dynamodb.provisioned_write_capacity",RE="aws.dynamodb.consistent_read",PE="aws.dynamodb.projection",LE="aws.dynamodb.limit",wE="aws.dynamodb.attributes_to_get",SE="aws.dynamodb.index_name",fE="aws.dynamodb.select",kE="aws.dynamodb.global_secondary_indexes",yE="aws.dynamodb.local_secondary_indexes",vE="aws.dynamodb.exclusive_start_table",hE="aws.dynamodb.table_count",jE="aws.dynamodb.scan_forward",_E="aws.dynamodb.segment",xE="aws.dynamodb.total_segments",bE="aws.dynamodb.count",uE="aws.dynamodb.scanned_count",mE="aws.dynamodb.attribute_definitions",gE="aws.dynamodb.global_secondary_index_updates",dE="messaging.system",cE="messaging.destination",lE="messaging.destination_kind",nE="messaging.temp_destination",pE="messaging.protocol",iE="messaging.protocol_version",rE="messaging.url",aE="messaging.message_id",oE="messaging.conversation_id",tE="messaging.message_payload_size_bytes",sE="messaging.message_payload_compressed_size_bytes",eE="messaging.operation",YM="messaging.consumer_id",ZM="messaging.rabbitmq.routing_key",QM="messaging.kafka.message_key",XM="messaging.kafka.consumer_group",JM="messaging.kafka.client_id",WM="messaging.kafka.partition",KM="messaging.kafka.tombstone",GM="rpc.system",FM="rpc.service",HM="rpc.method",VM="rpc.grpc.status_code",qM="rpc.jsonrpc.version",zM="rpc.jsonrpc.request_id",BM="rpc.jsonrpc.error_code",AM="rpc.jsonrpc.error_message",UM="message.type",NM="message.id",OM="message.compressed_size",DM="message.uncompressed_size";d2.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=e$;d2.SEMATTRS_DB_SYSTEM=YC;d2.SEMATTRS_DB_CONNECTION_STRING=ZC;d2.SEMATTRS_DB_USER=QC;d2.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=XC;d2.SEMATTRS_DB_NAME=JC;d2.SEMATTRS_DB_STATEMENT=WC;d2.SEMATTRS_DB_OPERATION=KC;d2.SEMATTRS_DB_MSSQL_INSTANCE_NAME=GC;d2.SEMATTRS_DB_CASSANDRA_KEYSPACE=FC;d2.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=HC;d2.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=VC;d2.SEMATTRS_DB_CASSANDRA_TABLE=qC;d2.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=zC;d2.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=BC;d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=AC;d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=UC;d2.SEMATTRS_DB_HBASE_NAMESPACE=NC;d2.SEMATTRS_DB_REDIS_DATABASE_INDEX=OC;d2.SEMATTRS_DB_MONGODB_COLLECTION=DC;d2.SEMATTRS_DB_SQL_TABLE=TC;d2.SEMATTRS_EXCEPTION_TYPE=IC;d2.SEMATTRS_EXCEPTION_MESSAGE=$C;d2.SEMATTRS_EXCEPTION_STACKTRACE=CC;d2.SEMATTRS_EXCEPTION_ESCAPED=EC;d2.SEMATTRS_FAAS_TRIGGER=MC;d2.SEMATTRS_FAAS_EXECUTION=RC;d2.SEMATTRS_FAAS_DOCUMENT_COLLECTION=PC;d2.SEMATTRS_FAAS_DOCUMENT_OPERATION=LC;d2.SEMATTRS_FAAS_DOCUMENT_TIME=wC;d2.SEMATTRS_FAAS_DOCUMENT_NAME=SC;d2.SEMATTRS_FAAS_TIME=fC;d2.SEMATTRS_FAAS_CRON=kC;d2.SEMATTRS_FAAS_COLDSTART=yC;d2.SEMATTRS_FAAS_INVOKED_NAME=vC;d2.SEMATTRS_FAAS_INVOKED_PROVIDER=hC;d2.SEMATTRS_FAAS_INVOKED_REGION=jC;d2.SEMATTRS_NET_TRANSPORT=_C;d2.SEMATTRS_NET_PEER_IP=xC;d2.SEMATTRS_NET_PEER_PORT=bC;d2.SEMATTRS_NET_PEER_NAME=uC;d2.SEMATTRS_NET_HOST_IP=mC;d2.SEMATTRS_NET_HOST_PORT=gC;d2.SEMATTRS_NET_HOST_NAME=dC;d2.SEMATTRS_NET_HOST_CONNECTION_TYPE=cC;d2.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=lC;d2.SEMATTRS_NET_HOST_CARRIER_NAME=nC;d2.SEMATTRS_NET_HOST_CARRIER_MCC=pC;d2.SEMATTRS_NET_HOST_CARRIER_MNC=iC;d2.SEMATTRS_NET_HOST_CARRIER_ICC=rC;d2.SEMATTRS_PEER_SERVICE=aC;d2.SEMATTRS_ENDUSER_ID=oC;d2.SEMATTRS_ENDUSER_ROLE=tC;d2.SEMATTRS_ENDUSER_SCOPE=sC;d2.SEMATTRS_THREAD_ID=eC;d2.SEMATTRS_THREAD_NAME=YE;d2.SEMATTRS_CODE_FUNCTION=ZE;d2.SEMATTRS_CODE_NAMESPACE=QE;d2.SEMATTRS_CODE_FILEPATH=XE;d2.SEMATTRS_CODE_LINENO=JE;d2.SEMATTRS_HTTP_METHOD=WE;d2.SEMATTRS_HTTP_URL=KE;d2.SEMATTRS_HTTP_TARGET=GE;d2.SEMATTRS_HTTP_HOST=FE;d2.SEMATTRS_HTTP_SCHEME=HE;d2.SEMATTRS_HTTP_STATUS_CODE=VE;d2.SEMATTRS_HTTP_FLAVOR=qE;d2.SEMATTRS_HTTP_USER_AGENT=zE;d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=BE;d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=AE;d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=UE;d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=NE;d2.SEMATTRS_HTTP_SERVER_NAME=OE;d2.SEMATTRS_HTTP_ROUTE=DE;d2.SEMATTRS_HTTP_CLIENT_IP=TE;d2.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=IE;d2.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=$E;d2.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=CE;d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=EE;d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=ME;d2.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=RE;d2.SEMATTRS_AWS_DYNAMODB_PROJECTION=PE;d2.SEMATTRS_AWS_DYNAMODB_LIMIT=LE;d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=wE;d2.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=SE;d2.SEMATTRS_AWS_DYNAMODB_SELECT=fE;d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=kE;d2.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=yE;d2.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=vE;d2.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=hE;d2.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=jE;d2.SEMATTRS_AWS_DYNAMODB_SEGMENT=_E;d2.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=xE;d2.SEMATTRS_AWS_DYNAMODB_COUNT=bE;d2.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=uE;d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=mE;d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=gE;d2.SEMATTRS_MESSAGING_SYSTEM=dE;d2.SEMATTRS_MESSAGING_DESTINATION=cE;d2.SEMATTRS_MESSAGING_DESTINATION_KIND=lE;d2.SEMATTRS_MESSAGING_TEMP_DESTINATION=nE;d2.SEMATTRS_MESSAGING_PROTOCOL=pE;d2.SEMATTRS_MESSAGING_PROTOCOL_VERSION=iE;d2.SEMATTRS_MESSAGING_URL=rE;d2.SEMATTRS_MESSAGING_MESSAGE_ID=aE;d2.SEMATTRS_MESSAGING_CONVERSATION_ID=oE;d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=tE;d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=sE;d2.SEMATTRS_MESSAGING_OPERATION=eE;d2.SEMATTRS_MESSAGING_CONSUMER_ID=YM;d2.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=ZM;d2.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=QM;d2.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=XM;d2.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=JM;d2.SEMATTRS_MESSAGING_KAFKA_PARTITION=WM;d2.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=KM;d2.SEMATTRS_RPC_SYSTEM=GM;d2.SEMATTRS_RPC_SERVICE=FM;d2.SEMATTRS_RPC_METHOD=HM;d2.SEMATTRS_RPC_GRPC_STATUS_CODE=VM;d2.SEMATTRS_RPC_JSONRPC_VERSION=qM;d2.SEMATTRS_RPC_JSONRPC_REQUEST_ID=zM;d2.SEMATTRS_RPC_JSONRPC_ERROR_CODE=BM;d2.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=AM;d2.SEMATTRS_MESSAGE_TYPE=UM;d2.SEMATTRS_MESSAGE_ID=NM;d2.SEMATTRS_MESSAGE_COMPRESSED_SIZE=OM;d2.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=DM;d2.SemanticAttributes=(0,X9.createConstMap)([e$,YC,ZC,QC,XC,JC,WC,KC,GC,FC,HC,VC,qC,zC,BC,AC,UC,NC,OC,DC,TC,IC,$C,CC,EC,MC,RC,PC,LC,wC,SC,fC,kC,yC,vC,hC,jC,_C,xC,bC,uC,mC,gC,dC,cC,lC,nC,pC,iC,rC,aC,oC,tC,sC,eC,YE,ZE,QE,XE,JE,WE,KE,GE,FE,HE,VE,qE,zE,BE,AE,UE,NE,OE,DE,TE,IE,$E,CE,EE,ME,RE,PE,LE,wE,SE,fE,kE,yE,vE,hE,jE,_E,xE,bE,uE,mE,gE,dE,cE,lE,nE,pE,iE,rE,aE,oE,tE,sE,eE,YM,ZM,QM,XM,JM,WM,KM,GM,FM,HM,VM,qM,zM,BM,AM,UM,NM,OM,DM]);var TM="other_sql",IM="mssql",$M="mysql",CM="oracle",EM="db2",MM="postgresql",RM="redshift",PM="hive",LM="cloudscape",wM="hsqldb",SM="progress",fM="maxdb",kM="hanadb",yM="ingres",vM="firstsql",hM="edb",jM="cache",_M="adabas",xM="firebird",bM="derby",uM="filemaker",mM="informix",gM="instantdb",dM="interbase",cM="mariadb",lM="netezza",nM="pervasive",pM="pointbase",iM="sqlite",rM="sybase",aM="teradata",oM="vertica",tM="h2",sM="coldfusion",eM="cassandra",YR="hbase",ZR="mongodb",QR="redis",XR="couchbase",JR="couchdb",WR="cosmosdb",KR="dynamodb",GR="neo4j",FR="geode",HR="elasticsearch",VR="memcached",qR="cockroachdb";d2.DBSYSTEMVALUES_OTHER_SQL=TM;d2.DBSYSTEMVALUES_MSSQL=IM;d2.DBSYSTEMVALUES_MYSQL=$M;d2.DBSYSTEMVALUES_ORACLE=CM;d2.DBSYSTEMVALUES_DB2=EM;d2.DBSYSTEMVALUES_POSTGRESQL=MM;d2.DBSYSTEMVALUES_REDSHIFT=RM;d2.DBSYSTEMVALUES_HIVE=PM;d2.DBSYSTEMVALUES_CLOUDSCAPE=LM;d2.DBSYSTEMVALUES_HSQLDB=wM;d2.DBSYSTEMVALUES_PROGRESS=SM;d2.DBSYSTEMVALUES_MAXDB=fM;d2.DBSYSTEMVALUES_HANADB=kM;d2.DBSYSTEMVALUES_INGRES=yM;d2.DBSYSTEMVALUES_FIRSTSQL=vM;d2.DBSYSTEMVALUES_EDB=hM;d2.DBSYSTEMVALUES_CACHE=jM;d2.DBSYSTEMVALUES_ADABAS=_M;d2.DBSYSTEMVALUES_FIREBIRD=xM;d2.DBSYSTEMVALUES_DERBY=bM;d2.DBSYSTEMVALUES_FILEMAKER=uM;d2.DBSYSTEMVALUES_INFORMIX=mM;d2.DBSYSTEMVALUES_INSTANTDB=gM;d2.DBSYSTEMVALUES_INTERBASE=dM;d2.DBSYSTEMVALUES_MARIADB=cM;d2.DBSYSTEMVALUES_NETEZZA=lM;d2.DBSYSTEMVALUES_PERVASIVE=nM;d2.DBSYSTEMVALUES_POINTBASE=pM;d2.DBSYSTEMVALUES_SQLITE=iM;d2.DBSYSTEMVALUES_SYBASE=rM;d2.DBSYSTEMVALUES_TERADATA=aM;d2.DBSYSTEMVALUES_VERTICA=oM;d2.DBSYSTEMVALUES_H2=tM;d2.DBSYSTEMVALUES_COLDFUSION=sM;d2.DBSYSTEMVALUES_CASSANDRA=eM;d2.DBSYSTEMVALUES_HBASE=YR;d2.DBSYSTEMVALUES_MONGODB=ZR;d2.DBSYSTEMVALUES_REDIS=QR;d2.DBSYSTEMVALUES_COUCHBASE=XR;d2.DBSYSTEMVALUES_COUCHDB=JR;d2.DBSYSTEMVALUES_COSMOSDB=WR;d2.DBSYSTEMVALUES_DYNAMODB=KR;d2.DBSYSTEMVALUES_NEO4J=GR;d2.DBSYSTEMVALUES_GEODE=FR;d2.DBSYSTEMVALUES_ELASTICSEARCH=HR;d2.DBSYSTEMVALUES_MEMCACHED=VR;d2.DBSYSTEMVALUES_COCKROACHDB=qR;d2.DbSystemValues=(0,X9.createConstMap)([TM,IM,$M,CM,EM,MM,RM,PM,LM,wM,SM,fM,kM,yM,vM,hM,jM,_M,xM,bM,uM,mM,gM,dM,cM,lM,nM,pM,iM,rM,aM,oM,tM,sM,eM,YR,ZR,QR,XR,JR,WR,KR,GR,FR,HR,VR,qR]);var zR="all",BR="each_quorum",AR="quorum",UR="local_quorum",NR="one",OR="two",DR="three",TR="local_one",IR="any",$R="serial",CR="local_serial";d2.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=zR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=BR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=AR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=UR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=NR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=OR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=DR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=TR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=IR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=$R;d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=CR;d2.DbCassandraConsistencyLevelValues=(0,X9.createConstMap)([zR,BR,AR,UR,NR,OR,DR,TR,IR,$R,CR]);var ER="datasource",MR="http",RR="pubsub",PR="timer",LR="other";d2.FAASTRIGGERVALUES_DATASOURCE=ER;d2.FAASTRIGGERVALUES_HTTP=MR;d2.FAASTRIGGERVALUES_PUBSUB=RR;d2.FAASTRIGGERVALUES_TIMER=PR;d2.FAASTRIGGERVALUES_OTHER=LR;d2.FaasTriggerValues=(0,X9.createConstMap)([ER,MR,RR,PR,LR]);var wR="insert",SR="edit",fR="delete";d2.FAASDOCUMENTOPERATIONVALUES_INSERT=wR;d2.FAASDOCUMENTOPERATIONVALUES_EDIT=SR;d2.FAASDOCUMENTOPERATIONVALUES_DELETE=fR;d2.FaasDocumentOperationValues=(0,X9.createConstMap)([wR,SR,fR]);var kR="alibaba_cloud",yR="aws",vR="azure",hR="gcp";d2.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=kR;d2.FAASINVOKEDPROVIDERVALUES_AWS=yR;d2.FAASINVOKEDPROVIDERVALUES_AZURE=vR;d2.FAASINVOKEDPROVIDERVALUES_GCP=hR;d2.FaasInvokedProviderValues=(0,X9.createConstMap)([kR,yR,vR,hR]);var jR="ip_tcp",_R="ip_udp",xR="ip",bR="unix",uR="pipe",mR="inproc",gR="other";d2.NETTRANSPORTVALUES_IP_TCP=jR;d2.NETTRANSPORTVALUES_IP_UDP=_R;d2.NETTRANSPORTVALUES_IP=xR;d2.NETTRANSPORTVALUES_UNIX=bR;d2.NETTRANSPORTVALUES_PIPE=uR;d2.NETTRANSPORTVALUES_INPROC=mR;d2.NETTRANSPORTVALUES_OTHER=gR;d2.NetTransportValues=(0,X9.createConstMap)([jR,_R,xR,bR,uR,mR,gR]);var dR="wifi",cR="wired",lR="cell",nR="unavailable",pR="unknown";d2.NETHOSTCONNECTIONTYPEVALUES_WIFI=dR;d2.NETHOSTCONNECTIONTYPEVALUES_WIRED=cR;d2.NETHOSTCONNECTIONTYPEVALUES_CELL=lR;d2.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=nR;d2.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=pR;d2.NetHostConnectionTypeValues=(0,X9.createConstMap)([dR,cR,lR,nR,pR]);var iR="gprs",rR="edge",aR="umts",oR="cdma",tR="evdo_0",sR="evdo_a",eR="cdma2000_1xrtt",Y2="hsdpa",Z2="hsupa",Q2="hspa",X2="iden",J2="evdo_b",W2="lte",K2="ehrpd",G2="hspap",F2="gsm",H2="td_scdma",V2="iwlan",q2="nr",z2="nrnsa",B2="lte_ca";d2.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=iR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=rR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=aR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=oR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=tR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=sR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=eR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=Y2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=Z2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=Q2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=X2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=J2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=W2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=K2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=G2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=F2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=H2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=V2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_NR=q2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=z2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=B2;d2.NetHostConnectionSubtypeValues=(0,X9.createConstMap)([iR,rR,aR,oR,tR,sR,eR,Y2,Z2,Q2,X2,J2,W2,K2,G2,F2,H2,V2,q2,z2,B2]);var A2="1.0",U2="1.1",N2="2.0",O2="SPDY",D2="QUIC";d2.HTTPFLAVORVALUES_HTTP_1_0=A2;d2.HTTPFLAVORVALUES_HTTP_1_1=U2;d2.HTTPFLAVORVALUES_HTTP_2_0=N2;d2.HTTPFLAVORVALUES_SPDY=O2;d2.HTTPFLAVORVALUES_QUIC=D2;d2.HttpFlavorValues={HTTP_1_0:A2,HTTP_1_1:U2,HTTP_2_0:N2,SPDY:O2,QUIC:D2};var T2="queue",I2="topic";d2.MESSAGINGDESTINATIONKINDVALUES_QUEUE=T2;d2.MESSAGINGDESTINATIONKINDVALUES_TOPIC=I2;d2.MessagingDestinationKindValues=(0,X9.createConstMap)([T2,I2]);var $2="receive",C2="process";d2.MESSAGINGOPERATIONVALUES_RECEIVE=$2;d2.MESSAGINGOPERATIONVALUES_PROCESS=C2;d2.MessagingOperationValues=(0,X9.createConstMap)([$2,C2]);var E2=0,M2=1,R2=2,P2=3,L2=4,w2=5,S2=6,f2=7,k2=8,y2=9,v2=10,h2=11,j2=12,_2=13,x2=14,b2=15,u2=16;d2.RPCGRPCSTATUSCODEVALUES_OK=E2;d2.RPCGRPCSTATUSCODEVALUES_CANCELLED=M2;d2.RPCGRPCSTATUSCODEVALUES_UNKNOWN=R2;d2.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=P2;d2.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=L2;d2.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=w2;d2.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=S2;d2.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=f2;d2.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=k2;d2.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=y2;d2.RPCGRPCSTATUSCODEVALUES_ABORTED=v2;d2.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=h2;d2.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=j2;d2.RPCGRPCSTATUSCODEVALUES_INTERNAL=_2;d2.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=x2;d2.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=b2;d2.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=u2;d2.RpcGrpcStatusCodeValues={OK:E2,CANCELLED:M2,UNKNOWN:R2,INVALID_ARGUMENT:P2,DEADLINE_EXCEEDED:L2,NOT_FOUND:w2,ALREADY_EXISTS:S2,PERMISSION_DENIED:f2,RESOURCE_EXHAUSTED:k2,FAILED_PRECONDITION:y2,ABORTED:v2,OUT_OF_RANGE:h2,UNIMPLEMENTED:j2,INTERNAL:_2,UNAVAILABLE:x2,DATA_LOSS:b2,UNAUTHENTICATED:u2};var m2="SENT",g2="RECEIVED";d2.MESSAGETYPEVALUES_SENT=m2;d2.MESSAGETYPEVALUES_RECEIVED=g2;d2.MessageTypeValues=(0,X9.createConstMap)([m2,g2])});var o2=H0((x5)=>{var FX0=x5&&x5.__createBinding||(Object.create?function(Y,Z,W,H){if(H===void 0)H=W;var F=Object.getOwnPropertyDescriptor(Z,W);if(!F||("get"in F?!Z.__esModule:F.writable||F.configurable))F={enumerable:!0,get:function(){return Z[W]}};Object.defineProperty(Y,H,F)}:function(Y,Z,W,H){if(H===void 0)H=W;Y[H]=Z[W]}),HX0=x5&&x5.__exportStar||function(Y,Z){for(var W in Y)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(Z,W))FX0(Z,Y,W)};Object.defineProperty(x5,"__esModule",{value:!0});HX0(a2(),x5)});var Rw=H0(($w)=>{Object.defineProperty($w,"__esModule",{value:!0});$w.SEMRESATTRS_K8S_STATEFULSET_NAME=$w.SEMRESATTRS_K8S_STATEFULSET_UID=$w.SEMRESATTRS_K8S_DEPLOYMENT_NAME=$w.SEMRESATTRS_K8S_DEPLOYMENT_UID=$w.SEMRESATTRS_K8S_REPLICASET_NAME=$w.SEMRESATTRS_K8S_REPLICASET_UID=$w.SEMRESATTRS_K8S_CONTAINER_NAME=$w.SEMRESATTRS_K8S_POD_NAME=$w.SEMRESATTRS_K8S_POD_UID=$w.SEMRESATTRS_K8S_NAMESPACE_NAME=$w.SEMRESATTRS_K8S_NODE_UID=$w.SEMRESATTRS_K8S_NODE_NAME=$w.SEMRESATTRS_K8S_CLUSTER_NAME=$w.SEMRESATTRS_HOST_IMAGE_VERSION=$w.SEMRESATTRS_HOST_IMAGE_ID=$w.SEMRESATTRS_HOST_IMAGE_NAME=$w.SEMRESATTRS_HOST_ARCH=$w.SEMRESATTRS_HOST_TYPE=$w.SEMRESATTRS_HOST_NAME=$w.SEMRESATTRS_HOST_ID=$w.SEMRESATTRS_FAAS_MAX_MEMORY=$w.SEMRESATTRS_FAAS_INSTANCE=$w.SEMRESATTRS_FAAS_VERSION=$w.SEMRESATTRS_FAAS_ID=$w.SEMRESATTRS_FAAS_NAME=$w.SEMRESATTRS_DEVICE_MODEL_NAME=$w.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=$w.SEMRESATTRS_DEVICE_ID=$w.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=$w.SEMRESATTRS_CONTAINER_IMAGE_TAG=$w.SEMRESATTRS_CONTAINER_IMAGE_NAME=$w.SEMRESATTRS_CONTAINER_RUNTIME=$w.SEMRESATTRS_CONTAINER_ID=$w.SEMRESATTRS_CONTAINER_NAME=$w.SEMRESATTRS_AWS_LOG_STREAM_ARNS=$w.SEMRESATTRS_AWS_LOG_STREAM_NAMES=$w.SEMRESATTRS_AWS_LOG_GROUP_ARNS=$w.SEMRESATTRS_AWS_LOG_GROUP_NAMES=$w.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=$w.SEMRESATTRS_AWS_ECS_TASK_REVISION=$w.SEMRESATTRS_AWS_ECS_TASK_FAMILY=$w.SEMRESATTRS_AWS_ECS_TASK_ARN=$w.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=$w.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=$w.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=$w.SEMRESATTRS_CLOUD_PLATFORM=$w.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=$w.SEMRESATTRS_CLOUD_REGION=$w.SEMRESATTRS_CLOUD_ACCOUNT_ID=$w.SEMRESATTRS_CLOUD_PROVIDER=void 0;$w.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=$w.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=$w.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=$w.CLOUDPLATFORMVALUES_AZURE_AKS=$w.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=$w.CLOUDPLATFORMVALUES_AZURE_VM=$w.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=$w.CLOUDPLATFORMVALUES_AWS_LAMBDA=$w.CLOUDPLATFORMVALUES_AWS_EKS=$w.CLOUDPLATFORMVALUES_AWS_ECS=$w.CLOUDPLATFORMVALUES_AWS_EC2=$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=$w.CloudProviderValues=$w.CLOUDPROVIDERVALUES_GCP=$w.CLOUDPROVIDERVALUES_AZURE=$w.CLOUDPROVIDERVALUES_AWS=$w.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=$w.SemanticResourceAttributes=$w.SEMRESATTRS_WEBENGINE_DESCRIPTION=$w.SEMRESATTRS_WEBENGINE_VERSION=$w.SEMRESATTRS_WEBENGINE_NAME=$w.SEMRESATTRS_TELEMETRY_AUTO_VERSION=$w.SEMRESATTRS_TELEMETRY_SDK_VERSION=$w.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=$w.SEMRESATTRS_TELEMETRY_SDK_NAME=$w.SEMRESATTRS_SERVICE_VERSION=$w.SEMRESATTRS_SERVICE_INSTANCE_ID=$w.SEMRESATTRS_SERVICE_NAMESPACE=$w.SEMRESATTRS_SERVICE_NAME=$w.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=$w.SEMRESATTRS_PROCESS_RUNTIME_VERSION=$w.SEMRESATTRS_PROCESS_RUNTIME_NAME=$w.SEMRESATTRS_PROCESS_OWNER=$w.SEMRESATTRS_PROCESS_COMMAND_ARGS=$w.SEMRESATTRS_PROCESS_COMMAND_LINE=$w.SEMRESATTRS_PROCESS_COMMAND=$w.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=$w.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=$w.SEMRESATTRS_PROCESS_PID=$w.SEMRESATTRS_OS_VERSION=$w.SEMRESATTRS_OS_NAME=$w.SEMRESATTRS_OS_DESCRIPTION=$w.SEMRESATTRS_OS_TYPE=$w.SEMRESATTRS_K8S_CRONJOB_NAME=$w.SEMRESATTRS_K8S_CRONJOB_UID=$w.SEMRESATTRS_K8S_JOB_NAME=$w.SEMRESATTRS_K8S_JOB_UID=$w.SEMRESATTRS_K8S_DAEMONSET_NAME=$w.SEMRESATTRS_K8S_DAEMONSET_UID=void 0;$w.TelemetrySdkLanguageValues=$w.TELEMETRYSDKLANGUAGEVALUES_WEBJS=$w.TELEMETRYSDKLANGUAGEVALUES_RUBY=$w.TELEMETRYSDKLANGUAGEVALUES_PYTHON=$w.TELEMETRYSDKLANGUAGEVALUES_PHP=$w.TELEMETRYSDKLANGUAGEVALUES_NODEJS=$w.TELEMETRYSDKLANGUAGEVALUES_JAVA=$w.TELEMETRYSDKLANGUAGEVALUES_GO=$w.TELEMETRYSDKLANGUAGEVALUES_ERLANG=$w.TELEMETRYSDKLANGUAGEVALUES_DOTNET=$w.TELEMETRYSDKLANGUAGEVALUES_CPP=$w.OsTypeValues=$w.OSTYPEVALUES_Z_OS=$w.OSTYPEVALUES_SOLARIS=$w.OSTYPEVALUES_AIX=$w.OSTYPEVALUES_HPUX=$w.OSTYPEVALUES_DRAGONFLYBSD=$w.OSTYPEVALUES_OPENBSD=$w.OSTYPEVALUES_NETBSD=$w.OSTYPEVALUES_FREEBSD=$w.OSTYPEVALUES_DARWIN=$w.OSTYPEVALUES_LINUX=$w.OSTYPEVALUES_WINDOWS=$w.HostArchValues=$w.HOSTARCHVALUES_X86=$w.HOSTARCHVALUES_PPC64=$w.HOSTARCHVALUES_PPC32=$w.HOSTARCHVALUES_IA64=$w.HOSTARCHVALUES_ARM64=$w.HOSTARCHVALUES_ARM32=$w.HOSTARCHVALUES_AMD64=$w.AwsEcsLaunchtypeValues=$w.AWSECSLAUNCHTYPEVALUES_FARGATE=$w.AWSECSLAUNCHTYPEVALUES_EC2=$w.CloudPlatformValues=$w.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=$w.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=$w.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=$w.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=void 0;var b5=KH(),t2="cloud.provider",s2="cloud.account.id",e2="cloud.region",YP="cloud.availability_zone",ZP="cloud.platform",QP="aws.ecs.container.arn",XP="aws.ecs.cluster.arn",JP="aws.ecs.launchtype",WP="aws.ecs.task.arn",KP="aws.ecs.task.family",GP="aws.ecs.task.revision",FP="aws.eks.cluster.arn",HP="aws.log.group.names",VP="aws.log.group.arns",qP="aws.log.stream.names",zP="aws.log.stream.arns",BP="container.name",AP="container.id",UP="container.runtime",NP="container.image.name",OP="container.image.tag",DP="deployment.environment",TP="device.id",IP="device.model.identifier",$P="device.model.name",CP="faas.name",EP="faas.id",MP="faas.version",RP="faas.instance",PP="faas.max_memory",LP="host.id",wP="host.name",SP="host.type",fP="host.arch",kP="host.image.name",yP="host.image.id",vP="host.image.version",hP="k8s.cluster.name",jP="k8s.node.name",_P="k8s.node.uid",xP="k8s.namespace.name",bP="k8s.pod.uid",uP="k8s.pod.name",mP="k8s.container.name",gP="k8s.replicaset.uid",dP="k8s.replicaset.name",cP="k8s.deployment.uid",lP="k8s.deployment.name",nP="k8s.statefulset.uid",pP="k8s.statefulset.name",iP="k8s.daemonset.uid",rP="k8s.daemonset.name",aP="k8s.job.uid",oP="k8s.job.name",tP="k8s.cronjob.uid",sP="k8s.cronjob.name",eP="os.type",YL="os.description",ZL="os.name",QL="os.version",XL="process.pid",JL="process.executable.name",WL="process.executable.path",KL="process.command",GL="process.command_line",FL="process.command_args",HL="process.owner",VL="process.runtime.name",qL="process.runtime.version",zL="process.runtime.description",BL="service.name",AL="service.namespace",UL="service.instance.id",NL="service.version",OL="telemetry.sdk.name",DL="telemetry.sdk.language",TL="telemetry.sdk.version",IL="telemetry.auto.version",$L="webengine.name",CL="webengine.version",EL="webengine.description";$w.SEMRESATTRS_CLOUD_PROVIDER=t2;$w.SEMRESATTRS_CLOUD_ACCOUNT_ID=s2;$w.SEMRESATTRS_CLOUD_REGION=e2;$w.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=YP;$w.SEMRESATTRS_CLOUD_PLATFORM=ZP;$w.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=QP;$w.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=XP;$w.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=JP;$w.SEMRESATTRS_AWS_ECS_TASK_ARN=WP;$w.SEMRESATTRS_AWS_ECS_TASK_FAMILY=KP;$w.SEMRESATTRS_AWS_ECS_TASK_REVISION=GP;$w.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=FP;$w.SEMRESATTRS_AWS_LOG_GROUP_NAMES=HP;$w.SEMRESATTRS_AWS_LOG_GROUP_ARNS=VP;$w.SEMRESATTRS_AWS_LOG_STREAM_NAMES=qP;$w.SEMRESATTRS_AWS_LOG_STREAM_ARNS=zP;$w.SEMRESATTRS_CONTAINER_NAME=BP;$w.SEMRESATTRS_CONTAINER_ID=AP;$w.SEMRESATTRS_CONTAINER_RUNTIME=UP;$w.SEMRESATTRS_CONTAINER_IMAGE_NAME=NP;$w.SEMRESATTRS_CONTAINER_IMAGE_TAG=OP;$w.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=DP;$w.SEMRESATTRS_DEVICE_ID=TP;$w.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=IP;$w.SEMRESATTRS_DEVICE_MODEL_NAME=$P;$w.SEMRESATTRS_FAAS_NAME=CP;$w.SEMRESATTRS_FAAS_ID=EP;$w.SEMRESATTRS_FAAS_VERSION=MP;$w.SEMRESATTRS_FAAS_INSTANCE=RP;$w.SEMRESATTRS_FAAS_MAX_MEMORY=PP;$w.SEMRESATTRS_HOST_ID=LP;$w.SEMRESATTRS_HOST_NAME=wP;$w.SEMRESATTRS_HOST_TYPE=SP;$w.SEMRESATTRS_HOST_ARCH=fP;$w.SEMRESATTRS_HOST_IMAGE_NAME=kP;$w.SEMRESATTRS_HOST_IMAGE_ID=yP;$w.SEMRESATTRS_HOST_IMAGE_VERSION=vP;$w.SEMRESATTRS_K8S_CLUSTER_NAME=hP;$w.SEMRESATTRS_K8S_NODE_NAME=jP;$w.SEMRESATTRS_K8S_NODE_UID=_P;$w.SEMRESATTRS_K8S_NAMESPACE_NAME=xP;$w.SEMRESATTRS_K8S_POD_UID=bP;$w.SEMRESATTRS_K8S_POD_NAME=uP;$w.SEMRESATTRS_K8S_CONTAINER_NAME=mP;$w.SEMRESATTRS_K8S_REPLICASET_UID=gP;$w.SEMRESATTRS_K8S_REPLICASET_NAME=dP;$w.SEMRESATTRS_K8S_DEPLOYMENT_UID=cP;$w.SEMRESATTRS_K8S_DEPLOYMENT_NAME=lP;$w.SEMRESATTRS_K8S_STATEFULSET_UID=nP;$w.SEMRESATTRS_K8S_STATEFULSET_NAME=pP;$w.SEMRESATTRS_K8S_DAEMONSET_UID=iP;$w.SEMRESATTRS_K8S_DAEMONSET_NAME=rP;$w.SEMRESATTRS_K8S_JOB_UID=aP;$w.SEMRESATTRS_K8S_JOB_NAME=oP;$w.SEMRESATTRS_K8S_CRONJOB_UID=tP;$w.SEMRESATTRS_K8S_CRONJOB_NAME=sP;$w.SEMRESATTRS_OS_TYPE=eP;$w.SEMRESATTRS_OS_DESCRIPTION=YL;$w.SEMRESATTRS_OS_NAME=ZL;$w.SEMRESATTRS_OS_VERSION=QL;$w.SEMRESATTRS_PROCESS_PID=XL;$w.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=JL;$w.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=WL;$w.SEMRESATTRS_PROCESS_COMMAND=KL;$w.SEMRESATTRS_PROCESS_COMMAND_LINE=GL;$w.SEMRESATTRS_PROCESS_COMMAND_ARGS=FL;$w.SEMRESATTRS_PROCESS_OWNER=HL;$w.SEMRESATTRS_PROCESS_RUNTIME_NAME=VL;$w.SEMRESATTRS_PROCESS_RUNTIME_VERSION=qL;$w.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=zL;$w.SEMRESATTRS_SERVICE_NAME=BL;$w.SEMRESATTRS_SERVICE_NAMESPACE=AL;$w.SEMRESATTRS_SERVICE_INSTANCE_ID=UL;$w.SEMRESATTRS_SERVICE_VERSION=NL;$w.SEMRESATTRS_TELEMETRY_SDK_NAME=OL;$w.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=DL;$w.SEMRESATTRS_TELEMETRY_SDK_VERSION=TL;$w.SEMRESATTRS_TELEMETRY_AUTO_VERSION=IL;$w.SEMRESATTRS_WEBENGINE_NAME=$L;$w.SEMRESATTRS_WEBENGINE_VERSION=CL;$w.SEMRESATTRS_WEBENGINE_DESCRIPTION=EL;$w.SemanticResourceAttributes=(0,b5.createConstMap)([t2,s2,e2,YP,ZP,QP,XP,JP,WP,KP,GP,FP,HP,VP,qP,zP,BP,AP,UP,NP,OP,DP,TP,IP,$P,CP,EP,MP,RP,PP,LP,wP,SP,fP,kP,yP,vP,hP,jP,_P,xP,bP,uP,mP,gP,dP,cP,lP,nP,pP,iP,rP,aP,oP,tP,sP,eP,YL,ZL,QL,XL,JL,WL,KL,GL,FL,HL,VL,qL,zL,BL,AL,UL,NL,OL,DL,TL,IL,$L,CL,EL]);var ML="alibaba_cloud",RL="aws",PL="azure",LL="gcp";$w.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=ML;$w.CLOUDPROVIDERVALUES_AWS=RL;$w.CLOUDPROVIDERVALUES_AZURE=PL;$w.CLOUDPROVIDERVALUES_GCP=LL;$w.CloudProviderValues=(0,b5.createConstMap)([ML,RL,PL,LL]);var wL="alibaba_cloud_ecs",SL="alibaba_cloud_fc",fL="aws_ec2",kL="aws_ecs",yL="aws_eks",vL="aws_lambda",hL="aws_elastic_beanstalk",jL="azure_vm",_L="azure_container_instances",xL="azure_aks",bL="azure_functions",uL="azure_app_service",mL="gcp_compute_engine",gL="gcp_cloud_run",dL="gcp_kubernetes_engine",cL="gcp_cloud_functions",lL="gcp_app_engine";$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=wL;$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=SL;$w.CLOUDPLATFORMVALUES_AWS_EC2=fL;$w.CLOUDPLATFORMVALUES_AWS_ECS=kL;$w.CLOUDPLATFORMVALUES_AWS_EKS=yL;$w.CLOUDPLATFORMVALUES_AWS_LAMBDA=vL;$w.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=hL;$w.CLOUDPLATFORMVALUES_AZURE_VM=jL;$w.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=_L;$w.CLOUDPLATFORMVALUES_AZURE_AKS=xL;$w.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=bL;$w.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=uL;$w.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=mL;$w.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=gL;$w.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=dL;$w.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=cL;$w.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=lL;$w.CloudPlatformValues=(0,b5.createConstMap)([wL,SL,fL,kL,yL,vL,hL,jL,_L,xL,bL,uL,mL,gL,dL,cL,lL]);var nL="ec2",pL="fargate";$w.AWSECSLAUNCHTYPEVALUES_EC2=nL;$w.AWSECSLAUNCHTYPEVALUES_FARGATE=pL;$w.AwsEcsLaunchtypeValues=(0,b5.createConstMap)([nL,pL]);var iL="amd64",rL="arm32",aL="arm64",oL="ia64",tL="ppc32",sL="ppc64",eL="x86";$w.HOSTARCHVALUES_AMD64=iL;$w.HOSTARCHVALUES_ARM32=rL;$w.HOSTARCHVALUES_ARM64=aL;$w.HOSTARCHVALUES_IA64=oL;$w.HOSTARCHVALUES_PPC32=tL;$w.HOSTARCHVALUES_PPC64=sL;$w.HOSTARCHVALUES_X86=eL;$w.HostArchValues=(0,b5.createConstMap)([iL,rL,aL,oL,tL,sL,eL]);var Yw="windows",Zw="linux",Qw="darwin",Xw="freebsd",Jw="netbsd",Ww="openbsd",Kw="dragonflybsd",Gw="hpux",Fw="aix",Hw="solaris",Vw="z_os";$w.OSTYPEVALUES_WINDOWS=Yw;$w.OSTYPEVALUES_LINUX=Zw;$w.OSTYPEVALUES_DARWIN=Qw;$w.OSTYPEVALUES_FREEBSD=Xw;$w.OSTYPEVALUES_NETBSD=Jw;$w.OSTYPEVALUES_OPENBSD=Ww;$w.OSTYPEVALUES_DRAGONFLYBSD=Kw;$w.OSTYPEVALUES_HPUX=Gw;$w.OSTYPEVALUES_AIX=Fw;$w.OSTYPEVALUES_SOLARIS=Hw;$w.OSTYPEVALUES_Z_OS=Vw;$w.OsTypeValues=(0,b5.createConstMap)([Yw,Zw,Qw,Xw,Jw,Ww,Kw,Gw,Fw,Hw,Vw]);var qw="cpp",zw="dotnet",Bw="erlang",Aw="go",Uw="java",Nw="nodejs",Ow="php",Dw="python",Tw="ruby",Iw="webjs";$w.TELEMETRYSDKLANGUAGEVALUES_CPP=qw;$w.TELEMETRYSDKLANGUAGEVALUES_DOTNET=zw;$w.TELEMETRYSDKLANGUAGEVALUES_ERLANG=Bw;$w.TELEMETRYSDKLANGUAGEVALUES_GO=Aw;$w.TELEMETRYSDKLANGUAGEVALUES_JAVA=Uw;$w.TELEMETRYSDKLANGUAGEVALUES_NODEJS=Nw;$w.TELEMETRYSDKLANGUAGEVALUES_PHP=Ow;$w.TELEMETRYSDKLANGUAGEVALUES_PYTHON=Dw;$w.TELEMETRYSDKLANGUAGEVALUES_RUBY=Tw;$w.TELEMETRYSDKLANGUAGEVALUES_WEBJS=Iw;$w.TelemetrySdkLanguageValues=(0,b5.createConstMap)([qw,zw,Bw,Aw,Uw,Nw,Ow,Dw,Tw,Iw])});var Pw=H0((u5)=>{var bW0=u5&&u5.__createBinding||(Object.create?function(Y,Z,W,H){if(H===void 0)H=W;var F=Object.getOwnPropertyDescriptor(Z,W);if(!F||("get"in F?!Z.__esModule:F.writable||F.configurable))F={enumerable:!0,get:function(){return Z[W]}};Object.defineProperty(Y,H,F)}:function(Y,Z,W,H){if(H===void 0)H=W;Y[H]=Z[W]}),uW0=u5&&u5.__exportStar||function(Y,Z){for(var W in Y)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(Z,W))bW0(Z,Y,W)};Object.defineProperty(u5,"__esModule",{value:!0});uW0(Rw(),u5)});var kw=H0((Lw)=>{Object.defineProperty(Lw,"__esModule",{value:!0});Lw.ATTR_EXCEPTION_TYPE=Lw.ATTR_EXCEPTION_STACKTRACE=Lw.ATTR_EXCEPTION_MESSAGE=Lw.ATTR_EXCEPTION_ESCAPED=Lw.ERROR_TYPE_VALUE_OTHER=Lw.ATTR_ERROR_TYPE=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_POH=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_LOH=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0=Lw.ATTR_DOTNET_GC_HEAP_GENERATION=Lw.DB_SYSTEM_NAME_VALUE_POSTGRESQL=Lw.DB_SYSTEM_NAME_VALUE_MYSQL=Lw.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER=Lw.DB_SYSTEM_NAME_VALUE_MARIADB=Lw.ATTR_DB_SYSTEM_NAME=Lw.ATTR_DB_STORED_PROCEDURE_NAME=Lw.ATTR_DB_RESPONSE_STATUS_CODE=Lw.ATTR_DB_QUERY_TEXT=Lw.ATTR_DB_QUERY_SUMMARY=Lw.ATTR_DB_OPERATION_NAME=Lw.ATTR_DB_OPERATION_BATCH_SIZE=Lw.ATTR_DB_NAMESPACE=Lw.ATTR_DB_COLLECTION_NAME=Lw.ATTR_CODE_STACKTRACE=Lw.ATTR_CODE_LINE_NUMBER=Lw.ATTR_CODE_FUNCTION_NAME=Lw.ATTR_CODE_FILE_PATH=Lw.ATTR_CODE_COLUMN_NUMBER=Lw.ATTR_CLIENT_PORT=Lw.ATTR_CLIENT_ADDRESS=Lw.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED=Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS=Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE=Lw.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS=Lw.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK=Lw.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED=Lw.ATTR_ASPNETCORE_RATE_LIMITING_RESULT=Lw.ATTR_ASPNETCORE_RATE_LIMITING_POLICY=Lw.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED=Lw.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT=void 0;Lw.OTEL_STATUS_CODE_VALUE_ERROR=Lw.ATTR_OTEL_STATUS_CODE=Lw.ATTR_OTEL_SCOPE_VERSION=Lw.ATTR_OTEL_SCOPE_NAME=Lw.NETWORK_TYPE_VALUE_IPV6=Lw.NETWORK_TYPE_VALUE_IPV4=Lw.ATTR_NETWORK_TYPE=Lw.NETWORK_TRANSPORT_VALUE_UNIX=Lw.NETWORK_TRANSPORT_VALUE_UDP=Lw.NETWORK_TRANSPORT_VALUE_TCP=Lw.NETWORK_TRANSPORT_VALUE_QUIC=Lw.NETWORK_TRANSPORT_VALUE_PIPE=Lw.ATTR_NETWORK_TRANSPORT=Lw.ATTR_NETWORK_PROTOCOL_VERSION=Lw.ATTR_NETWORK_PROTOCOL_NAME=Lw.ATTR_NETWORK_PEER_PORT=Lw.ATTR_NETWORK_PEER_ADDRESS=Lw.ATTR_NETWORK_LOCAL_PORT=Lw.ATTR_NETWORK_LOCAL_ADDRESS=Lw.JVM_THREAD_STATE_VALUE_WAITING=Lw.JVM_THREAD_STATE_VALUE_TIMED_WAITING=Lw.JVM_THREAD_STATE_VALUE_TERMINATED=Lw.JVM_THREAD_STATE_VALUE_RUNNABLE=Lw.JVM_THREAD_STATE_VALUE_NEW=Lw.JVM_THREAD_STATE_VALUE_BLOCKED=Lw.ATTR_JVM_THREAD_STATE=Lw.ATTR_JVM_THREAD_DAEMON=Lw.JVM_MEMORY_TYPE_VALUE_NON_HEAP=Lw.JVM_MEMORY_TYPE_VALUE_HEAP=Lw.ATTR_JVM_MEMORY_TYPE=Lw.ATTR_JVM_MEMORY_POOL_NAME=Lw.ATTR_JVM_GC_NAME=Lw.ATTR_JVM_GC_ACTION=Lw.ATTR_HTTP_ROUTE=Lw.ATTR_HTTP_RESPONSE_STATUS_CODE=Lw.ATTR_HTTP_RESPONSE_HEADER=Lw.ATTR_HTTP_REQUEST_RESEND_COUNT=Lw.ATTR_HTTP_REQUEST_METHOD_ORIGINAL=Lw.HTTP_REQUEST_METHOD_VALUE_TRACE=Lw.HTTP_REQUEST_METHOD_VALUE_PUT=Lw.HTTP_REQUEST_METHOD_VALUE_POST=Lw.HTTP_REQUEST_METHOD_VALUE_PATCH=Lw.HTTP_REQUEST_METHOD_VALUE_OPTIONS=Lw.HTTP_REQUEST_METHOD_VALUE_HEAD=Lw.HTTP_REQUEST_METHOD_VALUE_GET=Lw.HTTP_REQUEST_METHOD_VALUE_DELETE=Lw.HTTP_REQUEST_METHOD_VALUE_CONNECT=Lw.HTTP_REQUEST_METHOD_VALUE_OTHER=Lw.ATTR_HTTP_REQUEST_METHOD=Lw.ATTR_HTTP_REQUEST_HEADER=void 0;Lw.ATTR_USER_AGENT_ORIGINAL=Lw.ATTR_URL_SCHEME=Lw.ATTR_URL_QUERY=Lw.ATTR_URL_PATH=Lw.ATTR_URL_FULL=Lw.ATTR_URL_FRAGMENT=Lw.ATTR_TELEMETRY_SDK_VERSION=Lw.ATTR_TELEMETRY_SDK_NAME=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUST=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PHP=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_GO=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_CPP=Lw.ATTR_TELEMETRY_SDK_LANGUAGE=Lw.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS=Lw.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS=Lw.SIGNALR_TRANSPORT_VALUE_LONG_POLLING=Lw.ATTR_SIGNALR_TRANSPORT=Lw.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT=Lw.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE=Lw.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN=Lw.ATTR_SIGNALR_CONNECTION_STATUS=Lw.ATTR_SERVICE_VERSION=Lw.ATTR_SERVICE_NAMESPACE=Lw.ATTR_SERVICE_NAME=Lw.ATTR_SERVICE_INSTANCE_ID=Lw.ATTR_SERVER_PORT=Lw.ATTR_SERVER_ADDRESS=Lw.ATTR_OTEL_STATUS_DESCRIPTION=Lw.OTEL_STATUS_CODE_VALUE_OK=void 0;Lw.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT="aspnetcore.diagnostics.exception.result";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED="aborted";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED="handled";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED="skipped";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED="unhandled";Lw.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE="aspnetcore.diagnostics.handler.type";Lw.ATTR_ASPNETCORE_RATE_LIMITING_POLICY="aspnetcore.rate_limiting.policy";Lw.ATTR_ASPNETCORE_RATE_LIMITING_RESULT="aspnetcore.rate_limiting.result";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED="acquired";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER="endpoint_limiter";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER="global_limiter";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED="request_canceled";Lw.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED="aspnetcore.request.is_unhandled";Lw.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK="aspnetcore.routing.is_fallback";Lw.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS="aspnetcore.routing.match_status";Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE="failure";Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS="success";Lw.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED="aspnetcore.user.is_authenticated";Lw.ATTR_CLIENT_ADDRESS="client.address";Lw.ATTR_CLIENT_PORT="client.port";Lw.ATTR_CODE_COLUMN_NUMBER="code.column.number";Lw.ATTR_CODE_FILE_PATH="code.file.path";Lw.ATTR_CODE_FUNCTION_NAME="code.function.name";Lw.ATTR_CODE_LINE_NUMBER="code.line.number";Lw.ATTR_CODE_STACKTRACE="code.stacktrace";Lw.ATTR_DB_COLLECTION_NAME="db.collection.name";Lw.ATTR_DB_NAMESPACE="db.namespace";Lw.ATTR_DB_OPERATION_BATCH_SIZE="db.operation.batch.size";Lw.ATTR_DB_OPERATION_NAME="db.operation.name";Lw.ATTR_DB_QUERY_SUMMARY="db.query.summary";Lw.ATTR_DB_QUERY_TEXT="db.query.text";Lw.ATTR_DB_RESPONSE_STATUS_CODE="db.response.status_code";Lw.ATTR_DB_STORED_PROCEDURE_NAME="db.stored_procedure.name";Lw.ATTR_DB_SYSTEM_NAME="db.system.name";Lw.DB_SYSTEM_NAME_VALUE_MARIADB="mariadb";Lw.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER="microsoft.sql_server";Lw.DB_SYSTEM_NAME_VALUE_MYSQL="mysql";Lw.DB_SYSTEM_NAME_VALUE_POSTGRESQL="postgresql";Lw.ATTR_DOTNET_GC_HEAP_GENERATION="dotnet.gc.heap.generation";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0="gen0";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1="gen1";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2="gen2";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_LOH="loh";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_POH="poh";Lw.ATTR_ERROR_TYPE="error.type";Lw.ERROR_TYPE_VALUE_OTHER="_OTHER";Lw.ATTR_EXCEPTION_ESCAPED="exception.escaped";Lw.ATTR_EXCEPTION_MESSAGE="exception.message";Lw.ATTR_EXCEPTION_STACKTRACE="exception.stacktrace";Lw.ATTR_EXCEPTION_TYPE="exception.type";var mW0=(Y)=>`http.request.header.${Y}`;Lw.ATTR_HTTP_REQUEST_HEADER=mW0;Lw.ATTR_HTTP_REQUEST_METHOD="http.request.method";Lw.HTTP_REQUEST_METHOD_VALUE_OTHER="_OTHER";Lw.HTTP_REQUEST_METHOD_VALUE_CONNECT="CONNECT";Lw.HTTP_REQUEST_METHOD_VALUE_DELETE="DELETE";Lw.HTTP_REQUEST_METHOD_VALUE_GET="GET";Lw.HTTP_REQUEST_METHOD_VALUE_HEAD="HEAD";Lw.HTTP_REQUEST_METHOD_VALUE_OPTIONS="OPTIONS";Lw.HTTP_REQUEST_METHOD_VALUE_PATCH="PATCH";Lw.HTTP_REQUEST_METHOD_VALUE_POST="POST";Lw.HTTP_REQUEST_METHOD_VALUE_PUT="PUT";Lw.HTTP_REQUEST_METHOD_VALUE_TRACE="TRACE";Lw.ATTR_HTTP_REQUEST_METHOD_ORIGINAL="http.request.method_original";Lw.ATTR_HTTP_REQUEST_RESEND_COUNT="http.request.resend_count";var gW0=(Y)=>`http.response.header.${Y}`;Lw.ATTR_HTTP_RESPONSE_HEADER=gW0;Lw.ATTR_HTTP_RESPONSE_STATUS_CODE="http.response.status_code";Lw.ATTR_HTTP_ROUTE="http.route";Lw.ATTR_JVM_GC_ACTION="jvm.gc.action";Lw.ATTR_JVM_GC_NAME="jvm.gc.name";Lw.ATTR_JVM_MEMORY_POOL_NAME="jvm.memory.pool.name";Lw.ATTR_JVM_MEMORY_TYPE="jvm.memory.type";Lw.JVM_MEMORY_TYPE_VALUE_HEAP="heap";Lw.JVM_MEMORY_TYPE_VALUE_NON_HEAP="non_heap";Lw.ATTR_JVM_THREAD_DAEMON="jvm.thread.daemon";Lw.ATTR_JVM_THREAD_STATE="jvm.thread.state";Lw.JVM_THREAD_STATE_VALUE_BLOCKED="blocked";Lw.JVM_THREAD_STATE_VALUE_NEW="new";Lw.JVM_THREAD_STATE_VALUE_RUNNABLE="runnable";Lw.JVM_THREAD_STATE_VALUE_TERMINATED="terminated";Lw.JVM_THREAD_STATE_VALUE_TIMED_WAITING="timed_waiting";Lw.JVM_THREAD_STATE_VALUE_WAITING="waiting";Lw.ATTR_NETWORK_LOCAL_ADDRESS="network.local.address";Lw.ATTR_NETWORK_LOCAL_PORT="network.local.port";Lw.ATTR_NETWORK_PEER_ADDRESS="network.peer.address";Lw.ATTR_NETWORK_PEER_PORT="network.peer.port";Lw.ATTR_NETWORK_PROTOCOL_NAME="network.protocol.name";Lw.ATTR_NETWORK_PROTOCOL_VERSION="network.protocol.version";Lw.ATTR_NETWORK_TRANSPORT="network.transport";Lw.NETWORK_TRANSPORT_VALUE_PIPE="pipe";Lw.NETWORK_TRANSPORT_VALUE_QUIC="quic";Lw.NETWORK_TRANSPORT_VALUE_TCP="tcp";Lw.NETWORK_TRANSPORT_VALUE_UDP="udp";Lw.NETWORK_TRANSPORT_VALUE_UNIX="unix";Lw.ATTR_NETWORK_TYPE="network.type";Lw.NETWORK_TYPE_VALUE_IPV4="ipv4";Lw.NETWORK_TYPE_VALUE_IPV6="ipv6";Lw.ATTR_OTEL_SCOPE_NAME="otel.scope.name";Lw.ATTR_OTEL_SCOPE_VERSION="otel.scope.version";Lw.ATTR_OTEL_STATUS_CODE="otel.status_code";Lw.OTEL_STATUS_CODE_VALUE_ERROR="ERROR";Lw.OTEL_STATUS_CODE_VALUE_OK="OK";Lw.ATTR_OTEL_STATUS_DESCRIPTION="otel.status_description";Lw.ATTR_SERVER_ADDRESS="server.address";Lw.ATTR_SERVER_PORT="server.port";Lw.ATTR_SERVICE_INSTANCE_ID="service.instance.id";Lw.ATTR_SERVICE_NAME="service.name";Lw.ATTR_SERVICE_NAMESPACE="service.namespace";Lw.ATTR_SERVICE_VERSION="service.version";Lw.ATTR_SIGNALR_CONNECTION_STATUS="signalr.connection.status";Lw.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN="app_shutdown";Lw.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE="normal_closure";Lw.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT="timeout";Lw.ATTR_SIGNALR_TRANSPORT="signalr.transport";Lw.SIGNALR_TRANSPORT_VALUE_LONG_POLLING="long_polling";Lw.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS="server_sent_events";Lw.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS="web_sockets";Lw.ATTR_TELEMETRY_SDK_LANGUAGE="telemetry.sdk.language";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_CPP="cpp";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET="dotnet";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG="erlang";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_GO="go";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA="java";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS="nodejs";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PHP="php";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON="python";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY="ruby";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUST="rust";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT="swift";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS="webjs";Lw.ATTR_TELEMETRY_SDK_NAME="telemetry.sdk.name";Lw.ATTR_TELEMETRY_SDK_VERSION="telemetry.sdk.version";Lw.ATTR_URL_FRAGMENT="url.fragment";Lw.ATTR_URL_FULL="url.full";Lw.ATTR_URL_PATH="url.path";Lw.ATTR_URL_QUERY="url.query";Lw.ATTR_URL_SCHEME="url.scheme";Lw.ATTR_USER_AGENT_ORIGINAL="user_agent.original"});var jw=H0((yw)=>{Object.defineProperty(yw,"__esModule",{value:!0});yw.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS=yw.METRIC_KESTREL_UPGRADED_CONNECTIONS=yw.METRIC_KESTREL_TLS_HANDSHAKE_DURATION=yw.METRIC_KESTREL_REJECTED_CONNECTIONS=yw.METRIC_KESTREL_QUEUED_REQUESTS=yw.METRIC_KESTREL_QUEUED_CONNECTIONS=yw.METRIC_KESTREL_CONNECTION_DURATION=yw.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES=yw.METRIC_KESTREL_ACTIVE_CONNECTIONS=yw.METRIC_JVM_THREAD_COUNT=yw.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC=yw.METRIC_JVM_MEMORY_USED=yw.METRIC_JVM_MEMORY_LIMIT=yw.METRIC_JVM_MEMORY_COMMITTED=yw.METRIC_JVM_GC_DURATION=yw.METRIC_JVM_CPU_TIME=yw.METRIC_JVM_CPU_RECENT_UTILIZATION=yw.METRIC_JVM_CPU_COUNT=yw.METRIC_JVM_CLASS_UNLOADED=yw.METRIC_JVM_CLASS_LOADED=yw.METRIC_JVM_CLASS_COUNT=yw.METRIC_HTTP_SERVER_REQUEST_DURATION=yw.METRIC_HTTP_CLIENT_REQUEST_DURATION=yw.METRIC_DOTNET_TIMER_COUNT=yw.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT=yw.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT=yw.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH=yw.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET=yw.METRIC_DOTNET_PROCESS_CPU_TIME=yw.METRIC_DOTNET_PROCESS_CPU_COUNT=yw.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS=yw.METRIC_DOTNET_JIT_COMPILED_METHODS=yw.METRIC_DOTNET_JIT_COMPILED_IL_SIZE=yw.METRIC_DOTNET_JIT_COMPILATION_TIME=yw.METRIC_DOTNET_GC_PAUSE_TIME=yw.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE=yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE=yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE=yw.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED=yw.METRIC_DOTNET_GC_COLLECTIONS=yw.METRIC_DOTNET_EXCEPTIONS=yw.METRIC_DOTNET_ASSEMBLY_COUNT=yw.METRIC_DB_CLIENT_OPERATION_DURATION=yw.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS=yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS=yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION=yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE=yw.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS=yw.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES=yw.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS=void 0;yw.METRIC_SIGNALR_SERVER_CONNECTION_DURATION=void 0;yw.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS="aspnetcore.diagnostics.exceptions";yw.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES="aspnetcore.rate_limiting.active_request_leases";yw.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS="aspnetcore.rate_limiting.queued_requests";yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE="aspnetcore.rate_limiting.request.time_in_queue";yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION="aspnetcore.rate_limiting.request_lease.duration";yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS="aspnetcore.rate_limiting.requests";yw.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS="aspnetcore.routing.match_attempts";yw.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration";yw.METRIC_DOTNET_ASSEMBLY_COUNT="dotnet.assembly.count";yw.METRIC_DOTNET_EXCEPTIONS="dotnet.exceptions";yw.METRIC_DOTNET_GC_COLLECTIONS="dotnet.gc.collections";yw.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED="dotnet.gc.heap.total_allocated";yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE="dotnet.gc.last_collection.heap.fragmentation.size";yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE="dotnet.gc.last_collection.heap.size";yw.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE="dotnet.gc.last_collection.memory.committed_size";yw.METRIC_DOTNET_GC_PAUSE_TIME="dotnet.gc.pause.time";yw.METRIC_DOTNET_JIT_COMPILATION_TIME="dotnet.jit.compilation.time";yw.METRIC_DOTNET_JIT_COMPILED_IL_SIZE="dotnet.jit.compiled_il.size";yw.METRIC_DOTNET_JIT_COMPILED_METHODS="dotnet.jit.compiled_methods";yw.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS="dotnet.monitor.lock_contentions";yw.METRIC_DOTNET_PROCESS_CPU_COUNT="dotnet.process.cpu.count";yw.METRIC_DOTNET_PROCESS_CPU_TIME="dotnet.process.cpu.time";yw.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET="dotnet.process.memory.working_set";yw.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH="dotnet.thread_pool.queue.length";yw.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT="dotnet.thread_pool.thread.count";yw.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT="dotnet.thread_pool.work_item.count";yw.METRIC_DOTNET_TIMER_COUNT="dotnet.timer.count";yw.METRIC_HTTP_CLIENT_REQUEST_DURATION="http.client.request.duration";yw.METRIC_HTTP_SERVER_REQUEST_DURATION="http.server.request.duration";yw.METRIC_JVM_CLASS_COUNT="jvm.class.count";yw.METRIC_JVM_CLASS_LOADED="jvm.class.loaded";yw.METRIC_JVM_CLASS_UNLOADED="jvm.class.unloaded";yw.METRIC_JVM_CPU_COUNT="jvm.cpu.count";yw.METRIC_JVM_CPU_RECENT_UTILIZATION="jvm.cpu.recent_utilization";yw.METRIC_JVM_CPU_TIME="jvm.cpu.time";yw.METRIC_JVM_GC_DURATION="jvm.gc.duration";yw.METRIC_JVM_MEMORY_COMMITTED="jvm.memory.committed";yw.METRIC_JVM_MEMORY_LIMIT="jvm.memory.limit";yw.METRIC_JVM_MEMORY_USED="jvm.memory.used";yw.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC="jvm.memory.used_after_last_gc";yw.METRIC_JVM_THREAD_COUNT="jvm.thread.count";yw.METRIC_KESTREL_ACTIVE_CONNECTIONS="kestrel.active_connections";yw.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES="kestrel.active_tls_handshakes";yw.METRIC_KESTREL_CONNECTION_DURATION="kestrel.connection.duration";yw.METRIC_KESTREL_QUEUED_CONNECTIONS="kestrel.queued_connections";yw.METRIC_KESTREL_QUEUED_REQUESTS="kestrel.queued_requests";yw.METRIC_KESTREL_REJECTED_CONNECTIONS="kestrel.rejected_connections";yw.METRIC_KESTREL_TLS_HANDSHAKE_DURATION="kestrel.tls_handshake.duration";yw.METRIC_KESTREL_UPGRADED_CONNECTIONS="kestrel.upgraded_connections";yw.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS="signalr.server.active_connections";yw.METRIC_SIGNALR_SERVER_CONNECTION_DURATION="signalr.server.connection.duration"});var bw=H0((_w)=>{Object.defineProperty(_w,"__esModule",{value:!0});_w.EVENT_EXCEPTION=void 0;_w.EVENT_EXCEPTION="exception"});var m5=H0((E9)=>{var HF0=E9&&E9.__createBinding||(Object.create?function(Y,Z,W,H){if(H===void 0)H=W;var F=Object.getOwnPropertyDescriptor(Z,W);if(!F||("get"in F?!Z.__esModule:F.writable||F.configurable))F={enumerable:!0,get:function(){return Z[W]}};Object.defineProperty(Y,H,F)}:function(Y,Z,W,H){if(H===void 0)H=W;Y[H]=Z[W]}),mZ=E9&&E9.__exportStar||function(Y,Z){for(var W in Y)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(Z,W))HF0(Z,Y,W)};Object.defineProperty(E9,"__esModule",{value:!0});mZ(o2(),E9);mZ(Pw(),E9);mZ(kw(),E9);mZ(jw(),E9);mZ(bw(),E9)});var gw=H0((uw)=>{Object.defineProperty(uw,"__esModule",{value:!0});uw.ATTR_PROCESS_RUNTIME_NAME=void 0;uw.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var lw=H0((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});dw.SDK_INFO=void 0;var VF0=o$(),UJ=m5(),qF0=gw();dw.SDK_INFO={[UJ.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[qF0.ATTR_PROCESS_RUNTIME_NAME]:"node",[UJ.ATTR_TELEMETRY_SDK_LANGUAGE]:UJ.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[UJ.ATTR_TELEMETRY_SDK_VERSION]:VF0.VERSION}});var pw=H0((l4)=>{Object.defineProperty(l4,"__esModule",{value:!0});l4.otperformance=l4.SDK_INFO=l4._globalThis=l4.getStringListFromEnv=l4.getNumberFromEnv=l4.getBooleanFromEnv=l4.getStringFromEnv=void 0;var NJ=l$();Object.defineProperty(l4,"getStringFromEnv",{enumerable:!0,get:function(){return NJ.getStringFromEnv}});Object.defineProperty(l4,"getBooleanFromEnv",{enumerable:!0,get:function(){return NJ.getBooleanFromEnv}});Object.defineProperty(l4,"getNumberFromEnv",{enumerable:!0,get:function(){return NJ.getNumberFromEnv}});Object.defineProperty(l4,"getStringListFromEnv",{enumerable:!0,get:function(){return NJ.getStringListFromEnv}});var zF0=i$();Object.defineProperty(l4,"_globalThis",{enumerable:!0,get:function(){return zF0._globalThis}});var BF0=lw();Object.defineProperty(l4,"SDK_INFO",{enumerable:!0,get:function(){return BF0.SDK_INFO}});l4.otperformance=performance});var GH=H0((T4)=>{Object.defineProperty(T4,"__esModule",{value:!0});T4.getStringListFromEnv=T4.getNumberFromEnv=T4.getStringFromEnv=T4.getBooleanFromEnv=T4.otperformance=T4._globalThis=T4.SDK_INFO=void 0;var g5=pw();Object.defineProperty(T4,"SDK_INFO",{enumerable:!0,get:function(){return g5.SDK_INFO}});Object.defineProperty(T4,"_globalThis",{enumerable:!0,get:function(){return g5._globalThis}});Object.defineProperty(T4,"otperformance",{enumerable:!0,get:function(){return g5.otperformance}});Object.defineProperty(T4,"getBooleanFromEnv",{enumerable:!0,get:function(){return g5.getBooleanFromEnv}});Object.defineProperty(T4,"getStringFromEnv",{enumerable:!0,get:function(){return g5.getStringFromEnv}});Object.defineProperty(T4,"getNumberFromEnv",{enumerable:!0,get:function(){return g5.getNumberFromEnv}});Object.defineProperty(T4,"getStringListFromEnv",{enumerable:!0,get:function(){return g5.getStringListFromEnv}})});var sw=H0((ow)=>{Object.defineProperty(ow,"__esModule",{value:!0});ow.addHrTimes=ow.isTimeInput=ow.isTimeInputHrTime=ow.hrTimeToMicroseconds=ow.hrTimeToMilliseconds=ow.hrTimeToNanoseconds=ow.hrTimeToTimeStamp=ow.hrTimeDuration=ow.timeInputToHrTime=ow.hrTime=ow.getTimeOrigin=ow.millisToHrTime=void 0;var OJ=GH(),iw=9,UF0=6,NF0=Math.pow(10,UF0),DJ=Math.pow(10,iw);function gZ(Y){let Z=Y/1000,W=Math.trunc(Z),H=Math.round(Y%1000*NF0);return[W,H]}ow.millisToHrTime=gZ;function OF0(){return OJ.otperformance.timeOrigin}ow.getTimeOrigin=OF0;function rw(Y){let Z=gZ(OJ.otperformance.timeOrigin),W=gZ(typeof Y==="number"?Y:OJ.otperformance.now());return aw(Z,W)}ow.hrTime=rw;function DF0(Y){if(FH(Y))return Y;else if(typeof Y==="number")if(Y<OJ.otperformance.timeOrigin)return rw(Y);else return gZ(Y);else if(Y instanceof Date)return gZ(Y.getTime());else throw TypeError("Invalid input type")}ow.timeInputToHrTime=DF0;function TF0(Y,Z){let W=Z[0]-Y[0],H=Z[1]-Y[1];if(H<0)W-=1,H+=DJ;return[W,H]}ow.hrTimeDuration=TF0;function IF0(Y){let Z=iw,W=`${"0".repeat(Z)}${Y[1]}Z`,H=W.substring(W.length-Z-1);return new Date(Y[0]*1000).toISOString().replace("000Z",H)}ow.hrTimeToTimeStamp=IF0;function $F0(Y){return Y[0]*DJ+Y[1]}ow.hrTimeToNanoseconds=$F0;function CF0(Y){return Y[0]*1000+Y[1]/1e6}ow.hrTimeToMilliseconds=CF0;function EF0(Y){return Y[0]*1e6+Y[1]/1000}ow.hrTimeToMicroseconds=EF0;function FH(Y){return Array.isArray(Y)&&Y.length===2&&typeof Y[0]==="number"&&typeof Y[1]==="number"}ow.isTimeInputHrTime=FH;function MF0(Y){return FH(Y)||typeof Y==="number"||Y instanceof Date}ow.isTimeInput=MF0;function aw(Y,Z){let W=[Y[0]+Z[0],Y[1]+Z[1]];if(W[1]>=DJ)W[1]-=DJ,W[0]+=1;return W}ow.addHrTimes=aw});var ZS=H0((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});ew.unrefTimer=void 0;function _F0(Y){if(typeof Y!=="number")Y.unref()}ew.unrefTimer=_F0});var XS=H0((QS)=>{Object.defineProperty(QS,"__esModule",{value:!0});QS.ExportResultCode=void 0;var xF0;(function(Y){Y[Y.SUCCESS=0]="SUCCESS",Y[Y.FAILED=1]="FAILED"})(xF0=QS.ExportResultCode||(QS.ExportResultCode={}))});var FS=H0((KS)=>{Object.defineProperty(KS,"__esModule",{value:!0});KS.CompositePropagator=void 0;var JS=f1();class WS{_propagators;_fields;constructor(Y={}){this._propagators=Y.propagators??[],this._fields=Array.from(new Set(this._propagators.map((Z)=>typeof Z.fields==="function"?Z.fields():[]).reduce((Z,W)=>Z.concat(W),[])))}inject(Y,Z,W){for(let H of this._propagators)try{H.inject(Y,Z,W)}catch(F){JS.diag.warn(`Failed to inject with ${H.constructor.name}. Err: ${F.message}`)}}extract(Y,Z,W){return this._propagators.reduce((H,F)=>{try{return F.extract(H,Z,W)}catch(X){JS.diag.warn(`Failed to extract with ${F.constructor.name}. Err: ${X.message}`)}return H},Y)}fields(){return this._fields.slice()}}KS.CompositePropagator=WS});var qS=H0((HS)=>{Object.defineProperty(HS,"__esModule",{value:!0});HS.validateValue=HS.validateKey=void 0;var VH="[_0-9a-z-*/]",bF0=`[a-z]${VH}{0,255}`,uF0=`[a-z0-9]${VH}{0,240}@[a-z]${VH}{0,13}`,mF0=new RegExp(`^(?:${bF0}|${uF0})$`),gF0=/^[ -~]{0,255}[!-~]$/,dF0=/,|=/;function cF0(Y){return mF0.test(Y)}HS.validateKey=cF0;function lF0(Y){return gF0.test(Y)&&!dF0.test(Y)}HS.validateValue=lF0});var zH=H0((NS)=>{Object.defineProperty(NS,"__esModule",{value:!0});NS.TraceState=void 0;var zS=qS(),BS=32,pF0=512,AS=",",US="=";class qH{_internalState=new Map;constructor(Y){if(Y)this._parse(Y)}set(Y,Z){let W=this._clone();if(W._internalState.has(Y))W._internalState.delete(Y);return W._internalState.set(Y,Z),W}unset(Y){let Z=this._clone();return Z._internalState.delete(Y),Z}get(Y){return this._internalState.get(Y)}serialize(){return this._keys().reduce((Y,Z)=>{return Y.push(Z+US+this.get(Z)),Y},[]).join(AS)}_parse(Y){if(Y.length>pF0)return;if(this._internalState=Y.split(AS).reverse().reduce((Z,W)=>{let H=W.trim(),F=H.indexOf(US);if(F!==-1){let X=H.slice(0,F),J=H.slice(F+1,W.length);if((0,zS.validateKey)(X)&&(0,zS.validateValue)(J))Z.set(X,J)}return Z},new Map),this._internalState.size>BS)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BS))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let Y=new qH;return Y._internalState=new Map(this._internalState),Y}}NS.TraceState=qH});var CS=H0((IS)=>{Object.defineProperty(IS,"__esModule",{value:!0});IS.W3CTraceContextPropagator=IS.parseTraceParent=IS.TRACE_STATE_HEADER=IS.TRACE_PARENT_HEADER=void 0;var TJ=f1(),iF0=uZ(),rF0=zH();IS.TRACE_PARENT_HEADER="traceparent";IS.TRACE_STATE_HEADER="tracestate";var aF0="00",oF0="(?!ff)[\\da-f]{2}",tF0="(?![0]{32})[\\da-f]{32}",sF0="(?![0]{16})[\\da-f]{16}",eF0="[\\da-f]{2}",YH0=new RegExp(`^\\s?(${oF0})-(${tF0})-(${sF0})-(${eF0})(-.*)?\\s?$`);function DS(Y){let Z=YH0.exec(Y);if(!Z)return null;if(Z[1]==="00"&&Z[5])return null;return{traceId:Z[2],spanId:Z[3],traceFlags:parseInt(Z[4],16)}}IS.parseTraceParent=DS;class TS{inject(Y,Z,W){let H=TJ.trace.getSpanContext(Y);if(!H||(0,iF0.isTracingSuppressed)(Y)||!(0,TJ.isSpanContextValid)(H))return;let F=`${aF0}-${H.traceId}-${H.spanId}-0${Number(H.traceFlags||TJ.TraceFlags.NONE).toString(16)}`;if(W.set(Z,IS.TRACE_PARENT_HEADER,F),H.traceState)W.set(Z,IS.TRACE_STATE_HEADER,H.traceState.serialize())}extract(Y,Z,W){let H=W.get(Z,IS.TRACE_PARENT_HEADER);if(!H)return Y;let F=Array.isArray(H)?H[0]:H;if(typeof F!=="string")return Y;let X=DS(F);if(!X)return Y;X.isRemote=!0;let J=W.get(Z,IS.TRACE_STATE_HEADER);if(J){let Q=Array.isArray(J)?J.join(","):J;X.traceState=new rF0.TraceState(typeof Q==="string"?Q:void 0)}return TJ.trace.setSpanContext(Y,X)}fields(){return[IS.TRACE_PARENT_HEADER,IS.TRACE_STATE_HEADER]}}IS.W3CTraceContextPropagator=TS});var PS=H0((MS)=>{Object.defineProperty(MS,"__esModule",{value:!0});MS.getRPCMetadata=MS.deleteRPCMetadata=MS.setRPCMetadata=MS.RPCType=void 0;var QH0=f1(),BH=(0,QH0.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),XH0;(function(Y){Y.HTTP="http"})(XH0=MS.RPCType||(MS.RPCType={}));function JH0(Y,Z){return Y.setValue(BH,Z)}MS.setRPCMetadata=JH0;function WH0(Y){return Y.deleteValue(BH)}MS.deleteRPCMetadata=WH0;function KH0(Y){return Y.getValue(BH)}MS.getRPCMetadata=KH0});var vS=H0((kS)=>{Object.defineProperty(kS,"__esModule",{value:!0});kS.isPlainObject=void 0;var HH0="[object Object]",VH0="[object Null]",qH0="[object Undefined]",zH0=Function.prototype,LS=zH0.toString,BH0=LS.call(Object),AH0=Object.getPrototypeOf,wS=Object.prototype,SS=wS.hasOwnProperty,d5=Symbol?Symbol.toStringTag:void 0,fS=wS.toString;function UH0(Y){if(!NH0(Y)||OH0(Y)!==HH0)return!1;let Z=AH0(Y);if(Z===null)return!0;let W=SS.call(Z,"constructor")&&Z.constructor;return typeof W=="function"&&W instanceof W&&LS.call(W)===BH0}kS.isPlainObject=UH0;function NH0(Y){return Y!=null&&typeof Y=="object"}function OH0(Y){if(Y==null)return Y===void 0?qH0:VH0;return d5&&d5 in Object(Y)?DH0(Y):TH0(Y)}function DH0(Y){let Z=SS.call(Y,d5),W=Y[d5],H=!1;try{Y[d5]=void 0,H=!0}catch{}let F=fS.call(Y);if(H)if(Z)Y[d5]=W;else delete Y[d5];return F}function TH0(Y){return fS.call(Y)}});var mS=H0((bS)=>{Object.defineProperty(bS,"__esModule",{value:!0});bS.merge=void 0;var hS=vS(),IH0=20;function $H0(...Y){let Z=Y.shift(),W=new WeakMap;while(Y.length>0)Z=_S(Z,Y.shift(),0,W);return Z}bS.merge=$H0;function AH(Y){if(EJ(Y))return Y.slice();return Y}function _S(Y,Z,W=0,H){let F;if(W>IH0)return;if(W++,CJ(Y)||CJ(Z)||xS(Z))F=AH(Z);else if(EJ(Y)){if(F=Y.slice(),EJ(Z))for(let X=0,J=Z.length;X<J;X++)F.push(AH(Z[X]));else if(dZ(Z)){let X=Object.keys(Z);for(let J=0,Q=X.length;J<Q;J++){let G=X[J];F[G]=AH(Z[G])}}}else if(dZ(Y))if(dZ(Z)){if(!CH0(Y,Z))return Z;F=Object.assign({},Y);let X=Object.keys(Z);for(let J=0,Q=X.length;J<Q;J++){let G=X[J],q=Z[G];if(CJ(q))if(typeof q>"u")delete F[G];else F[G]=q;else{let K=F[G],V=q;if(jS(Y,G,H)||jS(Z,G,H))delete F[G];else{if(dZ(K)&&dZ(V)){let B=H.get(K)||[],I=H.get(V)||[];B.push({obj:Y,key:G}),I.push({obj:Z,key:G}),H.set(K,B),H.set(V,I)}F[G]=_S(F[G],q,W,H)}}}}else F=Z;return F}function jS(Y,Z,W){let H=W.get(Y[Z])||[];for(let F=0,X=H.length;F<X;F++){let J=H[F];if(J.key===Z&&J.obj===Y)return!0}return!1}function EJ(Y){return Array.isArray(Y)}function xS(Y){return typeof Y==="function"}function dZ(Y){return!CJ(Y)&&!EJ(Y)&&!xS(Y)&&typeof Y==="object"}function CJ(Y){return typeof Y==="string"||typeof Y==="number"||typeof Y==="boolean"||typeof Y>"u"||Y instanceof Date||Y instanceof RegExp||Y===null}function CH0(Y,Z){if(!(0,hS.isPlainObject)(Y)||!(0,hS.isPlainObject)(Z))return!1;return!0}});var cS=H0((gS)=>{Object.defineProperty(gS,"__esModule",{value:!0});gS.callWithTimeout=gS.TimeoutError=void 0;class MJ extends Error{constructor(Y){super(Y);Object.setPrototypeOf(this,MJ.prototype)}}gS.TimeoutError=MJ;function EH0(Y,Z){let W,H=new Promise(function(X,J){W=setTimeout(function(){J(new MJ("Operation timed out."))},Z)});return Promise.race([Y,H]).then((F)=>{return clearTimeout(W),F},(F)=>{throw clearTimeout(W),F})}gS.callWithTimeout=EH0});var iS=H0((nS)=>{Object.defineProperty(nS,"__esModule",{value:!0});nS.isUrlIgnored=nS.urlMatches=void 0;function lS(Y,Z){if(typeof Z==="string")return Y===Z;else return!!Y.match(Z)}nS.urlMatches=lS;function RH0(Y,Z){if(!Z)return!1;for(let W of Z)if(lS(Y,W))return!0;return!1}nS.isUrlIgnored=RH0});var tS=H0((aS)=>{Object.defineProperty(aS,"__esModule",{value:!0});aS.Deferred=void 0;class rS{_promise;_resolve;_reject;constructor(){this._promise=new Promise((Y,Z)=>{this._resolve=Y,this._reject=Z})}get promise(){return this._promise}resolve(Y){this._resolve(Y)}reject(Y){this._reject(Y)}}aS.Deferred=rS});var Zf=H0((eS)=>{Object.defineProperty(eS,"__esModule",{value:!0});eS.BindOnceFuture=void 0;var LH0=tS();class sS{_isCalled=!1;_deferred=new LH0.Deferred;_callback;_that;constructor(Y,Z){this._callback=Y,this._that=Z}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...Y){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...Y)).then((Z)=>this._deferred.resolve(Z),(Z)=>this._deferred.reject(Z))}catch(Z){this._deferred.reject(Z)}}return this._deferred.promise}}eS.BindOnceFuture=sS});var Wf=H0((Xf)=>{Object.defineProperty(Xf,"__esModule",{value:!0});Xf.diagLogLevelFromString=void 0;var I4=f1(),Qf={ALL:I4.DiagLogLevel.ALL,VERBOSE:I4.DiagLogLevel.VERBOSE,DEBUG:I4.DiagLogLevel.DEBUG,INFO:I4.DiagLogLevel.INFO,WARN:I4.DiagLogLevel.WARN,ERROR:I4.DiagLogLevel.ERROR,NONE:I4.DiagLogLevel.NONE};function wH0(Y){if(Y==null)return;let Z=Qf[Y.toUpperCase()];if(Z==null)return I4.diag.warn(`Unknown log level "${Y}", expected one of ${Object.keys(Qf)}, using default`),I4.DiagLogLevel.INFO;return Z}Xf.diagLogLevelFromString=wH0});var Hf=H0((Gf)=>{Object.defineProperty(Gf,"__esModule",{value:!0});Gf._export=void 0;var Kf=f1(),SH0=uZ();function fH0(Y,Z){return new Promise((W)=>{Kf.context.with((0,SH0.suppressTracing)(Kf.context.active()),()=>{Y.export(Z,W)})})}Gf._export=fH0});var G6=H0((_1)=>{Object.defineProperty(_1,"__esModule",{value:!0});_1.internal=_1.diagLogLevelFromString=_1.BindOnceFuture=_1.urlMatches=_1.isUrlIgnored=_1.callWithTimeout=_1.TimeoutError=_1.merge=_1.TraceState=_1.unsuppressTracing=_1.suppressTracing=_1.isTracingSuppressed=_1.setRPCMetadata=_1.getRPCMetadata=_1.deleteRPCMetadata=_1.RPCType=_1.parseTraceParent=_1.W3CTraceContextPropagator=_1.TRACE_STATE_HEADER=_1.TRACE_PARENT_HEADER=_1.CompositePropagator=_1.otperformance=_1.getStringListFromEnv=_1.getNumberFromEnv=_1.getBooleanFromEnv=_1.getStringFromEnv=_1._globalThis=_1.SDK_INFO=_1.parseKeyPairsIntoRecord=_1.ExportResultCode=_1.unrefTimer=_1.timeInputToHrTime=_1.millisToHrTime=_1.isTimeInputHrTime=_1.isTimeInput=_1.hrTimeToTimeStamp=_1.hrTimeToNanoseconds=_1.hrTimeToMilliseconds=_1.hrTimeToMicroseconds=_1.hrTimeDuration=_1.hrTime=_1.getTimeOrigin=_1.addHrTimes=_1.loggingErrorHandler=_1.setGlobalErrorHandler=_1.globalErrorHandler=_1.sanitizeAttributes=_1.isAttributeValue=_1.AnchoredClock=_1.W3CBaggagePropagator=void 0;var kH0=$$();Object.defineProperty(_1,"W3CBaggagePropagator",{enumerable:!0,get:function(){return kH0.W3CBaggagePropagator}});var yH0=R$();Object.defineProperty(_1,"AnchoredClock",{enumerable:!0,get:function(){return yH0.AnchoredClock}});var Vf=y$();Object.defineProperty(_1,"isAttributeValue",{enumerable:!0,get:function(){return Vf.isAttributeValue}});Object.defineProperty(_1,"sanitizeAttributes",{enumerable:!0,get:function(){return Vf.sanitizeAttributes}});var qf=b$();Object.defineProperty(_1,"globalErrorHandler",{enumerable:!0,get:function(){return qf.globalErrorHandler}});Object.defineProperty(_1,"setGlobalErrorHandler",{enumerable:!0,get:function(){return qf.setGlobalErrorHandler}});var vH0=WH();Object.defineProperty(_1,"loggingErrorHandler",{enumerable:!0,get:function(){return vH0.loggingErrorHandler}});var J9=sw();Object.defineProperty(_1,"addHrTimes",{enumerable:!0,get:function(){return J9.addHrTimes}});Object.defineProperty(_1,"getTimeOrigin",{enumerable:!0,get:function(){return J9.getTimeOrigin}});Object.defineProperty(_1,"hrTime",{enumerable:!0,get:function(){return J9.hrTime}});Object.defineProperty(_1,"hrTimeDuration",{enumerable:!0,get:function(){return J9.hrTimeDuration}});Object.defineProperty(_1,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return J9.hrTimeToMicroseconds}});Object.defineProperty(_1,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return J9.hrTimeToMilliseconds}});Object.defineProperty(_1,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return J9.hrTimeToNanoseconds}});Object.defineProperty(_1,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return J9.hrTimeToTimeStamp}});Object.defineProperty(_1,"isTimeInput",{enumerable:!0,get:function(){return J9.isTimeInput}});Object.defineProperty(_1,"isTimeInputHrTime",{enumerable:!0,get:function(){return J9.isTimeInputHrTime}});Object.defineProperty(_1,"millisToHrTime",{enumerable:!0,get:function(){return J9.millisToHrTime}});Object.defineProperty(_1,"timeInputToHrTime",{enumerable:!0,get:function(){return J9.timeInputToHrTime}});var hH0=ZS();Object.defineProperty(_1,"unrefTimer",{enumerable:!0,get:function(){return hH0.unrefTimer}});var jH0=XS();Object.defineProperty(_1,"ExportResultCode",{enumerable:!0,get:function(){return jH0.ExportResultCode}});var _H0=QH();Object.defineProperty(_1,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return _H0.parseKeyPairsIntoRecord}});var c5=GH();Object.defineProperty(_1,"SDK_INFO",{enumerable:!0,get:function(){return c5.SDK_INFO}});Object.defineProperty(_1,"_globalThis",{enumerable:!0,get:function(){return c5._globalThis}});Object.defineProperty(_1,"getStringFromEnv",{enumerable:!0,get:function(){return c5.getStringFromEnv}});Object.defineProperty(_1,"getBooleanFromEnv",{enumerable:!0,get:function(){return c5.getBooleanFromEnv}});Object.defineProperty(_1,"getNumberFromEnv",{enumerable:!0,get:function(){return c5.getNumberFromEnv}});Object.defineProperty(_1,"getStringListFromEnv",{enumerable:!0,get:function(){return c5.getStringListFromEnv}});Object.defineProperty(_1,"otperformance",{enumerable:!0,get:function(){return c5.otperformance}});var xH0=FS();Object.defineProperty(_1,"CompositePropagator",{enumerable:!0,get:function(){return xH0.CompositePropagator}});var RJ=CS();Object.defineProperty(_1,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return RJ.TRACE_PARENT_HEADER}});Object.defineProperty(_1,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return RJ.TRACE_STATE_HEADER}});Object.defineProperty(_1,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return RJ.W3CTraceContextPropagator}});Object.defineProperty(_1,"parseTraceParent",{enumerable:!0,get:function(){return RJ.parseTraceParent}});var PJ=PS();Object.defineProperty(_1,"RPCType",{enumerable:!0,get:function(){return PJ.RPCType}});Object.defineProperty(_1,"deleteRPCMetadata",{enumerable:!0,get:function(){return PJ.deleteRPCMetadata}});Object.defineProperty(_1,"getRPCMetadata",{enumerable:!0,get:function(){return PJ.getRPCMetadata}});Object.defineProperty(_1,"setRPCMetadata",{enumerable:!0,get:function(){return PJ.setRPCMetadata}});var UH=uZ();Object.defineProperty(_1,"isTracingSuppressed",{enumerable:!0,get:function(){return UH.isTracingSuppressed}});Object.defineProperty(_1,"suppressTracing",{enumerable:!0,get:function(){return UH.suppressTracing}});Object.defineProperty(_1,"unsuppressTracing",{enumerable:!0,get:function(){return UH.unsuppressTracing}});var bH0=zH();Object.defineProperty(_1,"TraceState",{enumerable:!0,get:function(){return bH0.TraceState}});var uH0=mS();Object.defineProperty(_1,"merge",{enumerable:!0,get:function(){return uH0.merge}});var zf=cS();Object.defineProperty(_1,"TimeoutError",{enumerable:!0,get:function(){return zf.TimeoutError}});Object.defineProperty(_1,"callWithTimeout",{enumerable:!0,get:function(){return zf.callWithTimeout}});var Bf=iS();Object.defineProperty(_1,"isUrlIgnored",{enumerable:!0,get:function(){return Bf.isUrlIgnored}});Object.defineProperty(_1,"urlMatches",{enumerable:!0,get:function(){return Bf.urlMatches}});var mH0=Zf();Object.defineProperty(_1,"BindOnceFuture",{enumerable:!0,get:function(){return mH0.BindOnceFuture}});var gH0=Wf();Object.defineProperty(_1,"diagLogLevelFromString",{enumerable:!0,get:function(){return gH0.diagLogLevelFromString}});var dH0=Hf();_1.internal={_export:dH0._export}});var Of=H0((Uf)=>{Object.defineProperty(Uf,"__esModule",{value:!0});Uf.createLoggingPartialSuccessResponseHandler=void 0;var cH0=f1();function lH0(Y){return Object.prototype.hasOwnProperty.call(Y,"partialSuccess")}function nH0(){return{handleResponse(Y){if(Y==null||!lH0(Y)||Y.partialSuccess==null||Object.keys(Y.partialSuccess).length===0)return;cH0.diag.warn("Received Partial Success response:",JSON.stringify(Y.partialSuccess))}}}Uf.createLoggingPartialSuccessResponseHandler=nH0});var NH=H0((If)=>{Object.defineProperty(If,"__esModule",{value:!0});If.createOtlpExportDelegate=void 0;var l5=G6(),Df=AJ(),pH0=Of(),iH0=f1();class Tf{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(Y,Z,W,H,F){this._transport=Y,this._serializer=Z,this._responseHandler=W,this._promiseQueue=H,this._timeout=F,this._diagLogger=iH0.diag.createComponentLogger({namespace:"OTLPExportDelegate"})}export(Y,Z){if(this._diagLogger.debug("items to be sent",Y),this._promiseQueue.hasReachedLimit()){Z({code:l5.ExportResultCode.FAILED,error:Error("Concurrent export limit reached")});return}let W=this._serializer.serializeRequest(Y);if(W==null){Z({code:l5.ExportResultCode.FAILED,error:Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(W,this._timeout).then((H)=>{if(H.status==="success"){if(H.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(H.data))}catch(F){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",F,H.data)}Z({code:l5.ExportResultCode.SUCCESS});return}else if(H.status==="failure"&&H.error){Z({code:l5.ExportResultCode.FAILED,error:H.error});return}else if(H.status==="retryable")Z({code:l5.ExportResultCode.FAILED,error:H.error??new Df.OTLPExporterError("Export failed with retryable status")});else Z({code:l5.ExportResultCode.FAILED,error:new Df.OTLPExporterError("Export failed with unknown error")})},(H)=>Z({code:l5.ExportResultCode.FAILED,error:H})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function rH0(Y,Z){return new Tf(Y.transport,Y.serializer,(0,pH0.createLoggingPartialSuccessResponseHandler)(),Y.promiseHandler,Z.timeout)}If.createOtlpExportDelegate=rH0});var Mf=H0((Cf)=>{Object.defineProperty(Cf,"__esModule",{value:!0});Cf.createOtlpNetworkExportDelegate=void 0;var aH0=eF(),oH0=NH();function tH0(Y,Z,W){return(0,oH0.createOtlpExportDelegate)({transport:W,serializer:Z,promiseHandler:(0,aH0.createBoundedQueueExportPromiseHandler)(Y)},{timeout:Y.timeoutMillis})}Cf.createOtlpNetworkExportDelegate=tH0});var LJ=H0((n4)=>{Object.defineProperty(n4,"__esModule",{value:!0});n4.createOtlpNetworkExportDelegate=n4.CompressionAlgorithm=n4.getSharedConfigurationDefaults=n4.mergeOtlpSharedConfigurationWithDefaults=n4.OTLPExporterError=n4.OTLPExporterBase=void 0;var sH0=eI();Object.defineProperty(n4,"OTLPExporterBase",{enumerable:!0,get:function(){return sH0.OTLPExporterBase}});var eH0=AJ();Object.defineProperty(n4,"OTLPExporterError",{enumerable:!0,get:function(){return eH0.OTLPExporterError}});var Rf=bZ();Object.defineProperty(n4,"mergeOtlpSharedConfigurationWithDefaults",{enumerable:!0,get:function(){return Rf.mergeOtlpSharedConfigurationWithDefaults}});Object.defineProperty(n4,"getSharedConfigurationDefaults",{enumerable:!0,get:function(){return Rf.getSharedConfigurationDefaults}});var YV0=G$();Object.defineProperty(n4,"CompressionAlgorithm",{enumerable:!0,get:function(){return YV0.CompressionAlgorithm}});var ZV0=Mf();Object.defineProperty(n4,"createOtlpNetworkExportDelegate",{enumerable:!0,get:function(){return ZV0.createOtlpNetworkExportDelegate}})});var OH=H0((Zc0,Pf)=>{Pf.exports=XV0;function XV0(Y,Z){var W=Array(arguments.length-1),H=0,F=2,X=!0;while(F<arguments.length)W[H++]=arguments[F++];return new Promise(function(Q,G){W[H]=function(K){if(X)if(X=!1,K)G(K);else{var V=Array(arguments.length-1),B=0;while(B<V.length)V[B++]=arguments[B];Q.apply(null,V)}};try{Y.apply(Z||null,W)}catch(q){if(X)X=!1,G(q)}})}});var ff=H0((Sf)=>{var wJ=Sf;wJ.length=function(Z){var W=Z.length;if(!W)return 0;var H=0;while(--W%4>1&&Z.charAt(W)==="=")++H;return Math.ceil(Z.length*3)/4-H};var s7=Array(64),wf=Array(123);for(W9=0;W9<64;)wf[s7[W9]=W9<26?W9+65:W9<52?W9+71:W9<62?W9-4:W9-59|43]=W9++;var W9;wJ.encode=function(Z,W,H){var F=null,X=[],J=0,Q=0,G;while(W<H){var q=Z[W++];switch(Q){case 0:X[J++]=s7[q>>2],G=(q&3)<<4,Q=1;break;case 1:X[J++]=s7[G|q>>4],G=(q&15)<<2,Q=2;break;case 2:X[J++]=s7[G|q>>6],X[J++]=s7[q&63],Q=0;break}if(J>8191)(F||(F=[])).push(String.fromCharCode.apply(String,X)),J=0}if(Q){if(X[J++]=s7[G],X[J++]=61,Q===1)X[J++]=61}if(F){if(J)F.push(String.fromCharCode.apply(String,X.slice(0,J)));return F.join("")}return String.fromCharCode.apply(String,X.slice(0,J))};var Lf="invalid encoding";wJ.decode=function(Z,W,H){var F=H,X=0,J;for(var Q=0;Q<Z.length;){var G=Z.charCodeAt(Q++);if(G===61&&X>1)break;if((G=wf[G])===void 0)throw Error(Lf);switch(X){case 0:J=G,X=1;break;case 1:W[H++]=J<<2|(G&48)>>4,J=G,X=2;break;case 2:W[H++]=(J&15)<<4|(G&60)>>2,J=G,X=3;break;case 3:W[H++]=(J&3)<<6|G,X=0;break}}if(X===1)throw Error(Lf);return H-F};wJ.test=function(Z){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(Z)}});var yf=H0((Xc0,kf)=>{kf.exports=SJ;function SJ(){this._listeners={}}SJ.prototype.on=function(Z,W,H){return(this._listeners[Z]||(this._listeners[Z]=[])).push({fn:W,ctx:H||this}),this};SJ.prototype.off=function(Z,W){if(Z===void 0)this._listeners={};else if(W===void 0)this._listeners[Z]=[];else{var H=this._listeners[Z];for(var F=0;F<H.length;)if(H[F].fn===W)H.splice(F,1);else++F}return this};SJ.prototype.emit=function(Z){var W=this._listeners[Z];if(W){var H=[],F=1;for(;F<arguments.length;)H.push(arguments[F++]);for(F=0;F<W.length;)W[F].fn.apply(W[F++].ctx,H)}return this}});var uf=H0((Jc0,bf)=>{bf.exports=vf(vf);function vf(Y){if(typeof Float32Array<"u")(function(){var Z=new Float32Array([-0]),W=new Uint8Array(Z.buffer),H=W[3]===128;function F(G,q,K){Z[0]=G,q[K]=W[0],q[K+1]=W[1],q[K+2]=W[2],q[K+3]=W[3]}function X(G,q,K){Z[0]=G,q[K]=W[3],q[K+1]=W[2],q[K+2]=W[1],q[K+3]=W[0]}Y.writeFloatLE=H?F:X,Y.writeFloatBE=H?X:F;function J(G,q){return W[0]=G[q],W[1]=G[q+1],W[2]=G[q+2],W[3]=G[q+3],Z[0]}function Q(G,q){return W[3]=G[q],W[2]=G[q+1],W[1]=G[q+2],W[0]=G[q+3],Z[0]}Y.readFloatLE=H?J:Q,Y.readFloatBE=H?Q:J})();else(function(){function Z(H,F,X,J){var Q=F<0?1:0;if(Q)F=-F;if(F===0)H(1/F>0?0:2147483648,X,J);else if(isNaN(F))H(2143289344,X,J);else if(F>340282346638528860000000000000000000000)H((Q<<31|2139095040)>>>0,X,J);else if(F<0.000000000000000000000000000000000000011754943508222875)H((Q<<31|Math.round(F/0.000000000000000000000000000000000000000000001401298464324817))>>>0,X,J);else{var G=Math.floor(Math.log(F)/Math.LN2),q=Math.round(F*Math.pow(2,-G)*8388608)&8388607;H((Q<<31|G+127<<23|q)>>>0,X,J)}}Y.writeFloatLE=Z.bind(null,hf),Y.writeFloatBE=Z.bind(null,jf);function W(H,F,X){var J=H(F,X),Q=(J>>31)*2+1,G=J>>>23&255,q=J&8388607;return G===255?q?NaN:Q*(1/0):G===0?Q*0.000000000000000000000000000000000000000000001401298464324817*q:Q*Math.pow(2,G-150)*(q+8388608)}Y.readFloatLE=W.bind(null,_f),Y.readFloatBE=W.bind(null,xf)})();if(typeof Float64Array<"u")(function(){var Z=new Float64Array([-0]),W=new Uint8Array(Z.buffer),H=W[7]===128;function F(G,q,K){Z[0]=G,q[K]=W[0],q[K+1]=W[1],q[K+2]=W[2],q[K+3]=W[3],q[K+4]=W[4],q[K+5]=W[5],q[K+6]=W[6],q[K+7]=W[7]}function X(G,q,K){Z[0]=G,q[K]=W[7],q[K+1]=W[6],q[K+2]=W[5],q[K+3]=W[4],q[K+4]=W[3],q[K+5]=W[2],q[K+6]=W[1],q[K+7]=W[0]}Y.writeDoubleLE=H?F:X,Y.writeDoubleBE=H?X:F;function J(G,q){return W[0]=G[q],W[1]=G[q+1],W[2]=G[q+2],W[3]=G[q+3],W[4]=G[q+4],W[5]=G[q+5],W[6]=G[q+6],W[7]=G[q+7],Z[0]}function Q(G,q){return W[7]=G[q],W[6]=G[q+1],W[5]=G[q+2],W[4]=G[q+3],W[3]=G[q+4],W[2]=G[q+5],W[1]=G[q+6],W[0]=G[q+7],Z[0]}Y.readDoubleLE=H?J:Q,Y.readDoubleBE=H?Q:J})();else(function(){function Z(H,F,X,J,Q,G){var q=J<0?1:0;if(q)J=-J;if(J===0)H(0,Q,G+F),H(1/J>0?0:2147483648,Q,G+X);else if(isNaN(J))H(0,Q,G+F),H(2146959360,Q,G+X);else if(J>179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)H(0,Q,G+F),H((q<<31|2146435072)>>>0,Q,G+X);else{var K;if(J<0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014)K=J/0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005,H(K>>>0,Q,G+F),H((q<<31|K/4294967296)>>>0,Q,G+X);else{var V=Math.floor(Math.log(J)/Math.LN2);if(V===1024)V=1023;K=J*Math.pow(2,-V),H(K*4503599627370496>>>0,Q,G+F),H((q<<31|V+1023<<20|K*1048576&1048575)>>>0,Q,G+X)}}}Y.writeDoubleLE=Z.bind(null,hf,0,4),Y.writeDoubleBE=Z.bind(null,jf,4,0);function W(H,F,X,J,Q){var G=H(J,Q+F),q=H(J,Q+X),K=(q>>31)*2+1,V=q>>>20&2047,B=4294967296*(q&1048575)+G;return V===2047?B?NaN:K*(1/0):V===0?K*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005*B:K*Math.pow(2,V-1075)*(B+4503599627370496)}Y.readDoubleLE=W.bind(null,_f,0,4),Y.readDoubleBE=W.bind(null,xf,4,0)})();return Y}function hf(Y,Z,W){Z[W]=Y&255,Z[W+1]=Y>>>8&255,Z[W+2]=Y>>>16&255,Z[W+3]=Y>>>24}function jf(Y,Z,W){Z[W]=Y>>>24,Z[W+1]=Y>>>16&255,Z[W+2]=Y>>>8&255,Z[W+3]=Y&255}function _f(Y,Z){return(Y[Z]|Y[Z+1]<<8|Y[Z+2]<<16|Y[Z+3]<<24)>>>0}function xf(Y,Z){return(Y[Z]<<24|Y[Z+1]<<16|Y[Z+2]<<8|Y[Z+3])>>>0}});var TH=H0((mf,DH)=>{DH.exports=JV0;function JV0(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(Y){}return null}});var df=H0((gf)=>{var IH=gf;IH.length=function(Z){var W=0,H=0;for(var F=0;F<Z.length;++F)if(H=Z.charCodeAt(F),H<128)W+=1;else if(H<2048)W+=2;else if((H&64512)===55296&&(Z.charCodeAt(F+1)&64512)===56320)++F,W+=4;else W+=3;return W};IH.read=function(Z,W,H){var F=H-W;if(F<1)return"";var X=null,J=[],Q=0,G;while(W<H){if(G=Z[W++],G<128)J[Q++]=G;else if(G>191&&G<224)J[Q++]=(G&31)<<6|Z[W++]&63;else if(G>239&&G<365)G=((G&7)<<18|(Z[W++]&63)<<12|(Z[W++]&63)<<6|Z[W++]&63)-65536,J[Q++]=55296+(G>>10),J[Q++]=56320+(G&1023);else J[Q++]=(G&15)<<12|(Z[W++]&63)<<6|Z[W++]&63;if(Q>8191)(X||(X=[])).push(String.fromCharCode.apply(String,J)),Q=0}if(X){if(Q)X.push(String.fromCharCode.apply(String,J.slice(0,Q)));return X.join("")}return String.fromCharCode.apply(String,J.slice(0,Q))};IH.write=function(Z,W,H){var F=H,X,J;for(var Q=0;Q<Z.length;++Q)if(X=Z.charCodeAt(Q),X<128)W[H++]=X;else if(X<2048)W[H++]=X>>6|192,W[H++]=X&63|128;else if((X&64512)===55296&&((J=Z.charCodeAt(Q+1))&64512)===56320)X=65536+((X&1023)<<10)+(J&1023),++Q,W[H++]=X>>18|240,W[H++]=X>>12&63|128,W[H++]=X>>6&63|128,W[H++]=X&63|128;else W[H++]=X>>12|224,W[H++]=X>>6&63|128,W[H++]=X&63|128;return H-F}});var lf=H0((Kc0,cf)=>{cf.exports=WV0;function WV0(Y,Z,W){var H=W||8192,F=H>>>1,X=null,J=H;return function(G){if(G<1||G>F)return Y(G);if(J+G>H)X=Y(H),J=0;var q=Z.call(X,J,J+=G);if(J&7)J=(J|7)+1;return q}}});var pf=H0((Gc0,nf)=>{nf.exports=J8;var cZ=l9();function J8(Y,Z){this.lo=Y>>>0,this.hi=Z>>>0}var n5=J8.zero=new J8(0,0);n5.toNumber=function(){return 0};n5.zzEncode=n5.zzDecode=function(){return this};n5.length=function(){return 1};var KV0=J8.zeroHash="\x00\x00\x00\x00\x00\x00\x00\x00";J8.fromNumber=function(Z){if(Z===0)return n5;var W=Z<0;if(W)Z=-Z;var H=Z>>>0,F=(Z-H)/4294967296>>>0;if(W){if(F=~F>>>0,H=~H>>>0,++H>4294967295){if(H=0,++F>4294967295)F=0}}return new J8(H,F)};J8.from=function(Z){if(typeof Z==="number")return J8.fromNumber(Z);if(cZ.isString(Z))if(cZ.Long)Z=cZ.Long.fromString(Z);else return J8.fromNumber(parseInt(Z,10));return Z.low||Z.high?new J8(Z.low>>>0,Z.high>>>0):n5};J8.prototype.toNumber=function(Z){if(!Z&&this.hi>>>31){var W=~this.lo+1>>>0,H=~this.hi>>>0;if(!W)H=H+1>>>0;return-(W+H*4294967296)}return this.lo+this.hi*4294967296};J8.prototype.toLong=function(Z){return cZ.Long?new cZ.Long(this.lo|0,this.hi|0,Boolean(Z)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(Z)}};var p4=String.prototype.charCodeAt;J8.fromHash=function(Z){if(Z===KV0)return n5;return new J8((p4.call(Z,0)|p4.call(Z,1)<<8|p4.call(Z,2)<<16|p4.call(Z,3)<<24)>>>0,(p4.call(Z,4)|p4.call(Z,5)<<8|p4.call(Z,6)<<16|p4.call(Z,7)<<24)>>>0)};J8.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)};J8.prototype.zzEncode=function(){var Z=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^Z)>>>0,this.lo=(this.lo<<1^Z)>>>0,this};J8.prototype.zzDecode=function(){var Z=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^Z)>>>0,this.hi=(this.hi>>>1^Z)>>>0,this};J8.prototype.length=function(){var Z=this.lo,W=(this.lo>>>28|this.hi<<4)>>>0,H=this.hi>>>24;return H===0?W===0?Z<16384?Z<128?1:2:Z<2097152?3:4:W<16384?W<128?5:6:W<2097152?7:8:H<128?9:10}});var l9=H0(($H)=>{var L1=$H;L1.asPromise=OH();L1.base64=ff();L1.EventEmitter=yf();L1.float=uf();L1.inquire=TH();L1.utf8=df();L1.pool=lf();L1.LongBits=pf();L1.isNode=Boolean(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);L1.global=L1.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||$H;L1.emptyArray=Object.freeze?Object.freeze([]):[];L1.emptyObject=Object.freeze?Object.freeze({}):{};L1.isInteger=Number.isInteger||function(Z){return typeof Z==="number"&&isFinite(Z)&&Math.floor(Z)===Z};L1.isString=function(Z){return typeof Z==="string"||Z instanceof String};L1.isObject=function(Z){return Z&&typeof Z==="object"};L1.isset=L1.isSet=function(Z,W){var H=Z[W];if(H!=null&&Z.hasOwnProperty(W))return typeof H!=="object"||(Array.isArray(H)?H.length:Object.keys(H).length)>0;return!1};L1.Buffer=function(){try{var Y=L1.inquire("buffer").Buffer;return Y.prototype.utf8Write?Y:null}catch(Z){return null}}();L1._Buffer_from=null;L1._Buffer_allocUnsafe=null;L1.newBuffer=function(Z){return typeof Z==="number"?L1.Buffer?L1._Buffer_allocUnsafe(Z):new L1.Array(Z):L1.Buffer?L1._Buffer_from(Z):typeof Uint8Array>"u"?Z:new Uint8Array(Z)};L1.Array=typeof Uint8Array<"u"?Uint8Array:Array;L1.Long=L1.global.dcodeIO&&L1.global.dcodeIO.Long||L1.global.Long||L1.inquire("long");L1.key2Re=/^true|false|0|1$/;L1.key32Re=/^-?(?:0|[1-9][0-9]*)$/;L1.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;L1.longToHash=function(Z){return Z?L1.LongBits.from(Z).toHash():L1.LongBits.zeroHash};L1.longFromHash=function(Z,W){var H=L1.LongBits.fromHash(Z);if(L1.Long)return L1.Long.fromBits(H.lo,H.hi,W);return H.toNumber(Boolean(W))};function rf(Y,Z,W){for(var H=Object.keys(Z),F=0;F<H.length;++F)if(Y[H[F]]===void 0||!W)Y[H[F]]=Z[H[F]];return Y}L1.merge=rf;L1.lcFirst=function(Z){return Z.charAt(0).toLowerCase()+Z.substring(1)};function af(Y){function Z(W,H){if(!(this instanceof Z))return new Z(W,H);if(Object.defineProperty(this,"message",{get:function(){return W}}),Error.captureStackTrace)Error.captureStackTrace(this,Z);else Object.defineProperty(this,"stack",{value:Error().stack||""});if(H)rf(this,H)}return Z.prototype=Object.create(Error.prototype,{constructor:{value:Z,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return Y},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),Z}L1.newError=af;L1.ProtocolError=af("ProtocolError");L1.oneOfGetter=function(Z){var W={};for(var H=0;H<Z.length;++H)W[Z[H]]=1;return function(){for(var F=Object.keys(this),X=F.length-1;X>-1;--X)if(W[F[X]]===1&&this[F[X]]!==void 0&&this[F[X]]!==null)return F[X]}};L1.oneOfSetter=function(Z){return function(W){for(var H=0;H<Z.length;++H)if(Z[H]!==W)delete this[Z[H]]}};L1.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};L1._configure=function(){var Y=L1.Buffer;if(!Y){L1._Buffer_from=L1._Buffer_allocUnsafe=null;return}L1._Buffer_from=Y.from!==Uint8Array.from&&Y.from||function(W,H){return new Y(W,H)},L1._Buffer_allocUnsafe=Y.allocUnsafe||function(W){return new Y(W)}}});var kJ=H0((Hc0,ef)=>{ef.exports=F6;var K9=l9(),CH,fJ=K9.LongBits,of=K9.base64,tf=K9.utf8;function lZ(Y,Z,W){this.fn=Y,this.len=Z,this.next=void 0,this.val=W}function MH(){}function GV0(Y){this.head=Y.head,this.tail=Y.tail,this.len=Y.len,this.next=Y.states}function F6(){this.len=0,this.head=new lZ(MH,0,0),this.tail=this.head,this.states=null}var sf=function(){return K9.Buffer?function(){return(F6.create=function(){return new CH})()}:function(){return new F6}};F6.create=sf();F6.alloc=function(Z){return new K9.Array(Z)};if(K9.Array!==Array)F6.alloc=K9.pool(F6.alloc,K9.Array.prototype.subarray);F6.prototype._push=function(Z,W,H){return this.tail=this.tail.next=new lZ(Z,W,H),this.len+=W,this};function RH(Y,Z,W){Z[W]=Y&255}function FV0(Y,Z,W){while(Y>127)Z[W++]=Y&127|128,Y>>>=7;Z[W]=Y}function PH(Y,Z){this.len=Y,this.next=void 0,this.val=Z}PH.prototype=Object.create(lZ.prototype);PH.prototype.fn=FV0;F6.prototype.uint32=function(Z){return this.len+=(this.tail=this.tail.next=new PH((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this};F6.prototype.int32=function(Z){return Z<0?this._push(LH,10,fJ.fromNumber(Z)):this.uint32(Z)};F6.prototype.sint32=function(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function LH(Y,Z,W){while(Y.hi)Z[W++]=Y.lo&127|128,Y.lo=(Y.lo>>>7|Y.hi<<25)>>>0,Y.hi>>>=7;while(Y.lo>127)Z[W++]=Y.lo&127|128,Y.lo=Y.lo>>>7;Z[W++]=Y.lo}F6.prototype.uint64=function(Z){var W=fJ.from(Z);return this._push(LH,W.length(),W)};F6.prototype.int64=F6.prototype.uint64;F6.prototype.sint64=function(Z){var W=fJ.from(Z).zzEncode();return this._push(LH,W.length(),W)};F6.prototype.bool=function(Z){return this._push(RH,1,Z?1:0)};function EH(Y,Z,W){Z[W]=Y&255,Z[W+1]=Y>>>8&255,Z[W+2]=Y>>>16&255,Z[W+3]=Y>>>24}F6.prototype.fixed32=function(Z){return this._push(EH,4,Z>>>0)};F6.prototype.sfixed32=F6.prototype.fixed32;F6.prototype.fixed64=function(Z){var W=fJ.from(Z);return this._push(EH,4,W.lo)._push(EH,4,W.hi)};F6.prototype.sfixed64=F6.prototype.fixed64;F6.prototype.float=function(Z){return this._push(K9.float.writeFloatLE,4,Z)};F6.prototype.double=function(Z){return this._push(K9.float.writeDoubleLE,8,Z)};var HV0=K9.Array.prototype.set?function(Z,W,H){W.set(Z,H)}:function(Z,W,H){for(var F=0;F<Z.length;++F)W[H+F]=Z[F]};F6.prototype.bytes=function(Z){var W=Z.length>>>0;if(!W)return this._push(RH,1,0);if(K9.isString(Z)){var H=F6.alloc(W=of.length(Z));of.decode(Z,H,0),Z=H}return this.uint32(W)._push(HV0,W,Z)};F6.prototype.string=function(Z){var W=tf.length(Z);return W?this.uint32(W)._push(tf.write,W,Z):this._push(RH,1,0)};F6.prototype.fork=function(){return this.states=new GV0(this),this.head=this.tail=new lZ(MH,0,0),this.len=0,this};F6.prototype.reset=function(){if(this.states)this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next;else this.head=this.tail=new lZ(MH,0,0),this.len=0;return this};F6.prototype.ldelim=function(){var Z=this.head,W=this.tail,H=this.len;if(this.reset().uint32(H),H)this.tail.next=Z.next,this.tail=W,this.len+=H;return this};F6.prototype.finish=function(){var Z=this.head.next,W=this.constructor.alloc(this.len),H=0;while(Z)Z.fn(Z.val,W,H),H+=Z.len,Z=Z.next;return W};F6._configure=function(Y){CH=Y,F6.create=sf(),CH._configure()}});var Qk=H0((Vc0,Zk)=>{Zk.exports=n9;var Yk=kJ();(n9.prototype=Object.create(Yk.prototype)).constructor=n9;var i4=l9();function n9(){Yk.call(this)}n9._configure=function(){n9.alloc=i4._Buffer_allocUnsafe,n9.writeBytesBuffer=i4.Buffer&&i4.Buffer.prototype instanceof Uint8Array&&i4.Buffer.prototype.set.name==="set"?function(Z,W,H){W.set(Z,H)}:function(Z,W,H){if(Z.copy)Z.copy(W,H,0,Z.length);else for(var F=0;F<Z.length;)W[H++]=Z[F++]}};n9.prototype.bytes=function(Z){if(i4.isString(Z))Z=i4._Buffer_from(Z,"base64");var W=Z.length>>>0;if(this.uint32(W),W)this._push(n9.writeBytesBuffer,W,Z);return this};function VV0(Y,Z,W){if(Y.length<40)i4.utf8.write(Y,Z,W);else if(Z.utf8Write)Z.utf8Write(Y,W);else Z.write(Y,W)}n9.prototype.string=function(Z){var W=i4.Buffer.byteLength(Z);if(this.uint32(W),W)this._push(VV0,W,Z);return this};n9._configure()});var vJ=H0((qc0,Gk)=>{Gk.exports=c6;var M9=l9(),SH,Wk=M9.LongBits,qV0=M9.utf8;function R9(Y,Z){return RangeError("index out of range: "+Y.pos+" + "+(Z||1)+" > "+Y.len)}function c6(Y){this.buf=Y,this.pos=0,this.len=Y.length}var Xk=typeof Uint8Array<"u"?function(Z){if(Z instanceof Uint8Array||Array.isArray(Z))return new c6(Z);throw Error("illegal buffer")}:function(Z){if(Array.isArray(Z))return new c6(Z);throw Error("illegal buffer")},Kk=function(){return M9.Buffer?function(W){return(c6.create=function(F){return M9.Buffer.isBuffer(F)?new SH(F):Xk(F)})(W)}:Xk};c6.create=Kk();c6.prototype._slice=M9.Array.prototype.subarray||M9.Array.prototype.slice;c6.prototype.uint32=function(){var Z=4294967295;return function(){if(Z=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128)return Z;if((this.pos+=5)>this.len)throw this.pos=this.len,R9(this,10);return Z}}();c6.prototype.int32=function(){return this.uint32()|0};c6.prototype.sint32=function(){var Z=this.uint32();return Z>>>1^-(Z&1)|0};function wH(){var Y=new Wk(0,0),Z=0;if(this.len-this.pos>4){for(;Z<4;++Z)if(Y.lo=(Y.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return Y;if(Y.lo=(Y.lo|(this.buf[this.pos]&127)<<28)>>>0,Y.hi=(Y.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return Y;Z=0}else{for(;Z<3;++Z){if(this.pos>=this.len)throw R9(this);if(Y.lo=(Y.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return Y}return Y.lo=(Y.lo|(this.buf[this.pos++]&127)<<Z*7)>>>0,Y}if(this.len-this.pos>4){for(;Z<5;++Z)if(Y.hi=(Y.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return Y}else for(;Z<5;++Z){if(this.pos>=this.len)throw R9(this);if(Y.hi=(Y.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return Y}throw Error("invalid varint encoding")}c6.prototype.bool=function(){return this.uint32()!==0};function yJ(Y,Z){return(Y[Z-4]|Y[Z-3]<<8|Y[Z-2]<<16|Y[Z-1]<<24)>>>0}c6.prototype.fixed32=function(){if(this.pos+4>this.len)throw R9(this,4);return yJ(this.buf,this.pos+=4)};c6.prototype.sfixed32=function(){if(this.pos+4>this.len)throw R9(this,4);return yJ(this.buf,this.pos+=4)|0};function Jk(){if(this.pos+8>this.len)throw R9(this,8);return new Wk(yJ(this.buf,this.pos+=4),yJ(this.buf,this.pos+=4))}c6.prototype.float=function(){if(this.pos+4>this.len)throw R9(this,4);var Z=M9.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Z};c6.prototype.double=function(){if(this.pos+8>this.len)throw R9(this,4);var Z=M9.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Z};c6.prototype.bytes=function(){var Z=this.uint32(),W=this.pos,H=this.pos+Z;if(H>this.len)throw R9(this,Z);if(this.pos+=Z,Array.isArray(this.buf))return this.buf.slice(W,H);if(W===H){var F=M9.Buffer;return F?F.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,W,H)};c6.prototype.string=function(){var Z=this.bytes();return qV0.read(Z,0,Z.length)};c6.prototype.skip=function(Z){if(typeof Z==="number"){if(this.pos+Z>this.len)throw R9(this,Z);this.pos+=Z}else do if(this.pos>=this.len)throw R9(this);while(this.buf[this.pos++]&128);return this};c6.prototype.skipType=function(Y){switch(Y){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:while((Y=this.uint32()&7)!==4)this.skipType(Y);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+Y+" at offset "+this.pos)}return this};c6._configure=function(Y){SH=Y,c6.create=Kk(),SH._configure();var Z=M9.Long?"toLong":"toNumber";M9.merge(c6.prototype,{int64:function(){return wH.call(this)[Z](!1)},uint64:function(){return wH.call(this)[Z](!0)},sint64:function(){return wH.call(this).zzDecode()[Z](!1)},fixed64:function(){return Jk.call(this)[Z](!0)},sfixed64:function(){return Jk.call(this)[Z](!1)}})}});var qk=H0((zc0,Vk)=>{Vk.exports=p5;var Hk=vJ();(p5.prototype=Object.create(Hk.prototype)).constructor=p5;var Fk=l9();function p5(Y){Hk.call(this,Y)}p5._configure=function(){if(Fk.Buffer)p5.prototype._slice=Fk.Buffer.prototype.slice};p5.prototype.string=function(){var Z=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+Z,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+Z,this.len))};p5._configure()});var Bk=H0((Bc0,zk)=>{zk.exports=nZ;var fH=l9();(nZ.prototype=Object.create(fH.EventEmitter.prototype)).constructor=nZ;function nZ(Y,Z,W){if(typeof Y!=="function")throw TypeError("rpcImpl must be a function");fH.EventEmitter.call(this),this.rpcImpl=Y,this.requestDelimited=Boolean(Z),this.responseDelimited=Boolean(W)}nZ.prototype.rpcCall=function Y(Z,W,H,F,X){if(!F)throw TypeError("request must be specified");var J=this;if(!X)return fH.asPromise(Y,J,Z,W,H,F);if(!J.rpcImpl){setTimeout(function(){X(Error("already ended"))},0);return}try{return J.rpcImpl(Z,W[J.requestDelimited?"encodeDelimited":"encode"](F).finish(),function(G,q){if(G)return J.emit("error",G,Z),X(G);if(q===null){J.end(!0);return}if(!(q instanceof H))try{q=H[J.responseDelimited?"decodeDelimited":"decode"](q)}catch(K){return J.emit("error",K,Z),X(K)}return J.emit("data",q,Z),X(null,q)})}catch(Q){J.emit("error",Q,Z),setTimeout(function(){X(Q)},0);return}};nZ.prototype.end=function(Z){if(this.rpcImpl){if(!Z)this.rpcImpl(null,null,null);this.rpcImpl=null,this.emit("end").off()}return this}});var kH=H0((Ak)=>{var zV0=Ak;zV0.Service=Bk()});var yH=H0((Uc0,Uk)=>{Uk.exports={}});var vH=H0((Ok)=>{var j8=Ok;j8.build="minimal";j8.Writer=kJ();j8.BufferWriter=Qk();j8.Reader=vJ();j8.BufferReader=qk();j8.util=l9();j8.rpc=kH();j8.roots=yH();j8.configure=Nk;function Nk(){j8.util._configure(),j8.Writer._configure(j8.BufferWriter),j8.Reader._configure(j8.BufferReader)}Nk()});var hJ=H0((Dk,Tk)=>{Object.defineProperty(Dk,"__esModule",{value:!0});var k1=vH(),x0=k1.Reader,u1=k1.Writer,W0=k1.util,X0=k1.roots.default||(k1.roots.default={});X0.opentelemetry=function(){var Y={};return Y.proto=function(){var Z={};return Z.common=function(){var W={};return W.v1=function(){var H={};return H.AnyValue=function(){function F(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.stringValue=null,F.prototype.boolValue=null,F.prototype.intValue=null,F.prototype.doubleValue=null,F.prototype.arrayValue=null,F.prototype.kvlistValue=null,F.prototype.bytesValue=null;var X;return Object.defineProperty(F.prototype,"value",{get:W0.oneOfGetter(X=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.stringValue!=null&&Object.hasOwnProperty.call(Q,"stringValue"))G.uint32(10).string(Q.stringValue);if(Q.boolValue!=null&&Object.hasOwnProperty.call(Q,"boolValue"))G.uint32(16).bool(Q.boolValue);if(Q.intValue!=null&&Object.hasOwnProperty.call(Q,"intValue"))G.uint32(24).int64(Q.intValue);if(Q.doubleValue!=null&&Object.hasOwnProperty.call(Q,"doubleValue"))G.uint32(33).double(Q.doubleValue);if(Q.arrayValue!=null&&Object.hasOwnProperty.call(Q,"arrayValue"))X0.opentelemetry.proto.common.v1.ArrayValue.encode(Q.arrayValue,G.uint32(42).fork()).ldelim();if(Q.kvlistValue!=null&&Object.hasOwnProperty.call(Q,"kvlistValue"))X0.opentelemetry.proto.common.v1.KeyValueList.encode(Q.kvlistValue,G.uint32(50).fork()).ldelim();if(Q.bytesValue!=null&&Object.hasOwnProperty.call(Q,"bytesValue"))G.uint32(58).bytes(Q.bytesValue);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.common.v1.AnyValue;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.stringValue=Q.string();break}case 2:{V.boolValue=Q.bool();break}case 3:{V.intValue=Q.int64();break}case 4:{V.doubleValue=Q.double();break}case 5:{V.arrayValue=X0.opentelemetry.proto.common.v1.ArrayValue.decode(Q,Q.uint32());break}case 6:{V.kvlistValue=X0.opentelemetry.proto.common.v1.KeyValueList.decode(Q,Q.uint32());break}case 7:{V.bytesValue=Q.bytes();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.stringValue!=null&&Q.hasOwnProperty("stringValue")){if(G.value=1,!W0.isString(Q.stringValue))return"stringValue: string expected"}if(Q.boolValue!=null&&Q.hasOwnProperty("boolValue")){if(G.value===1)return"value: multiple values";if(G.value=1,typeof Q.boolValue!=="boolean")return"boolValue: boolean expected"}if(Q.intValue!=null&&Q.hasOwnProperty("intValue")){if(G.value===1)return"value: multiple values";if(G.value=1,!W0.isInteger(Q.intValue)&&!(Q.intValue&&W0.isInteger(Q.intValue.low)&&W0.isInteger(Q.intValue.high)))return"intValue: integer|Long expected"}if(Q.doubleValue!=null&&Q.hasOwnProperty("doubleValue")){if(G.value===1)return"value: multiple values";if(G.value=1,typeof Q.doubleValue!=="number")return"doubleValue: number expected"}if(Q.arrayValue!=null&&Q.hasOwnProperty("arrayValue")){if(G.value===1)return"value: multiple values";G.value=1;{var q=X0.opentelemetry.proto.common.v1.ArrayValue.verify(Q.arrayValue);if(q)return"arrayValue."+q}}if(Q.kvlistValue!=null&&Q.hasOwnProperty("kvlistValue")){if(G.value===1)return"value: multiple values";G.value=1;{var q=X0.opentelemetry.proto.common.v1.KeyValueList.verify(Q.kvlistValue);if(q)return"kvlistValue."+q}}if(Q.bytesValue!=null&&Q.hasOwnProperty("bytesValue")){if(G.value===1)return"value: multiple values";if(G.value=1,!(Q.bytesValue&&typeof Q.bytesValue.length==="number"||W0.isString(Q.bytesValue)))return"bytesValue: buffer expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.common.v1.AnyValue)return Q;var G=new X0.opentelemetry.proto.common.v1.AnyValue;if(Q.stringValue!=null)G.stringValue=String(Q.stringValue);if(Q.boolValue!=null)G.boolValue=Boolean(Q.boolValue);if(Q.intValue!=null){if(W0.Long)(G.intValue=W0.Long.fromValue(Q.intValue)).unsigned=!1;else if(typeof Q.intValue==="string")G.intValue=parseInt(Q.intValue,10);else if(typeof Q.intValue==="number")G.intValue=Q.intValue;else if(typeof Q.intValue==="object")G.intValue=new W0.LongBits(Q.intValue.low>>>0,Q.intValue.high>>>0).toNumber()}if(Q.doubleValue!=null)G.doubleValue=Number(Q.doubleValue);if(Q.arrayValue!=null){if(typeof Q.arrayValue!=="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");G.arrayValue=X0.opentelemetry.proto.common.v1.ArrayValue.fromObject(Q.arrayValue)}if(Q.kvlistValue!=null){if(typeof Q.kvlistValue!=="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");G.kvlistValue=X0.opentelemetry.proto.common.v1.KeyValueList.fromObject(Q.kvlistValue)}if(Q.bytesValue!=null){if(typeof Q.bytesValue==="string")W0.base64.decode(Q.bytesValue,G.bytesValue=W0.newBuffer(W0.base64.length(Q.bytesValue)),0);else if(Q.bytesValue.length>=0)G.bytesValue=Q.bytesValue}return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(Q.stringValue!=null&&Q.hasOwnProperty("stringValue")){if(q.stringValue=Q.stringValue,G.oneofs)q.value="stringValue"}if(Q.boolValue!=null&&Q.hasOwnProperty("boolValue")){if(q.boolValue=Q.boolValue,G.oneofs)q.value="boolValue"}if(Q.intValue!=null&&Q.hasOwnProperty("intValue")){if(typeof Q.intValue==="number")q.intValue=G.longs===String?String(Q.intValue):Q.intValue;else q.intValue=G.longs===String?W0.Long.prototype.toString.call(Q.intValue):G.longs===Number?new W0.LongBits(Q.intValue.low>>>0,Q.intValue.high>>>0).toNumber():Q.intValue;if(G.oneofs)q.value="intValue"}if(Q.doubleValue!=null&&Q.hasOwnProperty("doubleValue")){if(q.doubleValue=G.json&&!isFinite(Q.doubleValue)?String(Q.doubleValue):Q.doubleValue,G.oneofs)q.value="doubleValue"}if(Q.arrayValue!=null&&Q.hasOwnProperty("arrayValue")){if(q.arrayValue=X0.opentelemetry.proto.common.v1.ArrayValue.toObject(Q.arrayValue,G),G.oneofs)q.value="arrayValue"}if(Q.kvlistValue!=null&&Q.hasOwnProperty("kvlistValue")){if(q.kvlistValue=X0.opentelemetry.proto.common.v1.KeyValueList.toObject(Q.kvlistValue,G),G.oneofs)q.value="kvlistValue"}if(Q.bytesValue!=null&&Q.hasOwnProperty("bytesValue")){if(q.bytesValue=G.bytes===String?W0.base64.encode(Q.bytesValue,0,Q.bytesValue.length):G.bytes===Array?Array.prototype.slice.call(Q.bytesValue):Q.bytesValue,G.oneofs)q.value="bytesValue"}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.common.v1.AnyValue"},F}(),H.ArrayValue=function(){function F(X){if(this.values=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.values=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.values!=null&&J.values.length)for(var G=0;G<J.values.length;++G)X0.opentelemetry.proto.common.v1.AnyValue.encode(J.values[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.ArrayValue;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.values&&K.values.length))K.values=[];K.values.push(X0.opentelemetry.proto.common.v1.AnyValue.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.values!=null&&J.hasOwnProperty("values")){if(!Array.isArray(J.values))return"values: array expected";for(var Q=0;Q<J.values.length;++Q){var G=X0.opentelemetry.proto.common.v1.AnyValue.verify(J.values[Q]);if(G)return"values."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.ArrayValue)return J;var Q=new X0.opentelemetry.proto.common.v1.ArrayValue;if(J.values){if(!Array.isArray(J.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");Q.values=[];for(var G=0;G<J.values.length;++G){if(typeof J.values[G]!=="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");Q.values[G]=X0.opentelemetry.proto.common.v1.AnyValue.fromObject(J.values[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.values=[];if(J.values&&J.values.length){G.values=[];for(var q=0;q<J.values.length;++q)G.values[q]=X0.opentelemetry.proto.common.v1.AnyValue.toObject(J.values[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.ArrayValue"},F}(),H.KeyValueList=function(){function F(X){if(this.values=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.values=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.values!=null&&J.values.length)for(var G=0;G<J.values.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.values[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.KeyValueList;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.values&&K.values.length))K.values=[];K.values.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.values!=null&&J.hasOwnProperty("values")){if(!Array.isArray(J.values))return"values: array expected";for(var Q=0;Q<J.values.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.values[Q]);if(G)return"values."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.KeyValueList)return J;var Q=new X0.opentelemetry.proto.common.v1.KeyValueList;if(J.values){if(!Array.isArray(J.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");Q.values=[];for(var G=0;G<J.values.length;++G){if(typeof J.values[G]!=="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");Q.values[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.values[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.values=[];if(J.values&&J.values.length){G.values=[];for(var q=0;q<J.values.length;++q)G.values[q]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.values[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.KeyValueList"},F}(),H.KeyValue=function(){function F(X){if(X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.key=null,F.prototype.value=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.key!=null&&Object.hasOwnProperty.call(J,"key"))Q.uint32(10).string(J.key);if(J.value!=null&&Object.hasOwnProperty.call(J,"value"))X0.opentelemetry.proto.common.v1.AnyValue.encode(J.value,Q.uint32(18).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.KeyValue;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.key=J.string();break}case 2:{K.value=X0.opentelemetry.proto.common.v1.AnyValue.decode(J,J.uint32());break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.key!=null&&J.hasOwnProperty("key")){if(!W0.isString(J.key))return"key: string expected"}if(J.value!=null&&J.hasOwnProperty("value")){var Q=X0.opentelemetry.proto.common.v1.AnyValue.verify(J.value);if(Q)return"value."+Q}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.KeyValue)return J;var Q=new X0.opentelemetry.proto.common.v1.KeyValue;if(J.key!=null)Q.key=String(J.key);if(J.value!=null){if(typeof J.value!=="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");Q.value=X0.opentelemetry.proto.common.v1.AnyValue.fromObject(J.value)}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.defaults)G.key="",G.value=null;if(J.key!=null&&J.hasOwnProperty("key"))G.key=J.key;if(J.value!=null&&J.hasOwnProperty("value"))G.value=X0.opentelemetry.proto.common.v1.AnyValue.toObject(J.value,Q);return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.KeyValue"},F}(),H.InstrumentationScope=function(){function F(X){if(this.attributes=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.name=null,F.prototype.version=null,F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.name!=null&&Object.hasOwnProperty.call(J,"name"))Q.uint32(10).string(J.name);if(J.version!=null&&Object.hasOwnProperty.call(J,"version"))Q.uint32(18).string(J.version);if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(26).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(32).uint32(J.droppedAttributesCount);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.InstrumentationScope;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.name=J.string();break}case 2:{K.version=J.string();break}case 3:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 4:{K.droppedAttributesCount=J.uint32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.name!=null&&J.hasOwnProperty("name")){if(!W0.isString(J.name))return"name: string expected"}if(J.version!=null&&J.hasOwnProperty("version")){if(!W0.isString(J.version))return"version: string expected"}if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.InstrumentationScope)return J;var Q=new X0.opentelemetry.proto.common.v1.InstrumentationScope;if(J.name!=null)Q.name=String(J.name);if(J.version!=null)Q.version=String(J.version);if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[];if(Q.defaults)G.name="",G.version="",G.droppedAttributesCount=0;if(J.name!=null&&J.hasOwnProperty("name"))G.name=J.name;if(J.version!=null&&J.hasOwnProperty("version"))G.version=J.version;if(J.attributes&&J.attributes.length){G.attributes=[];for(var q=0;q<J.attributes.length;++q)G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[q],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.InstrumentationScope"},F}(),H.EntityRef=function(){function F(X){if(this.idKeys=[],this.descriptionKeys=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.schemaUrl=null,F.prototype.type=null,F.prototype.idKeys=W0.emptyArray,F.prototype.descriptionKeys=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(10).string(J.schemaUrl);if(J.type!=null&&Object.hasOwnProperty.call(J,"type"))Q.uint32(18).string(J.type);if(J.idKeys!=null&&J.idKeys.length)for(var G=0;G<J.idKeys.length;++G)Q.uint32(26).string(J.idKeys[G]);if(J.descriptionKeys!=null&&J.descriptionKeys.length)for(var G=0;G<J.descriptionKeys.length;++G)Q.uint32(34).string(J.descriptionKeys[G]);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.EntityRef;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.schemaUrl=J.string();break}case 2:{K.type=J.string();break}case 3:{if(!(K.idKeys&&K.idKeys.length))K.idKeys=[];K.idKeys.push(J.string());break}case 4:{if(!(K.descriptionKeys&&K.descriptionKeys.length))K.descriptionKeys=[];K.descriptionKeys.push(J.string());break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}if(J.type!=null&&J.hasOwnProperty("type")){if(!W0.isString(J.type))return"type: string expected"}if(J.idKeys!=null&&J.hasOwnProperty("idKeys")){if(!Array.isArray(J.idKeys))return"idKeys: array expected";for(var Q=0;Q<J.idKeys.length;++Q)if(!W0.isString(J.idKeys[Q]))return"idKeys: string[] expected"}if(J.descriptionKeys!=null&&J.hasOwnProperty("descriptionKeys")){if(!Array.isArray(J.descriptionKeys))return"descriptionKeys: array expected";for(var Q=0;Q<J.descriptionKeys.length;++Q)if(!W0.isString(J.descriptionKeys[Q]))return"descriptionKeys: string[] expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.EntityRef)return J;var Q=new X0.opentelemetry.proto.common.v1.EntityRef;if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);if(J.type!=null)Q.type=String(J.type);if(J.idKeys){if(!Array.isArray(J.idKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected");Q.idKeys=[];for(var G=0;G<J.idKeys.length;++G)Q.idKeys[G]=String(J.idKeys[G])}if(J.descriptionKeys){if(!Array.isArray(J.descriptionKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected");Q.descriptionKeys=[];for(var G=0;G<J.descriptionKeys.length;++G)Q.descriptionKeys[G]=String(J.descriptionKeys[G])}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.idKeys=[],G.descriptionKeys=[];if(Q.defaults)G.schemaUrl="",G.type="";if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;if(J.type!=null&&J.hasOwnProperty("type"))G.type=J.type;if(J.idKeys&&J.idKeys.length){G.idKeys=[];for(var q=0;q<J.idKeys.length;++q)G.idKeys[q]=J.idKeys[q]}if(J.descriptionKeys&&J.descriptionKeys.length){G.descriptionKeys=[];for(var q=0;q<J.descriptionKeys.length;++q)G.descriptionKeys[q]=J.descriptionKeys[q]}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.EntityRef"},F}(),H}(),W}(),Z.resource=function(){var W={};return W.v1=function(){var H={};return H.Resource=function(){function F(X){if(this.attributes=[],this.entityRefs=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.prototype.entityRefs=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(10).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(16).uint32(J.droppedAttributesCount);if(J.entityRefs!=null&&J.entityRefs.length)for(var G=0;G<J.entityRefs.length;++G)X0.opentelemetry.proto.common.v1.EntityRef.encode(J.entityRefs[G],Q.uint32(26).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.resource.v1.Resource;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 2:{K.droppedAttributesCount=J.uint32();break}case 3:{if(!(K.entityRefs&&K.entityRefs.length))K.entityRefs=[];K.entityRefs.push(X0.opentelemetry.proto.common.v1.EntityRef.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(J.entityRefs!=null&&J.hasOwnProperty("entityRefs")){if(!Array.isArray(J.entityRefs))return"entityRefs: array expected";for(var Q=0;Q<J.entityRefs.length;++Q){var G=X0.opentelemetry.proto.common.v1.EntityRef.verify(J.entityRefs[Q]);if(G)return"entityRefs."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.resource.v1.Resource)return J;var Q=new X0.opentelemetry.proto.resource.v1.Resource;if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;if(J.entityRefs){if(!Array.isArray(J.entityRefs))throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected");Q.entityRefs=[];for(var G=0;G<J.entityRefs.length;++G){if(typeof J.entityRefs[G]!=="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected");Q.entityRefs[G]=X0.opentelemetry.proto.common.v1.EntityRef.fromObject(J.entityRefs[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[],G.entityRefs=[];if(Q.defaults)G.droppedAttributesCount=0;if(J.attributes&&J.attributes.length){G.attributes=[];for(var q=0;q<J.attributes.length;++q)G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[q],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;if(J.entityRefs&&J.entityRefs.length){G.entityRefs=[];for(var q=0;q<J.entityRefs.length;++q)G.entityRefs[q]=X0.opentelemetry.proto.common.v1.EntityRef.toObject(J.entityRefs[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.resource.v1.Resource"},F}(),H}(),W}(),Z.trace=function(){var W={};return W.v1=function(){var H={};return H.TracesData=function(){function F(X){if(this.resourceSpans=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resourceSpans=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resourceSpans!=null&&J.resourceSpans.length)for(var G=0;G<J.resourceSpans.length;++G)X0.opentelemetry.proto.trace.v1.ResourceSpans.encode(J.resourceSpans[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.TracesData;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.resourceSpans&&K.resourceSpans.length))K.resourceSpans=[];K.resourceSpans.push(X0.opentelemetry.proto.trace.v1.ResourceSpans.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resourceSpans!=null&&J.hasOwnProperty("resourceSpans")){if(!Array.isArray(J.resourceSpans))return"resourceSpans: array expected";for(var Q=0;Q<J.resourceSpans.length;++Q){var G=X0.opentelemetry.proto.trace.v1.ResourceSpans.verify(J.resourceSpans[Q]);if(G)return"resourceSpans."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.TracesData)return J;var Q=new X0.opentelemetry.proto.trace.v1.TracesData;if(J.resourceSpans){if(!Array.isArray(J.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");Q.resourceSpans=[];for(var G=0;G<J.resourceSpans.length;++G){if(typeof J.resourceSpans[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");Q.resourceSpans[G]=X0.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(J.resourceSpans[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.resourceSpans=[];if(J.resourceSpans&&J.resourceSpans.length){G.resourceSpans=[];for(var q=0;q<J.resourceSpans.length;++q)G.resourceSpans[q]=X0.opentelemetry.proto.trace.v1.ResourceSpans.toObject(J.resourceSpans[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.TracesData"},F}(),H.ResourceSpans=function(){function F(X){if(this.scopeSpans=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resource=null,F.prototype.scopeSpans=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resource!=null&&Object.hasOwnProperty.call(J,"resource"))X0.opentelemetry.proto.resource.v1.Resource.encode(J.resource,Q.uint32(10).fork()).ldelim();if(J.scopeSpans!=null&&J.scopeSpans.length)for(var G=0;G<J.scopeSpans.length;++G)X0.opentelemetry.proto.trace.v1.ScopeSpans.encode(J.scopeSpans[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.ResourceSpans;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.resource=X0.opentelemetry.proto.resource.v1.Resource.decode(J,J.uint32());break}case 2:{if(!(K.scopeSpans&&K.scopeSpans.length))K.scopeSpans=[];K.scopeSpans.push(X0.opentelemetry.proto.trace.v1.ScopeSpans.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resource!=null&&J.hasOwnProperty("resource")){var Q=X0.opentelemetry.proto.resource.v1.Resource.verify(J.resource);if(Q)return"resource."+Q}if(J.scopeSpans!=null&&J.hasOwnProperty("scopeSpans")){if(!Array.isArray(J.scopeSpans))return"scopeSpans: array expected";for(var G=0;G<J.scopeSpans.length;++G){var Q=X0.opentelemetry.proto.trace.v1.ScopeSpans.verify(J.scopeSpans[G]);if(Q)return"scopeSpans."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.ResourceSpans)return J;var Q=new X0.opentelemetry.proto.trace.v1.ResourceSpans;if(J.resource!=null){if(typeof J.resource!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");Q.resource=X0.opentelemetry.proto.resource.v1.Resource.fromObject(J.resource)}if(J.scopeSpans){if(!Array.isArray(J.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");Q.scopeSpans=[];for(var G=0;G<J.scopeSpans.length;++G){if(typeof J.scopeSpans[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");Q.scopeSpans[G]=X0.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(J.scopeSpans[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.scopeSpans=[];if(Q.defaults)G.resource=null,G.schemaUrl="";if(J.resource!=null&&J.hasOwnProperty("resource"))G.resource=X0.opentelemetry.proto.resource.v1.Resource.toObject(J.resource,Q);if(J.scopeSpans&&J.scopeSpans.length){G.scopeSpans=[];for(var q=0;q<J.scopeSpans.length;++q)G.scopeSpans[q]=X0.opentelemetry.proto.trace.v1.ScopeSpans.toObject(J.scopeSpans[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.ResourceSpans"},F}(),H.ScopeSpans=function(){function F(X){if(this.spans=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.scope=null,F.prototype.spans=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.scope!=null&&Object.hasOwnProperty.call(J,"scope"))X0.opentelemetry.proto.common.v1.InstrumentationScope.encode(J.scope,Q.uint32(10).fork()).ldelim();if(J.spans!=null&&J.spans.length)for(var G=0;G<J.spans.length;++G)X0.opentelemetry.proto.trace.v1.Span.encode(J.spans[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.ScopeSpans;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.decode(J,J.uint32());break}case 2:{if(!(K.spans&&K.spans.length))K.spans=[];K.spans.push(X0.opentelemetry.proto.trace.v1.Span.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.scope!=null&&J.hasOwnProperty("scope")){var Q=X0.opentelemetry.proto.common.v1.InstrumentationScope.verify(J.scope);if(Q)return"scope."+Q}if(J.spans!=null&&J.hasOwnProperty("spans")){if(!Array.isArray(J.spans))return"spans: array expected";for(var G=0;G<J.spans.length;++G){var Q=X0.opentelemetry.proto.trace.v1.Span.verify(J.spans[G]);if(Q)return"spans."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.ScopeSpans)return J;var Q=new X0.opentelemetry.proto.trace.v1.ScopeSpans;if(J.scope!=null){if(typeof J.scope!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");Q.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(J.scope)}if(J.spans){if(!Array.isArray(J.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");Q.spans=[];for(var G=0;G<J.spans.length;++G){if(typeof J.spans[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");Q.spans[G]=X0.opentelemetry.proto.trace.v1.Span.fromObject(J.spans[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.spans=[];if(Q.defaults)G.scope=null,G.schemaUrl="";if(J.scope!=null&&J.hasOwnProperty("scope"))G.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.toObject(J.scope,Q);if(J.spans&&J.spans.length){G.spans=[];for(var q=0;q<J.spans.length;++q)G.spans[q]=X0.opentelemetry.proto.trace.v1.Span.toObject(J.spans[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.ScopeSpans"},F}(),H.Span=function(){function F(X){if(this.attributes=[],this.events=[],this.links=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.traceId=null,F.prototype.spanId=null,F.prototype.traceState=null,F.prototype.parentSpanId=null,F.prototype.flags=null,F.prototype.name=null,F.prototype.kind=null,F.prototype.startTimeUnixNano=null,F.prototype.endTimeUnixNano=null,F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.prototype.events=W0.emptyArray,F.prototype.droppedEventsCount=null,F.prototype.links=W0.emptyArray,F.prototype.droppedLinksCount=null,F.prototype.status=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.traceId!=null&&Object.hasOwnProperty.call(J,"traceId"))Q.uint32(10).bytes(J.traceId);if(J.spanId!=null&&Object.hasOwnProperty.call(J,"spanId"))Q.uint32(18).bytes(J.spanId);if(J.traceState!=null&&Object.hasOwnProperty.call(J,"traceState"))Q.uint32(26).string(J.traceState);if(J.parentSpanId!=null&&Object.hasOwnProperty.call(J,"parentSpanId"))Q.uint32(34).bytes(J.parentSpanId);if(J.name!=null&&Object.hasOwnProperty.call(J,"name"))Q.uint32(42).string(J.name);if(J.kind!=null&&Object.hasOwnProperty.call(J,"kind"))Q.uint32(48).int32(J.kind);if(J.startTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"startTimeUnixNano"))Q.uint32(57).fixed64(J.startTimeUnixNano);if(J.endTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"endTimeUnixNano"))Q.uint32(65).fixed64(J.endTimeUnixNano);if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(74).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(80).uint32(J.droppedAttributesCount);if(J.events!=null&&J.events.length)for(var G=0;G<J.events.length;++G)X0.opentelemetry.proto.trace.v1.Span.Event.encode(J.events[G],Q.uint32(90).fork()).ldelim();if(J.droppedEventsCount!=null&&Object.hasOwnProperty.call(J,"droppedEventsCount"))Q.uint32(96).uint32(J.droppedEventsCount);if(J.links!=null&&J.links.length)for(var G=0;G<J.links.length;++G)X0.opentelemetry.proto.trace.v1.Span.Link.encode(J.links[G],Q.uint32(106).fork()).ldelim();if(J.droppedLinksCount!=null&&Object.hasOwnProperty.call(J,"droppedLinksCount"))Q.uint32(112).uint32(J.droppedLinksCount);if(J.status!=null&&Object.hasOwnProperty.call(J,"status"))X0.opentelemetry.proto.trace.v1.Status.encode(J.status,Q.uint32(122).fork()).ldelim();if(J.flags!=null&&Object.hasOwnProperty.call(J,"flags"))Q.uint32(133).fixed32(J.flags);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.Span;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.traceId=J.bytes();break}case 2:{K.spanId=J.bytes();break}case 3:{K.traceState=J.string();break}case 4:{K.parentSpanId=J.bytes();break}case 16:{K.flags=J.fixed32();break}case 5:{K.name=J.string();break}case 6:{K.kind=J.int32();break}case 7:{K.startTimeUnixNano=J.fixed64();break}case 8:{K.endTimeUnixNano=J.fixed64();break}case 9:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 10:{K.droppedAttributesCount=J.uint32();break}case 11:{if(!(K.events&&K.events.length))K.events=[];K.events.push(X0.opentelemetry.proto.trace.v1.Span.Event.decode(J,J.uint32()));break}case 12:{K.droppedEventsCount=J.uint32();break}case 13:{if(!(K.links&&K.links.length))K.links=[];K.links.push(X0.opentelemetry.proto.trace.v1.Span.Link.decode(J,J.uint32()));break}case 14:{K.droppedLinksCount=J.uint32();break}case 15:{K.status=X0.opentelemetry.proto.trace.v1.Status.decode(J,J.uint32());break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.traceId!=null&&J.hasOwnProperty("traceId")){if(!(J.traceId&&typeof J.traceId.length==="number"||W0.isString(J.traceId)))return"traceId: buffer expected"}if(J.spanId!=null&&J.hasOwnProperty("spanId")){if(!(J.spanId&&typeof J.spanId.length==="number"||W0.isString(J.spanId)))return"spanId: buffer expected"}if(J.traceState!=null&&J.hasOwnProperty("traceState")){if(!W0.isString(J.traceState))return"traceState: string expected"}if(J.parentSpanId!=null&&J.hasOwnProperty("parentSpanId")){if(!(J.parentSpanId&&typeof J.parentSpanId.length==="number"||W0.isString(J.parentSpanId)))return"parentSpanId: buffer expected"}if(J.flags!=null&&J.hasOwnProperty("flags")){if(!W0.isInteger(J.flags))return"flags: integer expected"}if(J.name!=null&&J.hasOwnProperty("name")){if(!W0.isString(J.name))return"name: string expected"}if(J.kind!=null&&J.hasOwnProperty("kind"))switch(J.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(J.startTimeUnixNano)&&!(J.startTimeUnixNano&&W0.isInteger(J.startTimeUnixNano.low)&&W0.isInteger(J.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(J.endTimeUnixNano!=null&&J.hasOwnProperty("endTimeUnixNano")){if(!W0.isInteger(J.endTimeUnixNano)&&!(J.endTimeUnixNano&&W0.isInteger(J.endTimeUnixNano.low)&&W0.isInteger(J.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected"}if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(J.events!=null&&J.hasOwnProperty("events")){if(!Array.isArray(J.events))return"events: array expected";for(var Q=0;Q<J.events.length;++Q){var G=X0.opentelemetry.proto.trace.v1.Span.Event.verify(J.events[Q]);if(G)return"events."+G}}if(J.droppedEventsCount!=null&&J.hasOwnProperty("droppedEventsCount")){if(!W0.isInteger(J.droppedEventsCount))return"droppedEventsCount: integer expected"}if(J.links!=null&&J.hasOwnProperty("links")){if(!Array.isArray(J.links))return"links: array expected";for(var Q=0;Q<J.links.length;++Q){var G=X0.opentelemetry.proto.trace.v1.Span.Link.verify(J.links[Q]);if(G)return"links."+G}}if(J.droppedLinksCount!=null&&J.hasOwnProperty("droppedLinksCount")){if(!W0.isInteger(J.droppedLinksCount))return"droppedLinksCount: integer expected"}if(J.status!=null&&J.hasOwnProperty("status")){var G=X0.opentelemetry.proto.trace.v1.Status.verify(J.status);if(G)return"status."+G}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.Span)return J;var Q=new X0.opentelemetry.proto.trace.v1.Span;if(J.traceId!=null){if(typeof J.traceId==="string")W0.base64.decode(J.traceId,Q.traceId=W0.newBuffer(W0.base64.length(J.traceId)),0);else if(J.traceId.length>=0)Q.traceId=J.traceId}if(J.spanId!=null){if(typeof J.spanId==="string")W0.base64.decode(J.spanId,Q.spanId=W0.newBuffer(W0.base64.length(J.spanId)),0);else if(J.spanId.length>=0)Q.spanId=J.spanId}if(J.traceState!=null)Q.traceState=String(J.traceState);if(J.parentSpanId!=null){if(typeof J.parentSpanId==="string")W0.base64.decode(J.parentSpanId,Q.parentSpanId=W0.newBuffer(W0.base64.length(J.parentSpanId)),0);else if(J.parentSpanId.length>=0)Q.parentSpanId=J.parentSpanId}if(J.flags!=null)Q.flags=J.flags>>>0;if(J.name!=null)Q.name=String(J.name);switch(J.kind){default:if(typeof J.kind==="number"){Q.kind=J.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:Q.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:Q.kind=1;break;case"SPAN_KIND_SERVER":case 2:Q.kind=2;break;case"SPAN_KIND_CLIENT":case 3:Q.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:Q.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:Q.kind=5;break}if(J.startTimeUnixNano!=null){if(W0.Long)(Q.startTimeUnixNano=W0.Long.fromValue(J.startTimeUnixNano)).unsigned=!1;else if(typeof J.startTimeUnixNano==="string")Q.startTimeUnixNano=parseInt(J.startTimeUnixNano,10);else if(typeof J.startTimeUnixNano==="number")Q.startTimeUnixNano=J.startTimeUnixNano;else if(typeof J.startTimeUnixNano==="object")Q.startTimeUnixNano=new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber()}if(J.endTimeUnixNano!=null){if(W0.Long)(Q.endTimeUnixNano=W0.Long.fromValue(J.endTimeUnixNano)).unsigned=!1;else if(typeof J.endTimeUnixNano==="string")Q.endTimeUnixNano=parseInt(J.endTimeUnixNano,10);else if(typeof J.endTimeUnixNano==="number")Q.endTimeUnixNano=J.endTimeUnixNano;else if(typeof J.endTimeUnixNano==="object")Q.endTimeUnixNano=new W0.LongBits(J.endTimeUnixNano.low>>>0,J.endTimeUnixNano.high>>>0).toNumber()}if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;if(J.events){if(!Array.isArray(J.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");Q.events=[];for(var G=0;G<J.events.length;++G){if(typeof J.events[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");Q.events[G]=X0.opentelemetry.proto.trace.v1.Span.Event.fromObject(J.events[G])}}if(J.droppedEventsCount!=null)Q.droppedEventsCount=J.droppedEventsCount>>>0;if(J.links){if(!Array.isArray(J.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");Q.links=[];for(var G=0;G<J.links.length;++G){if(typeof J.links[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");Q.links[G]=X0.opentelemetry.proto.trace.v1.Span.Link.fromObject(J.links[G])}}if(J.droppedLinksCount!=null)Q.droppedLinksCount=J.droppedLinksCount>>>0;if(J.status!=null){if(typeof J.status!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");Q.status=X0.opentelemetry.proto.trace.v1.Status.fromObject(J.status)}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[],G.events=[],G.links=[];if(Q.defaults){if(Q.bytes===String)G.traceId="";else if(G.traceId=[],Q.bytes!==Array)G.traceId=W0.newBuffer(G.traceId);if(Q.bytes===String)G.spanId="";else if(G.spanId=[],Q.bytes!==Array)G.spanId=W0.newBuffer(G.spanId);if(G.traceState="",Q.bytes===String)G.parentSpanId="";else if(G.parentSpanId=[],Q.bytes!==Array)G.parentSpanId=W0.newBuffer(G.parentSpanId);if(G.name="",G.kind=Q.enums===String?"SPAN_KIND_UNSPECIFIED":0,W0.Long){var q=new W0.Long(0,0,!1);G.startTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.startTimeUnixNano=Q.longs===String?"0":0;if(W0.Long){var q=new W0.Long(0,0,!1);G.endTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.endTimeUnixNano=Q.longs===String?"0":0;G.droppedAttributesCount=0,G.droppedEventsCount=0,G.droppedLinksCount=0,G.status=null,G.flags=0}if(J.traceId!=null&&J.hasOwnProperty("traceId"))G.traceId=Q.bytes===String?W0.base64.encode(J.traceId,0,J.traceId.length):Q.bytes===Array?Array.prototype.slice.call(J.traceId):J.traceId;if(J.spanId!=null&&J.hasOwnProperty("spanId"))G.spanId=Q.bytes===String?W0.base64.encode(J.spanId,0,J.spanId.length):Q.bytes===Array?Array.prototype.slice.call(J.spanId):J.spanId;if(J.traceState!=null&&J.hasOwnProperty("traceState"))G.traceState=J.traceState;if(J.parentSpanId!=null&&J.hasOwnProperty("parentSpanId"))G.parentSpanId=Q.bytes===String?W0.base64.encode(J.parentSpanId,0,J.parentSpanId.length):Q.bytes===Array?Array.prototype.slice.call(J.parentSpanId):J.parentSpanId;if(J.name!=null&&J.hasOwnProperty("name"))G.name=J.name;if(J.kind!=null&&J.hasOwnProperty("kind"))G.kind=Q.enums===String?X0.opentelemetry.proto.trace.v1.Span.SpanKind[J.kind]===void 0?J.kind:X0.opentelemetry.proto.trace.v1.Span.SpanKind[J.kind]:J.kind;if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano"))if(typeof J.startTimeUnixNano==="number")G.startTimeUnixNano=Q.longs===String?String(J.startTimeUnixNano):J.startTimeUnixNano;else G.startTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.startTimeUnixNano):Q.longs===Number?new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber():J.startTimeUnixNano;if(J.endTimeUnixNano!=null&&J.hasOwnProperty("endTimeUnixNano"))if(typeof J.endTimeUnixNano==="number")G.endTimeUnixNano=Q.longs===String?String(J.endTimeUnixNano):J.endTimeUnixNano;else G.endTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.endTimeUnixNano):Q.longs===Number?new W0.LongBits(J.endTimeUnixNano.low>>>0,J.endTimeUnixNano.high>>>0).toNumber():J.endTimeUnixNano;if(J.attributes&&J.attributes.length){G.attributes=[];for(var K=0;K<J.attributes.length;++K)G.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[K],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;if(J.events&&J.events.length){G.events=[];for(var K=0;K<J.events.length;++K)G.events[K]=X0.opentelemetry.proto.trace.v1.Span.Event.toObject(J.events[K],Q)}if(J.droppedEventsCount!=null&&J.hasOwnProperty("droppedEventsCount"))G.droppedEventsCount=J.droppedEventsCount;if(J.links&&J.links.length){G.links=[];for(var K=0;K<J.links.length;++K)G.links[K]=X0.opentelemetry.proto.trace.v1.Span.Link.toObject(J.links[K],Q)}if(J.droppedLinksCount!=null&&J.hasOwnProperty("droppedLinksCount"))G.droppedLinksCount=J.droppedLinksCount;if(J.status!=null&&J.hasOwnProperty("status"))G.status=X0.opentelemetry.proto.trace.v1.Status.toObject(J.status,Q);if(J.flags!=null&&J.hasOwnProperty("flags"))G.flags=J.flags;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.Span"},F.SpanKind=function(){var X={},J=Object.create(X);return J[X[0]="SPAN_KIND_UNSPECIFIED"]=0,J[X[1]="SPAN_KIND_INTERNAL"]=1,J[X[2]="SPAN_KIND_SERVER"]=2,J[X[3]="SPAN_KIND_CLIENT"]=3,J[X[4]="SPAN_KIND_PRODUCER"]=4,J[X[5]="SPAN_KIND_CONSUMER"]=5,J}(),F.Event=function(){function X(J){if(this.attributes=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.timeUnixNano=null,X.prototype.name=null,X.prototype.attributes=W0.emptyArray,X.prototype.droppedAttributesCount=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(9).fixed64(Q.timeUnixNano);if(Q.name!=null&&Object.hasOwnProperty.call(Q,"name"))G.uint32(18).string(Q.name);if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(26).fork()).ldelim();if(Q.droppedAttributesCount!=null&&Object.hasOwnProperty.call(Q,"droppedAttributesCount"))G.uint32(32).uint32(Q.droppedAttributesCount);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.trace.v1.Span.Event;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.timeUnixNano=Q.fixed64();break}case 2:{V.name=Q.string();break}case 3:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 4:{V.droppedAttributesCount=Q.uint32();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.name!=null&&Q.hasOwnProperty("name")){if(!W0.isString(Q.name))return"name: string expected"}if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var G=0;G<Q.attributes.length;++G){var q=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[G]);if(q)return"attributes."+q}}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(Q.droppedAttributesCount))return"droppedAttributesCount: integer expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.trace.v1.Span.Event)return Q;var G=new X0.opentelemetry.proto.trace.v1.Span.Event;if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.name!=null)G.name=String(Q.name);if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.droppedAttributesCount!=null)G.droppedAttributesCount=Q.droppedAttributesCount>>>0;return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.attributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;q.name="",q.droppedAttributesCount=0}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.name!=null&&Q.hasOwnProperty("name"))q.name=Q.name;if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount"))q.droppedAttributesCount=Q.droppedAttributesCount;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.trace.v1.Span.Event"},X}(),F.Link=function(){function X(J){if(this.attributes=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.traceId=null,X.prototype.spanId=null,X.prototype.traceState=null,X.prototype.attributes=W0.emptyArray,X.prototype.droppedAttributesCount=null,X.prototype.flags=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.traceId!=null&&Object.hasOwnProperty.call(Q,"traceId"))G.uint32(10).bytes(Q.traceId);if(Q.spanId!=null&&Object.hasOwnProperty.call(Q,"spanId"))G.uint32(18).bytes(Q.spanId);if(Q.traceState!=null&&Object.hasOwnProperty.call(Q,"traceState"))G.uint32(26).string(Q.traceState);if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(34).fork()).ldelim();if(Q.droppedAttributesCount!=null&&Object.hasOwnProperty.call(Q,"droppedAttributesCount"))G.uint32(40).uint32(Q.droppedAttributesCount);if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(53).fixed32(Q.flags);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.trace.v1.Span.Link;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.traceId=Q.bytes();break}case 2:{V.spanId=Q.bytes();break}case 3:{V.traceState=Q.string();break}case 4:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 5:{V.droppedAttributesCount=Q.uint32();break}case 6:{V.flags=Q.fixed32();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.traceId!=null&&Q.hasOwnProperty("traceId")){if(!(Q.traceId&&typeof Q.traceId.length==="number"||W0.isString(Q.traceId)))return"traceId: buffer expected"}if(Q.spanId!=null&&Q.hasOwnProperty("spanId")){if(!(Q.spanId&&typeof Q.spanId.length==="number"||W0.isString(Q.spanId)))return"spanId: buffer expected"}if(Q.traceState!=null&&Q.hasOwnProperty("traceState")){if(!W0.isString(Q.traceState))return"traceState: string expected"}if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var G=0;G<Q.attributes.length;++G){var q=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[G]);if(q)return"attributes."+q}}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(Q.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.trace.v1.Span.Link)return Q;var G=new X0.opentelemetry.proto.trace.v1.Span.Link;if(Q.traceId!=null){if(typeof Q.traceId==="string")W0.base64.decode(Q.traceId,G.traceId=W0.newBuffer(W0.base64.length(Q.traceId)),0);else if(Q.traceId.length>=0)G.traceId=Q.traceId}if(Q.spanId!=null){if(typeof Q.spanId==="string")W0.base64.decode(Q.spanId,G.spanId=W0.newBuffer(W0.base64.length(Q.spanId)),0);else if(Q.spanId.length>=0)G.spanId=Q.spanId}if(Q.traceState!=null)G.traceState=String(Q.traceState);if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.droppedAttributesCount!=null)G.droppedAttributesCount=Q.droppedAttributesCount>>>0;if(Q.flags!=null)G.flags=Q.flags>>>0;return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.attributes=[];if(G.defaults){if(G.bytes===String)q.traceId="";else if(q.traceId=[],G.bytes!==Array)q.traceId=W0.newBuffer(q.traceId);if(G.bytes===String)q.spanId="";else if(q.spanId=[],G.bytes!==Array)q.spanId=W0.newBuffer(q.spanId);q.traceState="",q.droppedAttributesCount=0,q.flags=0}if(Q.traceId!=null&&Q.hasOwnProperty("traceId"))q.traceId=G.bytes===String?W0.base64.encode(Q.traceId,0,Q.traceId.length):G.bytes===Array?Array.prototype.slice.call(Q.traceId):Q.traceId;if(Q.spanId!=null&&Q.hasOwnProperty("spanId"))q.spanId=G.bytes===String?W0.base64.encode(Q.spanId,0,Q.spanId.length):G.bytes===Array?Array.prototype.slice.call(Q.spanId):Q.spanId;if(Q.traceState!=null&&Q.hasOwnProperty("traceState"))q.traceState=Q.traceState;if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var K=0;K<Q.attributes.length;++K)q.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[K],G)}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount"))q.droppedAttributesCount=Q.droppedAttributesCount;if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.trace.v1.Span.Link"},X}(),F}(),H.Status=function(){function F(X){if(X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.message=null,F.prototype.code=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.message!=null&&Object.hasOwnProperty.call(J,"message"))Q.uint32(18).string(J.message);if(J.code!=null&&Object.hasOwnProperty.call(J,"code"))Q.uint32(24).int32(J.code);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.Status;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 2:{K.message=J.string();break}case 3:{K.code=J.int32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.message!=null&&J.hasOwnProperty("message")){if(!W0.isString(J.message))return"message: string expected"}if(J.code!=null&&J.hasOwnProperty("code"))switch(J.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.Status)return J;var Q=new X0.opentelemetry.proto.trace.v1.Status;if(J.message!=null)Q.message=String(J.message);switch(J.code){default:if(typeof J.code==="number"){Q.code=J.code;break}break;case"STATUS_CODE_UNSET":case 0:Q.code=0;break;case"STATUS_CODE_OK":case 1:Q.code=1;break;case"STATUS_CODE_ERROR":case 2:Q.code=2;break}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.defaults)G.message="",G.code=Q.enums===String?"STATUS_CODE_UNSET":0;if(J.message!=null&&J.hasOwnProperty("message"))G.message=J.message;if(J.code!=null&&J.hasOwnProperty("code"))G.code=Q.enums===String?X0.opentelemetry.proto.trace.v1.Status.StatusCode[J.code]===void 0?J.code:X0.opentelemetry.proto.trace.v1.Status.StatusCode[J.code]:J.code;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.Status"},F.StatusCode=function(){var X={},J=Object.create(X);return J[X[0]="STATUS_CODE_UNSET"]=0,J[X[1]="STATUS_CODE_OK"]=1,J[X[2]="STATUS_CODE_ERROR"]=2,J}(),F}(),H.SpanFlags=function(){var F={},X=Object.create(F);return X[F[0]="SPAN_FLAGS_DO_NOT_USE"]=0,X[F[255]="SPAN_FLAGS_TRACE_FLAGS_MASK"]=255,X[F[256]="SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"]=256,X[F[512]="SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"]=512,X}(),H}(),W}(),Z.collector=function(){var W={};return W.trace=function(){var H={};return H.v1=function(){var F={};return F.TraceService=function(){function X(J,Q,G){k1.rpc.Service.call(this,J,Q,G)}return(X.prototype=Object.create(k1.rpc.Service.prototype)).constructor=X,X.create=function(Q,G,q){return new this(Q,G,q)},Object.defineProperty(X.prototype.export=function J(Q,G){return this.rpcCall(J,X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Q,G)},"name",{value:"Export"}),X}(),F.ExportTraceServiceRequest=function(){function X(J){if(this.resourceSpans=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.resourceSpans=W0.emptyArray,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.resourceSpans!=null&&Q.resourceSpans.length)for(var q=0;q<Q.resourceSpans.length;++q)X0.opentelemetry.proto.trace.v1.ResourceSpans.encode(Q.resourceSpans[q],G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.resourceSpans&&V.resourceSpans.length))V.resourceSpans=[];V.resourceSpans.push(X0.opentelemetry.proto.trace.v1.ResourceSpans.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.resourceSpans!=null&&Q.hasOwnProperty("resourceSpans")){if(!Array.isArray(Q.resourceSpans))return"resourceSpans: array expected";for(var G=0;G<Q.resourceSpans.length;++G){var q=X0.opentelemetry.proto.trace.v1.ResourceSpans.verify(Q.resourceSpans[G]);if(q)return"resourceSpans."+q}}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return Q;var G=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(Q.resourceSpans){if(!Array.isArray(Q.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");G.resourceSpans=[];for(var q=0;q<Q.resourceSpans.length;++q){if(typeof Q.resourceSpans[q]!=="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");G.resourceSpans[q]=X0.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(Q.resourceSpans[q])}}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.resourceSpans=[];if(Q.resourceSpans&&Q.resourceSpans.length){q.resourceSpans=[];for(var K=0;K<Q.resourceSpans.length;++K)q.resourceSpans[K]=X0.opentelemetry.proto.trace.v1.ResourceSpans.toObject(Q.resourceSpans[K],G)}return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},X}(),F.ExportTraceServiceResponse=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.partialSuccess=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.partialSuccess!=null&&Object.hasOwnProperty.call(Q,"partialSuccess"))X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(Q.partialSuccess,G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.partialSuccess=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(Q,Q.uint32());break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess")){var G=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(Q.partialSuccess);if(G)return"partialSuccess."+G}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return Q;var G=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(Q.partialSuccess!=null){if(typeof Q.partialSuccess!=="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");G.partialSuccess=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(Q.partialSuccess)}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.partialSuccess=null;if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess"))q.partialSuccess=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(Q.partialSuccess,G);return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},X}(),F.ExportTracePartialSuccess=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.rejectedSpans=null,X.prototype.errorMessage=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.rejectedSpans!=null&&Object.hasOwnProperty.call(Q,"rejectedSpans"))G.uint32(8).int64(Q.rejectedSpans);if(Q.errorMessage!=null&&Object.hasOwnProperty.call(Q,"errorMessage"))G.uint32(18).string(Q.errorMessage);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.rejectedSpans=Q.int64();break}case 2:{V.errorMessage=Q.string();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.rejectedSpans!=null&&Q.hasOwnProperty("rejectedSpans")){if(!W0.isInteger(Q.rejectedSpans)&&!(Q.rejectedSpans&&W0.isInteger(Q.rejectedSpans.low)&&W0.isInteger(Q.rejectedSpans.high)))return"rejectedSpans: integer|Long expected"}if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage")){if(!W0.isString(Q.errorMessage))return"errorMessage: string expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return Q;var G=new X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;if(Q.rejectedSpans!=null){if(W0.Long)(G.rejectedSpans=W0.Long.fromValue(Q.rejectedSpans)).unsigned=!1;else if(typeof Q.rejectedSpans==="string")G.rejectedSpans=parseInt(Q.rejectedSpans,10);else if(typeof Q.rejectedSpans==="number")G.rejectedSpans=Q.rejectedSpans;else if(typeof Q.rejectedSpans==="object")G.rejectedSpans=new W0.LongBits(Q.rejectedSpans.low>>>0,Q.rejectedSpans.high>>>0).toNumber()}if(Q.errorMessage!=null)G.errorMessage=String(Q.errorMessage);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.rejectedSpans=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.rejectedSpans=G.longs===String?"0":0;q.errorMessage=""}if(Q.rejectedSpans!=null&&Q.hasOwnProperty("rejectedSpans"))if(typeof Q.rejectedSpans==="number")q.rejectedSpans=G.longs===String?String(Q.rejectedSpans):Q.rejectedSpans;else q.rejectedSpans=G.longs===String?W0.Long.prototype.toString.call(Q.rejectedSpans):G.longs===Number?new W0.LongBits(Q.rejectedSpans.low>>>0,Q.rejectedSpans.high>>>0).toNumber():Q.rejectedSpans;if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage"))q.errorMessage=Q.errorMessage;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},X}(),F}(),H}(),W.metrics=function(){var H={};return H.v1=function(){var F={};return F.MetricsService=function(){function X(J,Q,G){k1.rpc.Service.call(this,J,Q,G)}return(X.prototype=Object.create(k1.rpc.Service.prototype)).constructor=X,X.create=function(Q,G,q){return new this(Q,G,q)},Object.defineProperty(X.prototype.export=function J(Q,G){return this.rpcCall(J,X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Q,G)},"name",{value:"Export"}),X}(),F.ExportMetricsServiceRequest=function(){function X(J){if(this.resourceMetrics=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.resourceMetrics=W0.emptyArray,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.resourceMetrics!=null&&Q.resourceMetrics.length)for(var q=0;q<Q.resourceMetrics.length;++q)X0.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(Q.resourceMetrics[q],G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.resourceMetrics&&V.resourceMetrics.length))V.resourceMetrics=[];V.resourceMetrics.push(X0.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.resourceMetrics!=null&&Q.hasOwnProperty("resourceMetrics")){if(!Array.isArray(Q.resourceMetrics))return"resourceMetrics: array expected";for(var G=0;G<Q.resourceMetrics.length;++G){var q=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(Q.resourceMetrics[G]);if(q)return"resourceMetrics."+q}}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return Q;var G=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(Q.resourceMetrics){if(!Array.isArray(Q.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");G.resourceMetrics=[];for(var q=0;q<Q.resourceMetrics.length;++q){if(typeof Q.resourceMetrics[q]!=="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");G.resourceMetrics[q]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(Q.resourceMetrics[q])}}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.resourceMetrics=[];if(Q.resourceMetrics&&Q.resourceMetrics.length){q.resourceMetrics=[];for(var K=0;K<Q.resourceMetrics.length;++K)q.resourceMetrics[K]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(Q.resourceMetrics[K],G)}return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},X}(),F.ExportMetricsServiceResponse=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.partialSuccess=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.partialSuccess!=null&&Object.hasOwnProperty.call(Q,"partialSuccess"))X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(Q.partialSuccess,G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.partialSuccess=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(Q,Q.uint32());break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess")){var G=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(Q.partialSuccess);if(G)return"partialSuccess."+G}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return Q;var G=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(Q.partialSuccess!=null){if(typeof Q.partialSuccess!=="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");G.partialSuccess=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(Q.partialSuccess)}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.partialSuccess=null;if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess"))q.partialSuccess=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(Q.partialSuccess,G);return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},X}(),F.ExportMetricsPartialSuccess=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.rejectedDataPoints=null,X.prototype.errorMessage=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.rejectedDataPoints!=null&&Object.hasOwnProperty.call(Q,"rejectedDataPoints"))G.uint32(8).int64(Q.rejectedDataPoints);if(Q.errorMessage!=null&&Object.hasOwnProperty.call(Q,"errorMessage"))G.uint32(18).string(Q.errorMessage);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.rejectedDataPoints=Q.int64();break}case 2:{V.errorMessage=Q.string();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.rejectedDataPoints!=null&&Q.hasOwnProperty("rejectedDataPoints")){if(!W0.isInteger(Q.rejectedDataPoints)&&!(Q.rejectedDataPoints&&W0.isInteger(Q.rejectedDataPoints.low)&&W0.isInteger(Q.rejectedDataPoints.high)))return"rejectedDataPoints: integer|Long expected"}if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage")){if(!W0.isString(Q.errorMessage))return"errorMessage: string expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return Q;var G=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;if(Q.rejectedDataPoints!=null){if(W0.Long)(G.rejectedDataPoints=W0.Long.fromValue(Q.rejectedDataPoints)).unsigned=!1;else if(typeof Q.rejectedDataPoints==="string")G.rejectedDataPoints=parseInt(Q.rejectedDataPoints,10);else if(typeof Q.rejectedDataPoints==="number")G.rejectedDataPoints=Q.rejectedDataPoints;else if(typeof Q.rejectedDataPoints==="object")G.rejectedDataPoints=new W0.LongBits(Q.rejectedDataPoints.low>>>0,Q.rejectedDataPoints.high>>>0).toNumber()}if(Q.errorMessage!=null)G.errorMessage=String(Q.errorMessage);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.rejectedDataPoints=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.rejectedDataPoints=G.longs===String?"0":0;q.errorMessage=""}if(Q.rejectedDataPoints!=null&&Q.hasOwnProperty("rejectedDataPoints"))if(typeof Q.rejectedDataPoints==="number")q.rejectedDataPoints=G.longs===String?String(Q.rejectedDataPoints):Q.rejectedDataPoints;else q.rejectedDataPoints=G.longs===String?W0.Long.prototype.toString.call(Q.rejectedDataPoints):G.longs===Number?new W0.LongBits(Q.rejectedDataPoints.low>>>0,Q.rejectedDataPoints.high>>>0).toNumber():Q.rejectedDataPoints;if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage"))q.errorMessage=Q.errorMessage;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},X}(),F}(),H}(),W.logs=function(){var H={};return H.v1=function(){var F={};return F.LogsService=function(){function X(J,Q,G){k1.rpc.Service.call(this,J,Q,G)}return(X.prototype=Object.create(k1.rpc.Service.prototype)).constructor=X,X.create=function(Q,G,q){return new this(Q,G,q)},Object.defineProperty(X.prototype.export=function J(Q,G){return this.rpcCall(J,X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,Q,G)},"name",{value:"Export"}),X}(),F.ExportLogsServiceRequest=function(){function X(J){if(this.resourceLogs=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.resourceLogs=W0.emptyArray,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.resourceLogs!=null&&Q.resourceLogs.length)for(var q=0;q<Q.resourceLogs.length;++q)X0.opentelemetry.proto.logs.v1.ResourceLogs.encode(Q.resourceLogs[q],G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.resourceLogs&&V.resourceLogs.length))V.resourceLogs=[];V.resourceLogs.push(X0.opentelemetry.proto.logs.v1.ResourceLogs.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.resourceLogs!=null&&Q.hasOwnProperty("resourceLogs")){if(!Array.isArray(Q.resourceLogs))return"resourceLogs: array expected";for(var G=0;G<Q.resourceLogs.length;++G){var q=X0.opentelemetry.proto.logs.v1.ResourceLogs.verify(Q.resourceLogs[G]);if(q)return"resourceLogs."+q}}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return Q;var G=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(Q.resourceLogs){if(!Array.isArray(Q.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");G.resourceLogs=[];for(var q=0;q<Q.resourceLogs.length;++q){if(typeof Q.resourceLogs[q]!=="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");G.resourceLogs[q]=X0.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(Q.resourceLogs[q])}}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.resourceLogs=[];if(Q.resourceLogs&&Q.resourceLogs.length){q.resourceLogs=[];for(var K=0;K<Q.resourceLogs.length;++K)q.resourceLogs[K]=X0.opentelemetry.proto.logs.v1.ResourceLogs.toObject(Q.resourceLogs[K],G)}return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},X}(),F.ExportLogsServiceResponse=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.partialSuccess=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.partialSuccess!=null&&Object.hasOwnProperty.call(Q,"partialSuccess"))X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(Q.partialSuccess,G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.partialSuccess=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(Q,Q.uint32());break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess")){var G=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(Q.partialSuccess);if(G)return"partialSuccess."+G}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return Q;var G=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(Q.partialSuccess!=null){if(typeof Q.partialSuccess!=="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");G.partialSuccess=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(Q.partialSuccess)}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.partialSuccess=null;if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess"))q.partialSuccess=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(Q.partialSuccess,G);return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},X}(),F.ExportLogsPartialSuccess=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.rejectedLogRecords=null,X.prototype.errorMessage=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.rejectedLogRecords!=null&&Object.hasOwnProperty.call(Q,"rejectedLogRecords"))G.uint32(8).int64(Q.rejectedLogRecords);if(Q.errorMessage!=null&&Object.hasOwnProperty.call(Q,"errorMessage"))G.uint32(18).string(Q.errorMessage);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.rejectedLogRecords=Q.int64();break}case 2:{V.errorMessage=Q.string();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.rejectedLogRecords!=null&&Q.hasOwnProperty("rejectedLogRecords")){if(!W0.isInteger(Q.rejectedLogRecords)&&!(Q.rejectedLogRecords&&W0.isInteger(Q.rejectedLogRecords.low)&&W0.isInteger(Q.rejectedLogRecords.high)))return"rejectedLogRecords: integer|Long expected"}if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage")){if(!W0.isString(Q.errorMessage))return"errorMessage: string expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return Q;var G=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;if(Q.rejectedLogRecords!=null){if(W0.Long)(G.rejectedLogRecords=W0.Long.fromValue(Q.rejectedLogRecords)).unsigned=!1;else if(typeof Q.rejectedLogRecords==="string")G.rejectedLogRecords=parseInt(Q.rejectedLogRecords,10);else if(typeof Q.rejectedLogRecords==="number")G.rejectedLogRecords=Q.rejectedLogRecords;else if(typeof Q.rejectedLogRecords==="object")G.rejectedLogRecords=new W0.LongBits(Q.rejectedLogRecords.low>>>0,Q.rejectedLogRecords.high>>>0).toNumber()}if(Q.errorMessage!=null)G.errorMessage=String(Q.errorMessage);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.rejectedLogRecords=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.rejectedLogRecords=G.longs===String?"0":0;q.errorMessage=""}if(Q.rejectedLogRecords!=null&&Q.hasOwnProperty("rejectedLogRecords"))if(typeof Q.rejectedLogRecords==="number")q.rejectedLogRecords=G.longs===String?String(Q.rejectedLogRecords):Q.rejectedLogRecords;else q.rejectedLogRecords=G.longs===String?W0.Long.prototype.toString.call(Q.rejectedLogRecords):G.longs===Number?new W0.LongBits(Q.rejectedLogRecords.low>>>0,Q.rejectedLogRecords.high>>>0).toNumber():Q.rejectedLogRecords;if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage"))q.errorMessage=Q.errorMessage;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},X}(),F}(),H}(),W}(),Z.metrics=function(){var W={};return W.v1=function(){var H={};return H.MetricsData=function(){function F(X){if(this.resourceMetrics=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resourceMetrics=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resourceMetrics!=null&&J.resourceMetrics.length)for(var G=0;G<J.resourceMetrics.length;++G)X0.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(J.resourceMetrics[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.MetricsData;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.resourceMetrics&&K.resourceMetrics.length))K.resourceMetrics=[];K.resourceMetrics.push(X0.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resourceMetrics!=null&&J.hasOwnProperty("resourceMetrics")){if(!Array.isArray(J.resourceMetrics))return"resourceMetrics: array expected";for(var Q=0;Q<J.resourceMetrics.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(J.resourceMetrics[Q]);if(G)return"resourceMetrics."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.MetricsData)return J;var Q=new X0.opentelemetry.proto.metrics.v1.MetricsData;if(J.resourceMetrics){if(!Array.isArray(J.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");Q.resourceMetrics=[];for(var G=0;G<J.resourceMetrics.length;++G){if(typeof J.resourceMetrics[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");Q.resourceMetrics[G]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(J.resourceMetrics[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.resourceMetrics=[];if(J.resourceMetrics&&J.resourceMetrics.length){G.resourceMetrics=[];for(var q=0;q<J.resourceMetrics.length;++q)G.resourceMetrics[q]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(J.resourceMetrics[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.MetricsData"},F}(),H.ResourceMetrics=function(){function F(X){if(this.scopeMetrics=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resource=null,F.prototype.scopeMetrics=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resource!=null&&Object.hasOwnProperty.call(J,"resource"))X0.opentelemetry.proto.resource.v1.Resource.encode(J.resource,Q.uint32(10).fork()).ldelim();if(J.scopeMetrics!=null&&J.scopeMetrics.length)for(var G=0;G<J.scopeMetrics.length;++G)X0.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(J.scopeMetrics[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.ResourceMetrics;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.resource=X0.opentelemetry.proto.resource.v1.Resource.decode(J,J.uint32());break}case 2:{if(!(K.scopeMetrics&&K.scopeMetrics.length))K.scopeMetrics=[];K.scopeMetrics.push(X0.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resource!=null&&J.hasOwnProperty("resource")){var Q=X0.opentelemetry.proto.resource.v1.Resource.verify(J.resource);if(Q)return"resource."+Q}if(J.scopeMetrics!=null&&J.hasOwnProperty("scopeMetrics")){if(!Array.isArray(J.scopeMetrics))return"scopeMetrics: array expected";for(var G=0;G<J.scopeMetrics.length;++G){var Q=X0.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(J.scopeMetrics[G]);if(Q)return"scopeMetrics."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.ResourceMetrics)return J;var Q=new X0.opentelemetry.proto.metrics.v1.ResourceMetrics;if(J.resource!=null){if(typeof J.resource!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");Q.resource=X0.opentelemetry.proto.resource.v1.Resource.fromObject(J.resource)}if(J.scopeMetrics){if(!Array.isArray(J.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");Q.scopeMetrics=[];for(var G=0;G<J.scopeMetrics.length;++G){if(typeof J.scopeMetrics[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");Q.scopeMetrics[G]=X0.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(J.scopeMetrics[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.scopeMetrics=[];if(Q.defaults)G.resource=null,G.schemaUrl="";if(J.resource!=null&&J.hasOwnProperty("resource"))G.resource=X0.opentelemetry.proto.resource.v1.Resource.toObject(J.resource,Q);if(J.scopeMetrics&&J.scopeMetrics.length){G.scopeMetrics=[];for(var q=0;q<J.scopeMetrics.length;++q)G.scopeMetrics[q]=X0.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(J.scopeMetrics[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},F}(),H.ScopeMetrics=function(){function F(X){if(this.metrics=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.scope=null,F.prototype.metrics=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.scope!=null&&Object.hasOwnProperty.call(J,"scope"))X0.opentelemetry.proto.common.v1.InstrumentationScope.encode(J.scope,Q.uint32(10).fork()).ldelim();if(J.metrics!=null&&J.metrics.length)for(var G=0;G<J.metrics.length;++G)X0.opentelemetry.proto.metrics.v1.Metric.encode(J.metrics[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.ScopeMetrics;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.decode(J,J.uint32());break}case 2:{if(!(K.metrics&&K.metrics.length))K.metrics=[];K.metrics.push(X0.opentelemetry.proto.metrics.v1.Metric.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.scope!=null&&J.hasOwnProperty("scope")){var Q=X0.opentelemetry.proto.common.v1.InstrumentationScope.verify(J.scope);if(Q)return"scope."+Q}if(J.metrics!=null&&J.hasOwnProperty("metrics")){if(!Array.isArray(J.metrics))return"metrics: array expected";for(var G=0;G<J.metrics.length;++G){var Q=X0.opentelemetry.proto.metrics.v1.Metric.verify(J.metrics[G]);if(Q)return"metrics."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.ScopeMetrics)return J;var Q=new X0.opentelemetry.proto.metrics.v1.ScopeMetrics;if(J.scope!=null){if(typeof J.scope!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");Q.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(J.scope)}if(J.metrics){if(!Array.isArray(J.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");Q.metrics=[];for(var G=0;G<J.metrics.length;++G){if(typeof J.metrics[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");Q.metrics[G]=X0.opentelemetry.proto.metrics.v1.Metric.fromObject(J.metrics[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.metrics=[];if(Q.defaults)G.scope=null,G.schemaUrl="";if(J.scope!=null&&J.hasOwnProperty("scope"))G.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.toObject(J.scope,Q);if(J.metrics&&J.metrics.length){G.metrics=[];for(var q=0;q<J.metrics.length;++q)G.metrics[q]=X0.opentelemetry.proto.metrics.v1.Metric.toObject(J.metrics[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},F}(),H.Metric=function(){function F(J){if(this.metadata=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.name=null,F.prototype.description=null,F.prototype.unit=null,F.prototype.gauge=null,F.prototype.sum=null,F.prototype.histogram=null,F.prototype.exponentialHistogram=null,F.prototype.summary=null,F.prototype.metadata=W0.emptyArray;var X;return Object.defineProperty(F.prototype,"data",{get:W0.oneOfGetter(X=["gauge","sum","histogram","exponentialHistogram","summary"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.name!=null&&Object.hasOwnProperty.call(Q,"name"))G.uint32(10).string(Q.name);if(Q.description!=null&&Object.hasOwnProperty.call(Q,"description"))G.uint32(18).string(Q.description);if(Q.unit!=null&&Object.hasOwnProperty.call(Q,"unit"))G.uint32(26).string(Q.unit);if(Q.gauge!=null&&Object.hasOwnProperty.call(Q,"gauge"))X0.opentelemetry.proto.metrics.v1.Gauge.encode(Q.gauge,G.uint32(42).fork()).ldelim();if(Q.sum!=null&&Object.hasOwnProperty.call(Q,"sum"))X0.opentelemetry.proto.metrics.v1.Sum.encode(Q.sum,G.uint32(58).fork()).ldelim();if(Q.histogram!=null&&Object.hasOwnProperty.call(Q,"histogram"))X0.opentelemetry.proto.metrics.v1.Histogram.encode(Q.histogram,G.uint32(74).fork()).ldelim();if(Q.exponentialHistogram!=null&&Object.hasOwnProperty.call(Q,"exponentialHistogram"))X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(Q.exponentialHistogram,G.uint32(82).fork()).ldelim();if(Q.summary!=null&&Object.hasOwnProperty.call(Q,"summary"))X0.opentelemetry.proto.metrics.v1.Summary.encode(Q.summary,G.uint32(90).fork()).ldelim();if(Q.metadata!=null&&Q.metadata.length)for(var q=0;q<Q.metadata.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.metadata[q],G.uint32(98).fork()).ldelim();return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.Metric;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.name=Q.string();break}case 2:{V.description=Q.string();break}case 3:{V.unit=Q.string();break}case 5:{V.gauge=X0.opentelemetry.proto.metrics.v1.Gauge.decode(Q,Q.uint32());break}case 7:{V.sum=X0.opentelemetry.proto.metrics.v1.Sum.decode(Q,Q.uint32());break}case 9:{V.histogram=X0.opentelemetry.proto.metrics.v1.Histogram.decode(Q,Q.uint32());break}case 10:{V.exponentialHistogram=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(Q,Q.uint32());break}case 11:{V.summary=X0.opentelemetry.proto.metrics.v1.Summary.decode(Q,Q.uint32());break}case 12:{if(!(V.metadata&&V.metadata.length))V.metadata=[];V.metadata.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.name!=null&&Q.hasOwnProperty("name")){if(!W0.isString(Q.name))return"name: string expected"}if(Q.description!=null&&Q.hasOwnProperty("description")){if(!W0.isString(Q.description))return"description: string expected"}if(Q.unit!=null&&Q.hasOwnProperty("unit")){if(!W0.isString(Q.unit))return"unit: string expected"}if(Q.gauge!=null&&Q.hasOwnProperty("gauge")){G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Gauge.verify(Q.gauge);if(q)return"gauge."+q}}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Sum.verify(Q.sum);if(q)return"sum."+q}}if(Q.histogram!=null&&Q.hasOwnProperty("histogram")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Histogram.verify(Q.histogram);if(q)return"histogram."+q}}if(Q.exponentialHistogram!=null&&Q.hasOwnProperty("exponentialHistogram")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(Q.exponentialHistogram);if(q)return"exponentialHistogram."+q}}if(Q.summary!=null&&Q.hasOwnProperty("summary")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Summary.verify(Q.summary);if(q)return"summary."+q}}if(Q.metadata!=null&&Q.hasOwnProperty("metadata")){if(!Array.isArray(Q.metadata))return"metadata: array expected";for(var K=0;K<Q.metadata.length;++K){var q=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.metadata[K]);if(q)return"metadata."+q}}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.Metric)return Q;var G=new X0.opentelemetry.proto.metrics.v1.Metric;if(Q.name!=null)G.name=String(Q.name);if(Q.description!=null)G.description=String(Q.description);if(Q.unit!=null)G.unit=String(Q.unit);if(Q.gauge!=null){if(typeof Q.gauge!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");G.gauge=X0.opentelemetry.proto.metrics.v1.Gauge.fromObject(Q.gauge)}if(Q.sum!=null){if(typeof Q.sum!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");G.sum=X0.opentelemetry.proto.metrics.v1.Sum.fromObject(Q.sum)}if(Q.histogram!=null){if(typeof Q.histogram!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");G.histogram=X0.opentelemetry.proto.metrics.v1.Histogram.fromObject(Q.histogram)}if(Q.exponentialHistogram!=null){if(typeof Q.exponentialHistogram!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");G.exponentialHistogram=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(Q.exponentialHistogram)}if(Q.summary!=null){if(typeof Q.summary!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");G.summary=X0.opentelemetry.proto.metrics.v1.Summary.fromObject(Q.summary)}if(Q.metadata){if(!Array.isArray(Q.metadata))throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected");G.metadata=[];for(var q=0;q<Q.metadata.length;++q){if(typeof Q.metadata[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected");G.metadata[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.metadata[q])}}return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.metadata=[];if(G.defaults)q.name="",q.description="",q.unit="";if(Q.name!=null&&Q.hasOwnProperty("name"))q.name=Q.name;if(Q.description!=null&&Q.hasOwnProperty("description"))q.description=Q.description;if(Q.unit!=null&&Q.hasOwnProperty("unit"))q.unit=Q.unit;if(Q.gauge!=null&&Q.hasOwnProperty("gauge")){if(q.gauge=X0.opentelemetry.proto.metrics.v1.Gauge.toObject(Q.gauge,G),G.oneofs)q.data="gauge"}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(q.sum=X0.opentelemetry.proto.metrics.v1.Sum.toObject(Q.sum,G),G.oneofs)q.data="sum"}if(Q.histogram!=null&&Q.hasOwnProperty("histogram")){if(q.histogram=X0.opentelemetry.proto.metrics.v1.Histogram.toObject(Q.histogram,G),G.oneofs)q.data="histogram"}if(Q.exponentialHistogram!=null&&Q.hasOwnProperty("exponentialHistogram")){if(q.exponentialHistogram=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(Q.exponentialHistogram,G),G.oneofs)q.data="exponentialHistogram"}if(Q.summary!=null&&Q.hasOwnProperty("summary")){if(q.summary=X0.opentelemetry.proto.metrics.v1.Summary.toObject(Q.summary,G),G.oneofs)q.data="summary"}if(Q.metadata&&Q.metadata.length){q.metadata=[];for(var K=0;K<Q.metadata.length;++K)q.metadata[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.metadata[K],G)}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.Metric"},F}(),H.Gauge=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Gauge;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Gauge)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Gauge;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(J.dataPoints[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(J.dataPoints[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Gauge"},F}(),H.Sum=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.prototype.aggregationTemporality=null,F.prototype.isMonotonic=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();if(J.aggregationTemporality!=null&&Object.hasOwnProperty.call(J,"aggregationTemporality"))Q.uint32(16).int32(J.aggregationTemporality);if(J.isMonotonic!=null&&Object.hasOwnProperty.call(J,"isMonotonic"))Q.uint32(24).bool(J.isMonotonic);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Sum;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(J,J.uint32()));break}case 2:{K.aggregationTemporality=J.int32();break}case 3:{K.isMonotonic=J.bool();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))switch(J.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}if(J.isMonotonic!=null&&J.hasOwnProperty("isMonotonic")){if(typeof J.isMonotonic!=="boolean")return"isMonotonic: boolean expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Sum)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Sum;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(J.dataPoints[G])}}switch(J.aggregationTemporality){default:if(typeof J.aggregationTemporality==="number"){Q.aggregationTemporality=J.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:Q.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:Q.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:Q.aggregationTemporality=2;break}if(J.isMonotonic!=null)Q.isMonotonic=Boolean(J.isMonotonic);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(Q.defaults)G.aggregationTemporality=Q.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,G.isMonotonic=!1;if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(J.dataPoints[q],Q)}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))G.aggregationTemporality=Q.enums===String?X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]===void 0?J.aggregationTemporality:X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]:J.aggregationTemporality;if(J.isMonotonic!=null&&J.hasOwnProperty("isMonotonic"))G.isMonotonic=J.isMonotonic;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Sum"},F}(),H.Histogram=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.prototype.aggregationTemporality=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();if(J.aggregationTemporality!=null&&Object.hasOwnProperty.call(J,"aggregationTemporality"))Q.uint32(16).int32(J.aggregationTemporality);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Histogram;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(J,J.uint32()));break}case 2:{K.aggregationTemporality=J.int32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))switch(J.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Histogram)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Histogram;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(J.dataPoints[G])}}switch(J.aggregationTemporality){default:if(typeof J.aggregationTemporality==="number"){Q.aggregationTemporality=J.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:Q.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:Q.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:Q.aggregationTemporality=2;break}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(Q.defaults)G.aggregationTemporality=Q.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0;if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(J.dataPoints[q],Q)}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))G.aggregationTemporality=Q.enums===String?X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]===void 0?J.aggregationTemporality:X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]:J.aggregationTemporality;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Histogram"},F}(),H.ExponentialHistogram=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.prototype.aggregationTemporality=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();if(J.aggregationTemporality!=null&&Object.hasOwnProperty.call(J,"aggregationTemporality"))Q.uint32(16).int32(J.aggregationTemporality);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogram;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(J,J.uint32()));break}case 2:{K.aggregationTemporality=J.int32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))switch(J.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.ExponentialHistogram)return J;var Q=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(J.dataPoints[G])}}switch(J.aggregationTemporality){default:if(typeof J.aggregationTemporality==="number"){Q.aggregationTemporality=J.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:Q.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:Q.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:Q.aggregationTemporality=2;break}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(Q.defaults)G.aggregationTemporality=Q.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0;if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(J.dataPoints[q],Q)}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))G.aggregationTemporality=Q.enums===String?X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]===void 0?J.aggregationTemporality:X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]:J.aggregationTemporality;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},F}(),H.Summary=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Summary;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Summary)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Summary;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(J.dataPoints[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(J.dataPoints[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Summary"},F}(),H.AggregationTemporality=function(){var F={},X=Object.create(F);return X[F[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,X[F[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,X[F[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,X}(),H.DataPointFlags=function(){var F={},X=Object.create(F);return X[F[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,X[F[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,X}(),H.NumberDataPoint=function(){function F(J){if(this.attributes=[],this.exemplars=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.asDouble=null,F.prototype.asInt=null,F.prototype.exemplars=W0.emptyArray,F.prototype.flags=null;var X;return Object.defineProperty(F.prototype,"value",{get:W0.oneOfGetter(X=["asDouble","asInt"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.startTimeUnixNano!=null&&Object.hasOwnProperty.call(Q,"startTimeUnixNano"))G.uint32(17).fixed64(Q.startTimeUnixNano);if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(25).fixed64(Q.timeUnixNano);if(Q.asDouble!=null&&Object.hasOwnProperty.call(Q,"asDouble"))G.uint32(33).double(Q.asDouble);if(Q.exemplars!=null&&Q.exemplars.length)for(var q=0;q<Q.exemplars.length;++q)X0.opentelemetry.proto.metrics.v1.Exemplar.encode(Q.exemplars[q],G.uint32(42).fork()).ldelim();if(Q.asInt!=null&&Object.hasOwnProperty.call(Q,"asInt"))G.uint32(49).sfixed64(Q.asInt);if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(58).fork()).ldelim();if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(64).uint32(Q.flags);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.NumberDataPoint;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 7:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.startTimeUnixNano=Q.fixed64();break}case 3:{V.timeUnixNano=Q.fixed64();break}case 4:{V.asDouble=Q.double();break}case 6:{V.asInt=Q.sfixed64();break}case 5:{if(!(V.exemplars&&V.exemplars.length))V.exemplars=[];V.exemplars.push(X0.opentelemetry.proto.metrics.v1.Exemplar.decode(Q,Q.uint32()));break}case 8:{V.flags=Q.uint32();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var q=0;q<Q.attributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[q]);if(K)return"attributes."+K}}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(Q.startTimeUnixNano)&&!(Q.startTimeUnixNano&&W0.isInteger(Q.startTimeUnixNano.low)&&W0.isInteger(Q.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(G.value=1,typeof Q.asDouble!=="number")return"asDouble: number expected"}if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(G.value===1)return"value: multiple values";if(G.value=1,!W0.isInteger(Q.asInt)&&!(Q.asInt&&W0.isInteger(Q.asInt.low)&&W0.isInteger(Q.asInt.high)))return"asInt: integer|Long expected"}if(Q.exemplars!=null&&Q.hasOwnProperty("exemplars")){if(!Array.isArray(Q.exemplars))return"exemplars: array expected";for(var q=0;q<Q.exemplars.length;++q){var K=X0.opentelemetry.proto.metrics.v1.Exemplar.verify(Q.exemplars[q]);if(K)return"exemplars."+K}}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.NumberDataPoint)return Q;var G=new X0.opentelemetry.proto.metrics.v1.NumberDataPoint;if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.startTimeUnixNano!=null){if(W0.Long)(G.startTimeUnixNano=W0.Long.fromValue(Q.startTimeUnixNano)).unsigned=!1;else if(typeof Q.startTimeUnixNano==="string")G.startTimeUnixNano=parseInt(Q.startTimeUnixNano,10);else if(typeof Q.startTimeUnixNano==="number")G.startTimeUnixNano=Q.startTimeUnixNano;else if(typeof Q.startTimeUnixNano==="object")G.startTimeUnixNano=new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber()}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.asDouble!=null)G.asDouble=Number(Q.asDouble);if(Q.asInt!=null){if(W0.Long)(G.asInt=W0.Long.fromValue(Q.asInt)).unsigned=!1;else if(typeof Q.asInt==="string")G.asInt=parseInt(Q.asInt,10);else if(typeof Q.asInt==="number")G.asInt=Q.asInt;else if(typeof Q.asInt==="object")G.asInt=new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber()}if(Q.exemplars){if(!Array.isArray(Q.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");G.exemplars=[];for(var q=0;q<Q.exemplars.length;++q){if(typeof Q.exemplars[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");G.exemplars[q]=X0.opentelemetry.proto.metrics.v1.Exemplar.fromObject(Q.exemplars[q])}}if(Q.flags!=null)G.flags=Q.flags>>>0;return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.exemplars=[],q.attributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.startTimeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.startTimeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;q.flags=0}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano"))if(typeof Q.startTimeUnixNano==="number")q.startTimeUnixNano=G.longs===String?String(Q.startTimeUnixNano):Q.startTimeUnixNano;else q.startTimeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.startTimeUnixNano):G.longs===Number?new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber():Q.startTimeUnixNano;if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(q.asDouble=G.json&&!isFinite(Q.asDouble)?String(Q.asDouble):Q.asDouble,G.oneofs)q.value="asDouble"}if(Q.exemplars&&Q.exemplars.length){q.exemplars=[];for(var V=0;V<Q.exemplars.length;++V)q.exemplars[V]=X0.opentelemetry.proto.metrics.v1.Exemplar.toObject(Q.exemplars[V],G)}if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(typeof Q.asInt==="number")q.asInt=G.longs===String?String(Q.asInt):Q.asInt;else q.asInt=G.longs===String?W0.Long.prototype.toString.call(Q.asInt):G.longs===Number?new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber():Q.asInt;if(G.oneofs)q.value="asInt"}if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},F}(),H.HistogramDataPoint=function(){function F(J){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.count=null,F.prototype.sum=null,F.prototype.bucketCounts=W0.emptyArray,F.prototype.explicitBounds=W0.emptyArray,F.prototype.exemplars=W0.emptyArray,F.prototype.flags=null,F.prototype.min=null,F.prototype.max=null;var X;return Object.defineProperty(F.prototype,"_sum",{get:W0.oneOfGetter(X=["sum"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_min",{get:W0.oneOfGetter(X=["min"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_max",{get:W0.oneOfGetter(X=["max"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.startTimeUnixNano!=null&&Object.hasOwnProperty.call(Q,"startTimeUnixNano"))G.uint32(17).fixed64(Q.startTimeUnixNano);if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(25).fixed64(Q.timeUnixNano);if(Q.count!=null&&Object.hasOwnProperty.call(Q,"count"))G.uint32(33).fixed64(Q.count);if(Q.sum!=null&&Object.hasOwnProperty.call(Q,"sum"))G.uint32(41).double(Q.sum);if(Q.bucketCounts!=null&&Q.bucketCounts.length){G.uint32(50).fork();for(var q=0;q<Q.bucketCounts.length;++q)G.fixed64(Q.bucketCounts[q]);G.ldelim()}if(Q.explicitBounds!=null&&Q.explicitBounds.length){G.uint32(58).fork();for(var q=0;q<Q.explicitBounds.length;++q)G.double(Q.explicitBounds[q]);G.ldelim()}if(Q.exemplars!=null&&Q.exemplars.length)for(var q=0;q<Q.exemplars.length;++q)X0.opentelemetry.proto.metrics.v1.Exemplar.encode(Q.exemplars[q],G.uint32(66).fork()).ldelim();if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(74).fork()).ldelim();if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(80).uint32(Q.flags);if(Q.min!=null&&Object.hasOwnProperty.call(Q,"min"))G.uint32(89).double(Q.min);if(Q.max!=null&&Object.hasOwnProperty.call(Q,"max"))G.uint32(97).double(Q.max);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.HistogramDataPoint;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 9:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.startTimeUnixNano=Q.fixed64();break}case 3:{V.timeUnixNano=Q.fixed64();break}case 4:{V.count=Q.fixed64();break}case 5:{V.sum=Q.double();break}case 6:{if(!(V.bucketCounts&&V.bucketCounts.length))V.bucketCounts=[];if((B&7)===2){var I=Q.uint32()+Q.pos;while(Q.pos<I)V.bucketCounts.push(Q.fixed64())}else V.bucketCounts.push(Q.fixed64());break}case 7:{if(!(V.explicitBounds&&V.explicitBounds.length))V.explicitBounds=[];if((B&7)===2){var I=Q.uint32()+Q.pos;while(Q.pos<I)V.explicitBounds.push(Q.double())}else V.explicitBounds.push(Q.double());break}case 8:{if(!(V.exemplars&&V.exemplars.length))V.exemplars=[];V.exemplars.push(X0.opentelemetry.proto.metrics.v1.Exemplar.decode(Q,Q.uint32()));break}case 10:{V.flags=Q.uint32();break}case 11:{V.min=Q.double();break}case 12:{V.max=Q.double();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var q=0;q<Q.attributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[q]);if(K)return"attributes."+K}}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(Q.startTimeUnixNano)&&!(Q.startTimeUnixNano&&W0.isInteger(Q.startTimeUnixNano.low)&&W0.isInteger(Q.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.count!=null&&Q.hasOwnProperty("count")){if(!W0.isInteger(Q.count)&&!(Q.count&&W0.isInteger(Q.count.low)&&W0.isInteger(Q.count.high)))return"count: integer|Long expected"}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(G._sum=1,typeof Q.sum!=="number")return"sum: number expected"}if(Q.bucketCounts!=null&&Q.hasOwnProperty("bucketCounts")){if(!Array.isArray(Q.bucketCounts))return"bucketCounts: array expected";for(var q=0;q<Q.bucketCounts.length;++q)if(!W0.isInteger(Q.bucketCounts[q])&&!(Q.bucketCounts[q]&&W0.isInteger(Q.bucketCounts[q].low)&&W0.isInteger(Q.bucketCounts[q].high)))return"bucketCounts: integer|Long[] expected"}if(Q.explicitBounds!=null&&Q.hasOwnProperty("explicitBounds")){if(!Array.isArray(Q.explicitBounds))return"explicitBounds: array expected";for(var q=0;q<Q.explicitBounds.length;++q)if(typeof Q.explicitBounds[q]!=="number")return"explicitBounds: number[] expected"}if(Q.exemplars!=null&&Q.hasOwnProperty("exemplars")){if(!Array.isArray(Q.exemplars))return"exemplars: array expected";for(var q=0;q<Q.exemplars.length;++q){var K=X0.opentelemetry.proto.metrics.v1.Exemplar.verify(Q.exemplars[q]);if(K)return"exemplars."+K}}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}if(Q.min!=null&&Q.hasOwnProperty("min")){if(G._min=1,typeof Q.min!=="number")return"min: number expected"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(G._max=1,typeof Q.max!=="number")return"max: number expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.HistogramDataPoint)return Q;var G=new X0.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.startTimeUnixNano!=null){if(W0.Long)(G.startTimeUnixNano=W0.Long.fromValue(Q.startTimeUnixNano)).unsigned=!1;else if(typeof Q.startTimeUnixNano==="string")G.startTimeUnixNano=parseInt(Q.startTimeUnixNano,10);else if(typeof Q.startTimeUnixNano==="number")G.startTimeUnixNano=Q.startTimeUnixNano;else if(typeof Q.startTimeUnixNano==="object")G.startTimeUnixNano=new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber()}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.count!=null){if(W0.Long)(G.count=W0.Long.fromValue(Q.count)).unsigned=!1;else if(typeof Q.count==="string")G.count=parseInt(Q.count,10);else if(typeof Q.count==="number")G.count=Q.count;else if(typeof Q.count==="object")G.count=new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber()}if(Q.sum!=null)G.sum=Number(Q.sum);if(Q.bucketCounts){if(!Array.isArray(Q.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");G.bucketCounts=[];for(var q=0;q<Q.bucketCounts.length;++q)if(W0.Long)(G.bucketCounts[q]=W0.Long.fromValue(Q.bucketCounts[q])).unsigned=!1;else if(typeof Q.bucketCounts[q]==="string")G.bucketCounts[q]=parseInt(Q.bucketCounts[q],10);else if(typeof Q.bucketCounts[q]==="number")G.bucketCounts[q]=Q.bucketCounts[q];else if(typeof Q.bucketCounts[q]==="object")G.bucketCounts[q]=new W0.LongBits(Q.bucketCounts[q].low>>>0,Q.bucketCounts[q].high>>>0).toNumber()}if(Q.explicitBounds){if(!Array.isArray(Q.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");G.explicitBounds=[];for(var q=0;q<Q.explicitBounds.length;++q)G.explicitBounds[q]=Number(Q.explicitBounds[q])}if(Q.exemplars){if(!Array.isArray(Q.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");G.exemplars=[];for(var q=0;q<Q.exemplars.length;++q){if(typeof Q.exemplars[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");G.exemplars[q]=X0.opentelemetry.proto.metrics.v1.Exemplar.fromObject(Q.exemplars[q])}}if(Q.flags!=null)G.flags=Q.flags>>>0;if(Q.min!=null)G.min=Number(Q.min);if(Q.max!=null)G.max=Number(Q.max);return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.bucketCounts=[],q.explicitBounds=[],q.exemplars=[],q.attributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.startTimeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.startTimeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.count=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.count=G.longs===String?"0":0;q.flags=0}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano"))if(typeof Q.startTimeUnixNano==="number")q.startTimeUnixNano=G.longs===String?String(Q.startTimeUnixNano):Q.startTimeUnixNano;else q.startTimeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.startTimeUnixNano):G.longs===Number?new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber():Q.startTimeUnixNano;if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.count!=null&&Q.hasOwnProperty("count"))if(typeof Q.count==="number")q.count=G.longs===String?String(Q.count):Q.count;else q.count=G.longs===String?W0.Long.prototype.toString.call(Q.count):G.longs===Number?new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber():Q.count;if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(q.sum=G.json&&!isFinite(Q.sum)?String(Q.sum):Q.sum,G.oneofs)q._sum="sum"}if(Q.bucketCounts&&Q.bucketCounts.length){q.bucketCounts=[];for(var V=0;V<Q.bucketCounts.length;++V)if(typeof Q.bucketCounts[V]==="number")q.bucketCounts[V]=G.longs===String?String(Q.bucketCounts[V]):Q.bucketCounts[V];else q.bucketCounts[V]=G.longs===String?W0.Long.prototype.toString.call(Q.bucketCounts[V]):G.longs===Number?new W0.LongBits(Q.bucketCounts[V].low>>>0,Q.bucketCounts[V].high>>>0).toNumber():Q.bucketCounts[V]}if(Q.explicitBounds&&Q.explicitBounds.length){q.explicitBounds=[];for(var V=0;V<Q.explicitBounds.length;++V)q.explicitBounds[V]=G.json&&!isFinite(Q.explicitBounds[V])?String(Q.explicitBounds[V]):Q.explicitBounds[V]}if(Q.exemplars&&Q.exemplars.length){q.exemplars=[];for(var V=0;V<Q.exemplars.length;++V)q.exemplars[V]=X0.opentelemetry.proto.metrics.v1.Exemplar.toObject(Q.exemplars[V],G)}if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;if(Q.min!=null&&Q.hasOwnProperty("min")){if(q.min=G.json&&!isFinite(Q.min)?String(Q.min):Q.min,G.oneofs)q._min="min"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(q.max=G.json&&!isFinite(Q.max)?String(Q.max):Q.max,G.oneofs)q._max="max"}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},F}(),H.ExponentialHistogramDataPoint=function(){function F(J){if(this.attributes=[],this.exemplars=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.count=null,F.prototype.sum=null,F.prototype.scale=null,F.prototype.zeroCount=null,F.prototype.positive=null,F.prototype.negative=null,F.prototype.flags=null,F.prototype.exemplars=W0.emptyArray,F.prototype.min=null,F.prototype.max=null,F.prototype.zeroThreshold=null;var X;return Object.defineProperty(F.prototype,"_sum",{get:W0.oneOfGetter(X=["sum"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_min",{get:W0.oneOfGetter(X=["min"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_max",{get:W0.oneOfGetter(X=["max"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(10).fork()).ldelim();if(Q.startTimeUnixNano!=null&&Object.hasOwnProperty.call(Q,"startTimeUnixNano"))G.uint32(17).fixed64(Q.startTimeUnixNano);if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(25).fixed64(Q.timeUnixNano);if(Q.count!=null&&Object.hasOwnProperty.call(Q,"count"))G.uint32(33).fixed64(Q.count);if(Q.sum!=null&&Object.hasOwnProperty.call(Q,"sum"))G.uint32(41).double(Q.sum);if(Q.scale!=null&&Object.hasOwnProperty.call(Q,"scale"))G.uint32(48).sint32(Q.scale);if(Q.zeroCount!=null&&Object.hasOwnProperty.call(Q,"zeroCount"))G.uint32(57).fixed64(Q.zeroCount);if(Q.positive!=null&&Object.hasOwnProperty.call(Q,"positive"))X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(Q.positive,G.uint32(66).fork()).ldelim();if(Q.negative!=null&&Object.hasOwnProperty.call(Q,"negative"))X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(Q.negative,G.uint32(74).fork()).ldelim();if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(80).uint32(Q.flags);if(Q.exemplars!=null&&Q.exemplars.length)for(var q=0;q<Q.exemplars.length;++q)X0.opentelemetry.proto.metrics.v1.Exemplar.encode(Q.exemplars[q],G.uint32(90).fork()).ldelim();if(Q.min!=null&&Object.hasOwnProperty.call(Q,"min"))G.uint32(97).double(Q.min);if(Q.max!=null&&Object.hasOwnProperty.call(Q,"max"))G.uint32(105).double(Q.max);if(Q.zeroThreshold!=null&&Object.hasOwnProperty.call(Q,"zeroThreshold"))G.uint32(113).double(Q.zeroThreshold);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.startTimeUnixNano=Q.fixed64();break}case 3:{V.timeUnixNano=Q.fixed64();break}case 4:{V.count=Q.fixed64();break}case 5:{V.sum=Q.double();break}case 6:{V.scale=Q.sint32();break}case 7:{V.zeroCount=Q.fixed64();break}case 8:{V.positive=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(Q,Q.uint32());break}case 9:{V.negative=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(Q,Q.uint32());break}case 10:{V.flags=Q.uint32();break}case 11:{if(!(V.exemplars&&V.exemplars.length))V.exemplars=[];V.exemplars.push(X0.opentelemetry.proto.metrics.v1.Exemplar.decode(Q,Q.uint32()));break}case 12:{V.min=Q.double();break}case 13:{V.max=Q.double();break}case 14:{V.zeroThreshold=Q.double();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var q=0;q<Q.attributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[q]);if(K)return"attributes."+K}}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(Q.startTimeUnixNano)&&!(Q.startTimeUnixNano&&W0.isInteger(Q.startTimeUnixNano.low)&&W0.isInteger(Q.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.count!=null&&Q.hasOwnProperty("count")){if(!W0.isInteger(Q.count)&&!(Q.count&&W0.isInteger(Q.count.low)&&W0.isInteger(Q.count.high)))return"count: integer|Long expected"}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(G._sum=1,typeof Q.sum!=="number")return"sum: number expected"}if(Q.scale!=null&&Q.hasOwnProperty("scale")){if(!W0.isInteger(Q.scale))return"scale: integer expected"}if(Q.zeroCount!=null&&Q.hasOwnProperty("zeroCount")){if(!W0.isInteger(Q.zeroCount)&&!(Q.zeroCount&&W0.isInteger(Q.zeroCount.low)&&W0.isInteger(Q.zeroCount.high)))return"zeroCount: integer|Long expected"}if(Q.positive!=null&&Q.hasOwnProperty("positive")){var K=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(Q.positive);if(K)return"positive."+K}if(Q.negative!=null&&Q.hasOwnProperty("negative")){var K=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(Q.negative);if(K)return"negative."+K}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}if(Q.exemplars!=null&&Q.hasOwnProperty("exemplars")){if(!Array.isArray(Q.exemplars))return"exemplars: array expected";for(var q=0;q<Q.exemplars.length;++q){var K=X0.opentelemetry.proto.metrics.v1.Exemplar.verify(Q.exemplars[q]);if(K)return"exemplars."+K}}if(Q.min!=null&&Q.hasOwnProperty("min")){if(G._min=1,typeof Q.min!=="number")return"min: number expected"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(G._max=1,typeof Q.max!=="number")return"max: number expected"}if(Q.zeroThreshold!=null&&Q.hasOwnProperty("zeroThreshold")){if(typeof Q.zeroThreshold!=="number")return"zeroThreshold: number expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return Q;var G=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.startTimeUnixNano!=null){if(W0.Long)(G.startTimeUnixNano=W0.Long.fromValue(Q.startTimeUnixNano)).unsigned=!1;else if(typeof Q.startTimeUnixNano==="string")G.startTimeUnixNano=parseInt(Q.startTimeUnixNano,10);else if(typeof Q.startTimeUnixNano==="number")G.startTimeUnixNano=Q.startTimeUnixNano;else if(typeof Q.startTimeUnixNano==="object")G.startTimeUnixNano=new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber()}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.count!=null){if(W0.Long)(G.count=W0.Long.fromValue(Q.count)).unsigned=!1;else if(typeof Q.count==="string")G.count=parseInt(Q.count,10);else if(typeof Q.count==="number")G.count=Q.count;else if(typeof Q.count==="object")G.count=new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber()}if(Q.sum!=null)G.sum=Number(Q.sum);if(Q.scale!=null)G.scale=Q.scale|0;if(Q.zeroCount!=null){if(W0.Long)(G.zeroCount=W0.Long.fromValue(Q.zeroCount)).unsigned=!1;else if(typeof Q.zeroCount==="string")G.zeroCount=parseInt(Q.zeroCount,10);else if(typeof Q.zeroCount==="number")G.zeroCount=Q.zeroCount;else if(typeof Q.zeroCount==="object")G.zeroCount=new W0.LongBits(Q.zeroCount.low>>>0,Q.zeroCount.high>>>0).toNumber()}if(Q.positive!=null){if(typeof Q.positive!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");G.positive=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(Q.positive)}if(Q.negative!=null){if(typeof Q.negative!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");G.negative=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(Q.negative)}if(Q.flags!=null)G.flags=Q.flags>>>0;if(Q.exemplars){if(!Array.isArray(Q.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");G.exemplars=[];for(var q=0;q<Q.exemplars.length;++q){if(typeof Q.exemplars[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");G.exemplars[q]=X0.opentelemetry.proto.metrics.v1.Exemplar.fromObject(Q.exemplars[q])}}if(Q.min!=null)G.min=Number(Q.min);if(Q.max!=null)G.max=Number(Q.max);if(Q.zeroThreshold!=null)G.zeroThreshold=Number(Q.zeroThreshold);return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.attributes=[],q.exemplars=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.startTimeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.startTimeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.count=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.count=G.longs===String?"0":0;if(q.scale=0,W0.Long){var K=new W0.Long(0,0,!1);q.zeroCount=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.zeroCount=G.longs===String?"0":0;q.positive=null,q.negative=null,q.flags=0,q.zeroThreshold=0}if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano"))if(typeof Q.startTimeUnixNano==="number")q.startTimeUnixNano=G.longs===String?String(Q.startTimeUnixNano):Q.startTimeUnixNano;else q.startTimeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.startTimeUnixNano):G.longs===Number?new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber():Q.startTimeUnixNano;if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.count!=null&&Q.hasOwnProperty("count"))if(typeof Q.count==="number")q.count=G.longs===String?String(Q.count):Q.count;else q.count=G.longs===String?W0.Long.prototype.toString.call(Q.count):G.longs===Number?new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber():Q.count;if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(q.sum=G.json&&!isFinite(Q.sum)?String(Q.sum):Q.sum,G.oneofs)q._sum="sum"}if(Q.scale!=null&&Q.hasOwnProperty("scale"))q.scale=Q.scale;if(Q.zeroCount!=null&&Q.hasOwnProperty("zeroCount"))if(typeof Q.zeroCount==="number")q.zeroCount=G.longs===String?String(Q.zeroCount):Q.zeroCount;else q.zeroCount=G.longs===String?W0.Long.prototype.toString.call(Q.zeroCount):G.longs===Number?new W0.LongBits(Q.zeroCount.low>>>0,Q.zeroCount.high>>>0).toNumber():Q.zeroCount;if(Q.positive!=null&&Q.hasOwnProperty("positive"))q.positive=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(Q.positive,G);if(Q.negative!=null&&Q.hasOwnProperty("negative"))q.negative=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(Q.negative,G);if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;if(Q.exemplars&&Q.exemplars.length){q.exemplars=[];for(var V=0;V<Q.exemplars.length;++V)q.exemplars[V]=X0.opentelemetry.proto.metrics.v1.Exemplar.toObject(Q.exemplars[V],G)}if(Q.min!=null&&Q.hasOwnProperty("min")){if(q.min=G.json&&!isFinite(Q.min)?String(Q.min):Q.min,G.oneofs)q._min="min"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(q.max=G.json&&!isFinite(Q.max)?String(Q.max):Q.max,G.oneofs)q._max="max"}if(Q.zeroThreshold!=null&&Q.hasOwnProperty("zeroThreshold"))q.zeroThreshold=G.json&&!isFinite(Q.zeroThreshold)?String(Q.zeroThreshold):Q.zeroThreshold;return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},F.Buckets=function(){function J(Q){if(this.bucketCounts=[],Q){for(var G=Object.keys(Q),q=0;q<G.length;++q)if(Q[G[q]]!=null)this[G[q]]=Q[G[q]]}}return J.prototype.offset=null,J.prototype.bucketCounts=W0.emptyArray,J.create=function(G){return new J(G)},J.encode=function(G,q){if(!q)q=u1.create();if(G.offset!=null&&Object.hasOwnProperty.call(G,"offset"))q.uint32(8).sint32(G.offset);if(G.bucketCounts!=null&&G.bucketCounts.length){q.uint32(18).fork();for(var K=0;K<G.bucketCounts.length;++K)q.uint64(G.bucketCounts[K]);q.ldelim()}return q},J.encodeDelimited=function(G,q){return this.encode(G,q).ldelim()},J.decode=function(G,q,K){if(!(G instanceof x0))G=x0.create(G);var V=q===void 0?G.len:G.pos+q,B=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;while(G.pos<V){var I=G.uint32();if(I===K)break;switch(I>>>3){case 1:{B.offset=G.sint32();break}case 2:{if(!(B.bucketCounts&&B.bucketCounts.length))B.bucketCounts=[];if((I&7)===2){var M=G.uint32()+G.pos;while(G.pos<M)B.bucketCounts.push(G.uint64())}else B.bucketCounts.push(G.uint64());break}default:G.skipType(I&7);break}}return B},J.decodeDelimited=function(G){if(!(G instanceof x0))G=new x0(G);return this.decode(G,G.uint32())},J.verify=function(G){if(typeof G!=="object"||G===null)return"object expected";if(G.offset!=null&&G.hasOwnProperty("offset")){if(!W0.isInteger(G.offset))return"offset: integer expected"}if(G.bucketCounts!=null&&G.hasOwnProperty("bucketCounts")){if(!Array.isArray(G.bucketCounts))return"bucketCounts: array expected";for(var q=0;q<G.bucketCounts.length;++q)if(!W0.isInteger(G.bucketCounts[q])&&!(G.bucketCounts[q]&&W0.isInteger(G.bucketCounts[q].low)&&W0.isInteger(G.bucketCounts[q].high)))return"bucketCounts: integer|Long[] expected"}return null},J.fromObject=function(G){if(G instanceof X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return G;var q=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(G.offset!=null)q.offset=G.offset|0;if(G.bucketCounts){if(!Array.isArray(G.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");q.bucketCounts=[];for(var K=0;K<G.bucketCounts.length;++K)if(W0.Long)(q.bucketCounts[K]=W0.Long.fromValue(G.bucketCounts[K])).unsigned=!0;else if(typeof G.bucketCounts[K]==="string")q.bucketCounts[K]=parseInt(G.bucketCounts[K],10);else if(typeof G.bucketCounts[K]==="number")q.bucketCounts[K]=G.bucketCounts[K];else if(typeof G.bucketCounts[K]==="object")q.bucketCounts[K]=new W0.LongBits(G.bucketCounts[K].low>>>0,G.bucketCounts[K].high>>>0).toNumber(!0)}return q},J.toObject=function(G,q){if(!q)q={};var K={};if(q.arrays||q.defaults)K.bucketCounts=[];if(q.defaults)K.offset=0;if(G.offset!=null&&G.hasOwnProperty("offset"))K.offset=G.offset;if(G.bucketCounts&&G.bucketCounts.length){K.bucketCounts=[];for(var V=0;V<G.bucketCounts.length;++V)if(typeof G.bucketCounts[V]==="number")K.bucketCounts[V]=q.longs===String?String(G.bucketCounts[V]):G.bucketCounts[V];else K.bucketCounts[V]=q.longs===String?W0.Long.prototype.toString.call(G.bucketCounts[V]):q.longs===Number?new W0.LongBits(G.bucketCounts[V].low>>>0,G.bucketCounts[V].high>>>0).toNumber(!0):G.bucketCounts[V]}return K},J.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},J.getTypeUrl=function(G){if(G===void 0)G="type.googleapis.com";return G+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},J}(),F}(),H.SummaryDataPoint=function(){function F(X){if(this.attributes=[],this.quantileValues=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.count=null,F.prototype.sum=null,F.prototype.quantileValues=W0.emptyArray,F.prototype.flags=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.startTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"startTimeUnixNano"))Q.uint32(17).fixed64(J.startTimeUnixNano);if(J.timeUnixNano!=null&&Object.hasOwnProperty.call(J,"timeUnixNano"))Q.uint32(25).fixed64(J.timeUnixNano);if(J.count!=null&&Object.hasOwnProperty.call(J,"count"))Q.uint32(33).fixed64(J.count);if(J.sum!=null&&Object.hasOwnProperty.call(J,"sum"))Q.uint32(41).double(J.sum);if(J.quantileValues!=null&&J.quantileValues.length)for(var G=0;G<J.quantileValues.length;++G)X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(J.quantileValues[G],Q.uint32(50).fork()).ldelim();if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(58).fork()).ldelim();if(J.flags!=null&&Object.hasOwnProperty.call(J,"flags"))Q.uint32(64).uint32(J.flags);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 7:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 2:{K.startTimeUnixNano=J.fixed64();break}case 3:{K.timeUnixNano=J.fixed64();break}case 4:{K.count=J.fixed64();break}case 5:{K.sum=J.double();break}case 6:{if(!(K.quantileValues&&K.quantileValues.length))K.quantileValues=[];K.quantileValues.push(X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(J,J.uint32()));break}case 8:{K.flags=J.uint32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(J.startTimeUnixNano)&&!(J.startTimeUnixNano&&W0.isInteger(J.startTimeUnixNano.low)&&W0.isInteger(J.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(J.timeUnixNano)&&!(J.timeUnixNano&&W0.isInteger(J.timeUnixNano.low)&&W0.isInteger(J.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(J.count!=null&&J.hasOwnProperty("count")){if(!W0.isInteger(J.count)&&!(J.count&&W0.isInteger(J.count.low)&&W0.isInteger(J.count.high)))return"count: integer|Long expected"}if(J.sum!=null&&J.hasOwnProperty("sum")){if(typeof J.sum!=="number")return"sum: number expected"}if(J.quantileValues!=null&&J.hasOwnProperty("quantileValues")){if(!Array.isArray(J.quantileValues))return"quantileValues: array expected";for(var Q=0;Q<J.quantileValues.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(J.quantileValues[Q]);if(G)return"quantileValues."+G}}if(J.flags!=null&&J.hasOwnProperty("flags")){if(!W0.isInteger(J.flags))return"flags: integer expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.SummaryDataPoint)return J;var Q=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.startTimeUnixNano!=null){if(W0.Long)(Q.startTimeUnixNano=W0.Long.fromValue(J.startTimeUnixNano)).unsigned=!1;else if(typeof J.startTimeUnixNano==="string")Q.startTimeUnixNano=parseInt(J.startTimeUnixNano,10);else if(typeof J.startTimeUnixNano==="number")Q.startTimeUnixNano=J.startTimeUnixNano;else if(typeof J.startTimeUnixNano==="object")Q.startTimeUnixNano=new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber()}if(J.timeUnixNano!=null){if(W0.Long)(Q.timeUnixNano=W0.Long.fromValue(J.timeUnixNano)).unsigned=!1;else if(typeof J.timeUnixNano==="string")Q.timeUnixNano=parseInt(J.timeUnixNano,10);else if(typeof J.timeUnixNano==="number")Q.timeUnixNano=J.timeUnixNano;else if(typeof J.timeUnixNano==="object")Q.timeUnixNano=new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber()}if(J.count!=null){if(W0.Long)(Q.count=W0.Long.fromValue(J.count)).unsigned=!1;else if(typeof J.count==="string")Q.count=parseInt(J.count,10);else if(typeof J.count==="number")Q.count=J.count;else if(typeof J.count==="object")Q.count=new W0.LongBits(J.count.low>>>0,J.count.high>>>0).toNumber()}if(J.sum!=null)Q.sum=Number(J.sum);if(J.quantileValues){if(!Array.isArray(J.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");Q.quantileValues=[];for(var G=0;G<J.quantileValues.length;++G){if(typeof J.quantileValues[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");Q.quantileValues[G]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(J.quantileValues[G])}}if(J.flags!=null)Q.flags=J.flags>>>0;return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.quantileValues=[],G.attributes=[];if(Q.defaults){if(W0.Long){var q=new W0.Long(0,0,!1);G.startTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.startTimeUnixNano=Q.longs===String?"0":0;if(W0.Long){var q=new W0.Long(0,0,!1);G.timeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.timeUnixNano=Q.longs===String?"0":0;if(W0.Long){var q=new W0.Long(0,0,!1);G.count=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.count=Q.longs===String?"0":0;G.sum=0,G.flags=0}if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano"))if(typeof J.startTimeUnixNano==="number")G.startTimeUnixNano=Q.longs===String?String(J.startTimeUnixNano):J.startTimeUnixNano;else G.startTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.startTimeUnixNano):Q.longs===Number?new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber():J.startTimeUnixNano;if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano"))if(typeof J.timeUnixNano==="number")G.timeUnixNano=Q.longs===String?String(J.timeUnixNano):J.timeUnixNano;else G.timeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.timeUnixNano):Q.longs===Number?new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber():J.timeUnixNano;if(J.count!=null&&J.hasOwnProperty("count"))if(typeof J.count==="number")G.count=Q.longs===String?String(J.count):J.count;else G.count=Q.longs===String?W0.Long.prototype.toString.call(J.count):Q.longs===Number?new W0.LongBits(J.count.low>>>0,J.count.high>>>0).toNumber():J.count;if(J.sum!=null&&J.hasOwnProperty("sum"))G.sum=Q.json&&!isFinite(J.sum)?String(J.sum):J.sum;if(J.quantileValues&&J.quantileValues.length){G.quantileValues=[];for(var K=0;K<J.quantileValues.length;++K)G.quantileValues[K]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(J.quantileValues[K],Q)}if(J.attributes&&J.attributes.length){G.attributes=[];for(var K=0;K<J.attributes.length;++K)G.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[K],Q)}if(J.flags!=null&&J.hasOwnProperty("flags"))G.flags=J.flags;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},F.ValueAtQuantile=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.quantile=null,X.prototype.value=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.quantile!=null&&Object.hasOwnProperty.call(Q,"quantile"))G.uint32(9).double(Q.quantile);if(Q.value!=null&&Object.hasOwnProperty.call(Q,"value"))G.uint32(17).double(Q.value);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.quantile=Q.double();break}case 2:{V.value=Q.double();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.quantile!=null&&Q.hasOwnProperty("quantile")){if(typeof Q.quantile!=="number")return"quantile: number expected"}if(Q.value!=null&&Q.hasOwnProperty("value")){if(typeof Q.value!=="number")return"value: number expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return Q;var G=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;if(Q.quantile!=null)G.quantile=Number(Q.quantile);if(Q.value!=null)G.value=Number(Q.value);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.quantile=0,q.value=0;if(Q.quantile!=null&&Q.hasOwnProperty("quantile"))q.quantile=G.json&&!isFinite(Q.quantile)?String(Q.quantile):Q.quantile;if(Q.value!=null&&Q.hasOwnProperty("value"))q.value=G.json&&!isFinite(Q.value)?String(Q.value):Q.value;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},X}(),F}(),H.Exemplar=function(){function F(J){if(this.filteredAttributes=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.filteredAttributes=W0.emptyArray,F.prototype.timeUnixNano=null,F.prototype.asDouble=null,F.prototype.asInt=null,F.prototype.spanId=null,F.prototype.traceId=null;var X;return Object.defineProperty(F.prototype,"value",{get:W0.oneOfGetter(X=["asDouble","asInt"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(17).fixed64(Q.timeUnixNano);if(Q.asDouble!=null&&Object.hasOwnProperty.call(Q,"asDouble"))G.uint32(25).double(Q.asDouble);if(Q.spanId!=null&&Object.hasOwnProperty.call(Q,"spanId"))G.uint32(34).bytes(Q.spanId);if(Q.traceId!=null&&Object.hasOwnProperty.call(Q,"traceId"))G.uint32(42).bytes(Q.traceId);if(Q.asInt!=null&&Object.hasOwnProperty.call(Q,"asInt"))G.uint32(49).sfixed64(Q.asInt);if(Q.filteredAttributes!=null&&Q.filteredAttributes.length)for(var q=0;q<Q.filteredAttributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.filteredAttributes[q],G.uint32(58).fork()).ldelim();return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.Exemplar;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 7:{if(!(V.filteredAttributes&&V.filteredAttributes.length))V.filteredAttributes=[];V.filteredAttributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.timeUnixNano=Q.fixed64();break}case 3:{V.asDouble=Q.double();break}case 6:{V.asInt=Q.sfixed64();break}case 4:{V.spanId=Q.bytes();break}case 5:{V.traceId=Q.bytes();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.filteredAttributes!=null&&Q.hasOwnProperty("filteredAttributes")){if(!Array.isArray(Q.filteredAttributes))return"filteredAttributes: array expected";for(var q=0;q<Q.filteredAttributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.filteredAttributes[q]);if(K)return"filteredAttributes."+K}}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(G.value=1,typeof Q.asDouble!=="number")return"asDouble: number expected"}if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(G.value===1)return"value: multiple values";if(G.value=1,!W0.isInteger(Q.asInt)&&!(Q.asInt&&W0.isInteger(Q.asInt.low)&&W0.isInteger(Q.asInt.high)))return"asInt: integer|Long expected"}if(Q.spanId!=null&&Q.hasOwnProperty("spanId")){if(!(Q.spanId&&typeof Q.spanId.length==="number"||W0.isString(Q.spanId)))return"spanId: buffer expected"}if(Q.traceId!=null&&Q.hasOwnProperty("traceId")){if(!(Q.traceId&&typeof Q.traceId.length==="number"||W0.isString(Q.traceId)))return"traceId: buffer expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.Exemplar)return Q;var G=new X0.opentelemetry.proto.metrics.v1.Exemplar;if(Q.filteredAttributes){if(!Array.isArray(Q.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");G.filteredAttributes=[];for(var q=0;q<Q.filteredAttributes.length;++q){if(typeof Q.filteredAttributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");G.filteredAttributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.filteredAttributes[q])}}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.asDouble!=null)G.asDouble=Number(Q.asDouble);if(Q.asInt!=null){if(W0.Long)(G.asInt=W0.Long.fromValue(Q.asInt)).unsigned=!1;else if(typeof Q.asInt==="string")G.asInt=parseInt(Q.asInt,10);else if(typeof Q.asInt==="number")G.asInt=Q.asInt;else if(typeof Q.asInt==="object")G.asInt=new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber()}if(Q.spanId!=null){if(typeof Q.spanId==="string")W0.base64.decode(Q.spanId,G.spanId=W0.newBuffer(W0.base64.length(Q.spanId)),0);else if(Q.spanId.length>=0)G.spanId=Q.spanId}if(Q.traceId!=null){if(typeof Q.traceId==="string")W0.base64.decode(Q.traceId,G.traceId=W0.newBuffer(W0.base64.length(Q.traceId)),0);else if(Q.traceId.length>=0)G.traceId=Q.traceId}return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.filteredAttributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;if(G.bytes===String)q.spanId="";else if(q.spanId=[],G.bytes!==Array)q.spanId=W0.newBuffer(q.spanId);if(G.bytes===String)q.traceId="";else if(q.traceId=[],G.bytes!==Array)q.traceId=W0.newBuffer(q.traceId)}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(q.asDouble=G.json&&!isFinite(Q.asDouble)?String(Q.asDouble):Q.asDouble,G.oneofs)q.value="asDouble"}if(Q.spanId!=null&&Q.hasOwnProperty("spanId"))q.spanId=G.bytes===String?W0.base64.encode(Q.spanId,0,Q.spanId.length):G.bytes===Array?Array.prototype.slice.call(Q.spanId):Q.spanId;if(Q.traceId!=null&&Q.hasOwnProperty("traceId"))q.traceId=G.bytes===String?W0.base64.encode(Q.traceId,0,Q.traceId.length):G.bytes===Array?Array.prototype.slice.call(Q.traceId):Q.traceId;if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(typeof Q.asInt==="number")q.asInt=G.longs===String?String(Q.asInt):Q.asInt;else q.asInt=G.longs===String?W0.Long.prototype.toString.call(Q.asInt):G.longs===Number?new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber():Q.asInt;if(G.oneofs)q.value="asInt"}if(Q.filteredAttributes&&Q.filteredAttributes.length){q.filteredAttributes=[];for(var V=0;V<Q.filteredAttributes.length;++V)q.filteredAttributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.filteredAttributes[V],G)}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.Exemplar"},F}(),H}(),W}(),Z.logs=function(){var W={};return W.v1=function(){var H={};return H.LogsData=function(){function F(X){if(this.resourceLogs=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resourceLogs=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resourceLogs!=null&&J.resourceLogs.length)for(var G=0;G<J.resourceLogs.length;++G)X0.opentelemetry.proto.logs.v1.ResourceLogs.encode(J.resourceLogs[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.LogsData;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.resourceLogs&&K.resourceLogs.length))K.resourceLogs=[];K.resourceLogs.push(X0.opentelemetry.proto.logs.v1.ResourceLogs.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resourceLogs!=null&&J.hasOwnProperty("resourceLogs")){if(!Array.isArray(J.resourceLogs))return"resourceLogs: array expected";for(var Q=0;Q<J.resourceLogs.length;++Q){var G=X0.opentelemetry.proto.logs.v1.ResourceLogs.verify(J.resourceLogs[Q]);if(G)return"resourceLogs."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.LogsData)return J;var Q=new X0.opentelemetry.proto.logs.v1.LogsData;if(J.resourceLogs){if(!Array.isArray(J.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");Q.resourceLogs=[];for(var G=0;G<J.resourceLogs.length;++G){if(typeof J.resourceLogs[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");Q.resourceLogs[G]=X0.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(J.resourceLogs[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.resourceLogs=[];if(J.resourceLogs&&J.resourceLogs.length){G.resourceLogs=[];for(var q=0;q<J.resourceLogs.length;++q)G.resourceLogs[q]=X0.opentelemetry.proto.logs.v1.ResourceLogs.toObject(J.resourceLogs[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.LogsData"},F}(),H.ResourceLogs=function(){function F(X){if(this.scopeLogs=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resource=null,F.prototype.scopeLogs=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resource!=null&&Object.hasOwnProperty.call(J,"resource"))X0.opentelemetry.proto.resource.v1.Resource.encode(J.resource,Q.uint32(10).fork()).ldelim();if(J.scopeLogs!=null&&J.scopeLogs.length)for(var G=0;G<J.scopeLogs.length;++G)X0.opentelemetry.proto.logs.v1.ScopeLogs.encode(J.scopeLogs[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.ResourceLogs;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.resource=X0.opentelemetry.proto.resource.v1.Resource.decode(J,J.uint32());break}case 2:{if(!(K.scopeLogs&&K.scopeLogs.length))K.scopeLogs=[];K.scopeLogs.push(X0.opentelemetry.proto.logs.v1.ScopeLogs.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resource!=null&&J.hasOwnProperty("resource")){var Q=X0.opentelemetry.proto.resource.v1.Resource.verify(J.resource);if(Q)return"resource."+Q}if(J.scopeLogs!=null&&J.hasOwnProperty("scopeLogs")){if(!Array.isArray(J.scopeLogs))return"scopeLogs: array expected";for(var G=0;G<J.scopeLogs.length;++G){var Q=X0.opentelemetry.proto.logs.v1.ScopeLogs.verify(J.scopeLogs[G]);if(Q)return"scopeLogs."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.ResourceLogs)return J;var Q=new X0.opentelemetry.proto.logs.v1.ResourceLogs;if(J.resource!=null){if(typeof J.resource!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");Q.resource=X0.opentelemetry.proto.resource.v1.Resource.fromObject(J.resource)}if(J.scopeLogs){if(!Array.isArray(J.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");Q.scopeLogs=[];for(var G=0;G<J.scopeLogs.length;++G){if(typeof J.scopeLogs[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");Q.scopeLogs[G]=X0.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(J.scopeLogs[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.scopeLogs=[];if(Q.defaults)G.resource=null,G.schemaUrl="";if(J.resource!=null&&J.hasOwnProperty("resource"))G.resource=X0.opentelemetry.proto.resource.v1.Resource.toObject(J.resource,Q);if(J.scopeLogs&&J.scopeLogs.length){G.scopeLogs=[];for(var q=0;q<J.scopeLogs.length;++q)G.scopeLogs[q]=X0.opentelemetry.proto.logs.v1.ScopeLogs.toObject(J.scopeLogs[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.ResourceLogs"},F}(),H.ScopeLogs=function(){function F(X){if(this.logRecords=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.scope=null,F.prototype.logRecords=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.scope!=null&&Object.hasOwnProperty.call(J,"scope"))X0.opentelemetry.proto.common.v1.InstrumentationScope.encode(J.scope,Q.uint32(10).fork()).ldelim();if(J.logRecords!=null&&J.logRecords.length)for(var G=0;G<J.logRecords.length;++G)X0.opentelemetry.proto.logs.v1.LogRecord.encode(J.logRecords[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.ScopeLogs;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.decode(J,J.uint32());break}case 2:{if(!(K.logRecords&&K.logRecords.length))K.logRecords=[];K.logRecords.push(X0.opentelemetry.proto.logs.v1.LogRecord.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.scope!=null&&J.hasOwnProperty("scope")){var Q=X0.opentelemetry.proto.common.v1.InstrumentationScope.verify(J.scope);if(Q)return"scope."+Q}if(J.logRecords!=null&&J.hasOwnProperty("logRecords")){if(!Array.isArray(J.logRecords))return"logRecords: array expected";for(var G=0;G<J.logRecords.length;++G){var Q=X0.opentelemetry.proto.logs.v1.LogRecord.verify(J.logRecords[G]);if(Q)return"logRecords."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.ScopeLogs)return J;var Q=new X0.opentelemetry.proto.logs.v1.ScopeLogs;if(J.scope!=null){if(typeof J.scope!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");Q.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(J.scope)}if(J.logRecords){if(!Array.isArray(J.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");Q.logRecords=[];for(var G=0;G<J.logRecords.length;++G){if(typeof J.logRecords[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");Q.logRecords[G]=X0.opentelemetry.proto.logs.v1.LogRecord.fromObject(J.logRecords[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.logRecords=[];if(Q.defaults)G.scope=null,G.schemaUrl="";if(J.scope!=null&&J.hasOwnProperty("scope"))G.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.toObject(J.scope,Q);if(J.logRecords&&J.logRecords.length){G.logRecords=[];for(var q=0;q<J.logRecords.length;++q)G.logRecords[q]=X0.opentelemetry.proto.logs.v1.LogRecord.toObject(J.logRecords[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.ScopeLogs"},F}(),H.SeverityNumber=function(){var F={},X=Object.create(F);return X[F[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,X[F[1]="SEVERITY_NUMBER_TRACE"]=1,X[F[2]="SEVERITY_NUMBER_TRACE2"]=2,X[F[3]="SEVERITY_NUMBER_TRACE3"]=3,X[F[4]="SEVERITY_NUMBER_TRACE4"]=4,X[F[5]="SEVERITY_NUMBER_DEBUG"]=5,X[F[6]="SEVERITY_NUMBER_DEBUG2"]=6,X[F[7]="SEVERITY_NUMBER_DEBUG3"]=7,X[F[8]="SEVERITY_NUMBER_DEBUG4"]=8,X[F[9]="SEVERITY_NUMBER_INFO"]=9,X[F[10]="SEVERITY_NUMBER_INFO2"]=10,X[F[11]="SEVERITY_NUMBER_INFO3"]=11,X[F[12]="SEVERITY_NUMBER_INFO4"]=12,X[F[13]="SEVERITY_NUMBER_WARN"]=13,X[F[14]="SEVERITY_NUMBER_WARN2"]=14,X[F[15]="SEVERITY_NUMBER_WARN3"]=15,X[F[16]="SEVERITY_NUMBER_WARN4"]=16,X[F[17]="SEVERITY_NUMBER_ERROR"]=17,X[F[18]="SEVERITY_NUMBER_ERROR2"]=18,X[F[19]="SEVERITY_NUMBER_ERROR3"]=19,X[F[20]="SEVERITY_NUMBER_ERROR4"]=20,X[F[21]="SEVERITY_NUMBER_FATAL"]=21,X[F[22]="SEVERITY_NUMBER_FATAL2"]=22,X[F[23]="SEVERITY_NUMBER_FATAL3"]=23,X[F[24]="SEVERITY_NUMBER_FATAL4"]=24,X}(),H.LogRecordFlags=function(){var F={},X=Object.create(F);return X[F[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,X[F[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,X}(),H.LogRecord=function(){function F(X){if(this.attributes=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.timeUnixNano=null,F.prototype.observedTimeUnixNano=null,F.prototype.severityNumber=null,F.prototype.severityText=null,F.prototype.body=null,F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.prototype.flags=null,F.prototype.traceId=null,F.prototype.spanId=null,F.prototype.eventName=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.timeUnixNano!=null&&Object.hasOwnProperty.call(J,"timeUnixNano"))Q.uint32(9).fixed64(J.timeUnixNano);if(J.severityNumber!=null&&Object.hasOwnProperty.call(J,"severityNumber"))Q.uint32(16).int32(J.severityNumber);if(J.severityText!=null&&Object.hasOwnProperty.call(J,"severityText"))Q.uint32(26).string(J.severityText);if(J.body!=null&&Object.hasOwnProperty.call(J,"body"))X0.opentelemetry.proto.common.v1.AnyValue.encode(J.body,Q.uint32(42).fork()).ldelim();if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(50).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(56).uint32(J.droppedAttributesCount);if(J.flags!=null&&Object.hasOwnProperty.call(J,"flags"))Q.uint32(69).fixed32(J.flags);if(J.traceId!=null&&Object.hasOwnProperty.call(J,"traceId"))Q.uint32(74).bytes(J.traceId);if(J.spanId!=null&&Object.hasOwnProperty.call(J,"spanId"))Q.uint32(82).bytes(J.spanId);if(J.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"observedTimeUnixNano"))Q.uint32(89).fixed64(J.observedTimeUnixNano);if(J.eventName!=null&&Object.hasOwnProperty.call(J,"eventName"))Q.uint32(98).string(J.eventName);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.LogRecord;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.timeUnixNano=J.fixed64();break}case 11:{K.observedTimeUnixNano=J.fixed64();break}case 2:{K.severityNumber=J.int32();break}case 3:{K.severityText=J.string();break}case 5:{K.body=X0.opentelemetry.proto.common.v1.AnyValue.decode(J,J.uint32());break}case 6:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 7:{K.droppedAttributesCount=J.uint32();break}case 8:{K.flags=J.fixed32();break}case 9:{K.traceId=J.bytes();break}case 10:{K.spanId=J.bytes();break}case 12:{K.eventName=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(J.timeUnixNano)&&!(J.timeUnixNano&&W0.isInteger(J.timeUnixNano.low)&&W0.isInteger(J.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(J.observedTimeUnixNano!=null&&J.hasOwnProperty("observedTimeUnixNano")){if(!W0.isInteger(J.observedTimeUnixNano)&&!(J.observedTimeUnixNano&&W0.isInteger(J.observedTimeUnixNano.low)&&W0.isInteger(J.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected"}if(J.severityNumber!=null&&J.hasOwnProperty("severityNumber"))switch(J.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(J.severityText!=null&&J.hasOwnProperty("severityText")){if(!W0.isString(J.severityText))return"severityText: string expected"}if(J.body!=null&&J.hasOwnProperty("body")){var Q=X0.opentelemetry.proto.common.v1.AnyValue.verify(J.body);if(Q)return"body."+Q}if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var G=0;G<J.attributes.length;++G){var Q=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[G]);if(Q)return"attributes."+Q}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(J.flags!=null&&J.hasOwnProperty("flags")){if(!W0.isInteger(J.flags))return"flags: integer expected"}if(J.traceId!=null&&J.hasOwnProperty("traceId")){if(!(J.traceId&&typeof J.traceId.length==="number"||W0.isString(J.traceId)))return"traceId: buffer expected"}if(J.spanId!=null&&J.hasOwnProperty("spanId")){if(!(J.spanId&&typeof J.spanId.length==="number"||W0.isString(J.spanId)))return"spanId: buffer expected"}if(J.eventName!=null&&J.hasOwnProperty("eventName")){if(!W0.isString(J.eventName))return"eventName: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.LogRecord)return J;var Q=new X0.opentelemetry.proto.logs.v1.LogRecord;if(J.timeUnixNano!=null){if(W0.Long)(Q.timeUnixNano=W0.Long.fromValue(J.timeUnixNano)).unsigned=!1;else if(typeof J.timeUnixNano==="string")Q.timeUnixNano=parseInt(J.timeUnixNano,10);else if(typeof J.timeUnixNano==="number")Q.timeUnixNano=J.timeUnixNano;else if(typeof J.timeUnixNano==="object")Q.timeUnixNano=new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber()}if(J.observedTimeUnixNano!=null){if(W0.Long)(Q.observedTimeUnixNano=W0.Long.fromValue(J.observedTimeUnixNano)).unsigned=!1;else if(typeof J.observedTimeUnixNano==="string")Q.observedTimeUnixNano=parseInt(J.observedTimeUnixNano,10);else if(typeof J.observedTimeUnixNano==="number")Q.observedTimeUnixNano=J.observedTimeUnixNano;else if(typeof J.observedTimeUnixNano==="object")Q.observedTimeUnixNano=new W0.LongBits(J.observedTimeUnixNano.low>>>0,J.observedTimeUnixNano.high>>>0).toNumber()}switch(J.severityNumber){default:if(typeof J.severityNumber==="number"){Q.severityNumber=J.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:Q.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:Q.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:Q.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:Q.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:Q.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:Q.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:Q.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:Q.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:Q.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:Q.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:Q.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:Q.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:Q.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:Q.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:Q.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:Q.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:Q.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:Q.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:Q.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:Q.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:Q.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:Q.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:Q.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:Q.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:Q.severityNumber=24;break}if(J.severityText!=null)Q.severityText=String(J.severityText);if(J.body!=null){if(typeof J.body!=="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");Q.body=X0.opentelemetry.proto.common.v1.AnyValue.fromObject(J.body)}if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;if(J.flags!=null)Q.flags=J.flags>>>0;if(J.traceId!=null){if(typeof J.traceId==="string")W0.base64.decode(J.traceId,Q.traceId=W0.newBuffer(W0.base64.length(J.traceId)),0);else if(J.traceId.length>=0)Q.traceId=J.traceId}if(J.spanId!=null){if(typeof J.spanId==="string")W0.base64.decode(J.spanId,Q.spanId=W0.newBuffer(W0.base64.length(J.spanId)),0);else if(J.spanId.length>=0)Q.spanId=J.spanId}if(J.eventName!=null)Q.eventName=String(J.eventName);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[];if(Q.defaults){if(W0.Long){var q=new W0.Long(0,0,!1);G.timeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.timeUnixNano=Q.longs===String?"0":0;if(G.severityNumber=Q.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,G.severityText="",G.body=null,G.droppedAttributesCount=0,G.flags=0,Q.bytes===String)G.traceId="";else if(G.traceId=[],Q.bytes!==Array)G.traceId=W0.newBuffer(G.traceId);if(Q.bytes===String)G.spanId="";else if(G.spanId=[],Q.bytes!==Array)G.spanId=W0.newBuffer(G.spanId);if(W0.Long){var q=new W0.Long(0,0,!1);G.observedTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.observedTimeUnixNano=Q.longs===String?"0":0;G.eventName=""}if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano"))if(typeof J.timeUnixNano==="number")G.timeUnixNano=Q.longs===String?String(J.timeUnixNano):J.timeUnixNano;else G.timeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.timeUnixNano):Q.longs===Number?new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber():J.timeUnixNano;if(J.severityNumber!=null&&J.hasOwnProperty("severityNumber"))G.severityNumber=Q.enums===String?X0.opentelemetry.proto.logs.v1.SeverityNumber[J.severityNumber]===void 0?J.severityNumber:X0.opentelemetry.proto.logs.v1.SeverityNumber[J.severityNumber]:J.severityNumber;if(J.severityText!=null&&J.hasOwnProperty("severityText"))G.severityText=J.severityText;if(J.body!=null&&J.hasOwnProperty("body"))G.body=X0.opentelemetry.proto.common.v1.AnyValue.toObject(J.body,Q);if(J.attributes&&J.attributes.length){G.attributes=[];for(var K=0;K<J.attributes.length;++K)G.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[K],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;if(J.flags!=null&&J.hasOwnProperty("flags"))G.flags=J.flags;if(J.traceId!=null&&J.hasOwnProperty("traceId"))G.traceId=Q.bytes===String?W0.base64.encode(J.traceId,0,J.traceId.length):Q.bytes===Array?Array.prototype.slice.call(J.traceId):J.traceId;if(J.spanId!=null&&J.hasOwnProperty("spanId"))G.spanId=Q.bytes===String?W0.base64.encode(J.spanId,0,J.spanId.length):Q.bytes===Array?Array.prototype.slice.call(J.spanId):J.spanId;if(J.observedTimeUnixNano!=null&&J.hasOwnProperty("observedTimeUnixNano"))if(typeof J.observedTimeUnixNano==="number")G.observedTimeUnixNano=Q.longs===String?String(J.observedTimeUnixNano):J.observedTimeUnixNano;else G.observedTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.observedTimeUnixNano):Q.longs===Number?new W0.LongBits(J.observedTimeUnixNano.low>>>0,J.observedTimeUnixNano.high>>>0).toNumber():J.observedTimeUnixNano;if(J.eventName!=null&&J.hasOwnProperty("eventName"))G.eventName=J.eventName;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.LogRecord"},F}(),H}(),W}(),Z}(),Y}();Tk.exports=X0});var _J=H0((Ck)=>{Object.defineProperty(Ck,"__esModule",{value:!0});Ck.toAnyValue=Ck.toKeyValue=Ck.toAttributes=Ck.createInstrumentationScope=Ck.createResource=void 0;function BV0(Y,Z){let W={attributes:Ik(Y.attributes,Z),droppedAttributesCount:0},H=Y.schemaUrl;if(H&&H!=="")W.schemaUrl=H;return W}Ck.createResource=BV0;function AV0(Y){return{name:Y.name,version:Y.version}}Ck.createInstrumentationScope=AV0;function Ik(Y,Z){return Object.keys(Y).map((W)=>$k(W,Y[W],Z))}Ck.toAttributes=Ik;function $k(Y,Z,W){return{key:Y,value:jJ(Z,W)}}Ck.toKeyValue=$k;function jJ(Y,Z){let W=typeof Y;if(W==="string")return{stringValue:Y};if(W==="number"){if(!Number.isInteger(Y))return{doubleValue:Y};return{intValue:Y}}if(W==="boolean")return{boolValue:Y};if(Y instanceof Uint8Array)return{bytesValue:Z.encodeUint8Array(Y)};if(Array.isArray(Y)){let H=Array(Y.length);for(let F=0;F<Y.length;F++)H[F]=jJ(Y[F],Z);return{arrayValue:{values:H}}}if(W==="object"&&Y!=null){let H=Object.keys(Y),F=Array(H.length);for(let X=0;X<H.length;X++)F[X]={key:H[X],value:jJ(Y[H[X]],Z)};return{kvlistValue:{values:F}}}return{}}Ck.toAnyValue=jJ});var hH=H0((Rk)=>{Object.defineProperty(Rk,"__esModule",{value:!0});Rk.toLogAttributes=Rk.createExportLogsServiceRequest=void 0;var xJ=_J();function TV0(Y,Z){return{resourceLogs:$V0(Y,Z)}}Rk.createExportLogsServiceRequest=TV0;function IV0(Y){let Z=new Map;for(let W of Y){let{resource:H,instrumentationScope:{name:F,version:X="",schemaUrl:J=""}}=W,Q=Z.get(H);if(!Q)Q=new Map,Z.set(H,Q);let G=`${F}@${X}:${J}`,q=Q.get(G);if(!q)q=[],Q.set(G,q);q.push(W)}return Z}function $V0(Y,Z){let W=IV0(Y);return Array.from(W,([H,F])=>{let X=(0,xJ.createResource)(H,Z);return{resource:X,scopeLogs:Array.from(F,([,J])=>{return{scope:(0,xJ.createInstrumentationScope)(J[0].instrumentationScope),logRecords:J.map((Q)=>CV0(Q,Z)),schemaUrl:J[0].instrumentationScope.schemaUrl}}),schemaUrl:X.schemaUrl}})}function CV0(Y,Z){return{timeUnixNano:Z.encodeHrTime(Y.hrTime),observedTimeUnixNano:Z.encodeHrTime(Y.hrTimeObserved),severityNumber:EV0(Y.severityNumber),severityText:Y.severityText,body:(0,xJ.toAnyValue)(Y.body,Z),eventName:Y.eventName,attributes:Mk(Y.attributes,Z),droppedAttributesCount:Y.droppedAttributesCount,flags:Y.spanContext?.traceFlags,traceId:Z.encodeOptionalSpanContext(Y.spanContext?.traceId),spanId:Z.encodeOptionalSpanContext(Y.spanContext?.spanId)}}function EV0(Y){return Y}function Mk(Y,Z){return Object.keys(Y).map((W)=>(0,xJ.toKeyValue)(W,Y[W],Z))}Rk.toLogAttributes=Mk});var fk=H0((wk)=>{Object.defineProperty(wk,"__esModule",{value:!0});wk.hexToBinary=void 0;function Lk(Y){if(Y>=48&&Y<=57)return Y-48;if(Y>=97&&Y<=102)return Y-87;return Y-55}function RV0(Y){let Z=new Uint8Array(Y.length/2),W=0;for(let H=0;H<Y.length;H+=2){let F=Lk(Y.charCodeAt(H)),X=Lk(Y.charCodeAt(H+1));Z[W++]=F<<4|X}return Z}wk.hexToBinary=RV0});var i5=H0((jk)=>{Object.defineProperty(jk,"__esModule",{value:!0});jk.JSON_ENCODER=jk.PROTOBUF_ENCODER=jk.encodeAsString=jk.encodeAsLongBits=jk.toLongBits=jk.hrTimeToNanos=void 0;var PV0=G6(),kk=fk();function _H(Y){let Z=BigInt(1e9);return BigInt(Math.trunc(Y[0]))*Z+BigInt(Math.trunc(Y[1]))}jk.hrTimeToNanos=_H;function yk(Y){let Z=Number(BigInt.asUintN(32,Y)),W=Number(BigInt.asUintN(32,Y>>BigInt(32)));return{low:Z,high:W}}jk.toLongBits=yk;function vk(Y){let Z=_H(Y);return yk(Z)}jk.encodeAsLongBits=vk;function hk(Y){return _H(Y).toString()}jk.encodeAsString=hk;var LV0=typeof BigInt<"u"?hk:PV0.hrTimeToNanoseconds;function jH(Y){return Y}function wV0(Y){if(Y===void 0)return;return(0,kk.hexToBinary)(Y)}jk.PROTOBUF_ENCODER={encodeHrTime:vk,encodeSpanContext:kk.hexToBinary,encodeOptionalSpanContext:wV0,encodeUint8Array:jH};jk.JSON_ENCODER={encodeHrTime:LV0,encodeSpanContext:jH,encodeOptionalSpanContext:jH,encodeUint8Array:(Y)=>{if(typeof Buffer<"u")return Buffer.from(Y).toString("base64");let Z=Array(Y.length);for(let W=0;W<Y.length;W++)Z[W]=String.fromCharCode(Y[W]);return btoa(Z.join(""))}}});var mk=H0((bk)=>{Object.defineProperty(bk,"__esModule",{value:!0});bk.ProtobufLogsSerializer=void 0;var xk=hJ(),hV0=hH(),jV0=i5(),_V0=xk.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,xV0=xk.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;bk.ProtobufLogsSerializer={serializeRequest:(Y)=>{let Z=(0,hV0.createExportLogsServiceRequest)(Y,jV0.PROTOBUF_ENCODER);return xV0.encode(Z).finish()},deserializeResponse:(Y)=>{return _V0.decode(Y)}}});var gk=H0((xH)=>{Object.defineProperty(xH,"__esModule",{value:!0});xH.ProtobufLogsSerializer=void 0;var bV0=mk();Object.defineProperty(xH,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return bV0.ProtobufLogsSerializer}})});var bJ=H0((dk)=>{Object.defineProperty(dk,"__esModule",{value:!0});dk.AggregationTemporality=void 0;var mV0;(function(Y){Y[Y.DELTA=0]="DELTA",Y[Y.CUMULATIVE=1]="CUMULATIVE"})(mV0=dk.AggregationTemporality||(dk.AggregationTemporality={}))});var r4=H0((lk)=>{Object.defineProperty(lk,"__esModule",{value:!0});lk.DataPointType=lk.InstrumentType=void 0;var gV0;(function(Y){Y.COUNTER="COUNTER",Y.GAUGE="GAUGE",Y.HISTOGRAM="HISTOGRAM",Y.UP_DOWN_COUNTER="UP_DOWN_COUNTER",Y.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",Y.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",Y.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(gV0=lk.InstrumentType||(lk.InstrumentType={}));var dV0;(function(Y){Y[Y.HISTOGRAM=0]="HISTOGRAM",Y[Y.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",Y[Y.GAUGE=2]="GAUGE",Y[Y.SUM=3]="SUM"})(dV0=lk.DataPointType||(lk.DataPointType={}))});var p9=H0((nk)=>{Object.defineProperty(nk,"__esModule",{value:!0});nk.equalsCaseInsensitive=nk.binarySearchUB=nk.setEquals=nk.callWithTimeout=nk.TimeoutError=nk.instrumentationScopeId=nk.hashAttributes=void 0;function cV0(Y){let Z=Object.keys(Y);if(Z.length===0)return"";return Z=Z.sort(),JSON.stringify(Z.map((W)=>[W,Y[W]]))}nk.hashAttributes=cV0;function lV0(Y){return`${Y.name}:${Y.version??""}:${Y.schemaUrl??""}`}nk.instrumentationScopeId=lV0;class uJ extends Error{constructor(Y){super(Y);Object.setPrototypeOf(this,uJ.prototype)}}nk.TimeoutError=uJ;function nV0(Y,Z){let W,H=new Promise(function(X,J){W=setTimeout(function(){J(new uJ("Operation timed out."))},Z)});return Promise.race([Y,H]).then((F)=>{return clearTimeout(W),F},(F)=>{throw clearTimeout(W),F})}nk.callWithTimeout=nV0;function pV0(Y,Z){if(Y.size!==Z.size)return!1;for(let W of Y)if(!Z.has(W))return!1;return!0}nk.setEquals=pV0;function iV0(Y,Z){let W=0,H=Y.length-1,F=Y.length;while(H>=W){let X=W+Math.trunc((H-W)/2);if(Y[X]<Z)W=X+1;else F=X,H=X-1}return F}nk.binarySearchUB=iV0;function rV0(Y,Z){return Y.toLowerCase()===Z.toLowerCase()}nk.equalsCaseInsensitive=rV0});var e7=H0((ik)=>{Object.defineProperty(ik,"__esModule",{value:!0});ik.AggregatorKind=void 0;var Zq0;(function(Y){Y[Y.DROP=0]="DROP",Y[Y.SUM=1]="SUM",Y[Y.LAST_VALUE=2]="LAST_VALUE",Y[Y.HISTOGRAM=3]="HISTOGRAM",Y[Y.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(Zq0=ik.AggregatorKind||(ik.AggregatorKind={}))});var tk=H0((ak)=>{Object.defineProperty(ak,"__esModule",{value:!0});ak.DropAggregator=void 0;var Qq0=e7();class rk{kind=Qq0.AggregatorKind.DROP;createAccumulation(){return}merge(Y,Z){return}diff(Y,Z){return}toMetricData(Y,Z,W,H){return}}ak.DropAggregator=rk});var Zy=H0((ek)=>{Object.defineProperty(ek,"__esModule",{value:!0});ek.HistogramAggregator=ek.HistogramAccumulation=void 0;var Xq0=e7(),pZ=r4(),Jq0=p9();function Wq0(Y){let Z=Y.map(()=>0);return Z.push(0),{buckets:{boundaries:Y,counts:Z},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}class iZ{startTime;_boundaries;_recordMinMax;_current;constructor(Y,Z,W=!0,H=Wq0(Z)){this.startTime=Y,this._boundaries=Z,this._recordMinMax=W,this._current=H}record(Y){if(Number.isNaN(Y))return;if(this._current.count+=1,this._current.sum+=Y,this._recordMinMax)this._current.min=Math.min(Y,this._current.min),this._current.max=Math.max(Y,this._current.max),this._current.hasMinMax=!0;let Z=(0,Jq0.binarySearchUB)(this._boundaries,Y);this._current.buckets.counts[Z]+=1}setStartTime(Y){this.startTime=Y}toPointValue(){return this._current}}ek.HistogramAccumulation=iZ;class sk{kind=Xq0.AggregatorKind.HISTOGRAM;_boundaries;_recordMinMax;constructor(Y,Z){this._boundaries=Y,this._recordMinMax=Z}createAccumulation(Y){return new iZ(Y,this._boundaries,this._recordMinMax)}merge(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue(),F=W.buckets.counts,X=H.buckets.counts,J=Array(F.length);for(let q=0;q<F.length;q++)J[q]=F[q]+X[q];let Q=1/0,G=-1/0;if(this._recordMinMax){if(W.hasMinMax&&H.hasMinMax)Q=Math.min(W.min,H.min),G=Math.max(W.max,H.max);else if(W.hasMinMax)Q=W.min,G=W.max;else if(H.hasMinMax)Q=H.min,G=H.max}return new iZ(Y.startTime,W.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:W.buckets.boundaries,counts:J},count:W.count+H.count,sum:W.sum+H.sum,hasMinMax:this._recordMinMax&&(W.hasMinMax||H.hasMinMax),min:Q,max:G})}diff(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue(),F=W.buckets.counts,X=H.buckets.counts,J=Array(F.length);for(let Q=0;Q<F.length;Q++)J[Q]=X[Q]-F[Q];return new iZ(Z.startTime,W.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:W.buckets.boundaries,counts:J},count:H.count-W.count,sum:H.sum-W.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:pZ.DataPointType.HISTOGRAM,dataPoints:W.map(([F,X])=>{let J=X.toPointValue(),Q=Y.type===pZ.InstrumentType.GAUGE||Y.type===pZ.InstrumentType.UP_DOWN_COUNTER||Y.type===pZ.InstrumentType.OBSERVABLE_GAUGE||Y.type===pZ.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:F,startTime:X.startTime,endTime:H,value:{min:J.hasMinMax?J.min:void 0,max:J.hasMinMax?J.max:void 0,sum:!Q?J.sum:void 0,buckets:J.buckets,count:J.count}}})}}}ek.HistogramAggregator=sk});var Jy=H0((Qy)=>{Object.defineProperty(Qy,"__esModule",{value:!0});Qy.Buckets=void 0;class gH{backing;indexBase;indexStart;indexEnd;constructor(Y=new dH,Z=0,W=0,H=0){this.backing=Y,this.indexBase=Z,this.indexStart=W,this.indexEnd=H}get offset(){return this.indexStart}get length(){if(this.backing.length===0)return 0;if(this.indexEnd===this.indexStart&&this.at(0)===0)return 0;return this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(Y,Z)=>this.at(Z))}at(Y){let Z=this.indexBase-this.indexStart;if(Y<Z)Y+=this.backing.length;return Y-=Z,this.backing.countAt(Y)}incrementBucket(Y,Z){this.backing.increment(Y,Z)}decrementBucket(Y,Z){this.backing.decrement(Y,Z)}trim(){for(let Y=0;Y<this.length;Y++)if(this.at(Y)!==0){this.indexStart+=Y;break}else if(Y===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let Y=this.length-1;Y>=0;Y--)if(this.at(Y)!==0){this.indexEnd-=this.length-Y-1;break}this._rotate()}downscale(Y){this._rotate();let Z=1+this.indexEnd-this.indexStart,W=1<<Y,H=0,F=0;for(let X=this.indexStart;X<=this.indexEnd;){let J=X%W;if(J<0)J+=W;for(let Q=J;Q<W&&H<Z;Q++)this._relocateBucket(F,H),H++,X++;F++}this.indexStart>>=Y,this.indexEnd>>=Y,this.indexBase=this.indexStart}clone(){return new gH(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let Y=this.indexBase-this.indexStart;if(Y===0)return;else if(Y>0)this.backing.reverse(0,this.backing.length),this.backing.reverse(0,Y),this.backing.reverse(Y,this.backing.length);else this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+Y);this.indexBase=this.indexStart}_relocateBucket(Y,Z){if(Y===Z)return;this.incrementBucket(Y,this.backing.emptyBucket(Z))}}Qy.Buckets=gH;class dH{_counts;constructor(Y=[0]){this._counts=Y}get length(){return this._counts.length}countAt(Y){return this._counts[Y]}growTo(Y,Z,W){let H=Array(Y).fill(0);H.splice(W,this._counts.length-Z,...this._counts.slice(Z)),H.splice(0,Z,...this._counts.slice(0,Z)),this._counts=H}reverse(Y,Z){let W=Math.floor((Y+Z)/2)-Y;for(let H=0;H<W;H++){let F=this._counts[Y+H];this._counts[Y+H]=this._counts[Z-H-1],this._counts[Z-H-1]=F}}emptyBucket(Y){let Z=this._counts[Y];return this._counts[Y]=0,Z}increment(Y,Z){this._counts[Y]+=Z}decrement(Y,Z){if(this._counts[Y]>=Z)this._counts[Y]-=Z;else this._counts[Y]=0}clone(){return new dH([...this._counts])}}});var lH=H0((Wy)=>{Object.defineProperty(Wy,"__esModule",{value:!0});Wy.getSignificand=Wy.getNormalBase2=Wy.MIN_VALUE=Wy.MAX_NORMAL_EXPONENT=Wy.MIN_NORMAL_EXPONENT=Wy.SIGNIFICAND_WIDTH=void 0;Wy.SIGNIFICAND_WIDTH=52;var Gq0=2146435072,Fq0=1048575,cH=1023;Wy.MIN_NORMAL_EXPONENT=-cH+1;Wy.MAX_NORMAL_EXPONENT=cH;Wy.MIN_VALUE=Math.pow(2,-1022);function Hq0(Y){let Z=new DataView(new ArrayBuffer(8));return Z.setFloat64(0,Y),((Z.getUint32(0)&Gq0)>>20)-cH}Wy.getNormalBase2=Hq0;function Vq0(Y){let Z=new DataView(new ArrayBuffer(8));Z.setFloat64(0,Y);let W=Z.getUint32(0),H=Z.getUint32(4);return(W&Fq0)*Math.pow(2,32)+H}Wy.getSignificand=Vq0});var mJ=H0((Gy)=>{Object.defineProperty(Gy,"__esModule",{value:!0});Gy.nextGreaterSquare=Gy.ldexp=void 0;function Nq0(Y,Z){if(Y===0||Y===Number.POSITIVE_INFINITY||Y===Number.NEGATIVE_INFINITY||Number.isNaN(Y))return Y;return Y*Math.pow(2,Z)}Gy.ldexp=Nq0;function Oq0(Y){return Y--,Y|=Y>>1,Y|=Y>>2,Y|=Y>>4,Y|=Y>>8,Y|=Y>>16,Y++,Y}Gy.nextGreaterSquare=Oq0});var gJ=H0((Vy)=>{Object.defineProperty(Vy,"__esModule",{value:!0});Vy.MappingError=void 0;class Hy extends Error{}Vy.MappingError=Hy});var Ny=H0((Ay)=>{Object.defineProperty(Ay,"__esModule",{value:!0});Ay.ExponentMapping=void 0;var YY=lH(),Tq0=mJ(),zy=gJ();class By{_shift;constructor(Y){this._shift=-Y}mapToIndex(Y){if(Y<YY.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let Z=YY.getNormalBase2(Y),W=this._rightShift(YY.getSignificand(Y)-1,YY.SIGNIFICAND_WIDTH);return Z+W>>this._shift}lowerBoundary(Y){let Z=this._minNormalLowerBoundaryIndex();if(Y<Z)throw new zy.MappingError(`underflow: ${Y} is < minimum lower boundary: ${Z}`);let W=this._maxNormalLowerBoundaryIndex();if(Y>W)throw new zy.MappingError(`overflow: ${Y} is > maximum lower boundary: ${W}`);return Tq0.ldexp(1,Y<<this._shift)}get scale(){if(this._shift===0)return 0;return-this._shift}_minNormalLowerBoundaryIndex(){let Y=YY.MIN_NORMAL_EXPONENT>>this._shift;if(this._shift<2)Y--;return Y}_maxNormalLowerBoundaryIndex(){return YY.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(Y,Z){return Math.floor(Y*Math.pow(2,-Z))}}Ay.ExponentMapping=By});var Cy=H0((Iy)=>{Object.defineProperty(Iy,"__esModule",{value:!0});Iy.LogarithmMapping=void 0;var ZY=lH(),Oy=mJ(),Dy=gJ();class Ty{_scale;_scaleFactor;_inverseFactor;constructor(Y){this._scale=Y,this._scaleFactor=Oy.ldexp(Math.LOG2E,Y),this._inverseFactor=Oy.ldexp(Math.LN2,-Y)}mapToIndex(Y){if(Y<=ZY.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(ZY.getSignificand(Y)===0)return(ZY.getNormalBase2(Y)<<this._scale)-1;let Z=Math.floor(Math.log(Y)*this._scaleFactor),W=this._maxNormalLowerBoundaryIndex();if(Z>=W)return W;return Z}lowerBoundary(Y){let Z=this._maxNormalLowerBoundaryIndex();if(Y>=Z){if(Y===Z)return 2*Math.exp((Y-(1<<this._scale))/this._scaleFactor);throw new Dy.MappingError(`overflow: ${Y} is > maximum lower boundary: ${Z}`)}let W=this._minNormalLowerBoundaryIndex();if(Y<=W){if(Y===W)return ZY.MIN_VALUE;else if(Y===W-1)return Math.exp((Y+(1<<this._scale))/this._scaleFactor)/2;throw new Dy.MappingError(`overflow: ${Y} is < minimum lower boundary: ${W}`)}return Math.exp(Y*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return ZY.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(ZY.MAX_NORMAL_EXPONENT+1<<this._scale)-1}}Iy.LogarithmMapping=Ty});var Ly=H0((Ry)=>{Object.defineProperty(Ry,"__esModule",{value:!0});Ry.getMapping=void 0;var Iq0=Ny(),$q0=Cy(),Cq0=gJ(),Ey=-10,My=20,Eq0=Array.from({length:31},(Y,Z)=>{if(Z>10)return new $q0.LogarithmMapping(Z-10);return new Iq0.ExponentMapping(Z-10)});function Mq0(Y){if(Y>My||Y<Ey)throw new Cq0.MappingError(`expected scale >= ${Ey} && <= ${My}, got: ${Y}`);return Eq0[Y+10]}Ry.getMapping=Mq0});var vy=H0((ky)=>{Object.defineProperty(ky,"__esModule",{value:!0});ky.ExponentialHistogramAggregator=ky.ExponentialHistogramAccumulation=void 0;var Rq0=e7(),rZ=r4(),Pq0=f1(),wy=Jy(),Sy=Ly(),Lq0=mJ();class QY{static combine(Y,Z){return new QY(Math.min(Y.low,Z.low),Math.max(Y.high,Z.high))}low;high;constructor(Y,Z){this.low=Y,this.high=Z}}var wq0=20,Sq0=160,nH=2;class dJ{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(Y,Z=Sq0,W=!0,H=0,F=0,X=0,J=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,G=new wy.Buckets,q=new wy.Buckets,K=(0,Sy.getMapping)(wq0)){if(this.startTime=Y,this._maxSize=Z,this._recordMinMax=W,this._sum=H,this._count=F,this._zeroCount=X,this._min=J,this._max=Q,this._positive=G,this._negative=q,this._mapping=K,this._maxSize<nH)Pq0.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${nH}`),this._maxSize=nH}record(Y){this.updateByIncrement(Y,1)}setStartTime(Y){this.startTime=Y}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(){if(this._count===this._zeroCount)return 0;return this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(Y,Z){if(Number.isNaN(Y))return;if(Y>this._max)this._max=Y;if(Y<this._min)this._min=Y;if(this._count+=Z,Y===0){this._zeroCount+=Z;return}if(this._sum+=Y*Z,Y>0)this._updateBuckets(this._positive,Y,Z);else this._updateBuckets(this._negative,-Y,Z)}merge(Y){if(this._count===0)this._min=Y.min,this._max=Y.max;else if(Y.count!==0){if(Y.min<this.min)this._min=Y.min;if(Y.max>this.max)this._max=Y.max}this.startTime=Y.startTime,this._sum+=Y.sum,this._count+=Y.count,this._zeroCount+=Y.zeroCount;let Z=this._minScale(Y);this._downscale(this.scale-Z),this._mergeBuckets(this.positive,Y,Y.positive,Z),this._mergeBuckets(this.negative,Y,Y.negative,Z)}diff(Y){this._min=1/0,this._max=-1/0,this._sum-=Y.sum,this._count-=Y.count,this._zeroCount-=Y.zeroCount;let Z=this._minScale(Y);this._downscale(this.scale-Z),this._diffBuckets(this.positive,Y,Y.positive,Z),this._diffBuckets(this.negative,Y,Y.negative,Z)}clone(){return new dJ(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(Y,Z,W){let H=this._mapping.mapToIndex(Z),F=!1,X=0,J=0;if(Y.length===0)Y.indexStart=H,Y.indexEnd=Y.indexStart,Y.indexBase=Y.indexStart;else if(H<Y.indexStart&&Y.indexEnd-H>=this._maxSize)F=!0,J=H,X=Y.indexEnd;else if(H>Y.indexEnd&&H-Y.indexStart>=this._maxSize)F=!0,J=Y.indexStart,X=H;if(F){let Q=this._changeScale(X,J);this._downscale(Q),H=this._mapping.mapToIndex(Z)}this._incrementIndexBy(Y,H,W)}_incrementIndexBy(Y,Z,W){if(W===0)return;if(Y.length===0)Y.indexStart=Y.indexEnd=Y.indexBase=Z;if(Z<Y.indexStart){let F=Y.indexEnd-Z;if(F>=Y.backing.length)this._grow(Y,F+1);Y.indexStart=Z}else if(Z>Y.indexEnd){let F=Z-Y.indexStart;if(F>=Y.backing.length)this._grow(Y,F+1);Y.indexEnd=Z}let H=Z-Y.indexBase;if(H<0)H+=Y.backing.length;Y.incrementBucket(H,W)}_grow(Y,Z){let W=Y.backing.length,H=Y.indexBase-Y.indexStart,F=W-H,X=(0,Lq0.nextGreaterSquare)(Z);if(X>this._maxSize)X=this._maxSize;let J=X-H;Y.backing.growTo(X,F,J)}_changeScale(Y,Z){let W=0;while(Y-Z>=this._maxSize)Y>>=1,Z>>=1,W++;return W}_downscale(Y){if(Y===0)return;if(Y<0)throw Error(`impossible change of scale: ${this.scale}`);let Z=this._mapping.scale-Y;this._positive.downscale(Y),this._negative.downscale(Y),this._mapping=(0,Sy.getMapping)(Z)}_minScale(Y){let Z=Math.min(this.scale,Y.scale),W=QY.combine(this._highLowAtScale(this.positive,this.scale,Z),this._highLowAtScale(Y.positive,Y.scale,Z)),H=QY.combine(this._highLowAtScale(this.negative,this.scale,Z),this._highLowAtScale(Y.negative,Y.scale,Z));return Math.min(Z-this._changeScale(W.high,W.low),Z-this._changeScale(H.high,H.low))}_highLowAtScale(Y,Z,W){if(Y.length===0)return new QY(0,-1);let H=Z-W;return new QY(Y.indexStart>>H,Y.indexEnd>>H)}_mergeBuckets(Y,Z,W,H){let F=W.offset,X=Z.scale-H;for(let J=0;J<W.length;J++)this._incrementIndexBy(Y,F+J>>X,W.at(J))}_diffBuckets(Y,Z,W,H){let F=W.offset,X=Z.scale-H;for(let J=0;J<W.length;J++){let G=(F+J>>X)-Y.indexBase;if(G<0)G+=Y.backing.length;Y.decrementBucket(G,W.at(J))}Y.trim()}}ky.ExponentialHistogramAccumulation=dJ;class fy{kind=Rq0.AggregatorKind.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(Y,Z){this._maxSize=Y,this._recordMinMax=Z}createAccumulation(Y){return new dJ(Y,this._maxSize,this._recordMinMax)}merge(Y,Z){let W=Z.clone();return W.merge(Y),W}diff(Y,Z){let W=Z.clone();return W.diff(Y),W}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:rZ.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:W.map(([F,X])=>{let J=X.toPointValue(),Q=Y.type===rZ.InstrumentType.GAUGE||Y.type===rZ.InstrumentType.UP_DOWN_COUNTER||Y.type===rZ.InstrumentType.OBSERVABLE_GAUGE||Y.type===rZ.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:F,startTime:X.startTime,endTime:H,value:{min:J.hasMinMax?J.min:void 0,max:J.hasMinMax?J.max:void 0,sum:!Q?J.sum:void 0,positive:{offset:J.positive.offset,bucketCounts:J.positive.bucketCounts},negative:{offset:J.negative.offset,bucketCounts:J.negative.bucketCounts},count:J.count,scale:J.scale,zeroCount:J.zeroCount}}})}}}ky.ExponentialHistogramAggregator=fy});var xy=H0((jy)=>{Object.defineProperty(jy,"__esModule",{value:!0});jy.LastValueAggregator=jy.LastValueAccumulation=void 0;var kq0=e7(),aZ=G6(),yq0=r4();class oZ{startTime;_current;sampleTime;constructor(Y,Z=0,W=[0,0]){this.startTime=Y,this._current=Z,this.sampleTime=W}record(Y){this._current=Y,this.sampleTime=(0,aZ.millisToHrTime)(Date.now())}setStartTime(Y){this.startTime=Y}toPointValue(){return this._current}}jy.LastValueAccumulation=oZ;class hy{kind=kq0.AggregatorKind.LAST_VALUE;createAccumulation(Y){return new oZ(Y)}merge(Y,Z){let W=(0,aZ.hrTimeToMicroseconds)(Z.sampleTime)>=(0,aZ.hrTimeToMicroseconds)(Y.sampleTime)?Z:Y;return new oZ(Y.startTime,W.toPointValue(),W.sampleTime)}diff(Y,Z){let W=(0,aZ.hrTimeToMicroseconds)(Z.sampleTime)>=(0,aZ.hrTimeToMicroseconds)(Y.sampleTime)?Z:Y;return new oZ(Z.startTime,W.toPointValue(),W.sampleTime)}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:yq0.DataPointType.GAUGE,dataPoints:W.map(([F,X])=>{return{attributes:F,startTime:X.startTime,endTime:H,value:X.toPointValue()}})}}}jy.LastValueAggregator=hy});var gy=H0((uy)=>{Object.defineProperty(uy,"__esModule",{value:!0});uy.SumAggregator=uy.SumAccumulation=void 0;var hq0=e7(),jq0=r4();class r5{startTime;monotonic;_current;reset;constructor(Y,Z,W=0,H=!1){this.startTime=Y,this.monotonic=Z,this._current=W,this.reset=H}record(Y){if(this.monotonic&&Y<0)return;this._current+=Y}setStartTime(Y){this.startTime=Y}toPointValue(){return this._current}}uy.SumAccumulation=r5;class by{kind=hq0.AggregatorKind.SUM;monotonic;constructor(Y){this.monotonic=Y}createAccumulation(Y){return new r5(Y,this.monotonic)}merge(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue();if(Z.reset)return new r5(Z.startTime,this.monotonic,H,Z.reset);return new r5(Y.startTime,this.monotonic,W+H)}diff(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue();if(this.monotonic&&W>H)return new r5(Z.startTime,this.monotonic,H,!0);return new r5(Z.startTime,this.monotonic,H-W)}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:jq0.DataPointType.SUM,dataPoints:W.map(([F,X])=>{return{attributes:F,startTime:X.startTime,endTime:H,value:X.toPointValue()}}),isMonotonic:this.monotonic}}}uy.SumAggregator=by});var py=H0((P9)=>{Object.defineProperty(P9,"__esModule",{value:!0});P9.SumAggregator=P9.SumAccumulation=P9.LastValueAggregator=P9.LastValueAccumulation=P9.ExponentialHistogramAggregator=P9.ExponentialHistogramAccumulation=P9.HistogramAggregator=P9.HistogramAccumulation=P9.DropAggregator=void 0;var xq0=tk();Object.defineProperty(P9,"DropAggregator",{enumerable:!0,get:function(){return xq0.DropAggregator}});var dy=Zy();Object.defineProperty(P9,"HistogramAccumulation",{enumerable:!0,get:function(){return dy.HistogramAccumulation}});Object.defineProperty(P9,"HistogramAggregator",{enumerable:!0,get:function(){return dy.HistogramAggregator}});var cy=vy();Object.defineProperty(P9,"ExponentialHistogramAccumulation",{enumerable:!0,get:function(){return cy.ExponentialHistogramAccumulation}});Object.defineProperty(P9,"ExponentialHistogramAggregator",{enumerable:!0,get:function(){return cy.ExponentialHistogramAggregator}});var ly=xy();Object.defineProperty(P9,"LastValueAccumulation",{enumerable:!0,get:function(){return ly.LastValueAccumulation}});Object.defineProperty(P9,"LastValueAggregator",{enumerable:!0,get:function(){return ly.LastValueAggregator}});var ny=gy();Object.defineProperty(P9,"SumAccumulation",{enumerable:!0,get:function(){return ny.SumAccumulation}});Object.defineProperty(P9,"SumAggregator",{enumerable:!0,get:function(){return ny.SumAggregator}})});var ey=H0((iy)=>{Object.defineProperty(iy,"__esModule",{value:!0});iy.DEFAULT_AGGREGATION=iy.EXPONENTIAL_HISTOGRAM_AGGREGATION=iy.HISTOGRAM_AGGREGATION=iy.LAST_VALUE_AGGREGATION=iy.SUM_AGGREGATION=iy.DROP_AGGREGATION=iy.DefaultAggregation=iy.ExponentialHistogramAggregation=iy.ExplicitBucketHistogramAggregation=iy.HistogramAggregation=iy.LastValueAggregation=iy.SumAggregation=iy.DropAggregation=void 0;var uq0=f1(),a5=py(),i9=r4();class cJ{static DEFAULT_INSTANCE=new a5.DropAggregator;createAggregator(Y){return cJ.DEFAULT_INSTANCE}}iy.DropAggregation=cJ;class tZ{static MONOTONIC_INSTANCE=new a5.SumAggregator(!0);static NON_MONOTONIC_INSTANCE=new a5.SumAggregator(!1);createAggregator(Y){switch(Y.type){case i9.InstrumentType.COUNTER:case i9.InstrumentType.OBSERVABLE_COUNTER:case i9.InstrumentType.HISTOGRAM:return tZ.MONOTONIC_INSTANCE;default:return tZ.NON_MONOTONIC_INSTANCE}}}iy.SumAggregation=tZ;class lJ{static DEFAULT_INSTANCE=new a5.LastValueAggregator;createAggregator(Y){return lJ.DEFAULT_INSTANCE}}iy.LastValueAggregation=lJ;class nJ{static DEFAULT_INSTANCE=new a5.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1000,2500,5000,7500,1e4],!0);createAggregator(Y){return nJ.DEFAULT_INSTANCE}}iy.HistogramAggregation=nJ;class pH{_boundaries;_recordMinMax;constructor(Y,Z=!0){if(Y==null)throw Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");Y=Y.concat(),Y=Y.sort((F,X)=>F-X);let W=Y.lastIndexOf(-1/0),H=Y.indexOf(1/0);if(H===-1)H=void 0;this._boundaries=Y.slice(W+1,H),this._recordMinMax=Z}createAggregator(Y){return new a5.HistogramAggregator(this._boundaries,this._recordMinMax)}}iy.ExplicitBucketHistogramAggregation=pH;class iH{_maxSize;_recordMinMax;constructor(Y=160,Z=!0){this._maxSize=Y,this._recordMinMax=Z}createAggregator(Y){return new a5.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}}iy.ExponentialHistogramAggregation=iH;class rH{_resolve(Y){switch(Y.type){case i9.InstrumentType.COUNTER:case i9.InstrumentType.UP_DOWN_COUNTER:case i9.InstrumentType.OBSERVABLE_COUNTER:case i9.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return iy.SUM_AGGREGATION;case i9.InstrumentType.GAUGE:case i9.InstrumentType.OBSERVABLE_GAUGE:return iy.LAST_VALUE_AGGREGATION;case i9.InstrumentType.HISTOGRAM:{if(Y.advice.explicitBucketBoundaries)return new pH(Y.advice.explicitBucketBoundaries);return iy.HISTOGRAM_AGGREGATION}}return uq0.diag.warn(`Unable to recognize instrument type: ${Y.type}`),iy.DROP_AGGREGATION}createAggregator(Y){return this._resolve(Y).createAggregator(Y)}}iy.DefaultAggregation=rH;iy.DROP_AGGREGATION=new cJ;iy.SUM_AGGREGATION=new tZ;iy.LAST_VALUE_AGGREGATION=new lJ;iy.HISTOGRAM_AGGREGATION=new nJ;iy.EXPONENTIAL_HISTOGRAM_AGGREGATION=new iH;iy.DEFAULT_AGGREGATION=new rH});var sZ=H0((Zv)=>{Object.defineProperty(Zv,"__esModule",{value:!0});Zv.toAggregation=Zv.AggregationType=void 0;var o5=ey(),t5;(function(Y){Y[Y.DEFAULT=0]="DEFAULT",Y[Y.DROP=1]="DROP",Y[Y.SUM=2]="SUM",Y[Y.LAST_VALUE=3]="LAST_VALUE",Y[Y.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",Y[Y.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(t5=Zv.AggregationType||(Zv.AggregationType={}));function rq0(Y){switch(Y.type){case t5.DEFAULT:return o5.DEFAULT_AGGREGATION;case t5.DROP:return o5.DROP_AGGREGATION;case t5.SUM:return o5.SUM_AGGREGATION;case t5.LAST_VALUE:return o5.LAST_VALUE_AGGREGATION;case t5.EXPONENTIAL_HISTOGRAM:{let Z=Y;return new o5.ExponentialHistogramAggregation(Z.options?.maxSize,Z.options?.recordMinMax)}case t5.EXPLICIT_BUCKET_HISTOGRAM:{let Z=Y;if(Z.options==null)return o5.HISTOGRAM_AGGREGATION;else return new o5.ExplicitBucketHistogramAggregation(Z.options?.boundaries,Z.options?.recordMinMax)}default:throw Error("Unsupported Aggregation")}}Zv.toAggregation=rq0});var aH=H0((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});Xv.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Xv.DEFAULT_AGGREGATION_SELECTOR=void 0;var aq0=bJ(),oq0=sZ(),tq0=(Y)=>{return{type:oq0.AggregationType.DEFAULT}};Xv.DEFAULT_AGGREGATION_SELECTOR=tq0;var sq0=(Y)=>aq0.AggregationTemporality.CUMULATIVE;Xv.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=sq0});var oH=H0((Hv)=>{Object.defineProperty(Hv,"__esModule",{value:!0});Hv.MetricReader=void 0;var Wv=f1(),Kv=p9(),Gv=aH();class Fv{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(Y){this._aggregationSelector=Y?.aggregationSelector??Gv.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=Y?.aggregationTemporalitySelector??Gv.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=Y?.metricProducers??[],this._cardinalitySelector=Y?.cardinalitySelector}setMetricProducer(Y){if(this._sdkMetricProducer)throw Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=Y,this.onInitialized()}selectAggregation(Y){return this._aggregationSelector(Y)}selectAggregationTemporality(Y){return this._aggregationTemporalitySelector(Y)}selectCardinalityLimit(Y){return this._cardinalitySelector?this._cardinalitySelector(Y):2000}onInitialized(){}async collect(Y){if(this._sdkMetricProducer===void 0)throw Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw Error("MetricReader is shutdown");let[Z,...W]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:Y?.timeoutMillis}),...this._metricProducers.map((J)=>J.collect({timeoutMillis:Y?.timeoutMillis}))]),H=Z.errors.concat(W.flatMap((J)=>J.errors)),F=Z.resourceMetrics.resource,X=Z.resourceMetrics.scopeMetrics.concat(W.flatMap((J)=>J.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:F,scopeMetrics:X},errors:H}}async shutdown(Y){if(this._shutdown){Wv.diag.error("Cannot call shutdown twice.");return}if(Y?.timeoutMillis==null)await this.onShutdown();else await(0,Kv.callWithTimeout)(this.onShutdown(),Y.timeoutMillis);this._shutdown=!0}async forceFlush(Y){if(this._shutdown){Wv.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(Y?.timeoutMillis==null){await this.onForceFlush();return}await(0,Kv.callWithTimeout)(this.onForceFlush(),Y.timeoutMillis)}}Hv.MetricReader=Fv});var Uv=H0((Bv)=>{Object.defineProperty(Bv,"__esModule",{value:!0});Bv.PeriodicExportingMetricReader=void 0;var pJ=f1(),iJ=G6(),Yz0=oH(),qv=p9();class zv extends Yz0.MetricReader{_interval;_exporter;_exportInterval;_exportTimeout;constructor(Y){let{exporter:Z,exportIntervalMillis:W=60000,metricProducers:H}=Y,{exportTimeoutMillis:F=30000}=Y;super({aggregationSelector:Z.selectAggregation?.bind(Z),aggregationTemporalitySelector:Z.selectAggregationTemporality?.bind(Z),metricProducers:H});if(W<=0)throw Error("exportIntervalMillis must be greater than 0");if(F<=0)throw Error("exportTimeoutMillis must be greater than 0");if(W<F)if("exportIntervalMillis"in Y&&"exportTimeoutMillis"in Y)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");else pJ.diag.info(`Timeout of ${F} exceeds the interval of ${W}. Clamping timeout to interval duration.`),F=W;this._exportInterval=W,this._exportTimeout=F,this._exporter=Z}async _runOnce(){try{await(0,qv.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(Y){if(Y instanceof qv.TimeoutError){pJ.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,iJ.globalErrorHandler)(Y)}}async _doRun(){let{resourceMetrics:Y,errors:Z}=await this.collect({timeoutMillis:this._exportTimeout});if(Z.length>0)pJ.diag.error("PeriodicExportingMetricReader: metrics collection errors",...Z);if(Y.resource.asyncAttributesPending)try{await Y.resource.waitForAsyncAttributes?.()}catch(H){pJ.diag.debug("Error while resolving async portion of resource: ",H),(0,iJ.globalErrorHandler)(H)}if(Y.scopeMetrics.length===0)return;let W=await iJ.internal._export(this._exporter,Y);if(W.code!==iJ.ExportResultCode.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${W.error})`)}onInitialized(){if(this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=="number")this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){if(this._interval)clearInterval(this._interval);await this.onForceFlush(),await this._exporter.shutdown()}}Bv.PeriodicExportingMetricReader=zv});var Iv=H0((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});Dv.InMemoryMetricExporter=void 0;var Nv=G6();class Ov{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(Y){this._aggregationTemporality=Y}export(Y,Z){if(this._shutdown){setTimeout(()=>Z({code:Nv.ExportResultCode.FAILED}),0);return}this._metrics.push(Y),setTimeout(()=>Z({code:Nv.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(Y){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}Dv.InMemoryMetricExporter=Ov});var Mv=H0((Cv)=>{Object.defineProperty(Cv,"__esModule",{value:!0});Cv.ConsoleMetricExporter=void 0;var $v=G6(),Zz0=aH();class tH{_shutdown=!1;_temporalitySelector;constructor(Y){this._temporalitySelector=Y?.temporalitySelector??Zz0.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(Y,Z){if(this._shutdown){Z({code:$v.ExportResultCode.FAILED});return}return tH._sendMetrics(Y,Z)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(Y){return this._temporalitySelector(Y)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(Y,Z){for(let W of Y.scopeMetrics)for(let H of W.metrics)console.dir({descriptor:H.descriptor,dataPointType:H.dataPointType,dataPoints:H.dataPoints},{depth:null});Z({code:$v.ExportResultCode.SUCCESS})}}Cv.ConsoleMetricExporter=tH});var sH=H0((Rv)=>{Object.defineProperty(Rv,"__esModule",{value:!0});Rv._clearDefaultServiceNameCache=Rv.defaultServiceName=void 0;var eZ;function Qz0(){if(eZ===void 0)try{let Y=globalThis.process.argv0;eZ=Y?`unknown_service:${Y}`:"unknown_service"}catch{eZ="unknown_service"}return eZ}Rv.defaultServiceName=Qz0;function Xz0(){eZ=void 0}Rv._clearDefaultServiceNameCache=Xz0});var Sv=H0((Lv)=>{Object.defineProperty(Lv,"__esModule",{value:!0});Lv.isPromiseLike=void 0;var Wz0=(Y)=>{return Y!==null&&typeof Y==="object"&&typeof Y.then==="function"};Lv.isPromiseLike=Wz0});var ZV=H0((kv)=>{Object.defineProperty(kv,"__esModule",{value:!0});kv.defaultResource=kv.emptyResource=kv.resourceFromDetectedResource=kv.resourceFromAttributes=void 0;var ZQ=f1(),eH=G6(),s5=m5(),Kz0=sH(),YQ=Sv();class QQ{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(Y,Z){let W=new QQ({},Z);return W._rawAttributes=fv(Y),W._asyncAttributesPending=Y.filter(([H,F])=>(0,YQ.isPromiseLike)(F)).length>0,W}constructor(Y,Z){let W=Y.attributes??{};this._rawAttributes=Object.entries(W).map(([H,F])=>{if((0,YQ.isPromiseLike)(F))this._asyncAttributesPending=!0;return[H,F]}),this._rawAttributes=fv(this._rawAttributes),this._schemaUrl=Vz0(Z?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(!this.asyncAttributesPending)return;for(let Y=0;Y<this._rawAttributes.length;Y++){let[Z,W]=this._rawAttributes[Y];this._rawAttributes[Y]=[Z,(0,YQ.isPromiseLike)(W)?await W:W]}this._asyncAttributesPending=!1}get attributes(){if(this.asyncAttributesPending)ZQ.diag.error("Accessing resource attributes before async attributes settled");if(this._memoizedAttributes)return this._memoizedAttributes;let Y={};for(let[Z,W]of this._rawAttributes){if((0,YQ.isPromiseLike)(W)){ZQ.diag.debug(`Unsettled resource attribute ${Z} skipped`);continue}if(W!=null)Y[Z]??=W}if(!this._asyncAttributesPending)this._memoizedAttributes=Y;return Y}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(Y){if(Y==null)return this;let Z=qz0(this,Y),W=Z?{schemaUrl:Z}:void 0;return QQ.FromAttributeList([...Y.getRawAttributes(),...this.getRawAttributes()],W)}}function YV(Y,Z){return QQ.FromAttributeList(Object.entries(Y),Z)}kv.resourceFromAttributes=YV;function Gz0(Y,Z){return new QQ(Y,Z)}kv.resourceFromDetectedResource=Gz0;function Fz0(){return YV({})}kv.emptyResource=Fz0;function Hz0(){return YV({[s5.ATTR_SERVICE_NAME]:(0,Kz0.defaultServiceName)(),[s5.ATTR_TELEMETRY_SDK_LANGUAGE]:eH.SDK_INFO[s5.ATTR_TELEMETRY_SDK_LANGUAGE],[s5.ATTR_TELEMETRY_SDK_NAME]:eH.SDK_INFO[s5.ATTR_TELEMETRY_SDK_NAME],[s5.ATTR_TELEMETRY_SDK_VERSION]:eH.SDK_INFO[s5.ATTR_TELEMETRY_SDK_VERSION]})}kv.defaultResource=Hz0;function fv(Y){return Y.map(([Z,W])=>{if((0,YQ.isPromiseLike)(W))return[Z,W.catch((H)=>{ZQ.diag.debug("promise rejection for resource attribute: %s - %s",Z,H);return})];return[Z,W]})}function Vz0(Y){if(typeof Y==="string"||Y===void 0)return Y;ZQ.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",Y);return}function qz0(Y,Z){let W=Y?.schemaUrl,H=Z?.schemaUrl,F=W===void 0||W==="",X=H===void 0||H==="";if(F)return H;if(X)return W;if(W===H)return W;ZQ.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',W,H);return}});var _v=H0((hv)=>{Object.defineProperty(hv,"__esModule",{value:!0});hv.detectResources=void 0;var vv=f1(),QV=ZV(),Uz0=(Y={})=>{return(Y.detectors||[]).map((W)=>{try{let H=(0,QV.resourceFromDetectedResource)(W.detect(Y));return vv.diag.debug(`${W.constructor.name} found resource.`,H),H}catch(H){return vv.diag.debug(`${W.constructor.name} failed: ${H.message}`),(0,QV.emptyResource)()}}).reduce((W,H)=>W.merge(H),(0,QV.emptyResource)())};hv.detectResources=Uz0});var gv=H0((uv)=>{Object.defineProperty(uv,"__esModule",{value:!0});uv.envDetector=void 0;var Nz0=f1(),Oz0=m5(),xv=G6();class bv{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";detect(Y){let Z={},W=(0,xv.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),H=(0,xv.getStringFromEnv)("OTEL_SERVICE_NAME");if(W)try{let F=this._parseResourceAttributes(W);Object.assign(Z,F)}catch(F){Nz0.diag.debug(`EnvDetector failed: ${F instanceof Error?F.message:F}`)}if(H)Z[Oz0.ATTR_SERVICE_NAME]=H;return{attributes:Z}}_parseResourceAttributes(Y){if(!Y)return{};let Z={},W=Y.split(this._COMMA_SEPARATOR);for(let H of W){let F=H.split(this._LABEL_KEY_VALUE_SPLITTER);if(F.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${H}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[X,J]=F,Q=X.trim(),G=J.trim();if(Q.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${H}".`);let q,K;try{q=decodeURIComponent(Q),K=decodeURIComponent(G)}catch(V){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${H}": ${V instanceof Error?V.message:V}`)}if(q.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${q}".`);if(K.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${q}".`);Z[q]=K}return Z}}uv.envDetector=new bv});var XQ=H0((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});dv.ATTR_WEBENGINE_VERSION=dv.ATTR_WEBENGINE_NAME=dv.ATTR_WEBENGINE_DESCRIPTION=dv.ATTR_SERVICE_NAMESPACE=dv.ATTR_SERVICE_INSTANCE_ID=dv.ATTR_PROCESS_RUNTIME_VERSION=dv.ATTR_PROCESS_RUNTIME_NAME=dv.ATTR_PROCESS_RUNTIME_DESCRIPTION=dv.ATTR_PROCESS_PID=dv.ATTR_PROCESS_OWNER=dv.ATTR_PROCESS_EXECUTABLE_PATH=dv.ATTR_PROCESS_EXECUTABLE_NAME=dv.ATTR_PROCESS_COMMAND_ARGS=dv.ATTR_PROCESS_COMMAND=dv.ATTR_OS_VERSION=dv.ATTR_OS_TYPE=dv.ATTR_K8S_POD_NAME=dv.ATTR_K8S_NAMESPACE_NAME=dv.ATTR_K8S_DEPLOYMENT_NAME=dv.ATTR_K8S_CLUSTER_NAME=dv.ATTR_HOST_TYPE=dv.ATTR_HOST_NAME=dv.ATTR_HOST_IMAGE_VERSION=dv.ATTR_HOST_IMAGE_NAME=dv.ATTR_HOST_IMAGE_ID=dv.ATTR_HOST_ID=dv.ATTR_HOST_ARCH=dv.ATTR_CONTAINER_NAME=dv.ATTR_CONTAINER_IMAGE_TAGS=dv.ATTR_CONTAINER_IMAGE_NAME=dv.ATTR_CONTAINER_ID=dv.ATTR_CLOUD_REGION=dv.ATTR_CLOUD_PROVIDER=dv.ATTR_CLOUD_AVAILABILITY_ZONE=dv.ATTR_CLOUD_ACCOUNT_ID=void 0;dv.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";dv.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";dv.ATTR_CLOUD_PROVIDER="cloud.provider";dv.ATTR_CLOUD_REGION="cloud.region";dv.ATTR_CONTAINER_ID="container.id";dv.ATTR_CONTAINER_IMAGE_NAME="container.image.name";dv.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";dv.ATTR_CONTAINER_NAME="container.name";dv.ATTR_HOST_ARCH="host.arch";dv.ATTR_HOST_ID="host.id";dv.ATTR_HOST_IMAGE_ID="host.image.id";dv.ATTR_HOST_IMAGE_NAME="host.image.name";dv.ATTR_HOST_IMAGE_VERSION="host.image.version";dv.ATTR_HOST_NAME="host.name";dv.ATTR_HOST_TYPE="host.type";dv.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";dv.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";dv.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";dv.ATTR_K8S_POD_NAME="k8s.pod.name";dv.ATTR_OS_TYPE="os.type";dv.ATTR_OS_VERSION="os.version";dv.ATTR_PROCESS_COMMAND="process.command";dv.ATTR_PROCESS_COMMAND_ARGS="process.command_args";dv.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";dv.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";dv.ATTR_PROCESS_OWNER="process.owner";dv.ATTR_PROCESS_PID="process.pid";dv.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";dv.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";dv.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";dv.ATTR_SERVICE_INSTANCE_ID="service.instance.id";dv.ATTR_SERVICE_NAMESPACE="service.namespace";dv.ATTR_WEBENGINE_DESCRIPTION="webengine.description";dv.ATTR_WEBENGINE_NAME="webengine.name";dv.ATTR_WEBENGINE_VERSION="webengine.version"});var rJ=H0((lv)=>{Object.defineProperty(lv,"__esModule",{value:!0});lv.execAsync=void 0;var sz0=V1("child_process"),ez0=V1("util");lv.execAsync=ez0.promisify(sz0.exec)});var rv=H0((pv)=>{Object.defineProperty(pv,"__esModule",{value:!0});pv.getMachineId=void 0;var YB0=rJ(),ZB0=f1();async function QB0(){try{let Z=(await(0,YB0.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
1
+ import{createRequire as i60}from"node:module";var x60=Object.create;var{getPrototypeOf:b60,defineProperty:sG,getOwnPropertyNames:u60}=Object;var m60=Object.prototype.hasOwnProperty;function g60(Y){return this[Y]}var d60,c60,y6=(Y,Z,W)=>{var H=Y!=null&&typeof Y==="object";if(H){var F=Z?d60??=new WeakMap:c60??=new WeakMap,X=F.get(Y);if(X)return X}W=Y!=null?x60(b60(Y)):{};let J=Z||!Y||!Y.__esModule?sG(W,"default",{value:Y,enumerable:!0}):W;for(let Q of u60(Y))if(!m60.call(J,Q))sG(J,Q,{get:g60.bind(Y,Q),enumerable:!0});if(H)F.set(Y,J);return J};var H0=(Y,Z)=>()=>(Z||Y((Z={exports:{}}).exports,Z),Z.exports);var l60=(Y)=>Y;function n60(Y,Z){this[Y]=l60.bind(null,Z)}var p60=(Y,Z)=>{for(var W in Z)sG(Y,W,{get:Z[W],enumerable:!0,configurable:!0,set:n60.bind(Z,W)})};var n7=(Y,Z)=>()=>(Y&&(Z=Y(Y=0)),Z);var V1=i60(import.meta.url);class fZ{name;metadata;meter;logger;enabled;distinctId;commonProperties;counters=new Map;histograms=new Map;gauges=new Map;gaugeValues=new Map;meterProvider;loggerProvider;constructor(Y){this.name=Y.name??"OpenTelemetryAdapter",this.metadata={...Y.metadata},this.meterProvider=Y.meterProvider,this.loggerProvider=Y.loggerProvider,this.meter=Y.meterProvider?.getMeter("cline")??null,this.logger=Y.loggerProvider?.getLogger("cline")??null,this.enabled=Y.enabled??!0,this.distinctId=Y.distinctId,this.commonProperties=Y.commonProperties?{...Y.commonProperties}:{}}emit(Y,Z){if(!this.isEnabled())return;this.emitLog(Y,Z,!1)}emitRequired(Y,Z){this.emitLog(Y,Z,!0)}recordCounter(Y,Z,W,H,F=!1){if(!this.meter||!F&&!this.isEnabled())return;let X=this.counters.get(Y);if(!X)X=this.meter.createCounter(Y,H?{description:H}:void 0),this.counters.set(Y,X);X.add(Z,this.flattenProperties(this.buildAttributes(W)))}recordHistogram(Y,Z,W,H,F=!1){if(!this.meter||!F&&!this.isEnabled())return;let X=this.histograms.get(Y);if(!X)X=this.meter.createHistogram(Y,H?{description:H}:void 0),this.histograms.set(Y,X);X.record(Z,this.flattenProperties(this.buildAttributes(W)))}recordGauge(Y,Z,W,H,F=!1){if(!this.meter||!F&&!this.isEnabled())return;let X=this.buildAttributes(W),J=JSON.stringify(X),Q=this.gaugeValues.get(Y);if(Z===null){if(Q){if(Q.delete(J),Q.size===0)this.gaugeValues.delete(Y),this.gauges.delete(Y)}return}let G=Q;if(!G)G=new Map,this.gaugeValues.set(Y,G);if(!this.gauges.has(Y)){let q=this.meter.createObservableGauge(Y,H?{description:H}:void 0);q.addCallback((K)=>{for(let V of this.snapshotGaugeSeries(Y))K.observe(V.value,this.flattenProperties(V.attributes))}),this.gauges.set(Y,q)}G.set(J,{value:Z,attributes:X})}isEnabled(){return typeof this.enabled==="function"?this.enabled():this.enabled}setDistinctId(Y){this.distinctId=Y}setCommonProperties(Y){this.commonProperties={...Y}}updateCommonProperties(Y){this.commonProperties={...this.commonProperties,...Y}}async flush(){await Promise.all([this.meterProvider?.forceFlush?.(),this.loggerProvider?.forceFlush?.()])}async dispose(){await Promise.all([this.meterProvider?.shutdown?.(),this.loggerProvider?.shutdown?.()])}emitLog(Y,Z,W){if(!this.logger)return;let H=this.flattenProperties(this.buildAttributes(Z,W));this.logger.emit({severityText:"INFO",body:Y,attributes:H})}buildAttributes(Y,Z=!1){return{...this.commonProperties,...this.metadata,...Y,...this.distinctId?{distinct_id:this.distinctId}:{},...Z?{_required:!0}:{}}}snapshotGaugeSeries(Y){let Z=this.gaugeValues.get(Y);if(!Z)return[];return Array.from(Z.values(),(W)=>({value:W.value,attributes:W.attributes?{...W.attributes}:void 0}))}flattenProperties(Y,Z="",W=new WeakSet,H=0){if(!Y)return{};let F={},X=100,J=10;for(let[Q,G]of Object.entries(Y)){if(Q==="__proto__"||Q==="constructor"||Q==="prototype")continue;let q=Z?`${Z}.${Q}`:Q;if(G===null||G===void 0){F[q]=String(G);continue}if(Array.isArray(G)){let K=G.length>X?G.slice(0,X):G;try{F[q]=JSON.stringify(K)}catch{F[q]="[UnserializableArray]"}if(G.length>X)F[`${q}_truncated`]=!0,F[`${q}_original_length`]=G.length;continue}if(typeof G==="object"){if(G instanceof Date){F[q]=G.toISOString();continue}if(G instanceof Error){F[q]=G.message;continue}if(W.has(G)){F[q]="[Circular]";continue}if(H>=J){F[q]="[MaxDepthExceeded]";continue}W.add(G),Object.assign(F,this.flattenProperties(G,q,W,H+1));continue}if(r60(G)){F[q]=G;continue}try{F[q]=JSON.stringify(G)}catch{F[q]=String(G)}}return F}}function r60(Y){return typeof Y==="string"||typeof Y==="number"||typeof Y==="boolean"}var YF=H0((_O)=>{Object.defineProperty(_O,"__esModule",{value:!0});_O.VERSION=void 0;_O.VERSION="1.9.1"});var dO=H0((mO)=>{Object.defineProperty(mO,"__esModule",{value:!0});mO.isCompatible=mO._makeCompatibilityCheck=void 0;var a60=YF(),bO=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function uO(Y){let Z=new Set([Y]),W=new Set,H=Y.match(bO);if(!H)return()=>!1;let F={major:+H[1],minor:+H[2],patch:+H[3],prerelease:H[4]};if(F.prerelease!=null)return function(G){return G===Y};function X(Q){return W.add(Q),!1}function J(Q){return Z.add(Q),!0}return function(G){if(Z.has(G))return!0;if(W.has(G))return!1;let q=G.match(bO);if(!q)return X(G);let K={major:+q[1],minor:+q[2],patch:+q[3],prerelease:q[4]};if(K.prerelease!=null)return X(G);if(F.major!==K.major)return X(G);if(F.major===0){if(F.minor===K.minor&&F.patch<=K.patch)return J(G);return X(G)}if(F.minor<=K.minor)return J(G);return X(G)}}mO._makeCompatibilityCheck=uO;mO.isCompatible=uO(a60.VERSION)});var h5=H0((cO)=>{Object.defineProperty(cO,"__esModule",{value:!0});cO.unregisterGlobal=cO.getGlobal=cO.registerGlobal=void 0;var p7=YF(),t60=dO(),s60=p7.VERSION.split(".")[0],kZ=Symbol.for(`opentelemetry.js.api.${s60}`),yZ=typeof globalThis==="object"?globalThis:typeof self==="object"?self:typeof window==="object"?window:typeof global==="object"?global:{};function e60(Y,Z,W,H=!1){var F;let X=yZ[kZ]=(F=yZ[kZ])!==null&&F!==void 0?F:{version:p7.VERSION};if(!H&&X[Y]){let J=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${Y}`);return W.error(J.stack||J.message),!1}if(X.version!==p7.VERSION){let J=Error(`@opentelemetry/api: Registration of version v${X.version} for ${Y} does not match previously registered API v${p7.VERSION}`);return W.error(J.stack||J.message),!1}return X[Y]=Z,W.debug(`@opentelemetry/api: Registered a global for ${Y} v${p7.VERSION}.`),!0}cO.registerGlobal=e60;function Y80(Y){var Z,W;let H=(Z=yZ[kZ])===null||Z===void 0?void 0:Z.version;if(!H||!(0,t60.isCompatible)(H))return;return(W=yZ[kZ])===null||W===void 0?void 0:W[Y]}cO.getGlobal=Y80;function Z80(Y,Z){Z.debug(`@opentelemetry/api: Unregistering a global for ${Y} v${p7.VERSION}.`);let W=yZ[kZ];if(W)delete W[Y]}cO.unregisterGlobal=Z80});var rO=H0((pO)=>{Object.defineProperty(pO,"__esModule",{value:!0});pO.DiagComponentLogger=void 0;var J80=h5();class nO{constructor(Y){this._namespace=Y.namespace||"DiagComponentLogger"}debug(...Y){return vZ("debug",this._namespace,Y)}error(...Y){return vZ("error",this._namespace,Y)}info(...Y){return vZ("info",this._namespace,Y)}warn(...Y){return vZ("warn",this._namespace,Y)}verbose(...Y){return vZ("verbose",this._namespace,Y)}}pO.DiagComponentLogger=nO;function vZ(Y,Z,W){let H=(0,J80.getGlobal)("diag");if(!H)return;return H[Y](Z,...W)}});var JJ=H0((aO)=>{Object.defineProperty(aO,"__esModule",{value:!0});aO.DiagLogLevel=void 0;var W80;(function(Y){Y[Y.NONE=0]="NONE",Y[Y.ERROR=30]="ERROR",Y[Y.WARN=50]="WARN",Y[Y.INFO=60]="INFO",Y[Y.DEBUG=70]="DEBUG",Y[Y.VERBOSE=80]="VERBOSE",Y[Y.ALL=9999]="ALL"})(W80=aO.DiagLogLevel||(aO.DiagLogLevel={}))});var sO=H0((oO)=>{Object.defineProperty(oO,"__esModule",{value:!0});oO.createLogLevelDiagLogger=void 0;var D4=JJ();function K80(Y,Z){if(Y<D4.DiagLogLevel.NONE)Y=D4.DiagLogLevel.NONE;else if(Y>D4.DiagLogLevel.ALL)Y=D4.DiagLogLevel.ALL;Z=Z||{};function W(H,F){let X=Z[H];if(typeof X==="function"&&Y>=F)return X.bind(Z);return function(){}}return{error:W("error",D4.DiagLogLevel.ERROR),warn:W("warn",D4.DiagLogLevel.WARN),info:W("info",D4.DiagLogLevel.INFO),debug:W("debug",D4.DiagLogLevel.DEBUG),verbose:W("verbose",D4.DiagLogLevel.VERBOSE)}}oO.createLogLevelDiagLogger=K80});var j5=H0((YD)=>{Object.defineProperty(YD,"__esModule",{value:!0});YD.DiagAPI=void 0;var G80=rO(),F80=sO(),eO=JJ(),WJ=h5(),H80="diag";class QF{static instance(){if(!this._instance)this._instance=new QF;return this._instance}constructor(){function Y(H){return function(...F){let X=(0,WJ.getGlobal)("diag");if(!X)return;return X[H](...F)}}let Z=this,W=(H,F={logLevel:eO.DiagLogLevel.INFO})=>{var X,J,Q;if(H===Z){let K=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return Z.error((X=K.stack)!==null&&X!==void 0?X:K.message),!1}if(typeof F==="number")F={logLevel:F};let G=(0,WJ.getGlobal)("diag"),q=(0,F80.createLogLevelDiagLogger)((J=F.logLevel)!==null&&J!==void 0?J:eO.DiagLogLevel.INFO,H);if(G&&!F.suppressOverrideMessage){let K=(Q=Error().stack)!==null&&Q!==void 0?Q:"<failed to generate stacktrace>";G.warn(`Current logger will be overwritten from ${K}`),q.warn(`Current logger will overwrite one already registered from ${K}`)}return(0,WJ.registerGlobal)("diag",q,Z,!0)};Z.setLogger=W,Z.disable=()=>{(0,WJ.unregisterGlobal)(H80,Z)},Z.createComponentLogger=(H)=>{return new G80.DiagComponentLogger(H)},Z.verbose=Y("verbose"),Z.debug=Y("debug"),Z.info=Y("info"),Z.warn=Y("warn"),Z.error=Y("error")}}YD.DiagAPI=QF});var JD=H0((QD)=>{Object.defineProperty(QD,"__esModule",{value:!0});QD.BaggageImpl=void 0;class i7{constructor(Y){this._entries=Y?new Map(Y):new Map}getEntry(Y){let Z=this._entries.get(Y);if(!Z)return;return Object.assign({},Z)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(Y,Z){let W=new i7(this._entries);return W._entries.set(Y,Z),W}removeEntry(Y){let Z=new i7(this._entries);return Z._entries.delete(Y),Z}removeEntries(...Y){let Z=new i7(this._entries);for(let W of Y)Z._entries.delete(W);return Z}clear(){return new i7}}QD.BaggageImpl=i7});var GD=H0((WD)=>{Object.defineProperty(WD,"__esModule",{value:!0});WD.baggageEntryMetadataSymbol=void 0;WD.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var XF=H0((FD)=>{Object.defineProperty(FD,"__esModule",{value:!0});FD.baggageEntryMetadataFromString=FD.createBaggage=void 0;var V80=j5(),q80=JD(),z80=GD(),B80=V80.DiagAPI.instance();function A80(Y={}){return new q80.BaggageImpl(new Map(Object.entries(Y)))}FD.createBaggage=A80;function U80(Y){if(typeof Y!=="string")B80.error(`Cannot create baggage metadata from unknown type: ${typeof Y}`),Y="";return{__TYPE__:z80.baggageEntryMetadataSymbol,toString(){return Y}}}FD.baggageEntryMetadataFromString=U80});var hZ=H0((VD)=>{Object.defineProperty(VD,"__esModule",{value:!0});VD.ROOT_CONTEXT=VD.createContextKey=void 0;function O80(Y){return Symbol.for(Y)}VD.createContextKey=O80;class KJ{constructor(Y){let Z=this;Z._currentContext=Y?new Map(Y):new Map,Z.getValue=(W)=>Z._currentContext.get(W),Z.setValue=(W,H)=>{let F=new KJ(Z._currentContext);return F._currentContext.set(W,H),F},Z.deleteValue=(W)=>{let H=new KJ(Z._currentContext);return H._currentContext.delete(W),H}}}VD.ROOT_CONTEXT=new KJ});var UD=H0((BD)=>{Object.defineProperty(BD,"__esModule",{value:!0});BD.DiagConsoleLogger=BD._originalConsoleMethods=void 0;var JF=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];BD._originalConsoleMethods={};if(typeof console<"u"){let Y=["error","warn","info","debug","trace","log"];for(let Z of Y)if(typeof console[Z]==="function")BD._originalConsoleMethods[Z]=console[Z]}class zD{constructor(){function Y(Z){return function(...W){let H=BD._originalConsoleMethods[Z];if(typeof H!=="function")H=BD._originalConsoleMethods.log;if(typeof H!=="function"&&console){if(H=console[Z],typeof H!=="function")H=console.log}if(typeof H==="function")return H.apply(console,W)}}for(let Z=0;Z<JF.length;Z++)this[JF[Z].n]=Y(JF[Z].c)}}BD.DiagConsoleLogger=zD});var BF=H0((ND)=>{Object.defineProperty(ND,"__esModule",{value:!0});ND.createNoopMeter=ND.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=ND.NOOP_OBSERVABLE_GAUGE_METRIC=ND.NOOP_OBSERVABLE_COUNTER_METRIC=ND.NOOP_UP_DOWN_COUNTER_METRIC=ND.NOOP_HISTOGRAM_METRIC=ND.NOOP_GAUGE_METRIC=ND.NOOP_COUNTER_METRIC=ND.NOOP_METER=ND.NoopObservableUpDownCounterMetric=ND.NoopObservableGaugeMetric=ND.NoopObservableCounterMetric=ND.NoopObservableMetric=ND.NoopHistogramMetric=ND.NoopGaugeMetric=ND.NoopUpDownCounterMetric=ND.NoopCounterMetric=ND.NoopMetric=ND.NoopMeter=void 0;class WF{constructor(){}createGauge(Y,Z){return ND.NOOP_GAUGE_METRIC}createHistogram(Y,Z){return ND.NOOP_HISTOGRAM_METRIC}createCounter(Y,Z){return ND.NOOP_COUNTER_METRIC}createUpDownCounter(Y,Z){return ND.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(Y,Z){return ND.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(Y,Z){return ND.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(Y,Z){return ND.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(Y,Z){}removeBatchObservableCallback(Y){}}ND.NoopMeter=WF;class r7{}ND.NoopMetric=r7;class KF extends r7{add(Y,Z){}}ND.NoopCounterMetric=KF;class GF extends r7{add(Y,Z){}}ND.NoopUpDownCounterMetric=GF;class FF extends r7{record(Y,Z){}}ND.NoopGaugeMetric=FF;class HF extends r7{record(Y,Z){}}ND.NoopHistogramMetric=HF;class jZ{addCallback(Y){}removeCallback(Y){}}ND.NoopObservableMetric=jZ;class VF extends jZ{}ND.NoopObservableCounterMetric=VF;class qF extends jZ{}ND.NoopObservableGaugeMetric=qF;class zF extends jZ{}ND.NoopObservableUpDownCounterMetric=zF;ND.NOOP_METER=new WF;ND.NOOP_COUNTER_METRIC=new KF;ND.NOOP_GAUGE_METRIC=new FF;ND.NOOP_HISTOGRAM_METRIC=new HF;ND.NOOP_UP_DOWN_COUNTER_METRIC=new GF;ND.NOOP_OBSERVABLE_COUNTER_METRIC=new VF;ND.NOOP_OBSERVABLE_GAUGE_METRIC=new qF;ND.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new zF;function T80(){return ND.NOOP_METER}ND.createNoopMeter=T80});var LD=H0((PD)=>{Object.defineProperty(PD,"__esModule",{value:!0});PD.ValueType=void 0;var f80;(function(Y){Y[Y.INT=0]="INT",Y[Y.DOUBLE=1]="DOUBLE"})(f80=PD.ValueType||(PD.ValueType={}))});var UF=H0((wD)=>{Object.defineProperty(wD,"__esModule",{value:!0});wD.defaultTextMapSetter=wD.defaultTextMapGetter=void 0;wD.defaultTextMapGetter={get(Y,Z){if(Y==null)return;return Y[Z]},keys(Y){if(Y==null)return[];return Object.keys(Y)}};wD.defaultTextMapSetter={set(Y,Z,W){if(Y==null)return;Y[Z]=W}}});var vD=H0((kD)=>{Object.defineProperty(kD,"__esModule",{value:!0});kD.NoopContextManager=void 0;var y80=hZ();class fD{active(){return y80.ROOT_CONTEXT}with(Y,Z,W,...H){return Z.call(W,...H)}bind(Y,Z){return Z}enable(){return this}disable(){return this}}kD.NoopContextManager=fD});var _Z=H0((jD)=>{Object.defineProperty(jD,"__esModule",{value:!0});jD.ContextAPI=void 0;var v80=vD(),NF=h5(),hD=j5(),OF="context",h80=new v80.NoopContextManager;class DF{constructor(){}static getInstance(){if(!this._instance)this._instance=new DF;return this._instance}setGlobalContextManager(Y){return(0,NF.registerGlobal)(OF,Y,hD.DiagAPI.instance())}active(){return this._getContextManager().active()}with(Y,Z,W,...H){return this._getContextManager().with(Y,Z,W,...H)}bind(Y,Z){return this._getContextManager().bind(Y,Z)}_getContextManager(){return(0,NF.getGlobal)(OF)||h80}disable(){this._getContextManager().disable(),(0,NF.unregisterGlobal)(OF,hD.DiagAPI.instance())}}jD.ContextAPI=DF});var IF=H0((xD)=>{Object.defineProperty(xD,"__esModule",{value:!0});xD.TraceFlags=void 0;var j80;(function(Y){Y[Y.NONE=0]="NONE",Y[Y.SAMPLED=1]="SAMPLED"})(j80=xD.TraceFlags||(xD.TraceFlags={}))});var FJ=H0((bD)=>{Object.defineProperty(bD,"__esModule",{value:!0});bD.INVALID_SPAN_CONTEXT=bD.INVALID_TRACEID=bD.INVALID_SPANID=void 0;var _80=IF();bD.INVALID_SPANID="0000000000000000";bD.INVALID_TRACEID="00000000000000000000000000000000";bD.INVALID_SPAN_CONTEXT={traceId:bD.INVALID_TRACEID,spanId:bD.INVALID_SPANID,traceFlags:_80.TraceFlags.NONE}});var HJ=H0((cD)=>{Object.defineProperty(cD,"__esModule",{value:!0});cD.NonRecordingSpan=void 0;var x80=FJ();class dD{constructor(Y=x80.INVALID_SPAN_CONTEXT){this._spanContext=Y}spanContext(){return this._spanContext}setAttribute(Y,Z){return this}setAttributes(Y){return this}addEvent(Y,Z){return this}addLink(Y){return this}addLinks(Y){return this}setStatus(Y){return this}updateName(Y){return this}end(Y){}isRecording(){return!1}recordException(Y,Z){}}cD.NonRecordingSpan=dD});var EF=H0((pD)=>{Object.defineProperty(pD,"__esModule",{value:!0});pD.getSpanContext=pD.setSpanContext=pD.deleteSpan=pD.setSpan=pD.getActiveSpan=pD.getSpan=void 0;var b80=hZ(),u80=HJ(),m80=_Z(),$F=(0,b80.createContextKey)("OpenTelemetry Context Key SPAN");function CF(Y){return Y.getValue($F)||void 0}pD.getSpan=CF;function g80(){return CF(m80.ContextAPI.getInstance().active())}pD.getActiveSpan=g80;function nD(Y,Z){return Y.setValue($F,Z)}pD.setSpan=nD;function d80(Y){return Y.deleteValue($F)}pD.deleteSpan=d80;function c80(Y,Z){return nD(Y,new u80.NonRecordingSpan(Z))}pD.setSpanContext=c80;function l80(Y){var Z;return(Z=CF(Y))===null||Z===void 0?void 0:Z.spanContext()}pD.getSpanContext=l80});var qJ=H0((sD)=>{Object.defineProperty(sD,"__esModule",{value:!0});sD.wrapSpanContext=sD.isSpanContextValid=sD.isValidSpanId=sD.isValidTraceId=void 0;var rD=FJ(),o80=HJ(),VJ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function aD(Y,Z){if(typeof Y!=="string"||Y.length!==Z)return!1;let W=0;for(let H=0;H<Y.length;H+=4)W+=(VJ[Y.charCodeAt(H)]|0)+(VJ[Y.charCodeAt(H+1)]|0)+(VJ[Y.charCodeAt(H+2)]|0)+(VJ[Y.charCodeAt(H+3)]|0);return W===Z}function oD(Y){return aD(Y,32)&&Y!==rD.INVALID_TRACEID}sD.isValidTraceId=oD;function tD(Y){return aD(Y,16)&&Y!==rD.INVALID_SPANID}sD.isValidSpanId=tD;function t80(Y){return oD(Y.traceId)&&tD(Y.spanId)}sD.isSpanContextValid=t80;function s80(Y){return new o80.NonRecordingSpan(Y)}sD.wrapSpanContext=s80});var PF=H0((QT)=>{Object.defineProperty(QT,"__esModule",{value:!0});QT.NoopTracer=void 0;var Q90=_Z(),YT=EF(),MF=HJ(),X90=qJ(),RF=Q90.ContextAPI.getInstance();class ZT{startSpan(Y,Z,W=RF.active()){if(Boolean(Z===null||Z===void 0?void 0:Z.root))return new MF.NonRecordingSpan;let F=W&&(0,YT.getSpanContext)(W);if(J90(F)&&(0,X90.isSpanContextValid)(F))return new MF.NonRecordingSpan(F);else return new MF.NonRecordingSpan}startActiveSpan(Y,Z,W,H){let F,X,J;if(arguments.length<2)return;else if(arguments.length===2)J=Z;else if(arguments.length===3)F=Z,J=W;else F=Z,X=W,J=H;let Q=X!==null&&X!==void 0?X:RF.active(),G=this.startSpan(Y,F,Q),q=(0,YT.setSpan)(Q,G);return RF.with(q,J,void 0,G)}}QT.NoopTracer=ZT;function J90(Y){return Y!==null&&typeof Y==="object"&&"spanId"in Y&&typeof Y.spanId==="string"&&"traceId"in Y&&typeof Y.traceId==="string"&&"traceFlags"in Y&&typeof Y.traceFlags==="number"}});var LF=H0((WT)=>{Object.defineProperty(WT,"__esModule",{value:!0});WT.ProxyTracer=void 0;var W90=PF(),K90=new W90.NoopTracer;class JT{constructor(Y,Z,W,H){this._provider=Y,this.name=Z,this.version=W,this.options=H}startSpan(Y,Z,W){return this._getTracer().startSpan(Y,Z,W)}startActiveSpan(Y,Z,W,H){let F=this._getTracer();return Reflect.apply(F.startActiveSpan,F,arguments)}_getTracer(){if(this._delegate)return this._delegate;let Y=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!Y)return K90;return this._delegate=Y,this._delegate}}WT.ProxyTracer=JT});var VT=H0((FT)=>{Object.defineProperty(FT,"__esModule",{value:!0});FT.NoopTracerProvider=void 0;var G90=PF();class GT{getTracer(Y,Z,W){return new G90.NoopTracer}}FT.NoopTracerProvider=GT});var wF=H0((zT)=>{Object.defineProperty(zT,"__esModule",{value:!0});zT.ProxyTracerProvider=void 0;var F90=LF(),H90=VT(),V90=new H90.NoopTracerProvider;class qT{getTracer(Y,Z,W){var H;return(H=this.getDelegateTracer(Y,Z,W))!==null&&H!==void 0?H:new F90.ProxyTracer(this,Y,Z,W)}getDelegate(){var Y;return(Y=this._delegate)!==null&&Y!==void 0?Y:V90}setDelegate(Y){this._delegate=Y}getDelegateTracer(Y,Z,W){var H;return(H=this._delegate)===null||H===void 0?void 0:H.getTracer(Y,Z,W)}}zT.ProxyTracerProvider=qT});var UT=H0((AT)=>{Object.defineProperty(AT,"__esModule",{value:!0});AT.SamplingDecision=void 0;var q90;(function(Y){Y[Y.NOT_RECORD=0]="NOT_RECORD",Y[Y.RECORD=1]="RECORD",Y[Y.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(q90=AT.SamplingDecision||(AT.SamplingDecision={}))});var OT=H0((NT)=>{Object.defineProperty(NT,"__esModule",{value:!0});NT.SpanKind=void 0;var z90;(function(Y){Y[Y.INTERNAL=0]="INTERNAL",Y[Y.SERVER=1]="SERVER",Y[Y.CLIENT=2]="CLIENT",Y[Y.PRODUCER=3]="PRODUCER",Y[Y.CONSUMER=4]="CONSUMER"})(z90=NT.SpanKind||(NT.SpanKind={}))});var TT=H0((DT)=>{Object.defineProperty(DT,"__esModule",{value:!0});DT.SpanStatusCode=void 0;var B90;(function(Y){Y[Y.UNSET=0]="UNSET",Y[Y.OK=1]="OK",Y[Y.ERROR=2]="ERROR"})(B90=DT.SpanStatusCode||(DT.SpanStatusCode={}))});var CT=H0((IT)=>{Object.defineProperty(IT,"__esModule",{value:!0});IT.validateValue=IT.validateKey=void 0;var yF="[_0-9a-z-*/]",A90=`[a-z]${yF}{0,255}`,U90=`[a-z0-9]${yF}{0,240}@[a-z]${yF}{0,13}`,N90=new RegExp(`^(?:${A90}|${U90})$`),O90=/^[ -~]{0,255}[!-~]$/,D90=/,|=/;function T90(Y){return N90.test(Y)}IT.validateKey=T90;function I90(Y){return O90.test(Y)&&!D90.test(Y)}IT.validateValue=I90});var ST=H0((LT)=>{Object.defineProperty(LT,"__esModule",{value:!0});LT.TraceStateImpl=void 0;var ET=CT(),MT=32,C90=512,RT=",",PT="=";class vF{constructor(Y){if(this._internalState=new Map,Y)this._parse(Y)}set(Y,Z){let W=this._clone();if(W._internalState.has(Y))W._internalState.delete(Y);return W._internalState.set(Y,Z),W}unset(Y){let Z=this._clone();return Z._internalState.delete(Y),Z}get(Y){return this._internalState.get(Y)}serialize(){return Array.from(this._internalState.keys()).reduceRight((Y,Z)=>{return Y.push(Z+PT+this.get(Z)),Y},[]).join(RT)}_parse(Y){if(Y.length>C90)return;if(this._internalState=Y.split(RT).reduceRight((Z,W)=>{let H=W.trim(),F=H.indexOf(PT);if(F!==-1){let X=H.slice(0,F),J=H.slice(F+1,W.length);if((0,ET.validateKey)(X)&&(0,ET.validateValue)(J))Z.set(X,J)}return Z},new Map),this._internalState.size>MT)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,MT))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let Y=new vF;return Y._internalState=new Map(this._internalState),Y}}LT.TraceStateImpl=vF});var yT=H0((fT)=>{Object.defineProperty(fT,"__esModule",{value:!0});fT.createTraceState=void 0;var E90=ST();function M90(Y){return new E90.TraceStateImpl(Y)}fT.createTraceState=M90});var jT=H0((vT)=>{Object.defineProperty(vT,"__esModule",{value:!0});vT.context=void 0;var R90=_Z();vT.context=R90.ContextAPI.getInstance()});var bT=H0((_T)=>{Object.defineProperty(_T,"__esModule",{value:!0});_T.diag=void 0;var P90=j5();_T.diag=P90.DiagAPI.instance()});var gT=H0((uT)=>{Object.defineProperty(uT,"__esModule",{value:!0});uT.NOOP_METER_PROVIDER=uT.NoopMeterProvider=void 0;var L90=BF();class hF{getMeter(Y,Z,W){return L90.NOOP_METER}}uT.NoopMeterProvider=hF;uT.NOOP_METER_PROVIDER=new hF});var nT=H0((cT)=>{Object.defineProperty(cT,"__esModule",{value:!0});cT.MetricsAPI=void 0;var S90=gT(),jF=h5(),dT=j5(),_F="metrics";class xF{constructor(){}static getInstance(){if(!this._instance)this._instance=new xF;return this._instance}setGlobalMeterProvider(Y){return(0,jF.registerGlobal)(_F,Y,dT.DiagAPI.instance())}getMeterProvider(){return(0,jF.getGlobal)(_F)||S90.NOOP_METER_PROVIDER}getMeter(Y,Z,W){return this.getMeterProvider().getMeter(Y,Z,W)}disable(){(0,jF.unregisterGlobal)(_F,dT.DiagAPI.instance())}}cT.MetricsAPI=xF});var rT=H0((pT)=>{Object.defineProperty(pT,"__esModule",{value:!0});pT.metrics=void 0;var f90=nT();pT.metrics=f90.MetricsAPI.getInstance()});var sT=H0((oT)=>{Object.defineProperty(oT,"__esModule",{value:!0});oT.NoopTextMapPropagator=void 0;class aT{inject(Y,Z){}extract(Y,Z){return Y}fields(){return[]}}oT.NoopTextMapPropagator=aT});var QI=H0((YI)=>{Object.defineProperty(YI,"__esModule",{value:!0});YI.deleteBaggage=YI.setBaggage=YI.getActiveBaggage=YI.getBaggage=void 0;var k90=_Z(),y90=hZ(),bF=(0,y90.createContextKey)("OpenTelemetry Baggage Key");function eT(Y){return Y.getValue(bF)||void 0}YI.getBaggage=eT;function v90(){return eT(k90.ContextAPI.getInstance().active())}YI.getActiveBaggage=v90;function h90(Y,Z){return Y.setValue(bF,Z)}YI.setBaggage=h90;function j90(Y){return Y.deleteValue(bF)}YI.deleteBaggage=j90});var GI=H0((WI)=>{Object.defineProperty(WI,"__esModule",{value:!0});WI.PropagationAPI=void 0;var uF=h5(),u90=sT(),XI=UF(),zJ=QI(),m90=XF(),JI=j5(),mF="propagation",g90=new u90.NoopTextMapPropagator;class gF{constructor(){this.createBaggage=m90.createBaggage,this.getBaggage=zJ.getBaggage,this.getActiveBaggage=zJ.getActiveBaggage,this.setBaggage=zJ.setBaggage,this.deleteBaggage=zJ.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new gF;return this._instance}setGlobalPropagator(Y){return(0,uF.registerGlobal)(mF,Y,JI.DiagAPI.instance())}inject(Y,Z,W=XI.defaultTextMapSetter){return this._getGlobalPropagator().inject(Y,Z,W)}extract(Y,Z,W=XI.defaultTextMapGetter){return this._getGlobalPropagator().extract(Y,Z,W)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,uF.unregisterGlobal)(mF,JI.DiagAPI.instance())}_getGlobalPropagator(){return(0,uF.getGlobal)(mF)||g90}}WI.PropagationAPI=gF});var VI=H0((FI)=>{Object.defineProperty(FI,"__esModule",{value:!0});FI.propagation=void 0;var d90=GI();FI.propagation=d90.PropagationAPI.getInstance()});var NI=H0((AI)=>{Object.defineProperty(AI,"__esModule",{value:!0});AI.TraceAPI=void 0;var dF=h5(),qI=wF(),zI=qJ(),a7=EF(),BI=j5(),cF="trace";class lF{constructor(){this._proxyTracerProvider=new qI.ProxyTracerProvider,this.wrapSpanContext=zI.wrapSpanContext,this.isSpanContextValid=zI.isSpanContextValid,this.deleteSpan=a7.deleteSpan,this.getSpan=a7.getSpan,this.getActiveSpan=a7.getActiveSpan,this.getSpanContext=a7.getSpanContext,this.setSpan=a7.setSpan,this.setSpanContext=a7.setSpanContext}static getInstance(){if(!this._instance)this._instance=new lF;return this._instance}setGlobalTracerProvider(Y){let Z=(0,dF.registerGlobal)(cF,this._proxyTracerProvider,BI.DiagAPI.instance());if(Z)this._proxyTracerProvider.setDelegate(Y);return Z}getTracerProvider(){return(0,dF.getGlobal)(cF)||this._proxyTracerProvider}getTracer(Y,Z){return this.getTracerProvider().getTracer(Y,Z)}disable(){(0,dF.unregisterGlobal)(cF,BI.DiagAPI.instance()),this._proxyTracerProvider=new qI.ProxyTracerProvider}}AI.TraceAPI=lF});var TI=H0((OI)=>{Object.defineProperty(OI,"__esModule",{value:!0});OI.trace=void 0;var c90=NI();OI.trace=c90.TraceAPI.getInstance()});var f1=H0((N6)=>{Object.defineProperty(N6,"__esModule",{value:!0});N6.trace=N6.propagation=N6.metrics=N6.diag=N6.context=N6.INVALID_SPAN_CONTEXT=N6.INVALID_TRACEID=N6.INVALID_SPANID=N6.isValidSpanId=N6.isValidTraceId=N6.isSpanContextValid=N6.createTraceState=N6.TraceFlags=N6.SpanStatusCode=N6.SpanKind=N6.SamplingDecision=N6.ProxyTracerProvider=N6.ProxyTracer=N6.defaultTextMapSetter=N6.defaultTextMapGetter=N6.ValueType=N6.createNoopMeter=N6.DiagLogLevel=N6.DiagConsoleLogger=N6.ROOT_CONTEXT=N6.createContextKey=N6.baggageEntryMetadataFromString=void 0;var l90=XF();Object.defineProperty(N6,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return l90.baggageEntryMetadataFromString}});var II=hZ();Object.defineProperty(N6,"createContextKey",{enumerable:!0,get:function(){return II.createContextKey}});Object.defineProperty(N6,"ROOT_CONTEXT",{enumerable:!0,get:function(){return II.ROOT_CONTEXT}});var n90=UD();Object.defineProperty(N6,"DiagConsoleLogger",{enumerable:!0,get:function(){return n90.DiagConsoleLogger}});var p90=JJ();Object.defineProperty(N6,"DiagLogLevel",{enumerable:!0,get:function(){return p90.DiagLogLevel}});var i90=BF();Object.defineProperty(N6,"createNoopMeter",{enumerable:!0,get:function(){return i90.createNoopMeter}});var r90=LD();Object.defineProperty(N6,"ValueType",{enumerable:!0,get:function(){return r90.ValueType}});var $I=UF();Object.defineProperty(N6,"defaultTextMapGetter",{enumerable:!0,get:function(){return $I.defaultTextMapGetter}});Object.defineProperty(N6,"defaultTextMapSetter",{enumerable:!0,get:function(){return $I.defaultTextMapSetter}});var a90=LF();Object.defineProperty(N6,"ProxyTracer",{enumerable:!0,get:function(){return a90.ProxyTracer}});var o90=wF();Object.defineProperty(N6,"ProxyTracerProvider",{enumerable:!0,get:function(){return o90.ProxyTracerProvider}});var t90=UT();Object.defineProperty(N6,"SamplingDecision",{enumerable:!0,get:function(){return t90.SamplingDecision}});var s90=OT();Object.defineProperty(N6,"SpanKind",{enumerable:!0,get:function(){return s90.SpanKind}});var e90=TT();Object.defineProperty(N6,"SpanStatusCode",{enumerable:!0,get:function(){return e90.SpanStatusCode}});var Y40=IF();Object.defineProperty(N6,"TraceFlags",{enumerable:!0,get:function(){return Y40.TraceFlags}});var Z40=yT();Object.defineProperty(N6,"createTraceState",{enumerable:!0,get:function(){return Z40.createTraceState}});var nF=qJ();Object.defineProperty(N6,"isSpanContextValid",{enumerable:!0,get:function(){return nF.isSpanContextValid}});Object.defineProperty(N6,"isValidTraceId",{enumerable:!0,get:function(){return nF.isValidTraceId}});Object.defineProperty(N6,"isValidSpanId",{enumerable:!0,get:function(){return nF.isValidSpanId}});var pF=FJ();Object.defineProperty(N6,"INVALID_SPANID",{enumerable:!0,get:function(){return pF.INVALID_SPANID}});Object.defineProperty(N6,"INVALID_TRACEID",{enumerable:!0,get:function(){return pF.INVALID_TRACEID}});Object.defineProperty(N6,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return pF.INVALID_SPAN_CONTEXT}});var CI=jT();Object.defineProperty(N6,"context",{enumerable:!0,get:function(){return CI.context}});var EI=bT();Object.defineProperty(N6,"diag",{enumerable:!0,get:function(){return EI.diag}});var MI=rT();Object.defineProperty(N6,"metrics",{enumerable:!0,get:function(){return MI.metrics}});var RI=VI();Object.defineProperty(N6,"propagation",{enumerable:!0,get:function(){return RI.propagation}});var PI=TI();Object.defineProperty(N6,"trace",{enumerable:!0,get:function(){return PI.trace}});N6.default={context:CI.context,diag:EI.diag,metrics:MI.metrics,propagation:RI.propagation,trace:PI.trace}});var wI=H0((LI)=>{Object.defineProperty(LI,"__esModule",{value:!0});LI.SeverityNumber=void 0;var J40;(function(Y){Y[Y.UNSPECIFIED=0]="UNSPECIFIED",Y[Y.TRACE=1]="TRACE",Y[Y.TRACE2=2]="TRACE2",Y[Y.TRACE3=3]="TRACE3",Y[Y.TRACE4=4]="TRACE4",Y[Y.DEBUG=5]="DEBUG",Y[Y.DEBUG2=6]="DEBUG2",Y[Y.DEBUG3=7]="DEBUG3",Y[Y.DEBUG4=8]="DEBUG4",Y[Y.INFO=9]="INFO",Y[Y.INFO2=10]="INFO2",Y[Y.INFO3=11]="INFO3",Y[Y.INFO4=12]="INFO4",Y[Y.WARN=13]="WARN",Y[Y.WARN2=14]="WARN2",Y[Y.WARN3=15]="WARN3",Y[Y.WARN4=16]="WARN4",Y[Y.ERROR=17]="ERROR",Y[Y.ERROR2=18]="ERROR2",Y[Y.ERROR3=19]="ERROR3",Y[Y.ERROR4=20]="ERROR4",Y[Y.FATAL=21]="FATAL",Y[Y.FATAL2=22]="FATAL2",Y[Y.FATAL3=23]="FATAL3",Y[Y.FATAL4=24]="FATAL4"})(J40=LI.SeverityNumber||(LI.SeverityNumber={}))});var BJ=H0((SI)=>{Object.defineProperty(SI,"__esModule",{value:!0});SI.NOOP_LOGGER=SI.NoopLogger=void 0;class rF{emit(Y){}}SI.NoopLogger=rF;SI.NOOP_LOGGER=new rF});var vI=H0((kI)=>{Object.defineProperty(kI,"__esModule",{value:!0});kI.API_BACKWARDS_COMPATIBILITY_VERSION=kI.makeGetter=kI._global=kI.GLOBAL_LOGS_API_KEY=void 0;kI.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");kI._global=globalThis;function K40(Y,Z,W){return(H)=>H===Y?Z:W}kI.makeGetter=K40;kI.API_BACKWARDS_COMPATIBILITY_VERSION=1});var oF=H0((hI)=>{Object.defineProperty(hI,"__esModule",{value:!0});hI.NOOP_LOGGER_PROVIDER=hI.NoopLoggerProvider=void 0;var V40=BJ();class aF{getLogger(Y,Z,W){return new V40.NoopLogger}}hI.NoopLoggerProvider=aF;hI.NOOP_LOGGER_PROVIDER=new aF});var uI=H0((xI)=>{Object.defineProperty(xI,"__esModule",{value:!0});xI.ProxyLogger=void 0;var z40=BJ();class _I{constructor(Y,Z,W,H){this._provider=Y,this.name=Z,this.version=W,this.options=H}emit(Y){this._getLogger().emit(Y)}_getLogger(){if(this._delegate)return this._delegate;let Y=this._provider._getDelegateLogger(this.name,this.version,this.options);if(!Y)return z40.NOOP_LOGGER;return this._delegate=Y,this._delegate}}xI.ProxyLogger=_I});var cI=H0((gI)=>{Object.defineProperty(gI,"__esModule",{value:!0});gI.ProxyLoggerProvider=void 0;var B40=oF(),A40=uI();class mI{getLogger(Y,Z,W){var H;return(H=this._getDelegateLogger(Y,Z,W))!==null&&H!==void 0?H:new A40.ProxyLogger(this,Y,Z,W)}_getDelegate(){var Y;return(Y=this._delegate)!==null&&Y!==void 0?Y:B40.NOOP_LOGGER_PROVIDER}_setDelegate(Y){this._delegate=Y}_getDelegateLogger(Y,Z,W){var H;return(H=this._delegate)===null||H===void 0?void 0:H.getLogger(Y,Z,W)}}gI.ProxyLoggerProvider=mI});var iI=H0((nI)=>{Object.defineProperty(nI,"__esModule",{value:!0});nI.LogsAPI=void 0;var Q9=vI(),U40=oF(),lI=cI();class tF{constructor(){this._proxyLoggerProvider=new lI.ProxyLoggerProvider}static getInstance(){if(!this._instance)this._instance=new tF;return this._instance}setGlobalLoggerProvider(Y){if(Q9._global[Q9.GLOBAL_LOGS_API_KEY])return this.getLoggerProvider();return Q9._global[Q9.GLOBAL_LOGS_API_KEY]=(0,Q9.makeGetter)(Q9.API_BACKWARDS_COMPATIBILITY_VERSION,Y,U40.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(Y),Y}getLoggerProvider(){var Y,Z;return(Z=(Y=Q9._global[Q9.GLOBAL_LOGS_API_KEY])===null||Y===void 0?void 0:Y.call(Q9._global,Q9.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&Z!==void 0?Z:this._proxyLoggerProvider}getLogger(Y,Z,W){return this.getLoggerProvider().getLogger(Y,Z,W)}disable(){delete Q9._global[Q9.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new lI.ProxyLoggerProvider}}nI.LogsAPI=tF});var o7=H0((xZ)=>{Object.defineProperty(xZ,"__esModule",{value:!0});xZ.logs=xZ.NoopLogger=xZ.NOOP_LOGGER=xZ.SeverityNumber=void 0;var N40=wI();Object.defineProperty(xZ,"SeverityNumber",{enumerable:!0,get:function(){return N40.SeverityNumber}});var rI=BJ();Object.defineProperty(xZ,"NOOP_LOGGER",{enumerable:!0,get:function(){return rI.NOOP_LOGGER}});Object.defineProperty(xZ,"NoopLogger",{enumerable:!0,get:function(){return rI.NoopLogger}});var O40=iI();xZ.logs=O40.LogsAPI.getInstance()});var eI=H0((tI)=>{Object.defineProperty(tI,"__esModule",{value:!0});tI.OTLPExporterBase=void 0;class oI{_delegate;constructor(Y){this._delegate=Y}export(Y,Z){this._delegate.export(Y,Z)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}tI.OTLPExporterBase=oI});var AJ=H0((Z$)=>{Object.defineProperty(Z$,"__esModule",{value:!0});Z$.OTLPExporterError=void 0;class Y$ extends Error{code;name="OTLPExporterError";data;constructor(Y,Z,W){super(Y);this.data=W,this.code=Z}}Z$.OTLPExporterError=Y$});var bZ=H0((J$)=>{Object.defineProperty(J$,"__esModule",{value:!0});J$.getSharedConfigurationDefaults=J$.mergeOtlpSharedConfigurationWithDefaults=J$.wrapStaticHeadersInFunction=J$.validateTimeoutMillis=void 0;function X$(Y){if(Number.isFinite(Y)&&Y>0)return Y;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${Y}')`)}J$.validateTimeoutMillis=X$;function D40(Y){if(Y==null)return;return async()=>Y}J$.wrapStaticHeadersInFunction=D40;function T40(Y,Z,W){return{timeoutMillis:X$(Y.timeoutMillis??Z.timeoutMillis??W.timeoutMillis),concurrencyLimit:Y.concurrencyLimit??Z.concurrencyLimit??W.concurrencyLimit,compression:Y.compression??Z.compression??W.compression}}J$.mergeOtlpSharedConfigurationWithDefaults=T40;function I40(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}J$.getSharedConfigurationDefaults=I40});var G$=H0((K$)=>{Object.defineProperty(K$,"__esModule",{value:!0});K$.CompressionAlgorithm=void 0;var M40;(function(Y){Y.NONE="none",Y.GZIP="gzip"})(M40=K$.CompressionAlgorithm||(K$.CompressionAlgorithm={}))});var eF=H0((H$)=>{Object.defineProperty(H$,"__esModule",{value:!0});H$.createBoundedQueueExportPromiseHandler=void 0;class F${_concurrencyLimit;_sendingPromises=[];constructor(Y){this._concurrencyLimit=Y}pushPromise(Y){if(this.hasReachedLimit())throw Error("Concurrency Limit reached");this._sendingPromises.push(Y);let Z=()=>{let W=this._sendingPromises.indexOf(Y);this._sendingPromises.splice(W,1)};Y.then(Z,Z)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function R40(Y){return new F$(Y.concurrencyLimit)}H$.createBoundedQueueExportPromiseHandler=R40});var uZ=H0((q$)=>{Object.defineProperty(q$,"__esModule",{value:!0});q$.isTracingSuppressed=q$.unsuppressTracing=q$.suppressTracing=void 0;var P40=f1(),YH=(0,P40.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function L40(Y){return Y.setValue(YH,!0)}q$.suppressTracing=L40;function w40(Y){return Y.deleteValue(YH)}q$.unsuppressTracing=w40;function S40(Y){return Y.getValue(YH)===!0}q$.isTracingSuppressed=S40});var ZH=H0((B$)=>{Object.defineProperty(B$,"__esModule",{value:!0});B$.BAGGAGE_MAX_TOTAL_LENGTH=B$.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=B$.BAGGAGE_MAX_NAME_VALUE_PAIRS=B$.BAGGAGE_HEADER=B$.BAGGAGE_ITEMS_SEPARATOR=B$.BAGGAGE_PROPERTIES_SEPARATOR=B$.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;B$.BAGGAGE_KEY_PAIR_SEPARATOR="=";B$.BAGGAGE_PROPERTIES_SEPARATOR=";";B$.BAGGAGE_ITEMS_SEPARATOR=",";B$.BAGGAGE_HEADER="baggage";B$.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;B$.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;B$.BAGGAGE_MAX_TOTAL_LENGTH=8192});var QH=H0((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});N$.parseKeyPairsIntoRecord=N$.parsePairKeyValue=N$.getKeyPairs=N$.serializeKeyPairs=void 0;var b40=f1(),t7=ZH();function u40(Y){return Y.reduce((Z,W)=>{let H=`${Z}${Z!==""?t7.BAGGAGE_ITEMS_SEPARATOR:""}${W}`;return H.length>t7.BAGGAGE_MAX_TOTAL_LENGTH?Z:H},"")}N$.serializeKeyPairs=u40;function m40(Y){return Y.getAllEntries().map(([Z,W])=>{let H=`${encodeURIComponent(Z)}=${encodeURIComponent(W.value)}`;if(W.metadata!==void 0)H+=t7.BAGGAGE_PROPERTIES_SEPARATOR+W.metadata.toString();return H})}N$.getKeyPairs=m40;function U$(Y){if(!Y)return;let Z=Y.indexOf(t7.BAGGAGE_PROPERTIES_SEPARATOR),W=Z===-1?Y:Y.substring(0,Z),H=W.indexOf(t7.BAGGAGE_KEY_PAIR_SEPARATOR);if(H<=0)return;let F=W.substring(0,H).trim(),X=W.substring(H+1).trim();if(!F||!X)return;let J,Q;try{J=decodeURIComponent(F),Q=decodeURIComponent(X)}catch{return}let G;if(Z!==-1&&Z<Y.length-1){let q=Y.substring(Z+1);G=(0,b40.baggageEntryMetadataFromString)(q)}return{key:J,value:Q,metadata:G}}N$.parsePairKeyValue=U$;function g40(Y){let Z={};if(typeof Y==="string"&&Y.length>0)Y.split(t7.BAGGAGE_ITEMS_SEPARATOR).forEach((W)=>{let H=U$(W);if(H!==void 0&&H.value.length>0)Z[H.key]=H.value});return Z}N$.parseKeyPairsIntoRecord=g40});var $$=H0((T$)=>{Object.defineProperty(T$,"__esModule",{value:!0});T$.W3CBaggagePropagator=void 0;var XH=f1(),n40=uZ(),_5=ZH(),JH=QH();class D${inject(Y,Z,W){let H=XH.propagation.getBaggage(Y);if(!H||(0,n40.isTracingSuppressed)(Y))return;let F=(0,JH.getKeyPairs)(H).filter((J)=>{return J.length<=_5.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS}).slice(0,_5.BAGGAGE_MAX_NAME_VALUE_PAIRS),X=(0,JH.serializeKeyPairs)(F);if(X.length>0)W.set(Z,_5.BAGGAGE_HEADER,X)}extract(Y,Z,W){let H=W.get(Z,_5.BAGGAGE_HEADER),F=Array.isArray(H)?H.join(_5.BAGGAGE_ITEMS_SEPARATOR):H;if(!F)return Y;let X={};if(F.length===0)return Y;if(F.split(_5.BAGGAGE_ITEMS_SEPARATOR).forEach((Q)=>{let G=(0,JH.parsePairKeyValue)(Q);if(G){let q={value:G.value};if(G.metadata)q.metadata=G.metadata;X[G.key]=q}}),Object.entries(X).length===0)return Y;return XH.propagation.setBaggage(Y,XH.propagation.createBaggage(X))}fields(){return[_5.BAGGAGE_HEADER]}}T$.W3CBaggagePropagator=D$});var R$=H0((E$)=>{Object.defineProperty(E$,"__esModule",{value:!0});E$.AnchoredClock=void 0;class C${_monotonicClock;_epochMillis;_performanceMillis;constructor(Y,Z){this._monotonicClock=Z,this._epochMillis=Y.now(),this._performanceMillis=Z.now()}now(){let Y=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+Y}}E$.AnchoredClock=C$});var y$=H0((f$)=>{Object.defineProperty(f$,"__esModule",{value:!0});f$.isAttributeValue=f$.isAttributeKey=f$.sanitizeAttributes=void 0;var P$=f1();function p40(Y){let Z={};if(typeof Y!=="object"||Y==null)return Z;for(let W in Y){if(!Object.prototype.hasOwnProperty.call(Y,W))continue;if(!L$(W)){P$.diag.warn(`Invalid attribute key: ${W}`);continue}let H=Y[W];if(!w$(H)){P$.diag.warn(`Invalid attribute value set for key: ${W}`);continue}if(Array.isArray(H))Z[W]=H.slice();else Z[W]=H}return Z}f$.sanitizeAttributes=p40;function L$(Y){return typeof Y==="string"&&Y!==""}f$.isAttributeKey=L$;function w$(Y){if(Y==null)return!0;if(Array.isArray(Y))return i40(Y);return S$(typeof Y)}f$.isAttributeValue=w$;function i40(Y){let Z;for(let W of Y){if(W==null)continue;let H=typeof W;if(H===Z)continue;if(!Z){if(S$(H)){Z=H;continue}return!1}return!1}return!0}function S$(Y){switch(Y){case"number":case"boolean":case"string":return!0}return!1}});var WH=H0((v$)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.loggingErrorHandler=void 0;var o40=f1();function t40(){return(Y)=>{o40.diag.error(s40(Y))}}v$.loggingErrorHandler=t40;function s40(Y){if(typeof Y==="string")return Y;else return JSON.stringify(e40(Y))}function e40(Y){let Z={},W=Y;while(W!==null)Object.getOwnPropertyNames(W).forEach((H)=>{if(Z[H])return;let F=W[H];if(F)Z[H]=String(F)}),W=Object.getPrototypeOf(W);return Z}});var b$=H0((_$)=>{Object.defineProperty(_$,"__esModule",{value:!0});_$.globalErrorHandler=_$.setGlobalErrorHandler=void 0;var Y50=WH(),j$=(0,Y50.loggingErrorHandler)();function Z50(Y){j$=Y}_$.setGlobalErrorHandler=Z50;function Q50(Y){try{j$(Y)}catch{}}_$.globalErrorHandler=Q50});var l$=H0((d$)=>{Object.defineProperty(d$,"__esModule",{value:!0});d$.getStringListFromEnv=d$.getBooleanFromEnv=d$.getStringFromEnv=d$.getNumberFromEnv=void 0;var u$=f1(),m$=V1("util");function J50(Y){let Z=process.env[Y];if(Z==null||Z.trim()==="")return;let W=Number(Z);if(isNaN(W)){u$.diag.warn(`Unknown value ${(0,m$.inspect)(Z)} for ${Y}, expected a number, using defaults`);return}return W}d$.getNumberFromEnv=J50;function g$(Y){let Z=process.env[Y];if(Z==null||Z.trim()==="")return;return Z}d$.getStringFromEnv=g$;function W50(Y){let Z=process.env[Y]?.trim().toLowerCase();if(Z==null||Z==="")return!1;if(Z==="true")return!0;else if(Z==="false")return!1;else return u$.diag.warn(`Unknown value ${(0,m$.inspect)(Z)} for ${Y}, expected 'true' or 'false', falling back to 'false' (default)`),!1}d$.getBooleanFromEnv=W50;function K50(Y){return g$(Y)?.split(",").map((Z)=>Z.trim()).filter((Z)=>Z!=="")}d$.getStringListFromEnv=K50});var i$=H0((n$)=>{Object.defineProperty(n$,"__esModule",{value:!0});n$._globalThis=void 0;n$._globalThis=globalThis});var o$=H0((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.VERSION=void 0;r$.VERSION="2.6.1"});var KH=H0((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.createConstMap=void 0;function V50(Y){let Z={},W=Y.length;for(let H=0;H<W;H++){let F=Y[H];if(F)Z[String(F).toUpperCase().replace(/[-.]/g,"_")]=F}return Z}t$.createConstMap=V50});var a2=H0((d2)=>{Object.defineProperty(d2,"__esModule",{value:!0});d2.SEMATTRS_NET_HOST_CARRIER_ICC=d2.SEMATTRS_NET_HOST_CARRIER_MNC=d2.SEMATTRS_NET_HOST_CARRIER_MCC=d2.SEMATTRS_NET_HOST_CARRIER_NAME=d2.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=d2.SEMATTRS_NET_HOST_CONNECTION_TYPE=d2.SEMATTRS_NET_HOST_NAME=d2.SEMATTRS_NET_HOST_PORT=d2.SEMATTRS_NET_HOST_IP=d2.SEMATTRS_NET_PEER_NAME=d2.SEMATTRS_NET_PEER_PORT=d2.SEMATTRS_NET_PEER_IP=d2.SEMATTRS_NET_TRANSPORT=d2.SEMATTRS_FAAS_INVOKED_REGION=d2.SEMATTRS_FAAS_INVOKED_PROVIDER=d2.SEMATTRS_FAAS_INVOKED_NAME=d2.SEMATTRS_FAAS_COLDSTART=d2.SEMATTRS_FAAS_CRON=d2.SEMATTRS_FAAS_TIME=d2.SEMATTRS_FAAS_DOCUMENT_NAME=d2.SEMATTRS_FAAS_DOCUMENT_TIME=d2.SEMATTRS_FAAS_DOCUMENT_OPERATION=d2.SEMATTRS_FAAS_DOCUMENT_COLLECTION=d2.SEMATTRS_FAAS_EXECUTION=d2.SEMATTRS_FAAS_TRIGGER=d2.SEMATTRS_EXCEPTION_ESCAPED=d2.SEMATTRS_EXCEPTION_STACKTRACE=d2.SEMATTRS_EXCEPTION_MESSAGE=d2.SEMATTRS_EXCEPTION_TYPE=d2.SEMATTRS_DB_SQL_TABLE=d2.SEMATTRS_DB_MONGODB_COLLECTION=d2.SEMATTRS_DB_REDIS_DATABASE_INDEX=d2.SEMATTRS_DB_HBASE_NAMESPACE=d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=d2.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=d2.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=d2.SEMATTRS_DB_CASSANDRA_TABLE=d2.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=d2.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=d2.SEMATTRS_DB_CASSANDRA_KEYSPACE=d2.SEMATTRS_DB_MSSQL_INSTANCE_NAME=d2.SEMATTRS_DB_OPERATION=d2.SEMATTRS_DB_STATEMENT=d2.SEMATTRS_DB_NAME=d2.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=d2.SEMATTRS_DB_USER=d2.SEMATTRS_DB_CONNECTION_STRING=d2.SEMATTRS_DB_SYSTEM=d2.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=void 0;d2.SEMATTRS_MESSAGING_DESTINATION_KIND=d2.SEMATTRS_MESSAGING_DESTINATION=d2.SEMATTRS_MESSAGING_SYSTEM=d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=d2.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=d2.SEMATTRS_AWS_DYNAMODB_COUNT=d2.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=d2.SEMATTRS_AWS_DYNAMODB_SEGMENT=d2.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=d2.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=d2.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=d2.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=d2.SEMATTRS_AWS_DYNAMODB_SELECT=d2.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=d2.SEMATTRS_AWS_DYNAMODB_LIMIT=d2.SEMATTRS_AWS_DYNAMODB_PROJECTION=d2.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=d2.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=d2.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=d2.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=d2.SEMATTRS_HTTP_CLIENT_IP=d2.SEMATTRS_HTTP_ROUTE=d2.SEMATTRS_HTTP_SERVER_NAME=d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=d2.SEMATTRS_HTTP_USER_AGENT=d2.SEMATTRS_HTTP_FLAVOR=d2.SEMATTRS_HTTP_STATUS_CODE=d2.SEMATTRS_HTTP_SCHEME=d2.SEMATTRS_HTTP_HOST=d2.SEMATTRS_HTTP_TARGET=d2.SEMATTRS_HTTP_URL=d2.SEMATTRS_HTTP_METHOD=d2.SEMATTRS_CODE_LINENO=d2.SEMATTRS_CODE_FILEPATH=d2.SEMATTRS_CODE_NAMESPACE=d2.SEMATTRS_CODE_FUNCTION=d2.SEMATTRS_THREAD_NAME=d2.SEMATTRS_THREAD_ID=d2.SEMATTRS_ENDUSER_SCOPE=d2.SEMATTRS_ENDUSER_ROLE=d2.SEMATTRS_ENDUSER_ID=d2.SEMATTRS_PEER_SERVICE=void 0;d2.DBSYSTEMVALUES_FILEMAKER=d2.DBSYSTEMVALUES_DERBY=d2.DBSYSTEMVALUES_FIREBIRD=d2.DBSYSTEMVALUES_ADABAS=d2.DBSYSTEMVALUES_CACHE=d2.DBSYSTEMVALUES_EDB=d2.DBSYSTEMVALUES_FIRSTSQL=d2.DBSYSTEMVALUES_INGRES=d2.DBSYSTEMVALUES_HANADB=d2.DBSYSTEMVALUES_MAXDB=d2.DBSYSTEMVALUES_PROGRESS=d2.DBSYSTEMVALUES_HSQLDB=d2.DBSYSTEMVALUES_CLOUDSCAPE=d2.DBSYSTEMVALUES_HIVE=d2.DBSYSTEMVALUES_REDSHIFT=d2.DBSYSTEMVALUES_POSTGRESQL=d2.DBSYSTEMVALUES_DB2=d2.DBSYSTEMVALUES_ORACLE=d2.DBSYSTEMVALUES_MYSQL=d2.DBSYSTEMVALUES_MSSQL=d2.DBSYSTEMVALUES_OTHER_SQL=d2.SemanticAttributes=d2.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=d2.SEMATTRS_MESSAGE_COMPRESSED_SIZE=d2.SEMATTRS_MESSAGE_ID=d2.SEMATTRS_MESSAGE_TYPE=d2.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=d2.SEMATTRS_RPC_JSONRPC_ERROR_CODE=d2.SEMATTRS_RPC_JSONRPC_REQUEST_ID=d2.SEMATTRS_RPC_JSONRPC_VERSION=d2.SEMATTRS_RPC_GRPC_STATUS_CODE=d2.SEMATTRS_RPC_METHOD=d2.SEMATTRS_RPC_SERVICE=d2.SEMATTRS_RPC_SYSTEM=d2.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=d2.SEMATTRS_MESSAGING_KAFKA_PARTITION=d2.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=d2.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=d2.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=d2.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=d2.SEMATTRS_MESSAGING_CONSUMER_ID=d2.SEMATTRS_MESSAGING_OPERATION=d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=d2.SEMATTRS_MESSAGING_CONVERSATION_ID=d2.SEMATTRS_MESSAGING_MESSAGE_ID=d2.SEMATTRS_MESSAGING_URL=d2.SEMATTRS_MESSAGING_PROTOCOL_VERSION=d2.SEMATTRS_MESSAGING_PROTOCOL=d2.SEMATTRS_MESSAGING_TEMP_DESTINATION=void 0;d2.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=d2.FaasDocumentOperationValues=d2.FAASDOCUMENTOPERATIONVALUES_DELETE=d2.FAASDOCUMENTOPERATIONVALUES_EDIT=d2.FAASDOCUMENTOPERATIONVALUES_INSERT=d2.FaasTriggerValues=d2.FAASTRIGGERVALUES_OTHER=d2.FAASTRIGGERVALUES_TIMER=d2.FAASTRIGGERVALUES_PUBSUB=d2.FAASTRIGGERVALUES_HTTP=d2.FAASTRIGGERVALUES_DATASOURCE=d2.DbCassandraConsistencyLevelValues=d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=d2.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=d2.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=d2.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=d2.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=d2.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=d2.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=d2.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=d2.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=d2.DbSystemValues=d2.DBSYSTEMVALUES_COCKROACHDB=d2.DBSYSTEMVALUES_MEMCACHED=d2.DBSYSTEMVALUES_ELASTICSEARCH=d2.DBSYSTEMVALUES_GEODE=d2.DBSYSTEMVALUES_NEO4J=d2.DBSYSTEMVALUES_DYNAMODB=d2.DBSYSTEMVALUES_COSMOSDB=d2.DBSYSTEMVALUES_COUCHDB=d2.DBSYSTEMVALUES_COUCHBASE=d2.DBSYSTEMVALUES_REDIS=d2.DBSYSTEMVALUES_MONGODB=d2.DBSYSTEMVALUES_HBASE=d2.DBSYSTEMVALUES_CASSANDRA=d2.DBSYSTEMVALUES_COLDFUSION=d2.DBSYSTEMVALUES_H2=d2.DBSYSTEMVALUES_VERTICA=d2.DBSYSTEMVALUES_TERADATA=d2.DBSYSTEMVALUES_SYBASE=d2.DBSYSTEMVALUES_SQLITE=d2.DBSYSTEMVALUES_POINTBASE=d2.DBSYSTEMVALUES_PERVASIVE=d2.DBSYSTEMVALUES_NETEZZA=d2.DBSYSTEMVALUES_MARIADB=d2.DBSYSTEMVALUES_INTERBASE=d2.DBSYSTEMVALUES_INSTANTDB=d2.DBSYSTEMVALUES_INFORMIX=void 0;d2.MESSAGINGOPERATIONVALUES_RECEIVE=d2.MessagingDestinationKindValues=d2.MESSAGINGDESTINATIONKINDVALUES_TOPIC=d2.MESSAGINGDESTINATIONKINDVALUES_QUEUE=d2.HttpFlavorValues=d2.HTTPFLAVORVALUES_QUIC=d2.HTTPFLAVORVALUES_SPDY=d2.HTTPFLAVORVALUES_HTTP_2_0=d2.HTTPFLAVORVALUES_HTTP_1_1=d2.HTTPFLAVORVALUES_HTTP_1_0=d2.NetHostConnectionSubtypeValues=d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_NR=d2.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=d2.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=d2.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=d2.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=d2.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=d2.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=d2.NetHostConnectionTypeValues=d2.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=d2.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=d2.NETHOSTCONNECTIONTYPEVALUES_CELL=d2.NETHOSTCONNECTIONTYPEVALUES_WIRED=d2.NETHOSTCONNECTIONTYPEVALUES_WIFI=d2.NetTransportValues=d2.NETTRANSPORTVALUES_OTHER=d2.NETTRANSPORTVALUES_INPROC=d2.NETTRANSPORTVALUES_PIPE=d2.NETTRANSPORTVALUES_UNIX=d2.NETTRANSPORTVALUES_IP=d2.NETTRANSPORTVALUES_IP_UDP=d2.NETTRANSPORTVALUES_IP_TCP=d2.FaasInvokedProviderValues=d2.FAASINVOKEDPROVIDERVALUES_GCP=d2.FAASINVOKEDPROVIDERVALUES_AZURE=d2.FAASINVOKEDPROVIDERVALUES_AWS=void 0;d2.MessageTypeValues=d2.MESSAGETYPEVALUES_RECEIVED=d2.MESSAGETYPEVALUES_SENT=d2.RpcGrpcStatusCodeValues=d2.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=d2.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=d2.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=d2.RPCGRPCSTATUSCODEVALUES_INTERNAL=d2.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=d2.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=d2.RPCGRPCSTATUSCODEVALUES_ABORTED=d2.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=d2.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=d2.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=d2.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=d2.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=d2.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=d2.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=d2.RPCGRPCSTATUSCODEVALUES_UNKNOWN=d2.RPCGRPCSTATUSCODEVALUES_CANCELLED=d2.RPCGRPCSTATUSCODEVALUES_OK=d2.MessagingOperationValues=d2.MESSAGINGOPERATIONVALUES_PROCESS=void 0;var X9=KH(),e$="aws.lambda.invoked_arn",YC="db.system",ZC="db.connection_string",QC="db.user",XC="db.jdbc.driver_classname",JC="db.name",WC="db.statement",KC="db.operation",GC="db.mssql.instance_name",FC="db.cassandra.keyspace",HC="db.cassandra.page_size",VC="db.cassandra.consistency_level",qC="db.cassandra.table",zC="db.cassandra.idempotence",BC="db.cassandra.speculative_execution_count",AC="db.cassandra.coordinator.id",UC="db.cassandra.coordinator.dc",NC="db.hbase.namespace",OC="db.redis.database_index",DC="db.mongodb.collection",TC="db.sql.table",IC="exception.type",$C="exception.message",CC="exception.stacktrace",EC="exception.escaped",MC="faas.trigger",RC="faas.execution",PC="faas.document.collection",LC="faas.document.operation",wC="faas.document.time",SC="faas.document.name",fC="faas.time",kC="faas.cron",yC="faas.coldstart",vC="faas.invoked_name",hC="faas.invoked_provider",jC="faas.invoked_region",_C="net.transport",xC="net.peer.ip",bC="net.peer.port",uC="net.peer.name",mC="net.host.ip",gC="net.host.port",dC="net.host.name",cC="net.host.connection.type",lC="net.host.connection.subtype",nC="net.host.carrier.name",pC="net.host.carrier.mcc",iC="net.host.carrier.mnc",rC="net.host.carrier.icc",aC="peer.service",oC="enduser.id",tC="enduser.role",sC="enduser.scope",eC="thread.id",YE="thread.name",ZE="code.function",QE="code.namespace",XE="code.filepath",JE="code.lineno",WE="http.method",KE="http.url",GE="http.target",FE="http.host",HE="http.scheme",VE="http.status_code",qE="http.flavor",zE="http.user_agent",BE="http.request_content_length",AE="http.request_content_length_uncompressed",UE="http.response_content_length",NE="http.response_content_length_uncompressed",OE="http.server_name",DE="http.route",TE="http.client_ip",IE="aws.dynamodb.table_names",$E="aws.dynamodb.consumed_capacity",CE="aws.dynamodb.item_collection_metrics",EE="aws.dynamodb.provisioned_read_capacity",ME="aws.dynamodb.provisioned_write_capacity",RE="aws.dynamodb.consistent_read",PE="aws.dynamodb.projection",LE="aws.dynamodb.limit",wE="aws.dynamodb.attributes_to_get",SE="aws.dynamodb.index_name",fE="aws.dynamodb.select",kE="aws.dynamodb.global_secondary_indexes",yE="aws.dynamodb.local_secondary_indexes",vE="aws.dynamodb.exclusive_start_table",hE="aws.dynamodb.table_count",jE="aws.dynamodb.scan_forward",_E="aws.dynamodb.segment",xE="aws.dynamodb.total_segments",bE="aws.dynamodb.count",uE="aws.dynamodb.scanned_count",mE="aws.dynamodb.attribute_definitions",gE="aws.dynamodb.global_secondary_index_updates",dE="messaging.system",cE="messaging.destination",lE="messaging.destination_kind",nE="messaging.temp_destination",pE="messaging.protocol",iE="messaging.protocol_version",rE="messaging.url",aE="messaging.message_id",oE="messaging.conversation_id",tE="messaging.message_payload_size_bytes",sE="messaging.message_payload_compressed_size_bytes",eE="messaging.operation",YM="messaging.consumer_id",ZM="messaging.rabbitmq.routing_key",QM="messaging.kafka.message_key",XM="messaging.kafka.consumer_group",JM="messaging.kafka.client_id",WM="messaging.kafka.partition",KM="messaging.kafka.tombstone",GM="rpc.system",FM="rpc.service",HM="rpc.method",VM="rpc.grpc.status_code",qM="rpc.jsonrpc.version",zM="rpc.jsonrpc.request_id",BM="rpc.jsonrpc.error_code",AM="rpc.jsonrpc.error_message",UM="message.type",NM="message.id",OM="message.compressed_size",DM="message.uncompressed_size";d2.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=e$;d2.SEMATTRS_DB_SYSTEM=YC;d2.SEMATTRS_DB_CONNECTION_STRING=ZC;d2.SEMATTRS_DB_USER=QC;d2.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=XC;d2.SEMATTRS_DB_NAME=JC;d2.SEMATTRS_DB_STATEMENT=WC;d2.SEMATTRS_DB_OPERATION=KC;d2.SEMATTRS_DB_MSSQL_INSTANCE_NAME=GC;d2.SEMATTRS_DB_CASSANDRA_KEYSPACE=FC;d2.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=HC;d2.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=VC;d2.SEMATTRS_DB_CASSANDRA_TABLE=qC;d2.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=zC;d2.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=BC;d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=AC;d2.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=UC;d2.SEMATTRS_DB_HBASE_NAMESPACE=NC;d2.SEMATTRS_DB_REDIS_DATABASE_INDEX=OC;d2.SEMATTRS_DB_MONGODB_COLLECTION=DC;d2.SEMATTRS_DB_SQL_TABLE=TC;d2.SEMATTRS_EXCEPTION_TYPE=IC;d2.SEMATTRS_EXCEPTION_MESSAGE=$C;d2.SEMATTRS_EXCEPTION_STACKTRACE=CC;d2.SEMATTRS_EXCEPTION_ESCAPED=EC;d2.SEMATTRS_FAAS_TRIGGER=MC;d2.SEMATTRS_FAAS_EXECUTION=RC;d2.SEMATTRS_FAAS_DOCUMENT_COLLECTION=PC;d2.SEMATTRS_FAAS_DOCUMENT_OPERATION=LC;d2.SEMATTRS_FAAS_DOCUMENT_TIME=wC;d2.SEMATTRS_FAAS_DOCUMENT_NAME=SC;d2.SEMATTRS_FAAS_TIME=fC;d2.SEMATTRS_FAAS_CRON=kC;d2.SEMATTRS_FAAS_COLDSTART=yC;d2.SEMATTRS_FAAS_INVOKED_NAME=vC;d2.SEMATTRS_FAAS_INVOKED_PROVIDER=hC;d2.SEMATTRS_FAAS_INVOKED_REGION=jC;d2.SEMATTRS_NET_TRANSPORT=_C;d2.SEMATTRS_NET_PEER_IP=xC;d2.SEMATTRS_NET_PEER_PORT=bC;d2.SEMATTRS_NET_PEER_NAME=uC;d2.SEMATTRS_NET_HOST_IP=mC;d2.SEMATTRS_NET_HOST_PORT=gC;d2.SEMATTRS_NET_HOST_NAME=dC;d2.SEMATTRS_NET_HOST_CONNECTION_TYPE=cC;d2.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=lC;d2.SEMATTRS_NET_HOST_CARRIER_NAME=nC;d2.SEMATTRS_NET_HOST_CARRIER_MCC=pC;d2.SEMATTRS_NET_HOST_CARRIER_MNC=iC;d2.SEMATTRS_NET_HOST_CARRIER_ICC=rC;d2.SEMATTRS_PEER_SERVICE=aC;d2.SEMATTRS_ENDUSER_ID=oC;d2.SEMATTRS_ENDUSER_ROLE=tC;d2.SEMATTRS_ENDUSER_SCOPE=sC;d2.SEMATTRS_THREAD_ID=eC;d2.SEMATTRS_THREAD_NAME=YE;d2.SEMATTRS_CODE_FUNCTION=ZE;d2.SEMATTRS_CODE_NAMESPACE=QE;d2.SEMATTRS_CODE_FILEPATH=XE;d2.SEMATTRS_CODE_LINENO=JE;d2.SEMATTRS_HTTP_METHOD=WE;d2.SEMATTRS_HTTP_URL=KE;d2.SEMATTRS_HTTP_TARGET=GE;d2.SEMATTRS_HTTP_HOST=FE;d2.SEMATTRS_HTTP_SCHEME=HE;d2.SEMATTRS_HTTP_STATUS_CODE=VE;d2.SEMATTRS_HTTP_FLAVOR=qE;d2.SEMATTRS_HTTP_USER_AGENT=zE;d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=BE;d2.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=AE;d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=UE;d2.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=NE;d2.SEMATTRS_HTTP_SERVER_NAME=OE;d2.SEMATTRS_HTTP_ROUTE=DE;d2.SEMATTRS_HTTP_CLIENT_IP=TE;d2.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=IE;d2.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=$E;d2.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=CE;d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=EE;d2.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=ME;d2.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=RE;d2.SEMATTRS_AWS_DYNAMODB_PROJECTION=PE;d2.SEMATTRS_AWS_DYNAMODB_LIMIT=LE;d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=wE;d2.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=SE;d2.SEMATTRS_AWS_DYNAMODB_SELECT=fE;d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=kE;d2.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=yE;d2.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=vE;d2.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=hE;d2.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=jE;d2.SEMATTRS_AWS_DYNAMODB_SEGMENT=_E;d2.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=xE;d2.SEMATTRS_AWS_DYNAMODB_COUNT=bE;d2.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=uE;d2.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=mE;d2.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=gE;d2.SEMATTRS_MESSAGING_SYSTEM=dE;d2.SEMATTRS_MESSAGING_DESTINATION=cE;d2.SEMATTRS_MESSAGING_DESTINATION_KIND=lE;d2.SEMATTRS_MESSAGING_TEMP_DESTINATION=nE;d2.SEMATTRS_MESSAGING_PROTOCOL=pE;d2.SEMATTRS_MESSAGING_PROTOCOL_VERSION=iE;d2.SEMATTRS_MESSAGING_URL=rE;d2.SEMATTRS_MESSAGING_MESSAGE_ID=aE;d2.SEMATTRS_MESSAGING_CONVERSATION_ID=oE;d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=tE;d2.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=sE;d2.SEMATTRS_MESSAGING_OPERATION=eE;d2.SEMATTRS_MESSAGING_CONSUMER_ID=YM;d2.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=ZM;d2.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=QM;d2.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=XM;d2.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=JM;d2.SEMATTRS_MESSAGING_KAFKA_PARTITION=WM;d2.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=KM;d2.SEMATTRS_RPC_SYSTEM=GM;d2.SEMATTRS_RPC_SERVICE=FM;d2.SEMATTRS_RPC_METHOD=HM;d2.SEMATTRS_RPC_GRPC_STATUS_CODE=VM;d2.SEMATTRS_RPC_JSONRPC_VERSION=qM;d2.SEMATTRS_RPC_JSONRPC_REQUEST_ID=zM;d2.SEMATTRS_RPC_JSONRPC_ERROR_CODE=BM;d2.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=AM;d2.SEMATTRS_MESSAGE_TYPE=UM;d2.SEMATTRS_MESSAGE_ID=NM;d2.SEMATTRS_MESSAGE_COMPRESSED_SIZE=OM;d2.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=DM;d2.SemanticAttributes=(0,X9.createConstMap)([e$,YC,ZC,QC,XC,JC,WC,KC,GC,FC,HC,VC,qC,zC,BC,AC,UC,NC,OC,DC,TC,IC,$C,CC,EC,MC,RC,PC,LC,wC,SC,fC,kC,yC,vC,hC,jC,_C,xC,bC,uC,mC,gC,dC,cC,lC,nC,pC,iC,rC,aC,oC,tC,sC,eC,YE,ZE,QE,XE,JE,WE,KE,GE,FE,HE,VE,qE,zE,BE,AE,UE,NE,OE,DE,TE,IE,$E,CE,EE,ME,RE,PE,LE,wE,SE,fE,kE,yE,vE,hE,jE,_E,xE,bE,uE,mE,gE,dE,cE,lE,nE,pE,iE,rE,aE,oE,tE,sE,eE,YM,ZM,QM,XM,JM,WM,KM,GM,FM,HM,VM,qM,zM,BM,AM,UM,NM,OM,DM]);var TM="other_sql",IM="mssql",$M="mysql",CM="oracle",EM="db2",MM="postgresql",RM="redshift",PM="hive",LM="cloudscape",wM="hsqldb",SM="progress",fM="maxdb",kM="hanadb",yM="ingres",vM="firstsql",hM="edb",jM="cache",_M="adabas",xM="firebird",bM="derby",uM="filemaker",mM="informix",gM="instantdb",dM="interbase",cM="mariadb",lM="netezza",nM="pervasive",pM="pointbase",iM="sqlite",rM="sybase",aM="teradata",oM="vertica",tM="h2",sM="coldfusion",eM="cassandra",YR="hbase",ZR="mongodb",QR="redis",XR="couchbase",JR="couchdb",WR="cosmosdb",KR="dynamodb",GR="neo4j",FR="geode",HR="elasticsearch",VR="memcached",qR="cockroachdb";d2.DBSYSTEMVALUES_OTHER_SQL=TM;d2.DBSYSTEMVALUES_MSSQL=IM;d2.DBSYSTEMVALUES_MYSQL=$M;d2.DBSYSTEMVALUES_ORACLE=CM;d2.DBSYSTEMVALUES_DB2=EM;d2.DBSYSTEMVALUES_POSTGRESQL=MM;d2.DBSYSTEMVALUES_REDSHIFT=RM;d2.DBSYSTEMVALUES_HIVE=PM;d2.DBSYSTEMVALUES_CLOUDSCAPE=LM;d2.DBSYSTEMVALUES_HSQLDB=wM;d2.DBSYSTEMVALUES_PROGRESS=SM;d2.DBSYSTEMVALUES_MAXDB=fM;d2.DBSYSTEMVALUES_HANADB=kM;d2.DBSYSTEMVALUES_INGRES=yM;d2.DBSYSTEMVALUES_FIRSTSQL=vM;d2.DBSYSTEMVALUES_EDB=hM;d2.DBSYSTEMVALUES_CACHE=jM;d2.DBSYSTEMVALUES_ADABAS=_M;d2.DBSYSTEMVALUES_FIREBIRD=xM;d2.DBSYSTEMVALUES_DERBY=bM;d2.DBSYSTEMVALUES_FILEMAKER=uM;d2.DBSYSTEMVALUES_INFORMIX=mM;d2.DBSYSTEMVALUES_INSTANTDB=gM;d2.DBSYSTEMVALUES_INTERBASE=dM;d2.DBSYSTEMVALUES_MARIADB=cM;d2.DBSYSTEMVALUES_NETEZZA=lM;d2.DBSYSTEMVALUES_PERVASIVE=nM;d2.DBSYSTEMVALUES_POINTBASE=pM;d2.DBSYSTEMVALUES_SQLITE=iM;d2.DBSYSTEMVALUES_SYBASE=rM;d2.DBSYSTEMVALUES_TERADATA=aM;d2.DBSYSTEMVALUES_VERTICA=oM;d2.DBSYSTEMVALUES_H2=tM;d2.DBSYSTEMVALUES_COLDFUSION=sM;d2.DBSYSTEMVALUES_CASSANDRA=eM;d2.DBSYSTEMVALUES_HBASE=YR;d2.DBSYSTEMVALUES_MONGODB=ZR;d2.DBSYSTEMVALUES_REDIS=QR;d2.DBSYSTEMVALUES_COUCHBASE=XR;d2.DBSYSTEMVALUES_COUCHDB=JR;d2.DBSYSTEMVALUES_COSMOSDB=WR;d2.DBSYSTEMVALUES_DYNAMODB=KR;d2.DBSYSTEMVALUES_NEO4J=GR;d2.DBSYSTEMVALUES_GEODE=FR;d2.DBSYSTEMVALUES_ELASTICSEARCH=HR;d2.DBSYSTEMVALUES_MEMCACHED=VR;d2.DBSYSTEMVALUES_COCKROACHDB=qR;d2.DbSystemValues=(0,X9.createConstMap)([TM,IM,$M,CM,EM,MM,RM,PM,LM,wM,SM,fM,kM,yM,vM,hM,jM,_M,xM,bM,uM,mM,gM,dM,cM,lM,nM,pM,iM,rM,aM,oM,tM,sM,eM,YR,ZR,QR,XR,JR,WR,KR,GR,FR,HR,VR,qR]);var zR="all",BR="each_quorum",AR="quorum",UR="local_quorum",NR="one",OR="two",DR="three",TR="local_one",IR="any",$R="serial",CR="local_serial";d2.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=zR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=BR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=AR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=UR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=NR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=OR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=DR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=TR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=IR;d2.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=$R;d2.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=CR;d2.DbCassandraConsistencyLevelValues=(0,X9.createConstMap)([zR,BR,AR,UR,NR,OR,DR,TR,IR,$R,CR]);var ER="datasource",MR="http",RR="pubsub",PR="timer",LR="other";d2.FAASTRIGGERVALUES_DATASOURCE=ER;d2.FAASTRIGGERVALUES_HTTP=MR;d2.FAASTRIGGERVALUES_PUBSUB=RR;d2.FAASTRIGGERVALUES_TIMER=PR;d2.FAASTRIGGERVALUES_OTHER=LR;d2.FaasTriggerValues=(0,X9.createConstMap)([ER,MR,RR,PR,LR]);var wR="insert",SR="edit",fR="delete";d2.FAASDOCUMENTOPERATIONVALUES_INSERT=wR;d2.FAASDOCUMENTOPERATIONVALUES_EDIT=SR;d2.FAASDOCUMENTOPERATIONVALUES_DELETE=fR;d2.FaasDocumentOperationValues=(0,X9.createConstMap)([wR,SR,fR]);var kR="alibaba_cloud",yR="aws",vR="azure",hR="gcp";d2.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=kR;d2.FAASINVOKEDPROVIDERVALUES_AWS=yR;d2.FAASINVOKEDPROVIDERVALUES_AZURE=vR;d2.FAASINVOKEDPROVIDERVALUES_GCP=hR;d2.FaasInvokedProviderValues=(0,X9.createConstMap)([kR,yR,vR,hR]);var jR="ip_tcp",_R="ip_udp",xR="ip",bR="unix",uR="pipe",mR="inproc",gR="other";d2.NETTRANSPORTVALUES_IP_TCP=jR;d2.NETTRANSPORTVALUES_IP_UDP=_R;d2.NETTRANSPORTVALUES_IP=xR;d2.NETTRANSPORTVALUES_UNIX=bR;d2.NETTRANSPORTVALUES_PIPE=uR;d2.NETTRANSPORTVALUES_INPROC=mR;d2.NETTRANSPORTVALUES_OTHER=gR;d2.NetTransportValues=(0,X9.createConstMap)([jR,_R,xR,bR,uR,mR,gR]);var dR="wifi",cR="wired",lR="cell",nR="unavailable",pR="unknown";d2.NETHOSTCONNECTIONTYPEVALUES_WIFI=dR;d2.NETHOSTCONNECTIONTYPEVALUES_WIRED=cR;d2.NETHOSTCONNECTIONTYPEVALUES_CELL=lR;d2.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=nR;d2.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=pR;d2.NetHostConnectionTypeValues=(0,X9.createConstMap)([dR,cR,lR,nR,pR]);var iR="gprs",rR="edge",aR="umts",oR="cdma",tR="evdo_0",sR="evdo_a",eR="cdma2000_1xrtt",Y2="hsdpa",Z2="hsupa",Q2="hspa",X2="iden",J2="evdo_b",W2="lte",K2="ehrpd",G2="hspap",F2="gsm",H2="td_scdma",V2="iwlan",q2="nr",z2="nrnsa",B2="lte_ca";d2.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=iR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=rR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=aR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=oR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=tR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=sR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=eR;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=Y2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=Z2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=Q2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=X2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=J2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=W2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=K2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=G2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=F2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=H2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=V2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_NR=q2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=z2;d2.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=B2;d2.NetHostConnectionSubtypeValues=(0,X9.createConstMap)([iR,rR,aR,oR,tR,sR,eR,Y2,Z2,Q2,X2,J2,W2,K2,G2,F2,H2,V2,q2,z2,B2]);var A2="1.0",U2="1.1",N2="2.0",O2="SPDY",D2="QUIC";d2.HTTPFLAVORVALUES_HTTP_1_0=A2;d2.HTTPFLAVORVALUES_HTTP_1_1=U2;d2.HTTPFLAVORVALUES_HTTP_2_0=N2;d2.HTTPFLAVORVALUES_SPDY=O2;d2.HTTPFLAVORVALUES_QUIC=D2;d2.HttpFlavorValues={HTTP_1_0:A2,HTTP_1_1:U2,HTTP_2_0:N2,SPDY:O2,QUIC:D2};var T2="queue",I2="topic";d2.MESSAGINGDESTINATIONKINDVALUES_QUEUE=T2;d2.MESSAGINGDESTINATIONKINDVALUES_TOPIC=I2;d2.MessagingDestinationKindValues=(0,X9.createConstMap)([T2,I2]);var $2="receive",C2="process";d2.MESSAGINGOPERATIONVALUES_RECEIVE=$2;d2.MESSAGINGOPERATIONVALUES_PROCESS=C2;d2.MessagingOperationValues=(0,X9.createConstMap)([$2,C2]);var E2=0,M2=1,R2=2,P2=3,L2=4,w2=5,S2=6,f2=7,k2=8,y2=9,v2=10,h2=11,j2=12,_2=13,x2=14,b2=15,u2=16;d2.RPCGRPCSTATUSCODEVALUES_OK=E2;d2.RPCGRPCSTATUSCODEVALUES_CANCELLED=M2;d2.RPCGRPCSTATUSCODEVALUES_UNKNOWN=R2;d2.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=P2;d2.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=L2;d2.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=w2;d2.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=S2;d2.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=f2;d2.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=k2;d2.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=y2;d2.RPCGRPCSTATUSCODEVALUES_ABORTED=v2;d2.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=h2;d2.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=j2;d2.RPCGRPCSTATUSCODEVALUES_INTERNAL=_2;d2.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=x2;d2.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=b2;d2.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=u2;d2.RpcGrpcStatusCodeValues={OK:E2,CANCELLED:M2,UNKNOWN:R2,INVALID_ARGUMENT:P2,DEADLINE_EXCEEDED:L2,NOT_FOUND:w2,ALREADY_EXISTS:S2,PERMISSION_DENIED:f2,RESOURCE_EXHAUSTED:k2,FAILED_PRECONDITION:y2,ABORTED:v2,OUT_OF_RANGE:h2,UNIMPLEMENTED:j2,INTERNAL:_2,UNAVAILABLE:x2,DATA_LOSS:b2,UNAUTHENTICATED:u2};var m2="SENT",g2="RECEIVED";d2.MESSAGETYPEVALUES_SENT=m2;d2.MESSAGETYPEVALUES_RECEIVED=g2;d2.MessageTypeValues=(0,X9.createConstMap)([m2,g2])});var o2=H0((x5)=>{var FX0=x5&&x5.__createBinding||(Object.create?function(Y,Z,W,H){if(H===void 0)H=W;var F=Object.getOwnPropertyDescriptor(Z,W);if(!F||("get"in F?!Z.__esModule:F.writable||F.configurable))F={enumerable:!0,get:function(){return Z[W]}};Object.defineProperty(Y,H,F)}:function(Y,Z,W,H){if(H===void 0)H=W;Y[H]=Z[W]}),HX0=x5&&x5.__exportStar||function(Y,Z){for(var W in Y)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(Z,W))FX0(Z,Y,W)};Object.defineProperty(x5,"__esModule",{value:!0});HX0(a2(),x5)});var Rw=H0(($w)=>{Object.defineProperty($w,"__esModule",{value:!0});$w.SEMRESATTRS_K8S_STATEFULSET_NAME=$w.SEMRESATTRS_K8S_STATEFULSET_UID=$w.SEMRESATTRS_K8S_DEPLOYMENT_NAME=$w.SEMRESATTRS_K8S_DEPLOYMENT_UID=$w.SEMRESATTRS_K8S_REPLICASET_NAME=$w.SEMRESATTRS_K8S_REPLICASET_UID=$w.SEMRESATTRS_K8S_CONTAINER_NAME=$w.SEMRESATTRS_K8S_POD_NAME=$w.SEMRESATTRS_K8S_POD_UID=$w.SEMRESATTRS_K8S_NAMESPACE_NAME=$w.SEMRESATTRS_K8S_NODE_UID=$w.SEMRESATTRS_K8S_NODE_NAME=$w.SEMRESATTRS_K8S_CLUSTER_NAME=$w.SEMRESATTRS_HOST_IMAGE_VERSION=$w.SEMRESATTRS_HOST_IMAGE_ID=$w.SEMRESATTRS_HOST_IMAGE_NAME=$w.SEMRESATTRS_HOST_ARCH=$w.SEMRESATTRS_HOST_TYPE=$w.SEMRESATTRS_HOST_NAME=$w.SEMRESATTRS_HOST_ID=$w.SEMRESATTRS_FAAS_MAX_MEMORY=$w.SEMRESATTRS_FAAS_INSTANCE=$w.SEMRESATTRS_FAAS_VERSION=$w.SEMRESATTRS_FAAS_ID=$w.SEMRESATTRS_FAAS_NAME=$w.SEMRESATTRS_DEVICE_MODEL_NAME=$w.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=$w.SEMRESATTRS_DEVICE_ID=$w.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=$w.SEMRESATTRS_CONTAINER_IMAGE_TAG=$w.SEMRESATTRS_CONTAINER_IMAGE_NAME=$w.SEMRESATTRS_CONTAINER_RUNTIME=$w.SEMRESATTRS_CONTAINER_ID=$w.SEMRESATTRS_CONTAINER_NAME=$w.SEMRESATTRS_AWS_LOG_STREAM_ARNS=$w.SEMRESATTRS_AWS_LOG_STREAM_NAMES=$w.SEMRESATTRS_AWS_LOG_GROUP_ARNS=$w.SEMRESATTRS_AWS_LOG_GROUP_NAMES=$w.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=$w.SEMRESATTRS_AWS_ECS_TASK_REVISION=$w.SEMRESATTRS_AWS_ECS_TASK_FAMILY=$w.SEMRESATTRS_AWS_ECS_TASK_ARN=$w.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=$w.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=$w.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=$w.SEMRESATTRS_CLOUD_PLATFORM=$w.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=$w.SEMRESATTRS_CLOUD_REGION=$w.SEMRESATTRS_CLOUD_ACCOUNT_ID=$w.SEMRESATTRS_CLOUD_PROVIDER=void 0;$w.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=$w.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=$w.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=$w.CLOUDPLATFORMVALUES_AZURE_AKS=$w.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=$w.CLOUDPLATFORMVALUES_AZURE_VM=$w.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=$w.CLOUDPLATFORMVALUES_AWS_LAMBDA=$w.CLOUDPLATFORMVALUES_AWS_EKS=$w.CLOUDPLATFORMVALUES_AWS_ECS=$w.CLOUDPLATFORMVALUES_AWS_EC2=$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=$w.CloudProviderValues=$w.CLOUDPROVIDERVALUES_GCP=$w.CLOUDPROVIDERVALUES_AZURE=$w.CLOUDPROVIDERVALUES_AWS=$w.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=$w.SemanticResourceAttributes=$w.SEMRESATTRS_WEBENGINE_DESCRIPTION=$w.SEMRESATTRS_WEBENGINE_VERSION=$w.SEMRESATTRS_WEBENGINE_NAME=$w.SEMRESATTRS_TELEMETRY_AUTO_VERSION=$w.SEMRESATTRS_TELEMETRY_SDK_VERSION=$w.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=$w.SEMRESATTRS_TELEMETRY_SDK_NAME=$w.SEMRESATTRS_SERVICE_VERSION=$w.SEMRESATTRS_SERVICE_INSTANCE_ID=$w.SEMRESATTRS_SERVICE_NAMESPACE=$w.SEMRESATTRS_SERVICE_NAME=$w.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=$w.SEMRESATTRS_PROCESS_RUNTIME_VERSION=$w.SEMRESATTRS_PROCESS_RUNTIME_NAME=$w.SEMRESATTRS_PROCESS_OWNER=$w.SEMRESATTRS_PROCESS_COMMAND_ARGS=$w.SEMRESATTRS_PROCESS_COMMAND_LINE=$w.SEMRESATTRS_PROCESS_COMMAND=$w.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=$w.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=$w.SEMRESATTRS_PROCESS_PID=$w.SEMRESATTRS_OS_VERSION=$w.SEMRESATTRS_OS_NAME=$w.SEMRESATTRS_OS_DESCRIPTION=$w.SEMRESATTRS_OS_TYPE=$w.SEMRESATTRS_K8S_CRONJOB_NAME=$w.SEMRESATTRS_K8S_CRONJOB_UID=$w.SEMRESATTRS_K8S_JOB_NAME=$w.SEMRESATTRS_K8S_JOB_UID=$w.SEMRESATTRS_K8S_DAEMONSET_NAME=$w.SEMRESATTRS_K8S_DAEMONSET_UID=void 0;$w.TelemetrySdkLanguageValues=$w.TELEMETRYSDKLANGUAGEVALUES_WEBJS=$w.TELEMETRYSDKLANGUAGEVALUES_RUBY=$w.TELEMETRYSDKLANGUAGEVALUES_PYTHON=$w.TELEMETRYSDKLANGUAGEVALUES_PHP=$w.TELEMETRYSDKLANGUAGEVALUES_NODEJS=$w.TELEMETRYSDKLANGUAGEVALUES_JAVA=$w.TELEMETRYSDKLANGUAGEVALUES_GO=$w.TELEMETRYSDKLANGUAGEVALUES_ERLANG=$w.TELEMETRYSDKLANGUAGEVALUES_DOTNET=$w.TELEMETRYSDKLANGUAGEVALUES_CPP=$w.OsTypeValues=$w.OSTYPEVALUES_Z_OS=$w.OSTYPEVALUES_SOLARIS=$w.OSTYPEVALUES_AIX=$w.OSTYPEVALUES_HPUX=$w.OSTYPEVALUES_DRAGONFLYBSD=$w.OSTYPEVALUES_OPENBSD=$w.OSTYPEVALUES_NETBSD=$w.OSTYPEVALUES_FREEBSD=$w.OSTYPEVALUES_DARWIN=$w.OSTYPEVALUES_LINUX=$w.OSTYPEVALUES_WINDOWS=$w.HostArchValues=$w.HOSTARCHVALUES_X86=$w.HOSTARCHVALUES_PPC64=$w.HOSTARCHVALUES_PPC32=$w.HOSTARCHVALUES_IA64=$w.HOSTARCHVALUES_ARM64=$w.HOSTARCHVALUES_ARM32=$w.HOSTARCHVALUES_AMD64=$w.AwsEcsLaunchtypeValues=$w.AWSECSLAUNCHTYPEVALUES_FARGATE=$w.AWSECSLAUNCHTYPEVALUES_EC2=$w.CloudPlatformValues=$w.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=$w.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=$w.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=$w.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=void 0;var b5=KH(),t2="cloud.provider",s2="cloud.account.id",e2="cloud.region",YP="cloud.availability_zone",ZP="cloud.platform",QP="aws.ecs.container.arn",XP="aws.ecs.cluster.arn",JP="aws.ecs.launchtype",WP="aws.ecs.task.arn",KP="aws.ecs.task.family",GP="aws.ecs.task.revision",FP="aws.eks.cluster.arn",HP="aws.log.group.names",VP="aws.log.group.arns",qP="aws.log.stream.names",zP="aws.log.stream.arns",BP="container.name",AP="container.id",UP="container.runtime",NP="container.image.name",OP="container.image.tag",DP="deployment.environment",TP="device.id",IP="device.model.identifier",$P="device.model.name",CP="faas.name",EP="faas.id",MP="faas.version",RP="faas.instance",PP="faas.max_memory",LP="host.id",wP="host.name",SP="host.type",fP="host.arch",kP="host.image.name",yP="host.image.id",vP="host.image.version",hP="k8s.cluster.name",jP="k8s.node.name",_P="k8s.node.uid",xP="k8s.namespace.name",bP="k8s.pod.uid",uP="k8s.pod.name",mP="k8s.container.name",gP="k8s.replicaset.uid",dP="k8s.replicaset.name",cP="k8s.deployment.uid",lP="k8s.deployment.name",nP="k8s.statefulset.uid",pP="k8s.statefulset.name",iP="k8s.daemonset.uid",rP="k8s.daemonset.name",aP="k8s.job.uid",oP="k8s.job.name",tP="k8s.cronjob.uid",sP="k8s.cronjob.name",eP="os.type",YL="os.description",ZL="os.name",QL="os.version",XL="process.pid",JL="process.executable.name",WL="process.executable.path",KL="process.command",GL="process.command_line",FL="process.command_args",HL="process.owner",VL="process.runtime.name",qL="process.runtime.version",zL="process.runtime.description",BL="service.name",AL="service.namespace",UL="service.instance.id",NL="service.version",OL="telemetry.sdk.name",DL="telemetry.sdk.language",TL="telemetry.sdk.version",IL="telemetry.auto.version",$L="webengine.name",CL="webengine.version",EL="webengine.description";$w.SEMRESATTRS_CLOUD_PROVIDER=t2;$w.SEMRESATTRS_CLOUD_ACCOUNT_ID=s2;$w.SEMRESATTRS_CLOUD_REGION=e2;$w.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=YP;$w.SEMRESATTRS_CLOUD_PLATFORM=ZP;$w.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=QP;$w.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=XP;$w.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=JP;$w.SEMRESATTRS_AWS_ECS_TASK_ARN=WP;$w.SEMRESATTRS_AWS_ECS_TASK_FAMILY=KP;$w.SEMRESATTRS_AWS_ECS_TASK_REVISION=GP;$w.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=FP;$w.SEMRESATTRS_AWS_LOG_GROUP_NAMES=HP;$w.SEMRESATTRS_AWS_LOG_GROUP_ARNS=VP;$w.SEMRESATTRS_AWS_LOG_STREAM_NAMES=qP;$w.SEMRESATTRS_AWS_LOG_STREAM_ARNS=zP;$w.SEMRESATTRS_CONTAINER_NAME=BP;$w.SEMRESATTRS_CONTAINER_ID=AP;$w.SEMRESATTRS_CONTAINER_RUNTIME=UP;$w.SEMRESATTRS_CONTAINER_IMAGE_NAME=NP;$w.SEMRESATTRS_CONTAINER_IMAGE_TAG=OP;$w.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=DP;$w.SEMRESATTRS_DEVICE_ID=TP;$w.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=IP;$w.SEMRESATTRS_DEVICE_MODEL_NAME=$P;$w.SEMRESATTRS_FAAS_NAME=CP;$w.SEMRESATTRS_FAAS_ID=EP;$w.SEMRESATTRS_FAAS_VERSION=MP;$w.SEMRESATTRS_FAAS_INSTANCE=RP;$w.SEMRESATTRS_FAAS_MAX_MEMORY=PP;$w.SEMRESATTRS_HOST_ID=LP;$w.SEMRESATTRS_HOST_NAME=wP;$w.SEMRESATTRS_HOST_TYPE=SP;$w.SEMRESATTRS_HOST_ARCH=fP;$w.SEMRESATTRS_HOST_IMAGE_NAME=kP;$w.SEMRESATTRS_HOST_IMAGE_ID=yP;$w.SEMRESATTRS_HOST_IMAGE_VERSION=vP;$w.SEMRESATTRS_K8S_CLUSTER_NAME=hP;$w.SEMRESATTRS_K8S_NODE_NAME=jP;$w.SEMRESATTRS_K8S_NODE_UID=_P;$w.SEMRESATTRS_K8S_NAMESPACE_NAME=xP;$w.SEMRESATTRS_K8S_POD_UID=bP;$w.SEMRESATTRS_K8S_POD_NAME=uP;$w.SEMRESATTRS_K8S_CONTAINER_NAME=mP;$w.SEMRESATTRS_K8S_REPLICASET_UID=gP;$w.SEMRESATTRS_K8S_REPLICASET_NAME=dP;$w.SEMRESATTRS_K8S_DEPLOYMENT_UID=cP;$w.SEMRESATTRS_K8S_DEPLOYMENT_NAME=lP;$w.SEMRESATTRS_K8S_STATEFULSET_UID=nP;$w.SEMRESATTRS_K8S_STATEFULSET_NAME=pP;$w.SEMRESATTRS_K8S_DAEMONSET_UID=iP;$w.SEMRESATTRS_K8S_DAEMONSET_NAME=rP;$w.SEMRESATTRS_K8S_JOB_UID=aP;$w.SEMRESATTRS_K8S_JOB_NAME=oP;$w.SEMRESATTRS_K8S_CRONJOB_UID=tP;$w.SEMRESATTRS_K8S_CRONJOB_NAME=sP;$w.SEMRESATTRS_OS_TYPE=eP;$w.SEMRESATTRS_OS_DESCRIPTION=YL;$w.SEMRESATTRS_OS_NAME=ZL;$w.SEMRESATTRS_OS_VERSION=QL;$w.SEMRESATTRS_PROCESS_PID=XL;$w.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=JL;$w.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=WL;$w.SEMRESATTRS_PROCESS_COMMAND=KL;$w.SEMRESATTRS_PROCESS_COMMAND_LINE=GL;$w.SEMRESATTRS_PROCESS_COMMAND_ARGS=FL;$w.SEMRESATTRS_PROCESS_OWNER=HL;$w.SEMRESATTRS_PROCESS_RUNTIME_NAME=VL;$w.SEMRESATTRS_PROCESS_RUNTIME_VERSION=qL;$w.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=zL;$w.SEMRESATTRS_SERVICE_NAME=BL;$w.SEMRESATTRS_SERVICE_NAMESPACE=AL;$w.SEMRESATTRS_SERVICE_INSTANCE_ID=UL;$w.SEMRESATTRS_SERVICE_VERSION=NL;$w.SEMRESATTRS_TELEMETRY_SDK_NAME=OL;$w.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=DL;$w.SEMRESATTRS_TELEMETRY_SDK_VERSION=TL;$w.SEMRESATTRS_TELEMETRY_AUTO_VERSION=IL;$w.SEMRESATTRS_WEBENGINE_NAME=$L;$w.SEMRESATTRS_WEBENGINE_VERSION=CL;$w.SEMRESATTRS_WEBENGINE_DESCRIPTION=EL;$w.SemanticResourceAttributes=(0,b5.createConstMap)([t2,s2,e2,YP,ZP,QP,XP,JP,WP,KP,GP,FP,HP,VP,qP,zP,BP,AP,UP,NP,OP,DP,TP,IP,$P,CP,EP,MP,RP,PP,LP,wP,SP,fP,kP,yP,vP,hP,jP,_P,xP,bP,uP,mP,gP,dP,cP,lP,nP,pP,iP,rP,aP,oP,tP,sP,eP,YL,ZL,QL,XL,JL,WL,KL,GL,FL,HL,VL,qL,zL,BL,AL,UL,NL,OL,DL,TL,IL,$L,CL,EL]);var ML="alibaba_cloud",RL="aws",PL="azure",LL="gcp";$w.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=ML;$w.CLOUDPROVIDERVALUES_AWS=RL;$w.CLOUDPROVIDERVALUES_AZURE=PL;$w.CLOUDPROVIDERVALUES_GCP=LL;$w.CloudProviderValues=(0,b5.createConstMap)([ML,RL,PL,LL]);var wL="alibaba_cloud_ecs",SL="alibaba_cloud_fc",fL="aws_ec2",kL="aws_ecs",yL="aws_eks",vL="aws_lambda",hL="aws_elastic_beanstalk",jL="azure_vm",_L="azure_container_instances",xL="azure_aks",bL="azure_functions",uL="azure_app_service",mL="gcp_compute_engine",gL="gcp_cloud_run",dL="gcp_kubernetes_engine",cL="gcp_cloud_functions",lL="gcp_app_engine";$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=wL;$w.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=SL;$w.CLOUDPLATFORMVALUES_AWS_EC2=fL;$w.CLOUDPLATFORMVALUES_AWS_ECS=kL;$w.CLOUDPLATFORMVALUES_AWS_EKS=yL;$w.CLOUDPLATFORMVALUES_AWS_LAMBDA=vL;$w.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=hL;$w.CLOUDPLATFORMVALUES_AZURE_VM=jL;$w.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=_L;$w.CLOUDPLATFORMVALUES_AZURE_AKS=xL;$w.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=bL;$w.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=uL;$w.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=mL;$w.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=gL;$w.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=dL;$w.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=cL;$w.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=lL;$w.CloudPlatformValues=(0,b5.createConstMap)([wL,SL,fL,kL,yL,vL,hL,jL,_L,xL,bL,uL,mL,gL,dL,cL,lL]);var nL="ec2",pL="fargate";$w.AWSECSLAUNCHTYPEVALUES_EC2=nL;$w.AWSECSLAUNCHTYPEVALUES_FARGATE=pL;$w.AwsEcsLaunchtypeValues=(0,b5.createConstMap)([nL,pL]);var iL="amd64",rL="arm32",aL="arm64",oL="ia64",tL="ppc32",sL="ppc64",eL="x86";$w.HOSTARCHVALUES_AMD64=iL;$w.HOSTARCHVALUES_ARM32=rL;$w.HOSTARCHVALUES_ARM64=aL;$w.HOSTARCHVALUES_IA64=oL;$w.HOSTARCHVALUES_PPC32=tL;$w.HOSTARCHVALUES_PPC64=sL;$w.HOSTARCHVALUES_X86=eL;$w.HostArchValues=(0,b5.createConstMap)([iL,rL,aL,oL,tL,sL,eL]);var Yw="windows",Zw="linux",Qw="darwin",Xw="freebsd",Jw="netbsd",Ww="openbsd",Kw="dragonflybsd",Gw="hpux",Fw="aix",Hw="solaris",Vw="z_os";$w.OSTYPEVALUES_WINDOWS=Yw;$w.OSTYPEVALUES_LINUX=Zw;$w.OSTYPEVALUES_DARWIN=Qw;$w.OSTYPEVALUES_FREEBSD=Xw;$w.OSTYPEVALUES_NETBSD=Jw;$w.OSTYPEVALUES_OPENBSD=Ww;$w.OSTYPEVALUES_DRAGONFLYBSD=Kw;$w.OSTYPEVALUES_HPUX=Gw;$w.OSTYPEVALUES_AIX=Fw;$w.OSTYPEVALUES_SOLARIS=Hw;$w.OSTYPEVALUES_Z_OS=Vw;$w.OsTypeValues=(0,b5.createConstMap)([Yw,Zw,Qw,Xw,Jw,Ww,Kw,Gw,Fw,Hw,Vw]);var qw="cpp",zw="dotnet",Bw="erlang",Aw="go",Uw="java",Nw="nodejs",Ow="php",Dw="python",Tw="ruby",Iw="webjs";$w.TELEMETRYSDKLANGUAGEVALUES_CPP=qw;$w.TELEMETRYSDKLANGUAGEVALUES_DOTNET=zw;$w.TELEMETRYSDKLANGUAGEVALUES_ERLANG=Bw;$w.TELEMETRYSDKLANGUAGEVALUES_GO=Aw;$w.TELEMETRYSDKLANGUAGEVALUES_JAVA=Uw;$w.TELEMETRYSDKLANGUAGEVALUES_NODEJS=Nw;$w.TELEMETRYSDKLANGUAGEVALUES_PHP=Ow;$w.TELEMETRYSDKLANGUAGEVALUES_PYTHON=Dw;$w.TELEMETRYSDKLANGUAGEVALUES_RUBY=Tw;$w.TELEMETRYSDKLANGUAGEVALUES_WEBJS=Iw;$w.TelemetrySdkLanguageValues=(0,b5.createConstMap)([qw,zw,Bw,Aw,Uw,Nw,Ow,Dw,Tw,Iw])});var Pw=H0((u5)=>{var bW0=u5&&u5.__createBinding||(Object.create?function(Y,Z,W,H){if(H===void 0)H=W;var F=Object.getOwnPropertyDescriptor(Z,W);if(!F||("get"in F?!Z.__esModule:F.writable||F.configurable))F={enumerable:!0,get:function(){return Z[W]}};Object.defineProperty(Y,H,F)}:function(Y,Z,W,H){if(H===void 0)H=W;Y[H]=Z[W]}),uW0=u5&&u5.__exportStar||function(Y,Z){for(var W in Y)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(Z,W))bW0(Z,Y,W)};Object.defineProperty(u5,"__esModule",{value:!0});uW0(Rw(),u5)});var kw=H0((Lw)=>{Object.defineProperty(Lw,"__esModule",{value:!0});Lw.ATTR_EXCEPTION_TYPE=Lw.ATTR_EXCEPTION_STACKTRACE=Lw.ATTR_EXCEPTION_MESSAGE=Lw.ATTR_EXCEPTION_ESCAPED=Lw.ERROR_TYPE_VALUE_OTHER=Lw.ATTR_ERROR_TYPE=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_POH=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_LOH=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1=Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0=Lw.ATTR_DOTNET_GC_HEAP_GENERATION=Lw.DB_SYSTEM_NAME_VALUE_POSTGRESQL=Lw.DB_SYSTEM_NAME_VALUE_MYSQL=Lw.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER=Lw.DB_SYSTEM_NAME_VALUE_MARIADB=Lw.ATTR_DB_SYSTEM_NAME=Lw.ATTR_DB_STORED_PROCEDURE_NAME=Lw.ATTR_DB_RESPONSE_STATUS_CODE=Lw.ATTR_DB_QUERY_TEXT=Lw.ATTR_DB_QUERY_SUMMARY=Lw.ATTR_DB_OPERATION_NAME=Lw.ATTR_DB_OPERATION_BATCH_SIZE=Lw.ATTR_DB_NAMESPACE=Lw.ATTR_DB_COLLECTION_NAME=Lw.ATTR_CODE_STACKTRACE=Lw.ATTR_CODE_LINE_NUMBER=Lw.ATTR_CODE_FUNCTION_NAME=Lw.ATTR_CODE_FILE_PATH=Lw.ATTR_CODE_COLUMN_NUMBER=Lw.ATTR_CLIENT_PORT=Lw.ATTR_CLIENT_ADDRESS=Lw.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED=Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS=Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE=Lw.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS=Lw.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK=Lw.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER=Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED=Lw.ATTR_ASPNETCORE_RATE_LIMITING_RESULT=Lw.ATTR_ASPNETCORE_RATE_LIMITING_POLICY=Lw.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED=Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED=Lw.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT=void 0;Lw.OTEL_STATUS_CODE_VALUE_ERROR=Lw.ATTR_OTEL_STATUS_CODE=Lw.ATTR_OTEL_SCOPE_VERSION=Lw.ATTR_OTEL_SCOPE_NAME=Lw.NETWORK_TYPE_VALUE_IPV6=Lw.NETWORK_TYPE_VALUE_IPV4=Lw.ATTR_NETWORK_TYPE=Lw.NETWORK_TRANSPORT_VALUE_UNIX=Lw.NETWORK_TRANSPORT_VALUE_UDP=Lw.NETWORK_TRANSPORT_VALUE_TCP=Lw.NETWORK_TRANSPORT_VALUE_QUIC=Lw.NETWORK_TRANSPORT_VALUE_PIPE=Lw.ATTR_NETWORK_TRANSPORT=Lw.ATTR_NETWORK_PROTOCOL_VERSION=Lw.ATTR_NETWORK_PROTOCOL_NAME=Lw.ATTR_NETWORK_PEER_PORT=Lw.ATTR_NETWORK_PEER_ADDRESS=Lw.ATTR_NETWORK_LOCAL_PORT=Lw.ATTR_NETWORK_LOCAL_ADDRESS=Lw.JVM_THREAD_STATE_VALUE_WAITING=Lw.JVM_THREAD_STATE_VALUE_TIMED_WAITING=Lw.JVM_THREAD_STATE_VALUE_TERMINATED=Lw.JVM_THREAD_STATE_VALUE_RUNNABLE=Lw.JVM_THREAD_STATE_VALUE_NEW=Lw.JVM_THREAD_STATE_VALUE_BLOCKED=Lw.ATTR_JVM_THREAD_STATE=Lw.ATTR_JVM_THREAD_DAEMON=Lw.JVM_MEMORY_TYPE_VALUE_NON_HEAP=Lw.JVM_MEMORY_TYPE_VALUE_HEAP=Lw.ATTR_JVM_MEMORY_TYPE=Lw.ATTR_JVM_MEMORY_POOL_NAME=Lw.ATTR_JVM_GC_NAME=Lw.ATTR_JVM_GC_ACTION=Lw.ATTR_HTTP_ROUTE=Lw.ATTR_HTTP_RESPONSE_STATUS_CODE=Lw.ATTR_HTTP_RESPONSE_HEADER=Lw.ATTR_HTTP_REQUEST_RESEND_COUNT=Lw.ATTR_HTTP_REQUEST_METHOD_ORIGINAL=Lw.HTTP_REQUEST_METHOD_VALUE_TRACE=Lw.HTTP_REQUEST_METHOD_VALUE_PUT=Lw.HTTP_REQUEST_METHOD_VALUE_POST=Lw.HTTP_REQUEST_METHOD_VALUE_PATCH=Lw.HTTP_REQUEST_METHOD_VALUE_OPTIONS=Lw.HTTP_REQUEST_METHOD_VALUE_HEAD=Lw.HTTP_REQUEST_METHOD_VALUE_GET=Lw.HTTP_REQUEST_METHOD_VALUE_DELETE=Lw.HTTP_REQUEST_METHOD_VALUE_CONNECT=Lw.HTTP_REQUEST_METHOD_VALUE_OTHER=Lw.ATTR_HTTP_REQUEST_METHOD=Lw.ATTR_HTTP_REQUEST_HEADER=void 0;Lw.ATTR_USER_AGENT_ORIGINAL=Lw.ATTR_URL_SCHEME=Lw.ATTR_URL_QUERY=Lw.ATTR_URL_PATH=Lw.ATTR_URL_FULL=Lw.ATTR_URL_FRAGMENT=Lw.ATTR_TELEMETRY_SDK_VERSION=Lw.ATTR_TELEMETRY_SDK_NAME=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUST=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PHP=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_GO=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET=Lw.TELEMETRY_SDK_LANGUAGE_VALUE_CPP=Lw.ATTR_TELEMETRY_SDK_LANGUAGE=Lw.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS=Lw.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS=Lw.SIGNALR_TRANSPORT_VALUE_LONG_POLLING=Lw.ATTR_SIGNALR_TRANSPORT=Lw.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT=Lw.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE=Lw.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN=Lw.ATTR_SIGNALR_CONNECTION_STATUS=Lw.ATTR_SERVICE_VERSION=Lw.ATTR_SERVICE_NAMESPACE=Lw.ATTR_SERVICE_NAME=Lw.ATTR_SERVICE_INSTANCE_ID=Lw.ATTR_SERVER_PORT=Lw.ATTR_SERVER_ADDRESS=Lw.ATTR_OTEL_STATUS_DESCRIPTION=Lw.OTEL_STATUS_CODE_VALUE_OK=void 0;Lw.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT="aspnetcore.diagnostics.exception.result";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED="aborted";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED="handled";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED="skipped";Lw.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED="unhandled";Lw.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE="aspnetcore.diagnostics.handler.type";Lw.ATTR_ASPNETCORE_RATE_LIMITING_POLICY="aspnetcore.rate_limiting.policy";Lw.ATTR_ASPNETCORE_RATE_LIMITING_RESULT="aspnetcore.rate_limiting.result";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED="acquired";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER="endpoint_limiter";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER="global_limiter";Lw.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED="request_canceled";Lw.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED="aspnetcore.request.is_unhandled";Lw.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK="aspnetcore.routing.is_fallback";Lw.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS="aspnetcore.routing.match_status";Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE="failure";Lw.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS="success";Lw.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED="aspnetcore.user.is_authenticated";Lw.ATTR_CLIENT_ADDRESS="client.address";Lw.ATTR_CLIENT_PORT="client.port";Lw.ATTR_CODE_COLUMN_NUMBER="code.column.number";Lw.ATTR_CODE_FILE_PATH="code.file.path";Lw.ATTR_CODE_FUNCTION_NAME="code.function.name";Lw.ATTR_CODE_LINE_NUMBER="code.line.number";Lw.ATTR_CODE_STACKTRACE="code.stacktrace";Lw.ATTR_DB_COLLECTION_NAME="db.collection.name";Lw.ATTR_DB_NAMESPACE="db.namespace";Lw.ATTR_DB_OPERATION_BATCH_SIZE="db.operation.batch.size";Lw.ATTR_DB_OPERATION_NAME="db.operation.name";Lw.ATTR_DB_QUERY_SUMMARY="db.query.summary";Lw.ATTR_DB_QUERY_TEXT="db.query.text";Lw.ATTR_DB_RESPONSE_STATUS_CODE="db.response.status_code";Lw.ATTR_DB_STORED_PROCEDURE_NAME="db.stored_procedure.name";Lw.ATTR_DB_SYSTEM_NAME="db.system.name";Lw.DB_SYSTEM_NAME_VALUE_MARIADB="mariadb";Lw.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER="microsoft.sql_server";Lw.DB_SYSTEM_NAME_VALUE_MYSQL="mysql";Lw.DB_SYSTEM_NAME_VALUE_POSTGRESQL="postgresql";Lw.ATTR_DOTNET_GC_HEAP_GENERATION="dotnet.gc.heap.generation";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0="gen0";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1="gen1";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2="gen2";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_LOH="loh";Lw.DOTNET_GC_HEAP_GENERATION_VALUE_POH="poh";Lw.ATTR_ERROR_TYPE="error.type";Lw.ERROR_TYPE_VALUE_OTHER="_OTHER";Lw.ATTR_EXCEPTION_ESCAPED="exception.escaped";Lw.ATTR_EXCEPTION_MESSAGE="exception.message";Lw.ATTR_EXCEPTION_STACKTRACE="exception.stacktrace";Lw.ATTR_EXCEPTION_TYPE="exception.type";var mW0=(Y)=>`http.request.header.${Y}`;Lw.ATTR_HTTP_REQUEST_HEADER=mW0;Lw.ATTR_HTTP_REQUEST_METHOD="http.request.method";Lw.HTTP_REQUEST_METHOD_VALUE_OTHER="_OTHER";Lw.HTTP_REQUEST_METHOD_VALUE_CONNECT="CONNECT";Lw.HTTP_REQUEST_METHOD_VALUE_DELETE="DELETE";Lw.HTTP_REQUEST_METHOD_VALUE_GET="GET";Lw.HTTP_REQUEST_METHOD_VALUE_HEAD="HEAD";Lw.HTTP_REQUEST_METHOD_VALUE_OPTIONS="OPTIONS";Lw.HTTP_REQUEST_METHOD_VALUE_PATCH="PATCH";Lw.HTTP_REQUEST_METHOD_VALUE_POST="POST";Lw.HTTP_REQUEST_METHOD_VALUE_PUT="PUT";Lw.HTTP_REQUEST_METHOD_VALUE_TRACE="TRACE";Lw.ATTR_HTTP_REQUEST_METHOD_ORIGINAL="http.request.method_original";Lw.ATTR_HTTP_REQUEST_RESEND_COUNT="http.request.resend_count";var gW0=(Y)=>`http.response.header.${Y}`;Lw.ATTR_HTTP_RESPONSE_HEADER=gW0;Lw.ATTR_HTTP_RESPONSE_STATUS_CODE="http.response.status_code";Lw.ATTR_HTTP_ROUTE="http.route";Lw.ATTR_JVM_GC_ACTION="jvm.gc.action";Lw.ATTR_JVM_GC_NAME="jvm.gc.name";Lw.ATTR_JVM_MEMORY_POOL_NAME="jvm.memory.pool.name";Lw.ATTR_JVM_MEMORY_TYPE="jvm.memory.type";Lw.JVM_MEMORY_TYPE_VALUE_HEAP="heap";Lw.JVM_MEMORY_TYPE_VALUE_NON_HEAP="non_heap";Lw.ATTR_JVM_THREAD_DAEMON="jvm.thread.daemon";Lw.ATTR_JVM_THREAD_STATE="jvm.thread.state";Lw.JVM_THREAD_STATE_VALUE_BLOCKED="blocked";Lw.JVM_THREAD_STATE_VALUE_NEW="new";Lw.JVM_THREAD_STATE_VALUE_RUNNABLE="runnable";Lw.JVM_THREAD_STATE_VALUE_TERMINATED="terminated";Lw.JVM_THREAD_STATE_VALUE_TIMED_WAITING="timed_waiting";Lw.JVM_THREAD_STATE_VALUE_WAITING="waiting";Lw.ATTR_NETWORK_LOCAL_ADDRESS="network.local.address";Lw.ATTR_NETWORK_LOCAL_PORT="network.local.port";Lw.ATTR_NETWORK_PEER_ADDRESS="network.peer.address";Lw.ATTR_NETWORK_PEER_PORT="network.peer.port";Lw.ATTR_NETWORK_PROTOCOL_NAME="network.protocol.name";Lw.ATTR_NETWORK_PROTOCOL_VERSION="network.protocol.version";Lw.ATTR_NETWORK_TRANSPORT="network.transport";Lw.NETWORK_TRANSPORT_VALUE_PIPE="pipe";Lw.NETWORK_TRANSPORT_VALUE_QUIC="quic";Lw.NETWORK_TRANSPORT_VALUE_TCP="tcp";Lw.NETWORK_TRANSPORT_VALUE_UDP="udp";Lw.NETWORK_TRANSPORT_VALUE_UNIX="unix";Lw.ATTR_NETWORK_TYPE="network.type";Lw.NETWORK_TYPE_VALUE_IPV4="ipv4";Lw.NETWORK_TYPE_VALUE_IPV6="ipv6";Lw.ATTR_OTEL_SCOPE_NAME="otel.scope.name";Lw.ATTR_OTEL_SCOPE_VERSION="otel.scope.version";Lw.ATTR_OTEL_STATUS_CODE="otel.status_code";Lw.OTEL_STATUS_CODE_VALUE_ERROR="ERROR";Lw.OTEL_STATUS_CODE_VALUE_OK="OK";Lw.ATTR_OTEL_STATUS_DESCRIPTION="otel.status_description";Lw.ATTR_SERVER_ADDRESS="server.address";Lw.ATTR_SERVER_PORT="server.port";Lw.ATTR_SERVICE_INSTANCE_ID="service.instance.id";Lw.ATTR_SERVICE_NAME="service.name";Lw.ATTR_SERVICE_NAMESPACE="service.namespace";Lw.ATTR_SERVICE_VERSION="service.version";Lw.ATTR_SIGNALR_CONNECTION_STATUS="signalr.connection.status";Lw.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN="app_shutdown";Lw.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE="normal_closure";Lw.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT="timeout";Lw.ATTR_SIGNALR_TRANSPORT="signalr.transport";Lw.SIGNALR_TRANSPORT_VALUE_LONG_POLLING="long_polling";Lw.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS="server_sent_events";Lw.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS="web_sockets";Lw.ATTR_TELEMETRY_SDK_LANGUAGE="telemetry.sdk.language";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_CPP="cpp";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET="dotnet";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG="erlang";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_GO="go";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA="java";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS="nodejs";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PHP="php";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON="python";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY="ruby";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_RUST="rust";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT="swift";Lw.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS="webjs";Lw.ATTR_TELEMETRY_SDK_NAME="telemetry.sdk.name";Lw.ATTR_TELEMETRY_SDK_VERSION="telemetry.sdk.version";Lw.ATTR_URL_FRAGMENT="url.fragment";Lw.ATTR_URL_FULL="url.full";Lw.ATTR_URL_PATH="url.path";Lw.ATTR_URL_QUERY="url.query";Lw.ATTR_URL_SCHEME="url.scheme";Lw.ATTR_USER_AGENT_ORIGINAL="user_agent.original"});var jw=H0((yw)=>{Object.defineProperty(yw,"__esModule",{value:!0});yw.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS=yw.METRIC_KESTREL_UPGRADED_CONNECTIONS=yw.METRIC_KESTREL_TLS_HANDSHAKE_DURATION=yw.METRIC_KESTREL_REJECTED_CONNECTIONS=yw.METRIC_KESTREL_QUEUED_REQUESTS=yw.METRIC_KESTREL_QUEUED_CONNECTIONS=yw.METRIC_KESTREL_CONNECTION_DURATION=yw.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES=yw.METRIC_KESTREL_ACTIVE_CONNECTIONS=yw.METRIC_JVM_THREAD_COUNT=yw.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC=yw.METRIC_JVM_MEMORY_USED=yw.METRIC_JVM_MEMORY_LIMIT=yw.METRIC_JVM_MEMORY_COMMITTED=yw.METRIC_JVM_GC_DURATION=yw.METRIC_JVM_CPU_TIME=yw.METRIC_JVM_CPU_RECENT_UTILIZATION=yw.METRIC_JVM_CPU_COUNT=yw.METRIC_JVM_CLASS_UNLOADED=yw.METRIC_JVM_CLASS_LOADED=yw.METRIC_JVM_CLASS_COUNT=yw.METRIC_HTTP_SERVER_REQUEST_DURATION=yw.METRIC_HTTP_CLIENT_REQUEST_DURATION=yw.METRIC_DOTNET_TIMER_COUNT=yw.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT=yw.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT=yw.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH=yw.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET=yw.METRIC_DOTNET_PROCESS_CPU_TIME=yw.METRIC_DOTNET_PROCESS_CPU_COUNT=yw.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS=yw.METRIC_DOTNET_JIT_COMPILED_METHODS=yw.METRIC_DOTNET_JIT_COMPILED_IL_SIZE=yw.METRIC_DOTNET_JIT_COMPILATION_TIME=yw.METRIC_DOTNET_GC_PAUSE_TIME=yw.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE=yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE=yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE=yw.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED=yw.METRIC_DOTNET_GC_COLLECTIONS=yw.METRIC_DOTNET_EXCEPTIONS=yw.METRIC_DOTNET_ASSEMBLY_COUNT=yw.METRIC_DB_CLIENT_OPERATION_DURATION=yw.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS=yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS=yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION=yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE=yw.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS=yw.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES=yw.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS=void 0;yw.METRIC_SIGNALR_SERVER_CONNECTION_DURATION=void 0;yw.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS="aspnetcore.diagnostics.exceptions";yw.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES="aspnetcore.rate_limiting.active_request_leases";yw.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS="aspnetcore.rate_limiting.queued_requests";yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE="aspnetcore.rate_limiting.request.time_in_queue";yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION="aspnetcore.rate_limiting.request_lease.duration";yw.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS="aspnetcore.rate_limiting.requests";yw.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS="aspnetcore.routing.match_attempts";yw.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration";yw.METRIC_DOTNET_ASSEMBLY_COUNT="dotnet.assembly.count";yw.METRIC_DOTNET_EXCEPTIONS="dotnet.exceptions";yw.METRIC_DOTNET_GC_COLLECTIONS="dotnet.gc.collections";yw.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED="dotnet.gc.heap.total_allocated";yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE="dotnet.gc.last_collection.heap.fragmentation.size";yw.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE="dotnet.gc.last_collection.heap.size";yw.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE="dotnet.gc.last_collection.memory.committed_size";yw.METRIC_DOTNET_GC_PAUSE_TIME="dotnet.gc.pause.time";yw.METRIC_DOTNET_JIT_COMPILATION_TIME="dotnet.jit.compilation.time";yw.METRIC_DOTNET_JIT_COMPILED_IL_SIZE="dotnet.jit.compiled_il.size";yw.METRIC_DOTNET_JIT_COMPILED_METHODS="dotnet.jit.compiled_methods";yw.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS="dotnet.monitor.lock_contentions";yw.METRIC_DOTNET_PROCESS_CPU_COUNT="dotnet.process.cpu.count";yw.METRIC_DOTNET_PROCESS_CPU_TIME="dotnet.process.cpu.time";yw.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET="dotnet.process.memory.working_set";yw.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH="dotnet.thread_pool.queue.length";yw.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT="dotnet.thread_pool.thread.count";yw.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT="dotnet.thread_pool.work_item.count";yw.METRIC_DOTNET_TIMER_COUNT="dotnet.timer.count";yw.METRIC_HTTP_CLIENT_REQUEST_DURATION="http.client.request.duration";yw.METRIC_HTTP_SERVER_REQUEST_DURATION="http.server.request.duration";yw.METRIC_JVM_CLASS_COUNT="jvm.class.count";yw.METRIC_JVM_CLASS_LOADED="jvm.class.loaded";yw.METRIC_JVM_CLASS_UNLOADED="jvm.class.unloaded";yw.METRIC_JVM_CPU_COUNT="jvm.cpu.count";yw.METRIC_JVM_CPU_RECENT_UTILIZATION="jvm.cpu.recent_utilization";yw.METRIC_JVM_CPU_TIME="jvm.cpu.time";yw.METRIC_JVM_GC_DURATION="jvm.gc.duration";yw.METRIC_JVM_MEMORY_COMMITTED="jvm.memory.committed";yw.METRIC_JVM_MEMORY_LIMIT="jvm.memory.limit";yw.METRIC_JVM_MEMORY_USED="jvm.memory.used";yw.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC="jvm.memory.used_after_last_gc";yw.METRIC_JVM_THREAD_COUNT="jvm.thread.count";yw.METRIC_KESTREL_ACTIVE_CONNECTIONS="kestrel.active_connections";yw.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES="kestrel.active_tls_handshakes";yw.METRIC_KESTREL_CONNECTION_DURATION="kestrel.connection.duration";yw.METRIC_KESTREL_QUEUED_CONNECTIONS="kestrel.queued_connections";yw.METRIC_KESTREL_QUEUED_REQUESTS="kestrel.queued_requests";yw.METRIC_KESTREL_REJECTED_CONNECTIONS="kestrel.rejected_connections";yw.METRIC_KESTREL_TLS_HANDSHAKE_DURATION="kestrel.tls_handshake.duration";yw.METRIC_KESTREL_UPGRADED_CONNECTIONS="kestrel.upgraded_connections";yw.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS="signalr.server.active_connections";yw.METRIC_SIGNALR_SERVER_CONNECTION_DURATION="signalr.server.connection.duration"});var bw=H0((_w)=>{Object.defineProperty(_w,"__esModule",{value:!0});_w.EVENT_EXCEPTION=void 0;_w.EVENT_EXCEPTION="exception"});var m5=H0((E9)=>{var HF0=E9&&E9.__createBinding||(Object.create?function(Y,Z,W,H){if(H===void 0)H=W;var F=Object.getOwnPropertyDescriptor(Z,W);if(!F||("get"in F?!Z.__esModule:F.writable||F.configurable))F={enumerable:!0,get:function(){return Z[W]}};Object.defineProperty(Y,H,F)}:function(Y,Z,W,H){if(H===void 0)H=W;Y[H]=Z[W]}),mZ=E9&&E9.__exportStar||function(Y,Z){for(var W in Y)if(W!=="default"&&!Object.prototype.hasOwnProperty.call(Z,W))HF0(Z,Y,W)};Object.defineProperty(E9,"__esModule",{value:!0});mZ(o2(),E9);mZ(Pw(),E9);mZ(kw(),E9);mZ(jw(),E9);mZ(bw(),E9)});var gw=H0((uw)=>{Object.defineProperty(uw,"__esModule",{value:!0});uw.ATTR_PROCESS_RUNTIME_NAME=void 0;uw.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var lw=H0((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});dw.SDK_INFO=void 0;var VF0=o$(),UJ=m5(),qF0=gw();dw.SDK_INFO={[UJ.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[qF0.ATTR_PROCESS_RUNTIME_NAME]:"node",[UJ.ATTR_TELEMETRY_SDK_LANGUAGE]:UJ.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[UJ.ATTR_TELEMETRY_SDK_VERSION]:VF0.VERSION}});var pw=H0((l4)=>{Object.defineProperty(l4,"__esModule",{value:!0});l4.otperformance=l4.SDK_INFO=l4._globalThis=l4.getStringListFromEnv=l4.getNumberFromEnv=l4.getBooleanFromEnv=l4.getStringFromEnv=void 0;var NJ=l$();Object.defineProperty(l4,"getStringFromEnv",{enumerable:!0,get:function(){return NJ.getStringFromEnv}});Object.defineProperty(l4,"getBooleanFromEnv",{enumerable:!0,get:function(){return NJ.getBooleanFromEnv}});Object.defineProperty(l4,"getNumberFromEnv",{enumerable:!0,get:function(){return NJ.getNumberFromEnv}});Object.defineProperty(l4,"getStringListFromEnv",{enumerable:!0,get:function(){return NJ.getStringListFromEnv}});var zF0=i$();Object.defineProperty(l4,"_globalThis",{enumerable:!0,get:function(){return zF0._globalThis}});var BF0=lw();Object.defineProperty(l4,"SDK_INFO",{enumerable:!0,get:function(){return BF0.SDK_INFO}});l4.otperformance=performance});var GH=H0((T4)=>{Object.defineProperty(T4,"__esModule",{value:!0});T4.getStringListFromEnv=T4.getNumberFromEnv=T4.getStringFromEnv=T4.getBooleanFromEnv=T4.otperformance=T4._globalThis=T4.SDK_INFO=void 0;var g5=pw();Object.defineProperty(T4,"SDK_INFO",{enumerable:!0,get:function(){return g5.SDK_INFO}});Object.defineProperty(T4,"_globalThis",{enumerable:!0,get:function(){return g5._globalThis}});Object.defineProperty(T4,"otperformance",{enumerable:!0,get:function(){return g5.otperformance}});Object.defineProperty(T4,"getBooleanFromEnv",{enumerable:!0,get:function(){return g5.getBooleanFromEnv}});Object.defineProperty(T4,"getStringFromEnv",{enumerable:!0,get:function(){return g5.getStringFromEnv}});Object.defineProperty(T4,"getNumberFromEnv",{enumerable:!0,get:function(){return g5.getNumberFromEnv}});Object.defineProperty(T4,"getStringListFromEnv",{enumerable:!0,get:function(){return g5.getStringListFromEnv}})});var sw=H0((ow)=>{Object.defineProperty(ow,"__esModule",{value:!0});ow.addHrTimes=ow.isTimeInput=ow.isTimeInputHrTime=ow.hrTimeToMicroseconds=ow.hrTimeToMilliseconds=ow.hrTimeToNanoseconds=ow.hrTimeToTimeStamp=ow.hrTimeDuration=ow.timeInputToHrTime=ow.hrTime=ow.getTimeOrigin=ow.millisToHrTime=void 0;var OJ=GH(),iw=9,UF0=6,NF0=Math.pow(10,UF0),DJ=Math.pow(10,iw);function gZ(Y){let Z=Y/1000,W=Math.trunc(Z),H=Math.round(Y%1000*NF0);return[W,H]}ow.millisToHrTime=gZ;function OF0(){return OJ.otperformance.timeOrigin}ow.getTimeOrigin=OF0;function rw(Y){let Z=gZ(OJ.otperformance.timeOrigin),W=gZ(typeof Y==="number"?Y:OJ.otperformance.now());return aw(Z,W)}ow.hrTime=rw;function DF0(Y){if(FH(Y))return Y;else if(typeof Y==="number")if(Y<OJ.otperformance.timeOrigin)return rw(Y);else return gZ(Y);else if(Y instanceof Date)return gZ(Y.getTime());else throw TypeError("Invalid input type")}ow.timeInputToHrTime=DF0;function TF0(Y,Z){let W=Z[0]-Y[0],H=Z[1]-Y[1];if(H<0)W-=1,H+=DJ;return[W,H]}ow.hrTimeDuration=TF0;function IF0(Y){let Z=iw,W=`${"0".repeat(Z)}${Y[1]}Z`,H=W.substring(W.length-Z-1);return new Date(Y[0]*1000).toISOString().replace("000Z",H)}ow.hrTimeToTimeStamp=IF0;function $F0(Y){return Y[0]*DJ+Y[1]}ow.hrTimeToNanoseconds=$F0;function CF0(Y){return Y[0]*1000+Y[1]/1e6}ow.hrTimeToMilliseconds=CF0;function EF0(Y){return Y[0]*1e6+Y[1]/1000}ow.hrTimeToMicroseconds=EF0;function FH(Y){return Array.isArray(Y)&&Y.length===2&&typeof Y[0]==="number"&&typeof Y[1]==="number"}ow.isTimeInputHrTime=FH;function MF0(Y){return FH(Y)||typeof Y==="number"||Y instanceof Date}ow.isTimeInput=MF0;function aw(Y,Z){let W=[Y[0]+Z[0],Y[1]+Z[1]];if(W[1]>=DJ)W[1]-=DJ,W[0]+=1;return W}ow.addHrTimes=aw});var ZS=H0((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});ew.unrefTimer=void 0;function _F0(Y){if(typeof Y!=="number")Y.unref()}ew.unrefTimer=_F0});var XS=H0((QS)=>{Object.defineProperty(QS,"__esModule",{value:!0});QS.ExportResultCode=void 0;var xF0;(function(Y){Y[Y.SUCCESS=0]="SUCCESS",Y[Y.FAILED=1]="FAILED"})(xF0=QS.ExportResultCode||(QS.ExportResultCode={}))});var FS=H0((KS)=>{Object.defineProperty(KS,"__esModule",{value:!0});KS.CompositePropagator=void 0;var JS=f1();class WS{_propagators;_fields;constructor(Y={}){this._propagators=Y.propagators??[],this._fields=Array.from(new Set(this._propagators.map((Z)=>typeof Z.fields==="function"?Z.fields():[]).reduce((Z,W)=>Z.concat(W),[])))}inject(Y,Z,W){for(let H of this._propagators)try{H.inject(Y,Z,W)}catch(F){JS.diag.warn(`Failed to inject with ${H.constructor.name}. Err: ${F.message}`)}}extract(Y,Z,W){return this._propagators.reduce((H,F)=>{try{return F.extract(H,Z,W)}catch(X){JS.diag.warn(`Failed to extract with ${F.constructor.name}. Err: ${X.message}`)}return H},Y)}fields(){return this._fields.slice()}}KS.CompositePropagator=WS});var qS=H0((HS)=>{Object.defineProperty(HS,"__esModule",{value:!0});HS.validateValue=HS.validateKey=void 0;var VH="[_0-9a-z-*/]",bF0=`[a-z]${VH}{0,255}`,uF0=`[a-z0-9]${VH}{0,240}@[a-z]${VH}{0,13}`,mF0=new RegExp(`^(?:${bF0}|${uF0})$`),gF0=/^[ -~]{0,255}[!-~]$/,dF0=/,|=/;function cF0(Y){return mF0.test(Y)}HS.validateKey=cF0;function lF0(Y){return gF0.test(Y)&&!dF0.test(Y)}HS.validateValue=lF0});var zH=H0((NS)=>{Object.defineProperty(NS,"__esModule",{value:!0});NS.TraceState=void 0;var zS=qS(),BS=32,pF0=512,AS=",",US="=";class qH{_internalState=new Map;constructor(Y){if(Y)this._parse(Y)}set(Y,Z){let W=this._clone();if(W._internalState.has(Y))W._internalState.delete(Y);return W._internalState.set(Y,Z),W}unset(Y){let Z=this._clone();return Z._internalState.delete(Y),Z}get(Y){return this._internalState.get(Y)}serialize(){return this._keys().reduce((Y,Z)=>{return Y.push(Z+US+this.get(Z)),Y},[]).join(AS)}_parse(Y){if(Y.length>pF0)return;if(this._internalState=Y.split(AS).reverse().reduce((Z,W)=>{let H=W.trim(),F=H.indexOf(US);if(F!==-1){let X=H.slice(0,F),J=H.slice(F+1,W.length);if((0,zS.validateKey)(X)&&(0,zS.validateValue)(J))Z.set(X,J)}return Z},new Map),this._internalState.size>BS)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BS))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let Y=new qH;return Y._internalState=new Map(this._internalState),Y}}NS.TraceState=qH});var CS=H0((IS)=>{Object.defineProperty(IS,"__esModule",{value:!0});IS.W3CTraceContextPropagator=IS.parseTraceParent=IS.TRACE_STATE_HEADER=IS.TRACE_PARENT_HEADER=void 0;var TJ=f1(),iF0=uZ(),rF0=zH();IS.TRACE_PARENT_HEADER="traceparent";IS.TRACE_STATE_HEADER="tracestate";var aF0="00",oF0="(?!ff)[\\da-f]{2}",tF0="(?![0]{32})[\\da-f]{32}",sF0="(?![0]{16})[\\da-f]{16}",eF0="[\\da-f]{2}",YH0=new RegExp(`^\\s?(${oF0})-(${tF0})-(${sF0})-(${eF0})(-.*)?\\s?$`);function DS(Y){let Z=YH0.exec(Y);if(!Z)return null;if(Z[1]==="00"&&Z[5])return null;return{traceId:Z[2],spanId:Z[3],traceFlags:parseInt(Z[4],16)}}IS.parseTraceParent=DS;class TS{inject(Y,Z,W){let H=TJ.trace.getSpanContext(Y);if(!H||(0,iF0.isTracingSuppressed)(Y)||!(0,TJ.isSpanContextValid)(H))return;let F=`${aF0}-${H.traceId}-${H.spanId}-0${Number(H.traceFlags||TJ.TraceFlags.NONE).toString(16)}`;if(W.set(Z,IS.TRACE_PARENT_HEADER,F),H.traceState)W.set(Z,IS.TRACE_STATE_HEADER,H.traceState.serialize())}extract(Y,Z,W){let H=W.get(Z,IS.TRACE_PARENT_HEADER);if(!H)return Y;let F=Array.isArray(H)?H[0]:H;if(typeof F!=="string")return Y;let X=DS(F);if(!X)return Y;X.isRemote=!0;let J=W.get(Z,IS.TRACE_STATE_HEADER);if(J){let Q=Array.isArray(J)?J.join(","):J;X.traceState=new rF0.TraceState(typeof Q==="string"?Q:void 0)}return TJ.trace.setSpanContext(Y,X)}fields(){return[IS.TRACE_PARENT_HEADER,IS.TRACE_STATE_HEADER]}}IS.W3CTraceContextPropagator=TS});var PS=H0((MS)=>{Object.defineProperty(MS,"__esModule",{value:!0});MS.getRPCMetadata=MS.deleteRPCMetadata=MS.setRPCMetadata=MS.RPCType=void 0;var QH0=f1(),BH=(0,QH0.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),XH0;(function(Y){Y.HTTP="http"})(XH0=MS.RPCType||(MS.RPCType={}));function JH0(Y,Z){return Y.setValue(BH,Z)}MS.setRPCMetadata=JH0;function WH0(Y){return Y.deleteValue(BH)}MS.deleteRPCMetadata=WH0;function KH0(Y){return Y.getValue(BH)}MS.getRPCMetadata=KH0});var vS=H0((kS)=>{Object.defineProperty(kS,"__esModule",{value:!0});kS.isPlainObject=void 0;var HH0="[object Object]",VH0="[object Null]",qH0="[object Undefined]",zH0=Function.prototype,LS=zH0.toString,BH0=LS.call(Object),AH0=Object.getPrototypeOf,wS=Object.prototype,SS=wS.hasOwnProperty,d5=Symbol?Symbol.toStringTag:void 0,fS=wS.toString;function UH0(Y){if(!NH0(Y)||OH0(Y)!==HH0)return!1;let Z=AH0(Y);if(Z===null)return!0;let W=SS.call(Z,"constructor")&&Z.constructor;return typeof W=="function"&&W instanceof W&&LS.call(W)===BH0}kS.isPlainObject=UH0;function NH0(Y){return Y!=null&&typeof Y=="object"}function OH0(Y){if(Y==null)return Y===void 0?qH0:VH0;return d5&&d5 in Object(Y)?DH0(Y):TH0(Y)}function DH0(Y){let Z=SS.call(Y,d5),W=Y[d5],H=!1;try{Y[d5]=void 0,H=!0}catch{}let F=fS.call(Y);if(H)if(Z)Y[d5]=W;else delete Y[d5];return F}function TH0(Y){return fS.call(Y)}});var mS=H0((bS)=>{Object.defineProperty(bS,"__esModule",{value:!0});bS.merge=void 0;var hS=vS(),IH0=20;function $H0(...Y){let Z=Y.shift(),W=new WeakMap;while(Y.length>0)Z=_S(Z,Y.shift(),0,W);return Z}bS.merge=$H0;function AH(Y){if(EJ(Y))return Y.slice();return Y}function _S(Y,Z,W=0,H){let F;if(W>IH0)return;if(W++,CJ(Y)||CJ(Z)||xS(Z))F=AH(Z);else if(EJ(Y)){if(F=Y.slice(),EJ(Z))for(let X=0,J=Z.length;X<J;X++)F.push(AH(Z[X]));else if(dZ(Z)){let X=Object.keys(Z);for(let J=0,Q=X.length;J<Q;J++){let G=X[J];F[G]=AH(Z[G])}}}else if(dZ(Y))if(dZ(Z)){if(!CH0(Y,Z))return Z;F=Object.assign({},Y);let X=Object.keys(Z);for(let J=0,Q=X.length;J<Q;J++){let G=X[J],q=Z[G];if(CJ(q))if(typeof q>"u")delete F[G];else F[G]=q;else{let K=F[G],V=q;if(jS(Y,G,H)||jS(Z,G,H))delete F[G];else{if(dZ(K)&&dZ(V)){let B=H.get(K)||[],I=H.get(V)||[];B.push({obj:Y,key:G}),I.push({obj:Z,key:G}),H.set(K,B),H.set(V,I)}F[G]=_S(F[G],q,W,H)}}}}else F=Z;return F}function jS(Y,Z,W){let H=W.get(Y[Z])||[];for(let F=0,X=H.length;F<X;F++){let J=H[F];if(J.key===Z&&J.obj===Y)return!0}return!1}function EJ(Y){return Array.isArray(Y)}function xS(Y){return typeof Y==="function"}function dZ(Y){return!CJ(Y)&&!EJ(Y)&&!xS(Y)&&typeof Y==="object"}function CJ(Y){return typeof Y==="string"||typeof Y==="number"||typeof Y==="boolean"||typeof Y>"u"||Y instanceof Date||Y instanceof RegExp||Y===null}function CH0(Y,Z){if(!(0,hS.isPlainObject)(Y)||!(0,hS.isPlainObject)(Z))return!1;return!0}});var cS=H0((gS)=>{Object.defineProperty(gS,"__esModule",{value:!0});gS.callWithTimeout=gS.TimeoutError=void 0;class MJ extends Error{constructor(Y){super(Y);Object.setPrototypeOf(this,MJ.prototype)}}gS.TimeoutError=MJ;function EH0(Y,Z){let W,H=new Promise(function(X,J){W=setTimeout(function(){J(new MJ("Operation timed out."))},Z)});return Promise.race([Y,H]).then((F)=>{return clearTimeout(W),F},(F)=>{throw clearTimeout(W),F})}gS.callWithTimeout=EH0});var iS=H0((nS)=>{Object.defineProperty(nS,"__esModule",{value:!0});nS.isUrlIgnored=nS.urlMatches=void 0;function lS(Y,Z){if(typeof Z==="string")return Y===Z;else return!!Y.match(Z)}nS.urlMatches=lS;function RH0(Y,Z){if(!Z)return!1;for(let W of Z)if(lS(Y,W))return!0;return!1}nS.isUrlIgnored=RH0});var tS=H0((aS)=>{Object.defineProperty(aS,"__esModule",{value:!0});aS.Deferred=void 0;class rS{_promise;_resolve;_reject;constructor(){this._promise=new Promise((Y,Z)=>{this._resolve=Y,this._reject=Z})}get promise(){return this._promise}resolve(Y){this._resolve(Y)}reject(Y){this._reject(Y)}}aS.Deferred=rS});var Zf=H0((eS)=>{Object.defineProperty(eS,"__esModule",{value:!0});eS.BindOnceFuture=void 0;var LH0=tS();class sS{_isCalled=!1;_deferred=new LH0.Deferred;_callback;_that;constructor(Y,Z){this._callback=Y,this._that=Z}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...Y){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...Y)).then((Z)=>this._deferred.resolve(Z),(Z)=>this._deferred.reject(Z))}catch(Z){this._deferred.reject(Z)}}return this._deferred.promise}}eS.BindOnceFuture=sS});var Wf=H0((Xf)=>{Object.defineProperty(Xf,"__esModule",{value:!0});Xf.diagLogLevelFromString=void 0;var I4=f1(),Qf={ALL:I4.DiagLogLevel.ALL,VERBOSE:I4.DiagLogLevel.VERBOSE,DEBUG:I4.DiagLogLevel.DEBUG,INFO:I4.DiagLogLevel.INFO,WARN:I4.DiagLogLevel.WARN,ERROR:I4.DiagLogLevel.ERROR,NONE:I4.DiagLogLevel.NONE};function wH0(Y){if(Y==null)return;let Z=Qf[Y.toUpperCase()];if(Z==null)return I4.diag.warn(`Unknown log level "${Y}", expected one of ${Object.keys(Qf)}, using default`),I4.DiagLogLevel.INFO;return Z}Xf.diagLogLevelFromString=wH0});var Hf=H0((Gf)=>{Object.defineProperty(Gf,"__esModule",{value:!0});Gf._export=void 0;var Kf=f1(),SH0=uZ();function fH0(Y,Z){return new Promise((W)=>{Kf.context.with((0,SH0.suppressTracing)(Kf.context.active()),()=>{Y.export(Z,W)})})}Gf._export=fH0});var G6=H0((_1)=>{Object.defineProperty(_1,"__esModule",{value:!0});_1.internal=_1.diagLogLevelFromString=_1.BindOnceFuture=_1.urlMatches=_1.isUrlIgnored=_1.callWithTimeout=_1.TimeoutError=_1.merge=_1.TraceState=_1.unsuppressTracing=_1.suppressTracing=_1.isTracingSuppressed=_1.setRPCMetadata=_1.getRPCMetadata=_1.deleteRPCMetadata=_1.RPCType=_1.parseTraceParent=_1.W3CTraceContextPropagator=_1.TRACE_STATE_HEADER=_1.TRACE_PARENT_HEADER=_1.CompositePropagator=_1.otperformance=_1.getStringListFromEnv=_1.getNumberFromEnv=_1.getBooleanFromEnv=_1.getStringFromEnv=_1._globalThis=_1.SDK_INFO=_1.parseKeyPairsIntoRecord=_1.ExportResultCode=_1.unrefTimer=_1.timeInputToHrTime=_1.millisToHrTime=_1.isTimeInputHrTime=_1.isTimeInput=_1.hrTimeToTimeStamp=_1.hrTimeToNanoseconds=_1.hrTimeToMilliseconds=_1.hrTimeToMicroseconds=_1.hrTimeDuration=_1.hrTime=_1.getTimeOrigin=_1.addHrTimes=_1.loggingErrorHandler=_1.setGlobalErrorHandler=_1.globalErrorHandler=_1.sanitizeAttributes=_1.isAttributeValue=_1.AnchoredClock=_1.W3CBaggagePropagator=void 0;var kH0=$$();Object.defineProperty(_1,"W3CBaggagePropagator",{enumerable:!0,get:function(){return kH0.W3CBaggagePropagator}});var yH0=R$();Object.defineProperty(_1,"AnchoredClock",{enumerable:!0,get:function(){return yH0.AnchoredClock}});var Vf=y$();Object.defineProperty(_1,"isAttributeValue",{enumerable:!0,get:function(){return Vf.isAttributeValue}});Object.defineProperty(_1,"sanitizeAttributes",{enumerable:!0,get:function(){return Vf.sanitizeAttributes}});var qf=b$();Object.defineProperty(_1,"globalErrorHandler",{enumerable:!0,get:function(){return qf.globalErrorHandler}});Object.defineProperty(_1,"setGlobalErrorHandler",{enumerable:!0,get:function(){return qf.setGlobalErrorHandler}});var vH0=WH();Object.defineProperty(_1,"loggingErrorHandler",{enumerable:!0,get:function(){return vH0.loggingErrorHandler}});var J9=sw();Object.defineProperty(_1,"addHrTimes",{enumerable:!0,get:function(){return J9.addHrTimes}});Object.defineProperty(_1,"getTimeOrigin",{enumerable:!0,get:function(){return J9.getTimeOrigin}});Object.defineProperty(_1,"hrTime",{enumerable:!0,get:function(){return J9.hrTime}});Object.defineProperty(_1,"hrTimeDuration",{enumerable:!0,get:function(){return J9.hrTimeDuration}});Object.defineProperty(_1,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return J9.hrTimeToMicroseconds}});Object.defineProperty(_1,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return J9.hrTimeToMilliseconds}});Object.defineProperty(_1,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return J9.hrTimeToNanoseconds}});Object.defineProperty(_1,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return J9.hrTimeToTimeStamp}});Object.defineProperty(_1,"isTimeInput",{enumerable:!0,get:function(){return J9.isTimeInput}});Object.defineProperty(_1,"isTimeInputHrTime",{enumerable:!0,get:function(){return J9.isTimeInputHrTime}});Object.defineProperty(_1,"millisToHrTime",{enumerable:!0,get:function(){return J9.millisToHrTime}});Object.defineProperty(_1,"timeInputToHrTime",{enumerable:!0,get:function(){return J9.timeInputToHrTime}});var hH0=ZS();Object.defineProperty(_1,"unrefTimer",{enumerable:!0,get:function(){return hH0.unrefTimer}});var jH0=XS();Object.defineProperty(_1,"ExportResultCode",{enumerable:!0,get:function(){return jH0.ExportResultCode}});var _H0=QH();Object.defineProperty(_1,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return _H0.parseKeyPairsIntoRecord}});var c5=GH();Object.defineProperty(_1,"SDK_INFO",{enumerable:!0,get:function(){return c5.SDK_INFO}});Object.defineProperty(_1,"_globalThis",{enumerable:!0,get:function(){return c5._globalThis}});Object.defineProperty(_1,"getStringFromEnv",{enumerable:!0,get:function(){return c5.getStringFromEnv}});Object.defineProperty(_1,"getBooleanFromEnv",{enumerable:!0,get:function(){return c5.getBooleanFromEnv}});Object.defineProperty(_1,"getNumberFromEnv",{enumerable:!0,get:function(){return c5.getNumberFromEnv}});Object.defineProperty(_1,"getStringListFromEnv",{enumerable:!0,get:function(){return c5.getStringListFromEnv}});Object.defineProperty(_1,"otperformance",{enumerable:!0,get:function(){return c5.otperformance}});var xH0=FS();Object.defineProperty(_1,"CompositePropagator",{enumerable:!0,get:function(){return xH0.CompositePropagator}});var RJ=CS();Object.defineProperty(_1,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return RJ.TRACE_PARENT_HEADER}});Object.defineProperty(_1,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return RJ.TRACE_STATE_HEADER}});Object.defineProperty(_1,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return RJ.W3CTraceContextPropagator}});Object.defineProperty(_1,"parseTraceParent",{enumerable:!0,get:function(){return RJ.parseTraceParent}});var PJ=PS();Object.defineProperty(_1,"RPCType",{enumerable:!0,get:function(){return PJ.RPCType}});Object.defineProperty(_1,"deleteRPCMetadata",{enumerable:!0,get:function(){return PJ.deleteRPCMetadata}});Object.defineProperty(_1,"getRPCMetadata",{enumerable:!0,get:function(){return PJ.getRPCMetadata}});Object.defineProperty(_1,"setRPCMetadata",{enumerable:!0,get:function(){return PJ.setRPCMetadata}});var UH=uZ();Object.defineProperty(_1,"isTracingSuppressed",{enumerable:!0,get:function(){return UH.isTracingSuppressed}});Object.defineProperty(_1,"suppressTracing",{enumerable:!0,get:function(){return UH.suppressTracing}});Object.defineProperty(_1,"unsuppressTracing",{enumerable:!0,get:function(){return UH.unsuppressTracing}});var bH0=zH();Object.defineProperty(_1,"TraceState",{enumerable:!0,get:function(){return bH0.TraceState}});var uH0=mS();Object.defineProperty(_1,"merge",{enumerable:!0,get:function(){return uH0.merge}});var zf=cS();Object.defineProperty(_1,"TimeoutError",{enumerable:!0,get:function(){return zf.TimeoutError}});Object.defineProperty(_1,"callWithTimeout",{enumerable:!0,get:function(){return zf.callWithTimeout}});var Bf=iS();Object.defineProperty(_1,"isUrlIgnored",{enumerable:!0,get:function(){return Bf.isUrlIgnored}});Object.defineProperty(_1,"urlMatches",{enumerable:!0,get:function(){return Bf.urlMatches}});var mH0=Zf();Object.defineProperty(_1,"BindOnceFuture",{enumerable:!0,get:function(){return mH0.BindOnceFuture}});var gH0=Wf();Object.defineProperty(_1,"diagLogLevelFromString",{enumerable:!0,get:function(){return gH0.diagLogLevelFromString}});var dH0=Hf();_1.internal={_export:dH0._export}});var Of=H0((Uf)=>{Object.defineProperty(Uf,"__esModule",{value:!0});Uf.createLoggingPartialSuccessResponseHandler=void 0;var cH0=f1();function lH0(Y){return Object.prototype.hasOwnProperty.call(Y,"partialSuccess")}function nH0(){return{handleResponse(Y){if(Y==null||!lH0(Y)||Y.partialSuccess==null||Object.keys(Y.partialSuccess).length===0)return;cH0.diag.warn("Received Partial Success response:",JSON.stringify(Y.partialSuccess))}}}Uf.createLoggingPartialSuccessResponseHandler=nH0});var NH=H0((If)=>{Object.defineProperty(If,"__esModule",{value:!0});If.createOtlpExportDelegate=void 0;var l5=G6(),Df=AJ(),pH0=Of(),iH0=f1();class Tf{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(Y,Z,W,H,F){this._transport=Y,this._serializer=Z,this._responseHandler=W,this._promiseQueue=H,this._timeout=F,this._diagLogger=iH0.diag.createComponentLogger({namespace:"OTLPExportDelegate"})}export(Y,Z){if(this._diagLogger.debug("items to be sent",Y),this._promiseQueue.hasReachedLimit()){Z({code:l5.ExportResultCode.FAILED,error:Error("Concurrent export limit reached")});return}let W=this._serializer.serializeRequest(Y);if(W==null){Z({code:l5.ExportResultCode.FAILED,error:Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(W,this._timeout).then((H)=>{if(H.status==="success"){if(H.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(H.data))}catch(F){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",F,H.data)}Z({code:l5.ExportResultCode.SUCCESS});return}else if(H.status==="failure"&&H.error){Z({code:l5.ExportResultCode.FAILED,error:H.error});return}else if(H.status==="retryable")Z({code:l5.ExportResultCode.FAILED,error:H.error??new Df.OTLPExporterError("Export failed with retryable status")});else Z({code:l5.ExportResultCode.FAILED,error:new Df.OTLPExporterError("Export failed with unknown error")})},(H)=>Z({code:l5.ExportResultCode.FAILED,error:H})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function rH0(Y,Z){return new Tf(Y.transport,Y.serializer,(0,pH0.createLoggingPartialSuccessResponseHandler)(),Y.promiseHandler,Z.timeout)}If.createOtlpExportDelegate=rH0});var Mf=H0((Cf)=>{Object.defineProperty(Cf,"__esModule",{value:!0});Cf.createOtlpNetworkExportDelegate=void 0;var aH0=eF(),oH0=NH();function tH0(Y,Z,W){return(0,oH0.createOtlpExportDelegate)({transport:W,serializer:Z,promiseHandler:(0,aH0.createBoundedQueueExportPromiseHandler)(Y)},{timeout:Y.timeoutMillis})}Cf.createOtlpNetworkExportDelegate=tH0});var LJ=H0((n4)=>{Object.defineProperty(n4,"__esModule",{value:!0});n4.createOtlpNetworkExportDelegate=n4.CompressionAlgorithm=n4.getSharedConfigurationDefaults=n4.mergeOtlpSharedConfigurationWithDefaults=n4.OTLPExporterError=n4.OTLPExporterBase=void 0;var sH0=eI();Object.defineProperty(n4,"OTLPExporterBase",{enumerable:!0,get:function(){return sH0.OTLPExporterBase}});var eH0=AJ();Object.defineProperty(n4,"OTLPExporterError",{enumerable:!0,get:function(){return eH0.OTLPExporterError}});var Rf=bZ();Object.defineProperty(n4,"mergeOtlpSharedConfigurationWithDefaults",{enumerable:!0,get:function(){return Rf.mergeOtlpSharedConfigurationWithDefaults}});Object.defineProperty(n4,"getSharedConfigurationDefaults",{enumerable:!0,get:function(){return Rf.getSharedConfigurationDefaults}});var YV0=G$();Object.defineProperty(n4,"CompressionAlgorithm",{enumerable:!0,get:function(){return YV0.CompressionAlgorithm}});var ZV0=Mf();Object.defineProperty(n4,"createOtlpNetworkExportDelegate",{enumerable:!0,get:function(){return ZV0.createOtlpNetworkExportDelegate}})});var OH=H0((Zc0,Pf)=>{Pf.exports=XV0;function XV0(Y,Z){var W=Array(arguments.length-1),H=0,F=2,X=!0;while(F<arguments.length)W[H++]=arguments[F++];return new Promise(function(Q,G){W[H]=function(K){if(X)if(X=!1,K)G(K);else{var V=Array(arguments.length-1),B=0;while(B<V.length)V[B++]=arguments[B];Q.apply(null,V)}};try{Y.apply(Z||null,W)}catch(q){if(X)X=!1,G(q)}})}});var ff=H0((Sf)=>{var wJ=Sf;wJ.length=function(Z){var W=Z.length;if(!W)return 0;var H=0;while(--W%4>1&&Z.charAt(W)==="=")++H;return Math.ceil(Z.length*3)/4-H};var s7=Array(64),wf=Array(123);for(W9=0;W9<64;)wf[s7[W9]=W9<26?W9+65:W9<52?W9+71:W9<62?W9-4:W9-59|43]=W9++;var W9;wJ.encode=function(Z,W,H){var F=null,X=[],J=0,Q=0,G;while(W<H){var q=Z[W++];switch(Q){case 0:X[J++]=s7[q>>2],G=(q&3)<<4,Q=1;break;case 1:X[J++]=s7[G|q>>4],G=(q&15)<<2,Q=2;break;case 2:X[J++]=s7[G|q>>6],X[J++]=s7[q&63],Q=0;break}if(J>8191)(F||(F=[])).push(String.fromCharCode.apply(String,X)),J=0}if(Q){if(X[J++]=s7[G],X[J++]=61,Q===1)X[J++]=61}if(F){if(J)F.push(String.fromCharCode.apply(String,X.slice(0,J)));return F.join("")}return String.fromCharCode.apply(String,X.slice(0,J))};var Lf="invalid encoding";wJ.decode=function(Z,W,H){var F=H,X=0,J;for(var Q=0;Q<Z.length;){var G=Z.charCodeAt(Q++);if(G===61&&X>1)break;if((G=wf[G])===void 0)throw Error(Lf);switch(X){case 0:J=G,X=1;break;case 1:W[H++]=J<<2|(G&48)>>4,J=G,X=2;break;case 2:W[H++]=(J&15)<<4|(G&60)>>2,J=G,X=3;break;case 3:W[H++]=(J&3)<<6|G,X=0;break}}if(X===1)throw Error(Lf);return H-F};wJ.test=function(Z){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(Z)}});var yf=H0((Xc0,kf)=>{kf.exports=SJ;function SJ(){this._listeners={}}SJ.prototype.on=function(Z,W,H){return(this._listeners[Z]||(this._listeners[Z]=[])).push({fn:W,ctx:H||this}),this};SJ.prototype.off=function(Z,W){if(Z===void 0)this._listeners={};else if(W===void 0)this._listeners[Z]=[];else{var H=this._listeners[Z];for(var F=0;F<H.length;)if(H[F].fn===W)H.splice(F,1);else++F}return this};SJ.prototype.emit=function(Z){var W=this._listeners[Z];if(W){var H=[],F=1;for(;F<arguments.length;)H.push(arguments[F++]);for(F=0;F<W.length;)W[F].fn.apply(W[F++].ctx,H)}return this}});var uf=H0((Jc0,bf)=>{bf.exports=vf(vf);function vf(Y){if(typeof Float32Array<"u")(function(){var Z=new Float32Array([-0]),W=new Uint8Array(Z.buffer),H=W[3]===128;function F(G,q,K){Z[0]=G,q[K]=W[0],q[K+1]=W[1],q[K+2]=W[2],q[K+3]=W[3]}function X(G,q,K){Z[0]=G,q[K]=W[3],q[K+1]=W[2],q[K+2]=W[1],q[K+3]=W[0]}Y.writeFloatLE=H?F:X,Y.writeFloatBE=H?X:F;function J(G,q){return W[0]=G[q],W[1]=G[q+1],W[2]=G[q+2],W[3]=G[q+3],Z[0]}function Q(G,q){return W[3]=G[q],W[2]=G[q+1],W[1]=G[q+2],W[0]=G[q+3],Z[0]}Y.readFloatLE=H?J:Q,Y.readFloatBE=H?Q:J})();else(function(){function Z(H,F,X,J){var Q=F<0?1:0;if(Q)F=-F;if(F===0)H(1/F>0?0:2147483648,X,J);else if(isNaN(F))H(2143289344,X,J);else if(F>340282346638528860000000000000000000000)H((Q<<31|2139095040)>>>0,X,J);else if(F<0.000000000000000000000000000000000000011754943508222875)H((Q<<31|Math.round(F/0.000000000000000000000000000000000000000000001401298464324817))>>>0,X,J);else{var G=Math.floor(Math.log(F)/Math.LN2),q=Math.round(F*Math.pow(2,-G)*8388608)&8388607;H((Q<<31|G+127<<23|q)>>>0,X,J)}}Y.writeFloatLE=Z.bind(null,hf),Y.writeFloatBE=Z.bind(null,jf);function W(H,F,X){var J=H(F,X),Q=(J>>31)*2+1,G=J>>>23&255,q=J&8388607;return G===255?q?NaN:Q*(1/0):G===0?Q*0.000000000000000000000000000000000000000000001401298464324817*q:Q*Math.pow(2,G-150)*(q+8388608)}Y.readFloatLE=W.bind(null,_f),Y.readFloatBE=W.bind(null,xf)})();if(typeof Float64Array<"u")(function(){var Z=new Float64Array([-0]),W=new Uint8Array(Z.buffer),H=W[7]===128;function F(G,q,K){Z[0]=G,q[K]=W[0],q[K+1]=W[1],q[K+2]=W[2],q[K+3]=W[3],q[K+4]=W[4],q[K+5]=W[5],q[K+6]=W[6],q[K+7]=W[7]}function X(G,q,K){Z[0]=G,q[K]=W[7],q[K+1]=W[6],q[K+2]=W[5],q[K+3]=W[4],q[K+4]=W[3],q[K+5]=W[2],q[K+6]=W[1],q[K+7]=W[0]}Y.writeDoubleLE=H?F:X,Y.writeDoubleBE=H?X:F;function J(G,q){return W[0]=G[q],W[1]=G[q+1],W[2]=G[q+2],W[3]=G[q+3],W[4]=G[q+4],W[5]=G[q+5],W[6]=G[q+6],W[7]=G[q+7],Z[0]}function Q(G,q){return W[7]=G[q],W[6]=G[q+1],W[5]=G[q+2],W[4]=G[q+3],W[3]=G[q+4],W[2]=G[q+5],W[1]=G[q+6],W[0]=G[q+7],Z[0]}Y.readDoubleLE=H?J:Q,Y.readDoubleBE=H?Q:J})();else(function(){function Z(H,F,X,J,Q,G){var q=J<0?1:0;if(q)J=-J;if(J===0)H(0,Q,G+F),H(1/J>0?0:2147483648,Q,G+X);else if(isNaN(J))H(0,Q,G+F),H(2146959360,Q,G+X);else if(J>179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)H(0,Q,G+F),H((q<<31|2146435072)>>>0,Q,G+X);else{var K;if(J<0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022250738585072014)K=J/0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005,H(K>>>0,Q,G+F),H((q<<31|K/4294967296)>>>0,Q,G+X);else{var V=Math.floor(Math.log(J)/Math.LN2);if(V===1024)V=1023;K=J*Math.pow(2,-V),H(K*4503599627370496>>>0,Q,G+F),H((q<<31|V+1023<<20|K*1048576&1048575)>>>0,Q,G+X)}}}Y.writeDoubleLE=Z.bind(null,hf,0,4),Y.writeDoubleBE=Z.bind(null,jf,4,0);function W(H,F,X,J,Q){var G=H(J,Q+F),q=H(J,Q+X),K=(q>>31)*2+1,V=q>>>20&2047,B=4294967296*(q&1048575)+G;return V===2047?B?NaN:K*(1/0):V===0?K*0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005*B:K*Math.pow(2,V-1075)*(B+4503599627370496)}Y.readDoubleLE=W.bind(null,_f,0,4),Y.readDoubleBE=W.bind(null,xf,4,0)})();return Y}function hf(Y,Z,W){Z[W]=Y&255,Z[W+1]=Y>>>8&255,Z[W+2]=Y>>>16&255,Z[W+3]=Y>>>24}function jf(Y,Z,W){Z[W]=Y>>>24,Z[W+1]=Y>>>16&255,Z[W+2]=Y>>>8&255,Z[W+3]=Y&255}function _f(Y,Z){return(Y[Z]|Y[Z+1]<<8|Y[Z+2]<<16|Y[Z+3]<<24)>>>0}function xf(Y,Z){return(Y[Z]<<24|Y[Z+1]<<16|Y[Z+2]<<8|Y[Z+3])>>>0}});var TH=H0((mf,DH)=>{DH.exports=JV0;function JV0(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(Y){}return null}});var df=H0((gf)=>{var IH=gf;IH.length=function(Z){var W=0,H=0;for(var F=0;F<Z.length;++F)if(H=Z.charCodeAt(F),H<128)W+=1;else if(H<2048)W+=2;else if((H&64512)===55296&&(Z.charCodeAt(F+1)&64512)===56320)++F,W+=4;else W+=3;return W};IH.read=function(Z,W,H){var F=H-W;if(F<1)return"";var X=null,J=[],Q=0,G;while(W<H){if(G=Z[W++],G<128)J[Q++]=G;else if(G>191&&G<224)J[Q++]=(G&31)<<6|Z[W++]&63;else if(G>239&&G<365)G=((G&7)<<18|(Z[W++]&63)<<12|(Z[W++]&63)<<6|Z[W++]&63)-65536,J[Q++]=55296+(G>>10),J[Q++]=56320+(G&1023);else J[Q++]=(G&15)<<12|(Z[W++]&63)<<6|Z[W++]&63;if(Q>8191)(X||(X=[])).push(String.fromCharCode.apply(String,J)),Q=0}if(X){if(Q)X.push(String.fromCharCode.apply(String,J.slice(0,Q)));return X.join("")}return String.fromCharCode.apply(String,J.slice(0,Q))};IH.write=function(Z,W,H){var F=H,X,J;for(var Q=0;Q<Z.length;++Q)if(X=Z.charCodeAt(Q),X<128)W[H++]=X;else if(X<2048)W[H++]=X>>6|192,W[H++]=X&63|128;else if((X&64512)===55296&&((J=Z.charCodeAt(Q+1))&64512)===56320)X=65536+((X&1023)<<10)+(J&1023),++Q,W[H++]=X>>18|240,W[H++]=X>>12&63|128,W[H++]=X>>6&63|128,W[H++]=X&63|128;else W[H++]=X>>12|224,W[H++]=X>>6&63|128,W[H++]=X&63|128;return H-F}});var lf=H0((Kc0,cf)=>{cf.exports=WV0;function WV0(Y,Z,W){var H=W||8192,F=H>>>1,X=null,J=H;return function(G){if(G<1||G>F)return Y(G);if(J+G>H)X=Y(H),J=0;var q=Z.call(X,J,J+=G);if(J&7)J=(J|7)+1;return q}}});var pf=H0((Gc0,nf)=>{nf.exports=J8;var cZ=l9();function J8(Y,Z){this.lo=Y>>>0,this.hi=Z>>>0}var n5=J8.zero=new J8(0,0);n5.toNumber=function(){return 0};n5.zzEncode=n5.zzDecode=function(){return this};n5.length=function(){return 1};var KV0=J8.zeroHash="\x00\x00\x00\x00\x00\x00\x00\x00";J8.fromNumber=function(Z){if(Z===0)return n5;var W=Z<0;if(W)Z=-Z;var H=Z>>>0,F=(Z-H)/4294967296>>>0;if(W){if(F=~F>>>0,H=~H>>>0,++H>4294967295){if(H=0,++F>4294967295)F=0}}return new J8(H,F)};J8.from=function(Z){if(typeof Z==="number")return J8.fromNumber(Z);if(cZ.isString(Z))if(cZ.Long)Z=cZ.Long.fromString(Z);else return J8.fromNumber(parseInt(Z,10));return Z.low||Z.high?new J8(Z.low>>>0,Z.high>>>0):n5};J8.prototype.toNumber=function(Z){if(!Z&&this.hi>>>31){var W=~this.lo+1>>>0,H=~this.hi>>>0;if(!W)H=H+1>>>0;return-(W+H*4294967296)}return this.lo+this.hi*4294967296};J8.prototype.toLong=function(Z){return cZ.Long?new cZ.Long(this.lo|0,this.hi|0,Boolean(Z)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(Z)}};var p4=String.prototype.charCodeAt;J8.fromHash=function(Z){if(Z===KV0)return n5;return new J8((p4.call(Z,0)|p4.call(Z,1)<<8|p4.call(Z,2)<<16|p4.call(Z,3)<<24)>>>0,(p4.call(Z,4)|p4.call(Z,5)<<8|p4.call(Z,6)<<16|p4.call(Z,7)<<24)>>>0)};J8.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)};J8.prototype.zzEncode=function(){var Z=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^Z)>>>0,this.lo=(this.lo<<1^Z)>>>0,this};J8.prototype.zzDecode=function(){var Z=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^Z)>>>0,this.hi=(this.hi>>>1^Z)>>>0,this};J8.prototype.length=function(){var Z=this.lo,W=(this.lo>>>28|this.hi<<4)>>>0,H=this.hi>>>24;return H===0?W===0?Z<16384?Z<128?1:2:Z<2097152?3:4:W<16384?W<128?5:6:W<2097152?7:8:H<128?9:10}});var l9=H0(($H)=>{var L1=$H;L1.asPromise=OH();L1.base64=ff();L1.EventEmitter=yf();L1.float=uf();L1.inquire=TH();L1.utf8=df();L1.pool=lf();L1.LongBits=pf();L1.isNode=Boolean(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);L1.global=L1.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||$H;L1.emptyArray=Object.freeze?Object.freeze([]):[];L1.emptyObject=Object.freeze?Object.freeze({}):{};L1.isInteger=Number.isInteger||function(Z){return typeof Z==="number"&&isFinite(Z)&&Math.floor(Z)===Z};L1.isString=function(Z){return typeof Z==="string"||Z instanceof String};L1.isObject=function(Z){return Z&&typeof Z==="object"};L1.isset=L1.isSet=function(Z,W){var H=Z[W];if(H!=null&&Z.hasOwnProperty(W))return typeof H!=="object"||(Array.isArray(H)?H.length:Object.keys(H).length)>0;return!1};L1.Buffer=function(){try{var Y=L1.inquire("buffer").Buffer;return Y.prototype.utf8Write?Y:null}catch(Z){return null}}();L1._Buffer_from=null;L1._Buffer_allocUnsafe=null;L1.newBuffer=function(Z){return typeof Z==="number"?L1.Buffer?L1._Buffer_allocUnsafe(Z):new L1.Array(Z):L1.Buffer?L1._Buffer_from(Z):typeof Uint8Array>"u"?Z:new Uint8Array(Z)};L1.Array=typeof Uint8Array<"u"?Uint8Array:Array;L1.Long=L1.global.dcodeIO&&L1.global.dcodeIO.Long||L1.global.Long||L1.inquire("long");L1.key2Re=/^true|false|0|1$/;L1.key32Re=/^-?(?:0|[1-9][0-9]*)$/;L1.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;L1.longToHash=function(Z){return Z?L1.LongBits.from(Z).toHash():L1.LongBits.zeroHash};L1.longFromHash=function(Z,W){var H=L1.LongBits.fromHash(Z);if(L1.Long)return L1.Long.fromBits(H.lo,H.hi,W);return H.toNumber(Boolean(W))};function rf(Y,Z,W){for(var H=Object.keys(Z),F=0;F<H.length;++F)if(Y[H[F]]===void 0||!W)Y[H[F]]=Z[H[F]];return Y}L1.merge=rf;L1.lcFirst=function(Z){return Z.charAt(0).toLowerCase()+Z.substring(1)};function af(Y){function Z(W,H){if(!(this instanceof Z))return new Z(W,H);if(Object.defineProperty(this,"message",{get:function(){return W}}),Error.captureStackTrace)Error.captureStackTrace(this,Z);else Object.defineProperty(this,"stack",{value:Error().stack||""});if(H)rf(this,H)}return Z.prototype=Object.create(Error.prototype,{constructor:{value:Z,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return Y},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),Z}L1.newError=af;L1.ProtocolError=af("ProtocolError");L1.oneOfGetter=function(Z){var W={};for(var H=0;H<Z.length;++H)W[Z[H]]=1;return function(){for(var F=Object.keys(this),X=F.length-1;X>-1;--X)if(W[F[X]]===1&&this[F[X]]!==void 0&&this[F[X]]!==null)return F[X]}};L1.oneOfSetter=function(Z){return function(W){for(var H=0;H<Z.length;++H)if(Z[H]!==W)delete this[Z[H]]}};L1.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};L1._configure=function(){var Y=L1.Buffer;if(!Y){L1._Buffer_from=L1._Buffer_allocUnsafe=null;return}L1._Buffer_from=Y.from!==Uint8Array.from&&Y.from||function(W,H){return new Y(W,H)},L1._Buffer_allocUnsafe=Y.allocUnsafe||function(W){return new Y(W)}}});var kJ=H0((Hc0,ef)=>{ef.exports=F6;var K9=l9(),CH,fJ=K9.LongBits,of=K9.base64,tf=K9.utf8;function lZ(Y,Z,W){this.fn=Y,this.len=Z,this.next=void 0,this.val=W}function MH(){}function GV0(Y){this.head=Y.head,this.tail=Y.tail,this.len=Y.len,this.next=Y.states}function F6(){this.len=0,this.head=new lZ(MH,0,0),this.tail=this.head,this.states=null}var sf=function(){return K9.Buffer?function(){return(F6.create=function(){return new CH})()}:function(){return new F6}};F6.create=sf();F6.alloc=function(Z){return new K9.Array(Z)};if(K9.Array!==Array)F6.alloc=K9.pool(F6.alloc,K9.Array.prototype.subarray);F6.prototype._push=function(Z,W,H){return this.tail=this.tail.next=new lZ(Z,W,H),this.len+=W,this};function RH(Y,Z,W){Z[W]=Y&255}function FV0(Y,Z,W){while(Y>127)Z[W++]=Y&127|128,Y>>>=7;Z[W]=Y}function PH(Y,Z){this.len=Y,this.next=void 0,this.val=Z}PH.prototype=Object.create(lZ.prototype);PH.prototype.fn=FV0;F6.prototype.uint32=function(Z){return this.len+=(this.tail=this.tail.next=new PH((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this};F6.prototype.int32=function(Z){return Z<0?this._push(LH,10,fJ.fromNumber(Z)):this.uint32(Z)};F6.prototype.sint32=function(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function LH(Y,Z,W){while(Y.hi)Z[W++]=Y.lo&127|128,Y.lo=(Y.lo>>>7|Y.hi<<25)>>>0,Y.hi>>>=7;while(Y.lo>127)Z[W++]=Y.lo&127|128,Y.lo=Y.lo>>>7;Z[W++]=Y.lo}F6.prototype.uint64=function(Z){var W=fJ.from(Z);return this._push(LH,W.length(),W)};F6.prototype.int64=F6.prototype.uint64;F6.prototype.sint64=function(Z){var W=fJ.from(Z).zzEncode();return this._push(LH,W.length(),W)};F6.prototype.bool=function(Z){return this._push(RH,1,Z?1:0)};function EH(Y,Z,W){Z[W]=Y&255,Z[W+1]=Y>>>8&255,Z[W+2]=Y>>>16&255,Z[W+3]=Y>>>24}F6.prototype.fixed32=function(Z){return this._push(EH,4,Z>>>0)};F6.prototype.sfixed32=F6.prototype.fixed32;F6.prototype.fixed64=function(Z){var W=fJ.from(Z);return this._push(EH,4,W.lo)._push(EH,4,W.hi)};F6.prototype.sfixed64=F6.prototype.fixed64;F6.prototype.float=function(Z){return this._push(K9.float.writeFloatLE,4,Z)};F6.prototype.double=function(Z){return this._push(K9.float.writeDoubleLE,8,Z)};var HV0=K9.Array.prototype.set?function(Z,W,H){W.set(Z,H)}:function(Z,W,H){for(var F=0;F<Z.length;++F)W[H+F]=Z[F]};F6.prototype.bytes=function(Z){var W=Z.length>>>0;if(!W)return this._push(RH,1,0);if(K9.isString(Z)){var H=F6.alloc(W=of.length(Z));of.decode(Z,H,0),Z=H}return this.uint32(W)._push(HV0,W,Z)};F6.prototype.string=function(Z){var W=tf.length(Z);return W?this.uint32(W)._push(tf.write,W,Z):this._push(RH,1,0)};F6.prototype.fork=function(){return this.states=new GV0(this),this.head=this.tail=new lZ(MH,0,0),this.len=0,this};F6.prototype.reset=function(){if(this.states)this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next;else this.head=this.tail=new lZ(MH,0,0),this.len=0;return this};F6.prototype.ldelim=function(){var Z=this.head,W=this.tail,H=this.len;if(this.reset().uint32(H),H)this.tail.next=Z.next,this.tail=W,this.len+=H;return this};F6.prototype.finish=function(){var Z=this.head.next,W=this.constructor.alloc(this.len),H=0;while(Z)Z.fn(Z.val,W,H),H+=Z.len,Z=Z.next;return W};F6._configure=function(Y){CH=Y,F6.create=sf(),CH._configure()}});var Qk=H0((Vc0,Zk)=>{Zk.exports=n9;var Yk=kJ();(n9.prototype=Object.create(Yk.prototype)).constructor=n9;var i4=l9();function n9(){Yk.call(this)}n9._configure=function(){n9.alloc=i4._Buffer_allocUnsafe,n9.writeBytesBuffer=i4.Buffer&&i4.Buffer.prototype instanceof Uint8Array&&i4.Buffer.prototype.set.name==="set"?function(Z,W,H){W.set(Z,H)}:function(Z,W,H){if(Z.copy)Z.copy(W,H,0,Z.length);else for(var F=0;F<Z.length;)W[H++]=Z[F++]}};n9.prototype.bytes=function(Z){if(i4.isString(Z))Z=i4._Buffer_from(Z,"base64");var W=Z.length>>>0;if(this.uint32(W),W)this._push(n9.writeBytesBuffer,W,Z);return this};function VV0(Y,Z,W){if(Y.length<40)i4.utf8.write(Y,Z,W);else if(Z.utf8Write)Z.utf8Write(Y,W);else Z.write(Y,W)}n9.prototype.string=function(Z){var W=i4.Buffer.byteLength(Z);if(this.uint32(W),W)this._push(VV0,W,Z);return this};n9._configure()});var vJ=H0((qc0,Gk)=>{Gk.exports=c6;var M9=l9(),SH,Wk=M9.LongBits,qV0=M9.utf8;function R9(Y,Z){return RangeError("index out of range: "+Y.pos+" + "+(Z||1)+" > "+Y.len)}function c6(Y){this.buf=Y,this.pos=0,this.len=Y.length}var Xk=typeof Uint8Array<"u"?function(Z){if(Z instanceof Uint8Array||Array.isArray(Z))return new c6(Z);throw Error("illegal buffer")}:function(Z){if(Array.isArray(Z))return new c6(Z);throw Error("illegal buffer")},Kk=function(){return M9.Buffer?function(W){return(c6.create=function(F){return M9.Buffer.isBuffer(F)?new SH(F):Xk(F)})(W)}:Xk};c6.create=Kk();c6.prototype._slice=M9.Array.prototype.subarray||M9.Array.prototype.slice;c6.prototype.uint32=function(){var Z=4294967295;return function(){if(Z=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)return Z;if(Z=(Z|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128)return Z;if((this.pos+=5)>this.len)throw this.pos=this.len,R9(this,10);return Z}}();c6.prototype.int32=function(){return this.uint32()|0};c6.prototype.sint32=function(){var Z=this.uint32();return Z>>>1^-(Z&1)|0};function wH(){var Y=new Wk(0,0),Z=0;if(this.len-this.pos>4){for(;Z<4;++Z)if(Y.lo=(Y.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return Y;if(Y.lo=(Y.lo|(this.buf[this.pos]&127)<<28)>>>0,Y.hi=(Y.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return Y;Z=0}else{for(;Z<3;++Z){if(this.pos>=this.len)throw R9(this);if(Y.lo=(Y.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return Y}return Y.lo=(Y.lo|(this.buf[this.pos++]&127)<<Z*7)>>>0,Y}if(this.len-this.pos>4){for(;Z<5;++Z)if(Y.hi=(Y.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return Y}else for(;Z<5;++Z){if(this.pos>=this.len)throw R9(this);if(Y.hi=(Y.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return Y}throw Error("invalid varint encoding")}c6.prototype.bool=function(){return this.uint32()!==0};function yJ(Y,Z){return(Y[Z-4]|Y[Z-3]<<8|Y[Z-2]<<16|Y[Z-1]<<24)>>>0}c6.prototype.fixed32=function(){if(this.pos+4>this.len)throw R9(this,4);return yJ(this.buf,this.pos+=4)};c6.prototype.sfixed32=function(){if(this.pos+4>this.len)throw R9(this,4);return yJ(this.buf,this.pos+=4)|0};function Jk(){if(this.pos+8>this.len)throw R9(this,8);return new Wk(yJ(this.buf,this.pos+=4),yJ(this.buf,this.pos+=4))}c6.prototype.float=function(){if(this.pos+4>this.len)throw R9(this,4);var Z=M9.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Z};c6.prototype.double=function(){if(this.pos+8>this.len)throw R9(this,4);var Z=M9.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Z};c6.prototype.bytes=function(){var Z=this.uint32(),W=this.pos,H=this.pos+Z;if(H>this.len)throw R9(this,Z);if(this.pos+=Z,Array.isArray(this.buf))return this.buf.slice(W,H);if(W===H){var F=M9.Buffer;return F?F.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,W,H)};c6.prototype.string=function(){var Z=this.bytes();return qV0.read(Z,0,Z.length)};c6.prototype.skip=function(Z){if(typeof Z==="number"){if(this.pos+Z>this.len)throw R9(this,Z);this.pos+=Z}else do if(this.pos>=this.len)throw R9(this);while(this.buf[this.pos++]&128);return this};c6.prototype.skipType=function(Y){switch(Y){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:while((Y=this.uint32()&7)!==4)this.skipType(Y);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+Y+" at offset "+this.pos)}return this};c6._configure=function(Y){SH=Y,c6.create=Kk(),SH._configure();var Z=M9.Long?"toLong":"toNumber";M9.merge(c6.prototype,{int64:function(){return wH.call(this)[Z](!1)},uint64:function(){return wH.call(this)[Z](!0)},sint64:function(){return wH.call(this).zzDecode()[Z](!1)},fixed64:function(){return Jk.call(this)[Z](!0)},sfixed64:function(){return Jk.call(this)[Z](!1)}})}});var qk=H0((zc0,Vk)=>{Vk.exports=p5;var Hk=vJ();(p5.prototype=Object.create(Hk.prototype)).constructor=p5;var Fk=l9();function p5(Y){Hk.call(this,Y)}p5._configure=function(){if(Fk.Buffer)p5.prototype._slice=Fk.Buffer.prototype.slice};p5.prototype.string=function(){var Z=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+Z,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+Z,this.len))};p5._configure()});var Bk=H0((Bc0,zk)=>{zk.exports=nZ;var fH=l9();(nZ.prototype=Object.create(fH.EventEmitter.prototype)).constructor=nZ;function nZ(Y,Z,W){if(typeof Y!=="function")throw TypeError("rpcImpl must be a function");fH.EventEmitter.call(this),this.rpcImpl=Y,this.requestDelimited=Boolean(Z),this.responseDelimited=Boolean(W)}nZ.prototype.rpcCall=function Y(Z,W,H,F,X){if(!F)throw TypeError("request must be specified");var J=this;if(!X)return fH.asPromise(Y,J,Z,W,H,F);if(!J.rpcImpl){setTimeout(function(){X(Error("already ended"))},0);return}try{return J.rpcImpl(Z,W[J.requestDelimited?"encodeDelimited":"encode"](F).finish(),function(G,q){if(G)return J.emit("error",G,Z),X(G);if(q===null){J.end(!0);return}if(!(q instanceof H))try{q=H[J.responseDelimited?"decodeDelimited":"decode"](q)}catch(K){return J.emit("error",K,Z),X(K)}return J.emit("data",q,Z),X(null,q)})}catch(Q){J.emit("error",Q,Z),setTimeout(function(){X(Q)},0);return}};nZ.prototype.end=function(Z){if(this.rpcImpl){if(!Z)this.rpcImpl(null,null,null);this.rpcImpl=null,this.emit("end").off()}return this}});var kH=H0((Ak)=>{var zV0=Ak;zV0.Service=Bk()});var yH=H0((Uc0,Uk)=>{Uk.exports={}});var vH=H0((Ok)=>{var j8=Ok;j8.build="minimal";j8.Writer=kJ();j8.BufferWriter=Qk();j8.Reader=vJ();j8.BufferReader=qk();j8.util=l9();j8.rpc=kH();j8.roots=yH();j8.configure=Nk;function Nk(){j8.util._configure(),j8.Writer._configure(j8.BufferWriter),j8.Reader._configure(j8.BufferReader)}Nk()});var hJ=H0((Dk,Tk)=>{Object.defineProperty(Dk,"__esModule",{value:!0});var k1=vH(),x0=k1.Reader,u1=k1.Writer,W0=k1.util,X0=k1.roots.default||(k1.roots.default={});X0.opentelemetry=function(){var Y={};return Y.proto=function(){var Z={};return Z.common=function(){var W={};return W.v1=function(){var H={};return H.AnyValue=function(){function F(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.stringValue=null,F.prototype.boolValue=null,F.prototype.intValue=null,F.prototype.doubleValue=null,F.prototype.arrayValue=null,F.prototype.kvlistValue=null,F.prototype.bytesValue=null;var X;return Object.defineProperty(F.prototype,"value",{get:W0.oneOfGetter(X=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.stringValue!=null&&Object.hasOwnProperty.call(Q,"stringValue"))G.uint32(10).string(Q.stringValue);if(Q.boolValue!=null&&Object.hasOwnProperty.call(Q,"boolValue"))G.uint32(16).bool(Q.boolValue);if(Q.intValue!=null&&Object.hasOwnProperty.call(Q,"intValue"))G.uint32(24).int64(Q.intValue);if(Q.doubleValue!=null&&Object.hasOwnProperty.call(Q,"doubleValue"))G.uint32(33).double(Q.doubleValue);if(Q.arrayValue!=null&&Object.hasOwnProperty.call(Q,"arrayValue"))X0.opentelemetry.proto.common.v1.ArrayValue.encode(Q.arrayValue,G.uint32(42).fork()).ldelim();if(Q.kvlistValue!=null&&Object.hasOwnProperty.call(Q,"kvlistValue"))X0.opentelemetry.proto.common.v1.KeyValueList.encode(Q.kvlistValue,G.uint32(50).fork()).ldelim();if(Q.bytesValue!=null&&Object.hasOwnProperty.call(Q,"bytesValue"))G.uint32(58).bytes(Q.bytesValue);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.common.v1.AnyValue;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.stringValue=Q.string();break}case 2:{V.boolValue=Q.bool();break}case 3:{V.intValue=Q.int64();break}case 4:{V.doubleValue=Q.double();break}case 5:{V.arrayValue=X0.opentelemetry.proto.common.v1.ArrayValue.decode(Q,Q.uint32());break}case 6:{V.kvlistValue=X0.opentelemetry.proto.common.v1.KeyValueList.decode(Q,Q.uint32());break}case 7:{V.bytesValue=Q.bytes();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.stringValue!=null&&Q.hasOwnProperty("stringValue")){if(G.value=1,!W0.isString(Q.stringValue))return"stringValue: string expected"}if(Q.boolValue!=null&&Q.hasOwnProperty("boolValue")){if(G.value===1)return"value: multiple values";if(G.value=1,typeof Q.boolValue!=="boolean")return"boolValue: boolean expected"}if(Q.intValue!=null&&Q.hasOwnProperty("intValue")){if(G.value===1)return"value: multiple values";if(G.value=1,!W0.isInteger(Q.intValue)&&!(Q.intValue&&W0.isInteger(Q.intValue.low)&&W0.isInteger(Q.intValue.high)))return"intValue: integer|Long expected"}if(Q.doubleValue!=null&&Q.hasOwnProperty("doubleValue")){if(G.value===1)return"value: multiple values";if(G.value=1,typeof Q.doubleValue!=="number")return"doubleValue: number expected"}if(Q.arrayValue!=null&&Q.hasOwnProperty("arrayValue")){if(G.value===1)return"value: multiple values";G.value=1;{var q=X0.opentelemetry.proto.common.v1.ArrayValue.verify(Q.arrayValue);if(q)return"arrayValue."+q}}if(Q.kvlistValue!=null&&Q.hasOwnProperty("kvlistValue")){if(G.value===1)return"value: multiple values";G.value=1;{var q=X0.opentelemetry.proto.common.v1.KeyValueList.verify(Q.kvlistValue);if(q)return"kvlistValue."+q}}if(Q.bytesValue!=null&&Q.hasOwnProperty("bytesValue")){if(G.value===1)return"value: multiple values";if(G.value=1,!(Q.bytesValue&&typeof Q.bytesValue.length==="number"||W0.isString(Q.bytesValue)))return"bytesValue: buffer expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.common.v1.AnyValue)return Q;var G=new X0.opentelemetry.proto.common.v1.AnyValue;if(Q.stringValue!=null)G.stringValue=String(Q.stringValue);if(Q.boolValue!=null)G.boolValue=Boolean(Q.boolValue);if(Q.intValue!=null){if(W0.Long)(G.intValue=W0.Long.fromValue(Q.intValue)).unsigned=!1;else if(typeof Q.intValue==="string")G.intValue=parseInt(Q.intValue,10);else if(typeof Q.intValue==="number")G.intValue=Q.intValue;else if(typeof Q.intValue==="object")G.intValue=new W0.LongBits(Q.intValue.low>>>0,Q.intValue.high>>>0).toNumber()}if(Q.doubleValue!=null)G.doubleValue=Number(Q.doubleValue);if(Q.arrayValue!=null){if(typeof Q.arrayValue!=="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");G.arrayValue=X0.opentelemetry.proto.common.v1.ArrayValue.fromObject(Q.arrayValue)}if(Q.kvlistValue!=null){if(typeof Q.kvlistValue!=="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");G.kvlistValue=X0.opentelemetry.proto.common.v1.KeyValueList.fromObject(Q.kvlistValue)}if(Q.bytesValue!=null){if(typeof Q.bytesValue==="string")W0.base64.decode(Q.bytesValue,G.bytesValue=W0.newBuffer(W0.base64.length(Q.bytesValue)),0);else if(Q.bytesValue.length>=0)G.bytesValue=Q.bytesValue}return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(Q.stringValue!=null&&Q.hasOwnProperty("stringValue")){if(q.stringValue=Q.stringValue,G.oneofs)q.value="stringValue"}if(Q.boolValue!=null&&Q.hasOwnProperty("boolValue")){if(q.boolValue=Q.boolValue,G.oneofs)q.value="boolValue"}if(Q.intValue!=null&&Q.hasOwnProperty("intValue")){if(typeof Q.intValue==="number")q.intValue=G.longs===String?String(Q.intValue):Q.intValue;else q.intValue=G.longs===String?W0.Long.prototype.toString.call(Q.intValue):G.longs===Number?new W0.LongBits(Q.intValue.low>>>0,Q.intValue.high>>>0).toNumber():Q.intValue;if(G.oneofs)q.value="intValue"}if(Q.doubleValue!=null&&Q.hasOwnProperty("doubleValue")){if(q.doubleValue=G.json&&!isFinite(Q.doubleValue)?String(Q.doubleValue):Q.doubleValue,G.oneofs)q.value="doubleValue"}if(Q.arrayValue!=null&&Q.hasOwnProperty("arrayValue")){if(q.arrayValue=X0.opentelemetry.proto.common.v1.ArrayValue.toObject(Q.arrayValue,G),G.oneofs)q.value="arrayValue"}if(Q.kvlistValue!=null&&Q.hasOwnProperty("kvlistValue")){if(q.kvlistValue=X0.opentelemetry.proto.common.v1.KeyValueList.toObject(Q.kvlistValue,G),G.oneofs)q.value="kvlistValue"}if(Q.bytesValue!=null&&Q.hasOwnProperty("bytesValue")){if(q.bytesValue=G.bytes===String?W0.base64.encode(Q.bytesValue,0,Q.bytesValue.length):G.bytes===Array?Array.prototype.slice.call(Q.bytesValue):Q.bytesValue,G.oneofs)q.value="bytesValue"}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.common.v1.AnyValue"},F}(),H.ArrayValue=function(){function F(X){if(this.values=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.values=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.values!=null&&J.values.length)for(var G=0;G<J.values.length;++G)X0.opentelemetry.proto.common.v1.AnyValue.encode(J.values[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.ArrayValue;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.values&&K.values.length))K.values=[];K.values.push(X0.opentelemetry.proto.common.v1.AnyValue.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.values!=null&&J.hasOwnProperty("values")){if(!Array.isArray(J.values))return"values: array expected";for(var Q=0;Q<J.values.length;++Q){var G=X0.opentelemetry.proto.common.v1.AnyValue.verify(J.values[Q]);if(G)return"values."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.ArrayValue)return J;var Q=new X0.opentelemetry.proto.common.v1.ArrayValue;if(J.values){if(!Array.isArray(J.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");Q.values=[];for(var G=0;G<J.values.length;++G){if(typeof J.values[G]!=="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");Q.values[G]=X0.opentelemetry.proto.common.v1.AnyValue.fromObject(J.values[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.values=[];if(J.values&&J.values.length){G.values=[];for(var q=0;q<J.values.length;++q)G.values[q]=X0.opentelemetry.proto.common.v1.AnyValue.toObject(J.values[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.ArrayValue"},F}(),H.KeyValueList=function(){function F(X){if(this.values=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.values=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.values!=null&&J.values.length)for(var G=0;G<J.values.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.values[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.KeyValueList;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.values&&K.values.length))K.values=[];K.values.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.values!=null&&J.hasOwnProperty("values")){if(!Array.isArray(J.values))return"values: array expected";for(var Q=0;Q<J.values.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.values[Q]);if(G)return"values."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.KeyValueList)return J;var Q=new X0.opentelemetry.proto.common.v1.KeyValueList;if(J.values){if(!Array.isArray(J.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");Q.values=[];for(var G=0;G<J.values.length;++G){if(typeof J.values[G]!=="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");Q.values[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.values[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.values=[];if(J.values&&J.values.length){G.values=[];for(var q=0;q<J.values.length;++q)G.values[q]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.values[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.KeyValueList"},F}(),H.KeyValue=function(){function F(X){if(X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.key=null,F.prototype.value=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.key!=null&&Object.hasOwnProperty.call(J,"key"))Q.uint32(10).string(J.key);if(J.value!=null&&Object.hasOwnProperty.call(J,"value"))X0.opentelemetry.proto.common.v1.AnyValue.encode(J.value,Q.uint32(18).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.KeyValue;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.key=J.string();break}case 2:{K.value=X0.opentelemetry.proto.common.v1.AnyValue.decode(J,J.uint32());break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.key!=null&&J.hasOwnProperty("key")){if(!W0.isString(J.key))return"key: string expected"}if(J.value!=null&&J.hasOwnProperty("value")){var Q=X0.opentelemetry.proto.common.v1.AnyValue.verify(J.value);if(Q)return"value."+Q}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.KeyValue)return J;var Q=new X0.opentelemetry.proto.common.v1.KeyValue;if(J.key!=null)Q.key=String(J.key);if(J.value!=null){if(typeof J.value!=="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");Q.value=X0.opentelemetry.proto.common.v1.AnyValue.fromObject(J.value)}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.defaults)G.key="",G.value=null;if(J.key!=null&&J.hasOwnProperty("key"))G.key=J.key;if(J.value!=null&&J.hasOwnProperty("value"))G.value=X0.opentelemetry.proto.common.v1.AnyValue.toObject(J.value,Q);return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.KeyValue"},F}(),H.InstrumentationScope=function(){function F(X){if(this.attributes=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.name=null,F.prototype.version=null,F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.name!=null&&Object.hasOwnProperty.call(J,"name"))Q.uint32(10).string(J.name);if(J.version!=null&&Object.hasOwnProperty.call(J,"version"))Q.uint32(18).string(J.version);if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(26).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(32).uint32(J.droppedAttributesCount);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.InstrumentationScope;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.name=J.string();break}case 2:{K.version=J.string();break}case 3:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 4:{K.droppedAttributesCount=J.uint32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.name!=null&&J.hasOwnProperty("name")){if(!W0.isString(J.name))return"name: string expected"}if(J.version!=null&&J.hasOwnProperty("version")){if(!W0.isString(J.version))return"version: string expected"}if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.InstrumentationScope)return J;var Q=new X0.opentelemetry.proto.common.v1.InstrumentationScope;if(J.name!=null)Q.name=String(J.name);if(J.version!=null)Q.version=String(J.version);if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[];if(Q.defaults)G.name="",G.version="",G.droppedAttributesCount=0;if(J.name!=null&&J.hasOwnProperty("name"))G.name=J.name;if(J.version!=null&&J.hasOwnProperty("version"))G.version=J.version;if(J.attributes&&J.attributes.length){G.attributes=[];for(var q=0;q<J.attributes.length;++q)G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[q],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.InstrumentationScope"},F}(),H.EntityRef=function(){function F(X){if(this.idKeys=[],this.descriptionKeys=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.schemaUrl=null,F.prototype.type=null,F.prototype.idKeys=W0.emptyArray,F.prototype.descriptionKeys=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(10).string(J.schemaUrl);if(J.type!=null&&Object.hasOwnProperty.call(J,"type"))Q.uint32(18).string(J.type);if(J.idKeys!=null&&J.idKeys.length)for(var G=0;G<J.idKeys.length;++G)Q.uint32(26).string(J.idKeys[G]);if(J.descriptionKeys!=null&&J.descriptionKeys.length)for(var G=0;G<J.descriptionKeys.length;++G)Q.uint32(34).string(J.descriptionKeys[G]);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.common.v1.EntityRef;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.schemaUrl=J.string();break}case 2:{K.type=J.string();break}case 3:{if(!(K.idKeys&&K.idKeys.length))K.idKeys=[];K.idKeys.push(J.string());break}case 4:{if(!(K.descriptionKeys&&K.descriptionKeys.length))K.descriptionKeys=[];K.descriptionKeys.push(J.string());break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}if(J.type!=null&&J.hasOwnProperty("type")){if(!W0.isString(J.type))return"type: string expected"}if(J.idKeys!=null&&J.hasOwnProperty("idKeys")){if(!Array.isArray(J.idKeys))return"idKeys: array expected";for(var Q=0;Q<J.idKeys.length;++Q)if(!W0.isString(J.idKeys[Q]))return"idKeys: string[] expected"}if(J.descriptionKeys!=null&&J.hasOwnProperty("descriptionKeys")){if(!Array.isArray(J.descriptionKeys))return"descriptionKeys: array expected";for(var Q=0;Q<J.descriptionKeys.length;++Q)if(!W0.isString(J.descriptionKeys[Q]))return"descriptionKeys: string[] expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.common.v1.EntityRef)return J;var Q=new X0.opentelemetry.proto.common.v1.EntityRef;if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);if(J.type!=null)Q.type=String(J.type);if(J.idKeys){if(!Array.isArray(J.idKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected");Q.idKeys=[];for(var G=0;G<J.idKeys.length;++G)Q.idKeys[G]=String(J.idKeys[G])}if(J.descriptionKeys){if(!Array.isArray(J.descriptionKeys))throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected");Q.descriptionKeys=[];for(var G=0;G<J.descriptionKeys.length;++G)Q.descriptionKeys[G]=String(J.descriptionKeys[G])}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.idKeys=[],G.descriptionKeys=[];if(Q.defaults)G.schemaUrl="",G.type="";if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;if(J.type!=null&&J.hasOwnProperty("type"))G.type=J.type;if(J.idKeys&&J.idKeys.length){G.idKeys=[];for(var q=0;q<J.idKeys.length;++q)G.idKeys[q]=J.idKeys[q]}if(J.descriptionKeys&&J.descriptionKeys.length){G.descriptionKeys=[];for(var q=0;q<J.descriptionKeys.length;++q)G.descriptionKeys[q]=J.descriptionKeys[q]}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.common.v1.EntityRef"},F}(),H}(),W}(),Z.resource=function(){var W={};return W.v1=function(){var H={};return H.Resource=function(){function F(X){if(this.attributes=[],this.entityRefs=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.prototype.entityRefs=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(10).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(16).uint32(J.droppedAttributesCount);if(J.entityRefs!=null&&J.entityRefs.length)for(var G=0;G<J.entityRefs.length;++G)X0.opentelemetry.proto.common.v1.EntityRef.encode(J.entityRefs[G],Q.uint32(26).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.resource.v1.Resource;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 2:{K.droppedAttributesCount=J.uint32();break}case 3:{if(!(K.entityRefs&&K.entityRefs.length))K.entityRefs=[];K.entityRefs.push(X0.opentelemetry.proto.common.v1.EntityRef.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(J.entityRefs!=null&&J.hasOwnProperty("entityRefs")){if(!Array.isArray(J.entityRefs))return"entityRefs: array expected";for(var Q=0;Q<J.entityRefs.length;++Q){var G=X0.opentelemetry.proto.common.v1.EntityRef.verify(J.entityRefs[Q]);if(G)return"entityRefs."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.resource.v1.Resource)return J;var Q=new X0.opentelemetry.proto.resource.v1.Resource;if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;if(J.entityRefs){if(!Array.isArray(J.entityRefs))throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected");Q.entityRefs=[];for(var G=0;G<J.entityRefs.length;++G){if(typeof J.entityRefs[G]!=="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected");Q.entityRefs[G]=X0.opentelemetry.proto.common.v1.EntityRef.fromObject(J.entityRefs[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[],G.entityRefs=[];if(Q.defaults)G.droppedAttributesCount=0;if(J.attributes&&J.attributes.length){G.attributes=[];for(var q=0;q<J.attributes.length;++q)G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[q],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;if(J.entityRefs&&J.entityRefs.length){G.entityRefs=[];for(var q=0;q<J.entityRefs.length;++q)G.entityRefs[q]=X0.opentelemetry.proto.common.v1.EntityRef.toObject(J.entityRefs[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.resource.v1.Resource"},F}(),H}(),W}(),Z.trace=function(){var W={};return W.v1=function(){var H={};return H.TracesData=function(){function F(X){if(this.resourceSpans=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resourceSpans=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resourceSpans!=null&&J.resourceSpans.length)for(var G=0;G<J.resourceSpans.length;++G)X0.opentelemetry.proto.trace.v1.ResourceSpans.encode(J.resourceSpans[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.TracesData;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.resourceSpans&&K.resourceSpans.length))K.resourceSpans=[];K.resourceSpans.push(X0.opentelemetry.proto.trace.v1.ResourceSpans.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resourceSpans!=null&&J.hasOwnProperty("resourceSpans")){if(!Array.isArray(J.resourceSpans))return"resourceSpans: array expected";for(var Q=0;Q<J.resourceSpans.length;++Q){var G=X0.opentelemetry.proto.trace.v1.ResourceSpans.verify(J.resourceSpans[Q]);if(G)return"resourceSpans."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.TracesData)return J;var Q=new X0.opentelemetry.proto.trace.v1.TracesData;if(J.resourceSpans){if(!Array.isArray(J.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");Q.resourceSpans=[];for(var G=0;G<J.resourceSpans.length;++G){if(typeof J.resourceSpans[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");Q.resourceSpans[G]=X0.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(J.resourceSpans[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.resourceSpans=[];if(J.resourceSpans&&J.resourceSpans.length){G.resourceSpans=[];for(var q=0;q<J.resourceSpans.length;++q)G.resourceSpans[q]=X0.opentelemetry.proto.trace.v1.ResourceSpans.toObject(J.resourceSpans[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.TracesData"},F}(),H.ResourceSpans=function(){function F(X){if(this.scopeSpans=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resource=null,F.prototype.scopeSpans=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resource!=null&&Object.hasOwnProperty.call(J,"resource"))X0.opentelemetry.proto.resource.v1.Resource.encode(J.resource,Q.uint32(10).fork()).ldelim();if(J.scopeSpans!=null&&J.scopeSpans.length)for(var G=0;G<J.scopeSpans.length;++G)X0.opentelemetry.proto.trace.v1.ScopeSpans.encode(J.scopeSpans[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.ResourceSpans;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.resource=X0.opentelemetry.proto.resource.v1.Resource.decode(J,J.uint32());break}case 2:{if(!(K.scopeSpans&&K.scopeSpans.length))K.scopeSpans=[];K.scopeSpans.push(X0.opentelemetry.proto.trace.v1.ScopeSpans.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resource!=null&&J.hasOwnProperty("resource")){var Q=X0.opentelemetry.proto.resource.v1.Resource.verify(J.resource);if(Q)return"resource."+Q}if(J.scopeSpans!=null&&J.hasOwnProperty("scopeSpans")){if(!Array.isArray(J.scopeSpans))return"scopeSpans: array expected";for(var G=0;G<J.scopeSpans.length;++G){var Q=X0.opentelemetry.proto.trace.v1.ScopeSpans.verify(J.scopeSpans[G]);if(Q)return"scopeSpans."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.ResourceSpans)return J;var Q=new X0.opentelemetry.proto.trace.v1.ResourceSpans;if(J.resource!=null){if(typeof J.resource!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");Q.resource=X0.opentelemetry.proto.resource.v1.Resource.fromObject(J.resource)}if(J.scopeSpans){if(!Array.isArray(J.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");Q.scopeSpans=[];for(var G=0;G<J.scopeSpans.length;++G){if(typeof J.scopeSpans[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");Q.scopeSpans[G]=X0.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(J.scopeSpans[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.scopeSpans=[];if(Q.defaults)G.resource=null,G.schemaUrl="";if(J.resource!=null&&J.hasOwnProperty("resource"))G.resource=X0.opentelemetry.proto.resource.v1.Resource.toObject(J.resource,Q);if(J.scopeSpans&&J.scopeSpans.length){G.scopeSpans=[];for(var q=0;q<J.scopeSpans.length;++q)G.scopeSpans[q]=X0.opentelemetry.proto.trace.v1.ScopeSpans.toObject(J.scopeSpans[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.ResourceSpans"},F}(),H.ScopeSpans=function(){function F(X){if(this.spans=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.scope=null,F.prototype.spans=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.scope!=null&&Object.hasOwnProperty.call(J,"scope"))X0.opentelemetry.proto.common.v1.InstrumentationScope.encode(J.scope,Q.uint32(10).fork()).ldelim();if(J.spans!=null&&J.spans.length)for(var G=0;G<J.spans.length;++G)X0.opentelemetry.proto.trace.v1.Span.encode(J.spans[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.ScopeSpans;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.decode(J,J.uint32());break}case 2:{if(!(K.spans&&K.spans.length))K.spans=[];K.spans.push(X0.opentelemetry.proto.trace.v1.Span.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.scope!=null&&J.hasOwnProperty("scope")){var Q=X0.opentelemetry.proto.common.v1.InstrumentationScope.verify(J.scope);if(Q)return"scope."+Q}if(J.spans!=null&&J.hasOwnProperty("spans")){if(!Array.isArray(J.spans))return"spans: array expected";for(var G=0;G<J.spans.length;++G){var Q=X0.opentelemetry.proto.trace.v1.Span.verify(J.spans[G]);if(Q)return"spans."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.ScopeSpans)return J;var Q=new X0.opentelemetry.proto.trace.v1.ScopeSpans;if(J.scope!=null){if(typeof J.scope!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");Q.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(J.scope)}if(J.spans){if(!Array.isArray(J.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");Q.spans=[];for(var G=0;G<J.spans.length;++G){if(typeof J.spans[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");Q.spans[G]=X0.opentelemetry.proto.trace.v1.Span.fromObject(J.spans[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.spans=[];if(Q.defaults)G.scope=null,G.schemaUrl="";if(J.scope!=null&&J.hasOwnProperty("scope"))G.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.toObject(J.scope,Q);if(J.spans&&J.spans.length){G.spans=[];for(var q=0;q<J.spans.length;++q)G.spans[q]=X0.opentelemetry.proto.trace.v1.Span.toObject(J.spans[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.ScopeSpans"},F}(),H.Span=function(){function F(X){if(this.attributes=[],this.events=[],this.links=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.traceId=null,F.prototype.spanId=null,F.prototype.traceState=null,F.prototype.parentSpanId=null,F.prototype.flags=null,F.prototype.name=null,F.prototype.kind=null,F.prototype.startTimeUnixNano=null,F.prototype.endTimeUnixNano=null,F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.prototype.events=W0.emptyArray,F.prototype.droppedEventsCount=null,F.prototype.links=W0.emptyArray,F.prototype.droppedLinksCount=null,F.prototype.status=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.traceId!=null&&Object.hasOwnProperty.call(J,"traceId"))Q.uint32(10).bytes(J.traceId);if(J.spanId!=null&&Object.hasOwnProperty.call(J,"spanId"))Q.uint32(18).bytes(J.spanId);if(J.traceState!=null&&Object.hasOwnProperty.call(J,"traceState"))Q.uint32(26).string(J.traceState);if(J.parentSpanId!=null&&Object.hasOwnProperty.call(J,"parentSpanId"))Q.uint32(34).bytes(J.parentSpanId);if(J.name!=null&&Object.hasOwnProperty.call(J,"name"))Q.uint32(42).string(J.name);if(J.kind!=null&&Object.hasOwnProperty.call(J,"kind"))Q.uint32(48).int32(J.kind);if(J.startTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"startTimeUnixNano"))Q.uint32(57).fixed64(J.startTimeUnixNano);if(J.endTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"endTimeUnixNano"))Q.uint32(65).fixed64(J.endTimeUnixNano);if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(74).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(80).uint32(J.droppedAttributesCount);if(J.events!=null&&J.events.length)for(var G=0;G<J.events.length;++G)X0.opentelemetry.proto.trace.v1.Span.Event.encode(J.events[G],Q.uint32(90).fork()).ldelim();if(J.droppedEventsCount!=null&&Object.hasOwnProperty.call(J,"droppedEventsCount"))Q.uint32(96).uint32(J.droppedEventsCount);if(J.links!=null&&J.links.length)for(var G=0;G<J.links.length;++G)X0.opentelemetry.proto.trace.v1.Span.Link.encode(J.links[G],Q.uint32(106).fork()).ldelim();if(J.droppedLinksCount!=null&&Object.hasOwnProperty.call(J,"droppedLinksCount"))Q.uint32(112).uint32(J.droppedLinksCount);if(J.status!=null&&Object.hasOwnProperty.call(J,"status"))X0.opentelemetry.proto.trace.v1.Status.encode(J.status,Q.uint32(122).fork()).ldelim();if(J.flags!=null&&Object.hasOwnProperty.call(J,"flags"))Q.uint32(133).fixed32(J.flags);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.Span;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.traceId=J.bytes();break}case 2:{K.spanId=J.bytes();break}case 3:{K.traceState=J.string();break}case 4:{K.parentSpanId=J.bytes();break}case 16:{K.flags=J.fixed32();break}case 5:{K.name=J.string();break}case 6:{K.kind=J.int32();break}case 7:{K.startTimeUnixNano=J.fixed64();break}case 8:{K.endTimeUnixNano=J.fixed64();break}case 9:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 10:{K.droppedAttributesCount=J.uint32();break}case 11:{if(!(K.events&&K.events.length))K.events=[];K.events.push(X0.opentelemetry.proto.trace.v1.Span.Event.decode(J,J.uint32()));break}case 12:{K.droppedEventsCount=J.uint32();break}case 13:{if(!(K.links&&K.links.length))K.links=[];K.links.push(X0.opentelemetry.proto.trace.v1.Span.Link.decode(J,J.uint32()));break}case 14:{K.droppedLinksCount=J.uint32();break}case 15:{K.status=X0.opentelemetry.proto.trace.v1.Status.decode(J,J.uint32());break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.traceId!=null&&J.hasOwnProperty("traceId")){if(!(J.traceId&&typeof J.traceId.length==="number"||W0.isString(J.traceId)))return"traceId: buffer expected"}if(J.spanId!=null&&J.hasOwnProperty("spanId")){if(!(J.spanId&&typeof J.spanId.length==="number"||W0.isString(J.spanId)))return"spanId: buffer expected"}if(J.traceState!=null&&J.hasOwnProperty("traceState")){if(!W0.isString(J.traceState))return"traceState: string expected"}if(J.parentSpanId!=null&&J.hasOwnProperty("parentSpanId")){if(!(J.parentSpanId&&typeof J.parentSpanId.length==="number"||W0.isString(J.parentSpanId)))return"parentSpanId: buffer expected"}if(J.flags!=null&&J.hasOwnProperty("flags")){if(!W0.isInteger(J.flags))return"flags: integer expected"}if(J.name!=null&&J.hasOwnProperty("name")){if(!W0.isString(J.name))return"name: string expected"}if(J.kind!=null&&J.hasOwnProperty("kind"))switch(J.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(J.startTimeUnixNano)&&!(J.startTimeUnixNano&&W0.isInteger(J.startTimeUnixNano.low)&&W0.isInteger(J.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(J.endTimeUnixNano!=null&&J.hasOwnProperty("endTimeUnixNano")){if(!W0.isInteger(J.endTimeUnixNano)&&!(J.endTimeUnixNano&&W0.isInteger(J.endTimeUnixNano.low)&&W0.isInteger(J.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected"}if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(J.events!=null&&J.hasOwnProperty("events")){if(!Array.isArray(J.events))return"events: array expected";for(var Q=0;Q<J.events.length;++Q){var G=X0.opentelemetry.proto.trace.v1.Span.Event.verify(J.events[Q]);if(G)return"events."+G}}if(J.droppedEventsCount!=null&&J.hasOwnProperty("droppedEventsCount")){if(!W0.isInteger(J.droppedEventsCount))return"droppedEventsCount: integer expected"}if(J.links!=null&&J.hasOwnProperty("links")){if(!Array.isArray(J.links))return"links: array expected";for(var Q=0;Q<J.links.length;++Q){var G=X0.opentelemetry.proto.trace.v1.Span.Link.verify(J.links[Q]);if(G)return"links."+G}}if(J.droppedLinksCount!=null&&J.hasOwnProperty("droppedLinksCount")){if(!W0.isInteger(J.droppedLinksCount))return"droppedLinksCount: integer expected"}if(J.status!=null&&J.hasOwnProperty("status")){var G=X0.opentelemetry.proto.trace.v1.Status.verify(J.status);if(G)return"status."+G}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.Span)return J;var Q=new X0.opentelemetry.proto.trace.v1.Span;if(J.traceId!=null){if(typeof J.traceId==="string")W0.base64.decode(J.traceId,Q.traceId=W0.newBuffer(W0.base64.length(J.traceId)),0);else if(J.traceId.length>=0)Q.traceId=J.traceId}if(J.spanId!=null){if(typeof J.spanId==="string")W0.base64.decode(J.spanId,Q.spanId=W0.newBuffer(W0.base64.length(J.spanId)),0);else if(J.spanId.length>=0)Q.spanId=J.spanId}if(J.traceState!=null)Q.traceState=String(J.traceState);if(J.parentSpanId!=null){if(typeof J.parentSpanId==="string")W0.base64.decode(J.parentSpanId,Q.parentSpanId=W0.newBuffer(W0.base64.length(J.parentSpanId)),0);else if(J.parentSpanId.length>=0)Q.parentSpanId=J.parentSpanId}if(J.flags!=null)Q.flags=J.flags>>>0;if(J.name!=null)Q.name=String(J.name);switch(J.kind){default:if(typeof J.kind==="number"){Q.kind=J.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:Q.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:Q.kind=1;break;case"SPAN_KIND_SERVER":case 2:Q.kind=2;break;case"SPAN_KIND_CLIENT":case 3:Q.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:Q.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:Q.kind=5;break}if(J.startTimeUnixNano!=null){if(W0.Long)(Q.startTimeUnixNano=W0.Long.fromValue(J.startTimeUnixNano)).unsigned=!1;else if(typeof J.startTimeUnixNano==="string")Q.startTimeUnixNano=parseInt(J.startTimeUnixNano,10);else if(typeof J.startTimeUnixNano==="number")Q.startTimeUnixNano=J.startTimeUnixNano;else if(typeof J.startTimeUnixNano==="object")Q.startTimeUnixNano=new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber()}if(J.endTimeUnixNano!=null){if(W0.Long)(Q.endTimeUnixNano=W0.Long.fromValue(J.endTimeUnixNano)).unsigned=!1;else if(typeof J.endTimeUnixNano==="string")Q.endTimeUnixNano=parseInt(J.endTimeUnixNano,10);else if(typeof J.endTimeUnixNano==="number")Q.endTimeUnixNano=J.endTimeUnixNano;else if(typeof J.endTimeUnixNano==="object")Q.endTimeUnixNano=new W0.LongBits(J.endTimeUnixNano.low>>>0,J.endTimeUnixNano.high>>>0).toNumber()}if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;if(J.events){if(!Array.isArray(J.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");Q.events=[];for(var G=0;G<J.events.length;++G){if(typeof J.events[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");Q.events[G]=X0.opentelemetry.proto.trace.v1.Span.Event.fromObject(J.events[G])}}if(J.droppedEventsCount!=null)Q.droppedEventsCount=J.droppedEventsCount>>>0;if(J.links){if(!Array.isArray(J.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");Q.links=[];for(var G=0;G<J.links.length;++G){if(typeof J.links[G]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");Q.links[G]=X0.opentelemetry.proto.trace.v1.Span.Link.fromObject(J.links[G])}}if(J.droppedLinksCount!=null)Q.droppedLinksCount=J.droppedLinksCount>>>0;if(J.status!=null){if(typeof J.status!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");Q.status=X0.opentelemetry.proto.trace.v1.Status.fromObject(J.status)}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[],G.events=[],G.links=[];if(Q.defaults){if(Q.bytes===String)G.traceId="";else if(G.traceId=[],Q.bytes!==Array)G.traceId=W0.newBuffer(G.traceId);if(Q.bytes===String)G.spanId="";else if(G.spanId=[],Q.bytes!==Array)G.spanId=W0.newBuffer(G.spanId);if(G.traceState="",Q.bytes===String)G.parentSpanId="";else if(G.parentSpanId=[],Q.bytes!==Array)G.parentSpanId=W0.newBuffer(G.parentSpanId);if(G.name="",G.kind=Q.enums===String?"SPAN_KIND_UNSPECIFIED":0,W0.Long){var q=new W0.Long(0,0,!1);G.startTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.startTimeUnixNano=Q.longs===String?"0":0;if(W0.Long){var q=new W0.Long(0,0,!1);G.endTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.endTimeUnixNano=Q.longs===String?"0":0;G.droppedAttributesCount=0,G.droppedEventsCount=0,G.droppedLinksCount=0,G.status=null,G.flags=0}if(J.traceId!=null&&J.hasOwnProperty("traceId"))G.traceId=Q.bytes===String?W0.base64.encode(J.traceId,0,J.traceId.length):Q.bytes===Array?Array.prototype.slice.call(J.traceId):J.traceId;if(J.spanId!=null&&J.hasOwnProperty("spanId"))G.spanId=Q.bytes===String?W0.base64.encode(J.spanId,0,J.spanId.length):Q.bytes===Array?Array.prototype.slice.call(J.spanId):J.spanId;if(J.traceState!=null&&J.hasOwnProperty("traceState"))G.traceState=J.traceState;if(J.parentSpanId!=null&&J.hasOwnProperty("parentSpanId"))G.parentSpanId=Q.bytes===String?W0.base64.encode(J.parentSpanId,0,J.parentSpanId.length):Q.bytes===Array?Array.prototype.slice.call(J.parentSpanId):J.parentSpanId;if(J.name!=null&&J.hasOwnProperty("name"))G.name=J.name;if(J.kind!=null&&J.hasOwnProperty("kind"))G.kind=Q.enums===String?X0.opentelemetry.proto.trace.v1.Span.SpanKind[J.kind]===void 0?J.kind:X0.opentelemetry.proto.trace.v1.Span.SpanKind[J.kind]:J.kind;if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano"))if(typeof J.startTimeUnixNano==="number")G.startTimeUnixNano=Q.longs===String?String(J.startTimeUnixNano):J.startTimeUnixNano;else G.startTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.startTimeUnixNano):Q.longs===Number?new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber():J.startTimeUnixNano;if(J.endTimeUnixNano!=null&&J.hasOwnProperty("endTimeUnixNano"))if(typeof J.endTimeUnixNano==="number")G.endTimeUnixNano=Q.longs===String?String(J.endTimeUnixNano):J.endTimeUnixNano;else G.endTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.endTimeUnixNano):Q.longs===Number?new W0.LongBits(J.endTimeUnixNano.low>>>0,J.endTimeUnixNano.high>>>0).toNumber():J.endTimeUnixNano;if(J.attributes&&J.attributes.length){G.attributes=[];for(var K=0;K<J.attributes.length;++K)G.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[K],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;if(J.events&&J.events.length){G.events=[];for(var K=0;K<J.events.length;++K)G.events[K]=X0.opentelemetry.proto.trace.v1.Span.Event.toObject(J.events[K],Q)}if(J.droppedEventsCount!=null&&J.hasOwnProperty("droppedEventsCount"))G.droppedEventsCount=J.droppedEventsCount;if(J.links&&J.links.length){G.links=[];for(var K=0;K<J.links.length;++K)G.links[K]=X0.opentelemetry.proto.trace.v1.Span.Link.toObject(J.links[K],Q)}if(J.droppedLinksCount!=null&&J.hasOwnProperty("droppedLinksCount"))G.droppedLinksCount=J.droppedLinksCount;if(J.status!=null&&J.hasOwnProperty("status"))G.status=X0.opentelemetry.proto.trace.v1.Status.toObject(J.status,Q);if(J.flags!=null&&J.hasOwnProperty("flags"))G.flags=J.flags;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.Span"},F.SpanKind=function(){var X={},J=Object.create(X);return J[X[0]="SPAN_KIND_UNSPECIFIED"]=0,J[X[1]="SPAN_KIND_INTERNAL"]=1,J[X[2]="SPAN_KIND_SERVER"]=2,J[X[3]="SPAN_KIND_CLIENT"]=3,J[X[4]="SPAN_KIND_PRODUCER"]=4,J[X[5]="SPAN_KIND_CONSUMER"]=5,J}(),F.Event=function(){function X(J){if(this.attributes=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.timeUnixNano=null,X.prototype.name=null,X.prototype.attributes=W0.emptyArray,X.prototype.droppedAttributesCount=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(9).fixed64(Q.timeUnixNano);if(Q.name!=null&&Object.hasOwnProperty.call(Q,"name"))G.uint32(18).string(Q.name);if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(26).fork()).ldelim();if(Q.droppedAttributesCount!=null&&Object.hasOwnProperty.call(Q,"droppedAttributesCount"))G.uint32(32).uint32(Q.droppedAttributesCount);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.trace.v1.Span.Event;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.timeUnixNano=Q.fixed64();break}case 2:{V.name=Q.string();break}case 3:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 4:{V.droppedAttributesCount=Q.uint32();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.name!=null&&Q.hasOwnProperty("name")){if(!W0.isString(Q.name))return"name: string expected"}if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var G=0;G<Q.attributes.length;++G){var q=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[G]);if(q)return"attributes."+q}}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(Q.droppedAttributesCount))return"droppedAttributesCount: integer expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.trace.v1.Span.Event)return Q;var G=new X0.opentelemetry.proto.trace.v1.Span.Event;if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.name!=null)G.name=String(Q.name);if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.droppedAttributesCount!=null)G.droppedAttributesCount=Q.droppedAttributesCount>>>0;return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.attributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;q.name="",q.droppedAttributesCount=0}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.name!=null&&Q.hasOwnProperty("name"))q.name=Q.name;if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount"))q.droppedAttributesCount=Q.droppedAttributesCount;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.trace.v1.Span.Event"},X}(),F.Link=function(){function X(J){if(this.attributes=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.traceId=null,X.prototype.spanId=null,X.prototype.traceState=null,X.prototype.attributes=W0.emptyArray,X.prototype.droppedAttributesCount=null,X.prototype.flags=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.traceId!=null&&Object.hasOwnProperty.call(Q,"traceId"))G.uint32(10).bytes(Q.traceId);if(Q.spanId!=null&&Object.hasOwnProperty.call(Q,"spanId"))G.uint32(18).bytes(Q.spanId);if(Q.traceState!=null&&Object.hasOwnProperty.call(Q,"traceState"))G.uint32(26).string(Q.traceState);if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(34).fork()).ldelim();if(Q.droppedAttributesCount!=null&&Object.hasOwnProperty.call(Q,"droppedAttributesCount"))G.uint32(40).uint32(Q.droppedAttributesCount);if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(53).fixed32(Q.flags);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.trace.v1.Span.Link;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.traceId=Q.bytes();break}case 2:{V.spanId=Q.bytes();break}case 3:{V.traceState=Q.string();break}case 4:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 5:{V.droppedAttributesCount=Q.uint32();break}case 6:{V.flags=Q.fixed32();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.traceId!=null&&Q.hasOwnProperty("traceId")){if(!(Q.traceId&&typeof Q.traceId.length==="number"||W0.isString(Q.traceId)))return"traceId: buffer expected"}if(Q.spanId!=null&&Q.hasOwnProperty("spanId")){if(!(Q.spanId&&typeof Q.spanId.length==="number"||W0.isString(Q.spanId)))return"spanId: buffer expected"}if(Q.traceState!=null&&Q.hasOwnProperty("traceState")){if(!W0.isString(Q.traceState))return"traceState: string expected"}if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var G=0;G<Q.attributes.length;++G){var q=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[G]);if(q)return"attributes."+q}}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(Q.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.trace.v1.Span.Link)return Q;var G=new X0.opentelemetry.proto.trace.v1.Span.Link;if(Q.traceId!=null){if(typeof Q.traceId==="string")W0.base64.decode(Q.traceId,G.traceId=W0.newBuffer(W0.base64.length(Q.traceId)),0);else if(Q.traceId.length>=0)G.traceId=Q.traceId}if(Q.spanId!=null){if(typeof Q.spanId==="string")W0.base64.decode(Q.spanId,G.spanId=W0.newBuffer(W0.base64.length(Q.spanId)),0);else if(Q.spanId.length>=0)G.spanId=Q.spanId}if(Q.traceState!=null)G.traceState=String(Q.traceState);if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.droppedAttributesCount!=null)G.droppedAttributesCount=Q.droppedAttributesCount>>>0;if(Q.flags!=null)G.flags=Q.flags>>>0;return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.attributes=[];if(G.defaults){if(G.bytes===String)q.traceId="";else if(q.traceId=[],G.bytes!==Array)q.traceId=W0.newBuffer(q.traceId);if(G.bytes===String)q.spanId="";else if(q.spanId=[],G.bytes!==Array)q.spanId=W0.newBuffer(q.spanId);q.traceState="",q.droppedAttributesCount=0,q.flags=0}if(Q.traceId!=null&&Q.hasOwnProperty("traceId"))q.traceId=G.bytes===String?W0.base64.encode(Q.traceId,0,Q.traceId.length):G.bytes===Array?Array.prototype.slice.call(Q.traceId):Q.traceId;if(Q.spanId!=null&&Q.hasOwnProperty("spanId"))q.spanId=G.bytes===String?W0.base64.encode(Q.spanId,0,Q.spanId.length):G.bytes===Array?Array.prototype.slice.call(Q.spanId):Q.spanId;if(Q.traceState!=null&&Q.hasOwnProperty("traceState"))q.traceState=Q.traceState;if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var K=0;K<Q.attributes.length;++K)q.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[K],G)}if(Q.droppedAttributesCount!=null&&Q.hasOwnProperty("droppedAttributesCount"))q.droppedAttributesCount=Q.droppedAttributesCount;if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.trace.v1.Span.Link"},X}(),F}(),H.Status=function(){function F(X){if(X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.message=null,F.prototype.code=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.message!=null&&Object.hasOwnProperty.call(J,"message"))Q.uint32(18).string(J.message);if(J.code!=null&&Object.hasOwnProperty.call(J,"code"))Q.uint32(24).int32(J.code);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.trace.v1.Status;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 2:{K.message=J.string();break}case 3:{K.code=J.int32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.message!=null&&J.hasOwnProperty("message")){if(!W0.isString(J.message))return"message: string expected"}if(J.code!=null&&J.hasOwnProperty("code"))switch(J.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.trace.v1.Status)return J;var Q=new X0.opentelemetry.proto.trace.v1.Status;if(J.message!=null)Q.message=String(J.message);switch(J.code){default:if(typeof J.code==="number"){Q.code=J.code;break}break;case"STATUS_CODE_UNSET":case 0:Q.code=0;break;case"STATUS_CODE_OK":case 1:Q.code=1;break;case"STATUS_CODE_ERROR":case 2:Q.code=2;break}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.defaults)G.message="",G.code=Q.enums===String?"STATUS_CODE_UNSET":0;if(J.message!=null&&J.hasOwnProperty("message"))G.message=J.message;if(J.code!=null&&J.hasOwnProperty("code"))G.code=Q.enums===String?X0.opentelemetry.proto.trace.v1.Status.StatusCode[J.code]===void 0?J.code:X0.opentelemetry.proto.trace.v1.Status.StatusCode[J.code]:J.code;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.trace.v1.Status"},F.StatusCode=function(){var X={},J=Object.create(X);return J[X[0]="STATUS_CODE_UNSET"]=0,J[X[1]="STATUS_CODE_OK"]=1,J[X[2]="STATUS_CODE_ERROR"]=2,J}(),F}(),H.SpanFlags=function(){var F={},X=Object.create(F);return X[F[0]="SPAN_FLAGS_DO_NOT_USE"]=0,X[F[255]="SPAN_FLAGS_TRACE_FLAGS_MASK"]=255,X[F[256]="SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"]=256,X[F[512]="SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"]=512,X}(),H}(),W}(),Z.collector=function(){var W={};return W.trace=function(){var H={};return H.v1=function(){var F={};return F.TraceService=function(){function X(J,Q,G){k1.rpc.Service.call(this,J,Q,G)}return(X.prototype=Object.create(k1.rpc.Service.prototype)).constructor=X,X.create=function(Q,G,q){return new this(Q,G,q)},Object.defineProperty(X.prototype.export=function J(Q,G){return this.rpcCall(J,X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Q,G)},"name",{value:"Export"}),X}(),F.ExportTraceServiceRequest=function(){function X(J){if(this.resourceSpans=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.resourceSpans=W0.emptyArray,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.resourceSpans!=null&&Q.resourceSpans.length)for(var q=0;q<Q.resourceSpans.length;++q)X0.opentelemetry.proto.trace.v1.ResourceSpans.encode(Q.resourceSpans[q],G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.resourceSpans&&V.resourceSpans.length))V.resourceSpans=[];V.resourceSpans.push(X0.opentelemetry.proto.trace.v1.ResourceSpans.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.resourceSpans!=null&&Q.hasOwnProperty("resourceSpans")){if(!Array.isArray(Q.resourceSpans))return"resourceSpans: array expected";for(var G=0;G<Q.resourceSpans.length;++G){var q=X0.opentelemetry.proto.trace.v1.ResourceSpans.verify(Q.resourceSpans[G]);if(q)return"resourceSpans."+q}}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return Q;var G=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(Q.resourceSpans){if(!Array.isArray(Q.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");G.resourceSpans=[];for(var q=0;q<Q.resourceSpans.length;++q){if(typeof Q.resourceSpans[q]!=="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");G.resourceSpans[q]=X0.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(Q.resourceSpans[q])}}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.resourceSpans=[];if(Q.resourceSpans&&Q.resourceSpans.length){q.resourceSpans=[];for(var K=0;K<Q.resourceSpans.length;++K)q.resourceSpans[K]=X0.opentelemetry.proto.trace.v1.ResourceSpans.toObject(Q.resourceSpans[K],G)}return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},X}(),F.ExportTraceServiceResponse=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.partialSuccess=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.partialSuccess!=null&&Object.hasOwnProperty.call(Q,"partialSuccess"))X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(Q.partialSuccess,G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.partialSuccess=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(Q,Q.uint32());break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess")){var G=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(Q.partialSuccess);if(G)return"partialSuccess."+G}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return Q;var G=new X0.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(Q.partialSuccess!=null){if(typeof Q.partialSuccess!=="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");G.partialSuccess=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(Q.partialSuccess)}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.partialSuccess=null;if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess"))q.partialSuccess=X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(Q.partialSuccess,G);return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},X}(),F.ExportTracePartialSuccess=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.rejectedSpans=null,X.prototype.errorMessage=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.rejectedSpans!=null&&Object.hasOwnProperty.call(Q,"rejectedSpans"))G.uint32(8).int64(Q.rejectedSpans);if(Q.errorMessage!=null&&Object.hasOwnProperty.call(Q,"errorMessage"))G.uint32(18).string(Q.errorMessage);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.rejectedSpans=Q.int64();break}case 2:{V.errorMessage=Q.string();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.rejectedSpans!=null&&Q.hasOwnProperty("rejectedSpans")){if(!W0.isInteger(Q.rejectedSpans)&&!(Q.rejectedSpans&&W0.isInteger(Q.rejectedSpans.low)&&W0.isInteger(Q.rejectedSpans.high)))return"rejectedSpans: integer|Long expected"}if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage")){if(!W0.isString(Q.errorMessage))return"errorMessage: string expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return Q;var G=new X0.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;if(Q.rejectedSpans!=null){if(W0.Long)(G.rejectedSpans=W0.Long.fromValue(Q.rejectedSpans)).unsigned=!1;else if(typeof Q.rejectedSpans==="string")G.rejectedSpans=parseInt(Q.rejectedSpans,10);else if(typeof Q.rejectedSpans==="number")G.rejectedSpans=Q.rejectedSpans;else if(typeof Q.rejectedSpans==="object")G.rejectedSpans=new W0.LongBits(Q.rejectedSpans.low>>>0,Q.rejectedSpans.high>>>0).toNumber()}if(Q.errorMessage!=null)G.errorMessage=String(Q.errorMessage);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.rejectedSpans=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.rejectedSpans=G.longs===String?"0":0;q.errorMessage=""}if(Q.rejectedSpans!=null&&Q.hasOwnProperty("rejectedSpans"))if(typeof Q.rejectedSpans==="number")q.rejectedSpans=G.longs===String?String(Q.rejectedSpans):Q.rejectedSpans;else q.rejectedSpans=G.longs===String?W0.Long.prototype.toString.call(Q.rejectedSpans):G.longs===Number?new W0.LongBits(Q.rejectedSpans.low>>>0,Q.rejectedSpans.high>>>0).toNumber():Q.rejectedSpans;if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage"))q.errorMessage=Q.errorMessage;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},X}(),F}(),H}(),W.metrics=function(){var H={};return H.v1=function(){var F={};return F.MetricsService=function(){function X(J,Q,G){k1.rpc.Service.call(this,J,Q,G)}return(X.prototype=Object.create(k1.rpc.Service.prototype)).constructor=X,X.create=function(Q,G,q){return new this(Q,G,q)},Object.defineProperty(X.prototype.export=function J(Q,G){return this.rpcCall(J,X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,Q,G)},"name",{value:"Export"}),X}(),F.ExportMetricsServiceRequest=function(){function X(J){if(this.resourceMetrics=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.resourceMetrics=W0.emptyArray,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.resourceMetrics!=null&&Q.resourceMetrics.length)for(var q=0;q<Q.resourceMetrics.length;++q)X0.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(Q.resourceMetrics[q],G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.resourceMetrics&&V.resourceMetrics.length))V.resourceMetrics=[];V.resourceMetrics.push(X0.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.resourceMetrics!=null&&Q.hasOwnProperty("resourceMetrics")){if(!Array.isArray(Q.resourceMetrics))return"resourceMetrics: array expected";for(var G=0;G<Q.resourceMetrics.length;++G){var q=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(Q.resourceMetrics[G]);if(q)return"resourceMetrics."+q}}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return Q;var G=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(Q.resourceMetrics){if(!Array.isArray(Q.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");G.resourceMetrics=[];for(var q=0;q<Q.resourceMetrics.length;++q){if(typeof Q.resourceMetrics[q]!=="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");G.resourceMetrics[q]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(Q.resourceMetrics[q])}}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.resourceMetrics=[];if(Q.resourceMetrics&&Q.resourceMetrics.length){q.resourceMetrics=[];for(var K=0;K<Q.resourceMetrics.length;++K)q.resourceMetrics[K]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(Q.resourceMetrics[K],G)}return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},X}(),F.ExportMetricsServiceResponse=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.partialSuccess=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.partialSuccess!=null&&Object.hasOwnProperty.call(Q,"partialSuccess"))X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(Q.partialSuccess,G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.partialSuccess=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(Q,Q.uint32());break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess")){var G=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(Q.partialSuccess);if(G)return"partialSuccess."+G}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return Q;var G=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(Q.partialSuccess!=null){if(typeof Q.partialSuccess!=="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");G.partialSuccess=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(Q.partialSuccess)}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.partialSuccess=null;if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess"))q.partialSuccess=X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(Q.partialSuccess,G);return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},X}(),F.ExportMetricsPartialSuccess=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.rejectedDataPoints=null,X.prototype.errorMessage=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.rejectedDataPoints!=null&&Object.hasOwnProperty.call(Q,"rejectedDataPoints"))G.uint32(8).int64(Q.rejectedDataPoints);if(Q.errorMessage!=null&&Object.hasOwnProperty.call(Q,"errorMessage"))G.uint32(18).string(Q.errorMessage);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.rejectedDataPoints=Q.int64();break}case 2:{V.errorMessage=Q.string();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.rejectedDataPoints!=null&&Q.hasOwnProperty("rejectedDataPoints")){if(!W0.isInteger(Q.rejectedDataPoints)&&!(Q.rejectedDataPoints&&W0.isInteger(Q.rejectedDataPoints.low)&&W0.isInteger(Q.rejectedDataPoints.high)))return"rejectedDataPoints: integer|Long expected"}if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage")){if(!W0.isString(Q.errorMessage))return"errorMessage: string expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return Q;var G=new X0.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;if(Q.rejectedDataPoints!=null){if(W0.Long)(G.rejectedDataPoints=W0.Long.fromValue(Q.rejectedDataPoints)).unsigned=!1;else if(typeof Q.rejectedDataPoints==="string")G.rejectedDataPoints=parseInt(Q.rejectedDataPoints,10);else if(typeof Q.rejectedDataPoints==="number")G.rejectedDataPoints=Q.rejectedDataPoints;else if(typeof Q.rejectedDataPoints==="object")G.rejectedDataPoints=new W0.LongBits(Q.rejectedDataPoints.low>>>0,Q.rejectedDataPoints.high>>>0).toNumber()}if(Q.errorMessage!=null)G.errorMessage=String(Q.errorMessage);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.rejectedDataPoints=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.rejectedDataPoints=G.longs===String?"0":0;q.errorMessage=""}if(Q.rejectedDataPoints!=null&&Q.hasOwnProperty("rejectedDataPoints"))if(typeof Q.rejectedDataPoints==="number")q.rejectedDataPoints=G.longs===String?String(Q.rejectedDataPoints):Q.rejectedDataPoints;else q.rejectedDataPoints=G.longs===String?W0.Long.prototype.toString.call(Q.rejectedDataPoints):G.longs===Number?new W0.LongBits(Q.rejectedDataPoints.low>>>0,Q.rejectedDataPoints.high>>>0).toNumber():Q.rejectedDataPoints;if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage"))q.errorMessage=Q.errorMessage;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},X}(),F}(),H}(),W.logs=function(){var H={};return H.v1=function(){var F={};return F.LogsService=function(){function X(J,Q,G){k1.rpc.Service.call(this,J,Q,G)}return(X.prototype=Object.create(k1.rpc.Service.prototype)).constructor=X,X.create=function(Q,G,q){return new this(Q,G,q)},Object.defineProperty(X.prototype.export=function J(Q,G){return this.rpcCall(J,X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,Q,G)},"name",{value:"Export"}),X}(),F.ExportLogsServiceRequest=function(){function X(J){if(this.resourceLogs=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.resourceLogs=W0.emptyArray,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.resourceLogs!=null&&Q.resourceLogs.length)for(var q=0;q<Q.resourceLogs.length;++q)X0.opentelemetry.proto.logs.v1.ResourceLogs.encode(Q.resourceLogs[q],G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.resourceLogs&&V.resourceLogs.length))V.resourceLogs=[];V.resourceLogs.push(X0.opentelemetry.proto.logs.v1.ResourceLogs.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.resourceLogs!=null&&Q.hasOwnProperty("resourceLogs")){if(!Array.isArray(Q.resourceLogs))return"resourceLogs: array expected";for(var G=0;G<Q.resourceLogs.length;++G){var q=X0.opentelemetry.proto.logs.v1.ResourceLogs.verify(Q.resourceLogs[G]);if(q)return"resourceLogs."+q}}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return Q;var G=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(Q.resourceLogs){if(!Array.isArray(Q.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");G.resourceLogs=[];for(var q=0;q<Q.resourceLogs.length;++q){if(typeof Q.resourceLogs[q]!=="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");G.resourceLogs[q]=X0.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(Q.resourceLogs[q])}}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.resourceLogs=[];if(Q.resourceLogs&&Q.resourceLogs.length){q.resourceLogs=[];for(var K=0;K<Q.resourceLogs.length;++K)q.resourceLogs[K]=X0.opentelemetry.proto.logs.v1.ResourceLogs.toObject(Q.resourceLogs[K],G)}return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},X}(),F.ExportLogsServiceResponse=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.partialSuccess=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.partialSuccess!=null&&Object.hasOwnProperty.call(Q,"partialSuccess"))X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(Q.partialSuccess,G.uint32(10).fork()).ldelim();return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.partialSuccess=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(Q,Q.uint32());break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess")){var G=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(Q.partialSuccess);if(G)return"partialSuccess."+G}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return Q;var G=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(Q.partialSuccess!=null){if(typeof Q.partialSuccess!=="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");G.partialSuccess=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(Q.partialSuccess)}return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.partialSuccess=null;if(Q.partialSuccess!=null&&Q.hasOwnProperty("partialSuccess"))q.partialSuccess=X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(Q.partialSuccess,G);return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},X}(),F.ExportLogsPartialSuccess=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.rejectedLogRecords=null,X.prototype.errorMessage=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.rejectedLogRecords!=null&&Object.hasOwnProperty.call(Q,"rejectedLogRecords"))G.uint32(8).int64(Q.rejectedLogRecords);if(Q.errorMessage!=null&&Object.hasOwnProperty.call(Q,"errorMessage"))G.uint32(18).string(Q.errorMessage);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.rejectedLogRecords=Q.int64();break}case 2:{V.errorMessage=Q.string();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.rejectedLogRecords!=null&&Q.hasOwnProperty("rejectedLogRecords")){if(!W0.isInteger(Q.rejectedLogRecords)&&!(Q.rejectedLogRecords&&W0.isInteger(Q.rejectedLogRecords.low)&&W0.isInteger(Q.rejectedLogRecords.high)))return"rejectedLogRecords: integer|Long expected"}if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage")){if(!W0.isString(Q.errorMessage))return"errorMessage: string expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return Q;var G=new X0.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;if(Q.rejectedLogRecords!=null){if(W0.Long)(G.rejectedLogRecords=W0.Long.fromValue(Q.rejectedLogRecords)).unsigned=!1;else if(typeof Q.rejectedLogRecords==="string")G.rejectedLogRecords=parseInt(Q.rejectedLogRecords,10);else if(typeof Q.rejectedLogRecords==="number")G.rejectedLogRecords=Q.rejectedLogRecords;else if(typeof Q.rejectedLogRecords==="object")G.rejectedLogRecords=new W0.LongBits(Q.rejectedLogRecords.low>>>0,Q.rejectedLogRecords.high>>>0).toNumber()}if(Q.errorMessage!=null)G.errorMessage=String(Q.errorMessage);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.rejectedLogRecords=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.rejectedLogRecords=G.longs===String?"0":0;q.errorMessage=""}if(Q.rejectedLogRecords!=null&&Q.hasOwnProperty("rejectedLogRecords"))if(typeof Q.rejectedLogRecords==="number")q.rejectedLogRecords=G.longs===String?String(Q.rejectedLogRecords):Q.rejectedLogRecords;else q.rejectedLogRecords=G.longs===String?W0.Long.prototype.toString.call(Q.rejectedLogRecords):G.longs===Number?new W0.LongBits(Q.rejectedLogRecords.low>>>0,Q.rejectedLogRecords.high>>>0).toNumber():Q.rejectedLogRecords;if(Q.errorMessage!=null&&Q.hasOwnProperty("errorMessage"))q.errorMessage=Q.errorMessage;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},X}(),F}(),H}(),W}(),Z.metrics=function(){var W={};return W.v1=function(){var H={};return H.MetricsData=function(){function F(X){if(this.resourceMetrics=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resourceMetrics=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resourceMetrics!=null&&J.resourceMetrics.length)for(var G=0;G<J.resourceMetrics.length;++G)X0.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(J.resourceMetrics[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.MetricsData;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.resourceMetrics&&K.resourceMetrics.length))K.resourceMetrics=[];K.resourceMetrics.push(X0.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resourceMetrics!=null&&J.hasOwnProperty("resourceMetrics")){if(!Array.isArray(J.resourceMetrics))return"resourceMetrics: array expected";for(var Q=0;Q<J.resourceMetrics.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(J.resourceMetrics[Q]);if(G)return"resourceMetrics."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.MetricsData)return J;var Q=new X0.opentelemetry.proto.metrics.v1.MetricsData;if(J.resourceMetrics){if(!Array.isArray(J.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");Q.resourceMetrics=[];for(var G=0;G<J.resourceMetrics.length;++G){if(typeof J.resourceMetrics[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");Q.resourceMetrics[G]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(J.resourceMetrics[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.resourceMetrics=[];if(J.resourceMetrics&&J.resourceMetrics.length){G.resourceMetrics=[];for(var q=0;q<J.resourceMetrics.length;++q)G.resourceMetrics[q]=X0.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(J.resourceMetrics[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.MetricsData"},F}(),H.ResourceMetrics=function(){function F(X){if(this.scopeMetrics=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resource=null,F.prototype.scopeMetrics=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resource!=null&&Object.hasOwnProperty.call(J,"resource"))X0.opentelemetry.proto.resource.v1.Resource.encode(J.resource,Q.uint32(10).fork()).ldelim();if(J.scopeMetrics!=null&&J.scopeMetrics.length)for(var G=0;G<J.scopeMetrics.length;++G)X0.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(J.scopeMetrics[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.ResourceMetrics;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.resource=X0.opentelemetry.proto.resource.v1.Resource.decode(J,J.uint32());break}case 2:{if(!(K.scopeMetrics&&K.scopeMetrics.length))K.scopeMetrics=[];K.scopeMetrics.push(X0.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resource!=null&&J.hasOwnProperty("resource")){var Q=X0.opentelemetry.proto.resource.v1.Resource.verify(J.resource);if(Q)return"resource."+Q}if(J.scopeMetrics!=null&&J.hasOwnProperty("scopeMetrics")){if(!Array.isArray(J.scopeMetrics))return"scopeMetrics: array expected";for(var G=0;G<J.scopeMetrics.length;++G){var Q=X0.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(J.scopeMetrics[G]);if(Q)return"scopeMetrics."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.ResourceMetrics)return J;var Q=new X0.opentelemetry.proto.metrics.v1.ResourceMetrics;if(J.resource!=null){if(typeof J.resource!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");Q.resource=X0.opentelemetry.proto.resource.v1.Resource.fromObject(J.resource)}if(J.scopeMetrics){if(!Array.isArray(J.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");Q.scopeMetrics=[];for(var G=0;G<J.scopeMetrics.length;++G){if(typeof J.scopeMetrics[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");Q.scopeMetrics[G]=X0.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(J.scopeMetrics[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.scopeMetrics=[];if(Q.defaults)G.resource=null,G.schemaUrl="";if(J.resource!=null&&J.hasOwnProperty("resource"))G.resource=X0.opentelemetry.proto.resource.v1.Resource.toObject(J.resource,Q);if(J.scopeMetrics&&J.scopeMetrics.length){G.scopeMetrics=[];for(var q=0;q<J.scopeMetrics.length;++q)G.scopeMetrics[q]=X0.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(J.scopeMetrics[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},F}(),H.ScopeMetrics=function(){function F(X){if(this.metrics=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.scope=null,F.prototype.metrics=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.scope!=null&&Object.hasOwnProperty.call(J,"scope"))X0.opentelemetry.proto.common.v1.InstrumentationScope.encode(J.scope,Q.uint32(10).fork()).ldelim();if(J.metrics!=null&&J.metrics.length)for(var G=0;G<J.metrics.length;++G)X0.opentelemetry.proto.metrics.v1.Metric.encode(J.metrics[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.ScopeMetrics;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.decode(J,J.uint32());break}case 2:{if(!(K.metrics&&K.metrics.length))K.metrics=[];K.metrics.push(X0.opentelemetry.proto.metrics.v1.Metric.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.scope!=null&&J.hasOwnProperty("scope")){var Q=X0.opentelemetry.proto.common.v1.InstrumentationScope.verify(J.scope);if(Q)return"scope."+Q}if(J.metrics!=null&&J.hasOwnProperty("metrics")){if(!Array.isArray(J.metrics))return"metrics: array expected";for(var G=0;G<J.metrics.length;++G){var Q=X0.opentelemetry.proto.metrics.v1.Metric.verify(J.metrics[G]);if(Q)return"metrics."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.ScopeMetrics)return J;var Q=new X0.opentelemetry.proto.metrics.v1.ScopeMetrics;if(J.scope!=null){if(typeof J.scope!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");Q.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(J.scope)}if(J.metrics){if(!Array.isArray(J.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");Q.metrics=[];for(var G=0;G<J.metrics.length;++G){if(typeof J.metrics[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");Q.metrics[G]=X0.opentelemetry.proto.metrics.v1.Metric.fromObject(J.metrics[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.metrics=[];if(Q.defaults)G.scope=null,G.schemaUrl="";if(J.scope!=null&&J.hasOwnProperty("scope"))G.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.toObject(J.scope,Q);if(J.metrics&&J.metrics.length){G.metrics=[];for(var q=0;q<J.metrics.length;++q)G.metrics[q]=X0.opentelemetry.proto.metrics.v1.Metric.toObject(J.metrics[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},F}(),H.Metric=function(){function F(J){if(this.metadata=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.name=null,F.prototype.description=null,F.prototype.unit=null,F.prototype.gauge=null,F.prototype.sum=null,F.prototype.histogram=null,F.prototype.exponentialHistogram=null,F.prototype.summary=null,F.prototype.metadata=W0.emptyArray;var X;return Object.defineProperty(F.prototype,"data",{get:W0.oneOfGetter(X=["gauge","sum","histogram","exponentialHistogram","summary"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.name!=null&&Object.hasOwnProperty.call(Q,"name"))G.uint32(10).string(Q.name);if(Q.description!=null&&Object.hasOwnProperty.call(Q,"description"))G.uint32(18).string(Q.description);if(Q.unit!=null&&Object.hasOwnProperty.call(Q,"unit"))G.uint32(26).string(Q.unit);if(Q.gauge!=null&&Object.hasOwnProperty.call(Q,"gauge"))X0.opentelemetry.proto.metrics.v1.Gauge.encode(Q.gauge,G.uint32(42).fork()).ldelim();if(Q.sum!=null&&Object.hasOwnProperty.call(Q,"sum"))X0.opentelemetry.proto.metrics.v1.Sum.encode(Q.sum,G.uint32(58).fork()).ldelim();if(Q.histogram!=null&&Object.hasOwnProperty.call(Q,"histogram"))X0.opentelemetry.proto.metrics.v1.Histogram.encode(Q.histogram,G.uint32(74).fork()).ldelim();if(Q.exponentialHistogram!=null&&Object.hasOwnProperty.call(Q,"exponentialHistogram"))X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(Q.exponentialHistogram,G.uint32(82).fork()).ldelim();if(Q.summary!=null&&Object.hasOwnProperty.call(Q,"summary"))X0.opentelemetry.proto.metrics.v1.Summary.encode(Q.summary,G.uint32(90).fork()).ldelim();if(Q.metadata!=null&&Q.metadata.length)for(var q=0;q<Q.metadata.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.metadata[q],G.uint32(98).fork()).ldelim();return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.Metric;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.name=Q.string();break}case 2:{V.description=Q.string();break}case 3:{V.unit=Q.string();break}case 5:{V.gauge=X0.opentelemetry.proto.metrics.v1.Gauge.decode(Q,Q.uint32());break}case 7:{V.sum=X0.opentelemetry.proto.metrics.v1.Sum.decode(Q,Q.uint32());break}case 9:{V.histogram=X0.opentelemetry.proto.metrics.v1.Histogram.decode(Q,Q.uint32());break}case 10:{V.exponentialHistogram=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(Q,Q.uint32());break}case 11:{V.summary=X0.opentelemetry.proto.metrics.v1.Summary.decode(Q,Q.uint32());break}case 12:{if(!(V.metadata&&V.metadata.length))V.metadata=[];V.metadata.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.name!=null&&Q.hasOwnProperty("name")){if(!W0.isString(Q.name))return"name: string expected"}if(Q.description!=null&&Q.hasOwnProperty("description")){if(!W0.isString(Q.description))return"description: string expected"}if(Q.unit!=null&&Q.hasOwnProperty("unit")){if(!W0.isString(Q.unit))return"unit: string expected"}if(Q.gauge!=null&&Q.hasOwnProperty("gauge")){G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Gauge.verify(Q.gauge);if(q)return"gauge."+q}}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Sum.verify(Q.sum);if(q)return"sum."+q}}if(Q.histogram!=null&&Q.hasOwnProperty("histogram")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Histogram.verify(Q.histogram);if(q)return"histogram."+q}}if(Q.exponentialHistogram!=null&&Q.hasOwnProperty("exponentialHistogram")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(Q.exponentialHistogram);if(q)return"exponentialHistogram."+q}}if(Q.summary!=null&&Q.hasOwnProperty("summary")){if(G.data===1)return"data: multiple values";G.data=1;{var q=X0.opentelemetry.proto.metrics.v1.Summary.verify(Q.summary);if(q)return"summary."+q}}if(Q.metadata!=null&&Q.hasOwnProperty("metadata")){if(!Array.isArray(Q.metadata))return"metadata: array expected";for(var K=0;K<Q.metadata.length;++K){var q=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.metadata[K]);if(q)return"metadata."+q}}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.Metric)return Q;var G=new X0.opentelemetry.proto.metrics.v1.Metric;if(Q.name!=null)G.name=String(Q.name);if(Q.description!=null)G.description=String(Q.description);if(Q.unit!=null)G.unit=String(Q.unit);if(Q.gauge!=null){if(typeof Q.gauge!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");G.gauge=X0.opentelemetry.proto.metrics.v1.Gauge.fromObject(Q.gauge)}if(Q.sum!=null){if(typeof Q.sum!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");G.sum=X0.opentelemetry.proto.metrics.v1.Sum.fromObject(Q.sum)}if(Q.histogram!=null){if(typeof Q.histogram!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");G.histogram=X0.opentelemetry.proto.metrics.v1.Histogram.fromObject(Q.histogram)}if(Q.exponentialHistogram!=null){if(typeof Q.exponentialHistogram!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");G.exponentialHistogram=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(Q.exponentialHistogram)}if(Q.summary!=null){if(typeof Q.summary!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");G.summary=X0.opentelemetry.proto.metrics.v1.Summary.fromObject(Q.summary)}if(Q.metadata){if(!Array.isArray(Q.metadata))throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected");G.metadata=[];for(var q=0;q<Q.metadata.length;++q){if(typeof Q.metadata[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected");G.metadata[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.metadata[q])}}return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.metadata=[];if(G.defaults)q.name="",q.description="",q.unit="";if(Q.name!=null&&Q.hasOwnProperty("name"))q.name=Q.name;if(Q.description!=null&&Q.hasOwnProperty("description"))q.description=Q.description;if(Q.unit!=null&&Q.hasOwnProperty("unit"))q.unit=Q.unit;if(Q.gauge!=null&&Q.hasOwnProperty("gauge")){if(q.gauge=X0.opentelemetry.proto.metrics.v1.Gauge.toObject(Q.gauge,G),G.oneofs)q.data="gauge"}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(q.sum=X0.opentelemetry.proto.metrics.v1.Sum.toObject(Q.sum,G),G.oneofs)q.data="sum"}if(Q.histogram!=null&&Q.hasOwnProperty("histogram")){if(q.histogram=X0.opentelemetry.proto.metrics.v1.Histogram.toObject(Q.histogram,G),G.oneofs)q.data="histogram"}if(Q.exponentialHistogram!=null&&Q.hasOwnProperty("exponentialHistogram")){if(q.exponentialHistogram=X0.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(Q.exponentialHistogram,G),G.oneofs)q.data="exponentialHistogram"}if(Q.summary!=null&&Q.hasOwnProperty("summary")){if(q.summary=X0.opentelemetry.proto.metrics.v1.Summary.toObject(Q.summary,G),G.oneofs)q.data="summary"}if(Q.metadata&&Q.metadata.length){q.metadata=[];for(var K=0;K<Q.metadata.length;++K)q.metadata[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.metadata[K],G)}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.Metric"},F}(),H.Gauge=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Gauge;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Gauge)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Gauge;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(J.dataPoints[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(J.dataPoints[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Gauge"},F}(),H.Sum=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.prototype.aggregationTemporality=null,F.prototype.isMonotonic=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();if(J.aggregationTemporality!=null&&Object.hasOwnProperty.call(J,"aggregationTemporality"))Q.uint32(16).int32(J.aggregationTemporality);if(J.isMonotonic!=null&&Object.hasOwnProperty.call(J,"isMonotonic"))Q.uint32(24).bool(J.isMonotonic);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Sum;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(J,J.uint32()));break}case 2:{K.aggregationTemporality=J.int32();break}case 3:{K.isMonotonic=J.bool();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))switch(J.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}if(J.isMonotonic!=null&&J.hasOwnProperty("isMonotonic")){if(typeof J.isMonotonic!=="boolean")return"isMonotonic: boolean expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Sum)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Sum;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(J.dataPoints[G])}}switch(J.aggregationTemporality){default:if(typeof J.aggregationTemporality==="number"){Q.aggregationTemporality=J.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:Q.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:Q.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:Q.aggregationTemporality=2;break}if(J.isMonotonic!=null)Q.isMonotonic=Boolean(J.isMonotonic);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(Q.defaults)G.aggregationTemporality=Q.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,G.isMonotonic=!1;if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(J.dataPoints[q],Q)}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))G.aggregationTemporality=Q.enums===String?X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]===void 0?J.aggregationTemporality:X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]:J.aggregationTemporality;if(J.isMonotonic!=null&&J.hasOwnProperty("isMonotonic"))G.isMonotonic=J.isMonotonic;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Sum"},F}(),H.Histogram=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.prototype.aggregationTemporality=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();if(J.aggregationTemporality!=null&&Object.hasOwnProperty.call(J,"aggregationTemporality"))Q.uint32(16).int32(J.aggregationTemporality);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Histogram;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(J,J.uint32()));break}case 2:{K.aggregationTemporality=J.int32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))switch(J.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Histogram)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Histogram;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(J.dataPoints[G])}}switch(J.aggregationTemporality){default:if(typeof J.aggregationTemporality==="number"){Q.aggregationTemporality=J.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:Q.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:Q.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:Q.aggregationTemporality=2;break}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(Q.defaults)G.aggregationTemporality=Q.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0;if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(J.dataPoints[q],Q)}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))G.aggregationTemporality=Q.enums===String?X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]===void 0?J.aggregationTemporality:X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]:J.aggregationTemporality;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Histogram"},F}(),H.ExponentialHistogram=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.prototype.aggregationTemporality=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();if(J.aggregationTemporality!=null&&Object.hasOwnProperty.call(J,"aggregationTemporality"))Q.uint32(16).int32(J.aggregationTemporality);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogram;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(J,J.uint32()));break}case 2:{K.aggregationTemporality=J.int32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))switch(J.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.ExponentialHistogram)return J;var Q=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(J.dataPoints[G])}}switch(J.aggregationTemporality){default:if(typeof J.aggregationTemporality==="number"){Q.aggregationTemporality=J.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:Q.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:Q.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:Q.aggregationTemporality=2;break}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(Q.defaults)G.aggregationTemporality=Q.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0;if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(J.dataPoints[q],Q)}if(J.aggregationTemporality!=null&&J.hasOwnProperty("aggregationTemporality"))G.aggregationTemporality=Q.enums===String?X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]===void 0?J.aggregationTemporality:X0.opentelemetry.proto.metrics.v1.AggregationTemporality[J.aggregationTemporality]:J.aggregationTemporality;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},F}(),H.Summary=function(){function F(X){if(this.dataPoints=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.dataPoints=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.dataPoints!=null&&J.dataPoints.length)for(var G=0;G<J.dataPoints.length;++G)X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(J.dataPoints[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.Summary;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.dataPoints&&K.dataPoints.length))K.dataPoints=[];K.dataPoints.push(X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.dataPoints!=null&&J.hasOwnProperty("dataPoints")){if(!Array.isArray(J.dataPoints))return"dataPoints: array expected";for(var Q=0;Q<J.dataPoints.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(J.dataPoints[Q]);if(G)return"dataPoints."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.Summary)return J;var Q=new X0.opentelemetry.proto.metrics.v1.Summary;if(J.dataPoints){if(!Array.isArray(J.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");Q.dataPoints=[];for(var G=0;G<J.dataPoints.length;++G){if(typeof J.dataPoints[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");Q.dataPoints[G]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(J.dataPoints[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.dataPoints=[];if(J.dataPoints&&J.dataPoints.length){G.dataPoints=[];for(var q=0;q<J.dataPoints.length;++q)G.dataPoints[q]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(J.dataPoints[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.Summary"},F}(),H.AggregationTemporality=function(){var F={},X=Object.create(F);return X[F[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,X[F[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,X[F[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,X}(),H.DataPointFlags=function(){var F={},X=Object.create(F);return X[F[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,X[F[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,X}(),H.NumberDataPoint=function(){function F(J){if(this.attributes=[],this.exemplars=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.asDouble=null,F.prototype.asInt=null,F.prototype.exemplars=W0.emptyArray,F.prototype.flags=null;var X;return Object.defineProperty(F.prototype,"value",{get:W0.oneOfGetter(X=["asDouble","asInt"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.startTimeUnixNano!=null&&Object.hasOwnProperty.call(Q,"startTimeUnixNano"))G.uint32(17).fixed64(Q.startTimeUnixNano);if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(25).fixed64(Q.timeUnixNano);if(Q.asDouble!=null&&Object.hasOwnProperty.call(Q,"asDouble"))G.uint32(33).double(Q.asDouble);if(Q.exemplars!=null&&Q.exemplars.length)for(var q=0;q<Q.exemplars.length;++q)X0.opentelemetry.proto.metrics.v1.Exemplar.encode(Q.exemplars[q],G.uint32(42).fork()).ldelim();if(Q.asInt!=null&&Object.hasOwnProperty.call(Q,"asInt"))G.uint32(49).sfixed64(Q.asInt);if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(58).fork()).ldelim();if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(64).uint32(Q.flags);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.NumberDataPoint;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 7:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.startTimeUnixNano=Q.fixed64();break}case 3:{V.timeUnixNano=Q.fixed64();break}case 4:{V.asDouble=Q.double();break}case 6:{V.asInt=Q.sfixed64();break}case 5:{if(!(V.exemplars&&V.exemplars.length))V.exemplars=[];V.exemplars.push(X0.opentelemetry.proto.metrics.v1.Exemplar.decode(Q,Q.uint32()));break}case 8:{V.flags=Q.uint32();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var q=0;q<Q.attributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[q]);if(K)return"attributes."+K}}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(Q.startTimeUnixNano)&&!(Q.startTimeUnixNano&&W0.isInteger(Q.startTimeUnixNano.low)&&W0.isInteger(Q.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(G.value=1,typeof Q.asDouble!=="number")return"asDouble: number expected"}if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(G.value===1)return"value: multiple values";if(G.value=1,!W0.isInteger(Q.asInt)&&!(Q.asInt&&W0.isInteger(Q.asInt.low)&&W0.isInteger(Q.asInt.high)))return"asInt: integer|Long expected"}if(Q.exemplars!=null&&Q.hasOwnProperty("exemplars")){if(!Array.isArray(Q.exemplars))return"exemplars: array expected";for(var q=0;q<Q.exemplars.length;++q){var K=X0.opentelemetry.proto.metrics.v1.Exemplar.verify(Q.exemplars[q]);if(K)return"exemplars."+K}}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.NumberDataPoint)return Q;var G=new X0.opentelemetry.proto.metrics.v1.NumberDataPoint;if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.startTimeUnixNano!=null){if(W0.Long)(G.startTimeUnixNano=W0.Long.fromValue(Q.startTimeUnixNano)).unsigned=!1;else if(typeof Q.startTimeUnixNano==="string")G.startTimeUnixNano=parseInt(Q.startTimeUnixNano,10);else if(typeof Q.startTimeUnixNano==="number")G.startTimeUnixNano=Q.startTimeUnixNano;else if(typeof Q.startTimeUnixNano==="object")G.startTimeUnixNano=new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber()}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.asDouble!=null)G.asDouble=Number(Q.asDouble);if(Q.asInt!=null){if(W0.Long)(G.asInt=W0.Long.fromValue(Q.asInt)).unsigned=!1;else if(typeof Q.asInt==="string")G.asInt=parseInt(Q.asInt,10);else if(typeof Q.asInt==="number")G.asInt=Q.asInt;else if(typeof Q.asInt==="object")G.asInt=new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber()}if(Q.exemplars){if(!Array.isArray(Q.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");G.exemplars=[];for(var q=0;q<Q.exemplars.length;++q){if(typeof Q.exemplars[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");G.exemplars[q]=X0.opentelemetry.proto.metrics.v1.Exemplar.fromObject(Q.exemplars[q])}}if(Q.flags!=null)G.flags=Q.flags>>>0;return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.exemplars=[],q.attributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.startTimeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.startTimeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;q.flags=0}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano"))if(typeof Q.startTimeUnixNano==="number")q.startTimeUnixNano=G.longs===String?String(Q.startTimeUnixNano):Q.startTimeUnixNano;else q.startTimeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.startTimeUnixNano):G.longs===Number?new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber():Q.startTimeUnixNano;if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(q.asDouble=G.json&&!isFinite(Q.asDouble)?String(Q.asDouble):Q.asDouble,G.oneofs)q.value="asDouble"}if(Q.exemplars&&Q.exemplars.length){q.exemplars=[];for(var V=0;V<Q.exemplars.length;++V)q.exemplars[V]=X0.opentelemetry.proto.metrics.v1.Exemplar.toObject(Q.exemplars[V],G)}if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(typeof Q.asInt==="number")q.asInt=G.longs===String?String(Q.asInt):Q.asInt;else q.asInt=G.longs===String?W0.Long.prototype.toString.call(Q.asInt):G.longs===Number?new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber():Q.asInt;if(G.oneofs)q.value="asInt"}if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},F}(),H.HistogramDataPoint=function(){function F(J){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.count=null,F.prototype.sum=null,F.prototype.bucketCounts=W0.emptyArray,F.prototype.explicitBounds=W0.emptyArray,F.prototype.exemplars=W0.emptyArray,F.prototype.flags=null,F.prototype.min=null,F.prototype.max=null;var X;return Object.defineProperty(F.prototype,"_sum",{get:W0.oneOfGetter(X=["sum"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_min",{get:W0.oneOfGetter(X=["min"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_max",{get:W0.oneOfGetter(X=["max"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.startTimeUnixNano!=null&&Object.hasOwnProperty.call(Q,"startTimeUnixNano"))G.uint32(17).fixed64(Q.startTimeUnixNano);if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(25).fixed64(Q.timeUnixNano);if(Q.count!=null&&Object.hasOwnProperty.call(Q,"count"))G.uint32(33).fixed64(Q.count);if(Q.sum!=null&&Object.hasOwnProperty.call(Q,"sum"))G.uint32(41).double(Q.sum);if(Q.bucketCounts!=null&&Q.bucketCounts.length){G.uint32(50).fork();for(var q=0;q<Q.bucketCounts.length;++q)G.fixed64(Q.bucketCounts[q]);G.ldelim()}if(Q.explicitBounds!=null&&Q.explicitBounds.length){G.uint32(58).fork();for(var q=0;q<Q.explicitBounds.length;++q)G.double(Q.explicitBounds[q]);G.ldelim()}if(Q.exemplars!=null&&Q.exemplars.length)for(var q=0;q<Q.exemplars.length;++q)X0.opentelemetry.proto.metrics.v1.Exemplar.encode(Q.exemplars[q],G.uint32(66).fork()).ldelim();if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(74).fork()).ldelim();if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(80).uint32(Q.flags);if(Q.min!=null&&Object.hasOwnProperty.call(Q,"min"))G.uint32(89).double(Q.min);if(Q.max!=null&&Object.hasOwnProperty.call(Q,"max"))G.uint32(97).double(Q.max);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.HistogramDataPoint;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 9:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.startTimeUnixNano=Q.fixed64();break}case 3:{V.timeUnixNano=Q.fixed64();break}case 4:{V.count=Q.fixed64();break}case 5:{V.sum=Q.double();break}case 6:{if(!(V.bucketCounts&&V.bucketCounts.length))V.bucketCounts=[];if((B&7)===2){var I=Q.uint32()+Q.pos;while(Q.pos<I)V.bucketCounts.push(Q.fixed64())}else V.bucketCounts.push(Q.fixed64());break}case 7:{if(!(V.explicitBounds&&V.explicitBounds.length))V.explicitBounds=[];if((B&7)===2){var I=Q.uint32()+Q.pos;while(Q.pos<I)V.explicitBounds.push(Q.double())}else V.explicitBounds.push(Q.double());break}case 8:{if(!(V.exemplars&&V.exemplars.length))V.exemplars=[];V.exemplars.push(X0.opentelemetry.proto.metrics.v1.Exemplar.decode(Q,Q.uint32()));break}case 10:{V.flags=Q.uint32();break}case 11:{V.min=Q.double();break}case 12:{V.max=Q.double();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var q=0;q<Q.attributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[q]);if(K)return"attributes."+K}}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(Q.startTimeUnixNano)&&!(Q.startTimeUnixNano&&W0.isInteger(Q.startTimeUnixNano.low)&&W0.isInteger(Q.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.count!=null&&Q.hasOwnProperty("count")){if(!W0.isInteger(Q.count)&&!(Q.count&&W0.isInteger(Q.count.low)&&W0.isInteger(Q.count.high)))return"count: integer|Long expected"}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(G._sum=1,typeof Q.sum!=="number")return"sum: number expected"}if(Q.bucketCounts!=null&&Q.hasOwnProperty("bucketCounts")){if(!Array.isArray(Q.bucketCounts))return"bucketCounts: array expected";for(var q=0;q<Q.bucketCounts.length;++q)if(!W0.isInteger(Q.bucketCounts[q])&&!(Q.bucketCounts[q]&&W0.isInteger(Q.bucketCounts[q].low)&&W0.isInteger(Q.bucketCounts[q].high)))return"bucketCounts: integer|Long[] expected"}if(Q.explicitBounds!=null&&Q.hasOwnProperty("explicitBounds")){if(!Array.isArray(Q.explicitBounds))return"explicitBounds: array expected";for(var q=0;q<Q.explicitBounds.length;++q)if(typeof Q.explicitBounds[q]!=="number")return"explicitBounds: number[] expected"}if(Q.exemplars!=null&&Q.hasOwnProperty("exemplars")){if(!Array.isArray(Q.exemplars))return"exemplars: array expected";for(var q=0;q<Q.exemplars.length;++q){var K=X0.opentelemetry.proto.metrics.v1.Exemplar.verify(Q.exemplars[q]);if(K)return"exemplars."+K}}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}if(Q.min!=null&&Q.hasOwnProperty("min")){if(G._min=1,typeof Q.min!=="number")return"min: number expected"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(G._max=1,typeof Q.max!=="number")return"max: number expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.HistogramDataPoint)return Q;var G=new X0.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.startTimeUnixNano!=null){if(W0.Long)(G.startTimeUnixNano=W0.Long.fromValue(Q.startTimeUnixNano)).unsigned=!1;else if(typeof Q.startTimeUnixNano==="string")G.startTimeUnixNano=parseInt(Q.startTimeUnixNano,10);else if(typeof Q.startTimeUnixNano==="number")G.startTimeUnixNano=Q.startTimeUnixNano;else if(typeof Q.startTimeUnixNano==="object")G.startTimeUnixNano=new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber()}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.count!=null){if(W0.Long)(G.count=W0.Long.fromValue(Q.count)).unsigned=!1;else if(typeof Q.count==="string")G.count=parseInt(Q.count,10);else if(typeof Q.count==="number")G.count=Q.count;else if(typeof Q.count==="object")G.count=new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber()}if(Q.sum!=null)G.sum=Number(Q.sum);if(Q.bucketCounts){if(!Array.isArray(Q.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");G.bucketCounts=[];for(var q=0;q<Q.bucketCounts.length;++q)if(W0.Long)(G.bucketCounts[q]=W0.Long.fromValue(Q.bucketCounts[q])).unsigned=!1;else if(typeof Q.bucketCounts[q]==="string")G.bucketCounts[q]=parseInt(Q.bucketCounts[q],10);else if(typeof Q.bucketCounts[q]==="number")G.bucketCounts[q]=Q.bucketCounts[q];else if(typeof Q.bucketCounts[q]==="object")G.bucketCounts[q]=new W0.LongBits(Q.bucketCounts[q].low>>>0,Q.bucketCounts[q].high>>>0).toNumber()}if(Q.explicitBounds){if(!Array.isArray(Q.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");G.explicitBounds=[];for(var q=0;q<Q.explicitBounds.length;++q)G.explicitBounds[q]=Number(Q.explicitBounds[q])}if(Q.exemplars){if(!Array.isArray(Q.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");G.exemplars=[];for(var q=0;q<Q.exemplars.length;++q){if(typeof Q.exemplars[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");G.exemplars[q]=X0.opentelemetry.proto.metrics.v1.Exemplar.fromObject(Q.exemplars[q])}}if(Q.flags!=null)G.flags=Q.flags>>>0;if(Q.min!=null)G.min=Number(Q.min);if(Q.max!=null)G.max=Number(Q.max);return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.bucketCounts=[],q.explicitBounds=[],q.exemplars=[],q.attributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.startTimeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.startTimeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.count=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.count=G.longs===String?"0":0;q.flags=0}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano"))if(typeof Q.startTimeUnixNano==="number")q.startTimeUnixNano=G.longs===String?String(Q.startTimeUnixNano):Q.startTimeUnixNano;else q.startTimeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.startTimeUnixNano):G.longs===Number?new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber():Q.startTimeUnixNano;if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.count!=null&&Q.hasOwnProperty("count"))if(typeof Q.count==="number")q.count=G.longs===String?String(Q.count):Q.count;else q.count=G.longs===String?W0.Long.prototype.toString.call(Q.count):G.longs===Number?new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber():Q.count;if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(q.sum=G.json&&!isFinite(Q.sum)?String(Q.sum):Q.sum,G.oneofs)q._sum="sum"}if(Q.bucketCounts&&Q.bucketCounts.length){q.bucketCounts=[];for(var V=0;V<Q.bucketCounts.length;++V)if(typeof Q.bucketCounts[V]==="number")q.bucketCounts[V]=G.longs===String?String(Q.bucketCounts[V]):Q.bucketCounts[V];else q.bucketCounts[V]=G.longs===String?W0.Long.prototype.toString.call(Q.bucketCounts[V]):G.longs===Number?new W0.LongBits(Q.bucketCounts[V].low>>>0,Q.bucketCounts[V].high>>>0).toNumber():Q.bucketCounts[V]}if(Q.explicitBounds&&Q.explicitBounds.length){q.explicitBounds=[];for(var V=0;V<Q.explicitBounds.length;++V)q.explicitBounds[V]=G.json&&!isFinite(Q.explicitBounds[V])?String(Q.explicitBounds[V]):Q.explicitBounds[V]}if(Q.exemplars&&Q.exemplars.length){q.exemplars=[];for(var V=0;V<Q.exemplars.length;++V)q.exemplars[V]=X0.opentelemetry.proto.metrics.v1.Exemplar.toObject(Q.exemplars[V],G)}if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;if(Q.min!=null&&Q.hasOwnProperty("min")){if(q.min=G.json&&!isFinite(Q.min)?String(Q.min):Q.min,G.oneofs)q._min="min"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(q.max=G.json&&!isFinite(Q.max)?String(Q.max):Q.max,G.oneofs)q._max="max"}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},F}(),H.ExponentialHistogramDataPoint=function(){function F(J){if(this.attributes=[],this.exemplars=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.count=null,F.prototype.sum=null,F.prototype.scale=null,F.prototype.zeroCount=null,F.prototype.positive=null,F.prototype.negative=null,F.prototype.flags=null,F.prototype.exemplars=W0.emptyArray,F.prototype.min=null,F.prototype.max=null,F.prototype.zeroThreshold=null;var X;return Object.defineProperty(F.prototype,"_sum",{get:W0.oneOfGetter(X=["sum"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_min",{get:W0.oneOfGetter(X=["min"]),set:W0.oneOfSetter(X)}),Object.defineProperty(F.prototype,"_max",{get:W0.oneOfGetter(X=["max"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.attributes!=null&&Q.attributes.length)for(var q=0;q<Q.attributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.attributes[q],G.uint32(10).fork()).ldelim();if(Q.startTimeUnixNano!=null&&Object.hasOwnProperty.call(Q,"startTimeUnixNano"))G.uint32(17).fixed64(Q.startTimeUnixNano);if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(25).fixed64(Q.timeUnixNano);if(Q.count!=null&&Object.hasOwnProperty.call(Q,"count"))G.uint32(33).fixed64(Q.count);if(Q.sum!=null&&Object.hasOwnProperty.call(Q,"sum"))G.uint32(41).double(Q.sum);if(Q.scale!=null&&Object.hasOwnProperty.call(Q,"scale"))G.uint32(48).sint32(Q.scale);if(Q.zeroCount!=null&&Object.hasOwnProperty.call(Q,"zeroCount"))G.uint32(57).fixed64(Q.zeroCount);if(Q.positive!=null&&Object.hasOwnProperty.call(Q,"positive"))X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(Q.positive,G.uint32(66).fork()).ldelim();if(Q.negative!=null&&Object.hasOwnProperty.call(Q,"negative"))X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(Q.negative,G.uint32(74).fork()).ldelim();if(Q.flags!=null&&Object.hasOwnProperty.call(Q,"flags"))G.uint32(80).uint32(Q.flags);if(Q.exemplars!=null&&Q.exemplars.length)for(var q=0;q<Q.exemplars.length;++q)X0.opentelemetry.proto.metrics.v1.Exemplar.encode(Q.exemplars[q],G.uint32(90).fork()).ldelim();if(Q.min!=null&&Object.hasOwnProperty.call(Q,"min"))G.uint32(97).double(Q.min);if(Q.max!=null&&Object.hasOwnProperty.call(Q,"max"))G.uint32(105).double(Q.max);if(Q.zeroThreshold!=null&&Object.hasOwnProperty.call(Q,"zeroThreshold"))G.uint32(113).double(Q.zeroThreshold);return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{if(!(V.attributes&&V.attributes.length))V.attributes=[];V.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.startTimeUnixNano=Q.fixed64();break}case 3:{V.timeUnixNano=Q.fixed64();break}case 4:{V.count=Q.fixed64();break}case 5:{V.sum=Q.double();break}case 6:{V.scale=Q.sint32();break}case 7:{V.zeroCount=Q.fixed64();break}case 8:{V.positive=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(Q,Q.uint32());break}case 9:{V.negative=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(Q,Q.uint32());break}case 10:{V.flags=Q.uint32();break}case 11:{if(!(V.exemplars&&V.exemplars.length))V.exemplars=[];V.exemplars.push(X0.opentelemetry.proto.metrics.v1.Exemplar.decode(Q,Q.uint32()));break}case 12:{V.min=Q.double();break}case 13:{V.max=Q.double();break}case 14:{V.zeroThreshold=Q.double();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.attributes!=null&&Q.hasOwnProperty("attributes")){if(!Array.isArray(Q.attributes))return"attributes: array expected";for(var q=0;q<Q.attributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.attributes[q]);if(K)return"attributes."+K}}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(Q.startTimeUnixNano)&&!(Q.startTimeUnixNano&&W0.isInteger(Q.startTimeUnixNano.low)&&W0.isInteger(Q.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.count!=null&&Q.hasOwnProperty("count")){if(!W0.isInteger(Q.count)&&!(Q.count&&W0.isInteger(Q.count.low)&&W0.isInteger(Q.count.high)))return"count: integer|Long expected"}if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(G._sum=1,typeof Q.sum!=="number")return"sum: number expected"}if(Q.scale!=null&&Q.hasOwnProperty("scale")){if(!W0.isInteger(Q.scale))return"scale: integer expected"}if(Q.zeroCount!=null&&Q.hasOwnProperty("zeroCount")){if(!W0.isInteger(Q.zeroCount)&&!(Q.zeroCount&&W0.isInteger(Q.zeroCount.low)&&W0.isInteger(Q.zeroCount.high)))return"zeroCount: integer|Long expected"}if(Q.positive!=null&&Q.hasOwnProperty("positive")){var K=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(Q.positive);if(K)return"positive."+K}if(Q.negative!=null&&Q.hasOwnProperty("negative")){var K=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(Q.negative);if(K)return"negative."+K}if(Q.flags!=null&&Q.hasOwnProperty("flags")){if(!W0.isInteger(Q.flags))return"flags: integer expected"}if(Q.exemplars!=null&&Q.hasOwnProperty("exemplars")){if(!Array.isArray(Q.exemplars))return"exemplars: array expected";for(var q=0;q<Q.exemplars.length;++q){var K=X0.opentelemetry.proto.metrics.v1.Exemplar.verify(Q.exemplars[q]);if(K)return"exemplars."+K}}if(Q.min!=null&&Q.hasOwnProperty("min")){if(G._min=1,typeof Q.min!=="number")return"min: number expected"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(G._max=1,typeof Q.max!=="number")return"max: number expected"}if(Q.zeroThreshold!=null&&Q.hasOwnProperty("zeroThreshold")){if(typeof Q.zeroThreshold!=="number")return"zeroThreshold: number expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return Q;var G=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(Q.attributes){if(!Array.isArray(Q.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");G.attributes=[];for(var q=0;q<Q.attributes.length;++q){if(typeof Q.attributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");G.attributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.attributes[q])}}if(Q.startTimeUnixNano!=null){if(W0.Long)(G.startTimeUnixNano=W0.Long.fromValue(Q.startTimeUnixNano)).unsigned=!1;else if(typeof Q.startTimeUnixNano==="string")G.startTimeUnixNano=parseInt(Q.startTimeUnixNano,10);else if(typeof Q.startTimeUnixNano==="number")G.startTimeUnixNano=Q.startTimeUnixNano;else if(typeof Q.startTimeUnixNano==="object")G.startTimeUnixNano=new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber()}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.count!=null){if(W0.Long)(G.count=W0.Long.fromValue(Q.count)).unsigned=!1;else if(typeof Q.count==="string")G.count=parseInt(Q.count,10);else if(typeof Q.count==="number")G.count=Q.count;else if(typeof Q.count==="object")G.count=new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber()}if(Q.sum!=null)G.sum=Number(Q.sum);if(Q.scale!=null)G.scale=Q.scale|0;if(Q.zeroCount!=null){if(W0.Long)(G.zeroCount=W0.Long.fromValue(Q.zeroCount)).unsigned=!1;else if(typeof Q.zeroCount==="string")G.zeroCount=parseInt(Q.zeroCount,10);else if(typeof Q.zeroCount==="number")G.zeroCount=Q.zeroCount;else if(typeof Q.zeroCount==="object")G.zeroCount=new W0.LongBits(Q.zeroCount.low>>>0,Q.zeroCount.high>>>0).toNumber()}if(Q.positive!=null){if(typeof Q.positive!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");G.positive=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(Q.positive)}if(Q.negative!=null){if(typeof Q.negative!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");G.negative=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(Q.negative)}if(Q.flags!=null)G.flags=Q.flags>>>0;if(Q.exemplars){if(!Array.isArray(Q.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");G.exemplars=[];for(var q=0;q<Q.exemplars.length;++q){if(typeof Q.exemplars[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");G.exemplars[q]=X0.opentelemetry.proto.metrics.v1.Exemplar.fromObject(Q.exemplars[q])}}if(Q.min!=null)G.min=Number(Q.min);if(Q.max!=null)G.max=Number(Q.max);if(Q.zeroThreshold!=null)G.zeroThreshold=Number(Q.zeroThreshold);return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.attributes=[],q.exemplars=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.startTimeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.startTimeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;if(W0.Long){var K=new W0.Long(0,0,!1);q.count=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.count=G.longs===String?"0":0;if(q.scale=0,W0.Long){var K=new W0.Long(0,0,!1);q.zeroCount=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.zeroCount=G.longs===String?"0":0;q.positive=null,q.negative=null,q.flags=0,q.zeroThreshold=0}if(Q.attributes&&Q.attributes.length){q.attributes=[];for(var V=0;V<Q.attributes.length;++V)q.attributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.attributes[V],G)}if(Q.startTimeUnixNano!=null&&Q.hasOwnProperty("startTimeUnixNano"))if(typeof Q.startTimeUnixNano==="number")q.startTimeUnixNano=G.longs===String?String(Q.startTimeUnixNano):Q.startTimeUnixNano;else q.startTimeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.startTimeUnixNano):G.longs===Number?new W0.LongBits(Q.startTimeUnixNano.low>>>0,Q.startTimeUnixNano.high>>>0).toNumber():Q.startTimeUnixNano;if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.count!=null&&Q.hasOwnProperty("count"))if(typeof Q.count==="number")q.count=G.longs===String?String(Q.count):Q.count;else q.count=G.longs===String?W0.Long.prototype.toString.call(Q.count):G.longs===Number?new W0.LongBits(Q.count.low>>>0,Q.count.high>>>0).toNumber():Q.count;if(Q.sum!=null&&Q.hasOwnProperty("sum")){if(q.sum=G.json&&!isFinite(Q.sum)?String(Q.sum):Q.sum,G.oneofs)q._sum="sum"}if(Q.scale!=null&&Q.hasOwnProperty("scale"))q.scale=Q.scale;if(Q.zeroCount!=null&&Q.hasOwnProperty("zeroCount"))if(typeof Q.zeroCount==="number")q.zeroCount=G.longs===String?String(Q.zeroCount):Q.zeroCount;else q.zeroCount=G.longs===String?W0.Long.prototype.toString.call(Q.zeroCount):G.longs===Number?new W0.LongBits(Q.zeroCount.low>>>0,Q.zeroCount.high>>>0).toNumber():Q.zeroCount;if(Q.positive!=null&&Q.hasOwnProperty("positive"))q.positive=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(Q.positive,G);if(Q.negative!=null&&Q.hasOwnProperty("negative"))q.negative=X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(Q.negative,G);if(Q.flags!=null&&Q.hasOwnProperty("flags"))q.flags=Q.flags;if(Q.exemplars&&Q.exemplars.length){q.exemplars=[];for(var V=0;V<Q.exemplars.length;++V)q.exemplars[V]=X0.opentelemetry.proto.metrics.v1.Exemplar.toObject(Q.exemplars[V],G)}if(Q.min!=null&&Q.hasOwnProperty("min")){if(q.min=G.json&&!isFinite(Q.min)?String(Q.min):Q.min,G.oneofs)q._min="min"}if(Q.max!=null&&Q.hasOwnProperty("max")){if(q.max=G.json&&!isFinite(Q.max)?String(Q.max):Q.max,G.oneofs)q._max="max"}if(Q.zeroThreshold!=null&&Q.hasOwnProperty("zeroThreshold"))q.zeroThreshold=G.json&&!isFinite(Q.zeroThreshold)?String(Q.zeroThreshold):Q.zeroThreshold;return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},F.Buckets=function(){function J(Q){if(this.bucketCounts=[],Q){for(var G=Object.keys(Q),q=0;q<G.length;++q)if(Q[G[q]]!=null)this[G[q]]=Q[G[q]]}}return J.prototype.offset=null,J.prototype.bucketCounts=W0.emptyArray,J.create=function(G){return new J(G)},J.encode=function(G,q){if(!q)q=u1.create();if(G.offset!=null&&Object.hasOwnProperty.call(G,"offset"))q.uint32(8).sint32(G.offset);if(G.bucketCounts!=null&&G.bucketCounts.length){q.uint32(18).fork();for(var K=0;K<G.bucketCounts.length;++K)q.uint64(G.bucketCounts[K]);q.ldelim()}return q},J.encodeDelimited=function(G,q){return this.encode(G,q).ldelim()},J.decode=function(G,q,K){if(!(G instanceof x0))G=x0.create(G);var V=q===void 0?G.len:G.pos+q,B=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;while(G.pos<V){var I=G.uint32();if(I===K)break;switch(I>>>3){case 1:{B.offset=G.sint32();break}case 2:{if(!(B.bucketCounts&&B.bucketCounts.length))B.bucketCounts=[];if((I&7)===2){var M=G.uint32()+G.pos;while(G.pos<M)B.bucketCounts.push(G.uint64())}else B.bucketCounts.push(G.uint64());break}default:G.skipType(I&7);break}}return B},J.decodeDelimited=function(G){if(!(G instanceof x0))G=new x0(G);return this.decode(G,G.uint32())},J.verify=function(G){if(typeof G!=="object"||G===null)return"object expected";if(G.offset!=null&&G.hasOwnProperty("offset")){if(!W0.isInteger(G.offset))return"offset: integer expected"}if(G.bucketCounts!=null&&G.hasOwnProperty("bucketCounts")){if(!Array.isArray(G.bucketCounts))return"bucketCounts: array expected";for(var q=0;q<G.bucketCounts.length;++q)if(!W0.isInteger(G.bucketCounts[q])&&!(G.bucketCounts[q]&&W0.isInteger(G.bucketCounts[q].low)&&W0.isInteger(G.bucketCounts[q].high)))return"bucketCounts: integer|Long[] expected"}return null},J.fromObject=function(G){if(G instanceof X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return G;var q=new X0.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(G.offset!=null)q.offset=G.offset|0;if(G.bucketCounts){if(!Array.isArray(G.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");q.bucketCounts=[];for(var K=0;K<G.bucketCounts.length;++K)if(W0.Long)(q.bucketCounts[K]=W0.Long.fromValue(G.bucketCounts[K])).unsigned=!0;else if(typeof G.bucketCounts[K]==="string")q.bucketCounts[K]=parseInt(G.bucketCounts[K],10);else if(typeof G.bucketCounts[K]==="number")q.bucketCounts[K]=G.bucketCounts[K];else if(typeof G.bucketCounts[K]==="object")q.bucketCounts[K]=new W0.LongBits(G.bucketCounts[K].low>>>0,G.bucketCounts[K].high>>>0).toNumber(!0)}return q},J.toObject=function(G,q){if(!q)q={};var K={};if(q.arrays||q.defaults)K.bucketCounts=[];if(q.defaults)K.offset=0;if(G.offset!=null&&G.hasOwnProperty("offset"))K.offset=G.offset;if(G.bucketCounts&&G.bucketCounts.length){K.bucketCounts=[];for(var V=0;V<G.bucketCounts.length;++V)if(typeof G.bucketCounts[V]==="number")K.bucketCounts[V]=q.longs===String?String(G.bucketCounts[V]):G.bucketCounts[V];else K.bucketCounts[V]=q.longs===String?W0.Long.prototype.toString.call(G.bucketCounts[V]):q.longs===Number?new W0.LongBits(G.bucketCounts[V].low>>>0,G.bucketCounts[V].high>>>0).toNumber(!0):G.bucketCounts[V]}return K},J.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},J.getTypeUrl=function(G){if(G===void 0)G="type.googleapis.com";return G+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},J}(),F}(),H.SummaryDataPoint=function(){function F(X){if(this.attributes=[],this.quantileValues=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.attributes=W0.emptyArray,F.prototype.startTimeUnixNano=null,F.prototype.timeUnixNano=null,F.prototype.count=null,F.prototype.sum=null,F.prototype.quantileValues=W0.emptyArray,F.prototype.flags=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.startTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"startTimeUnixNano"))Q.uint32(17).fixed64(J.startTimeUnixNano);if(J.timeUnixNano!=null&&Object.hasOwnProperty.call(J,"timeUnixNano"))Q.uint32(25).fixed64(J.timeUnixNano);if(J.count!=null&&Object.hasOwnProperty.call(J,"count"))Q.uint32(33).fixed64(J.count);if(J.sum!=null&&Object.hasOwnProperty.call(J,"sum"))Q.uint32(41).double(J.sum);if(J.quantileValues!=null&&J.quantileValues.length)for(var G=0;G<J.quantileValues.length;++G)X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(J.quantileValues[G],Q.uint32(50).fork()).ldelim();if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(58).fork()).ldelim();if(J.flags!=null&&Object.hasOwnProperty.call(J,"flags"))Q.uint32(64).uint32(J.flags);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 7:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 2:{K.startTimeUnixNano=J.fixed64();break}case 3:{K.timeUnixNano=J.fixed64();break}case 4:{K.count=J.fixed64();break}case 5:{K.sum=J.double();break}case 6:{if(!(K.quantileValues&&K.quantileValues.length))K.quantileValues=[];K.quantileValues.push(X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(J,J.uint32()));break}case 8:{K.flags=J.uint32();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var Q=0;Q<J.attributes.length;++Q){var G=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[Q]);if(G)return"attributes."+G}}if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano")){if(!W0.isInteger(J.startTimeUnixNano)&&!(J.startTimeUnixNano&&W0.isInteger(J.startTimeUnixNano.low)&&W0.isInteger(J.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected"}if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(J.timeUnixNano)&&!(J.timeUnixNano&&W0.isInteger(J.timeUnixNano.low)&&W0.isInteger(J.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(J.count!=null&&J.hasOwnProperty("count")){if(!W0.isInteger(J.count)&&!(J.count&&W0.isInteger(J.count.low)&&W0.isInteger(J.count.high)))return"count: integer|Long expected"}if(J.sum!=null&&J.hasOwnProperty("sum")){if(typeof J.sum!=="number")return"sum: number expected"}if(J.quantileValues!=null&&J.hasOwnProperty("quantileValues")){if(!Array.isArray(J.quantileValues))return"quantileValues: array expected";for(var Q=0;Q<J.quantileValues.length;++Q){var G=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(J.quantileValues[Q]);if(G)return"quantileValues."+G}}if(J.flags!=null&&J.hasOwnProperty("flags")){if(!W0.isInteger(J.flags))return"flags: integer expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.metrics.v1.SummaryDataPoint)return J;var Q=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.startTimeUnixNano!=null){if(W0.Long)(Q.startTimeUnixNano=W0.Long.fromValue(J.startTimeUnixNano)).unsigned=!1;else if(typeof J.startTimeUnixNano==="string")Q.startTimeUnixNano=parseInt(J.startTimeUnixNano,10);else if(typeof J.startTimeUnixNano==="number")Q.startTimeUnixNano=J.startTimeUnixNano;else if(typeof J.startTimeUnixNano==="object")Q.startTimeUnixNano=new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber()}if(J.timeUnixNano!=null){if(W0.Long)(Q.timeUnixNano=W0.Long.fromValue(J.timeUnixNano)).unsigned=!1;else if(typeof J.timeUnixNano==="string")Q.timeUnixNano=parseInt(J.timeUnixNano,10);else if(typeof J.timeUnixNano==="number")Q.timeUnixNano=J.timeUnixNano;else if(typeof J.timeUnixNano==="object")Q.timeUnixNano=new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber()}if(J.count!=null){if(W0.Long)(Q.count=W0.Long.fromValue(J.count)).unsigned=!1;else if(typeof J.count==="string")Q.count=parseInt(J.count,10);else if(typeof J.count==="number")Q.count=J.count;else if(typeof J.count==="object")Q.count=new W0.LongBits(J.count.low>>>0,J.count.high>>>0).toNumber()}if(J.sum!=null)Q.sum=Number(J.sum);if(J.quantileValues){if(!Array.isArray(J.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");Q.quantileValues=[];for(var G=0;G<J.quantileValues.length;++G){if(typeof J.quantileValues[G]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");Q.quantileValues[G]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(J.quantileValues[G])}}if(J.flags!=null)Q.flags=J.flags>>>0;return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.quantileValues=[],G.attributes=[];if(Q.defaults){if(W0.Long){var q=new W0.Long(0,0,!1);G.startTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.startTimeUnixNano=Q.longs===String?"0":0;if(W0.Long){var q=new W0.Long(0,0,!1);G.timeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.timeUnixNano=Q.longs===String?"0":0;if(W0.Long){var q=new W0.Long(0,0,!1);G.count=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.count=Q.longs===String?"0":0;G.sum=0,G.flags=0}if(J.startTimeUnixNano!=null&&J.hasOwnProperty("startTimeUnixNano"))if(typeof J.startTimeUnixNano==="number")G.startTimeUnixNano=Q.longs===String?String(J.startTimeUnixNano):J.startTimeUnixNano;else G.startTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.startTimeUnixNano):Q.longs===Number?new W0.LongBits(J.startTimeUnixNano.low>>>0,J.startTimeUnixNano.high>>>0).toNumber():J.startTimeUnixNano;if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano"))if(typeof J.timeUnixNano==="number")G.timeUnixNano=Q.longs===String?String(J.timeUnixNano):J.timeUnixNano;else G.timeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.timeUnixNano):Q.longs===Number?new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber():J.timeUnixNano;if(J.count!=null&&J.hasOwnProperty("count"))if(typeof J.count==="number")G.count=Q.longs===String?String(J.count):J.count;else G.count=Q.longs===String?W0.Long.prototype.toString.call(J.count):Q.longs===Number?new W0.LongBits(J.count.low>>>0,J.count.high>>>0).toNumber():J.count;if(J.sum!=null&&J.hasOwnProperty("sum"))G.sum=Q.json&&!isFinite(J.sum)?String(J.sum):J.sum;if(J.quantileValues&&J.quantileValues.length){G.quantileValues=[];for(var K=0;K<J.quantileValues.length;++K)G.quantileValues[K]=X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(J.quantileValues[K],Q)}if(J.attributes&&J.attributes.length){G.attributes=[];for(var K=0;K<J.attributes.length;++K)G.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[K],Q)}if(J.flags!=null&&J.hasOwnProperty("flags"))G.flags=J.flags;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},F.ValueAtQuantile=function(){function X(J){if(J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}return X.prototype.quantile=null,X.prototype.value=null,X.create=function(Q){return new X(Q)},X.encode=function(Q,G){if(!G)G=u1.create();if(Q.quantile!=null&&Object.hasOwnProperty.call(Q,"quantile"))G.uint32(9).double(Q.quantile);if(Q.value!=null&&Object.hasOwnProperty.call(Q,"value"))G.uint32(17).double(Q.value);return G},X.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},X.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 1:{V.quantile=Q.double();break}case 2:{V.value=Q.double();break}default:Q.skipType(B&7);break}}return V},X.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},X.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";if(Q.quantile!=null&&Q.hasOwnProperty("quantile")){if(typeof Q.quantile!=="number")return"quantile: number expected"}if(Q.value!=null&&Q.hasOwnProperty("value")){if(typeof Q.value!=="number")return"value: number expected"}return null},X.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return Q;var G=new X0.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;if(Q.quantile!=null)G.quantile=Number(Q.quantile);if(Q.value!=null)G.value=Number(Q.value);return G},X.toObject=function(Q,G){if(!G)G={};var q={};if(G.defaults)q.quantile=0,q.value=0;if(Q.quantile!=null&&Q.hasOwnProperty("quantile"))q.quantile=G.json&&!isFinite(Q.quantile)?String(Q.quantile):Q.quantile;if(Q.value!=null&&Q.hasOwnProperty("value"))q.value=G.json&&!isFinite(Q.value)?String(Q.value):Q.value;return q},X.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},X.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},X}(),F}(),H.Exemplar=function(){function F(J){if(this.filteredAttributes=[],J){for(var Q=Object.keys(J),G=0;G<Q.length;++G)if(J[Q[G]]!=null)this[Q[G]]=J[Q[G]]}}F.prototype.filteredAttributes=W0.emptyArray,F.prototype.timeUnixNano=null,F.prototype.asDouble=null,F.prototype.asInt=null,F.prototype.spanId=null,F.prototype.traceId=null;var X;return Object.defineProperty(F.prototype,"value",{get:W0.oneOfGetter(X=["asDouble","asInt"]),set:W0.oneOfSetter(X)}),F.create=function(Q){return new F(Q)},F.encode=function(Q,G){if(!G)G=u1.create();if(Q.timeUnixNano!=null&&Object.hasOwnProperty.call(Q,"timeUnixNano"))G.uint32(17).fixed64(Q.timeUnixNano);if(Q.asDouble!=null&&Object.hasOwnProperty.call(Q,"asDouble"))G.uint32(25).double(Q.asDouble);if(Q.spanId!=null&&Object.hasOwnProperty.call(Q,"spanId"))G.uint32(34).bytes(Q.spanId);if(Q.traceId!=null&&Object.hasOwnProperty.call(Q,"traceId"))G.uint32(42).bytes(Q.traceId);if(Q.asInt!=null&&Object.hasOwnProperty.call(Q,"asInt"))G.uint32(49).sfixed64(Q.asInt);if(Q.filteredAttributes!=null&&Q.filteredAttributes.length)for(var q=0;q<Q.filteredAttributes.length;++q)X0.opentelemetry.proto.common.v1.KeyValue.encode(Q.filteredAttributes[q],G.uint32(58).fork()).ldelim();return G},F.encodeDelimited=function(Q,G){return this.encode(Q,G).ldelim()},F.decode=function(Q,G,q){if(!(Q instanceof x0))Q=x0.create(Q);var K=G===void 0?Q.len:Q.pos+G,V=new X0.opentelemetry.proto.metrics.v1.Exemplar;while(Q.pos<K){var B=Q.uint32();if(B===q)break;switch(B>>>3){case 7:{if(!(V.filteredAttributes&&V.filteredAttributes.length))V.filteredAttributes=[];V.filteredAttributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(Q,Q.uint32()));break}case 2:{V.timeUnixNano=Q.fixed64();break}case 3:{V.asDouble=Q.double();break}case 6:{V.asInt=Q.sfixed64();break}case 4:{V.spanId=Q.bytes();break}case 5:{V.traceId=Q.bytes();break}default:Q.skipType(B&7);break}}return V},F.decodeDelimited=function(Q){if(!(Q instanceof x0))Q=new x0(Q);return this.decode(Q,Q.uint32())},F.verify=function(Q){if(typeof Q!=="object"||Q===null)return"object expected";var G={};if(Q.filteredAttributes!=null&&Q.hasOwnProperty("filteredAttributes")){if(!Array.isArray(Q.filteredAttributes))return"filteredAttributes: array expected";for(var q=0;q<Q.filteredAttributes.length;++q){var K=X0.opentelemetry.proto.common.v1.KeyValue.verify(Q.filteredAttributes[q]);if(K)return"filteredAttributes."+K}}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(Q.timeUnixNano)&&!(Q.timeUnixNano&&W0.isInteger(Q.timeUnixNano.low)&&W0.isInteger(Q.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(G.value=1,typeof Q.asDouble!=="number")return"asDouble: number expected"}if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(G.value===1)return"value: multiple values";if(G.value=1,!W0.isInteger(Q.asInt)&&!(Q.asInt&&W0.isInteger(Q.asInt.low)&&W0.isInteger(Q.asInt.high)))return"asInt: integer|Long expected"}if(Q.spanId!=null&&Q.hasOwnProperty("spanId")){if(!(Q.spanId&&typeof Q.spanId.length==="number"||W0.isString(Q.spanId)))return"spanId: buffer expected"}if(Q.traceId!=null&&Q.hasOwnProperty("traceId")){if(!(Q.traceId&&typeof Q.traceId.length==="number"||W0.isString(Q.traceId)))return"traceId: buffer expected"}return null},F.fromObject=function(Q){if(Q instanceof X0.opentelemetry.proto.metrics.v1.Exemplar)return Q;var G=new X0.opentelemetry.proto.metrics.v1.Exemplar;if(Q.filteredAttributes){if(!Array.isArray(Q.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");G.filteredAttributes=[];for(var q=0;q<Q.filteredAttributes.length;++q){if(typeof Q.filteredAttributes[q]!=="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");G.filteredAttributes[q]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(Q.filteredAttributes[q])}}if(Q.timeUnixNano!=null){if(W0.Long)(G.timeUnixNano=W0.Long.fromValue(Q.timeUnixNano)).unsigned=!1;else if(typeof Q.timeUnixNano==="string")G.timeUnixNano=parseInt(Q.timeUnixNano,10);else if(typeof Q.timeUnixNano==="number")G.timeUnixNano=Q.timeUnixNano;else if(typeof Q.timeUnixNano==="object")G.timeUnixNano=new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber()}if(Q.asDouble!=null)G.asDouble=Number(Q.asDouble);if(Q.asInt!=null){if(W0.Long)(G.asInt=W0.Long.fromValue(Q.asInt)).unsigned=!1;else if(typeof Q.asInt==="string")G.asInt=parseInt(Q.asInt,10);else if(typeof Q.asInt==="number")G.asInt=Q.asInt;else if(typeof Q.asInt==="object")G.asInt=new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber()}if(Q.spanId!=null){if(typeof Q.spanId==="string")W0.base64.decode(Q.spanId,G.spanId=W0.newBuffer(W0.base64.length(Q.spanId)),0);else if(Q.spanId.length>=0)G.spanId=Q.spanId}if(Q.traceId!=null){if(typeof Q.traceId==="string")W0.base64.decode(Q.traceId,G.traceId=W0.newBuffer(W0.base64.length(Q.traceId)),0);else if(Q.traceId.length>=0)G.traceId=Q.traceId}return G},F.toObject=function(Q,G){if(!G)G={};var q={};if(G.arrays||G.defaults)q.filteredAttributes=[];if(G.defaults){if(W0.Long){var K=new W0.Long(0,0,!1);q.timeUnixNano=G.longs===String?K.toString():G.longs===Number?K.toNumber():K}else q.timeUnixNano=G.longs===String?"0":0;if(G.bytes===String)q.spanId="";else if(q.spanId=[],G.bytes!==Array)q.spanId=W0.newBuffer(q.spanId);if(G.bytes===String)q.traceId="";else if(q.traceId=[],G.bytes!==Array)q.traceId=W0.newBuffer(q.traceId)}if(Q.timeUnixNano!=null&&Q.hasOwnProperty("timeUnixNano"))if(typeof Q.timeUnixNano==="number")q.timeUnixNano=G.longs===String?String(Q.timeUnixNano):Q.timeUnixNano;else q.timeUnixNano=G.longs===String?W0.Long.prototype.toString.call(Q.timeUnixNano):G.longs===Number?new W0.LongBits(Q.timeUnixNano.low>>>0,Q.timeUnixNano.high>>>0).toNumber():Q.timeUnixNano;if(Q.asDouble!=null&&Q.hasOwnProperty("asDouble")){if(q.asDouble=G.json&&!isFinite(Q.asDouble)?String(Q.asDouble):Q.asDouble,G.oneofs)q.value="asDouble"}if(Q.spanId!=null&&Q.hasOwnProperty("spanId"))q.spanId=G.bytes===String?W0.base64.encode(Q.spanId,0,Q.spanId.length):G.bytes===Array?Array.prototype.slice.call(Q.spanId):Q.spanId;if(Q.traceId!=null&&Q.hasOwnProperty("traceId"))q.traceId=G.bytes===String?W0.base64.encode(Q.traceId,0,Q.traceId.length):G.bytes===Array?Array.prototype.slice.call(Q.traceId):Q.traceId;if(Q.asInt!=null&&Q.hasOwnProperty("asInt")){if(typeof Q.asInt==="number")q.asInt=G.longs===String?String(Q.asInt):Q.asInt;else q.asInt=G.longs===String?W0.Long.prototype.toString.call(Q.asInt):G.longs===Number?new W0.LongBits(Q.asInt.low>>>0,Q.asInt.high>>>0).toNumber():Q.asInt;if(G.oneofs)q.value="asInt"}if(Q.filteredAttributes&&Q.filteredAttributes.length){q.filteredAttributes=[];for(var V=0;V<Q.filteredAttributes.length;++V)q.filteredAttributes[V]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(Q.filteredAttributes[V],G)}return q},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(Q){if(Q===void 0)Q="type.googleapis.com";return Q+"/opentelemetry.proto.metrics.v1.Exemplar"},F}(),H}(),W}(),Z.logs=function(){var W={};return W.v1=function(){var H={};return H.LogsData=function(){function F(X){if(this.resourceLogs=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resourceLogs=W0.emptyArray,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resourceLogs!=null&&J.resourceLogs.length)for(var G=0;G<J.resourceLogs.length;++G)X0.opentelemetry.proto.logs.v1.ResourceLogs.encode(J.resourceLogs[G],Q.uint32(10).fork()).ldelim();return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.LogsData;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{if(!(K.resourceLogs&&K.resourceLogs.length))K.resourceLogs=[];K.resourceLogs.push(X0.opentelemetry.proto.logs.v1.ResourceLogs.decode(J,J.uint32()));break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resourceLogs!=null&&J.hasOwnProperty("resourceLogs")){if(!Array.isArray(J.resourceLogs))return"resourceLogs: array expected";for(var Q=0;Q<J.resourceLogs.length;++Q){var G=X0.opentelemetry.proto.logs.v1.ResourceLogs.verify(J.resourceLogs[Q]);if(G)return"resourceLogs."+G}}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.LogsData)return J;var Q=new X0.opentelemetry.proto.logs.v1.LogsData;if(J.resourceLogs){if(!Array.isArray(J.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");Q.resourceLogs=[];for(var G=0;G<J.resourceLogs.length;++G){if(typeof J.resourceLogs[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");Q.resourceLogs[G]=X0.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(J.resourceLogs[G])}}return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.resourceLogs=[];if(J.resourceLogs&&J.resourceLogs.length){G.resourceLogs=[];for(var q=0;q<J.resourceLogs.length;++q)G.resourceLogs[q]=X0.opentelemetry.proto.logs.v1.ResourceLogs.toObject(J.resourceLogs[q],Q)}return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.LogsData"},F}(),H.ResourceLogs=function(){function F(X){if(this.scopeLogs=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.resource=null,F.prototype.scopeLogs=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.resource!=null&&Object.hasOwnProperty.call(J,"resource"))X0.opentelemetry.proto.resource.v1.Resource.encode(J.resource,Q.uint32(10).fork()).ldelim();if(J.scopeLogs!=null&&J.scopeLogs.length)for(var G=0;G<J.scopeLogs.length;++G)X0.opentelemetry.proto.logs.v1.ScopeLogs.encode(J.scopeLogs[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.ResourceLogs;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.resource=X0.opentelemetry.proto.resource.v1.Resource.decode(J,J.uint32());break}case 2:{if(!(K.scopeLogs&&K.scopeLogs.length))K.scopeLogs=[];K.scopeLogs.push(X0.opentelemetry.proto.logs.v1.ScopeLogs.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.resource!=null&&J.hasOwnProperty("resource")){var Q=X0.opentelemetry.proto.resource.v1.Resource.verify(J.resource);if(Q)return"resource."+Q}if(J.scopeLogs!=null&&J.hasOwnProperty("scopeLogs")){if(!Array.isArray(J.scopeLogs))return"scopeLogs: array expected";for(var G=0;G<J.scopeLogs.length;++G){var Q=X0.opentelemetry.proto.logs.v1.ScopeLogs.verify(J.scopeLogs[G]);if(Q)return"scopeLogs."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.ResourceLogs)return J;var Q=new X0.opentelemetry.proto.logs.v1.ResourceLogs;if(J.resource!=null){if(typeof J.resource!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");Q.resource=X0.opentelemetry.proto.resource.v1.Resource.fromObject(J.resource)}if(J.scopeLogs){if(!Array.isArray(J.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");Q.scopeLogs=[];for(var G=0;G<J.scopeLogs.length;++G){if(typeof J.scopeLogs[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");Q.scopeLogs[G]=X0.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(J.scopeLogs[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.scopeLogs=[];if(Q.defaults)G.resource=null,G.schemaUrl="";if(J.resource!=null&&J.hasOwnProperty("resource"))G.resource=X0.opentelemetry.proto.resource.v1.Resource.toObject(J.resource,Q);if(J.scopeLogs&&J.scopeLogs.length){G.scopeLogs=[];for(var q=0;q<J.scopeLogs.length;++q)G.scopeLogs[q]=X0.opentelemetry.proto.logs.v1.ScopeLogs.toObject(J.scopeLogs[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.ResourceLogs"},F}(),H.ScopeLogs=function(){function F(X){if(this.logRecords=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.scope=null,F.prototype.logRecords=W0.emptyArray,F.prototype.schemaUrl=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.scope!=null&&Object.hasOwnProperty.call(J,"scope"))X0.opentelemetry.proto.common.v1.InstrumentationScope.encode(J.scope,Q.uint32(10).fork()).ldelim();if(J.logRecords!=null&&J.logRecords.length)for(var G=0;G<J.logRecords.length;++G)X0.opentelemetry.proto.logs.v1.LogRecord.encode(J.logRecords[G],Q.uint32(18).fork()).ldelim();if(J.schemaUrl!=null&&Object.hasOwnProperty.call(J,"schemaUrl"))Q.uint32(26).string(J.schemaUrl);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.ScopeLogs;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.decode(J,J.uint32());break}case 2:{if(!(K.logRecords&&K.logRecords.length))K.logRecords=[];K.logRecords.push(X0.opentelemetry.proto.logs.v1.LogRecord.decode(J,J.uint32()));break}case 3:{K.schemaUrl=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.scope!=null&&J.hasOwnProperty("scope")){var Q=X0.opentelemetry.proto.common.v1.InstrumentationScope.verify(J.scope);if(Q)return"scope."+Q}if(J.logRecords!=null&&J.hasOwnProperty("logRecords")){if(!Array.isArray(J.logRecords))return"logRecords: array expected";for(var G=0;G<J.logRecords.length;++G){var Q=X0.opentelemetry.proto.logs.v1.LogRecord.verify(J.logRecords[G]);if(Q)return"logRecords."+Q}}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl")){if(!W0.isString(J.schemaUrl))return"schemaUrl: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.ScopeLogs)return J;var Q=new X0.opentelemetry.proto.logs.v1.ScopeLogs;if(J.scope!=null){if(typeof J.scope!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");Q.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(J.scope)}if(J.logRecords){if(!Array.isArray(J.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");Q.logRecords=[];for(var G=0;G<J.logRecords.length;++G){if(typeof J.logRecords[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");Q.logRecords[G]=X0.opentelemetry.proto.logs.v1.LogRecord.fromObject(J.logRecords[G])}}if(J.schemaUrl!=null)Q.schemaUrl=String(J.schemaUrl);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.logRecords=[];if(Q.defaults)G.scope=null,G.schemaUrl="";if(J.scope!=null&&J.hasOwnProperty("scope"))G.scope=X0.opentelemetry.proto.common.v1.InstrumentationScope.toObject(J.scope,Q);if(J.logRecords&&J.logRecords.length){G.logRecords=[];for(var q=0;q<J.logRecords.length;++q)G.logRecords[q]=X0.opentelemetry.proto.logs.v1.LogRecord.toObject(J.logRecords[q],Q)}if(J.schemaUrl!=null&&J.hasOwnProperty("schemaUrl"))G.schemaUrl=J.schemaUrl;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.ScopeLogs"},F}(),H.SeverityNumber=function(){var F={},X=Object.create(F);return X[F[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,X[F[1]="SEVERITY_NUMBER_TRACE"]=1,X[F[2]="SEVERITY_NUMBER_TRACE2"]=2,X[F[3]="SEVERITY_NUMBER_TRACE3"]=3,X[F[4]="SEVERITY_NUMBER_TRACE4"]=4,X[F[5]="SEVERITY_NUMBER_DEBUG"]=5,X[F[6]="SEVERITY_NUMBER_DEBUG2"]=6,X[F[7]="SEVERITY_NUMBER_DEBUG3"]=7,X[F[8]="SEVERITY_NUMBER_DEBUG4"]=8,X[F[9]="SEVERITY_NUMBER_INFO"]=9,X[F[10]="SEVERITY_NUMBER_INFO2"]=10,X[F[11]="SEVERITY_NUMBER_INFO3"]=11,X[F[12]="SEVERITY_NUMBER_INFO4"]=12,X[F[13]="SEVERITY_NUMBER_WARN"]=13,X[F[14]="SEVERITY_NUMBER_WARN2"]=14,X[F[15]="SEVERITY_NUMBER_WARN3"]=15,X[F[16]="SEVERITY_NUMBER_WARN4"]=16,X[F[17]="SEVERITY_NUMBER_ERROR"]=17,X[F[18]="SEVERITY_NUMBER_ERROR2"]=18,X[F[19]="SEVERITY_NUMBER_ERROR3"]=19,X[F[20]="SEVERITY_NUMBER_ERROR4"]=20,X[F[21]="SEVERITY_NUMBER_FATAL"]=21,X[F[22]="SEVERITY_NUMBER_FATAL2"]=22,X[F[23]="SEVERITY_NUMBER_FATAL3"]=23,X[F[24]="SEVERITY_NUMBER_FATAL4"]=24,X}(),H.LogRecordFlags=function(){var F={},X=Object.create(F);return X[F[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,X[F[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,X}(),H.LogRecord=function(){function F(X){if(this.attributes=[],X){for(var J=Object.keys(X),Q=0;Q<J.length;++Q)if(X[J[Q]]!=null)this[J[Q]]=X[J[Q]]}}return F.prototype.timeUnixNano=null,F.prototype.observedTimeUnixNano=null,F.prototype.severityNumber=null,F.prototype.severityText=null,F.prototype.body=null,F.prototype.attributes=W0.emptyArray,F.prototype.droppedAttributesCount=null,F.prototype.flags=null,F.prototype.traceId=null,F.prototype.spanId=null,F.prototype.eventName=null,F.create=function(J){return new F(J)},F.encode=function(J,Q){if(!Q)Q=u1.create();if(J.timeUnixNano!=null&&Object.hasOwnProperty.call(J,"timeUnixNano"))Q.uint32(9).fixed64(J.timeUnixNano);if(J.severityNumber!=null&&Object.hasOwnProperty.call(J,"severityNumber"))Q.uint32(16).int32(J.severityNumber);if(J.severityText!=null&&Object.hasOwnProperty.call(J,"severityText"))Q.uint32(26).string(J.severityText);if(J.body!=null&&Object.hasOwnProperty.call(J,"body"))X0.opentelemetry.proto.common.v1.AnyValue.encode(J.body,Q.uint32(42).fork()).ldelim();if(J.attributes!=null&&J.attributes.length)for(var G=0;G<J.attributes.length;++G)X0.opentelemetry.proto.common.v1.KeyValue.encode(J.attributes[G],Q.uint32(50).fork()).ldelim();if(J.droppedAttributesCount!=null&&Object.hasOwnProperty.call(J,"droppedAttributesCount"))Q.uint32(56).uint32(J.droppedAttributesCount);if(J.flags!=null&&Object.hasOwnProperty.call(J,"flags"))Q.uint32(69).fixed32(J.flags);if(J.traceId!=null&&Object.hasOwnProperty.call(J,"traceId"))Q.uint32(74).bytes(J.traceId);if(J.spanId!=null&&Object.hasOwnProperty.call(J,"spanId"))Q.uint32(82).bytes(J.spanId);if(J.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(J,"observedTimeUnixNano"))Q.uint32(89).fixed64(J.observedTimeUnixNano);if(J.eventName!=null&&Object.hasOwnProperty.call(J,"eventName"))Q.uint32(98).string(J.eventName);return Q},F.encodeDelimited=function(J,Q){return this.encode(J,Q).ldelim()},F.decode=function(J,Q,G){if(!(J instanceof x0))J=x0.create(J);var q=Q===void 0?J.len:J.pos+Q,K=new X0.opentelemetry.proto.logs.v1.LogRecord;while(J.pos<q){var V=J.uint32();if(V===G)break;switch(V>>>3){case 1:{K.timeUnixNano=J.fixed64();break}case 11:{K.observedTimeUnixNano=J.fixed64();break}case 2:{K.severityNumber=J.int32();break}case 3:{K.severityText=J.string();break}case 5:{K.body=X0.opentelemetry.proto.common.v1.AnyValue.decode(J,J.uint32());break}case 6:{if(!(K.attributes&&K.attributes.length))K.attributes=[];K.attributes.push(X0.opentelemetry.proto.common.v1.KeyValue.decode(J,J.uint32()));break}case 7:{K.droppedAttributesCount=J.uint32();break}case 8:{K.flags=J.fixed32();break}case 9:{K.traceId=J.bytes();break}case 10:{K.spanId=J.bytes();break}case 12:{K.eventName=J.string();break}default:J.skipType(V&7);break}}return K},F.decodeDelimited=function(J){if(!(J instanceof x0))J=new x0(J);return this.decode(J,J.uint32())},F.verify=function(J){if(typeof J!=="object"||J===null)return"object expected";if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano")){if(!W0.isInteger(J.timeUnixNano)&&!(J.timeUnixNano&&W0.isInteger(J.timeUnixNano.low)&&W0.isInteger(J.timeUnixNano.high)))return"timeUnixNano: integer|Long expected"}if(J.observedTimeUnixNano!=null&&J.hasOwnProperty("observedTimeUnixNano")){if(!W0.isInteger(J.observedTimeUnixNano)&&!(J.observedTimeUnixNano&&W0.isInteger(J.observedTimeUnixNano.low)&&W0.isInteger(J.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected"}if(J.severityNumber!=null&&J.hasOwnProperty("severityNumber"))switch(J.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(J.severityText!=null&&J.hasOwnProperty("severityText")){if(!W0.isString(J.severityText))return"severityText: string expected"}if(J.body!=null&&J.hasOwnProperty("body")){var Q=X0.opentelemetry.proto.common.v1.AnyValue.verify(J.body);if(Q)return"body."+Q}if(J.attributes!=null&&J.hasOwnProperty("attributes")){if(!Array.isArray(J.attributes))return"attributes: array expected";for(var G=0;G<J.attributes.length;++G){var Q=X0.opentelemetry.proto.common.v1.KeyValue.verify(J.attributes[G]);if(Q)return"attributes."+Q}}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount")){if(!W0.isInteger(J.droppedAttributesCount))return"droppedAttributesCount: integer expected"}if(J.flags!=null&&J.hasOwnProperty("flags")){if(!W0.isInteger(J.flags))return"flags: integer expected"}if(J.traceId!=null&&J.hasOwnProperty("traceId")){if(!(J.traceId&&typeof J.traceId.length==="number"||W0.isString(J.traceId)))return"traceId: buffer expected"}if(J.spanId!=null&&J.hasOwnProperty("spanId")){if(!(J.spanId&&typeof J.spanId.length==="number"||W0.isString(J.spanId)))return"spanId: buffer expected"}if(J.eventName!=null&&J.hasOwnProperty("eventName")){if(!W0.isString(J.eventName))return"eventName: string expected"}return null},F.fromObject=function(J){if(J instanceof X0.opentelemetry.proto.logs.v1.LogRecord)return J;var Q=new X0.opentelemetry.proto.logs.v1.LogRecord;if(J.timeUnixNano!=null){if(W0.Long)(Q.timeUnixNano=W0.Long.fromValue(J.timeUnixNano)).unsigned=!1;else if(typeof J.timeUnixNano==="string")Q.timeUnixNano=parseInt(J.timeUnixNano,10);else if(typeof J.timeUnixNano==="number")Q.timeUnixNano=J.timeUnixNano;else if(typeof J.timeUnixNano==="object")Q.timeUnixNano=new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber()}if(J.observedTimeUnixNano!=null){if(W0.Long)(Q.observedTimeUnixNano=W0.Long.fromValue(J.observedTimeUnixNano)).unsigned=!1;else if(typeof J.observedTimeUnixNano==="string")Q.observedTimeUnixNano=parseInt(J.observedTimeUnixNano,10);else if(typeof J.observedTimeUnixNano==="number")Q.observedTimeUnixNano=J.observedTimeUnixNano;else if(typeof J.observedTimeUnixNano==="object")Q.observedTimeUnixNano=new W0.LongBits(J.observedTimeUnixNano.low>>>0,J.observedTimeUnixNano.high>>>0).toNumber()}switch(J.severityNumber){default:if(typeof J.severityNumber==="number"){Q.severityNumber=J.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:Q.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:Q.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:Q.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:Q.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:Q.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:Q.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:Q.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:Q.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:Q.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:Q.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:Q.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:Q.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:Q.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:Q.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:Q.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:Q.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:Q.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:Q.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:Q.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:Q.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:Q.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:Q.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:Q.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:Q.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:Q.severityNumber=24;break}if(J.severityText!=null)Q.severityText=String(J.severityText);if(J.body!=null){if(typeof J.body!=="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");Q.body=X0.opentelemetry.proto.common.v1.AnyValue.fromObject(J.body)}if(J.attributes){if(!Array.isArray(J.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");Q.attributes=[];for(var G=0;G<J.attributes.length;++G){if(typeof J.attributes[G]!=="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");Q.attributes[G]=X0.opentelemetry.proto.common.v1.KeyValue.fromObject(J.attributes[G])}}if(J.droppedAttributesCount!=null)Q.droppedAttributesCount=J.droppedAttributesCount>>>0;if(J.flags!=null)Q.flags=J.flags>>>0;if(J.traceId!=null){if(typeof J.traceId==="string")W0.base64.decode(J.traceId,Q.traceId=W0.newBuffer(W0.base64.length(J.traceId)),0);else if(J.traceId.length>=0)Q.traceId=J.traceId}if(J.spanId!=null){if(typeof J.spanId==="string")W0.base64.decode(J.spanId,Q.spanId=W0.newBuffer(W0.base64.length(J.spanId)),0);else if(J.spanId.length>=0)Q.spanId=J.spanId}if(J.eventName!=null)Q.eventName=String(J.eventName);return Q},F.toObject=function(J,Q){if(!Q)Q={};var G={};if(Q.arrays||Q.defaults)G.attributes=[];if(Q.defaults){if(W0.Long){var q=new W0.Long(0,0,!1);G.timeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.timeUnixNano=Q.longs===String?"0":0;if(G.severityNumber=Q.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,G.severityText="",G.body=null,G.droppedAttributesCount=0,G.flags=0,Q.bytes===String)G.traceId="";else if(G.traceId=[],Q.bytes!==Array)G.traceId=W0.newBuffer(G.traceId);if(Q.bytes===String)G.spanId="";else if(G.spanId=[],Q.bytes!==Array)G.spanId=W0.newBuffer(G.spanId);if(W0.Long){var q=new W0.Long(0,0,!1);G.observedTimeUnixNano=Q.longs===String?q.toString():Q.longs===Number?q.toNumber():q}else G.observedTimeUnixNano=Q.longs===String?"0":0;G.eventName=""}if(J.timeUnixNano!=null&&J.hasOwnProperty("timeUnixNano"))if(typeof J.timeUnixNano==="number")G.timeUnixNano=Q.longs===String?String(J.timeUnixNano):J.timeUnixNano;else G.timeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.timeUnixNano):Q.longs===Number?new W0.LongBits(J.timeUnixNano.low>>>0,J.timeUnixNano.high>>>0).toNumber():J.timeUnixNano;if(J.severityNumber!=null&&J.hasOwnProperty("severityNumber"))G.severityNumber=Q.enums===String?X0.opentelemetry.proto.logs.v1.SeverityNumber[J.severityNumber]===void 0?J.severityNumber:X0.opentelemetry.proto.logs.v1.SeverityNumber[J.severityNumber]:J.severityNumber;if(J.severityText!=null&&J.hasOwnProperty("severityText"))G.severityText=J.severityText;if(J.body!=null&&J.hasOwnProperty("body"))G.body=X0.opentelemetry.proto.common.v1.AnyValue.toObject(J.body,Q);if(J.attributes&&J.attributes.length){G.attributes=[];for(var K=0;K<J.attributes.length;++K)G.attributes[K]=X0.opentelemetry.proto.common.v1.KeyValue.toObject(J.attributes[K],Q)}if(J.droppedAttributesCount!=null&&J.hasOwnProperty("droppedAttributesCount"))G.droppedAttributesCount=J.droppedAttributesCount;if(J.flags!=null&&J.hasOwnProperty("flags"))G.flags=J.flags;if(J.traceId!=null&&J.hasOwnProperty("traceId"))G.traceId=Q.bytes===String?W0.base64.encode(J.traceId,0,J.traceId.length):Q.bytes===Array?Array.prototype.slice.call(J.traceId):J.traceId;if(J.spanId!=null&&J.hasOwnProperty("spanId"))G.spanId=Q.bytes===String?W0.base64.encode(J.spanId,0,J.spanId.length):Q.bytes===Array?Array.prototype.slice.call(J.spanId):J.spanId;if(J.observedTimeUnixNano!=null&&J.hasOwnProperty("observedTimeUnixNano"))if(typeof J.observedTimeUnixNano==="number")G.observedTimeUnixNano=Q.longs===String?String(J.observedTimeUnixNano):J.observedTimeUnixNano;else G.observedTimeUnixNano=Q.longs===String?W0.Long.prototype.toString.call(J.observedTimeUnixNano):Q.longs===Number?new W0.LongBits(J.observedTimeUnixNano.low>>>0,J.observedTimeUnixNano.high>>>0).toNumber():J.observedTimeUnixNano;if(J.eventName!=null&&J.hasOwnProperty("eventName"))G.eventName=J.eventName;return G},F.prototype.toJSON=function(){return this.constructor.toObject(this,k1.util.toJSONOptions)},F.getTypeUrl=function(J){if(J===void 0)J="type.googleapis.com";return J+"/opentelemetry.proto.logs.v1.LogRecord"},F}(),H}(),W}(),Z}(),Y}();Tk.exports=X0});var _J=H0((Ck)=>{Object.defineProperty(Ck,"__esModule",{value:!0});Ck.toAnyValue=Ck.toKeyValue=Ck.toAttributes=Ck.createInstrumentationScope=Ck.createResource=void 0;function BV0(Y,Z){let W={attributes:Ik(Y.attributes,Z),droppedAttributesCount:0},H=Y.schemaUrl;if(H&&H!=="")W.schemaUrl=H;return W}Ck.createResource=BV0;function AV0(Y){return{name:Y.name,version:Y.version}}Ck.createInstrumentationScope=AV0;function Ik(Y,Z){return Object.keys(Y).map((W)=>$k(W,Y[W],Z))}Ck.toAttributes=Ik;function $k(Y,Z,W){return{key:Y,value:jJ(Z,W)}}Ck.toKeyValue=$k;function jJ(Y,Z){let W=typeof Y;if(W==="string")return{stringValue:Y};if(W==="number"){if(!Number.isInteger(Y))return{doubleValue:Y};return{intValue:Y}}if(W==="boolean")return{boolValue:Y};if(Y instanceof Uint8Array)return{bytesValue:Z.encodeUint8Array(Y)};if(Array.isArray(Y)){let H=Array(Y.length);for(let F=0;F<Y.length;F++)H[F]=jJ(Y[F],Z);return{arrayValue:{values:H}}}if(W==="object"&&Y!=null){let H=Object.keys(Y),F=Array(H.length);for(let X=0;X<H.length;X++)F[X]={key:H[X],value:jJ(Y[H[X]],Z)};return{kvlistValue:{values:F}}}return{}}Ck.toAnyValue=jJ});var hH=H0((Rk)=>{Object.defineProperty(Rk,"__esModule",{value:!0});Rk.toLogAttributes=Rk.createExportLogsServiceRequest=void 0;var xJ=_J();function TV0(Y,Z){return{resourceLogs:$V0(Y,Z)}}Rk.createExportLogsServiceRequest=TV0;function IV0(Y){let Z=new Map;for(let W of Y){let{resource:H,instrumentationScope:{name:F,version:X="",schemaUrl:J=""}}=W,Q=Z.get(H);if(!Q)Q=new Map,Z.set(H,Q);let G=`${F}@${X}:${J}`,q=Q.get(G);if(!q)q=[],Q.set(G,q);q.push(W)}return Z}function $V0(Y,Z){let W=IV0(Y);return Array.from(W,([H,F])=>{let X=(0,xJ.createResource)(H,Z);return{resource:X,scopeLogs:Array.from(F,([,J])=>{return{scope:(0,xJ.createInstrumentationScope)(J[0].instrumentationScope),logRecords:J.map((Q)=>CV0(Q,Z)),schemaUrl:J[0].instrumentationScope.schemaUrl}}),schemaUrl:X.schemaUrl}})}function CV0(Y,Z){return{timeUnixNano:Z.encodeHrTime(Y.hrTime),observedTimeUnixNano:Z.encodeHrTime(Y.hrTimeObserved),severityNumber:EV0(Y.severityNumber),severityText:Y.severityText,body:(0,xJ.toAnyValue)(Y.body,Z),eventName:Y.eventName,attributes:Mk(Y.attributes,Z),droppedAttributesCount:Y.droppedAttributesCount,flags:Y.spanContext?.traceFlags,traceId:Z.encodeOptionalSpanContext(Y.spanContext?.traceId),spanId:Z.encodeOptionalSpanContext(Y.spanContext?.spanId)}}function EV0(Y){return Y}function Mk(Y,Z){return Object.keys(Y).map((W)=>(0,xJ.toKeyValue)(W,Y[W],Z))}Rk.toLogAttributes=Mk});var fk=H0((wk)=>{Object.defineProperty(wk,"__esModule",{value:!0});wk.hexToBinary=void 0;function Lk(Y){if(Y>=48&&Y<=57)return Y-48;if(Y>=97&&Y<=102)return Y-87;return Y-55}function RV0(Y){let Z=new Uint8Array(Y.length/2),W=0;for(let H=0;H<Y.length;H+=2){let F=Lk(Y.charCodeAt(H)),X=Lk(Y.charCodeAt(H+1));Z[W++]=F<<4|X}return Z}wk.hexToBinary=RV0});var i5=H0((jk)=>{Object.defineProperty(jk,"__esModule",{value:!0});jk.JSON_ENCODER=jk.PROTOBUF_ENCODER=jk.encodeAsString=jk.encodeAsLongBits=jk.toLongBits=jk.hrTimeToNanos=void 0;var PV0=G6(),kk=fk();function _H(Y){let Z=BigInt(1e9);return BigInt(Math.trunc(Y[0]))*Z+BigInt(Math.trunc(Y[1]))}jk.hrTimeToNanos=_H;function yk(Y){let Z=Number(BigInt.asUintN(32,Y)),W=Number(BigInt.asUintN(32,Y>>BigInt(32)));return{low:Z,high:W}}jk.toLongBits=yk;function vk(Y){let Z=_H(Y);return yk(Z)}jk.encodeAsLongBits=vk;function hk(Y){return _H(Y).toString()}jk.encodeAsString=hk;var LV0=typeof BigInt<"u"?hk:PV0.hrTimeToNanoseconds;function jH(Y){return Y}function wV0(Y){if(Y===void 0)return;return(0,kk.hexToBinary)(Y)}jk.PROTOBUF_ENCODER={encodeHrTime:vk,encodeSpanContext:kk.hexToBinary,encodeOptionalSpanContext:wV0,encodeUint8Array:jH};jk.JSON_ENCODER={encodeHrTime:LV0,encodeSpanContext:jH,encodeOptionalSpanContext:jH,encodeUint8Array:(Y)=>{if(typeof Buffer<"u")return Buffer.from(Y).toString("base64");let Z=Array(Y.length);for(let W=0;W<Y.length;W++)Z[W]=String.fromCharCode(Y[W]);return btoa(Z.join(""))}}});var mk=H0((bk)=>{Object.defineProperty(bk,"__esModule",{value:!0});bk.ProtobufLogsSerializer=void 0;var xk=hJ(),hV0=hH(),jV0=i5(),_V0=xk.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,xV0=xk.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;bk.ProtobufLogsSerializer={serializeRequest:(Y)=>{let Z=(0,hV0.createExportLogsServiceRequest)(Y,jV0.PROTOBUF_ENCODER);return xV0.encode(Z).finish()},deserializeResponse:(Y)=>{return _V0.decode(Y)}}});var gk=H0((xH)=>{Object.defineProperty(xH,"__esModule",{value:!0});xH.ProtobufLogsSerializer=void 0;var bV0=mk();Object.defineProperty(xH,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return bV0.ProtobufLogsSerializer}})});var bJ=H0((dk)=>{Object.defineProperty(dk,"__esModule",{value:!0});dk.AggregationTemporality=void 0;var mV0;(function(Y){Y[Y.DELTA=0]="DELTA",Y[Y.CUMULATIVE=1]="CUMULATIVE"})(mV0=dk.AggregationTemporality||(dk.AggregationTemporality={}))});var r4=H0((lk)=>{Object.defineProperty(lk,"__esModule",{value:!0});lk.DataPointType=lk.InstrumentType=void 0;var gV0;(function(Y){Y.COUNTER="COUNTER",Y.GAUGE="GAUGE",Y.HISTOGRAM="HISTOGRAM",Y.UP_DOWN_COUNTER="UP_DOWN_COUNTER",Y.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",Y.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",Y.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(gV0=lk.InstrumentType||(lk.InstrumentType={}));var dV0;(function(Y){Y[Y.HISTOGRAM=0]="HISTOGRAM",Y[Y.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",Y[Y.GAUGE=2]="GAUGE",Y[Y.SUM=3]="SUM"})(dV0=lk.DataPointType||(lk.DataPointType={}))});var p9=H0((nk)=>{Object.defineProperty(nk,"__esModule",{value:!0});nk.equalsCaseInsensitive=nk.binarySearchUB=nk.setEquals=nk.callWithTimeout=nk.TimeoutError=nk.instrumentationScopeId=nk.hashAttributes=void 0;function cV0(Y){let Z=Object.keys(Y);if(Z.length===0)return"";return Z=Z.sort(),JSON.stringify(Z.map((W)=>[W,Y[W]]))}nk.hashAttributes=cV0;function lV0(Y){return`${Y.name}:${Y.version??""}:${Y.schemaUrl??""}`}nk.instrumentationScopeId=lV0;class uJ extends Error{constructor(Y){super(Y);Object.setPrototypeOf(this,uJ.prototype)}}nk.TimeoutError=uJ;function nV0(Y,Z){let W,H=new Promise(function(X,J){W=setTimeout(function(){J(new uJ("Operation timed out."))},Z)});return Promise.race([Y,H]).then((F)=>{return clearTimeout(W),F},(F)=>{throw clearTimeout(W),F})}nk.callWithTimeout=nV0;function pV0(Y,Z){if(Y.size!==Z.size)return!1;for(let W of Y)if(!Z.has(W))return!1;return!0}nk.setEquals=pV0;function iV0(Y,Z){let W=0,H=Y.length-1,F=Y.length;while(H>=W){let X=W+Math.trunc((H-W)/2);if(Y[X]<Z)W=X+1;else F=X,H=X-1}return F}nk.binarySearchUB=iV0;function rV0(Y,Z){return Y.toLowerCase()===Z.toLowerCase()}nk.equalsCaseInsensitive=rV0});var e7=H0((ik)=>{Object.defineProperty(ik,"__esModule",{value:!0});ik.AggregatorKind=void 0;var Zq0;(function(Y){Y[Y.DROP=0]="DROP",Y[Y.SUM=1]="SUM",Y[Y.LAST_VALUE=2]="LAST_VALUE",Y[Y.HISTOGRAM=3]="HISTOGRAM",Y[Y.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(Zq0=ik.AggregatorKind||(ik.AggregatorKind={}))});var tk=H0((ak)=>{Object.defineProperty(ak,"__esModule",{value:!0});ak.DropAggregator=void 0;var Qq0=e7();class rk{kind=Qq0.AggregatorKind.DROP;createAccumulation(){return}merge(Y,Z){return}diff(Y,Z){return}toMetricData(Y,Z,W,H){return}}ak.DropAggregator=rk});var Zy=H0((ek)=>{Object.defineProperty(ek,"__esModule",{value:!0});ek.HistogramAggregator=ek.HistogramAccumulation=void 0;var Xq0=e7(),pZ=r4(),Jq0=p9();function Wq0(Y){let Z=Y.map(()=>0);return Z.push(0),{buckets:{boundaries:Y,counts:Z},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}class iZ{startTime;_boundaries;_recordMinMax;_current;constructor(Y,Z,W=!0,H=Wq0(Z)){this.startTime=Y,this._boundaries=Z,this._recordMinMax=W,this._current=H}record(Y){if(Number.isNaN(Y))return;if(this._current.count+=1,this._current.sum+=Y,this._recordMinMax)this._current.min=Math.min(Y,this._current.min),this._current.max=Math.max(Y,this._current.max),this._current.hasMinMax=!0;let Z=(0,Jq0.binarySearchUB)(this._boundaries,Y);this._current.buckets.counts[Z]+=1}setStartTime(Y){this.startTime=Y}toPointValue(){return this._current}}ek.HistogramAccumulation=iZ;class sk{kind=Xq0.AggregatorKind.HISTOGRAM;_boundaries;_recordMinMax;constructor(Y,Z){this._boundaries=Y,this._recordMinMax=Z}createAccumulation(Y){return new iZ(Y,this._boundaries,this._recordMinMax)}merge(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue(),F=W.buckets.counts,X=H.buckets.counts,J=Array(F.length);for(let q=0;q<F.length;q++)J[q]=F[q]+X[q];let Q=1/0,G=-1/0;if(this._recordMinMax){if(W.hasMinMax&&H.hasMinMax)Q=Math.min(W.min,H.min),G=Math.max(W.max,H.max);else if(W.hasMinMax)Q=W.min,G=W.max;else if(H.hasMinMax)Q=H.min,G=H.max}return new iZ(Y.startTime,W.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:W.buckets.boundaries,counts:J},count:W.count+H.count,sum:W.sum+H.sum,hasMinMax:this._recordMinMax&&(W.hasMinMax||H.hasMinMax),min:Q,max:G})}diff(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue(),F=W.buckets.counts,X=H.buckets.counts,J=Array(F.length);for(let Q=0;Q<F.length;Q++)J[Q]=X[Q]-F[Q];return new iZ(Z.startTime,W.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:W.buckets.boundaries,counts:J},count:H.count-W.count,sum:H.sum-W.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:pZ.DataPointType.HISTOGRAM,dataPoints:W.map(([F,X])=>{let J=X.toPointValue(),Q=Y.type===pZ.InstrumentType.GAUGE||Y.type===pZ.InstrumentType.UP_DOWN_COUNTER||Y.type===pZ.InstrumentType.OBSERVABLE_GAUGE||Y.type===pZ.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:F,startTime:X.startTime,endTime:H,value:{min:J.hasMinMax?J.min:void 0,max:J.hasMinMax?J.max:void 0,sum:!Q?J.sum:void 0,buckets:J.buckets,count:J.count}}})}}}ek.HistogramAggregator=sk});var Jy=H0((Qy)=>{Object.defineProperty(Qy,"__esModule",{value:!0});Qy.Buckets=void 0;class gH{backing;indexBase;indexStart;indexEnd;constructor(Y=new dH,Z=0,W=0,H=0){this.backing=Y,this.indexBase=Z,this.indexStart=W,this.indexEnd=H}get offset(){return this.indexStart}get length(){if(this.backing.length===0)return 0;if(this.indexEnd===this.indexStart&&this.at(0)===0)return 0;return this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(Y,Z)=>this.at(Z))}at(Y){let Z=this.indexBase-this.indexStart;if(Y<Z)Y+=this.backing.length;return Y-=Z,this.backing.countAt(Y)}incrementBucket(Y,Z){this.backing.increment(Y,Z)}decrementBucket(Y,Z){this.backing.decrement(Y,Z)}trim(){for(let Y=0;Y<this.length;Y++)if(this.at(Y)!==0){this.indexStart+=Y;break}else if(Y===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let Y=this.length-1;Y>=0;Y--)if(this.at(Y)!==0){this.indexEnd-=this.length-Y-1;break}this._rotate()}downscale(Y){this._rotate();let Z=1+this.indexEnd-this.indexStart,W=1<<Y,H=0,F=0;for(let X=this.indexStart;X<=this.indexEnd;){let J=X%W;if(J<0)J+=W;for(let Q=J;Q<W&&H<Z;Q++)this._relocateBucket(F,H),H++,X++;F++}this.indexStart>>=Y,this.indexEnd>>=Y,this.indexBase=this.indexStart}clone(){return new gH(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let Y=this.indexBase-this.indexStart;if(Y===0)return;else if(Y>0)this.backing.reverse(0,this.backing.length),this.backing.reverse(0,Y),this.backing.reverse(Y,this.backing.length);else this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+Y);this.indexBase=this.indexStart}_relocateBucket(Y,Z){if(Y===Z)return;this.incrementBucket(Y,this.backing.emptyBucket(Z))}}Qy.Buckets=gH;class dH{_counts;constructor(Y=[0]){this._counts=Y}get length(){return this._counts.length}countAt(Y){return this._counts[Y]}growTo(Y,Z,W){let H=Array(Y).fill(0);H.splice(W,this._counts.length-Z,...this._counts.slice(Z)),H.splice(0,Z,...this._counts.slice(0,Z)),this._counts=H}reverse(Y,Z){let W=Math.floor((Y+Z)/2)-Y;for(let H=0;H<W;H++){let F=this._counts[Y+H];this._counts[Y+H]=this._counts[Z-H-1],this._counts[Z-H-1]=F}}emptyBucket(Y){let Z=this._counts[Y];return this._counts[Y]=0,Z}increment(Y,Z){this._counts[Y]+=Z}decrement(Y,Z){if(this._counts[Y]>=Z)this._counts[Y]-=Z;else this._counts[Y]=0}clone(){return new dH([...this._counts])}}});var lH=H0((Wy)=>{Object.defineProperty(Wy,"__esModule",{value:!0});Wy.getSignificand=Wy.getNormalBase2=Wy.MIN_VALUE=Wy.MAX_NORMAL_EXPONENT=Wy.MIN_NORMAL_EXPONENT=Wy.SIGNIFICAND_WIDTH=void 0;Wy.SIGNIFICAND_WIDTH=52;var Gq0=2146435072,Fq0=1048575,cH=1023;Wy.MIN_NORMAL_EXPONENT=-cH+1;Wy.MAX_NORMAL_EXPONENT=cH;Wy.MIN_VALUE=Math.pow(2,-1022);function Hq0(Y){let Z=new DataView(new ArrayBuffer(8));return Z.setFloat64(0,Y),((Z.getUint32(0)&Gq0)>>20)-cH}Wy.getNormalBase2=Hq0;function Vq0(Y){let Z=new DataView(new ArrayBuffer(8));Z.setFloat64(0,Y);let W=Z.getUint32(0),H=Z.getUint32(4);return(W&Fq0)*Math.pow(2,32)+H}Wy.getSignificand=Vq0});var mJ=H0((Gy)=>{Object.defineProperty(Gy,"__esModule",{value:!0});Gy.nextGreaterSquare=Gy.ldexp=void 0;function Nq0(Y,Z){if(Y===0||Y===Number.POSITIVE_INFINITY||Y===Number.NEGATIVE_INFINITY||Number.isNaN(Y))return Y;return Y*Math.pow(2,Z)}Gy.ldexp=Nq0;function Oq0(Y){return Y--,Y|=Y>>1,Y|=Y>>2,Y|=Y>>4,Y|=Y>>8,Y|=Y>>16,Y++,Y}Gy.nextGreaterSquare=Oq0});var gJ=H0((Vy)=>{Object.defineProperty(Vy,"__esModule",{value:!0});Vy.MappingError=void 0;class Hy extends Error{}Vy.MappingError=Hy});var Ny=H0((Ay)=>{Object.defineProperty(Ay,"__esModule",{value:!0});Ay.ExponentMapping=void 0;var YY=lH(),Tq0=mJ(),zy=gJ();class By{_shift;constructor(Y){this._shift=-Y}mapToIndex(Y){if(Y<YY.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let Z=YY.getNormalBase2(Y),W=this._rightShift(YY.getSignificand(Y)-1,YY.SIGNIFICAND_WIDTH);return Z+W>>this._shift}lowerBoundary(Y){let Z=this._minNormalLowerBoundaryIndex();if(Y<Z)throw new zy.MappingError(`underflow: ${Y} is < minimum lower boundary: ${Z}`);let W=this._maxNormalLowerBoundaryIndex();if(Y>W)throw new zy.MappingError(`overflow: ${Y} is > maximum lower boundary: ${W}`);return Tq0.ldexp(1,Y<<this._shift)}get scale(){if(this._shift===0)return 0;return-this._shift}_minNormalLowerBoundaryIndex(){let Y=YY.MIN_NORMAL_EXPONENT>>this._shift;if(this._shift<2)Y--;return Y}_maxNormalLowerBoundaryIndex(){return YY.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(Y,Z){return Math.floor(Y*Math.pow(2,-Z))}}Ay.ExponentMapping=By});var Cy=H0((Iy)=>{Object.defineProperty(Iy,"__esModule",{value:!0});Iy.LogarithmMapping=void 0;var ZY=lH(),Oy=mJ(),Dy=gJ();class Ty{_scale;_scaleFactor;_inverseFactor;constructor(Y){this._scale=Y,this._scaleFactor=Oy.ldexp(Math.LOG2E,Y),this._inverseFactor=Oy.ldexp(Math.LN2,-Y)}mapToIndex(Y){if(Y<=ZY.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(ZY.getSignificand(Y)===0)return(ZY.getNormalBase2(Y)<<this._scale)-1;let Z=Math.floor(Math.log(Y)*this._scaleFactor),W=this._maxNormalLowerBoundaryIndex();if(Z>=W)return W;return Z}lowerBoundary(Y){let Z=this._maxNormalLowerBoundaryIndex();if(Y>=Z){if(Y===Z)return 2*Math.exp((Y-(1<<this._scale))/this._scaleFactor);throw new Dy.MappingError(`overflow: ${Y} is > maximum lower boundary: ${Z}`)}let W=this._minNormalLowerBoundaryIndex();if(Y<=W){if(Y===W)return ZY.MIN_VALUE;else if(Y===W-1)return Math.exp((Y+(1<<this._scale))/this._scaleFactor)/2;throw new Dy.MappingError(`overflow: ${Y} is < minimum lower boundary: ${W}`)}return Math.exp(Y*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return ZY.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(ZY.MAX_NORMAL_EXPONENT+1<<this._scale)-1}}Iy.LogarithmMapping=Ty});var Ly=H0((Ry)=>{Object.defineProperty(Ry,"__esModule",{value:!0});Ry.getMapping=void 0;var Iq0=Ny(),$q0=Cy(),Cq0=gJ(),Ey=-10,My=20,Eq0=Array.from({length:31},(Y,Z)=>{if(Z>10)return new $q0.LogarithmMapping(Z-10);return new Iq0.ExponentMapping(Z-10)});function Mq0(Y){if(Y>My||Y<Ey)throw new Cq0.MappingError(`expected scale >= ${Ey} && <= ${My}, got: ${Y}`);return Eq0[Y+10]}Ry.getMapping=Mq0});var vy=H0((ky)=>{Object.defineProperty(ky,"__esModule",{value:!0});ky.ExponentialHistogramAggregator=ky.ExponentialHistogramAccumulation=void 0;var Rq0=e7(),rZ=r4(),Pq0=f1(),wy=Jy(),Sy=Ly(),Lq0=mJ();class QY{static combine(Y,Z){return new QY(Math.min(Y.low,Z.low),Math.max(Y.high,Z.high))}low;high;constructor(Y,Z){this.low=Y,this.high=Z}}var wq0=20,Sq0=160,nH=2;class dJ{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(Y,Z=Sq0,W=!0,H=0,F=0,X=0,J=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,G=new wy.Buckets,q=new wy.Buckets,K=(0,Sy.getMapping)(wq0)){if(this.startTime=Y,this._maxSize=Z,this._recordMinMax=W,this._sum=H,this._count=F,this._zeroCount=X,this._min=J,this._max=Q,this._positive=G,this._negative=q,this._mapping=K,this._maxSize<nH)Pq0.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${nH}`),this._maxSize=nH}record(Y){this.updateByIncrement(Y,1)}setStartTime(Y){this.startTime=Y}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(){if(this._count===this._zeroCount)return 0;return this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(Y,Z){if(Number.isNaN(Y))return;if(Y>this._max)this._max=Y;if(Y<this._min)this._min=Y;if(this._count+=Z,Y===0){this._zeroCount+=Z;return}if(this._sum+=Y*Z,Y>0)this._updateBuckets(this._positive,Y,Z);else this._updateBuckets(this._negative,-Y,Z)}merge(Y){if(this._count===0)this._min=Y.min,this._max=Y.max;else if(Y.count!==0){if(Y.min<this.min)this._min=Y.min;if(Y.max>this.max)this._max=Y.max}this.startTime=Y.startTime,this._sum+=Y.sum,this._count+=Y.count,this._zeroCount+=Y.zeroCount;let Z=this._minScale(Y);this._downscale(this.scale-Z),this._mergeBuckets(this.positive,Y,Y.positive,Z),this._mergeBuckets(this.negative,Y,Y.negative,Z)}diff(Y){this._min=1/0,this._max=-1/0,this._sum-=Y.sum,this._count-=Y.count,this._zeroCount-=Y.zeroCount;let Z=this._minScale(Y);this._downscale(this.scale-Z),this._diffBuckets(this.positive,Y,Y.positive,Z),this._diffBuckets(this.negative,Y,Y.negative,Z)}clone(){return new dJ(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(Y,Z,W){let H=this._mapping.mapToIndex(Z),F=!1,X=0,J=0;if(Y.length===0)Y.indexStart=H,Y.indexEnd=Y.indexStart,Y.indexBase=Y.indexStart;else if(H<Y.indexStart&&Y.indexEnd-H>=this._maxSize)F=!0,J=H,X=Y.indexEnd;else if(H>Y.indexEnd&&H-Y.indexStart>=this._maxSize)F=!0,J=Y.indexStart,X=H;if(F){let Q=this._changeScale(X,J);this._downscale(Q),H=this._mapping.mapToIndex(Z)}this._incrementIndexBy(Y,H,W)}_incrementIndexBy(Y,Z,W){if(W===0)return;if(Y.length===0)Y.indexStart=Y.indexEnd=Y.indexBase=Z;if(Z<Y.indexStart){let F=Y.indexEnd-Z;if(F>=Y.backing.length)this._grow(Y,F+1);Y.indexStart=Z}else if(Z>Y.indexEnd){let F=Z-Y.indexStart;if(F>=Y.backing.length)this._grow(Y,F+1);Y.indexEnd=Z}let H=Z-Y.indexBase;if(H<0)H+=Y.backing.length;Y.incrementBucket(H,W)}_grow(Y,Z){let W=Y.backing.length,H=Y.indexBase-Y.indexStart,F=W-H,X=(0,Lq0.nextGreaterSquare)(Z);if(X>this._maxSize)X=this._maxSize;let J=X-H;Y.backing.growTo(X,F,J)}_changeScale(Y,Z){let W=0;while(Y-Z>=this._maxSize)Y>>=1,Z>>=1,W++;return W}_downscale(Y){if(Y===0)return;if(Y<0)throw Error(`impossible change of scale: ${this.scale}`);let Z=this._mapping.scale-Y;this._positive.downscale(Y),this._negative.downscale(Y),this._mapping=(0,Sy.getMapping)(Z)}_minScale(Y){let Z=Math.min(this.scale,Y.scale),W=QY.combine(this._highLowAtScale(this.positive,this.scale,Z),this._highLowAtScale(Y.positive,Y.scale,Z)),H=QY.combine(this._highLowAtScale(this.negative,this.scale,Z),this._highLowAtScale(Y.negative,Y.scale,Z));return Math.min(Z-this._changeScale(W.high,W.low),Z-this._changeScale(H.high,H.low))}_highLowAtScale(Y,Z,W){if(Y.length===0)return new QY(0,-1);let H=Z-W;return new QY(Y.indexStart>>H,Y.indexEnd>>H)}_mergeBuckets(Y,Z,W,H){let F=W.offset,X=Z.scale-H;for(let J=0;J<W.length;J++)this._incrementIndexBy(Y,F+J>>X,W.at(J))}_diffBuckets(Y,Z,W,H){let F=W.offset,X=Z.scale-H;for(let J=0;J<W.length;J++){let G=(F+J>>X)-Y.indexBase;if(G<0)G+=Y.backing.length;Y.decrementBucket(G,W.at(J))}Y.trim()}}ky.ExponentialHistogramAccumulation=dJ;class fy{kind=Rq0.AggregatorKind.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(Y,Z){this._maxSize=Y,this._recordMinMax=Z}createAccumulation(Y){return new dJ(Y,this._maxSize,this._recordMinMax)}merge(Y,Z){let W=Z.clone();return W.merge(Y),W}diff(Y,Z){let W=Z.clone();return W.diff(Y),W}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:rZ.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:W.map(([F,X])=>{let J=X.toPointValue(),Q=Y.type===rZ.InstrumentType.GAUGE||Y.type===rZ.InstrumentType.UP_DOWN_COUNTER||Y.type===rZ.InstrumentType.OBSERVABLE_GAUGE||Y.type===rZ.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:F,startTime:X.startTime,endTime:H,value:{min:J.hasMinMax?J.min:void 0,max:J.hasMinMax?J.max:void 0,sum:!Q?J.sum:void 0,positive:{offset:J.positive.offset,bucketCounts:J.positive.bucketCounts},negative:{offset:J.negative.offset,bucketCounts:J.negative.bucketCounts},count:J.count,scale:J.scale,zeroCount:J.zeroCount}}})}}}ky.ExponentialHistogramAggregator=fy});var xy=H0((jy)=>{Object.defineProperty(jy,"__esModule",{value:!0});jy.LastValueAggregator=jy.LastValueAccumulation=void 0;var kq0=e7(),aZ=G6(),yq0=r4();class oZ{startTime;_current;sampleTime;constructor(Y,Z=0,W=[0,0]){this.startTime=Y,this._current=Z,this.sampleTime=W}record(Y){this._current=Y,this.sampleTime=(0,aZ.millisToHrTime)(Date.now())}setStartTime(Y){this.startTime=Y}toPointValue(){return this._current}}jy.LastValueAccumulation=oZ;class hy{kind=kq0.AggregatorKind.LAST_VALUE;createAccumulation(Y){return new oZ(Y)}merge(Y,Z){let W=(0,aZ.hrTimeToMicroseconds)(Z.sampleTime)>=(0,aZ.hrTimeToMicroseconds)(Y.sampleTime)?Z:Y;return new oZ(Y.startTime,W.toPointValue(),W.sampleTime)}diff(Y,Z){let W=(0,aZ.hrTimeToMicroseconds)(Z.sampleTime)>=(0,aZ.hrTimeToMicroseconds)(Y.sampleTime)?Z:Y;return new oZ(Z.startTime,W.toPointValue(),W.sampleTime)}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:yq0.DataPointType.GAUGE,dataPoints:W.map(([F,X])=>{return{attributes:F,startTime:X.startTime,endTime:H,value:X.toPointValue()}})}}}jy.LastValueAggregator=hy});var gy=H0((uy)=>{Object.defineProperty(uy,"__esModule",{value:!0});uy.SumAggregator=uy.SumAccumulation=void 0;var hq0=e7(),jq0=r4();class r5{startTime;monotonic;_current;reset;constructor(Y,Z,W=0,H=!1){this.startTime=Y,this.monotonic=Z,this._current=W,this.reset=H}record(Y){if(this.monotonic&&Y<0)return;this._current+=Y}setStartTime(Y){this.startTime=Y}toPointValue(){return this._current}}uy.SumAccumulation=r5;class by{kind=hq0.AggregatorKind.SUM;monotonic;constructor(Y){this.monotonic=Y}createAccumulation(Y){return new r5(Y,this.monotonic)}merge(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue();if(Z.reset)return new r5(Z.startTime,this.monotonic,H,Z.reset);return new r5(Y.startTime,this.monotonic,W+H)}diff(Y,Z){let W=Y.toPointValue(),H=Z.toPointValue();if(this.monotonic&&W>H)return new r5(Z.startTime,this.monotonic,H,!0);return new r5(Z.startTime,this.monotonic,H-W)}toMetricData(Y,Z,W,H){return{descriptor:Y,aggregationTemporality:Z,dataPointType:jq0.DataPointType.SUM,dataPoints:W.map(([F,X])=>{return{attributes:F,startTime:X.startTime,endTime:H,value:X.toPointValue()}}),isMonotonic:this.monotonic}}}uy.SumAggregator=by});var py=H0((P9)=>{Object.defineProperty(P9,"__esModule",{value:!0});P9.SumAggregator=P9.SumAccumulation=P9.LastValueAggregator=P9.LastValueAccumulation=P9.ExponentialHistogramAggregator=P9.ExponentialHistogramAccumulation=P9.HistogramAggregator=P9.HistogramAccumulation=P9.DropAggregator=void 0;var xq0=tk();Object.defineProperty(P9,"DropAggregator",{enumerable:!0,get:function(){return xq0.DropAggregator}});var dy=Zy();Object.defineProperty(P9,"HistogramAccumulation",{enumerable:!0,get:function(){return dy.HistogramAccumulation}});Object.defineProperty(P9,"HistogramAggregator",{enumerable:!0,get:function(){return dy.HistogramAggregator}});var cy=vy();Object.defineProperty(P9,"ExponentialHistogramAccumulation",{enumerable:!0,get:function(){return cy.ExponentialHistogramAccumulation}});Object.defineProperty(P9,"ExponentialHistogramAggregator",{enumerable:!0,get:function(){return cy.ExponentialHistogramAggregator}});var ly=xy();Object.defineProperty(P9,"LastValueAccumulation",{enumerable:!0,get:function(){return ly.LastValueAccumulation}});Object.defineProperty(P9,"LastValueAggregator",{enumerable:!0,get:function(){return ly.LastValueAggregator}});var ny=gy();Object.defineProperty(P9,"SumAccumulation",{enumerable:!0,get:function(){return ny.SumAccumulation}});Object.defineProperty(P9,"SumAggregator",{enumerable:!0,get:function(){return ny.SumAggregator}})});var ey=H0((iy)=>{Object.defineProperty(iy,"__esModule",{value:!0});iy.DEFAULT_AGGREGATION=iy.EXPONENTIAL_HISTOGRAM_AGGREGATION=iy.HISTOGRAM_AGGREGATION=iy.LAST_VALUE_AGGREGATION=iy.SUM_AGGREGATION=iy.DROP_AGGREGATION=iy.DefaultAggregation=iy.ExponentialHistogramAggregation=iy.ExplicitBucketHistogramAggregation=iy.HistogramAggregation=iy.LastValueAggregation=iy.SumAggregation=iy.DropAggregation=void 0;var uq0=f1(),a5=py(),i9=r4();class cJ{static DEFAULT_INSTANCE=new a5.DropAggregator;createAggregator(Y){return cJ.DEFAULT_INSTANCE}}iy.DropAggregation=cJ;class tZ{static MONOTONIC_INSTANCE=new a5.SumAggregator(!0);static NON_MONOTONIC_INSTANCE=new a5.SumAggregator(!1);createAggregator(Y){switch(Y.type){case i9.InstrumentType.COUNTER:case i9.InstrumentType.OBSERVABLE_COUNTER:case i9.InstrumentType.HISTOGRAM:return tZ.MONOTONIC_INSTANCE;default:return tZ.NON_MONOTONIC_INSTANCE}}}iy.SumAggregation=tZ;class lJ{static DEFAULT_INSTANCE=new a5.LastValueAggregator;createAggregator(Y){return lJ.DEFAULT_INSTANCE}}iy.LastValueAggregation=lJ;class nJ{static DEFAULT_INSTANCE=new a5.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1000,2500,5000,7500,1e4],!0);createAggregator(Y){return nJ.DEFAULT_INSTANCE}}iy.HistogramAggregation=nJ;class pH{_boundaries;_recordMinMax;constructor(Y,Z=!0){if(Y==null)throw Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");Y=Y.concat(),Y=Y.sort((F,X)=>F-X);let W=Y.lastIndexOf(-1/0),H=Y.indexOf(1/0);if(H===-1)H=void 0;this._boundaries=Y.slice(W+1,H),this._recordMinMax=Z}createAggregator(Y){return new a5.HistogramAggregator(this._boundaries,this._recordMinMax)}}iy.ExplicitBucketHistogramAggregation=pH;class iH{_maxSize;_recordMinMax;constructor(Y=160,Z=!0){this._maxSize=Y,this._recordMinMax=Z}createAggregator(Y){return new a5.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}}iy.ExponentialHistogramAggregation=iH;class rH{_resolve(Y){switch(Y.type){case i9.InstrumentType.COUNTER:case i9.InstrumentType.UP_DOWN_COUNTER:case i9.InstrumentType.OBSERVABLE_COUNTER:case i9.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return iy.SUM_AGGREGATION;case i9.InstrumentType.GAUGE:case i9.InstrumentType.OBSERVABLE_GAUGE:return iy.LAST_VALUE_AGGREGATION;case i9.InstrumentType.HISTOGRAM:{if(Y.advice.explicitBucketBoundaries)return new pH(Y.advice.explicitBucketBoundaries);return iy.HISTOGRAM_AGGREGATION}}return uq0.diag.warn(`Unable to recognize instrument type: ${Y.type}`),iy.DROP_AGGREGATION}createAggregator(Y){return this._resolve(Y).createAggregator(Y)}}iy.DefaultAggregation=rH;iy.DROP_AGGREGATION=new cJ;iy.SUM_AGGREGATION=new tZ;iy.LAST_VALUE_AGGREGATION=new lJ;iy.HISTOGRAM_AGGREGATION=new nJ;iy.EXPONENTIAL_HISTOGRAM_AGGREGATION=new iH;iy.DEFAULT_AGGREGATION=new rH});var sZ=H0((Zv)=>{Object.defineProperty(Zv,"__esModule",{value:!0});Zv.toAggregation=Zv.AggregationType=void 0;var o5=ey(),t5;(function(Y){Y[Y.DEFAULT=0]="DEFAULT",Y[Y.DROP=1]="DROP",Y[Y.SUM=2]="SUM",Y[Y.LAST_VALUE=3]="LAST_VALUE",Y[Y.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",Y[Y.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(t5=Zv.AggregationType||(Zv.AggregationType={}));function rq0(Y){switch(Y.type){case t5.DEFAULT:return o5.DEFAULT_AGGREGATION;case t5.DROP:return o5.DROP_AGGREGATION;case t5.SUM:return o5.SUM_AGGREGATION;case t5.LAST_VALUE:return o5.LAST_VALUE_AGGREGATION;case t5.EXPONENTIAL_HISTOGRAM:{let Z=Y;return new o5.ExponentialHistogramAggregation(Z.options?.maxSize,Z.options?.recordMinMax)}case t5.EXPLICIT_BUCKET_HISTOGRAM:{let Z=Y;if(Z.options==null)return o5.HISTOGRAM_AGGREGATION;else return new o5.ExplicitBucketHistogramAggregation(Z.options?.boundaries,Z.options?.recordMinMax)}default:throw Error("Unsupported Aggregation")}}Zv.toAggregation=rq0});var aH=H0((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});Xv.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Xv.DEFAULT_AGGREGATION_SELECTOR=void 0;var aq0=bJ(),oq0=sZ(),tq0=(Y)=>{return{type:oq0.AggregationType.DEFAULT}};Xv.DEFAULT_AGGREGATION_SELECTOR=tq0;var sq0=(Y)=>aq0.AggregationTemporality.CUMULATIVE;Xv.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=sq0});var oH=H0((Hv)=>{Object.defineProperty(Hv,"__esModule",{value:!0});Hv.MetricReader=void 0;var Wv=f1(),Kv=p9(),Gv=aH();class Fv{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(Y){this._aggregationSelector=Y?.aggregationSelector??Gv.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=Y?.aggregationTemporalitySelector??Gv.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=Y?.metricProducers??[],this._cardinalitySelector=Y?.cardinalitySelector}setMetricProducer(Y){if(this._sdkMetricProducer)throw Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=Y,this.onInitialized()}selectAggregation(Y){return this._aggregationSelector(Y)}selectAggregationTemporality(Y){return this._aggregationTemporalitySelector(Y)}selectCardinalityLimit(Y){return this._cardinalitySelector?this._cardinalitySelector(Y):2000}onInitialized(){}async collect(Y){if(this._sdkMetricProducer===void 0)throw Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw Error("MetricReader is shutdown");let[Z,...W]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:Y?.timeoutMillis}),...this._metricProducers.map((J)=>J.collect({timeoutMillis:Y?.timeoutMillis}))]),H=Z.errors.concat(W.flatMap((J)=>J.errors)),F=Z.resourceMetrics.resource,X=Z.resourceMetrics.scopeMetrics.concat(W.flatMap((J)=>J.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:F,scopeMetrics:X},errors:H}}async shutdown(Y){if(this._shutdown){Wv.diag.error("Cannot call shutdown twice.");return}if(Y?.timeoutMillis==null)await this.onShutdown();else await(0,Kv.callWithTimeout)(this.onShutdown(),Y.timeoutMillis);this._shutdown=!0}async forceFlush(Y){if(this._shutdown){Wv.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(Y?.timeoutMillis==null){await this.onForceFlush();return}await(0,Kv.callWithTimeout)(this.onForceFlush(),Y.timeoutMillis)}}Hv.MetricReader=Fv});var Uv=H0((Bv)=>{Object.defineProperty(Bv,"__esModule",{value:!0});Bv.PeriodicExportingMetricReader=void 0;var pJ=f1(),iJ=G6(),Yz0=oH(),qv=p9();class zv extends Yz0.MetricReader{_interval;_exporter;_exportInterval;_exportTimeout;constructor(Y){let{exporter:Z,exportIntervalMillis:W=60000,metricProducers:H}=Y,{exportTimeoutMillis:F=30000}=Y;super({aggregationSelector:Z.selectAggregation?.bind(Z),aggregationTemporalitySelector:Z.selectAggregationTemporality?.bind(Z),metricProducers:H});if(W<=0)throw Error("exportIntervalMillis must be greater than 0");if(F<=0)throw Error("exportTimeoutMillis must be greater than 0");if(W<F)if("exportIntervalMillis"in Y&&"exportTimeoutMillis"in Y)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");else pJ.diag.info(`Timeout of ${F} exceeds the interval of ${W}. Clamping timeout to interval duration.`),F=W;this._exportInterval=W,this._exportTimeout=F,this._exporter=Z}async _runOnce(){try{await(0,qv.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(Y){if(Y instanceof qv.TimeoutError){pJ.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,iJ.globalErrorHandler)(Y)}}async _doRun(){let{resourceMetrics:Y,errors:Z}=await this.collect({timeoutMillis:this._exportTimeout});if(Z.length>0)pJ.diag.error("PeriodicExportingMetricReader: metrics collection errors",...Z);if(Y.resource.asyncAttributesPending)try{await Y.resource.waitForAsyncAttributes?.()}catch(H){pJ.diag.debug("Error while resolving async portion of resource: ",H),(0,iJ.globalErrorHandler)(H)}if(Y.scopeMetrics.length===0)return;let W=await iJ.internal._export(this._exporter,Y);if(W.code!==iJ.ExportResultCode.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${W.error})`)}onInitialized(){if(this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=="number")this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){if(this._interval)clearInterval(this._interval);await this.onForceFlush(),await this._exporter.shutdown()}}Bv.PeriodicExportingMetricReader=zv});var Iv=H0((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});Dv.InMemoryMetricExporter=void 0;var Nv=G6();class Ov{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(Y){this._aggregationTemporality=Y}export(Y,Z){if(this._shutdown){setTimeout(()=>Z({code:Nv.ExportResultCode.FAILED}),0);return}this._metrics.push(Y),setTimeout(()=>Z({code:Nv.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(Y){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}Dv.InMemoryMetricExporter=Ov});var Mv=H0((Cv)=>{Object.defineProperty(Cv,"__esModule",{value:!0});Cv.ConsoleMetricExporter=void 0;var $v=G6(),Zz0=aH();class tH{_shutdown=!1;_temporalitySelector;constructor(Y){this._temporalitySelector=Y?.temporalitySelector??Zz0.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(Y,Z){if(this._shutdown){Z({code:$v.ExportResultCode.FAILED});return}return tH._sendMetrics(Y,Z)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(Y){return this._temporalitySelector(Y)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(Y,Z){for(let W of Y.scopeMetrics)for(let H of W.metrics)console.dir({descriptor:H.descriptor,dataPointType:H.dataPointType,dataPoints:H.dataPoints},{depth:null});Z({code:$v.ExportResultCode.SUCCESS})}}Cv.ConsoleMetricExporter=tH});var sH=H0((Rv)=>{Object.defineProperty(Rv,"__esModule",{value:!0});Rv._clearDefaultServiceNameCache=Rv.defaultServiceName=void 0;var eZ;function Qz0(){if(eZ===void 0)try{let Y=globalThis.process.argv0;eZ=Y?`unknown_service:${Y}`:"unknown_service"}catch{eZ="unknown_service"}return eZ}Rv.defaultServiceName=Qz0;function Xz0(){eZ=void 0}Rv._clearDefaultServiceNameCache=Xz0});var Sv=H0((Lv)=>{Object.defineProperty(Lv,"__esModule",{value:!0});Lv.isPromiseLike=void 0;var Wz0=(Y)=>{return Y!==null&&typeof Y==="object"&&typeof Y.then==="function"};Lv.isPromiseLike=Wz0});var ZV=H0((kv)=>{Object.defineProperty(kv,"__esModule",{value:!0});kv.defaultResource=kv.emptyResource=kv.resourceFromDetectedResource=kv.resourceFromAttributes=void 0;var ZQ=f1(),eH=G6(),s5=m5(),Kz0=sH(),YQ=Sv();class QQ{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(Y,Z){let W=new QQ({},Z);return W._rawAttributes=fv(Y),W._asyncAttributesPending=Y.filter(([H,F])=>(0,YQ.isPromiseLike)(F)).length>0,W}constructor(Y,Z){let W=Y.attributes??{};this._rawAttributes=Object.entries(W).map(([H,F])=>{if((0,YQ.isPromiseLike)(F))this._asyncAttributesPending=!0;return[H,F]}),this._rawAttributes=fv(this._rawAttributes),this._schemaUrl=Vz0(Z?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(!this.asyncAttributesPending)return;for(let Y=0;Y<this._rawAttributes.length;Y++){let[Z,W]=this._rawAttributes[Y];this._rawAttributes[Y]=[Z,(0,YQ.isPromiseLike)(W)?await W:W]}this._asyncAttributesPending=!1}get attributes(){if(this.asyncAttributesPending)ZQ.diag.error("Accessing resource attributes before async attributes settled");if(this._memoizedAttributes)return this._memoizedAttributes;let Y={};for(let[Z,W]of this._rawAttributes){if((0,YQ.isPromiseLike)(W)){ZQ.diag.debug(`Unsettled resource attribute ${Z} skipped`);continue}if(W!=null)Y[Z]??=W}if(!this._asyncAttributesPending)this._memoizedAttributes=Y;return Y}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(Y){if(Y==null)return this;let Z=qz0(this,Y),W=Z?{schemaUrl:Z}:void 0;return QQ.FromAttributeList([...Y.getRawAttributes(),...this.getRawAttributes()],W)}}function YV(Y,Z){return QQ.FromAttributeList(Object.entries(Y),Z)}kv.resourceFromAttributes=YV;function Gz0(Y,Z){return new QQ(Y,Z)}kv.resourceFromDetectedResource=Gz0;function Fz0(){return YV({})}kv.emptyResource=Fz0;function Hz0(){return YV({[s5.ATTR_SERVICE_NAME]:(0,Kz0.defaultServiceName)(),[s5.ATTR_TELEMETRY_SDK_LANGUAGE]:eH.SDK_INFO[s5.ATTR_TELEMETRY_SDK_LANGUAGE],[s5.ATTR_TELEMETRY_SDK_NAME]:eH.SDK_INFO[s5.ATTR_TELEMETRY_SDK_NAME],[s5.ATTR_TELEMETRY_SDK_VERSION]:eH.SDK_INFO[s5.ATTR_TELEMETRY_SDK_VERSION]})}kv.defaultResource=Hz0;function fv(Y){return Y.map(([Z,W])=>{if((0,YQ.isPromiseLike)(W))return[Z,W.catch((H)=>{ZQ.diag.debug("promise rejection for resource attribute: %s - %s",Z,H);return})];return[Z,W]})}function Vz0(Y){if(typeof Y==="string"||Y===void 0)return Y;ZQ.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",Y);return}function qz0(Y,Z){let W=Y?.schemaUrl,H=Z?.schemaUrl,F=W===void 0||W==="",X=H===void 0||H==="";if(F)return H;if(X)return W;if(W===H)return W;ZQ.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',W,H);return}});var _v=H0((hv)=>{Object.defineProperty(hv,"__esModule",{value:!0});hv.detectResources=void 0;var vv=f1(),QV=ZV(),Uz0=(Y={})=>{return(Y.detectors||[]).map((W)=>{try{let H=(0,QV.resourceFromDetectedResource)(W.detect(Y));return vv.diag.debug(`${W.constructor.name} found resource.`,H),H}catch(H){return vv.diag.debug(`${W.constructor.name} failed: ${H.message}`),(0,QV.emptyResource)()}}).reduce((W,H)=>W.merge(H),(0,QV.emptyResource)())};hv.detectResources=Uz0});var gv=H0((uv)=>{Object.defineProperty(uv,"__esModule",{value:!0});uv.envDetector=void 0;var Nz0=f1(),Oz0=m5(),xv=G6();class bv{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";detect(Y){let Z={},W=(0,xv.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),H=(0,xv.getStringFromEnv)("OTEL_SERVICE_NAME");if(W)try{let F=this._parseResourceAttributes(W);Object.assign(Z,F)}catch(F){Nz0.diag.debug(`EnvDetector failed: ${F instanceof Error?F.message:F}`)}if(H)Z[Oz0.ATTR_SERVICE_NAME]=H;return{attributes:Z}}_parseResourceAttributes(Y){if(!Y)return{};let Z={},W=Y.split(this._COMMA_SEPARATOR);for(let H of W){let F=H.split(this._LABEL_KEY_VALUE_SPLITTER);if(F.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${H}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[X,J]=F,Q=X.trim(),G=J.trim();if(Q.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${H}".`);let q,K;try{q=decodeURIComponent(Q),K=decodeURIComponent(G)}catch(V){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${H}": ${V instanceof Error?V.message:V}`)}if(q.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${q}".`);if(K.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${q}".`);Z[q]=K}return Z}}uv.envDetector=new bv});var XQ=H0((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});dv.ATTR_WEBENGINE_VERSION=dv.ATTR_WEBENGINE_NAME=dv.ATTR_WEBENGINE_DESCRIPTION=dv.ATTR_SERVICE_NAMESPACE=dv.ATTR_SERVICE_INSTANCE_ID=dv.ATTR_PROCESS_RUNTIME_VERSION=dv.ATTR_PROCESS_RUNTIME_NAME=dv.ATTR_PROCESS_RUNTIME_DESCRIPTION=dv.ATTR_PROCESS_PID=dv.ATTR_PROCESS_OWNER=dv.ATTR_PROCESS_EXECUTABLE_PATH=dv.ATTR_PROCESS_EXECUTABLE_NAME=dv.ATTR_PROCESS_COMMAND_ARGS=dv.ATTR_PROCESS_COMMAND=dv.ATTR_OS_VERSION=dv.ATTR_OS_TYPE=dv.ATTR_K8S_POD_NAME=dv.ATTR_K8S_NAMESPACE_NAME=dv.ATTR_K8S_DEPLOYMENT_NAME=dv.ATTR_K8S_CLUSTER_NAME=dv.ATTR_HOST_TYPE=dv.ATTR_HOST_NAME=dv.ATTR_HOST_IMAGE_VERSION=dv.ATTR_HOST_IMAGE_NAME=dv.ATTR_HOST_IMAGE_ID=dv.ATTR_HOST_ID=dv.ATTR_HOST_ARCH=dv.ATTR_CONTAINER_NAME=dv.ATTR_CONTAINER_IMAGE_TAGS=dv.ATTR_CONTAINER_IMAGE_NAME=dv.ATTR_CONTAINER_ID=dv.ATTR_CLOUD_REGION=dv.ATTR_CLOUD_PROVIDER=dv.ATTR_CLOUD_AVAILABILITY_ZONE=dv.ATTR_CLOUD_ACCOUNT_ID=void 0;dv.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";dv.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";dv.ATTR_CLOUD_PROVIDER="cloud.provider";dv.ATTR_CLOUD_REGION="cloud.region";dv.ATTR_CONTAINER_ID="container.id";dv.ATTR_CONTAINER_IMAGE_NAME="container.image.name";dv.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";dv.ATTR_CONTAINER_NAME="container.name";dv.ATTR_HOST_ARCH="host.arch";dv.ATTR_HOST_ID="host.id";dv.ATTR_HOST_IMAGE_ID="host.image.id";dv.ATTR_HOST_IMAGE_NAME="host.image.name";dv.ATTR_HOST_IMAGE_VERSION="host.image.version";dv.ATTR_HOST_NAME="host.name";dv.ATTR_HOST_TYPE="host.type";dv.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";dv.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";dv.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";dv.ATTR_K8S_POD_NAME="k8s.pod.name";dv.ATTR_OS_TYPE="os.type";dv.ATTR_OS_VERSION="os.version";dv.ATTR_PROCESS_COMMAND="process.command";dv.ATTR_PROCESS_COMMAND_ARGS="process.command_args";dv.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";dv.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";dv.ATTR_PROCESS_OWNER="process.owner";dv.ATTR_PROCESS_PID="process.pid";dv.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";dv.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";dv.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";dv.ATTR_SERVICE_INSTANCE_ID="service.instance.id";dv.ATTR_SERVICE_NAMESPACE="service.namespace";dv.ATTR_WEBENGINE_DESCRIPTION="webengine.description";dv.ATTR_WEBENGINE_NAME="webengine.name";dv.ATTR_WEBENGINE_VERSION="webengine.version"});var rJ=H0((lv)=>{Object.defineProperty(lv,"__esModule",{value:!0});lv.execAsync=void 0;var sz0=V1("child_process"),ez0=V1("util");lv.execAsync=ez0.promisify(sz0.exec)});var rv=H0((pv)=>{Object.defineProperty(pv,"__esModule",{value:!0});pv.getMachineId=void 0;var YB0=rJ(),ZB0=f1();async function QB0(){try{let Z=(await(0,YB0.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
2
2
  `).find((H)=>H.includes("IOPlatformUUID"));if(!Z)return;let W=Z.split('" = "');if(W.length===2)return W[1].slice(0,-1)}catch(Y){ZB0.diag.debug(`error reading machine id: ${Y}`)}return}pv.getMachineId=QB0});var tv=H0((av)=>{Object.defineProperty(av,"__esModule",{value:!0});av.getMachineId=void 0;var XB0=V1("fs"),JB0=f1();async function WB0(){let Y=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let Z of Y)try{return(await XB0.promises.readFile(Z,{encoding:"utf8"})).trim()}catch(W){JB0.diag.debug(`error reading machine id: ${W}`)}return}av.getMachineId=WB0});var Zh=H0((ev)=>{Object.defineProperty(ev,"__esModule",{value:!0});ev.getMachineId=void 0;var KB0=V1("fs"),GB0=rJ(),sv=f1();async function FB0(){try{return(await KB0.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(Y){sv.diag.debug(`error reading machine id: ${Y}`)}try{return(await(0,GB0.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(Y){sv.diag.debug(`error reading machine id: ${Y}`)}return}ev.getMachineId=FB0});var Wh=H0((Xh)=>{Object.defineProperty(Xh,"__esModule",{value:!0});Xh.getMachineId=void 0;var Qh=V1("process"),HB0=rJ(),VB0=f1();async function qB0(){let Z="%windir%\\System32\\REG.exe";if(Qh.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Qh.env)Z="%windir%\\sysnative\\cmd.exe /c "+Z;try{let H=(await(0,HB0.execAsync)(`${Z} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split("REG_SZ");if(H.length===2)return H[1].trim()}catch(W){VB0.diag.debug(`error reading machine id: ${W}`)}return}Xh.getMachineId=qB0});var Fh=H0((Kh)=>{Object.defineProperty(Kh,"__esModule",{value:!0});Kh.getMachineId=void 0;var zB0=f1();async function BB0(){zB0.diag.debug("could not read machine-id: unsupported platform");return}Kh.getMachineId=BB0});var qh=H0((Hh)=>{Object.defineProperty(Hh,"__esModule",{value:!0});Hh.getMachineId=void 0;var AB0=V1("process"),e5;async function UB0(){if(!e5)switch(AB0.platform){case"darwin":e5=(await Promise.resolve().then(() => y6(rv()))).getMachineId;break;case"linux":e5=(await Promise.resolve().then(() => y6(tv()))).getMachineId;break;case"freebsd":e5=(await Promise.resolve().then(() => y6(Zh()))).getMachineId;break;case"win32":e5=(await Promise.resolve().then(() => y6(Wh()))).getMachineId;break;default:e5=(await Promise.resolve().then(() => y6(Fh()))).getMachineId;break}return e5()}Hh.getMachineId=UB0});var XV=H0((zh)=>{Object.defineProperty(zh,"__esModule",{value:!0});zh.normalizeType=zh.normalizeArch=void 0;var NB0=(Y)=>{switch(Y){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return Y}};zh.normalizeArch=NB0;var OB0=(Y)=>{switch(Y){case"sunos":return"solaris";case"win32":return"windows";default:return Y}};zh.normalizeType=OB0});var Dh=H0((Nh)=>{Object.defineProperty(Nh,"__esModule",{value:!0});Nh.hostDetector=void 0;var JV=XQ(),Ah=V1("os"),TB0=qh(),IB0=XV();class Uh{detect(Y){return{attributes:{[JV.ATTR_HOST_NAME]:(0,Ah.hostname)(),[JV.ATTR_HOST_ARCH]:(0,IB0.normalizeArch)((0,Ah.arch)()),[JV.ATTR_HOST_ID]:(0,TB0.getMachineId)()}}}}Nh.hostDetector=new Uh});var Mh=H0((Ch)=>{Object.defineProperty(Ch,"__esModule",{value:!0});Ch.osDetector=void 0;var Th=XQ(),Ih=V1("os"),$B0=XV();class $h{detect(Y){return{attributes:{[Th.ATTR_OS_TYPE]:(0,$B0.normalizeType)((0,Ih.platform)()),[Th.ATTR_OS_VERSION]:(0,Ih.release)()}}}}Ch.osDetector=new $h});var wh=H0((Ph)=>{Object.defineProperty(Ph,"__esModule",{value:!0});Ph.processDetector=void 0;var CB0=f1(),$4=XQ(),EB0=V1("os");class Rh{detect(Y){let Z={[$4.ATTR_PROCESS_PID]:process.pid,[$4.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[$4.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[$4.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[$4.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[$4.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[$4.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};if(process.argv.length>1)Z[$4.ATTR_PROCESS_COMMAND]=process.argv[1];try{let W=EB0.userInfo();Z[$4.ATTR_PROCESS_OWNER]=W.username}catch(W){CB0.diag.debug(`error obtaining process owner: ${W}`)}return{attributes:Z}}}Ph.processDetector=new Rh});var yh=H0((fh)=>{Object.defineProperty(fh,"__esModule",{value:!0});fh.serviceInstanceIdDetector=void 0;var MB0=XQ(),RB0=V1("crypto");class Sh{detect(Y){return{attributes:{[MB0.ATTR_SERVICE_INSTANCE_ID]:(0,RB0.randomUUID)()}}}}fh.serviceInstanceIdDetector=new Sh});var vh=H0((XY)=>{Object.defineProperty(XY,"__esModule",{value:!0});XY.serviceInstanceIdDetector=XY.processDetector=XY.osDetector=XY.hostDetector=void 0;var PB0=Dh();Object.defineProperty(XY,"hostDetector",{enumerable:!0,get:function(){return PB0.hostDetector}});var LB0=Mh();Object.defineProperty(XY,"osDetector",{enumerable:!0,get:function(){return LB0.osDetector}});var wB0=wh();Object.defineProperty(XY,"processDetector",{enumerable:!0,get:function(){return wB0.processDetector}});var SB0=yh();Object.defineProperty(XY,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return SB0.serviceInstanceIdDetector}})});var hh=H0((JY)=>{Object.defineProperty(JY,"__esModule",{value:!0});JY.serviceInstanceIdDetector=JY.processDetector=JY.osDetector=JY.hostDetector=void 0;var aJ=vh();Object.defineProperty(JY,"hostDetector",{enumerable:!0,get:function(){return aJ.hostDetector}});Object.defineProperty(JY,"osDetector",{enumerable:!0,get:function(){return aJ.osDetector}});Object.defineProperty(JY,"processDetector",{enumerable:!0,get:function(){return aJ.processDetector}});Object.defineProperty(JY,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return aJ.serviceInstanceIdDetector}})});var xh=H0((jh)=>{Object.defineProperty(jh,"__esModule",{value:!0});jh.noopDetector=jh.NoopDetector=void 0;class WV{detect(){return{attributes:{}}}}jh.NoopDetector=WV;jh.noopDetector=new WV});var bh=H0((a4)=>{Object.defineProperty(a4,"__esModule",{value:!0});a4.noopDetector=a4.serviceInstanceIdDetector=a4.processDetector=a4.osDetector=a4.hostDetector=a4.envDetector=void 0;var vB0=gv();Object.defineProperty(a4,"envDetector",{enumerable:!0,get:function(){return vB0.envDetector}});var oJ=hh();Object.defineProperty(a4,"hostDetector",{enumerable:!0,get:function(){return oJ.hostDetector}});Object.defineProperty(a4,"osDetector",{enumerable:!0,get:function(){return oJ.osDetector}});Object.defineProperty(a4,"processDetector",{enumerable:!0,get:function(){return oJ.processDetector}});Object.defineProperty(a4,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return oJ.serviceInstanceIdDetector}});var hB0=xh();Object.defineProperty(a4,"noopDetector",{enumerable:!0,get:function(){return hB0.noopDetector}})});var WQ=H0((G9)=>{Object.defineProperty(G9,"__esModule",{value:!0});G9.defaultServiceName=G9.emptyResource=G9.defaultResource=G9.resourceFromAttributes=G9.serviceInstanceIdDetector=G9.processDetector=G9.osDetector=G9.hostDetector=G9.envDetector=G9.detectResources=void 0;var _B0=_v();Object.defineProperty(G9,"detectResources",{enumerable:!0,get:function(){return _B0.detectResources}});var JQ=bh();Object.defineProperty(G9,"envDetector",{enumerable:!0,get:function(){return JQ.envDetector}});Object.defineProperty(G9,"hostDetector",{enumerable:!0,get:function(){return JQ.hostDetector}});Object.defineProperty(G9,"osDetector",{enumerable:!0,get:function(){return JQ.osDetector}});Object.defineProperty(G9,"processDetector",{enumerable:!0,get:function(){return JQ.processDetector}});Object.defineProperty(G9,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return JQ.serviceInstanceIdDetector}});var KV=ZV();Object.defineProperty(G9,"resourceFromAttributes",{enumerable:!0,get:function(){return KV.resourceFromAttributes}});Object.defineProperty(G9,"defaultResource",{enumerable:!0,get:function(){return KV.defaultResource}});Object.defineProperty(G9,"emptyResource",{enumerable:!0,get:function(){return KV.emptyResource}});var xB0=sH();Object.defineProperty(G9,"defaultServiceName",{enumerable:!0,get:function(){return xB0.defaultServiceName}})});var dh=H0((mh)=>{Object.defineProperty(mh,"__esModule",{value:!0});mh.ViewRegistry=void 0;class uh{_registeredViews=[];addView(Y){this._registeredViews.push(Y)}findViews(Y,Z){return this._registeredViews.filter((H)=>{return this._matchInstrument(H.instrumentSelector,Y)&&this._matchMeter(H.meterSelector,Z)})}_matchInstrument(Y,Z){return(Y.getType()===void 0||Z.type===Y.getType())&&Y.getNameFilter().match(Z.name)&&Y.getUnitFilter().match(Z.unit)}_matchMeter(Y,Z){return Y.getNameFilter().match(Z.name)&&(Z.version===void 0||Y.getVersionFilter().match(Z.version))&&(Z.schemaUrl===void 0||Y.getSchemaUrlFilter().match(Z.schemaUrl))}}mh.ViewRegistry=uh});var KQ=H0((nh)=>{Object.defineProperty(nh,"__esModule",{value:!0});nh.isValidName=nh.isDescriptorCompatibleWith=nh.createInstrumentDescriptorWithView=nh.createInstrumentDescriptor=void 0;var ch=f1(),uB0=p9();function mB0(Y,Z,W){if(!lh(Y))ch.diag.warn(`Invalid metric name: "${Y}". The metric name should be a ASCII string with a length no greater than 255 characters.`);return{name:Y,type:Z,description:W?.description??"",unit:W?.unit??"",valueType:W?.valueType??ch.ValueType.DOUBLE,advice:W?.advice??{}}}nh.createInstrumentDescriptor=mB0;function gB0(Y,Z){return{name:Y.name??Z.name,description:Y.description??Z.description,type:Z.type,unit:Z.unit,valueType:Z.valueType,advice:Z.advice}}nh.createInstrumentDescriptorWithView=gB0;function dB0(Y,Z){return(0,uB0.equalsCaseInsensitive)(Y.name,Z.name)&&Y.unit===Z.unit&&Y.type===Z.type&&Y.valueType===Z.valueType}nh.isDescriptorCompatibleWith=dB0;var cB0=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function lh(Y){return cB0.test(Y)}nh.isValidName=lh});var tJ=H0((Yj)=>{Object.defineProperty(Yj,"__esModule",{value:!0});Yj.isObservableInstrument=Yj.ObservableUpDownCounterInstrument=Yj.ObservableGaugeInstrument=Yj.ObservableCounterInstrument=Yj.ObservableInstrument=Yj.HistogramInstrument=Yj.GaugeInstrument=Yj.CounterInstrument=Yj.UpDownCounterInstrument=Yj.SyncInstrument=void 0;var WY=f1(),iB0=G6();class KY{_writableMetricStorage;_descriptor;constructor(Y,Z){this._writableMetricStorage=Y,this._descriptor=Z}_record(Y,Z={},W=WY.context.active()){if(typeof Y!=="number"){WY.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${Y}`);return}if(this._descriptor.valueType===WY.ValueType.INT&&!Number.isInteger(Y)){if(WY.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),Y=Math.trunc(Y),!Number.isInteger(Y))return}this._writableMetricStorage.record(Y,Z,W,(0,iB0.millisToHrTime)(Date.now()))}}Yj.SyncInstrument=KY;class ih extends KY{add(Y,Z,W){this._record(Y,Z,W)}}Yj.UpDownCounterInstrument=ih;class rh extends KY{add(Y,Z,W){if(Y<0){WY.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${Y}`);return}this._record(Y,Z,W)}}Yj.CounterInstrument=rh;class ah extends KY{record(Y,Z,W){this._record(Y,Z,W)}}Yj.GaugeInstrument=ah;class oh extends KY{record(Y,Z,W){if(Y<0){WY.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${Y}`);return}this._record(Y,Z,W)}}Yj.HistogramInstrument=oh;class GY{_metricStorages;_descriptor;_observableRegistry;constructor(Y,Z,W){this._descriptor=Y,this._metricStorages=Z,this._observableRegistry=W}addCallback(Y){this._observableRegistry.addCallback(Y,this)}removeCallback(Y){this._observableRegistry.removeCallback(Y,this)}}Yj.ObservableInstrument=GY;class th extends GY{}Yj.ObservableCounterInstrument=th;class sh extends GY{}Yj.ObservableGaugeInstrument=sh;class eh extends GY{}Yj.ObservableUpDownCounterInstrument=eh;function rB0(Y){return Y instanceof GY}Yj.isObservableInstrument=rB0});var Wj=H0((Xj)=>{Object.defineProperty(Xj,"__esModule",{value:!0});Xj.Meter=void 0;var Y7=KQ(),Z7=tJ(),Q7=r4();class Qj{_meterSharedState;constructor(Y){this._meterSharedState=Y}createGauge(Y,Z){let W=(0,Y7.createInstrumentDescriptor)(Y,Q7.InstrumentType.GAUGE,Z),H=this._meterSharedState.registerMetricStorage(W);return new Z7.GaugeInstrument(H,W)}createHistogram(Y,Z){let W=(0,Y7.createInstrumentDescriptor)(Y,Q7.InstrumentType.HISTOGRAM,Z),H=this._meterSharedState.registerMetricStorage(W);return new Z7.HistogramInstrument(H,W)}createCounter(Y,Z){let W=(0,Y7.createInstrumentDescriptor)(Y,Q7.InstrumentType.COUNTER,Z),H=this._meterSharedState.registerMetricStorage(W);return new Z7.CounterInstrument(H,W)}createUpDownCounter(Y,Z){let W=(0,Y7.createInstrumentDescriptor)(Y,Q7.InstrumentType.UP_DOWN_COUNTER,Z),H=this._meterSharedState.registerMetricStorage(W);return new Z7.UpDownCounterInstrument(H,W)}createObservableGauge(Y,Z){let W=(0,Y7.createInstrumentDescriptor)(Y,Q7.InstrumentType.OBSERVABLE_GAUGE,Z),H=this._meterSharedState.registerAsyncMetricStorage(W);return new Z7.ObservableGaugeInstrument(W,H,this._meterSharedState.observableRegistry)}createObservableCounter(Y,Z){let W=(0,Y7.createInstrumentDescriptor)(Y,Q7.InstrumentType.OBSERVABLE_COUNTER,Z),H=this._meterSharedState.registerAsyncMetricStorage(W);return new Z7.ObservableCounterInstrument(W,H,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(Y,Z){let W=(0,Y7.createInstrumentDescriptor)(Y,Q7.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,Z),H=this._meterSharedState.registerAsyncMetricStorage(W);return new Z7.ObservableUpDownCounterInstrument(W,H,this._meterSharedState.observableRegistry)}addBatchObservableCallback(Y,Z){this._meterSharedState.observableRegistry.addBatchCallback(Y,Z)}removeBatchObservableCallback(Y,Z){this._meterSharedState.observableRegistry.removeBatchCallback(Y,Z)}}Xj.Meter=Qj});var GV=H0((Gj)=>{Object.defineProperty(Gj,"__esModule",{value:!0});Gj.MetricStorage=void 0;var JA0=KQ();class Kj{_instrumentDescriptor;constructor(Y){this._instrumentDescriptor=Y}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(Y){this._instrumentDescriptor=(0,JA0.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:Y,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}Gj.MetricStorage=Kj});var GQ=H0((Vj)=>{Object.defineProperty(Vj,"__esModule",{value:!0});Vj.AttributeHashMap=Vj.HashMap=void 0;var WA0=p9();class FV{_valueMap=new Map;_keyMap=new Map;_hash;constructor(Y){this._hash=Y}get(Y,Z){return Z??=this._hash(Y),this._valueMap.get(Z)}getOrDefault(Y,Z){let W=this._hash(Y);if(this._valueMap.has(W))return this._valueMap.get(W);let H=Z();if(!this._keyMap.has(W))this._keyMap.set(W,Y);return this._valueMap.set(W,H),H}set(Y,Z,W){if(W??=this._hash(Y),!this._keyMap.has(W))this._keyMap.set(W,Y);this._valueMap.set(W,Z)}has(Y,Z){return Z??=this._hash(Y),this._valueMap.has(Z)}*keys(){let Y=this._keyMap.entries(),Z=Y.next();while(Z.done!==!0)yield[Z.value[1],Z.value[0]],Z=Y.next()}*entries(){let Y=this._valueMap.entries(),Z=Y.next();while(Z.done!==!0)yield[this._keyMap.get(Z.value[0]),Z.value[1],Z.value[0]],Z=Y.next()}get size(){return this._valueMap.size}}Vj.HashMap=FV;class Hj extends FV{constructor(){super(WA0.hashAttributes)}}Vj.AttributeHashMap=Hj});var VV=H0((Bj)=>{Object.defineProperty(Bj,"__esModule",{value:!0});Bj.DeltaMetricProcessor=void 0;var GA0=p9(),HV=GQ();class zj{_activeCollectionStorage=new HV.AttributeHashMap;_cumulativeMemoStorage=new HV.AttributeHashMap;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(Y,Z){this._aggregator=Y,this._cardinalityLimit=(Z??2000)-1,this._overflowHashCode=(0,GA0.hashAttributes)(this._overflowAttributes)}record(Y,Z,W,H){let F=this._activeCollectionStorage.get(Z);if(!F){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(H))?.record(Y);return}F=this._aggregator.createAccumulation(H),this._activeCollectionStorage.set(Z,F)}F?.record(Y)}batchCumulate(Y,Z){Array.from(Y.entries()).forEach(([W,H,F])=>{let X=this._aggregator.createAccumulation(Z);X?.record(H);let J=X;if(this._cumulativeMemoStorage.has(W,F)){let Q=this._cumulativeMemoStorage.get(W,F);J=this._aggregator.diff(Q,X)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit){if(W=this._overflowAttributes,F=this._overflowHashCode,this._cumulativeMemoStorage.has(W,F)){let Q=this._cumulativeMemoStorage.get(W,F);J=this._aggregator.diff(Q,X)}}if(this._activeCollectionStorage.has(W,F)){let Q=this._activeCollectionStorage.get(W,F);J=this._aggregator.merge(Q,J)}this._cumulativeMemoStorage.set(W,X,F),this._activeCollectionStorage.set(W,J,F)})}collect(){let Y=this._activeCollectionStorage;return this._activeCollectionStorage=new HV.AttributeHashMap,Y}}Bj.DeltaMetricProcessor=zj});var qV=H0((Uj)=>{Object.defineProperty(Uj,"__esModule",{value:!0});Uj.TemporalMetricProcessor=void 0;var FA0=bJ(),HA0=GQ();class FQ{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(Y,Z){this._aggregator=Y,Z.forEach((W)=>{this._unreportedAccumulations.set(W,[])})}buildMetrics(Y,Z,W,H){this._stashAccumulations(W);let F=this._getMergedUnreportedAccumulations(Y),X=F,J;if(this._reportHistory.has(Y)){let G=this._reportHistory.get(Y),q=G.collectionTime;if(J=G.aggregationTemporality,J===FA0.AggregationTemporality.CUMULATIVE)X=FQ.merge(G.accumulations,F,this._aggregator);else X=FQ.calibrateStartTime(G.accumulations,F,q)}else J=Y.selectAggregationTemporality(Z.type);this._reportHistory.set(Y,{accumulations:X,collectionTime:H,aggregationTemporality:J});let Q=VA0(X);if(Q.length===0)return;return this._aggregator.toMetricData(Z,J,Q,H)}_stashAccumulations(Y){let Z=this._unreportedAccumulations.keys();for(let W of Z){let H=this._unreportedAccumulations.get(W);if(H===void 0)H=[],this._unreportedAccumulations.set(W,H);H.push(Y)}}_getMergedUnreportedAccumulations(Y){let Z=new HA0.AttributeHashMap,W=this._unreportedAccumulations.get(Y);if(this._unreportedAccumulations.set(Y,[]),W===void 0)return Z;for(let H of W)Z=FQ.merge(Z,H,this._aggregator);return Z}static merge(Y,Z,W){let H=Y,F=Z.entries(),X=F.next();while(X.done!==!0){let[J,Q,G]=X.value;if(Y.has(J,G)){let q=Y.get(J,G),K=W.merge(q,Q);H.set(J,K,G)}else H.set(J,Q,G);X=F.next()}return H}static calibrateStartTime(Y,Z,W){for(let[H,F]of Y.keys())Z.get(H,F)?.setStartTime(W);return Z}}Uj.TemporalMetricProcessor=FQ;function VA0(Y){return Array.from(Y.entries())}});var Ij=H0((Dj)=>{Object.defineProperty(Dj,"__esModule",{value:!0});Dj.AsyncMetricStorage=void 0;var qA0=GV(),zA0=VV(),BA0=qV(),AA0=GQ();class Oj extends qA0.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(Y,Z,W,H,F){super(Y);this._aggregationCardinalityLimit=F,this._deltaMetricStorage=new zA0.DeltaMetricProcessor(Z,this._aggregationCardinalityLimit),this._temporalMetricStorage=new BA0.TemporalMetricProcessor(Z,H),this._attributesProcessor=W}record(Y,Z){let W=new AA0.AttributeHashMap;Array.from(Y.entries()).forEach(([H,F])=>{W.set(this._attributesProcessor.process(H),F)}),this._deltaMetricStorage.batchCumulate(W,Z)}collect(Y,Z){let W=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(Y,this._instrumentDescriptor,W,Z)}}Dj.AsyncMetricStorage=Oj});var Lj=H0((Rj)=>{Object.defineProperty(Rj,"__esModule",{value:!0});Rj.getConflictResolutionRecipe=Rj.getDescriptionResolutionRecipe=Rj.getTypeConflictResolutionRecipe=Rj.getUnitConflictResolutionRecipe=Rj.getValueTypeConflictResolutionRecipe=Rj.getIncompatibilityDetails=void 0;function UA0(Y,Z){let W="";if(Y.unit!==Z.unit)W+=` - Unit '${Y.unit}' does not match '${Z.unit}'
3
3
  `;if(Y.type!==Z.type)W+=` - Type '${Y.type}' does not match '${Z.type}'
4
4
  `;if(Y.valueType!==Z.valueType)W+=` - Value Type '${Y.valueType}' does not match '${Z.valueType}'
@@ -12,7 +12,7 @@ To resolve the conflict:`,(0,sJ.getConflictResolutionRecipe)(F,Y))}W=H}else wj.d
12
12
  `,`Details:
13
13
  `,(0,sJ.getIncompatibilityDetails)(F,Y),`To resolve the conflict:
14
14
  `,(0,sJ.getConflictResolutionRecipe)(F,Y))}return W}}Sj.MetricStorageRegistry=zV});var jj=H0((vj)=>{Object.defineProperty(vj,"__esModule",{value:!0});vj.MultiMetricStorage=void 0;class yj{_backingStorages;constructor(Y){this._backingStorages=Y}record(Y,Z,W,H){this._backingStorages.forEach((F)=>{F.record(Y,Z,W,H)})}}vj.MultiMetricStorage=yj});var gj=H0((uj)=>{Object.defineProperty(uj,"__esModule",{value:!0});uj.BatchObservableResultImpl=uj.ObservableResultImpl=void 0;var FY=f1(),_j=GQ(),EA0=tJ();class xj{_buffer=new _j.AttributeHashMap;_instrumentName;_valueType;constructor(Y,Z){this._instrumentName=Y,this._valueType=Z}observe(Y,Z={}){if(typeof Y!=="number"){FY.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${Y}`);return}if(this._valueType===FY.ValueType.INT&&!Number.isInteger(Y)){if(FY.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),Y=Math.trunc(Y),!Number.isInteger(Y))return}this._buffer.set(Z,Y)}}uj.ObservableResultImpl=xj;class bj{_buffer=new Map;observe(Y,Z,W={}){if(!(0,EA0.isObservableInstrument)(Y))return;let H=this._buffer.get(Y);if(H==null)H=new _j.AttributeHashMap,this._buffer.set(Y,H);if(typeof Z!=="number"){FY.diag.warn(`non-number value provided to metric ${Y._descriptor.name}: ${Z}`);return}if(Y._descriptor.valueType===FY.ValueType.INT&&!Number.isInteger(Z)){if(FY.diag.warn(`INT value type cannot accept a floating-point value for ${Y._descriptor.name}, ignoring the fractional digits.`),Z=Math.trunc(Z),!Number.isInteger(Z))return}H.set(W,Z)}}uj.BatchObservableResultImpl=bj});var ij=H0((nj)=>{Object.defineProperty(nj,"__esModule",{value:!0});nj.ObservableRegistry=void 0;var RA0=f1(),dj=tJ(),cj=gj(),BV=p9();class lj{_callbacks=[];_batchCallbacks=[];addCallback(Y,Z){if(this._findCallback(Y,Z)>=0)return;this._callbacks.push({callback:Y,instrument:Z})}removeCallback(Y,Z){let W=this._findCallback(Y,Z);if(W<0)return;this._callbacks.splice(W,1)}addBatchCallback(Y,Z){let W=new Set(Z.filter(dj.isObservableInstrument));if(W.size===0){RA0.diag.error("BatchObservableCallback is not associated with valid instruments",Z);return}if(this._findBatchCallback(Y,W)>=0)return;this._batchCallbacks.push({callback:Y,instruments:W})}removeBatchCallback(Y,Z){let W=new Set(Z.filter(dj.isObservableInstrument)),H=this._findBatchCallback(Y,W);if(H<0)return;this._batchCallbacks.splice(H,1)}async observe(Y,Z){let W=this._observeCallbacks(Y,Z),H=this._observeBatchCallbacks(Y,Z);return(await Promise.allSettled([...W,...H])).filter((J)=>J.status==="rejected").map((J)=>J.reason)}_observeCallbacks(Y,Z){return this._callbacks.map(async({callback:W,instrument:H})=>{let F=new cj.ObservableResultImpl(H._descriptor.name,H._descriptor.valueType),X=Promise.resolve(W(F));if(Z!=null)X=(0,BV.callWithTimeout)(X,Z);await X,H._metricStorages.forEach((J)=>{J.record(F._buffer,Y)})})}_observeBatchCallbacks(Y,Z){return this._batchCallbacks.map(async({callback:W,instruments:H})=>{let F=new cj.BatchObservableResultImpl,X=Promise.resolve(W(F));if(Z!=null)X=(0,BV.callWithTimeout)(X,Z);await X,H.forEach((J)=>{let Q=F._buffer.get(J);if(Q==null)return;J._metricStorages.forEach((G)=>{G.record(Q,Y)})})})}_findCallback(Y,Z){return this._callbacks.findIndex((W)=>{return W.callback===Y&&W.instrument===Z})}_findBatchCallback(Y,Z){return this._batchCallbacks.findIndex((W)=>{return W.callback===Y&&(0,BV.setEquals)(W.instruments,Z)})}}nj.ObservableRegistry=lj});var tj=H0((aj)=>{Object.defineProperty(aj,"__esModule",{value:!0});aj.SyncMetricStorage=void 0;var PA0=GV(),LA0=VV(),wA0=qV();class rj extends PA0.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(Y,Z,W,H,F){super(Y);this._aggregationCardinalityLimit=F,this._deltaMetricStorage=new LA0.DeltaMetricProcessor(Z,this._aggregationCardinalityLimit),this._temporalMetricStorage=new wA0.TemporalMetricProcessor(Z,H),this._attributesProcessor=W}record(Y,Z,W,H){Z=this._attributesProcessor.process(Z,W),this._deltaMetricStorage.record(Y,Z,W,H)}collect(Y,Z){let W=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(Y,this._instrumentDescriptor,W,Z)}}aj.SyncMetricStorage=rj});var eJ=H0((Q_)=>{Object.defineProperty(Q_,"__esModule",{value:!0});Q_.createDenyListAttributesProcessor=Q_.createAllowListAttributesProcessor=Q_.createMultiAttributesProcessor=Q_.createNoopAttributesProcessor=void 0;class sj{process(Y,Z){return Y}}class ej{_processors;constructor(Y){this._processors=Y}process(Y,Z){let W=Y;for(let H of this._processors)W=H.process(W,Z);return W}}class Y_{_allowedAttributeNames;constructor(Y){this._allowedAttributeNames=Y}process(Y,Z){let W={};return Object.keys(Y).forEach((H)=>{if(this._allowedAttributeNames.includes(H))W[H]=Y[H]}),W}}class Z_{_deniedAttributeNames;constructor(Y){this._deniedAttributeNames=Y}process(Y,Z){let W={};return Object.keys(Y).forEach((H)=>{if(!this._deniedAttributeNames.includes(H))W[H]=Y[H]}),W}}function SA0(){return vA0}Q_.createNoopAttributesProcessor=SA0;function fA0(Y){return new ej(Y)}Q_.createMultiAttributesProcessor=fA0;function kA0(Y){return new Y_(Y)}Q_.createAllowListAttributesProcessor=kA0;function yA0(Y){return new Z_(Y)}Q_.createDenyListAttributesProcessor=yA0;var vA0=new sj});var G_=H0((W_)=>{Object.defineProperty(W_,"__esModule",{value:!0});W_.MeterSharedState=void 0;var xA0=KQ(),bA0=Wj(),uA0=Ij(),mA0=kj(),gA0=jj(),dA0=ij(),cA0=tj(),lA0=eJ();class J_{metricStorageRegistry=new mA0.MetricStorageRegistry;observableRegistry=new dA0.ObservableRegistry;meter;_meterProviderSharedState;_instrumentationScope;constructor(Y,Z){this.meter=new bA0.Meter(this),this._meterProviderSharedState=Y,this._instrumentationScope=Z}registerMetricStorage(Y){let Z=this._registerMetricStorage(Y,cA0.SyncMetricStorage);if(Z.length===1)return Z[0];return new gA0.MultiMetricStorage(Z)}registerAsyncMetricStorage(Y){return this._registerMetricStorage(Y,uA0.AsyncMetricStorage)}async collect(Y,Z,W){let H=await this.observableRegistry.observe(Z,W?.timeoutMillis),F=this.metricStorageRegistry.getStorages(Y);if(F.length===0)return null;let X=[];if(F.forEach((J)=>{let Q=J.collect(Y,Z);if(Q!=null)X.push(Q)}),X.length===0)return{errors:H};return{scopeMetrics:{scope:this._instrumentationScope,metrics:X},errors:H}}_registerMetricStorage(Y,Z){let H=this._meterProviderSharedState.viewRegistry.findViews(Y,this._instrumentationScope).map((F)=>{let X=(0,xA0.createInstrumentDescriptorWithView)(F,Y),J=this.metricStorageRegistry.findOrUpdateCompatibleStorage(X);if(J!=null)return J;let Q=F.aggregation.createAggregator(X),G=new Z(X,Q,F.attributesProcessor,this._meterProviderSharedState.metricCollectors,F.aggregationCardinalityLimit);return this.metricStorageRegistry.register(G),G});if(H.length===0){let X=this._meterProviderSharedState.selectAggregations(Y.type).map(([J,Q])=>{let G=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(J,Y);if(G!=null)return G;let q=Q.createAggregator(Y),K=J.selectCardinalityLimit(Y.type),V=new Z(Y,q,(0,lA0.createNoopAttributesProcessor)(),[J],K);return this.metricStorageRegistry.registerForCollector(J,V),V});H=H.concat(X)}return H}}W_.MeterSharedState=J_});var q_=H0((H_)=>{Object.defineProperty(H_,"__esModule",{value:!0});H_.MeterProviderSharedState=void 0;var nA0=p9(),pA0=dh(),iA0=G_(),rA0=sZ();class F_{viewRegistry=new pA0.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;resource;constructor(Y){this.resource=Y}getMeterSharedState(Y){let Z=(0,nA0.instrumentationScopeId)(Y),W=this.meterSharedStates.get(Z);if(W==null)W=new iA0.MeterSharedState(this,Y),this.meterSharedStates.set(Z,W);return W}selectAggregations(Y){let Z=[];for(let W of this.metricCollectors)Z.push([W,(0,rA0.toAggregation)(W.selectAggregation(Y))]);return Z}}H_.MeterProviderSharedState=F_});var U_=H0((B_)=>{Object.defineProperty(B_,"__esModule",{value:!0});B_.MetricCollector=void 0;var aA0=G6();class z_{_sharedState;_metricReader;constructor(Y,Z){this._sharedState=Y,this._metricReader=Z}async collect(Y){let Z=(0,aA0.millisToHrTime)(Date.now()),W=[],H=[],F=Array.from(this._sharedState.meterSharedStates.values()).map(async(X)=>{let J=await X.collect(this,Z,Y);if(J?.scopeMetrics!=null)W.push(J.scopeMetrics);if(J?.errors!=null)H.push(...J.errors)});return await Promise.all(F),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:W},errors:H}}async forceFlush(Y){await this._metricReader.forceFlush(Y)}async shutdown(Y){await this._metricReader.shutdown(Y)}selectAggregationTemporality(Y){return this._metricReader.selectAggregationTemporality(Y)}selectAggregation(Y){return this._metricReader.selectAggregation(Y)}selectCardinalityLimit(Y){return this._metricReader.selectCardinalityLimit?.(Y)??2000}}B_.MetricCollector=z_});var YW=H0((O_)=>{Object.defineProperty(O_,"__esModule",{value:!0});O_.ExactPredicate=O_.PatternPredicate=void 0;var oA0=/[\^$\\.+?()[\]{}|]/g;class AV{_matchAll;_regexp;constructor(Y){if(Y==="*")this._matchAll=!0,this._regexp=/.*/;else this._matchAll=!1,this._regexp=new RegExp(AV.escapePattern(Y))}match(Y){if(this._matchAll)return!0;return this._regexp.test(Y)}static escapePattern(Y){return`^${Y.replace(oA0,"\\$&").replace("*",".*")}$`}static hasWildcard(Y){return Y.includes("*")}}O_.PatternPredicate=AV;class N_{_matchAll;_pattern;constructor(Y){this._matchAll=Y===void 0,this._pattern=Y}match(Y){if(this._matchAll)return!0;if(Y===this._pattern)return!0;return!1}}O_.ExactPredicate=N_});var E_=H0(($_)=>{Object.defineProperty($_,"__esModule",{value:!0});$_.InstrumentSelector=void 0;var T_=YW();class I_{_nameFilter;_type;_unitFilter;constructor(Y){this._nameFilter=new T_.PatternPredicate(Y?.name??"*"),this._type=Y?.type,this._unitFilter=new T_.ExactPredicate(Y?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}$_.InstrumentSelector=I_});var L_=H0((R_)=>{Object.defineProperty(R_,"__esModule",{value:!0});R_.MeterSelector=void 0;var UV=YW();class M_{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(Y){this._nameFilter=new UV.ExactPredicate(Y?.name),this._versionFilter=new UV.ExactPredicate(Y?.version),this._schemaUrlFilter=new UV.ExactPredicate(Y?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}R_.MeterSelector=M_});var v_=H0((k_)=>{Object.defineProperty(k_,"__esModule",{value:!0});k_.View=void 0;var sA0=YW(),w_=eJ(),eA0=E_(),YU0=L_(),S_=sZ();function ZU0(Y){return Y.instrumentName==null&&Y.instrumentType==null&&Y.instrumentUnit==null&&Y.meterName==null&&Y.meterVersion==null&&Y.meterSchemaUrl==null}function QU0(Y){if(ZU0(Y))throw Error("Cannot create view with no selector arguments supplied");if(Y.name!=null&&(Y?.instrumentName==null||sA0.PatternPredicate.hasWildcard(Y.instrumentName)))throw Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.")}class f_{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(Y){if(QU0(Y),Y.attributesProcessors!=null)this.attributesProcessor=(0,w_.createMultiAttributesProcessor)(Y.attributesProcessors);else this.attributesProcessor=(0,w_.createNoopAttributesProcessor)();this.name=Y.name,this.description=Y.description,this.aggregation=(0,S_.toAggregation)(Y.aggregation??{type:S_.AggregationType.DEFAULT}),this.instrumentSelector=new eA0.InstrumentSelector({name:Y.instrumentName,type:Y.instrumentType,unit:Y.instrumentUnit}),this.meterSelector=new YU0.MeterSelector({name:Y.meterName,version:Y.meterVersion,schemaUrl:Y.meterSchemaUrl}),this.aggregationCardinalityLimit=Y.aggregationCardinalityLimit}}k_.View=f_});var x_=H0((j_)=>{Object.defineProperty(j_,"__esModule",{value:!0});j_.MeterProvider=void 0;var ZW=f1(),XU0=WQ(),JU0=q_(),WU0=U_(),KU0=v_();class h_{_sharedState;_shutdown=!1;constructor(Y){if(this._sharedState=new JU0.MeterProviderSharedState(Y?.resource??(0,XU0.defaultResource)()),Y?.views!=null&&Y.views.length>0)for(let Z of Y.views)this._sharedState.viewRegistry.addView(new KU0.View(Z));if(Y?.readers!=null&&Y.readers.length>0)for(let Z of Y.readers){let W=new WU0.MetricCollector(this._sharedState,Z);Z.setMetricProducer(W),this._sharedState.metricCollectors.push(W)}}getMeter(Y,Z="",W={}){if(this._shutdown)return ZW.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,ZW.createNoopMeter)();return this._sharedState.getMeterSharedState({name:Y,version:Z,schemaUrl:W.schemaUrl}).meter}async shutdown(Y){if(this._shutdown){ZW.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map((Z)=>{return Z.shutdown(Y)}))}async forceFlush(Y){if(this._shutdown){ZW.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map((Z)=>{return Z.forceFlush(Y)}))}}j_.MeterProvider=h_});var QW=H0((_8)=>{Object.defineProperty(_8,"__esModule",{value:!0});_8.TimeoutError=_8.createDenyListAttributesProcessor=_8.createAllowListAttributesProcessor=_8.AggregationType=_8.MeterProvider=_8.ConsoleMetricExporter=_8.InMemoryMetricExporter=_8.PeriodicExportingMetricReader=_8.MetricReader=_8.InstrumentType=_8.DataPointType=_8.AggregationTemporality=void 0;var GU0=bJ();Object.defineProperty(_8,"AggregationTemporality",{enumerable:!0,get:function(){return GU0.AggregationTemporality}});var b_=r4();Object.defineProperty(_8,"DataPointType",{enumerable:!0,get:function(){return b_.DataPointType}});Object.defineProperty(_8,"InstrumentType",{enumerable:!0,get:function(){return b_.InstrumentType}});var FU0=oH();Object.defineProperty(_8,"MetricReader",{enumerable:!0,get:function(){return FU0.MetricReader}});var HU0=Uv();Object.defineProperty(_8,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return HU0.PeriodicExportingMetricReader}});var VU0=Iv();Object.defineProperty(_8,"InMemoryMetricExporter",{enumerable:!0,get:function(){return VU0.InMemoryMetricExporter}});var qU0=Mv();Object.defineProperty(_8,"ConsoleMetricExporter",{enumerable:!0,get:function(){return qU0.ConsoleMetricExporter}});var zU0=x_();Object.defineProperty(_8,"MeterProvider",{enumerable:!0,get:function(){return zU0.MeterProvider}});var BU0=sZ();Object.defineProperty(_8,"AggregationType",{enumerable:!0,get:function(){return BU0.AggregationType}});var u_=eJ();Object.defineProperty(_8,"createAllowListAttributesProcessor",{enumerable:!0,get:function(){return u_.createAllowListAttributesProcessor}});Object.defineProperty(_8,"createDenyListAttributesProcessor",{enumerable:!0,get:function(){return u_.createDenyListAttributesProcessor}});var AU0=p9();Object.defineProperty(_8,"TimeoutError",{enumerable:!0,get:function(){return AU0.TimeoutError}})});var g_=H0((m_)=>{Object.defineProperty(m_,"__esModule",{value:!0});m_.EAggregationTemporality=void 0;var NU0;(function(Y){Y[Y.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",Y[Y.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",Y[Y.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(NU0=m_.EAggregationTemporality||(m_.EAggregationTemporality={}))});var OV=H0((r_)=>{Object.defineProperty(r_,"__esModule",{value:!0});r_.createExportMetricsServiceRequest=r_.toMetric=r_.toScopeMetrics=r_.toResourceMetrics=void 0;var d_=f1(),HY=QW(),c_=g_(),HQ=_J();function n_(Y,Z){let W=(0,HQ.createResource)(Y.resource,Z);return{resource:W,schemaUrl:W.schemaUrl,scopeMetrics:p_(Y.scopeMetrics,Z)}}r_.toResourceMetrics=n_;function p_(Y,Z){return Array.from(Y.map((W)=>({scope:(0,HQ.createInstrumentationScope)(W.scope),metrics:W.metrics.map((H)=>i_(H,Z)),schemaUrl:W.scope.schemaUrl})))}r_.toScopeMetrics=p_;function i_(Y,Z){let W={name:Y.descriptor.name,description:Y.descriptor.description,unit:Y.descriptor.unit},H=IU0(Y.aggregationTemporality);switch(Y.dataPointType){case HY.DataPointType.SUM:W.sum={aggregationTemporality:H,isMonotonic:Y.isMonotonic,dataPoints:l_(Y,Z)};break;case HY.DataPointType.GAUGE:W.gauge={dataPoints:l_(Y,Z)};break;case HY.DataPointType.HISTOGRAM:W.histogram={aggregationTemporality:H,dataPoints:DU0(Y,Z)};break;case HY.DataPointType.EXPONENTIAL_HISTOGRAM:W.exponentialHistogram={aggregationTemporality:H,dataPoints:TU0(Y,Z)};break}return W}r_.toMetric=i_;function OU0(Y,Z,W){let H={attributes:(0,HQ.toAttributes)(Y.attributes,W),startTimeUnixNano:W.encodeHrTime(Y.startTime),timeUnixNano:W.encodeHrTime(Y.endTime)};switch(Z){case d_.ValueType.INT:H.asInt=Y.value;break;case d_.ValueType.DOUBLE:H.asDouble=Y.value;break}return H}function l_(Y,Z){return Y.dataPoints.map((W)=>{return OU0(W,Y.descriptor.valueType,Z)})}function DU0(Y,Z){return Y.dataPoints.map((W)=>{let H=W.value;return{attributes:(0,HQ.toAttributes)(W.attributes,Z),bucketCounts:H.buckets.counts,explicitBounds:H.buckets.boundaries,count:H.count,sum:H.sum,min:H.min,max:H.max,startTimeUnixNano:Z.encodeHrTime(W.startTime),timeUnixNano:Z.encodeHrTime(W.endTime)}})}function TU0(Y,Z){return Y.dataPoints.map((W)=>{let H=W.value;return{attributes:(0,HQ.toAttributes)(W.attributes,Z),count:H.count,min:H.min,max:H.max,sum:H.sum,positive:{offset:H.positive.offset,bucketCounts:H.positive.bucketCounts},negative:{offset:H.negative.offset,bucketCounts:H.negative.bucketCounts},scale:H.scale,zeroCount:H.zeroCount,startTimeUnixNano:Z.encodeHrTime(W.startTime),timeUnixNano:Z.encodeHrTime(W.endTime)}})}function IU0(Y){switch(Y){case HY.AggregationTemporality.DELTA:return c_.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;case HY.AggregationTemporality.CUMULATIVE:return c_.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE}}function $U0(Y,Z){return{resourceMetrics:Y.map((W)=>n_(W,Z))}}r_.createExportMetricsServiceRequest=$U0});var e_=H0((t_)=>{Object.defineProperty(t_,"__esModule",{value:!0});t_.ProtobufMetricsSerializer=void 0;var o_=hJ(),RU0=OV(),PU0=i5(),LU0=o_.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,wU0=o_.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;t_.ProtobufMetricsSerializer={serializeRequest:(Y)=>{let Z=(0,RU0.createExportMetricsServiceRequest)([Y],PU0.PROTOBUF_ENCODER);return wU0.encode(Z).finish()},deserializeResponse:(Y)=>{return LU0.decode(Y)}}});var Yx=H0((DV)=>{Object.defineProperty(DV,"__esModule",{value:!0});DV.ProtobufMetricsSerializer=void 0;var SU0=e_();Object.defineProperty(DV,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return SU0.ProtobufMetricsSerializer}})});var TV=H0((Wx)=>{Object.defineProperty(Wx,"__esModule",{value:!0});Wx.createExportTraceServiceRequest=Wx.toOtlpSpanEvent=Wx.toOtlpLink=Wx.sdkSpanToOtlpSpan=void 0;var VQ=_J(),kU0=256,yU0=512;function Zx(Y,Z){let W=Y&255|kU0;if(Z)W|=yU0;return W}function Qx(Y,Z){let W=Y.spanContext(),H=Y.status,F=Y.parentSpanContext?.spanId?Z.encodeSpanContext(Y.parentSpanContext?.spanId):void 0;return{traceId:Z.encodeSpanContext(W.traceId),spanId:Z.encodeSpanContext(W.spanId),parentSpanId:F,traceState:W.traceState?.serialize(),name:Y.name,kind:Y.kind==null?0:Y.kind+1,startTimeUnixNano:Z.encodeHrTime(Y.startTime),endTimeUnixNano:Z.encodeHrTime(Y.endTime),attributes:(0,VQ.toAttributes)(Y.attributes,Z),droppedAttributesCount:Y.droppedAttributesCount,events:Y.events.map((X)=>Jx(X,Z)),droppedEventsCount:Y.droppedEventsCount,status:{code:H.code,message:H.message},links:Y.links.map((X)=>Xx(X,Z)),droppedLinksCount:Y.droppedLinksCount,flags:Zx(W.traceFlags,Y.parentSpanContext?.isRemote)}}Wx.sdkSpanToOtlpSpan=Qx;function Xx(Y,Z){return{attributes:Y.attributes?(0,VQ.toAttributes)(Y.attributes,Z):[],spanId:Z.encodeSpanContext(Y.context.spanId),traceId:Z.encodeSpanContext(Y.context.traceId),traceState:Y.context.traceState?.serialize(),droppedAttributesCount:Y.droppedAttributesCount||0,flags:Zx(Y.context.traceFlags,Y.context.isRemote)}}Wx.toOtlpLink=Xx;function Jx(Y,Z){return{attributes:Y.attributes?(0,VQ.toAttributes)(Y.attributes,Z):[],name:Y.name,timeUnixNano:Z.encodeHrTime(Y.time),droppedAttributesCount:Y.droppedAttributesCount||0}}Wx.toOtlpSpanEvent=Jx;function vU0(Y,Z){return{resourceSpans:jU0(Y,Z)}}Wx.createExportTraceServiceRequest=vU0;function hU0(Y){let Z=new Map;for(let W of Y){let H=Z.get(W.resource);if(!H)H=new Map,Z.set(W.resource,H);let F=`${W.instrumentationScope.name}@${W.instrumentationScope.version||""}:${W.instrumentationScope.schemaUrl||""}`,X=H.get(F);if(!X)X=[],H.set(F,X);X.push(W)}return Z}function jU0(Y,Z){let W=hU0(Y),H=[],F=W.entries(),X=F.next();while(!X.done){let[J,Q]=X.value,G=[],q=Q.values(),K=q.next();while(!K.done){let I=K.value;if(I.length>0){let M=I.map((E)=>Qx(E,Z));G.push({scope:(0,VQ.createInstrumentationScope)(I[0].instrumentationScope),spans:M,schemaUrl:I[0].instrumentationScope.schemaUrl})}K=q.next()}let V=(0,VQ.createResource)(J,Z),B={resource:V,scopeSpans:G,schemaUrl:V.schemaUrl};H.push(B),X=F.next()}return H}});var Vx=H0((Fx)=>{Object.defineProperty(Fx,"__esModule",{value:!0});Fx.ProtobufTraceSerializer=void 0;var Gx=hJ(),uU0=TV(),mU0=i5(),gU0=Gx.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,dU0=Gx.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;Fx.ProtobufTraceSerializer={serializeRequest:(Y)=>{let Z=(0,uU0.createExportTraceServiceRequest)(Y,mU0.PROTOBUF_ENCODER);return dU0.encode(Z).finish()},deserializeResponse:(Y)=>{return gU0.decode(Y)}}});var qx=H0((IV)=>{Object.defineProperty(IV,"__esModule",{value:!0});IV.ProtobufTraceSerializer=void 0;var cU0=Vx();Object.defineProperty(IV,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return cU0.ProtobufTraceSerializer}})});var Ax=H0((zx)=>{Object.defineProperty(zx,"__esModule",{value:!0});zx.JsonLogsSerializer=void 0;var nU0=hH(),pU0=i5();zx.JsonLogsSerializer={serializeRequest:(Y)=>{let Z=(0,nU0.createExportLogsServiceRequest)(Y,pU0.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(Z))},deserializeResponse:(Y)=>{if(Y.length===0)return{};return JSON.parse(new TextDecoder().decode(Y))}}});var Ux=H0(($V)=>{Object.defineProperty($V,"__esModule",{value:!0});$V.JsonLogsSerializer=void 0;var iU0=Ax();Object.defineProperty($V,"JsonLogsSerializer",{enumerable:!0,get:function(){return iU0.JsonLogsSerializer}})});var Dx=H0((Nx)=>{Object.defineProperty(Nx,"__esModule",{value:!0});Nx.JsonMetricsSerializer=void 0;var aU0=OV(),oU0=i5();Nx.JsonMetricsSerializer={serializeRequest:(Y)=>{let Z=(0,aU0.createExportMetricsServiceRequest)([Y],oU0.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(Z))},deserializeResponse:(Y)=>{if(Y.length===0)return{};return JSON.parse(new TextDecoder().decode(Y))}}});var Tx=H0((CV)=>{Object.defineProperty(CV,"__esModule",{value:!0});CV.JsonMetricsSerializer=void 0;var tU0=Dx();Object.defineProperty(CV,"JsonMetricsSerializer",{enumerable:!0,get:function(){return tU0.JsonMetricsSerializer}})});var Cx=H0((Ix)=>{Object.defineProperty(Ix,"__esModule",{value:!0});Ix.JsonTraceSerializer=void 0;var eU0=TV(),YN0=i5();Ix.JsonTraceSerializer={serializeRequest:(Y)=>{let Z=(0,eU0.createExportTraceServiceRequest)(Y,YN0.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(Z))},deserializeResponse:(Y)=>{if(Y.length===0)return{};return JSON.parse(new TextDecoder().decode(Y))}}});var Ex=H0((EV)=>{Object.defineProperty(EV,"__esModule",{value:!0});EV.JsonTraceSerializer=void 0;var ZN0=Cx();Object.defineProperty(EV,"JsonTraceSerializer",{enumerable:!0,get:function(){return ZN0.JsonTraceSerializer}})});var XW=H0((o4)=>{Object.defineProperty(o4,"__esModule",{value:!0});o4.JsonTraceSerializer=o4.JsonMetricsSerializer=o4.JsonLogsSerializer=o4.ProtobufTraceSerializer=o4.ProtobufMetricsSerializer=o4.ProtobufLogsSerializer=void 0;var XN0=gk();Object.defineProperty(o4,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return XN0.ProtobufLogsSerializer}});var JN0=Yx();Object.defineProperty(o4,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return JN0.ProtobufMetricsSerializer}});var WN0=qx();Object.defineProperty(o4,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return WN0.ProtobufTraceSerializer}});var KN0=Ux();Object.defineProperty(o4,"JsonLogsSerializer",{enumerable:!0,get:function(){return KN0.JsonLogsSerializer}});var GN0=Tx();Object.defineProperty(o4,"JsonMetricsSerializer",{enumerable:!0,get:function(){return GN0.JsonMetricsSerializer}});var FN0=Ex();Object.defineProperty(o4,"JsonTraceSerializer",{enumerable:!0,get:function(){return FN0.JsonTraceSerializer}})});var Px=H0((Mx)=>{Object.defineProperty(Mx,"__esModule",{value:!0});Mx.validateAndNormalizeHeaders=void 0;var VN0=f1();function qN0(Y){let Z={};return Object.entries(Y??{}).forEach(([W,H])=>{if(typeof H<"u")Z[W]=String(H);else VN0.diag.warn(`Header "${W}" has invalid value (${H}) and will be ignored`)}),Z}Mx.validateAndNormalizeHeaders=qN0});var fx=H0((wx)=>{Object.defineProperty(wx,"__esModule",{value:!0});wx.getHttpConfigurationDefaults=wx.mergeOtlpHttpConfigurationWithDefaults=void 0;var Lx=bZ(),zN0=Px();function BN0(Y,Z,W){return async()=>{let H={...await W()},F={};if(Z!=null)Object.assign(F,await Z());if(Y!=null)Object.assign(F,(0,zN0.validateAndNormalizeHeaders)(await Y()));return Object.assign(F,H)}}function AN0(Y){if(Y==null)return;try{let Z=globalThis.location?.href;return new URL(Y,Z).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${Y}'`)}}function UN0(Y,Z,W){return{...(0,Lx.mergeOtlpSharedConfigurationWithDefaults)(Y,Z,W),headers:BN0(Y.headers,Z.headers,W.headers),url:AN0(Y.url)??Z.url??W.url}}wx.mergeOtlpHttpConfigurationWithDefaults=UN0;function NN0(Y,Z){return{...(0,Lx.getSharedConfigurationDefaults)(),headers:async()=>Y,url:"http://localhost:4318/"+Z}}wx.getHttpConfigurationDefaults=NN0});var JW=H0((vx)=>{Object.defineProperty(vx,"__esModule",{value:!0});vx.getNodeHttpConfigurationDefaults=vx.mergeOtlpNodeHttpConfigurationWithDefaults=vx.httpAgentFactoryFromOptions=void 0;var kx=fx();function yx(Y){return async(Z)=>{let W=Z==="http:",H=W?import("http"):import("https"),{Agent:F}=await H;if(W){let{ca:X,cert:J,key:Q,...G}=Y;return new F(G)}return new F(Y)}}vx.httpAgentFactoryFromOptions=yx;function DN0(Y,Z,W){return{...(0,kx.mergeOtlpHttpConfigurationWithDefaults)(Y,Z,W),agentFactory:Y.agentFactory??Z.agentFactory??W.agentFactory,userAgent:Y.userAgent}}vx.mergeOtlpNodeHttpConfigurationWithDefaults=DN0;function TN0(Y,Z){return{...(0,kx.getHttpConfigurationDefaults)(Y,Z),agentFactory:yx({keepAlive:!0})}}vx.getNodeHttpConfigurationDefaults=TN0});var xx=H0((jx)=>{Object.defineProperty(jx,"__esModule",{value:!0});jx.parseRetryAfterToMills=jx.isExportHTTPErrorRetryable=void 0;function CN0(Y){return Y===429||Y===502||Y===503||Y===504}jx.isExportHTTPErrorRetryable=CN0;function EN0(Y){if(Y==null)return;let Z=Number.parseInt(Y,10);if(Number.isInteger(Z))return Z>0?Z*1000:-1;let W=new Date(Y).getTime()-Date.now();if(W>=0)return W;return 0}jx.parseRetryAfterToMills=EN0});var mx=H0((bx)=>{Object.defineProperty(bx,"__esModule",{value:!0});bx.VERSION=void 0;bx.VERSION="0.214.0"});var nx=H0((cx)=>{Object.defineProperty(cx,"__esModule",{value:!0});cx.compressAndSend=cx.sendWithHttp=void 0;var RN0=V1("zlib"),PN0=V1("stream"),WW=xx(),LN0=AJ(),wN0=mx(),gx=`OTel-OTLP-Exporter-JavaScript/${wN0.VERSION}`;function SN0(Y,Z,W,H,F,X,J,Q){return new Promise((G)=>{let q=new URL(Z);if(F)W["User-Agent"]=`${F} ${gx}`;else W["User-Agent"]=gx;let K={hostname:q.hostname,port:q.port,path:q.pathname,method:"POST",headers:W,agent:X},V=Y(K,(B)=>{let I=[];B.on("data",(M)=>I.push(M)),B.on("end",()=>{if(B.statusCode&&B.statusCode<=299)G({status:"success",data:Buffer.concat(I)});else if(B.statusCode&&(0,WW.isExportHTTPErrorRetryable)(B.statusCode))G({status:"retryable",retryInMillis:(0,WW.parseRetryAfterToMills)(B.headers["retry-after"])});else{let M=new LN0.OTLPExporterError(B.statusMessage,B.statusCode,Buffer.concat(I).toString());G({status:"failure",error:M})}}),B.on("error",(M)=>{if(B.statusCode&&B.statusCode<=299)G({status:"success"});else if(B.statusCode&&(0,WW.isExportHTTPErrorRetryable)(B.statusCode))G({status:"retryable",error:M,retryInMillis:(0,WW.parseRetryAfterToMills)(B.headers["retry-after"])});else G({status:"failure",error:M})})});V.setTimeout(Q,()=>{V.destroy(),G({status:"retryable",error:Error("Request timed out")})}),V.on("error",(B)=>{if(kN0(B))G({status:"retryable",error:B});else G({status:"failure",error:B})}),dx(V,H,J,(B)=>{G({status:"failure",error:B})})})}cx.sendWithHttp=SN0;function dx(Y,Z,W,H){let F=fN0(W);if(Z==="gzip")Y.setHeader("Content-Encoding","gzip"),F=F.on("error",H).pipe(RN0.createGzip()).on("error",H);F.pipe(Y).on("error",H)}cx.compressAndSend=dx;function fN0(Y){let Z=new PN0.Readable;return Z.push(Y),Z.push(null),Z}function kN0(Y){let Z=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);if("code"in Y&&typeof Y.code==="string")return Z.has(Y.code);return!1}});var ax=H0((ix)=>{Object.defineProperty(ix,"__esModule",{value:!0});ix.createHttpExporterTransport=void 0;var vN0=nx();class px{_utils=null;_parameters;constructor(Y){this._parameters=Y}async send(Y,Z){let{agent:W,request:H}=await this._loadUtils(),F=await this._parameters.headers();return(0,vN0.sendWithHttp)(H,this._parameters.url,F,this._parameters.compression,this._parameters.userAgent,W,Y,Z)}shutdown(){}async _loadUtils(){let Y=this._utils;if(Y===null){let Z=new URL(this._parameters.url).protocol,[W,H]=await Promise.all([this._parameters.agentFactory(Z),hN0(Z)]);Y=this._utils={agent:W,request:H}}return Y}}async function hN0(Y){let Z=Y==="http:"?import("http"):import("https"),{request:W}=await Z;return W}function jN0(Y){return new px(Y)}ix.createHttpExporterTransport=jN0});var Yb=H0((sx)=>{Object.defineProperty(sx,"__esModule",{value:!0});sx.createRetryingTransport=void 0;var qQ=f1(),MV=5,_N0=1000,xN0=5000,bN0=1.5,ox=0.2;function uN0(){return Math.random()*(2*ox)-ox}class tx{_transport;constructor(Y){this._transport=Y}retry(Y,Z,W){return new Promise((H,F)=>{setTimeout(()=>{this._transport.send(Y,Z).then(H,F)},W)})}async send(Y,Z){let W=MV,H=_N0,F=Date.now()+Z,X=await this._transport.send(Y,Z);while(X.status==="retryable"&&W>0){W--;let J=Math.max(Math.min(H*(1+uN0()),xN0),0);H=H*bN0;let Q=X.retryInMillis??J,G=F-Date.now();if(Q>G)return qQ.diag.info(`Export retry time ${Math.round(Q)}ms exceeds remaining timeout ${Math.round(G)}ms, not retrying further.`),X;qQ.diag.verbose(`Scheduling export retry in ${Math.round(Q)}ms`),X=await this.retry(Y,G,Q)}if(X.status==="success")qQ.diag.verbose(`Export succeeded after ${MV-W} retry attempts.`);else if(X.status==="retryable")qQ.diag.info(`Export failed after maximum retry attempts (${MV}).`);else qQ.diag.info(`Export failed with non-retryable error: ${X.error}`);return X}shutdown(){return this._transport.shutdown()}}function mN0(Y){return new tx(Y.transport)}sx.createRetryingTransport=mN0});var Xb=H0((Zb)=>{Object.defineProperty(Zb,"__esModule",{value:!0});Zb.createOtlpHttpExportDelegate=void 0;var gN0=NH(),dN0=ax(),cN0=eF(),lN0=Yb();function nN0(Y,Z){return(0,gN0.createOtlpExportDelegate)({transport:(0,lN0.createRetryingTransport)({transport:(0,dN0.createHttpExporterTransport)(Y)}),serializer:Z,promiseHandler:(0,cN0.createBoundedQueueExportPromiseHandler)(Y)},{timeout:Y.timeoutMillis})}Zb.createOtlpHttpExportDelegate=nN0});var RV=H0((Fb)=>{Object.defineProperty(Fb,"__esModule",{value:!0});Fb.getSharedConfigurationFromEnvironment=void 0;var Kb=G6(),Gb=f1();function Jb(Y){let Z=(0,Kb.getNumberFromEnv)(Y);if(Z!=null){if(Number.isFinite(Z)&&Z>0)return Z;Gb.diag.warn(`Configuration: ${Y} is invalid, expected number greater than 0 (actual: ${Z})`)}return}function pN0(Y){let Z=Jb(`OTEL_EXPORTER_OTLP_${Y}_TIMEOUT`),W=Jb("OTEL_EXPORTER_OTLP_TIMEOUT");return Z??W}function Wb(Y){let Z=(0,Kb.getStringFromEnv)(Y)?.trim();if(Z==null||Z==="none"||Z==="gzip")return Z;Gb.diag.warn(`Configuration: ${Y} is invalid, expected 'none' or 'gzip' (actual: '${Z}')`);return}function iN0(Y){let Z=Wb(`OTEL_EXPORTER_OTLP_${Y}_COMPRESSION`),W=Wb("OTEL_EXPORTER_OTLP_COMPRESSION");return Z??W}function rN0(Y){return{timeoutMillis:pN0(Y),compression:iN0(Y)}}Fb.getSharedConfigurationFromEnvironment=rN0});var zb=H0((Vb)=>{Object.defineProperty(Vb,"__esModule",{value:!0});Vb.getNodeHttpConfigurationFromEnvironment=void 0;var aN0=V1("fs"),oN0=V1("path"),r9=G6(),KW=f1(),tN0=RV(),sN0=bZ(),eN0=JW();function YO0(Y){let Z=(0,r9.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${Y}_HEADERS`),W=(0,r9.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"),H=(0,r9.parseKeyPairsIntoRecord)(Z),F=(0,r9.parseKeyPairsIntoRecord)(W);if(Object.keys(H).length===0&&Object.keys(F).length===0)return;return Object.assign({},(0,r9.parseKeyPairsIntoRecord)(W),(0,r9.parseKeyPairsIntoRecord)(Z))}function ZO0(Y){try{return new URL(Y).toString()}catch{KW.diag.warn(`Configuration: Could not parse environment-provided export URL: '${Y}', falling back to undefined`);return}}function QO0(Y,Z){try{new URL(Y)}catch{KW.diag.warn(`Configuration: Could not parse environment-provided export URL: '${Y}', falling back to undefined`);return}if(!Y.endsWith("/"))Y=Y+"/";Y+=Z;try{new URL(Y)}catch{KW.diag.warn(`Configuration: Provided URL appended with '${Z}' is not a valid URL, using 'undefined' instead of '${Y}'`);return}return Y}function XO0(Y){let Z=(0,r9.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT");if(Z===void 0)return;return QO0(Z,Y)}function JO0(Y){let Z=(0,r9.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${Y}_ENDPOINT`);if(Z===void 0)return;return ZO0(Z)}function PV(Y,Z,W){let H=(0,r9.getStringFromEnv)(Y),F=(0,r9.getStringFromEnv)(Z),X=H??F;if(X!=null)try{return aN0.readFileSync(oN0.resolve(process.cwd(),X))}catch{KW.diag.warn(W);return}else return}function WO0(Y){return PV(`OTEL_EXPORTER_OTLP_${Y}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function KO0(Y){return PV(`OTEL_EXPORTER_OTLP_${Y}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function GO0(Y){return PV(`OTEL_EXPORTER_OTLP_${Y}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function FO0(Y,Z){return{...(0,tN0.getSharedConfigurationFromEnvironment)(Y),url:JO0(Y)??XO0(Z),headers:(0,sN0.wrapStaticHeadersInFunction)(YO0(Y)),agentFactory:(0,eN0.httpAgentFactoryFromOptions)({keepAlive:!0,ca:GO0(Y),cert:WO0(Y),key:KO0(Y)})}}Vb.getNodeHttpConfigurationFromEnvironment=FO0});var Ub=H0((Bb)=>{Object.defineProperty(Bb,"__esModule",{value:!0});Bb.convertLegacyHeaders=void 0;var HO0=bZ();function VO0(Y){if(typeof Y.headers==="function")return Y.headers;return(0,HO0.wrapStaticHeadersInFunction)(Y.headers)}Bb.convertLegacyHeaders=VO0});var Tb=H0((Ob)=>{Object.defineProperty(Ob,"__esModule",{value:!0});Ob.convertLegacyHttpOptions=void 0;var qO0=f1(),Nb=JW(),zO0=zQ(),BO0=zb(),AO0=Ub();function UO0(Y){if(typeof Y.httpAgentOptions==="function")return Y.httpAgentOptions;let Z=Y.httpAgentOptions;if(Y.keepAlive!=null)Z={keepAlive:Y.keepAlive,...Z};if(Z!=null)return(0,zO0.httpAgentFactoryFromOptions)(Z);else return}function NO0(Y,Z,W,H){if(Y.metadata)qO0.diag.warn("Metadata cannot be set when using http");return(0,Nb.mergeOtlpNodeHttpConfigurationWithDefaults)({url:Y.url,headers:(0,AO0.convertLegacyHeaders)(Y),concurrencyLimit:Y.concurrencyLimit,timeoutMillis:Y.timeoutMillis,compression:Y.compression,agentFactory:UO0(Y),userAgent:Y.userAgent},(0,BO0.getNodeHttpConfigurationFromEnvironment)(Z,W),(0,Nb.getNodeHttpConfigurationDefaults)(H,W))}Ob.convertLegacyHttpOptions=NO0});var zQ=H0((VY)=>{Object.defineProperty(VY,"__esModule",{value:!0});VY.convertLegacyHttpOptions=VY.getSharedConfigurationFromEnvironment=VY.createOtlpHttpExportDelegate=VY.httpAgentFactoryFromOptions=void 0;var OO0=JW();Object.defineProperty(VY,"httpAgentFactoryFromOptions",{enumerable:!0,get:function(){return OO0.httpAgentFactoryFromOptions}});var DO0=Xb();Object.defineProperty(VY,"createOtlpHttpExportDelegate",{enumerable:!0,get:function(){return DO0.createOtlpHttpExportDelegate}});var TO0=RV();Object.defineProperty(VY,"getSharedConfigurationFromEnvironment",{enumerable:!0,get:function(){return TO0.getSharedConfigurationFromEnvironment}});var IO0=Tb();Object.defineProperty(VY,"convertLegacyHttpOptions",{enumerable:!0,get:function(){return IO0.convertLegacyHttpOptions}})});var Mb=H0((Cb)=>{Object.defineProperty(Cb,"__esModule",{value:!0});Cb.OTLPLogExporter=void 0;var CO0=LJ(),EO0=XW(),Ib=zQ();class $b extends CO0.OTLPExporterBase{constructor(Y={}){super((0,Ib.createOtlpHttpExportDelegate)((0,Ib.convertLegacyHttpOptions)(Y,"LOGS","v1/logs",{"Content-Type":"application/json"}),EO0.JsonLogsSerializer))}}Cb.OTLPLogExporter=$b});var Rb=H0((LV)=>{Object.defineProperty(LV,"__esModule",{value:!0});LV.OTLPLogExporter=void 0;var MO0=Mb();Object.defineProperty(LV,"OTLPLogExporter",{enumerable:!0,get:function(){return MO0.OTLPLogExporter}})});var Pb=H0((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});wV.OTLPLogExporter=void 0;var PO0=Rb();Object.defineProperty(wV,"OTLPLogExporter",{enumerable:!0,get:function(){return PO0.OTLPLogExporter}})});var Lb=H0((SV)=>{Object.defineProperty(SV,"__esModule",{value:!0});SV.OTLPLogExporter=void 0;var wO0=Pb();Object.defineProperty(SV,"OTLPLogExporter",{enumerable:!0,get:function(){return wO0.OTLPLogExporter}})});var kV=H0((wb)=>{Object.defineProperty(wb,"__esModule",{value:!0});wb.AggregationTemporalityPreference=void 0;var fO0;(function(Y){Y[Y.DELTA=0]="DELTA",Y[Y.CUMULATIVE=1]="CUMULATIVE",Y[Y.LOWMEMORY=2]="LOWMEMORY"})(fO0=wb.AggregationTemporalityPreference||(wb.AggregationTemporalityPreference={}))});var hV=H0((kb)=>{Object.defineProperty(kb,"__esModule",{value:!0});kb.OTLPMetricExporterBase=kb.LowMemoryTemporalitySelector=kb.DeltaTemporalitySelector=kb.CumulativeTemporalitySelector=void 0;var kO0=G6(),a6=QW(),Sb=kV(),yO0=LJ(),vO0=f1(),hO0=()=>a6.AggregationTemporality.CUMULATIVE;kb.CumulativeTemporalitySelector=hO0;var jO0=(Y)=>{switch(Y){case a6.InstrumentType.COUNTER:case a6.InstrumentType.OBSERVABLE_COUNTER:case a6.InstrumentType.GAUGE:case a6.InstrumentType.HISTOGRAM:case a6.InstrumentType.OBSERVABLE_GAUGE:return a6.AggregationTemporality.DELTA;case a6.InstrumentType.UP_DOWN_COUNTER:case a6.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return a6.AggregationTemporality.CUMULATIVE}};kb.DeltaTemporalitySelector=jO0;var _O0=(Y)=>{switch(Y){case a6.InstrumentType.COUNTER:case a6.InstrumentType.HISTOGRAM:return a6.AggregationTemporality.DELTA;case a6.InstrumentType.GAUGE:case a6.InstrumentType.UP_DOWN_COUNTER:case a6.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:case a6.InstrumentType.OBSERVABLE_COUNTER:case a6.InstrumentType.OBSERVABLE_GAUGE:return a6.AggregationTemporality.CUMULATIVE}};kb.LowMemoryTemporalitySelector=_O0;function xO0(){let Y=((0,kO0.getStringFromEnv)("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE")??"cumulative").toLowerCase();if(Y==="cumulative")return kb.CumulativeTemporalitySelector;if(Y==="delta")return kb.DeltaTemporalitySelector;if(Y==="lowmemory")return kb.LowMemoryTemporalitySelector;return vO0.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${Y}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),kb.CumulativeTemporalitySelector}function bO0(Y){if(Y!=null){if(Y===Sb.AggregationTemporalityPreference.DELTA)return kb.DeltaTemporalitySelector;else if(Y===Sb.AggregationTemporalityPreference.LOWMEMORY)return kb.LowMemoryTemporalitySelector;return kb.CumulativeTemporalitySelector}return xO0()}var uO0=Object.freeze({type:a6.AggregationType.DEFAULT});function mO0(Y){return Y?.aggregationPreference??(()=>uO0)}class fb extends yO0.OTLPExporterBase{_aggregationTemporalitySelector;_aggregationSelector;constructor(Y,Z){super(Y);this._aggregationSelector=mO0(Z),this._aggregationTemporalitySelector=bO0(Z?.temporalityPreference)}selectAggregation(Y){return this._aggregationSelector(Y)}selectAggregationTemporality(Y){return this._aggregationTemporalitySelector(Y)}}kb.OTLPMetricExporterBase=fb});var xb=H0((jb)=>{Object.defineProperty(jb,"__esModule",{value:!0});jb.OTLPMetricExporter=void 0;var gO0=hV(),dO0=XW(),vb=zQ();class hb extends gO0.OTLPMetricExporterBase{constructor(Y){super((0,vb.createOtlpHttpExportDelegate)((0,vb.convertLegacyHttpOptions)(Y??{},"METRICS","v1/metrics",{"Content-Type":"application/json"}),dO0.JsonMetricsSerializer),Y)}}jb.OTLPMetricExporter=hb});var bb=H0((jV)=>{Object.defineProperty(jV,"__esModule",{value:!0});jV.OTLPMetricExporter=void 0;var cO0=xb();Object.defineProperty(jV,"OTLPMetricExporter",{enumerable:!0,get:function(){return cO0.OTLPMetricExporter}})});var ub=H0((_V)=>{Object.defineProperty(_V,"__esModule",{value:!0});_V.OTLPMetricExporter=void 0;var nO0=bb();Object.defineProperty(_V,"OTLPMetricExporter",{enumerable:!0,get:function(){return nO0.OTLPMetricExporter}})});var mb=H0((t4)=>{Object.defineProperty(t4,"__esModule",{value:!0});t4.OTLPMetricExporterBase=t4.LowMemoryTemporalitySelector=t4.DeltaTemporalitySelector=t4.CumulativeTemporalitySelector=t4.AggregationTemporalityPreference=t4.OTLPMetricExporter=void 0;var iO0=ub();Object.defineProperty(t4,"OTLPMetricExporter",{enumerable:!0,get:function(){return iO0.OTLPMetricExporter}});var rO0=kV();Object.defineProperty(t4,"AggregationTemporalityPreference",{enumerable:!0,get:function(){return rO0.AggregationTemporalityPreference}});var FW=hV();Object.defineProperty(t4,"CumulativeTemporalitySelector",{enumerable:!0,get:function(){return FW.CumulativeTemporalitySelector}});Object.defineProperty(t4,"DeltaTemporalitySelector",{enumerable:!0,get:function(){return FW.DeltaTemporalitySelector}});Object.defineProperty(t4,"LowMemoryTemporalitySelector",{enumerable:!0,get:function(){return FW.LowMemoryTemporalitySelector}});Object.defineProperty(t4,"OTLPMetricExporterBase",{enumerable:!0,get:function(){return FW.OTLPMetricExporterBase}})});var nb=H0((cb)=>{Object.defineProperty(cb,"__esModule",{value:!0});cb.OTLPTraceExporter=void 0;var oO0=LJ(),tO0=XW(),gb=zQ();class db extends oO0.OTLPExporterBase{constructor(Y={}){super((0,gb.createOtlpHttpExportDelegate)((0,gb.convertLegacyHttpOptions)(Y,"TRACES","v1/traces",{"Content-Type":"application/json"}),tO0.JsonTraceSerializer))}}cb.OTLPTraceExporter=db});var pb=H0((xV)=>{Object.defineProperty(xV,"__esModule",{value:!0});xV.OTLPTraceExporter=void 0;var sO0=nb();Object.defineProperty(xV,"OTLPTraceExporter",{enumerable:!0,get:function(){return sO0.OTLPTraceExporter}})});var ib=H0((bV)=>{Object.defineProperty(bV,"__esModule",{value:!0});bV.OTLPTraceExporter=void 0;var YD0=pb();Object.defineProperty(bV,"OTLPTraceExporter",{enumerable:!0,get:function(){return YD0.OTLPTraceExporter}})});var rb=H0((uV)=>{Object.defineProperty(uV,"__esModule",{value:!0});uV.OTLPTraceExporter=void 0;var QD0=ib();Object.defineProperty(uV,"OTLPTraceExporter",{enumerable:!0,get:function(){return QD0.OTLPTraceExporter}})});var tb=H0((ab)=>{Object.defineProperty(ab,"__esModule",{value:!0});ab.isLogAttributeValue=void 0;function JD0(Y){return mV(Y,new WeakSet)}ab.isLogAttributeValue=JD0;function mV(Y,Z){if(Y==null)return!0;if(typeof Y==="string"||typeof Y==="number"||typeof Y==="boolean")return!0;if(Y instanceof Uint8Array)return!0;if(typeof Y==="object"){if(Z.has(Y))return!1;if(Z.add(Y),Array.isArray(Y))return Y.every((H)=>mV(H,Z));let W=Y;if(W.constructor!==Object&&W.constructor!==void 0)return!1;return Object.values(W).every((H)=>mV(H,Z))}return!1}});var Qu=H0((Yu)=>{Object.defineProperty(Yu,"__esModule",{value:!0});Yu.LogRecordImpl=void 0;var s4=f1(),sb=G6(),a9=m5(),WD0=tb();class eb{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;_attributesCount=0;_droppedAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(Y){if(this._isLogRecordReadonly())return;this._severityText=Y}get severityText(){return this._severityText}set severityNumber(Y){if(this._isLogRecordReadonly())return;this._severityNumber=Y}get severityNumber(){return this._severityNumber}set body(Y){if(this._isLogRecordReadonly())return;this._body=Y}get body(){return this._body}get eventName(){return this._eventName}set eventName(Y){if(this._isLogRecordReadonly())return;this._eventName=Y}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(Y,Z,W){let{timestamp:H,observedTimestamp:F,eventName:X,severityNumber:J,severityText:Q,body:G,attributes:q={},exception:K,context:V}=W,B=Date.now();if(this.hrTime=(0,sb.timeInputToHrTime)(H??B),this.hrTimeObserved=(0,sb.timeInputToHrTime)(F??B),V){let I=s4.trace.getSpanContext(V);if(I&&s4.isSpanContextValid(I))this.spanContext=I}if(this.severityNumber=J,this.severityText=Q,this.body=G,this.resource=Y.resource,this.instrumentationScope=Z,this._logRecordLimits=Y.logRecordLimits,this._eventName=X,this.setAttributes(q),K!=null)this._setException(K)}setAttribute(Y,Z){if(this._isLogRecordReadonly())return this;if(Y.length===0)return s4.diag.warn(`Invalid attribute key: ${Y}`),this;if(!(0,WD0.isLogAttributeValue)(Z))return s4.diag.warn(`Invalid attribute value set for key: ${Y}`),this;let W=!Object.prototype.hasOwnProperty.call(this.attributes,Y);if(W&&this._attributesCount>=this._logRecordLimits.attributeCountLimit){if(this._droppedAttributesCount++,this._droppedAttributesCount===1)s4.diag.warn("Dropping extra attributes.");return this}if(this.attributes[Y]=this._truncateToSize(Z),W)this._attributesCount++;return this}setAttributes(Y){for(let[Z,W]of Object.entries(Y))this.setAttribute(Z,W);return this}setBody(Y){return this.body=Y,this}setEventName(Y){return this.eventName=Y,this}setSeverityNumber(Y){return this.severityNumber=Y,this}setSeverityText(Y){return this.severityText=Y,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(Y){let Z=this._logRecordLimits.attributeValueLengthLimit;if(Z<=0)return s4.diag.warn(`Attribute value limit must be positive, got ${Z}`),Y;if(Y==null)return Y;if(typeof Y==="string")return this._truncateToLimitUtil(Y,Z);if(Y instanceof Uint8Array)return Y;if(Array.isArray(Y))return Y.map((W)=>this._truncateToSize(W));if(typeof Y==="object"){let W={};for(let[H,F]of Object.entries(Y))W[H]=this._truncateToSize(F);return W}return Y}_setException(Y){let Z=!1;if(typeof Y==="string"||typeof Y==="number"){if(!Object.hasOwn(this.attributes,a9.ATTR_EXCEPTION_MESSAGE))this.setAttribute(a9.ATTR_EXCEPTION_MESSAGE,String(Y));Z=!0}else if(Y&&typeof Y==="object"){let W=Y;if(W.code){if(!Object.hasOwn(this.attributes,a9.ATTR_EXCEPTION_TYPE))this.setAttribute(a9.ATTR_EXCEPTION_TYPE,W.code.toString());Z=!0}else if(W.name){if(!Object.hasOwn(this.attributes,a9.ATTR_EXCEPTION_TYPE))this.setAttribute(a9.ATTR_EXCEPTION_TYPE,W.name);Z=!0}if(W.message){if(!Object.hasOwn(this.attributes,a9.ATTR_EXCEPTION_MESSAGE))this.setAttribute(a9.ATTR_EXCEPTION_MESSAGE,W.message);Z=!0}if(W.stack){if(!Object.hasOwn(this.attributes,a9.ATTR_EXCEPTION_STACKTRACE))this.setAttribute(a9.ATTR_EXCEPTION_STACKTRACE,W.stack);Z=!0}}if(!Z)s4.diag.warn(`Failed to record an exception ${Y}`)}_truncateToLimitUtil(Y,Z){if(Y.length<=Z)return Y;return Y.substring(0,Z)}_isLogRecordReadonly(){if(this._isReadonly)s4.diag.warn("Can not execute the operation on emitted log record");return this._isReadonly}}Yu.LogRecordImpl=eb});var Gu=H0((Wu)=>{Object.defineProperty(Wu,"__esModule",{value:!0});Wu.Logger=void 0;var Xu=o7(),BQ=f1(),KD0=Qu();class Ju{instrumentationScope;_sharedState;_loggerConfig;constructor(Y,Z){this.instrumentationScope=Y,this._sharedState=Z,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(Y){let Z=this._loggerConfig,W=Y.context||BQ.context.active(),H=Y.severityNumber??Xu.SeverityNumber.UNSPECIFIED;if(H!==Xu.SeverityNumber.UNSPECIFIED&&H<Z.minimumSeverity)return;if(Z.traceBased){let X=BQ.trace.getSpanContext(W);if(X&&(0,BQ.isSpanContextValid)(X)){if((X.traceFlags&BQ.TraceFlags.SAMPLED)!==BQ.TraceFlags.SAMPLED)return}}let F=new KD0.LogRecordImpl(this._sharedState,this.instrumentationScope,{context:W,...Y});this._sharedState.activeProcessor.onEmit(F,W),F._makeReadonly()}}Wu.Logger=Ju});var qu=H0((Hu)=>{Object.defineProperty(Hu,"__esModule",{value:!0});Hu.NoopLogRecordProcessor=void 0;class Fu{forceFlush(){return Promise.resolve()}onEmit(Y,Z){}shutdown(){return Promise.resolve()}}Hu.NoopLogRecordProcessor=Fu});var Uu=H0((Bu)=>{Object.defineProperty(Bu,"__esModule",{value:!0});Bu.MultiLogRecordProcessor=void 0;var GD0=G6();class zu{processors;forceFlushTimeoutMillis;constructor(Y,Z){this.processors=Y,this.forceFlushTimeoutMillis=Z}async forceFlush(){let Y=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map((Z)=>(0,GD0.callWithTimeout)(Z.forceFlush(),Y)))}onEmit(Y,Z){this.processors.forEach((W)=>W.onEmit(Y,Z))}async shutdown(){await Promise.all(this.processors.map((Y)=>Y.shutdown()))}}Bu.MultiLogRecordProcessor=zu});var Du=H0((Nu)=>{Object.defineProperty(Nu,"__esModule",{value:!0});Nu.getInstrumentationScopeKey=void 0;function FD0(Y){return`${Y.name}@${Y.version||""}:${Y.schemaUrl||""}`}Nu.getInstrumentationScopeKey=FD0});var Eu=H0((Iu)=>{Object.defineProperty(Iu,"__esModule",{value:!0});Iu.LoggerProviderSharedState=Iu.DEFAULT_LOGGER_CONFIGURATOR=void 0;var HD0=o7(),VD0=qu(),qD0=Uu(),zD0=Du(),BD0={disabled:!1,minimumSeverity:HD0.SeverityNumber.UNSPECIFIED,traceBased:!1},AD0=()=>({...BD0});Iu.DEFAULT_LOGGER_CONFIGURATOR=AD0;class Tu{loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];resource;forceFlushTimeoutMillis;logRecordLimits;processors;_loggerConfigurator;_loggerConfigs=new Map;constructor(Y,Z,W,H,F){if(this.resource=Y,this.forceFlushTimeoutMillis=Z,this.logRecordLimits=W,this.processors=H,H.length>0)this.registeredLogRecordProcessors=H,this.activeProcessor=new qD0.MultiLogRecordProcessor(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis);else this.activeProcessor=new VD0.NoopLogRecordProcessor;this._loggerConfigurator=F??Iu.DEFAULT_LOGGER_CONFIGURATOR}getLoggerConfig(Y){let Z=(0,zD0.getInstrumentationScopeKey)(Y),W=this._loggerConfigs.get(Z);if(W)return W;return W=this._loggerConfigurator(Y),this._loggerConfigs.set(Z,W),W}}Iu.LoggerProviderSharedState=Tu});var Su=H0((Pu)=>{Object.defineProperty(Pu,"__esModule",{value:!0});Pu.LoggerProvider=Pu.DEFAULT_LOGGER_NAME=void 0;var HW=f1(),UD0=o7(),ND0=WQ(),OD0=G6(),DD0=Gu(),Mu=Eu();Pu.DEFAULT_LOGGER_NAME="unknown";class Ru{_shutdownOnce;_sharedState;constructor(Y={}){let Z={resource:Y.resource??(0,ND0.defaultResource)(),forceFlushTimeoutMillis:Y.forceFlushTimeoutMillis??30000,logRecordLimits:{attributeCountLimit:Y.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:Y.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:Y.loggerConfigurator??Mu.DEFAULT_LOGGER_CONFIGURATOR,processors:Y.processors??[]};this._sharedState=new Mu.LoggerProviderSharedState(Z.resource,Z.forceFlushTimeoutMillis,Z.logRecordLimits,Z.processors,Z.loggerConfigurator),this._shutdownOnce=new OD0.BindOnceFuture(this._shutdown,this)}getLogger(Y,Z,W){if(this._shutdownOnce.isCalled)return HW.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),UD0.NOOP_LOGGER;if(!Y)HW.diag.warn("Logger requested without instrumentation scope name.");let H=Y||Pu.DEFAULT_LOGGER_NAME,F=`${H}@${Z||""}:${W?.schemaUrl||""}`;if(!this._sharedState.loggers.has(F))this._sharedState.loggers.set(F,new DD0.Logger({name:H,version:Z,schemaUrl:W?.schemaUrl},this._sharedState));return this._sharedState.loggers.get(F)}forceFlush(){if(this._shutdownOnce.isCalled)return HW.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise;return this._sharedState.activeProcessor.forceFlush()}shutdown(){if(this._shutdownOnce.isCalled)return HW.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise;return this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}Pu.LoggerProvider=Ru});var hu=H0((yu)=>{Object.defineProperty(yu,"__esModule",{value:!0});yu.ConsoleLogRecordExporter=void 0;var fu=G6();class ku{export(Y,Z){this._sendLogRecords(Y,Z)}shutdown(){return Promise.resolve()}_exportInfo(Y){return{resource:{attributes:Y.resource.attributes},instrumentationScope:Y.instrumentationScope,timestamp:(0,fu.hrTimeToMicroseconds)(Y.hrTime),traceId:Y.spanContext?.traceId,spanId:Y.spanContext?.spanId,traceFlags:Y.spanContext?.traceFlags,severityText:Y.severityText,severityNumber:Y.severityNumber,eventName:Y.eventName,body:Y.body,attributes:Y.attributes}}_sendLogRecords(Y,Z){for(let W of Y)console.dir(this._exportInfo(W),{depth:3});Z?.({code:fu.ExportResultCode.SUCCESS})}}yu.ConsoleLogRecordExporter=ku});var bu=H0((_u)=>{Object.defineProperty(_u,"__esModule",{value:!0});_u.SimpleLogRecordProcessor=void 0;var qY=G6();class ju{_exporter;_shutdownOnce;_unresolvedExports;constructor(Y){this._exporter=Y,this._shutdownOnce=new qY.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}onEmit(Y){if(this._shutdownOnce.isCalled)return;let Z=()=>qY.internal._export(this._exporter,[Y]).then((W)=>{if(W.code!==qY.ExportResultCode.SUCCESS)(0,qY.globalErrorHandler)(W.error??Error(`SimpleLogRecordProcessor: log record export failed (status ${W})`))}).catch(qY.globalErrorHandler);if(Y.resource.asyncAttributesPending){let W=Y.resource.waitForAsyncAttributes?.().then(()=>{return this._unresolvedExports.delete(W),Z()},qY.globalErrorHandler);if(W!=null)this._unresolvedExports.add(W)}else Z()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}_u.SimpleLogRecordProcessor=ju});var cu=H0((gu)=>{Object.defineProperty(gu,"__esModule",{value:!0});gu.InMemoryLogRecordExporter=void 0;var uu=G6();class mu{_finishedLogRecords=[];_stopped=!1;export(Y,Z){if(this._stopped)return Z({code:uu.ExportResultCode.FAILED,error:Error("Exporter has been stopped")});this._finishedLogRecords.push(...Y),Z({code:uu.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}}gu.InMemoryLogRecordExporter=mu});var iu=H0((nu)=>{Object.defineProperty(nu,"__esModule",{value:!0});nu.BatchLogRecordProcessorBase=void 0;var TD0=f1(),e4=G6();class lu{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedLogRecords=[];_timer;_shutdownOnce;constructor(Y,Z){if(this._exporter=Y,this._maxExportBatchSize=Z?.maxExportBatchSize??512,this._maxQueueSize=Z?.maxQueueSize??2048,this._scheduledDelayMillis=Z?.scheduledDelayMillis??5000,this._exportTimeoutMillis=Z?.exportTimeoutMillis??30000,this._shutdownOnce=new e4.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)TD0.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}onEmit(Y){if(this._shutdownOnce.isCalled)return;this._addToBuffer(Y)}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(Y){if(this._finishedLogRecords.length>=this._maxQueueSize)return;this._finishedLogRecords.push(Y),this._maybeStartTimer()}_flushAll(){return new Promise((Y,Z)=>{let W=[],H=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let F=0;F<H;F++)W.push(this._flushOneBatch());Promise.all(W).then(()=>{Y()}).catch(Z)})}_flushOneBatch(){if(this._clearTimer(),this._finishedLogRecords.length===0)return Promise.resolve();return(0,e4.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis)}_maybeStartTimer(){if(this._isExporting)return;let Y=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{if(this._isExporting=!1,this._finishedLogRecords.length>0)this._clearTimer(),this._maybeStartTimer()}).catch((Z)=>{this._isExporting=!1,(0,e4.globalErrorHandler)(Z)})};if(this._finishedLogRecords.length>=this._maxExportBatchSize)return Y();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>Y(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}_export(Y){let Z=()=>e4.internal._export(this._exporter,Y).then((H)=>{if(H.code!==e4.ExportResultCode.SUCCESS)(0,e4.globalErrorHandler)(H.error??Error(`BatchLogRecordProcessor: log record export failed (status ${H})`))}).catch(e4.globalErrorHandler),W=[];for(let H=0;H<Y.length;H++){let F=Y[H].resource;if(F.asyncAttributesPending&&typeof F.waitForAsyncAttributes==="function")W.push(F.waitForAsyncAttributes())}if(W.length===0)return Z();else return Promise.all(W).then(Z,e4.globalErrorHandler)}}nu.BatchLogRecordProcessorBase=lu});var tu=H0((au)=>{Object.defineProperty(au,"__esModule",{value:!0});au.BatchLogRecordProcessor=void 0;var ID0=iu();class ru extends ID0.BatchLogRecordProcessorBase{onShutdown(){}}au.BatchLogRecordProcessor=ru});var su=H0((gV)=>{Object.defineProperty(gV,"__esModule",{value:!0});gV.BatchLogRecordProcessor=void 0;var $D0=tu();Object.defineProperty(gV,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return $D0.BatchLogRecordProcessor}})});var eu=H0((dV)=>{Object.defineProperty(dV,"__esModule",{value:!0});dV.BatchLogRecordProcessor=void 0;var ED0=su();Object.defineProperty(dV,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return ED0.BatchLogRecordProcessor}})});var Qm=H0((Ym)=>{Object.defineProperty(Ym,"__esModule",{value:!0});Ym.createLoggerConfigurator=void 0;var RD0=o7(),VW={disabled:!1,minimumSeverity:RD0.SeverityNumber.UNSPECIFIED,traceBased:!1};function PD0(Y){return(Z)=>{let W=Z.name;for(let{pattern:H,config:F}of Y)if(LD0(W,H))return{disabled:F.disabled??VW.disabled,minimumSeverity:F.minimumSeverity??VW.minimumSeverity,traceBased:F.traceBased??VW.traceBased};return{...VW}}}Ym.createLoggerConfigurator=PD0;function LD0(Y,Z){if(Z===Y)return!0;if(Z.includes("*")){let W=Z.split("*").map((F)=>F.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*");return new RegExp(`^${W}$`).test(Y)}return!1}});var Xm=H0((Y5)=>{Object.defineProperty(Y5,"__esModule",{value:!0});Y5.createLoggerConfigurator=Y5.BatchLogRecordProcessor=Y5.InMemoryLogRecordExporter=Y5.SimpleLogRecordProcessor=Y5.ConsoleLogRecordExporter=Y5.LoggerProvider=void 0;var wD0=Su();Object.defineProperty(Y5,"LoggerProvider",{enumerable:!0,get:function(){return wD0.LoggerProvider}});var SD0=hu();Object.defineProperty(Y5,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return SD0.ConsoleLogRecordExporter}});var fD0=bu();Object.defineProperty(Y5,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return fD0.SimpleLogRecordProcessor}});var kD0=cu();Object.defineProperty(Y5,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return kD0.InMemoryLogRecordExporter}});var yD0=eu();Object.defineProperty(Y5,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return yD0.BatchLogRecordProcessor}});var vD0=Qm();Object.defineProperty(Y5,"createLoggerConfigurator",{enumerable:!0,get:function(){return vD0.createLoggerConfigurator}})});var Km=H0((Jm)=>{Object.defineProperty(Jm,"__esModule",{value:!0});Jm.ExceptionEventName=void 0;Jm.ExceptionEventName="exception"});var Vm=H0((Fm)=>{Object.defineProperty(Fm,"__esModule",{value:!0});Fm.SpanImpl=void 0;var O8=f1(),D8=G6(),X7=m5(),jD0=Km();class Gm{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:O8.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(Y){let Z=Date.now();if(this._spanContext=Y.spanContext,this._performanceStartTime=D8.otperformance.now(),this._performanceOffset=Z-(this._performanceStartTime+D8.otperformance.timeOrigin),this._startTimeProvided=Y.startTime!=null,this._spanLimits=Y.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=Y.spanProcessor,this.name=Y.name,this.parentSpanContext=Y.parentSpanContext,this.kind=Y.kind,Y.links)for(let W of Y.links)this.addLink(W);if(this.startTime=this._getTime(Y.startTime??Z),this.resource=Y.resource,this.instrumentationScope=Y.scope,this._recordEndMetrics=Y.recordEndMetrics,Y.attributes!=null)this.setAttributes(Y.attributes);this._spanProcessor.onStart(this,Y.context)}spanContext(){return this._spanContext}setAttribute(Y,Z){if(Z==null||this._isSpanEnded())return this;if(Y.length===0)return O8.diag.warn(`Invalid attribute key: ${Y}`),this;if(!(0,D8.isAttributeValue)(Z))return O8.diag.warn(`Invalid attribute value set for key: ${Y}`),this;let{attributeCountLimit:W}=this._spanLimits,H=!Object.prototype.hasOwnProperty.call(this.attributes,Y);if(W!==void 0&&this._attributesCount>=W&&H)return this._droppedAttributesCount++,this;if(this.attributes[Y]=this._truncateToSize(Z),H)this._attributesCount++;return this}setAttributes(Y){for(let Z in Y)if(Object.prototype.hasOwnProperty.call(Y,Z))this.setAttribute(Z,Y[Z]);return this}addEvent(Y,Z,W){if(this._isSpanEnded())return this;let{eventCountLimit:H}=this._spanLimits;if(H===0)return O8.diag.warn("No events allowed."),this._droppedEventsCount++,this;if(H!==void 0&&this.events.length>=H){if(this._droppedEventsCount===0)O8.diag.debug("Dropping extra events.");this.events.shift(),this._droppedEventsCount++}if((0,D8.isTimeInput)(Z)){if(!(0,D8.isTimeInput)(W))W=Z;Z=void 0}let F=(0,D8.sanitizeAttributes)(Z),{attributePerEventCountLimit:X}=this._spanLimits,J={},Q=0,G=0;for(let q in F){if(!Object.prototype.hasOwnProperty.call(F,q))continue;let K=F[q];if(X!==void 0&&G>=X){Q++;continue}J[q]=this._truncateToSize(K),G++}return this.events.push({name:Y,attributes:J,time:this._getTime(W),droppedAttributesCount:Q}),this}addLink(Y){if(this._isSpanEnded())return this;let{linkCountLimit:Z}=this._spanLimits;if(Z===0)return this._droppedLinksCount++,this;if(Z!==void 0&&this.links.length>=Z){if(this._droppedLinksCount===0)O8.diag.debug("Dropping extra links.");this.links.shift(),this._droppedLinksCount++}let{attributePerLinkCountLimit:W}=this._spanLimits,H=(0,D8.sanitizeAttributes)(Y.attributes),F={},X=0,J=0;for(let G in H){if(!Object.prototype.hasOwnProperty.call(H,G))continue;let q=H[G];if(W!==void 0&&J>=W){X++;continue}F[G]=this._truncateToSize(q),J++}let Q={context:Y.context};if(J>0)Q.attributes=F;if(X>0)Q.droppedAttributesCount=X;return this.links.push(Q),this}addLinks(Y){for(let Z of Y)this.addLink(Z);return this}setStatus(Y){if(this._isSpanEnded())return this;if(Y.code===O8.SpanStatusCode.UNSET)return this;if(this.status.code===O8.SpanStatusCode.OK)return this;let Z={code:Y.code};if(Y.code===O8.SpanStatusCode.ERROR){if(typeof Y.message==="string")Z.message=Y.message;else if(Y.message!=null)O8.diag.warn(`Dropping invalid status.message of type '${typeof Y.message}', expected 'string'`)}return this.status=Z,this}updateName(Y){if(this._isSpanEnded())return this;return this.name=Y,this}end(Y){if(this._isSpanEnded()){O8.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}if(this.endTime=this._getTime(Y),this._duration=(0,D8.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0)O8.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];if(this._droppedEventsCount>0)O8.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);if(this._droppedLinksCount>0)O8.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);if(this._spanProcessor.onEnding)this._spanProcessor.onEnding(this);this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(Y){if(typeof Y==="number"&&Y<=D8.otperformance.now())return(0,D8.hrTime)(Y+this._performanceOffset);if(typeof Y==="number")return(0,D8.millisToHrTime)(Y);if(Y instanceof Date)return(0,D8.millisToHrTime)(Y.getTime());if((0,D8.isTimeInputHrTime)(Y))return Y;if(this._startTimeProvided)return(0,D8.millisToHrTime)(Date.now());let Z=D8.otperformance.now()-this._performanceStartTime;return(0,D8.addHrTimes)(this.startTime,(0,D8.millisToHrTime)(Z))}isRecording(){return this._ended===!1}recordException(Y,Z){let W={};if(typeof Y==="string")W[X7.ATTR_EXCEPTION_MESSAGE]=Y;else if(Y){if(Y.code)W[X7.ATTR_EXCEPTION_TYPE]=Y.code.toString();else if(Y.name)W[X7.ATTR_EXCEPTION_TYPE]=Y.name;if(Y.message)W[X7.ATTR_EXCEPTION_MESSAGE]=Y.message;if(Y.stack)W[X7.ATTR_EXCEPTION_STACKTRACE]=Y.stack}if(W[X7.ATTR_EXCEPTION_TYPE]||W[X7.ATTR_EXCEPTION_MESSAGE])this.addEvent(jD0.ExceptionEventName,W,Z);else O8.diag.warn(`Failed to record an exception ${Y}`)}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 Y=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);O8.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,Y)}return this._ended}_truncateToLimitUtil(Y,Z){if(Y.length<=Z)return Y;return Y.substring(0,Z)}_truncateToSize(Y){let Z=this._attributeValueLengthLimit;if(Z<=0)return O8.diag.warn(`Attribute value limit must be positive, got ${Z}`),Y;if(typeof Y==="string")return this._truncateToLimitUtil(Y,Z);if(Array.isArray(Y))return Y.map((W)=>typeof W==="string"?this._truncateToLimitUtil(W,Z):W);return Y}}Fm.SpanImpl=Gm});var zY=H0((qm)=>{Object.defineProperty(qm,"__esModule",{value:!0});qm.SamplingDecision=void 0;var _D0;(function(Y){Y[Y.NOT_RECORD=0]="NOT_RECORD",Y[Y.RECORD=1]="RECORD",Y[Y.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(_D0=qm.SamplingDecision||(qm.SamplingDecision={}))});var qW=H0((Bm)=>{Object.defineProperty(Bm,"__esModule",{value:!0});Bm.AlwaysOffSampler=void 0;var xD0=zY();class zm{shouldSample(){return{decision:xD0.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}Bm.AlwaysOffSampler=zm});var zW=H0((Nm)=>{Object.defineProperty(Nm,"__esModule",{value:!0});Nm.AlwaysOnSampler=void 0;var bD0=zY();class Um{shouldSample(){return{decision:bD0.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}Nm.AlwaysOnSampler=Um});var nV=H0((Im)=>{Object.defineProperty(Im,"__esModule",{value:!0});Im.ParentBasedSampler=void 0;var BW=f1(),uD0=G6(),Dm=qW(),lV=zW();class Tm{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(Y){if(this._root=Y.root,!this._root)(0,uD0.globalErrorHandler)(Error("ParentBasedSampler must have a root sampler configured")),this._root=new lV.AlwaysOnSampler;this._remoteParentSampled=Y.remoteParentSampled??new lV.AlwaysOnSampler,this._remoteParentNotSampled=Y.remoteParentNotSampled??new Dm.AlwaysOffSampler,this._localParentSampled=Y.localParentSampled??new lV.AlwaysOnSampler,this._localParentNotSampled=Y.localParentNotSampled??new Dm.AlwaysOffSampler}shouldSample(Y,Z,W,H,F,X){let J=BW.trace.getSpanContext(Y);if(!J||!(0,BW.isSpanContextValid)(J))return this._root.shouldSample(Y,Z,W,H,F,X);if(J.isRemote){if(J.traceFlags&BW.TraceFlags.SAMPLED)return this._remoteParentSampled.shouldSample(Y,Z,W,H,F,X);return this._remoteParentNotSampled.shouldSample(Y,Z,W,H,F,X)}if(J.traceFlags&BW.TraceFlags.SAMPLED)return this._localParentSampled.shouldSample(Y,Z,W,H,F,X);return this._localParentNotSampled.shouldSample(Y,Z,W,H,F,X)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}Im.ParentBasedSampler=Tm});var pV=H0((Mm)=>{Object.defineProperty(Mm,"__esModule",{value:!0});Mm.TraceIdRatioBasedSampler=void 0;var mD0=f1(),Cm=zY();class Em{_ratio;_upperBound;constructor(Y=0){this._ratio=this._normalize(Y),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(Y,Z){return{decision:(0,mD0.isValidTraceId)(Z)&&this._accumulate(Z)<this._upperBound?Cm.SamplingDecision.RECORD_AND_SAMPLED:Cm.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(Y){if(typeof Y!=="number"||isNaN(Y))return 0;return Y>=1?1:Y<=0?0:Y}_accumulate(Y){let Z=0;for(let W=0;W<Y.length/8;W++){let H=W*8,F=parseInt(Y.slice(H,H+8),16);Z=(Z^F)>>>0}return Z}}Mm.TraceIdRatioBasedSampler=Em});var aV=H0((fm)=>{Object.defineProperty(fm,"__esModule",{value:!0});fm.buildSamplerFromEnv=fm.loadDefaultConfig=void 0;var rV=f1(),o9=G6(),Pm=qW(),iV=zW(),AW=nV(),Lm=pV(),t9;(function(Y){Y.AlwaysOff="always_off",Y.AlwaysOn="always_on",Y.ParentBasedAlwaysOff="parentbased_always_off",Y.ParentBasedAlwaysOn="parentbased_always_on",Y.ParentBasedTraceIdRatio="parentbased_traceidratio",Y.TraceIdRatio="traceidratio"})(t9||(t9={}));var UW=1;function gD0(){return{sampler:Sm(),forceFlushTimeoutMillis:30000,generalLimits:{attributeValueLengthLimit:(0,o9.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,o9.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,o9.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,o9.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,o9.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,o9.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,o9.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,o9.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}fm.loadDefaultConfig=gD0;function Sm(){let Y=(0,o9.getStringFromEnv)("OTEL_TRACES_SAMPLER")??t9.ParentBasedAlwaysOn;switch(Y){case t9.AlwaysOn:return new iV.AlwaysOnSampler;case t9.AlwaysOff:return new Pm.AlwaysOffSampler;case t9.ParentBasedAlwaysOn:return new AW.ParentBasedSampler({root:new iV.AlwaysOnSampler});case t9.ParentBasedAlwaysOff:return new AW.ParentBasedSampler({root:new Pm.AlwaysOffSampler});case t9.TraceIdRatio:return new Lm.TraceIdRatioBasedSampler(wm());case t9.ParentBasedTraceIdRatio:return new AW.ParentBasedSampler({root:new Lm.TraceIdRatioBasedSampler(wm())});default:return rV.diag.error(`OTEL_TRACES_SAMPLER value "${Y}" invalid, defaulting to "${t9.ParentBasedAlwaysOn}".`),new AW.ParentBasedSampler({root:new iV.AlwaysOnSampler})}}fm.buildSamplerFromEnv=Sm;function wm(){let Y=(0,o9.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");if(Y==null)return rV.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${UW}.`),UW;if(Y<0||Y>1)return rV.diag.error(`OTEL_TRACES_SAMPLER_ARG=${Y} was given, but it is out of range ([0..1]), defaulting to ${UW}.`),UW;return Y}});var oV=H0((vm)=>{Object.defineProperty(vm,"__esModule",{value:!0});vm.reconfigureLimits=vm.mergeConfig=vm.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=vm.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var ym=aV(),NW=G6();vm.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;vm.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function cD0(Y){let Z={sampler:(0,ym.buildSamplerFromEnv)()},W=(0,ym.loadDefaultConfig)(),H=Object.assign({},W,Z,Y);return H.generalLimits=Object.assign({},W.generalLimits,Y.generalLimits||{}),H.spanLimits=Object.assign({},W.spanLimits,Y.spanLimits||{}),H}vm.mergeConfig=cD0;function lD0(Y){let Z=Object.assign({},Y.spanLimits);return Z.attributeCountLimit=Y.spanLimits?.attributeCountLimit??Y.generalLimits?.attributeCountLimit??(0,NW.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,NW.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??vm.DEFAULT_ATTRIBUTE_COUNT_LIMIT,Z.attributeValueLengthLimit=Y.spanLimits?.attributeValueLengthLimit??Y.generalLimits?.attributeValueLengthLimit??(0,NW.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,NW.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??vm.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},Y,{spanLimits:Z})}vm.reconfigureLimits=lD0});var mm=H0((bm)=>{Object.defineProperty(bm,"__esModule",{value:!0});bm.BatchSpanProcessorBase=void 0;var BY=f1(),C4=G6();class xm{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(Y,Z){if(this._exporter=Y,this._maxExportBatchSize=typeof Z?.maxExportBatchSize==="number"?Z.maxExportBatchSize:(0,C4.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof Z?.maxQueueSize==="number"?Z.maxQueueSize:(0,C4.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof Z?.scheduledDelayMillis==="number"?Z.scheduledDelayMillis:(0,C4.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5000,this._exportTimeoutMillis=typeof Z?.exportTimeoutMillis==="number"?Z.exportTimeoutMillis:(0,C4.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??30000,this._shutdownOnce=new C4.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize)BY.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize}forceFlush(){if(this._shutdownOnce.isCalled)return this._shutdownOnce.promise;return this._flushAll()}onStart(Y,Z){}onEnd(Y){if(this._shutdownOnce.isCalled)return;if((Y.spanContext().traceFlags&BY.TraceFlags.SAMPLED)===0)return;this._addToBuffer(Y)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>{return this.onShutdown()}).then(()=>{return this._flushAll()}).then(()=>{return this._exporter.shutdown()})}_addToBuffer(Y){if(this._finishedSpans.length>=this._maxQueueSize){if(this._droppedSpansCount===0)BY.diag.debug("maxQueueSize reached, dropping spans");this._droppedSpansCount++;return}if(this._droppedSpansCount>0)BY.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0;this._finishedSpans.push(Y),this._maybeStartTimer()}_flushAll(){return new Promise((Y,Z)=>{let W=[],H=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let F=0,X=H;F<X;F++)W.push(this._flushOneBatch());Promise.all(W).then(()=>{Y()}).catch(Z)})}_flushOneBatch(){if(this._clearTimer(),this._finishedSpans.length===0)return Promise.resolve();return new Promise((Y,Z)=>{let W=setTimeout(()=>{Z(Error("Timeout"))},this._exportTimeoutMillis);BY.context.with((0,C4.suppressTracing)(BY.context.active()),()=>{let H;if(this._finishedSpans.length<=this._maxExportBatchSize)H=this._finishedSpans,this._finishedSpans=[];else H=this._finishedSpans.splice(0,this._maxExportBatchSize);let F=()=>this._exporter.export(H,(J)=>{if(clearTimeout(W),J.code===C4.ExportResultCode.SUCCESS)Y();else Z(J.error??Error("BatchSpanProcessor: span export failed"))}),X=null;for(let J=0,Q=H.length;J<Q;J++){let G=H[J];if(G.resource.asyncAttributesPending&&G.resource.waitForAsyncAttributes)X??=[],X.push(G.resource.waitForAsyncAttributes())}if(X===null)F();else Promise.all(X).then(F,(J)=>{(0,C4.globalErrorHandler)(J),Z(J)})})})}_maybeStartTimer(){if(this._isExporting)return;let Y=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{if(this._isExporting=!1,this._finishedSpans.length>0)this._clearTimer(),this._maybeStartTimer()}).catch((Z)=>{this._isExporting=!1,(0,C4.globalErrorHandler)(Z)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return Y();if(this._timer!==void 0)return;if(this._timer=setTimeout(()=>Y(),this._scheduledDelayMillis),typeof this._timer!=="number")this._timer.unref()}_clearTimer(){if(this._timer!==void 0)clearTimeout(this._timer),this._timer=void 0}}bm.BatchSpanProcessorBase=xm});var lm=H0((dm)=>{Object.defineProperty(dm,"__esModule",{value:!0});dm.BatchSpanProcessor=void 0;var pD0=mm();class gm extends pD0.BatchSpanProcessorBase{onShutdown(){}}dm.BatchSpanProcessor=gm});var om=H0((rm)=>{Object.defineProperty(rm,"__esModule",{value:!0});rm.RandomIdGenerator=void 0;var iD0=8,pm=16;class im{generateTraceId=nm(pm);generateSpanId=nm(iD0)}rm.RandomIdGenerator=im;var OW=Buffer.allocUnsafe(pm);function nm(Y){return function(){for(let W=0;W<Y/4;W++)OW.writeUInt32BE(Math.random()*4294967296>>>0,W*4);for(let W=0;W<Y;W++)if(OW[W]>0)break;else if(W===Y-1)OW[Y-1]=1;return OW.toString("hex",0,Y)}}});var tm=H0((DW)=>{Object.defineProperty(DW,"__esModule",{value:!0});DW.RandomIdGenerator=DW.BatchSpanProcessor=void 0;var rD0=lm();Object.defineProperty(DW,"BatchSpanProcessor",{enumerable:!0,get:function(){return rD0.BatchSpanProcessor}});var aD0=om();Object.defineProperty(DW,"RandomIdGenerator",{enumerable:!0,get:function(){return aD0.RandomIdGenerator}})});var tV=H0((TW)=>{Object.defineProperty(TW,"__esModule",{value:!0});TW.RandomIdGenerator=TW.BatchSpanProcessor=void 0;var sm=tm();Object.defineProperty(TW,"BatchSpanProcessor",{enumerable:!0,get:function(){return sm.BatchSpanProcessor}});Object.defineProperty(TW,"RandomIdGenerator",{enumerable:!0,get:function(){return sm.RandomIdGenerator}})});var Zg=H0((em)=>{Object.defineProperty(em,"__esModule",{value:!0});em.METRIC_OTEL_SDK_SPAN_STARTED=em.METRIC_OTEL_SDK_SPAN_LIVE=em.ATTR_OTEL_SPAN_SAMPLING_RESULT=em.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;em.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";em.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";em.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";em.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var Wg=H0((Xg)=>{Object.defineProperty(Xg,"__esModule",{value:!0});Xg.TracerMetrics=void 0;var IW=zY(),AQ=Zg();class Qg{startedSpans;liveSpans;constructor(Y){this.startedSpans=Y.createCounter(AQ.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=Y.createUpDownCounter(AQ.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(Y,Z){let W=QT0(Z);if(this.startedSpans.add(1,{[AQ.ATTR_OTEL_SPAN_PARENT_ORIGIN]:ZT0(Y),[AQ.ATTR_OTEL_SPAN_SAMPLING_RESULT]:W}),Z===IW.SamplingDecision.NOT_RECORD)return()=>{};let H={[AQ.ATTR_OTEL_SPAN_SAMPLING_RESULT]:W};return this.liveSpans.add(1,H),()=>{this.liveSpans.add(-1,H)}}}Xg.TracerMetrics=Qg;function ZT0(Y){if(!Y)return"none";if(Y.isRemote)return"remote";return"local"}function QT0(Y){switch(Y){case IW.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case IW.SamplingDecision.RECORD:return"RECORD_ONLY";case IW.SamplingDecision.NOT_RECORD:return"DROP"}}});var Fg=H0((Kg)=>{Object.defineProperty(Kg,"__esModule",{value:!0});Kg.VERSION=void 0;Kg.VERSION="2.6.1"});var zg=H0((Vg)=>{Object.defineProperty(Vg,"__esModule",{value:!0});Vg.Tracer=void 0;var W8=f1(),$W=G6(),XT0=Vm(),JT0=oV(),WT0=tV(),KT0=Wg(),GT0=Fg();class Hg{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(Y,Z,W,H){let F=(0,JT0.mergeConfig)(Z);this._sampler=F.sampler,this._generalLimits=F.generalLimits,this._spanLimits=F.spanLimits,this._idGenerator=Z.idGenerator||new WT0.RandomIdGenerator,this._resource=W,this._spanProcessor=H,this.instrumentationScope=Y;let X=F.meterProvider?F.meterProvider.getMeter("@opentelemetry/sdk-trace",GT0.VERSION):W8.createNoopMeter();this._tracerMetrics=new KT0.TracerMetrics(X)}startSpan(Y,Z={},W=W8.context.active()){if(Z.root)W=W8.trace.deleteSpan(W);let H=W8.trace.getSpan(W);if((0,$W.isTracingSuppressed)(W))return W8.diag.debug("Instrumentation suppressed, returning Noop Span"),W8.trace.wrapSpanContext(W8.INVALID_SPAN_CONTEXT);let F=H?.spanContext(),X=this._idGenerator.generateSpanId(),J,Q,G;if(!F||!W8.trace.isSpanContextValid(F))Q=this._idGenerator.generateTraceId();else Q=F.traceId,G=F.traceState,J=F;let q=Z.kind??W8.SpanKind.INTERNAL,K=(Z.links??[]).map((O)=>{return{context:O.context,attributes:(0,$W.sanitizeAttributes)(O.attributes)}}),V=(0,$W.sanitizeAttributes)(Z.attributes),B=this._sampler.shouldSample(W,Q,Y,q,V,K),I=this._tracerMetrics.startSpan(F,B.decision);G=B.traceState??G;let M=B.decision===W8.SamplingDecision.RECORD_AND_SAMPLED?W8.TraceFlags.SAMPLED:W8.TraceFlags.NONE,E={traceId:Q,spanId:X,traceFlags:M,traceState:G};if(B.decision===W8.SamplingDecision.NOT_RECORD)return W8.diag.debug("Recording is off, propagating context in a non-recording span"),W8.trace.wrapSpanContext(E);let A=(0,$W.sanitizeAttributes)(Object.assign(V,B.attributes));return new XT0.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:W,spanContext:E,name:Y,kind:q,links:K,parentSpanContext:J,attributes:A,startTime:Z.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:I})}startActiveSpan(Y,Z,W,H){let F,X,J;if(arguments.length<2)return;else if(arguments.length===2)J=Z;else if(arguments.length===3)F=Z,J=W;else F=Z,X=W,J=H;let Q=X??W8.context.active(),G=this.startSpan(Y,F,Q),q=W8.trace.setSpan(Q,G);return W8.context.with(q,J,void 0,G)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}Vg.Tracer=Hg});var Ng=H0((Ag)=>{Object.defineProperty(Ag,"__esModule",{value:!0});Ag.MultiSpanProcessor=void 0;var FT0=G6();class Bg{_spanProcessors;constructor(Y){this._spanProcessors=Y}forceFlush(){let Y=[];for(let Z of this._spanProcessors)Y.push(Z.forceFlush());return new Promise((Z)=>{Promise.all(Y).then(()=>{Z()}).catch((W)=>{(0,FT0.globalErrorHandler)(W||Error("MultiSpanProcessor: forceFlush failed")),Z()})})}onStart(Y,Z){for(let W of this._spanProcessors)W.onStart(Y,Z)}onEnding(Y){for(let Z of this._spanProcessors)if(Z.onEnding)Z.onEnding(Y)}onEnd(Y){for(let Z of this._spanProcessors)Z.onEnd(Y)}shutdown(){let Y=[];for(let Z of this._spanProcessors)Y.push(Z.shutdown());return new Promise((Z,W)=>{Promise.all(Y).then(()=>{Z()},W)})}}Ag.MultiSpanProcessor=Bg});var $g=H0((Tg)=>{Object.defineProperty(Tg,"__esModule",{value:!0});Tg.BasicTracerProvider=Tg.ForceFlushState=void 0;var HT0=G6(),VT0=WQ(),qT0=zg(),zT0=aV(),BT0=Ng(),AT0=oV(),AY;(function(Y){Y[Y.resolved=0]="resolved",Y[Y.timeout=1]="timeout",Y[Y.error=2]="error",Y[Y.unresolved=3]="unresolved"})(AY=Tg.ForceFlushState||(Tg.ForceFlushState={}));class Dg{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(Y={}){let Z=(0,HT0.merge)({},(0,zT0.loadDefaultConfig)(),(0,AT0.reconfigureLimits)(Y));this._resource=Z.resource??(0,VT0.defaultResource)(),this._config=Object.assign({},Z,{resource:this._resource});let W=[];if(Y.spanProcessors?.length)W.push(...Y.spanProcessors);this._activeSpanProcessor=new BT0.MultiSpanProcessor(W)}getTracer(Y,Z,W){let H=`${Y}@${Z||""}:${W?.schemaUrl||""}`;if(!this._tracers.has(H))this._tracers.set(H,new qT0.Tracer({name:Y,version:Z,schemaUrl:W?.schemaUrl},this._config,this._resource,this._activeSpanProcessor));return this._tracers.get(H)}forceFlush(){let Y=this._config.forceFlushTimeoutMillis,Z=this._activeSpanProcessor._spanProcessors.map((W)=>{return new Promise((H)=>{let F,X=setTimeout(()=>{H(Error(`Span processor did not completed within timeout period of ${Y} ms`)),F=AY.timeout},Y);W.forceFlush().then(()=>{if(clearTimeout(X),F!==AY.timeout)F=AY.resolved,H(F)}).catch((J)=>{clearTimeout(X),F=AY.error,H(J)})})});return new Promise((W,H)=>{Promise.all(Z).then((F)=>{let X=F.filter((J)=>J!==AY.resolved);if(X.length>0)H(X);else W()}).catch((F)=>H([F]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}Tg.BasicTracerProvider=Dg});var Rg=H0((Eg)=>{Object.defineProperty(Eg,"__esModule",{value:!0});Eg.ConsoleSpanExporter=void 0;var sV=G6();class Cg{export(Y,Z){return this._sendSpans(Y,Z)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(Y){return{resource:{attributes:Y.resource.attributes},instrumentationScope:Y.instrumentationScope,traceId:Y.spanContext().traceId,parentSpanContext:Y.parentSpanContext,traceState:Y.spanContext().traceState?.serialize(),name:Y.name,id:Y.spanContext().spanId,kind:Y.kind,timestamp:(0,sV.hrTimeToMicroseconds)(Y.startTime),duration:(0,sV.hrTimeToMicroseconds)(Y.duration),attributes:Y.attributes,status:Y.status,events:Y.events,links:Y.links}}_sendSpans(Y,Z){for(let W of Y)console.dir(this._exportInfo(W),{depth:3});if(Z)return Z({code:sV.ExportResultCode.SUCCESS})}}Eg.ConsoleSpanExporter=Cg});var fg=H0((wg)=>{Object.defineProperty(wg,"__esModule",{value:!0});wg.InMemorySpanExporter=void 0;var Pg=G6();class Lg{_finishedSpans=[];_stopped=!1;export(Y,Z){if(this._stopped)return Z({code:Pg.ExportResultCode.FAILED,error:Error("Exporter has been stopped")});this._finishedSpans.push(...Y),setTimeout(()=>Z({code:Pg.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}wg.InMemorySpanExporter=Lg});var hg=H0((yg)=>{Object.defineProperty(yg,"__esModule",{value:!0});yg.SimpleSpanProcessor=void 0;var UT0=f1(),CW=G6();class kg{_exporter;_shutdownOnce;_pendingExports;constructor(Y){this._exporter=Y,this._shutdownOnce=new CW.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){if(await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush)await this._exporter.forceFlush()}onStart(Y,Z){}onEnd(Y){if(this._shutdownOnce.isCalled)return;if((Y.spanContext().traceFlags&UT0.TraceFlags.SAMPLED)===0)return;let Z=this._doExport(Y).catch((W)=>(0,CW.globalErrorHandler)(W));this._pendingExports.add(Z),Z.finally(()=>this._pendingExports.delete(Z))}async _doExport(Y){if(Y.resource.asyncAttributesPending)await Y.resource.waitForAsyncAttributes?.();let Z=await CW.internal._export(this._exporter,[Y]);if(Z.code!==CW.ExportResultCode.SUCCESS)throw Z.error??Error(`SimpleSpanProcessor: span export failed (status ${Z})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}yg.SimpleSpanProcessor=kg});var bg=H0((_g)=>{Object.defineProperty(_g,"__esModule",{value:!0});_g.NoopSpanProcessor=void 0;class jg{onStart(Y,Z){}onEnd(Y){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}_g.NoopSpanProcessor=jg});var EW=H0((x8)=>{Object.defineProperty(x8,"__esModule",{value:!0});x8.SamplingDecision=x8.TraceIdRatioBasedSampler=x8.ParentBasedSampler=x8.AlwaysOnSampler=x8.AlwaysOffSampler=x8.NoopSpanProcessor=x8.SimpleSpanProcessor=x8.InMemorySpanExporter=x8.ConsoleSpanExporter=x8.RandomIdGenerator=x8.BatchSpanProcessor=x8.BasicTracerProvider=void 0;var NT0=$g();Object.defineProperty(x8,"BasicTracerProvider",{enumerable:!0,get:function(){return NT0.BasicTracerProvider}});var ug=tV();Object.defineProperty(x8,"BatchSpanProcessor",{enumerable:!0,get:function(){return ug.BatchSpanProcessor}});Object.defineProperty(x8,"RandomIdGenerator",{enumerable:!0,get:function(){return ug.RandomIdGenerator}});var OT0=Rg();Object.defineProperty(x8,"ConsoleSpanExporter",{enumerable:!0,get:function(){return OT0.ConsoleSpanExporter}});var DT0=fg();Object.defineProperty(x8,"InMemorySpanExporter",{enumerable:!0,get:function(){return DT0.InMemorySpanExporter}});var TT0=hg();Object.defineProperty(x8,"SimpleSpanProcessor",{enumerable:!0,get:function(){return TT0.SimpleSpanProcessor}});var IT0=bg();Object.defineProperty(x8,"NoopSpanProcessor",{enumerable:!0,get:function(){return IT0.NoopSpanProcessor}});var $T0=qW();Object.defineProperty(x8,"AlwaysOffSampler",{enumerable:!0,get:function(){return $T0.AlwaysOffSampler}});var CT0=zW();Object.defineProperty(x8,"AlwaysOnSampler",{enumerable:!0,get:function(){return CT0.AlwaysOnSampler}});var ET0=nV();Object.defineProperty(x8,"ParentBasedSampler",{enumerable:!0,get:function(){return ET0.ParentBasedSampler}});var MT0=pV();Object.defineProperty(x8,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return MT0.TraceIdRatioBasedSampler}});var RT0=zY();Object.defineProperty(x8,"SamplingDecision",{enumerable:!0,get:function(){return RT0.SamplingDecision}})});var eV=H0((gg)=>{Object.defineProperty(gg,"__esModule",{value:!0});gg.AbstractAsyncHooksContextManager=void 0;var LT0=V1("events"),wT0=["addListener","on","once","prependListener","prependOnceListener"];class mg{bind(Y,Z){if(Z instanceof LT0.EventEmitter)return this._bindEventEmitter(Y,Z);if(typeof Z==="function")return this._bindFunction(Y,Z);return Z}_bindFunction(Y,Z){let W=this,H=function(...F){return W.with(Y,()=>Z.apply(this,F))};return Object.defineProperty(H,"length",{enumerable:!1,configurable:!0,writable:!1,value:Z.length}),H}_bindEventEmitter(Y,Z){if(this._getPatchMap(Z)!==void 0)return Z;if(this._createPatchMap(Z),wT0.forEach((H)=>{if(Z[H]===void 0)return;Z[H]=this._patchAddListener(Z,Z[H],Y)}),typeof Z.removeListener==="function")Z.removeListener=this._patchRemoveListener(Z,Z.removeListener);if(typeof Z.off==="function")Z.off=this._patchRemoveListener(Z,Z.off);if(typeof Z.removeAllListeners==="function")Z.removeAllListeners=this._patchRemoveAllListeners(Z,Z.removeAllListeners);return Z}_patchRemoveListener(Y,Z){let W=this;return function(H,F){let X=W._getPatchMap(Y)?.[H];if(X===void 0)return Z.call(this,H,F);let J=X.get(F);return Z.call(this,H,J||F)}}_patchRemoveAllListeners(Y,Z){let W=this;return function(H){let F=W._getPatchMap(Y);if(F!==void 0){if(arguments.length===0)W._createPatchMap(Y);else if(F[H]!==void 0)delete F[H]}return Z.apply(this,arguments)}}_patchAddListener(Y,Z,W){let H=this;return function(F,X){if(H._wrapped)return Z.call(this,F,X);let J=H._getPatchMap(Y);if(J===void 0)J=H._createPatchMap(Y);let Q=J[F];if(Q===void 0)Q=new WeakMap,J[F]=Q;let G=H.bind(W,X);Q.set(X,G),H._wrapped=!0;try{return Z.call(this,F,G)}finally{H._wrapped=!1}}}_createPatchMap(Y){let Z=Object.create(null);return Y[this._kOtListeners]=Z,Z}_getPatchMap(Y){return Y[this._kOtListeners]}_kOtListeners=Symbol("OtListeners");_wrapped=!1}gg.AbstractAsyncHooksContextManager=mg});var pg=H0((lg)=>{Object.defineProperty(lg,"__esModule",{value:!0});lg.AsyncHooksContextManager=void 0;var ST0=f1(),fT0=V1("async_hooks"),kT0=eV();class cg extends kT0.AbstractAsyncHooksContextManager{_asyncHook;_contexts=new Map;_stack=[];constructor(){super();this._asyncHook=fT0.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]??ST0.ROOT_CONTEXT}with(Y,Z,W,...H){this._enterContext(Y);try{return Z.call(W,...H)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(Y,Z){if(Z==="TIMERWRAP")return;let W=this._stack[this._stack.length-1];if(W!==void 0)this._contexts.set(Y,W)}_destroy(Y){this._contexts.delete(Y)}_before(Y){let Z=this._contexts.get(Y);if(Z!==void 0)this._enterContext(Z)}_after(){this._exitContext()}_enterContext(Y){this._stack.push(Y)}_exitContext(){this._stack.pop()}}lg.AsyncHooksContextManager=cg});var og=H0((rg)=>{Object.defineProperty(rg,"__esModule",{value:!0});rg.AsyncLocalStorageContextManager=void 0;var yT0=f1(),vT0=V1("async_hooks"),hT0=eV();class ig extends hT0.AbstractAsyncHooksContextManager{_asyncLocalStorage;constructor(){super();this._asyncLocalStorage=new vT0.AsyncLocalStorage}active(){return this._asyncLocalStorage.getStore()??yT0.ROOT_CONTEXT}with(Y,Z,W,...H){let F=W==null?Z:Z.bind(W);return this._asyncLocalStorage.run(Y,F,...H)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}}rg.AsyncLocalStorageContextManager=ig});var tg=H0((MW)=>{Object.defineProperty(MW,"__esModule",{value:!0});MW.AsyncLocalStorageContextManager=MW.AsyncHooksContextManager=void 0;var jT0=pg();Object.defineProperty(MW,"AsyncHooksContextManager",{enumerable:!0,get:function(){return jT0.AsyncHooksContextManager}});var _T0=og();Object.defineProperty(MW,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return _T0.AsyncLocalStorageContextManager}})});var Zd=H0((eg)=>{Object.defineProperty(eg,"__esModule",{value:!0});eg.NodeTracerProvider=void 0;var bT0=tg(),uT0=EW(),UQ=f1(),Yq=G6();function mT0(Y){if(Y===null)return;if(Y===void 0){let Z=new bT0.AsyncLocalStorageContextManager;Z.enable(),UQ.context.setGlobalContextManager(Z);return}Y.enable(),UQ.context.setGlobalContextManager(Y)}function gT0(Y){if(Y===null)return;if(Y===void 0){UQ.propagation.setGlobalPropagator(new Yq.CompositePropagator({propagators:[new Yq.W3CTraceContextPropagator,new Yq.W3CBaggagePropagator]}));return}UQ.propagation.setGlobalPropagator(Y)}class sg extends uT0.BasicTracerProvider{constructor(Y={}){super(Y)}register(Y={}){UQ.trace.setGlobalTracerProvider(this),mT0(Y.contextManager),gT0(Y.propagator)}}eg.NodeTracerProvider=sg});var Qd=H0((w8)=>{Object.defineProperty(w8,"__esModule",{value:!0});w8.TraceIdRatioBasedSampler=w8.SimpleSpanProcessor=w8.SamplingDecision=w8.RandomIdGenerator=w8.ParentBasedSampler=w8.NoopSpanProcessor=w8.InMemorySpanExporter=w8.ConsoleSpanExporter=w8.BatchSpanProcessor=w8.BasicTracerProvider=w8.AlwaysOnSampler=w8.AlwaysOffSampler=w8.NodeTracerProvider=void 0;var dT0=Zd();Object.defineProperty(w8,"NodeTracerProvider",{enumerable:!0,get:function(){return dT0.NodeTracerProvider}});var F9=EW();Object.defineProperty(w8,"AlwaysOffSampler",{enumerable:!0,get:function(){return F9.AlwaysOffSampler}});Object.defineProperty(w8,"AlwaysOnSampler",{enumerable:!0,get:function(){return F9.AlwaysOnSampler}});Object.defineProperty(w8,"BasicTracerProvider",{enumerable:!0,get:function(){return F9.BasicTracerProvider}});Object.defineProperty(w8,"BatchSpanProcessor",{enumerable:!0,get:function(){return F9.BatchSpanProcessor}});Object.defineProperty(w8,"ConsoleSpanExporter",{enumerable:!0,get:function(){return F9.ConsoleSpanExporter}});Object.defineProperty(w8,"InMemorySpanExporter",{enumerable:!0,get:function(){return F9.InMemorySpanExporter}});Object.defineProperty(w8,"NoopSpanProcessor",{enumerable:!0,get:function(){return F9.NoopSpanProcessor}});Object.defineProperty(w8,"ParentBasedSampler",{enumerable:!0,get:function(){return F9.ParentBasedSampler}});Object.defineProperty(w8,"RandomIdGenerator",{enumerable:!0,get:function(){return F9.RandomIdGenerator}});Object.defineProperty(w8,"SamplingDecision",{enumerable:!0,get:function(){return F9.SamplingDecision}});Object.defineProperty(w8,"SimpleSpanProcessor",{enumerable:!0,get:function(){return F9.SimpleSpanProcessor}});Object.defineProperty(w8,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return F9.TraceIdRatioBasedSampler}})});import{existsSync as s9,mkdirSync as Jd,readdirSync as lT0,readFileSync as nT0,statSync as NQ}from"node:fs";import{homedir as pT0}from"node:os";import{dirname as Wd,join as z6,resolve as OQ}from"node:path";function iT0(){let Y=process?.env?.HOME?.trim();if(Y&&Y!=="~")return Y;let Z=process?.env?.USERPROFILE?.trim();if(Z)return Z;let W=process?.env?.HOMEDRIVE?.trim(),H=process?.env?.HOMEPATH?.trim();if(W&&H)return`${W}${H}`;let F=pT0().trim();if(F&&F!=="~")return F;return"~"}function rT0(Y){let Z=Y.trim();if(!Z)return;TQ=Z,Gd=!0}function Xq(Y){if(Gd)return;let Z=Y.trim();if(!Z)return;TQ=Z}function aT0(Y){let Z=Y.trim();if(!Z)return;RW=Z,Fd=!0}function oT0(Y){if(Fd)return;let Z=Y.trim();if(!Z)return;RW=Z}function PW(){if(RW)return RW;let Y=process.env.CLINE_DIR?.trim();if(Y)return Y;return z6(TQ,".cline")}function OY(){return z6(TQ,"Documents","Cline")}function LW(){return z6(OY(),"Agents")}function K7(){return z6(OY(),"Hooks")}function IQ(){return z6(OY(),"Rules")}function $Q(){return z6(OY(),"Workflows")}function Hd(){return z6(OY(),"Plugins")}function S8(){let Y=process.env.CLINE_DATA_DIR?.trim();if(Y)return Y;return z6(PW(),"data")}function H9(){let Y=process.env.CLINE_SESSION_DATA_DIR?.trim();if(Y)return Y;return z6(S8(),"sessions")}function DY(){let Y=process.env.CLINE_TEAM_DATA_DIR?.trim();if(Y)return Y;return z6(S8(),"teams")}function Jq(){let Y=process.env.CLINE_PROVIDER_SETTINGS_PATH?.trim();if(Y)return Y;return z6(S8(),"settings","providers.json")}function Wq(){let Y=process.env.CLINE_MCP_SETTINGS_PATH?.trim();if(Y)return Y;return z6(S8(),"settings",Kd)}function CQ(Y){let Z=new Set,W=[];for(let H of Y){if(!H||Z.has(H))continue;Z.add(H),W.push(H)}return W}function tT0(Y){if(!Y)return[];return[Zq,Qq,NY].map((Z)=>z6(Y,Z,Z5))}function Kq(){return z6(S8(),"settings",NY)}function Gq(){return[LW(),Kq()]}function Fq(Y){let Z=[K7(),z6(S8(),J7)];if(Y)Z.push(z6(Y,Zq,J7),z6(Y,Qq,J7));return CQ(Z)}function EQ(Y){return CQ([...tT0(Y),z6(PW(),Z5),z6(TQ,NY,Z5)])}function Hq(Y){let Z=Y?[z6(Y,Zq),z6(Y,Qq,UY)]:[],W=Y?[z6(Y,"AGENTS.md")]:[];return CQ([...W,...Z,z6(S8(),UY),IQ()])}function Vq(Y){return CQ([Y?z6(Y,".clinerules",W7):"",z6(S8(),W7),$Q()])}function qq(Y){return CQ([Y?z6(Y,".cline",Xd):"",z6(PW(),Xd),Hd()])}function DQ(Y){let Z=Y.lastIndexOf(".");if(Z===-1)return!1;return Vd.has(Y.slice(Z))}function zd(Y){try{let Z=JSON.parse(nT0(Y,"utf8"));if(!Z.cline||typeof Z.cline!=="object")return null;return Z.cline}catch{return null}}function Bd(Y){let Z=Y?.plugins;if(!Array.isArray(Z))return[];return Z.flatMap((W)=>W.paths??[])}function Ad(Y){let Z=OQ(Y);if(!s9(Z)||!NQ(Z).isDirectory())return null;let W=z6(Z,qd);if(s9(W)){let H=zd(W),F=Bd(H).map((X)=>OQ(Z,X)).filter((X)=>s9(X)&&NQ(X).isFile()&&DQ(X));if(F.length>0)return F}for(let H of sT0){let F=z6(Z,H);if(s9(F)&&NQ(F).isFile())return[F]}return null}function wW(Y){let Z=OQ(Y);if(!s9(Z))return[];let W=[],H=[Z];while(H.length>0){let F=H.pop();if(!F)continue;for(let X of lT0(F,{withFileTypes:!0})){let J=z6(F,X.name);if(X.isDirectory()){let Q=z6(J,qd);if(s9(Q)){let G=zd(Q),q=Bd(G).map((K)=>OQ(J,K)).filter((K)=>s9(K)&&NQ(K).isFile()&&DQ(K));if(q.length>0){W.push(...q);continue}}H.push(J);continue}if(X.name.startsWith("."))continue;if(X.isFile()&&DQ(J))W.push(J)}}return W.sort((F,X)=>F.localeCompare(X))}function zq(Y,Z){let W=[];for(let H of Y){let F=H.trim();if(!F)continue;let X=OQ(Z,F);if(!s9(X))throw Error(`Plugin path does not exist: ${X}`);if(NQ(X).isDirectory()){let Q=Ad(X);if(Q){W.push(...Q);continue}W.push(...wW(X));continue}if(!DQ(X))throw Error(`Plugin file must use a supported extension (${[...Vd].join(", ")}): ${X}`);W.push(X)}return W}function SW(Y){let Z=Wd(Y);if(!s9(Z))Jd(Z,{recursive:!0})}function eT0(Y){if(Y?.trim())return SW(Y),Wd(Y);let Z=z6(S8(),"hooks");if(!s9(Z))Jd(Z,{recursive:!0});return Z}var Zq=".clinerules",Qq=".cline",NY=".agents",J7="hooks",Z5="skills",UY="rules",W7="workflows",Xd="plugins",Kd="cline_mcp_settings.json",TQ,Gd=!1,RW,Fd=!1,Vd,qd="package.json",sT0;var Ud=n7(()=>{TQ=iT0();Vd=new Set([".js",".ts"]),sT0=["index.ts","index.js"]});var x6=n7(()=>{Ud()});var Nd=H0((MQ,Bq)=>{(function(Y,Z){typeof MQ=="object"&&typeof Bq=="object"?Bq.exports=Z(V1("child_process"),V1("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],Z):typeof MQ=="object"?MQ["electron-machine-id"]=Z(V1("child_process"),V1("crypto")):Y["electron-machine-id"]=Z(Y.child_process,Y.crypto)})(MQ,function(Y,Z){return function(W){function H(X){if(F[X])return F[X].exports;var J=F[X]={exports:{},id:X,loaded:!1};return W[X].call(J.exports,J,J.exports,H),J.loaded=!0,J.exports}var F={};return H.m=W,H.c=F,H.p="",H(0)}([function(W,H,F){W.exports=F(34)},function(W,H,F){var X=F(29)("wks"),J=F(33),Q=F(2).Symbol,G=typeof Q=="function",q=W.exports=function(K){return X[K]||(X[K]=G&&Q[K]||(G?Q:J)("Symbol."+K))};q.store=X},function(W,H){var F=W.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=F)},function(W,H,F){var X=F(9);W.exports=function(J){if(!X(J))throw TypeError(J+" is not an object!");return J}},function(W,H,F){W.exports=!F(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(W,H,F){var X=F(12),J=F(17);W.exports=F(4)?function(Q,G,q){return X.f(Q,G,J(1,q))}:function(Q,G,q){return Q[G]=q,Q}},function(W,H){var F=W.exports={version:"2.4.0"};typeof __e=="number"&&(__e=F)},function(W,H,F){var X=F(14);W.exports=function(J,Q,G){if(X(J),Q===void 0)return J;switch(G){case 1:return function(q){return J.call(Q,q)};case 2:return function(q,K){return J.call(Q,q,K)};case 3:return function(q,K,V){return J.call(Q,q,K,V)}}return function(){return J.apply(Q,arguments)}}},function(W,H){var F={}.hasOwnProperty;W.exports=function(X,J){return F.call(X,J)}},function(W,H){W.exports=function(F){return typeof F=="object"?F!==null:typeof F=="function"}},function(W,H){W.exports={}},function(W,H){var F={}.toString;W.exports=function(X){return F.call(X).slice(8,-1)}},function(W,H,F){var X=F(3),J=F(26),Q=F(32),G=Object.defineProperty;H.f=F(4)?Object.defineProperty:function(q,K,V){if(X(q),K=Q(K,!0),X(V),J)try{return G(q,K,V)}catch(B){}if("get"in V||"set"in V)throw TypeError("Accessors not supported!");return"value"in V&&(q[K]=V.value),q}},function(W,H,F){var X=F(42),J=F(15);W.exports=function(Q){return X(J(Q))}},function(W,H){W.exports=function(F){if(typeof F!="function")throw TypeError(F+" is not a function!");return F}},function(W,H){W.exports=function(F){if(F==null)throw TypeError("Can't call method on "+F);return F}},function(W,H,F){var X=F(9),J=F(2).document,Q=X(J)&&X(J.createElement);W.exports=function(G){return Q?J.createElement(G):{}}},function(W,H){W.exports=function(F,X){return{enumerable:!(1&F),configurable:!(2&F),writable:!(4&F),value:X}}},function(W,H,F){var X=F(12).f,J=F(8),Q=F(1)("toStringTag");W.exports=function(G,q,K){G&&!J(G=K?G:G.prototype,Q)&&X(G,Q,{configurable:!0,value:q})}},function(W,H,F){var X=F(29)("keys"),J=F(33);W.exports=function(Q){return X[Q]||(X[Q]=J(Q))}},function(W,H){var{ceil:F,floor:X}=Math;W.exports=function(J){return isNaN(J=+J)?0:(J>0?X:F)(J)}},function(W,H,F){var X=F(11),J=F(1)("toStringTag"),Q=X(function(){return arguments}())=="Arguments",G=function(q,K){try{return q[K]}catch(V){}};W.exports=function(q){var K,V,B;return q===void 0?"Undefined":q===null?"Null":typeof(V=G(K=Object(q),J))=="string"?V:Q?X(K):(B=X(K))=="Object"&&typeof K.callee=="function"?"Arguments":B}},function(W,H){W.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(W,H,F){var X=F(2),J=F(6),Q=F(7),G=F(5),q="prototype",K=function(V,B,I){var M,E,A,N=V&K.F,O=V&K.G,T=V&K.S,C=V&K.P,R=V&K.B,w=V&K.W,L=O?J:J[B]||(J[B]={}),k=L[q],v=O?X:T?X[B]:(X[B]||{})[q];O&&(I=B);for(M in I)E=!N&&v&&v[M]!==void 0,E&&M in L||(A=E?v[M]:I[M],L[M]=O&&typeof v[M]!="function"?I[M]:R&&E?Q(A,X):w&&v[M]==A?function(f){var h=function(b,x,y){if(this instanceof f){switch(arguments.length){case 0:return new f;case 1:return new f(b);case 2:return new f(b,x)}return new f(b,x,y)}return f.apply(this,arguments)};return h[q]=f[q],h}(A):C&&typeof A=="function"?Q(Function.call,A):A,C&&((L.virtual||(L.virtual={}))[M]=A,V&K.R&&k&&!k[M]&&G(k,M,A)))};K.F=1,K.G=2,K.S=4,K.P=8,K.B=16,K.W=32,K.U=64,K.R=128,W.exports=K},function(W,H){W.exports=function(F){try{return!!F()}catch(X){return!0}}},function(W,H,F){W.exports=F(2).document&&document.documentElement},function(W,H,F){W.exports=!F(4)&&!F(24)(function(){return Object.defineProperty(F(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(W,H,F){var X=F(28),J=F(23),Q=F(57),G=F(5),q=F(8),K=F(10),V=F(45),B=F(18),I=F(52),M=F(1)("iterator"),E=!([].keys&&("next"in[].keys())),A="@@iterator",N="keys",O="values",T=function(){return this};W.exports=function(C,R,w,L,k,v,f){V(w,R,L);var h,b,x,y=function(s){if(!E&&s in j)return j[s];switch(s){case N:return function(){return new w(this,s)};case O:return function(){return new w(this,s)}}return function(){return new w(this,s)}},n=R+" Iterator",Z0=k==O,m=!1,j=C.prototype,c=j[M]||j[A]||k&&j[k],p=c||y(k),Q0=k?Z0?y("entries"):p:void 0,l=R=="Array"?j.entries||c:c;if(l&&(x=I(l.call(new C)),x!==Object.prototype&&(B(x,n,!0),X||q(x,M)||G(x,M,T))),Z0&&c&&c.name!==O&&(m=!0,p=function(){return c.call(this)}),X&&!f||!E&&!m&&j[M]||G(j,M,p),K[R]=p,K[n]=T,k)if(h={values:Z0?p:y(O),keys:v?p:y(N),entries:Q0},f)for(b in h)b in j||Q(j,b,h[b]);else J(J.P+J.F*(E||m),R,h);return h}},function(W,H){W.exports=!0},function(W,H,F){var X=F(2),J="__core-js_shared__",Q=X[J]||(X[J]={});W.exports=function(G){return Q[G]||(Q[G]={})}},function(W,H,F){var X,J,Q,G=F(7),q=F(41),K=F(25),V=F(16),B=F(2),I=B.process,M=B.setImmediate,E=B.clearImmediate,A=B.MessageChannel,N=0,O={},T="onreadystatechange",C=function(){var w=+this;if(O.hasOwnProperty(w)){var L=O[w];delete O[w],L()}},R=function(w){C.call(w.data)};M&&E||(M=function(w){for(var L=[],k=1;arguments.length>k;)L.push(arguments[k++]);return O[++N]=function(){q(typeof w=="function"?w:Function(w),L)},X(N),N},E=function(w){delete O[w]},F(11)(I)=="process"?X=function(w){I.nextTick(G(C,w,1))}:A?(J=new A,Q=J.port2,J.port1.onmessage=R,X=G(Q.postMessage,Q,1)):B.addEventListener&&typeof postMessage=="function"&&!B.importScripts?(X=function(w){B.postMessage(w+"","*")},B.addEventListener("message",R,!1)):X=(T in V("script"))?function(w){K.appendChild(V("script"))[T]=function(){K.removeChild(this),C.call(w)}}:function(w){setTimeout(G(C,w,1),0)}),W.exports={set:M,clear:E}},function(W,H,F){var X=F(20),J=Math.min;W.exports=function(Q){return Q>0?J(X(Q),9007199254740991):0}},function(W,H,F){var X=F(9);W.exports=function(J,Q){if(!X(J))return J;var G,q;if(Q&&typeof(G=J.toString)=="function"&&!X(q=G.call(J)))return q;if(typeof(G=J.valueOf)=="function"&&!X(q=G.call(J)))return q;if(!Q&&typeof(G=J.toString)=="function"&&!X(q=G.call(J)))return q;throw TypeError("Can't convert object to primitive value")}},function(W,H){var F=0,X=Math.random();W.exports=function(J){return"Symbol(".concat(J===void 0?"":J,")_",(++F+X).toString(36))}},function(W,H,F){function X(T){return T&&T.__esModule?T:{default:T}}function J(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function Q(T){return(0,M.createHash)("sha256").update(T).digest("hex")}function G(T){switch(A){case"darwin":return T.split("IOPlatformUUID")[1].split(`
15
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return T.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return T.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return T.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw Error("Unsupported platform: "+process.platform)}}function q(T){var C=G((0,I.execSync)(O[A]).toString());return T?C:Q(C)}function K(T){return new B.default(function(C,R){return(0,I.exec)(O[A],{},function(w,L,k){if(w)return R(Error("Error while obtaining machine id: "+w.stack));var v=G(L.toString());return C(T?v:Q(v))})})}Object.defineProperty(H,"__esModule",{value:!0});var V=F(35),B=X(V);H.machineIdSync=q,H.machineId=K;var I=F(70),M=F(71),E=process,A=E.platform,N={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},O={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:N[J()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(W,H,F){W.exports={default:F(36),__esModule:!0}},function(W,H,F){F(66),F(68),F(69),F(67),W.exports=F(6).Promise},function(W,H){W.exports=function(){}},function(W,H){W.exports=function(F,X,J,Q){if(!(F instanceof X)||Q!==void 0&&Q in F)throw TypeError(J+": incorrect invocation!");return F}},function(W,H,F){var X=F(13),J=F(31),Q=F(62);W.exports=function(G){return function(q,K,V){var B,I=X(q),M=J(I.length),E=Q(V,M);if(G&&K!=K){for(;M>E;)if(B=I[E++],B!=B)return!0}else for(;M>E;E++)if((G||(E in I))&&I[E]===K)return G||E||0;return!G&&-1}}},function(W,I,F){var X=F(7),J=F(44),Q=F(43),G=F(3),q=F(31),K=F(64),V={},B={},I=W.exports=function(M,E,A,N,O){var T,C,R,w,L=O?function(){return M}:K(M),k=X(A,N,E?2:1),v=0;if(typeof L!="function")throw TypeError(M+" is not iterable!");if(Q(L)){for(T=q(M.length);T>v;v++)if(w=E?k(G(C=M[v])[0],C[1]):k(M[v]),w===V||w===B)return w}else for(R=L.call(M);!(C=R.next()).done;)if(w=J(R,k,C.value,E),w===V||w===B)return w};I.BREAK=V,I.RETURN=B},function(W,H){W.exports=function(F,X,J){var Q=J===void 0;switch(X.length){case 0:return Q?F():F.call(J);case 1:return Q?F(X[0]):F.call(J,X[0]);case 2:return Q?F(X[0],X[1]):F.call(J,X[0],X[1]);case 3:return Q?F(X[0],X[1],X[2]):F.call(J,X[0],X[1],X[2]);case 4:return Q?F(X[0],X[1],X[2],X[3]):F.call(J,X[0],X[1],X[2],X[3])}return F.apply(J,X)}},function(W,H,F){var X=F(11);W.exports=Object("z").propertyIsEnumerable(0)?Object:function(J){return X(J)=="String"?J.split(""):Object(J)}},function(W,H,F){var X=F(10),J=F(1)("iterator"),Q=Array.prototype;W.exports=function(G){return G!==void 0&&(X.Array===G||Q[J]===G)}},function(W,H,F){var X=F(3);W.exports=function(J,Q,G,q){try{return q?Q(X(G)[0],G[1]):Q(G)}catch(V){var K=J.return;throw K!==void 0&&X(K.call(J)),V}}},function(W,H,F){var X=F(49),J=F(17),Q=F(18),G={};F(5)(G,F(1)("iterator"),function(){return this}),W.exports=function(q,K,V){q.prototype=X(G,{next:J(1,V)}),Q(q,K+" Iterator")}},function(W,H,F){var X=F(1)("iterator"),J=!1;try{var Q=[7][X]();Q.return=function(){J=!0},Array.from(Q,function(){throw 2})}catch(G){}W.exports=function(G,q){if(!q&&!J)return!1;var K=!1;try{var V=[7],B=V[X]();B.next=function(){return{done:K=!0}},V[X]=function(){return B},G(V)}catch(I){}return K}},function(W,H){W.exports=function(F,X){return{value:X,done:!!F}}},function(W,H,F){var X=F(2),J=F(30).set,Q=X.MutationObserver||X.WebKitMutationObserver,G=X.process,q=X.Promise,K=F(11)(G)=="process";W.exports=function(){var V,B,I,M=function(){var O,T;for(K&&(O=G.domain)&&O.exit();V;){T=V.fn,V=V.next;try{T()}catch(C){throw V?I():B=void 0,C}}B=void 0,O&&O.enter()};if(K)I=function(){G.nextTick(M)};else if(Q){var E=!0,A=document.createTextNode("");new Q(M).observe(A,{characterData:!0}),I=function(){A.data=E=!E}}else if(q&&q.resolve){var N=q.resolve();I=function(){N.then(M)}}else I=function(){J.call(X,M)};return function(O){var T={fn:O,next:void 0};B&&(B.next=T),V||(V=T,I()),B=T}}},function(W,H,F){var X=F(3),J=F(50),Q=F(22),G=F(19)("IE_PROTO"),q=function(){},K="prototype",V=function(){var B,I=F(16)("iframe"),M=Q.length,E=">";for(I.style.display="none",F(25).appendChild(I),I.src="javascript:",B=I.contentWindow.document,B.open(),B.write("<script>document.F=Object</script"+E),B.close(),V=B.F;M--;)delete V[K][Q[M]];return V()};W.exports=Object.create||function(B,I){var M;return B!==null?(q[K]=X(B),M=new q,q[K]=null,M[G]=B):M=V(),I===void 0?M:J(M,I)}},function(W,H,F){var X=F(12),J=F(3),Q=F(54);W.exports=F(4)?Object.defineProperties:function(G,q){J(G);for(var K,V=Q(q),B=V.length,I=0;B>I;)X.f(G,K=V[I++],q[K]);return G}},function(W,H,F){var X=F(55),J=F(17),Q=F(13),G=F(32),q=F(8),K=F(26),V=Object.getOwnPropertyDescriptor;H.f=F(4)?V:function(B,I){if(B=Q(B),I=G(I,!0),K)try{return V(B,I)}catch(M){}if(q(B,I))return J(!X.f.call(B,I),B[I])}},function(W,H,F){var X=F(8),J=F(63),Q=F(19)("IE_PROTO"),G=Object.prototype;W.exports=Object.getPrototypeOf||function(q){return q=J(q),X(q,Q)?q[Q]:typeof q.constructor=="function"&&q instanceof q.constructor?q.constructor.prototype:q instanceof Object?G:null}},function(W,H,F){var X=F(8),J=F(13),Q=F(39)(!1),G=F(19)("IE_PROTO");W.exports=function(q,K){var V,B=J(q),I=0,M=[];for(V in B)V!=G&&X(B,V)&&M.push(V);for(;K.length>I;)X(B,V=K[I++])&&(~Q(M,V)||M.push(V));return M}},function(W,H,F){var X=F(53),J=F(22);W.exports=Object.keys||function(Q){return X(Q,J)}},function(W,H){H.f={}.propertyIsEnumerable},function(W,H,F){var X=F(5);W.exports=function(J,Q,G){for(var q in Q)G&&J[q]?J[q]=Q[q]:X(J,q,Q[q]);return J}},function(W,H,F){W.exports=F(5)},function(W,H,F){var X=F(9),J=F(3),Q=function(G,q){if(J(G),!X(q)&&q!==null)throw TypeError(q+": can't set as prototype!")};W.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(G,q,K){try{K=F(7)(Function.call,F(51).f(Object.prototype,"__proto__").set,2),K(G,[]),q=!(G instanceof Array)}catch(V){q=!0}return function(V,B){return Q(V,B),q?V.__proto__=B:K(V,B),V}}({},!1):void 0),check:Q}},function(W,H,F){var X=F(2),J=F(6),Q=F(12),G=F(4),q=F(1)("species");W.exports=function(K){var V=typeof J[K]=="function"?J[K]:X[K];G&&V&&!V[q]&&Q.f(V,q,{configurable:!0,get:function(){return this}})}},function(W,H,F){var X=F(3),J=F(14),Q=F(1)("species");W.exports=function(G,q){var K,V=X(G).constructor;return V===void 0||(K=X(V)[Q])==null?q:J(K)}},function(W,H,F){var X=F(20),J=F(15);W.exports=function(Q){return function(G,q){var K,V,B=String(J(G)),I=X(q),M=B.length;return I<0||I>=M?Q?"":void 0:(K=B.charCodeAt(I),K<55296||K>56319||I+1===M||(V=B.charCodeAt(I+1))<56320||V>57343?Q?B.charAt(I):K:Q?B.slice(I,I+2):(K-55296<<10)+(V-56320)+65536)}}},function(W,H,F){var X=F(20),J=Math.max,Q=Math.min;W.exports=function(G,q){return G=X(G),G<0?J(G+q,0):Q(G,q)}},function(W,H,F){var X=F(15);W.exports=function(J){return Object(X(J))}},function(W,H,F){var X=F(21),J=F(1)("iterator"),Q=F(10);W.exports=F(6).getIteratorMethod=function(G){if(G!=null)return G[J]||G["@@iterator"]||Q[X(G)]}},function(W,H,F){var X=F(37),J=F(47),Q=F(10),G=F(13);W.exports=F(27)(Array,"Array",function(q,K){this._t=G(q),this._i=0,this._k=K},function(){var q=this._t,K=this._k,V=this._i++;return!q||V>=q.length?(this._t=void 0,J(1)):K=="keys"?J(0,V):K=="values"?J(0,q[V]):J(0,[V,q[V]])},"values"),Q.Arguments=Q.Array,X("keys"),X("values"),X("entries")},function(W,H){},function(W,H,F){var X,J,Q,G=F(28),q=F(2),K=F(7),V=F(21),B=F(23),I=F(9),M=(F(3),F(14)),E=F(38),A=F(40),N=(F(58).set,F(60)),O=F(30).set,T=F(48)(),C="Promise",R=q.TypeError,L=q.process,w=q[C],L=q.process,k=V(L)=="process",v=function(){},f=!!function(){try{var l=w.resolve(1),s=(l.constructor={})[F(1)("species")]=function(g){g(v,v)};return(k||typeof PromiseRejectionEvent=="function")&&l.then(v)instanceof s}catch(g){}}(),h=function(l,s){return l===s||l===w&&s===Q},b=function(l){var s;return!(!I(l)||typeof(s=l.then)!="function")&&s},x=function(l){return h(w,l)?new y(l):new J(l)},y=J=function(l){var s,g;this.promise=new l(function(u,a){if(s!==void 0||g!==void 0)throw R("Bad Promise constructor");s=u,g=a}),this.resolve=M(s),this.reject=M(g)},n=function(l){try{l()}catch(s){return{error:s}}},Z0=function(l,s){if(!l._n){l._n=!0;var g=l._c;T(function(){for(var u=l._v,a=l._s==1,t=0,J0=function(z0){var N0,P0,D0=a?z0.ok:z0.fail,A0=z0.resolve,Y0=z0.reject,G0=z0.domain;try{D0?(a||(l._h==2&&c(l),l._h=1),D0===!0?N0=u:(G0&&G0.enter(),N0=D0(u),G0&&G0.exit()),N0===z0.promise?Y0(R("Promise-chain cycle")):(P0=b(N0))?P0.call(N0,A0,Y0):A0(N0)):Y0(u)}catch(U0){Y0(U0)}};g.length>t;)J0(g[t++]);l._c=[],l._n=!1,s&&!l._h&&m(l)})}},m=function(l){O.call(q,function(){var s,g,u,a=l._v;if(j(l)&&(s=n(function(){k?L.emit("unhandledRejection",a,l):(g=q.onunhandledrejection)?g({promise:l,reason:a}):(u=q.console)&&u.error&&u.error("Unhandled promise rejection",a)}),l._h=k||j(l)?2:1),l._a=void 0,s)throw s.error})},j=function(l){if(l._h==1)return!1;for(var s,g=l._a||l._c,u=0;g.length>u;)if(s=g[u++],s.fail||!j(s.promise))return!1;return!0},c=function(l){O.call(q,function(){var s;k?L.emit("rejectionHandled",l):(s=q.onrejectionhandled)&&s({promise:l,reason:l._v})})},p=function(l){var s=this;s._d||(s._d=!0,s=s._w||s,s._v=l,s._s=2,s._a||(s._a=s._c.slice()),Z0(s,!0))},Q0=function(l){var s,g=this;if(!g._d){g._d=!0,g=g._w||g;try{if(g===l)throw R("Promise can't be resolved itself");(s=b(l))?T(function(){var u={_w:g,_d:!1};try{s.call(l,K(Q0,u,1),K(p,u,1))}catch(a){p.call(u,a)}}):(g._v=l,g._s=1,Z0(g,!1))}catch(u){p.call({_w:g,_d:!1},u)}}};f||(w=function(l){E(this,w,C,"_h"),M(l),X.call(this);try{l(K(Q0,this,1),K(p,this,1))}catch(s){p.call(this,s)}},X=function(l){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},X.prototype=F(56)(w.prototype,{then:function(l,s){var g=x(N(this,w));return g.ok=typeof l!="function"||l,g.fail=typeof s=="function"&&s,g.domain=k?L.domain:void 0,this._c.push(g),this._a&&this._a.push(g),this._s&&Z0(this,!1),g.promise},catch:function(l){return this.then(void 0,l)}}),y=function(){var l=new X;this.promise=l,this.resolve=K(Q0,l,1),this.reject=K(p,l,1)}),B(B.G+B.W+B.F*!f,{Promise:w}),F(18)(w,C),F(59)(C),Q=F(6)[C],B(B.S+B.F*!f,C,{reject:function(l){var s=x(this),g=s.reject;return g(l),s.promise}}),B(B.S+B.F*(G||!f),C,{resolve:function(l){if(l instanceof w&&h(l.constructor,this))return l;var s=x(this),g=s.resolve;return g(l),s.promise}}),B(B.S+B.F*!(f&&F(46)(function(l){w.all(l).catch(v)})),C,{all:function(l){var s=this,g=x(s),u=g.resolve,a=g.reject,t=n(function(){var J0=[],z0=0,N0=1;A(l,!1,function(P0){var D0=z0++,A0=!1;J0.push(void 0),N0++,s.resolve(P0).then(function(Y0){A0||(A0=!0,J0[D0]=Y0,--N0||u(J0))},a)}),--N0||u(J0)});return t&&a(t.error),g.promise},race:function(l){var s=this,g=x(s),u=g.reject,a=n(function(){A(l,!1,function(t){s.resolve(t).then(g.resolve,u)})});return a&&u(a.error),g.promise}})},function(W,H,F){var X=F(61)(!0);F(27)(String,"String",function(J){this._t=String(J),this._i=0},function(){var J,Q=this._t,G=this._i;return G>=Q.length?{value:void 0,done:!0}:(J=X(Q,G),this._i+=J.length,{value:J,done:!1})})},function(W,H,F){F(65);for(var X=F(2),J=F(5),Q=F(10),G=F(1)("toStringTag"),q=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],K=0;K<5;K++){var V=q[K],B=X[V],I=B&&B.prototype;I&&!I[G]&&J(I,G,V),Q[V]=Q.Array}},function(W,H){W.exports=V1("child_process")},function(W,H){W.exports=V1("crypto")}])})});import{existsSync as YI0,mkdirSync as ZI0,readFileSync as QI0,writeFileSync as XI0}from"node:fs";import{resolve as JI0}from"node:path";import{nanoid as WI0}from"nanoid";function G7(Y){let Z=Y?.trim();if(Z)return Z;let W=GI0();if(W)return W;return FI0()}function GI0(){try{return Od.machineIdSync().trim()||void 0}catch{return}}function FI0(){let Y=H9(),Z=JI0(Y,KI0);try{if(YI0(Z)){let H=QI0(Z,"utf8").trim();if(H.length>0)return H}}catch{}let W=`cl-${WI0()}`;try{ZI0(Y,{recursive:!0}),XI0(Z,W,"utf8")}catch{}return W}var Od,KI0="machine-id";var fW=n7(()=>{x6();Od=y6(Nd(),1)});class kW{name;logger;enabled;constructor(Y={}){this.name=Y.name??"TelemetryLoggerSink",this.logger=Y.logger,this.enabled=Y.enabled??!0}emit(Y,Z){if(!this.isEnabled())return;this.logger?.log("telemetry.event",{telemetrySink:this.name,event:Y,properties:Z})}emitRequired(Y,Z){this.logger?.log("telemetry.required_event",{telemetrySink:this.name,severity:"warn",event:Y,properties:Z})}recordCounter(Y,Z,W,H,F){if(!F&&!this.isEnabled())return;this.logger?.debug("telemetry.metric",{telemetrySink:this.name,instrument:"counter",name:Y,value:Z,attributes:W,description:H,required:F===!0})}recordHistogram(Y,Z,W,H,F){if(!F&&!this.isEnabled())return;this.logger?.debug("telemetry.metric",{telemetrySink:this.name,instrument:"histogram",name:Y,value:Z,attributes:W,description:H,required:F===!0})}recordGauge(Y,Z,W,H,F){if(!F&&!this.isEnabled())return;this.logger?.debug("telemetry.metric",{telemetrySink:this.name,instrument:"gauge",name:Y,value:Z,attributes:W,description:H,required:F===!0})}isEnabled(){return typeof this.enabled==="function"?this.enabled():this.enabled}async flush(){}async dispose(){}}class RQ{adapters;metadata;distinctId;commonProperties;constructor(Y={}){if(this.adapters=[...Y.adapters??[]],Y.logger)this.adapters.push(new kW({logger:Y.logger}));this.metadata={...Y.metadata??{}},this.distinctId=Y.distinctId,this.commonProperties={...Y.commonProperties??{}}}addAdapter(Y){this.adapters.push(Y)}setDistinctId(Y){this.distinctId=Y}setMetadata(Y){this.metadata={...Y}}updateMetadata(Y){this.metadata={...this.metadata,...Y}}setCommonProperties(Y){this.commonProperties={...Y}}updateCommonProperties(Y){this.commonProperties={...this.commonProperties,...Y}}isEnabled(){return this.adapters.some((Y)=>Y.isEnabled())}capture(Y){let Z=this.buildAttributes(Y.properties);for(let W of this.adapters)W.emit(Y.event,Z)}captureRequired(Y,Z){let W=this.buildAttributes(Z);for(let H of this.adapters)H.emitRequired(Y,W)}recordCounter(Y,Z,W,H,F=!1){let X=this.buildAttributes(W);for(let J of this.adapters)J.recordCounter(Y,Z,X,H,F)}recordHistogram(Y,Z,W,H,F=!1){let X=this.buildAttributes(W);for(let J of this.adapters)J.recordHistogram(Y,Z,X,H,F)}recordGauge(Y,Z,W,H,F=!1){let X=this.buildAttributes(W);for(let J of this.adapters)J.recordGauge(Y,Z,X,H,F)}async flush(){await Promise.all(this.adapters.map((Y)=>Y.flush()))}async dispose(){await Promise.all(this.adapters.map((Y)=>Y.dispose()))}buildAttributes(Y){return{...this.commonProperties,...Y,...this.metadata,...this.distinctId?{distinct_id:this.distinctId}:{}}}}var Aq=()=>{};class PQ{meterProvider;loggerProvider;tracerProvider;options;constructor(Y={}){this.options=Y;let Z=Cd.resourceFromAttributes({[vW.ATTR_SERVICE_NAME]:Y.serviceName??"cline",...Y.serviceVersion?{[vW.ATTR_SERVICE_VERSION]:Y.serviceVersion}:{}});if(this.meterProvider=this.createMeterProvider(Z),this.loggerProvider=this.createLoggerProvider(Z),this.tracerProvider=this.createTracerProvider(Z),this.meterProvider)yW.metrics.setGlobalMeterProvider(this.meterProvider);if(this.loggerProvider)Dd.logs.setGlobalLoggerProvider(this.loggerProvider);if(this.tracerProvider)this.tracerProvider.register()}getTracer(Y="cline",Z){return yW.trace.getTracer(Y,Z??this.options.serviceVersion)}createAdapter(Y){return new fZ({...Y,meterProvider:this.meterProvider,loggerProvider:this.loggerProvider})}createTelemetryService(Y){let Z=this.createAdapter({name:Y.name,enabled:this.options.enabled,metadata:Y.metadata});return new RQ({adapters:[Z],distinctId:G7(Y.distinctId),commonProperties:Y.commonProperties,logger:Y.logger})}async forceFlush(){await Promise.all([this.meterProvider?.forceFlush?.(),this.loggerProvider?.forceFlush?.(),this.tracerProvider?.forceFlush?.()])}async dispose(){await Promise.all([this.meterProvider?.shutdown?.(),this.loggerProvider?.shutdown?.(),this.tracerProvider?.shutdown?.()])}createMeterProvider(Y){let Z=Uq(this.options.metricsExporter);if(Z.length===0)return null;let W=Math.max(1000,this.options.metricExportIntervalMs??this.options.metricExportInterval??60000),H=Math.min(30000,Math.floor(W*0.8)),F=Z.map((X)=>qI0(X,{endpoint:this.options.otlpEndpoint,headers:this.options.otlpHeaders,insecure:this.options.otlpInsecure??!1,protocol:"http/json",interval:W,timeout:H})).filter((X)=>X!==null);if(F.length===0)return null;return new F7.MeterProvider({resource:Y,readers:F})}createTracerProvider(Y){let Z=Uq(this.options.tracesExporter);if(Z.length===0)return null;let W=this.options.otlpTracesEndpoint??this.options.otlpEndpoint,H=this.options.otlpTracesHeaders??this.options.otlpHeaders,F=[];for(let X of Z){let J=VI0(X,{endpoint:W,headers:H,insecure:this.options.otlpInsecure??!1,protocol:"http/json"});if(J)F.push(J)}if(F.length===0)return null;return new Ed.NodeTracerProvider({resource:Y,spanProcessors:F})}createLoggerProvider(Y){let Z=Uq(this.options.logsExporter);if(Z.length===0)return null;let W=Z.map((H)=>{let F=HI0(H,{endpoint:this.options.otlpEndpoint,headers:this.options.otlpHeaders,insecure:this.options.otlpInsecure??!1,protocol:"http/json"});if(!F)return null;return new TY.BatchLogRecordProcessor(F,{maxQueueSize:this.options.logMaxQueueSize??2048,maxExportBatchSize:this.options.logBatchSize??512,scheduledDelayMillis:this.options.logBatchTimeoutMs??this.options.logBatchTimeout??5000})}).filter((H)=>H!==null);if(W.length===0)return null;return new TY.LoggerProvider({resource:Y,processors:W})}}function hW(Y){let Z=new PQ(Y),W=Z.createTelemetryService(Y);return W.captureRequired("telemetry.provider_created",{provider:"opentelemetry",enabled:Y.enabled??!0,logsExporter:Array.isArray(Y.logsExporter)?Y.logsExporter.join(","):Y.logsExporter,metricsExporter:Array.isArray(Y.metricsExporter)?Y.metricsExporter.join(","):Y.metricsExporter,tracesExporter:Array.isArray(Y.tracesExporter)?Y.tracesExporter.join(","):Y.tracesExporter,otlpProtocol:Y.otlpProtocol,hasOtlpEndpoint:Boolean(Y.otlpEndpoint),serviceName:Y.serviceName,serviceVersion:Y.serviceVersion}),{provider:Z,telemetry:W}}function Nq(Y){if(Y.enabled!==!0)return{telemetry:new RQ({distinctId:G7(Y.distinctId)})};return hW(Y)}function Uq(Y){if(!Y)return[];return(Array.isArray(Y)?Y:Y.split(",")).map((W)=>W.trim()).filter((W)=>W==="console"||W==="otlp")}function HI0(Y,Z){if(Y==="console")return new TY.ConsoleLogRecordExporter;if(!Z.endpoint)return null;let W=Oq(Z.endpoint,"/v1/logs");return new Td.OTLPLogExporter({url:W,headers:Z.headers})}function VI0(Y,Z){if(Y==="console")return new IY.SimpleSpanProcessor(new IY.ConsoleSpanExporter);if(!Z.endpoint)return null;let W=Oq(Z.endpoint,"/v1/traces");return new IY.BatchSpanProcessor(new $d.OTLPTraceExporter({url:W,headers:Z.headers}))}function qI0(Y,Z){if(Y==="console")return new F7.PeriodicExportingMetricReader({exporter:new F7.ConsoleMetricExporter,exportIntervalMillis:Z.interval,exportTimeoutMillis:Z.timeout});if(!Z.endpoint)return null;let W=Oq(Z.endpoint,"/v1/metrics");return new F7.PeriodicExportingMetricReader({exporter:new Id.OTLPMetricExporter({url:W,headers:Z.headers}),exportIntervalMillis:Z.interval,exportTimeoutMillis:Z.timeout})}function Oq(Y,Z){let W=new URL(Y),H=W.pathname.endsWith("/")?W.pathname.slice(0,-1):W.pathname;return W.pathname=H.endsWith(Z)?H:`${H}${Z}`,W.toString()}var yW,Dd,Td,Id,$d,Cd,TY,F7,IY,Ed,vW;var Dq=n7(()=>{fW();Aq();yW=y6(f1(),1),Dd=y6(o7(),1),Td=y6(Lb(),1),Id=y6(mb(),1),$d=y6(rb(),1),Cd=y6(WQ(),1),TY=y6(Xm(),1),F7=y6(QW(),1),IY=y6(EW(),1),Ed=y6(Qd(),1),vW=y6(m5(),1)});var Md={};p60(Md,{createOpenTelemetryTelemetryService:()=>hW,createConfiguredTelemetryService:()=>Nq,OpenTelemetryProvider:()=>PQ,OpenTelemetryAdapter:()=>fZ});var Rd=n7(()=>{Dq()});var a1=H0((ic)=>{Object.defineProperty(ic,"__esModule",{value:!0});ic.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=ic.DEFAULT_MAX_SEND_MESSAGE_LENGTH=ic.Propagate=ic.LogVerbosity=ic.Status=void 0;var lc;(function(Y){Y[Y.OK=0]="OK",Y[Y.CANCELLED=1]="CANCELLED",Y[Y.UNKNOWN=2]="UNKNOWN",Y[Y.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Y[Y.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Y[Y.NOT_FOUND=5]="NOT_FOUND",Y[Y.ALREADY_EXISTS=6]="ALREADY_EXISTS",Y[Y.PERMISSION_DENIED=7]="PERMISSION_DENIED",Y[Y.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Y[Y.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Y[Y.ABORTED=10]="ABORTED",Y[Y.OUT_OF_RANGE=11]="OUT_OF_RANGE",Y[Y.UNIMPLEMENTED=12]="UNIMPLEMENTED",Y[Y.INTERNAL=13]="INTERNAL",Y[Y.UNAVAILABLE=14]="UNAVAILABLE",Y[Y.DATA_LOSS=15]="DATA_LOSS",Y[Y.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(lc||(ic.Status=lc={}));var nc;(function(Y){Y[Y.DEBUG=0]="DEBUG",Y[Y.INFO=1]="INFO",Y[Y.ERROR=2]="ERROR",Y[Y.NONE=3]="NONE"})(nc||(ic.LogVerbosity=nc={}));var pc;(function(Y){Y[Y.DEADLINE=1]="DEADLINE",Y[Y.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",Y[Y.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",Y[Y.CANCELLATION=8]="CANCELLATION",Y[Y.DEFAULTS=65535]="DEFAULTS"})(pc||(ic.Propagate=pc={}));ic.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;ic.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4194304});var fz=H0((Yt0,h$0)=>{h$0.exports={name:"@grpc/grpc-js",version:"1.14.3",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 M6=H0((tc)=>{var kz,yz,vz,hz;Object.defineProperty(tc,"__esModule",{value:!0});tc.log=tc.setLoggerVerbosity=tc.setLogger=tc.getLogger=void 0;tc.trace=n$0;tc.isTracerEnabled=oc;var F5=a1(),j$0=V1("process"),_$0=fz().version,x$0={error:(Y,...Z)=>{console.error("E "+Y,...Z)},info:(Y,...Z)=>{console.error("I "+Y,...Z)},debug:(Y,...Z)=>{console.error("D "+Y,...Z)}},B7=x$0,LY=F5.LogVerbosity.ERROR,b$0=(yz=(kz=process.env.GRPC_NODE_VERBOSITY)!==null&&kz!==void 0?kz:process.env.GRPC_VERBOSITY)!==null&&yz!==void 0?yz:"";switch(b$0.toUpperCase()){case"DEBUG":LY=F5.LogVerbosity.DEBUG;break;case"INFO":LY=F5.LogVerbosity.INFO;break;case"ERROR":LY=F5.LogVerbosity.ERROR;break;case"NONE":LY=F5.LogVerbosity.NONE;break;default:}var u$0=()=>{return B7};tc.getLogger=u$0;var m$0=(Y)=>{B7=Y};tc.setLogger=m$0;var g$0=(Y)=>{LY=Y};tc.setLoggerVerbosity=g$0;var d$0=(Y,...Z)=>{let W;if(Y>=LY){switch(Y){case F5.LogVerbosity.DEBUG:W=B7.debug;break;case F5.LogVerbosity.INFO:W=B7.info;break;case F5.LogVerbosity.ERROR:W=B7.error;break}if(!W)W=B7.error;if(W)W.bind(B7)(...Z)}};tc.log=d$0;var c$0=(hz=(vz=process.env.GRPC_NODE_TRACE)!==null&&vz!==void 0?vz:process.env.GRPC_TRACE)!==null&&hz!==void 0?hz:"",jz=new Set,ac=new Set;for(let Y of c$0.split(","))if(Y.startsWith("-"))ac.add(Y.substring(1));else jz.add(Y);var l$0=jz.has("all");function n$0(Y,Z,W){if(oc(Z))tc.log(Y,new Date().toISOString()+" | v"+_$0+" "+j$0.pid+" | "+Z+" | "+W)}function oc(Y){return!ac.has(Y)&&(l$0||jz.has(Y))}});var Y3=H0((sc)=>{Object.defineProperty(sc,"__esModule",{value:!0});sc.getErrorMessage=t$0;sc.getErrorCode=s$0;function t$0(Y){if(Y instanceof Error)return Y.message;else return String(Y)}function s$0(Y){if(typeof Y==="object"&&Y!==null&&"code"in Y&&typeof Y.code==="number")return Y.code;else return null}});var K8=H0((Zl)=>{Object.defineProperty(Zl,"__esModule",{value:!0});Zl.Metadata=void 0;var ZC0=M6(),QC0=a1(),XC0=Y3(),JC0=/^[:0-9a-z_.-]+$/,WC0=/^[ -~]*$/;function KC0(Y){return JC0.test(Y)}function GC0(Y){return WC0.test(Y)}function Yl(Y){return Y.endsWith("-bin")}function FC0(Y){return!Y.startsWith("grpc-")}function Z3(Y){return Y.toLowerCase()}function ec(Y,Z){if(!KC0(Y))throw Error('Metadata key "'+Y+'" contains illegal characters');if(Z!==null&&Z!==void 0)if(Yl(Y)){if(!Buffer.isBuffer(Z))throw Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(Z))throw Error("keys that don't end with '-bin' must have String values");if(!GC0(Z))throw Error('Metadata string value "'+Z+'" contains illegal characters')}}class Q3{constructor(Y={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=Y}set(Y,Z){Y=Z3(Y),ec(Y,Z),this.internalRepr.set(Y,[Z])}add(Y,Z){Y=Z3(Y),ec(Y,Z);let W=this.internalRepr.get(Y);if(W===void 0)this.internalRepr.set(Y,[Z]);else W.push(Z)}remove(Y){Y=Z3(Y),this.internalRepr.delete(Y)}get(Y){return Y=Z3(Y),this.internalRepr.get(Y)||[]}getMap(){let Y={};for(let[Z,W]of this.internalRepr)if(W.length>0){let H=W[0];Y[Z]=Buffer.isBuffer(H)?Buffer.from(H):H}return Y}clone(){let Y=new Q3(this.options),Z=Y.internalRepr;for(let[W,H]of this.internalRepr){let F=H.map((X)=>{if(Buffer.isBuffer(X))return Buffer.from(X);else return X});Z.set(W,F)}return Y}merge(Y){for(let[Z,W]of Y.internalRepr){let H=(this.internalRepr.get(Z)||[]).concat(W);this.internalRepr.set(Z,H)}}setOptions(Y){this.options=Y}getOptions(){return this.options}toHttp2Headers(){let Y={};for(let[Z,W]of this.internalRepr){if(Z.startsWith(":"))continue;Y[Z]=W.map(HC0)}return Y}toJSON(){let Y={};for(let[Z,W]of this.internalRepr)Y[Z]=W;return Y}setOpaque(Y,Z){this.opaqueData.set(Y,Z)}getOpaque(Y){return this.opaqueData.get(Y)}static fromHttp2Headers(Y){let Z=new Q3;for(let W of Object.keys(Y)){if(W.charAt(0)===":")continue;let H=Y[W];try{if(Yl(W)){if(Array.isArray(H))H.forEach((F)=>{Z.add(W,Buffer.from(F,"base64"))});else if(H!==void 0)if(FC0(W))H.split(",").forEach((F)=>{Z.add(W,Buffer.from(F.trim(),"base64"))});else Z.add(W,Buffer.from(H,"base64"))}else if(Array.isArray(H))H.forEach((F)=>{Z.add(W,F)});else if(H!==void 0)Z.add(W,H)}catch(F){let X=`Failed to add metadata entry ${W}: ${H}. ${(0,XC0.getErrorMessage)(F)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,ZC0.log)(QC0.LogVerbosity.ERROR,X)}}return Z}}Zl.Metadata=Q3;var HC0=(Y)=>{return Buffer.isBuffer(Y)?Y.toString("base64"):Y}});var J3=H0((Xl)=>{Object.defineProperty(Xl,"__esModule",{value:!0});Xl.CallCredentials=void 0;var xz=K8();function VC0(Y){return"getRequestHeaders"in Y&&typeof Y.getRequestHeaders==="function"}class wY{static createFromMetadataGenerator(Y){return new bz(Y)}static createFromGoogleCredential(Y){return wY.createFromMetadataGenerator((Z,W)=>{let H;if(VC0(Y))H=Y.getRequestHeaders(Z.service_url);else H=new Promise((F,X)=>{Y.getRequestMetadata(Z.service_url,(J,Q)=>{if(J){X(J);return}if(!Q){X(Error("Headers not set by metadata plugin"));return}F(Q)})});H.then((F)=>{let X=new xz.Metadata;for(let J of Object.keys(F))X.add(J,F[J]);W(null,X)},(F)=>{W(F)})})}static createEmpty(){return new uz}}Xl.CallCredentials=wY;class X3 extends wY{constructor(Y){super();this.creds=Y}async generateMetadata(Y){let Z=new xz.Metadata,W=await Promise.all(this.creds.map((H)=>H.generateMetadata(Y)));for(let H of W)Z.merge(H);return Z}compose(Y){return new X3(this.creds.concat([Y]))}_equals(Y){if(this===Y)return!0;if(Y instanceof X3)return this.creds.every((Z,W)=>Z._equals(Y.creds[W]));else return!1}}class bz extends wY{constructor(Y){super();this.metadataGenerator=Y}generateMetadata(Y){return new Promise((Z,W)=>{this.metadataGenerator(Y,(H,F)=>{if(F!==void 0)Z(F);else W(H)})})}compose(Y){return new X3([this,Y])}_equals(Y){if(this===Y)return!0;if(Y instanceof bz)return this.metadataGenerator===Y.metadataGenerator;else return!1}}class uz extends wY{generateMetadata(Y){return Promise.resolve(new xz.Metadata)}compose(Y){return Y}_equals(Y){return Y instanceof uz}}});var gz=H0((Kl)=>{Object.defineProperty(Kl,"__esModule",{value:!0});Kl.CIPHER_SUITES=void 0;Kl.getDefaultRootsData=zC0;var qC0=V1("fs");Kl.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var Wl=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,mz=null;function zC0(){if(Wl){if(mz===null)mz=qC0.readFileSync(Wl);return mz}return null}});var f8=H0((Hl)=>{Object.defineProperty(Hl,"__esModule",{value:!0});Hl.parseUri=UC0;Hl.splitHostPort=NC0;Hl.combineHostPort=OC0;Hl.uriToString=DC0;var AC0=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function UC0(Y){let Z=AC0.exec(Y);if(Z===null)return null;return{scheme:Z[1],authority:Z[2],path:Z[3]}}var Fl=/^\d+$/;function NC0(Y){if(Y.startsWith("[")){let Z=Y.indexOf("]");if(Z===-1)return null;let W=Y.substring(1,Z);if(W.indexOf(":")===-1)return null;if(Y.length>Z+1)if(Y[Z+1]===":"){let H=Y.substring(Z+2);if(Fl.test(H))return{host:W,port:+H};else return null}else return null;else return{host:W}}else{let Z=Y.split(":");if(Z.length===2)if(Fl.test(Z[1]))return{host:Z[0],port:+Z[1]};else return null;else return{host:Y}}}function OC0(Y){if(Y.port===void 0)return Y.host;else if(Y.host.includes(":"))return`[${Y.host}]:${Y.port}`;else return`${Y.host}:${Y.port}`}function DC0(Y){let Z="";if(Y.scheme!==void 0)Z+=Y.scheme+":";if(Y.authority!==void 0)Z+="//"+Y.authority+"/";return Z+=Y.path,Z}});var S9=H0((Vl)=>{Object.defineProperty(Vl,"__esModule",{value:!0});Vl.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;Vl.registerResolver=EC0;Vl.registerDefaultScheme=MC0;Vl.createResolver=RC0;Vl.getDefaultAuthority=PC0;Vl.mapUriDefaultScheme=LC0;var cz=f8();Vl.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var SY={},dz=null;function EC0(Y,Z){SY[Y]=Z}function MC0(Y){dz=Y}function RC0(Y,Z,W){if(Y.scheme!==void 0&&Y.scheme in SY)return new SY[Y.scheme](Y,Z,W);else throw Error(`No resolver could be created for target ${(0,cz.uriToString)(Y)}`)}function PC0(Y){if(Y.scheme!==void 0&&Y.scheme in SY)return SY[Y.scheme].getDefaultAuthority(Y);else throw Error(`Invalid target ${(0,cz.uriToString)(Y)}`)}function LC0(Y){if(Y.scheme===void 0||!(Y.scheme in SY))if(dz!==null)return{scheme:dz,authority:void 0,path:(0,cz.uriToString)(Y)};else return null;return Y}});var kY=H0((Ul)=>{Object.defineProperty(Ul,"__esModule",{value:!0});Ul.ChannelCredentials=void 0;Ul.createCertificateProviderChannelCredentials=_C0;var vQ=V1("tls"),G3=J3(),nz=gz(),zl=f8(),vC0=S9(),hC0=M6(),jC0=a1();function lz(Y,Z){if(Y&&!(Y instanceof Buffer))throw TypeError(`${Z}, if provided, must be a Buffer.`)}class fY{compose(Y){return new K3(this,Y)}static createSsl(Y,Z,W,H){var F;if(lz(Y,"Root certificate"),lz(Z,"Private key"),lz(W,"Certificate chain"),Z&&!W)throw Error("Private key must be given with accompanying certificate chain");if(!Z&&W)throw Error("Certificate chain must be given with accompanying private key");let X=(0,vQ.createSecureContext)({ca:(F=Y!==null&&Y!==void 0?Y:(0,nz.getDefaultRootsData)())!==null&&F!==void 0?F:void 0,key:Z!==null&&Z!==void 0?Z:void 0,cert:W!==null&&W!==void 0?W:void 0,ciphers:nz.CIPHER_SUITES});return new W3(X,H!==null&&H!==void 0?H:{})}static createFromSecureContext(Y,Z){return new W3(Y,Z!==null&&Z!==void 0?Z:{})}static createInsecure(){return new pz}}Ul.ChannelCredentials=fY;class pz extends fY{constructor(){super()}compose(Y){throw Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(Y){return Y instanceof pz}_createSecureConnector(Y,Z,W){return{connect(H){return Promise.resolve({socket:H,secure:!1})},waitForReady:()=>{return Promise.resolve()},getCallCredentials:()=>{return W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty()},destroy(){}}}}function Bl(Y,Z,W,H){var F,X;let J={secureContext:Y},Q=W;if("grpc.http_connect_target"in H){let V=(0,zl.parseUri)(H["grpc.http_connect_target"]);if(V)Q=V}let G=(0,vC0.getDefaultAuthority)(Q),q=(0,zl.splitHostPort)(G),K=(F=q===null||q===void 0?void 0:q.host)!==null&&F!==void 0?F:G;if(J.host=K,Z.checkServerIdentity)J.checkServerIdentity=Z.checkServerIdentity;if(Z.rejectUnauthorized!==void 0)J.rejectUnauthorized=Z.rejectUnauthorized;if(J.ALPNProtocols=["h2"],H["grpc.ssl_target_name_override"]){let V=H["grpc.ssl_target_name_override"],B=(X=J.checkServerIdentity)!==null&&X!==void 0?X:vQ.checkServerIdentity;J.checkServerIdentity=(I,M)=>{return B(V,M)},J.servername=V}else J.servername=K;if(H["grpc-node.tls_enable_trace"])J.enableTrace=!0;return J}class Al{constructor(Y,Z){this.connectionOptions=Y,this.callCredentials=Z}connect(Y){let Z=Object.assign({socket:Y},this.connectionOptions);return new Promise((W,H)=>{let F=(0,vQ.connect)(Z,()=>{var X;if(((X=this.connectionOptions.rejectUnauthorized)!==null&&X!==void 0?X:!0)&&!F.authorized){H(F.authorizationError);return}W({socket:F,secure:!0})});F.on("error",(X)=>{H(X)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class W3 extends fY{constructor(Y,Z){super();this.secureContext=Y,this.verifyOptions=Z}_isSecure(){return!0}_equals(Y){if(this===Y)return!0;if(Y instanceof W3)return this.secureContext===Y.secureContext&&this.verifyOptions.checkServerIdentity===Y.verifyOptions.checkServerIdentity;else return!1}_createSecureConnector(Y,Z,W){let H=Bl(this.secureContext,this.verifyOptions,Y,Z);return new Al(H,W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty())}}class yQ extends fY{constructor(Y,Z,W){super();this.caCertificateProvider=Y,this.identityCertificateProvider=Z,this.verifyOptions=W,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(Y){var Z,W;if(this===Y)return!0;if(Y instanceof yQ)return this.caCertificateProvider===Y.caCertificateProvider&&this.identityCertificateProvider===Y.identityCertificateProvider&&((Z=this.verifyOptions)===null||Z===void 0?void 0:Z.checkServerIdentity)===((W=Y.verifyOptions)===null||W===void 0?void 0:W.checkServerIdentity);else return!1}ref(){var Y;if(this.refcount===0)this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(Y=this.identityCertificateProvider)===null||Y===void 0||Y.addIdentityCertificateListener(this.identityCertificateUpdateListener);this.refcount+=1}unref(){var Y;if(this.refcount-=1,this.refcount===0)this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(Y=this.identityCertificateProvider)===null||Y===void 0||Y.removeIdentityCertificateListener(this.identityCertificateUpdateListener)}_createSecureConnector(Y,Z,W){return this.ref(),new yQ.SecureConnectorImpl(this,Y,Z,W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let Y of this.secureContextWatchers)Y(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(Y){this.latestCaUpdate=Y,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(Y){this.latestIdentityUpdate=Y,this.maybeUpdateWatchers()}hasReceivedUpdates(){if(this.latestCaUpdate===void 0)return!1;if(this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)return!1;return!0}getSecureContext(){if(this.hasReceivedUpdates())return Promise.resolve(this.getLatestSecureContext());else return new Promise((Y)=>{this.secureContextWatchers.push(Y)})}getLatestSecureContext(){var Y,Z;if(!this.latestCaUpdate)return null;if(this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,vQ.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(Y=this.latestIdentityUpdate)===null||Y===void 0?void 0:Y.privateKey,cert:(Z=this.latestIdentityUpdate)===null||Z===void 0?void 0:Z.certificate,ciphers:nz.CIPHER_SUITES})}catch(W){return(0,hC0.log)(jC0.LogVerbosity.ERROR,"Failed to createSecureContext with error "+W.message),null}}}yQ.SecureConnectorImpl=class{constructor(Y,Z,W,H){this.parent=Y,this.channelTarget=Z,this.options=W,this.callCredentials=H}connect(Y){return new Promise((Z,W)=>{let H=this.parent.getLatestSecureContext();if(!H){W(Error("Failed to load credentials"));return}if(Y.closed)W(Error("Socket closed while loading credentials"));let F=Bl(H,this.parent.verifyOptions,this.channelTarget,this.options),X=Object.assign({socket:Y},F),J=()=>{W(Error("Socket closed"))},Q=(q)=>{W(q)},G=(0,vQ.connect)(X,()=>{var q;if(G.removeListener("close",J),G.removeListener("error",Q),((q=this.parent.verifyOptions.rejectUnauthorized)!==null&&q!==void 0?q:!0)&&!G.authorized){W(G.authorizationError);return}Z({socket:G,secure:!0})});G.once("close",J),G.once("error",Q)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function _C0(Y,Z,W){return new yQ(Y,Z,W!==null&&W!==void 0?W:{})}class K3 extends fY{constructor(Y,Z){super();if(this.channelCredentials=Y,this.callCredentials=Z,!Y._isSecure())throw Error("Cannot compose insecure credentials")}compose(Y){let Z=this.callCredentials.compose(Y);return new K3(this.channelCredentials,Z)}_isSecure(){return!0}_equals(Y){if(this===Y)return!0;if(Y instanceof K3)return this.channelCredentials._equals(Y.channelCredentials)&&this.callCredentials._equals(Y.callCredentials);else return!1}_createSecureConnector(Y,Z,W){let H=this.callCredentials.compose(W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(Y,Z,H)}}});var V5=H0((Dl)=>{Object.defineProperty(Dl,"__esModule",{value:!0});Dl.createChildChannelControlHelper=mC0;Dl.registerLoadBalancerType=gC0;Dl.registerDefaultLoadBalancerType=dC0;Dl.createLoadBalancer=cC0;Dl.isLoadBalancerNameRegistered=lC0;Dl.parseLoadBalancingConfig=Ol;Dl.getDefaultConfig=nC0;Dl.selectLbConfigFromList=pC0;var bC0=M6(),uC0=a1();function mC0(Y,Z){var W,H,F,X,J,Q,G,q,K,V;return{createSubchannel:(H=(W=Z.createSubchannel)===null||W===void 0?void 0:W.bind(Z))!==null&&H!==void 0?H:Y.createSubchannel.bind(Y),updateState:(X=(F=Z.updateState)===null||F===void 0?void 0:F.bind(Z))!==null&&X!==void 0?X:Y.updateState.bind(Y),requestReresolution:(Q=(J=Z.requestReresolution)===null||J===void 0?void 0:J.bind(Z))!==null&&Q!==void 0?Q:Y.requestReresolution.bind(Y),addChannelzChild:(q=(G=Z.addChannelzChild)===null||G===void 0?void 0:G.bind(Z))!==null&&q!==void 0?q:Y.addChannelzChild.bind(Y),removeChannelzChild:(V=(K=Z.removeChannelzChild)===null||K===void 0?void 0:K.bind(Z))!==null&&V!==void 0?V:Y.removeChannelzChild.bind(Y)}}var H5={},hQ=null;function gC0(Y,Z,W){H5[Y]={LoadBalancer:Z,LoadBalancingConfig:W}}function dC0(Y){hQ=Y}function cC0(Y,Z){let W=Y.getLoadBalancerName();if(W in H5)return new H5[W].LoadBalancer(Z);else return null}function lC0(Y){return Y in H5}function Ol(Y){let Z=Object.keys(Y);if(Z.length!==1)throw Error("Provided load balancing config has multiple conflicting entries");let W=Z[0];if(W in H5)try{return H5[W].LoadBalancingConfig.createFromJson(Y[W])}catch(H){throw Error(`${W}: ${H.message}`)}else throw Error(`Unrecognized load balancing config name ${W}`)}function nC0(){if(!hQ)throw Error("No default load balancer type registered");return new H5[hQ].LoadBalancingConfig}function pC0(Y,Z=!1){for(let W of Y)try{return Ol(W)}catch(H){(0,bC0.log)(uC0.LogVerbosity.DEBUG,"Config parsing failed with error",H.message);continue}if(Z)if(hQ)return new H5[hQ].LoadBalancingConfig;else return null;else return null}});var iz=H0(($l)=>{Object.defineProperty($l,"__esModule",{value:!0});$l.validateRetryThrottling=Tl;$l.validateServiceConfig=Il;$l.extractAndSelectServiceConfig=VE0;var ZE0=V1("os"),F3=a1(),H3=/^\d+(\.\d{1,9})?s$/,QE0="node";function XE0(Y){if("service"in Y&&Y.service!==""){if(typeof Y.service!=="string")throw Error(`Invalid method config name: invalid service: expected type string, got ${typeof Y.service}`);if("method"in Y&&Y.method!==""){if(typeof Y.method!=="string")throw Error(`Invalid method config name: invalid method: expected type string, got ${typeof Y.service}`);return{service:Y.service,method:Y.method}}else return{service:Y.service}}else{if("method"in Y&&Y.method!==void 0)throw Error("Invalid method config name: method set with empty or unset service");return{}}}function JE0(Y){if(!("maxAttempts"in Y)||!Number.isInteger(Y.maxAttempts)||Y.maxAttempts<2)throw Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in Y)||typeof Y.initialBackoff!=="string"||!H3.test(Y.initialBackoff))throw Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in Y)||typeof Y.maxBackoff!=="string"||!H3.test(Y.maxBackoff))throw Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in Y)||typeof Y.backoffMultiplier!=="number"||Y.backoffMultiplier<=0)throw Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!(("retryableStatusCodes"in Y)&&Array.isArray(Y.retryableStatusCodes)))throw Error("Invalid method config retry policy: retryableStatusCodes is required");if(Y.retryableStatusCodes.length===0)throw Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let Z of Y.retryableStatusCodes)if(typeof Z==="number"){if(!Object.values(F3.Status).includes(Z))throw Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof Z==="string"){if(!Object.values(F3.Status).includes(Z.toUpperCase()))throw Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:Y.maxAttempts,initialBackoff:Y.initialBackoff,maxBackoff:Y.maxBackoff,backoffMultiplier:Y.backoffMultiplier,retryableStatusCodes:Y.retryableStatusCodes}}function WE0(Y){if(!("maxAttempts"in Y)||!Number.isInteger(Y.maxAttempts)||Y.maxAttempts<2)throw Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in Y&&(typeof Y.hedgingDelay!=="string"||!H3.test(Y.hedgingDelay)))throw Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in Y&&Array.isArray(Y.nonFatalStatusCodes))for(let W of Y.nonFatalStatusCodes)if(typeof W==="number"){if(!Object.values(F3.Status).includes(W))throw Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof W==="string"){if(!Object.values(F3.Status).includes(W.toUpperCase()))throw Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let Z={maxAttempts:Y.maxAttempts};if(Y.hedgingDelay)Z.hedgingDelay=Y.hedgingDelay;if(Y.nonFatalStatusCodes)Z.nonFatalStatusCodes=Y.nonFatalStatusCodes;return Z}function KE0(Y){var Z;let W={name:[]};if(!("name"in Y)||!Array.isArray(Y.name))throw Error("Invalid method config: invalid name array");for(let H of Y.name)W.name.push(XE0(H));if("waitForReady"in Y){if(typeof Y.waitForReady!=="boolean")throw Error("Invalid method config: invalid waitForReady");W.waitForReady=Y.waitForReady}if("timeout"in Y)if(typeof Y.timeout==="object"){if(!("seconds"in Y.timeout)||typeof Y.timeout.seconds!=="number")throw Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in Y.timeout)||typeof Y.timeout.nanos!=="number")throw Error("Invalid method config: invalid timeout.nanos");W.timeout=Y.timeout}else if(typeof Y.timeout==="string"&&H3.test(Y.timeout)){let H=Y.timeout.substring(0,Y.timeout.length-1).split(".");W.timeout={seconds:H[0]|0,nanos:((Z=H[1])!==null&&Z!==void 0?Z:0)|0}}else throw Error("Invalid method config: invalid timeout");if("maxRequestBytes"in Y){if(typeof Y.maxRequestBytes!=="number")throw Error("Invalid method config: invalid maxRequestBytes");W.maxRequestBytes=Y.maxRequestBytes}if("maxResponseBytes"in Y){if(typeof Y.maxResponseBytes!=="number")throw Error("Invalid method config: invalid maxRequestBytes");W.maxResponseBytes=Y.maxResponseBytes}if("retryPolicy"in Y)if("hedgingPolicy"in Y)throw Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");else W.retryPolicy=JE0(Y.retryPolicy);else if("hedgingPolicy"in Y)W.hedgingPolicy=WE0(Y.hedgingPolicy);return W}function Tl(Y){if(!("maxTokens"in Y)||typeof Y.maxTokens!=="number"||Y.maxTokens<=0||Y.maxTokens>1000)throw Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in Y)||typeof Y.tokenRatio!=="number"||Y.tokenRatio<=0)throw Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+Y.maxTokens.toFixed(3),tokenRatio:+Y.tokenRatio.toFixed(3)}}function GE0(Y){if(!(typeof Y==="object"&&Y!==null))throw Error(`Invalid loadBalancingConfig: unexpected type ${typeof Y}`);let Z=Object.keys(Y);if(Z.length>1)throw Error(`Invalid loadBalancingConfig: unexpected multiple keys ${Z}`);if(Z.length===0)throw Error("Invalid loadBalancingConfig: load balancing policy name required");return{[Z[0]]:Y[Z[0]]}}function Il(Y){let Z={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in Y)if(typeof Y.loadBalancingPolicy==="string")Z.loadBalancingPolicy=Y.loadBalancingPolicy;else throw Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in Y)if(Array.isArray(Y.loadBalancingConfig))for(let H of Y.loadBalancingConfig)Z.loadBalancingConfig.push(GE0(H));else throw Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in Y){if(Array.isArray(Y.methodConfig))for(let H of Y.methodConfig)Z.methodConfig.push(KE0(H))}if("retryThrottling"in Y)Z.retryThrottling=Tl(Y.retryThrottling);let W=[];for(let H of Z.methodConfig)for(let F of H.name){for(let X of W)if(F.service===X.service&&F.method===X.method)throw Error(`Invalid service config: duplicate name ${F.service}/${F.method}`);W.push(F)}return Z}function FE0(Y){if(!("serviceConfig"in Y))throw Error("Invalid service config choice: missing service config");let Z={serviceConfig:Il(Y.serviceConfig)};if("clientLanguage"in Y)if(Array.isArray(Y.clientLanguage)){Z.clientLanguage=[];for(let H of Y.clientLanguage)if(typeof H==="string")Z.clientLanguage.push(H);else throw Error("Invalid service config choice: invalid clientLanguage")}else throw Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in Y)if(Array.isArray(Y.clientHostname)){Z.clientHostname=[];for(let H of Y.clientHostname)if(typeof H==="string")Z.clientHostname.push(H);else throw Error("Invalid service config choice: invalid clientHostname")}else throw Error("Invalid service config choice: invalid clientHostname");if("percentage"in Y)if(typeof Y.percentage==="number"&&0<=Y.percentage&&Y.percentage<=100)Z.percentage=Y.percentage;else throw Error("Invalid service config choice: invalid percentage");let W=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let H in Y)if(!W.includes(H))throw Error(`Invalid service config choice: unexpected field ${H}`);return Z}function HE0(Y,Z){if(!Array.isArray(Y))throw Error("Invalid service config list");for(let W of Y){let H=FE0(W);if(typeof H.percentage==="number"&&Z>H.percentage)continue;if(Array.isArray(H.clientHostname)){let F=!1;for(let X of H.clientHostname)if(X===ZE0.hostname())F=!0;if(!F)continue}if(Array.isArray(H.clientLanguage)){let F=!1;for(let X of H.clientLanguage)if(X===QE0)F=!0;if(!F)continue}return H.serviceConfig}throw Error("No matching service config found")}function VE0(Y,Z){for(let W of Y)if(W.length>0&&W[0].startsWith("grpc_config=")){let H=W.join("").substring(12),F=JSON.parse(H);return HE0(F,Z)}return null}});var k8=H0((El)=>{Object.defineProperty(El,"__esModule",{value:!0});El.ConnectivityState=void 0;var Cl;(function(Y){Y[Y.IDLE=0]="IDLE",Y[Y.CONNECTING=1]="CONNECTING",Y[Y.READY=2]="READY",Y[Y.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",Y[Y.SHUTDOWN=4]="SHUTDOWN"})(Cl||(El.ConnectivityState=Cl={}))});var E4=H0((Ll)=>{Object.defineProperty(Ll,"__esModule",{value:!0});Ll.QueuePicker=Ll.UnavailablePicker=Ll.PickResultType=void 0;var AE0=K8(),UE0=a1(),V3;(function(Y){Y[Y.COMPLETE=0]="COMPLETE",Y[Y.QUEUE=1]="QUEUE",Y[Y.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",Y[Y.DROP=3]="DROP"})(V3||(Ll.PickResultType=V3={}));class Rl{constructor(Y){this.status=Object.assign({code:UE0.Status.UNAVAILABLE,details:"No connection established",metadata:new AE0.Metadata},Y)}pick(Y){return{pickResultType:V3.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}}Ll.UnavailablePicker=Rl;class Pl{constructor(Y,Z){this.loadBalancer=Y,this.childPicker=Z,this.calledExitIdle=!1}pick(Y){if(!this.calledExitIdle)process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0;if(this.childPicker)return this.childPicker.pick(Y);else return{pickResultType:V3.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}}Ll.QueuePicker=Pl});var yY=H0((Sl)=>{Object.defineProperty(Sl,"__esModule",{value:!0});Sl.BackoffTimeout=void 0;var DE0=a1(),TE0=M6(),IE0="backoff",$E0=1000,CE0=1.6,EE0=120000,ME0=0.2;function RE0(Y,Z){return Math.random()*(Z-Y)+Y}class q3{constructor(Y,Z){if(this.callback=Y,this.initialDelay=$E0,this.multiplier=CE0,this.maxDelay=EE0,this.jitter=ME0,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=q3.getNextId(),Z){if(Z.initialDelay)this.initialDelay=Z.initialDelay;if(Z.multiplier)this.multiplier=Z.multiplier;if(Z.jitter)this.jitter=Z.jitter;if(Z.maxDelay)this.maxDelay=Z.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(Y){TE0.trace(DE0.LogVerbosity.DEBUG,IE0,"{"+this.id+"} "+Y)}runTimer(Y){var Z,W;if(this.trace("runTimer(delay="+Y+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+Y),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},Y),!this.hasRef)(W=(Z=this.timerId).unref)===null||W===void 0||W.call(Z)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let Y=Math.min(this.nextDelay*this.multiplier,this.maxDelay),Z=Y*this.jitter;this.nextDelay=Y+RE0(-Z,Z)}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 Y=new Date,Z=this.startTime;if(Z.setMilliseconds(Z.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),Y<Z)this.runTimer(Z.getTime()-Y.getTime());else this.running=!1}}isRunning(){return this.running}ref(){var Y,Z;this.hasRef=!0,(Z=(Y=this.timerId).ref)===null||Z===void 0||Z.call(Y)}unref(){var Y,Z;this.hasRef=!1,(Z=(Y=this.timerId).unref)===null||Z===void 0||Z.call(Y)}getEndTime(){return this.endTime}}Sl.BackoffTimeout=q3;q3.nextId=0});var z3=H0((yl)=>{Object.defineProperty(yl,"__esModule",{value:!0});yl.ChildLoadBalancerHandler=void 0;var PE0=V5(),LE0=k8(),wE0="child_load_balancer_helper";class kl{constructor(Y){this.channelControlHelper=Y,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(Z){this.parent=Z,this.child=null}createSubchannel(Z,W){return this.parent.channelControlHelper.createSubchannel(Z,W)}updateState(Z,W,H){var F;if(this.calledByPendingChild()){if(Z===LE0.ConnectivityState.CONNECTING)return;(F=this.parent.currentChild)===null||F===void 0||F.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(Z,W,H)}requestReresolution(){var Z;let W=(Z=this.parent.pendingChild)!==null&&Z!==void 0?Z:this.parent.currentChild;if(this.child===W)this.parent.channelControlHelper.requestReresolution()}setChild(Z){this.child=Z}addChannelzChild(Z){this.parent.channelControlHelper.addChannelzChild(Z)}removeChannelzChild(Z){this.parent.channelControlHelper.removeChannelzChild(Z)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(Y,Z){return Y.getLoadBalancerName()!==Z.getLoadBalancerName()}updateAddressList(Y,Z,W,H){let F;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,Z)){let X=new this.ChildPolicyHelper(this),J=(0,PE0.createLoadBalancer)(Z,X);if(X.setChild(J),this.currentChild===null)this.currentChild=J,F=this.currentChild;else{if(this.pendingChild)this.pendingChild.destroy();this.pendingChild=J,F=this.pendingChild}}else if(this.pendingChild===null)F=this.currentChild;else F=this.pendingChild;return this.latestConfig=Z,F.updateAddressList(Y,Z,W,H)}exitIdle(){if(this.currentChild){if(this.currentChild.exitIdle(),this.pendingChild)this.pendingChild.exitIdle()}}resetBackoff(){if(this.currentChild){if(this.currentChild.resetBackoff(),this.pendingChild)this.pendingChild.resetBackoff()}}destroy(){if(this.currentChild)this.currentChild.destroy(),this.currentChild=null;if(this.pendingChild)this.pendingChild.destroy(),this.pendingChild=null}getTypeName(){return wE0}}yl.ChildLoadBalancerHandler=kl});var ul=H0((xl)=>{Object.defineProperty(xl,"__esModule",{value:!0});xl.ResolvingLoadBalancer=void 0;var SE0=V5(),fE0=iz(),b8=k8(),hl=S9(),jQ=E4(),kE0=yY(),rz=a1(),yE0=K8(),vE0=M6(),hE0=a1(),jE0=f8(),_E0=z3(),xE0="resolving_load_balancer";function jl(Y){vE0.trace(hE0.LogVerbosity.DEBUG,xE0,Y)}var bE0=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function uE0(Y,Z,W,H){for(let F of W.name)switch(H){case"EMPTY":if(!F.service&&!F.method)return!0;break;case"SERVICE":if(F.service===Y&&!F.method)return!0;break;case"SERVICE_AND_METHOD":if(F.service===Y&&F.method===Z)return!0}return!1}function mE0(Y,Z,W,H){for(let F of W)if(uE0(Y,Z,F,H))return F;return null}function gE0(Y){return{invoke(Z,W){var H,F;let X=Z.split("/").filter((G)=>G.length>0),J=(H=X[0])!==null&&H!==void 0?H:"",Q=(F=X[1])!==null&&F!==void 0?F:"";if(Y&&Y.methodConfig)for(let G of bE0){let q=mE0(J,Q,Y.methodConfig,G);if(q)return{methodConfig:q,pickInformation:{},status:rz.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:rz.Status.OK,dynamicFilterFactories:[]}},unref(){}}}class _l{constructor(Y,Z,W,H,F){if(this.target=Y,this.channelControlHelper=Z,this.channelOptions=W,this.onSuccessfulResolution=H,this.onFailedResolution=F,this.latestChildState=b8.ConnectivityState.IDLE,this.latestChildPicker=new jQ.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=b8.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,W["grpc.service_config"])this.defaultServiceConfig=(0,fE0.validateServiceConfig)(JSON.parse(W["grpc.service_config"]));else this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]};this.updateState(b8.ConnectivityState.IDLE,new jQ.QueuePicker(this),null),this.childLoadBalancer=new _E0.ChildLoadBalancerHandler({createSubchannel:Z.createSubchannel.bind(Z),requestReresolution:()=>{if(this.backoffTimeout.isRunning())jl("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0;else this.updateResolution()},updateState:(J,Q,G)=>{this.latestChildState=J,this.latestChildPicker=Q,this.latestChildErrorMessage=G,this.updateState(J,Q,G)},addChannelzChild:Z.addChannelzChild.bind(Z),removeChannelzChild:Z.removeChannelzChild.bind(Z)}),this.innerResolver=(0,hl.createResolver)(Y,this.handleResolverResult.bind(this),W);let X={initialDelay:W["grpc.initial_reconnect_backoff_ms"],maxDelay:W["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new kE0.BackoffTimeout(()=>{if(this.continueResolving)this.updateResolution(),this.continueResolving=!1;else this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},X),this.backoffTimeout.unref()}handleResolverResult(Y,Z,W,H){var F,X;this.backoffTimeout.stop(),this.backoffTimeout.reset();let J=!0,Q=null;if(W===null)Q=this.defaultServiceConfig;else if(W.ok)Q=W.value;else if(this.previousServiceConfig!==null)Q=this.previousServiceConfig;else J=!1,this.handleResolutionFailure(W.error);if(Q!==null){let G=(F=Q===null||Q===void 0?void 0:Q.loadBalancingConfig)!==null&&F!==void 0?F:[],q=(0,SE0.selectLbConfigFromList)(G,!0);if(q===null)J=!1,this.handleResolutionFailure({code:rz.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new yE0.Metadata});else J=this.childLoadBalancer.updateAddressList(Y,q,Object.assign(Object.assign({},this.channelOptions),Z),H)}if(J)this.onSuccessfulResolution(Q,(X=Z[hl.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&X!==void 0?X:gE0(Q));return J}updateResolution(){if(this.innerResolver.updateResolution(),this.currentState===b8.ConnectivityState.IDLE)this.updateState(b8.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage);this.backoffTimeout.runOnce()}updateState(Y,Z,W){if(jl((0,jE0.uriToString)(this.target)+" "+b8.ConnectivityState[this.currentState]+" -> "+b8.ConnectivityState[Y]),Y===b8.ConnectivityState.IDLE)Z=new jQ.QueuePicker(this,Z);this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}handleResolutionFailure(Y){if(this.latestChildState===b8.ConnectivityState.IDLE)this.updateState(b8.ConnectivityState.TRANSIENT_FAILURE,new jQ.UnavailablePicker(Y),Y.details),this.onFailedResolution(Y)}exitIdle(){if(this.currentState===b8.ConnectivityState.IDLE||this.currentState===b8.ConnectivityState.TRANSIENT_FAILURE)if(this.backoffTimeout.isRunning())this.continueResolving=!0;else this.updateResolution();this.childLoadBalancer.exitIdle()}updateAddressList(Y,Z){throw 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=b8.ConnectivityState.IDLE,this.latestChildPicker=new jQ.QueuePicker(this),this.currentState=b8.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}}xl.ResolvingLoadBalancer=_l});var dl=H0((ml)=>{Object.defineProperty(ml,"__esModule",{value:!0});ml.recognizedOptions=void 0;ml.channelOptionsEqual=dE0;ml.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 dE0(Y,Z){let W=Object.keys(Y).sort(),H=Object.keys(Z).sort();if(W.length!==H.length)return!1;for(let F=0;F<W.length;F+=1){if(W[F]!==H[F])return!1;if(Y[W[F]]!==Z[H[F]])return!1}return!0}});var u8=H0((il)=>{Object.defineProperty(il,"__esModule",{value:!0});il.EndpointMap=void 0;il.isTcpSubchannelAddress=xQ;il.subchannelAddressEqual=B3;il.subchannelAddressToString=ll;il.stringToSubchannelAddress=nE0;il.endpointEqual=pE0;il.endpointToString=iE0;il.endpointHasAddress=nl;var cl=V1("net");function xQ(Y){return"port"in Y}function B3(Y,Z){if(!Y&&!Z)return!0;if(!Y||!Z)return!1;if(xQ(Y))return xQ(Z)&&Y.host===Z.host&&Y.port===Z.port;else return!xQ(Z)&&Y.path===Z.path}function ll(Y){if(xQ(Y))if((0,cl.isIPv6)(Y.host))return"["+Y.host+"]:"+Y.port;else return Y.host+":"+Y.port;else return Y.path}var lE0=443;function nE0(Y,Z){if((0,cl.isIP)(Y))return{host:Y,port:Z!==null&&Z!==void 0?Z:lE0};else return{path:Y}}function pE0(Y,Z){if(Y.addresses.length!==Z.addresses.length)return!1;for(let W=0;W<Y.addresses.length;W++)if(!B3(Y.addresses[W],Z.addresses[W]))return!1;return!0}function iE0(Y){return"["+Y.addresses.map(ll).join(", ")+"]"}function nl(Y,Z){for(let W of Y.addresses)if(B3(W,Z))return!0;return!1}function _Q(Y,Z){if(Y.addresses.length!==Z.addresses.length)return!1;for(let W of Y.addresses){let H=!1;for(let F of Z.addresses)if(B3(W,F)){H=!0;break}if(!H)return!1}return!0}class pl{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(Y){for(let Z of this.map)if(nl(Z.key,Y))return Z.value;return}deleteMissing(Y){let Z=[];for(let W of this.map){let H=!1;for(let F of Y)if(_Q(F,W.key))H=!0;if(!H)Z.push(W.value),this.map.delete(W)}return Z}get(Y){for(let Z of this.map)if(_Q(Y,Z.key))return Z.value;return}set(Y,Z){for(let W of this.map)if(_Q(Y,W.key)){W.value=Z;return}this.map.add({key:Y,value:Z})}delete(Y){for(let Z of this.map)if(_Q(Y,Z.key)){this.map.delete(Z);return}}has(Y){for(let Z of this.map)if(_Q(Y,Z.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let Y of this.map)yield Y.key}*values(){for(let Y of this.map)yield Y.value}*entries(){for(let Y of this.map)yield[Y.key,Y.value]}}il.EndpointMap=pl});var Xn=H0((Qn)=>{Object.defineProperty(Qn,"t",{value:!0});class az{constructor(Y,Z,W=1){this.i=void 0,this.h=void 0,this.o=void 0,this.u=Y,this.l=Z,this.p=W}I(){let Y=this,Z=Y.o.o===Y;if(Z&&Y.p===1)Y=Y.h;else if(Y.i){Y=Y.i;while(Y.h)Y=Y.h}else{if(Z)return Y.o;let W=Y.o;while(W.i===Y)Y=W,W=Y.o;Y=W}return Y}B(){let Y=this;if(Y.h){Y=Y.h;while(Y.i)Y=Y.i;return Y}else{let Z=Y.o;while(Z.h===Y)Y=Z,Z=Y.o;if(Y.h!==Z)return Z;else return Y}}_(){let Y=this.o,Z=this.h,W=Z.i;if(Y.o===this)Y.o=Z;else if(Y.i===this)Y.i=Z;else Y.h=Z;if(Z.o=Y,Z.i=this,this.o=Z,this.h=W,W)W.o=this;return Z}g(){let Y=this.o,Z=this.i,W=Z.h;if(Y.o===this)Y.o=Z;else if(Y.i===this)Y.i=Z;else Y.h=Z;if(Z.o=Y,Z.h=this,this.o=Z,this.i=W,W)W.o=this;return Z}}class al extends az{constructor(){super(...arguments);this.M=1}_(){let Y=super._();return this.O(),Y.O(),Y}g(){let Y=super.g();return this.O(),Y.O(),Y}O(){if(this.M=1,this.i)this.M+=this.i.M;if(this.h)this.M+=this.h.M}}class ol{constructor(Y=0){this.iteratorType=Y}equals(Y){return this.T===Y.T}}class tl{constructor(){this.m=0}get length(){return this.m}size(){return this.m}empty(){return this.m===0}}class sl extends tl{}function A7(){throw RangeError("Iterator access denied!")}class el extends sl{constructor(Y=function(W,H){if(W<H)return-1;if(W>H)return 1;return 0},Z=!1){super();this.v=void 0,this.A=Y,this.enableIndex=Z,this.N=Z?al:az,this.C=new this.N}R(Y,Z){let W=this.C;while(Y){let H=this.A(Y.u,Z);if(H<0)Y=Y.h;else if(H>0)W=Y,Y=Y.i;else return Y}return W}K(Y,Z){let W=this.C;while(Y)if(this.A(Y.u,Z)<=0)Y=Y.h;else W=Y,Y=Y.i;return W}L(Y,Z){let W=this.C;while(Y){let H=this.A(Y.u,Z);if(H<0)W=Y,Y=Y.h;else if(H>0)Y=Y.i;else return Y}return W}k(Y,Z){let W=this.C;while(Y)if(this.A(Y.u,Z)<0)W=Y,Y=Y.h;else Y=Y.i;return W}P(Y){while(!0){let Z=Y.o;if(Z===this.C)return;if(Y.p===1){Y.p=0;return}if(Y===Z.i){let W=Z.h;if(W.p===1)if(W.p=0,Z.p=1,Z===this.v)this.v=Z._();else Z._();else if(W.h&&W.h.p===1){if(W.p=Z.p,Z.p=0,W.h.p=0,Z===this.v)this.v=Z._();else Z._();return}else if(W.i&&W.i.p===1)W.p=1,W.i.p=0,W.g();else W.p=1,Y=Z}else{let W=Z.i;if(W.p===1)if(W.p=0,Z.p=1,Z===this.v)this.v=Z.g();else Z.g();else if(W.i&&W.i.p===1){if(W.p=Z.p,Z.p=0,W.i.p=0,Z===this.v)this.v=Z.g();else Z.g();return}else if(W.h&&W.h.p===1)W.p=1,W.h.p=0,W._();else W.p=1,Y=Z}}}S(Y){if(this.m===1){this.clear();return}let Z=Y;while(Z.i||Z.h){if(Z.h){Z=Z.h;while(Z.i)Z=Z.i}else Z=Z.i;let H=Y.u;Y.u=Z.u,Z.u=H;let F=Y.l;Y.l=Z.l,Z.l=F,Y=Z}if(this.C.i===Z)this.C.i=Z.o;else if(this.C.h===Z)this.C.h=Z.o;this.P(Z);let W=Z.o;if(Z===W.i)W.i=void 0;else W.h=void 0;if(this.m-=1,this.v.p=0,this.enableIndex)while(W!==this.C)W.M-=1,W=W.o}U(Y){let Z=typeof Y==="number"?Y:void 0,W=typeof Y==="function"?Y:void 0,H=typeof Y>"u"?[]:void 0,F=0,X=this.v,J=[];while(J.length||X)if(X)J.push(X),X=X.i;else{if(X=J.pop(),F===Z)return X;H&&H.push(X),W&&W(X,F,this),F+=1,X=X.h}return H}j(Y){while(!0){let Z=Y.o;if(Z.p===0)return;let W=Z.o;if(Z===W.i){let H=W.h;if(H&&H.p===1){if(H.p=Z.p=0,W===this.v)return;W.p=1,Y=W;continue}else if(Y===Z.h){if(Y.p=0,Y.i)Y.i.o=Z;if(Y.h)Y.h.o=W;if(Z.h=Y.i,W.i=Y.h,Y.i=Z,Y.h=W,W===this.v)this.v=Y,this.C.o=Y;else{let F=W.o;if(F.i===W)F.i=Y;else F.h=Y}Y.o=W.o,Z.o=Y,W.o=Y,W.p=1}else{if(Z.p=0,W===this.v)this.v=W.g();else W.g();W.p=1;return}}else{let H=W.i;if(H&&H.p===1){if(H.p=Z.p=0,W===this.v)return;W.p=1,Y=W;continue}else if(Y===Z.i){if(Y.p=0,Y.i)Y.i.o=W;if(Y.h)Y.h.o=Z;if(W.h=Y.i,Z.i=Y.h,Y.i=W,Y.h=Z,W===this.v)this.v=Y,this.C.o=Y;else{let F=W.o;if(F.i===W)F.i=Y;else F.h=Y}Y.o=W.o,Z.o=Y,W.o=Y,W.p=1}else{if(Z.p=0,W===this.v)this.v=W._();else W._();W.p=1;return}}if(this.enableIndex)Z.O(),W.O(),Y.O();return}}q(Y,Z,W){if(this.v===void 0)return this.m+=1,this.v=new this.N(Y,Z,0),this.v.o=this.C,this.C.o=this.C.i=this.C.h=this.v,this.m;let H,F=this.C.i,X=this.A(F.u,Y);if(X===0)return F.l=Z,this.m;else if(X>0)F.i=new this.N(Y,Z),F.i.o=F,H=F.i,this.C.i=H;else{let J=this.C.h,Q=this.A(J.u,Y);if(Q===0)return J.l=Z,this.m;else if(Q<0)J.h=new this.N(Y,Z),J.h.o=J,H=J.h,this.C.h=H;else{if(W!==void 0){let G=W.T;if(G!==this.C){let q=this.A(G.u,Y);if(q===0)return G.l=Z,this.m;else if(q>0){let K=G.I(),V=this.A(K.u,Y);if(V===0)return K.l=Z,this.m;else if(V<0)if(H=new this.N(Y,Z),K.h===void 0)K.h=H,H.o=K;else G.i=H,H.o=G}}}if(H===void 0){H=this.v;while(!0){let G=this.A(H.u,Y);if(G>0){if(H.i===void 0){H.i=new this.N(Y,Z),H.i.o=H,H=H.i;break}H=H.i}else if(G<0){if(H.h===void 0){H.h=new this.N(Y,Z),H.h.o=H,H=H.h;break}H=H.h}else return H.l=Z,this.m}}}}if(this.enableIndex){let J=H.o;while(J!==this.C)J.M+=1,J=J.o}return this.j(H),this.m+=1,this.m}H(Y,Z){while(Y){let W=this.A(Y.u,Z);if(W<0)Y=Y.h;else if(W>0)Y=Y.i;else return Y}return Y||this.C}clear(){this.m=0,this.v=void 0,this.C.o=void 0,this.C.i=this.C.h=void 0}updateKeyByIterator(Y,Z){let W=Y.T;if(W===this.C)A7();if(this.m===1)return W.u=Z,!0;let H=W.B().u;if(W===this.C.i){if(this.A(H,Z)>0)return W.u=Z,!0;return!1}let F=W.I().u;if(W===this.C.h){if(this.A(F,Z)<0)return W.u=Z,!0;return!1}if(this.A(F,Z)>=0||this.A(H,Z)<=0)return!1;return W.u=Z,!0}eraseElementByPos(Y){if(Y<0||Y>this.m-1)throw RangeError();let Z=this.U(Y);return this.S(Z),this.m}eraseElementByKey(Y){if(this.m===0)return!1;let Z=this.H(this.v,Y);if(Z===this.C)return!1;return this.S(Z),!0}eraseElementByIterator(Y){let Z=Y.T;if(Z===this.C)A7();let W=Z.h===void 0;if(Y.iteratorType===0){if(W)Y.next()}else if(!W||Z.i===void 0)Y.next();return this.S(Z),Y}getHeight(){if(this.m===0)return 0;function Y(Z){if(!Z)return 0;return Math.max(Y(Z.i),Y(Z.h))+1}return Y(this.v)}}class Yn extends ol{constructor(Y,Z,W){super(W);if(this.T=Y,this.C=Z,this.iteratorType===0)this.pre=function(){if(this.T===this.C.i)A7();return this.T=this.T.I(),this},this.next=function(){if(this.T===this.C)A7();return this.T=this.T.B(),this};else this.pre=function(){if(this.T===this.C.h)A7();return this.T=this.T.B(),this},this.next=function(){if(this.T===this.C)A7();return this.T=this.T.I(),this}}get index(){let Y=this.T,Z=this.C.o;if(Y===this.C){if(Z)return Z.M-1;return 0}let W=0;if(Y.i)W+=Y.i.M;while(Y!==Z){let H=Y.o;if(Y===H.h){if(W+=1,H.i)W+=H.i.M}Y=H}return W}isAccessible(){return this.T!==this.C}}class f9 extends Yn{constructor(Y,Z,W,H){super(Y,Z,H);this.container=W}get pointer(){if(this.T===this.C)A7();let Y=this;return new Proxy([],{get(Z,W){if(W==="0")return Y.T.u;else if(W==="1")return Y.T.l;return Z[0]=Y.T.u,Z[1]=Y.T.l,Z[W]},set(Z,W,H){if(W!=="1")throw TypeError("prop must be 1");return Y.T.l=H,!0}})}copy(){return new f9(this.T,this.C,this.container,this.iteratorType)}}class Zn extends el{constructor(Y=[],Z,W){super(Z,W);let H=this;Y.forEach(function(F){H.setElement(F[0],F[1])})}begin(){return new f9(this.C.i||this.C,this.C,this)}end(){return new f9(this.C,this.C,this)}rBegin(){return new f9(this.C.h||this.C,this.C,this,1)}rEnd(){return new f9(this.C,this.C,this,1)}front(){if(this.m===0)return;let Y=this.C.i;return[Y.u,Y.l]}back(){if(this.m===0)return;let Y=this.C.h;return[Y.u,Y.l]}lowerBound(Y){let Z=this.R(this.v,Y);return new f9(Z,this.C,this)}upperBound(Y){let Z=this.K(this.v,Y);return new f9(Z,this.C,this)}reverseLowerBound(Y){let Z=this.L(this.v,Y);return new f9(Z,this.C,this)}reverseUpperBound(Y){let Z=this.k(this.v,Y);return new f9(Z,this.C,this)}forEach(Y){this.U(function(Z,W,H){Y([Z.u,Z.l],W,H)})}setElement(Y,Z,W){return this.q(Y,Z,W)}getElementByPos(Y){if(Y<0||Y>this.m-1)throw RangeError();let Z=this.U(Y);return[Z.u,Z.l]}find(Y){let Z=this.H(this.v,Y);return new f9(Z,this.C,this)}getElementByKey(Y){return this.H(this.v,Y).l}union(Y){let Z=this;return Y.forEach(function(W){Z.setElement(W[0],W[1])}),this.m}*[Symbol.iterator](){let Y=this.m,Z=this.U();for(let W=0;W<Y;++W){let H=Z[W];yield[H.u,H.l]}}}Qn.OrderedMap=Zn});var A3=H0((Wn)=>{Object.defineProperty(Wn,"__esModule",{value:!0});Wn.registerAdminService=QM0;Wn.addAdminServicesToServer=XM0;var Jn=[];function QM0(Y,Z){Jn.push({getServiceDefinition:Y,getHandlers:Z})}function XM0(Y){for(let{getServiceDefinition:Z,getHandlers:W}of Jn)Y.addService(Z(),W())}});var zn=H0((Vn)=>{Object.defineProperty(Vn,"__esModule",{value:!0});Vn.ClientDuplexStreamImpl=Vn.ClientWritableStreamImpl=Vn.ClientReadableStreamImpl=Vn.ClientUnaryCallImpl=void 0;Vn.callErrorFromStatus=GM0;var KM0=V1("events"),oz=V1("stream"),bQ=a1();function GM0(Y,Z){let W=`${Y.code} ${bQ.Status[Y.code]}: ${Y.details}`,F=`${Error(W).stack}
15
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return T.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return T.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return T.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw Error("Unsupported platform: "+process.platform)}}function q(T){var C=G((0,I.execSync)(O[A]).toString());return T?C:Q(C)}function K(T){return new B.default(function(C,R){return(0,I.exec)(O[A],{},function(w,L,k){if(w)return R(Error("Error while obtaining machine id: "+w.stack));var v=G(L.toString());return C(T?v:Q(v))})})}Object.defineProperty(H,"__esModule",{value:!0});var V=F(35),B=X(V);H.machineIdSync=q,H.machineId=K;var I=F(70),M=F(71),E=process,A=E.platform,N={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},O={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:N[J()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(W,H,F){W.exports={default:F(36),__esModule:!0}},function(W,H,F){F(66),F(68),F(69),F(67),W.exports=F(6).Promise},function(W,H){W.exports=function(){}},function(W,H){W.exports=function(F,X,J,Q){if(!(F instanceof X)||Q!==void 0&&Q in F)throw TypeError(J+": incorrect invocation!");return F}},function(W,H,F){var X=F(13),J=F(31),Q=F(62);W.exports=function(G){return function(q,K,V){var B,I=X(q),M=J(I.length),E=Q(V,M);if(G&&K!=K){for(;M>E;)if(B=I[E++],B!=B)return!0}else for(;M>E;E++)if((G||(E in I))&&I[E]===K)return G||E||0;return!G&&-1}}},function(W,I,F){var X=F(7),J=F(44),Q=F(43),G=F(3),q=F(31),K=F(64),V={},B={},I=W.exports=function(M,E,A,N,O){var T,C,R,w,L=O?function(){return M}:K(M),k=X(A,N,E?2:1),v=0;if(typeof L!="function")throw TypeError(M+" is not iterable!");if(Q(L)){for(T=q(M.length);T>v;v++)if(w=E?k(G(C=M[v])[0],C[1]):k(M[v]),w===V||w===B)return w}else for(R=L.call(M);!(C=R.next()).done;)if(w=J(R,k,C.value,E),w===V||w===B)return w};I.BREAK=V,I.RETURN=B},function(W,H){W.exports=function(F,X,J){var Q=J===void 0;switch(X.length){case 0:return Q?F():F.call(J);case 1:return Q?F(X[0]):F.call(J,X[0]);case 2:return Q?F(X[0],X[1]):F.call(J,X[0],X[1]);case 3:return Q?F(X[0],X[1],X[2]):F.call(J,X[0],X[1],X[2]);case 4:return Q?F(X[0],X[1],X[2],X[3]):F.call(J,X[0],X[1],X[2],X[3])}return F.apply(J,X)}},function(W,H,F){var X=F(11);W.exports=Object("z").propertyIsEnumerable(0)?Object:function(J){return X(J)=="String"?J.split(""):Object(J)}},function(W,H,F){var X=F(10),J=F(1)("iterator"),Q=Array.prototype;W.exports=function(G){return G!==void 0&&(X.Array===G||Q[J]===G)}},function(W,H,F){var X=F(3);W.exports=function(J,Q,G,q){try{return q?Q(X(G)[0],G[1]):Q(G)}catch(V){var K=J.return;throw K!==void 0&&X(K.call(J)),V}}},function(W,H,F){var X=F(49),J=F(17),Q=F(18),G={};F(5)(G,F(1)("iterator"),function(){return this}),W.exports=function(q,K,V){q.prototype=X(G,{next:J(1,V)}),Q(q,K+" Iterator")}},function(W,H,F){var X=F(1)("iterator"),J=!1;try{var Q=[7][X]();Q.return=function(){J=!0},Array.from(Q,function(){throw 2})}catch(G){}W.exports=function(G,q){if(!q&&!J)return!1;var K=!1;try{var V=[7],B=V[X]();B.next=function(){return{done:K=!0}},V[X]=function(){return B},G(V)}catch(I){}return K}},function(W,H){W.exports=function(F,X){return{value:X,done:!!F}}},function(W,H,F){var X=F(2),J=F(30).set,Q=X.MutationObserver||X.WebKitMutationObserver,G=X.process,q=X.Promise,K=F(11)(G)=="process";W.exports=function(){var V,B,I,M=function(){var O,T;for(K&&(O=G.domain)&&O.exit();V;){T=V.fn,V=V.next;try{T()}catch(C){throw V?I():B=void 0,C}}B=void 0,O&&O.enter()};if(K)I=function(){G.nextTick(M)};else if(Q){var E=!0,A=document.createTextNode("");new Q(M).observe(A,{characterData:!0}),I=function(){A.data=E=!E}}else if(q&&q.resolve){var N=q.resolve();I=function(){N.then(M)}}else I=function(){J.call(X,M)};return function(O){var T={fn:O,next:void 0};B&&(B.next=T),V||(V=T,I()),B=T}}},function(W,H,F){var X=F(3),J=F(50),Q=F(22),G=F(19)("IE_PROTO"),q=function(){},K="prototype",V=function(){var B,I=F(16)("iframe"),M=Q.length,E=">";for(I.style.display="none",F(25).appendChild(I),I.src="javascript:",B=I.contentWindow.document,B.open(),B.write("<script>document.F=Object</script"+E),B.close(),V=B.F;M--;)delete V[K][Q[M]];return V()};W.exports=Object.create||function(B,I){var M;return B!==null?(q[K]=X(B),M=new q,q[K]=null,M[G]=B):M=V(),I===void 0?M:J(M,I)}},function(W,H,F){var X=F(12),J=F(3),Q=F(54);W.exports=F(4)?Object.defineProperties:function(G,q){J(G);for(var K,V=Q(q),B=V.length,I=0;B>I;)X.f(G,K=V[I++],q[K]);return G}},function(W,H,F){var X=F(55),J=F(17),Q=F(13),G=F(32),q=F(8),K=F(26),V=Object.getOwnPropertyDescriptor;H.f=F(4)?V:function(B,I){if(B=Q(B),I=G(I,!0),K)try{return V(B,I)}catch(M){}if(q(B,I))return J(!X.f.call(B,I),B[I])}},function(W,H,F){var X=F(8),J=F(63),Q=F(19)("IE_PROTO"),G=Object.prototype;W.exports=Object.getPrototypeOf||function(q){return q=J(q),X(q,Q)?q[Q]:typeof q.constructor=="function"&&q instanceof q.constructor?q.constructor.prototype:q instanceof Object?G:null}},function(W,H,F){var X=F(8),J=F(13),Q=F(39)(!1),G=F(19)("IE_PROTO");W.exports=function(q,K){var V,B=J(q),I=0,M=[];for(V in B)V!=G&&X(B,V)&&M.push(V);for(;K.length>I;)X(B,V=K[I++])&&(~Q(M,V)||M.push(V));return M}},function(W,H,F){var X=F(53),J=F(22);W.exports=Object.keys||function(Q){return X(Q,J)}},function(W,H){H.f={}.propertyIsEnumerable},function(W,H,F){var X=F(5);W.exports=function(J,Q,G){for(var q in Q)G&&J[q]?J[q]=Q[q]:X(J,q,Q[q]);return J}},function(W,H,F){W.exports=F(5)},function(W,H,F){var X=F(9),J=F(3),Q=function(G,q){if(J(G),!X(q)&&q!==null)throw TypeError(q+": can't set as prototype!")};W.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(G,q,K){try{K=F(7)(Function.call,F(51).f(Object.prototype,"__proto__").set,2),K(G,[]),q=!(G instanceof Array)}catch(V){q=!0}return function(V,B){return Q(V,B),q?V.__proto__=B:K(V,B),V}}({},!1):void 0),check:Q}},function(W,H,F){var X=F(2),J=F(6),Q=F(12),G=F(4),q=F(1)("species");W.exports=function(K){var V=typeof J[K]=="function"?J[K]:X[K];G&&V&&!V[q]&&Q.f(V,q,{configurable:!0,get:function(){return this}})}},function(W,H,F){var X=F(3),J=F(14),Q=F(1)("species");W.exports=function(G,q){var K,V=X(G).constructor;return V===void 0||(K=X(V)[Q])==null?q:J(K)}},function(W,H,F){var X=F(20),J=F(15);W.exports=function(Q){return function(G,q){var K,V,B=String(J(G)),I=X(q),M=B.length;return I<0||I>=M?Q?"":void 0:(K=B.charCodeAt(I),K<55296||K>56319||I+1===M||(V=B.charCodeAt(I+1))<56320||V>57343?Q?B.charAt(I):K:Q?B.slice(I,I+2):(K-55296<<10)+(V-56320)+65536)}}},function(W,H,F){var X=F(20),J=Math.max,Q=Math.min;W.exports=function(G,q){return G=X(G),G<0?J(G+q,0):Q(G,q)}},function(W,H,F){var X=F(15);W.exports=function(J){return Object(X(J))}},function(W,H,F){var X=F(21),J=F(1)("iterator"),Q=F(10);W.exports=F(6).getIteratorMethod=function(G){if(G!=null)return G[J]||G["@@iterator"]||Q[X(G)]}},function(W,H,F){var X=F(37),J=F(47),Q=F(10),G=F(13);W.exports=F(27)(Array,"Array",function(q,K){this._t=G(q),this._i=0,this._k=K},function(){var q=this._t,K=this._k,V=this._i++;return!q||V>=q.length?(this._t=void 0,J(1)):K=="keys"?J(0,V):K=="values"?J(0,q[V]):J(0,[V,q[V]])},"values"),Q.Arguments=Q.Array,X("keys"),X("values"),X("entries")},function(W,H){},function(W,H,F){var X,J,Q,G=F(28),q=F(2),K=F(7),V=F(21),B=F(23),I=F(9),M=(F(3),F(14)),E=F(38),A=F(40),N=(F(58).set,F(60)),O=F(30).set,T=F(48)(),C="Promise",R=q.TypeError,L=q.process,w=q[C],L=q.process,k=V(L)=="process",v=function(){},f=!!function(){try{var l=w.resolve(1),s=(l.constructor={})[F(1)("species")]=function(g){g(v,v)};return(k||typeof PromiseRejectionEvent=="function")&&l.then(v)instanceof s}catch(g){}}(),h=function(l,s){return l===s||l===w&&s===Q},b=function(l){var s;return!(!I(l)||typeof(s=l.then)!="function")&&s},x=function(l){return h(w,l)?new y(l):new J(l)},y=J=function(l){var s,g;this.promise=new l(function(u,a){if(s!==void 0||g!==void 0)throw R("Bad Promise constructor");s=u,g=a}),this.resolve=M(s),this.reject=M(g)},n=function(l){try{l()}catch(s){return{error:s}}},Z0=function(l,s){if(!l._n){l._n=!0;var g=l._c;T(function(){for(var u=l._v,a=l._s==1,t=0,J0=function(z0){var N0,P0,D0=a?z0.ok:z0.fail,A0=z0.resolve,Y0=z0.reject,G0=z0.domain;try{D0?(a||(l._h==2&&c(l),l._h=1),D0===!0?N0=u:(G0&&G0.enter(),N0=D0(u),G0&&G0.exit()),N0===z0.promise?Y0(R("Promise-chain cycle")):(P0=b(N0))?P0.call(N0,A0,Y0):A0(N0)):Y0(u)}catch(U0){Y0(U0)}};g.length>t;)J0(g[t++]);l._c=[],l._n=!1,s&&!l._h&&m(l)})}},m=function(l){O.call(q,function(){var s,g,u,a=l._v;if(j(l)&&(s=n(function(){k?L.emit("unhandledRejection",a,l):(g=q.onunhandledrejection)?g({promise:l,reason:a}):(u=q.console)&&u.error&&u.error("Unhandled promise rejection",a)}),l._h=k||j(l)?2:1),l._a=void 0,s)throw s.error})},j=function(l){if(l._h==1)return!1;for(var s,g=l._a||l._c,u=0;g.length>u;)if(s=g[u++],s.fail||!j(s.promise))return!1;return!0},c=function(l){O.call(q,function(){var s;k?L.emit("rejectionHandled",l):(s=q.onrejectionhandled)&&s({promise:l,reason:l._v})})},p=function(l){var s=this;s._d||(s._d=!0,s=s._w||s,s._v=l,s._s=2,s._a||(s._a=s._c.slice()),Z0(s,!0))},Q0=function(l){var s,g=this;if(!g._d){g._d=!0,g=g._w||g;try{if(g===l)throw R("Promise can't be resolved itself");(s=b(l))?T(function(){var u={_w:g,_d:!1};try{s.call(l,K(Q0,u,1),K(p,u,1))}catch(a){p.call(u,a)}}):(g._v=l,g._s=1,Z0(g,!1))}catch(u){p.call({_w:g,_d:!1},u)}}};f||(w=function(l){E(this,w,C,"_h"),M(l),X.call(this);try{l(K(Q0,this,1),K(p,this,1))}catch(s){p.call(this,s)}},X=function(l){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},X.prototype=F(56)(w.prototype,{then:function(l,s){var g=x(N(this,w));return g.ok=typeof l!="function"||l,g.fail=typeof s=="function"&&s,g.domain=k?L.domain:void 0,this._c.push(g),this._a&&this._a.push(g),this._s&&Z0(this,!1),g.promise},catch:function(l){return this.then(void 0,l)}}),y=function(){var l=new X;this.promise=l,this.resolve=K(Q0,l,1),this.reject=K(p,l,1)}),B(B.G+B.W+B.F*!f,{Promise:w}),F(18)(w,C),F(59)(C),Q=F(6)[C],B(B.S+B.F*!f,C,{reject:function(l){var s=x(this),g=s.reject;return g(l),s.promise}}),B(B.S+B.F*(G||!f),C,{resolve:function(l){if(l instanceof w&&h(l.constructor,this))return l;var s=x(this),g=s.resolve;return g(l),s.promise}}),B(B.S+B.F*!(f&&F(46)(function(l){w.all(l).catch(v)})),C,{all:function(l){var s=this,g=x(s),u=g.resolve,a=g.reject,t=n(function(){var J0=[],z0=0,N0=1;A(l,!1,function(P0){var D0=z0++,A0=!1;J0.push(void 0),N0++,s.resolve(P0).then(function(Y0){A0||(A0=!0,J0[D0]=Y0,--N0||u(J0))},a)}),--N0||u(J0)});return t&&a(t.error),g.promise},race:function(l){var s=this,g=x(s),u=g.reject,a=n(function(){A(l,!1,function(t){s.resolve(t).then(g.resolve,u)})});return a&&u(a.error),g.promise}})},function(W,H,F){var X=F(61)(!0);F(27)(String,"String",function(J){this._t=String(J),this._i=0},function(){var J,Q=this._t,G=this._i;return G>=Q.length?{value:void 0,done:!0}:(J=X(Q,G),this._i+=J.length,{value:J,done:!1})})},function(W,H,F){F(65);for(var X=F(2),J=F(5),Q=F(10),G=F(1)("toStringTag"),q=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],K=0;K<5;K++){var V=q[K],B=X[V],I=B&&B.prototype;I&&!I[G]&&J(I,G,V),Q[V]=Q.Array}},function(W,H){W.exports=V1("child_process")},function(W,H){W.exports=V1("crypto")}])})});import{existsSync as YI0,mkdirSync as ZI0,readFileSync as QI0,writeFileSync as XI0}from"node:fs";import{resolve as JI0}from"node:path";import{nanoid as WI0}from"nanoid";function G7(Y){let Z=Y?.trim();if(Z)return Z;let W=GI0();if(W)return W;return FI0()}function GI0(){try{return Od.machineIdSync().trim()||void 0}catch{return}}function FI0(){let Y=H9(),Z=JI0(Y,KI0);try{if(YI0(Z)){let H=QI0(Z,"utf8").trim();if(H.length>0)return H}}catch{}let W=`cl-${WI0()}`;try{ZI0(Y,{recursive:!0}),XI0(Z,W,"utf8")}catch{}return W}var Od,KI0="machine-id";var fW=n7(()=>{x6();Od=y6(Nd(),1)});class kW{name;logger;enabled;constructor(Y={}){this.name=Y.name??"TelemetryLoggerSink",this.logger=Y.logger,this.enabled=Y.enabled??!0}emit(Y,Z){if(!this.isEnabled())return;this.logger?.log("telemetry.event",{telemetrySink:this.name,event:Y,properties:Z})}emitRequired(Y,Z){this.logger?.log("telemetry.required_event",{telemetrySink:this.name,severity:"warn",event:Y,properties:Z})}recordCounter(Y,Z,W,H,F){if(!F&&!this.isEnabled())return;this.logger?.debug("telemetry.metric",{telemetrySink:this.name,instrument:"counter",name:Y,value:Z,attributes:W,description:H,required:F===!0})}recordHistogram(Y,Z,W,H,F){if(!F&&!this.isEnabled())return;this.logger?.debug("telemetry.metric",{telemetrySink:this.name,instrument:"histogram",name:Y,value:Z,attributes:W,description:H,required:F===!0})}recordGauge(Y,Z,W,H,F){if(!F&&!this.isEnabled())return;this.logger?.debug("telemetry.metric",{telemetrySink:this.name,instrument:"gauge",name:Y,value:Z,attributes:W,description:H,required:F===!0})}isEnabled(){return typeof this.enabled==="function"?this.enabled():this.enabled}async flush(){}async dispose(){}}class RQ{adapters;metadata;distinctId;commonProperties;constructor(Y={}){if(this.adapters=[...Y.adapters??[]],Y.logger)this.adapters.push(new kW({logger:Y.logger}));this.metadata={...Y.metadata??{}},this.distinctId=Y.distinctId,this.commonProperties={...Y.commonProperties??{}}}addAdapter(Y){this.adapters.push(Y)}setDistinctId(Y){this.distinctId=Y}setMetadata(Y){this.metadata={...Y}}updateMetadata(Y){this.metadata={...this.metadata,...Y}}setCommonProperties(Y){this.commonProperties={...Y}}updateCommonProperties(Y){this.commonProperties={...this.commonProperties,...Y}}isEnabled(){return this.adapters.some((Y)=>Y.isEnabled())}capture(Y){let Z=this.buildAttributes(Y.properties);for(let W of this.adapters)W.emit(Y.event,Z)}captureRequired(Y,Z){let W=this.buildAttributes(Z);for(let H of this.adapters)H.emitRequired(Y,W)}recordCounter(Y,Z,W,H,F=!1){let X=this.buildAttributes(W);for(let J of this.adapters)J.recordCounter(Y,Z,X,H,F)}recordHistogram(Y,Z,W,H,F=!1){let X=this.buildAttributes(W);for(let J of this.adapters)J.recordHistogram(Y,Z,X,H,F)}recordGauge(Y,Z,W,H,F=!1){let X=this.buildAttributes(W);for(let J of this.adapters)J.recordGauge(Y,Z,X,H,F)}async flush(){await Promise.all(this.adapters.map((Y)=>Y.flush()))}async dispose(){await Promise.all(this.adapters.map((Y)=>Y.dispose()))}buildAttributes(Y){return{...this.commonProperties,...Y,...this.metadata,...this.distinctId?{distinct_id:this.distinctId}:{}}}}var Aq=()=>{};class PQ{meterProvider;loggerProvider;tracerProvider;options;constructor(Y={}){this.options=Y;let Z=Cd.resourceFromAttributes({[vW.ATTR_SERVICE_NAME]:Y.serviceName??"cline",...Y.serviceVersion?{[vW.ATTR_SERVICE_VERSION]:Y.serviceVersion}:{}});if(this.meterProvider=this.createMeterProvider(Z),this.loggerProvider=this.createLoggerProvider(Z),this.tracerProvider=this.createTracerProvider(Z),this.meterProvider)yW.metrics.setGlobalMeterProvider(this.meterProvider);if(this.loggerProvider)Dd.logs.setGlobalLoggerProvider(this.loggerProvider);if(this.tracerProvider)this.tracerProvider.register()}getTracer(Y="cline",Z){return yW.trace.getTracer(Y,Z??this.options.serviceVersion)}createAdapter(Y){return new fZ({...Y,meterProvider:this.meterProvider,loggerProvider:this.loggerProvider})}createTelemetryService(Y){let Z=this.createAdapter({name:Y.name,enabled:this.options.enabled,metadata:Y.metadata});return new RQ({...Y,adapters:[Z],distinctId:G7(Y.distinctId)})}async forceFlush(){await Promise.all([this.meterProvider?.forceFlush?.(),this.loggerProvider?.forceFlush?.(),this.tracerProvider?.forceFlush?.()])}async dispose(){await Promise.all([this.meterProvider?.shutdown?.(),this.loggerProvider?.shutdown?.(),this.tracerProvider?.shutdown?.()])}createMeterProvider(Y){let Z=Uq(this.options.metricsExporter);if(Z.length===0)return null;let W=Math.max(1000,this.options.metricExportIntervalMs??this.options.metricExportInterval??60000),H=Math.min(30000,Math.floor(W*0.8)),F=Z.map((X)=>qI0(X,{endpoint:this.options.otlpEndpoint,headers:this.options.otlpHeaders,insecure:this.options.otlpInsecure??!1,protocol:"http/json",interval:W,timeout:H})).filter((X)=>X!==null);if(F.length===0)return null;return new F7.MeterProvider({resource:Y,readers:F})}createTracerProvider(Y){let Z=Uq(this.options.tracesExporter);if(Z.length===0)return null;let W=this.options.otlpTracesEndpoint??this.options.otlpEndpoint,H=this.options.otlpTracesHeaders??this.options.otlpHeaders,F=[];for(let X of Z){let J=VI0(X,{endpoint:W,headers:H,insecure:this.options.otlpInsecure??!1,protocol:"http/json"});if(J)F.push(J)}if(F.length===0)return null;return new Ed.NodeTracerProvider({resource:Y,spanProcessors:F})}createLoggerProvider(Y){let Z=Uq(this.options.logsExporter);if(Z.length===0)return null;let W=Z.map((H)=>{let F=HI0(H,{endpoint:this.options.otlpEndpoint,headers:this.options.otlpHeaders,insecure:this.options.otlpInsecure??!1,protocol:"http/json"});if(!F)return null;return new TY.BatchLogRecordProcessor(F,{maxQueueSize:this.options.logMaxQueueSize??2048,maxExportBatchSize:this.options.logBatchSize??512,scheduledDelayMillis:this.options.logBatchTimeoutMs??this.options.logBatchTimeout??5000})}).filter((H)=>H!==null);if(W.length===0)return null;return new TY.LoggerProvider({resource:Y,processors:W})}}function hW(Y){let Z=new PQ(Y),W=Z.createTelemetryService(Y);return W.captureRequired("telemetry.provider_created",{provider:"opentelemetry",enabled:Y.enabled??!0,logsExporter:Array.isArray(Y.logsExporter)?Y.logsExporter.join(","):Y.logsExporter,metricsExporter:Array.isArray(Y.metricsExporter)?Y.metricsExporter.join(","):Y.metricsExporter,tracesExporter:Array.isArray(Y.tracesExporter)?Y.tracesExporter.join(","):Y.tracesExporter,otlpProtocol:Y.otlpProtocol,hasOtlpEndpoint:Boolean(Y.otlpEndpoint),serviceName:Y.serviceName,serviceVersion:Y.serviceVersion}),{provider:Z,telemetry:W}}function Nq(Y){if(Y.enabled!==!0)return{telemetry:new RQ({...Y,distinctId:G7(Y.distinctId)})};return hW(Y)}function Uq(Y){if(!Y)return[];return(Array.isArray(Y)?Y:Y.split(",")).map((W)=>W.trim()).filter((W)=>W==="console"||W==="otlp")}function HI0(Y,Z){if(Y==="console")return new TY.ConsoleLogRecordExporter;if(!Z.endpoint)return null;let W=Oq(Z.endpoint,"/v1/logs");return new Td.OTLPLogExporter({url:W,headers:Z.headers})}function VI0(Y,Z){if(Y==="console")return new IY.SimpleSpanProcessor(new IY.ConsoleSpanExporter);if(!Z.endpoint)return null;let W=Oq(Z.endpoint,"/v1/traces");return new IY.BatchSpanProcessor(new $d.OTLPTraceExporter({url:W,headers:Z.headers}))}function qI0(Y,Z){if(Y==="console")return new F7.PeriodicExportingMetricReader({exporter:new F7.ConsoleMetricExporter,exportIntervalMillis:Z.interval,exportTimeoutMillis:Z.timeout});if(!Z.endpoint)return null;let W=Oq(Z.endpoint,"/v1/metrics");return new F7.PeriodicExportingMetricReader({exporter:new Id.OTLPMetricExporter({url:W,headers:Z.headers}),exportIntervalMillis:Z.interval,exportTimeoutMillis:Z.timeout})}function Oq(Y,Z){let W=new URL(Y),H=W.pathname.endsWith("/")?W.pathname.slice(0,-1):W.pathname;return W.pathname=H.endsWith(Z)?H:`${H}${Z}`,W.toString()}var yW,Dd,Td,Id,$d,Cd,TY,F7,IY,Ed,vW;var Dq=n7(()=>{fW();Aq();yW=y6(f1(),1),Dd=y6(o7(),1),Td=y6(Lb(),1),Id=y6(mb(),1),$d=y6(rb(),1),Cd=y6(WQ(),1),TY=y6(Xm(),1),F7=y6(QW(),1),IY=y6(EW(),1),Ed=y6(Qd(),1),vW=y6(m5(),1)});var Md={};p60(Md,{createOpenTelemetryTelemetryService:()=>hW,createConfiguredTelemetryService:()=>Nq,OpenTelemetryProvider:()=>PQ,OpenTelemetryAdapter:()=>fZ});var Rd=n7(()=>{Dq()});var a1=H0((ic)=>{Object.defineProperty(ic,"__esModule",{value:!0});ic.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=ic.DEFAULT_MAX_SEND_MESSAGE_LENGTH=ic.Propagate=ic.LogVerbosity=ic.Status=void 0;var lc;(function(Y){Y[Y.OK=0]="OK",Y[Y.CANCELLED=1]="CANCELLED",Y[Y.UNKNOWN=2]="UNKNOWN",Y[Y.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Y[Y.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Y[Y.NOT_FOUND=5]="NOT_FOUND",Y[Y.ALREADY_EXISTS=6]="ALREADY_EXISTS",Y[Y.PERMISSION_DENIED=7]="PERMISSION_DENIED",Y[Y.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Y[Y.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Y[Y.ABORTED=10]="ABORTED",Y[Y.OUT_OF_RANGE=11]="OUT_OF_RANGE",Y[Y.UNIMPLEMENTED=12]="UNIMPLEMENTED",Y[Y.INTERNAL=13]="INTERNAL",Y[Y.UNAVAILABLE=14]="UNAVAILABLE",Y[Y.DATA_LOSS=15]="DATA_LOSS",Y[Y.UNAUTHENTICATED=16]="UNAUTHENTICATED"})(lc||(ic.Status=lc={}));var nc;(function(Y){Y[Y.DEBUG=0]="DEBUG",Y[Y.INFO=1]="INFO",Y[Y.ERROR=2]="ERROR",Y[Y.NONE=3]="NONE"})(nc||(ic.LogVerbosity=nc={}));var pc;(function(Y){Y[Y.DEADLINE=1]="DEADLINE",Y[Y.CENSUS_STATS_CONTEXT=2]="CENSUS_STATS_CONTEXT",Y[Y.CENSUS_TRACING_CONTEXT=4]="CENSUS_TRACING_CONTEXT",Y[Y.CANCELLATION=8]="CANCELLATION",Y[Y.DEFAULTS=65535]="DEFAULTS"})(pc||(ic.Propagate=pc={}));ic.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1;ic.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4194304});var fz=H0((Yt0,h$0)=>{h$0.exports={name:"@grpc/grpc-js",version:"1.14.3",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 M6=H0((tc)=>{var kz,yz,vz,hz;Object.defineProperty(tc,"__esModule",{value:!0});tc.log=tc.setLoggerVerbosity=tc.setLogger=tc.getLogger=void 0;tc.trace=n$0;tc.isTracerEnabled=oc;var F5=a1(),j$0=V1("process"),_$0=fz().version,x$0={error:(Y,...Z)=>{console.error("E "+Y,...Z)},info:(Y,...Z)=>{console.error("I "+Y,...Z)},debug:(Y,...Z)=>{console.error("D "+Y,...Z)}},B7=x$0,LY=F5.LogVerbosity.ERROR,b$0=(yz=(kz=process.env.GRPC_NODE_VERBOSITY)!==null&&kz!==void 0?kz:process.env.GRPC_VERBOSITY)!==null&&yz!==void 0?yz:"";switch(b$0.toUpperCase()){case"DEBUG":LY=F5.LogVerbosity.DEBUG;break;case"INFO":LY=F5.LogVerbosity.INFO;break;case"ERROR":LY=F5.LogVerbosity.ERROR;break;case"NONE":LY=F5.LogVerbosity.NONE;break;default:}var u$0=()=>{return B7};tc.getLogger=u$0;var m$0=(Y)=>{B7=Y};tc.setLogger=m$0;var g$0=(Y)=>{LY=Y};tc.setLoggerVerbosity=g$0;var d$0=(Y,...Z)=>{let W;if(Y>=LY){switch(Y){case F5.LogVerbosity.DEBUG:W=B7.debug;break;case F5.LogVerbosity.INFO:W=B7.info;break;case F5.LogVerbosity.ERROR:W=B7.error;break}if(!W)W=B7.error;if(W)W.bind(B7)(...Z)}};tc.log=d$0;var c$0=(hz=(vz=process.env.GRPC_NODE_TRACE)!==null&&vz!==void 0?vz:process.env.GRPC_TRACE)!==null&&hz!==void 0?hz:"",jz=new Set,ac=new Set;for(let Y of c$0.split(","))if(Y.startsWith("-"))ac.add(Y.substring(1));else jz.add(Y);var l$0=jz.has("all");function n$0(Y,Z,W){if(oc(Z))tc.log(Y,new Date().toISOString()+" | v"+_$0+" "+j$0.pid+" | "+Z+" | "+W)}function oc(Y){return!ac.has(Y)&&(l$0||jz.has(Y))}});var Y3=H0((sc)=>{Object.defineProperty(sc,"__esModule",{value:!0});sc.getErrorMessage=t$0;sc.getErrorCode=s$0;function t$0(Y){if(Y instanceof Error)return Y.message;else return String(Y)}function s$0(Y){if(typeof Y==="object"&&Y!==null&&"code"in Y&&typeof Y.code==="number")return Y.code;else return null}});var K8=H0((Zl)=>{Object.defineProperty(Zl,"__esModule",{value:!0});Zl.Metadata=void 0;var ZC0=M6(),QC0=a1(),XC0=Y3(),JC0=/^[:0-9a-z_.-]+$/,WC0=/^[ -~]*$/;function KC0(Y){return JC0.test(Y)}function GC0(Y){return WC0.test(Y)}function Yl(Y){return Y.endsWith("-bin")}function FC0(Y){return!Y.startsWith("grpc-")}function Z3(Y){return Y.toLowerCase()}function ec(Y,Z){if(!KC0(Y))throw Error('Metadata key "'+Y+'" contains illegal characters');if(Z!==null&&Z!==void 0)if(Yl(Y)){if(!Buffer.isBuffer(Z))throw Error("keys that end with '-bin' must have Buffer values")}else{if(Buffer.isBuffer(Z))throw Error("keys that don't end with '-bin' must have String values");if(!GC0(Z))throw Error('Metadata string value "'+Z+'" contains illegal characters')}}class Q3{constructor(Y={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=Y}set(Y,Z){Y=Z3(Y),ec(Y,Z),this.internalRepr.set(Y,[Z])}add(Y,Z){Y=Z3(Y),ec(Y,Z);let W=this.internalRepr.get(Y);if(W===void 0)this.internalRepr.set(Y,[Z]);else W.push(Z)}remove(Y){Y=Z3(Y),this.internalRepr.delete(Y)}get(Y){return Y=Z3(Y),this.internalRepr.get(Y)||[]}getMap(){let Y={};for(let[Z,W]of this.internalRepr)if(W.length>0){let H=W[0];Y[Z]=Buffer.isBuffer(H)?Buffer.from(H):H}return Y}clone(){let Y=new Q3(this.options),Z=Y.internalRepr;for(let[W,H]of this.internalRepr){let F=H.map((X)=>{if(Buffer.isBuffer(X))return Buffer.from(X);else return X});Z.set(W,F)}return Y}merge(Y){for(let[Z,W]of Y.internalRepr){let H=(this.internalRepr.get(Z)||[]).concat(W);this.internalRepr.set(Z,H)}}setOptions(Y){this.options=Y}getOptions(){return this.options}toHttp2Headers(){let Y={};for(let[Z,W]of this.internalRepr){if(Z.startsWith(":"))continue;Y[Z]=W.map(HC0)}return Y}toJSON(){let Y={};for(let[Z,W]of this.internalRepr)Y[Z]=W;return Y}setOpaque(Y,Z){this.opaqueData.set(Y,Z)}getOpaque(Y){return this.opaqueData.get(Y)}static fromHttp2Headers(Y){let Z=new Q3;for(let W of Object.keys(Y)){if(W.charAt(0)===":")continue;let H=Y[W];try{if(Yl(W)){if(Array.isArray(H))H.forEach((F)=>{Z.add(W,Buffer.from(F,"base64"))});else if(H!==void 0)if(FC0(W))H.split(",").forEach((F)=>{Z.add(W,Buffer.from(F.trim(),"base64"))});else Z.add(W,Buffer.from(H,"base64"))}else if(Array.isArray(H))H.forEach((F)=>{Z.add(W,F)});else if(H!==void 0)Z.add(W,H)}catch(F){let X=`Failed to add metadata entry ${W}: ${H}. ${(0,XC0.getErrorMessage)(F)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,ZC0.log)(QC0.LogVerbosity.ERROR,X)}}return Z}}Zl.Metadata=Q3;var HC0=(Y)=>{return Buffer.isBuffer(Y)?Y.toString("base64"):Y}});var J3=H0((Xl)=>{Object.defineProperty(Xl,"__esModule",{value:!0});Xl.CallCredentials=void 0;var xz=K8();function VC0(Y){return"getRequestHeaders"in Y&&typeof Y.getRequestHeaders==="function"}class wY{static createFromMetadataGenerator(Y){return new bz(Y)}static createFromGoogleCredential(Y){return wY.createFromMetadataGenerator((Z,W)=>{let H;if(VC0(Y))H=Y.getRequestHeaders(Z.service_url);else H=new Promise((F,X)=>{Y.getRequestMetadata(Z.service_url,(J,Q)=>{if(J){X(J);return}if(!Q){X(Error("Headers not set by metadata plugin"));return}F(Q)})});H.then((F)=>{let X=new xz.Metadata;for(let J of Object.keys(F))X.add(J,F[J]);W(null,X)},(F)=>{W(F)})})}static createEmpty(){return new uz}}Xl.CallCredentials=wY;class X3 extends wY{constructor(Y){super();this.creds=Y}async generateMetadata(Y){let Z=new xz.Metadata,W=await Promise.all(this.creds.map((H)=>H.generateMetadata(Y)));for(let H of W)Z.merge(H);return Z}compose(Y){return new X3(this.creds.concat([Y]))}_equals(Y){if(this===Y)return!0;if(Y instanceof X3)return this.creds.every((Z,W)=>Z._equals(Y.creds[W]));else return!1}}class bz extends wY{constructor(Y){super();this.metadataGenerator=Y}generateMetadata(Y){return new Promise((Z,W)=>{this.metadataGenerator(Y,(H,F)=>{if(F!==void 0)Z(F);else W(H)})})}compose(Y){return new X3([this,Y])}_equals(Y){if(this===Y)return!0;if(Y instanceof bz)return this.metadataGenerator===Y.metadataGenerator;else return!1}}class uz extends wY{generateMetadata(Y){return Promise.resolve(new xz.Metadata)}compose(Y){return Y}_equals(Y){return Y instanceof uz}}});var gz=H0((Kl)=>{Object.defineProperty(Kl,"__esModule",{value:!0});Kl.CIPHER_SUITES=void 0;Kl.getDefaultRootsData=zC0;var qC0=V1("fs");Kl.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;var Wl=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,mz=null;function zC0(){if(Wl){if(mz===null)mz=qC0.readFileSync(Wl);return mz}return null}});var f8=H0((Hl)=>{Object.defineProperty(Hl,"__esModule",{value:!0});Hl.parseUri=UC0;Hl.splitHostPort=NC0;Hl.combineHostPort=OC0;Hl.uriToString=DC0;var AC0=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function UC0(Y){let Z=AC0.exec(Y);if(Z===null)return null;return{scheme:Z[1],authority:Z[2],path:Z[3]}}var Fl=/^\d+$/;function NC0(Y){if(Y.startsWith("[")){let Z=Y.indexOf("]");if(Z===-1)return null;let W=Y.substring(1,Z);if(W.indexOf(":")===-1)return null;if(Y.length>Z+1)if(Y[Z+1]===":"){let H=Y.substring(Z+2);if(Fl.test(H))return{host:W,port:+H};else return null}else return null;else return{host:W}}else{let Z=Y.split(":");if(Z.length===2)if(Fl.test(Z[1]))return{host:Z[0],port:+Z[1]};else return null;else return{host:Y}}}function OC0(Y){if(Y.port===void 0)return Y.host;else if(Y.host.includes(":"))return`[${Y.host}]:${Y.port}`;else return`${Y.host}:${Y.port}`}function DC0(Y){let Z="";if(Y.scheme!==void 0)Z+=Y.scheme+":";if(Y.authority!==void 0)Z+="//"+Y.authority+"/";return Z+=Y.path,Z}});var S9=H0((Vl)=>{Object.defineProperty(Vl,"__esModule",{value:!0});Vl.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0;Vl.registerResolver=EC0;Vl.registerDefaultScheme=MC0;Vl.createResolver=RC0;Vl.getDefaultAuthority=PC0;Vl.mapUriDefaultScheme=LC0;var cz=f8();Vl.CHANNEL_ARGS_CONFIG_SELECTOR_KEY="grpc.internal.config_selector";var SY={},dz=null;function EC0(Y,Z){SY[Y]=Z}function MC0(Y){dz=Y}function RC0(Y,Z,W){if(Y.scheme!==void 0&&Y.scheme in SY)return new SY[Y.scheme](Y,Z,W);else throw Error(`No resolver could be created for target ${(0,cz.uriToString)(Y)}`)}function PC0(Y){if(Y.scheme!==void 0&&Y.scheme in SY)return SY[Y.scheme].getDefaultAuthority(Y);else throw Error(`Invalid target ${(0,cz.uriToString)(Y)}`)}function LC0(Y){if(Y.scheme===void 0||!(Y.scheme in SY))if(dz!==null)return{scheme:dz,authority:void 0,path:(0,cz.uriToString)(Y)};else return null;return Y}});var kY=H0((Ul)=>{Object.defineProperty(Ul,"__esModule",{value:!0});Ul.ChannelCredentials=void 0;Ul.createCertificateProviderChannelCredentials=_C0;var vQ=V1("tls"),G3=J3(),nz=gz(),zl=f8(),vC0=S9(),hC0=M6(),jC0=a1();function lz(Y,Z){if(Y&&!(Y instanceof Buffer))throw TypeError(`${Z}, if provided, must be a Buffer.`)}class fY{compose(Y){return new K3(this,Y)}static createSsl(Y,Z,W,H){var F;if(lz(Y,"Root certificate"),lz(Z,"Private key"),lz(W,"Certificate chain"),Z&&!W)throw Error("Private key must be given with accompanying certificate chain");if(!Z&&W)throw Error("Certificate chain must be given with accompanying private key");let X=(0,vQ.createSecureContext)({ca:(F=Y!==null&&Y!==void 0?Y:(0,nz.getDefaultRootsData)())!==null&&F!==void 0?F:void 0,key:Z!==null&&Z!==void 0?Z:void 0,cert:W!==null&&W!==void 0?W:void 0,ciphers:nz.CIPHER_SUITES});return new W3(X,H!==null&&H!==void 0?H:{})}static createFromSecureContext(Y,Z){return new W3(Y,Z!==null&&Z!==void 0?Z:{})}static createInsecure(){return new pz}}Ul.ChannelCredentials=fY;class pz extends fY{constructor(){super()}compose(Y){throw Error("Cannot compose insecure credentials")}_isSecure(){return!1}_equals(Y){return Y instanceof pz}_createSecureConnector(Y,Z,W){return{connect(H){return Promise.resolve({socket:H,secure:!1})},waitForReady:()=>{return Promise.resolve()},getCallCredentials:()=>{return W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty()},destroy(){}}}}function Bl(Y,Z,W,H){var F,X;let J={secureContext:Y},Q=W;if("grpc.http_connect_target"in H){let V=(0,zl.parseUri)(H["grpc.http_connect_target"]);if(V)Q=V}let G=(0,vC0.getDefaultAuthority)(Q),q=(0,zl.splitHostPort)(G),K=(F=q===null||q===void 0?void 0:q.host)!==null&&F!==void 0?F:G;if(J.host=K,Z.checkServerIdentity)J.checkServerIdentity=Z.checkServerIdentity;if(Z.rejectUnauthorized!==void 0)J.rejectUnauthorized=Z.rejectUnauthorized;if(J.ALPNProtocols=["h2"],H["grpc.ssl_target_name_override"]){let V=H["grpc.ssl_target_name_override"],B=(X=J.checkServerIdentity)!==null&&X!==void 0?X:vQ.checkServerIdentity;J.checkServerIdentity=(I,M)=>{return B(V,M)},J.servername=V}else J.servername=K;if(H["grpc-node.tls_enable_trace"])J.enableTrace=!0;return J}class Al{constructor(Y,Z){this.connectionOptions=Y,this.callCredentials=Z}connect(Y){let Z=Object.assign({socket:Y},this.connectionOptions);return new Promise((W,H)=>{let F=(0,vQ.connect)(Z,()=>{var X;if(((X=this.connectionOptions.rejectUnauthorized)!==null&&X!==void 0?X:!0)&&!F.authorized){H(F.authorizationError);return}W({socket:F,secure:!0})});F.on("error",(X)=>{H(X)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}}class W3 extends fY{constructor(Y,Z){super();this.secureContext=Y,this.verifyOptions=Z}_isSecure(){return!0}_equals(Y){if(this===Y)return!0;if(Y instanceof W3)return this.secureContext===Y.secureContext&&this.verifyOptions.checkServerIdentity===Y.verifyOptions.checkServerIdentity;else return!1}_createSecureConnector(Y,Z,W){let H=Bl(this.secureContext,this.verifyOptions,Y,Z);return new Al(H,W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty())}}class yQ extends fY{constructor(Y,Z,W){super();this.caCertificateProvider=Y,this.identityCertificateProvider=Z,this.verifyOptions=W,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(Y){var Z,W;if(this===Y)return!0;if(Y instanceof yQ)return this.caCertificateProvider===Y.caCertificateProvider&&this.identityCertificateProvider===Y.identityCertificateProvider&&((Z=this.verifyOptions)===null||Z===void 0?void 0:Z.checkServerIdentity)===((W=Y.verifyOptions)===null||W===void 0?void 0:W.checkServerIdentity);else return!1}ref(){var Y;if(this.refcount===0)this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(Y=this.identityCertificateProvider)===null||Y===void 0||Y.addIdentityCertificateListener(this.identityCertificateUpdateListener);this.refcount+=1}unref(){var Y;if(this.refcount-=1,this.refcount===0)this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(Y=this.identityCertificateProvider)===null||Y===void 0||Y.removeIdentityCertificateListener(this.identityCertificateUpdateListener)}_createSecureConnector(Y,Z,W){return this.ref(),new yQ.SecureConnectorImpl(this,Y,Z,W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let Y of this.secureContextWatchers)Y(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(Y){this.latestCaUpdate=Y,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(Y){this.latestIdentityUpdate=Y,this.maybeUpdateWatchers()}hasReceivedUpdates(){if(this.latestCaUpdate===void 0)return!1;if(this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)return!1;return!0}getSecureContext(){if(this.hasReceivedUpdates())return Promise.resolve(this.getLatestSecureContext());else return new Promise((Y)=>{this.secureContextWatchers.push(Y)})}getLatestSecureContext(){var Y,Z;if(!this.latestCaUpdate)return null;if(this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,vQ.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:(Y=this.latestIdentityUpdate)===null||Y===void 0?void 0:Y.privateKey,cert:(Z=this.latestIdentityUpdate)===null||Z===void 0?void 0:Z.certificate,ciphers:nz.CIPHER_SUITES})}catch(W){return(0,hC0.log)(jC0.LogVerbosity.ERROR,"Failed to createSecureContext with error "+W.message),null}}}yQ.SecureConnectorImpl=class{constructor(Y,Z,W,H){this.parent=Y,this.channelTarget=Z,this.options=W,this.callCredentials=H}connect(Y){return new Promise((Z,W)=>{let H=this.parent.getLatestSecureContext();if(!H){W(Error("Failed to load credentials"));return}if(Y.closed)W(Error("Socket closed while loading credentials"));let F=Bl(H,this.parent.verifyOptions,this.channelTarget,this.options),X=Object.assign({socket:Y},F),J=()=>{W(Error("Socket closed"))},Q=(q)=>{W(q)},G=(0,vQ.connect)(X,()=>{var q;if(G.removeListener("close",J),G.removeListener("error",Q),((q=this.parent.verifyOptions.rejectUnauthorized)!==null&&q!==void 0?q:!0)&&!G.authorized){W(G.authorizationError);return}Z({socket:G,secure:!0})});G.once("close",J),G.once("error",Q)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function _C0(Y,Z,W){return new yQ(Y,Z,W!==null&&W!==void 0?W:{})}class K3 extends fY{constructor(Y,Z){super();if(this.channelCredentials=Y,this.callCredentials=Z,!Y._isSecure())throw Error("Cannot compose insecure credentials")}compose(Y){let Z=this.callCredentials.compose(Y);return new K3(this.channelCredentials,Z)}_isSecure(){return!0}_equals(Y){if(this===Y)return!0;if(Y instanceof K3)return this.channelCredentials._equals(Y.channelCredentials)&&this.callCredentials._equals(Y.callCredentials);else return!1}_createSecureConnector(Y,Z,W){let H=this.callCredentials.compose(W!==null&&W!==void 0?W:G3.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(Y,Z,H)}}});var V5=H0((Dl)=>{Object.defineProperty(Dl,"__esModule",{value:!0});Dl.createChildChannelControlHelper=mC0;Dl.registerLoadBalancerType=gC0;Dl.registerDefaultLoadBalancerType=dC0;Dl.createLoadBalancer=cC0;Dl.isLoadBalancerNameRegistered=lC0;Dl.parseLoadBalancingConfig=Ol;Dl.getDefaultConfig=nC0;Dl.selectLbConfigFromList=pC0;var bC0=M6(),uC0=a1();function mC0(Y,Z){var W,H,F,X,J,Q,G,q,K,V;return{createSubchannel:(H=(W=Z.createSubchannel)===null||W===void 0?void 0:W.bind(Z))!==null&&H!==void 0?H:Y.createSubchannel.bind(Y),updateState:(X=(F=Z.updateState)===null||F===void 0?void 0:F.bind(Z))!==null&&X!==void 0?X:Y.updateState.bind(Y),requestReresolution:(Q=(J=Z.requestReresolution)===null||J===void 0?void 0:J.bind(Z))!==null&&Q!==void 0?Q:Y.requestReresolution.bind(Y),addChannelzChild:(q=(G=Z.addChannelzChild)===null||G===void 0?void 0:G.bind(Z))!==null&&q!==void 0?q:Y.addChannelzChild.bind(Y),removeChannelzChild:(V=(K=Z.removeChannelzChild)===null||K===void 0?void 0:K.bind(Z))!==null&&V!==void 0?V:Y.removeChannelzChild.bind(Y)}}var H5={},hQ=null;function gC0(Y,Z,W){H5[Y]={LoadBalancer:Z,LoadBalancingConfig:W}}function dC0(Y){hQ=Y}function cC0(Y,Z){let W=Y.getLoadBalancerName();if(W in H5)return new H5[W].LoadBalancer(Z);else return null}function lC0(Y){return Y in H5}function Ol(Y){let Z=Object.keys(Y);if(Z.length!==1)throw Error("Provided load balancing config has multiple conflicting entries");let W=Z[0];if(W in H5)try{return H5[W].LoadBalancingConfig.createFromJson(Y[W])}catch(H){throw Error(`${W}: ${H.message}`)}else throw Error(`Unrecognized load balancing config name ${W}`)}function nC0(){if(!hQ)throw Error("No default load balancer type registered");return new H5[hQ].LoadBalancingConfig}function pC0(Y,Z=!1){for(let W of Y)try{return Ol(W)}catch(H){(0,bC0.log)(uC0.LogVerbosity.DEBUG,"Config parsing failed with error",H.message);continue}if(Z)if(hQ)return new H5[hQ].LoadBalancingConfig;else return null;else return null}});var iz=H0(($l)=>{Object.defineProperty($l,"__esModule",{value:!0});$l.validateRetryThrottling=Tl;$l.validateServiceConfig=Il;$l.extractAndSelectServiceConfig=VE0;var ZE0=V1("os"),F3=a1(),H3=/^\d+(\.\d{1,9})?s$/,QE0="node";function XE0(Y){if("service"in Y&&Y.service!==""){if(typeof Y.service!=="string")throw Error(`Invalid method config name: invalid service: expected type string, got ${typeof Y.service}`);if("method"in Y&&Y.method!==""){if(typeof Y.method!=="string")throw Error(`Invalid method config name: invalid method: expected type string, got ${typeof Y.service}`);return{service:Y.service,method:Y.method}}else return{service:Y.service}}else{if("method"in Y&&Y.method!==void 0)throw Error("Invalid method config name: method set with empty or unset service");return{}}}function JE0(Y){if(!("maxAttempts"in Y)||!Number.isInteger(Y.maxAttempts)||Y.maxAttempts<2)throw Error("Invalid method config retry policy: maxAttempts must be an integer at least 2");if(!("initialBackoff"in Y)||typeof Y.initialBackoff!=="string"||!H3.test(Y.initialBackoff))throw Error("Invalid method config retry policy: initialBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("maxBackoff"in Y)||typeof Y.maxBackoff!=="string"||!H3.test(Y.maxBackoff))throw Error("Invalid method config retry policy: maxBackoff must be a string consisting of a positive integer or decimal followed by s");if(!("backoffMultiplier"in Y)||typeof Y.backoffMultiplier!=="number"||Y.backoffMultiplier<=0)throw Error("Invalid method config retry policy: backoffMultiplier must be a number greater than 0");if(!(("retryableStatusCodes"in Y)&&Array.isArray(Y.retryableStatusCodes)))throw Error("Invalid method config retry policy: retryableStatusCodes is required");if(Y.retryableStatusCodes.length===0)throw Error("Invalid method config retry policy: retryableStatusCodes must be non-empty");for(let Z of Y.retryableStatusCodes)if(typeof Z==="number"){if(!Object.values(F3.Status).includes(Z))throw Error("Invalid method config retry policy: retryableStatusCodes value not in status code range")}else if(typeof Z==="string"){if(!Object.values(F3.Status).includes(Z.toUpperCase()))throw Error("Invalid method config retry policy: retryableStatusCodes value not a status code name")}else throw Error("Invalid method config retry policy: retryableStatusCodes value must be a string or number");return{maxAttempts:Y.maxAttempts,initialBackoff:Y.initialBackoff,maxBackoff:Y.maxBackoff,backoffMultiplier:Y.backoffMultiplier,retryableStatusCodes:Y.retryableStatusCodes}}function WE0(Y){if(!("maxAttempts"in Y)||!Number.isInteger(Y.maxAttempts)||Y.maxAttempts<2)throw Error("Invalid method config hedging policy: maxAttempts must be an integer at least 2");if("hedgingDelay"in Y&&(typeof Y.hedgingDelay!=="string"||!H3.test(Y.hedgingDelay)))throw Error("Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s");if("nonFatalStatusCodes"in Y&&Array.isArray(Y.nonFatalStatusCodes))for(let W of Y.nonFatalStatusCodes)if(typeof W==="number"){if(!Object.values(F3.Status).includes(W))throw Error("Invalid method config hedging policy: nonFatalStatusCodes value not in status code range")}else if(typeof W==="string"){if(!Object.values(F3.Status).includes(W.toUpperCase()))throw Error("Invalid method config hedging policy: nonFatalStatusCodes value not a status code name")}else throw Error("Invalid method config hedging policy: nonFatalStatusCodes value must be a string or number");let Z={maxAttempts:Y.maxAttempts};if(Y.hedgingDelay)Z.hedgingDelay=Y.hedgingDelay;if(Y.nonFatalStatusCodes)Z.nonFatalStatusCodes=Y.nonFatalStatusCodes;return Z}function KE0(Y){var Z;let W={name:[]};if(!("name"in Y)||!Array.isArray(Y.name))throw Error("Invalid method config: invalid name array");for(let H of Y.name)W.name.push(XE0(H));if("waitForReady"in Y){if(typeof Y.waitForReady!=="boolean")throw Error("Invalid method config: invalid waitForReady");W.waitForReady=Y.waitForReady}if("timeout"in Y)if(typeof Y.timeout==="object"){if(!("seconds"in Y.timeout)||typeof Y.timeout.seconds!=="number")throw Error("Invalid method config: invalid timeout.seconds");if(!("nanos"in Y.timeout)||typeof Y.timeout.nanos!=="number")throw Error("Invalid method config: invalid timeout.nanos");W.timeout=Y.timeout}else if(typeof Y.timeout==="string"&&H3.test(Y.timeout)){let H=Y.timeout.substring(0,Y.timeout.length-1).split(".");W.timeout={seconds:H[0]|0,nanos:((Z=H[1])!==null&&Z!==void 0?Z:0)|0}}else throw Error("Invalid method config: invalid timeout");if("maxRequestBytes"in Y){if(typeof Y.maxRequestBytes!=="number")throw Error("Invalid method config: invalid maxRequestBytes");W.maxRequestBytes=Y.maxRequestBytes}if("maxResponseBytes"in Y){if(typeof Y.maxResponseBytes!=="number")throw Error("Invalid method config: invalid maxRequestBytes");W.maxResponseBytes=Y.maxResponseBytes}if("retryPolicy"in Y)if("hedgingPolicy"in Y)throw Error("Invalid method config: retryPolicy and hedgingPolicy cannot both be specified");else W.retryPolicy=JE0(Y.retryPolicy);else if("hedgingPolicy"in Y)W.hedgingPolicy=WE0(Y.hedgingPolicy);return W}function Tl(Y){if(!("maxTokens"in Y)||typeof Y.maxTokens!=="number"||Y.maxTokens<=0||Y.maxTokens>1000)throw Error("Invalid retryThrottling: maxTokens must be a number in (0, 1000]");if(!("tokenRatio"in Y)||typeof Y.tokenRatio!=="number"||Y.tokenRatio<=0)throw Error("Invalid retryThrottling: tokenRatio must be a number greater than 0");return{maxTokens:+Y.maxTokens.toFixed(3),tokenRatio:+Y.tokenRatio.toFixed(3)}}function GE0(Y){if(!(typeof Y==="object"&&Y!==null))throw Error(`Invalid loadBalancingConfig: unexpected type ${typeof Y}`);let Z=Object.keys(Y);if(Z.length>1)throw Error(`Invalid loadBalancingConfig: unexpected multiple keys ${Z}`);if(Z.length===0)throw Error("Invalid loadBalancingConfig: load balancing policy name required");return{[Z[0]]:Y[Z[0]]}}function Il(Y){let Z={loadBalancingConfig:[],methodConfig:[]};if("loadBalancingPolicy"in Y)if(typeof Y.loadBalancingPolicy==="string")Z.loadBalancingPolicy=Y.loadBalancingPolicy;else throw Error("Invalid service config: invalid loadBalancingPolicy");if("loadBalancingConfig"in Y)if(Array.isArray(Y.loadBalancingConfig))for(let H of Y.loadBalancingConfig)Z.loadBalancingConfig.push(GE0(H));else throw Error("Invalid service config: invalid loadBalancingConfig");if("methodConfig"in Y){if(Array.isArray(Y.methodConfig))for(let H of Y.methodConfig)Z.methodConfig.push(KE0(H))}if("retryThrottling"in Y)Z.retryThrottling=Tl(Y.retryThrottling);let W=[];for(let H of Z.methodConfig)for(let F of H.name){for(let X of W)if(F.service===X.service&&F.method===X.method)throw Error(`Invalid service config: duplicate name ${F.service}/${F.method}`);W.push(F)}return Z}function FE0(Y){if(!("serviceConfig"in Y))throw Error("Invalid service config choice: missing service config");let Z={serviceConfig:Il(Y.serviceConfig)};if("clientLanguage"in Y)if(Array.isArray(Y.clientLanguage)){Z.clientLanguage=[];for(let H of Y.clientLanguage)if(typeof H==="string")Z.clientLanguage.push(H);else throw Error("Invalid service config choice: invalid clientLanguage")}else throw Error("Invalid service config choice: invalid clientLanguage");if("clientHostname"in Y)if(Array.isArray(Y.clientHostname)){Z.clientHostname=[];for(let H of Y.clientHostname)if(typeof H==="string")Z.clientHostname.push(H);else throw Error("Invalid service config choice: invalid clientHostname")}else throw Error("Invalid service config choice: invalid clientHostname");if("percentage"in Y)if(typeof Y.percentage==="number"&&0<=Y.percentage&&Y.percentage<=100)Z.percentage=Y.percentage;else throw Error("Invalid service config choice: invalid percentage");let W=["clientLanguage","percentage","clientHostname","serviceConfig"];for(let H in Y)if(!W.includes(H))throw Error(`Invalid service config choice: unexpected field ${H}`);return Z}function HE0(Y,Z){if(!Array.isArray(Y))throw Error("Invalid service config list");for(let W of Y){let H=FE0(W);if(typeof H.percentage==="number"&&Z>H.percentage)continue;if(Array.isArray(H.clientHostname)){let F=!1;for(let X of H.clientHostname)if(X===ZE0.hostname())F=!0;if(!F)continue}if(Array.isArray(H.clientLanguage)){let F=!1;for(let X of H.clientLanguage)if(X===QE0)F=!0;if(!F)continue}return H.serviceConfig}throw Error("No matching service config found")}function VE0(Y,Z){for(let W of Y)if(W.length>0&&W[0].startsWith("grpc_config=")){let H=W.join("").substring(12),F=JSON.parse(H);return HE0(F,Z)}return null}});var k8=H0((El)=>{Object.defineProperty(El,"__esModule",{value:!0});El.ConnectivityState=void 0;var Cl;(function(Y){Y[Y.IDLE=0]="IDLE",Y[Y.CONNECTING=1]="CONNECTING",Y[Y.READY=2]="READY",Y[Y.TRANSIENT_FAILURE=3]="TRANSIENT_FAILURE",Y[Y.SHUTDOWN=4]="SHUTDOWN"})(Cl||(El.ConnectivityState=Cl={}))});var E4=H0((Ll)=>{Object.defineProperty(Ll,"__esModule",{value:!0});Ll.QueuePicker=Ll.UnavailablePicker=Ll.PickResultType=void 0;var AE0=K8(),UE0=a1(),V3;(function(Y){Y[Y.COMPLETE=0]="COMPLETE",Y[Y.QUEUE=1]="QUEUE",Y[Y.TRANSIENT_FAILURE=2]="TRANSIENT_FAILURE",Y[Y.DROP=3]="DROP"})(V3||(Ll.PickResultType=V3={}));class Rl{constructor(Y){this.status=Object.assign({code:UE0.Status.UNAVAILABLE,details:"No connection established",metadata:new AE0.Metadata},Y)}pick(Y){return{pickResultType:V3.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}}Ll.UnavailablePicker=Rl;class Pl{constructor(Y,Z){this.loadBalancer=Y,this.childPicker=Z,this.calledExitIdle=!1}pick(Y){if(!this.calledExitIdle)process.nextTick(()=>{this.loadBalancer.exitIdle()}),this.calledExitIdle=!0;if(this.childPicker)return this.childPicker.pick(Y);else return{pickResultType:V3.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}}Ll.QueuePicker=Pl});var yY=H0((Sl)=>{Object.defineProperty(Sl,"__esModule",{value:!0});Sl.BackoffTimeout=void 0;var DE0=a1(),TE0=M6(),IE0="backoff",$E0=1000,CE0=1.6,EE0=120000,ME0=0.2;function RE0(Y,Z){return Math.random()*(Z-Y)+Y}class q3{constructor(Y,Z){if(this.callback=Y,this.initialDelay=$E0,this.multiplier=CE0,this.maxDelay=EE0,this.jitter=ME0,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=q3.getNextId(),Z){if(Z.initialDelay)this.initialDelay=Z.initialDelay;if(Z.multiplier)this.multiplier=Z.multiplier;if(Z.jitter)this.jitter=Z.jitter;if(Z.maxDelay)this.maxDelay=Z.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(Y){TE0.trace(DE0.LogVerbosity.DEBUG,IE0,"{"+this.id+"} "+Y)}runTimer(Y){var Z,W;if(this.trace("runTimer(delay="+Y+")"),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+Y),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace("timer fired"),this.running=!1,this.callback()},Y),!this.hasRef)(W=(Z=this.timerId).unref)===null||W===void 0||W.call(Z)}runOnce(){this.trace("runOnce()"),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let Y=Math.min(this.nextDelay*this.multiplier,this.maxDelay),Z=Y*this.jitter;this.nextDelay=Y+RE0(-Z,Z)}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 Y=new Date,Z=this.startTime;if(Z.setMilliseconds(Z.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),Y<Z)this.runTimer(Z.getTime()-Y.getTime());else this.running=!1}}isRunning(){return this.running}ref(){var Y,Z;this.hasRef=!0,(Z=(Y=this.timerId).ref)===null||Z===void 0||Z.call(Y)}unref(){var Y,Z;this.hasRef=!1,(Z=(Y=this.timerId).unref)===null||Z===void 0||Z.call(Y)}getEndTime(){return this.endTime}}Sl.BackoffTimeout=q3;q3.nextId=0});var z3=H0((yl)=>{Object.defineProperty(yl,"__esModule",{value:!0});yl.ChildLoadBalancerHandler=void 0;var PE0=V5(),LE0=k8(),wE0="child_load_balancer_helper";class kl{constructor(Y){this.channelControlHelper=Y,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(Z){this.parent=Z,this.child=null}createSubchannel(Z,W){return this.parent.channelControlHelper.createSubchannel(Z,W)}updateState(Z,W,H){var F;if(this.calledByPendingChild()){if(Z===LE0.ConnectivityState.CONNECTING)return;(F=this.parent.currentChild)===null||F===void 0||F.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(Z,W,H)}requestReresolution(){var Z;let W=(Z=this.parent.pendingChild)!==null&&Z!==void 0?Z:this.parent.currentChild;if(this.child===W)this.parent.channelControlHelper.requestReresolution()}setChild(Z){this.child=Z}addChannelzChild(Z){this.parent.channelControlHelper.addChannelzChild(Z)}removeChannelzChild(Z){this.parent.channelControlHelper.removeChannelzChild(Z)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(Y,Z){return Y.getLoadBalancerName()!==Z.getLoadBalancerName()}updateAddressList(Y,Z,W,H){let F;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,Z)){let X=new this.ChildPolicyHelper(this),J=(0,PE0.createLoadBalancer)(Z,X);if(X.setChild(J),this.currentChild===null)this.currentChild=J,F=this.currentChild;else{if(this.pendingChild)this.pendingChild.destroy();this.pendingChild=J,F=this.pendingChild}}else if(this.pendingChild===null)F=this.currentChild;else F=this.pendingChild;return this.latestConfig=Z,F.updateAddressList(Y,Z,W,H)}exitIdle(){if(this.currentChild){if(this.currentChild.exitIdle(),this.pendingChild)this.pendingChild.exitIdle()}}resetBackoff(){if(this.currentChild){if(this.currentChild.resetBackoff(),this.pendingChild)this.pendingChild.resetBackoff()}}destroy(){if(this.currentChild)this.currentChild.destroy(),this.currentChild=null;if(this.pendingChild)this.pendingChild.destroy(),this.pendingChild=null}getTypeName(){return wE0}}yl.ChildLoadBalancerHandler=kl});var ul=H0((xl)=>{Object.defineProperty(xl,"__esModule",{value:!0});xl.ResolvingLoadBalancer=void 0;var SE0=V5(),fE0=iz(),b8=k8(),hl=S9(),jQ=E4(),kE0=yY(),rz=a1(),yE0=K8(),vE0=M6(),hE0=a1(),jE0=f8(),_E0=z3(),xE0="resolving_load_balancer";function jl(Y){vE0.trace(hE0.LogVerbosity.DEBUG,xE0,Y)}var bE0=["SERVICE_AND_METHOD","SERVICE","EMPTY"];function uE0(Y,Z,W,H){for(let F of W.name)switch(H){case"EMPTY":if(!F.service&&!F.method)return!0;break;case"SERVICE":if(F.service===Y&&!F.method)return!0;break;case"SERVICE_AND_METHOD":if(F.service===Y&&F.method===Z)return!0}return!1}function mE0(Y,Z,W,H){for(let F of W)if(uE0(Y,Z,F,H))return F;return null}function gE0(Y){return{invoke(Z,W){var H,F;let X=Z.split("/").filter((G)=>G.length>0),J=(H=X[0])!==null&&H!==void 0?H:"",Q=(F=X[1])!==null&&F!==void 0?F:"";if(Y&&Y.methodConfig)for(let G of bE0){let q=mE0(J,Q,Y.methodConfig,G);if(q)return{methodConfig:q,pickInformation:{},status:rz.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:rz.Status.OK,dynamicFilterFactories:[]}},unref(){}}}class _l{constructor(Y,Z,W,H,F){if(this.target=Y,this.channelControlHelper=Z,this.channelOptions=W,this.onSuccessfulResolution=H,this.onFailedResolution=F,this.latestChildState=b8.ConnectivityState.IDLE,this.latestChildPicker=new jQ.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=b8.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,W["grpc.service_config"])this.defaultServiceConfig=(0,fE0.validateServiceConfig)(JSON.parse(W["grpc.service_config"]));else this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]};this.updateState(b8.ConnectivityState.IDLE,new jQ.QueuePicker(this),null),this.childLoadBalancer=new _E0.ChildLoadBalancerHandler({createSubchannel:Z.createSubchannel.bind(Z),requestReresolution:()=>{if(this.backoffTimeout.isRunning())jl("requestReresolution delayed by backoff timer until "+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0;else this.updateResolution()},updateState:(J,Q,G)=>{this.latestChildState=J,this.latestChildPicker=Q,this.latestChildErrorMessage=G,this.updateState(J,Q,G)},addChannelzChild:Z.addChannelzChild.bind(Z),removeChannelzChild:Z.removeChannelzChild.bind(Z)}),this.innerResolver=(0,hl.createResolver)(Y,this.handleResolverResult.bind(this),W);let X={initialDelay:W["grpc.initial_reconnect_backoff_ms"],maxDelay:W["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new kE0.BackoffTimeout(()=>{if(this.continueResolving)this.updateResolution(),this.continueResolving=!1;else this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},X),this.backoffTimeout.unref()}handleResolverResult(Y,Z,W,H){var F,X;this.backoffTimeout.stop(),this.backoffTimeout.reset();let J=!0,Q=null;if(W===null)Q=this.defaultServiceConfig;else if(W.ok)Q=W.value;else if(this.previousServiceConfig!==null)Q=this.previousServiceConfig;else J=!1,this.handleResolutionFailure(W.error);if(Q!==null){let G=(F=Q===null||Q===void 0?void 0:Q.loadBalancingConfig)!==null&&F!==void 0?F:[],q=(0,SE0.selectLbConfigFromList)(G,!0);if(q===null)J=!1,this.handleResolutionFailure({code:rz.Status.UNAVAILABLE,details:"All load balancer options in service config are not compatible",metadata:new yE0.Metadata});else J=this.childLoadBalancer.updateAddressList(Y,q,Object.assign(Object.assign({},this.channelOptions),Z),H)}if(J)this.onSuccessfulResolution(Q,(X=Z[hl.CHANNEL_ARGS_CONFIG_SELECTOR_KEY])!==null&&X!==void 0?X:gE0(Q));return J}updateResolution(){if(this.innerResolver.updateResolution(),this.currentState===b8.ConnectivityState.IDLE)this.updateState(b8.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage);this.backoffTimeout.runOnce()}updateState(Y,Z,W){if(jl((0,jE0.uriToString)(this.target)+" "+b8.ConnectivityState[this.currentState]+" -> "+b8.ConnectivityState[Y]),Y===b8.ConnectivityState.IDLE)Z=new jQ.QueuePicker(this,Z);this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}handleResolutionFailure(Y){if(this.latestChildState===b8.ConnectivityState.IDLE)this.updateState(b8.ConnectivityState.TRANSIENT_FAILURE,new jQ.UnavailablePicker(Y),Y.details),this.onFailedResolution(Y)}exitIdle(){if(this.currentState===b8.ConnectivityState.IDLE||this.currentState===b8.ConnectivityState.TRANSIENT_FAILURE)if(this.backoffTimeout.isRunning())this.continueResolving=!0;else this.updateResolution();this.childLoadBalancer.exitIdle()}updateAddressList(Y,Z){throw 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=b8.ConnectivityState.IDLE,this.latestChildPicker=new jQ.QueuePicker(this),this.currentState=b8.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return"resolving_load_balancer"}}xl.ResolvingLoadBalancer=_l});var dl=H0((ml)=>{Object.defineProperty(ml,"__esModule",{value:!0});ml.recognizedOptions=void 0;ml.channelOptionsEqual=dE0;ml.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 dE0(Y,Z){let W=Object.keys(Y).sort(),H=Object.keys(Z).sort();if(W.length!==H.length)return!1;for(let F=0;F<W.length;F+=1){if(W[F]!==H[F])return!1;if(Y[W[F]]!==Z[H[F]])return!1}return!0}});var u8=H0((il)=>{Object.defineProperty(il,"__esModule",{value:!0});il.EndpointMap=void 0;il.isTcpSubchannelAddress=xQ;il.subchannelAddressEqual=B3;il.subchannelAddressToString=ll;il.stringToSubchannelAddress=nE0;il.endpointEqual=pE0;il.endpointToString=iE0;il.endpointHasAddress=nl;var cl=V1("net");function xQ(Y){return"port"in Y}function B3(Y,Z){if(!Y&&!Z)return!0;if(!Y||!Z)return!1;if(xQ(Y))return xQ(Z)&&Y.host===Z.host&&Y.port===Z.port;else return!xQ(Z)&&Y.path===Z.path}function ll(Y){if(xQ(Y))if((0,cl.isIPv6)(Y.host))return"["+Y.host+"]:"+Y.port;else return Y.host+":"+Y.port;else return Y.path}var lE0=443;function nE0(Y,Z){if((0,cl.isIP)(Y))return{host:Y,port:Z!==null&&Z!==void 0?Z:lE0};else return{path:Y}}function pE0(Y,Z){if(Y.addresses.length!==Z.addresses.length)return!1;for(let W=0;W<Y.addresses.length;W++)if(!B3(Y.addresses[W],Z.addresses[W]))return!1;return!0}function iE0(Y){return"["+Y.addresses.map(ll).join(", ")+"]"}function nl(Y,Z){for(let W of Y.addresses)if(B3(W,Z))return!0;return!1}function _Q(Y,Z){if(Y.addresses.length!==Z.addresses.length)return!1;for(let W of Y.addresses){let H=!1;for(let F of Z.addresses)if(B3(W,F)){H=!0;break}if(!H)return!1}return!0}class pl{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(Y){for(let Z of this.map)if(nl(Z.key,Y))return Z.value;return}deleteMissing(Y){let Z=[];for(let W of this.map){let H=!1;for(let F of Y)if(_Q(F,W.key))H=!0;if(!H)Z.push(W.value),this.map.delete(W)}return Z}get(Y){for(let Z of this.map)if(_Q(Y,Z.key))return Z.value;return}set(Y,Z){for(let W of this.map)if(_Q(Y,W.key)){W.value=Z;return}this.map.add({key:Y,value:Z})}delete(Y){for(let Z of this.map)if(_Q(Y,Z.key)){this.map.delete(Z);return}}has(Y){for(let Z of this.map)if(_Q(Y,Z.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let Y of this.map)yield Y.key}*values(){for(let Y of this.map)yield Y.value}*entries(){for(let Y of this.map)yield[Y.key,Y.value]}}il.EndpointMap=pl});var Xn=H0((Qn)=>{Object.defineProperty(Qn,"t",{value:!0});class az{constructor(Y,Z,W=1){this.i=void 0,this.h=void 0,this.o=void 0,this.u=Y,this.l=Z,this.p=W}I(){let Y=this,Z=Y.o.o===Y;if(Z&&Y.p===1)Y=Y.h;else if(Y.i){Y=Y.i;while(Y.h)Y=Y.h}else{if(Z)return Y.o;let W=Y.o;while(W.i===Y)Y=W,W=Y.o;Y=W}return Y}B(){let Y=this;if(Y.h){Y=Y.h;while(Y.i)Y=Y.i;return Y}else{let Z=Y.o;while(Z.h===Y)Y=Z,Z=Y.o;if(Y.h!==Z)return Z;else return Y}}_(){let Y=this.o,Z=this.h,W=Z.i;if(Y.o===this)Y.o=Z;else if(Y.i===this)Y.i=Z;else Y.h=Z;if(Z.o=Y,Z.i=this,this.o=Z,this.h=W,W)W.o=this;return Z}g(){let Y=this.o,Z=this.i,W=Z.h;if(Y.o===this)Y.o=Z;else if(Y.i===this)Y.i=Z;else Y.h=Z;if(Z.o=Y,Z.h=this,this.o=Z,this.i=W,W)W.o=this;return Z}}class al extends az{constructor(){super(...arguments);this.M=1}_(){let Y=super._();return this.O(),Y.O(),Y}g(){let Y=super.g();return this.O(),Y.O(),Y}O(){if(this.M=1,this.i)this.M+=this.i.M;if(this.h)this.M+=this.h.M}}class ol{constructor(Y=0){this.iteratorType=Y}equals(Y){return this.T===Y.T}}class tl{constructor(){this.m=0}get length(){return this.m}size(){return this.m}empty(){return this.m===0}}class sl extends tl{}function A7(){throw RangeError("Iterator access denied!")}class el extends sl{constructor(Y=function(W,H){if(W<H)return-1;if(W>H)return 1;return 0},Z=!1){super();this.v=void 0,this.A=Y,this.enableIndex=Z,this.N=Z?al:az,this.C=new this.N}R(Y,Z){let W=this.C;while(Y){let H=this.A(Y.u,Z);if(H<0)Y=Y.h;else if(H>0)W=Y,Y=Y.i;else return Y}return W}K(Y,Z){let W=this.C;while(Y)if(this.A(Y.u,Z)<=0)Y=Y.h;else W=Y,Y=Y.i;return W}L(Y,Z){let W=this.C;while(Y){let H=this.A(Y.u,Z);if(H<0)W=Y,Y=Y.h;else if(H>0)Y=Y.i;else return Y}return W}k(Y,Z){let W=this.C;while(Y)if(this.A(Y.u,Z)<0)W=Y,Y=Y.h;else Y=Y.i;return W}P(Y){while(!0){let Z=Y.o;if(Z===this.C)return;if(Y.p===1){Y.p=0;return}if(Y===Z.i){let W=Z.h;if(W.p===1)if(W.p=0,Z.p=1,Z===this.v)this.v=Z._();else Z._();else if(W.h&&W.h.p===1){if(W.p=Z.p,Z.p=0,W.h.p=0,Z===this.v)this.v=Z._();else Z._();return}else if(W.i&&W.i.p===1)W.p=1,W.i.p=0,W.g();else W.p=1,Y=Z}else{let W=Z.i;if(W.p===1)if(W.p=0,Z.p=1,Z===this.v)this.v=Z.g();else Z.g();else if(W.i&&W.i.p===1){if(W.p=Z.p,Z.p=0,W.i.p=0,Z===this.v)this.v=Z.g();else Z.g();return}else if(W.h&&W.h.p===1)W.p=1,W.h.p=0,W._();else W.p=1,Y=Z}}}S(Y){if(this.m===1){this.clear();return}let Z=Y;while(Z.i||Z.h){if(Z.h){Z=Z.h;while(Z.i)Z=Z.i}else Z=Z.i;let H=Y.u;Y.u=Z.u,Z.u=H;let F=Y.l;Y.l=Z.l,Z.l=F,Y=Z}if(this.C.i===Z)this.C.i=Z.o;else if(this.C.h===Z)this.C.h=Z.o;this.P(Z);let W=Z.o;if(Z===W.i)W.i=void 0;else W.h=void 0;if(this.m-=1,this.v.p=0,this.enableIndex)while(W!==this.C)W.M-=1,W=W.o}U(Y){let Z=typeof Y==="number"?Y:void 0,W=typeof Y==="function"?Y:void 0,H=typeof Y>"u"?[]:void 0,F=0,X=this.v,J=[];while(J.length||X)if(X)J.push(X),X=X.i;else{if(X=J.pop(),F===Z)return X;H&&H.push(X),W&&W(X,F,this),F+=1,X=X.h}return H}j(Y){while(!0){let Z=Y.o;if(Z.p===0)return;let W=Z.o;if(Z===W.i){let H=W.h;if(H&&H.p===1){if(H.p=Z.p=0,W===this.v)return;W.p=1,Y=W;continue}else if(Y===Z.h){if(Y.p=0,Y.i)Y.i.o=Z;if(Y.h)Y.h.o=W;if(Z.h=Y.i,W.i=Y.h,Y.i=Z,Y.h=W,W===this.v)this.v=Y,this.C.o=Y;else{let F=W.o;if(F.i===W)F.i=Y;else F.h=Y}Y.o=W.o,Z.o=Y,W.o=Y,W.p=1}else{if(Z.p=0,W===this.v)this.v=W.g();else W.g();W.p=1;return}}else{let H=W.i;if(H&&H.p===1){if(H.p=Z.p=0,W===this.v)return;W.p=1,Y=W;continue}else if(Y===Z.i){if(Y.p=0,Y.i)Y.i.o=W;if(Y.h)Y.h.o=Z;if(W.h=Y.i,Z.i=Y.h,Y.i=W,Y.h=Z,W===this.v)this.v=Y,this.C.o=Y;else{let F=W.o;if(F.i===W)F.i=Y;else F.h=Y}Y.o=W.o,Z.o=Y,W.o=Y,W.p=1}else{if(Z.p=0,W===this.v)this.v=W._();else W._();W.p=1;return}}if(this.enableIndex)Z.O(),W.O(),Y.O();return}}q(Y,Z,W){if(this.v===void 0)return this.m+=1,this.v=new this.N(Y,Z,0),this.v.o=this.C,this.C.o=this.C.i=this.C.h=this.v,this.m;let H,F=this.C.i,X=this.A(F.u,Y);if(X===0)return F.l=Z,this.m;else if(X>0)F.i=new this.N(Y,Z),F.i.o=F,H=F.i,this.C.i=H;else{let J=this.C.h,Q=this.A(J.u,Y);if(Q===0)return J.l=Z,this.m;else if(Q<0)J.h=new this.N(Y,Z),J.h.o=J,H=J.h,this.C.h=H;else{if(W!==void 0){let G=W.T;if(G!==this.C){let q=this.A(G.u,Y);if(q===0)return G.l=Z,this.m;else if(q>0){let K=G.I(),V=this.A(K.u,Y);if(V===0)return K.l=Z,this.m;else if(V<0)if(H=new this.N(Y,Z),K.h===void 0)K.h=H,H.o=K;else G.i=H,H.o=G}}}if(H===void 0){H=this.v;while(!0){let G=this.A(H.u,Y);if(G>0){if(H.i===void 0){H.i=new this.N(Y,Z),H.i.o=H,H=H.i;break}H=H.i}else if(G<0){if(H.h===void 0){H.h=new this.N(Y,Z),H.h.o=H,H=H.h;break}H=H.h}else return H.l=Z,this.m}}}}if(this.enableIndex){let J=H.o;while(J!==this.C)J.M+=1,J=J.o}return this.j(H),this.m+=1,this.m}H(Y,Z){while(Y){let W=this.A(Y.u,Z);if(W<0)Y=Y.h;else if(W>0)Y=Y.i;else return Y}return Y||this.C}clear(){this.m=0,this.v=void 0,this.C.o=void 0,this.C.i=this.C.h=void 0}updateKeyByIterator(Y,Z){let W=Y.T;if(W===this.C)A7();if(this.m===1)return W.u=Z,!0;let H=W.B().u;if(W===this.C.i){if(this.A(H,Z)>0)return W.u=Z,!0;return!1}let F=W.I().u;if(W===this.C.h){if(this.A(F,Z)<0)return W.u=Z,!0;return!1}if(this.A(F,Z)>=0||this.A(H,Z)<=0)return!1;return W.u=Z,!0}eraseElementByPos(Y){if(Y<0||Y>this.m-1)throw RangeError();let Z=this.U(Y);return this.S(Z),this.m}eraseElementByKey(Y){if(this.m===0)return!1;let Z=this.H(this.v,Y);if(Z===this.C)return!1;return this.S(Z),!0}eraseElementByIterator(Y){let Z=Y.T;if(Z===this.C)A7();let W=Z.h===void 0;if(Y.iteratorType===0){if(W)Y.next()}else if(!W||Z.i===void 0)Y.next();return this.S(Z),Y}getHeight(){if(this.m===0)return 0;function Y(Z){if(!Z)return 0;return Math.max(Y(Z.i),Y(Z.h))+1}return Y(this.v)}}class Yn extends ol{constructor(Y,Z,W){super(W);if(this.T=Y,this.C=Z,this.iteratorType===0)this.pre=function(){if(this.T===this.C.i)A7();return this.T=this.T.I(),this},this.next=function(){if(this.T===this.C)A7();return this.T=this.T.B(),this};else this.pre=function(){if(this.T===this.C.h)A7();return this.T=this.T.B(),this},this.next=function(){if(this.T===this.C)A7();return this.T=this.T.I(),this}}get index(){let Y=this.T,Z=this.C.o;if(Y===this.C){if(Z)return Z.M-1;return 0}let W=0;if(Y.i)W+=Y.i.M;while(Y!==Z){let H=Y.o;if(Y===H.h){if(W+=1,H.i)W+=H.i.M}Y=H}return W}isAccessible(){return this.T!==this.C}}class f9 extends Yn{constructor(Y,Z,W,H){super(Y,Z,H);this.container=W}get pointer(){if(this.T===this.C)A7();let Y=this;return new Proxy([],{get(Z,W){if(W==="0")return Y.T.u;else if(W==="1")return Y.T.l;return Z[0]=Y.T.u,Z[1]=Y.T.l,Z[W]},set(Z,W,H){if(W!=="1")throw TypeError("prop must be 1");return Y.T.l=H,!0}})}copy(){return new f9(this.T,this.C,this.container,this.iteratorType)}}class Zn extends el{constructor(Y=[],Z,W){super(Z,W);let H=this;Y.forEach(function(F){H.setElement(F[0],F[1])})}begin(){return new f9(this.C.i||this.C,this.C,this)}end(){return new f9(this.C,this.C,this)}rBegin(){return new f9(this.C.h||this.C,this.C,this,1)}rEnd(){return new f9(this.C,this.C,this,1)}front(){if(this.m===0)return;let Y=this.C.i;return[Y.u,Y.l]}back(){if(this.m===0)return;let Y=this.C.h;return[Y.u,Y.l]}lowerBound(Y){let Z=this.R(this.v,Y);return new f9(Z,this.C,this)}upperBound(Y){let Z=this.K(this.v,Y);return new f9(Z,this.C,this)}reverseLowerBound(Y){let Z=this.L(this.v,Y);return new f9(Z,this.C,this)}reverseUpperBound(Y){let Z=this.k(this.v,Y);return new f9(Z,this.C,this)}forEach(Y){this.U(function(Z,W,H){Y([Z.u,Z.l],W,H)})}setElement(Y,Z,W){return this.q(Y,Z,W)}getElementByPos(Y){if(Y<0||Y>this.m-1)throw RangeError();let Z=this.U(Y);return[Z.u,Z.l]}find(Y){let Z=this.H(this.v,Y);return new f9(Z,this.C,this)}getElementByKey(Y){return this.H(this.v,Y).l}union(Y){let Z=this;return Y.forEach(function(W){Z.setElement(W[0],W[1])}),this.m}*[Symbol.iterator](){let Y=this.m,Z=this.U();for(let W=0;W<Y;++W){let H=Z[W];yield[H.u,H.l]}}}Qn.OrderedMap=Zn});var A3=H0((Wn)=>{Object.defineProperty(Wn,"__esModule",{value:!0});Wn.registerAdminService=QM0;Wn.addAdminServicesToServer=XM0;var Jn=[];function QM0(Y,Z){Jn.push({getServiceDefinition:Y,getHandlers:Z})}function XM0(Y){for(let{getServiceDefinition:Z,getHandlers:W}of Jn)Y.addService(Z(),W())}});var zn=H0((Vn)=>{Object.defineProperty(Vn,"__esModule",{value:!0});Vn.ClientDuplexStreamImpl=Vn.ClientWritableStreamImpl=Vn.ClientReadableStreamImpl=Vn.ClientUnaryCallImpl=void 0;Vn.callErrorFromStatus=GM0;var KM0=V1("events"),oz=V1("stream"),bQ=a1();function GM0(Y,Z){let W=`${Y.code} ${bQ.Status[Y.code]}: ${Y.details}`,F=`${Error(W).stack}
16
16
  for call at
17
17
  ${Z}`;return Object.assign(Error(W),Y,{stack:F})}class Kn extends KM0.EventEmitter{constructor(){super()}cancel(){var Y;(Y=this.call)===null||Y===void 0||Y.cancelWithStatus(bQ.Status.CANCELLED,"Cancelled on client")}getPeer(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:"unknown"}getAuthContext(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getAuthContext())!==null&&Z!==void 0?Z:null}}Vn.ClientUnaryCallImpl=Kn;class Gn extends oz.Readable{constructor(Y){super({objectMode:!0});this.deserialize=Y}cancel(){var Y;(Y=this.call)===null||Y===void 0||Y.cancelWithStatus(bQ.Status.CANCELLED,"Cancelled on client")}getPeer(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:"unknown"}getAuthContext(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getAuthContext())!==null&&Z!==void 0?Z:null}_read(Y){var Z;(Z=this.call)===null||Z===void 0||Z.startRead()}}Vn.ClientReadableStreamImpl=Gn;class Fn extends oz.Writable{constructor(Y){super({objectMode:!0});this.serialize=Y}cancel(){var Y;(Y=this.call)===null||Y===void 0||Y.cancelWithStatus(bQ.Status.CANCELLED,"Cancelled on client")}getPeer(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:"unknown"}getAuthContext(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getAuthContext())!==null&&Z!==void 0?Z:null}_write(Y,Z,W){var H;let F={callback:W},X=Number(Z);if(!Number.isNaN(X))F.flags=X;(H=this.call)===null||H===void 0||H.sendMessageWithContext(F,Y)}_final(Y){var Z;(Z=this.call)===null||Z===void 0||Z.halfClose(),Y()}}Vn.ClientWritableStreamImpl=Fn;class Hn extends oz.Duplex{constructor(Y,Z){super({objectMode:!0});this.serialize=Y,this.deserialize=Z}cancel(){var Y;(Y=this.call)===null||Y===void 0||Y.cancelWithStatus(bQ.Status.CANCELLED,"Cancelled on client")}getPeer(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:"unknown"}getAuthContext(){var Y,Z;return(Z=(Y=this.call)===null||Y===void 0?void 0:Y.getAuthContext())!==null&&Z!==void 0?Z:null}_read(Y){var Z;(Z=this.call)===null||Z===void 0||Z.startRead()}_write(Y,Z,W){var H;let F={callback:W},X=Number(Z);if(!Number.isNaN(X))F.flags=X;(H=this.call)===null||H===void 0||H.sendMessageWithContext(F,Y)}_final(Y){var Z;(Z=this.call)===null||Z===void 0||Z.halfClose(),Y()}}Vn.ClientDuplexStreamImpl=Hn});var U7=H0((An)=>{Object.defineProperty(An,"__esModule",{value:!0});An.InterceptingListenerImpl=void 0;An.statusOrFromValue=BM0;An.statusOrFromError=AM0;An.isInterceptingListener=UM0;var zM0=K8();function BM0(Y){return{ok:!0,value:Y}}function AM0(Y){var Z;return{ok:!1,error:Object.assign(Object.assign({},Y),{metadata:(Z=Y.metadata)!==null&&Z!==void 0?Z:new zM0.Metadata})}}function UM0(Y){return Y.onReceiveMetadata!==void 0&&Y.onReceiveMetadata.length===1}class Bn{constructor(Y,Z){this.listener=Y,this.nextListener=Z,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){if(this.hasPendingMessage)this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1}processPendingStatus(){if(this.pendingStatus)this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(Y){this.processingMetadata=!0,this.listener.onReceiveMetadata(Y,(Z)=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(Z),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(Y){this.processingMessage=!0,this.listener.onReceiveMessage(Y,(Z)=>{if(this.processingMessage=!1,this.processingMetadata)this.pendingMessage=Z,this.hasPendingMessage=!0;else this.nextListener.onReceiveMessage(Z),this.processPendingStatus()})}onReceiveStatus(Y){this.listener.onReceiveStatus(Y,(Z)=>{if(this.processingMetadata||this.processingMessage)this.pendingStatus=Z;else this.nextListener.onReceiveStatus(Z)})}}An.InterceptingListenerImpl=Bn});var ez=H0((Mn)=>{Object.defineProperty(Mn,"__esModule",{value:!0});Mn.InterceptingCall=Mn.RequesterBuilder=Mn.ListenerBuilder=Mn.InterceptorConfigurationError=void 0;Mn.getInterceptingCall=CM0;var TM0=K8(),Nn=U7(),On=a1(),Dn=Y3();class mQ extends Error{constructor(Y){super(Y);this.name="InterceptorConfigurationError",Error.captureStackTrace(this,mQ)}}Mn.InterceptorConfigurationError=mQ;class Tn{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(Y){return this.metadata=Y,this}withOnReceiveMessage(Y){return this.message=Y,this}withOnReceiveStatus(Y){return this.status=Y,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}}Mn.ListenerBuilder=Tn;class In{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(Y){return this.start=Y,this}withSendMessage(Y){return this.message=Y,this}withHalfClose(Y){return this.halfClose=Y,this}withCancel(Y){return this.cancel=Y,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}}Mn.RequesterBuilder=In;var tz={onReceiveMetadata:(Y,Z)=>{Z(Y)},onReceiveMessage:(Y,Z)=>{Z(Y)},onReceiveStatus:(Y,Z)=>{Z(Y)}},uQ={start:(Y,Z,W)=>{W(Y,Z)},sendMessage:(Y,Z)=>{Z(Y)},halfClose:(Y)=>{Y()},cancel:(Y)=>{Y()}};class $n{constructor(Y,Z){var W,H,F,X;if(this.nextCall=Y,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,Z)this.requester={start:(W=Z.start)!==null&&W!==void 0?W:uQ.start,sendMessage:(H=Z.sendMessage)!==null&&H!==void 0?H:uQ.sendMessage,halfClose:(F=Z.halfClose)!==null&&F!==void 0?F:uQ.halfClose,cancel:(X=Z.cancel)!==null&&X!==void 0?X:uQ.cancel};else this.requester=uQ}cancelWithStatus(Y,Z){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(Y,Z)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){if(this.pendingMessageContext)this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null}processPendingHalfClose(){if(this.pendingHalfClose)this.nextCall.halfClose()}start(Y,Z){var W,H,F,X,J,Q;let G={onReceiveMetadata:(H=(W=Z===null||Z===void 0?void 0:Z.onReceiveMetadata)===null||W===void 0?void 0:W.bind(Z))!==null&&H!==void 0?H:(q)=>{},onReceiveMessage:(X=(F=Z===null||Z===void 0?void 0:Z.onReceiveMessage)===null||F===void 0?void 0:F.bind(Z))!==null&&X!==void 0?X:(q)=>{},onReceiveStatus:(Q=(J=Z===null||Z===void 0?void 0:Z.onReceiveStatus)===null||J===void 0?void 0:J.bind(Z))!==null&&Q!==void 0?Q:(q)=>{}};this.processingMetadata=!0,this.requester.start(Y,G,(q,K)=>{var V,B,I;this.processingMetadata=!1;let M;if((0,Nn.isInterceptingListener)(K))M=K;else{let E={onReceiveMetadata:(V=K.onReceiveMetadata)!==null&&V!==void 0?V:tz.onReceiveMetadata,onReceiveMessage:(B=K.onReceiveMessage)!==null&&B!==void 0?B:tz.onReceiveMessage,onReceiveStatus:(I=K.onReceiveStatus)!==null&&I!==void 0?I:tz.onReceiveStatus};M=new Nn.InterceptingListenerImpl(E,G)}this.nextCall.start(q,M),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(Y,Z){this.processingMessage=!0,this.requester.sendMessage(Z,(W)=>{if(this.processingMessage=!1,this.processingMetadata)this.pendingMessageContext=Y,this.pendingMessage=Z;else this.nextCall.sendMessageWithContext(Y,W),this.processPendingHalfClose()})}sendMessage(Y){this.sendMessageWithContext({},Y)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{if(this.processingMetadata||this.processingMessage)this.pendingHalfClose=!0;else this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}}Mn.InterceptingCall=$n;function IM0(Y,Z,W){var H,F;let X=(H=W.deadline)!==null&&H!==void 0?H:1/0,J=W.host,Q=(F=W.parent)!==null&&F!==void 0?F:null,G=W.propagate_flags,q=W.credentials,K=Y.createCall(Z,X,J,Q,G);if(q)K.setCredentials(q);return K}class sz{constructor(Y,Z){this.call=Y,this.methodDefinition=Z}cancelWithStatus(Y,Z){this.call.cancelWithStatus(Y,Z)}getPeer(){return this.call.getPeer()}sendMessageWithContext(Y,Z){let W;try{W=this.methodDefinition.requestSerialize(Z)}catch(H){this.call.cancelWithStatus(On.Status.INTERNAL,`Request message serialization failure: ${(0,Dn.getErrorMessage)(H)}`);return}this.call.sendMessageWithContext(Y,W)}sendMessage(Y){this.sendMessageWithContext({},Y)}start(Y,Z){let W=null;this.call.start(Y,{onReceiveMetadata:(H)=>{var F;(F=Z===null||Z===void 0?void 0:Z.onReceiveMetadata)===null||F===void 0||F.call(Z,H)},onReceiveMessage:(H)=>{var F;let X;try{X=this.methodDefinition.responseDeserialize(H)}catch(J){W={code:On.Status.INTERNAL,details:`Response message parsing error: ${(0,Dn.getErrorMessage)(J)}`,metadata:new TM0.Metadata},this.call.cancelWithStatus(W.code,W.details);return}(F=Z===null||Z===void 0?void 0:Z.onReceiveMessage)===null||F===void 0||F.call(Z,X)},onReceiveStatus:(H)=>{var F,X;if(W)(F=Z===null||Z===void 0?void 0:Z.onReceiveStatus)===null||F===void 0||F.call(Z,W);else(X=Z===null||Z===void 0?void 0:Z.onReceiveStatus)===null||X===void 0||X.call(Z,H)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}}class Cn extends sz{constructor(Y,Z){super(Y,Z)}start(Y,Z){var W,H;let F=!1,X={onReceiveMetadata:(H=(W=Z===null||Z===void 0?void 0:Z.onReceiveMetadata)===null||W===void 0?void 0:W.bind(Z))!==null&&H!==void 0?H:(J)=>{},onReceiveMessage:(J)=>{var Q;F=!0,(Q=Z===null||Z===void 0?void 0:Z.onReceiveMessage)===null||Q===void 0||Q.call(Z,J)},onReceiveStatus:(J)=>{var Q,G;if(!F)(Q=Z===null||Z===void 0?void 0:Z.onReceiveMessage)===null||Q===void 0||Q.call(Z,null);(G=Z===null||Z===void 0?void 0:Z.onReceiveStatus)===null||G===void 0||G.call(Z,J)}};super.start(Y,X),this.call.startRead()}}class En extends sz{}function $M0(Y,Z,W){let H=IM0(Y,W.path,Z);if(W.responseStream)return new En(H,W);else return new Cn(H,W)}function CM0(Y,Z,W,H){if(Y.clientInterceptors.length>0&&Y.clientInterceptorProviders.length>0)throw new mQ("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(Y.callInterceptors.length>0&&Y.callInterceptorProviders.length>0)throw new mQ("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let F=[];if(Y.callInterceptors.length>0||Y.callInterceptorProviders.length>0)F=[].concat(Y.callInterceptors,Y.callInterceptorProviders.map((Q)=>Q(Z))).filter((Q)=>Q);else F=[].concat(Y.clientInterceptors,Y.clientInterceptorProviders.map((Q)=>Q(Z))).filter((Q)=>Q);let X=Object.assign({},W,{method_definition:Z});return F.reduceRight((Q,G)=>{return(q)=>G(q,Q)},(Q)=>$M0(H,Q,Z))(X)}});var ZB=H0((Ln)=>{Object.defineProperty(Ln,"__esModule",{value:!0});Ln.Client=void 0;var Y4=zn(),LM0=QB(),wM0=k8(),q5=a1(),vY=K8(),U3=ez(),k9=Symbol(),hY=Symbol(),jY=Symbol(),M4=Symbol();function YB(Y){return typeof Y==="function"}function _Y(Y){var Z;return((Z=Y.stack)===null||Z===void 0?void 0:Z.split(`
18
18
  `).slice(1).join(`
@@ -26,13 +26,13 @@ ${Z}`;return Object.assign(Error(W),Y,{stack:F})}class Kn extends KM0.EventEmitt
26
26
  `)R++;return R}function E(){if(Q.length>0)return Q.shift();if(G)return K();var C,R,w,L,k,v=W===0;do{if(W===H)return null;C=!1;while(D20.test(w=V(W))){if(w===`
27
27
  `)v=!0,++F;if(++W===H)return null}if(V(W)==="/"){if(++W===H)throw q("comment");if(V(W)==="/")if(!Z){k=V(L=W+1)==="/";while(V(++W)!==`
28
28
  `)if(W===H)return null;if(++W,k)B(L,W-1,v),v=!0;++F,C=!0}else{if(L=W,k=!1,I(W-1)){k=!0;do{if(W=M(W),W===H)break;if(W++,!v)break}while(I(W))}else W=Math.min(H,M(W)+1);if(k)B(L,W,v),v=!0;F++,C=!0}else if((w=V(W))==="*"){L=W+1,k=Z||V(L)==="*";do{if(w===`
29
- `)++F;if(++W===H)throw q("comment");R=w,w=V(W)}while(R!=="*"||w!=="/");if(++W,k)B(L,W-2,v),v=!0;C=!0}else return"/"}}while(C);var f=W;xB.lastIndex=0;var h=xB.test(V(f++));if(!h)while(f<H&&!xB.test(V(f)))++f;var b=Y.substring(W,W=f);if(b==='"'||b==="'")G=b;return b}function A(C){Q.push(C)}function N(){if(!Q.length){var C=E();if(C===null)return null;A(C)}return Q[0]}function O(C,R){var w=N(),L=w===C;if(L)return E(),!0;if(!R)throw q("token '"+w+"', '"+C+"' expected");return!1}function T(C){var R=null,w;if(C===void 0){if(w=J[F-1],delete J[F-1],w&&(Z||w.type==="*"||w.lineEmpty))R=w.leading?w.text:null}else{if(X<C)N();if(w=J[C],delete J[C],w&&!w.lineEmpty&&(Z||w.type==="/"))R=w.leading?null:w.text}return R}return Object.defineProperty({next:E,peek:N,push:A,skip:O,cmnt:T},"line",{get:function(){return F}})}});var sp=H0((tt0,tp)=>{tp.exports=w4;w4.filename=null;w4.defaults={keepCase:!1};var $20=bB(),ip=y3(),rp=w3(),ap=z5(),C20=C3(),op=D7(),E20=y9(),M20=M3(),R20=E3(),P20=B5(),L20=T7(),uB=G8(),w20=/^[1-9][0-9]*$/,S20=/^-?[1-9][0-9]*$/,f20=/^0[x][0-9a-fA-F]+$/,k20=/^-?0[x][0-9a-fA-F]+$/,y20=/^0[0-7]+$/,v20=/^-?0[0-7]+$/,h20=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,X4=/^[a-zA-Z_][a-zA-Z_0-9]*$/,J4=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function w4(Y,Z,W){if(!(Z instanceof ip))W=Z,Z=new ip;if(!W)W=w4.defaults;var H=W.preferTrailingComment||!1,F=$20(Y,W.alternateCommentMode||!1),X=F.next,J=F.push,Q=F.peek,G=F.skip,q=F.cmnt,K=!0,V,B,I,M="proto2",E=Z,A=[],N={},O=W.keepCase?function(D0){return D0}:uB.camelCase;function T(){A.forEach((D0)=>{D0._edition=M,Object.keys(N).forEach((A0)=>{if(D0.getOption(A0)!==void 0)return;D0.setOption(A0,N[A0],!0)})})}function C(D0,A0,Y0){var G0=w4.filename;if(!Y0)w4.filename=null;return Error("illegal "+(A0||"token")+" '"+D0+"' ("+(G0?G0+", ":"")+"line "+F.line+")")}function R(){var D0=[],A0;do{if((A0=X())!=='"'&&A0!=="'")throw C(A0);D0.push(X()),G(A0),A0=Q()}while(A0==='"'||A0==="'");return D0.join("")}function w(D0){var A0=X();switch(A0){case"'":case'"':return J(A0),R();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return k(A0,!0)}catch(Y0){if(D0&&J4.test(A0))return A0;throw C(A0,"value")}}function L(D0,A0){var Y0,G0;do if(A0&&((Y0=Q())==='"'||Y0==="'")){var U0=R();if(D0.push(U0),M>=2023)throw C(U0,"id")}else try{D0.push([G0=v(X()),G("to",!0)?v(X()):G0])}catch(O0){if(A0&&J4.test(Y0)&&M>=2023)D0.push(Y0);else throw O0}while(G(",",!0));var R0={options:void 0};R0.setOption=function(O0,I0){if(this.options===void 0)this.options={};this.options[O0]=I0},n(R0,function(I0){if(I0==="option")s(R0,I0),G(";");else throw C(I0)},function(){t(R0)})}function k(D0,A0){var Y0=1;if(D0.charAt(0)==="-")Y0=-1,D0=D0.substring(1);switch(D0){case"inf":case"INF":case"Inf":return Y0*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(w20.test(D0))return Y0*parseInt(D0,10);if(f20.test(D0))return Y0*parseInt(D0,16);if(y20.test(D0))return Y0*parseInt(D0,8);if(h20.test(D0))return Y0*parseFloat(D0);throw C(D0,"number",A0)}function v(D0,A0){switch(D0){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!A0&&D0.charAt(0)==="-")throw C(D0,"id");if(S20.test(D0))return parseInt(D0,10);if(k20.test(D0))return parseInt(D0,16);if(v20.test(D0))return parseInt(D0,8);throw C(D0,"id")}function f(){if(V!==void 0)throw C("package");if(V=X(),!J4.test(V))throw C(V,"name");E=E.define(V),G(";")}function h(){var D0=Q(),A0;switch(D0){case"weak":A0=I||(I=[]),X();break;case"public":X();default:A0=B||(B=[]);break}D0=R(),G(";"),A0.push(D0)}function b(){if(G("="),M=R(),M<2023)throw C(M,"syntax");G(";")}function x(){if(G("="),M=R(),!["2023"].includes(M))throw C(M,"edition");G(";")}function y(D0,A0){switch(A0){case"option":return s(D0,A0),G(";"),!0;case"message":return Z0(D0,A0),!0;case"enum":return Q0(D0,A0),!0;case"service":return J0(D0,A0),!0;case"extend":return N0(D0,A0),!0}return!1}function n(D0,A0,Y0){var G0=F.line;if(D0){if(typeof D0.comment!=="string")D0.comment=q();D0.filename=w4.filename}if(G("{",!0)){var U0;while((U0=X())!=="}")A0(U0);G(";",!0)}else{if(Y0)Y0();if(G(";"),D0&&(typeof D0.comment!=="string"||H))D0.comment=q(G0)||D0.comment}}function Z0(D0,A0){if(!X4.test(A0=X()))throw C(A0,"type name");var Y0=new rp(A0);if(n(Y0,function(U0){if(y(Y0,U0))return;switch(U0){case"map":c(Y0,U0);break;case"required":if(M!=="proto2")throw C(U0);case"repeated":m(Y0,U0);break;case"optional":if(M==="proto3")m(Y0,"proto3_optional");else if(M!=="proto2")throw C(U0);else m(Y0,"optional");break;case"oneof":p(Y0,U0);break;case"extensions":L(Y0.extensions||(Y0.extensions=[]));break;case"reserved":L(Y0.reserved||(Y0.reserved=[]),!0);break;default:if(M==="proto2"||!J4.test(U0))throw C(U0);J(U0),m(Y0,"optional");break}}),D0.add(Y0),D0===E)A.push(Y0)}function m(D0,A0,Y0){var G0=X();if(G0==="group"){j(D0,A0);return}while(G0.endsWith(".")||Q().startsWith("."))G0+=X();if(!J4.test(G0))throw C(G0,"type");var U0=X();if(!X4.test(U0))throw C(U0,"name");U0=O(U0),G("=");var R0=new ap(U0,v(X()),G0,A0,Y0);if(n(R0,function(M0){if(M0==="option")s(R0,M0),G(";");else throw C(M0)},function(){t(R0)}),A0==="proto3_optional"){var O0=new op("_"+U0);R0.setOption("proto3_optional",!0),O0.add(R0),D0.add(O0)}else D0.add(R0);if(D0===E)A.push(R0)}function j(D0,A0){if(M>=2023)throw C("group");var Y0=X();if(!X4.test(Y0))throw C(Y0,"name");var G0=uB.lcFirst(Y0);if(Y0===G0)Y0=uB.ucFirst(Y0);G("=");var U0=v(X()),R0=new rp(Y0);R0.group=!0;var O0=new ap(G0,U0,Y0,A0);O0.filename=w4.filename,n(R0,function(M0){switch(M0){case"option":s(R0,M0),G(";");break;case"required":case"repeated":m(R0,M0);break;case"optional":if(M==="proto3")m(R0,"proto3_optional");else m(R0,"optional");break;case"message":Z0(R0,M0);break;case"enum":Q0(R0,M0);break;case"reserved":L(R0.reserved||(R0.reserved=[]),!0);break;default:throw C(M0)}}),D0.add(R0).add(O0)}function c(D0){G("<");var A0=X();if(L20.mapKey[A0]===void 0)throw C(A0,"type");G(",");var Y0=X();if(!J4.test(Y0))throw C(Y0,"type");G(">");var G0=X();if(!X4.test(G0))throw C(G0,"name");G("=");var U0=new C20(O(G0),v(X()),A0,Y0);n(U0,function(O0){if(O0==="option")s(U0,O0),G(";");else throw C(O0)},function(){t(U0)}),D0.add(U0)}function p(D0,A0){if(!X4.test(A0=X()))throw C(A0,"name");var Y0=new op(O(A0));n(Y0,function(U0){if(U0==="option")s(Y0,U0),G(";");else J(U0),m(Y0,"optional")}),D0.add(Y0)}function Q0(D0,A0){if(!X4.test(A0=X()))throw C(A0,"name");var Y0=new E20(A0);if(n(Y0,function(U0){switch(U0){case"option":s(Y0,U0),G(";");break;case"reserved":if(L(Y0.reserved||(Y0.reserved=[]),!0),Y0.reserved===void 0)Y0.reserved=[];break;default:l(Y0,U0)}}),D0.add(Y0),D0===E)A.push(Y0)}function l(D0,A0){if(!X4.test(A0))throw C(A0,"name");G("=");var Y0=v(X(),!0),G0={options:void 0};G0.getOption=function(U0){return this.options[U0]},G0.setOption=function(U0,R0){P20.prototype.setOption.call(G0,U0,R0)},G0.setParsedOption=function(){return},n(G0,function(R0){if(R0==="option")s(G0,R0),G(";");else throw C(R0)},function(){t(G0)}),D0.add(A0,Y0,G0.comment,G0.parsedOptions||G0.options)}function s(D0,A0){var Y0,G0,U0=!0;if(A0==="option")A0=X();while(A0!=="="){if(A0==="("){var R0=X();G(")"),A0="("+R0+")"}if(U0){if(U0=!1,A0.includes(".")&&!A0.includes("(")){var O0=A0.split(".");Y0=O0[0]+".",A0=O0[1];continue}Y0=A0}else G0=G0?G0+=A0:A0;A0=X()}var I0=G0?Y0.concat(G0):Y0,M0=g(D0,I0);G0=G0&&G0[0]==="."?G0.slice(1):G0,Y0=Y0&&Y0[Y0.length-1]==="."?Y0.slice(0,-1):Y0,a(D0,Y0,M0,G0)}function g(D0,A0){if(G("{",!0)){var Y0={};while(!G("}",!0)){if(!X4.test(P0=X()))throw C(P0,"name");if(P0===null)throw C(P0,"end of input");var G0,U0=P0;if(G(":",!0),Q()==="{")G0=g(D0,A0+"."+P0);else if(Q()==="["){G0=[];var R0;if(G("[",!0)){do R0=w(!0),G0.push(R0);while(G(",",!0));if(G("]"),typeof R0<"u")u(D0,A0+"."+P0,R0)}}else G0=w(!0),u(D0,A0+"."+P0,G0);var O0=Y0[U0];if(O0)G0=[].concat(O0).concat(G0);Y0[U0]=G0,G(",",!0),G(";",!0)}return Y0}var I0=w(!0);return u(D0,A0,I0),I0}function u(D0,A0,Y0){if(E===D0&&/^features\./.test(A0)){N[A0]=Y0;return}if(D0.setOption)D0.setOption(A0,Y0)}function a(D0,A0,Y0,G0){if(D0.setParsedOption)D0.setParsedOption(A0,Y0,G0)}function t(D0){if(G("[",!0)){do s(D0,"option");while(G(",",!0));G("]")}return D0}function J0(D0,A0){if(!X4.test(A0=X()))throw C(A0,"service name");var Y0=new M20(A0);if(n(Y0,function(U0){if(y(Y0,U0))return;if(U0==="rpc")z0(Y0,U0);else throw C(U0)}),D0.add(Y0),D0===E)A.push(Y0)}function z0(D0,A0){var Y0=q(),G0=A0;if(!X4.test(A0=X()))throw C(A0,"name");var U0=A0,R0,O0,I0,M0;if(G("("),G("stream",!0))O0=!0;if(!J4.test(A0=X()))throw C(A0);if(R0=A0,G(")"),G("returns"),G("("),G("stream",!0))M0=!0;if(!J4.test(A0=X()))throw C(A0);I0=A0,G(")");var w0=new R20(U0,G0,R0,I0,O0,M0);w0.comment=Y0,n(w0,function(y0){if(y0==="option")s(w0,y0),G(";");else throw C(y0)}),D0.add(w0)}function N0(D0,A0){if(!J4.test(A0=X()))throw C(A0,"reference");var Y0=A0;n(null,function(U0){switch(U0){case"required":case"repeated":m(D0,U0,Y0);break;case"optional":if(M==="proto3")m(D0,"proto3_optional",Y0);else m(D0,"optional",Y0);break;default:if(M==="proto2"||!J4.test(U0))throw C(U0);J(U0),m(D0,"optional",Y0);break}})}var P0;while((P0=X())!==null)switch(P0){case"package":if(!K)throw C(P0);f();break;case"import":if(!K)throw C(P0);h();break;case"syntax":if(!K)throw C(P0);b();break;case"edition":if(!K)throw C(P0);x();break;case"option":s(E,P0),G(";",!0);break;default:if(y(E,P0)){K=!1;continue}throw C(P0)}return T(),w4.filename=null,{package:V,imports:B,weakImports:I,root:Z}}});var Zi=H0((st0,Yi)=>{Yi.exports=h9;var j20=/\/|\./;function h9(Y,Z){if(!j20.test(Y))Y="google/protobuf/"+Y+".proto",Z={nested:{google:{nested:{protobuf:{nested:Z}}}}};h9[Y]=Z}h9("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var ep;h9("duration",{Duration:ep={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});h9("timestamp",{Timestamp:ep});h9("empty",{Empty:{fields:{}}});h9("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}}}});h9("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}}}});h9("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});h9.get=function(Z){return h9[Z]||null}});var x3=H0((et0,Qi)=>{var U5=Qi.exports=cp();U5.build="full";U5.tokenize=bB();U5.parse=sp();U5.common=Zi();U5.Root._configure(U5.Type,U5.parse,U5.common)});var mB=H0((Ys0,_20)=>{_20.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:[[536000000,536000000]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,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:[[1000,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:[[1000,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:[[536000000,536000000]],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 Hi=H0((p1,Fi)=>{var a8=x3();Fi.exports=p1=a8.descriptor=a8.Root.fromJSON(mB()).lookup(".google.protobuf");var{Namespace:Xi,Root:sQ,Enum:S4,Type:W4,Field:N5,MapField:x20,OneOf:b3,Service:eQ,Method:u3}=a8;sQ.fromDescriptor=function(Z){if(typeof Z.length==="number")Z=p1.FileDescriptorSet.decode(Z);var W=new sQ;if(Z.file){var H,F;for(var X=0,J;X<Z.file.length;++X){if(F=W,(H=Z.file[X]).package&&H.package.length)F=W.define(H.package);var Q=i20(H);if(H.name&&H.name.length)W.files.push(F.filename=H.name);if(H.messageType)for(J=0;J<H.messageType.length;++J)F.add(W4.fromDescriptor(H.messageType[J],Q));if(H.enumType)for(J=0;J<H.enumType.length;++J)F.add(S4.fromDescriptor(H.enumType[J],Q));if(H.extension)for(J=0;J<H.extension.length;++J)F.add(N5.fromDescriptor(H.extension[J],Q));if(H.service)for(J=0;J<H.service.length;++J)F.add(eQ.fromDescriptor(H.service[J],Q));var G=gY(H.options,p1.FileOptions);if(G){var q=Object.keys(G);for(J=0;J<q.length;++J)F.setOption(q[J],G[q[J]])}}}return W.resolveAll()};sQ.prototype.toDescriptor=function(Z){var W=p1.FileDescriptorSet.create();return Ji(this,W.file,Z),W};function Ji(Y,Z,W){var H=p1.FileDescriptorProto.create({name:Y.filename||(Y.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});if(r20(W,H),!(Y instanceof sQ))H.package=Y.fullName.substring(1);for(var F=0,X;F<Y.nestedArray.length;++F)if((X=Y._nestedArray[F])instanceof W4)H.messageType.push(X.toDescriptor(W));else if(X instanceof S4)H.enumType.push(X.toDescriptor());else if(X instanceof N5)H.extension.push(X.toDescriptor(W));else if(X instanceof eQ)H.service.push(X.toDescriptor());else if(X instanceof Xi)Ji(X,Z,W);if(H.options=dY(Y.options,p1.FileOptions),H.messageType.length+H.enumType.length+H.extension.length+H.service.length)Z.push(H)}var b20=0;W4.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.DescriptorProto.decode(Z);var F=new W4(Z.name.length?Z.name:"Type"+b20++,gY(Z.options,p1.MessageOptions)),X;if(!H)F._edition=W;if(Z.oneofDecl)for(X=0;X<Z.oneofDecl.length;++X)F.add(b3.fromDescriptor(Z.oneofDecl[X]));if(Z.field)for(X=0;X<Z.field.length;++X){var J=N5.fromDescriptor(Z.field[X],W,!0);if(F.add(J),Z.field[X].hasOwnProperty("oneofIndex"))F.oneofsArray[Z.field[X].oneofIndex].add(J)}if(Z.extension)for(X=0;X<Z.extension.length;++X)F.add(N5.fromDescriptor(Z.extension[X],W,!0));if(Z.nestedType){for(X=0;X<Z.nestedType.length;++X)if(F.add(W4.fromDescriptor(Z.nestedType[X],W,!0)),Z.nestedType[X].options&&Z.nestedType[X].options.mapEntry)F.setOption("map_entry",!0)}if(Z.enumType)for(X=0;X<Z.enumType.length;++X)F.add(S4.fromDescriptor(Z.enumType[X],W,!0));if(Z.extensionRange&&Z.extensionRange.length){F.extensions=[];for(X=0;X<Z.extensionRange.length;++X)F.extensions.push([Z.extensionRange[X].start,Z.extensionRange[X].end])}if(Z.reservedRange&&Z.reservedRange.length||Z.reservedName&&Z.reservedName.length){if(F.reserved=[],Z.reservedRange)for(X=0;X<Z.reservedRange.length;++X)F.reserved.push([Z.reservedRange[X].start,Z.reservedRange[X].end]);if(Z.reservedName)for(X=0;X<Z.reservedName.length;++X)F.reserved.push(Z.reservedName[X])}return F};W4.prototype.toDescriptor=function(Z){var W=p1.DescriptorProto.create({name:this.name}),H;for(H=0;H<this.fieldsArray.length;++H){var F;if(W.field.push(F=this._fieldsArray[H].toDescriptor(Z)),this._fieldsArray[H]instanceof x20){var X=gB(this._fieldsArray[H].keyType,this._fieldsArray[H].resolvedKeyType,!1),J=gB(this._fieldsArray[H].type,this._fieldsArray[H].resolvedType,!1),Q=J===11||J===14?this._fieldsArray[H].resolvedType&&Gi(this.parent,this._fieldsArray[H].resolvedType)||this._fieldsArray[H].type:void 0;W.nestedType.push(p1.DescriptorProto.create({name:F.typeName,field:[p1.FieldDescriptorProto.create({name:"key",number:1,label:1,type:X}),p1.FieldDescriptorProto.create({name:"value",number:2,label:1,type:J,typeName:Q})],options:p1.MessageOptions.create({mapEntry:!0})}))}}for(H=0;H<this.oneofsArray.length;++H)W.oneofDecl.push(this._oneofsArray[H].toDescriptor());for(H=0;H<this.nestedArray.length;++H)if(this._nestedArray[H]instanceof N5)W.field.push(this._nestedArray[H].toDescriptor(Z));else if(this._nestedArray[H]instanceof W4)W.nestedType.push(this._nestedArray[H].toDescriptor(Z));else if(this._nestedArray[H]instanceof S4)W.enumType.push(this._nestedArray[H].toDescriptor());if(this.extensions)for(H=0;H<this.extensions.length;++H)W.extensionRange.push(p1.DescriptorProto.ExtensionRange.create({start:this.extensions[H][0],end:this.extensions[H][1]}));if(this.reserved)for(H=0;H<this.reserved.length;++H)if(typeof this.reserved[H]==="string")W.reservedName.push(this.reserved[H]);else W.reservedRange.push(p1.DescriptorProto.ReservedRange.create({start:this.reserved[H][0],end:this.reserved[H][1]}));return W.options=dY(this.options,p1.MessageOptions),W};var u20=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;N5.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.DescriptorProto.decode(Z);if(typeof Z.number!=="number")throw Error("missing field id");var F;if(Z.typeName&&Z.typeName.length)F=Z.typeName;else F=l20(Z.type);var X;switch(Z.label){case 1:X=void 0;break;case 2:X="required";break;case 3:X="repeated";break;default:throw Error("illegal label: "+Z.label)}var J=Z.extendee;if(Z.extendee!==void 0)J=J.length?J:void 0;var Q=new N5(Z.name.length?Z.name:"field"+Z.number,Z.number,F,X,J);if(!H)Q._edition=W;if(Q.options=gY(Z.options,p1.FieldOptions),Z.proto3_optional)Q.options.proto3_optional=!0;if(Z.defaultValue&&Z.defaultValue.length){var G=Z.defaultValue;switch(G){case"true":case"TRUE":G=!0;break;case"false":case"FALSE":G=!1;break;default:var q=u20.exec(G);if(q)G=parseInt(G);break}Q.setOption("default",G)}if(n20(Z.type)){if(W==="proto3"){if(Z.options&&!Z.options.packed)Q.setOption("packed",!1)}else if((!W||W==="proto2")&&Z.options&&Z.options.packed)Q.setOption("packed",!0)}return Q};N5.prototype.toDescriptor=function(Z){var W=p1.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)W.type=11,W.typeName=a8.util.ucFirst(this.name),W.label=3;else{switch(W.type=gB(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:W.typeName=this.resolvedType?Gi(this.parent,this.resolvedType):this.type;break}if(this.rule==="repeated")W.label=3;else if(this.required&&Z==="proto2")W.label=2;else W.label=1}if(W.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf){if((W.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof")}if(this.options){if(W.options=dY(this.options,p1.FieldOptions),this.options.default!=null)W.defaultValue=String(this.options.default);if(this.options.proto3_optional)W.proto3_optional=!0}if(Z==="proto3"){if(!this.packed)(W.options||(W.options=p1.FieldOptions.create())).packed=!1}else if((!Z||Z==="proto2")&&this.packed)(W.options||(W.options=p1.FieldOptions.create())).packed=!0;return W};var m20=0;S4.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.EnumDescriptorProto.decode(Z);var F={};if(Z.value)for(var X=0;X<Z.value.length;++X){var J=Z.value[X].name,Q=Z.value[X].number||0;F[J&&J.length?J:"NAME"+Q]=Q}var G=new S4(Z.name&&Z.name.length?Z.name:"Enum"+m20++,F,gY(Z.options,p1.EnumOptions));if(!H)G._edition=W;return G};S4.prototype.toDescriptor=function(){var Z=[];for(var W=0,H=Object.keys(this.values);W<H.length;++W)Z.push(p1.EnumValueDescriptorProto.create({name:H[W],number:this.values[H[W]]}));return p1.EnumDescriptorProto.create({name:this.name,value:Z,options:dY(this.options,p1.EnumOptions)})};var g20=0;b3.fromDescriptor=function(Z){if(typeof Z.length==="number")Z=p1.OneofDescriptorProto.decode(Z);return new b3(Z.name&&Z.name.length?Z.name:"oneof"+g20++)};b3.prototype.toDescriptor=function(){return p1.OneofDescriptorProto.create({name:this.name})};var d20=0;eQ.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.ServiceDescriptorProto.decode(Z);var F=new eQ(Z.name&&Z.name.length?Z.name:"Service"+d20++,gY(Z.options,p1.ServiceOptions));if(!H)F._edition=W;if(Z.method)for(var X=0;X<Z.method.length;++X)F.add(u3.fromDescriptor(Z.method[X]));return F};eQ.prototype.toDescriptor=function(){var Z=[];for(var W=0;W<this.methodsArray.length;++W)Z.push(this._methodsArray[W].toDescriptor());return p1.ServiceDescriptorProto.create({name:this.name,method:Z,options:dY(this.options,p1.ServiceOptions)})};var c20=0;u3.fromDescriptor=function(Z){if(typeof Z.length==="number")Z=p1.MethodDescriptorProto.decode(Z);return new u3(Z.name&&Z.name.length?Z.name:"Method"+c20++,"rpc",Z.inputType,Z.outputType,Boolean(Z.clientStreaming),Boolean(Z.serverStreaming),gY(Z.options,p1.MethodOptions))};u3.prototype.toDescriptor=function(){return p1.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:dY(this.options,p1.MethodOptions)})};function l20(Y){switch(Y){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: "+Y)}function n20(Y){switch(Y){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 gB(Y,Z,W){switch(Y){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(Z instanceof S4)return 14;if(Z instanceof W4)return W?10:11;throw Error("illegal type: "+Y)}function Wi(Y,Z){var W={};for(var H=0,F,X;H<Z.fieldsArray.length;++H){if((X=(F=Z._fieldsArray[H]).name)==="uninterpretedOption")continue;if(!Object.prototype.hasOwnProperty.call(Y,X))continue;var J=p20(X);if(F.resolvedType instanceof W4)W[J]=Wi(Y[X],F.resolvedType);else if(F.resolvedType instanceof S4)W[J]=F.resolvedType.valuesById[Y[X]];else W[J]=Y[X]}return W}function gY(Y,Z){if(!Y)return;return Wi(Z.toObject(Y),Z)}function Ki(Y,Z){var W={},H=Object.keys(Y);for(var F=0;F<H.length;++F){var X=H[F],J=a8.util.camelCase(X);if(!Object.prototype.hasOwnProperty.call(Z.fields,J))continue;var Q=Z.fields[J];if(Q.resolvedType instanceof W4)W[J]=Ki(Y[X],Q.resolvedType);else W[J]=Y[X];if(Q.repeated&&!Array.isArray(W[J]))W[J]=[W[J]]}return W}function dY(Y,Z){if(!Y)return;return Z.fromObject(Ki(Y,Z))}function Gi(Y,Z){var W=Y.fullName.split("."),H=Z.fullName.split("."),F=0,X=0,J=H.length-1;if(!(Y instanceof sQ)&&Z instanceof Xi)while(F<W.length&&X<J&&W[F]===H[X]){var Q=Z.lookup(W[F++],!0);if(Q!==null&&Q!==Z)break;++X}else for(;F<W.length&&X<J&&W[F]===H[X];++F,++X);return H.slice(X).join(".")}function p20(Y){return Y.substring(0,1)+Y.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(Z,W){return"_"+W.toLowerCase()})}function i20(Y){if(Y.syntax==="editions")switch(Y.edition){case p1.Edition.EDITION_2023:return"2023";default:throw Error("Unsupported edition "+Y.edition)}if(Y.syntax==="proto3")return"proto3";return"proto2"}function r20(Y,Z){if(!Y)return;if(Y==="proto2"||Y==="proto3")Z.syntax=Y;else switch(Z.syntax="editions",Y){case"2023":Z.edition=p1.Edition.EDITION_2023;break;default:throw Error("Unsupported edition "+Y)}}});var Vi=H0((Zs0,a20)=>{a20.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 qi=H0((Qs0,o20)=>{o20.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var zi=H0((Xs0,t20)=>{t20.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 Di=H0((Ni)=>{Object.defineProperty(Ni,"__esModule",{value:!0});Ni.addCommonProtos=Ni.loadProtosWithOptionsSync=Ni.loadProtosWithOptions=void 0;var Bi=V1("fs"),Ai=V1("path"),cY=x3();function Ui(Y,Z){let W=Y.resolvePath;Y.resolvePath=(H,F)=>{if(Ai.isAbsolute(F))return F;for(let X of Z){let J=Ai.join(X,F);try{return Bi.accessSync(J,Bi.constants.R_OK),J}catch(Q){continue}}return process.emitWarning(`${F} not found in any of the include paths ${Z}`),W(H,F)}}async function s20(Y,Z){let W=new cY.Root;if(Z=Z||{},Z.includeDirs){if(!Array.isArray(Z.includeDirs))return Promise.reject(Error("The includeDirs option must be an array"));Ui(W,Z.includeDirs)}let H=await W.load(Y,Z);return H.resolveAll(),H}Ni.loadProtosWithOptions=s20;function e20(Y,Z){let W=new cY.Root;if(Z=Z||{},Z.includeDirs){if(!Array.isArray(Z.includeDirs))throw Error("The includeDirs option must be an array");Ui(W,Z.includeDirs)}let H=W.loadSync(Y,Z);return H.resolveAll(),H}Ni.loadProtosWithOptionsSync=e20;function YP0(){let Y=Vi(),Z=mB(),W=qi(),H=zi();cY.common("api",Y.nested.google.nested.protobuf.nested),cY.common("descriptor",Z.nested.google.nested.protobuf.nested),cY.common("source_context",W.nested.google.nested.protobuf.nested),cY.common("type",H.nested.google.nested.protobuf.nested)}Ni.addCommonProtos=YP0});var Ti=H0((YX,dB)=>{(function(Y,Z){function W(H){return H.default||H}if(typeof define==="function"&&define.amd)define([],function(){var H={};return Z(H),W(H)});else if(typeof YX==="object"){if(Z(YX),typeof dB==="object")dB.exports=W(YX)}else(function(){var H={};Z(H),Y.Long=W(H)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:YX,function(Y){Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=void 0;var Z=null;try{Z=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 W(x,y,n){this.low=x|0,this.high=y|0,this.unsigned=!!n}W.prototype.__isLong__,Object.defineProperty(W.prototype,"__isLong__",{value:!0});function H(x){return(x&&x.__isLong__)===!0}function F(x){var y=Math.clz32(x&-x);return x?31-y:y}W.isLong=H;var X={},J={};function Q(x,y){var n,Z0,m;if(y){if(x>>>=0,m=0<=x&&x<256){if(Z0=J[x],Z0)return Z0}if(n=q(x,0,!0),m)J[x]=n;return n}else{if(x|=0,m=-128<=x&&x<128){if(Z0=X[x],Z0)return Z0}if(n=q(x,x<0?-1:0,!1),m)X[x]=n;return n}}W.fromInt=Q;function G(x,y){if(isNaN(x))return y?C:T;if(y){if(x<0)return C;if(x>=A)return v}else{if(x<=-N)return f;if(x+1>=N)return k}if(x<0)return G(-x,y).neg();return q(x%E|0,x/E|0,y)}W.fromNumber=G;function q(x,y,n){return new W(x,y,n)}W.fromBits=q;var K=Math.pow;function V(x,y,n){if(x.length===0)throw Error("empty string");if(typeof y==="number")n=y,y=!1;else y=!!y;if(x==="NaN"||x==="Infinity"||x==="+Infinity"||x==="-Infinity")return y?C:T;if(n=n||10,n<2||36<n)throw RangeError("radix");var Z0;if((Z0=x.indexOf("-"))>0)throw Error("interior hyphen");else if(Z0===0)return V(x.substring(1),y,n).neg();var m=G(K(n,8)),j=T;for(var c=0;c<x.length;c+=8){var p=Math.min(8,x.length-c),Q0=parseInt(x.substring(c,c+p),n);if(p<8){var l=G(K(n,p));j=j.mul(l).add(G(Q0))}else j=j.mul(m),j=j.add(G(Q0))}return j.unsigned=y,j}W.fromString=V;function B(x,y){if(typeof x==="number")return G(x,y);if(typeof x==="string")return V(x,y);return q(x.low,x.high,typeof y==="boolean"?y:x.unsigned)}W.fromValue=B;var I=65536,M=16777216,E=I*I,A=E*E,N=A/2,O=Q(M),T=Q(0);W.ZERO=T;var C=Q(0,!0);W.UZERO=C;var R=Q(1);W.ONE=R;var w=Q(1,!0);W.UONE=w;var L=Q(-1);W.NEG_ONE=L;var k=q(-1,2147483647,!1);W.MAX_VALUE=k;var v=q(-1,-1,!0);W.MAX_UNSIGNED_VALUE=v;var f=q(0,-2147483648,!1);W.MIN_VALUE=f;var h=W.prototype;if(h.toInt=function(){return this.unsigned?this.low>>>0:this.low},h.toNumber=function(){if(this.unsigned)return(this.high>>>0)*E+(this.low>>>0);return this.high*E+(this.low>>>0)},h.toString=function(y){if(y=y||10,y<2||36<y)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(f)){var n=G(y),Z0=this.div(n),m=Z0.mul(n).sub(this);return Z0.toString(y)+m.toInt().toString(y)}else return"-"+this.neg().toString(y);var j=G(K(y,6),this.unsigned),c=this,p="";while(!0){var Q0=c.div(j),l=c.sub(Q0.mul(j)).toInt()>>>0,s=l.toString(y);if(c=Q0,c.isZero())return s+p;else{while(s.length<6)s="0"+s;p=""+s+p}}},h.getHighBits=function(){return this.high},h.getHighBitsUnsigned=function(){return this.high>>>0},h.getLowBits=function(){return this.low},h.getLowBitsUnsigned=function(){return this.low>>>0},h.getNumBitsAbs=function(){if(this.isNegative())return this.eq(f)?64:this.neg().getNumBitsAbs();var y=this.high!=0?this.high:this.low;for(var n=31;n>0;n--)if((y&1<<n)!=0)break;return this.high!=0?n+33:n+1},h.isSafeInteger=function(){var y=this.high>>21;if(!y)return!0;if(this.unsigned)return!1;return y===-1&&!(this.low===0&&this.high===-2097152)},h.isZero=function(){return this.high===0&&this.low===0},h.eqz=h.isZero,h.isNegative=function(){return!this.unsigned&&this.high<0},h.isPositive=function(){return this.unsigned||this.high>=0},h.isOdd=function(){return(this.low&1)===1},h.isEven=function(){return(this.low&1)===0},h.equals=function(y){if(!H(y))y=B(y);if(this.unsigned!==y.unsigned&&this.high>>>31===1&&y.high>>>31===1)return!1;return this.high===y.high&&this.low===y.low},h.eq=h.equals,h.notEquals=function(y){return!this.eq(y)},h.neq=h.notEquals,h.ne=h.notEquals,h.lessThan=function(y){return this.comp(y)<0},h.lt=h.lessThan,h.lessThanOrEqual=function(y){return this.comp(y)<=0},h.lte=h.lessThanOrEqual,h.le=h.lessThanOrEqual,h.greaterThan=function(y){return this.comp(y)>0},h.gt=h.greaterThan,h.greaterThanOrEqual=function(y){return this.comp(y)>=0},h.gte=h.greaterThanOrEqual,h.ge=h.greaterThanOrEqual,h.compare=function(y){if(!H(y))y=B(y);if(this.eq(y))return 0;var n=this.isNegative(),Z0=y.isNegative();if(n&&!Z0)return-1;if(!n&&Z0)return 1;if(!this.unsigned)return this.sub(y).isNegative()?-1:1;return y.high>>>0>this.high>>>0||y.high===this.high&&y.low>>>0>this.low>>>0?-1:1},h.comp=h.compare,h.negate=function(){if(!this.unsigned&&this.eq(f))return f;return this.not().add(R)},h.neg=h.negate,h.add=function(y){if(!H(y))y=B(y);var n=this.high>>>16,Z0=this.high&65535,m=this.low>>>16,j=this.low&65535,c=y.high>>>16,p=y.high&65535,Q0=y.low>>>16,l=y.low&65535,s=0,g=0,u=0,a=0;return a+=j+l,u+=a>>>16,a&=65535,u+=m+Q0,g+=u>>>16,u&=65535,g+=Z0+p,s+=g>>>16,g&=65535,s+=n+c,s&=65535,q(u<<16|a,s<<16|g,this.unsigned)},h.subtract=function(y){if(!H(y))y=B(y);return this.add(y.neg())},h.sub=h.subtract,h.multiply=function(y){if(this.isZero())return this;if(!H(y))y=B(y);if(Z){var n=Z.mul(this.low,this.high,y.low,y.high);return q(n,Z.get_high(),this.unsigned)}if(y.isZero())return this.unsigned?C:T;if(this.eq(f))return y.isOdd()?f:T;if(y.eq(f))return this.isOdd()?f:T;if(this.isNegative())if(y.isNegative())return this.neg().mul(y.neg());else return this.neg().mul(y).neg();else if(y.isNegative())return this.mul(y.neg()).neg();if(this.lt(O)&&y.lt(O))return G(this.toNumber()*y.toNumber(),this.unsigned);var Z0=this.high>>>16,m=this.high&65535,j=this.low>>>16,c=this.low&65535,p=y.high>>>16,Q0=y.high&65535,l=y.low>>>16,s=y.low&65535,g=0,u=0,a=0,t=0;return t+=c*s,a+=t>>>16,t&=65535,a+=j*s,u+=a>>>16,a&=65535,a+=c*l,u+=a>>>16,a&=65535,u+=m*s,g+=u>>>16,u&=65535,u+=j*l,g+=u>>>16,u&=65535,u+=c*Q0,g+=u>>>16,u&=65535,g+=Z0*s+m*l+j*Q0+c*p,g&=65535,q(a<<16|t,g<<16|u,this.unsigned)},h.mul=h.multiply,h.divide=function(y){if(!H(y))y=B(y);if(y.isZero())throw Error("division by zero");if(Z){if(!this.unsigned&&this.high===-2147483648&&y.low===-1&&y.high===-1)return this;var n=(this.unsigned?Z.div_u:Z.div_s)(this.low,this.high,y.low,y.high);return q(n,Z.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?C:T;var Z0,m,j;if(!this.unsigned){if(this.eq(f))if(y.eq(R)||y.eq(L))return f;else if(y.eq(f))return R;else{var c=this.shr(1);if(Z0=c.div(y).shl(1),Z0.eq(T))return y.isNegative()?R:L;else return m=this.sub(y.mul(Z0)),j=Z0.add(m.div(y)),j}else if(y.eq(f))return this.unsigned?C:T;if(this.isNegative()){if(y.isNegative())return this.neg().div(y.neg());return this.neg().div(y).neg()}else if(y.isNegative())return this.div(y.neg()).neg();j=T}else{if(!y.unsigned)y=y.toUnsigned();if(y.gt(this))return C;if(y.gt(this.shru(1)))return w;j=C}m=this;while(m.gte(y)){Z0=Math.max(1,Math.floor(m.toNumber()/y.toNumber()));var p=Math.ceil(Math.log(Z0)/Math.LN2),Q0=p<=48?1:K(2,p-48),l=G(Z0),s=l.mul(y);while(s.isNegative()||s.gt(m))Z0-=Q0,l=G(Z0,this.unsigned),s=l.mul(y);if(l.isZero())l=R;j=j.add(l),m=m.sub(s)}return j},h.div=h.divide,h.modulo=function(y){if(!H(y))y=B(y);if(Z){var n=(this.unsigned?Z.rem_u:Z.rem_s)(this.low,this.high,y.low,y.high);return q(n,Z.get_high(),this.unsigned)}return this.sub(this.div(y).mul(y))},h.mod=h.modulo,h.rem=h.modulo,h.not=function(){return q(~this.low,~this.high,this.unsigned)},h.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},h.clz=h.countLeadingZeros,h.countTrailingZeros=function(){return this.low?F(this.low):F(this.high)+32},h.ctz=h.countTrailingZeros,h.and=function(y){if(!H(y))y=B(y);return q(this.low&y.low,this.high&y.high,this.unsigned)},h.or=function(y){if(!H(y))y=B(y);return q(this.low|y.low,this.high|y.high,this.unsigned)},h.xor=function(y){if(!H(y))y=B(y);return q(this.low^y.low,this.high^y.high,this.unsigned)},h.shiftLeft=function(y){if(H(y))y=y.toInt();if((y&=63)===0)return this;else if(y<32)return q(this.low<<y,this.high<<y|this.low>>>32-y,this.unsigned);else return q(0,this.low<<y-32,this.unsigned)},h.shl=h.shiftLeft,h.shiftRight=function(y){if(H(y))y=y.toInt();if((y&=63)===0)return this;else if(y<32)return q(this.low>>>y|this.high<<32-y,this.high>>y,this.unsigned);else return q(this.high>>y-32,this.high>=0?0:-1,this.unsigned)},h.shr=h.shiftRight,h.shiftRightUnsigned=function(y){if(H(y))y=y.toInt();if((y&=63)===0)return this;if(y<32)return q(this.low>>>y|this.high<<32-y,this.high>>>y,this.unsigned);if(y===32)return q(this.high,0,this.unsigned);return q(this.high>>>y-32,0,this.unsigned)},h.shru=h.shiftRightUnsigned,h.shr_u=h.shiftRightUnsigned,h.rotateLeft=function(y){var n;if(H(y))y=y.toInt();if((y&=63)===0)return this;if(y===32)return q(this.high,this.low,this.unsigned);if(y<32)return n=32-y,q(this.low<<y|this.high>>>n,this.high<<y|this.low>>>n,this.unsigned);return y-=32,n=32-y,q(this.high<<y|this.low>>>n,this.low<<y|this.high>>>n,this.unsigned)},h.rotl=h.rotateLeft,h.rotateRight=function(y){var n;if(H(y))y=y.toInt();if((y&=63)===0)return this;if(y===32)return q(this.high,this.low,this.unsigned);if(y<32)return n=32-y,q(this.high<<n|this.low>>>y,this.low<<n|this.high>>>y,this.unsigned);return y-=32,n=32-y,q(this.low<<n|this.high>>>y,this.high<<n|this.low>>>y,this.unsigned)},h.rotr=h.rotateRight,h.toSigned=function(){if(!this.unsigned)return this;return q(this.low,this.high,!1)},h.toUnsigned=function(){if(this.unsigned)return this;return q(this.low,this.high,!0)},h.toBytes=function(y){return y?this.toBytesLE():this.toBytesBE()},h.toBytesLE=function(){var y=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,y&255,y>>>8&255,y>>>16&255,y>>>24]},h.toBytesBE=function(){var y=this.high,n=this.low;return[y>>>24,y>>>16&255,y>>>8&255,y&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},W.fromBytes=function(y,n,Z0){return Z0?W.fromBytesLE(y,n):W.fromBytesBE(y,n)},W.fromBytesLE=function(y,n){return new W(y[0]|y[1]<<8|y[2]<<16|y[3]<<24,y[4]|y[5]<<8|y[6]<<16|y[7]<<24,n)},W.fromBytesBE=function(y,n){return new W(y[4]<<24|y[5]<<16|y[6]<<8|y[7],y[0]<<24|y[1]<<16|y[2]<<8|y[3],n)},typeof BigInt==="function")W.fromBigInt=function(y,n){var Z0=Number(BigInt.asIntN(32,y)),m=Number(BigInt.asIntN(32,y>>BigInt(32)));return q(Z0,m,n)},W.fromValue=function(y,n){if(typeof y==="bigint")return W.fromBigInt(y,n);return B(y,n)},h.toBigInt=function(){var y=BigInt(this.low>>>0),n=BigInt(this.unsigned?this.high>>>0:this.high);return n<<BigInt(32)|y};var b=Y.default=W})});var ZX=H0((Ri)=>{Object.defineProperty(Ri,"__esModule",{value:!0});Ri.loadFileDescriptorSetFromObject=Ri.loadFileDescriptorSetFromBuffer=Ri.fromJSON=Ri.loadSync=Ri.load=Ri.IdempotencyLevel=Ri.isAnyExtension=Ri.Long=void 0;var XP0=Qp(),K4=x3(),pB=Hi(),iB=Di(),JP0=Ti();Ri.Long=JP0;function WP0(Y){return"@type"in Y&&typeof Y["@type"]==="string"}Ri.isAnyExtension=WP0;var $i;(function(Y){Y.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",Y.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",Y.IDEMPOTENT="IDEMPOTENT"})($i=Ri.IdempotencyLevel||(Ri.IdempotencyLevel={}));var Ci={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function KP0(Y,Z){if(Y==="")return Z;else return Y+"."+Z}function GP0(Y){return Y instanceof K4.Service||Y instanceof K4.Type||Y instanceof K4.Enum}function FP0(Y){return Y instanceof K4.Namespace||Y instanceof K4.Root}function Ei(Y,Z){let W=KP0(Z,Y.name);if(GP0(Y))return[[W,Y]];else if(FP0(Y)&&typeof Y.nested<"u")return Object.keys(Y.nested).map((H)=>{return Ei(Y.nested[H],W)}).reduce((H,F)=>H.concat(F),[]);return[]}function cB(Y,Z){return function(H){return Y.toObject(Y.decode(H),Z)}}function lB(Y){return function(W){if(Array.isArray(W))throw Error(`Failed to serialize message: expected object with ${Y.name} structure, got array instead`);let H=Y.fromObject(W);return Y.encode(H).finish()}}function HP0(Y){return(Y||[]).reduce((Z,W)=>{for(let[H,F]of Object.entries(W))switch(H){case"uninterpreted_option":Z.uninterpreted_option.push(W.uninterpreted_option);break;default:Z[H]=F}return Z},{deprecated:!1,idempotency_level:$i.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function VP0(Y,Z,W,H){let{resolvedRequestType:F,resolvedResponseType:X}=Y;return{path:"/"+Z+"/"+Y.name,requestStream:!!Y.requestStream,responseStream:!!Y.responseStream,requestSerialize:lB(F),requestDeserialize:cB(F,W),responseSerialize:lB(X),responseDeserialize:cB(X,W),originalName:XP0(Y.name),requestType:nB(F,W,H),responseType:nB(X,W,H),options:HP0(Y.parsedOptions)}}function qP0(Y,Z,W,H){let F={};for(let X of Y.methodsArray)F[X.name]=VP0(X,Z,W,H);return F}function nB(Y,Z,W){let H=Y.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:H.$type.toObject(H,Ci),fileDescriptorProtos:W,serialize:lB(Y),deserialize:cB(Y,Z)}}function zP0(Y,Z){let W=Y.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:W.$type.toObject(W,Ci),fileDescriptorProtos:Z}}function BP0(Y,Z,W,H){if(Y instanceof K4.Service)return qP0(Y,Z,W,H);else if(Y instanceof K4.Type)return nB(Y,W,H);else if(Y instanceof K4.Enum)return zP0(Y,H);else throw Error("Type mismatch in reflection object handling")}function m3(Y,Z){let W={};Y.resolveAll();let F=Y.toDescriptor("proto3").file.map((X)=>Buffer.from(pB.FileDescriptorProto.encode(X).finish()));for(let[X,J]of Ei(Y,""))W[X]=BP0(J,X,Z,F);return W}function Mi(Y,Z){Z=Z||{};let W=K4.Root.fromDescriptor(Y);return W.resolveAll(),m3(W,Z)}function AP0(Y,Z){return(0,iB.loadProtosWithOptions)(Y,Z).then((W)=>{return m3(W,Z)})}Ri.load=AP0;function UP0(Y,Z){let W=(0,iB.loadProtosWithOptionsSync)(Y,Z);return m3(W,Z)}Ri.loadSync=UP0;function NP0(Y,Z){Z=Z||{};let W=K4.Root.fromJSON(Y);return W.resolveAll(),m3(W,Z)}Ri.fromJSON=NP0;function OP0(Y,Z){let W=pB.FileDescriptorSet.decode(Y);return Mi(W,Z)}Ri.loadFileDescriptorSetFromBuffer=OP0;function DP0(Y,Z){let W=pB.FileDescriptorSet.fromObject(Y);return Mi(W,Z)}Ri.loadFileDescriptorSetFromObject=DP0;(0,iB.addCommonProtos)()});var O5=H0((mi)=>{var __dirname="/Users/beatrix/dev/cline-packages/node_modules/.bun/@grpc+grpc-js@1.14.3/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(mi,"__esModule",{value:!0});mi.registerChannelzSocket=mi.registerChannelzServer=mi.registerChannelzSubchannel=mi.registerChannelzChannel=mi.ChannelzCallTrackerStub=mi.ChannelzCallTracker=mi.ChannelzChildrenTrackerStub=mi.ChannelzChildrenTracker=mi.ChannelzTrace=mi.ChannelzTraceStub=void 0;mi.unregisterChannelzRef=SP0;mi.getChannelzHandlers=bi;mi.getChannelzServiceDefinition=ui;mi.setup=mP0;var d3=V1("net"),$7=Xn(),QX=k8(),XX=a1(),RP0=u8(),PP0=A3(),LP0=N3();function rB(Y){return{channel_id:Y.id,name:Y.name}}function aB(Y){return{subchannel_id:Y.id,name:Y.name}}function wP0(Y){return{server_id:Y.id}}function c3(Y){return{socket_id:Y.id,name:Y.name}}var Li=32,oB=100;class ki{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:G4(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}}mi.ChannelzTraceStub=ki;class yi{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(Y,Z,W){let H=new Date;if(this.events.push({description:Z,severity:Y,timestamp:H,childChannel:(W===null||W===void 0?void 0:W.kind)==="channel"?W:void 0,childSubchannel:(W===null||W===void 0?void 0:W.kind)==="subchannel"?W:void 0}),this.events.length>=Li*2)this.events=this.events.slice(Li);this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:G4(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map((Y)=>{return{description:Y.description,severity:Y.severity,timestamp:G4(Y.timestamp),channel_ref:Y.childChannel?rB(Y.childChannel):null,subchannel_ref:Y.childSubchannel?aB(Y.childSubchannel):null}})}}}mi.ChannelzTrace=yi;class tB{constructor(){this.channelChildren=new $7.OrderedMap,this.subchannelChildren=new $7.OrderedMap,this.socketChildren=new $7.OrderedMap,this.trackerMap={["channel"]:this.channelChildren,["subchannel"]:this.subchannelChildren,["socket"]:this.socketChildren}}refChild(Y){let Z=this.trackerMap[Y.kind],W=Z.find(Y.id);if(W.equals(Z.end()))Z.setElement(Y.id,{ref:Y,count:1},W);else W.pointer[1].count+=1}unrefChild(Y){let Z=this.trackerMap[Y.kind],W=Z.getElementByKey(Y.id);if(W!==void 0){if(W.count-=1,W.count===0)Z.eraseElementByKey(Y.id)}}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}}mi.ChannelzChildrenTracker=tB;class vi extends tB{refChild(){}unrefChild(){}}mi.ChannelzChildrenTrackerStub=vi;class sB{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}}mi.ChannelzCallTracker=sB;class hi extends sB{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}}mi.ChannelzCallTrackerStub=hi;var f4={["channel"]:new $7.OrderedMap,["subchannel"]:new $7.OrderedMap,["server"]:new $7.OrderedMap,["socket"]:new $7.OrderedMap},l3=(Y)=>{let Z=1;function W(){return Z++}let H=f4[Y];return(F,X,J)=>{let Q=W(),G={id:Q,name:F,kind:Y};if(J)H.setElement(Q,{ref:G,getInfo:X});return G}};mi.registerChannelzChannel=l3("channel");mi.registerChannelzSubchannel=l3("subchannel");mi.registerChannelzServer=l3("server");mi.registerChannelzSocket=l3("socket");function SP0(Y){f4[Y.kind].eraseElementByKey(Y.id)}function fP0(Y){let Z=Number.parseInt(Y,16);return[Z/256|0,Z%256]}function wi(Y){if(Y==="")return[];let Z=Y.split(":").map((H)=>fP0(H));return[].concat(...Z)}function kP0(Y){return(0,d3.isIPv6)(Y)&&Y.toLowerCase().startsWith("::ffff:")&&(0,d3.isIPv4)(Y.substring(7))}function Si(Y){return Buffer.from(Uint8Array.from(Y.split(".").map((Z)=>Number.parseInt(Z))))}function yP0(Y){if((0,d3.isIPv4)(Y))return Si(Y);else if(kP0(Y))return Si(Y.substring(7));else if((0,d3.isIPv6)(Y)){let Z,W,H=Y.indexOf("::");if(H===-1)Z=Y,W="";else Z=Y.substring(0,H),W=Y.substring(H+2);let F=Buffer.from(wi(Z)),X=Buffer.from(wi(W)),J=Buffer.alloc(16-F.length-X.length,0);return Buffer.concat([F,J,X])}else return null}function ji(Y){switch(Y){case QX.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case QX.ConnectivityState.IDLE:return{state:"IDLE"};case QX.ConnectivityState.READY:return{state:"READY"};case QX.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case QX.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function G4(Y){if(!Y)return null;let Z=Y.getTime();return{seconds:Z/1000|0,nanos:Z%1000*1e6}}function _i(Y){let Z=Y.getInfo(),W=[],H=[];return Z.children.channels.forEach((F)=>{W.push(rB(F[1].ref))}),Z.children.subchannels.forEach((F)=>{H.push(aB(F[1].ref))}),{ref:rB(Y.ref),data:{target:Z.target,state:ji(Z.state),calls_started:Z.callTracker.callsStarted,calls_succeeded:Z.callTracker.callsSucceeded,calls_failed:Z.callTracker.callsFailed,last_call_started_timestamp:G4(Z.callTracker.lastCallStartedTimestamp),trace:Z.trace.getTraceMessage()},channel_ref:W,subchannel_ref:H}}function vP0(Y,Z){let W=parseInt(Y.request.channel_id,10),H=f4.channel.getElementByKey(W);if(H===void 0){Z({code:XX.Status.NOT_FOUND,details:"No channel data found for id "+W});return}Z(null,{channel:_i(H)})}function hP0(Y,Z){let W=parseInt(Y.request.max_results,10)||oB,H=[],F=parseInt(Y.request.start_channel_id,10),X=f4.channel,J;for(J=X.lowerBound(F);!J.equals(X.end())&&H.length<W;J=J.next())H.push(_i(J.pointer[1]));Z(null,{channel:H,end:J.equals(X.end())})}function xi(Y){let Z=Y.getInfo(),W=[];return Z.listenerChildren.sockets.forEach((H)=>{W.push(c3(H[1].ref))}),{ref:wP0(Y.ref),data:{calls_started:Z.callTracker.callsStarted,calls_succeeded:Z.callTracker.callsSucceeded,calls_failed:Z.callTracker.callsFailed,last_call_started_timestamp:G4(Z.callTracker.lastCallStartedTimestamp),trace:Z.trace.getTraceMessage()},listen_socket:W}}function jP0(Y,Z){let W=parseInt(Y.request.server_id,10),F=f4.server.getElementByKey(W);if(F===void 0){Z({code:XX.Status.NOT_FOUND,details:"No server data found for id "+W});return}Z(null,{server:xi(F)})}function _P0(Y,Z){let W=parseInt(Y.request.max_results,10)||oB,H=parseInt(Y.request.start_server_id,10),F=f4.server,X=[],J;for(J=F.lowerBound(H);!J.equals(F.end())&&X.length<W;J=J.next())X.push(xi(J.pointer[1]));Z(null,{server:X,end:J.equals(F.end())})}function xP0(Y,Z){let W=parseInt(Y.request.subchannel_id,10),H=f4.subchannel.getElementByKey(W);if(H===void 0){Z({code:XX.Status.NOT_FOUND,details:"No subchannel data found for id "+W});return}let F=H.getInfo(),X=[];F.children.sockets.forEach((Q)=>{X.push(c3(Q[1].ref))});let J={ref:aB(H.ref),data:{target:F.target,state:ji(F.state),calls_started:F.callTracker.callsStarted,calls_succeeded:F.callTracker.callsSucceeded,calls_failed:F.callTracker.callsFailed,last_call_started_timestamp:G4(F.callTracker.lastCallStartedTimestamp),trace:F.trace.getTraceMessage()},socket_ref:X};Z(null,{subchannel:J})}function fi(Y){var Z;if((0,RP0.isTcpSubchannelAddress)(Y))return{address:"tcpip_address",tcpip_address:{ip_address:(Z=yP0(Y.host))!==null&&Z!==void 0?Z:void 0,port:Y.port}};else return{address:"uds_address",uds_address:{filename:Y.path}}}function bP0(Y,Z){var W,H,F,X,J;let Q=parseInt(Y.request.socket_id,10),G=f4.socket.getElementByKey(Q);if(G===void 0){Z({code:XX.Status.NOT_FOUND,details:"No socket data found for id "+Q});return}let q=G.getInfo(),K=q.security?{model:"tls",tls:{cipher_suite:q.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(W=q.security.cipherSuiteStandardName)!==null&&W!==void 0?W:void 0,other_name:(H=q.security.cipherSuiteOtherName)!==null&&H!==void 0?H:void 0,local_certificate:(F=q.security.localCertificate)!==null&&F!==void 0?F:void 0,remote_certificate:(X=q.security.remoteCertificate)!==null&&X!==void 0?X:void 0}}:null,V={ref:c3(G.ref),local:q.localAddress?fi(q.localAddress):null,remote:q.remoteAddress?fi(q.remoteAddress):null,remote_name:(J=q.remoteName)!==null&&J!==void 0?J:void 0,security:K,data:{keep_alives_sent:q.keepAlivesSent,streams_started:q.streamsStarted,streams_succeeded:q.streamsSucceeded,streams_failed:q.streamsFailed,last_local_stream_created_timestamp:G4(q.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:G4(q.lastRemoteStreamCreatedTimestamp),messages_received:q.messagesReceived,messages_sent:q.messagesSent,last_message_received_timestamp:G4(q.lastMessageReceivedTimestamp),last_message_sent_timestamp:G4(q.lastMessageSentTimestamp),local_flow_control_window:q.localFlowControlWindow?{value:q.localFlowControlWindow}:null,remote_flow_control_window:q.remoteFlowControlWindow?{value:q.remoteFlowControlWindow}:null}};Z(null,{socket:V})}function uP0(Y,Z){let W=parseInt(Y.request.server_id,10),H=f4.server.getElementByKey(W);if(H===void 0){Z({code:XX.Status.NOT_FOUND,details:"No server data found for id "+W});return}let F=parseInt(Y.request.start_socket_id,10),X=parseInt(Y.request.max_results,10)||oB,Q=H.getInfo().sessionChildren.sockets,G=[],q;for(q=Q.lowerBound(F);!q.equals(Q.end())&&G.length<X;q=q.next())G.push(c3(q.pointer[1].ref));Z(null,{socket_ref:G,end:q.equals(Q.end())})}function bi(){return{GetChannel:vP0,GetTopChannels:hP0,GetServer:jP0,GetServers:_P0,GetSubchannel:xP0,GetSocket:bP0,GetServerSockets:uP0}}var g3=null;function ui(){if(g3)return g3;let Y=ZX().loadSync,Z=Y("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return g3=(0,LP0.loadPackageDefinition)(Z).grpc.channelz.v1.Channelz.service,g3}function mP0(){(0,PP0.registerAdminService)(ui,bi)}});var n3=H0((di)=>{Object.defineProperty(di,"__esModule",{value:!0});di.getNextCallNumber=ZL0;var YL0=0;function ZL0(){return YL0++}});var eB=H0((li)=>{Object.defineProperty(li,"__esModule",{value:!0});li.CompressionAlgorithms=void 0;var ci;(function(Y){Y[Y.identity=0]="identity",Y[Y.deflate=1]="deflate",Y[Y.gzip=2]="gzip"})(ci||(li.CompressionAlgorithms=ci={}))});var YA=H0((ii)=>{Object.defineProperty(ii,"__esModule",{value:!0});ii.BaseFilter=void 0;class pi{async sendMetadata(Y){return Y}receiveMetadata(Y){return Y}async sendMessage(Y){return Y}async receiveMessage(Y){return Y}receiveTrailers(Y){return Y}}ii.BaseFilter=pi});var QA=H0((Zr)=>{Object.defineProperty(Zr,"__esModule",{value:!0});Zr.CompressionFilterFactory=Zr.CompressionFilter=void 0;var p3=V1("zlib"),oi=eB(),lY=a1(),XL0=YA(),JL0=M6(),WL0=(Y)=>{return typeof Y==="number"&&typeof oi.CompressionAlgorithms[Y]==="string"};class JX{async writeMessage(Y,Z){let W=Y;if(Z)W=await this.compressMessage(W);let H=Buffer.allocUnsafe(W.length+5);return H.writeUInt8(Z?1:0,0),H.writeUInt32BE(W.length,1),W.copy(H,5),H}async readMessage(Y){let Z=Y.readUInt8(0)===1,W=Y.slice(5);if(Z)W=await this.decompressMessage(W);return W}}class nY extends JX{async compressMessage(Y){return Y}async writeMessage(Y,Z){let W=Buffer.allocUnsafe(Y.length+5);return W.writeUInt8(0,0),W.writeUInt32BE(Y.length,1),Y.copy(W,5),W}decompressMessage(Y){return Promise.reject(Error('Received compressed message but "grpc-encoding" header was identity'))}}class ti extends JX{constructor(Y){super();this.maxRecvMessageLength=Y}compressMessage(Y){return new Promise((Z,W)=>{p3.deflate(Y,(H,F)=>{if(H)W(H);else Z(F)})})}decompressMessage(Y){return new Promise((Z,W)=>{let H=0,F=[],X=p3.createInflate();X.on("data",(J)=>{if(F.push(J),H+=J.byteLength,this.maxRecvMessageLength!==-1&&H>this.maxRecvMessageLength)X.destroy(),W({code:lY.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),X.on("end",()=>{Z(Buffer.concat(F))}),X.write(Y),X.end()})}}class si extends JX{constructor(Y){super();this.maxRecvMessageLength=Y}compressMessage(Y){return new Promise((Z,W)=>{p3.gzip(Y,(H,F)=>{if(H)W(H);else Z(F)})})}decompressMessage(Y){return new Promise((Z,W)=>{let H=0,F=[],X=p3.createGunzip();X.on("data",(J)=>{if(F.push(J),H+=J.byteLength,this.maxRecvMessageLength!==-1&&H>this.maxRecvMessageLength)X.destroy(),W({code:lY.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),X.on("end",()=>{Z(Buffer.concat(F))}),X.write(Y),X.end()})}}class ei extends JX{constructor(Y){super();this.compressionName=Y}compressMessage(Y){return Promise.reject(Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(Y){return Promise.reject(Error(`Compression method not supported: ${this.compressionName}`))}}function ai(Y,Z){switch(Y){case"identity":return new nY;case"deflate":return new ti(Z);case"gzip":return new si(Z);default:return new ei(Y)}}class ZA extends XL0.BaseFilter{constructor(Y,Z){var W,H,F;super();this.sharedFilterConfig=Z,this.sendCompression=new nY,this.receiveCompression=new nY,this.currentCompressionAlgorithm="identity";let X=Y["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(W=Y["grpc.max_receive_message_length"])!==null&&W!==void 0?W:lY.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(H=Y["grpc.max_send_message_length"])!==null&&H!==void 0?H:lY.DEFAULT_MAX_SEND_MESSAGE_LENGTH,X!==void 0)if(WL0(X)){let J=oi.CompressionAlgorithms[X],Q=(F=Z.serverSupportedEncodingHeader)===null||F===void 0?void 0:F.split(",");if(!Q||Q.includes(J))this.currentCompressionAlgorithm=J,this.sendCompression=ai(this.currentCompressionAlgorithm,-1)}else JL0.log(lY.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${X}`)}async sendMetadata(Y){let Z=await Y;if(Z.set("grpc-accept-encoding","identity,deflate,gzip"),Z.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity")Z.remove("grpc-encoding");else Z.set("grpc-encoding",this.currentCompressionAlgorithm);return Z}receiveMetadata(Y){let Z=Y.get("grpc-encoding");if(Z.length>0){let H=Z[0];if(typeof H==="string")this.receiveCompression=ai(H,this.maxReceiveMessageLength)}Y.remove("grpc-encoding");let W=Y.get("grpc-accept-encoding")[0];if(W){if(this.sharedFilterConfig.serverSupportedEncodingHeader=W,!W.split(",").includes(this.currentCompressionAlgorithm))this.sendCompression=new nY,this.currentCompressionAlgorithm="identity"}return Y.remove("grpc-accept-encoding"),Y}async sendMessage(Y){var Z;let W=await Y;if(this.maxSendMessageLength!==-1&&W.message.length>this.maxSendMessageLength)throw{code:lY.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let H;if(this.sendCompression instanceof nY)H=!1;else H=(((Z=W.flags)!==null&&Z!==void 0?Z:0)&2)===0;return{message:await this.sendCompression.writeMessage(W.message,H),flags:W.flags}}async receiveMessage(Y){return this.receiveCompression.readMessage(await Y)}}Zr.CompressionFilter=ZA;class Yr{constructor(Y,Z){this.options=Z,this.sharedFilterConfig={}}createFilter(){return new ZA(this.options,this.sharedFilterConfig)}}Zr.CompressionFilterFactory=Yr});var WX=H0((Xr)=>{Object.defineProperty(Xr,"__esModule",{value:!0});Xr.restrictControlPlaneStatusCode=FL0;var F4=a1(),GL0=[F4.Status.OK,F4.Status.INVALID_ARGUMENT,F4.Status.NOT_FOUND,F4.Status.ALREADY_EXISTS,F4.Status.FAILED_PRECONDITION,F4.Status.ABORTED,F4.Status.OUT_OF_RANGE,F4.Status.DATA_LOSS];function FL0(Y,Z){if(GL0.includes(Y))return{code:F4.Status.INTERNAL,details:`Invalid status from control plane: ${Y} ${F4.Status[Y]} ${Z}`};else return{code:Y,details:Z}}});var pY=H0((Jr)=>{Object.defineProperty(Jr,"__esModule",{value:!0});Jr.minDeadline=VL0;Jr.getDeadlineTimeoutString=zL0;Jr.getRelativeTimeout=AL0;Jr.deadlineToString=UL0;Jr.formatDateDifference=NL0;function VL0(...Y){let Z=1/0;for(let W of Y){let H=W instanceof Date?W.getTime():W;if(H<Z)Z=H}return Z}var qL0=[["m",1],["S",1000],["M",60000],["H",3600000]];function zL0(Y){let Z=new Date().getTime();if(Y instanceof Date)Y=Y.getTime();let W=Math.max(Y-Z,0);for(let[H,F]of qL0){let X=W/F;if(X<1e8)return String(Math.ceil(X))+H}throw Error("Deadline is too far in the future")}var BL0=2147483647;function AL0(Y){let Z=Y instanceof Date?Y.getTime():Y,W=new Date().getTime(),H=Z-W;if(H<0)return 0;else if(H>BL0)return 1/0;else return H}function UL0(Y){if(Y instanceof Date)return Y.toISOString();else{let Z=new Date(Y);if(Number.isNaN(Z.getTime()))return""+Y;else return Z.toISOString()}}function NL0(Y,Z){return((Z.getTime()-Y.getTime())/1000).toFixed(3)+"s"}});var i3=H0((Wr)=>{Object.defineProperty(Wr,"__esModule",{value:!0});Wr.FilterStackFactory=Wr.FilterStack=void 0;class XA{constructor(Y){this.filters=Y}sendMetadata(Y){let Z=Y;for(let W=0;W<this.filters.length;W++)Z=this.filters[W].sendMetadata(Z);return Z}receiveMetadata(Y){let Z=Y;for(let W=this.filters.length-1;W>=0;W--)Z=this.filters[W].receiveMetadata(Z);return Z}sendMessage(Y){let Z=Y;for(let W=0;W<this.filters.length;W++)Z=this.filters[W].sendMessage(Z);return Z}receiveMessage(Y){let Z=Y;for(let W=this.filters.length-1;W>=0;W--)Z=this.filters[W].receiveMessage(Z);return Z}receiveTrailers(Y){let Z=Y;for(let W=this.filters.length-1;W>=0;W--)Z=this.filters[W].receiveTrailers(Z);return Z}push(Y){this.filters.unshift(...Y)}getFilters(){return this.filters}}Wr.FilterStack=XA;class JA{constructor(Y){this.factories=Y}push(Y){this.factories.unshift(...Y)}clone(){return new JA([...this.factories])}createFilter(){return new XA(this.factories.map((Y)=>Y.createFilter()))}}Wr.FilterStackFactory=JA});var qr=H0((Hr)=>{Object.defineProperty(Hr,"__esModule",{value:!0});Hr.SingleSubchannelChannel=void 0;var EL0=n3(),KX=O5(),ML0=QA(),RL0=k8(),GX=a1(),PL0=WX(),LL0=pY(),wL0=i3(),WA=K8(),SL0=S9(),r3=f8();class Gr{constructor(Y,Z,W,H,F){var X,J;this.subchannel=Y,this.method=Z,this.options=H,this.callNumber=F,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let Q=this.method.split("/"),G="";if(Q.length>=2)G=Q[1];let q=(J=(X=(0,r3.splitHostPort)(this.options.host))===null||X===void 0?void 0:X.host)!==null&&J!==void 0?J:"localhost";this.serviceUrl=`https://${q}/${G}`;let K=(0,LL0.getRelativeTimeout)(H.deadline);if(K!==1/0)if(K<=0)this.cancelWithStatus(GX.Status.DEADLINE_EXCEEDED,"Deadline exceeded");else setTimeout(()=>{this.cancelWithStatus(GX.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},K);this.filterStack=W.createFilter()}cancelWithStatus(Y,Z){if(this.childCall)this.childCall.cancelWithStatus(Y,Z);else this.pendingStatus={code:Y,details:Z,metadata:new WA.Metadata}}getPeer(){var Y,Z;return(Z=(Y=this.childCall)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:this.subchannel.getAddress()}async start(Y,Z){if(this.pendingStatus){Z.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==RL0.ConnectivityState.READY){Z.onReceiveStatus({code:GX.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new WA.Metadata});return}let W=await this.filterStack.sendMetadata(Promise.resolve(Y)),H;try{H=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(X){let J=X,{code:Q,details:G}=(0,PL0.restrictControlPlaneStatusCode)(typeof J.code==="number"?J.code:GX.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${J.message}`);Z.onReceiveStatus({code:Q,details:G,metadata:new WA.Metadata});return}H.merge(W);let F={onReceiveMetadata:async(X)=>{Z.onReceiveMetadata(await this.filterStack.receiveMetadata(X))},onReceiveMessage:async(X)=>{this.readFilterPending=!0;let J=await this.filterStack.receiveMessage(X);if(this.readFilterPending=!1,Z.onReceiveMessage(J),this.pendingStatus)Z.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async(X)=>{let J=await this.filterStack.receiveTrailers(X);if(this.readFilterPending)this.pendingStatus=J;else Z.onReceiveStatus(J)}};if(this.childCall=this.subchannel.createCall(H,this.options.host,this.method,F),this.readPending)this.childCall.startRead();if(this.pendingMessage)this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message);if(this.halfClosePending&&!this.writeFilterPending)this.childCall.halfClose()}async sendMessageWithContext(Y,Z){this.writeFilterPending=!0;let W=await this.filterStack.sendMessage(Promise.resolve({message:Z,flags:Y.flags}));if(this.writeFilterPending=!1,this.childCall){if(this.childCall.sendMessageWithContext(Y,W.message),this.halfClosePending)this.childCall.halfClose()}else this.pendingMessage={context:Y,message:W.message}}startRead(){if(this.childCall)this.childCall.startRead();else this.readPending=!0}halfClose(){if(this.childCall&&!this.writeFilterPending)this.childCall.halfClose();else this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(Y){throw Error("Method not implemented.")}getAuthContext(){if(this.childCall)return this.childCall.getAuthContext();else return null}}class Fr{constructor(Y,Z,W){if(this.subchannel=Y,this.target=Z,this.channelzEnabled=!1,this.channelzTrace=new KX.ChannelzTrace,this.callTracker=new KX.ChannelzCallTracker,this.childrenTracker=new KX.ChannelzChildrenTracker,this.channelzEnabled=W["grpc.enable_channelz"]!==0,this.channelzRef=(0,KX.registerChannelzChannel)((0,r3.uriToString)(Z),()=>({target:`${(0,r3.uriToString)(Z)} (${Y.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled)this.childrenTracker.refChild(Y.getChannelzRef());this.filterStackFactory=new wL0.FilterStackFactory([new ML0.CompressionFilterFactory(this,W)])}close(){if(this.channelzEnabled)this.childrenTracker.unrefChild(this.subchannel.getChannelzRef());(0,KX.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,r3.uriToString)(this.target)}getConnectivityState(Y){throw Error("Method not implemented.")}watchConnectivityState(Y,Z,W){throw Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(Y,Z){let W={deadline:Z,host:(0,SL0.getDefaultAuthority)(this.target),flags:GX.Propagate.DEFAULTS,parentCall:null};return new Gr(this.subchannel,Y,this.filterStackFactory,W,(0,EL0.getNextCallNumber)())}}Hr.SingleSubchannelChannel=Fr});var Ur=H0((Br)=>{Object.defineProperty(Br,"__esModule",{value:!0});Br.Subchannel=void 0;var T6=k8(),fL0=yY(),KA=M6(),a3=a1(),kL0=f8(),yL0=u8(),H4=O5(),vL0=qr(),hL0="subchannel",jL0=2147483647;class zr{constructor(Y,Z,W,H,F){var X;this.channelTarget=Y,this.subchannelAddress=Z,this.options=W,this.connector=F,this.connectivityState=T6.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 J={initialDelay:W["grpc.initial_reconnect_backoff_ms"],maxDelay:W["grpc.max_reconnect_backoff_ms"]};if(this.backoffTimeout=new fL0.BackoffTimeout(()=>{this.handleBackoffTimer()},J),this.backoffTimeout.unref(),this.subchannelAddressString=(0,yL0.subchannelAddressToString)(Z),this.keepaliveTime=(X=W["grpc.keepalive_time_ms"])!==null&&X!==void 0?X:-1,W["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new H4.ChannelzTraceStub,this.callTracker=new H4.ChannelzCallTrackerStub,this.childrenTracker=new H4.ChannelzChildrenTrackerStub,this.streamTracker=new H4.ChannelzCallTrackerStub;else this.channelzTrace=new H4.ChannelzTrace,this.callTracker=new H4.ChannelzCallTracker,this.childrenTracker=new H4.ChannelzChildrenTracker,this.streamTracker=new H4.ChannelzCallTracker;this.channelzRef=(0,H4.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(W,void 0,2)),this.secureConnector=H._createSecureConnector(Y,W)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(Y){KA.trace(a3.LogVerbosity.DEBUG,hL0,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}refTrace(Y){KA.trace(a3.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}handleBackoffTimer(){if(this.continueConnecting)this.transitionToState([T6.ConnectivityState.TRANSIENT_FAILURE],T6.ConnectivityState.CONNECTING);else this.transitionToState([T6.ConnectivityState.TRANSIENT_FAILURE],T6.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let Y=this.options;if(Y["grpc.keepalive_time_ms"]){let Z=Math.min(this.keepaliveTime,jL0);Y=Object.assign(Object.assign({},Y),{"grpc.keepalive_time_ms":Z})}this.connector.connect(this.subchannelAddress,this.secureConnector,Y).then((Z)=>{if(this.transitionToState([T6.ConnectivityState.CONNECTING],T6.ConnectivityState.READY)){if(this.transport=Z,this.channelzEnabled)this.childrenTracker.refChild(Z.getChannelzRef());Z.addDisconnectListener((W)=>{if(this.transitionToState([T6.ConnectivityState.READY],T6.ConnectivityState.IDLE),W&&this.keepaliveTime>0)this.keepaliveTime*=2,KA.log(a3.LogVerbosity.ERROR,`Connection to ${(0,kL0.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`)})}else Z.shutdown()},(Z)=>{this.transitionToState([T6.ConnectivityState.CONNECTING],T6.ConnectivityState.TRANSIENT_FAILURE,`${Z}`)})}transitionToState(Y,Z,W){var H,F;if(Y.indexOf(this.connectivityState)===-1)return!1;if(W)this.trace(T6.ConnectivityState[this.connectivityState]+" -> "+T6.ConnectivityState[Z]+' with error "'+W+'"');else this.trace(T6.ConnectivityState[this.connectivityState]+" -> "+T6.ConnectivityState[Z]);if(this.channelzEnabled)this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+T6.ConnectivityState[Z]);let X=this.connectivityState;switch(this.connectivityState=Z,Z){case T6.ConnectivityState.READY:this.stopBackoff();break;case T6.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case T6.ConnectivityState.TRANSIENT_FAILURE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());if((H=this.transport)===null||H===void 0||H.shutdown(),this.transport=null,!this.backoffTimeout.isRunning())process.nextTick(()=>{this.handleBackoffTimer()});break;case T6.ConnectivityState.IDLE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());(F=this.transport)===null||F===void 0||F.shutdown(),this.transport=null;break;default:throw Error(`Invalid state: unknown ConnectivityState ${Z}`)}for(let J of this.stateListeners)J(this,X,Z,this.keepaliveTime,W);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){if(this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0)this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,H4.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([T6.ConnectivityState.CONNECTING,T6.ConnectivityState.READY],T6.ConnectivityState.IDLE)})}unrefIfOneRef(){if(this.refcount===1)return this.unref(),!0;return!1}createCall(Y,Z,W,H){if(!this.transport)throw Error("Cannot create call, subchannel not READY");let F;if(this.channelzEnabled)this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),F={onCallEnd:(X)=>{if(X.code===a3.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()}};else F={};return this.transport.createCall(Y,Z,W,H,F)}startConnecting(){process.nextTick(()=>{if(!this.transitionToState([T6.ConnectivityState.IDLE],T6.ConnectivityState.CONNECTING)){if(this.connectivityState===T6.ConnectivityState.TRANSIENT_FAILURE)this.continueConnecting=!0}})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(Y){this.stateListeners.add(Y)}removeConnectivityStateListener(Y){this.stateListeners.delete(Y)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([T6.ConnectivityState.TRANSIENT_FAILURE],T6.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(Y){}removeHealthStateWatcher(Y){}getRealSubchannel(){return this}realSubchannelEquals(Y){return Y.getRealSubchannel()===this}throttleKeepalive(Y){if(Y>this.keepaliveTime)this.keepaliveTime=Y}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){if(!this.subchannelChannel)this.subchannelChannel=new vL0.SingleSubchannelChannel(this,this.channelTarget,this.options);return this.subchannelChannel}addDataWatcher(Y){throw Error("Not implemented")}getOrCreateDataProducer(Y,Z){let W=this.dataProducers.get(Y);if(W)return W;let H=Z(this);return this.dataProducers.set(Y,H),H}removeDataProducer(Y){this.dataProducers.delete(Y)}}Br.Subchannel=zr});var Dr=H0((Nr)=>{var GA;Object.defineProperty(Nr,"__esModule",{value:!0});Nr.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;Nr.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((GA=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&GA!==void 0?GA:"false")==="true"});var VA=H0((Er)=>{Object.defineProperty(Er,"__esModule",{value:!0});Er.DEFAULT_PORT=void 0;Er.setup=cL0;var Tr=S9(),FA=V1("dns"),_L0=iz(),HA=a1(),iY=U7(),xL0=K8(),bL0=M6(),uL0=a1(),D5=f8(),Ir=V1("net"),mL0=yY(),$r=Dr(),gL0="dns_resolver";function V4(Y){bL0.trace(uL0.LogVerbosity.DEBUG,gL0,Y)}Er.DEFAULT_PORT=443;var dL0=30000;class Cr{constructor(Y,Z,W){var H,F,X;if(this.target=Y,this.listener=Z,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 FA.promises.Resolver,V4("Resolver constructed for target "+(0,D5.uriToString)(Y)),Y.authority)this.alternativeResolver.setServers([Y.authority]);let J=(0,D5.splitHostPort)(Y.path);if(J===null)this.ipResult=null,this.dnsHostname=null,this.port=null;else if((0,Ir.isIPv4)(J.host)||(0,Ir.isIPv6)(J.host))this.ipResult=[{addresses:[{host:J.host,port:(H=J.port)!==null&&H!==void 0?H:Er.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null;else this.ipResult=null,this.dnsHostname=J.host,this.port=(F=J.port)!==null&&F!==void 0?F:Er.DEFAULT_PORT;if(this.percentage=Math.random()*100,W["grpc.service_config_disable_resolution"]===1)this.isServiceConfigEnabled=!1;this.defaultResolutionError={code:HA.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,D5.uriToString)(this.target)}`,metadata:new xL0.Metadata};let Q={initialDelay:W["grpc.initial_reconnect_backoff_ms"],maxDelay:W["grpc.max_reconnect_backoff_ms"]};this.backoff=new mL0.BackoffTimeout(()=>{if(this.continueResolving)this.startResolutionWithBackoff()},Q),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(X=W["grpc.dns_min_time_between_resolutions_ms"])!==null&&X!==void 0?X:dL0,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){if(!this.returnedIpResult)V4("Returning IP address for target "+(0,D5.uriToString)(this.target)),setImmediate(()=>{this.listener((0,iY.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0;this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)V4("Failed to parse DNS address "+(0,D5.uriToString)(this.target)),setImmediate(()=>{this.listener((0,iY.statusOrFromError)({code:HA.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,D5.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;V4("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let Y=this.dnsHostname;if(this.pendingLookupPromise=this.lookup(Y),this.pendingLookupPromise.then((Z)=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,iY.statusOrFromValue)(Z.map((F)=>({addresses:[F]})));let W="["+Z.map((F)=>F.host+":"+F.port).join(",")+"]";V4("Resolved addresses for target "+(0,D5.uriToString)(this.target)+": "+W);let H=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(H)},(Z)=>{if(this.pendingLookupPromise===null)return;V4("Resolution error for target "+(0,D5.uriToString)(this.target)+": "+Z.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,iY.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,"")}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null)this.pendingTxtPromise=this.resolveTxt(Y),this.pendingTxtPromise.then((Z)=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let W;try{if(W=(0,_L0.extractAndSelectServiceConfig)(Z,this.percentage),W)this.latestServiceConfigResult=(0,iY.statusOrFromValue)(W);else this.latestServiceConfigResult=null}catch(H){this.latestServiceConfigResult=(0,iY.statusOrFromError)({code:HA.Status.UNAVAILABLE,details:`Parsing service config failed with error ${H.message}`})}if(this.latestLookupResult!==null)this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},(Z)=>{})}}handleHealthStatus(Y){if(Y)this.backoff.stop(),this.backoff.reset();else this.continueResolving=!0}async lookup(Y){if($r.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){V4("Using alternative DNS resolver.");let W=await Promise.allSettled([this.alternativeResolver.resolve4(Y),this.alternativeResolver.resolve6(Y)]);if(W.every((H)=>H.status==="rejected"))throw Error(W[0].reason);return W.reduce((H,F)=>{return F.status==="fulfilled"?[...H,...F.value]:H},[]).map((H)=>({host:H,port:+this.port}))}return(await FA.promises.lookup(Y,{all:!0})).map((W)=>({host:W.address,port:+this.port}))}async resolveTxt(Y){if($r.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)return V4("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(Y);return FA.promises.resolveTxt(Y)}startNextResolutionTimer(){var Y,Z;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{if(this.stopNextResolutionTimer(),this.continueResolving)this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(Z=(Y=this.nextResolutionTimer).unref)===null||Z===void 0||Z.call(Y),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){if(this.pendingLookupPromise===null)this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution()}updateResolution(){if(this.pendingLookupPromise===null)if(this.isNextResolutionTimerRunning||this.backoff.isRunning()){if(this.isNextResolutionTimerRunning)V4('resolution update delayed by "min time between resolutions" rate limit');else V4("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString());this.continueResolving=!0}else 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(Y){return Y.path}}function cL0(){(0,Tr.registerResolver)("dns",Cr),(0,Tr.registerDefaultScheme)("dns")}});var qA=H0((wr)=>{Object.defineProperty(wr,"__esModule",{value:!0});wr.parseCIDR=Pr;wr.mapProxyName=Yw0;wr.getProxiedConnection=Zw0;var FX=M6(),rY=a1(),Rr=V1("net"),nL0=V1("http"),pL0=M6(),Mr=u8(),HX=f8(),iL0=V1("url"),rL0=VA(),aL0="proxy";function aY(Y){pL0.trace(rY.LogVerbosity.DEBUG,aL0,Y)}function oL0(){let Y="",Z="";if(process.env.grpc_proxy)Z="grpc_proxy",Y=process.env.grpc_proxy;else if(process.env.https_proxy)Z="https_proxy",Y=process.env.https_proxy;else if(process.env.http_proxy)Z="http_proxy",Y=process.env.http_proxy;else return{};let W;try{W=new iL0.URL(Y)}catch(Q){return(0,FX.log)(rY.LogVerbosity.ERROR,`cannot parse value of "${Z}" env var`),{}}if(W.protocol!=="http:")return(0,FX.log)(rY.LogVerbosity.ERROR,`"${W.protocol}" scheme not supported in proxy URI`),{};let H=null;if(W.username)if(W.password)(0,FX.log)(rY.LogVerbosity.INFO,"userinfo found in proxy URI"),H=decodeURIComponent(`${W.username}:${W.password}`);else H=W.username;let{hostname:F,port:X}=W;if(X==="")X="80";let J={address:`${F}:${X}`};if(H)J.creds=H;return aY("Proxy server "+J.address+" set by environment variable "+Z),J}function tL0(){let Y=process.env.no_grpc_proxy,Z="no_grpc_proxy";if(!Y)Y=process.env.no_proxy,Z="no_proxy";if(Y)return aY("No proxy server list set by environment variable "+Z),Y.split(",");else return[]}function Pr(Y){let Z=Y.split("/");if(Z.length!==2)return null;let W=parseInt(Z[1],10);if(!(0,Rr.isIPv4)(Z[0])||Number.isNaN(W)||W<0||W>32)return null;return{ip:Lr(Z[0]),prefixLength:W}}function Lr(Y){return Y.split(".").reduce((Z,W)=>(Z<<8)+parseInt(W,10),0)}function sL0(Y,Z){let W=Y.ip,H=-1<<32-Y.prefixLength;return(Lr(Z)&H)===(W&H)}function eL0(Y){for(let Z of tL0()){let W=Pr(Z);if((0,Rr.isIPv4)(Y)&&W&&sL0(W,Y))return!0;else if(Y.endsWith(Z))return!0}return!1}function Yw0(Y,Z){var W;let H={target:Y,extraOptions:{}};if(((W=Z["grpc.enable_http_proxy"])!==null&&W!==void 0?W:1)===0)return H;if(Y.scheme==="unix")return H;let F=oL0();if(!F.address)return H;let X=(0,HX.splitHostPort)(Y.path);if(!X)return H;let J=X.host;if(eL0(J))return aY("Not using proxy for target in no_proxy list: "+(0,HX.uriToString)(Y)),H;let Q={"grpc.http_connect_target":(0,HX.uriToString)(Y)};if(F.creds)Q["grpc.http_connect_creds"]=F.creds;return{target:{scheme:"dns",path:F.address},extraOptions:Q}}function Zw0(Y,Z){var W;if(!("grpc.http_connect_target"in Z))return Promise.resolve(null);let H=Z["grpc.http_connect_target"],F=(0,HX.parseUri)(H);if(F===null)return Promise.resolve(null);let X=(0,HX.splitHostPort)(F.path);if(X===null)return Promise.resolve(null);let J=`${X.host}:${(W=X.port)!==null&&W!==void 0?W:rL0.DEFAULT_PORT}`,Q={method:"CONNECT",path:J},G={Host:J};if((0,Mr.isTcpSubchannelAddress)(Y))Q.host=Y.host,Q.port=Y.port;else Q.socketPath=Y.path;if("grpc.http_connect_creds"in Z)G["Proxy-Authorization"]="Basic "+Buffer.from(Z["grpc.http_connect_creds"]).toString("base64");Q.headers=G;let q=(0,Mr.subchannelAddressToString)(Y);return aY("Using proxy "+q+" to connect to "+Q.path),new Promise((K,V)=>{let B=nL0.request(Q);B.once("connect",(I,M,E)=>{if(B.removeAllListeners(),M.removeAllListeners(),I.statusCode===200){if(aY("Successfully connected to "+Q.path+" through proxy "+q),E.length>0)M.unshift(E);aY("Successfully established a plaintext connection to "+Q.path+" through proxy "+q),K(M)}else(0,FX.log)(rY.LogVerbosity.ERROR,"Failed to connect to "+Q.path+" through proxy "+q+" with status "+I.statusCode),V()}),B.once("error",(I)=>{B.removeAllListeners(),(0,FX.log)(rY.LogVerbosity.ERROR,"Failed to connect to proxy "+q+" with error "+I.message),V()}),B.end()})}});var zA=H0((fr)=>{Object.defineProperty(fr,"__esModule",{value:!0});fr.StreamDecoder=void 0;var q4;(function(Y){Y[Y.NO_DATA=0]="NO_DATA",Y[Y.READING_SIZE=1]="READING_SIZE",Y[Y.READING_MESSAGE=2]="READING_MESSAGE"})(q4||(q4={}));class Sr{constructor(Y){this.maxReadMessageLength=Y,this.readState=q4.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(Y){let Z=0,W,H=[];while(Z<Y.length)switch(this.readState){case q4.NO_DATA:this.readCompressFlag=Y.slice(Z,Z+1),Z+=1,this.readState=q4.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case q4.READING_SIZE:if(W=Math.min(Y.length-Z,this.readSizeRemaining),Y.copy(this.readPartialSize,4-this.readSizeRemaining,Z,Z+W),this.readSizeRemaining-=W,Z+=W,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=q4.READING_MESSAGE;else{let F=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=q4.NO_DATA,H.push(F)}}break;case q4.READING_MESSAGE:if(W=Math.min(Y.length-Z,this.readMessageRemaining),this.readPartialMessage.push(Y.slice(Z,Z+W)),this.readMessageRemaining-=W,Z+=W,this.readMessageRemaining===0){let F=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),X=Buffer.concat(F,this.readMessageSize+5);this.readState=q4.NO_DATA,H.push(X)}break;default:throw Error("Unexpected read state")}return H}}fr.StreamDecoder=Sr});var jr=H0((vr)=>{Object.defineProperty(vr,"__esModule",{value:!0});vr.Http2SubchannelCall=void 0;var k4=V1("http2"),Ww0=V1("os"),I6=a1(),y4=K8(),Kw0=zA(),Gw0=M6(),Fw0=a1(),Hw0="subchannel_call";function Vw0(Y){for(let[Z,W]of Object.entries(Ww0.constants.errno))if(W===Y)return Z;return"Unknown system error "+Y}function BA(Y){let Z=`Received HTTP status code ${Y}`,W;switch(Y){case 400:W=I6.Status.INTERNAL;break;case 401:W=I6.Status.UNAUTHENTICATED;break;case 403:W=I6.Status.PERMISSION_DENIED;break;case 404:W=I6.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:W=I6.Status.UNAVAILABLE;break;default:W=I6.Status.UNKNOWN}return{code:W,details:Z,metadata:new y4.Metadata}}class yr{constructor(Y,Z,W,H,F){var X;this.http2Stream=Y,this.callEventTracker=Z,this.listener=W,this.transport=H,this.callId=F,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 J=(X=H.getOptions()["grpc.max_receive_message_length"])!==null&&X!==void 0?X:I6.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Kw0.StreamDecoder(J),Y.on("response",(Q,G)=>{let q="";for(let K of Object.keys(Q))q+="\t\t"+K+": "+Q[K]+`
29
+ `)++F;if(++W===H)throw q("comment");R=w,w=V(W)}while(R!=="*"||w!=="/");if(++W,k)B(L,W-2,v),v=!0;C=!0}else return"/"}}while(C);var f=W;xB.lastIndex=0;var h=xB.test(V(f++));if(!h)while(f<H&&!xB.test(V(f)))++f;var b=Y.substring(W,W=f);if(b==='"'||b==="'")G=b;return b}function A(C){Q.push(C)}function N(){if(!Q.length){var C=E();if(C===null)return null;A(C)}return Q[0]}function O(C,R){var w=N(),L=w===C;if(L)return E(),!0;if(!R)throw q("token '"+w+"', '"+C+"' expected");return!1}function T(C){var R=null,w;if(C===void 0){if(w=J[F-1],delete J[F-1],w&&(Z||w.type==="*"||w.lineEmpty))R=w.leading?w.text:null}else{if(X<C)N();if(w=J[C],delete J[C],w&&!w.lineEmpty&&(Z||w.type==="/"))R=w.leading?null:w.text}return R}return Object.defineProperty({next:E,peek:N,push:A,skip:O,cmnt:T},"line",{get:function(){return F}})}});var sp=H0((tt0,tp)=>{tp.exports=w4;w4.filename=null;w4.defaults={keepCase:!1};var $20=bB(),ip=y3(),rp=w3(),ap=z5(),C20=C3(),op=D7(),E20=y9(),M20=M3(),R20=E3(),P20=B5(),L20=T7(),uB=G8(),w20=/^[1-9][0-9]*$/,S20=/^-?[1-9][0-9]*$/,f20=/^0[x][0-9a-fA-F]+$/,k20=/^-?0[x][0-9a-fA-F]+$/,y20=/^0[0-7]+$/,v20=/^-?0[0-7]+$/,h20=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,X4=/^[a-zA-Z_][a-zA-Z_0-9]*$/,J4=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function w4(Y,Z,W){if(!(Z instanceof ip))W=Z,Z=new ip;if(!W)W=w4.defaults;var H=W.preferTrailingComment||!1,F=$20(Y,W.alternateCommentMode||!1),X=F.next,J=F.push,Q=F.peek,G=F.skip,q=F.cmnt,K=!0,V,B,I,M="proto2",E=Z,A=[],N={},O=W.keepCase?function(D0){return D0}:uB.camelCase;function T(){A.forEach((D0)=>{D0._edition=M,Object.keys(N).forEach((A0)=>{if(D0.getOption(A0)!==void 0)return;D0.setOption(A0,N[A0],!0)})})}function C(D0,A0,Y0){var G0=w4.filename;if(!Y0)w4.filename=null;return Error("illegal "+(A0||"token")+" '"+D0+"' ("+(G0?G0+", ":"")+"line "+F.line+")")}function R(){var D0=[],A0;do{if((A0=X())!=='"'&&A0!=="'")throw C(A0);D0.push(X()),G(A0),A0=Q()}while(A0==='"'||A0==="'");return D0.join("")}function w(D0){var A0=X();switch(A0){case"'":case'"':return J(A0),R();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return k(A0,!0)}catch(Y0){if(D0&&J4.test(A0))return A0;throw C(A0,"value")}}function L(D0,A0){var Y0,G0;do if(A0&&((Y0=Q())==='"'||Y0==="'")){var U0=R();if(D0.push(U0),M>=2023)throw C(U0,"id")}else try{D0.push([G0=v(X()),G("to",!0)?v(X()):G0])}catch(O0){if(A0&&J4.test(Y0)&&M>=2023)D0.push(Y0);else throw O0}while(G(",",!0));var R0={options:void 0};R0.setOption=function(O0,I0){if(this.options===void 0)this.options={};this.options[O0]=I0},n(R0,function(I0){if(I0==="option")s(R0,I0),G(";");else throw C(I0)},function(){t(R0)})}function k(D0,A0){var Y0=1;if(D0.charAt(0)==="-")Y0=-1,D0=D0.substring(1);switch(D0){case"inf":case"INF":case"Inf":return Y0*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(w20.test(D0))return Y0*parseInt(D0,10);if(f20.test(D0))return Y0*parseInt(D0,16);if(y20.test(D0))return Y0*parseInt(D0,8);if(h20.test(D0))return Y0*parseFloat(D0);throw C(D0,"number",A0)}function v(D0,A0){switch(D0){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!A0&&D0.charAt(0)==="-")throw C(D0,"id");if(S20.test(D0))return parseInt(D0,10);if(k20.test(D0))return parseInt(D0,16);if(v20.test(D0))return parseInt(D0,8);throw C(D0,"id")}function f(){if(V!==void 0)throw C("package");if(V=X(),!J4.test(V))throw C(V,"name");E=E.define(V),G(";")}function h(){var D0=Q(),A0;switch(D0){case"weak":A0=I||(I=[]),X();break;case"public":X();default:A0=B||(B=[]);break}D0=R(),G(";"),A0.push(D0)}function b(){if(G("="),M=R(),M<2023)throw C(M,"syntax");G(";")}function x(){if(G("="),M=R(),!["2023"].includes(M))throw C(M,"edition");G(";")}function y(D0,A0){switch(A0){case"option":return s(D0,A0),G(";"),!0;case"message":return Z0(D0,A0),!0;case"enum":return Q0(D0,A0),!0;case"service":return J0(D0,A0),!0;case"extend":return N0(D0,A0),!0}return!1}function n(D0,A0,Y0){var G0=F.line;if(D0){if(typeof D0.comment!=="string")D0.comment=q();D0.filename=w4.filename}if(G("{",!0)){var U0;while((U0=X())!=="}")A0(U0);G(";",!0)}else{if(Y0)Y0();if(G(";"),D0&&(typeof D0.comment!=="string"||H))D0.comment=q(G0)||D0.comment}}function Z0(D0,A0){if(!X4.test(A0=X()))throw C(A0,"type name");var Y0=new rp(A0);if(n(Y0,function(U0){if(y(Y0,U0))return;switch(U0){case"map":c(Y0,U0);break;case"required":if(M!=="proto2")throw C(U0);case"repeated":m(Y0,U0);break;case"optional":if(M==="proto3")m(Y0,"proto3_optional");else if(M!=="proto2")throw C(U0);else m(Y0,"optional");break;case"oneof":p(Y0,U0);break;case"extensions":L(Y0.extensions||(Y0.extensions=[]));break;case"reserved":L(Y0.reserved||(Y0.reserved=[]),!0);break;default:if(M==="proto2"||!J4.test(U0))throw C(U0);J(U0),m(Y0,"optional");break}}),D0.add(Y0),D0===E)A.push(Y0)}function m(D0,A0,Y0){var G0=X();if(G0==="group"){j(D0,A0);return}while(G0.endsWith(".")||Q().startsWith("."))G0+=X();if(!J4.test(G0))throw C(G0,"type");var U0=X();if(!X4.test(U0))throw C(U0,"name");U0=O(U0),G("=");var R0=new ap(U0,v(X()),G0,A0,Y0);if(n(R0,function(M0){if(M0==="option")s(R0,M0),G(";");else throw C(M0)},function(){t(R0)}),A0==="proto3_optional"){var O0=new op("_"+U0);R0.setOption("proto3_optional",!0),O0.add(R0),D0.add(O0)}else D0.add(R0);if(D0===E)A.push(R0)}function j(D0,A0){if(M>=2023)throw C("group");var Y0=X();if(!X4.test(Y0))throw C(Y0,"name");var G0=uB.lcFirst(Y0);if(Y0===G0)Y0=uB.ucFirst(Y0);G("=");var U0=v(X()),R0=new rp(Y0);R0.group=!0;var O0=new ap(G0,U0,Y0,A0);O0.filename=w4.filename,n(R0,function(M0){switch(M0){case"option":s(R0,M0),G(";");break;case"required":case"repeated":m(R0,M0);break;case"optional":if(M==="proto3")m(R0,"proto3_optional");else m(R0,"optional");break;case"message":Z0(R0,M0);break;case"enum":Q0(R0,M0);break;case"reserved":L(R0.reserved||(R0.reserved=[]),!0);break;default:throw C(M0)}}),D0.add(R0).add(O0)}function c(D0){G("<");var A0=X();if(L20.mapKey[A0]===void 0)throw C(A0,"type");G(",");var Y0=X();if(!J4.test(Y0))throw C(Y0,"type");G(">");var G0=X();if(!X4.test(G0))throw C(G0,"name");G("=");var U0=new C20(O(G0),v(X()),A0,Y0);n(U0,function(O0){if(O0==="option")s(U0,O0),G(";");else throw C(O0)},function(){t(U0)}),D0.add(U0)}function p(D0,A0){if(!X4.test(A0=X()))throw C(A0,"name");var Y0=new op(O(A0));n(Y0,function(U0){if(U0==="option")s(Y0,U0),G(";");else J(U0),m(Y0,"optional")}),D0.add(Y0)}function Q0(D0,A0){if(!X4.test(A0=X()))throw C(A0,"name");var Y0=new E20(A0);if(n(Y0,function(U0){switch(U0){case"option":s(Y0,U0),G(";");break;case"reserved":if(L(Y0.reserved||(Y0.reserved=[]),!0),Y0.reserved===void 0)Y0.reserved=[];break;default:l(Y0,U0)}}),D0.add(Y0),D0===E)A.push(Y0)}function l(D0,A0){if(!X4.test(A0))throw C(A0,"name");G("=");var Y0=v(X(),!0),G0={options:void 0};G0.getOption=function(U0){return this.options[U0]},G0.setOption=function(U0,R0){P20.prototype.setOption.call(G0,U0,R0)},G0.setParsedOption=function(){return},n(G0,function(R0){if(R0==="option")s(G0,R0),G(";");else throw C(R0)},function(){t(G0)}),D0.add(A0,Y0,G0.comment,G0.parsedOptions||G0.options)}function s(D0,A0){var Y0,G0,U0=!0;if(A0==="option")A0=X();while(A0!=="="){if(A0==="("){var R0=X();G(")"),A0="("+R0+")"}if(U0){if(U0=!1,A0.includes(".")&&!A0.includes("(")){var O0=A0.split(".");Y0=O0[0]+".",A0=O0[1];continue}Y0=A0}else G0=G0?G0+=A0:A0;A0=X()}var I0=G0?Y0.concat(G0):Y0,M0=g(D0,I0);G0=G0&&G0[0]==="."?G0.slice(1):G0,Y0=Y0&&Y0[Y0.length-1]==="."?Y0.slice(0,-1):Y0,a(D0,Y0,M0,G0)}function g(D0,A0){if(G("{",!0)){var Y0={};while(!G("}",!0)){if(!X4.test(P0=X()))throw C(P0,"name");if(P0===null)throw C(P0,"end of input");var G0,U0=P0;if(G(":",!0),Q()==="{")G0=g(D0,A0+"."+P0);else if(Q()==="["){G0=[];var R0;if(G("[",!0)){do R0=w(!0),G0.push(R0);while(G(",",!0));if(G("]"),typeof R0<"u")u(D0,A0+"."+P0,R0)}}else G0=w(!0),u(D0,A0+"."+P0,G0);var O0=Y0[U0];if(O0)G0=[].concat(O0).concat(G0);Y0[U0]=G0,G(",",!0),G(";",!0)}return Y0}var I0=w(!0);return u(D0,A0,I0),I0}function u(D0,A0,Y0){if(E===D0&&/^features\./.test(A0)){N[A0]=Y0;return}if(D0.setOption)D0.setOption(A0,Y0)}function a(D0,A0,Y0,G0){if(D0.setParsedOption)D0.setParsedOption(A0,Y0,G0)}function t(D0){if(G("[",!0)){do s(D0,"option");while(G(",",!0));G("]")}return D0}function J0(D0,A0){if(!X4.test(A0=X()))throw C(A0,"service name");var Y0=new M20(A0);if(n(Y0,function(U0){if(y(Y0,U0))return;if(U0==="rpc")z0(Y0,U0);else throw C(U0)}),D0.add(Y0),D0===E)A.push(Y0)}function z0(D0,A0){var Y0=q(),G0=A0;if(!X4.test(A0=X()))throw C(A0,"name");var U0=A0,R0,O0,I0,M0;if(G("("),G("stream",!0))O0=!0;if(!J4.test(A0=X()))throw C(A0);if(R0=A0,G(")"),G("returns"),G("("),G("stream",!0))M0=!0;if(!J4.test(A0=X()))throw C(A0);I0=A0,G(")");var w0=new R20(U0,G0,R0,I0,O0,M0);w0.comment=Y0,n(w0,function(y0){if(y0==="option")s(w0,y0),G(";");else throw C(y0)}),D0.add(w0)}function N0(D0,A0){if(!J4.test(A0=X()))throw C(A0,"reference");var Y0=A0;n(null,function(U0){switch(U0){case"required":case"repeated":m(D0,U0,Y0);break;case"optional":if(M==="proto3")m(D0,"proto3_optional",Y0);else m(D0,"optional",Y0);break;default:if(M==="proto2"||!J4.test(U0))throw C(U0);J(U0),m(D0,"optional",Y0);break}})}var P0;while((P0=X())!==null)switch(P0){case"package":if(!K)throw C(P0);f();break;case"import":if(!K)throw C(P0);h();break;case"syntax":if(!K)throw C(P0);b();break;case"edition":if(!K)throw C(P0);x();break;case"option":s(E,P0),G(";",!0);break;default:if(y(E,P0)){K=!1;continue}throw C(P0)}return T(),w4.filename=null,{package:V,imports:B,weakImports:I,root:Z}}});var Zi=H0((st0,Yi)=>{Yi.exports=h9;var j20=/\/|\./;function h9(Y,Z){if(!j20.test(Y))Y="google/protobuf/"+Y+".proto",Z={nested:{google:{nested:{protobuf:{nested:Z}}}}};h9[Y]=Z}h9("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var ep;h9("duration",{Duration:ep={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});h9("timestamp",{Timestamp:ep});h9("empty",{Empty:{fields:{}}});h9("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}}}});h9("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}}}});h9("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});h9.get=function(Z){return h9[Z]||null}});var x3=H0((et0,Qi)=>{var U5=Qi.exports=cp();U5.build="full";U5.tokenize=bB();U5.parse=sp();U5.common=Zi();U5.Root._configure(U5.Type,U5.parse,U5.common)});var mB=H0((Ys0,_20)=>{_20.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:[[536000000,536000000]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,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:[[1000,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1000,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:[[1000,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:[[1000,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:[[536000000,536000000]],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 Hi=H0((p1,Fi)=>{var a8=x3();Fi.exports=p1=a8.descriptor=a8.Root.fromJSON(mB()).lookup(".google.protobuf");var{Namespace:Xi,Root:sQ,Enum:S4,Type:W4,Field:N5,MapField:x20,OneOf:b3,Service:eQ,Method:u3}=a8;sQ.fromDescriptor=function(Z){if(typeof Z.length==="number")Z=p1.FileDescriptorSet.decode(Z);var W=new sQ;if(Z.file){var H,F;for(var X=0,J;X<Z.file.length;++X){if(F=W,(H=Z.file[X]).package&&H.package.length)F=W.define(H.package);var Q=i20(H);if(H.name&&H.name.length)W.files.push(F.filename=H.name);if(H.messageType)for(J=0;J<H.messageType.length;++J)F.add(W4.fromDescriptor(H.messageType[J],Q));if(H.enumType)for(J=0;J<H.enumType.length;++J)F.add(S4.fromDescriptor(H.enumType[J],Q));if(H.extension)for(J=0;J<H.extension.length;++J)F.add(N5.fromDescriptor(H.extension[J],Q));if(H.service)for(J=0;J<H.service.length;++J)F.add(eQ.fromDescriptor(H.service[J],Q));var G=gY(H.options,p1.FileOptions);if(G){var q=Object.keys(G);for(J=0;J<q.length;++J)F.setOption(q[J],G[q[J]])}}}return W.resolveAll()};sQ.prototype.toDescriptor=function(Z){var W=p1.FileDescriptorSet.create();return Ji(this,W.file,Z),W};function Ji(Y,Z,W){var H=p1.FileDescriptorProto.create({name:Y.filename||(Y.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});if(r20(W,H),!(Y instanceof sQ))H.package=Y.fullName.substring(1);for(var F=0,X;F<Y.nestedArray.length;++F)if((X=Y._nestedArray[F])instanceof W4)H.messageType.push(X.toDescriptor(W));else if(X instanceof S4)H.enumType.push(X.toDescriptor());else if(X instanceof N5)H.extension.push(X.toDescriptor(W));else if(X instanceof eQ)H.service.push(X.toDescriptor());else if(X instanceof Xi)Ji(X,Z,W);if(H.options=dY(Y.options,p1.FileOptions),H.messageType.length+H.enumType.length+H.extension.length+H.service.length)Z.push(H)}var b20=0;W4.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.DescriptorProto.decode(Z);var F=new W4(Z.name.length?Z.name:"Type"+b20++,gY(Z.options,p1.MessageOptions)),X;if(!H)F._edition=W;if(Z.oneofDecl)for(X=0;X<Z.oneofDecl.length;++X)F.add(b3.fromDescriptor(Z.oneofDecl[X]));if(Z.field)for(X=0;X<Z.field.length;++X){var J=N5.fromDescriptor(Z.field[X],W,!0);if(F.add(J),Z.field[X].hasOwnProperty("oneofIndex"))F.oneofsArray[Z.field[X].oneofIndex].add(J)}if(Z.extension)for(X=0;X<Z.extension.length;++X)F.add(N5.fromDescriptor(Z.extension[X],W,!0));if(Z.nestedType){for(X=0;X<Z.nestedType.length;++X)if(F.add(W4.fromDescriptor(Z.nestedType[X],W,!0)),Z.nestedType[X].options&&Z.nestedType[X].options.mapEntry)F.setOption("map_entry",!0)}if(Z.enumType)for(X=0;X<Z.enumType.length;++X)F.add(S4.fromDescriptor(Z.enumType[X],W,!0));if(Z.extensionRange&&Z.extensionRange.length){F.extensions=[];for(X=0;X<Z.extensionRange.length;++X)F.extensions.push([Z.extensionRange[X].start,Z.extensionRange[X].end])}if(Z.reservedRange&&Z.reservedRange.length||Z.reservedName&&Z.reservedName.length){if(F.reserved=[],Z.reservedRange)for(X=0;X<Z.reservedRange.length;++X)F.reserved.push([Z.reservedRange[X].start,Z.reservedRange[X].end]);if(Z.reservedName)for(X=0;X<Z.reservedName.length;++X)F.reserved.push(Z.reservedName[X])}return F};W4.prototype.toDescriptor=function(Z){var W=p1.DescriptorProto.create({name:this.name}),H;for(H=0;H<this.fieldsArray.length;++H){var F;if(W.field.push(F=this._fieldsArray[H].toDescriptor(Z)),this._fieldsArray[H]instanceof x20){var X=gB(this._fieldsArray[H].keyType,this._fieldsArray[H].resolvedKeyType,!1),J=gB(this._fieldsArray[H].type,this._fieldsArray[H].resolvedType,!1),Q=J===11||J===14?this._fieldsArray[H].resolvedType&&Gi(this.parent,this._fieldsArray[H].resolvedType)||this._fieldsArray[H].type:void 0;W.nestedType.push(p1.DescriptorProto.create({name:F.typeName,field:[p1.FieldDescriptorProto.create({name:"key",number:1,label:1,type:X}),p1.FieldDescriptorProto.create({name:"value",number:2,label:1,type:J,typeName:Q})],options:p1.MessageOptions.create({mapEntry:!0})}))}}for(H=0;H<this.oneofsArray.length;++H)W.oneofDecl.push(this._oneofsArray[H].toDescriptor());for(H=0;H<this.nestedArray.length;++H)if(this._nestedArray[H]instanceof N5)W.field.push(this._nestedArray[H].toDescriptor(Z));else if(this._nestedArray[H]instanceof W4)W.nestedType.push(this._nestedArray[H].toDescriptor(Z));else if(this._nestedArray[H]instanceof S4)W.enumType.push(this._nestedArray[H].toDescriptor());if(this.extensions)for(H=0;H<this.extensions.length;++H)W.extensionRange.push(p1.DescriptorProto.ExtensionRange.create({start:this.extensions[H][0],end:this.extensions[H][1]}));if(this.reserved)for(H=0;H<this.reserved.length;++H)if(typeof this.reserved[H]==="string")W.reservedName.push(this.reserved[H]);else W.reservedRange.push(p1.DescriptorProto.ReservedRange.create({start:this.reserved[H][0],end:this.reserved[H][1]}));return W.options=dY(this.options,p1.MessageOptions),W};var u20=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;N5.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.DescriptorProto.decode(Z);if(typeof Z.number!=="number")throw Error("missing field id");var F;if(Z.typeName&&Z.typeName.length)F=Z.typeName;else F=l20(Z.type);var X;switch(Z.label){case 1:X=void 0;break;case 2:X="required";break;case 3:X="repeated";break;default:throw Error("illegal label: "+Z.label)}var J=Z.extendee;if(Z.extendee!==void 0)J=J.length?J:void 0;var Q=new N5(Z.name.length?Z.name:"field"+Z.number,Z.number,F,X,J);if(!H)Q._edition=W;if(Q.options=gY(Z.options,p1.FieldOptions),Z.proto3_optional)Q.options.proto3_optional=!0;if(Z.defaultValue&&Z.defaultValue.length){var G=Z.defaultValue;switch(G){case"true":case"TRUE":G=!0;break;case"false":case"FALSE":G=!1;break;default:var q=u20.exec(G);if(q)G=parseInt(G);break}Q.setOption("default",G)}if(n20(Z.type)){if(W==="proto3"){if(Z.options&&!Z.options.packed)Q.setOption("packed",!1)}else if((!W||W==="proto2")&&Z.options&&Z.options.packed)Q.setOption("packed",!0)}return Q};N5.prototype.toDescriptor=function(Z){var W=p1.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)W.type=11,W.typeName=a8.util.ucFirst(this.name),W.label=3;else{switch(W.type=gB(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:W.typeName=this.resolvedType?Gi(this.parent,this.resolvedType):this.type;break}if(this.rule==="repeated")W.label=3;else if(this.required&&Z==="proto2")W.label=2;else W.label=1}if(W.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf){if((W.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof")}if(this.options){if(W.options=dY(this.options,p1.FieldOptions),this.options.default!=null)W.defaultValue=String(this.options.default);if(this.options.proto3_optional)W.proto3_optional=!0}if(Z==="proto3"){if(!this.packed)(W.options||(W.options=p1.FieldOptions.create())).packed=!1}else if((!Z||Z==="proto2")&&this.packed)(W.options||(W.options=p1.FieldOptions.create())).packed=!0;return W};var m20=0;S4.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.EnumDescriptorProto.decode(Z);var F={};if(Z.value)for(var X=0;X<Z.value.length;++X){var J=Z.value[X].name,Q=Z.value[X].number||0;F[J&&J.length?J:"NAME"+Q]=Q}var G=new S4(Z.name&&Z.name.length?Z.name:"Enum"+m20++,F,gY(Z.options,p1.EnumOptions));if(!H)G._edition=W;return G};S4.prototype.toDescriptor=function(){var Z=[];for(var W=0,H=Object.keys(this.values);W<H.length;++W)Z.push(p1.EnumValueDescriptorProto.create({name:H[W],number:this.values[H[W]]}));return p1.EnumDescriptorProto.create({name:this.name,value:Z,options:dY(this.options,p1.EnumOptions)})};var g20=0;b3.fromDescriptor=function(Z){if(typeof Z.length==="number")Z=p1.OneofDescriptorProto.decode(Z);return new b3(Z.name&&Z.name.length?Z.name:"oneof"+g20++)};b3.prototype.toDescriptor=function(){return p1.OneofDescriptorProto.create({name:this.name})};var d20=0;eQ.fromDescriptor=function(Z,W,H){if(typeof Z.length==="number")Z=p1.ServiceDescriptorProto.decode(Z);var F=new eQ(Z.name&&Z.name.length?Z.name:"Service"+d20++,gY(Z.options,p1.ServiceOptions));if(!H)F._edition=W;if(Z.method)for(var X=0;X<Z.method.length;++X)F.add(u3.fromDescriptor(Z.method[X]));return F};eQ.prototype.toDescriptor=function(){var Z=[];for(var W=0;W<this.methodsArray.length;++W)Z.push(this._methodsArray[W].toDescriptor());return p1.ServiceDescriptorProto.create({name:this.name,method:Z,options:dY(this.options,p1.ServiceOptions)})};var c20=0;u3.fromDescriptor=function(Z){if(typeof Z.length==="number")Z=p1.MethodDescriptorProto.decode(Z);return new u3(Z.name&&Z.name.length?Z.name:"Method"+c20++,"rpc",Z.inputType,Z.outputType,Boolean(Z.clientStreaming),Boolean(Z.serverStreaming),gY(Z.options,p1.MethodOptions))};u3.prototype.toDescriptor=function(){return p1.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:dY(this.options,p1.MethodOptions)})};function l20(Y){switch(Y){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: "+Y)}function n20(Y){switch(Y){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 gB(Y,Z,W){switch(Y){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(Z instanceof S4)return 14;if(Z instanceof W4)return W?10:11;throw Error("illegal type: "+Y)}function Wi(Y,Z){var W={};for(var H=0,F,X;H<Z.fieldsArray.length;++H){if((X=(F=Z._fieldsArray[H]).name)==="uninterpretedOption")continue;if(!Object.prototype.hasOwnProperty.call(Y,X))continue;var J=p20(X);if(F.resolvedType instanceof W4)W[J]=Wi(Y[X],F.resolvedType);else if(F.resolvedType instanceof S4)W[J]=F.resolvedType.valuesById[Y[X]];else W[J]=Y[X]}return W}function gY(Y,Z){if(!Y)return;return Wi(Z.toObject(Y),Z)}function Ki(Y,Z){var W={},H=Object.keys(Y);for(var F=0;F<H.length;++F){var X=H[F],J=a8.util.camelCase(X);if(!Object.prototype.hasOwnProperty.call(Z.fields,J))continue;var Q=Z.fields[J];if(Q.resolvedType instanceof W4)W[J]=Ki(Y[X],Q.resolvedType);else W[J]=Y[X];if(Q.repeated&&!Array.isArray(W[J]))W[J]=[W[J]]}return W}function dY(Y,Z){if(!Y)return;return Z.fromObject(Ki(Y,Z))}function Gi(Y,Z){var W=Y.fullName.split("."),H=Z.fullName.split("."),F=0,X=0,J=H.length-1;if(!(Y instanceof sQ)&&Z instanceof Xi)while(F<W.length&&X<J&&W[F]===H[X]){var Q=Z.lookup(W[F++],!0);if(Q!==null&&Q!==Z)break;++X}else for(;F<W.length&&X<J&&W[F]===H[X];++F,++X);return H.slice(X).join(".")}function p20(Y){return Y.substring(0,1)+Y.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(Z,W){return"_"+W.toLowerCase()})}function i20(Y){if(Y.syntax==="editions")switch(Y.edition){case p1.Edition.EDITION_2023:return"2023";default:throw Error("Unsupported edition "+Y.edition)}if(Y.syntax==="proto3")return"proto3";return"proto2"}function r20(Y,Z){if(!Y)return;if(Y==="proto2"||Y==="proto3")Z.syntax=Y;else switch(Z.syntax="editions",Y){case"2023":Z.edition=p1.Edition.EDITION_2023;break;default:throw Error("Unsupported edition "+Y)}}});var Vi=H0((Zs0,a20)=>{a20.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 qi=H0((Qs0,o20)=>{o20.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var zi=H0((Xs0,t20)=>{t20.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 Di=H0((Ni)=>{Object.defineProperty(Ni,"__esModule",{value:!0});Ni.addCommonProtos=Ni.loadProtosWithOptionsSync=Ni.loadProtosWithOptions=void 0;var Bi=V1("fs"),Ai=V1("path"),cY=x3();function Ui(Y,Z){let W=Y.resolvePath;Y.resolvePath=(H,F)=>{if(Ai.isAbsolute(F))return F;for(let X of Z){let J=Ai.join(X,F);try{return Bi.accessSync(J,Bi.constants.R_OK),J}catch(Q){continue}}return process.emitWarning(`${F} not found in any of the include paths ${Z}`),W(H,F)}}async function s20(Y,Z){let W=new cY.Root;if(Z=Z||{},Z.includeDirs){if(!Array.isArray(Z.includeDirs))return Promise.reject(Error("The includeDirs option must be an array"));Ui(W,Z.includeDirs)}let H=await W.load(Y,Z);return H.resolveAll(),H}Ni.loadProtosWithOptions=s20;function e20(Y,Z){let W=new cY.Root;if(Z=Z||{},Z.includeDirs){if(!Array.isArray(Z.includeDirs))throw Error("The includeDirs option must be an array");Ui(W,Z.includeDirs)}let H=W.loadSync(Y,Z);return H.resolveAll(),H}Ni.loadProtosWithOptionsSync=e20;function YP0(){let Y=Vi(),Z=mB(),W=qi(),H=zi();cY.common("api",Y.nested.google.nested.protobuf.nested),cY.common("descriptor",Z.nested.google.nested.protobuf.nested),cY.common("source_context",W.nested.google.nested.protobuf.nested),cY.common("type",H.nested.google.nested.protobuf.nested)}Ni.addCommonProtos=YP0});var Ti=H0((YX,dB)=>{(function(Y,Z){function W(H){return H.default||H}if(typeof define==="function"&&define.amd)define([],function(){var H={};return Z(H),W(H)});else if(typeof YX==="object"){if(Z(YX),typeof dB==="object")dB.exports=W(YX)}else(function(){var H={};Z(H),Y.Long=W(H)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:YX,function(Y){Object.defineProperty(Y,"__esModule",{value:!0}),Y.default=void 0;var Z=null;try{Z=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 W(x,y,n){this.low=x|0,this.high=y|0,this.unsigned=!!n}W.prototype.__isLong__,Object.defineProperty(W.prototype,"__isLong__",{value:!0});function H(x){return(x&&x.__isLong__)===!0}function F(x){var y=Math.clz32(x&-x);return x?31-y:y}W.isLong=H;var X={},J={};function Q(x,y){var n,Z0,m;if(y){if(x>>>=0,m=0<=x&&x<256){if(Z0=J[x],Z0)return Z0}if(n=q(x,0,!0),m)J[x]=n;return n}else{if(x|=0,m=-128<=x&&x<128){if(Z0=X[x],Z0)return Z0}if(n=q(x,x<0?-1:0,!1),m)X[x]=n;return n}}W.fromInt=Q;function G(x,y){if(isNaN(x))return y?C:T;if(y){if(x<0)return C;if(x>=A)return v}else{if(x<=-N)return f;if(x+1>=N)return k}if(x<0)return G(-x,y).neg();return q(x%E|0,x/E|0,y)}W.fromNumber=G;function q(x,y,n){return new W(x,y,n)}W.fromBits=q;var K=Math.pow;function V(x,y,n){if(x.length===0)throw Error("empty string");if(typeof y==="number")n=y,y=!1;else y=!!y;if(x==="NaN"||x==="Infinity"||x==="+Infinity"||x==="-Infinity")return y?C:T;if(n=n||10,n<2||36<n)throw RangeError("radix");var Z0;if((Z0=x.indexOf("-"))>0)throw Error("interior hyphen");else if(Z0===0)return V(x.substring(1),y,n).neg();var m=G(K(n,8)),j=T;for(var c=0;c<x.length;c+=8){var p=Math.min(8,x.length-c),Q0=parseInt(x.substring(c,c+p),n);if(p<8){var l=G(K(n,p));j=j.mul(l).add(G(Q0))}else j=j.mul(m),j=j.add(G(Q0))}return j.unsigned=y,j}W.fromString=V;function B(x,y){if(typeof x==="number")return G(x,y);if(typeof x==="string")return V(x,y);return q(x.low,x.high,typeof y==="boolean"?y:x.unsigned)}W.fromValue=B;var I=65536,M=16777216,E=I*I,A=E*E,N=A/2,O=Q(M),T=Q(0);W.ZERO=T;var C=Q(0,!0);W.UZERO=C;var R=Q(1);W.ONE=R;var w=Q(1,!0);W.UONE=w;var L=Q(-1);W.NEG_ONE=L;var k=q(-1,2147483647,!1);W.MAX_VALUE=k;var v=q(-1,-1,!0);W.MAX_UNSIGNED_VALUE=v;var f=q(0,-2147483648,!1);W.MIN_VALUE=f;var h=W.prototype;if(h.toInt=function(){return this.unsigned?this.low>>>0:this.low},h.toNumber=function(){if(this.unsigned)return(this.high>>>0)*E+(this.low>>>0);return this.high*E+(this.low>>>0)},h.toString=function(y){if(y=y||10,y<2||36<y)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(f)){var n=G(y),Z0=this.div(n),m=Z0.mul(n).sub(this);return Z0.toString(y)+m.toInt().toString(y)}else return"-"+this.neg().toString(y);var j=G(K(y,6),this.unsigned),c=this,p="";while(!0){var Q0=c.div(j),l=c.sub(Q0.mul(j)).toInt()>>>0,s=l.toString(y);if(c=Q0,c.isZero())return s+p;else{while(s.length<6)s="0"+s;p=""+s+p}}},h.getHighBits=function(){return this.high},h.getHighBitsUnsigned=function(){return this.high>>>0},h.getLowBits=function(){return this.low},h.getLowBitsUnsigned=function(){return this.low>>>0},h.getNumBitsAbs=function(){if(this.isNegative())return this.eq(f)?64:this.neg().getNumBitsAbs();var y=this.high!=0?this.high:this.low;for(var n=31;n>0;n--)if((y&1<<n)!=0)break;return this.high!=0?n+33:n+1},h.isSafeInteger=function(){var y=this.high>>21;if(!y)return!0;if(this.unsigned)return!1;return y===-1&&!(this.low===0&&this.high===-2097152)},h.isZero=function(){return this.high===0&&this.low===0},h.eqz=h.isZero,h.isNegative=function(){return!this.unsigned&&this.high<0},h.isPositive=function(){return this.unsigned||this.high>=0},h.isOdd=function(){return(this.low&1)===1},h.isEven=function(){return(this.low&1)===0},h.equals=function(y){if(!H(y))y=B(y);if(this.unsigned!==y.unsigned&&this.high>>>31===1&&y.high>>>31===1)return!1;return this.high===y.high&&this.low===y.low},h.eq=h.equals,h.notEquals=function(y){return!this.eq(y)},h.neq=h.notEquals,h.ne=h.notEquals,h.lessThan=function(y){return this.comp(y)<0},h.lt=h.lessThan,h.lessThanOrEqual=function(y){return this.comp(y)<=0},h.lte=h.lessThanOrEqual,h.le=h.lessThanOrEqual,h.greaterThan=function(y){return this.comp(y)>0},h.gt=h.greaterThan,h.greaterThanOrEqual=function(y){return this.comp(y)>=0},h.gte=h.greaterThanOrEqual,h.ge=h.greaterThanOrEqual,h.compare=function(y){if(!H(y))y=B(y);if(this.eq(y))return 0;var n=this.isNegative(),Z0=y.isNegative();if(n&&!Z0)return-1;if(!n&&Z0)return 1;if(!this.unsigned)return this.sub(y).isNegative()?-1:1;return y.high>>>0>this.high>>>0||y.high===this.high&&y.low>>>0>this.low>>>0?-1:1},h.comp=h.compare,h.negate=function(){if(!this.unsigned&&this.eq(f))return f;return this.not().add(R)},h.neg=h.negate,h.add=function(y){if(!H(y))y=B(y);var n=this.high>>>16,Z0=this.high&65535,m=this.low>>>16,j=this.low&65535,c=y.high>>>16,p=y.high&65535,Q0=y.low>>>16,l=y.low&65535,s=0,g=0,u=0,a=0;return a+=j+l,u+=a>>>16,a&=65535,u+=m+Q0,g+=u>>>16,u&=65535,g+=Z0+p,s+=g>>>16,g&=65535,s+=n+c,s&=65535,q(u<<16|a,s<<16|g,this.unsigned)},h.subtract=function(y){if(!H(y))y=B(y);return this.add(y.neg())},h.sub=h.subtract,h.multiply=function(y){if(this.isZero())return this;if(!H(y))y=B(y);if(Z){var n=Z.mul(this.low,this.high,y.low,y.high);return q(n,Z.get_high(),this.unsigned)}if(y.isZero())return this.unsigned?C:T;if(this.eq(f))return y.isOdd()?f:T;if(y.eq(f))return this.isOdd()?f:T;if(this.isNegative())if(y.isNegative())return this.neg().mul(y.neg());else return this.neg().mul(y).neg();else if(y.isNegative())return this.mul(y.neg()).neg();if(this.lt(O)&&y.lt(O))return G(this.toNumber()*y.toNumber(),this.unsigned);var Z0=this.high>>>16,m=this.high&65535,j=this.low>>>16,c=this.low&65535,p=y.high>>>16,Q0=y.high&65535,l=y.low>>>16,s=y.low&65535,g=0,u=0,a=0,t=0;return t+=c*s,a+=t>>>16,t&=65535,a+=j*s,u+=a>>>16,a&=65535,a+=c*l,u+=a>>>16,a&=65535,u+=m*s,g+=u>>>16,u&=65535,u+=j*l,g+=u>>>16,u&=65535,u+=c*Q0,g+=u>>>16,u&=65535,g+=Z0*s+m*l+j*Q0+c*p,g&=65535,q(a<<16|t,g<<16|u,this.unsigned)},h.mul=h.multiply,h.divide=function(y){if(!H(y))y=B(y);if(y.isZero())throw Error("division by zero");if(Z){if(!this.unsigned&&this.high===-2147483648&&y.low===-1&&y.high===-1)return this;var n=(this.unsigned?Z.div_u:Z.div_s)(this.low,this.high,y.low,y.high);return q(n,Z.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?C:T;var Z0,m,j;if(!this.unsigned){if(this.eq(f))if(y.eq(R)||y.eq(L))return f;else if(y.eq(f))return R;else{var c=this.shr(1);if(Z0=c.div(y).shl(1),Z0.eq(T))return y.isNegative()?R:L;else return m=this.sub(y.mul(Z0)),j=Z0.add(m.div(y)),j}else if(y.eq(f))return this.unsigned?C:T;if(this.isNegative()){if(y.isNegative())return this.neg().div(y.neg());return this.neg().div(y).neg()}else if(y.isNegative())return this.div(y.neg()).neg();j=T}else{if(!y.unsigned)y=y.toUnsigned();if(y.gt(this))return C;if(y.gt(this.shru(1)))return w;j=C}m=this;while(m.gte(y)){Z0=Math.max(1,Math.floor(m.toNumber()/y.toNumber()));var p=Math.ceil(Math.log(Z0)/Math.LN2),Q0=p<=48?1:K(2,p-48),l=G(Z0),s=l.mul(y);while(s.isNegative()||s.gt(m))Z0-=Q0,l=G(Z0,this.unsigned),s=l.mul(y);if(l.isZero())l=R;j=j.add(l),m=m.sub(s)}return j},h.div=h.divide,h.modulo=function(y){if(!H(y))y=B(y);if(Z){var n=(this.unsigned?Z.rem_u:Z.rem_s)(this.low,this.high,y.low,y.high);return q(n,Z.get_high(),this.unsigned)}return this.sub(this.div(y).mul(y))},h.mod=h.modulo,h.rem=h.modulo,h.not=function(){return q(~this.low,~this.high,this.unsigned)},h.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},h.clz=h.countLeadingZeros,h.countTrailingZeros=function(){return this.low?F(this.low):F(this.high)+32},h.ctz=h.countTrailingZeros,h.and=function(y){if(!H(y))y=B(y);return q(this.low&y.low,this.high&y.high,this.unsigned)},h.or=function(y){if(!H(y))y=B(y);return q(this.low|y.low,this.high|y.high,this.unsigned)},h.xor=function(y){if(!H(y))y=B(y);return q(this.low^y.low,this.high^y.high,this.unsigned)},h.shiftLeft=function(y){if(H(y))y=y.toInt();if((y&=63)===0)return this;else if(y<32)return q(this.low<<y,this.high<<y|this.low>>>32-y,this.unsigned);else return q(0,this.low<<y-32,this.unsigned)},h.shl=h.shiftLeft,h.shiftRight=function(y){if(H(y))y=y.toInt();if((y&=63)===0)return this;else if(y<32)return q(this.low>>>y|this.high<<32-y,this.high>>y,this.unsigned);else return q(this.high>>y-32,this.high>=0?0:-1,this.unsigned)},h.shr=h.shiftRight,h.shiftRightUnsigned=function(y){if(H(y))y=y.toInt();if((y&=63)===0)return this;if(y<32)return q(this.low>>>y|this.high<<32-y,this.high>>>y,this.unsigned);if(y===32)return q(this.high,0,this.unsigned);return q(this.high>>>y-32,0,this.unsigned)},h.shru=h.shiftRightUnsigned,h.shr_u=h.shiftRightUnsigned,h.rotateLeft=function(y){var n;if(H(y))y=y.toInt();if((y&=63)===0)return this;if(y===32)return q(this.high,this.low,this.unsigned);if(y<32)return n=32-y,q(this.low<<y|this.high>>>n,this.high<<y|this.low>>>n,this.unsigned);return y-=32,n=32-y,q(this.high<<y|this.low>>>n,this.low<<y|this.high>>>n,this.unsigned)},h.rotl=h.rotateLeft,h.rotateRight=function(y){var n;if(H(y))y=y.toInt();if((y&=63)===0)return this;if(y===32)return q(this.high,this.low,this.unsigned);if(y<32)return n=32-y,q(this.high<<n|this.low>>>y,this.low<<n|this.high>>>y,this.unsigned);return y-=32,n=32-y,q(this.low<<n|this.high>>>y,this.high<<n|this.low>>>y,this.unsigned)},h.rotr=h.rotateRight,h.toSigned=function(){if(!this.unsigned)return this;return q(this.low,this.high,!1)},h.toUnsigned=function(){if(this.unsigned)return this;return q(this.low,this.high,!0)},h.toBytes=function(y){return y?this.toBytesLE():this.toBytesBE()},h.toBytesLE=function(){var y=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,y&255,y>>>8&255,y>>>16&255,y>>>24]},h.toBytesBE=function(){var y=this.high,n=this.low;return[y>>>24,y>>>16&255,y>>>8&255,y&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},W.fromBytes=function(y,n,Z0){return Z0?W.fromBytesLE(y,n):W.fromBytesBE(y,n)},W.fromBytesLE=function(y,n){return new W(y[0]|y[1]<<8|y[2]<<16|y[3]<<24,y[4]|y[5]<<8|y[6]<<16|y[7]<<24,n)},W.fromBytesBE=function(y,n){return new W(y[4]<<24|y[5]<<16|y[6]<<8|y[7],y[0]<<24|y[1]<<16|y[2]<<8|y[3],n)},typeof BigInt==="function")W.fromBigInt=function(y,n){var Z0=Number(BigInt.asIntN(32,y)),m=Number(BigInt.asIntN(32,y>>BigInt(32)));return q(Z0,m,n)},W.fromValue=function(y,n){if(typeof y==="bigint")return W.fromBigInt(y,n);return B(y,n)},h.toBigInt=function(){var y=BigInt(this.low>>>0),n=BigInt(this.unsigned?this.high>>>0:this.high);return n<<BigInt(32)|y};var b=Y.default=W})});var ZX=H0((Ri)=>{Object.defineProperty(Ri,"__esModule",{value:!0});Ri.loadFileDescriptorSetFromObject=Ri.loadFileDescriptorSetFromBuffer=Ri.fromJSON=Ri.loadSync=Ri.load=Ri.IdempotencyLevel=Ri.isAnyExtension=Ri.Long=void 0;var XP0=Qp(),K4=x3(),pB=Hi(),iB=Di(),JP0=Ti();Ri.Long=JP0;function WP0(Y){return"@type"in Y&&typeof Y["@type"]==="string"}Ri.isAnyExtension=WP0;var $i;(function(Y){Y.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",Y.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",Y.IDEMPOTENT="IDEMPOTENT"})($i=Ri.IdempotencyLevel||(Ri.IdempotencyLevel={}));var Ci={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function KP0(Y,Z){if(Y==="")return Z;else return Y+"."+Z}function GP0(Y){return Y instanceof K4.Service||Y instanceof K4.Type||Y instanceof K4.Enum}function FP0(Y){return Y instanceof K4.Namespace||Y instanceof K4.Root}function Ei(Y,Z){let W=KP0(Z,Y.name);if(GP0(Y))return[[W,Y]];else if(FP0(Y)&&typeof Y.nested<"u")return Object.keys(Y.nested).map((H)=>{return Ei(Y.nested[H],W)}).reduce((H,F)=>H.concat(F),[]);return[]}function cB(Y,Z){return function(H){return Y.toObject(Y.decode(H),Z)}}function lB(Y){return function(W){if(Array.isArray(W))throw Error(`Failed to serialize message: expected object with ${Y.name} structure, got array instead`);let H=Y.fromObject(W);return Y.encode(H).finish()}}function HP0(Y){return(Y||[]).reduce((Z,W)=>{for(let[H,F]of Object.entries(W))switch(H){case"uninterpreted_option":Z.uninterpreted_option.push(W.uninterpreted_option);break;default:Z[H]=F}return Z},{deprecated:!1,idempotency_level:$i.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function VP0(Y,Z,W,H){let{resolvedRequestType:F,resolvedResponseType:X}=Y;return{path:"/"+Z+"/"+Y.name,requestStream:!!Y.requestStream,responseStream:!!Y.responseStream,requestSerialize:lB(F),requestDeserialize:cB(F,W),responseSerialize:lB(X),responseDeserialize:cB(X,W),originalName:XP0(Y.name),requestType:nB(F,W,H),responseType:nB(X,W,H),options:HP0(Y.parsedOptions)}}function qP0(Y,Z,W,H){let F={};for(let X of Y.methodsArray)F[X.name]=VP0(X,Z,W,H);return F}function nB(Y,Z,W){let H=Y.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:H.$type.toObject(H,Ci),fileDescriptorProtos:W,serialize:lB(Y),deserialize:cB(Y,Z)}}function zP0(Y,Z){let W=Y.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:W.$type.toObject(W,Ci),fileDescriptorProtos:Z}}function BP0(Y,Z,W,H){if(Y instanceof K4.Service)return qP0(Y,Z,W,H);else if(Y instanceof K4.Type)return nB(Y,W,H);else if(Y instanceof K4.Enum)return zP0(Y,H);else throw Error("Type mismatch in reflection object handling")}function m3(Y,Z){let W={};Y.resolveAll();let F=Y.toDescriptor("proto3").file.map((X)=>Buffer.from(pB.FileDescriptorProto.encode(X).finish()));for(let[X,J]of Ei(Y,""))W[X]=BP0(J,X,Z,F);return W}function Mi(Y,Z){Z=Z||{};let W=K4.Root.fromDescriptor(Y);return W.resolveAll(),m3(W,Z)}function AP0(Y,Z){return(0,iB.loadProtosWithOptions)(Y,Z).then((W)=>{return m3(W,Z)})}Ri.load=AP0;function UP0(Y,Z){let W=(0,iB.loadProtosWithOptionsSync)(Y,Z);return m3(W,Z)}Ri.loadSync=UP0;function NP0(Y,Z){Z=Z||{};let W=K4.Root.fromJSON(Y);return W.resolveAll(),m3(W,Z)}Ri.fromJSON=NP0;function OP0(Y,Z){let W=pB.FileDescriptorSet.decode(Y);return Mi(W,Z)}Ri.loadFileDescriptorSetFromBuffer=OP0;function DP0(Y,Z){let W=pB.FileDescriptorSet.fromObject(Y);return Mi(W,Z)}Ri.loadFileDescriptorSetFromObject=DP0;(0,iB.addCommonProtos)()});var O5=H0((mi)=>{var __dirname="/Users/beatrix/dev/sdk/node_modules/.bun/@grpc+grpc-js@1.14.3/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(mi,"__esModule",{value:!0});mi.registerChannelzSocket=mi.registerChannelzServer=mi.registerChannelzSubchannel=mi.registerChannelzChannel=mi.ChannelzCallTrackerStub=mi.ChannelzCallTracker=mi.ChannelzChildrenTrackerStub=mi.ChannelzChildrenTracker=mi.ChannelzTrace=mi.ChannelzTraceStub=void 0;mi.unregisterChannelzRef=SP0;mi.getChannelzHandlers=bi;mi.getChannelzServiceDefinition=ui;mi.setup=mP0;var d3=V1("net"),$7=Xn(),QX=k8(),XX=a1(),RP0=u8(),PP0=A3(),LP0=N3();function rB(Y){return{channel_id:Y.id,name:Y.name}}function aB(Y){return{subchannel_id:Y.id,name:Y.name}}function wP0(Y){return{server_id:Y.id}}function c3(Y){return{socket_id:Y.id,name:Y.name}}var Li=32,oB=100;class ki{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:G4(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}}mi.ChannelzTraceStub=ki;class yi{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(Y,Z,W){let H=new Date;if(this.events.push({description:Z,severity:Y,timestamp:H,childChannel:(W===null||W===void 0?void 0:W.kind)==="channel"?W:void 0,childSubchannel:(W===null||W===void 0?void 0:W.kind)==="subchannel"?W:void 0}),this.events.length>=Li*2)this.events=this.events.slice(Li);this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:G4(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map((Y)=>{return{description:Y.description,severity:Y.severity,timestamp:G4(Y.timestamp),channel_ref:Y.childChannel?rB(Y.childChannel):null,subchannel_ref:Y.childSubchannel?aB(Y.childSubchannel):null}})}}}mi.ChannelzTrace=yi;class tB{constructor(){this.channelChildren=new $7.OrderedMap,this.subchannelChildren=new $7.OrderedMap,this.socketChildren=new $7.OrderedMap,this.trackerMap={["channel"]:this.channelChildren,["subchannel"]:this.subchannelChildren,["socket"]:this.socketChildren}}refChild(Y){let Z=this.trackerMap[Y.kind],W=Z.find(Y.id);if(W.equals(Z.end()))Z.setElement(Y.id,{ref:Y,count:1},W);else W.pointer[1].count+=1}unrefChild(Y){let Z=this.trackerMap[Y.kind],W=Z.getElementByKey(Y.id);if(W!==void 0){if(W.count-=1,W.count===0)Z.eraseElementByKey(Y.id)}}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}}mi.ChannelzChildrenTracker=tB;class vi extends tB{refChild(){}unrefChild(){}}mi.ChannelzChildrenTrackerStub=vi;class sB{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}}mi.ChannelzCallTracker=sB;class hi extends sB{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}}mi.ChannelzCallTrackerStub=hi;var f4={["channel"]:new $7.OrderedMap,["subchannel"]:new $7.OrderedMap,["server"]:new $7.OrderedMap,["socket"]:new $7.OrderedMap},l3=(Y)=>{let Z=1;function W(){return Z++}let H=f4[Y];return(F,X,J)=>{let Q=W(),G={id:Q,name:F,kind:Y};if(J)H.setElement(Q,{ref:G,getInfo:X});return G}};mi.registerChannelzChannel=l3("channel");mi.registerChannelzSubchannel=l3("subchannel");mi.registerChannelzServer=l3("server");mi.registerChannelzSocket=l3("socket");function SP0(Y){f4[Y.kind].eraseElementByKey(Y.id)}function fP0(Y){let Z=Number.parseInt(Y,16);return[Z/256|0,Z%256]}function wi(Y){if(Y==="")return[];let Z=Y.split(":").map((H)=>fP0(H));return[].concat(...Z)}function kP0(Y){return(0,d3.isIPv6)(Y)&&Y.toLowerCase().startsWith("::ffff:")&&(0,d3.isIPv4)(Y.substring(7))}function Si(Y){return Buffer.from(Uint8Array.from(Y.split(".").map((Z)=>Number.parseInt(Z))))}function yP0(Y){if((0,d3.isIPv4)(Y))return Si(Y);else if(kP0(Y))return Si(Y.substring(7));else if((0,d3.isIPv6)(Y)){let Z,W,H=Y.indexOf("::");if(H===-1)Z=Y,W="";else Z=Y.substring(0,H),W=Y.substring(H+2);let F=Buffer.from(wi(Z)),X=Buffer.from(wi(W)),J=Buffer.alloc(16-F.length-X.length,0);return Buffer.concat([F,J,X])}else return null}function ji(Y){switch(Y){case QX.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case QX.ConnectivityState.IDLE:return{state:"IDLE"};case QX.ConnectivityState.READY:return{state:"READY"};case QX.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case QX.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function G4(Y){if(!Y)return null;let Z=Y.getTime();return{seconds:Z/1000|0,nanos:Z%1000*1e6}}function _i(Y){let Z=Y.getInfo(),W=[],H=[];return Z.children.channels.forEach((F)=>{W.push(rB(F[1].ref))}),Z.children.subchannels.forEach((F)=>{H.push(aB(F[1].ref))}),{ref:rB(Y.ref),data:{target:Z.target,state:ji(Z.state),calls_started:Z.callTracker.callsStarted,calls_succeeded:Z.callTracker.callsSucceeded,calls_failed:Z.callTracker.callsFailed,last_call_started_timestamp:G4(Z.callTracker.lastCallStartedTimestamp),trace:Z.trace.getTraceMessage()},channel_ref:W,subchannel_ref:H}}function vP0(Y,Z){let W=parseInt(Y.request.channel_id,10),H=f4.channel.getElementByKey(W);if(H===void 0){Z({code:XX.Status.NOT_FOUND,details:"No channel data found for id "+W});return}Z(null,{channel:_i(H)})}function hP0(Y,Z){let W=parseInt(Y.request.max_results,10)||oB,H=[],F=parseInt(Y.request.start_channel_id,10),X=f4.channel,J;for(J=X.lowerBound(F);!J.equals(X.end())&&H.length<W;J=J.next())H.push(_i(J.pointer[1]));Z(null,{channel:H,end:J.equals(X.end())})}function xi(Y){let Z=Y.getInfo(),W=[];return Z.listenerChildren.sockets.forEach((H)=>{W.push(c3(H[1].ref))}),{ref:wP0(Y.ref),data:{calls_started:Z.callTracker.callsStarted,calls_succeeded:Z.callTracker.callsSucceeded,calls_failed:Z.callTracker.callsFailed,last_call_started_timestamp:G4(Z.callTracker.lastCallStartedTimestamp),trace:Z.trace.getTraceMessage()},listen_socket:W}}function jP0(Y,Z){let W=parseInt(Y.request.server_id,10),F=f4.server.getElementByKey(W);if(F===void 0){Z({code:XX.Status.NOT_FOUND,details:"No server data found for id "+W});return}Z(null,{server:xi(F)})}function _P0(Y,Z){let W=parseInt(Y.request.max_results,10)||oB,H=parseInt(Y.request.start_server_id,10),F=f4.server,X=[],J;for(J=F.lowerBound(H);!J.equals(F.end())&&X.length<W;J=J.next())X.push(xi(J.pointer[1]));Z(null,{server:X,end:J.equals(F.end())})}function xP0(Y,Z){let W=parseInt(Y.request.subchannel_id,10),H=f4.subchannel.getElementByKey(W);if(H===void 0){Z({code:XX.Status.NOT_FOUND,details:"No subchannel data found for id "+W});return}let F=H.getInfo(),X=[];F.children.sockets.forEach((Q)=>{X.push(c3(Q[1].ref))});let J={ref:aB(H.ref),data:{target:F.target,state:ji(F.state),calls_started:F.callTracker.callsStarted,calls_succeeded:F.callTracker.callsSucceeded,calls_failed:F.callTracker.callsFailed,last_call_started_timestamp:G4(F.callTracker.lastCallStartedTimestamp),trace:F.trace.getTraceMessage()},socket_ref:X};Z(null,{subchannel:J})}function fi(Y){var Z;if((0,RP0.isTcpSubchannelAddress)(Y))return{address:"tcpip_address",tcpip_address:{ip_address:(Z=yP0(Y.host))!==null&&Z!==void 0?Z:void 0,port:Y.port}};else return{address:"uds_address",uds_address:{filename:Y.path}}}function bP0(Y,Z){var W,H,F,X,J;let Q=parseInt(Y.request.socket_id,10),G=f4.socket.getElementByKey(Q);if(G===void 0){Z({code:XX.Status.NOT_FOUND,details:"No socket data found for id "+Q});return}let q=G.getInfo(),K=q.security?{model:"tls",tls:{cipher_suite:q.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(W=q.security.cipherSuiteStandardName)!==null&&W!==void 0?W:void 0,other_name:(H=q.security.cipherSuiteOtherName)!==null&&H!==void 0?H:void 0,local_certificate:(F=q.security.localCertificate)!==null&&F!==void 0?F:void 0,remote_certificate:(X=q.security.remoteCertificate)!==null&&X!==void 0?X:void 0}}:null,V={ref:c3(G.ref),local:q.localAddress?fi(q.localAddress):null,remote:q.remoteAddress?fi(q.remoteAddress):null,remote_name:(J=q.remoteName)!==null&&J!==void 0?J:void 0,security:K,data:{keep_alives_sent:q.keepAlivesSent,streams_started:q.streamsStarted,streams_succeeded:q.streamsSucceeded,streams_failed:q.streamsFailed,last_local_stream_created_timestamp:G4(q.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:G4(q.lastRemoteStreamCreatedTimestamp),messages_received:q.messagesReceived,messages_sent:q.messagesSent,last_message_received_timestamp:G4(q.lastMessageReceivedTimestamp),last_message_sent_timestamp:G4(q.lastMessageSentTimestamp),local_flow_control_window:q.localFlowControlWindow?{value:q.localFlowControlWindow}:null,remote_flow_control_window:q.remoteFlowControlWindow?{value:q.remoteFlowControlWindow}:null}};Z(null,{socket:V})}function uP0(Y,Z){let W=parseInt(Y.request.server_id,10),H=f4.server.getElementByKey(W);if(H===void 0){Z({code:XX.Status.NOT_FOUND,details:"No server data found for id "+W});return}let F=parseInt(Y.request.start_socket_id,10),X=parseInt(Y.request.max_results,10)||oB,Q=H.getInfo().sessionChildren.sockets,G=[],q;for(q=Q.lowerBound(F);!q.equals(Q.end())&&G.length<X;q=q.next())G.push(c3(q.pointer[1].ref));Z(null,{socket_ref:G,end:q.equals(Q.end())})}function bi(){return{GetChannel:vP0,GetTopChannels:hP0,GetServer:jP0,GetServers:_P0,GetSubchannel:xP0,GetSocket:bP0,GetServerSockets:uP0}}var g3=null;function ui(){if(g3)return g3;let Y=ZX().loadSync,Z=Y("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return g3=(0,LP0.loadPackageDefinition)(Z).grpc.channelz.v1.Channelz.service,g3}function mP0(){(0,PP0.registerAdminService)(ui,bi)}});var n3=H0((di)=>{Object.defineProperty(di,"__esModule",{value:!0});di.getNextCallNumber=ZL0;var YL0=0;function ZL0(){return YL0++}});var eB=H0((li)=>{Object.defineProperty(li,"__esModule",{value:!0});li.CompressionAlgorithms=void 0;var ci;(function(Y){Y[Y.identity=0]="identity",Y[Y.deflate=1]="deflate",Y[Y.gzip=2]="gzip"})(ci||(li.CompressionAlgorithms=ci={}))});var YA=H0((ii)=>{Object.defineProperty(ii,"__esModule",{value:!0});ii.BaseFilter=void 0;class pi{async sendMetadata(Y){return Y}receiveMetadata(Y){return Y}async sendMessage(Y){return Y}async receiveMessage(Y){return Y}receiveTrailers(Y){return Y}}ii.BaseFilter=pi});var QA=H0((Zr)=>{Object.defineProperty(Zr,"__esModule",{value:!0});Zr.CompressionFilterFactory=Zr.CompressionFilter=void 0;var p3=V1("zlib"),oi=eB(),lY=a1(),XL0=YA(),JL0=M6(),WL0=(Y)=>{return typeof Y==="number"&&typeof oi.CompressionAlgorithms[Y]==="string"};class JX{async writeMessage(Y,Z){let W=Y;if(Z)W=await this.compressMessage(W);let H=Buffer.allocUnsafe(W.length+5);return H.writeUInt8(Z?1:0,0),H.writeUInt32BE(W.length,1),W.copy(H,5),H}async readMessage(Y){let Z=Y.readUInt8(0)===1,W=Y.slice(5);if(Z)W=await this.decompressMessage(W);return W}}class nY extends JX{async compressMessage(Y){return Y}async writeMessage(Y,Z){let W=Buffer.allocUnsafe(Y.length+5);return W.writeUInt8(0,0),W.writeUInt32BE(Y.length,1),Y.copy(W,5),W}decompressMessage(Y){return Promise.reject(Error('Received compressed message but "grpc-encoding" header was identity'))}}class ti extends JX{constructor(Y){super();this.maxRecvMessageLength=Y}compressMessage(Y){return new Promise((Z,W)=>{p3.deflate(Y,(H,F)=>{if(H)W(H);else Z(F)})})}decompressMessage(Y){return new Promise((Z,W)=>{let H=0,F=[],X=p3.createInflate();X.on("data",(J)=>{if(F.push(J),H+=J.byteLength,this.maxRecvMessageLength!==-1&&H>this.maxRecvMessageLength)X.destroy(),W({code:lY.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),X.on("end",()=>{Z(Buffer.concat(F))}),X.write(Y),X.end()})}}class si extends JX{constructor(Y){super();this.maxRecvMessageLength=Y}compressMessage(Y){return new Promise((Z,W)=>{p3.gzip(Y,(H,F)=>{if(H)W(H);else Z(F)})})}decompressMessage(Y){return new Promise((Z,W)=>{let H=0,F=[],X=p3.createGunzip();X.on("data",(J)=>{if(F.push(J),H+=J.byteLength,this.maxRecvMessageLength!==-1&&H>this.maxRecvMessageLength)X.destroy(),W({code:lY.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`})}),X.on("end",()=>{Z(Buffer.concat(F))}),X.write(Y),X.end()})}}class ei extends JX{constructor(Y){super();this.compressionName=Y}compressMessage(Y){return Promise.reject(Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(Y){return Promise.reject(Error(`Compression method not supported: ${this.compressionName}`))}}function ai(Y,Z){switch(Y){case"identity":return new nY;case"deflate":return new ti(Z);case"gzip":return new si(Z);default:return new ei(Y)}}class ZA extends XL0.BaseFilter{constructor(Y,Z){var W,H,F;super();this.sharedFilterConfig=Z,this.sendCompression=new nY,this.receiveCompression=new nY,this.currentCompressionAlgorithm="identity";let X=Y["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(W=Y["grpc.max_receive_message_length"])!==null&&W!==void 0?W:lY.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(H=Y["grpc.max_send_message_length"])!==null&&H!==void 0?H:lY.DEFAULT_MAX_SEND_MESSAGE_LENGTH,X!==void 0)if(WL0(X)){let J=oi.CompressionAlgorithms[X],Q=(F=Z.serverSupportedEncodingHeader)===null||F===void 0?void 0:F.split(",");if(!Q||Q.includes(J))this.currentCompressionAlgorithm=J,this.sendCompression=ai(this.currentCompressionAlgorithm,-1)}else JL0.log(lY.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${X}`)}async sendMetadata(Y){let Z=await Y;if(Z.set("grpc-accept-encoding","identity,deflate,gzip"),Z.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity")Z.remove("grpc-encoding");else Z.set("grpc-encoding",this.currentCompressionAlgorithm);return Z}receiveMetadata(Y){let Z=Y.get("grpc-encoding");if(Z.length>0){let H=Z[0];if(typeof H==="string")this.receiveCompression=ai(H,this.maxReceiveMessageLength)}Y.remove("grpc-encoding");let W=Y.get("grpc-accept-encoding")[0];if(W){if(this.sharedFilterConfig.serverSupportedEncodingHeader=W,!W.split(",").includes(this.currentCompressionAlgorithm))this.sendCompression=new nY,this.currentCompressionAlgorithm="identity"}return Y.remove("grpc-accept-encoding"),Y}async sendMessage(Y){var Z;let W=await Y;if(this.maxSendMessageLength!==-1&&W.message.length>this.maxSendMessageLength)throw{code:lY.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let H;if(this.sendCompression instanceof nY)H=!1;else H=(((Z=W.flags)!==null&&Z!==void 0?Z:0)&2)===0;return{message:await this.sendCompression.writeMessage(W.message,H),flags:W.flags}}async receiveMessage(Y){return this.receiveCompression.readMessage(await Y)}}Zr.CompressionFilter=ZA;class Yr{constructor(Y,Z){this.options=Z,this.sharedFilterConfig={}}createFilter(){return new ZA(this.options,this.sharedFilterConfig)}}Zr.CompressionFilterFactory=Yr});var WX=H0((Xr)=>{Object.defineProperty(Xr,"__esModule",{value:!0});Xr.restrictControlPlaneStatusCode=FL0;var F4=a1(),GL0=[F4.Status.OK,F4.Status.INVALID_ARGUMENT,F4.Status.NOT_FOUND,F4.Status.ALREADY_EXISTS,F4.Status.FAILED_PRECONDITION,F4.Status.ABORTED,F4.Status.OUT_OF_RANGE,F4.Status.DATA_LOSS];function FL0(Y,Z){if(GL0.includes(Y))return{code:F4.Status.INTERNAL,details:`Invalid status from control plane: ${Y} ${F4.Status[Y]} ${Z}`};else return{code:Y,details:Z}}});var pY=H0((Jr)=>{Object.defineProperty(Jr,"__esModule",{value:!0});Jr.minDeadline=VL0;Jr.getDeadlineTimeoutString=zL0;Jr.getRelativeTimeout=AL0;Jr.deadlineToString=UL0;Jr.formatDateDifference=NL0;function VL0(...Y){let Z=1/0;for(let W of Y){let H=W instanceof Date?W.getTime():W;if(H<Z)Z=H}return Z}var qL0=[["m",1],["S",1000],["M",60000],["H",3600000]];function zL0(Y){let Z=new Date().getTime();if(Y instanceof Date)Y=Y.getTime();let W=Math.max(Y-Z,0);for(let[H,F]of qL0){let X=W/F;if(X<1e8)return String(Math.ceil(X))+H}throw Error("Deadline is too far in the future")}var BL0=2147483647;function AL0(Y){let Z=Y instanceof Date?Y.getTime():Y,W=new Date().getTime(),H=Z-W;if(H<0)return 0;else if(H>BL0)return 1/0;else return H}function UL0(Y){if(Y instanceof Date)return Y.toISOString();else{let Z=new Date(Y);if(Number.isNaN(Z.getTime()))return""+Y;else return Z.toISOString()}}function NL0(Y,Z){return((Z.getTime()-Y.getTime())/1000).toFixed(3)+"s"}});var i3=H0((Wr)=>{Object.defineProperty(Wr,"__esModule",{value:!0});Wr.FilterStackFactory=Wr.FilterStack=void 0;class XA{constructor(Y){this.filters=Y}sendMetadata(Y){let Z=Y;for(let W=0;W<this.filters.length;W++)Z=this.filters[W].sendMetadata(Z);return Z}receiveMetadata(Y){let Z=Y;for(let W=this.filters.length-1;W>=0;W--)Z=this.filters[W].receiveMetadata(Z);return Z}sendMessage(Y){let Z=Y;for(let W=0;W<this.filters.length;W++)Z=this.filters[W].sendMessage(Z);return Z}receiveMessage(Y){let Z=Y;for(let W=this.filters.length-1;W>=0;W--)Z=this.filters[W].receiveMessage(Z);return Z}receiveTrailers(Y){let Z=Y;for(let W=this.filters.length-1;W>=0;W--)Z=this.filters[W].receiveTrailers(Z);return Z}push(Y){this.filters.unshift(...Y)}getFilters(){return this.filters}}Wr.FilterStack=XA;class JA{constructor(Y){this.factories=Y}push(Y){this.factories.unshift(...Y)}clone(){return new JA([...this.factories])}createFilter(){return new XA(this.factories.map((Y)=>Y.createFilter()))}}Wr.FilterStackFactory=JA});var qr=H0((Hr)=>{Object.defineProperty(Hr,"__esModule",{value:!0});Hr.SingleSubchannelChannel=void 0;var EL0=n3(),KX=O5(),ML0=QA(),RL0=k8(),GX=a1(),PL0=WX(),LL0=pY(),wL0=i3(),WA=K8(),SL0=S9(),r3=f8();class Gr{constructor(Y,Z,W,H,F){var X,J;this.subchannel=Y,this.method=Z,this.options=H,this.callNumber=F,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let Q=this.method.split("/"),G="";if(Q.length>=2)G=Q[1];let q=(J=(X=(0,r3.splitHostPort)(this.options.host))===null||X===void 0?void 0:X.host)!==null&&J!==void 0?J:"localhost";this.serviceUrl=`https://${q}/${G}`;let K=(0,LL0.getRelativeTimeout)(H.deadline);if(K!==1/0)if(K<=0)this.cancelWithStatus(GX.Status.DEADLINE_EXCEEDED,"Deadline exceeded");else setTimeout(()=>{this.cancelWithStatus(GX.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},K);this.filterStack=W.createFilter()}cancelWithStatus(Y,Z){if(this.childCall)this.childCall.cancelWithStatus(Y,Z);else this.pendingStatus={code:Y,details:Z,metadata:new WA.Metadata}}getPeer(){var Y,Z;return(Z=(Y=this.childCall)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:this.subchannel.getAddress()}async start(Y,Z){if(this.pendingStatus){Z.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==RL0.ConnectivityState.READY){Z.onReceiveStatus({code:GX.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new WA.Metadata});return}let W=await this.filterStack.sendMetadata(Promise.resolve(Y)),H;try{H=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(X){let J=X,{code:Q,details:G}=(0,PL0.restrictControlPlaneStatusCode)(typeof J.code==="number"?J.code:GX.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${J.message}`);Z.onReceiveStatus({code:Q,details:G,metadata:new WA.Metadata});return}H.merge(W);let F={onReceiveMetadata:async(X)=>{Z.onReceiveMetadata(await this.filterStack.receiveMetadata(X))},onReceiveMessage:async(X)=>{this.readFilterPending=!0;let J=await this.filterStack.receiveMessage(X);if(this.readFilterPending=!1,Z.onReceiveMessage(J),this.pendingStatus)Z.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async(X)=>{let J=await this.filterStack.receiveTrailers(X);if(this.readFilterPending)this.pendingStatus=J;else Z.onReceiveStatus(J)}};if(this.childCall=this.subchannel.createCall(H,this.options.host,this.method,F),this.readPending)this.childCall.startRead();if(this.pendingMessage)this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message);if(this.halfClosePending&&!this.writeFilterPending)this.childCall.halfClose()}async sendMessageWithContext(Y,Z){this.writeFilterPending=!0;let W=await this.filterStack.sendMessage(Promise.resolve({message:Z,flags:Y.flags}));if(this.writeFilterPending=!1,this.childCall){if(this.childCall.sendMessageWithContext(Y,W.message),this.halfClosePending)this.childCall.halfClose()}else this.pendingMessage={context:Y,message:W.message}}startRead(){if(this.childCall)this.childCall.startRead();else this.readPending=!0}halfClose(){if(this.childCall&&!this.writeFilterPending)this.childCall.halfClose();else this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(Y){throw Error("Method not implemented.")}getAuthContext(){if(this.childCall)return this.childCall.getAuthContext();else return null}}class Fr{constructor(Y,Z,W){if(this.subchannel=Y,this.target=Z,this.channelzEnabled=!1,this.channelzTrace=new KX.ChannelzTrace,this.callTracker=new KX.ChannelzCallTracker,this.childrenTracker=new KX.ChannelzChildrenTracker,this.channelzEnabled=W["grpc.enable_channelz"]!==0,this.channelzRef=(0,KX.registerChannelzChannel)((0,r3.uriToString)(Z),()=>({target:`${(0,r3.uriToString)(Z)} (${Y.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled)this.childrenTracker.refChild(Y.getChannelzRef());this.filterStackFactory=new wL0.FilterStackFactory([new ML0.CompressionFilterFactory(this,W)])}close(){if(this.channelzEnabled)this.childrenTracker.unrefChild(this.subchannel.getChannelzRef());(0,KX.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,r3.uriToString)(this.target)}getConnectivityState(Y){throw Error("Method not implemented.")}watchConnectivityState(Y,Z,W){throw Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(Y,Z){let W={deadline:Z,host:(0,SL0.getDefaultAuthority)(this.target),flags:GX.Propagate.DEFAULTS,parentCall:null};return new Gr(this.subchannel,Y,this.filterStackFactory,W,(0,EL0.getNextCallNumber)())}}Hr.SingleSubchannelChannel=Fr});var Ur=H0((Br)=>{Object.defineProperty(Br,"__esModule",{value:!0});Br.Subchannel=void 0;var T6=k8(),fL0=yY(),KA=M6(),a3=a1(),kL0=f8(),yL0=u8(),H4=O5(),vL0=qr(),hL0="subchannel",jL0=2147483647;class zr{constructor(Y,Z,W,H,F){var X;this.channelTarget=Y,this.subchannelAddress=Z,this.options=W,this.connector=F,this.connectivityState=T6.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 J={initialDelay:W["grpc.initial_reconnect_backoff_ms"],maxDelay:W["grpc.max_reconnect_backoff_ms"]};if(this.backoffTimeout=new fL0.BackoffTimeout(()=>{this.handleBackoffTimer()},J),this.backoffTimeout.unref(),this.subchannelAddressString=(0,yL0.subchannelAddressToString)(Z),this.keepaliveTime=(X=W["grpc.keepalive_time_ms"])!==null&&X!==void 0?X:-1,W["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new H4.ChannelzTraceStub,this.callTracker=new H4.ChannelzCallTrackerStub,this.childrenTracker=new H4.ChannelzChildrenTrackerStub,this.streamTracker=new H4.ChannelzCallTrackerStub;else this.channelzTrace=new H4.ChannelzTrace,this.callTracker=new H4.ChannelzCallTracker,this.childrenTracker=new H4.ChannelzChildrenTracker,this.streamTracker=new H4.ChannelzCallTracker;this.channelzRef=(0,H4.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(W,void 0,2)),this.secureConnector=H._createSecureConnector(Y,W)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(Y){KA.trace(a3.LogVerbosity.DEBUG,hL0,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}refTrace(Y){KA.trace(a3.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}handleBackoffTimer(){if(this.continueConnecting)this.transitionToState([T6.ConnectivityState.TRANSIENT_FAILURE],T6.ConnectivityState.CONNECTING);else this.transitionToState([T6.ConnectivityState.TRANSIENT_FAILURE],T6.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let Y=this.options;if(Y["grpc.keepalive_time_ms"]){let Z=Math.min(this.keepaliveTime,jL0);Y=Object.assign(Object.assign({},Y),{"grpc.keepalive_time_ms":Z})}this.connector.connect(this.subchannelAddress,this.secureConnector,Y).then((Z)=>{if(this.transitionToState([T6.ConnectivityState.CONNECTING],T6.ConnectivityState.READY)){if(this.transport=Z,this.channelzEnabled)this.childrenTracker.refChild(Z.getChannelzRef());Z.addDisconnectListener((W)=>{if(this.transitionToState([T6.ConnectivityState.READY],T6.ConnectivityState.IDLE),W&&this.keepaliveTime>0)this.keepaliveTime*=2,KA.log(a3.LogVerbosity.ERROR,`Connection to ${(0,kL0.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`)})}else Z.shutdown()},(Z)=>{this.transitionToState([T6.ConnectivityState.CONNECTING],T6.ConnectivityState.TRANSIENT_FAILURE,`${Z}`)})}transitionToState(Y,Z,W){var H,F;if(Y.indexOf(this.connectivityState)===-1)return!1;if(W)this.trace(T6.ConnectivityState[this.connectivityState]+" -> "+T6.ConnectivityState[Z]+' with error "'+W+'"');else this.trace(T6.ConnectivityState[this.connectivityState]+" -> "+T6.ConnectivityState[Z]);if(this.channelzEnabled)this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+T6.ConnectivityState[Z]);let X=this.connectivityState;switch(this.connectivityState=Z,Z){case T6.ConnectivityState.READY:this.stopBackoff();break;case T6.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case T6.ConnectivityState.TRANSIENT_FAILURE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());if((H=this.transport)===null||H===void 0||H.shutdown(),this.transport=null,!this.backoffTimeout.isRunning())process.nextTick(()=>{this.handleBackoffTimer()});break;case T6.ConnectivityState.IDLE:if(this.channelzEnabled&&this.transport)this.childrenTracker.unrefChild(this.transport.getChannelzRef());(F=this.transport)===null||F===void 0||F.shutdown(),this.transport=null;break;default:throw Error(`Invalid state: unknown ConnectivityState ${Z}`)}for(let J of this.stateListeners)J(this,X,Z,this.keepaliveTime,W);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){if(this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0)this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,H4.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([T6.ConnectivityState.CONNECTING,T6.ConnectivityState.READY],T6.ConnectivityState.IDLE)})}unrefIfOneRef(){if(this.refcount===1)return this.unref(),!0;return!1}createCall(Y,Z,W,H){if(!this.transport)throw Error("Cannot create call, subchannel not READY");let F;if(this.channelzEnabled)this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),F={onCallEnd:(X)=>{if(X.code===a3.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()}};else F={};return this.transport.createCall(Y,Z,W,H,F)}startConnecting(){process.nextTick(()=>{if(!this.transitionToState([T6.ConnectivityState.IDLE],T6.ConnectivityState.CONNECTING)){if(this.connectivityState===T6.ConnectivityState.TRANSIENT_FAILURE)this.continueConnecting=!0}})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(Y){this.stateListeners.add(Y)}removeConnectivityStateListener(Y){this.stateListeners.delete(Y)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([T6.ConnectivityState.TRANSIENT_FAILURE],T6.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(Y){}removeHealthStateWatcher(Y){}getRealSubchannel(){return this}realSubchannelEquals(Y){return Y.getRealSubchannel()===this}throttleKeepalive(Y){if(Y>this.keepaliveTime)this.keepaliveTime=Y}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){if(!this.subchannelChannel)this.subchannelChannel=new vL0.SingleSubchannelChannel(this,this.channelTarget,this.options);return this.subchannelChannel}addDataWatcher(Y){throw Error("Not implemented")}getOrCreateDataProducer(Y,Z){let W=this.dataProducers.get(Y);if(W)return W;let H=Z(this);return this.dataProducers.set(Y,H),H}removeDataProducer(Y){this.dataProducers.delete(Y)}}Br.Subchannel=zr});var Dr=H0((Nr)=>{var GA;Object.defineProperty(Nr,"__esModule",{value:!0});Nr.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;Nr.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((GA=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&GA!==void 0?GA:"false")==="true"});var VA=H0((Er)=>{Object.defineProperty(Er,"__esModule",{value:!0});Er.DEFAULT_PORT=void 0;Er.setup=cL0;var Tr=S9(),FA=V1("dns"),_L0=iz(),HA=a1(),iY=U7(),xL0=K8(),bL0=M6(),uL0=a1(),D5=f8(),Ir=V1("net"),mL0=yY(),$r=Dr(),gL0="dns_resolver";function V4(Y){bL0.trace(uL0.LogVerbosity.DEBUG,gL0,Y)}Er.DEFAULT_PORT=443;var dL0=30000;class Cr{constructor(Y,Z,W){var H,F,X;if(this.target=Y,this.listener=Z,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 FA.promises.Resolver,V4("Resolver constructed for target "+(0,D5.uriToString)(Y)),Y.authority)this.alternativeResolver.setServers([Y.authority]);let J=(0,D5.splitHostPort)(Y.path);if(J===null)this.ipResult=null,this.dnsHostname=null,this.port=null;else if((0,Ir.isIPv4)(J.host)||(0,Ir.isIPv6)(J.host))this.ipResult=[{addresses:[{host:J.host,port:(H=J.port)!==null&&H!==void 0?H:Er.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null;else this.ipResult=null,this.dnsHostname=J.host,this.port=(F=J.port)!==null&&F!==void 0?F:Er.DEFAULT_PORT;if(this.percentage=Math.random()*100,W["grpc.service_config_disable_resolution"]===1)this.isServiceConfigEnabled=!1;this.defaultResolutionError={code:HA.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,D5.uriToString)(this.target)}`,metadata:new xL0.Metadata};let Q={initialDelay:W["grpc.initial_reconnect_backoff_ms"],maxDelay:W["grpc.max_reconnect_backoff_ms"]};this.backoff=new mL0.BackoffTimeout(()=>{if(this.continueResolving)this.startResolutionWithBackoff()},Q),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(X=W["grpc.dns_min_time_between_resolutions_ms"])!==null&&X!==void 0?X:dL0,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){if(!this.returnedIpResult)V4("Returning IP address for target "+(0,D5.uriToString)(this.target)),setImmediate(()=>{this.listener((0,iY.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0;this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)V4("Failed to parse DNS address "+(0,D5.uriToString)(this.target)),setImmediate(()=>{this.listener((0,iY.statusOrFromError)({code:HA.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,D5.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;V4("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let Y=this.dnsHostname;if(this.pendingLookupPromise=this.lookup(Y),this.pendingLookupPromise.then((Z)=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,iY.statusOrFromValue)(Z.map((F)=>({addresses:[F]})));let W="["+Z.map((F)=>F.host+":"+F.port).join(",")+"]";V4("Resolved addresses for target "+(0,D5.uriToString)(this.target)+": "+W);let H=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(H)},(Z)=>{if(this.pendingLookupPromise===null)return;V4("Resolution error for target "+(0,D5.uriToString)(this.target)+": "+Z.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,iY.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,"")}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null)this.pendingTxtPromise=this.resolveTxt(Y),this.pendingTxtPromise.then((Z)=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let W;try{if(W=(0,_L0.extractAndSelectServiceConfig)(Z,this.percentage),W)this.latestServiceConfigResult=(0,iY.statusOrFromValue)(W);else this.latestServiceConfigResult=null}catch(H){this.latestServiceConfigResult=(0,iY.statusOrFromError)({code:HA.Status.UNAVAILABLE,details:`Parsing service config failed with error ${H.message}`})}if(this.latestLookupResult!==null)this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},(Z)=>{})}}handleHealthStatus(Y){if(Y)this.backoff.stop(),this.backoff.reset();else this.continueResolving=!0}async lookup(Y){if($r.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){V4("Using alternative DNS resolver.");let W=await Promise.allSettled([this.alternativeResolver.resolve4(Y),this.alternativeResolver.resolve6(Y)]);if(W.every((H)=>H.status==="rejected"))throw Error(W[0].reason);return W.reduce((H,F)=>{return F.status==="fulfilled"?[...H,...F.value]:H},[]).map((H)=>({host:H,port:+this.port}))}return(await FA.promises.lookup(Y,{all:!0})).map((W)=>({host:W.address,port:+this.port}))}async resolveTxt(Y){if($r.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)return V4("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(Y);return FA.promises.resolveTxt(Y)}startNextResolutionTimer(){var Y,Z;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{if(this.stopNextResolutionTimer(),this.continueResolving)this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(Z=(Y=this.nextResolutionTimer).unref)===null||Z===void 0||Z.call(Y),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){if(this.pendingLookupPromise===null)this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution()}updateResolution(){if(this.pendingLookupPromise===null)if(this.isNextResolutionTimerRunning||this.backoff.isRunning()){if(this.isNextResolutionTimerRunning)V4('resolution update delayed by "min time between resolutions" rate limit');else V4("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString());this.continueResolving=!0}else 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(Y){return Y.path}}function cL0(){(0,Tr.registerResolver)("dns",Cr),(0,Tr.registerDefaultScheme)("dns")}});var qA=H0((wr)=>{Object.defineProperty(wr,"__esModule",{value:!0});wr.parseCIDR=Pr;wr.mapProxyName=Yw0;wr.getProxiedConnection=Zw0;var FX=M6(),rY=a1(),Rr=V1("net"),nL0=V1("http"),pL0=M6(),Mr=u8(),HX=f8(),iL0=V1("url"),rL0=VA(),aL0="proxy";function aY(Y){pL0.trace(rY.LogVerbosity.DEBUG,aL0,Y)}function oL0(){let Y="",Z="";if(process.env.grpc_proxy)Z="grpc_proxy",Y=process.env.grpc_proxy;else if(process.env.https_proxy)Z="https_proxy",Y=process.env.https_proxy;else if(process.env.http_proxy)Z="http_proxy",Y=process.env.http_proxy;else return{};let W;try{W=new iL0.URL(Y)}catch(Q){return(0,FX.log)(rY.LogVerbosity.ERROR,`cannot parse value of "${Z}" env var`),{}}if(W.protocol!=="http:")return(0,FX.log)(rY.LogVerbosity.ERROR,`"${W.protocol}" scheme not supported in proxy URI`),{};let H=null;if(W.username)if(W.password)(0,FX.log)(rY.LogVerbosity.INFO,"userinfo found in proxy URI"),H=decodeURIComponent(`${W.username}:${W.password}`);else H=W.username;let{hostname:F,port:X}=W;if(X==="")X="80";let J={address:`${F}:${X}`};if(H)J.creds=H;return aY("Proxy server "+J.address+" set by environment variable "+Z),J}function tL0(){let Y=process.env.no_grpc_proxy,Z="no_grpc_proxy";if(!Y)Y=process.env.no_proxy,Z="no_proxy";if(Y)return aY("No proxy server list set by environment variable "+Z),Y.split(",");else return[]}function Pr(Y){let Z=Y.split("/");if(Z.length!==2)return null;let W=parseInt(Z[1],10);if(!(0,Rr.isIPv4)(Z[0])||Number.isNaN(W)||W<0||W>32)return null;return{ip:Lr(Z[0]),prefixLength:W}}function Lr(Y){return Y.split(".").reduce((Z,W)=>(Z<<8)+parseInt(W,10),0)}function sL0(Y,Z){let W=Y.ip,H=-1<<32-Y.prefixLength;return(Lr(Z)&H)===(W&H)}function eL0(Y){for(let Z of tL0()){let W=Pr(Z);if((0,Rr.isIPv4)(Y)&&W&&sL0(W,Y))return!0;else if(Y.endsWith(Z))return!0}return!1}function Yw0(Y,Z){var W;let H={target:Y,extraOptions:{}};if(((W=Z["grpc.enable_http_proxy"])!==null&&W!==void 0?W:1)===0)return H;if(Y.scheme==="unix")return H;let F=oL0();if(!F.address)return H;let X=(0,HX.splitHostPort)(Y.path);if(!X)return H;let J=X.host;if(eL0(J))return aY("Not using proxy for target in no_proxy list: "+(0,HX.uriToString)(Y)),H;let Q={"grpc.http_connect_target":(0,HX.uriToString)(Y)};if(F.creds)Q["grpc.http_connect_creds"]=F.creds;return{target:{scheme:"dns",path:F.address},extraOptions:Q}}function Zw0(Y,Z){var W;if(!("grpc.http_connect_target"in Z))return Promise.resolve(null);let H=Z["grpc.http_connect_target"],F=(0,HX.parseUri)(H);if(F===null)return Promise.resolve(null);let X=(0,HX.splitHostPort)(F.path);if(X===null)return Promise.resolve(null);let J=`${X.host}:${(W=X.port)!==null&&W!==void 0?W:rL0.DEFAULT_PORT}`,Q={method:"CONNECT",path:J},G={Host:J};if((0,Mr.isTcpSubchannelAddress)(Y))Q.host=Y.host,Q.port=Y.port;else Q.socketPath=Y.path;if("grpc.http_connect_creds"in Z)G["Proxy-Authorization"]="Basic "+Buffer.from(Z["grpc.http_connect_creds"]).toString("base64");Q.headers=G;let q=(0,Mr.subchannelAddressToString)(Y);return aY("Using proxy "+q+" to connect to "+Q.path),new Promise((K,V)=>{let B=nL0.request(Q);B.once("connect",(I,M,E)=>{if(B.removeAllListeners(),M.removeAllListeners(),I.statusCode===200){if(aY("Successfully connected to "+Q.path+" through proxy "+q),E.length>0)M.unshift(E);aY("Successfully established a plaintext connection to "+Q.path+" through proxy "+q),K(M)}else(0,FX.log)(rY.LogVerbosity.ERROR,"Failed to connect to "+Q.path+" through proxy "+q+" with status "+I.statusCode),V()}),B.once("error",(I)=>{B.removeAllListeners(),(0,FX.log)(rY.LogVerbosity.ERROR,"Failed to connect to proxy "+q+" with error "+I.message),V()}),B.end()})}});var zA=H0((fr)=>{Object.defineProperty(fr,"__esModule",{value:!0});fr.StreamDecoder=void 0;var q4;(function(Y){Y[Y.NO_DATA=0]="NO_DATA",Y[Y.READING_SIZE=1]="READING_SIZE",Y[Y.READING_MESSAGE=2]="READING_MESSAGE"})(q4||(q4={}));class Sr{constructor(Y){this.maxReadMessageLength=Y,this.readState=q4.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(Y){let Z=0,W,H=[];while(Z<Y.length)switch(this.readState){case q4.NO_DATA:this.readCompressFlag=Y.slice(Z,Z+1),Z+=1,this.readState=q4.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case q4.READING_SIZE:if(W=Math.min(Y.length-Z,this.readSizeRemaining),Y.copy(this.readPartialSize,4-this.readSizeRemaining,Z,Z+W),this.readSizeRemaining-=W,Z+=W,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=q4.READING_MESSAGE;else{let F=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=q4.NO_DATA,H.push(F)}}break;case q4.READING_MESSAGE:if(W=Math.min(Y.length-Z,this.readMessageRemaining),this.readPartialMessage.push(Y.slice(Z,Z+W)),this.readMessageRemaining-=W,Z+=W,this.readMessageRemaining===0){let F=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),X=Buffer.concat(F,this.readMessageSize+5);this.readState=q4.NO_DATA,H.push(X)}break;default:throw Error("Unexpected read state")}return H}}fr.StreamDecoder=Sr});var jr=H0((vr)=>{Object.defineProperty(vr,"__esModule",{value:!0});vr.Http2SubchannelCall=void 0;var k4=V1("http2"),Ww0=V1("os"),I6=a1(),y4=K8(),Kw0=zA(),Gw0=M6(),Fw0=a1(),Hw0="subchannel_call";function Vw0(Y){for(let[Z,W]of Object.entries(Ww0.constants.errno))if(W===Y)return Z;return"Unknown system error "+Y}function BA(Y){let Z=`Received HTTP status code ${Y}`,W;switch(Y){case 400:W=I6.Status.INTERNAL;break;case 401:W=I6.Status.UNAUTHENTICATED;break;case 403:W=I6.Status.PERMISSION_DENIED;break;case 404:W=I6.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:W=I6.Status.UNAVAILABLE;break;default:W=I6.Status.UNKNOWN}return{code:W,details:Z,metadata:new y4.Metadata}}class yr{constructor(Y,Z,W,H,F){var X;this.http2Stream=Y,this.callEventTracker=Z,this.listener=W,this.transport=H,this.callId=F,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 J=(X=H.getOptions()["grpc.max_receive_message_length"])!==null&&X!==void 0?X:I6.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new Kw0.StreamDecoder(J),Y.on("response",(Q,G)=>{let q="";for(let K of Object.keys(Q))q+="\t\t"+K+": "+Q[K]+`
30
30
  `;if(this.trace(`Received server headers:
31
31
  `+q),this.httpStatusCode=Q[":status"],G&k4.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(Q);else{let K;try{K=y4.Metadata.fromHttp2Headers(Q)}catch(V){this.endCall({code:I6.Status.UNKNOWN,details:V.message,metadata:new y4.Metadata});return}this.listener.onReceiveMetadata(K)}}),Y.on("trailers",(Q)=>{this.handleTrailers(Q)}),Y.on("data",(Q)=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+Q.length);let G;try{G=this.decoder.write(Q)}catch(q){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let K=BA(this.httpStatusCode);this.cancelWithStatus(K.code,K.details)}else this.cancelWithStatus(I6.Status.RESOURCE_EXHAUSTED,q.message);return}for(let q of G)this.trace("parsed message of length "+q.length),this.callEventTracker.addMessageReceived(),this.tryPush(q)}),Y.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),Y.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var Q;if(this.trace("HTTP/2 stream closed with code "+Y.rstCode),((Q=this.finalStatus)===null||Q===void 0?void 0:Q.code)===I6.Status.OK)return;let G,q="";switch(Y.rstCode){case k4.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let K=BA(this.httpStatusCode);G=K.code,q=K.details}else G=I6.Status.INTERNAL,q=`Received RST_STREAM with code ${Y.rstCode} (Call ended without gRPC status)`;break;case k4.constants.NGHTTP2_REFUSED_STREAM:G=I6.Status.UNAVAILABLE,q="Stream refused by server";break;case k4.constants.NGHTTP2_CANCEL:if(this.connectionDropped)G=I6.Status.UNAVAILABLE,q="Connection dropped";else G=I6.Status.CANCELLED,q="Call cancelled";break;case k4.constants.NGHTTP2_ENHANCE_YOUR_CALM:G=I6.Status.RESOURCE_EXHAUSTED,q="Bandwidth exhausted or memory limit exceeded";break;case k4.constants.NGHTTP2_INADEQUATE_SECURITY:G=I6.Status.PERMISSION_DENIED,q="Protocol not secure enough";break;case k4.constants.NGHTTP2_INTERNAL_ERROR:if(G=I6.Status.INTERNAL,this.internalError===null)q=`Received RST_STREAM with code ${Y.rstCode} (Internal server error)`;else if(this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT")G=I6.Status.UNAVAILABLE,q=this.internalError.message;else q=`Received RST_STREAM with code ${Y.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:G=I6.Status.INTERNAL,q=`Received RST_STREAM with code ${Y.rstCode}`}this.endCall({code:G,details:q,metadata:new y4.Metadata,rstCode:Y.rstCode})})}),Y.on("error",(Q)=>{if(Q.code!=="ERR_HTTP2_STREAM_ERROR")this.trace("Node error event: message="+Q.message+" code="+Q.code+" errno="+Vw0(Q.errno)+" syscall="+Q.syscall),this.internalError=Q;this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:I6.Status.UNAVAILABLE,details:"Connection dropped",metadata:new y4.Metadata})})}outputStatus(){if(!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(Y){Gw0.trace(Fw0.LogVerbosity.DEBUG,Hw0,"["+this.callId+"] "+Y)}endCall(Y){if(this.finalStatus===null||this.finalStatus.code===I6.Status.OK)this.finalStatus=Y,this.maybeOutputStatus();this.destroyHttp2Stream()}maybeOutputStatus(){if(this.finalStatus!==null){if(this.finalStatus.code!==I6.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)this.outputStatus()}}push(Y){this.trace("pushing to reader message of length "+(Y instanceof Buffer?Y.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{if(this.isPushPending=!1,this.statusOutput)return;this.listener.onReceiveMessage(Y),this.maybeOutputStatus()})}tryPush(Y){if(this.canPush)this.http2Stream.pause(),this.push(Y);else this.trace("unpushedReadMessages.push message of length "+Y.length),this.unpushedReadMessages.push(Y)}handleTrailers(Y){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let Z="";for(let X of Object.keys(Y))Z+="\t\t"+X+": "+Y[X]+`
32
32
  `;this.trace(`Received server trailers:
33
33
  `+Z);let W;try{W=y4.Metadata.fromHttp2Headers(Y)}catch(X){W=new y4.Metadata}let H=W.getMap(),F;if(typeof H["grpc-status"]==="string"){let X=Number(H["grpc-status"]);this.trace("received status code "+X+" from server"),W.remove("grpc-status");let J="";if(typeof H["grpc-message"]==="string"){try{J=decodeURI(H["grpc-message"])}catch(Q){J=H["grpc-message"]}W.remove("grpc-message"),this.trace('received status details string "'+J+'" from server')}F={code:X,details:J,metadata:W}}else if(this.httpStatusCode)F=BA(this.httpStatusCode),F.metadata=W;else F={code:I6.Status.UNKNOWN,details:"No status information received",metadata:W};this.endCall(F)}destroyHttp2Stream(){var Y;if(this.http2Stream.destroyed)return;if(this.serverEndedCall)this.http2Stream.end();else{let Z;if(((Y=this.finalStatus)===null||Y===void 0?void 0:Y.code)===I6.Status.OK)Z=k4.constants.NGHTTP2_NO_ERROR;else Z=k4.constants.NGHTTP2_CANCEL;this.trace("close http2 stream with code "+Z),this.http2Stream.close(Z)}}cancelWithStatus(Y,Z){this.trace("cancelWithStatus code: "+Y+' details: "'+Z+'"'),this.endCall({code:Y,details:Z,metadata:new y4.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!==I6.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let Y=this.unpushedReadMessages.shift();this.push(Y);return}this.http2Stream.resume()}sendMessageWithContext(Y,Z){this.trace("write() called with message of length "+Z.length);let W=(H)=>{process.nextTick(()=>{var F;let X=I6.Status.UNAVAILABLE;if((H===null||H===void 0?void 0:H.code)==="ERR_STREAM_WRITE_AFTER_END")X=I6.Status.INTERNAL;if(H)this.cancelWithStatus(X,`Write error: ${H.message}`);(F=Y.callback)===null||F===void 0||F.call(Y)})};this.trace("sending data chunk of length "+Z.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(Z,W)}catch(H){this.endCall({code:I6.Status.UNAVAILABLE,details:`Write failed with error ${H.message}`,metadata:new y4.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}}vr.Http2SubchannelCall=yr});var mr=H0((br)=>{Object.defineProperty(br,"__esModule",{value:!0});br.Http2SubchannelConnector=void 0;var C7=V1("http2"),qw0=V1("tls"),t3=O5(),VX=a1(),zw0=qA(),oY=M6(),Bw0=S9(),s3=u8(),AA=f8(),Aw0=V1("net"),Uw0=jr(),Nw0=n3(),UA="transport",Ow0="transport_flowctrl",Dw0=fz().version,{HTTP2_HEADER_AUTHORITY:Tw0,HTTP2_HEADER_CONTENT_TYPE:Iw0,HTTP2_HEADER_METHOD:$w0,HTTP2_HEADER_PATH:Cw0,HTTP2_HEADER_TE:Ew0,HTTP2_HEADER_USER_AGENT:Mw0}=C7.constants,Rw0=20000,Pw0=Buffer.from("too_many_pings","ascii");class _r{constructor(Y,Z,W,H){if(this.session=Y,this.options=W,this.remoteName=H,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,s3.subchannelAddressToString)(Z),W["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.streamTracker=new t3.ChannelzCallTrackerStub;else this.streamTracker=new t3.ChannelzCallTracker;if(this.channelzRef=(0,t3.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[W["grpc.primary_user_agent"],`grpc-node-js/${Dw0}`,W["grpc.secondary_user_agent"]].filter((F)=>F).join(" "),"grpc.keepalive_time_ms"in W)this.keepaliveTimeMs=W["grpc.keepalive_time_ms"];else this.keepaliveTimeMs=-1;if("grpc.keepalive_timeout_ms"in W)this.keepaliveTimeoutMs=W["grpc.keepalive_timeout_ms"];else this.keepaliveTimeoutMs=Rw0;if("grpc.keepalive_permit_without_calls"in W)this.keepaliveWithoutCalls=W["grpc.keepalive_permit_without_calls"]===1;else this.keepaliveWithoutCalls=!1;if(Y.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),Y.once("goaway",(F,X,J)=>{let Q=!1;if(F===C7.constants.NGHTTP2_ENHANCE_YOUR_CALM&&J&&J.equals(Pw0))Q=!0;this.trace("connection closed by GOAWAY with code "+F+" and data "+(J===null||J===void 0?void 0:J.toString())),this.reportDisconnectToOwner(Q)}),Y.once("error",(F)=>{this.trace("connection closed with error "+F.message),this.handleDisconnect()}),Y.socket.once("close",(F)=>{this.trace("connection closed. hadError="+F),this.handleDisconnect()}),oY.isTracerEnabled(UA))Y.on("remoteSettings",(F)=>{this.trace("new settings received"+(this.session!==Y?" on the old connection":"")+": "+JSON.stringify(F))}),Y.on("localSettings",(F)=>{this.trace("local settings acknowledged by remote"+(this.session!==Y?" on the old connection":"")+": "+JSON.stringify(F))});if(this.keepaliveWithoutCalls)this.maybeStartKeepalivePingTimer();if(Y.socket instanceof qw0.TLSSocket)this.authContext={transportSecurityType:"ssl",sslPeerCertificate:Y.socket.getPeerCertificate()};else this.authContext={}}getChannelzInfo(){var Y,Z,W;let H=this.session.socket,F=H.remoteAddress?(0,s3.stringToSubchannelAddress)(H.remoteAddress,H.remotePort):null,X=H.localAddress?(0,s3.stringToSubchannelAddress)(H.localAddress,H.localPort):null,J;if(this.session.encrypted){let G=H,q=G.getCipher(),K=G.getCertificate(),V=G.getPeerCertificate();J={cipherSuiteStandardName:(Y=q.standardName)!==null&&Y!==void 0?Y:null,cipherSuiteOtherName:q.standardName?null:q.name,localCertificate:K&&"raw"in K?K.raw:null,remoteCertificate:V&&"raw"in V?V.raw:null}}else J=null;return{remoteAddress:F,localAddress:X,security:J,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:(Z=this.session.state.localWindowSize)!==null&&Z!==void 0?Z:null,remoteFlowControlWindow:(W=this.session.state.remoteWindowSize)!==null&&W!==void 0?W:null}}trace(Y){oY.trace(VX.LogVerbosity.DEBUG,UA,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}keepaliveTrace(Y){oY.trace(VX.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}flowControlTrace(Y){oY.trace(VX.LogVerbosity.DEBUG,Ow0,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}internalsTrace(Y){oY.trace(VX.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+Y)}reportDisconnectToOwner(Y){if(this.disconnectHandled)return;this.disconnectHandled=!0,this.disconnectListeners.forEach((Z)=>Z(Y))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let Y of this.activeCalls)Y.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(Y){this.disconnectListeners.push(Y)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var Y,Z;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}if(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),(Z=(Y=this.keepaliveTimer).unref)===null||Z===void 0||Z.call(Y);let W="";try{if(!this.session.ping((F,X,J)=>{if(this.clearKeepaliveTimeout(),F)this.keepaliveTrace("Ping failed with error "+F.message),this.handleDisconnect();else this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer()}))W="Ping returned false"}catch(H){W=(H instanceof Error?H.message:"")||"Unknown error"}if(W)this.keepaliveTrace("Ping send failed: "+W),this.handleDisconnect()}maybeStartKeepalivePingTimer(){var Y,Z;if(!this.canSendPing())return;if(this.pendingSendKeepalivePing)this.pendingSendKeepalivePing=!1,this.maybeSendPing();else if(!this.keepaliveTimer)this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(Z=(Y=this.keepaliveTimer).unref)===null||Z===void 0||Z.call(Y)}clearKeepaliveTimeout(){if(this.keepaliveTimer)clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null}removeActiveCall(Y){if(this.activeCalls.delete(Y),this.activeCalls.size===0)this.session.unref()}addActiveCall(Y){if(this.activeCalls.add(Y),this.activeCalls.size===1){if(this.session.ref(),!this.keepaliveWithoutCalls)this.maybeStartKeepalivePingTimer()}}createCall(Y,Z,W,H,F){let X=Y.toHttp2Headers();X[Tw0]=Z,X[Mw0]=this.userAgent,X[Iw0]="application/grpc",X[$w0]="POST",X[Cw0]=W,X[Ew0]="trailers";let J;try{J=this.session.request(X)}catch(q){throw this.handleDisconnect(),q}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 Q,G;if(this.channelzEnabled)this.streamTracker.addCallStarted(),Q={addMessageSent:()=>{var q;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(q=F.addMessageSent)===null||q===void 0||q.call(F)},addMessageReceived:()=>{var q;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(q=F.addMessageReceived)===null||q===void 0||q.call(F)},onCallEnd:(q)=>{var K;(K=F.onCallEnd)===null||K===void 0||K.call(F,q),this.removeActiveCall(G)},onStreamEnd:(q)=>{var K;if(q)this.streamTracker.addCallSucceeded();else this.streamTracker.addCallFailed();(K=F.onStreamEnd)===null||K===void 0||K.call(F,q)}};else Q={addMessageSent:()=>{var q;(q=F.addMessageSent)===null||q===void 0||q.call(F)},addMessageReceived:()=>{var q;(q=F.addMessageReceived)===null||q===void 0||q.call(F)},onCallEnd:(q)=>{var K;(K=F.onCallEnd)===null||K===void 0||K.call(F,q),this.removeActiveCall(G)},onStreamEnd:(q)=>{var K;(K=F.onStreamEnd)===null||K===void 0||K.call(F,q)}};return G=new Uw0.Http2SubchannelCall(J,Q,H,this,(0,Nw0.getNextCallNumber)()),this.addActiveCall(G),G}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,t3.unregisterChannelzRef)(this.channelzRef)}}class xr{constructor(Y){this.channelTarget=Y,this.session=null,this.isShutdown=!1}trace(Y){oY.trace(VX.LogVerbosity.DEBUG,UA,(0,AA.uriToString)(this.channelTarget)+" "+Y)}createSession(Y,Z,W){if(this.isShutdown)return Promise.reject();if(Y.socket.closed)return Promise.reject("Connection closed before starting HTTP/2 handshake");return new Promise((H,F)=>{var X,J,Q,G,q,K,V,B;let I=null,M=this.channelTarget;if("grpc.http_connect_target"in W){let v=(0,AA.parseUri)(W["grpc.http_connect_target"]);if(v)M=v,I=(0,AA.uriToString)(v)}let E=Y.secure?"https":"http",A=(0,Bw0.getDefaultAuthority)(M),N=()=>{var v;(v=this.session)===null||v===void 0||v.destroy(),this.session=null,setImmediate(()=>{if(!k)k=!0,F(`${L.trim()} (${new Date().toISOString()})`)})},O=(v)=>{var f;if((f=this.session)===null||f===void 0||f.destroy(),L=v.message,this.trace("connection failed with error "+L),!k)k=!0,F(`${L} (${new Date().toISOString()})`)},T={createConnection:(v,f)=>{return Y.socket},settings:{initialWindowSize:(G=(X=W["grpc-node.flow_control_window"])!==null&&X!==void 0?X:(Q=(J=C7.getDefaultSettings)===null||J===void 0?void 0:J.call(C7))===null||Q===void 0?void 0:Q.initialWindowSize)!==null&&G!==void 0?G:65535},maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER,maxSessionMemory:(q=W["grpc-node.max_session_memory"])!==null&&q!==void 0?q:Number.MAX_SAFE_INTEGER},C=C7.connect(`${E}://${A}`,T),R=(B=(V=(K=C7.getDefaultSettings)===null||K===void 0?void 0:K.call(C7))===null||V===void 0?void 0:V.initialWindowSize)!==null&&B!==void 0?B:65535,w=W["grpc-node.flow_control_window"];this.session=C;let L="Failed to connect",k=!1;C.unref(),C.once("remoteSettings",()=>{var v;if(w&&w>R)try{C.setLocalWindowSize(w)}catch(f){let h=w-((v=C.state.localWindowSize)!==null&&v!==void 0?v:R);if(h>0)C.incrementWindowSize(h)}C.removeAllListeners(),Y.socket.removeListener("close",N),Y.socket.removeListener("error",O),H(new _r(C,Z,W,I)),this.session=null}),C.once("close",N),C.once("error",O),Y.socket.once("close",N),Y.socket.once("error",O)})}tcpConnect(Y,Z){return(0,zw0.getProxiedConnection)(Y,Z).then((W)=>{if(W)return W;else return new Promise((H,F)=>{let X=()=>{F(Error("Socket closed"))},J=(G)=>{F(G)},Q=Aw0.connect(Y,()=>{Q.removeListener("close",X),Q.removeListener("error",J),H(Q)});Q.once("close",X),Q.once("error",J)})})}async connect(Y,Z,W){if(this.isShutdown)return Promise.reject();let H=null,F=null,X=(0,s3.subchannelAddressToString)(Y);try{return this.trace(X+" Waiting for secureConnector to be ready"),await Z.waitForReady(),this.trace(X+" secureConnector is ready"),H=await this.tcpConnect(Y,W),H.setNoDelay(),this.trace(X+" Established TCP connection"),F=await Z.connect(H),this.trace(X+" Established secure connection"),this.createSession(F,Y,W)}catch(J){throw H===null||H===void 0||H.destroy(),F===null||F===void 0||F.socket.destroy(),J}}shutdown(){var Y;this.isShutdown=!0,(Y=this.session)===null||Y===void 0||Y.close(),this.session=null}}br.Http2SubchannelConnector=xr});var cr=H0((gr)=>{Object.defineProperty(gr,"__esModule",{value:!0});gr.SubchannelPool=void 0;gr.getSubchannelPool=hw0;var Lw0=dl(),ww0=Ur(),Sw0=u8(),fw0=f8(),kw0=mr(),yw0=1e4;class e3{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let Y=!0;for(let Z in this.pool){let H=this.pool[Z].filter((F)=>!F.subchannel.unrefIfOneRef());if(H.length>0)Y=!1;this.pool[Z]=H}if(Y&&this.cleanupTimer!==null)clearInterval(this.cleanupTimer),this.cleanupTimer=null}ensureCleanupTask(){var Y,Z;if(this.cleanupTimer===null)this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},yw0),(Z=(Y=this.cleanupTimer).unref)===null||Z===void 0||Z.call(Y)}getOrCreateSubchannel(Y,Z,W,H){this.ensureCleanupTask();let F=(0,fw0.uriToString)(Y);if(F in this.pool){let J=this.pool[F];for(let Q of J)if((0,Sw0.subchannelAddressEqual)(Z,Q.subchannelAddress)&&(0,Lw0.channelOptionsEqual)(W,Q.channelArguments)&&H._equals(Q.channelCredentials))return Q.subchannel}let X=new ww0.Subchannel(Y,Z,W,H,new kw0.Http2SubchannelConnector(Y));if(!(F in this.pool))this.pool[F]=[];return this.pool[F].push({subchannelAddress:Z,channelArguments:W,channelCredentials:H,subchannel:X}),X.ref(),X}}gr.SubchannelPool=e3;var vw0=new e3;function hw0(Y){if(Y)return vw0;else return new e3}});var ar=H0((ir)=>{Object.defineProperty(ir,"__esModule",{value:!0});ir.LoadBalancingCall=void 0;var lr=k8(),YK=a1(),nr=pY(),ZK=K8(),qX=E4(),_w0=f8(),xw0=M6(),NA=WX(),bw0=V1("http2"),uw0="load_balancing_call";class pr{constructor(Y,Z,W,H,F,X,J){var Q,G;this.channel=Y,this.callConfig=Z,this.methodName=W,this.host=H,this.credentials=F,this.deadline=X,this.callNumber=J,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 q=this.methodName.split("/"),K="";if(q.length>=2)K=q[1];let V=(G=(Q=(0,_w0.splitHostPort)(this.host))===null||Q===void 0?void 0:Q.host)!==null&&G!==void 0?G:"localhost";this.serviceUrl=`https://${V}/${K}`,this.startTime=new Date}getDeadlineInfo(){var Y,Z;let W=[];if(this.childStartTime){if(this.childStartTime>this.startTime){if((Y=this.metadata)===null||Y===void 0?void 0:Y.getOptions().waitForReady)W.push("wait_for_ready");W.push(`LB pick: ${(0,nr.formatDateDifference)(this.startTime,this.childStartTime)}`)}return W.push(...this.child.getDeadlineInfo()),W}else{if((Z=this.metadata)===null||Z===void 0?void 0:Z.getOptions().waitForReady)W.push("wait_for_ready");W.push("Waiting for LB pick")}return W}trace(Y){xw0.trace(YK.LogVerbosity.DEBUG,uw0,"["+this.callNumber+"] "+Y)}outputStatus(Y,Z){var W,H;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+Y.code+' details="'+Y.details+'" start time='+this.startTime.toISOString());let F=Object.assign(Object.assign({},Y),{progress:Z});(W=this.listener)===null||W===void 0||W.onReceiveStatus(F),(H=this.onCallEnded)===null||H===void 0||H.call(this,F.code,F.details,F.metadata)}}doPick(){var Y,Z;if(this.ended)return;if(!this.metadata)throw Error("doPick called before start");this.trace("Pick called");let W=this.metadata.clone(),H=this.channel.doPick(W,this.callConfig.pickInformation),F=H.subchannel?"("+H.subchannel.getChannelzRef().id+") "+H.subchannel.getAddress():""+H.subchannel;switch(this.trace("Pick result: "+qX.PickResultType[H.pickResultType]+" subchannel: "+F+" status: "+((Y=H.status)===null||Y===void 0?void 0:Y.code)+" "+((Z=H.status)===null||Z===void 0?void 0:Z.details)),H.pickResultType){case qX.PickResultType.COMPLETE:this.credentials.compose(H.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then((G)=>{var q;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(W.merge(G),W.get("authorization").length>1)this.outputStatus({code:YK.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new ZK.Metadata},"PROCESSED");if(H.subchannel.getConnectivityState()!==lr.ConnectivityState.READY){this.trace("Picked subchannel "+F+" has state "+lr.ConnectivityState[H.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}if(this.deadline!==1/0)W.set("grpc-timeout",(0,nr.getDeadlineTimeoutString)(this.deadline));try{this.child=H.subchannel.getRealSubchannel().createCall(W,this.host,this.methodName,{onReceiveMetadata:(K)=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(K)},onReceiveMessage:(K)=>{this.trace("Received message"),this.listener.onReceiveMessage(K)},onReceiveStatus:(K)=>{if(this.trace("Received status"),K.rstCode===bw0.constants.NGHTTP2_REFUSED_STREAM)this.outputStatus(K,"REFUSED");else this.outputStatus(K,"PROCESSED")}}),this.childStartTime=new Date}catch(K){this.trace("Failed to start call on picked subchannel "+F+" with error "+K.message),this.outputStatus({code:YK.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+K.message,metadata:new ZK.Metadata},"NOT_STARTED");return}if((q=H.onCallStarted)===null||q===void 0||q.call(H),this.onCallEnded=H.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending)this.child.startRead();if(this.pendingMessage)this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message);if(this.pendingHalfClose)this.child.halfClose()},(G)=>{let{code:q,details:K}=(0,NA.restrictControlPlaneStatusCode)(typeof G.code==="number"?G.code:YK.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${G.message}`);this.outputStatus({code:q,details:K,metadata:new ZK.Metadata},"PROCESSED")});break;case qX.PickResultType.DROP:let{code:J,details:Q}=(0,NA.restrictControlPlaneStatusCode)(H.status.code,H.status.details);setImmediate(()=>{this.outputStatus({code:J,details:Q,metadata:H.status.metadata},"DROP")});break;case qX.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:G,details:q}=(0,NA.restrictControlPlaneStatusCode)(H.status.code,H.status.details);setImmediate(()=>{this.outputStatus({code:G,details:q,metadata:H.status.metadata},"PROCESSED")})}break;case qX.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(Y,Z){var W;this.trace("cancelWithStatus code: "+Y+' details: "'+Z+'"'),(W=this.child)===null||W===void 0||W.cancelWithStatus(Y,Z),this.outputStatus({code:Y,details:Z,metadata:new ZK.Metadata},"PROCESSED")}getPeer(){var Y,Z;return(Z=(Y=this.child)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:this.channel.getTarget()}start(Y,Z){this.trace("start called"),this.listener=Z,this.metadata=Y,this.doPick()}sendMessageWithContext(Y,Z){if(this.trace("write() called with message of length "+Z.length),this.child)this.child.sendMessageWithContext(Y,Z);else this.pendingMessage={context:Y,message:Z}}startRead(){if(this.trace("startRead called"),this.child)this.child.startRead();else this.readPending=!0}halfClose(){if(this.trace("halfClose called"),this.child)this.child.halfClose();else this.pendingHalfClose=!0}setCredentials(Y){throw Error("Method not implemented.")}getCallNumber(){return this.callNumber}getAuthContext(){if(this.child)return this.child.getAuthContext();else return null}}ir.LoadBalancingCall=pr});var Ya=H0((sr)=>{Object.defineProperty(sr,"__esModule",{value:!0});sr.ResolvingCall=void 0;var mw0=J3(),E7=a1(),M7=pY(),or=K8(),gw0=M6(),dw0=WX(),cw0="resolving_call";class tr{constructor(Y,Z,W,H,F){if(this.channel=Y,this.method=Z,this.filterStackFactory=H,this.callNumber=F,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=mw0.CallCredentials.createEmpty(),this.deadline=W.deadline,this.host=W.host,W.parentCall){if(W.flags&E7.Propagate.CANCELLATION)W.parentCall.on("cancelled",()=>{this.cancelWithStatus(E7.Status.CANCELLED,"Cancelled by parent call")});if(W.flags&E7.Propagate.DEADLINE)this.trace("Propagating deadline from parent: "+W.parentCall.getDeadline()),this.deadline=(0,M7.minDeadline)(this.deadline,W.parentCall.getDeadline())}this.trace("Created"),this.runDeadlineTimer()}trace(Y){gw0.trace(E7.LogVerbosity.DEBUG,cw0,"["+this.callNumber+"] "+Y)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,M7.deadlineToString)(this.deadline));let Y=(0,M7.getRelativeTimeout)(this.deadline);if(Y!==1/0){this.trace("Deadline will be reached in "+Y+"ms");let Z=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(E7.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let W=[],H=new Date;if(W.push(`Deadline exceeded after ${(0,M7.formatDateDifference)(this.deadlineStartTime,H)}`),this.configReceivedTime){if(this.configReceivedTime>this.deadlineStartTime)W.push(`name resolution: ${(0,M7.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`);if(this.childStartTime){if(this.childStartTime>this.configReceivedTime)W.push(`metadata filters: ${(0,M7.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`)}else W.push("waiting for metadata filters")}else W.push("waiting for name resolution");if(this.child)W.push(...this.child.getDeadlineInfo());this.cancelWithStatus(E7.Status.DEADLINE_EXCEEDED,W.join(","))};if(Y<=0)process.nextTick(Z);else this.deadlineTimer=setTimeout(Z,Y)}}outputStatus(Y){if(!this.ended){if(this.ended=!0,!this.filterStack)this.filterStack=this.filterStackFactory.createFilter();clearTimeout(this.deadlineTimer);let Z=this.filterStack.receiveTrailers(Y);this.trace("ended with status: code="+Z.code+' details="'+Z.details+'"'),this.statusWatchers.forEach((W)=>W(Z)),process.nextTick(()=>{var W;(W=this.listener)===null||W===void 0||W.onReceiveStatus(Z)})}}sendMessageOnChild(Y,Z){if(!this.child)throw Error("sendMessageonChild called with child not populated");let W=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:Z,flags:Y.flags})).then((H)=>{if(this.writeFilterPending=!1,W.sendMessageWithContext(Y,H.message),this.pendingHalfClose)W.halfClose()},(H)=>{this.cancelWithStatus(H.code,H.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw Error("getConfig called before start");let Y=this.channel.getConfig(this.method,this.metadata);if(Y.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(Y.type==="ERROR"){if(this.metadata.getOptions().waitForReady)this.channel.queueCallForConfig(this);else this.outputStatus(Y.error);return}this.configReceivedTime=new Date;let Z=Y.config;if(Z.status!==E7.Status.OK){let{code:W,details:H}=(0,dw0.restrictControlPlaneStatusCode)(Z.status,"Failed to route call to method "+this.method);this.outputStatus({code:W,details:H,metadata:new or.Metadata});return}if(Z.methodConfig.timeout){let W=new Date;W.setSeconds(W.getSeconds()+Z.methodConfig.timeout.seconds),W.setMilliseconds(W.getMilliseconds()+Z.methodConfig.timeout.nanos/1e6),this.deadline=(0,M7.minDeadline)(this.deadline,W),this.runDeadlineTimer()}this.filterStackFactory.push(Z.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then((W)=>{if(this.child=this.channel.createRetryingCall(Z,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(W,{onReceiveMetadata:(H)=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(H))},onReceiveMessage:(H)=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(H).then((F)=>{if(this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(F),this.pendingChildStatus)this.outputStatus(this.pendingChildStatus)},(F)=>{this.cancelWithStatus(F.code,F.details)})},onReceiveStatus:(H)=>{if(this.trace("Received status"),this.readFilterPending)this.pendingChildStatus=H;else this.outputStatus(H)}}),this.readPending)this.child.startRead();if(this.pendingMessage)this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message);else if(this.pendingHalfClose)this.child.halfClose()},(W)=>{this.outputStatus(W)})}reportResolverError(Y){var Z;if((Z=this.metadata)===null||Z===void 0?void 0:Z.getOptions().waitForReady)this.channel.queueCallForConfig(this);else this.outputStatus(Y)}cancelWithStatus(Y,Z){var W;this.trace("cancelWithStatus code: "+Y+' details: "'+Z+'"'),(W=this.child)===null||W===void 0||W.cancelWithStatus(Y,Z),this.outputStatus({code:Y,details:Z,metadata:new or.Metadata})}getPeer(){var Y,Z;return(Z=(Y=this.child)===null||Y===void 0?void 0:Y.getPeer())!==null&&Z!==void 0?Z:this.channel.getTarget()}start(Y,Z){this.trace("start called"),this.metadata=Y.clone(),this.listener=Z,this.getConfig()}sendMessageWithContext(Y,Z){if(this.trace("write() called with message of length "+Z.length),this.child)this.sendMessageOnChild(Y,Z);else this.pendingMessage={context:Y,message:Z}}startRead(){if(this.trace("startRead called"),this.child)this.child.startRead();else this.readPending=!0}halfClose(){if(this.trace("halfClose called"),this.child&&!this.writeFilterPending)this.child.halfClose();else this.pendingHalfClose=!0}setCredentials(Y){this.credentials=Y}addStatusWatcher(Y){this.statusWatchers.push(Y)}getCallNumber(){return this.callNumber}getAuthContext(){if(this.child)return this.child.getAuthContext();else return null}}sr.ResolvingCall=tr});var Ka=H0((Ja)=>{Object.defineProperty(Ja,"__esModule",{value:!0});Ja.RetryingCall=Ja.MessageBufferTracker=Ja.RetryThrottler=void 0;var QK=a1(),lw0=pY(),nw0=K8(),pw0=M6(),iw0="retrying_call";class Za{constructor(Y,Z,W){if(this.maxTokens=Y,this.tokenRatio=Z,W)this.tokens=W.tokens*(Y/W.maxTokens);else this.tokens=Y}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}}Ja.RetryThrottler=Za;class Qa{constructor(Y,Z){this.totalLimit=Y,this.limitPerCall=Z,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(Y,Z){var W;let H=(W=this.allocatedPerCall.get(Z))!==null&&W!==void 0?W:0;if(this.limitPerCall-H<Y||this.totalLimit-this.totalAllocated<Y)return!1;return this.allocatedPerCall.set(Z,H+Y),this.totalAllocated+=Y,!0}free(Y,Z){var W;if(this.totalAllocated<Y)throw Error(`Invalid buffer allocation state: call ${Z} freed ${Y} > total allocated ${this.totalAllocated}`);this.totalAllocated-=Y;let H=(W=this.allocatedPerCall.get(Z))!==null&&W!==void 0?W:0;if(H<Y)throw Error(`Invalid buffer allocation state: call ${Z} freed ${Y} > allocated for call ${H}`);this.allocatedPerCall.set(Z,H-Y)}freeAll(Y){var Z;let W=(Z=this.allocatedPerCall.get(Y))!==null&&Z!==void 0?Z:0;if(this.totalAllocated<W)throw Error(`Invalid buffer allocation state: call ${Y} allocated ${W} > total allocated ${this.totalAllocated}`);this.totalAllocated-=W,this.allocatedPerCall.delete(Y)}}Ja.MessageBufferTracker=Qa;var OA="grpc-previous-rpc-attempts",rw0=5;class Xa{constructor(Y,Z,W,H,F,X,J,Q,G){var q;this.channel=Y,this.callConfig=Z,this.methodName=W,this.host=H,this.credentials=F,this.deadline=X,this.callNumber=J,this.bufferTracker=Q,this.retryThrottler=G,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 K=(q=Y.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&q!==void 0?q:rw0;if(Y.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(Z.methodConfig.retryPolicy){this.state="RETRY";let V=Z.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(V.initialBackoff.substring(0,V.initialBackoff.length-1)),this.maxAttempts=Math.min(V.maxAttempts,K)}else if(Z.methodConfig.hedgingPolicy)this.state="HEDGING",this.maxAttempts=Math.min(Z.methodConfig.hedgingPolicy.maxAttempts,K);else this.state="TRANSPARENT_ONLY",this.maxAttempts=1;this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let Y=[],Z=this.underlyingCalls[this.underlyingCalls.length-1];if(this.underlyingCalls.length>1)Y.push(`previous attempts: ${this.underlyingCalls.length-1}`);if(Z.startTime>this.startTime)Y.push(`time to current attempt start: ${(0,lw0.formatDateDifference)(this.startTime,Z.startTime)}`);return Y.push(...Z.call.getDeadlineInfo()),Y}getCallNumber(){return this.callNumber}trace(Y){pw0.trace(QK.LogVerbosity.DEBUG,iw0,"["+this.callNumber+"] "+Y)}reportStatus(Y){this.trace("ended with status: code="+Y.code+' details="'+Y.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var Z;(Z=this.listener)===null||Z===void 0||Z.onReceiveStatus({code:Y.code,details:Y.details,metadata:Y.metadata})})}cancelWithStatus(Y,Z){this.trace("cancelWithStatus code: "+Y+' details: "'+Z+'"'),this.reportStatus({code:Y,details:Z,metadata:new nw0.Metadata});for(let{call:W}of this.underlyingCalls)W.cancelWithStatus(Y,Z)}getPeer(){if(this.committedCallIndex!==null)return this.underlyingCalls[this.committedCallIndex].call.getPeer();else return"unknown"}getBufferEntry(Y){var Z;return(Z=this.writeBuffer[Y-this.writeBufferOffset])!==null&&Z!==void 0?Z:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let Y;if(this.underlyingCalls[this.committedCallIndex].state==="COMPLETED")Y=this.getNextBufferIndex();else Y=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let Z=this.writeBufferOffset;Z<Y;Z++){let W=this.getBufferEntry(Z);if(W.allocated)this.bufferTracker.free(W.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(Y-this.writeBufferOffset),this.writeBufferOffset=Y}commitCall(Y){var Z,W;if(this.state==="COMMITTED")return;this.trace("Committing call ["+this.underlyingCalls[Y].call.getCallNumber()+"] at index "+Y),this.state="COMMITTED",(W=(Z=this.callConfig).onCommitted)===null||W===void 0||W.call(Z),this.committedCallIndex=Y;for(let H=0;H<this.underlyingCalls.length;H++){if(H===Y)continue;if(this.underlyingCalls[H].state==="COMPLETED")continue;this.underlyingCalls[H].state="COMPLETED",this.underlyingCalls[H].call.cancelWithStatus(QK.Status.CANCELLED,"Discarded in favor of other hedged attempt")}this.clearSentMessages()}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let Y=-1,Z=-1;for(let[W,H]of this.underlyingCalls.entries())if(H.state==="ACTIVE"&&H.nextMessageToSend>Y)Y=H.nextMessageToSend,Z=W;if(Z===-1)this.state="TRANSPARENT_ONLY";else this.commitCall(Z)}isStatusCodeInList(Y,Z){return Y.some((W)=>{var H;return W===Z||W.toString().toLowerCase()===((H=QK.Status[Z])===null||H===void 0?void 0:H.toLowerCase())})}getNextRetryJitter(){return Math.random()*0.3999999999999999+0.8}getNextRetryBackoffMs(){var Y;let Z=(Y=this.callConfig)===null||Y===void 0?void 0:Y.methodConfig.retryPolicy;if(!Z)return 0;let H=this.getNextRetryJitter()*this.nextRetryBackoffSec*1000,F=Number(Z.maxBackoff.substring(0,Z.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*Z.backoffMultiplier,F),H}maybeRetryCall(Y,Z){if(this.state!=="RETRY"){Z(!1);return}if(this.attempts>=this.maxAttempts){Z(!1);return}let W;if(Y===null)W=this.getNextRetryBackoffMs();else if(Y<0){this.state="TRANSPARENT_ONLY",Z(!1);return}else W=Y,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var H,F;if(this.state!=="RETRY"){Z(!1);return}if((F=(H=this.retryThrottler)===null||H===void 0?void 0:H.canRetryCall())!==null&&F!==void 0?F:!0)Z(!0),this.attempts+=1,this.startNewAttempt();else this.trace("Retry attempt denied by throttling policy"),Z(!1)},W)}countActiveCalls(){let Y=0;for(let Z of this.underlyingCalls)if((Z===null||Z===void 0?void 0:Z.state)==="ACTIVE")Y+=1;return Y}handleProcessedStatus(Y,Z,W){var H,F,X;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(Z),this.reportStatus(Y);break;case"HEDGING":if(this.isStatusCodeInList((H=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&H!==void 0?H:[],Y.code)){(F=this.retryThrottler)===null||F===void 0||F.addCallFailed();let J;if(W===null)J=0;else if(W<0){this.state="TRANSPARENT_ONLY",this.commitCall(Z),this.reportStatus(Y);return}else J=W;setTimeout(()=>{if(this.maybeStartHedgingAttempt(),this.countActiveCalls()===0)this.commitCall(Z),this.reportStatus(Y)},J)}else this.commitCall(Z),this.reportStatus(Y);break;case"RETRY":if(this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,Y.code))(X=this.retryThrottler)===null||X===void 0||X.addCallFailed(),this.maybeRetryCall(W,(J)=>{if(!J)this.commitCall(Z),this.reportStatus(Y)});else this.commitCall(Z),this.reportStatus(Y);break}}getPushback(Y){let Z=Y.get("grpc-retry-pushback-ms");if(Z.length===0)return null;try{return parseInt(Z[0])}catch(W){return-1}}handleChildStatus(Y,Z){var W;if(this.underlyingCalls[Z].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+Y.progress+" from child ["+this.underlyingCalls[Z].call.getCallNumber()+"] in state "+this.underlyingCalls[Z].state),this.underlyingCalls[Z].state="COMPLETED",Y.code===QK.Status.OK){(W=this.retryThrottler)===null||W===void 0||W.addCallSucceeded(),this.commitCall(Z),this.reportStatus(Y);return}if(this.state==="NO_RETRY"){this.commitCall(Z),this.reportStatus(Y);return}if(this.state==="COMMITTED"){this.reportStatus(Y);return}let H=this.getPushback(Y.metadata);switch(Y.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":if(this.transparentRetryUsed)this.handleProcessedStatus(Y,Z,H);else this.transparentRetryUsed=!0,this.startNewAttempt();break;case"DROP":this.commitCall(Z),this.reportStatus(Y);break;case"PROCESSED":this.handleProcessedStatus(Y,Z,H);break}}maybeStartHedgingAttempt(){if(this.state!=="HEDGING")return;if(!this.callConfig.methodConfig.hedgingPolicy)return;if(this.attempts>=this.maxAttempts)return;this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}maybeStartHedgingTimer(){var Y,Z,W;if(this.hedgingTimer)clearTimeout(this.hedgingTimer);if(this.state!=="HEDGING")return;if(!this.callConfig.methodConfig.hedgingPolicy)return;let H=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let F=(Y=H.hedgingDelay)!==null&&Y!==void 0?Y:"0s",X=Number(F.substring(0,F.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},X*1000),(W=(Z=this.hedgingTimer).unref)===null||W===void 0||W.call(Z)}startNewAttempt(){let Y=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+Y.getCallNumber()+"] for attempt "+this.attempts);let Z=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:Y,nextMessageToSend:0,startTime:new Date});let W=this.attempts-1,H=this.initialMetadata.clone();if(W>0)H.set(OA,`${W}`);let F=!1;if(Y.start(H,{onReceiveMetadata:(X)=>{if(this.trace("Received metadata from child ["+Y.getCallNumber()+"]"),this.commitCall(Z),F=!0,W>0)X.set(OA,`${W}`);if(this.underlyingCalls[Z].state==="ACTIVE")this.listener.onReceiveMetadata(X)},onReceiveMessage:(X)=>{if(this.trace("Received message from child ["+Y.getCallNumber()+"]"),this.commitCall(Z),this.underlyingCalls[Z].state==="ACTIVE")this.listener.onReceiveMessage(X)},onReceiveStatus:(X)=>{if(this.trace("Received status from child ["+Y.getCallNumber()+"]"),!F&&W>0)X.metadata.set(OA,`${W}`);this.handleChildStatus(X,Z)}}),this.sendNextChildMessage(Z),this.readStarted)Y.startRead()}start(Y,Z){this.trace("start called"),this.listener=Z,this.initialMetadata=Y,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(Y,Z){var W,H;(H=(W=this.getBufferEntry(Z)).callback)===null||H===void 0||H.call(W),this.clearSentMessages();let F=this.underlyingCalls[Y];F.nextMessageToSend+=1,this.sendNextChildMessage(Y)}sendNextChildMessage(Y){let Z=this.underlyingCalls[Y];if(Z.state==="COMPLETED")return;let W=Z.nextMessageToSend;if(this.getBufferEntry(W)){let H=this.getBufferEntry(W);switch(H.entryType){case"MESSAGE":if(Z.call.sendMessageWithContext({callback:(X)=>{this.handleChildWriteCompleted(Y,W)}},H.message.message),this.getBufferEntry(W+1).entryType==="HALF_CLOSE")this.trace("Sending halfClose immediately after message to child ["+Z.call.getCallNumber()+"] - optimizing for unary/final message"),Z.nextMessageToSend+=1,Z.call.halfClose();break;case"HALF_CLOSE":Z.nextMessageToSend+=1,Z.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(Y,Z){this.trace("write() called with message of length "+Z.length);let W={message:Z,flags:Y.flags},H=this.getNextBufferIndex(),F={entryType:"MESSAGE",message:W,allocated:this.bufferTracker.allocate(Z.length,this.callNumber)};if(this.writeBuffer.push(F),F.allocated){process.nextTick(()=>{var X;(X=Y.callback)===null||X===void 0||X.call(Y)});for(let[X,J]of this.underlyingCalls.entries())if(J.state==="ACTIVE"&&J.nextMessageToSend===H)J.call.sendMessageWithContext({callback:(Q)=>{this.handleChildWriteCompleted(X,H)}},Z)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let X=this.underlyingCalls[this.committedCallIndex];if(F.callback=Y.callback,X.state==="ACTIVE"&&X.nextMessageToSend===H)X.call.sendMessageWithContext({callback:(J)=>{this.handleChildWriteCompleted(this.committedCallIndex,H)}},Z)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let Y of this.underlyingCalls)if((Y===null||Y===void 0?void 0:Y.state)==="ACTIVE")Y.call.startRead()}halfClose(){this.trace("halfClose called");let Y=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let Z of this.underlyingCalls)if((Z===null||Z===void 0?void 0:Z.state)==="ACTIVE"){if(Z.nextMessageToSend===Y||Z.nextMessageToSend===Y-1)this.trace("Sending halfClose immediately to child ["+Z.call.getCallNumber()+"] - all messages already sent"),Z.nextMessageToSend+=1,Z.call.halfClose()}}setCredentials(Y){throw Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){if(this.committedCallIndex!==null)return this.underlyingCalls[this.committedCallIndex].call.getAuthContext();else return null}}Ja.RetryingCall=Xa});var zX=H0((Fa)=>{Object.defineProperty(Fa,"__esModule",{value:!0});Fa.BaseSubchannelWrapper=void 0;class Ga{constructor(Y){this.child=Y,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,Y.addHealthStateWatcher((Z)=>{if(this.healthy)this.updateHealthListeners()})}updateHealthListeners(){for(let Y of this.healthListeners)Y(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(Y){this.child.addConnectivityStateListener(Y)}removeConnectivityStateListener(Y){this.child.removeConnectivityStateListener(Y)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(Y){this.child.throttleKeepalive(Y)}ref(){this.child.ref(),this.refcount+=1}unref(){if(this.child.unref(),this.refcount-=1,this.refcount===0)this.destroy()}destroy(){for(let Y of this.dataWatchers)Y.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(Y){this.healthListeners.add(Y)}removeHealthStateWatcher(Y){this.healthListeners.delete(Y)}addDataWatcher(Y){Y.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(Y)}setHealthy(Y){if(Y!==this.healthy){if(this.healthy=Y,this.child.isHealthy())this.updateHealthListeners()}}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(Y){return this.getRealSubchannel()===Y.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}}Fa.BaseSubchannelWrapper=Ga});var $A=H0((Ua)=>{Object.defineProperty(Ua,"__esModule",{value:!0});Ua.InternalChannel=Ua.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var tw0=kY(),sw0=ul(),ew0=cr(),IA=E4(),YS0=K8(),T5=a1(),ZS0=i3(),QS0=QA(),Va=S9(),XK=M6(),XS0=qA(),JK=f8(),B9=k8(),BX=O5(),JS0=ar(),WS0=pY(),KS0=Ya(),DA=n3(),GS0=WX(),TA=Ka(),FS0=zX(),HS0=2147483647,VS0=1000,qS0=1800000,WK=new Map,zS0=16777216,BS0=1048576;class qa extends FS0.BaseSubchannelWrapper{constructor(Y,Z){super(Y);this.channel=Z,this.refCount=0,this.subchannelStateListener=(W,H,F,X)=>{Z.throttleKeepalive(X)}}ref(){if(this.refCount===0)this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this);this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0)this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this)}}class za{pick(Y){return{pickResultType:IA.PickResultType.DROP,status:{code:T5.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new YS0.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}}Ua.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";class Ba{constructor(Y){this.target=Y,this.trace=new BX.ChannelzTrace,this.callTracker=new BX.ChannelzCallTracker,this.childrenTracker=new BX.ChannelzChildrenTracker,this.state=B9.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>{return{target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}}}}class Aa{constructor(Y,Z,W){var H,F,X,J,Q,G;if(this.credentials=Z,this.options=W,this.connectivityState=B9.ConnectivityState.IDLE,this.currentPicker=new IA.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 Y!=="string")throw TypeError("Channel target must be a string");if(!(Z instanceof tw0.ChannelCredentials))throw TypeError("Channel credentials must be a ChannelCredentials object");if(W){if(typeof W!=="object")throw TypeError("Channel options must be an object")}this.channelzInfoTracker=new Ba(Y);let q=(0,JK.parseUri)(Y);if(q===null)throw Error(`Could not parse target name "${Y}"`);let K=(0,Va.mapUriDefaultScheme)(q);if(K===null)throw Error(`Could not find a default scheme for target name "${Y}"`);if(this.options["grpc.enable_channelz"]===0)this.channelzEnabled=!1;if(this.channelzRef=(0,BX.registerChannelzChannel)(Y,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created");if(this.options["grpc.default_authority"])this.defaultAuthority=this.options["grpc.default_authority"];else this.defaultAuthority=(0,Va.getDefaultAuthority)(K);let V=(0,XS0.mapProxyName)(K,W);this.target=V.target,this.options=Object.assign({},this.options,V.extraOptions),this.subchannelPool=(0,ew0.getSubchannelPool)(((H=this.options["grpc.use_local_subchannel_pool"])!==null&&H!==void 0?H:0)===0),this.retryBufferTracker=new TA.MessageBufferTracker((F=this.options["grpc.retry_buffer_size"])!==null&&F!==void 0?F:zS0,(X=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&X!==void 0?X:BS0),this.keepaliveTime=(J=this.options["grpc.keepalive_time_ms"])!==null&&J!==void 0?J:-1,this.idleTimeoutMs=Math.max((Q=this.options["grpc.client_idle_timeout_ms"])!==null&&Q!==void 0?Q:qS0,VS0);let B={createSubchannel:(M,E)=>{let A={};for(let[T,C]of Object.entries(E))if(!T.startsWith(Ua.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX))A[T]=C;let N=this.subchannelPool.getOrCreateSubchannel(this.target,M,A,this.credentials);if(N.throttleKeepalive(this.keepaliveTime),this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",N.getChannelzRef());return new qa(N,this)},updateState:(M,E)=>{this.currentPicker=E;let A=this.pickQueue.slice();if(this.pickQueue=[],A.length>0)this.callRefTimerUnref();for(let N of A)N.doPick();this.updateState(M)},requestReresolution:()=>{throw Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:(M)=>{if(this.channelzEnabled)this.channelzInfoTracker.childrenTracker.refChild(M)},removeChannelzChild:(M)=>{if(this.channelzEnabled)this.channelzInfoTracker.childrenTracker.unrefChild(M)}};this.resolvingLoadBalancer=new sw0.ResolvingLoadBalancer(this.target,B,this.options,(M,E)=>{var A;if(M.retryThrottling)WK.set(this.getTarget(),new TA.RetryThrottler(M.retryThrottling.maxTokens,M.retryThrottling.tokenRatio,WK.get(this.getTarget())));else WK.delete(this.getTarget());if(this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded");(A=this.configSelector)===null||A===void 0||A.unref(),this.configSelector=E,this.currentResolutionError=null,process.nextTick(()=>{let N=this.configSelectionQueue;if(this.configSelectionQueue=[],N.length>0)this.callRefTimerUnref();for(let O of N)O.getConfig()})},(M)=>{if(this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+M.code+' and details "'+M.details+'"');if(this.configSelectionQueue.length>0)this.trace("Name resolution failed with calls queued for config selection");if(this.configSelector===null)this.currentResolutionError=Object.assign(Object.assign({},(0,GS0.restrictControlPlaneStatusCode)(M.code,M.details)),{metadata:M.metadata});let E=this.configSelectionQueue;if(this.configSelectionQueue=[],E.length>0)this.callRefTimerUnref();for(let A of E)A.reportResolverError(M)}),this.filterStackFactory=new ZS0.FilterStackFactory([new QS0.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(W,void 0,2));let I=Error();if((0,XK.isTracerEnabled)("channel_stacktrace"))(0,XK.trace)(T5.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
34
34
  `+((G=I.stack)===null||G===void 0?void 0:G.substring(I.stack.indexOf(`
35
- `)+1)));this.lastActivityTimestamp=new Date}trace(Y,Z){(0,XK.trace)(Z!==null&&Z!==void 0?Z:T5.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,JK.uriToString)(this.target)+" "+Y)}callRefTimerRef(){var Y,Z,W,H;if(!this.callRefTimer)this.callRefTimer=setInterval(()=>{},HS0);if(!((Z=(Y=this.callRefTimer).hasRef)===null||Z===void 0?void 0:Z.call(Y)))this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(H=(W=this.callRefTimer).ref)===null||H===void 0||H.call(W)}callRefTimerUnref(){var Y,Z,W;if(!((Y=this.callRefTimer)===null||Y===void 0?void 0:Y.hasRef)||this.callRefTimer.hasRef())this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(W=(Z=this.callRefTimer)===null||Z===void 0?void 0:Z.unref)===null||W===void 0||W.call(Z)}removeConnectivityStateWatcher(Y){let Z=this.connectivityStateWatchers.findIndex((W)=>W===Y);if(Z>=0)this.connectivityStateWatchers.splice(Z,1)}updateState(Y){if((0,XK.trace)(T5.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,JK.uriToString)(this.target)+" "+B9.ConnectivityState[this.connectivityState]+" -> "+B9.ConnectivityState[Y]),this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+B9.ConnectivityState[Y]);this.connectivityState=Y,this.channelzInfoTracker.state=Y;let Z=this.connectivityStateWatchers.slice();for(let W of Z)if(Y!==W.currentState){if(W.timer)clearTimeout(W.timer);this.removeConnectivityStateWatcher(W),W.callback()}if(Y!==B9.ConnectivityState.TRANSIENT_FAILURE)this.currentResolutionError=null}throttleKeepalive(Y){if(Y>this.keepaliveTime){this.keepaliveTime=Y;for(let Z of this.wrappedSubchannels)Z.throttleKeepalive(Y)}}addWrappedSubchannel(Y){this.wrappedSubchannels.add(Y)}removeWrappedSubchannel(Y){this.wrappedSubchannels.delete(Y)}doPick(Y,Z){return this.currentPicker.pick({metadata:Y,extraPickInfo:Z})}queueCallForPick(Y){this.pickQueue.push(Y),this.callRefTimerRef()}getConfig(Y,Z){if(this.connectivityState!==B9.ConnectivityState.SHUTDOWN)this.resolvingLoadBalancer.exitIdle();if(this.configSelector)return{type:"SUCCESS",config:this.configSelector.invoke(Y,Z,this.randomChannelId)};else if(this.currentResolutionError)return{type:"ERROR",error:this.currentResolutionError};else return{type:"NONE"}}queueCallForConfig(Y){this.configSelectionQueue.push(Y),this.callRefTimerRef()}enterIdle(){if(this.resolvingLoadBalancer.destroy(),this.updateState(B9.ConnectivityState.IDLE),this.currentPicker=new IA.QueuePicker(this.resolvingLoadBalancer),this.idleTimer)clearTimeout(this.idleTimer),this.idleTimer=null;if(this.callRefTimer)clearInterval(this.callRefTimer),this.callRefTimer=null}startIdleTimeout(Y){var Z,W;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let F=new Date().valueOf()-this.lastActivityTimestamp.valueOf();if(F>=this.idleTimeoutMs)this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle();else this.startIdleTimeout(this.idleTimeoutMs-F)},Y),(W=(Z=this.idleTimer).unref)===null||W===void 0||W.call(Z)}maybeStartIdleTimer(){if(this.connectivityState!==B9.ConnectivityState.SHUTDOWN&&!this.idleTimer)this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){if(this.channelzEnabled)this.channelzInfoTracker.callTracker.addCallStarted();this.callCount+=1}onCallEnd(Y){if(this.channelzEnabled)if(Y.code===T5.Status.OK)this.channelzInfoTracker.callTracker.addCallSucceeded();else this.channelzInfoTracker.callTracker.addCallFailed();this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(Y,Z,W,H,F){let X=(0,DA.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+X+'] method="'+Z+'"'),new JS0.LoadBalancingCall(this,Y,Z,W,H,F,X)}createRetryingCall(Y,Z,W,H,F){let X=(0,DA.getNextCallNumber)();return this.trace("createRetryingCall ["+X+'] method="'+Z+'"'),new TA.RetryingCall(this,Y,Z,W,H,F,X,this.retryBufferTracker,WK.get(this.getTarget()))}createResolvingCall(Y,Z,W,H,F){let X=(0,DA.getNextCallNumber)();this.trace("createResolvingCall ["+X+'] method="'+Y+'", deadline='+(0,WS0.deadlineToString)(Z));let J={deadline:Z,flags:F!==null&&F!==void 0?F:T5.Propagate.DEFAULTS,host:W!==null&&W!==void 0?W:this.defaultAuthority,parentCall:H},Q=new KS0.ResolvingCall(this,Y,J,this.filterStackFactory.clone(),X);return this.onCallStart(),Q.addStatusWatcher((G)=>{this.onCallEnd(G)}),Q}close(){var Y;this.resolvingLoadBalancer.destroy(),this.updateState(B9.ConnectivityState.SHUTDOWN),this.currentPicker=new za;for(let Z of this.configSelectionQueue)Z.cancelWithStatus(T5.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let Z of this.pickQueue)Z.cancelWithStatus(T5.Status.UNAVAILABLE,"Channel closed before call started");if(this.pickQueue=[],this.callRefTimer)clearInterval(this.callRefTimer);if(this.idleTimer)clearTimeout(this.idleTimer);if(this.channelzEnabled)(0,BX.unregisterChannelzRef)(this.channelzRef);this.subchannelPool.unrefUnusedSubchannels(),(Y=this.configSelector)===null||Y===void 0||Y.unref(),this.configSelector=null}getTarget(){return(0,JK.uriToString)(this.target)}getConnectivityState(Y){let Z=this.connectivityState;if(Y)this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer();return Z}watchConnectivityState(Y,Z,W){if(this.connectivityState===B9.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");let H=null;if(Z!==1/0){let X=Z instanceof Date?Z:new Date(Z),J=new Date;if(Z===-1/0||X<=J){process.nextTick(W,Error("Deadline passed without connectivity state change"));return}H=setTimeout(()=>{this.removeConnectivityStateWatcher(F),W(Error("Deadline passed without connectivity state change"))},X.getTime()-J.getTime())}let F={currentState:Y,callback:W,timer:H};this.connectivityStateWatchers.push(F)}getChannelzRef(){return this.channelzRef}createCall(Y,Z,W,H,F){if(typeof Y!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof Z==="number"||Z instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===B9.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");return this.createResolvingCall(Y,Z,W,H,F)}getOptions(){return this.options}}Ua.InternalChannel=Aa});var QB=H0((Ta)=>{Object.defineProperty(Ta,"__esModule",{value:!0});Ta.ChannelImplementation=void 0;var AS0=kY(),US0=$A();class Da{constructor(Y,Z,W){if(typeof Y!=="string")throw TypeError("Channel target must be a string");if(!(Z instanceof AS0.ChannelCredentials))throw TypeError("Channel credentials must be a ChannelCredentials object");if(W){if(typeof W!=="object")throw TypeError("Channel options must be an object")}this.internalChannel=new US0.InternalChannel(Y,Z,W)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(Y){return this.internalChannel.getConnectivityState(Y)}watchConnectivityState(Y,Z,W){this.internalChannel.watchConnectivityState(Y,Z,W)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(Y,Z,W,H,F){if(typeof Y!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof Z==="number"||Z instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(Y,Z,W,H,F)}}Ta.ChannelImplementation=Da});var wa=H0((Pa)=>{Object.defineProperty(Pa,"__esModule",{value:!0});Pa.ServerDuplexStreamImpl=Pa.ServerWritableStreamImpl=Pa.ServerReadableStreamImpl=Pa.ServerUnaryCallImpl=void 0;Pa.serverErrorToStatus=MA;var NS0=V1("events"),CA=V1("stream"),EA=a1(),$a=K8();function MA(Y,Z){var W;let H={code:EA.Status.UNKNOWN,details:"message"in Y?Y.message:"Unknown Error",metadata:(W=Z!==null&&Z!==void 0?Z:Y.metadata)!==null&&W!==void 0?W:null};if("code"in Y&&typeof Y.code==="number"&&Number.isInteger(Y.code)){if(H.code=Y.code,"details"in Y&&typeof Y.details==="string")H.details=Y.details}return H}class Ca extends NS0.EventEmitter{constructor(Y,Z,W,H){super();this.path=Y,this.call=Z,this.metadata=W,this.request=H,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}Pa.ServerUnaryCallImpl=Ca;class Ea extends CA.Readable{constructor(Y,Z,W){super({objectMode:!0});this.path=Y,this.call=Z,this.metadata=W,this.cancelled=!1}_read(Y){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}Pa.ServerReadableStreamImpl=Ea;class Ma extends CA.Writable{constructor(Y,Z,W,H){super({objectMode:!0});this.path=Y,this.call=Z,this.metadata=W,this.request=H,this.pendingStatus={code:EA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new $a.Metadata,this.on("error",(F)=>{this.pendingStatus=MA(F),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}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(Y,Z,W){this.call.sendMessage(Y,W)}_final(Y){var Z;Y(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(Z=this.pendingStatus.metadata)!==null&&Z!==void 0?Z:this.trailingMetadata}))}end(Y){if(Y)this.trailingMetadata=Y;return super.end()}}Pa.ServerWritableStreamImpl=Ma;class Ra extends CA.Duplex{constructor(Y,Z,W){super({objectMode:!0});this.path=Y,this.call=Z,this.metadata=W,this.pendingStatus={code:EA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new $a.Metadata,this.on("error",(H)=>{this.pendingStatus=MA(H),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}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(Y){this.call.startRead()}_write(Y,Z,W){this.call.sendMessage(Y,W)}_final(Y){var Z;Y(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(Z=this.pendingStatus.metadata)!==null&&Z!==void 0?Z:this.trailingMetadata}))}end(Y){if(Y)this.trailingMetadata=Y;return super.end()}}Pa.ServerDuplexStreamImpl=Ra});var KK=H0((Sa)=>{Object.defineProperty(Sa,"__esModule",{value:!0});Sa.ServerCredentials=void 0;Sa.createCertificateProviderServerCredentials=$S0;Sa.createServerCredentialsWithInterceptors=CS0;var RA=gz();class tY{constructor(Y,Z){this.serverConstructorOptions=Y,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=Z!==null&&Z!==void 0?Z:null}_addWatcher(Y){this.watchers.add(Y)}_removeWatcher(Y){this.watchers.delete(Y)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(Y){this.latestContextOptions=Y;for(let Z of this.watchers)Z(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new PA}static createSsl(Y,Z,W=!1){var H;if(Y!==null&&!Buffer.isBuffer(Y))throw TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(Z))throw TypeError("keyCertPairs must be an array");if(typeof W!=="boolean")throw TypeError("checkClientCertificate must be a boolean");let F=[],X=[];for(let J=0;J<Z.length;J++){let Q=Z[J];if(Q===null||typeof Q!=="object")throw TypeError(`keyCertPair[${J}] must be an object`);if(!Buffer.isBuffer(Q.private_key))throw TypeError(`keyCertPair[${J}].private_key must be a Buffer`);if(!Buffer.isBuffer(Q.cert_chain))throw TypeError(`keyCertPair[${J}].cert_chain must be a Buffer`);F.push(Q.cert_chain),X.push(Q.private_key)}return new LA({requestCert:W,ciphers:RA.CIPHER_SUITES},{ca:(H=Y!==null&&Y!==void 0?Y:(0,RA.getDefaultRootsData)())!==null&&H!==void 0?H:void 0,cert:F,key:X})}}Sa.ServerCredentials=tY;class PA extends tY{constructor(){super(null)}_getSettings(){return null}_equals(Y){return Y instanceof PA}}class LA extends tY{constructor(Y,Z){super(Y,Z);this.options=Object.assign(Object.assign({},Y),Z)}_equals(Y){if(this===Y)return!0;if(!(Y instanceof LA))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(Y.options.ca)){if(!this.options.ca.equals(Y.options.ca))return!1}else if(this.options.ca!==Y.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(Y.options.cert)){if(this.options.cert.length!==Y.options.cert.length)return!1;for(let Z=0;Z<this.options.cert.length;Z++){let W=this.options.cert[Z],H=Y.options.cert[Z];if(Buffer.isBuffer(W)&&Buffer.isBuffer(H)){if(!W.equals(H))return!1}else if(W!==H)return!1}}else if(this.options.cert!==Y.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(Y.options.key)){if(this.options.key.length!==Y.options.key.length)return!1;for(let Z=0;Z<this.options.key.length;Z++){let W=this.options.key[Z],H=Y.options.key[Z];if(Buffer.isBuffer(W)&&Buffer.isBuffer(H)){if(!W.equals(H))return!1}else if(W!==H)return!1}}else if(this.options.key!==Y.options.key)return!1;if(this.options.requestCert!==Y.options.requestCert)return!1;return!0}}class wA extends tY{constructor(Y,Z,W){super({requestCert:Z!==null,rejectUnauthorized:W,ciphers:RA.CIPHER_SUITES});this.identityCertificateProvider=Y,this.caCertificateProvider=Z,this.requireClientCertificate=W,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(Y){var Z;if(this.getWatcherCount()===0)(Z=this.caCertificateProvider)===null||Z===void 0||Z.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener);super._addWatcher(Y)}_removeWatcher(Y){var Z;if(super._removeWatcher(Y),this.getWatcherCount()===0)(Z=this.caCertificateProvider)===null||Z===void 0||Z.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener)}_equals(Y){if(this===Y)return!0;if(!(Y instanceof wA))return!1;return this.caCertificateProvider===Y.caCertificateProvider&&this.identityCertificateProvider===Y.identityCertificateProvider&&this.requireClientCertificate===Y.requireClientCertificate}calculateSecureContextOptions(){var Y;if(this.latestIdentityUpdate===null)return null;if(this.caCertificateProvider!==null&&this.latestCaUpdate===null)return null;return{ca:(Y=this.latestCaUpdate)===null||Y===void 0?void 0:Y.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let Y=this.calculateSecureContextOptions();this.updateSecureContextOptions(Y)}handleCaCertificateUpdate(Y){this.latestCaUpdate=Y,this.finalizeUpdate()}handleIdentityCertitificateUpdate(Y){this.latestIdentityUpdate=Y,this.finalizeUpdate()}}function $S0(Y,Z,W){return new wA(Y,Z,W)}class SA extends tY{constructor(Y,Z){super({});this.childCredentials=Y,this.interceptors=Z}_isSecure(){return this.childCredentials._isSecure()}_equals(Y){if(!(Y instanceof SA))return!1;if(!this.childCredentials._equals(Y.childCredentials))return!1;if(this.interceptors.length!==Y.interceptors.length)return!1;for(let Z=0;Z<this.interceptors.length;Z++)if(this.interceptors[Z]!==Y.interceptors[Z])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(Y){this.childCredentials._addWatcher(Y)}_removeWatcher(Y){this.childCredentials._removeWatcher(Y)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}}function CS0(Y,Z){return new SA(Y,Z)}});var AX=H0((ka)=>{Object.defineProperty(ka,"__esModule",{value:!0});ka.durationMessageToDuration=RS0;ka.msToDuration=PS0;ka.durationToMs=LS0;ka.isDuration=wS0;ka.isDurationMessage=SS0;ka.parseDuration=kS0;ka.durationToString=yS0;function RS0(Y){return{seconds:Number.parseInt(Y.seconds),nanos:Y.nanos}}function PS0(Y){return{seconds:Y/1000|0,nanos:Y%1000*1e6|0}}function LS0(Y){return Y.seconds*1000+Y.nanos/1e6|0}function wS0(Y){return typeof Y.seconds==="number"&&typeof Y.nanos==="number"}function SS0(Y){return typeof Y.seconds==="string"&&typeof Y.nanos==="number"}var fS0=/^(\d+)(?:\.(\d+))?s$/;function kS0(Y){let Z=Y.match(fS0);if(!Z)return null;return{seconds:Number.parseInt(Z[1],10),nanos:Z[2]?Number.parseInt(Z[2].padEnd(9,"0"),10):0}}function yS0(Y){if(Y.nanos===0)return`${Y.seconds}s`;let Z;if(Y.nanos%1e6===0)Z=1e6;else if(Y.nanos%1000===0)Z=1000;else Z=1;return`${Y.seconds}.${Y.nanos/Z}s`}});var FK=H0((da)=>{var __dirname="/Users/beatrix/dev/cline-packages/node_modules/.bun/@grpc+grpc-js@1.14.3/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(da,"__esModule",{value:!0});da.OrcaOobMetricsSubchannelWrapper=da.GRPC_METRICS_HEADER=da.ServerMetricRecorder=da.PerRequestMetricRecorder=void 0;da.createOrcaClient=xa;da.createMetricsReader=pS0;var mS0=N3(),fA=AX(),gS0=kY(),dS0=zX(),ya=a1(),cS0=yY(),lS0=k8(),va=null;function GK(){if(va)return va;let Y=ZX().loadSync,Z=Y("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,mS0.loadPackageDefinition)(Z)}class ja{constructor(){this.message={}}recordRequestCostMetric(Y,Z){if(!this.message.request_cost)this.message.request_cost={};this.message.request_cost[Y]=Z}recordUtilizationMetric(Y,Z){if(!this.message.utilization)this.message.utilization={};this.message.utilization[Y]=Z}recordNamedMetric(Y,Z){if(!this.message.named_metrics)this.message.named_metrics={};this.message.named_metrics[Y]=Z}recordCPUUtilizationMetric(Y){this.message.cpu_utilization=Y}recordMemoryUtilizationMetric(Y){this.message.mem_utilization=Y}recordApplicationUtilizationMetric(Y){this.message.application_utilization=Y}recordQpsMetric(Y){this.message.rps_fractional=Y}recordEpsMetric(Y){this.message.eps=Y}serialize(){return GK().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}}da.PerRequestMetricRecorder=ja;var nS0=30000;class _a{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:(Y)=>{let Z=Y.request.report_interval?(0,fA.durationToMs)((0,fA.durationMessageToDuration)(Y.request.report_interval)):nS0,W=setInterval(()=>{Y.write(this.message)},Z);Y.on("cancelled",()=>{clearInterval(W)})}}}putUtilizationMetric(Y,Z){if(!this.message.utilization)this.message.utilization={};this.message.utilization[Y]=Z}setAllUtilizationMetrics(Y){this.message.utilization=Object.assign({},Y)}deleteUtilizationMetric(Y){var Z;(Z=this.message.utilization)===null||Z===void 0||delete Z[Y]}setCpuUtilizationMetric(Y){this.message.cpu_utilization=Y}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(Y){this.message.application_utilization=Y}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(Y){this.message.rps_fractional=Y}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(Y){this.message.eps=Y}deleteEpsMetric(){delete this.message.eps}addToServer(Y){let Z=GK().xds.service.orca.v3.OpenRcaService.service;Y.addService(Z,this.serviceImplementation)}}da.ServerMetricRecorder=_a;function xa(Y){return new(GK()).xds.service.orca.v3.OpenRcaService("unused",gS0.ChannelCredentials.createInsecure(),{channelOverride:Y})}da.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var ha="grpc_orca_load_report";function pS0(Y,Z){return(W,H,F)=>{let X=F.getOpaque(ha);if(X)Y(X);else{let J=F.get(da.GRPC_METRICS_HEADER);if(J.length>0)X=GK().xds.data.orca.v3.OrcaLoadReport.deserialize(J[0]),Y(X),F.setOpaque(ha,X)}if(Z)Z(W,H,F)}}var ba="orca_oob_metrics";class ua{constructor(Y,Z){this.metricsListener=Y,this.intervalMs=Z,this.dataProducer=null}setSubchannel(Y){let Z=Y.getOrCreateDataProducer(ba,iS0);this.dataProducer=Z,Z.addDataWatcher(this)}destroy(){var Y;(Y=this.dataProducer)===null||Y===void 0||Y.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(Y){this.metricsListener(Y)}}class ma{constructor(Y){this.subchannel=Y,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new cS0.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let Z=Y.getChannel();this.client=xa(Z),Y.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(Y){this.dataWatchers.add(Y),this.updateMetricsSubscription()}removeDataWatcher(Y){var Z;if(this.dataWatchers.delete(Y),this.dataWatchers.size===0)this.subchannel.removeDataProducer(ba),(Z=this.metricsCall)===null||Z===void 0||Z.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener);else this.updateMetricsSubscription()}updateMetricsSubscription(){var Y;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==lS0.ConnectivityState.READY)return;let Z=Math.min(...Array.from(this.dataWatchers).map((W)=>W.getInterval()));if(!this.metricsCall||Z!==this.currentInterval){(Y=this.metricsCall)===null||Y===void 0||Y.cancel(),this.currentInterval=Z;let W=this.client.streamCoreMetrics({report_interval:(0,fA.msToDuration)(Z)});this.metricsCall=W,W.on("data",(H)=>{this.dataWatchers.forEach((F)=>{F.onMetricsUpdate(H)})}),W.on("error",(H)=>{if(this.metricsCall=null,H.code===ya.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}if(H.code===ya.Status.CANCELLED)return;this.backoffTimer.runOnce()})}}}class ga extends dS0.BaseSubchannelWrapper{constructor(Y,Z,W){super(Y);this.addDataWatcher(new ua(Z,W))}getWrappedSubchannel(){return this.child}}da.OrcaOobMetricsSubchannelWrapper=ga;function iS0(Y){return new ma(Y)}});var hA=H0((Jo)=>{Object.defineProperty(Jo,"__esModule",{value:!0});Jo.BaseServerInterceptingCall=Jo.ServerInterceptingCall=Jo.ResponderBuilder=Jo.ServerListenerBuilder=void 0;Jo.isInterceptingServerListener=Yf0;Jo.getServerInterceptingCall=Wf0;var qK=K8(),m8=a1(),sY=V1("http2"),na=Y3(),pa=V1("zlib"),sS0=zA(),ta=M6(),eS0=V1("tls"),ia=FK(),sa="server_call";function R7(Y){ta.trace(m8.LogVerbosity.DEBUG,sa,Y)}class ea{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(Y){return this.metadata=Y,this}withOnReceiveMessage(Y){return this.message=Y,this}withOnReceiveHalfClose(Y){return this.halfClose=Y,this}withOnCancel(Y){return this.cancel=Y,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}}Jo.ServerListenerBuilder=ea;function Yf0(Y){return Y.onReceiveMetadata!==void 0&&Y.onReceiveMetadata.length===1}class Yo{constructor(Y,Z){this.listener=Y,this.nextListener=Z,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){if(this.hasPendingMessage)this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1}processPendingHalfClose(){if(this.hasPendingHalfClose)this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1}onReceiveMetadata(Y){if(this.cancelled)return;this.processingMetadata=!0,this.listener.onReceiveMetadata(Y,(Z)=>{if(this.processingMetadata=!1,this.cancelled)return;this.nextListener.onReceiveMetadata(Z),this.processPendingMessage(),this.processPendingHalfClose()})}onReceiveMessage(Y){if(this.cancelled)return;this.processingMessage=!0,this.listener.onReceiveMessage(Y,(Z)=>{if(this.processingMessage=!1,this.cancelled)return;if(this.processingMetadata)this.pendingMessage=Z,this.hasPendingMessage=!0;else this.nextListener.onReceiveMessage(Z),this.processPendingHalfClose()})}onReceiveHalfClose(){if(this.cancelled)return;this.listener.onReceiveHalfClose(()=>{if(this.cancelled)return;if(this.processingMetadata||this.processingMessage)this.hasPendingHalfClose=!0;else this.nextListener.onReceiveHalfClose()})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}}class Zo{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(Y){return this.start=Y,this}withSendMetadata(Y){return this.metadata=Y,this}withSendMessage(Y){return this.message=Y,this}withSendStatus(Y){return this.status=Y,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}}Jo.ResponderBuilder=Zo;var HK={onReceiveMetadata:(Y,Z)=>{Z(Y)},onReceiveMessage:(Y,Z)=>{Z(Y)},onReceiveHalfClose:(Y)=>{Y()},onCancel:()=>{}},VK={start:(Y)=>{Y()},sendMetadata:(Y,Z)=>{Z(Y)},sendMessage:(Y,Z)=>{Z(Y)},sendStatus:(Y,Z)=>{Z(Y)}};class Qo{constructor(Y,Z){var W,H,F,X;this.nextCall=Y,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(W=Z===null||Z===void 0?void 0:Z.start)!==null&&W!==void 0?W:VK.start,sendMetadata:(H=Z===null||Z===void 0?void 0:Z.sendMetadata)!==null&&H!==void 0?H:VK.sendMetadata,sendMessage:(F=Z===null||Z===void 0?void 0:Z.sendMessage)!==null&&F!==void 0?F:VK.sendMessage,sendStatus:(X=Z===null||Z===void 0?void 0:Z.sendStatus)!==null&&X!==void 0?X:VK.sendStatus}}processPendingMessage(){if(this.pendingMessageCallback)this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null}processPendingStatus(){if(this.pendingStatus)this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null}start(Y){this.responder.start((Z)=>{var W,H,F,X;let J={onReceiveMetadata:(W=Z===null||Z===void 0?void 0:Z.onReceiveMetadata)!==null&&W!==void 0?W:HK.onReceiveMetadata,onReceiveMessage:(H=Z===null||Z===void 0?void 0:Z.onReceiveMessage)!==null&&H!==void 0?H:HK.onReceiveMessage,onReceiveHalfClose:(F=Z===null||Z===void 0?void 0:Z.onReceiveHalfClose)!==null&&F!==void 0?F:HK.onReceiveHalfClose,onCancel:(X=Z===null||Z===void 0?void 0:Z.onCancel)!==null&&X!==void 0?X:HK.onCancel},Q=new Yo(J,Y);this.nextCall.start(Q)})}sendMetadata(Y){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(Y,(Z)=>{this.processingMetadata=!1,this.nextCall.sendMetadata(Z),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(Y,Z){if(this.processingMessage=!0,!this.sentMetadata)this.sendMetadata(new qK.Metadata);this.responder.sendMessage(Y,(W)=>{if(this.processingMessage=!1,this.processingMetadata)this.pendingMessage=W,this.pendingMessageCallback=Z;else this.nextCall.sendMessage(W,Z)})}sendStatus(Y){this.responder.sendStatus(Y,(Z)=>{if(this.processingMetadata||this.processingMessage)this.pendingStatus=Z;else this.nextCall.sendStatus(Z)})}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()}}Jo.ServerInterceptingCall=Qo;var Xo="grpc-accept-encoding",yA="grpc-encoding",ra="grpc-message",aa="grpc-status",kA="grpc-timeout",Zf0=/(\d{1,8})\s*([HMSmun])/,Qf0={H:3600000,M:60000,S:1000,m:1,u:0.001,n:0.000001},Xf0={[Xo]:"identity,deflate,gzip",[yA]:"identity"},oa={[sY.constants.HTTP2_HEADER_STATUS]:sY.constants.HTTP_STATUS_OK,[sY.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},Jf0={waitForTrailers:!0};class vA{constructor(Y,Z,W,H,F){var X,J;if(this.stream=Y,this.callEventTracker=W,this.handler=H,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=m8.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=m8.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 ia.PerRequestMetricRecorder,this.stream.once("error",(V)=>{}),this.stream.once("close",()=>{var V;if(R7("Request to method "+((V=this.handler)===null||V===void 0?void 0:V.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:m8.Status.CANCELLED,details:"Stream closed before sending status",metadata:null});this.notifyOnCancel()}),this.stream.on("data",(V)=>{this.handleDataFrame(V)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in F)this.maxSendMessageSize=F["grpc.max_send_message_length"];if("grpc.max_receive_message_length"in F)this.maxReceiveMessageSize=F["grpc.max_receive_message_length"];this.host=(X=Z[":authority"])!==null&&X!==void 0?X:Z.host,this.decoder=new sS0.StreamDecoder(this.maxReceiveMessageSize);let Q=qK.Metadata.fromHttp2Headers(Z);if(ta.isTracerEnabled(sa))R7("Request to "+this.handler.path+" received headers "+JSON.stringify(Q.toJSON()));let G=Q.get(kA);if(G.length>0)this.handleTimeoutHeader(G[0]);let q=Q.get(yA);if(q.length>0)this.incomingEncoding=q[0];Q.remove(kA),Q.remove(yA),Q.remove(Xo),Q.remove(sY.constants.HTTP2_HEADER_ACCEPT_ENCODING),Q.remove(sY.constants.HTTP2_HEADER_TE),Q.remove(sY.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=Q;let K=(J=Y.session)===null||J===void 0?void 0:J.socket;this.connectionInfo={localAddress:K===null||K===void 0?void 0:K.localAddress,localPort:K===null||K===void 0?void 0:K.localPort,remoteAddress:K===null||K===void 0?void 0:K.remoteAddress,remotePort:K===null||K===void 0?void 0:K.remotePort},this.shouldSendMetrics=!!F["grpc.server_call_metric_recording"]}handleTimeoutHeader(Y){let Z=Y.toString().match(Zf0);if(Z===null){let F={code:m8.Status.INTERNAL,details:`Invalid ${kA} value "${Y}"`,metadata:null};process.nextTick(()=>{this.sendStatus(F)});return}let W=+Z[1]*Qf0[Z[2]]|0,H=new Date;this.deadline=H.setMilliseconds(H.getMilliseconds()+W),this.deadlineTimer=setTimeout(()=>{let F={code:m8.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(F)},W)}checkCancelled(){if(!this.cancelled&&(this.stream.destroyed||this.stream.closed))this.notifyOnCancel(),this.cancelled=!0;return this.cancelled}notifyOnCancel(){if(this.cancelNotified)return;if(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var Y;(Y=this.listener)===null||Y===void 0||Y.onCancel()}),this.deadlineTimer)clearTimeout(this.deadlineTimer);this.stream.resume()}maybeSendMetadata(){if(!this.metadataSent)this.sendMetadata(new qK.Metadata)}serializeMessage(Y){let Z=this.handler.serialize(Y),W=Z.byteLength,H=Buffer.allocUnsafe(W+5);return H.writeUInt8(0,0),H.writeUInt32BE(W,1),Z.copy(H,5),H}decompressMessage(Y,Z){let W=Y.subarray(5);if(Z==="identity")return W;else if(Z==="deflate"||Z==="gzip"){let H;if(Z==="deflate")H=pa.createInflate();else H=pa.createGunzip();return new Promise((F,X)=>{let J=0,Q=[];H.on("data",(G)=>{if(Q.push(G),J+=G.byteLength,this.maxReceiveMessageSize!==-1&&J>this.maxReceiveMessageSize)H.destroy(),X({code:m8.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`})}),H.on("end",()=>{F(Buffer.concat(Q))}),H.write(W),H.end()})}else return Promise.reject({code:m8.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${Z}"`})}async decompressAndMaybePush(Y){if(Y.type!=="COMPRESSED")throw Error(`Invalid queue entry type: ${Y.type}`);let W=Y.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",H;try{H=await this.decompressMessage(Y.compressedMessage,W)}catch(F){this.sendStatus(F);return}try{Y.parsedMessage=this.handler.deserialize(H)}catch(F){this.sendStatus({code:m8.Status.INTERNAL,details:`Error deserializing request: ${F.message}`});return}Y.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let Y=this.readQueue.shift();if(Y.type==="READABLE")this.listener.onReceiveMessage(Y.parsedMessage);else this.listener.onReceiveHalfClose()}}handleDataFrame(Y){var Z;if(this.checkCancelled())return;R7("Request to "+this.handler.path+" received data frame of size "+Y.length);let W;try{W=this.decoder.write(Y)}catch(H){this.sendStatus({code:m8.Status.RESOURCE_EXHAUSTED,details:H.message});return}for(let H of W){this.stream.pause();let F={type:"COMPRESSED",compressedMessage:H,parsedMessage:null};this.readQueue.push(F),this.decompressAndMaybePush(F),(Z=this.callEventTracker)===null||Z===void 0||Z.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(Y){if(R7("Request to "+this.handler.path+" start called"),this.checkCancelled())return;this.listener=Y,Y.onReceiveMetadata(this.metadata)}sendMetadata(Y){if(this.checkCancelled())return;if(this.metadataSent)return;this.metadataSent=!0;let Z=Y?Y.toHttp2Headers():null,W=Object.assign(Object.assign(Object.assign({},oa),Xf0),Z);this.stream.respond(W,Jf0)}sendMessage(Y,Z){if(this.checkCancelled())return;let W;try{W=this.serializeMessage(Y)}catch(H){this.sendStatus({code:m8.Status.INTERNAL,details:`Error serializing response: ${(0,na.getErrorMessage)(H)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&W.length-5>this.maxSendMessageSize){this.sendStatus({code:m8.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${W.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),R7("Request to "+this.handler.path+" sent data frame of size "+W.length),this.stream.write(W,(H)=>{var F;if(H){this.sendStatus({code:m8.Status.INTERNAL,details:`Error writing message: ${(0,na.getErrorMessage)(H)}`,metadata:null});return}(F=this.callEventTracker)===null||F===void 0||F.addMessageSent(),Z()})}sendStatus(Y){var Z,W,H;if(this.checkCancelled())return;R7("Request to method "+((Z=this.handler)===null||Z===void 0?void 0:Z.path)+" ended with status code: "+m8.Status[Y.code]+" details: "+Y.details);let F=(H=(W=Y.metadata)===null||W===void 0?void 0:W.clone())!==null&&H!==void 0?H:new qK.Metadata;if(this.shouldSendMetrics)F.set(ia.GRPC_METRICS_HEADER,this.metricsRecorder.serialize());if(this.metadataSent)if(!this.wantTrailers)this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(Y);let X=Object.assign({[aa]:Y.code,[ra]:encodeURI(Y.details)},F.toHttp2Headers());this.stream.sendTrailers(X),this.notifyOnCancel()}),this.stream.end();else this.notifyOnCancel();else{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(Y);let X=Object.assign(Object.assign({[aa]:Y.code,[ra]:encodeURI(Y.details)},oa),F.toHttp2Headers());this.stream.respond(X,{endStream:!0}),this.notifyOnCancel()}}startRead(){if(R7("Request to "+this.handler.path+" startRead called"),this.checkCancelled())return;if(this.isReadPending=!0,this.readQueue.length===0){if(!this.receivedHalfClose)this.stream.resume()}else this.maybePushNextMessage()}getPeer(){var Y;let Z=(Y=this.stream.session)===null||Y===void 0?void 0:Y.socket;if(Z===null||Z===void 0?void 0:Z.remoteAddress)if(Z.remotePort)return`${Z.remoteAddress}:${Z.remotePort}`;else return Z.remoteAddress;else return"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var Y;if(((Y=this.stream.session)===null||Y===void 0?void 0:Y.socket)instanceof eS0.TLSSocket){let Z=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:Z.raw?Z:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}}Jo.BaseServerInterceptingCall=vA;function Wf0(Y,Z,W,H,F,X){let J={path:F.path,requestStream:F.type==="clientStream"||F.type==="bidi",responseStream:F.type==="serverStream"||F.type==="bidi",requestDeserialize:F.deserialize,responseSerialize:F.serialize},Q=new vA(Z,W,H,F,X);return Y.reduce((G,q)=>{return q(J,G)},Q)}});var zo=H0(($5)=>{var qf0=$5&&$5.__runInitializers||function(Y,Z,W){var H=arguments.length>2;for(var F=0;F<Z.length;F++)W=H?Z[F].call(Y,W):Z[F].call(Y);return H?W:void 0},zf0=$5&&$5.__esDecorate||function(Y,Z,W,H,F,X){function J(N){if(N!==void 0&&typeof N!=="function")throw TypeError("Function expected");return N}var Q=H.kind,G=Q==="getter"?"get":Q==="setter"?"set":"value",q=!Z&&Y?H.static?Y:Y.prototype:null,K=Z||(q?Object.getOwnPropertyDescriptor(q,H.name):{}),V,B=!1;for(var I=W.length-1;I>=0;I--){var M={};for(var E in H)M[E]=E==="access"?{}:H[E];for(var E in H.access)M.access[E]=H.access[E];M.addInitializer=function(N){if(B)throw TypeError("Cannot add initializers after decoration has completed");X.push(J(N||null))};var A=(0,W[I])(Q==="accessor"?{get:K.get,set:K.set}:K[G],M);if(Q==="accessor"){if(A===void 0)continue;if(A===null||typeof A!=="object")throw TypeError("Object expected");if(V=J(A.get))K.get=V;if(V=J(A.set))K.set=V;if(V=J(A.init))F.unshift(V)}else if(V=J(A))if(Q==="field")F.unshift(V);else K[G]=V}if(q)Object.defineProperty(q,H.name,K);B=!0};Object.defineProperty($5,"__esModule",{value:!0});$5.Server=void 0;var g8=V1("http2"),Bf0=V1("util"),p6=a1(),ZZ=wa(),jA=KK(),Ko=S9(),YZ=M6(),I5=u8(),j9=f8(),Y8=O5(),Go=hA(),eY=2147483647,_A=2147483647,Af0=20000,Fo=2147483647,{HTTP2_HEADER_PATH:Ho}=g8.constants,Uf0="server",Vo=Buffer.from("max_age");function qo(Y){YZ.trace(p6.LogVerbosity.DEBUG,"server_call",Y)}function Nf0(){}function Of0(Y){return function(Z,W){return Bf0.deprecate(Z,Y)}}function xA(Y){return{code:p6.Status.UNIMPLEMENTED,details:`The server does not implement the method ${Y}`}}function Df0(Y,Z){let W=xA(Z);switch(Y){case"unary":return(H,F)=>{F(W,null)};case"clientStream":return(H,F)=>{F(W,null)};case"serverStream":return(H)=>{H.emit("error",W)};case"bidi":return(H)=>{H.emit("error",W)};default:throw Error(`Invalid handlerType ${Y}`)}}var Tf0=(()=>{var Y;let Z=[],W;return Y=class{constructor(F){var X,J,Q,G,q,K;if(this.boundPorts=(qf0(this,Z),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=F!==null&&F!==void 0?F:{},this.options["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new Y8.ChannelzTraceStub,this.callTracker=new Y8.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Y8.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Y8.ChannelzChildrenTrackerStub;else this.channelzTrace=new Y8.ChannelzTrace,this.callTracker=new Y8.ChannelzCallTracker,this.listenerChildrenTracker=new Y8.ChannelzChildrenTracker,this.sessionChildrenTracker=new Y8.ChannelzChildrenTracker;if(this.channelzRef=(0,Y8.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(X=this.options["grpc.max_connection_age_ms"])!==null&&X!==void 0?X:eY,this.maxConnectionAgeGraceMs=(J=this.options["grpc.max_connection_age_grace_ms"])!==null&&J!==void 0?J:eY,this.keepaliveTimeMs=(Q=this.options["grpc.keepalive_time_ms"])!==null&&Q!==void 0?Q:_A,this.keepaliveTimeoutMs=(G=this.options["grpc.keepalive_timeout_ms"])!==null&&G!==void 0?G:Af0,this.sessionIdleTimeout=(q=this.options["grpc.max_connection_idle_ms"])!==null&&q!==void 0?q:Fo,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"];else this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER;if("grpc.max_concurrent_streams"in this.options)this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]};this.interceptors=(K=this.options.interceptors)!==null&&K!==void 0?K:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(F){var X,J,Q;let G=this.sessions.get(F),q=F.socket,K=q.remoteAddress?(0,I5.stringToSubchannelAddress)(q.remoteAddress,q.remotePort):null,V=q.localAddress?(0,I5.stringToSubchannelAddress)(q.localAddress,q.localPort):null,B;if(F.encrypted){let M=q,E=M.getCipher(),A=M.getCertificate(),N=M.getPeerCertificate();B={cipherSuiteStandardName:(X=E.standardName)!==null&&X!==void 0?X:null,cipherSuiteOtherName:E.standardName?null:E.name,localCertificate:A&&"raw"in A?A.raw:null,remoteCertificate:N&&"raw"in N?N.raw:null}}else B=null;return{remoteAddress:K,localAddress:V,security:B,remoteName:null,streamsStarted:G.streamTracker.callsStarted,streamsSucceeded:G.streamTracker.callsSucceeded,streamsFailed:G.streamTracker.callsFailed,messagesSent:G.messagesSent,messagesReceived:G.messagesReceived,keepAlivesSent:G.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:G.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:G.lastMessageSentTimestamp,lastMessageReceivedTimestamp:G.lastMessageReceivedTimestamp,localFlowControlWindow:(J=F.state.localWindowSize)!==null&&J!==void 0?J:null,remoteFlowControlWindow:(Q=F.state.remoteWindowSize)!==null&&Q!==void 0?Q:null}}trace(F){YZ.trace(p6.LogVerbosity.DEBUG,Uf0,"("+this.channelzRef.id+") "+F)}keepaliveTrace(F){YZ.trace(p6.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+F)}addProtoService(){throw Error("Not implemented. Use addService() instead")}addService(F,X){if(F===null||typeof F!=="object"||X===null||typeof X!=="object")throw Error("addService() requires two objects as arguments");let J=Object.keys(F);if(J.length===0)throw Error("Cannot add an empty service to a server");J.forEach((Q)=>{let G=F[Q],q;if(G.requestStream)if(G.responseStream)q="bidi";else q="clientStream";else if(G.responseStream)q="serverStream";else q="unary";let K=X[Q],V;if(K===void 0&&typeof G.originalName==="string")K=X[G.originalName];if(K!==void 0)V=K.bind(X);else V=Df0(q,Q);if(this.register(G.path,V,G.responseSerialize,G.requestDeserialize,q)===!1)throw Error(`Method handler for ${G.path} already provided.`)})}removeService(F){if(F===null||typeof F!=="object")throw Error("removeService() requires object as argument");Object.keys(F).forEach((J)=>{let Q=F[J];this.unregister(Q.path)})}bind(F,X){throw Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(F){return(0,Y8.registerChannelzSocket)((0,I5.subchannelAddressToString)(F),()=>{return{localAddress:F,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(F){(0,Y8.unregisterChannelzRef)(F)}createHttp2Server(F){let X;if(F._isSecure()){let J=F._getConstructorOptions(),Q=F._getSecureContextOptions(),G=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),J),Q),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),q=Q!==null;this.trace("Initial credentials valid: "+q),X=g8.createSecureServer(G),X.prependListener("connection",(V)=>{if(!q)this.trace("Dropped connection from "+JSON.stringify(V.address())+" due to unloaded credentials"),V.destroy()}),X.on("secureConnection",(V)=>{V.on("error",(B)=>{this.trace("An incoming TLS connection closed with error: "+B.message)})});let K=(V)=>{if(V){let B=X;try{B.setSecureContext(V)}catch(I){YZ.log(p6.LogVerbosity.ERROR,"Failed to set secure context with error "+I.message),V=null}}q=V!==null,this.trace("Post-update credentials valid: "+q)};F._addWatcher(K),X.on("close",()=>{F._removeWatcher(K)})}else X=g8.createServer(this.commonServerOptions);return X.setTimeout(0,Nf0),this._setupHandlers(X,F._getInterceptors()),X}bindOneAddress(F,X){this.trace("Attempting to bind "+(0,I5.subchannelAddressToString)(F));let J=this.createHttp2Server(X.credentials);return new Promise((Q,G)=>{let q=(K)=>{this.trace("Failed to bind "+(0,I5.subchannelAddressToString)(F)+" with error "+K.message),Q({port:"port"in F?F.port:1,error:K.message})};J.once("error",q),J.listen(F,()=>{let K=J.address(),V;if(typeof K==="string")V={path:K};else V={host:K.address,port:K.port};let B=this.experimentalRegisterListenerToChannelz(V);this.listenerChildrenTracker.refChild(B),this.http2Servers.set(J,{channelzRef:B,sessions:new Set,ownsChannelzRef:!0}),X.listeningServers.add(J),this.trace("Successfully bound "+(0,I5.subchannelAddressToString)(V)),Q({port:"port"in V?V.port:1}),J.removeListener("error",q)})})}async bindManyPorts(F,X){if(F.length===0)return{count:0,port:0,errors:[]};if((0,I5.isTcpSubchannelAddress)(F[0])&&F[0].port===0){let J=await this.bindOneAddress(F[0],X);if(J.error){let Q=await this.bindManyPorts(F.slice(1),X);return Object.assign(Object.assign({},Q),{errors:[J.error,...Q.errors]})}else{let Q=F.slice(1).map((K)=>(0,I5.isTcpSubchannelAddress)(K)?{host:K.host,port:J.port}:K),G=await Promise.all(Q.map((K)=>this.bindOneAddress(K,X))),q=[J,...G];return{count:q.filter((K)=>K.error===void 0).length,port:J.port,errors:q.filter((K)=>K.error).map((K)=>K.error)}}}else{let J=await Promise.all(F.map((Q)=>this.bindOneAddress(Q,X)));return{count:J.filter((Q)=>Q.error===void 0).length,port:J[0].port,errors:J.filter((Q)=>Q.error).map((Q)=>Q.error)}}}async bindAddressList(F,X){let J=await this.bindManyPorts(F,X);if(J.count>0){if(J.count<F.length)YZ.log(p6.LogVerbosity.INFO,`WARNING Only ${J.count} addresses added out of total ${F.length} resolved`);return J.port}else{let Q=`No address added out of total ${F.length} resolved`;throw YZ.log(p6.LogVerbosity.ERROR,Q),Error(`${Q} errors: [${J.errors.join(",")}]`)}}resolvePort(F){return new Promise((X,J)=>{let Q=!1,G=(K,V,B,I)=>{if(Q)return!0;if(Q=!0,!K.ok)return J(Error(K.error.details)),!0;let M=[].concat(...K.value.map((E)=>E.addresses));if(M.length===0)return J(Error(`No addresses resolved for port ${F}`)),!0;return X(M),!0};(0,Ko.createResolver)(F,G,this.options).updateResolution()})}async bindPort(F,X){let J=await this.resolvePort(F);if(X.cancelled)throw this.completeUnbind(X),Error("bindAsync operation cancelled by unbind call");let Q=await this.bindAddressList(J,X);if(X.cancelled)throw this.completeUnbind(X),Error("bindAsync operation cancelled by unbind call");return Q}normalizePort(F){let X=(0,j9.parseUri)(F);if(X===null)throw Error(`Could not parse port "${F}"`);let J=(0,Ko.mapUriDefaultScheme)(X);if(J===null)throw Error(`Could not get a default scheme for port "${F}"`);return J}bindAsync(F,X,J){if(this.shutdown)throw Error("bindAsync called after shutdown");if(typeof F!=="string")throw TypeError("port must be a string");if(X===null||!(X instanceof jA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(typeof J!=="function")throw TypeError("callback must be a function");this.trace("bindAsync port="+F);let Q=this.normalizePort(F),G=(B,I)=>{process.nextTick(()=>J(B,I))},q=this.boundPorts.get((0,j9.uriToString)(Q));if(q){if(!X._equals(q.credentials)){G(Error(`${F} already bound with incompatible credentials`),0);return}if(q.cancelled=!1,q.completionPromise)q.completionPromise.then((B)=>J(null,B),(B)=>J(B,0));else G(null,q.portNumber);return}q={mapKey:(0,j9.uriToString)(Q),originalUri:Q,completionPromise:null,cancelled:!1,portNumber:0,credentials:X,listeningServers:new Set};let K=(0,j9.splitHostPort)(Q.path),V=this.bindPort(Q,q);if(q.completionPromise=V,(K===null||K===void 0?void 0:K.port)===0)V.then((B)=>{let I={scheme:Q.scheme,authority:Q.authority,path:(0,j9.combineHostPort)({host:K.host,port:B})};q.mapKey=(0,j9.uriToString)(I),q.completionPromise=null,q.portNumber=B,this.boundPorts.set(q.mapKey,q),J(null,B)},(B)=>{J(B,0)});else this.boundPorts.set(q.mapKey,q),V.then((B)=>{q.completionPromise=null,q.portNumber=B,J(null,B)},(B)=>{J(B,0)})}registerInjectorToChannelz(){return(0,Y8.registerChannelzSocket)("injector",()=>{return{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(F,X,J=!1){if(F===null||!(F instanceof jA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(this.channelzEnabled)this.listenerChildrenTracker.refChild(X);let Q=this.createHttp2Server(F),G=new Set;return this.http2Servers.set(Q,{channelzRef:X,sessions:G,ownsChannelzRef:J}),{injectConnection:(q)=>{Q.emit("connection",q)},drain:(q)=>{var K,V;for(let B of G)this.closeSession(B);(V=(K=setTimeout(()=>{for(let B of G)B.destroy(g8.constants.NGHTTP2_CANCEL)},q)).unref)===null||V===void 0||V.call(K)},destroy:()=>{this.closeServer(Q);for(let q of G)this.closeSession(q)}}}createConnectionInjector(F){if(F===null||!(F instanceof jA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");let X=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(F,X,!0)}closeServer(F,X){this.trace("Closing server with address "+JSON.stringify(F.address()));let J=this.http2Servers.get(F);F.close(()=>{if(J&&J.ownsChannelzRef)this.listenerChildrenTracker.unrefChild(J.channelzRef),(0,Y8.unregisterChannelzRef)(J.channelzRef);this.http2Servers.delete(F),X===null||X===void 0||X()})}closeSession(F,X){var J;this.trace("Closing session initiated by "+((J=F.socket)===null||J===void 0?void 0:J.remoteAddress));let Q=this.sessions.get(F),G=()=>{if(Q)this.sessionChildrenTracker.unrefChild(Q.ref),(0,Y8.unregisterChannelzRef)(Q.ref);X===null||X===void 0||X()};if(F.closed)queueMicrotask(G);else F.close(G)}completeUnbind(F){for(let X of F.listeningServers){let J=this.http2Servers.get(X);if(this.closeServer(X,()=>{F.listeningServers.delete(X)}),J)for(let Q of J.sessions)this.closeSession(Q)}this.boundPorts.delete(F.mapKey)}unbind(F){this.trace("unbind port="+F);let X=this.normalizePort(F),J=(0,j9.splitHostPort)(X.path);if((J===null||J===void 0?void 0:J.port)===0)throw Error("Cannot unbind port 0");let Q=this.boundPorts.get((0,j9.uriToString)(X));if(Q)if(this.trace("unbinding "+Q.mapKey+" originally bound as "+(0,j9.uriToString)(Q.originalUri)),Q.completionPromise)Q.cancelled=!0;else this.completeUnbind(Q)}drain(F,X){var J,Q;this.trace("drain port="+F+" graceTimeMs="+X);let G=this.normalizePort(F),q=(0,j9.splitHostPort)(G.path);if((q===null||q===void 0?void 0:q.port)===0)throw Error("Cannot drain port 0");let K=this.boundPorts.get((0,j9.uriToString)(G));if(!K)return;let V=new Set;for(let B of K.listeningServers){let I=this.http2Servers.get(B);if(I)for(let M of I.sessions)V.add(M),this.closeSession(M,()=>{V.delete(M)})}(Q=(J=setTimeout(()=>{for(let B of V)B.destroy(g8.constants.NGHTTP2_CANCEL)},X)).unref)===null||Q===void 0||Q.call(J)}forceShutdown(){for(let F of this.boundPorts.values())F.cancelled=!0;this.boundPorts.clear();for(let F of this.http2Servers.keys())this.closeServer(F);this.sessions.forEach((F,X)=>{this.closeSession(X),X.destroy(g8.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Y8.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(F,X,J,Q,G){if(this.handlers.has(F))return!1;return this.handlers.set(F,{func:X,serialize:J,deserialize:Q,type:G,path:F}),!0}unregister(F){return this.handlers.delete(F)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every((F)=>!F.listening))throw Error("server must be bound in order to start");if(this.started===!0)throw Error("server is already started");this.started=!0}tryShutdown(F){var X;let J=(q)=>{(0,Y8.unregisterChannelzRef)(this.channelzRef),F(q)},Q=0;function G(){if(Q--,Q===0)J()}this.shutdown=!0;for(let[q,K]of this.http2Servers.entries()){Q++;let V=K.channelzRef.name;this.trace("Waiting for server "+V+" to close"),this.closeServer(q,()=>{this.trace("Server "+V+" finished closing"),G()});for(let B of K.sessions.keys()){Q++;let I=(X=B.socket)===null||X===void 0?void 0:X.remoteAddress;this.trace("Waiting for session "+I+" to close"),this.closeSession(B,()=>{this.trace("Session "+I+" finished closing"),G()})}}if(Q===0)J()}addHttp2Port(){throw Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(F,X){let J=X[g8.constants.HTTP2_HEADER_CONTENT_TYPE];if(typeof J!=="string"||!J.startsWith("application/grpc"))return F.respond({[g8.constants.HTTP2_HEADER_STATUS]:g8.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1;return!0}_retrieveHandler(F){qo("Received call to method "+F+" at address "+this.serverAddressString);let X=this.handlers.get(F);if(X===void 0)return qo("No handler registered for method "+F+". Sending UNIMPLEMENTED status."),null;return X}_respondWithError(F,X,J=null){var Q,G;let q=Object.assign({"grpc-status":(Q=F.code)!==null&&Q!==void 0?Q:p6.Status.INTERNAL,"grpc-message":F.details,[g8.constants.HTTP2_HEADER_STATUS]:g8.constants.HTTP_STATUS_OK,[g8.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(G=F.metadata)===null||G===void 0?void 0:G.toHttp2Headers());X.respond(q,{endStream:!0}),this.callTracker.addCallFailed(),J===null||J===void 0||J.streamTracker.addCallFailed()}_channelzHandler(F,X,J){this.onStreamOpened(X);let Q=this.sessions.get(X.session);if(this.callTracker.addCallStarted(),Q===null||Q===void 0||Q.streamTracker.addCallStarted(),!this._verifyContentType(X,J)){this.callTracker.addCallFailed(),Q===null||Q===void 0||Q.streamTracker.addCallFailed();return}let G=J[Ho],q=this._retrieveHandler(G);if(!q){this._respondWithError(xA(G),X,Q);return}let K={addMessageSent:()=>{if(Q)Q.messagesSent+=1,Q.lastMessageSentTimestamp=new Date},addMessageReceived:()=>{if(Q)Q.messagesReceived+=1,Q.lastMessageReceivedTimestamp=new Date},onCallEnd:(B)=>{if(B.code===p6.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()},onStreamEnd:(B)=>{if(Q)if(B)Q.streamTracker.addCallSucceeded();else Q.streamTracker.addCallFailed()}},V=(0,Go.getServerInterceptingCall)([...F,...this.interceptors],X,J,K,q,this.options);if(!this._runHandlerForCall(V,q))this.callTracker.addCallFailed(),Q===null||Q===void 0||Q.streamTracker.addCallFailed(),V.sendStatus({code:p6.Status.INTERNAL,details:`Unknown handler type: ${q.type}`})}_streamHandler(F,X,J){if(this.onStreamOpened(X),this._verifyContentType(X,J)!==!0)return;let Q=J[Ho],G=this._retrieveHandler(Q);if(!G){this._respondWithError(xA(Q),X,null);return}let q=(0,Go.getServerInterceptingCall)([...F,...this.interceptors],X,J,null,G,this.options);if(!this._runHandlerForCall(q,G))q.sendStatus({code:p6.Status.INTERNAL,details:`Unknown handler type: ${G.type}`})}_runHandlerForCall(F,X){let{type:J}=X;if(J==="unary")If0(F,X);else if(J==="clientStream")$f0(F,X);else if(J==="serverStream")Cf0(F,X);else if(J==="bidi")Ef0(F,X);else return!1;return!0}_setupHandlers(F,X){if(F===null)return;let J=F.address(),Q="null";if(J)if(typeof J==="string")Q=J;else Q=J.address+":"+J.port;this.serverAddressString=Q;let G=this.channelzEnabled?this._channelzHandler:this._streamHandler,q=this.channelzEnabled?this._channelzSessionHandler(F):this._sessionHandler(F);F.on("stream",G.bind(this,X)),F.on("session",q)}_sessionHandler(F){return(X)=>{var J,Q;(J=this.http2Servers.get(F))===null||J===void 0||J.sessions.add(X);let G=null,q=null,K=null,V=!1,B=this.enableIdleTimeout(X);if(this.maxConnectionAgeMs!==eY){let N=this.maxConnectionAgeMs/10,O=Math.random()*N*2-N;G=setTimeout(()=>{var T,C;V=!0,this.trace("Connection dropped by max connection age: "+((T=X.socket)===null||T===void 0?void 0:T.remoteAddress));try{X.goaway(g8.constants.NGHTTP2_NO_ERROR,2147483647,Vo)}catch(R){X.destroy();return}if(X.close(),this.maxConnectionAgeGraceMs!==eY)q=setTimeout(()=>{X.destroy()},this.maxConnectionAgeGraceMs),(C=q.unref)===null||C===void 0||C.call(q)},this.maxConnectionAgeMs+O),(Q=G.unref)===null||Q===void 0||Q.call(G)}let I=()=>{if(K)clearTimeout(K),K=null},M=()=>{return!X.destroyed&&this.keepaliveTimeMs<_A&&this.keepaliveTimeMs>0},E,A=()=>{var N;if(!M())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),K=setTimeout(()=>{I(),E()},this.keepaliveTimeMs),(N=K.unref)===null||N===void 0||N.call(K)};E=()=>{var N;if(!M())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let O="";try{if(!X.ping((C,R,w)=>{if(I(),C)this.keepaliveTrace("Ping failed with error: "+C.message),V=!0,X.destroy();else this.keepaliveTrace("Received ping response"),A()}))O="Ping returned false"}catch(T){O=(T instanceof Error?T.message:"")||"Unknown error"}if(O){this.keepaliveTrace("Ping send failed: "+O),this.trace("Connection dropped due to ping send error: "+O),V=!0,X.destroy();return}K=setTimeout(()=>{I(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),V=!0,X.destroy()},this.keepaliveTimeoutMs),(N=K.unref)===null||N===void 0||N.call(K)},A(),X.on("close",()=>{var N,O;if(!V)this.trace(`Connection dropped by client ${(N=X.socket)===null||N===void 0?void 0:N.remoteAddress}`);if(G)clearTimeout(G);if(q)clearTimeout(q);if(I(),B!==null)clearTimeout(B.timeout),this.sessionIdleTimeouts.delete(X);(O=this.http2Servers.get(F))===null||O===void 0||O.sessions.delete(X)})}}_channelzSessionHandler(F){return(X)=>{var J,Q,G,q;let K=(0,Y8.registerChannelzSocket)((Q=(J=X.socket)===null||J===void 0?void 0:J.remoteAddress)!==null&&Q!==void 0?Q:"unknown",this.getChannelzSessionInfo.bind(this,X),this.channelzEnabled),V={ref:K,streamTracker:new Y8.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(G=this.http2Servers.get(F))===null||G===void 0||G.sessions.add(X),this.sessions.set(X,V);let B=`${X.socket.remoteAddress}:${X.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+B),this.trace("Connection established by client "+B),this.sessionChildrenTracker.refChild(K);let I=null,M=null,E=null,A=!1,N=this.enableIdleTimeout(X);if(this.maxConnectionAgeMs!==eY){let w=this.maxConnectionAgeMs/10,L=Math.random()*w*2-w;I=setTimeout(()=>{var k;A=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+B);try{X.goaway(g8.constants.NGHTTP2_NO_ERROR,2147483647,Vo)}catch(v){X.destroy();return}if(X.close(),this.maxConnectionAgeGraceMs!==eY)M=setTimeout(()=>{X.destroy()},this.maxConnectionAgeGraceMs),(k=M.unref)===null||k===void 0||k.call(M)},this.maxConnectionAgeMs+L),(q=I.unref)===null||q===void 0||q.call(I)}let O=()=>{if(E)clearTimeout(E),E=null},T=()=>{return!X.destroyed&&this.keepaliveTimeMs<_A&&this.keepaliveTimeMs>0},C,R=()=>{var w;if(!T())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),E=setTimeout(()=>{O(),C()},this.keepaliveTimeMs),(w=E.unref)===null||w===void 0||w.call(E)};C=()=>{var w;if(!T())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let L="";try{if(!X.ping((v,f,h)=>{if(O(),v)this.keepaliveTrace("Ping failed with error: "+v.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+v.message+" return in "+f),A=!0,X.destroy();else this.keepaliveTrace("Received ping response"),R()}))L="Ping returned false"}catch(k){L=(k instanceof Error?k.message:"")||"Unknown error"}if(L){this.keepaliveTrace("Ping send failed: "+L),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+L),A=!0,X.destroy();return}V.keepAlivesSent+=1,E=setTimeout(()=>{O(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+B),A=!0,X.destroy()},this.keepaliveTimeoutMs),(w=E.unref)===null||w===void 0||w.call(E)},R(),X.on("close",()=>{var w;if(!A)this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+B);if(this.sessionChildrenTracker.unrefChild(K),(0,Y8.unregisterChannelzRef)(K),I)clearTimeout(I);if(M)clearTimeout(M);if(O(),N!==null)clearTimeout(N.timeout),this.sessionIdleTimeouts.delete(X);(w=this.http2Servers.get(F))===null||w===void 0||w.sessions.delete(X),this.sessions.delete(X)})}}enableIdleTimeout(F){var X,J;if(this.sessionIdleTimeout>=Fo)return null;let Q={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,F),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,F)};(J=(X=Q.timeout).unref)===null||J===void 0||J.call(X),this.sessionIdleTimeouts.set(F,Q);let{socket:G}=F;return this.trace("Enable idle timeout for "+G.remoteAddress+":"+G.remotePort),Q}onIdleTimeout(F,X){let{socket:J}=X,Q=F.sessionIdleTimeouts.get(X);if(Q!==void 0&&Q.activeStreams===0)if(Date.now()-Q.lastIdle>=F.sessionIdleTimeout)F.trace("Session idle timeout triggered for "+(J===null||J===void 0?void 0:J.remoteAddress)+":"+(J===null||J===void 0?void 0:J.remotePort)+" last idle at "+Q.lastIdle),F.closeSession(X);else Q.timeout.refresh()}onStreamOpened(F){let X=F.session,J=this.sessionIdleTimeouts.get(X);if(J)J.activeStreams+=1,F.once("close",J.onClose)}onStreamClose(F){var X,J;let Q=this.sessionIdleTimeouts.get(F);if(Q){if(Q.activeStreams-=1,Q.activeStreams===0)Q.lastIdle=Date.now(),Q.timeout.refresh(),this.trace("Session onStreamClose"+((X=F.socket)===null||X===void 0?void 0:X.remoteAddress)+":"+((J=F.socket)===null||J===void 0?void 0:J.remotePort)+" at "+Q.lastIdle)}}},(()=>{let H=typeof Symbol==="function"&&Symbol.metadata?Object.create(null):void 0;if(W=[Of0("Calling start() is no longer necessary. It can be safely omitted.")],zf0(Y,null,W,{kind:"method",name:"start",static:!1,private:!1,access:{has:(F)=>("start"in F),get:(F)=>F.start},metadata:H},null,Z),H)Object.defineProperty(Y,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:H})})(),Y})();$5.Server=Tf0;async function If0(Y,Z){let W;function H(J,Q,G,q){if(J){Y.sendStatus((0,ZZ.serverErrorToStatus)(J,G));return}Y.sendMessage(Q,()=>{Y.sendStatus({code:p6.Status.OK,details:"OK",metadata:G!==null&&G!==void 0?G:null})})}let F,X=null;Y.start({onReceiveMetadata(J){F=J,Y.startRead()},onReceiveMessage(J){if(X){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${Z.path}`,metadata:null});return}X=J,Y.startRead()},onReceiveHalfClose(){if(!X){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${Z.path}`,metadata:null});return}W=new ZZ.ServerWritableStreamImpl(Z.path,Y,F,X);try{Z.func(W,H)}catch(J){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${J.message}`,metadata:null})}},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled")}})}function $f0(Y,Z){let W;function H(F,X,J,Q){if(F){Y.sendStatus((0,ZZ.serverErrorToStatus)(F,J));return}Y.sendMessage(X,()=>{Y.sendStatus({code:p6.Status.OK,details:"OK",metadata:J!==null&&J!==void 0?J:null})})}Y.start({onReceiveMetadata(F){W=new ZZ.ServerDuplexStreamImpl(Z.path,Y,F);try{Z.func(W,H)}catch(X){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${X.message}`,metadata:null})}},onReceiveMessage(F){W.push(F)},onReceiveHalfClose(){W.push(null)},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled"),W.destroy()}})}function Cf0(Y,Z){let W,H,F=null;Y.start({onReceiveMetadata(X){H=X,Y.startRead()},onReceiveMessage(X){if(F){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${Z.path}`,metadata:null});return}F=X,Y.startRead()},onReceiveHalfClose(){if(!F){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${Z.path}`,metadata:null});return}W=new ZZ.ServerWritableStreamImpl(Z.path,Y,H,F);try{Z.func(W)}catch(X){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${X.message}`,metadata:null})}},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled"),W.destroy()}})}function Ef0(Y,Z){let W;Y.start({onReceiveMetadata(H){W=new ZZ.ServerDuplexStreamImpl(Z.path,Y,H);try{Z.func(W)}catch(F){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${F.message}`,metadata:null})}},onReceiveMessage(H){W.push(H)},onReceiveHalfClose(){W.push(null)},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled"),W.destroy()}})}});var No=H0((Ao)=>{Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StatusBuilder=void 0;class Bo{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(Y){return this.code=Y,this}withDetails(Y){return this.details=Y,this}withMetadata(Y){return this.metadata=Y,this}build(){let Y={};if(this.code!==null)Y.code=this.code;if(this.details!==null)Y.details=this.details;if(this.metadata!==null)Y.metadata=this.metadata;return Y}}Ao.StatusBuilder=Bo});var OX=H0((Mo)=>{Object.defineProperty(Mo,"__esModule",{value:!0});Mo.LeafLoadBalancer=Mo.PickFirstLoadBalancer=Mo.PickFirstLoadBalancingConfig=void 0;Mo.shuffled=$o;Mo.setup=kf0;var bA=V5(),i6=k8(),C5=E4(),Oo=u8(),Mf0=M6(),Rf0=a1(),Do=u8(),To=V1("net"),Pf0=U7(),Lf0="pick_first";function UX(Y){Mf0.trace(Rf0.LogVerbosity.DEBUG,Lf0,Y)}var NX="pick_first",wf0=250;class QZ{constructor(Y){this.shuffleAddressList=Y}getLoadBalancerName(){return NX}toJsonObject(){return{[NX]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(Y){if("shuffleAddressList"in Y&&typeof Y.shuffleAddressList!=="boolean")throw Error("pick_first config field shuffleAddressList must be a boolean if provided");return new QZ(Y.shuffleAddressList===!0)}}Mo.PickFirstLoadBalancingConfig=QZ;class Io{constructor(Y){this.subchannel=Y}pick(Y){return{pickResultType:C5.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}}function $o(Y){let Z=Y.slice();for(let W=Z.length-1;W>1;W--){let H=Math.floor(Math.random()*(W+1)),F=Z[W];Z[W]=Z[H],Z[H]=F}return Z}function Sf0(Y){if(Y.length===0)return[];let Z=[],W=[],H=[],F=(0,Do.isTcpSubchannelAddress)(Y[0])&&(0,To.isIPv6)(Y[0].host);for(let Q of Y)if((0,Do.isTcpSubchannelAddress)(Q)&&(0,To.isIPv6)(Q.host))W.push(Q);else H.push(Q);let X=F?W:H,J=F?H:W;for(let Q=0;Q<Math.max(X.length,J.length);Q++){if(Q<X.length)Z.push(X[Q]);if(Q<J.length)Z.push(J[Q])}return Z}var Co="grpc-node.internal.pick-first.report_health_status";class zK{constructor(Y){this.channelControlHelper=Y,this.children=[],this.currentState=i6.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(Z,W,H,F,X)=>{this.onSubchannelStateUpdate(Z,W,H,X)},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((Y)=>Y.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every((Y)=>Y.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var Y;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let Z=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker({details:Z}),Z)}else this.updateState(i6.ConnectivityState.READY,new Io(this.currentPick),null);else if(((Y=this.latestAddressList)===null||Y===void 0?void 0:Y.length)===0){let Z=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker({details:Z}),Z)}else if(this.children.length===0)this.updateState(i6.ConnectivityState.IDLE,new C5.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let Z=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker({details:Z}),Z)}else this.updateState(i6.ConnectivityState.CONNECTING,new C5.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(!this.allChildrenHaveReportedTF())return;if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:Y}of this.children)Y.startConnecting();this.calculateAndReportNewState()}removeCurrentPick(){if(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(Y,Z,W,H){var F;if((F=this.currentPick)===null||F===void 0?void 0:F.realSubchannelEquals(Y)){if(W!==i6.ConnectivityState.READY)this.removeCurrentPick(),this.calculateAndReportNewState();return}for(let[X,J]of this.children.entries())if(Y.realSubchannelEquals(J.subchannel)){if(W===i6.ConnectivityState.READY)this.pickSubchannel(J.subchannel);if(W===i6.ConnectivityState.TRANSIENT_FAILURE){if(J.hasReportedTransientFailure=!0,H)this.lastError=H;if(this.maybeEnterStickyTransientFailureMode(),X===this.currentSubchannelIndex)this.startNextSubchannelConnecting(X+1)}J.subchannel.startConnecting();return}}startNextSubchannelConnecting(Y){clearTimeout(this.connectionDelayTimeout);for(let[Z,W]of this.children.entries())if(Z>=Y){let H=W.subchannel.getConnectivityState();if(H===i6.ConnectivityState.IDLE||H===i6.ConnectivityState.CONNECTING){this.startConnecting(Z);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(Y){var Z,W;if(clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=Y,this.children[Y].subchannel.getConnectivityState()===i6.ConnectivityState.IDLE)UX("Start connecting to subchannel with address "+this.children[Y].subchannel.getAddress()),process.nextTick(()=>{var H;(H=this.children[Y])===null||H===void 0||H.subchannel.startConnecting()});this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(Y+1)},wf0),(W=(Z=this.connectionDelayTimeout).unref)===null||W===void 0||W.call(Z)}pickSubchannel(Y){UX("Pick subchannel with address "+Y.getAddress()),this.stickyTransientFailureMode=!1,Y.ref(),this.channelControlHelper.addChannelzChild(Y.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),Y.addConnectivityStateListener(this.subchannelStateListener),Y.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=Y,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(Y,Z,W){UX(i6.ConnectivityState[this.currentState]+" -> "+i6.ConnectivityState[Y]),this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}resetSubchannelList(){for(let Y of this.children)Y.subchannel.removeConnectivityStateListener(this.subchannelStateListener),Y.subchannel.unref(),this.channelControlHelper.removeChannelzChild(Y.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(Y,Z){UX("connectToAddressList(["+Y.map((H)=>(0,Oo.subchannelAddressToString)(H))+"])");let W=Y.map((H)=>({subchannel:this.channelControlHelper.createSubchannel(H,Z),hasReportedTransientFailure:!1}));for(let{subchannel:H}of W)if(H.getConnectivityState()===i6.ConnectivityState.READY){this.pickSubchannel(H);return}for(let{subchannel:H}of W)H.ref(),this.channelControlHelper.addChannelzChild(H.getChannelzRef());this.resetSubchannelList(),this.children=W;for(let{subchannel:H}of this.children)H.addConnectivityStateListener(this.subchannelStateListener);for(let H of this.children)if(H.subchannel.getConnectivityState()===i6.ConnectivityState.TRANSIENT_FAILURE)H.hasReportedTransientFailure=!0;this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(Y,Z,W,H){if(!(Z instanceof QZ))return!1;if(!Y.ok){if(this.children.length===0&&this.currentPick===null)this.channelControlHelper.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker(Y.error),Y.error.details);return!0}let F=Y.value;if(this.reportHealthStatus=W[Co],Z.getShuffleAddressList())F=$o(F);let X=[].concat(...F.map((Q)=>Q.addresses));UX("updateAddressList(["+X.map((Q)=>(0,Oo.subchannelAddressToString)(Q))+"])");let J=Sf0(X);if(this.latestAddressList=J,this.latestOptions=W,this.connectToAddressList(J,W),this.latestResolutionNote=H,X.length>0)return!0;else return this.lastError="No addresses resolved",!1}exitIdle(){if(this.currentState===i6.ConnectivityState.IDLE&&this.latestAddressList)this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return NX}}Mo.PickFirstLoadBalancer=zK;var ff0=new QZ(!1);class Eo{constructor(Y,Z,W,H){this.endpoint=Y,this.options=W,this.resolutionNote=H,this.latestState=i6.ConnectivityState.IDLE;let F=(0,bA.createChildChannelControlHelper)(Z,{updateState:(X,J,Q)=>{this.latestState=X,this.latestPicker=J,Z.updateState(X,J,Q)}});this.pickFirstBalancer=new zK(F),this.latestPicker=new C5.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,Pf0.statusOrFromValue)([this.endpoint]),ff0,Object.assign(Object.assign({},this.options),{[Co]:!0}),this.resolutionNote)}updateEndpoint(Y,Z){if(this.options=Z,this.endpoint=Y,this.latestState!==i6.ConnectivityState.IDLE)this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}}Mo.LeafLoadBalancer=Eo;function kf0(){(0,bA.registerLoadBalancerType)(NX,zK,QZ),(0,bA.registerDefaultLoadBalancerType)(NX)}});var So=H0((Lo)=>{Object.defineProperty(Lo,"__esModule",{value:!0});Lo.FileWatcherCertificateProvider=void 0;var _f0=V1("fs"),xf0=M6(),bf0=a1(),uf0=V1("util"),mf0="certificate_provider";function BK(Y){xf0.trace(bf0.LogVerbosity.DEBUG,mf0,Y)}var uA=(0,uf0.promisify)(_f0.readFile);class Po{constructor(Y){if(this.config=Y,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,Y.certificateFile===void 0!==(Y.privateKeyFile===void 0))throw Error("certificateFile and privateKeyFile must be set or unset together");if(Y.certificateFile===void 0&&Y.caCertificateFile===void 0)throw Error("At least one of certificateFile and caCertificateFile must be set");BK("File watcher constructed with config "+JSON.stringify(Y))}updateCertificates(){if(this.fileResultPromise)return;this.fileResultPromise=Promise.allSettled([this.config.certificateFile?uA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?uA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?uA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([Y,Z,W])=>{if(!this.refreshTimer)return;if(BK("File watcher read certificates certificate "+Y.status+", privateKey "+Z.status+", CA certificate "+W.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,Y.status==="fulfilled"&&Z.status==="fulfilled")this.latestIdentityUpdate={certificate:Y.value,privateKey:Z.value};else this.latestIdentityUpdate=null;if(W.status==="fulfilled")this.latestCaUpdate={caCertificate:W.value};else this.latestCaUpdate=null;for(let H of this.identityListeners)H(this.latestIdentityUpdate);for(let H of this.caListeners)H(this.latestCaUpdate)}),BK("File watcher initiated certificate update")}maybeStartWatchingFiles(){if(!this.refreshTimer){let Y=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;if(Y>this.config.refreshIntervalMs)this.updateCertificates();if(Y>this.config.refreshIntervalMs*2)this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0;this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),BK("File watcher started watching")}}maybeStopWatchingFiles(){if(this.caListeners.size===0&&this.identityListeners.size===0){if(this.fileResultPromise=null,this.refreshTimer)clearInterval(this.refreshTimer),this.refreshTimer=null}}addCaCertificateListener(Y){if(this.caListeners.add(Y),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0)process.nextTick(Y,this.latestCaUpdate)}removeCaCertificateListener(Y){this.caListeners.delete(Y),this.maybeStopWatchingFiles()}addIdentityCertificateListener(Y){if(this.identityListeners.add(Y),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0)process.nextTick(Y,this.latestIdentityUpdate)}removeIdentityCertificateListener(Y){this.identityListeners.delete(Y),this.maybeStopWatchingFiles()}}Lo.FileWatcherCertificateProvider=Po});var dA=H0((Y6)=>{Object.defineProperty(Y6,"__esModule",{value:!0});Y6.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=Y6.createCertificateProviderChannelCredentials=Y6.FileWatcherCertificateProvider=Y6.createCertificateProviderServerCredentials=Y6.createServerCredentialsWithInterceptors=Y6.BaseSubchannelWrapper=Y6.registerAdminService=Y6.FilterStackFactory=Y6.BaseFilter=Y6.statusOrFromError=Y6.statusOrFromValue=Y6.PickResultType=Y6.QueuePicker=Y6.UnavailablePicker=Y6.ChildLoadBalancerHandler=Y6.EndpointMap=Y6.endpointHasAddress=Y6.endpointToString=Y6.subchannelAddressToString=Y6.LeafLoadBalancer=Y6.isLoadBalancerNameRegistered=Y6.parseLoadBalancingConfig=Y6.selectLbConfigFromList=Y6.registerLoadBalancerType=Y6.createChildChannelControlHelper=Y6.BackoffTimeout=Y6.parseDuration=Y6.durationToMs=Y6.splitHostPort=Y6.uriToString=Y6.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=Y6.createResolver=Y6.registerResolver=Y6.log=Y6.trace=void 0;var fo=M6();Object.defineProperty(Y6,"trace",{enumerable:!0,get:function(){return fo.trace}});Object.defineProperty(Y6,"log",{enumerable:!0,get:function(){return fo.log}});var mA=S9();Object.defineProperty(Y6,"registerResolver",{enumerable:!0,get:function(){return mA.registerResolver}});Object.defineProperty(Y6,"createResolver",{enumerable:!0,get:function(){return mA.createResolver}});Object.defineProperty(Y6,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return mA.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var ko=f8();Object.defineProperty(Y6,"uriToString",{enumerable:!0,get:function(){return ko.uriToString}});Object.defineProperty(Y6,"splitHostPort",{enumerable:!0,get:function(){return ko.splitHostPort}});var yo=AX();Object.defineProperty(Y6,"durationToMs",{enumerable:!0,get:function(){return yo.durationToMs}});Object.defineProperty(Y6,"parseDuration",{enumerable:!0,get:function(){return yo.parseDuration}});var gf0=yY();Object.defineProperty(Y6,"BackoffTimeout",{enumerable:!0,get:function(){return gf0.BackoffTimeout}});var DX=V5();Object.defineProperty(Y6,"createChildChannelControlHelper",{enumerable:!0,get:function(){return DX.createChildChannelControlHelper}});Object.defineProperty(Y6,"registerLoadBalancerType",{enumerable:!0,get:function(){return DX.registerLoadBalancerType}});Object.defineProperty(Y6,"selectLbConfigFromList",{enumerable:!0,get:function(){return DX.selectLbConfigFromList}});Object.defineProperty(Y6,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return DX.parseLoadBalancingConfig}});Object.defineProperty(Y6,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return DX.isLoadBalancerNameRegistered}});var df0=OX();Object.defineProperty(Y6,"LeafLoadBalancer",{enumerable:!0,get:function(){return df0.LeafLoadBalancer}});var AK=u8();Object.defineProperty(Y6,"subchannelAddressToString",{enumerable:!0,get:function(){return AK.subchannelAddressToString}});Object.defineProperty(Y6,"endpointToString",{enumerable:!0,get:function(){return AK.endpointToString}});Object.defineProperty(Y6,"endpointHasAddress",{enumerable:!0,get:function(){return AK.endpointHasAddress}});Object.defineProperty(Y6,"EndpointMap",{enumerable:!0,get:function(){return AK.EndpointMap}});var cf0=z3();Object.defineProperty(Y6,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return cf0.ChildLoadBalancerHandler}});var gA=E4();Object.defineProperty(Y6,"UnavailablePicker",{enumerable:!0,get:function(){return gA.UnavailablePicker}});Object.defineProperty(Y6,"QueuePicker",{enumerable:!0,get:function(){return gA.QueuePicker}});Object.defineProperty(Y6,"PickResultType",{enumerable:!0,get:function(){return gA.PickResultType}});var vo=U7();Object.defineProperty(Y6,"statusOrFromValue",{enumerable:!0,get:function(){return vo.statusOrFromValue}});Object.defineProperty(Y6,"statusOrFromError",{enumerable:!0,get:function(){return vo.statusOrFromError}});var lf0=YA();Object.defineProperty(Y6,"BaseFilter",{enumerable:!0,get:function(){return lf0.BaseFilter}});var nf0=i3();Object.defineProperty(Y6,"FilterStackFactory",{enumerable:!0,get:function(){return nf0.FilterStackFactory}});var pf0=A3();Object.defineProperty(Y6,"registerAdminService",{enumerable:!0,get:function(){return pf0.registerAdminService}});var if0=zX();Object.defineProperty(Y6,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return if0.BaseSubchannelWrapper}});var ho=KK();Object.defineProperty(Y6,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return ho.createServerCredentialsWithInterceptors}});Object.defineProperty(Y6,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return ho.createCertificateProviderServerCredentials}});var rf0=So();Object.defineProperty(Y6,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return rf0.FileWatcherCertificateProvider}});var af0=kY();Object.defineProperty(Y6,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return af0.createCertificateProviderChannelCredentials}});var of0=$A();Object.defineProperty(Y6,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return of0.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var xo=H0((_o)=>{Object.defineProperty(_o,"__esModule",{value:!0});_o.setup=Yk0;var sf0=S9(),ef0=U7();class jo{constructor(Y,Z,W){this.listener=Z,this.hasReturnedResult=!1,this.endpoints=[];let H;if(Y.authority==="")H="/"+Y.path;else H=Y.path;this.endpoints=[{addresses:[{path:H}]}]}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(this.listener,(0,ef0.statusOrFromValue)(this.endpoints),{},null,"")}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(Y){return"localhost"}}function Yk0(){(0,sf0.registerResolver)("unix",jo)}});var no=H0((lo)=>{Object.defineProperty(lo,"__esModule",{value:!0});lo.setup=Kk0;var bo=V1("net"),uo=U7(),UK=a1(),cA=K8(),mo=S9(),Qk0=u8(),go=f8(),Xk0=M6(),Jk0="ip_resolver";function co(Y){Xk0.trace(UK.LogVerbosity.DEBUG,Jk0,Y)}var lA="ipv4",nA="ipv6",Wk0=443;class pA{constructor(Y,Z,W){var H;this.listener=Z,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,co("Resolver constructed for target "+(0,go.uriToString)(Y));let F=[];if(!(Y.scheme===lA||Y.scheme===nA)){this.error={code:UK.Status.UNAVAILABLE,details:`Unrecognized scheme ${Y.scheme} in IP resolver`,metadata:new cA.Metadata};return}let X=Y.path.split(",");for(let J of X){let Q=(0,go.splitHostPort)(J);if(Q===null){this.error={code:UK.Status.UNAVAILABLE,details:`Failed to parse ${Y.scheme} address ${J}`,metadata:new cA.Metadata};return}if(Y.scheme===lA&&!(0,bo.isIPv4)(Q.host)||Y.scheme===nA&&!(0,bo.isIPv6)(Q.host)){this.error={code:UK.Status.UNAVAILABLE,details:`Failed to parse ${Y.scheme} address ${J}`,metadata:new cA.Metadata};return}F.push({host:Q.host,port:(H=Q.port)!==null&&H!==void 0?H:Wk0})}this.endpoints=F.map((J)=>({addresses:[J]})),co("Parsed "+Y.scheme+" address list "+F.map(Qk0.subchannelAddressToString))}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(()=>{if(this.error)this.listener((0,uo.statusOrFromError)(this.error),{},null,"");else this.listener((0,uo.statusOrFromValue)(this.endpoints),{},null,"")})}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(Y){return Y.path.split(",")[0]}}function Kk0(){(0,mo.registerResolver)(lA,pA),(0,mo.registerResolver)(nA,pA)}});var so=H0((oo)=>{Object.defineProperty(oo,"__esModule",{value:!0});oo.RoundRobinLoadBalancer=void 0;oo.setup=Bk0;var ro=V5(),$8=k8(),TX=E4(),Fk0=M6(),Hk0=a1(),po=u8(),Vk0=OX(),qk0="round_robin";function io(Y){Fk0.trace(Hk0.LogVerbosity.DEBUG,qk0,Y)}var NK="round_robin";class OK{getLoadBalancerName(){return NK}constructor(){}toJsonObject(){return{[NK]:{}}}static createFromJson(Y){return new OK}}class ao{constructor(Y,Z=0){this.children=Y,this.nextIndex=Z}pick(Y){let Z=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,Z.pick(Y)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}}function zk0(Y,Z){return[...Y.slice(Z),...Y.slice(0,Z)]}class iA{constructor(Y){this.channelControlHelper=Y,this.children=[],this.currentState=$8.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,ro.createChildChannelControlHelper)(Y,{updateState:(Z,W,H)=>{if(this.currentState===$8.ConnectivityState.READY&&Z!==$8.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(H)this.lastError=H;this.calculateAndUpdateState()}})}countChildrenWithState(Y){return this.children.filter((Z)=>Z.getConnectivityState()===Y).length}calculateAndUpdateState(){if(this.updatesPaused)return;if(this.countChildrenWithState($8.ConnectivityState.READY)>0){let Y=this.children.filter((W)=>W.getConnectivityState()===$8.ConnectivityState.READY),Z=0;if(this.currentReadyPicker!==null){let W=this.currentReadyPicker.peekNextEndpoint();if(Z=Y.findIndex((H)=>(0,po.endpointEqual)(H.getEndpoint(),W)),Z<0)Z=0}this.updateState($8.ConnectivityState.READY,new ao(Y.map((W)=>({endpoint:W.getEndpoint(),picker:W.getPicker()})),Z),null)}else if(this.countChildrenWithState($8.ConnectivityState.CONNECTING)>0)this.updateState($8.ConnectivityState.CONNECTING,new TX.QueuePicker(this),null);else if(this.countChildrenWithState($8.ConnectivityState.TRANSIENT_FAILURE)>0){let Y=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState($8.ConnectivityState.TRANSIENT_FAILURE,new TX.UnavailablePicker({details:Y}),Y)}else this.updateState($8.ConnectivityState.IDLE,new TX.QueuePicker(this),null);for(let Y of this.children)if(Y.getConnectivityState()===$8.ConnectivityState.IDLE)Y.exitIdle()}updateState(Y,Z,W){if(io($8.ConnectivityState[this.currentState]+" -> "+$8.ConnectivityState[Y]),Y===$8.ConnectivityState.READY)this.currentReadyPicker=Z;else this.currentReadyPicker=null;this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}resetSubchannelList(){for(let Y of this.children)Y.destroy();this.children=[]}updateAddressList(Y,Z,W,H){if(!(Z instanceof OK))return!1;if(!Y.ok){if(this.children.length===0)this.updateState($8.ConnectivityState.TRANSIENT_FAILURE,new TX.UnavailablePicker(Y.error),Y.error.details);return!0}let F=Math.random()*Y.value.length|0,X=zk0(Y.value,F);if(this.resetSubchannelList(),X.length===0){let J=`No addresses resolved. Resolution note: ${H}`;this.updateState($8.ConnectivityState.TRANSIENT_FAILURE,new TX.UnavailablePicker({details:J}),J)}io("Connect to endpoint list "+X.map(po.endpointToString)),this.updatesPaused=!0,this.children=X.map((J)=>new Vk0.LeafLoadBalancer(J,this.childChannelControlHelper,W,H));for(let J of this.children)J.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return NK}}oo.RoundRobinLoadBalancer=iA;function Bk0(){(0,ro.registerLoadBalancerType)(NK,iA,OK)}});var Kt=H0((Jt)=>{var rA;Object.defineProperty(Jt,"__esModule",{value:!0});Jt.OutlierDetectionLoadBalancer=Jt.OutlierDetectionLoadBalancingConfig=void 0;Jt.setup=Rk0;var Uk0=k8(),eo=a1(),P7=AX(),Yt=dA(),Nk0=V5(),Ok0=z3(),Dk0=E4(),aA=u8(),Tk0=zX(),Ik0=M6(),$k0="outlier_detection";function H8(Y){Ik0.trace(eo.LogVerbosity.DEBUG,$k0,Y)}var sA="outlier_detection",Ck0=((rA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&rA!==void 0?rA:"true")==="true",Ek0={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},Mk0={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function XZ(Y,Z,W,H){if(Z in Y&&Y[Z]!==void 0&&typeof Y[Z]!==W){let F=H?`${H}.${Z}`:Z;throw Error(`outlier detection config ${F} parse error: expected ${W}, got ${typeof Y[Z]}`)}}function oA(Y,Z,W){let H=W?`${W}.${Z}`:Z;if(Z in Y&&Y[Z]!==void 0){if(!(0,P7.isDuration)(Y[Z]))throw Error(`outlier detection config ${H} parse error: expected Duration, got ${typeof Y[Z]}`);if(!(Y[Z].seconds>=0&&Y[Z].seconds<=315576000000&&Y[Z].nanos>=0&&Y[Z].nanos<=999999999))throw Error(`outlier detection config ${H} parse error: values out of range for non-negative Duaration`)}}function DK(Y,Z,W){let H=W?`${W}.${Z}`:Z;if(XZ(Y,Z,"number",W),Z in Y&&Y[Z]!==void 0&&!(Y[Z]>=0&&Y[Z]<=100))throw Error(`outlier detection config ${H} parse error: value out of range for percentage (0-100)`)}class IX{constructor(Y,Z,W,H,F,X,J){if(this.childPolicy=J,J.getLoadBalancerName()==="pick_first")throw Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=Y!==null&&Y!==void 0?Y:1e4,this.baseEjectionTimeMs=Z!==null&&Z!==void 0?Z:30000,this.maxEjectionTimeMs=W!==null&&W!==void 0?W:300000,this.maxEjectionPercent=H!==null&&H!==void 0?H:10,this.successRateEjection=F?Object.assign(Object.assign({},Ek0),F):null,this.failurePercentageEjection=X?Object.assign(Object.assign({},Mk0),X):null}getLoadBalancerName(){return sA}toJsonObject(){var Y,Z;return{outlier_detection:{interval:(0,P7.msToDuration)(this.intervalMs),base_ejection_time:(0,P7.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,P7.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(Y=this.successRateEjection)!==null&&Y!==void 0?Y:void 0,failure_percentage_ejection:(Z=this.failurePercentageEjection)!==null&&Z!==void 0?Z: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(Y){var Z;if(oA(Y,"interval"),oA(Y,"base_ejection_time"),oA(Y,"max_ejection_time"),DK(Y,"max_ejection_percent"),"success_rate_ejection"in Y&&Y.success_rate_ejection!==void 0){if(typeof Y.success_rate_ejection!=="object")throw Error("outlier detection config success_rate_ejection must be an object");XZ(Y.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),DK(Y.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),XZ(Y.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),XZ(Y.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in Y&&Y.failure_percentage_ejection!==void 0){if(typeof Y.failure_percentage_ejection!=="object")throw Error("outlier detection config failure_percentage_ejection must be an object");DK(Y.failure_percentage_ejection,"threshold","failure_percentage_ejection"),DK(Y.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),XZ(Y.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),XZ(Y.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in Y)||!Array.isArray(Y.child_policy))throw Error("outlier detection config child_policy must be an array");let W=(0,Nk0.selectLbConfigFromList)(Y.child_policy);if(!W)throw Error("outlier detection config child_policy: no valid recognized policy found");return new IX(Y.interval?(0,P7.durationToMs)(Y.interval):null,Y.base_ejection_time?(0,P7.durationToMs)(Y.base_ejection_time):null,Y.max_ejection_time?(0,P7.durationToMs)(Y.max_ejection_time):null,(Z=Y.max_ejection_percent)!==null&&Z!==void 0?Z:null,Y.success_rate_ejection,Y.failure_percentage_ejection,W)}}Jt.OutlierDetectionLoadBalancingConfig=IX;class Zt extends Tk0.BaseSubchannelWrapper{constructor(Y,Z){super(Y);this.mapEntry=Z,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0){if(this.mapEntry){let Y=this.mapEntry.subchannelWrappers.indexOf(this);if(Y>=0)this.mapEntry.subchannelWrappers.splice(Y,1)}}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}}function tA(){return{success:0,failure:0}}class Qt{constructor(){this.activeBucket=tA(),this.inactiveBucket=tA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=tA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}}class Xt{constructor(Y,Z){this.wrappedPicker=Y,this.countCalls=Z}pick(Y){let Z=this.wrappedPicker.pick(Y);if(Z.pickResultType===Dk0.PickResultType.COMPLETE){let W=Z.subchannel,H=W.getMapEntry();if(H){let F=Z.onCallEnded;if(this.countCalls)F=(X,J,Q)=>{var G;if(X===eo.Status.OK)H.counter.addSuccess();else H.counter.addFailure();(G=Z.onCallEnded)===null||G===void 0||G.call(Z,X,J,Q)};return Object.assign(Object.assign({},Z),{subchannel:W.getWrappedSubchannel(),onCallEnded:F})}else return Object.assign(Object.assign({},Z),{subchannel:W.getWrappedSubchannel()})}else return Z}}class eA{constructor(Y){this.entryMap=new aA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new Ok0.ChildLoadBalancerHandler((0,Yt.createChildChannelControlHelper)(Y,{createSubchannel:(Z,W)=>{let H=Y.createSubchannel(Z,W),F=this.entryMap.getForSubchannelAddress(Z),X=new Zt(H,F);if((F===null||F===void 0?void 0:F.currentEjectionTimestamp)!==null)X.eject();return F===null||F===void 0||F.subchannelWrappers.push(X),X},updateState:(Z,W,H)=>{if(Z===Uk0.ConnectivityState.READY)Y.updateState(Z,new Xt(W,this.isCountingEnabled()),H);else Y.updateState(Z,W,H)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let Y=0;for(let Z of this.entryMap.values())if(Z.currentEjectionTimestamp!==null)Y+=1;return Y*100/this.entryMap.size}runSuccessRateCheck(Y){if(!this.latestConfig)return;let Z=this.latestConfig.getSuccessRateEjectionConfig();if(!Z)return;H8("Running success rate check");let W=Z.request_volume,H=0,F=[];for(let[K,V]of this.entryMap.entries()){let B=V.counter.getLastSuccesses(),I=V.counter.getLastFailures();if(H8("Stats for "+(0,aA.endpointToString)(K)+": successes="+B+" failures="+I+" targetRequestVolume="+W),B+I>=W)H+=1,F.push(B/(B+I))}if(H8("Found "+H+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+F+"]"),H<Z.minimum_hosts)return;let X=F.reduce((K,V)=>K+V)/F.length,J=0;for(let K of F){let V=K-X;J+=V*V}let Q=J/F.length,G=Math.sqrt(Q),q=X-G*(Z.stdev_factor/1000);H8("stdev="+G+" ejectionThreshold="+q);for(let[K,V]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let B=V.counter.getLastSuccesses(),I=V.counter.getLastFailures();if(B+I<W)continue;let M=B/(B+I);if(H8("Checking candidate "+K+" successRate="+M),M<q){let E=Math.random()*100;if(H8("Candidate "+K+" randomNumber="+E+" enforcement_percentage="+Z.enforcement_percentage),E<Z.enforcement_percentage)H8("Ejecting candidate "+K),this.eject(V,Y)}}}runFailurePercentageCheck(Y){if(!this.latestConfig)return;let Z=this.latestConfig.getFailurePercentageEjectionConfig();if(!Z)return;H8("Running failure percentage check. threshold="+Z.threshold+" request volume threshold="+Z.request_volume);let W=0;for(let H of this.entryMap.values()){let F=H.counter.getLastSuccesses(),X=H.counter.getLastFailures();if(F+X>=Z.request_volume)W+=1}if(W<Z.minimum_hosts)return;for(let[H,F]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let X=F.counter.getLastSuccesses(),J=F.counter.getLastFailures();if(H8("Candidate successes="+X+" failures="+J),X+J<Z.request_volume)continue;if(J*100/(J+X)>Z.threshold){let G=Math.random()*100;if(H8("Candidate "+H+" randomNumber="+G+" enforcement_percentage="+Z.enforcement_percentage),G<Z.enforcement_percentage)H8("Ejecting candidate "+H),this.eject(F,Y)}}}eject(Y,Z){Y.currentEjectionTimestamp=new Date,Y.ejectionTimeMultiplier+=1;for(let W of Y.subchannelWrappers)W.eject()}uneject(Y){Y.currentEjectionTimestamp=null;for(let Z of Y.subchannelWrappers)Z.uneject()}switchAllBuckets(){for(let Y of this.entryMap.values())Y.counter.switchBuckets()}startTimer(Y){var Z,W;this.ejectionTimer=setTimeout(()=>this.runChecks(),Y),(W=(Z=this.ejectionTimer).unref)===null||W===void 0||W.call(Z)}runChecks(){let Y=new Date;if(H8("Ejection timer running"),this.switchAllBuckets(),!this.latestConfig)return;this.timerStartTime=Y,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(Y),this.runFailurePercentageCheck(Y);for(let[Z,W]of this.entryMap.entries())if(W.currentEjectionTimestamp===null){if(W.ejectionTimeMultiplier>0)W.ejectionTimeMultiplier-=1}else{let H=this.latestConfig.getBaseEjectionTimeMs(),F=this.latestConfig.getMaxEjectionTimeMs(),X=new Date(W.currentEjectionTimestamp.getTime());if(X.setMilliseconds(X.getMilliseconds()+Math.min(H*W.ejectionTimeMultiplier,Math.max(H,F))),X<new Date)H8("Unejecting "+Z),this.uneject(W)}}updateAddressList(Y,Z,W,H){if(!(Z instanceof IX))return!1;if(H8("Received update with config: "+JSON.stringify(Z.toJsonObject(),void 0,2)),Y.ok){for(let X of Y.value)if(!this.entryMap.has(X))H8("Adding map entry for "+(0,aA.endpointToString)(X)),this.entryMap.set(X,{counter:new Qt,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]});this.entryMap.deleteMissing(Y.value)}let F=Z.getChildPolicy();if(this.childBalancer.updateAddressList(Y,F,W,H),Z.getSuccessRateEjectionConfig()||Z.getFailurePercentageEjectionConfig())if(this.timerStartTime){H8("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let X=Z.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(X)}else H8("Starting new timer"),this.timerStartTime=new Date,this.startTimer(Z.getIntervalMs()),this.switchAllBuckets();else{H8("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let X of this.entryMap.values())this.uneject(X),X.ejectionTimeMultiplier=0}return this.latestConfig=Z,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return sA}}Jt.OutlierDetectionLoadBalancer=eA;function Rk0(){if(Ck0)(0,Yt.registerLoadBalancerType)(sA,eA,IX)}});var Vt=H0((Ft)=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.PriorityQueue=void 0;var JZ=0,YU=(Y)=>Math.floor(Y/2),TK=(Y)=>Y*2+1,$X=(Y)=>Y*2+2;class Gt{constructor(Y=(Z,W)=>Z>W){this.comparator=Y,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[JZ]}push(...Y){return Y.forEach((Z)=>{this.heap.push(Z),this.siftUp()}),this.size()}pop(){let Y=this.peek(),Z=this.size()-1;if(Z>JZ)this.swap(JZ,Z);return this.heap.pop(),this.siftDown(),Y}replace(Y){let Z=this.peek();return this.heap[JZ]=Y,this.siftDown(),Z}greater(Y,Z){return this.comparator(this.heap[Y],this.heap[Z])}swap(Y,Z){[this.heap[Y],this.heap[Z]]=[this.heap[Z],this.heap[Y]]}siftUp(){let Y=this.size()-1;while(Y>JZ&&this.greater(Y,YU(Y)))this.swap(Y,YU(Y)),Y=YU(Y)}siftDown(){let Y=JZ;while(TK(Y)<this.size()&&this.greater(TK(Y),Y)||$X(Y)<this.size()&&this.greater($X(Y),Y)){let Z=$X(Y)<this.size()&&this.greater($X(Y),TK(Y))?$X(Y):TK(Y);this.swap(Y,Z),Y=Z}}}Ft.PriorityQueue=Gt});var Tt=H0((Ot)=>{Object.defineProperty(Ot,"__esModule",{value:!0});Ot.WeightedRoundRobinLoadBalancingConfig=void 0;Ot.setup=bk0;var V8=k8(),wk0=a1(),o8=AX(),Bt=V5(),Sk0=OX(),fk0=M6(),At=FK(),WZ=E4(),kk0=Vt(),qt=u8(),yk0="weighted_round_robin";function ZU(Y){fk0.trace(wk0.LogVerbosity.DEBUG,yk0,Y)}var QU="weighted_round_robin",vk0=1e4,hk0=1e4,jk0=180000,_k0=1000,xk0=1;function zt(Y,Z,W){if(Z in Y&&Y[Z]!==void 0&&typeof Y[Z]!==W)throw Error(`weighted round robin config ${Z} parse error: expected ${W}, got ${typeof Y[Z]}`)}function IK(Y,Z){if(Z in Y&&Y[Z]!==void 0&&Y[Z]!==null){let W;if((0,o8.isDuration)(Y[Z]))W=Y[Z];else if((0,o8.isDurationMessage)(Y[Z]))W=(0,o8.durationMessageToDuration)(Y[Z]);else if(typeof Y[Z]==="string"){let H=(0,o8.parseDuration)(Y[Z]);if(!H)throw Error(`weighted round robin config ${Z}: failed to parse duration string ${Y[Z]}`);W=H}else throw Error(`weighted round robin config ${Z}: expected duration, got ${typeof Y[Z]}`);return(0,o8.durationToMs)(W)}return null}class CX{constructor(Y,Z,W,H,F,X){this.enableOobLoadReport=Y!==null&&Y!==void 0?Y:!1,this.oobLoadReportingPeriodMs=Z!==null&&Z!==void 0?Z:vk0,this.blackoutPeriodMs=W!==null&&W!==void 0?W:hk0,this.weightExpirationPeriodMs=H!==null&&H!==void 0?H:jk0,this.weightUpdatePeriodMs=Math.max(F!==null&&F!==void 0?F:_k0,100),this.errorUtilizationPenalty=X!==null&&X!==void 0?X:xk0}getLoadBalancerName(){return QU}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,o8.durationToString)((0,o8.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,o8.durationToString)((0,o8.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,o8.durationToString)((0,o8.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,o8.durationToString)((0,o8.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(Y){if(zt(Y,"enable_oob_load_report","boolean"),zt(Y,"error_utilization_penalty","number"),Y.error_utilization_penalty<0)throw Error("weighted round robin config error_utilization_penalty < 0");return new CX(Y.enable_oob_load_report,IK(Y,"oob_load_reporting_period"),IK(Y,"blackout_period"),IK(Y,"weight_expiration_period"),IK(Y,"weight_update_period"),Y.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}}Ot.WeightedRoundRobinLoadBalancingConfig=CX;class Ut{constructor(Y,Z){this.metricsHandler=Z,this.queue=new kk0.PriorityQueue((F,X)=>F.deadline<X.deadline);let W=Y.filter((F)=>F.weight>0),H;if(W.length<2)H=1;else{let F=0;for(let{weight:X}of W)F+=X;H=F/W.length}for(let F of Y){let X=F.weight>0?1/F.weight:H;this.queue.push({endpointName:F.endpointName,picker:F.picker,period:X,deadline:Math.random()*X})}}pick(Y){let Z=this.queue.pop();this.queue.push(Object.assign(Object.assign({},Z),{deadline:Z.deadline+Z.period}));let W=Z.picker.pick(Y);if(W.pickResultType===WZ.PickResultType.COMPLETE)if(this.metricsHandler)return Object.assign(Object.assign({},W),{onCallEnded:(0,At.createMetricsReader)((H)=>this.metricsHandler(H,Z.endpointName),W.onCallEnded)});else{let H=W.subchannel;return Object.assign(Object.assign({},W),{subchannel:H.getWrappedSubchannel()})}else return W}}class Nt{constructor(Y){this.channelControlHelper=Y,this.latestConfig=null,this.children=new Map,this.currentState=V8.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(Y){let Z=0;for(let W of this.children.values())if(W.child.getConnectivityState()===Y)Z+=1;return Z}updateWeight(Y,Z){var W,H;let{rps_fractional:F,application_utilization:X}=Z;if(X>0&&F>0)X+=Z.eps/F*((H=(W=this.latestConfig)===null||W===void 0?void 0:W.getErrorUtilizationPenalty())!==null&&H!==void 0?H:0);let J=X===0?0:F/X;if(J===0)return;let Q=new Date;if(Y.nonEmptySince===null)Y.nonEmptySince=Q;Y.lastUpdated=Q,Y.weight=J}getWeight(Y){if(!this.latestConfig)return 0;let Z=new Date().getTime();if(Z-Y.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return Y.nonEmptySince=null,0;let W=this.latestConfig.getBlackoutPeriodMs();if(W>0&&(Y.nonEmptySince===null||Z-Y.nonEmptySince.getTime()<W))return 0;return Y.weight}calculateAndUpdateState(){if(this.updatesPaused||!this.latestConfig)return;if(this.countChildrenWithState(V8.ConnectivityState.READY)>0){let Y=[];for(let[W,H]of this.children){if(H.child.getConnectivityState()!==V8.ConnectivityState.READY)continue;Y.push({endpointName:W,picker:H.child.getPicker(),weight:this.getWeight(H)})}ZU("Created picker with weights: "+Y.map((W)=>W.endpointName+":"+W.weight).join(","));let Z;if(!this.latestConfig.getEnableOobLoadReport())Z=(W,H)=>{let F=this.children.get(H);if(F)this.updateWeight(F,W)};else Z=null;this.updateState(V8.ConnectivityState.READY,new Ut(Y,Z),null)}else if(this.countChildrenWithState(V8.ConnectivityState.CONNECTING)>0)this.updateState(V8.ConnectivityState.CONNECTING,new WZ.QueuePicker(this),null);else if(this.countChildrenWithState(V8.ConnectivityState.TRANSIENT_FAILURE)>0){let Y=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(V8.ConnectivityState.TRANSIENT_FAILURE,new WZ.UnavailablePicker({details:Y}),Y)}else this.updateState(V8.ConnectivityState.IDLE,new WZ.QueuePicker(this),null);for(let{child:Y}of this.children.values())if(Y.getConnectivityState()===V8.ConnectivityState.IDLE)Y.exitIdle()}updateState(Y,Z,W){ZU(V8.ConnectivityState[this.currentState]+" -> "+V8.ConnectivityState[Y]),this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}updateAddressList(Y,Z,W,H){var F,X;if(!(Z instanceof CX))return!1;if(!Y.ok){if(this.children.size===0)this.updateState(V8.ConnectivityState.TRANSIENT_FAILURE,new WZ.UnavailablePicker(Y.error),Y.error.details);return!0}if(Y.value.length===0){let G=`No addresses resolved. Resolution note: ${H}`;return this.updateState(V8.ConnectivityState.TRANSIENT_FAILURE,new WZ.UnavailablePicker({details:G}),G),!1}ZU("Connect to endpoint list "+Y.value.map(qt.endpointToString));let J=new Date,Q=new Set;this.updatesPaused=!0,this.latestConfig=Z;for(let G of Y.value){let q=(0,qt.endpointToString)(G);Q.add(q);let K=this.children.get(q);if(!K)K={child:new Sk0.LeafLoadBalancer(G,(0,Bt.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(V,B,I)=>{if(this.currentState===V8.ConnectivityState.READY&&V!==V8.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(V===V8.ConnectivityState.READY)K.nonEmptySince=null;if(I)this.lastError=I;this.calculateAndUpdateState()},createSubchannel:(V,B)=>{let I=this.channelControlHelper.createSubchannel(V,B);if(K===null||K===void 0?void 0:K.oobMetricsListener)return new At.OrcaOobMetricsSubchannelWrapper(I,K.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs());else return I}}),W,H),lastUpdated:J,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(q,K);if(Z.getEnableOobLoadReport())K.oobMetricsListener=(V)=>{this.updateWeight(K,V)};else K.oobMetricsListener=null}for(let[G,q]of this.children)if(Q.has(G))q.child.startConnecting();else q.child.destroy(),this.children.delete(G);if(this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer);return this.weightUpdateTimer=(X=(F=setInterval(()=>{if(this.currentState===V8.ConnectivityState.READY)this.calculateAndUpdateState()},Z.getWeightUpdatePeriodMs())).unref)===null||X===void 0?void 0:X.call(F),!0}exitIdle(){}resetBackoff(){}destroy(){for(let Y of this.children.values())Y.child.destroy();if(this.children.clear(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer)}getTypeName(){return QU}}function bk0(){(0,Bt.registerLoadBalancerType)(QU,Nt,CX)}});var EX=H0((O6)=>{Object.defineProperty(O6,"__esModule",{value:!0});O6.experimental=O6.ServerMetricRecorder=O6.ServerInterceptingCall=O6.ResponderBuilder=O6.ServerListenerBuilder=O6.addAdminServicesToServer=O6.getChannelzHandlers=O6.getChannelzServiceDefinition=O6.InterceptorConfigurationError=O6.InterceptingCall=O6.RequesterBuilder=O6.ListenerBuilder=O6.StatusBuilder=O6.getClientChannel=O6.ServerCredentials=O6.Server=O6.setLogVerbosity=O6.setLogger=O6.load=O6.loadObject=O6.CallCredentials=O6.ChannelCredentials=O6.waitForClientReady=O6.closeClient=O6.Channel=O6.makeGenericClientConstructor=O6.makeClientConstructor=O6.loadPackageDefinition=O6.Client=O6.compressionAlgorithms=O6.propagate=O6.connectivityState=O6.status=O6.logVerbosity=O6.Metadata=O6.credentials=void 0;var $K=J3();Object.defineProperty(O6,"CallCredentials",{enumerable:!0,get:function(){return $K.CallCredentials}});var mk0=QB();Object.defineProperty(O6,"Channel",{enumerable:!0,get:function(){return mk0.ChannelImplementation}});var gk0=eB();Object.defineProperty(O6,"compressionAlgorithms",{enumerable:!0,get:function(){return gk0.CompressionAlgorithms}});var dk0=k8();Object.defineProperty(O6,"connectivityState",{enumerable:!0,get:function(){return dk0.ConnectivityState}});var CK=kY();Object.defineProperty(O6,"ChannelCredentials",{enumerable:!0,get:function(){return CK.ChannelCredentials}});var It=ZB();Object.defineProperty(O6,"Client",{enumerable:!0,get:function(){return It.Client}});var XU=a1();Object.defineProperty(O6,"logVerbosity",{enumerable:!0,get:function(){return XU.LogVerbosity}});Object.defineProperty(O6,"status",{enumerable:!0,get:function(){return XU.Status}});Object.defineProperty(O6,"propagate",{enumerable:!0,get:function(){return XU.Propagate}});var $t=M6(),JU=N3();Object.defineProperty(O6,"loadPackageDefinition",{enumerable:!0,get:function(){return JU.loadPackageDefinition}});Object.defineProperty(O6,"makeClientConstructor",{enumerable:!0,get:function(){return JU.makeClientConstructor}});Object.defineProperty(O6,"makeGenericClientConstructor",{enumerable:!0,get:function(){return JU.makeClientConstructor}});var ck0=K8();Object.defineProperty(O6,"Metadata",{enumerable:!0,get:function(){return ck0.Metadata}});var lk0=zo();Object.defineProperty(O6,"Server",{enumerable:!0,get:function(){return lk0.Server}});var nk0=KK();Object.defineProperty(O6,"ServerCredentials",{enumerable:!0,get:function(){return nk0.ServerCredentials}});var pk0=No();Object.defineProperty(O6,"StatusBuilder",{enumerable:!0,get:function(){return pk0.StatusBuilder}});O6.credentials={combineChannelCredentials:(Y,...Z)=>{return Z.reduce((W,H)=>W.compose(H),Y)},combineCallCredentials:(Y,...Z)=>{return Z.reduce((W,H)=>W.compose(H),Y)},createInsecure:CK.ChannelCredentials.createInsecure,createSsl:CK.ChannelCredentials.createSsl,createFromSecureContext:CK.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:$K.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:$K.CallCredentials.createFromGoogleCredential,createEmpty:$K.CallCredentials.createEmpty};var ik0=(Y)=>Y.close();O6.closeClient=ik0;var rk0=(Y,Z,W)=>Y.waitForReady(Z,W);O6.waitForClientReady=rk0;var ak0=(Y,Z)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};O6.loadObject=ak0;var ok0=(Y,Z,W)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};O6.load=ok0;var tk0=(Y)=>{$t.setLogger(Y)};O6.setLogger=tk0;var sk0=(Y)=>{$t.setLoggerVerbosity(Y)};O6.setLogVerbosity=sk0;var ek0=(Y)=>{return It.Client.prototype.getChannel.call(Y)};O6.getClientChannel=ek0;var EK=ez();Object.defineProperty(O6,"ListenerBuilder",{enumerable:!0,get:function(){return EK.ListenerBuilder}});Object.defineProperty(O6,"RequesterBuilder",{enumerable:!0,get:function(){return EK.RequesterBuilder}});Object.defineProperty(O6,"InterceptingCall",{enumerable:!0,get:function(){return EK.InterceptingCall}});Object.defineProperty(O6,"InterceptorConfigurationError",{enumerable:!0,get:function(){return EK.InterceptorConfigurationError}});var Ct=O5();Object.defineProperty(O6,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return Ct.getChannelzServiceDefinition}});Object.defineProperty(O6,"getChannelzHandlers",{enumerable:!0,get:function(){return Ct.getChannelzHandlers}});var Yy0=A3();Object.defineProperty(O6,"addAdminServicesToServer",{enumerable:!0,get:function(){return Yy0.addAdminServicesToServer}});var WU=hA();Object.defineProperty(O6,"ServerListenerBuilder",{enumerable:!0,get:function(){return WU.ServerListenerBuilder}});Object.defineProperty(O6,"ResponderBuilder",{enumerable:!0,get:function(){return WU.ResponderBuilder}});Object.defineProperty(O6,"ServerInterceptingCall",{enumerable:!0,get:function(){return WU.ServerInterceptingCall}});var Zy0=FK();Object.defineProperty(O6,"ServerMetricRecorder",{enumerable:!0,get:function(){return Zy0.ServerMetricRecorder}});var Qy0=dA();O6.experimental=Qy0;var Xy0=VA(),Jy0=xo(),Wy0=no(),Ky0=OX(),Gy0=so(),Fy0=Kt(),Hy0=Tt(),Vy0=O5();(()=>{Xy0.setup(),Jy0.setup(),Wy0.setup(),Ky0.setup(),Gy0.setup(),Fy0.setup(),Hy0.setup(),Vy0.setup()})()});var B00=H0((J41,z00)=>{(()=>{var Y={"./node_modules/.pnpm/create-require@1.1.1/node_modules/create-require/create-require.js":(F,X,J)=>{let Q=J("module"),G=J("path"),q=J("fs");F.exports=function(K){return K||(K=process.cwd()),function(V){try{return q.lstatSync(V).isDirectory()}catch(B){return!1}}(K)&&(K=G.join(K,"index.js")),Q.createRequire?Q.createRequire(K):Q.createRequireFromPath?Q.createRequireFromPath(K):function(V){let B=new Q.Module(V,null);return B.filename=V,B.paths=Q.Module._nodeModulePaths(G.dirname(V)),B._compile("module.exports = require;",V),B.exports}(K)}},"./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive":(F)=>{function X(J){return Promise.resolve().then(()=>{var Q=Error("Cannot find module '"+J+"'");throw Q.code="MODULE_NOT_FOUND",Q})}X.keys=()=>[],X.resolve=X,X.id="./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive",F.exports=X},"./node_modules/.pnpm/object-hash@3.0.0/node_modules/object-hash/index.js":(F,X,J)=>{var Q=J("crypto");function G(E,A){return function(N,O){var T=O.algorithm!=="passthrough"?Q.createHash(O.algorithm):new M;T.write===void 0&&(T.write=T.update,T.end=T.update);var C=I(O,T);if(C.dispatch(N),T.update||T.end(""),T.digest)return T.digest(O.encoding==="buffer"?void 0:O.encoding);var R=T.read();if(O.encoding==="buffer")return R;return R.toString(O.encoding)}(E,A=V(E,A))}(X=F.exports=G).sha1=function(E){return G(E)},X.keys=function(E){return G(E,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},X.MD5=function(E){return G(E,{algorithm:"md5",encoding:"hex"})},X.keysMD5=function(E){return G(E,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var q=Q.getHashes?Q.getHashes().slice():["sha1","md5"];q.push("passthrough");var K=["buffer","hex","binary","base64"];function V(E,A){A=A||{};var N={};if(N.algorithm=A.algorithm||"sha1",N.encoding=A.encoding||"hex",N.excludeValues=!!A.excludeValues,N.algorithm=N.algorithm.toLowerCase(),N.encoding=N.encoding.toLowerCase(),N.ignoreUnknown=A.ignoreUnknown===!0,N.respectType=A.respectType!==!1,N.respectFunctionNames=A.respectFunctionNames!==!1,N.respectFunctionProperties=A.respectFunctionProperties!==!1,N.unorderedArrays=A.unorderedArrays===!0,N.unorderedSets=A.unorderedSets!==!1,N.unorderedObjects=A.unorderedObjects!==!1,N.replacer=A.replacer||void 0,N.excludeKeys=A.excludeKeys||void 0,E===void 0)throw Error("Object argument required.");for(var O=0;O<q.length;++O)q[O].toLowerCase()===N.algorithm.toLowerCase()&&(N.algorithm=q[O]);if(q.indexOf(N.algorithm)===-1)throw Error('Algorithm "'+N.algorithm+'" not supported. supported values: '+q.join(", "));if(K.indexOf(N.encoding)===-1&&N.algorithm!=="passthrough")throw Error('Encoding "'+N.encoding+'" not supported. supported values: '+K.join(", "));return N}function B(E){if(typeof E!="function")return!1;return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(E))!=null}function I(E,A,N){N=N||[];var O=function(T){return A.update?A.update(T,"utf8"):A.write(T,"utf8")};return{dispatch:function(T){E.replacer&&(T=E.replacer(T));var C=typeof T;return T===null&&(C="null"),this["_"+C](T)},_object:function(T){var C=Object.prototype.toString.call(T),R=/\[object (.*)\]/i.exec(C);R=(R=R?R[1]:"unknown:["+C+"]").toLowerCase();var w;if((w=N.indexOf(T))>=0)return this.dispatch("[CIRCULAR:"+w+"]");if(N.push(T),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(T))return O("buffer:"),O(T);if(R==="object"||R==="function"||R==="asyncfunction"){var L=Object.keys(T);E.unorderedObjects&&(L=L.sort()),E.respectType===!1||B(T)||L.splice(0,0,"prototype","__proto__","constructor"),E.excludeKeys&&(L=L.filter(function(v){return!E.excludeKeys(v)})),O("object:"+L.length+":");var k=this;return L.forEach(function(v){k.dispatch(v),O(":"),E.excludeValues||k.dispatch(T[v]),O(",")})}if(!this["_"+R]){if(E.ignoreUnknown)return O("["+R+"]");throw Error('Unknown object type "'+R+'"')}this["_"+R](T)},_array:function(T,C){C=C!==void 0?C:E.unorderedArrays!==!1;var R=this;if(O("array:"+T.length+":"),!C||T.length<=1)return T.forEach(function(k){return R.dispatch(k)});var w=[],L=T.map(function(k){var v=new M,f=N.slice();return I(E,v,f).dispatch(k),w=w.concat(f.slice(N.length)),v.read().toString()});return N=N.concat(w),L.sort(),this._array(L,!1)},_date:function(T){return O("date:"+T.toJSON())},_symbol:function(T){return O("symbol:"+T.toString())},_error:function(T){return O("error:"+T.toString())},_boolean:function(T){return O("bool:"+T.toString())},_string:function(T){O("string:"+T.length+":"),O(T.toString())},_function:function(T){O("fn:"),B(T)?this.dispatch("[native]"):this.dispatch(T.toString()),E.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(T.name)),E.respectFunctionProperties&&this._object(T)},_number:function(T){return O("number:"+T.toString())},_xml:function(T){return O("xml:"+T.toString())},_null:function(){return O("Null")},_undefined:function(){return O("Undefined")},_regexp:function(T){return O("regex:"+T.toString())},_uint8array:function(T){return O("uint8array:"),this.dispatch(Array.prototype.slice.call(T))},_uint8clampedarray:function(T){return O("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(T))},_int8array:function(T){return O("int8array:"),this.dispatch(Array.prototype.slice.call(T))},_uint16array:function(T){return O("uint16array:"),this.dispatch(Array.prototype.slice.call(T))},_int16array:function(T){return O("int16array:"),this.dispatch(Array.prototype.slice.call(T))},_uint32array:function(T){return O("uint32array:"),this.dispatch(Array.prototype.slice.call(T))},_int32array:function(T){return O("int32array:"),this.dispatch(Array.prototype.slice.call(T))},_float32array:function(T){return O("float32array:"),this.dispatch(Array.prototype.slice.call(T))},_float64array:function(T){return O("float64array:"),this.dispatch(Array.prototype.slice.call(T))},_arraybuffer:function(T){return O("arraybuffer:"),this.dispatch(new Uint8Array(T))},_url:function(T){return O("url:"+T.toString())},_map:function(T){O("map:");var C=Array.from(T);return this._array(C,E.unorderedSets!==!1)},_set:function(T){O("set:");var C=Array.from(T);return this._array(C,E.unorderedSets!==!1)},_file:function(T){return O("file:"),this.dispatch([T.name,T.size,T.type,T.lastModfied])},_blob:function(){if(E.ignoreUnknown)return O("[blob]");throw Error(`Hashing Blob objects is currently not supported
35
+ `)+1)));this.lastActivityTimestamp=new Date}trace(Y,Z){(0,XK.trace)(Z!==null&&Z!==void 0?Z:T5.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,JK.uriToString)(this.target)+" "+Y)}callRefTimerRef(){var Y,Z,W,H;if(!this.callRefTimer)this.callRefTimer=setInterval(()=>{},HS0);if(!((Z=(Y=this.callRefTimer).hasRef)===null||Z===void 0?void 0:Z.call(Y)))this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(H=(W=this.callRefTimer).ref)===null||H===void 0||H.call(W)}callRefTimerUnref(){var Y,Z,W;if(!((Y=this.callRefTimer)===null||Y===void 0?void 0:Y.hasRef)||this.callRefTimer.hasRef())this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(W=(Z=this.callRefTimer)===null||Z===void 0?void 0:Z.unref)===null||W===void 0||W.call(Z)}removeConnectivityStateWatcher(Y){let Z=this.connectivityStateWatchers.findIndex((W)=>W===Y);if(Z>=0)this.connectivityStateWatchers.splice(Z,1)}updateState(Y){if((0,XK.trace)(T5.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,JK.uriToString)(this.target)+" "+B9.ConnectivityState[this.connectivityState]+" -> "+B9.ConnectivityState[Y]),this.channelzEnabled)this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+B9.ConnectivityState[Y]);this.connectivityState=Y,this.channelzInfoTracker.state=Y;let Z=this.connectivityStateWatchers.slice();for(let W of Z)if(Y!==W.currentState){if(W.timer)clearTimeout(W.timer);this.removeConnectivityStateWatcher(W),W.callback()}if(Y!==B9.ConnectivityState.TRANSIENT_FAILURE)this.currentResolutionError=null}throttleKeepalive(Y){if(Y>this.keepaliveTime){this.keepaliveTime=Y;for(let Z of this.wrappedSubchannels)Z.throttleKeepalive(Y)}}addWrappedSubchannel(Y){this.wrappedSubchannels.add(Y)}removeWrappedSubchannel(Y){this.wrappedSubchannels.delete(Y)}doPick(Y,Z){return this.currentPicker.pick({metadata:Y,extraPickInfo:Z})}queueCallForPick(Y){this.pickQueue.push(Y),this.callRefTimerRef()}getConfig(Y,Z){if(this.connectivityState!==B9.ConnectivityState.SHUTDOWN)this.resolvingLoadBalancer.exitIdle();if(this.configSelector)return{type:"SUCCESS",config:this.configSelector.invoke(Y,Z,this.randomChannelId)};else if(this.currentResolutionError)return{type:"ERROR",error:this.currentResolutionError};else return{type:"NONE"}}queueCallForConfig(Y){this.configSelectionQueue.push(Y),this.callRefTimerRef()}enterIdle(){if(this.resolvingLoadBalancer.destroy(),this.updateState(B9.ConnectivityState.IDLE),this.currentPicker=new IA.QueuePicker(this.resolvingLoadBalancer),this.idleTimer)clearTimeout(this.idleTimer),this.idleTimer=null;if(this.callRefTimer)clearInterval(this.callRefTimer),this.callRefTimer=null}startIdleTimeout(Y){var Z,W;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let F=new Date().valueOf()-this.lastActivityTimestamp.valueOf();if(F>=this.idleTimeoutMs)this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle();else this.startIdleTimeout(this.idleTimeoutMs-F)},Y),(W=(Z=this.idleTimer).unref)===null||W===void 0||W.call(Z)}maybeStartIdleTimer(){if(this.connectivityState!==B9.ConnectivityState.SHUTDOWN&&!this.idleTimer)this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){if(this.channelzEnabled)this.channelzInfoTracker.callTracker.addCallStarted();this.callCount+=1}onCallEnd(Y){if(this.channelzEnabled)if(Y.code===T5.Status.OK)this.channelzInfoTracker.callTracker.addCallSucceeded();else this.channelzInfoTracker.callTracker.addCallFailed();this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(Y,Z,W,H,F){let X=(0,DA.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+X+'] method="'+Z+'"'),new JS0.LoadBalancingCall(this,Y,Z,W,H,F,X)}createRetryingCall(Y,Z,W,H,F){let X=(0,DA.getNextCallNumber)();return this.trace("createRetryingCall ["+X+'] method="'+Z+'"'),new TA.RetryingCall(this,Y,Z,W,H,F,X,this.retryBufferTracker,WK.get(this.getTarget()))}createResolvingCall(Y,Z,W,H,F){let X=(0,DA.getNextCallNumber)();this.trace("createResolvingCall ["+X+'] method="'+Y+'", deadline='+(0,WS0.deadlineToString)(Z));let J={deadline:Z,flags:F!==null&&F!==void 0?F:T5.Propagate.DEFAULTS,host:W!==null&&W!==void 0?W:this.defaultAuthority,parentCall:H},Q=new KS0.ResolvingCall(this,Y,J,this.filterStackFactory.clone(),X);return this.onCallStart(),Q.addStatusWatcher((G)=>{this.onCallEnd(G)}),Q}close(){var Y;this.resolvingLoadBalancer.destroy(),this.updateState(B9.ConnectivityState.SHUTDOWN),this.currentPicker=new za;for(let Z of this.configSelectionQueue)Z.cancelWithStatus(T5.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let Z of this.pickQueue)Z.cancelWithStatus(T5.Status.UNAVAILABLE,"Channel closed before call started");if(this.pickQueue=[],this.callRefTimer)clearInterval(this.callRefTimer);if(this.idleTimer)clearTimeout(this.idleTimer);if(this.channelzEnabled)(0,BX.unregisterChannelzRef)(this.channelzRef);this.subchannelPool.unrefUnusedSubchannels(),(Y=this.configSelector)===null||Y===void 0||Y.unref(),this.configSelector=null}getTarget(){return(0,JK.uriToString)(this.target)}getConnectivityState(Y){let Z=this.connectivityState;if(Y)this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer();return Z}watchConnectivityState(Y,Z,W){if(this.connectivityState===B9.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");let H=null;if(Z!==1/0){let X=Z instanceof Date?Z:new Date(Z),J=new Date;if(Z===-1/0||X<=J){process.nextTick(W,Error("Deadline passed without connectivity state change"));return}H=setTimeout(()=>{this.removeConnectivityStateWatcher(F),W(Error("Deadline passed without connectivity state change"))},X.getTime()-J.getTime())}let F={currentState:Y,callback:W,timer:H};this.connectivityStateWatchers.push(F)}getChannelzRef(){return this.channelzRef}createCall(Y,Z,W,H,F){if(typeof Y!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof Z==="number"||Z instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===B9.ConnectivityState.SHUTDOWN)throw Error("Channel has been shut down");return this.createResolvingCall(Y,Z,W,H,F)}getOptions(){return this.options}}Ua.InternalChannel=Aa});var QB=H0((Ta)=>{Object.defineProperty(Ta,"__esModule",{value:!0});Ta.ChannelImplementation=void 0;var AS0=kY(),US0=$A();class Da{constructor(Y,Z,W){if(typeof Y!=="string")throw TypeError("Channel target must be a string");if(!(Z instanceof AS0.ChannelCredentials))throw TypeError("Channel credentials must be a ChannelCredentials object");if(W){if(typeof W!=="object")throw TypeError("Channel options must be an object")}this.internalChannel=new US0.InternalChannel(Y,Z,W)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(Y){return this.internalChannel.getConnectivityState(Y)}watchConnectivityState(Y,Z,W){this.internalChannel.watchConnectivityState(Y,Z,W)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(Y,Z,W,H,F){if(typeof Y!=="string")throw TypeError("Channel#createCall: method must be a string");if(!(typeof Z==="number"||Z instanceof Date))throw TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(Y,Z,W,H,F)}}Ta.ChannelImplementation=Da});var wa=H0((Pa)=>{Object.defineProperty(Pa,"__esModule",{value:!0});Pa.ServerDuplexStreamImpl=Pa.ServerWritableStreamImpl=Pa.ServerReadableStreamImpl=Pa.ServerUnaryCallImpl=void 0;Pa.serverErrorToStatus=MA;var NS0=V1("events"),CA=V1("stream"),EA=a1(),$a=K8();function MA(Y,Z){var W;let H={code:EA.Status.UNKNOWN,details:"message"in Y?Y.message:"Unknown Error",metadata:(W=Z!==null&&Z!==void 0?Z:Y.metadata)!==null&&W!==void 0?W:null};if("code"in Y&&typeof Y.code==="number"&&Number.isInteger(Y.code)){if(H.code=Y.code,"details"in Y&&typeof Y.details==="string")H.details=Y.details}return H}class Ca extends NS0.EventEmitter{constructor(Y,Z,W,H){super();this.path=Y,this.call=Z,this.metadata=W,this.request=H,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}Pa.ServerUnaryCallImpl=Ca;class Ea extends CA.Readable{constructor(Y,Z,W){super({objectMode:!0});this.path=Y,this.call=Z,this.metadata=W,this.cancelled=!1}_read(Y){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}}Pa.ServerReadableStreamImpl=Ea;class Ma extends CA.Writable{constructor(Y,Z,W,H){super({objectMode:!0});this.path=Y,this.call=Z,this.metadata=W,this.request=H,this.pendingStatus={code:EA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new $a.Metadata,this.on("error",(F)=>{this.pendingStatus=MA(F),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}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(Y,Z,W){this.call.sendMessage(Y,W)}_final(Y){var Z;Y(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(Z=this.pendingStatus.metadata)!==null&&Z!==void 0?Z:this.trailingMetadata}))}end(Y){if(Y)this.trailingMetadata=Y;return super.end()}}Pa.ServerWritableStreamImpl=Ma;class Ra extends CA.Duplex{constructor(Y,Z,W){super({objectMode:!0});this.path=Y,this.call=Z,this.metadata=W,this.pendingStatus={code:EA.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new $a.Metadata,this.on("error",(H)=>{this.pendingStatus=MA(H),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(Y){this.call.sendMetadata(Y)}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(Y){this.call.startRead()}_write(Y,Z,W){this.call.sendMessage(Y,W)}_final(Y){var Z;Y(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(Z=this.pendingStatus.metadata)!==null&&Z!==void 0?Z:this.trailingMetadata}))}end(Y){if(Y)this.trailingMetadata=Y;return super.end()}}Pa.ServerDuplexStreamImpl=Ra});var KK=H0((Sa)=>{Object.defineProperty(Sa,"__esModule",{value:!0});Sa.ServerCredentials=void 0;Sa.createCertificateProviderServerCredentials=$S0;Sa.createServerCredentialsWithInterceptors=CS0;var RA=gz();class tY{constructor(Y,Z){this.serverConstructorOptions=Y,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=Z!==null&&Z!==void 0?Z:null}_addWatcher(Y){this.watchers.add(Y)}_removeWatcher(Y){this.watchers.delete(Y)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(Y){this.latestContextOptions=Y;for(let Z of this.watchers)Z(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new PA}static createSsl(Y,Z,W=!1){var H;if(Y!==null&&!Buffer.isBuffer(Y))throw TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(Z))throw TypeError("keyCertPairs must be an array");if(typeof W!=="boolean")throw TypeError("checkClientCertificate must be a boolean");let F=[],X=[];for(let J=0;J<Z.length;J++){let Q=Z[J];if(Q===null||typeof Q!=="object")throw TypeError(`keyCertPair[${J}] must be an object`);if(!Buffer.isBuffer(Q.private_key))throw TypeError(`keyCertPair[${J}].private_key must be a Buffer`);if(!Buffer.isBuffer(Q.cert_chain))throw TypeError(`keyCertPair[${J}].cert_chain must be a Buffer`);F.push(Q.cert_chain),X.push(Q.private_key)}return new LA({requestCert:W,ciphers:RA.CIPHER_SUITES},{ca:(H=Y!==null&&Y!==void 0?Y:(0,RA.getDefaultRootsData)())!==null&&H!==void 0?H:void 0,cert:F,key:X})}}Sa.ServerCredentials=tY;class PA extends tY{constructor(){super(null)}_getSettings(){return null}_equals(Y){return Y instanceof PA}}class LA extends tY{constructor(Y,Z){super(Y,Z);this.options=Object.assign(Object.assign({},Y),Z)}_equals(Y){if(this===Y)return!0;if(!(Y instanceof LA))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(Y.options.ca)){if(!this.options.ca.equals(Y.options.ca))return!1}else if(this.options.ca!==Y.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(Y.options.cert)){if(this.options.cert.length!==Y.options.cert.length)return!1;for(let Z=0;Z<this.options.cert.length;Z++){let W=this.options.cert[Z],H=Y.options.cert[Z];if(Buffer.isBuffer(W)&&Buffer.isBuffer(H)){if(!W.equals(H))return!1}else if(W!==H)return!1}}else if(this.options.cert!==Y.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(Y.options.key)){if(this.options.key.length!==Y.options.key.length)return!1;for(let Z=0;Z<this.options.key.length;Z++){let W=this.options.key[Z],H=Y.options.key[Z];if(Buffer.isBuffer(W)&&Buffer.isBuffer(H)){if(!W.equals(H))return!1}else if(W!==H)return!1}}else if(this.options.key!==Y.options.key)return!1;if(this.options.requestCert!==Y.options.requestCert)return!1;return!0}}class wA extends tY{constructor(Y,Z,W){super({requestCert:Z!==null,rejectUnauthorized:W,ciphers:RA.CIPHER_SUITES});this.identityCertificateProvider=Y,this.caCertificateProvider=Z,this.requireClientCertificate=W,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(Y){var Z;if(this.getWatcherCount()===0)(Z=this.caCertificateProvider)===null||Z===void 0||Z.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener);super._addWatcher(Y)}_removeWatcher(Y){var Z;if(super._removeWatcher(Y),this.getWatcherCount()===0)(Z=this.caCertificateProvider)===null||Z===void 0||Z.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener)}_equals(Y){if(this===Y)return!0;if(!(Y instanceof wA))return!1;return this.caCertificateProvider===Y.caCertificateProvider&&this.identityCertificateProvider===Y.identityCertificateProvider&&this.requireClientCertificate===Y.requireClientCertificate}calculateSecureContextOptions(){var Y;if(this.latestIdentityUpdate===null)return null;if(this.caCertificateProvider!==null&&this.latestCaUpdate===null)return null;return{ca:(Y=this.latestCaUpdate)===null||Y===void 0?void 0:Y.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let Y=this.calculateSecureContextOptions();this.updateSecureContextOptions(Y)}handleCaCertificateUpdate(Y){this.latestCaUpdate=Y,this.finalizeUpdate()}handleIdentityCertitificateUpdate(Y){this.latestIdentityUpdate=Y,this.finalizeUpdate()}}function $S0(Y,Z,W){return new wA(Y,Z,W)}class SA extends tY{constructor(Y,Z){super({});this.childCredentials=Y,this.interceptors=Z}_isSecure(){return this.childCredentials._isSecure()}_equals(Y){if(!(Y instanceof SA))return!1;if(!this.childCredentials._equals(Y.childCredentials))return!1;if(this.interceptors.length!==Y.interceptors.length)return!1;for(let Z=0;Z<this.interceptors.length;Z++)if(this.interceptors[Z]!==Y.interceptors[Z])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(Y){this.childCredentials._addWatcher(Y)}_removeWatcher(Y){this.childCredentials._removeWatcher(Y)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}}function CS0(Y,Z){return new SA(Y,Z)}});var AX=H0((ka)=>{Object.defineProperty(ka,"__esModule",{value:!0});ka.durationMessageToDuration=RS0;ka.msToDuration=PS0;ka.durationToMs=LS0;ka.isDuration=wS0;ka.isDurationMessage=SS0;ka.parseDuration=kS0;ka.durationToString=yS0;function RS0(Y){return{seconds:Number.parseInt(Y.seconds),nanos:Y.nanos}}function PS0(Y){return{seconds:Y/1000|0,nanos:Y%1000*1e6|0}}function LS0(Y){return Y.seconds*1000+Y.nanos/1e6|0}function wS0(Y){return typeof Y.seconds==="number"&&typeof Y.nanos==="number"}function SS0(Y){return typeof Y.seconds==="string"&&typeof Y.nanos==="number"}var fS0=/^(\d+)(?:\.(\d+))?s$/;function kS0(Y){let Z=Y.match(fS0);if(!Z)return null;return{seconds:Number.parseInt(Z[1],10),nanos:Z[2]?Number.parseInt(Z[2].padEnd(9,"0"),10):0}}function yS0(Y){if(Y.nanos===0)return`${Y.seconds}s`;let Z;if(Y.nanos%1e6===0)Z=1e6;else if(Y.nanos%1000===0)Z=1000;else Z=1;return`${Y.seconds}.${Y.nanos/Z}s`}});var FK=H0((da)=>{var __dirname="/Users/beatrix/dev/sdk/node_modules/.bun/@grpc+grpc-js@1.14.3/node_modules/@grpc/grpc-js/build/src";Object.defineProperty(da,"__esModule",{value:!0});da.OrcaOobMetricsSubchannelWrapper=da.GRPC_METRICS_HEADER=da.ServerMetricRecorder=da.PerRequestMetricRecorder=void 0;da.createOrcaClient=xa;da.createMetricsReader=pS0;var mS0=N3(),fA=AX(),gS0=kY(),dS0=zX(),ya=a1(),cS0=yY(),lS0=k8(),va=null;function GK(){if(va)return va;let Y=ZX().loadSync,Z=Y("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,mS0.loadPackageDefinition)(Z)}class ja{constructor(){this.message={}}recordRequestCostMetric(Y,Z){if(!this.message.request_cost)this.message.request_cost={};this.message.request_cost[Y]=Z}recordUtilizationMetric(Y,Z){if(!this.message.utilization)this.message.utilization={};this.message.utilization[Y]=Z}recordNamedMetric(Y,Z){if(!this.message.named_metrics)this.message.named_metrics={};this.message.named_metrics[Y]=Z}recordCPUUtilizationMetric(Y){this.message.cpu_utilization=Y}recordMemoryUtilizationMetric(Y){this.message.mem_utilization=Y}recordApplicationUtilizationMetric(Y){this.message.application_utilization=Y}recordQpsMetric(Y){this.message.rps_fractional=Y}recordEpsMetric(Y){this.message.eps=Y}serialize(){return GK().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}}da.PerRequestMetricRecorder=ja;var nS0=30000;class _a{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:(Y)=>{let Z=Y.request.report_interval?(0,fA.durationToMs)((0,fA.durationMessageToDuration)(Y.request.report_interval)):nS0,W=setInterval(()=>{Y.write(this.message)},Z);Y.on("cancelled",()=>{clearInterval(W)})}}}putUtilizationMetric(Y,Z){if(!this.message.utilization)this.message.utilization={};this.message.utilization[Y]=Z}setAllUtilizationMetrics(Y){this.message.utilization=Object.assign({},Y)}deleteUtilizationMetric(Y){var Z;(Z=this.message.utilization)===null||Z===void 0||delete Z[Y]}setCpuUtilizationMetric(Y){this.message.cpu_utilization=Y}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(Y){this.message.application_utilization=Y}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(Y){this.message.rps_fractional=Y}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(Y){this.message.eps=Y}deleteEpsMetric(){delete this.message.eps}addToServer(Y){let Z=GK().xds.service.orca.v3.OpenRcaService.service;Y.addService(Z,this.serviceImplementation)}}da.ServerMetricRecorder=_a;function xa(Y){return new(GK()).xds.service.orca.v3.OpenRcaService("unused",gS0.ChannelCredentials.createInsecure(),{channelOverride:Y})}da.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var ha="grpc_orca_load_report";function pS0(Y,Z){return(W,H,F)=>{let X=F.getOpaque(ha);if(X)Y(X);else{let J=F.get(da.GRPC_METRICS_HEADER);if(J.length>0)X=GK().xds.data.orca.v3.OrcaLoadReport.deserialize(J[0]),Y(X),F.setOpaque(ha,X)}if(Z)Z(W,H,F)}}var ba="orca_oob_metrics";class ua{constructor(Y,Z){this.metricsListener=Y,this.intervalMs=Z,this.dataProducer=null}setSubchannel(Y){let Z=Y.getOrCreateDataProducer(ba,iS0);this.dataProducer=Z,Z.addDataWatcher(this)}destroy(){var Y;(Y=this.dataProducer)===null||Y===void 0||Y.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(Y){this.metricsListener(Y)}}class ma{constructor(Y){this.subchannel=Y,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new cS0.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let Z=Y.getChannel();this.client=xa(Z),Y.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(Y){this.dataWatchers.add(Y),this.updateMetricsSubscription()}removeDataWatcher(Y){var Z;if(this.dataWatchers.delete(Y),this.dataWatchers.size===0)this.subchannel.removeDataProducer(ba),(Z=this.metricsCall)===null||Z===void 0||Z.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener);else this.updateMetricsSubscription()}updateMetricsSubscription(){var Y;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==lS0.ConnectivityState.READY)return;let Z=Math.min(...Array.from(this.dataWatchers).map((W)=>W.getInterval()));if(!this.metricsCall||Z!==this.currentInterval){(Y=this.metricsCall)===null||Y===void 0||Y.cancel(),this.currentInterval=Z;let W=this.client.streamCoreMetrics({report_interval:(0,fA.msToDuration)(Z)});this.metricsCall=W,W.on("data",(H)=>{this.dataWatchers.forEach((F)=>{F.onMetricsUpdate(H)})}),W.on("error",(H)=>{if(this.metricsCall=null,H.code===ya.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}if(H.code===ya.Status.CANCELLED)return;this.backoffTimer.runOnce()})}}}class ga extends dS0.BaseSubchannelWrapper{constructor(Y,Z,W){super(Y);this.addDataWatcher(new ua(Z,W))}getWrappedSubchannel(){return this.child}}da.OrcaOobMetricsSubchannelWrapper=ga;function iS0(Y){return new ma(Y)}});var hA=H0((Jo)=>{Object.defineProperty(Jo,"__esModule",{value:!0});Jo.BaseServerInterceptingCall=Jo.ServerInterceptingCall=Jo.ResponderBuilder=Jo.ServerListenerBuilder=void 0;Jo.isInterceptingServerListener=Yf0;Jo.getServerInterceptingCall=Wf0;var qK=K8(),m8=a1(),sY=V1("http2"),na=Y3(),pa=V1("zlib"),sS0=zA(),ta=M6(),eS0=V1("tls"),ia=FK(),sa="server_call";function R7(Y){ta.trace(m8.LogVerbosity.DEBUG,sa,Y)}class ea{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(Y){return this.metadata=Y,this}withOnReceiveMessage(Y){return this.message=Y,this}withOnReceiveHalfClose(Y){return this.halfClose=Y,this}withOnCancel(Y){return this.cancel=Y,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}}Jo.ServerListenerBuilder=ea;function Yf0(Y){return Y.onReceiveMetadata!==void 0&&Y.onReceiveMetadata.length===1}class Yo{constructor(Y,Z){this.listener=Y,this.nextListener=Z,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){if(this.hasPendingMessage)this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1}processPendingHalfClose(){if(this.hasPendingHalfClose)this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1}onReceiveMetadata(Y){if(this.cancelled)return;this.processingMetadata=!0,this.listener.onReceiveMetadata(Y,(Z)=>{if(this.processingMetadata=!1,this.cancelled)return;this.nextListener.onReceiveMetadata(Z),this.processPendingMessage(),this.processPendingHalfClose()})}onReceiveMessage(Y){if(this.cancelled)return;this.processingMessage=!0,this.listener.onReceiveMessage(Y,(Z)=>{if(this.processingMessage=!1,this.cancelled)return;if(this.processingMetadata)this.pendingMessage=Z,this.hasPendingMessage=!0;else this.nextListener.onReceiveMessage(Z),this.processPendingHalfClose()})}onReceiveHalfClose(){if(this.cancelled)return;this.listener.onReceiveHalfClose(()=>{if(this.cancelled)return;if(this.processingMetadata||this.processingMessage)this.hasPendingHalfClose=!0;else this.nextListener.onReceiveHalfClose()})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}}class Zo{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(Y){return this.start=Y,this}withSendMetadata(Y){return this.metadata=Y,this}withSendMessage(Y){return this.message=Y,this}withSendStatus(Y){return this.status=Y,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}}Jo.ResponderBuilder=Zo;var HK={onReceiveMetadata:(Y,Z)=>{Z(Y)},onReceiveMessage:(Y,Z)=>{Z(Y)},onReceiveHalfClose:(Y)=>{Y()},onCancel:()=>{}},VK={start:(Y)=>{Y()},sendMetadata:(Y,Z)=>{Z(Y)},sendMessage:(Y,Z)=>{Z(Y)},sendStatus:(Y,Z)=>{Z(Y)}};class Qo{constructor(Y,Z){var W,H,F,X;this.nextCall=Y,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(W=Z===null||Z===void 0?void 0:Z.start)!==null&&W!==void 0?W:VK.start,sendMetadata:(H=Z===null||Z===void 0?void 0:Z.sendMetadata)!==null&&H!==void 0?H:VK.sendMetadata,sendMessage:(F=Z===null||Z===void 0?void 0:Z.sendMessage)!==null&&F!==void 0?F:VK.sendMessage,sendStatus:(X=Z===null||Z===void 0?void 0:Z.sendStatus)!==null&&X!==void 0?X:VK.sendStatus}}processPendingMessage(){if(this.pendingMessageCallback)this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null}processPendingStatus(){if(this.pendingStatus)this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null}start(Y){this.responder.start((Z)=>{var W,H,F,X;let J={onReceiveMetadata:(W=Z===null||Z===void 0?void 0:Z.onReceiveMetadata)!==null&&W!==void 0?W:HK.onReceiveMetadata,onReceiveMessage:(H=Z===null||Z===void 0?void 0:Z.onReceiveMessage)!==null&&H!==void 0?H:HK.onReceiveMessage,onReceiveHalfClose:(F=Z===null||Z===void 0?void 0:Z.onReceiveHalfClose)!==null&&F!==void 0?F:HK.onReceiveHalfClose,onCancel:(X=Z===null||Z===void 0?void 0:Z.onCancel)!==null&&X!==void 0?X:HK.onCancel},Q=new Yo(J,Y);this.nextCall.start(Q)})}sendMetadata(Y){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(Y,(Z)=>{this.processingMetadata=!1,this.nextCall.sendMetadata(Z),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(Y,Z){if(this.processingMessage=!0,!this.sentMetadata)this.sendMetadata(new qK.Metadata);this.responder.sendMessage(Y,(W)=>{if(this.processingMessage=!1,this.processingMetadata)this.pendingMessage=W,this.pendingMessageCallback=Z;else this.nextCall.sendMessage(W,Z)})}sendStatus(Y){this.responder.sendStatus(Y,(Z)=>{if(this.processingMetadata||this.processingMessage)this.pendingStatus=Z;else this.nextCall.sendStatus(Z)})}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()}}Jo.ServerInterceptingCall=Qo;var Xo="grpc-accept-encoding",yA="grpc-encoding",ra="grpc-message",aa="grpc-status",kA="grpc-timeout",Zf0=/(\d{1,8})\s*([HMSmun])/,Qf0={H:3600000,M:60000,S:1000,m:1,u:0.001,n:0.000001},Xf0={[Xo]:"identity,deflate,gzip",[yA]:"identity"},oa={[sY.constants.HTTP2_HEADER_STATUS]:sY.constants.HTTP_STATUS_OK,[sY.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},Jf0={waitForTrailers:!0};class vA{constructor(Y,Z,W,H,F){var X,J;if(this.stream=Y,this.callEventTracker=W,this.handler=H,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=m8.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=m8.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 ia.PerRequestMetricRecorder,this.stream.once("error",(V)=>{}),this.stream.once("close",()=>{var V;if(R7("Request to method "+((V=this.handler)===null||V===void 0?void 0:V.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:m8.Status.CANCELLED,details:"Stream closed before sending status",metadata:null});this.notifyOnCancel()}),this.stream.on("data",(V)=>{this.handleDataFrame(V)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in F)this.maxSendMessageSize=F["grpc.max_send_message_length"];if("grpc.max_receive_message_length"in F)this.maxReceiveMessageSize=F["grpc.max_receive_message_length"];this.host=(X=Z[":authority"])!==null&&X!==void 0?X:Z.host,this.decoder=new sS0.StreamDecoder(this.maxReceiveMessageSize);let Q=qK.Metadata.fromHttp2Headers(Z);if(ta.isTracerEnabled(sa))R7("Request to "+this.handler.path+" received headers "+JSON.stringify(Q.toJSON()));let G=Q.get(kA);if(G.length>0)this.handleTimeoutHeader(G[0]);let q=Q.get(yA);if(q.length>0)this.incomingEncoding=q[0];Q.remove(kA),Q.remove(yA),Q.remove(Xo),Q.remove(sY.constants.HTTP2_HEADER_ACCEPT_ENCODING),Q.remove(sY.constants.HTTP2_HEADER_TE),Q.remove(sY.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=Q;let K=(J=Y.session)===null||J===void 0?void 0:J.socket;this.connectionInfo={localAddress:K===null||K===void 0?void 0:K.localAddress,localPort:K===null||K===void 0?void 0:K.localPort,remoteAddress:K===null||K===void 0?void 0:K.remoteAddress,remotePort:K===null||K===void 0?void 0:K.remotePort},this.shouldSendMetrics=!!F["grpc.server_call_metric_recording"]}handleTimeoutHeader(Y){let Z=Y.toString().match(Zf0);if(Z===null){let F={code:m8.Status.INTERNAL,details:`Invalid ${kA} value "${Y}"`,metadata:null};process.nextTick(()=>{this.sendStatus(F)});return}let W=+Z[1]*Qf0[Z[2]]|0,H=new Date;this.deadline=H.setMilliseconds(H.getMilliseconds()+W),this.deadlineTimer=setTimeout(()=>{let F={code:m8.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(F)},W)}checkCancelled(){if(!this.cancelled&&(this.stream.destroyed||this.stream.closed))this.notifyOnCancel(),this.cancelled=!0;return this.cancelled}notifyOnCancel(){if(this.cancelNotified)return;if(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var Y;(Y=this.listener)===null||Y===void 0||Y.onCancel()}),this.deadlineTimer)clearTimeout(this.deadlineTimer);this.stream.resume()}maybeSendMetadata(){if(!this.metadataSent)this.sendMetadata(new qK.Metadata)}serializeMessage(Y){let Z=this.handler.serialize(Y),W=Z.byteLength,H=Buffer.allocUnsafe(W+5);return H.writeUInt8(0,0),H.writeUInt32BE(W,1),Z.copy(H,5),H}decompressMessage(Y,Z){let W=Y.subarray(5);if(Z==="identity")return W;else if(Z==="deflate"||Z==="gzip"){let H;if(Z==="deflate")H=pa.createInflate();else H=pa.createGunzip();return new Promise((F,X)=>{let J=0,Q=[];H.on("data",(G)=>{if(Q.push(G),J+=G.byteLength,this.maxReceiveMessageSize!==-1&&J>this.maxReceiveMessageSize)H.destroy(),X({code:m8.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`})}),H.on("end",()=>{F(Buffer.concat(Q))}),H.write(W),H.end()})}else return Promise.reject({code:m8.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${Z}"`})}async decompressAndMaybePush(Y){if(Y.type!=="COMPRESSED")throw Error(`Invalid queue entry type: ${Y.type}`);let W=Y.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",H;try{H=await this.decompressMessage(Y.compressedMessage,W)}catch(F){this.sendStatus(F);return}try{Y.parsedMessage=this.handler.deserialize(H)}catch(F){this.sendStatus({code:m8.Status.INTERNAL,details:`Error deserializing request: ${F.message}`});return}Y.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let Y=this.readQueue.shift();if(Y.type==="READABLE")this.listener.onReceiveMessage(Y.parsedMessage);else this.listener.onReceiveHalfClose()}}handleDataFrame(Y){var Z;if(this.checkCancelled())return;R7("Request to "+this.handler.path+" received data frame of size "+Y.length);let W;try{W=this.decoder.write(Y)}catch(H){this.sendStatus({code:m8.Status.RESOURCE_EXHAUSTED,details:H.message});return}for(let H of W){this.stream.pause();let F={type:"COMPRESSED",compressedMessage:H,parsedMessage:null};this.readQueue.push(F),this.decompressAndMaybePush(F),(Z=this.callEventTracker)===null||Z===void 0||Z.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(Y){if(R7("Request to "+this.handler.path+" start called"),this.checkCancelled())return;this.listener=Y,Y.onReceiveMetadata(this.metadata)}sendMetadata(Y){if(this.checkCancelled())return;if(this.metadataSent)return;this.metadataSent=!0;let Z=Y?Y.toHttp2Headers():null,W=Object.assign(Object.assign(Object.assign({},oa),Xf0),Z);this.stream.respond(W,Jf0)}sendMessage(Y,Z){if(this.checkCancelled())return;let W;try{W=this.serializeMessage(Y)}catch(H){this.sendStatus({code:m8.Status.INTERNAL,details:`Error serializing response: ${(0,na.getErrorMessage)(H)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&W.length-5>this.maxSendMessageSize){this.sendStatus({code:m8.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${W.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),R7("Request to "+this.handler.path+" sent data frame of size "+W.length),this.stream.write(W,(H)=>{var F;if(H){this.sendStatus({code:m8.Status.INTERNAL,details:`Error writing message: ${(0,na.getErrorMessage)(H)}`,metadata:null});return}(F=this.callEventTracker)===null||F===void 0||F.addMessageSent(),Z()})}sendStatus(Y){var Z,W,H;if(this.checkCancelled())return;R7("Request to method "+((Z=this.handler)===null||Z===void 0?void 0:Z.path)+" ended with status code: "+m8.Status[Y.code]+" details: "+Y.details);let F=(H=(W=Y.metadata)===null||W===void 0?void 0:W.clone())!==null&&H!==void 0?H:new qK.Metadata;if(this.shouldSendMetrics)F.set(ia.GRPC_METRICS_HEADER,this.metricsRecorder.serialize());if(this.metadataSent)if(!this.wantTrailers)this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(Y);let X=Object.assign({[aa]:Y.code,[ra]:encodeURI(Y.details)},F.toHttp2Headers());this.stream.sendTrailers(X),this.notifyOnCancel()}),this.stream.end();else this.notifyOnCancel();else{if(this.callEventTracker&&!this.streamEnded)this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(Y);let X=Object.assign(Object.assign({[aa]:Y.code,[ra]:encodeURI(Y.details)},oa),F.toHttp2Headers());this.stream.respond(X,{endStream:!0}),this.notifyOnCancel()}}startRead(){if(R7("Request to "+this.handler.path+" startRead called"),this.checkCancelled())return;if(this.isReadPending=!0,this.readQueue.length===0){if(!this.receivedHalfClose)this.stream.resume()}else this.maybePushNextMessage()}getPeer(){var Y;let Z=(Y=this.stream.session)===null||Y===void 0?void 0:Y.socket;if(Z===null||Z===void 0?void 0:Z.remoteAddress)if(Z.remotePort)return`${Z.remoteAddress}:${Z.remotePort}`;else return Z.remoteAddress;else return"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var Y;if(((Y=this.stream.session)===null||Y===void 0?void 0:Y.socket)instanceof eS0.TLSSocket){let Z=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:Z.raw?Z:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}}Jo.BaseServerInterceptingCall=vA;function Wf0(Y,Z,W,H,F,X){let J={path:F.path,requestStream:F.type==="clientStream"||F.type==="bidi",responseStream:F.type==="serverStream"||F.type==="bidi",requestDeserialize:F.deserialize,responseSerialize:F.serialize},Q=new vA(Z,W,H,F,X);return Y.reduce((G,q)=>{return q(J,G)},Q)}});var zo=H0(($5)=>{var qf0=$5&&$5.__runInitializers||function(Y,Z,W){var H=arguments.length>2;for(var F=0;F<Z.length;F++)W=H?Z[F].call(Y,W):Z[F].call(Y);return H?W:void 0},zf0=$5&&$5.__esDecorate||function(Y,Z,W,H,F,X){function J(N){if(N!==void 0&&typeof N!=="function")throw TypeError("Function expected");return N}var Q=H.kind,G=Q==="getter"?"get":Q==="setter"?"set":"value",q=!Z&&Y?H.static?Y:Y.prototype:null,K=Z||(q?Object.getOwnPropertyDescriptor(q,H.name):{}),V,B=!1;for(var I=W.length-1;I>=0;I--){var M={};for(var E in H)M[E]=E==="access"?{}:H[E];for(var E in H.access)M.access[E]=H.access[E];M.addInitializer=function(N){if(B)throw TypeError("Cannot add initializers after decoration has completed");X.push(J(N||null))};var A=(0,W[I])(Q==="accessor"?{get:K.get,set:K.set}:K[G],M);if(Q==="accessor"){if(A===void 0)continue;if(A===null||typeof A!=="object")throw TypeError("Object expected");if(V=J(A.get))K.get=V;if(V=J(A.set))K.set=V;if(V=J(A.init))F.unshift(V)}else if(V=J(A))if(Q==="field")F.unshift(V);else K[G]=V}if(q)Object.defineProperty(q,H.name,K);B=!0};Object.defineProperty($5,"__esModule",{value:!0});$5.Server=void 0;var g8=V1("http2"),Bf0=V1("util"),p6=a1(),ZZ=wa(),jA=KK(),Ko=S9(),YZ=M6(),I5=u8(),j9=f8(),Y8=O5(),Go=hA(),eY=2147483647,_A=2147483647,Af0=20000,Fo=2147483647,{HTTP2_HEADER_PATH:Ho}=g8.constants,Uf0="server",Vo=Buffer.from("max_age");function qo(Y){YZ.trace(p6.LogVerbosity.DEBUG,"server_call",Y)}function Nf0(){}function Of0(Y){return function(Z,W){return Bf0.deprecate(Z,Y)}}function xA(Y){return{code:p6.Status.UNIMPLEMENTED,details:`The server does not implement the method ${Y}`}}function Df0(Y,Z){let W=xA(Z);switch(Y){case"unary":return(H,F)=>{F(W,null)};case"clientStream":return(H,F)=>{F(W,null)};case"serverStream":return(H)=>{H.emit("error",W)};case"bidi":return(H)=>{H.emit("error",W)};default:throw Error(`Invalid handlerType ${Y}`)}}var Tf0=(()=>{var Y;let Z=[],W;return Y=class{constructor(F){var X,J,Q,G,q,K;if(this.boundPorts=(qf0(this,Z),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=F!==null&&F!==void 0?F:{},this.options["grpc.enable_channelz"]===0)this.channelzEnabled=!1,this.channelzTrace=new Y8.ChannelzTraceStub,this.callTracker=new Y8.ChannelzCallTrackerStub,this.listenerChildrenTracker=new Y8.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new Y8.ChannelzChildrenTrackerStub;else this.channelzTrace=new Y8.ChannelzTrace,this.callTracker=new Y8.ChannelzCallTracker,this.listenerChildrenTracker=new Y8.ChannelzChildrenTracker,this.sessionChildrenTracker=new Y8.ChannelzChildrenTracker;if(this.channelzRef=(0,Y8.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(X=this.options["grpc.max_connection_age_ms"])!==null&&X!==void 0?X:eY,this.maxConnectionAgeGraceMs=(J=this.options["grpc.max_connection_age_grace_ms"])!==null&&J!==void 0?J:eY,this.keepaliveTimeMs=(Q=this.options["grpc.keepalive_time_ms"])!==null&&Q!==void 0?Q:_A,this.keepaliveTimeoutMs=(G=this.options["grpc.keepalive_timeout_ms"])!==null&&G!==void 0?G:Af0,this.sessionIdleTimeout=(q=this.options["grpc.max_connection_idle_ms"])!==null&&q!==void 0?q:Fo,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"];else this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER;if("grpc.max_concurrent_streams"in this.options)this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]};this.interceptors=(K=this.options.interceptors)!==null&&K!==void 0?K:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(F){var X,J,Q;let G=this.sessions.get(F),q=F.socket,K=q.remoteAddress?(0,I5.stringToSubchannelAddress)(q.remoteAddress,q.remotePort):null,V=q.localAddress?(0,I5.stringToSubchannelAddress)(q.localAddress,q.localPort):null,B;if(F.encrypted){let M=q,E=M.getCipher(),A=M.getCertificate(),N=M.getPeerCertificate();B={cipherSuiteStandardName:(X=E.standardName)!==null&&X!==void 0?X:null,cipherSuiteOtherName:E.standardName?null:E.name,localCertificate:A&&"raw"in A?A.raw:null,remoteCertificate:N&&"raw"in N?N.raw:null}}else B=null;return{remoteAddress:K,localAddress:V,security:B,remoteName:null,streamsStarted:G.streamTracker.callsStarted,streamsSucceeded:G.streamTracker.callsSucceeded,streamsFailed:G.streamTracker.callsFailed,messagesSent:G.messagesSent,messagesReceived:G.messagesReceived,keepAlivesSent:G.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:G.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:G.lastMessageSentTimestamp,lastMessageReceivedTimestamp:G.lastMessageReceivedTimestamp,localFlowControlWindow:(J=F.state.localWindowSize)!==null&&J!==void 0?J:null,remoteFlowControlWindow:(Q=F.state.remoteWindowSize)!==null&&Q!==void 0?Q:null}}trace(F){YZ.trace(p6.LogVerbosity.DEBUG,Uf0,"("+this.channelzRef.id+") "+F)}keepaliveTrace(F){YZ.trace(p6.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+F)}addProtoService(){throw Error("Not implemented. Use addService() instead")}addService(F,X){if(F===null||typeof F!=="object"||X===null||typeof X!=="object")throw Error("addService() requires two objects as arguments");let J=Object.keys(F);if(J.length===0)throw Error("Cannot add an empty service to a server");J.forEach((Q)=>{let G=F[Q],q;if(G.requestStream)if(G.responseStream)q="bidi";else q="clientStream";else if(G.responseStream)q="serverStream";else q="unary";let K=X[Q],V;if(K===void 0&&typeof G.originalName==="string")K=X[G.originalName];if(K!==void 0)V=K.bind(X);else V=Df0(q,Q);if(this.register(G.path,V,G.responseSerialize,G.requestDeserialize,q)===!1)throw Error(`Method handler for ${G.path} already provided.`)})}removeService(F){if(F===null||typeof F!=="object")throw Error("removeService() requires object as argument");Object.keys(F).forEach((J)=>{let Q=F[J];this.unregister(Q.path)})}bind(F,X){throw Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(F){return(0,Y8.registerChannelzSocket)((0,I5.subchannelAddressToString)(F),()=>{return{localAddress:F,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(F){(0,Y8.unregisterChannelzRef)(F)}createHttp2Server(F){let X;if(F._isSecure()){let J=F._getConstructorOptions(),Q=F._getSecureContextOptions(),G=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),J),Q),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),q=Q!==null;this.trace("Initial credentials valid: "+q),X=g8.createSecureServer(G),X.prependListener("connection",(V)=>{if(!q)this.trace("Dropped connection from "+JSON.stringify(V.address())+" due to unloaded credentials"),V.destroy()}),X.on("secureConnection",(V)=>{V.on("error",(B)=>{this.trace("An incoming TLS connection closed with error: "+B.message)})});let K=(V)=>{if(V){let B=X;try{B.setSecureContext(V)}catch(I){YZ.log(p6.LogVerbosity.ERROR,"Failed to set secure context with error "+I.message),V=null}}q=V!==null,this.trace("Post-update credentials valid: "+q)};F._addWatcher(K),X.on("close",()=>{F._removeWatcher(K)})}else X=g8.createServer(this.commonServerOptions);return X.setTimeout(0,Nf0),this._setupHandlers(X,F._getInterceptors()),X}bindOneAddress(F,X){this.trace("Attempting to bind "+(0,I5.subchannelAddressToString)(F));let J=this.createHttp2Server(X.credentials);return new Promise((Q,G)=>{let q=(K)=>{this.trace("Failed to bind "+(0,I5.subchannelAddressToString)(F)+" with error "+K.message),Q({port:"port"in F?F.port:1,error:K.message})};J.once("error",q),J.listen(F,()=>{let K=J.address(),V;if(typeof K==="string")V={path:K};else V={host:K.address,port:K.port};let B=this.experimentalRegisterListenerToChannelz(V);this.listenerChildrenTracker.refChild(B),this.http2Servers.set(J,{channelzRef:B,sessions:new Set,ownsChannelzRef:!0}),X.listeningServers.add(J),this.trace("Successfully bound "+(0,I5.subchannelAddressToString)(V)),Q({port:"port"in V?V.port:1}),J.removeListener("error",q)})})}async bindManyPorts(F,X){if(F.length===0)return{count:0,port:0,errors:[]};if((0,I5.isTcpSubchannelAddress)(F[0])&&F[0].port===0){let J=await this.bindOneAddress(F[0],X);if(J.error){let Q=await this.bindManyPorts(F.slice(1),X);return Object.assign(Object.assign({},Q),{errors:[J.error,...Q.errors]})}else{let Q=F.slice(1).map((K)=>(0,I5.isTcpSubchannelAddress)(K)?{host:K.host,port:J.port}:K),G=await Promise.all(Q.map((K)=>this.bindOneAddress(K,X))),q=[J,...G];return{count:q.filter((K)=>K.error===void 0).length,port:J.port,errors:q.filter((K)=>K.error).map((K)=>K.error)}}}else{let J=await Promise.all(F.map((Q)=>this.bindOneAddress(Q,X)));return{count:J.filter((Q)=>Q.error===void 0).length,port:J[0].port,errors:J.filter((Q)=>Q.error).map((Q)=>Q.error)}}}async bindAddressList(F,X){let J=await this.bindManyPorts(F,X);if(J.count>0){if(J.count<F.length)YZ.log(p6.LogVerbosity.INFO,`WARNING Only ${J.count} addresses added out of total ${F.length} resolved`);return J.port}else{let Q=`No address added out of total ${F.length} resolved`;throw YZ.log(p6.LogVerbosity.ERROR,Q),Error(`${Q} errors: [${J.errors.join(",")}]`)}}resolvePort(F){return new Promise((X,J)=>{let Q=!1,G=(K,V,B,I)=>{if(Q)return!0;if(Q=!0,!K.ok)return J(Error(K.error.details)),!0;let M=[].concat(...K.value.map((E)=>E.addresses));if(M.length===0)return J(Error(`No addresses resolved for port ${F}`)),!0;return X(M),!0};(0,Ko.createResolver)(F,G,this.options).updateResolution()})}async bindPort(F,X){let J=await this.resolvePort(F);if(X.cancelled)throw this.completeUnbind(X),Error("bindAsync operation cancelled by unbind call");let Q=await this.bindAddressList(J,X);if(X.cancelled)throw this.completeUnbind(X),Error("bindAsync operation cancelled by unbind call");return Q}normalizePort(F){let X=(0,j9.parseUri)(F);if(X===null)throw Error(`Could not parse port "${F}"`);let J=(0,Ko.mapUriDefaultScheme)(X);if(J===null)throw Error(`Could not get a default scheme for port "${F}"`);return J}bindAsync(F,X,J){if(this.shutdown)throw Error("bindAsync called after shutdown");if(typeof F!=="string")throw TypeError("port must be a string");if(X===null||!(X instanceof jA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(typeof J!=="function")throw TypeError("callback must be a function");this.trace("bindAsync port="+F);let Q=this.normalizePort(F),G=(B,I)=>{process.nextTick(()=>J(B,I))},q=this.boundPorts.get((0,j9.uriToString)(Q));if(q){if(!X._equals(q.credentials)){G(Error(`${F} already bound with incompatible credentials`),0);return}if(q.cancelled=!1,q.completionPromise)q.completionPromise.then((B)=>J(null,B),(B)=>J(B,0));else G(null,q.portNumber);return}q={mapKey:(0,j9.uriToString)(Q),originalUri:Q,completionPromise:null,cancelled:!1,portNumber:0,credentials:X,listeningServers:new Set};let K=(0,j9.splitHostPort)(Q.path),V=this.bindPort(Q,q);if(q.completionPromise=V,(K===null||K===void 0?void 0:K.port)===0)V.then((B)=>{let I={scheme:Q.scheme,authority:Q.authority,path:(0,j9.combineHostPort)({host:K.host,port:B})};q.mapKey=(0,j9.uriToString)(I),q.completionPromise=null,q.portNumber=B,this.boundPorts.set(q.mapKey,q),J(null,B)},(B)=>{J(B,0)});else this.boundPorts.set(q.mapKey,q),V.then((B)=>{q.completionPromise=null,q.portNumber=B,J(null,B)},(B)=>{J(B,0)})}registerInjectorToChannelz(){return(0,Y8.registerChannelzSocket)("injector",()=>{return{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(F,X,J=!1){if(F===null||!(F instanceof jA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");if(this.channelzEnabled)this.listenerChildrenTracker.refChild(X);let Q=this.createHttp2Server(F),G=new Set;return this.http2Servers.set(Q,{channelzRef:X,sessions:G,ownsChannelzRef:J}),{injectConnection:(q)=>{Q.emit("connection",q)},drain:(q)=>{var K,V;for(let B of G)this.closeSession(B);(V=(K=setTimeout(()=>{for(let B of G)B.destroy(g8.constants.NGHTTP2_CANCEL)},q)).unref)===null||V===void 0||V.call(K)},destroy:()=>{this.closeServer(Q);for(let q of G)this.closeSession(q)}}}createConnectionInjector(F){if(F===null||!(F instanceof jA.ServerCredentials))throw TypeError("creds must be a ServerCredentials object");let X=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(F,X,!0)}closeServer(F,X){this.trace("Closing server with address "+JSON.stringify(F.address()));let J=this.http2Servers.get(F);F.close(()=>{if(J&&J.ownsChannelzRef)this.listenerChildrenTracker.unrefChild(J.channelzRef),(0,Y8.unregisterChannelzRef)(J.channelzRef);this.http2Servers.delete(F),X===null||X===void 0||X()})}closeSession(F,X){var J;this.trace("Closing session initiated by "+((J=F.socket)===null||J===void 0?void 0:J.remoteAddress));let Q=this.sessions.get(F),G=()=>{if(Q)this.sessionChildrenTracker.unrefChild(Q.ref),(0,Y8.unregisterChannelzRef)(Q.ref);X===null||X===void 0||X()};if(F.closed)queueMicrotask(G);else F.close(G)}completeUnbind(F){for(let X of F.listeningServers){let J=this.http2Servers.get(X);if(this.closeServer(X,()=>{F.listeningServers.delete(X)}),J)for(let Q of J.sessions)this.closeSession(Q)}this.boundPorts.delete(F.mapKey)}unbind(F){this.trace("unbind port="+F);let X=this.normalizePort(F),J=(0,j9.splitHostPort)(X.path);if((J===null||J===void 0?void 0:J.port)===0)throw Error("Cannot unbind port 0");let Q=this.boundPorts.get((0,j9.uriToString)(X));if(Q)if(this.trace("unbinding "+Q.mapKey+" originally bound as "+(0,j9.uriToString)(Q.originalUri)),Q.completionPromise)Q.cancelled=!0;else this.completeUnbind(Q)}drain(F,X){var J,Q;this.trace("drain port="+F+" graceTimeMs="+X);let G=this.normalizePort(F),q=(0,j9.splitHostPort)(G.path);if((q===null||q===void 0?void 0:q.port)===0)throw Error("Cannot drain port 0");let K=this.boundPorts.get((0,j9.uriToString)(G));if(!K)return;let V=new Set;for(let B of K.listeningServers){let I=this.http2Servers.get(B);if(I)for(let M of I.sessions)V.add(M),this.closeSession(M,()=>{V.delete(M)})}(Q=(J=setTimeout(()=>{for(let B of V)B.destroy(g8.constants.NGHTTP2_CANCEL)},X)).unref)===null||Q===void 0||Q.call(J)}forceShutdown(){for(let F of this.boundPorts.values())F.cancelled=!0;this.boundPorts.clear();for(let F of this.http2Servers.keys())this.closeServer(F);this.sessions.forEach((F,X)=>{this.closeSession(X),X.destroy(g8.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,Y8.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(F,X,J,Q,G){if(this.handlers.has(F))return!1;return this.handlers.set(F,{func:X,serialize:J,deserialize:Q,type:G,path:F}),!0}unregister(F){return this.handlers.delete(F)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every((F)=>!F.listening))throw Error("server must be bound in order to start");if(this.started===!0)throw Error("server is already started");this.started=!0}tryShutdown(F){var X;let J=(q)=>{(0,Y8.unregisterChannelzRef)(this.channelzRef),F(q)},Q=0;function G(){if(Q--,Q===0)J()}this.shutdown=!0;for(let[q,K]of this.http2Servers.entries()){Q++;let V=K.channelzRef.name;this.trace("Waiting for server "+V+" to close"),this.closeServer(q,()=>{this.trace("Server "+V+" finished closing"),G()});for(let B of K.sessions.keys()){Q++;let I=(X=B.socket)===null||X===void 0?void 0:X.remoteAddress;this.trace("Waiting for session "+I+" to close"),this.closeSession(B,()=>{this.trace("Session "+I+" finished closing"),G()})}}if(Q===0)J()}addHttp2Port(){throw Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(F,X){let J=X[g8.constants.HTTP2_HEADER_CONTENT_TYPE];if(typeof J!=="string"||!J.startsWith("application/grpc"))return F.respond({[g8.constants.HTTP2_HEADER_STATUS]:g8.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1;return!0}_retrieveHandler(F){qo("Received call to method "+F+" at address "+this.serverAddressString);let X=this.handlers.get(F);if(X===void 0)return qo("No handler registered for method "+F+". Sending UNIMPLEMENTED status."),null;return X}_respondWithError(F,X,J=null){var Q,G;let q=Object.assign({"grpc-status":(Q=F.code)!==null&&Q!==void 0?Q:p6.Status.INTERNAL,"grpc-message":F.details,[g8.constants.HTTP2_HEADER_STATUS]:g8.constants.HTTP_STATUS_OK,[g8.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(G=F.metadata)===null||G===void 0?void 0:G.toHttp2Headers());X.respond(q,{endStream:!0}),this.callTracker.addCallFailed(),J===null||J===void 0||J.streamTracker.addCallFailed()}_channelzHandler(F,X,J){this.onStreamOpened(X);let Q=this.sessions.get(X.session);if(this.callTracker.addCallStarted(),Q===null||Q===void 0||Q.streamTracker.addCallStarted(),!this._verifyContentType(X,J)){this.callTracker.addCallFailed(),Q===null||Q===void 0||Q.streamTracker.addCallFailed();return}let G=J[Ho],q=this._retrieveHandler(G);if(!q){this._respondWithError(xA(G),X,Q);return}let K={addMessageSent:()=>{if(Q)Q.messagesSent+=1,Q.lastMessageSentTimestamp=new Date},addMessageReceived:()=>{if(Q)Q.messagesReceived+=1,Q.lastMessageReceivedTimestamp=new Date},onCallEnd:(B)=>{if(B.code===p6.Status.OK)this.callTracker.addCallSucceeded();else this.callTracker.addCallFailed()},onStreamEnd:(B)=>{if(Q)if(B)Q.streamTracker.addCallSucceeded();else Q.streamTracker.addCallFailed()}},V=(0,Go.getServerInterceptingCall)([...F,...this.interceptors],X,J,K,q,this.options);if(!this._runHandlerForCall(V,q))this.callTracker.addCallFailed(),Q===null||Q===void 0||Q.streamTracker.addCallFailed(),V.sendStatus({code:p6.Status.INTERNAL,details:`Unknown handler type: ${q.type}`})}_streamHandler(F,X,J){if(this.onStreamOpened(X),this._verifyContentType(X,J)!==!0)return;let Q=J[Ho],G=this._retrieveHandler(Q);if(!G){this._respondWithError(xA(Q),X,null);return}let q=(0,Go.getServerInterceptingCall)([...F,...this.interceptors],X,J,null,G,this.options);if(!this._runHandlerForCall(q,G))q.sendStatus({code:p6.Status.INTERNAL,details:`Unknown handler type: ${G.type}`})}_runHandlerForCall(F,X){let{type:J}=X;if(J==="unary")If0(F,X);else if(J==="clientStream")$f0(F,X);else if(J==="serverStream")Cf0(F,X);else if(J==="bidi")Ef0(F,X);else return!1;return!0}_setupHandlers(F,X){if(F===null)return;let J=F.address(),Q="null";if(J)if(typeof J==="string")Q=J;else Q=J.address+":"+J.port;this.serverAddressString=Q;let G=this.channelzEnabled?this._channelzHandler:this._streamHandler,q=this.channelzEnabled?this._channelzSessionHandler(F):this._sessionHandler(F);F.on("stream",G.bind(this,X)),F.on("session",q)}_sessionHandler(F){return(X)=>{var J,Q;(J=this.http2Servers.get(F))===null||J===void 0||J.sessions.add(X);let G=null,q=null,K=null,V=!1,B=this.enableIdleTimeout(X);if(this.maxConnectionAgeMs!==eY){let N=this.maxConnectionAgeMs/10,O=Math.random()*N*2-N;G=setTimeout(()=>{var T,C;V=!0,this.trace("Connection dropped by max connection age: "+((T=X.socket)===null||T===void 0?void 0:T.remoteAddress));try{X.goaway(g8.constants.NGHTTP2_NO_ERROR,2147483647,Vo)}catch(R){X.destroy();return}if(X.close(),this.maxConnectionAgeGraceMs!==eY)q=setTimeout(()=>{X.destroy()},this.maxConnectionAgeGraceMs),(C=q.unref)===null||C===void 0||C.call(q)},this.maxConnectionAgeMs+O),(Q=G.unref)===null||Q===void 0||Q.call(G)}let I=()=>{if(K)clearTimeout(K),K=null},M=()=>{return!X.destroyed&&this.keepaliveTimeMs<_A&&this.keepaliveTimeMs>0},E,A=()=>{var N;if(!M())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),K=setTimeout(()=>{I(),E()},this.keepaliveTimeMs),(N=K.unref)===null||N===void 0||N.call(K)};E=()=>{var N;if(!M())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let O="";try{if(!X.ping((C,R,w)=>{if(I(),C)this.keepaliveTrace("Ping failed with error: "+C.message),V=!0,X.destroy();else this.keepaliveTrace("Received ping response"),A()}))O="Ping returned false"}catch(T){O=(T instanceof Error?T.message:"")||"Unknown error"}if(O){this.keepaliveTrace("Ping send failed: "+O),this.trace("Connection dropped due to ping send error: "+O),V=!0,X.destroy();return}K=setTimeout(()=>{I(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),V=!0,X.destroy()},this.keepaliveTimeoutMs),(N=K.unref)===null||N===void 0||N.call(K)},A(),X.on("close",()=>{var N,O;if(!V)this.trace(`Connection dropped by client ${(N=X.socket)===null||N===void 0?void 0:N.remoteAddress}`);if(G)clearTimeout(G);if(q)clearTimeout(q);if(I(),B!==null)clearTimeout(B.timeout),this.sessionIdleTimeouts.delete(X);(O=this.http2Servers.get(F))===null||O===void 0||O.sessions.delete(X)})}}_channelzSessionHandler(F){return(X)=>{var J,Q,G,q;let K=(0,Y8.registerChannelzSocket)((Q=(J=X.socket)===null||J===void 0?void 0:J.remoteAddress)!==null&&Q!==void 0?Q:"unknown",this.getChannelzSessionInfo.bind(this,X),this.channelzEnabled),V={ref:K,streamTracker:new Y8.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(G=this.http2Servers.get(F))===null||G===void 0||G.sessions.add(X),this.sessions.set(X,V);let B=`${X.socket.remoteAddress}:${X.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+B),this.trace("Connection established by client "+B),this.sessionChildrenTracker.refChild(K);let I=null,M=null,E=null,A=!1,N=this.enableIdleTimeout(X);if(this.maxConnectionAgeMs!==eY){let w=this.maxConnectionAgeMs/10,L=Math.random()*w*2-w;I=setTimeout(()=>{var k;A=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+B);try{X.goaway(g8.constants.NGHTTP2_NO_ERROR,2147483647,Vo)}catch(v){X.destroy();return}if(X.close(),this.maxConnectionAgeGraceMs!==eY)M=setTimeout(()=>{X.destroy()},this.maxConnectionAgeGraceMs),(k=M.unref)===null||k===void 0||k.call(M)},this.maxConnectionAgeMs+L),(q=I.unref)===null||q===void 0||q.call(I)}let O=()=>{if(E)clearTimeout(E),E=null},T=()=>{return!X.destroyed&&this.keepaliveTimeMs<_A&&this.keepaliveTimeMs>0},C,R=()=>{var w;if(!T())return;this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),E=setTimeout(()=>{O(),C()},this.keepaliveTimeMs),(w=E.unref)===null||w===void 0||w.call(E)};C=()=>{var w;if(!T())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let L="";try{if(!X.ping((v,f,h)=>{if(O(),v)this.keepaliveTrace("Ping failed with error: "+v.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+v.message+" return in "+f),A=!0,X.destroy();else this.keepaliveTrace("Received ping response"),R()}))L="Ping returned false"}catch(k){L=(k instanceof Error?k.message:"")||"Unknown error"}if(L){this.keepaliveTrace("Ping send failed: "+L),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+L),A=!0,X.destroy();return}V.keepAlivesSent+=1,E=setTimeout(()=>{O(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+B),A=!0,X.destroy()},this.keepaliveTimeoutMs),(w=E.unref)===null||w===void 0||w.call(E)},R(),X.on("close",()=>{var w;if(!A)this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+B);if(this.sessionChildrenTracker.unrefChild(K),(0,Y8.unregisterChannelzRef)(K),I)clearTimeout(I);if(M)clearTimeout(M);if(O(),N!==null)clearTimeout(N.timeout),this.sessionIdleTimeouts.delete(X);(w=this.http2Servers.get(F))===null||w===void 0||w.sessions.delete(X),this.sessions.delete(X)})}}enableIdleTimeout(F){var X,J;if(this.sessionIdleTimeout>=Fo)return null;let Q={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,F),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,F)};(J=(X=Q.timeout).unref)===null||J===void 0||J.call(X),this.sessionIdleTimeouts.set(F,Q);let{socket:G}=F;return this.trace("Enable idle timeout for "+G.remoteAddress+":"+G.remotePort),Q}onIdleTimeout(F,X){let{socket:J}=X,Q=F.sessionIdleTimeouts.get(X);if(Q!==void 0&&Q.activeStreams===0)if(Date.now()-Q.lastIdle>=F.sessionIdleTimeout)F.trace("Session idle timeout triggered for "+(J===null||J===void 0?void 0:J.remoteAddress)+":"+(J===null||J===void 0?void 0:J.remotePort)+" last idle at "+Q.lastIdle),F.closeSession(X);else Q.timeout.refresh()}onStreamOpened(F){let X=F.session,J=this.sessionIdleTimeouts.get(X);if(J)J.activeStreams+=1,F.once("close",J.onClose)}onStreamClose(F){var X,J;let Q=this.sessionIdleTimeouts.get(F);if(Q){if(Q.activeStreams-=1,Q.activeStreams===0)Q.lastIdle=Date.now(),Q.timeout.refresh(),this.trace("Session onStreamClose"+((X=F.socket)===null||X===void 0?void 0:X.remoteAddress)+":"+((J=F.socket)===null||J===void 0?void 0:J.remotePort)+" at "+Q.lastIdle)}}},(()=>{let H=typeof Symbol==="function"&&Symbol.metadata?Object.create(null):void 0;if(W=[Of0("Calling start() is no longer necessary. It can be safely omitted.")],zf0(Y,null,W,{kind:"method",name:"start",static:!1,private:!1,access:{has:(F)=>("start"in F),get:(F)=>F.start},metadata:H},null,Z),H)Object.defineProperty(Y,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:H})})(),Y})();$5.Server=Tf0;async function If0(Y,Z){let W;function H(J,Q,G,q){if(J){Y.sendStatus((0,ZZ.serverErrorToStatus)(J,G));return}Y.sendMessage(Q,()=>{Y.sendStatus({code:p6.Status.OK,details:"OK",metadata:G!==null&&G!==void 0?G:null})})}let F,X=null;Y.start({onReceiveMetadata(J){F=J,Y.startRead()},onReceiveMessage(J){if(X){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${Z.path}`,metadata:null});return}X=J,Y.startRead()},onReceiveHalfClose(){if(!X){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${Z.path}`,metadata:null});return}W=new ZZ.ServerWritableStreamImpl(Z.path,Y,F,X);try{Z.func(W,H)}catch(J){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${J.message}`,metadata:null})}},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled")}})}function $f0(Y,Z){let W;function H(F,X,J,Q){if(F){Y.sendStatus((0,ZZ.serverErrorToStatus)(F,J));return}Y.sendMessage(X,()=>{Y.sendStatus({code:p6.Status.OK,details:"OK",metadata:J!==null&&J!==void 0?J:null})})}Y.start({onReceiveMetadata(F){W=new ZZ.ServerDuplexStreamImpl(Z.path,Y,F);try{Z.func(W,H)}catch(X){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${X.message}`,metadata:null})}},onReceiveMessage(F){W.push(F)},onReceiveHalfClose(){W.push(null)},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled"),W.destroy()}})}function Cf0(Y,Z){let W,H,F=null;Y.start({onReceiveMetadata(X){H=X,Y.startRead()},onReceiveMessage(X){if(F){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${Z.path}`,metadata:null});return}F=X,Y.startRead()},onReceiveHalfClose(){if(!F){Y.sendStatus({code:p6.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${Z.path}`,metadata:null});return}W=new ZZ.ServerWritableStreamImpl(Z.path,Y,H,F);try{Z.func(W)}catch(X){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${X.message}`,metadata:null})}},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled"),W.destroy()}})}function Ef0(Y,Z){let W;Y.start({onReceiveMetadata(H){W=new ZZ.ServerDuplexStreamImpl(Z.path,Y,H);try{Z.func(W)}catch(F){Y.sendStatus({code:p6.Status.UNKNOWN,details:`Server method handler threw error ${F.message}`,metadata:null})}},onReceiveMessage(H){W.push(H)},onReceiveHalfClose(){W.push(null)},onCancel(){if(W)W.cancelled=!0,W.emit("cancelled","cancelled"),W.destroy()}})}});var No=H0((Ao)=>{Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StatusBuilder=void 0;class Bo{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(Y){return this.code=Y,this}withDetails(Y){return this.details=Y,this}withMetadata(Y){return this.metadata=Y,this}build(){let Y={};if(this.code!==null)Y.code=this.code;if(this.details!==null)Y.details=this.details;if(this.metadata!==null)Y.metadata=this.metadata;return Y}}Ao.StatusBuilder=Bo});var OX=H0((Mo)=>{Object.defineProperty(Mo,"__esModule",{value:!0});Mo.LeafLoadBalancer=Mo.PickFirstLoadBalancer=Mo.PickFirstLoadBalancingConfig=void 0;Mo.shuffled=$o;Mo.setup=kf0;var bA=V5(),i6=k8(),C5=E4(),Oo=u8(),Mf0=M6(),Rf0=a1(),Do=u8(),To=V1("net"),Pf0=U7(),Lf0="pick_first";function UX(Y){Mf0.trace(Rf0.LogVerbosity.DEBUG,Lf0,Y)}var NX="pick_first",wf0=250;class QZ{constructor(Y){this.shuffleAddressList=Y}getLoadBalancerName(){return NX}toJsonObject(){return{[NX]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(Y){if("shuffleAddressList"in Y&&typeof Y.shuffleAddressList!=="boolean")throw Error("pick_first config field shuffleAddressList must be a boolean if provided");return new QZ(Y.shuffleAddressList===!0)}}Mo.PickFirstLoadBalancingConfig=QZ;class Io{constructor(Y){this.subchannel=Y}pick(Y){return{pickResultType:C5.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}}function $o(Y){let Z=Y.slice();for(let W=Z.length-1;W>1;W--){let H=Math.floor(Math.random()*(W+1)),F=Z[W];Z[W]=Z[H],Z[H]=F}return Z}function Sf0(Y){if(Y.length===0)return[];let Z=[],W=[],H=[],F=(0,Do.isTcpSubchannelAddress)(Y[0])&&(0,To.isIPv6)(Y[0].host);for(let Q of Y)if((0,Do.isTcpSubchannelAddress)(Q)&&(0,To.isIPv6)(Q.host))W.push(Q);else H.push(Q);let X=F?W:H,J=F?H:W;for(let Q=0;Q<Math.max(X.length,J.length);Q++){if(Q<X.length)Z.push(X[Q]);if(Q<J.length)Z.push(J[Q])}return Z}var Co="grpc-node.internal.pick-first.report_health_status";class zK{constructor(Y){this.channelControlHelper=Y,this.children=[],this.currentState=i6.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(Z,W,H,F,X)=>{this.onSubchannelStateUpdate(Z,W,H,X)},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((Y)=>Y.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every((Y)=>Y.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var Y;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let Z=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker({details:Z}),Z)}else this.updateState(i6.ConnectivityState.READY,new Io(this.currentPick),null);else if(((Y=this.latestAddressList)===null||Y===void 0?void 0:Y.length)===0){let Z=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker({details:Z}),Z)}else if(this.children.length===0)this.updateState(i6.ConnectivityState.IDLE,new C5.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let Z=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker({details:Z}),Z)}else this.updateState(i6.ConnectivityState.CONNECTING,new C5.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(!this.allChildrenHaveReportedTF())return;if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:Y}of this.children)Y.startConnecting();this.calculateAndReportNewState()}removeCurrentPick(){if(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(Y,Z,W,H){var F;if((F=this.currentPick)===null||F===void 0?void 0:F.realSubchannelEquals(Y)){if(W!==i6.ConnectivityState.READY)this.removeCurrentPick(),this.calculateAndReportNewState();return}for(let[X,J]of this.children.entries())if(Y.realSubchannelEquals(J.subchannel)){if(W===i6.ConnectivityState.READY)this.pickSubchannel(J.subchannel);if(W===i6.ConnectivityState.TRANSIENT_FAILURE){if(J.hasReportedTransientFailure=!0,H)this.lastError=H;if(this.maybeEnterStickyTransientFailureMode(),X===this.currentSubchannelIndex)this.startNextSubchannelConnecting(X+1)}J.subchannel.startConnecting();return}}startNextSubchannelConnecting(Y){clearTimeout(this.connectionDelayTimeout);for(let[Z,W]of this.children.entries())if(Z>=Y){let H=W.subchannel.getConnectivityState();if(H===i6.ConnectivityState.IDLE||H===i6.ConnectivityState.CONNECTING){this.startConnecting(Z);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(Y){var Z,W;if(clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=Y,this.children[Y].subchannel.getConnectivityState()===i6.ConnectivityState.IDLE)UX("Start connecting to subchannel with address "+this.children[Y].subchannel.getAddress()),process.nextTick(()=>{var H;(H=this.children[Y])===null||H===void 0||H.subchannel.startConnecting()});this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(Y+1)},wf0),(W=(Z=this.connectionDelayTimeout).unref)===null||W===void 0||W.call(Z)}pickSubchannel(Y){UX("Pick subchannel with address "+Y.getAddress()),this.stickyTransientFailureMode=!1,Y.ref(),this.channelControlHelper.addChannelzChild(Y.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),Y.addConnectivityStateListener(this.subchannelStateListener),Y.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=Y,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(Y,Z,W){UX(i6.ConnectivityState[this.currentState]+" -> "+i6.ConnectivityState[Y]),this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}resetSubchannelList(){for(let Y of this.children)Y.subchannel.removeConnectivityStateListener(this.subchannelStateListener),Y.subchannel.unref(),this.channelControlHelper.removeChannelzChild(Y.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(Y,Z){UX("connectToAddressList(["+Y.map((H)=>(0,Oo.subchannelAddressToString)(H))+"])");let W=Y.map((H)=>({subchannel:this.channelControlHelper.createSubchannel(H,Z),hasReportedTransientFailure:!1}));for(let{subchannel:H}of W)if(H.getConnectivityState()===i6.ConnectivityState.READY){this.pickSubchannel(H);return}for(let{subchannel:H}of W)H.ref(),this.channelControlHelper.addChannelzChild(H.getChannelzRef());this.resetSubchannelList(),this.children=W;for(let{subchannel:H}of this.children)H.addConnectivityStateListener(this.subchannelStateListener);for(let H of this.children)if(H.subchannel.getConnectivityState()===i6.ConnectivityState.TRANSIENT_FAILURE)H.hasReportedTransientFailure=!0;this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(Y,Z,W,H){if(!(Z instanceof QZ))return!1;if(!Y.ok){if(this.children.length===0&&this.currentPick===null)this.channelControlHelper.updateState(i6.ConnectivityState.TRANSIENT_FAILURE,new C5.UnavailablePicker(Y.error),Y.error.details);return!0}let F=Y.value;if(this.reportHealthStatus=W[Co],Z.getShuffleAddressList())F=$o(F);let X=[].concat(...F.map((Q)=>Q.addresses));UX("updateAddressList(["+X.map((Q)=>(0,Oo.subchannelAddressToString)(Q))+"])");let J=Sf0(X);if(this.latestAddressList=J,this.latestOptions=W,this.connectToAddressList(J,W),this.latestResolutionNote=H,X.length>0)return!0;else return this.lastError="No addresses resolved",!1}exitIdle(){if(this.currentState===i6.ConnectivityState.IDLE&&this.latestAddressList)this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return NX}}Mo.PickFirstLoadBalancer=zK;var ff0=new QZ(!1);class Eo{constructor(Y,Z,W,H){this.endpoint=Y,this.options=W,this.resolutionNote=H,this.latestState=i6.ConnectivityState.IDLE;let F=(0,bA.createChildChannelControlHelper)(Z,{updateState:(X,J,Q)=>{this.latestState=X,this.latestPicker=J,Z.updateState(X,J,Q)}});this.pickFirstBalancer=new zK(F),this.latestPicker=new C5.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,Pf0.statusOrFromValue)([this.endpoint]),ff0,Object.assign(Object.assign({},this.options),{[Co]:!0}),this.resolutionNote)}updateEndpoint(Y,Z){if(this.options=Z,this.endpoint=Y,this.latestState!==i6.ConnectivityState.IDLE)this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}}Mo.LeafLoadBalancer=Eo;function kf0(){(0,bA.registerLoadBalancerType)(NX,zK,QZ),(0,bA.registerDefaultLoadBalancerType)(NX)}});var So=H0((Lo)=>{Object.defineProperty(Lo,"__esModule",{value:!0});Lo.FileWatcherCertificateProvider=void 0;var _f0=V1("fs"),xf0=M6(),bf0=a1(),uf0=V1("util"),mf0="certificate_provider";function BK(Y){xf0.trace(bf0.LogVerbosity.DEBUG,mf0,Y)}var uA=(0,uf0.promisify)(_f0.readFile);class Po{constructor(Y){if(this.config=Y,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,Y.certificateFile===void 0!==(Y.privateKeyFile===void 0))throw Error("certificateFile and privateKeyFile must be set or unset together");if(Y.certificateFile===void 0&&Y.caCertificateFile===void 0)throw Error("At least one of certificateFile and caCertificateFile must be set");BK("File watcher constructed with config "+JSON.stringify(Y))}updateCertificates(){if(this.fileResultPromise)return;this.fileResultPromise=Promise.allSettled([this.config.certificateFile?uA(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?uA(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?uA(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([Y,Z,W])=>{if(!this.refreshTimer)return;if(BK("File watcher read certificates certificate "+Y.status+", privateKey "+Z.status+", CA certificate "+W.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,Y.status==="fulfilled"&&Z.status==="fulfilled")this.latestIdentityUpdate={certificate:Y.value,privateKey:Z.value};else this.latestIdentityUpdate=null;if(W.status==="fulfilled")this.latestCaUpdate={caCertificate:W.value};else this.latestCaUpdate=null;for(let H of this.identityListeners)H(this.latestIdentityUpdate);for(let H of this.caListeners)H(this.latestCaUpdate)}),BK("File watcher initiated certificate update")}maybeStartWatchingFiles(){if(!this.refreshTimer){let Y=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;if(Y>this.config.refreshIntervalMs)this.updateCertificates();if(Y>this.config.refreshIntervalMs*2)this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0;this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),BK("File watcher started watching")}}maybeStopWatchingFiles(){if(this.caListeners.size===0&&this.identityListeners.size===0){if(this.fileResultPromise=null,this.refreshTimer)clearInterval(this.refreshTimer),this.refreshTimer=null}}addCaCertificateListener(Y){if(this.caListeners.add(Y),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0)process.nextTick(Y,this.latestCaUpdate)}removeCaCertificateListener(Y){this.caListeners.delete(Y),this.maybeStopWatchingFiles()}addIdentityCertificateListener(Y){if(this.identityListeners.add(Y),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0)process.nextTick(Y,this.latestIdentityUpdate)}removeIdentityCertificateListener(Y){this.identityListeners.delete(Y),this.maybeStopWatchingFiles()}}Lo.FileWatcherCertificateProvider=Po});var dA=H0((Y6)=>{Object.defineProperty(Y6,"__esModule",{value:!0});Y6.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=Y6.createCertificateProviderChannelCredentials=Y6.FileWatcherCertificateProvider=Y6.createCertificateProviderServerCredentials=Y6.createServerCredentialsWithInterceptors=Y6.BaseSubchannelWrapper=Y6.registerAdminService=Y6.FilterStackFactory=Y6.BaseFilter=Y6.statusOrFromError=Y6.statusOrFromValue=Y6.PickResultType=Y6.QueuePicker=Y6.UnavailablePicker=Y6.ChildLoadBalancerHandler=Y6.EndpointMap=Y6.endpointHasAddress=Y6.endpointToString=Y6.subchannelAddressToString=Y6.LeafLoadBalancer=Y6.isLoadBalancerNameRegistered=Y6.parseLoadBalancingConfig=Y6.selectLbConfigFromList=Y6.registerLoadBalancerType=Y6.createChildChannelControlHelper=Y6.BackoffTimeout=Y6.parseDuration=Y6.durationToMs=Y6.splitHostPort=Y6.uriToString=Y6.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=Y6.createResolver=Y6.registerResolver=Y6.log=Y6.trace=void 0;var fo=M6();Object.defineProperty(Y6,"trace",{enumerable:!0,get:function(){return fo.trace}});Object.defineProperty(Y6,"log",{enumerable:!0,get:function(){return fo.log}});var mA=S9();Object.defineProperty(Y6,"registerResolver",{enumerable:!0,get:function(){return mA.registerResolver}});Object.defineProperty(Y6,"createResolver",{enumerable:!0,get:function(){return mA.createResolver}});Object.defineProperty(Y6,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return mA.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var ko=f8();Object.defineProperty(Y6,"uriToString",{enumerable:!0,get:function(){return ko.uriToString}});Object.defineProperty(Y6,"splitHostPort",{enumerable:!0,get:function(){return ko.splitHostPort}});var yo=AX();Object.defineProperty(Y6,"durationToMs",{enumerable:!0,get:function(){return yo.durationToMs}});Object.defineProperty(Y6,"parseDuration",{enumerable:!0,get:function(){return yo.parseDuration}});var gf0=yY();Object.defineProperty(Y6,"BackoffTimeout",{enumerable:!0,get:function(){return gf0.BackoffTimeout}});var DX=V5();Object.defineProperty(Y6,"createChildChannelControlHelper",{enumerable:!0,get:function(){return DX.createChildChannelControlHelper}});Object.defineProperty(Y6,"registerLoadBalancerType",{enumerable:!0,get:function(){return DX.registerLoadBalancerType}});Object.defineProperty(Y6,"selectLbConfigFromList",{enumerable:!0,get:function(){return DX.selectLbConfigFromList}});Object.defineProperty(Y6,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return DX.parseLoadBalancingConfig}});Object.defineProperty(Y6,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return DX.isLoadBalancerNameRegistered}});var df0=OX();Object.defineProperty(Y6,"LeafLoadBalancer",{enumerable:!0,get:function(){return df0.LeafLoadBalancer}});var AK=u8();Object.defineProperty(Y6,"subchannelAddressToString",{enumerable:!0,get:function(){return AK.subchannelAddressToString}});Object.defineProperty(Y6,"endpointToString",{enumerable:!0,get:function(){return AK.endpointToString}});Object.defineProperty(Y6,"endpointHasAddress",{enumerable:!0,get:function(){return AK.endpointHasAddress}});Object.defineProperty(Y6,"EndpointMap",{enumerable:!0,get:function(){return AK.EndpointMap}});var cf0=z3();Object.defineProperty(Y6,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return cf0.ChildLoadBalancerHandler}});var gA=E4();Object.defineProperty(Y6,"UnavailablePicker",{enumerable:!0,get:function(){return gA.UnavailablePicker}});Object.defineProperty(Y6,"QueuePicker",{enumerable:!0,get:function(){return gA.QueuePicker}});Object.defineProperty(Y6,"PickResultType",{enumerable:!0,get:function(){return gA.PickResultType}});var vo=U7();Object.defineProperty(Y6,"statusOrFromValue",{enumerable:!0,get:function(){return vo.statusOrFromValue}});Object.defineProperty(Y6,"statusOrFromError",{enumerable:!0,get:function(){return vo.statusOrFromError}});var lf0=YA();Object.defineProperty(Y6,"BaseFilter",{enumerable:!0,get:function(){return lf0.BaseFilter}});var nf0=i3();Object.defineProperty(Y6,"FilterStackFactory",{enumerable:!0,get:function(){return nf0.FilterStackFactory}});var pf0=A3();Object.defineProperty(Y6,"registerAdminService",{enumerable:!0,get:function(){return pf0.registerAdminService}});var if0=zX();Object.defineProperty(Y6,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return if0.BaseSubchannelWrapper}});var ho=KK();Object.defineProperty(Y6,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return ho.createServerCredentialsWithInterceptors}});Object.defineProperty(Y6,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return ho.createCertificateProviderServerCredentials}});var rf0=So();Object.defineProperty(Y6,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return rf0.FileWatcherCertificateProvider}});var af0=kY();Object.defineProperty(Y6,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return af0.createCertificateProviderChannelCredentials}});var of0=$A();Object.defineProperty(Y6,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return of0.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var xo=H0((_o)=>{Object.defineProperty(_o,"__esModule",{value:!0});_o.setup=Yk0;var sf0=S9(),ef0=U7();class jo{constructor(Y,Z,W){this.listener=Z,this.hasReturnedResult=!1,this.endpoints=[];let H;if(Y.authority==="")H="/"+Y.path;else H=Y.path;this.endpoints=[{addresses:[{path:H}]}]}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(this.listener,(0,ef0.statusOrFromValue)(this.endpoints),{},null,"")}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(Y){return"localhost"}}function Yk0(){(0,sf0.registerResolver)("unix",jo)}});var no=H0((lo)=>{Object.defineProperty(lo,"__esModule",{value:!0});lo.setup=Kk0;var bo=V1("net"),uo=U7(),UK=a1(),cA=K8(),mo=S9(),Qk0=u8(),go=f8(),Xk0=M6(),Jk0="ip_resolver";function co(Y){Xk0.trace(UK.LogVerbosity.DEBUG,Jk0,Y)}var lA="ipv4",nA="ipv6",Wk0=443;class pA{constructor(Y,Z,W){var H;this.listener=Z,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,co("Resolver constructed for target "+(0,go.uriToString)(Y));let F=[];if(!(Y.scheme===lA||Y.scheme===nA)){this.error={code:UK.Status.UNAVAILABLE,details:`Unrecognized scheme ${Y.scheme} in IP resolver`,metadata:new cA.Metadata};return}let X=Y.path.split(",");for(let J of X){let Q=(0,go.splitHostPort)(J);if(Q===null){this.error={code:UK.Status.UNAVAILABLE,details:`Failed to parse ${Y.scheme} address ${J}`,metadata:new cA.Metadata};return}if(Y.scheme===lA&&!(0,bo.isIPv4)(Q.host)||Y.scheme===nA&&!(0,bo.isIPv6)(Q.host)){this.error={code:UK.Status.UNAVAILABLE,details:`Failed to parse ${Y.scheme} address ${J}`,metadata:new cA.Metadata};return}F.push({host:Q.host,port:(H=Q.port)!==null&&H!==void 0?H:Wk0})}this.endpoints=F.map((J)=>({addresses:[J]})),co("Parsed "+Y.scheme+" address list "+F.map(Qk0.subchannelAddressToString))}updateResolution(){if(!this.hasReturnedResult)this.hasReturnedResult=!0,process.nextTick(()=>{if(this.error)this.listener((0,uo.statusOrFromError)(this.error),{},null,"");else this.listener((0,uo.statusOrFromValue)(this.endpoints),{},null,"")})}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(Y){return Y.path.split(",")[0]}}function Kk0(){(0,mo.registerResolver)(lA,pA),(0,mo.registerResolver)(nA,pA)}});var so=H0((oo)=>{Object.defineProperty(oo,"__esModule",{value:!0});oo.RoundRobinLoadBalancer=void 0;oo.setup=Bk0;var ro=V5(),$8=k8(),TX=E4(),Fk0=M6(),Hk0=a1(),po=u8(),Vk0=OX(),qk0="round_robin";function io(Y){Fk0.trace(Hk0.LogVerbosity.DEBUG,qk0,Y)}var NK="round_robin";class OK{getLoadBalancerName(){return NK}constructor(){}toJsonObject(){return{[NK]:{}}}static createFromJson(Y){return new OK}}class ao{constructor(Y,Z=0){this.children=Y,this.nextIndex=Z}pick(Y){let Z=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,Z.pick(Y)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}}function zk0(Y,Z){return[...Y.slice(Z),...Y.slice(0,Z)]}class iA{constructor(Y){this.channelControlHelper=Y,this.children=[],this.currentState=$8.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,ro.createChildChannelControlHelper)(Y,{updateState:(Z,W,H)=>{if(this.currentState===$8.ConnectivityState.READY&&Z!==$8.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(H)this.lastError=H;this.calculateAndUpdateState()}})}countChildrenWithState(Y){return this.children.filter((Z)=>Z.getConnectivityState()===Y).length}calculateAndUpdateState(){if(this.updatesPaused)return;if(this.countChildrenWithState($8.ConnectivityState.READY)>0){let Y=this.children.filter((W)=>W.getConnectivityState()===$8.ConnectivityState.READY),Z=0;if(this.currentReadyPicker!==null){let W=this.currentReadyPicker.peekNextEndpoint();if(Z=Y.findIndex((H)=>(0,po.endpointEqual)(H.getEndpoint(),W)),Z<0)Z=0}this.updateState($8.ConnectivityState.READY,new ao(Y.map((W)=>({endpoint:W.getEndpoint(),picker:W.getPicker()})),Z),null)}else if(this.countChildrenWithState($8.ConnectivityState.CONNECTING)>0)this.updateState($8.ConnectivityState.CONNECTING,new TX.QueuePicker(this),null);else if(this.countChildrenWithState($8.ConnectivityState.TRANSIENT_FAILURE)>0){let Y=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState($8.ConnectivityState.TRANSIENT_FAILURE,new TX.UnavailablePicker({details:Y}),Y)}else this.updateState($8.ConnectivityState.IDLE,new TX.QueuePicker(this),null);for(let Y of this.children)if(Y.getConnectivityState()===$8.ConnectivityState.IDLE)Y.exitIdle()}updateState(Y,Z,W){if(io($8.ConnectivityState[this.currentState]+" -> "+$8.ConnectivityState[Y]),Y===$8.ConnectivityState.READY)this.currentReadyPicker=Z;else this.currentReadyPicker=null;this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}resetSubchannelList(){for(let Y of this.children)Y.destroy();this.children=[]}updateAddressList(Y,Z,W,H){if(!(Z instanceof OK))return!1;if(!Y.ok){if(this.children.length===0)this.updateState($8.ConnectivityState.TRANSIENT_FAILURE,new TX.UnavailablePicker(Y.error),Y.error.details);return!0}let F=Math.random()*Y.value.length|0,X=zk0(Y.value,F);if(this.resetSubchannelList(),X.length===0){let J=`No addresses resolved. Resolution note: ${H}`;this.updateState($8.ConnectivityState.TRANSIENT_FAILURE,new TX.UnavailablePicker({details:J}),J)}io("Connect to endpoint list "+X.map(po.endpointToString)),this.updatesPaused=!0,this.children=X.map((J)=>new Vk0.LeafLoadBalancer(J,this.childChannelControlHelper,W,H));for(let J of this.children)J.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return NK}}oo.RoundRobinLoadBalancer=iA;function Bk0(){(0,ro.registerLoadBalancerType)(NK,iA,OK)}});var Kt=H0((Jt)=>{var rA;Object.defineProperty(Jt,"__esModule",{value:!0});Jt.OutlierDetectionLoadBalancer=Jt.OutlierDetectionLoadBalancingConfig=void 0;Jt.setup=Rk0;var Uk0=k8(),eo=a1(),P7=AX(),Yt=dA(),Nk0=V5(),Ok0=z3(),Dk0=E4(),aA=u8(),Tk0=zX(),Ik0=M6(),$k0="outlier_detection";function H8(Y){Ik0.trace(eo.LogVerbosity.DEBUG,$k0,Y)}var sA="outlier_detection",Ck0=((rA=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&rA!==void 0?rA:"true")==="true",Ek0={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},Mk0={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function XZ(Y,Z,W,H){if(Z in Y&&Y[Z]!==void 0&&typeof Y[Z]!==W){let F=H?`${H}.${Z}`:Z;throw Error(`outlier detection config ${F} parse error: expected ${W}, got ${typeof Y[Z]}`)}}function oA(Y,Z,W){let H=W?`${W}.${Z}`:Z;if(Z in Y&&Y[Z]!==void 0){if(!(0,P7.isDuration)(Y[Z]))throw Error(`outlier detection config ${H} parse error: expected Duration, got ${typeof Y[Z]}`);if(!(Y[Z].seconds>=0&&Y[Z].seconds<=315576000000&&Y[Z].nanos>=0&&Y[Z].nanos<=999999999))throw Error(`outlier detection config ${H} parse error: values out of range for non-negative Duaration`)}}function DK(Y,Z,W){let H=W?`${W}.${Z}`:Z;if(XZ(Y,Z,"number",W),Z in Y&&Y[Z]!==void 0&&!(Y[Z]>=0&&Y[Z]<=100))throw Error(`outlier detection config ${H} parse error: value out of range for percentage (0-100)`)}class IX{constructor(Y,Z,W,H,F,X,J){if(this.childPolicy=J,J.getLoadBalancerName()==="pick_first")throw Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=Y!==null&&Y!==void 0?Y:1e4,this.baseEjectionTimeMs=Z!==null&&Z!==void 0?Z:30000,this.maxEjectionTimeMs=W!==null&&W!==void 0?W:300000,this.maxEjectionPercent=H!==null&&H!==void 0?H:10,this.successRateEjection=F?Object.assign(Object.assign({},Ek0),F):null,this.failurePercentageEjection=X?Object.assign(Object.assign({},Mk0),X):null}getLoadBalancerName(){return sA}toJsonObject(){var Y,Z;return{outlier_detection:{interval:(0,P7.msToDuration)(this.intervalMs),base_ejection_time:(0,P7.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,P7.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(Y=this.successRateEjection)!==null&&Y!==void 0?Y:void 0,failure_percentage_ejection:(Z=this.failurePercentageEjection)!==null&&Z!==void 0?Z: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(Y){var Z;if(oA(Y,"interval"),oA(Y,"base_ejection_time"),oA(Y,"max_ejection_time"),DK(Y,"max_ejection_percent"),"success_rate_ejection"in Y&&Y.success_rate_ejection!==void 0){if(typeof Y.success_rate_ejection!=="object")throw Error("outlier detection config success_rate_ejection must be an object");XZ(Y.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),DK(Y.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),XZ(Y.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),XZ(Y.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in Y&&Y.failure_percentage_ejection!==void 0){if(typeof Y.failure_percentage_ejection!=="object")throw Error("outlier detection config failure_percentage_ejection must be an object");DK(Y.failure_percentage_ejection,"threshold","failure_percentage_ejection"),DK(Y.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),XZ(Y.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),XZ(Y.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in Y)||!Array.isArray(Y.child_policy))throw Error("outlier detection config child_policy must be an array");let W=(0,Nk0.selectLbConfigFromList)(Y.child_policy);if(!W)throw Error("outlier detection config child_policy: no valid recognized policy found");return new IX(Y.interval?(0,P7.durationToMs)(Y.interval):null,Y.base_ejection_time?(0,P7.durationToMs)(Y.base_ejection_time):null,Y.max_ejection_time?(0,P7.durationToMs)(Y.max_ejection_time):null,(Z=Y.max_ejection_percent)!==null&&Z!==void 0?Z:null,Y.success_rate_ejection,Y.failure_percentage_ejection,W)}}Jt.OutlierDetectionLoadBalancingConfig=IX;class Zt extends Tk0.BaseSubchannelWrapper{constructor(Y,Z){super(Y);this.mapEntry=Z,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0){if(this.mapEntry){let Y=this.mapEntry.subchannelWrappers.indexOf(this);if(Y>=0)this.mapEntry.subchannelWrappers.splice(Y,1)}}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}}function tA(){return{success:0,failure:0}}class Qt{constructor(){this.activeBucket=tA(),this.inactiveBucket=tA()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=tA()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}}class Xt{constructor(Y,Z){this.wrappedPicker=Y,this.countCalls=Z}pick(Y){let Z=this.wrappedPicker.pick(Y);if(Z.pickResultType===Dk0.PickResultType.COMPLETE){let W=Z.subchannel,H=W.getMapEntry();if(H){let F=Z.onCallEnded;if(this.countCalls)F=(X,J,Q)=>{var G;if(X===eo.Status.OK)H.counter.addSuccess();else H.counter.addFailure();(G=Z.onCallEnded)===null||G===void 0||G.call(Z,X,J,Q)};return Object.assign(Object.assign({},Z),{subchannel:W.getWrappedSubchannel(),onCallEnded:F})}else return Object.assign(Object.assign({},Z),{subchannel:W.getWrappedSubchannel()})}else return Z}}class eA{constructor(Y){this.entryMap=new aA.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new Ok0.ChildLoadBalancerHandler((0,Yt.createChildChannelControlHelper)(Y,{createSubchannel:(Z,W)=>{let H=Y.createSubchannel(Z,W),F=this.entryMap.getForSubchannelAddress(Z),X=new Zt(H,F);if((F===null||F===void 0?void 0:F.currentEjectionTimestamp)!==null)X.eject();return F===null||F===void 0||F.subchannelWrappers.push(X),X},updateState:(Z,W,H)=>{if(Z===Uk0.ConnectivityState.READY)Y.updateState(Z,new Xt(W,this.isCountingEnabled()),H);else Y.updateState(Z,W,H)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let Y=0;for(let Z of this.entryMap.values())if(Z.currentEjectionTimestamp!==null)Y+=1;return Y*100/this.entryMap.size}runSuccessRateCheck(Y){if(!this.latestConfig)return;let Z=this.latestConfig.getSuccessRateEjectionConfig();if(!Z)return;H8("Running success rate check");let W=Z.request_volume,H=0,F=[];for(let[K,V]of this.entryMap.entries()){let B=V.counter.getLastSuccesses(),I=V.counter.getLastFailures();if(H8("Stats for "+(0,aA.endpointToString)(K)+": successes="+B+" failures="+I+" targetRequestVolume="+W),B+I>=W)H+=1,F.push(B/(B+I))}if(H8("Found "+H+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+F+"]"),H<Z.minimum_hosts)return;let X=F.reduce((K,V)=>K+V)/F.length,J=0;for(let K of F){let V=K-X;J+=V*V}let Q=J/F.length,G=Math.sqrt(Q),q=X-G*(Z.stdev_factor/1000);H8("stdev="+G+" ejectionThreshold="+q);for(let[K,V]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let B=V.counter.getLastSuccesses(),I=V.counter.getLastFailures();if(B+I<W)continue;let M=B/(B+I);if(H8("Checking candidate "+K+" successRate="+M),M<q){let E=Math.random()*100;if(H8("Candidate "+K+" randomNumber="+E+" enforcement_percentage="+Z.enforcement_percentage),E<Z.enforcement_percentage)H8("Ejecting candidate "+K),this.eject(V,Y)}}}runFailurePercentageCheck(Y){if(!this.latestConfig)return;let Z=this.latestConfig.getFailurePercentageEjectionConfig();if(!Z)return;H8("Running failure percentage check. threshold="+Z.threshold+" request volume threshold="+Z.request_volume);let W=0;for(let H of this.entryMap.values()){let F=H.counter.getLastSuccesses(),X=H.counter.getLastFailures();if(F+X>=Z.request_volume)W+=1}if(W<Z.minimum_hosts)return;for(let[H,F]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let X=F.counter.getLastSuccesses(),J=F.counter.getLastFailures();if(H8("Candidate successes="+X+" failures="+J),X+J<Z.request_volume)continue;if(J*100/(J+X)>Z.threshold){let G=Math.random()*100;if(H8("Candidate "+H+" randomNumber="+G+" enforcement_percentage="+Z.enforcement_percentage),G<Z.enforcement_percentage)H8("Ejecting candidate "+H),this.eject(F,Y)}}}eject(Y,Z){Y.currentEjectionTimestamp=new Date,Y.ejectionTimeMultiplier+=1;for(let W of Y.subchannelWrappers)W.eject()}uneject(Y){Y.currentEjectionTimestamp=null;for(let Z of Y.subchannelWrappers)Z.uneject()}switchAllBuckets(){for(let Y of this.entryMap.values())Y.counter.switchBuckets()}startTimer(Y){var Z,W;this.ejectionTimer=setTimeout(()=>this.runChecks(),Y),(W=(Z=this.ejectionTimer).unref)===null||W===void 0||W.call(Z)}runChecks(){let Y=new Date;if(H8("Ejection timer running"),this.switchAllBuckets(),!this.latestConfig)return;this.timerStartTime=Y,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(Y),this.runFailurePercentageCheck(Y);for(let[Z,W]of this.entryMap.entries())if(W.currentEjectionTimestamp===null){if(W.ejectionTimeMultiplier>0)W.ejectionTimeMultiplier-=1}else{let H=this.latestConfig.getBaseEjectionTimeMs(),F=this.latestConfig.getMaxEjectionTimeMs(),X=new Date(W.currentEjectionTimestamp.getTime());if(X.setMilliseconds(X.getMilliseconds()+Math.min(H*W.ejectionTimeMultiplier,Math.max(H,F))),X<new Date)H8("Unejecting "+Z),this.uneject(W)}}updateAddressList(Y,Z,W,H){if(!(Z instanceof IX))return!1;if(H8("Received update with config: "+JSON.stringify(Z.toJsonObject(),void 0,2)),Y.ok){for(let X of Y.value)if(!this.entryMap.has(X))H8("Adding map entry for "+(0,aA.endpointToString)(X)),this.entryMap.set(X,{counter:new Qt,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]});this.entryMap.deleteMissing(Y.value)}let F=Z.getChildPolicy();if(this.childBalancer.updateAddressList(Y,F,W,H),Z.getSuccessRateEjectionConfig()||Z.getFailurePercentageEjectionConfig())if(this.timerStartTime){H8("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let X=Z.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(X)}else H8("Starting new timer"),this.timerStartTime=new Date,this.startTimer(Z.getIntervalMs()),this.switchAllBuckets();else{H8("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let X of this.entryMap.values())this.uneject(X),X.ejectionTimeMultiplier=0}return this.latestConfig=Z,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return sA}}Jt.OutlierDetectionLoadBalancer=eA;function Rk0(){if(Ck0)(0,Yt.registerLoadBalancerType)(sA,eA,IX)}});var Vt=H0((Ft)=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.PriorityQueue=void 0;var JZ=0,YU=(Y)=>Math.floor(Y/2),TK=(Y)=>Y*2+1,$X=(Y)=>Y*2+2;class Gt{constructor(Y=(Z,W)=>Z>W){this.comparator=Y,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[JZ]}push(...Y){return Y.forEach((Z)=>{this.heap.push(Z),this.siftUp()}),this.size()}pop(){let Y=this.peek(),Z=this.size()-1;if(Z>JZ)this.swap(JZ,Z);return this.heap.pop(),this.siftDown(),Y}replace(Y){let Z=this.peek();return this.heap[JZ]=Y,this.siftDown(),Z}greater(Y,Z){return this.comparator(this.heap[Y],this.heap[Z])}swap(Y,Z){[this.heap[Y],this.heap[Z]]=[this.heap[Z],this.heap[Y]]}siftUp(){let Y=this.size()-1;while(Y>JZ&&this.greater(Y,YU(Y)))this.swap(Y,YU(Y)),Y=YU(Y)}siftDown(){let Y=JZ;while(TK(Y)<this.size()&&this.greater(TK(Y),Y)||$X(Y)<this.size()&&this.greater($X(Y),Y)){let Z=$X(Y)<this.size()&&this.greater($X(Y),TK(Y))?$X(Y):TK(Y);this.swap(Y,Z),Y=Z}}}Ft.PriorityQueue=Gt});var Tt=H0((Ot)=>{Object.defineProperty(Ot,"__esModule",{value:!0});Ot.WeightedRoundRobinLoadBalancingConfig=void 0;Ot.setup=bk0;var V8=k8(),wk0=a1(),o8=AX(),Bt=V5(),Sk0=OX(),fk0=M6(),At=FK(),WZ=E4(),kk0=Vt(),qt=u8(),yk0="weighted_round_robin";function ZU(Y){fk0.trace(wk0.LogVerbosity.DEBUG,yk0,Y)}var QU="weighted_round_robin",vk0=1e4,hk0=1e4,jk0=180000,_k0=1000,xk0=1;function zt(Y,Z,W){if(Z in Y&&Y[Z]!==void 0&&typeof Y[Z]!==W)throw Error(`weighted round robin config ${Z} parse error: expected ${W}, got ${typeof Y[Z]}`)}function IK(Y,Z){if(Z in Y&&Y[Z]!==void 0&&Y[Z]!==null){let W;if((0,o8.isDuration)(Y[Z]))W=Y[Z];else if((0,o8.isDurationMessage)(Y[Z]))W=(0,o8.durationMessageToDuration)(Y[Z]);else if(typeof Y[Z]==="string"){let H=(0,o8.parseDuration)(Y[Z]);if(!H)throw Error(`weighted round robin config ${Z}: failed to parse duration string ${Y[Z]}`);W=H}else throw Error(`weighted round robin config ${Z}: expected duration, got ${typeof Y[Z]}`);return(0,o8.durationToMs)(W)}return null}class CX{constructor(Y,Z,W,H,F,X){this.enableOobLoadReport=Y!==null&&Y!==void 0?Y:!1,this.oobLoadReportingPeriodMs=Z!==null&&Z!==void 0?Z:vk0,this.blackoutPeriodMs=W!==null&&W!==void 0?W:hk0,this.weightExpirationPeriodMs=H!==null&&H!==void 0?H:jk0,this.weightUpdatePeriodMs=Math.max(F!==null&&F!==void 0?F:_k0,100),this.errorUtilizationPenalty=X!==null&&X!==void 0?X:xk0}getLoadBalancerName(){return QU}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,o8.durationToString)((0,o8.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,o8.durationToString)((0,o8.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,o8.durationToString)((0,o8.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,o8.durationToString)((0,o8.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(Y){if(zt(Y,"enable_oob_load_report","boolean"),zt(Y,"error_utilization_penalty","number"),Y.error_utilization_penalty<0)throw Error("weighted round robin config error_utilization_penalty < 0");return new CX(Y.enable_oob_load_report,IK(Y,"oob_load_reporting_period"),IK(Y,"blackout_period"),IK(Y,"weight_expiration_period"),IK(Y,"weight_update_period"),Y.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}}Ot.WeightedRoundRobinLoadBalancingConfig=CX;class Ut{constructor(Y,Z){this.metricsHandler=Z,this.queue=new kk0.PriorityQueue((F,X)=>F.deadline<X.deadline);let W=Y.filter((F)=>F.weight>0),H;if(W.length<2)H=1;else{let F=0;for(let{weight:X}of W)F+=X;H=F/W.length}for(let F of Y){let X=F.weight>0?1/F.weight:H;this.queue.push({endpointName:F.endpointName,picker:F.picker,period:X,deadline:Math.random()*X})}}pick(Y){let Z=this.queue.pop();this.queue.push(Object.assign(Object.assign({},Z),{deadline:Z.deadline+Z.period}));let W=Z.picker.pick(Y);if(W.pickResultType===WZ.PickResultType.COMPLETE)if(this.metricsHandler)return Object.assign(Object.assign({},W),{onCallEnded:(0,At.createMetricsReader)((H)=>this.metricsHandler(H,Z.endpointName),W.onCallEnded)});else{let H=W.subchannel;return Object.assign(Object.assign({},W),{subchannel:H.getWrappedSubchannel()})}else return W}}class Nt{constructor(Y){this.channelControlHelper=Y,this.latestConfig=null,this.children=new Map,this.currentState=V8.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(Y){let Z=0;for(let W of this.children.values())if(W.child.getConnectivityState()===Y)Z+=1;return Z}updateWeight(Y,Z){var W,H;let{rps_fractional:F,application_utilization:X}=Z;if(X>0&&F>0)X+=Z.eps/F*((H=(W=this.latestConfig)===null||W===void 0?void 0:W.getErrorUtilizationPenalty())!==null&&H!==void 0?H:0);let J=X===0?0:F/X;if(J===0)return;let Q=new Date;if(Y.nonEmptySince===null)Y.nonEmptySince=Q;Y.lastUpdated=Q,Y.weight=J}getWeight(Y){if(!this.latestConfig)return 0;let Z=new Date().getTime();if(Z-Y.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return Y.nonEmptySince=null,0;let W=this.latestConfig.getBlackoutPeriodMs();if(W>0&&(Y.nonEmptySince===null||Z-Y.nonEmptySince.getTime()<W))return 0;return Y.weight}calculateAndUpdateState(){if(this.updatesPaused||!this.latestConfig)return;if(this.countChildrenWithState(V8.ConnectivityState.READY)>0){let Y=[];for(let[W,H]of this.children){if(H.child.getConnectivityState()!==V8.ConnectivityState.READY)continue;Y.push({endpointName:W,picker:H.child.getPicker(),weight:this.getWeight(H)})}ZU("Created picker with weights: "+Y.map((W)=>W.endpointName+":"+W.weight).join(","));let Z;if(!this.latestConfig.getEnableOobLoadReport())Z=(W,H)=>{let F=this.children.get(H);if(F)this.updateWeight(F,W)};else Z=null;this.updateState(V8.ConnectivityState.READY,new Ut(Y,Z),null)}else if(this.countChildrenWithState(V8.ConnectivityState.CONNECTING)>0)this.updateState(V8.ConnectivityState.CONNECTING,new WZ.QueuePicker(this),null);else if(this.countChildrenWithState(V8.ConnectivityState.TRANSIENT_FAILURE)>0){let Y=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(V8.ConnectivityState.TRANSIENT_FAILURE,new WZ.UnavailablePicker({details:Y}),Y)}else this.updateState(V8.ConnectivityState.IDLE,new WZ.QueuePicker(this),null);for(let{child:Y}of this.children.values())if(Y.getConnectivityState()===V8.ConnectivityState.IDLE)Y.exitIdle()}updateState(Y,Z,W){ZU(V8.ConnectivityState[this.currentState]+" -> "+V8.ConnectivityState[Y]),this.currentState=Y,this.channelControlHelper.updateState(Y,Z,W)}updateAddressList(Y,Z,W,H){var F,X;if(!(Z instanceof CX))return!1;if(!Y.ok){if(this.children.size===0)this.updateState(V8.ConnectivityState.TRANSIENT_FAILURE,new WZ.UnavailablePicker(Y.error),Y.error.details);return!0}if(Y.value.length===0){let G=`No addresses resolved. Resolution note: ${H}`;return this.updateState(V8.ConnectivityState.TRANSIENT_FAILURE,new WZ.UnavailablePicker({details:G}),G),!1}ZU("Connect to endpoint list "+Y.value.map(qt.endpointToString));let J=new Date,Q=new Set;this.updatesPaused=!0,this.latestConfig=Z;for(let G of Y.value){let q=(0,qt.endpointToString)(G);Q.add(q);let K=this.children.get(q);if(!K)K={child:new Sk0.LeafLoadBalancer(G,(0,Bt.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(V,B,I)=>{if(this.currentState===V8.ConnectivityState.READY&&V!==V8.ConnectivityState.READY)this.channelControlHelper.requestReresolution();if(V===V8.ConnectivityState.READY)K.nonEmptySince=null;if(I)this.lastError=I;this.calculateAndUpdateState()},createSubchannel:(V,B)=>{let I=this.channelControlHelper.createSubchannel(V,B);if(K===null||K===void 0?void 0:K.oobMetricsListener)return new At.OrcaOobMetricsSubchannelWrapper(I,K.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs());else return I}}),W,H),lastUpdated:J,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(q,K);if(Z.getEnableOobLoadReport())K.oobMetricsListener=(V)=>{this.updateWeight(K,V)};else K.oobMetricsListener=null}for(let[G,q]of this.children)if(Q.has(G))q.child.startConnecting();else q.child.destroy(),this.children.delete(G);if(this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer);return this.weightUpdateTimer=(X=(F=setInterval(()=>{if(this.currentState===V8.ConnectivityState.READY)this.calculateAndUpdateState()},Z.getWeightUpdatePeriodMs())).unref)===null||X===void 0?void 0:X.call(F),!0}exitIdle(){}resetBackoff(){}destroy(){for(let Y of this.children.values())Y.child.destroy();if(this.children.clear(),this.weightUpdateTimer)clearInterval(this.weightUpdateTimer)}getTypeName(){return QU}}function bk0(){(0,Bt.registerLoadBalancerType)(QU,Nt,CX)}});var EX=H0((O6)=>{Object.defineProperty(O6,"__esModule",{value:!0});O6.experimental=O6.ServerMetricRecorder=O6.ServerInterceptingCall=O6.ResponderBuilder=O6.ServerListenerBuilder=O6.addAdminServicesToServer=O6.getChannelzHandlers=O6.getChannelzServiceDefinition=O6.InterceptorConfigurationError=O6.InterceptingCall=O6.RequesterBuilder=O6.ListenerBuilder=O6.StatusBuilder=O6.getClientChannel=O6.ServerCredentials=O6.Server=O6.setLogVerbosity=O6.setLogger=O6.load=O6.loadObject=O6.CallCredentials=O6.ChannelCredentials=O6.waitForClientReady=O6.closeClient=O6.Channel=O6.makeGenericClientConstructor=O6.makeClientConstructor=O6.loadPackageDefinition=O6.Client=O6.compressionAlgorithms=O6.propagate=O6.connectivityState=O6.status=O6.logVerbosity=O6.Metadata=O6.credentials=void 0;var $K=J3();Object.defineProperty(O6,"CallCredentials",{enumerable:!0,get:function(){return $K.CallCredentials}});var mk0=QB();Object.defineProperty(O6,"Channel",{enumerable:!0,get:function(){return mk0.ChannelImplementation}});var gk0=eB();Object.defineProperty(O6,"compressionAlgorithms",{enumerable:!0,get:function(){return gk0.CompressionAlgorithms}});var dk0=k8();Object.defineProperty(O6,"connectivityState",{enumerable:!0,get:function(){return dk0.ConnectivityState}});var CK=kY();Object.defineProperty(O6,"ChannelCredentials",{enumerable:!0,get:function(){return CK.ChannelCredentials}});var It=ZB();Object.defineProperty(O6,"Client",{enumerable:!0,get:function(){return It.Client}});var XU=a1();Object.defineProperty(O6,"logVerbosity",{enumerable:!0,get:function(){return XU.LogVerbosity}});Object.defineProperty(O6,"status",{enumerable:!0,get:function(){return XU.Status}});Object.defineProperty(O6,"propagate",{enumerable:!0,get:function(){return XU.Propagate}});var $t=M6(),JU=N3();Object.defineProperty(O6,"loadPackageDefinition",{enumerable:!0,get:function(){return JU.loadPackageDefinition}});Object.defineProperty(O6,"makeClientConstructor",{enumerable:!0,get:function(){return JU.makeClientConstructor}});Object.defineProperty(O6,"makeGenericClientConstructor",{enumerable:!0,get:function(){return JU.makeClientConstructor}});var ck0=K8();Object.defineProperty(O6,"Metadata",{enumerable:!0,get:function(){return ck0.Metadata}});var lk0=zo();Object.defineProperty(O6,"Server",{enumerable:!0,get:function(){return lk0.Server}});var nk0=KK();Object.defineProperty(O6,"ServerCredentials",{enumerable:!0,get:function(){return nk0.ServerCredentials}});var pk0=No();Object.defineProperty(O6,"StatusBuilder",{enumerable:!0,get:function(){return pk0.StatusBuilder}});O6.credentials={combineChannelCredentials:(Y,...Z)=>{return Z.reduce((W,H)=>W.compose(H),Y)},combineCallCredentials:(Y,...Z)=>{return Z.reduce((W,H)=>W.compose(H),Y)},createInsecure:CK.ChannelCredentials.createInsecure,createSsl:CK.ChannelCredentials.createSsl,createFromSecureContext:CK.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:$K.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:$K.CallCredentials.createFromGoogleCredential,createEmpty:$K.CallCredentials.createEmpty};var ik0=(Y)=>Y.close();O6.closeClient=ik0;var rk0=(Y,Z,W)=>Y.waitForReady(Z,W);O6.waitForClientReady=rk0;var ak0=(Y,Z)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};O6.loadObject=ak0;var ok0=(Y,Z,W)=>{throw Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};O6.load=ok0;var tk0=(Y)=>{$t.setLogger(Y)};O6.setLogger=tk0;var sk0=(Y)=>{$t.setLoggerVerbosity(Y)};O6.setLogVerbosity=sk0;var ek0=(Y)=>{return It.Client.prototype.getChannel.call(Y)};O6.getClientChannel=ek0;var EK=ez();Object.defineProperty(O6,"ListenerBuilder",{enumerable:!0,get:function(){return EK.ListenerBuilder}});Object.defineProperty(O6,"RequesterBuilder",{enumerable:!0,get:function(){return EK.RequesterBuilder}});Object.defineProperty(O6,"InterceptingCall",{enumerable:!0,get:function(){return EK.InterceptingCall}});Object.defineProperty(O6,"InterceptorConfigurationError",{enumerable:!0,get:function(){return EK.InterceptorConfigurationError}});var Ct=O5();Object.defineProperty(O6,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return Ct.getChannelzServiceDefinition}});Object.defineProperty(O6,"getChannelzHandlers",{enumerable:!0,get:function(){return Ct.getChannelzHandlers}});var Yy0=A3();Object.defineProperty(O6,"addAdminServicesToServer",{enumerable:!0,get:function(){return Yy0.addAdminServicesToServer}});var WU=hA();Object.defineProperty(O6,"ServerListenerBuilder",{enumerable:!0,get:function(){return WU.ServerListenerBuilder}});Object.defineProperty(O6,"ResponderBuilder",{enumerable:!0,get:function(){return WU.ResponderBuilder}});Object.defineProperty(O6,"ServerInterceptingCall",{enumerable:!0,get:function(){return WU.ServerInterceptingCall}});var Zy0=FK();Object.defineProperty(O6,"ServerMetricRecorder",{enumerable:!0,get:function(){return Zy0.ServerMetricRecorder}});var Qy0=dA();O6.experimental=Qy0;var Xy0=VA(),Jy0=xo(),Wy0=no(),Ky0=OX(),Gy0=so(),Fy0=Kt(),Hy0=Tt(),Vy0=O5();(()=>{Xy0.setup(),Jy0.setup(),Wy0.setup(),Ky0.setup(),Gy0.setup(),Fy0.setup(),Hy0.setup(),Vy0.setup()})()});var B00=H0((J41,z00)=>{(()=>{var Y={"./node_modules/.pnpm/create-require@1.1.1/node_modules/create-require/create-require.js":(F,X,J)=>{let Q=J("module"),G=J("path"),q=J("fs");F.exports=function(K){return K||(K=process.cwd()),function(V){try{return q.lstatSync(V).isDirectory()}catch(B){return!1}}(K)&&(K=G.join(K,"index.js")),Q.createRequire?Q.createRequire(K):Q.createRequireFromPath?Q.createRequireFromPath(K):function(V){let B=new Q.Module(V,null);return B.filename=V,B.paths=Q.Module._nodeModulePaths(G.dirname(V)),B._compile("module.exports = require;",V),B.exports}(K)}},"./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive":(F)=>{function X(J){return Promise.resolve().then(()=>{var Q=Error("Cannot find module '"+J+"'");throw Q.code="MODULE_NOT_FOUND",Q})}X.keys=()=>[],X.resolve=X,X.id="./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive",F.exports=X},"./node_modules/.pnpm/object-hash@3.0.0/node_modules/object-hash/index.js":(F,X,J)=>{var Q=J("crypto");function G(E,A){return function(N,O){var T=O.algorithm!=="passthrough"?Q.createHash(O.algorithm):new M;T.write===void 0&&(T.write=T.update,T.end=T.update);var C=I(O,T);if(C.dispatch(N),T.update||T.end(""),T.digest)return T.digest(O.encoding==="buffer"?void 0:O.encoding);var R=T.read();if(O.encoding==="buffer")return R;return R.toString(O.encoding)}(E,A=V(E,A))}(X=F.exports=G).sha1=function(E){return G(E)},X.keys=function(E){return G(E,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},X.MD5=function(E){return G(E,{algorithm:"md5",encoding:"hex"})},X.keysMD5=function(E){return G(E,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var q=Q.getHashes?Q.getHashes().slice():["sha1","md5"];q.push("passthrough");var K=["buffer","hex","binary","base64"];function V(E,A){A=A||{};var N={};if(N.algorithm=A.algorithm||"sha1",N.encoding=A.encoding||"hex",N.excludeValues=!!A.excludeValues,N.algorithm=N.algorithm.toLowerCase(),N.encoding=N.encoding.toLowerCase(),N.ignoreUnknown=A.ignoreUnknown===!0,N.respectType=A.respectType!==!1,N.respectFunctionNames=A.respectFunctionNames!==!1,N.respectFunctionProperties=A.respectFunctionProperties!==!1,N.unorderedArrays=A.unorderedArrays===!0,N.unorderedSets=A.unorderedSets!==!1,N.unorderedObjects=A.unorderedObjects!==!1,N.replacer=A.replacer||void 0,N.excludeKeys=A.excludeKeys||void 0,E===void 0)throw Error("Object argument required.");for(var O=0;O<q.length;++O)q[O].toLowerCase()===N.algorithm.toLowerCase()&&(N.algorithm=q[O]);if(q.indexOf(N.algorithm)===-1)throw Error('Algorithm "'+N.algorithm+'" not supported. supported values: '+q.join(", "));if(K.indexOf(N.encoding)===-1&&N.algorithm!=="passthrough")throw Error('Encoding "'+N.encoding+'" not supported. supported values: '+K.join(", "));return N}function B(E){if(typeof E!="function")return!1;return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(E))!=null}function I(E,A,N){N=N||[];var O=function(T){return A.update?A.update(T,"utf8"):A.write(T,"utf8")};return{dispatch:function(T){E.replacer&&(T=E.replacer(T));var C=typeof T;return T===null&&(C="null"),this["_"+C](T)},_object:function(T){var C=Object.prototype.toString.call(T),R=/\[object (.*)\]/i.exec(C);R=(R=R?R[1]:"unknown:["+C+"]").toLowerCase();var w;if((w=N.indexOf(T))>=0)return this.dispatch("[CIRCULAR:"+w+"]");if(N.push(T),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(T))return O("buffer:"),O(T);if(R==="object"||R==="function"||R==="asyncfunction"){var L=Object.keys(T);E.unorderedObjects&&(L=L.sort()),E.respectType===!1||B(T)||L.splice(0,0,"prototype","__proto__","constructor"),E.excludeKeys&&(L=L.filter(function(v){return!E.excludeKeys(v)})),O("object:"+L.length+":");var k=this;return L.forEach(function(v){k.dispatch(v),O(":"),E.excludeValues||k.dispatch(T[v]),O(",")})}if(!this["_"+R]){if(E.ignoreUnknown)return O("["+R+"]");throw Error('Unknown object type "'+R+'"')}this["_"+R](T)},_array:function(T,C){C=C!==void 0?C:E.unorderedArrays!==!1;var R=this;if(O("array:"+T.length+":"),!C||T.length<=1)return T.forEach(function(k){return R.dispatch(k)});var w=[],L=T.map(function(k){var v=new M,f=N.slice();return I(E,v,f).dispatch(k),w=w.concat(f.slice(N.length)),v.read().toString()});return N=N.concat(w),L.sort(),this._array(L,!1)},_date:function(T){return O("date:"+T.toJSON())},_symbol:function(T){return O("symbol:"+T.toString())},_error:function(T){return O("error:"+T.toString())},_boolean:function(T){return O("bool:"+T.toString())},_string:function(T){O("string:"+T.length+":"),O(T.toString())},_function:function(T){O("fn:"),B(T)?this.dispatch("[native]"):this.dispatch(T.toString()),E.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(T.name)),E.respectFunctionProperties&&this._object(T)},_number:function(T){return O("number:"+T.toString())},_xml:function(T){return O("xml:"+T.toString())},_null:function(){return O("Null")},_undefined:function(){return O("Undefined")},_regexp:function(T){return O("regex:"+T.toString())},_uint8array:function(T){return O("uint8array:"),this.dispatch(Array.prototype.slice.call(T))},_uint8clampedarray:function(T){return O("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(T))},_int8array:function(T){return O("int8array:"),this.dispatch(Array.prototype.slice.call(T))},_uint16array:function(T){return O("uint16array:"),this.dispatch(Array.prototype.slice.call(T))},_int16array:function(T){return O("int16array:"),this.dispatch(Array.prototype.slice.call(T))},_uint32array:function(T){return O("uint32array:"),this.dispatch(Array.prototype.slice.call(T))},_int32array:function(T){return O("int32array:"),this.dispatch(Array.prototype.slice.call(T))},_float32array:function(T){return O("float32array:"),this.dispatch(Array.prototype.slice.call(T))},_float64array:function(T){return O("float64array:"),this.dispatch(Array.prototype.slice.call(T))},_arraybuffer:function(T){return O("arraybuffer:"),this.dispatch(new Uint8Array(T))},_url:function(T){return O("url:"+T.toString())},_map:function(T){O("map:");var C=Array.from(T);return this._array(C,E.unorderedSets!==!1)},_set:function(T){O("set:");var C=Array.from(T);return this._array(C,E.unorderedSets!==!1)},_file:function(T){return O("file:"),this.dispatch([T.name,T.size,T.type,T.lastModfied])},_blob:function(){if(E.ignoreUnknown)return O("[blob]");throw Error(`Hashing Blob objects is currently not supported
36
36
  (see https://github.com/puleos/object-hash/issues/26)
37
37
  Use "options.replacer" or "options.ignoreUnknown"
38
38
  `)},_domwindow:function(){return O("domwindow")},_bigint:function(T){return O("bigint:"+T.toString())},_process:function(){return O("process")},_timer:function(){return O("timer")},_pipe:function(){return O("pipe")},_tcp:function(){return O("tcp")},_udp:function(){return O("udp")},_tty:function(){return O("tty")},_statwatcher:function(){return O("statwatcher")},_securecontext:function(){return O("securecontext")},_connection:function(){return O("connection")},_zlib:function(){return O("zlib")},_context:function(){return O("context")},_nodescript:function(){return O("nodescript")},_httpparser:function(){return O("httpparser")},_dataview:function(){return O("dataview")},_signal:function(){return O("signal")},_fsevent:function(){return O("fsevent")},_tlswrap:function(){return O("tlswrap")}}}function M(){return{buf:"",write:function(E){this.buf+=E},end:function(E){this.buf+=E},read:function(){return this.buf}}}X.writeToStream=function(E,A,N){return N===void 0&&(N=A,A={}),I(A=V(E,A),N).dispatch(E)}},"./node_modules/.pnpm/pirates@4.0.6/node_modules/pirates/lib/index.js":(F,X,J)=>{F=J.nmd(F),Object.defineProperty(X,"__esModule",{value:!0}),X.addHook=function(I,M={}){let E=!1,A=[],N=[],O,T=V._extensions[".js"],C=M.matcher||null,R=M.ignoreNodeModules!==!1;return O=M.extensions||M.exts||M.extension||M.ext||[".js"],Array.isArray(O)||(O=[O]),O.forEach((w)=>{if(typeof w!="string")throw TypeError(`Invalid Extension: ${w}`);let L=V._extensions[w]||T;N[w]=V._extensions[w],A[w]=V._extensions[w]=function(k,v){let f;E||function(h,b,x,y){if(typeof h!="string")return!1;if(b.indexOf(G.default.extname(h))===-1)return!1;let n=G.default.resolve(h);if(y&&K.test(n))return!1;if(x&&typeof x=="function")return!!x(n);return!0}(v,O,C,R)&&(f=k._compile,k._compile=function(h){k._compile=f;let b=I(h,v);if(typeof b!="string")throw Error(B);return k._compile(b,v)}),L(k,v)}}),function(){E||(E=!0,O.forEach((w)=>{V._extensions[w]===A[w]&&(N[w]?V._extensions[w]=N[w]:delete V._extensions[w])}))}};var Q=q(J("module")),G=q(J("path"));function q(I){return I&&I.__esModule?I:{default:I}}let K=/^(?:.*[\\/])?node_modules(?:[\\/].*)?$/,V=F.constructor.length>1?F.constructor:Q.default,B=`[Pirates] A hook returned a non-string, or nothing at all! This is a violation of intergalactic law!
@@ -973,8 +973,8 @@ ${B}${q.instructions}
973
973
  ${W.join(`
974
974
  `)}
975
975
 
976
- ${F}`,Y.config.mode)}function mN(Y,Z){return Cq(Y,Z==="plan"?"plan":"act")}function g00(Y,Z,W,H,F,X){if(H)Wz(Y.telemetry,{ulid:Z,apiProvider:Y.providerId,...X});else Jz(Y.telemetry,{ulid:Z,apiProvider:Y.providerId,...X});Ux0(Y.telemetry,{workspacePath:F}),Y.telemetry?.capture({event:"session.started",properties:{sessionId:Z,source:W,providerId:Y.providerId,modelId:Y.modelId,enableTools:Y.enableTools,enableSpawnAgent:Y.enableSpawnAgent,enableAgentTeams:Y.enableAgentTeams,...X}})}function Ux0(Y,Z){let W=K7(),H=UZ(Z.workspacePath),F=new Map;for(let X of H){let J=X.hookEventName??"unknown",Q=F.get(J)??{global:0,workspace:0};if(X.path===W||X.path.startsWith(`${W}/`))Q.global+=1;else Q.workspace+=1;F.set(J,Q)}for(let[X,J]of F.entries())Nz(Y,X,J.global,J.workspace)}function d00(Y,Z){for(let W of Z.mentions)Az(Y,W,Z.matchedFiles.includes(W)?1:0,"file",!Z.matchedFiles.includes(W));for(let W of Z.matchedFiles)zz(Y,"file",W.length);for(let W of Z.ignoredMentions)Bz(Y,"file","not_found",W)}import{basename as Nx0,resolve as Ox0}from"node:path";import Dx0 from"simple-git";function iX(Y){return Ox0(Y)}async function jG(Y){let Z=iX(Y),W={rootPath:Z,hint:Nx0(Z)};try{let H=Dx0({baseDir:Z});if(!await H.checkIsRepo())return W;let X=await H.getRemotes(!0);if(X.length>0){let G=X.map((q)=>{let K=q.refs.fetch||q.refs.push;return`${q.name}: ${K}`});W.associatedRemoteUrls=G}let J=(await H.revparse(["HEAD"])).trim();if(J.length>0)W.latestGitCommitHash=J;let Q=(await H.branch()).current.trim();if(Q.length>0)W.latestGitBranchName=Q}catch{}return W}async function gN(Y){let Z=await jG(Y);return Lq(Z)}var l00=5000,Rx0=20480000;function Px0(){return process?.env?.CLINE_CHECKPOINT==="true"}async function Lx0(Y){let Z=await Ix0(Y);if(!Z.isFile())throw Error("Path is not a file");if(Z.size>Rx0)throw Error("File is too large to read into context.");let W=await Tx0(Y,"utf8");if(W.includes("\x00"))throw Error("Cannot read binary file into context.");return W}class _G{sessionService;runtimeBuilder;createAgentInstance;defaultToolExecutors;defaultToolPolicies;providerSettingsManager;oauthTokenManager;defaultTelemetry;defaultRequestToolApproval;listeners=new Set;sessions=new Map;usageBySession=new Map;subAgentStarts=new Map;constructor(Y){let Z=$x0();if(Z)Xq(Z);let W=G7(Y.distinctId);this.sessionService=Y.sessionService,this.runtimeBuilder=Y.runtimeBuilder??new TG,this.createAgentInstance=Y.createAgent??((H)=>new Mx0(H)),this.defaultToolExecutors=Y.defaultToolExecutors,this.defaultToolPolicies=Y.toolPolicies,this.providerSettingsManager=Y.providerSettingsManager??new LZ,this.oauthTokenManager=Y.oauthTokenManager??new AN({providerSettingsManager:this.providerSettingsManager,telemetry:Y.telemetry}),this.defaultTelemetry=Y.telemetry,this.defaultTelemetry?.setDistinctId(W),this.defaultRequestToolApproval=Y.requestToolApproval}async start(Y){let Z=Y.source??dX.CLI,W=Z8(),H=Y.config.sessionId?.trim()??"",F=H||yq(),X=H?await this.getRow(F):void 0,J=X&&!Y.config.teamName?.trim()&&X.teamName?.trim()?{...Y,config:{...Y.config,teamName:X.teamName}}:Y;this.usageBySession.set(F,wG());let Q=await this.invokeOptionalValue("ensureSessionsDir")??"";if(!Q)throw Error("session service method not available: ensureSessionsDir");let G=rX(Q,F),q=rX(G,`${F}.log`),K=rX(G,`${F}.hooks.jsonl`),V=rX(G,`${F}.messages.json`),B=rX(G,`${F}.json`),I=pX(Y.config),M=L5.parse({version:1,session_id:F,source:Z,pid:process.pid,started_at:W,status:"running",interactive:Y.interactive===!0,provider:J.config.providerId,model:J.config.modelId,cwd:J.config.cwd,workspace_root:I,team_name:J.config.teamName,enable_tools:J.config.enableTools,enable_spawn:J.config.enableSpawnAgent,enable_teams:J.config.enableAgentTeams,prompt:J.prompt?.trim()||void 0,messages_path:V}),{config:E,pluginSandboxShutdown:A}=await y00(J,K,F,this.defaultTelemetry,(h)=>void this.handlePluginEvent(F,h)),N=await gN(J.config.cwd),O=v00(E,this.providerSettingsManager,h00),T={...E,providerConfig:O,workspaceMetadata:N};T.hooks=hK([E.hooks,Px0()?$s({cwd:T.cwd,sessionId:F,logger:T.logger,readSessionMetadata:async()=>(await this.get(F))?.metadata,writeSessionMetadata:async(h)=>{await this.persistSessionMetadata(F,()=>h)}}):void 0]);let C=await this.runtimeBuilder.build({config:T,hooks:T.hooks,extensions:E.extensions,logger:T.logger,telemetry:T.telemetry,onTeamEvent:(h)=>{this.handleTeamEvent(F,h),T.onTeamEvent?.(h)},createSpawnTool:()=>this.createSpawnTool(T,F),onTeamRestored:Y.onTeamRestored,userInstructionWatcher:Y.userInstructionWatcher,defaultToolExecutors:Y.defaultToolExecutors??this.defaultToolExecutors,teamToolsFactory:Y.teamToolsFactory});if(C.teamRuntime&&!T.teamName?.trim())T.teamName=C.teamRuntime.getTeamName();let R=[...C.tools,...T.extraTools??[]],w={providerId:O.providerId,modelId:O.modelId,apiKey:O.apiKey,baseUrl:O.baseUrl,headers:O.headers,knownModels:O.knownModels,providerConfig:O,thinking:T.thinking,reasoningEffort:T.reasoningEffort??O.reasoningEffort,systemPrompt:T.systemPrompt,maxIterations:T.maxIterations,execution:T.execution,prepareTurn:BU(T),tools:R,hooks:T.hooks,extensions:E.extensions,hookErrorMode:T.hookErrorMode,initialMessages:Y.initialMessages,userFileContentLoader:Lx0,toolPolicies:Y.toolPolicies??this.defaultToolPolicies,requestToolApproval:Y.requestToolApproval??this.defaultRequestToolApproval,onConsecutiveMistakeLimitReached:T.onConsecutiveMistakeLimitReached,completionGuard:C.completionGuard,logger:C.logger??T.logger,extensionContext:T.extensionContext,onEvent:(h)=>this.onAgentEvent(F,T,h)},L=this.createAgentInstance(w);C.registerLeadAgent?.(L);let k=x7({agentId:this.readAgentId(L),conversationId:this.readAgentConversationId(L),teamId:C.teamRuntime?.getTeamId(),teamName:C.teamRuntime?.getTeamName(),teamRole:C.teamRuntime?"lead":void 0});if(g00(T,F,Z,H.length>0,I,k),k)fQ(T.telemetry,{ulid:F,modelId:T.modelId,provider:T.providerId,...k});if(C.teamRuntime)Uz(T.telemetry,{ulid:F,teamId:C.teamRuntime.getTeamId(),teamName:C.teamRuntime.getTeamName(),leadAgentId:this.readAgentId(L),restoredFromPersistence:C.teamRestoredFromPersistence===!0});let v={sessionId:F,config:T,source:Z,startedAt:W,pendingPrompt:M.prompt,runtime:C,agent:L,started:!1,aborting:!1,interactive:Y.interactive===!0,persistedMessages:J.initialMessages,activeTeamRunIds:new Set,pendingTeamRunUpdates:[],teamRunWaiters:[],pendingPrompts:[],drainingPendingPrompts:!1,pluginSandboxShutdown:A};this.sessions.set(F,v),this.emitStatus(F,"running");let f;try{if(J.prompt?.trim()){if(f=await this.runTurn(v,{prompt:J.prompt,userImages:J.userImages,userFiles:J.userFiles}),!v.interactive)await this.finalizeSingleRun(v,f.finishReason)}}catch(h){throw await this.failSession(v),h}return{sessionId:F,manifest:M,manifestPath:B,transcriptPath:q,hookPath:K,messagesPath:V,result:f}}async send(Y){let Z=this.getSessionOrThrow(Y.sessionId);if(Z.config.telemetry?.capture({event:"session.input_sent",properties:{sessionId:Y.sessionId,promptLength:Y.prompt.length,userImageCount:Y.userImages?.length??0,userFileCount:Y.userFiles?.length??0,delivery:Y.delivery??"immediate"}}),Y.delivery==="queue"||Y.delivery==="steer"){this.enqueuePendingPrompt(Y.sessionId,{prompt:Y.prompt,delivery:Y.delivery,userImages:Y.userImages,userFiles:Y.userFiles});return}try{let W=await this.runTurn(Z,{prompt:Y.prompt,userImages:Y.userImages,userFiles:Y.userFiles});if(!Z.interactive)await this.finalizeSingleRun(Z,W.finishReason);return queueMicrotask(()=>{this.drainPendingPrompts(Y.sessionId)}),W}catch(W){throw await this.failSession(Z),W}}async getAccumulatedUsage(Y){let Z=this.usageBySession.get(Y);return Z?{...Z}:void 0}async abort(Y,Z){let W=this.sessions.get(Y);if(!W)return;W.config.telemetry?.capture({event:"session.aborted",properties:{sessionId:Y}}),W.aborting=!0,W.agent.abort(Z)}async stop(Y){let Z=this.sessions.get(Y);if(!Z)return;Z.config.telemetry?.capture({event:"session.stopped",properties:{sessionId:Y}}),Z.aborting=!0,Z.agent.abort(Error("session_stop")),await this.shutdownSession(Z,{status:"cancelled",exitCode:0,shutdownReason:"session_stop",endReason:"stopped"})}async dispose(Y="session_manager_dispose"){let Z=[...this.sessions.values()];if(Z.length===0)return;await Promise.allSettled(Z.map((W)=>this.shutdownSession(W,{status:"cancelled",exitCode:0,shutdownReason:Y,endReason:"disposed"}))),this.usageBySession.clear()}async get(Y){let Z=await this.getRow(Y);return Z?TN(Z):void 0}async list(Y=200){return(await this.listRows(Y)).map(TN)}async delete(Y){if(this.sessions.has(Y))await this.stop(Y);let Z=await this.invoke("deleteSession",Y);if(Z.deleted)this.usageBySession.delete(Y);return Z.deleted}async readTranscript(Y,Z){let W=await this.getRow(Y);if(!W?.transcriptPath||!dN(W.transcriptPath))return"";let H=cN(W.transcriptPath,"utf8");if(typeof Z==="number"&&Number.isFinite(Z))return H.slice(-Math.max(0,Math.floor(Z)));return H}async readMessages(Y){let W=(await this.getRow(Y))?.messagesPath?.trim();if(!W||!dN(W))return[];try{let H=cN(W,"utf8").trim();if(!H)return[];let F=JSON.parse(H);if(Array.isArray(F))return F;if(F&&typeof F==="object"&&!Array.isArray(F)){let X=F.messages;if(Array.isArray(X))return X}return[]}catch{return[]}}async readHooks(Y,Z=200){let W=await this.getRow(Y);if(!W?.hookPath||!dN(W.hookPath))return[];return cN(W.hookPath,"utf8").split(`
977
- `).filter((F)=>F.trim().length>0).slice(-Math.max(1,Math.floor(Z))).map((F)=>{try{return JSON.parse(F)}catch{return{raw:F}}})}subscribe(Y){return this.listeners.add(Y),()=>{this.listeners.delete(Y)}}async updateSessionModel(Y,Z){let W=this.getSessionOrThrow(Y);W.config.modelId=Z,W.runtime.delegatedAgentConfigProvider?.updateConnectionDefaults({modelId:Z}),this.updateAgentConnection(W,{modelId:Z})}async runTurn(Y,Z){let W=await this.prepareTurnInput(Y,Z),H=W.prompt.trim();if(!H)throw Error("prompt cannot be empty");if(!Y.artifacts&&!Y.pendingPrompt)Y.pendingPrompt=H;await this.ensureSessionPersisted(Y),await this.syncOAuthCredentials(Y);let F=await this.executeAgentTurn(Y,H,W.userImages,W.userFiles);while(b00(Y,F.finishReason)){let X=await u00(Y);if(X.length===0)break;let J=m00(Y,X);F=await this.executeAgentTurn(Y,J)}return F}async executeAgentTurn(Y,Z,W,H){let F=Y.started||Y.agent.getMessages().length>0,X=Y.persistedMessages??Y.agent.getMessages(),J=this.usageBySession.get(Y.sessionId)??wG();Y.turnUsageBaseline=J,Fz(Y.config.telemetry,Y.sessionId,Y.config.mode),SQ(Y.config.telemetry,{ulid:Y.sessionId,provider:Y.config.providerId,model:Y.config.modelId,source:"user",mode:Y.config.mode,...this.getSessionAgentTelemetryIdentity(Y)});try{let Q=F?()=>Y.agent.continue(Z,W,H):()=>Y.agent.run(Z,W,H),G=await this.runWithAuthRetry(Y,Q,X);Y.started=!0;let q=PG(G.messages,G,X);Y.persistedMessages=q;let K=nX(J,G.usage);return this.usageBySession.set(Y.sessionId,K),await this.persistSessionMetadata(Y.sessionId,(V)=>({...V??{},totalCost:K.totalCost})),await this.invoke("persistSessionMessages",Y.sessionId,q,Y.config.systemPrompt),G}catch(Q){throw await this.invoke("persistSessionMessages",Y.sessionId,Y.agent.getMessages(),Y.config.systemPrompt),Q}finally{Y.turnUsageBaseline=void 0}}async prepareTurnInput(Y,Z){let W=pX(Y.config),H=$Y(Z.prompt).trim();if(!H)return{prompt:"",userImages:Z.userImages,userFiles:this.resolveAbsoluteFilePaths(Y.config.cwd,Z.userFiles)};let F=await SK(H,W);d00(Y.config.telemetry,F);let X=mN(F.prompt,Y.config.mode),J=this.resolveAbsoluteFilePaths(Y.config.cwd,Z.userFiles),Q=this.resolveAbsoluteFilePaths(W,F.matchedFiles),G=Array.from(new Set([...J,...Q]));return{prompt:X,userImages:Z.userImages,userFiles:G.length>0?G:void 0}}async ensureSessionPersisted(Y){if(Y.artifacts)return;let Z=pX(Y.config);Y.artifacts=await this.invoke("createRootSessionWithArtifacts",{sessionId:Y.sessionId,source:Y.source,pid:process.pid,interactive:Y.interactive,provider:Y.config.providerId,model:Y.config.modelId,cwd:Y.config.cwd,workspaceRoot:Z,teamName:Y.config.teamName,enableTools:Y.config.enableTools,enableSpawn:Y.config.enableSpawnAgent,enableTeams:Y.config.enableAgentTeams,prompt:Y.pendingPrompt,startedAt:Y.startedAt})}async persistSessionMetadata(Y,Z){let W=this.sessions.get(Y),H=await this.invokeOptionalValue("readSessionManifest",Y)??W?.artifacts?.manifest,F=Z(H?.metadata);if(!W?.artifacts)return;if((await this.invokeOptionalValue("updateSession",{sessionId:Y,metadata:F}))?.updated===!1)return;W.artifacts.manifest.metadata=F}async finalizeSingleRun(Y,Z){if(bN(Y))return;let W=Z==="aborted"||Y.aborting;await this.shutdownSession(Y,{status:W?"cancelled":"completed",exitCode:0,shutdownReason:"session_complete",endReason:Z})}async failSession(Y){await this.shutdownSession(Y,{status:"failed",exitCode:1,shutdownReason:"session_error",endReason:"error"})}async shutdownSession(Y,Z){if(Z.status==="completed")Kz(Y.config.telemetry,{ulid:Y.sessionId,provider:Y.config.providerId,modelId:Y.config.modelId,mode:Y.config.mode,durationMs:Date.now()-Date.parse(Y.startedAt),...this.getSessionAgentTelemetryIdentity(Y)});if(uN(Y),Y.artifacts)await this.updateStatus(Y,Z.status,Z.exitCode),await Y.agent.shutdown(Z.shutdownReason);await Promise.resolve(Y.runtime.shutdown(Z.shutdownReason)),await Y.pluginSandboxShutdown?.(),this.sessions.delete(Y.sessionId),this.emit({type:"ended",payload:{sessionId:Y.sessionId,reason:Z.endReason,ts:Date.now()}})}async updateStatus(Y,Z,W){if(!Y.artifacts)return;let H=await this.invoke("updateSessionStatus",Y.sessionId,Z,W);if(!H.updated)return;let F=await this.invokeOptionalValue("readSessionManifest",Y.sessionId)??Y.artifacts.manifest;F.status=Z,F.ended_at=H.endedAt??Z8(),F.exit_code=typeof W==="number"?W:null,Y.artifacts.manifest=F,await this.invoke("writeSessionManifest",Y.artifacts.manifestPath,F),this.emitStatus(Y.sessionId,Z)}async handlePluginEvent(Y,Z){if(Z.name!=="steer_message"&&Z.name!=="queue_message"&&Z.name!=="pending_prompt")return;let W=Z.payload&&typeof Z.payload==="object"?Z.payload:void 0,H=typeof W?.sessionId==="string"&&W.sessionId.trim().length>0?W.sessionId.trim():Y,F=typeof W?.prompt==="string"?W.prompt.trim():"";if(!F)return;let X=Z.name==="steer_message"?"steer":Z.name==="queue_message"?"queue":W?.delivery==="steer"?"steer":"queue";this.enqueuePendingPrompt(H,{prompt:F,delivery:X})}enqueuePendingPrompt(Y,Z){let W=this.sessions.get(Y);if(!W)return;let{prompt:H,delivery:F,userImages:X,userFiles:J}=Z,Q=W.pendingPrompts.findIndex((G)=>G.prompt===H);if(Q>=0){let[G]=W.pendingPrompts.splice(Q,1);if(F==="steer"||G.delivery==="steer")W.pendingPrompts.unshift({id:G.id,prompt:H,delivery:"steer",userImages:X??G.userImages,userFiles:J??G.userFiles});else W.pendingPrompts.push({...G,userImages:X??G.userImages,userFiles:J??G.userFiles})}else if(F==="steer")W.pendingPrompts.unshift({id:`pending_${Date.now()}_${c00(5)}`,prompt:H,delivery:F,userImages:X,userFiles:J});else W.pendingPrompts.push({id:`pending_${Date.now()}_${c00(5)}`,prompt:H,delivery:F,userImages:X,userFiles:J});this.emitPendingPrompts(W),queueMicrotask(()=>{this.drainPendingPrompts(Y)})}async drainPendingPrompts(Y){let Z=this.sessions.get(Y);if(!Z||Z.drainingPendingPrompts)return;if(!(typeof Z.agent.canStartRun==="function"?Z.agent.canStartRun():!0))return;let H=Z.pendingPrompts.shift();if(!H)return;this.emitPendingPrompts(Z),this.emitPendingPromptSubmitted(Z,H),Z.drainingPendingPrompts=!0;try{await this.send({sessionId:Y,prompt:H.prompt,userImages:H.userImages,userFiles:H.userFiles})}catch(F){if((F instanceof Error?F.message:String(F)).includes("already in progress"))Z.pendingPrompts.unshift(H),this.emitPendingPrompts(Z);else throw F}finally{if(Z.drainingPendingPrompts=!1,Z.pendingPrompts.length>0)queueMicrotask(()=>{this.drainPendingPrompts(Y)})}}onAgentEvent(Y,Z,W){let H=this.sessions.get(Y),F={sessionId:Y,config:Z,liveSession:H,usageBySession:this.usageBySession,persistMessages:(Q,G,q)=>{this.invoke("persistSessionMessages",Q,G,q)},emit:(Q)=>this.emit(Q)},X=EN(W),J=H&&X.agentId===this.readAgentId(H.agent);MN(F,W,J?{isPrimaryAgentEvent:!0,...H?.runtime.teamRuntime?{teamRole:"lead"}:{}}:{isPrimaryAgentEvent:!1})}emitPendingPrompts(Y){this.emit({type:"pending_prompts",payload:{sessionId:Y.sessionId,prompts:Y.pendingPrompts.map((Z)=>({id:Z.id,prompt:Z.prompt,delivery:Z.delivery,attachmentCount:(Z.userImages?.length??0)+(Z.userFiles?.length??0)}))}})}emitPendingPromptSubmitted(Y,Z){this.emit({type:"pending_prompt_submitted",payload:{sessionId:Y.sessionId,id:Z.id,prompt:Z.prompt,delivery:Z.delivery,attachmentCount:(Z.userImages?.length??0)+(Z.userFiles?.length??0)}})}createSpawnTool(Y,Z){return OG({configProvider:{getRuntimeConfig:()=>this.sessions.get(Z)?.runtime.delegatedAgentConfigProvider?.getRuntimeConfig()??{providerId:Y.providerId,modelId:Y.modelId,cwd:Y.cwd,apiKey:Y.apiKey,baseUrl:Y.baseUrl,headers:Y.headers,providerConfig:Y.providerConfig,knownModels:Y.knownModels,thinking:Y.thinking,maxIterations:Y.maxIterations,hooks:Y.hooks,extensions:Y.extensions,logger:Y.logger,telemetry:Y.telemetry},getConnectionConfig:()=>this.sessions.get(Z)?.runtime.delegatedAgentConfigProvider?.getConnectionConfig()??{providerId:Y.providerId,modelId:Y.modelId,apiKey:Y.apiKey,baseUrl:Y.baseUrl,headers:Y.headers,providerConfig:Y.providerConfig,knownModels:Y.knownModels,thinking:Y.thinking},updateConnectionDefaults:()=>{}},createSubAgentTools:()=>{let H=Y.enableTools?kX({cwd:Y.cwd,...R5[DZ({mode:Y.mode,yolo:Y.yolo})],executors:this.defaultToolExecutors}):[];if(Y.enableSpawnAgent)H.push(this.createSpawnTool(Y,Z));return H},onSubAgentEvent:(H)=>this.onAgentEvent(Z,Y,H),onSubAgentStart:(H)=>{let F=this.sessions.get(Z)?.runtime.teamRuntime;this.subAgentStarts.set(H.subAgentId,{startedAt:Date.now(),rootSessionId:Z});let X=x7({agentId:H.subAgentId,conversationId:H.conversationId,parentAgentId:H.parentAgentId,teamId:F?.getTeamId(),teamName:F?.getTeamName(),createdByAgentId:H.parentAgentId});if(X)fQ(Y.telemetry,{ulid:Z,modelId:Y.modelId,provider:Y.providerId,...X});nW(Y.telemetry,{event:"started",ulid:Z,durationMs:0,parentId:H.parentAgentId,agentId:H.subAgentId,...X}),this.invokeOptional("handleSubAgentStart",Z,H)},onSubAgentEnd:(H)=>{let F=this.sessions.get(Z)?.runtime.teamRuntime,X=this.subAgentStarts.get(H.subAgentId),J=X?Date.now()-X.startedAt:0,Q=H.result?.text?H.result.text.split(`
976
+ ${F}`,Y.config.mode)}function mN(Y,Z){return Cq(Y,Z==="plan"?"plan":"act")}function g00(Y,Z,W,H,F,X){if(H)Wz(Y.telemetry,{ulid:Z,apiProvider:Y.providerId,...X});else Jz(Y.telemetry,{ulid:Z,apiProvider:Y.providerId,...X});Ux0(Y.telemetry,{workspacePath:F}),Y.telemetry?.capture({event:"session.started",properties:{sessionId:Z,source:W,providerId:Y.providerId,modelId:Y.modelId,enableTools:Y.enableTools,enableSpawnAgent:Y.enableSpawnAgent,enableAgentTeams:Y.enableAgentTeams,...X}})}function Ux0(Y,Z){let W=K7(),H=UZ(Z.workspacePath),F=new Map;for(let X of H){let J=X.hookEventName??"unknown",Q=F.get(J)??{global:0,workspace:0};if(X.path===W||X.path.startsWith(`${W}/`))Q.global+=1;else Q.workspace+=1;F.set(J,Q)}for(let[X,J]of F.entries())Nz(Y,X,J.global,J.workspace)}function d00(Y,Z){for(let W of Z.mentions)Az(Y,W,Z.matchedFiles.includes(W)?1:0,"file",!Z.matchedFiles.includes(W));for(let W of Z.matchedFiles)zz(Y,"file",W.length);for(let W of Z.ignoredMentions)Bz(Y,"file","not_found",W)}import{basename as Nx0,resolve as Ox0}from"node:path";import Dx0 from"simple-git";function iX(Y){return Ox0(Y)}async function jG(Y){let Z=iX(Y),W={rootPath:Z,hint:Nx0(Z)};try{let H=Dx0({baseDir:Z});if(!await H.checkIsRepo())return W;let X=await H.getRemotes(!0);if(X.length>0){let G=X.map((q)=>{let K=q.refs.fetch||q.refs.push;return`${q.name}: ${K}`});W.associatedRemoteUrls=G}let J=(await H.revparse(["HEAD"])).trim();if(J.length>0)W.latestGitCommitHash=J;let Q=(await H.branch()).current.trim();if(Q.length>0)W.latestGitBranchName=Q}catch{}return W}async function gN(Y){let Z=await jG(Y);return Lq(Z)}var l00=5000,Rx0=20480000;function Px0(){return process?.env?.CLINE_CHECKPOINT==="true"}async function Lx0(Y){let Z=await Ix0(Y);if(!Z.isFile())throw Error("Path is not a file");if(Z.size>Rx0)throw Error("File is too large to read into context.");let W=await Tx0(Y,"utf8");if(W.includes("\x00"))throw Error("Cannot read binary file into context.");return W}class _G{sessionService;runtimeBuilder;createAgentInstance;defaultToolExecutors;defaultToolPolicies;providerSettingsManager;oauthTokenManager;defaultTelemetry;defaultRequestToolApproval;listeners=new Set;sessions=new Map;usageBySession=new Map;subAgentStarts=new Map;constructor(Y){let Z=$x0();if(Z)Xq(Z);let W=G7(Y.distinctId);this.sessionService=Y.sessionService,this.runtimeBuilder=Y.runtimeBuilder??new TG,this.createAgentInstance=Y.createAgent??((H)=>new Mx0(H)),this.defaultToolExecutors=Y.defaultToolExecutors,this.defaultToolPolicies=Y.toolPolicies,this.providerSettingsManager=Y.providerSettingsManager??new LZ,this.oauthTokenManager=Y.oauthTokenManager??new AN({providerSettingsManager:this.providerSettingsManager,telemetry:Y.telemetry}),this.defaultTelemetry=Y.telemetry,this.defaultTelemetry?.setDistinctId(W),this.defaultRequestToolApproval=Y.requestToolApproval}async start(Y){let Z=Y.source??dX.CLI,W=Z8(),H=Y.config.sessionId?.trim()??"",F=H||yq(),X=H?await this.getRow(F):void 0,J=X&&!Y.config.teamName?.trim()&&X.teamName?.trim()?{...Y,config:{...Y.config,teamName:X.teamName}}:Y;this.usageBySession.set(F,wG());let Q=await this.invokeOptionalValue("ensureSessionsDir")??"";if(!Q)throw Error("session service method not available: ensureSessionsDir");let G=rX(Q,F),q=rX(G,`${F}.log`),K=rX(G,`${F}.hooks.jsonl`),V=rX(G,`${F}.messages.json`),B=rX(G,`${F}.json`),I=pX(Y.config),M=L5.parse({version:1,session_id:F,source:Z,pid:process.pid,started_at:W,status:"running",interactive:Y.interactive===!0,provider:J.config.providerId,model:J.config.modelId,cwd:J.config.cwd,workspace_root:I,team_name:J.config.teamName,enable_tools:J.config.enableTools,enable_spawn:J.config.enableSpawnAgent,enable_teams:J.config.enableAgentTeams,prompt:J.prompt?.trim()||void 0,messages_path:V}),{config:E,pluginSandboxShutdown:A}=await y00(J,K,F,this.defaultTelemetry,(h)=>void this.handlePluginEvent(F,h)),N=await gN(J.config.cwd),O=v00(E,this.providerSettingsManager,h00),T={...E,providerConfig:O,workspaceMetadata:N};T.hooks=hK([E.hooks,Px0()?$s({cwd:T.cwd,sessionId:F,logger:T.logger,readSessionMetadata:async()=>(await this.get(F))?.metadata,writeSessionMetadata:async(h)=>{await this.persistSessionMetadata(F,()=>h)}}):void 0]);let C=await this.runtimeBuilder.build({config:T,hooks:T.hooks,extensions:E.extensions,logger:T.logger,telemetry:T.telemetry,onTeamEvent:(h)=>{this.handleTeamEvent(F,h),T.onTeamEvent?.(h)},createSpawnTool:()=>this.createSpawnTool(T,F),onTeamRestored:Y.onTeamRestored,userInstructionWatcher:Y.userInstructionWatcher,defaultToolExecutors:Y.defaultToolExecutors??this.defaultToolExecutors,teamToolsFactory:Y.teamToolsFactory});if(C.teamRuntime&&!T.teamName?.trim())T.teamName=C.teamRuntime.getTeamName();let R=[...C.tools,...T.extraTools??[]],w={providerId:O.providerId,modelId:O.modelId,apiKey:O.apiKey,baseUrl:O.baseUrl,headers:O.headers,knownModels:O.knownModels,providerConfig:O,thinking:T.thinking,reasoningEffort:T.reasoningEffort??O.reasoningEffort,systemPrompt:T.systemPrompt,maxIterations:T.maxIterations,execution:T.execution,prepareTurn:BU(T),tools:R,hooks:T.hooks,extensions:E.extensions,hookErrorMode:T.hookErrorMode,initialMessages:Y.initialMessages,userFileContentLoader:Lx0,toolPolicies:Y.toolPolicies??this.defaultToolPolicies,requestToolApproval:Y.requestToolApproval??this.defaultRequestToolApproval,onConsecutiveMistakeLimitReached:T.onConsecutiveMistakeLimitReached,completionGuard:C.completionGuard,consumePendingUserMessage:()=>this.consumeSteerMessage(F),logger:C.logger??T.logger,extensionContext:T.extensionContext,onEvent:(h)=>this.onAgentEvent(F,T,h)},L=this.createAgentInstance(w);C.registerLeadAgent?.(L);let k=x7({agentId:this.readAgentId(L),conversationId:this.readAgentConversationId(L),teamId:C.teamRuntime?.getTeamId(),teamName:C.teamRuntime?.getTeamName(),teamRole:C.teamRuntime?"lead":void 0});if(g00(T,F,Z,H.length>0,I,k),k)fQ(T.telemetry,{ulid:F,modelId:T.modelId,provider:T.providerId,...k});if(C.teamRuntime)Uz(T.telemetry,{ulid:F,teamId:C.teamRuntime.getTeamId(),teamName:C.teamRuntime.getTeamName(),leadAgentId:this.readAgentId(L),restoredFromPersistence:C.teamRestoredFromPersistence===!0});let v={sessionId:F,config:T,source:Z,startedAt:W,pendingPrompt:M.prompt,runtime:C,agent:L,started:!1,aborting:!1,interactive:Y.interactive===!0,persistedMessages:J.initialMessages,activeTeamRunIds:new Set,pendingTeamRunUpdates:[],teamRunWaiters:[],pendingPrompts:[],drainingPendingPrompts:!1,pluginSandboxShutdown:A};this.sessions.set(F,v),this.emitStatus(F,"running");let f;try{if(J.prompt?.trim()){if(f=await this.runTurn(v,{prompt:J.prompt,userImages:J.userImages,userFiles:J.userFiles}),!v.interactive)await this.finalizeSingleRun(v,f.finishReason)}}catch(h){throw await this.failSession(v),h}return{sessionId:F,manifest:M,manifestPath:B,transcriptPath:q,hookPath:K,messagesPath:V,result:f}}async send(Y){let Z=this.getSessionOrThrow(Y.sessionId);if(Z.config.telemetry?.capture({event:"session.input_sent",properties:{sessionId:Y.sessionId,promptLength:Y.prompt.length,userImageCount:Y.userImages?.length??0,userFileCount:Y.userFiles?.length??0,delivery:Y.delivery??"immediate"}}),Y.delivery==="queue"||Y.delivery==="steer"){this.enqueuePendingPrompt(Y.sessionId,{prompt:Y.prompt,delivery:Y.delivery,userImages:Y.userImages,userFiles:Y.userFiles});return}try{let W=await this.runTurn(Z,{prompt:Y.prompt,userImages:Y.userImages,userFiles:Y.userFiles});if(!Z.interactive)await this.finalizeSingleRun(Z,W.finishReason);return queueMicrotask(()=>{this.drainPendingPrompts(Y.sessionId)}),W}catch(W){throw await this.failSession(Z),W}}async getAccumulatedUsage(Y){let Z=this.usageBySession.get(Y);return Z?{...Z}:void 0}async abort(Y,Z){let W=this.sessions.get(Y);if(!W)return;W.config.telemetry?.capture({event:"session.aborted",properties:{sessionId:Y}}),W.aborting=!0,W.agent.abort(Z)}async stop(Y){let Z=this.sessions.get(Y);if(!Z)return;Z.config.telemetry?.capture({event:"session.stopped",properties:{sessionId:Y}}),Z.aborting=!0,Z.agent.abort(Error("session_stop")),await this.shutdownSession(Z,{status:"cancelled",exitCode:0,shutdownReason:"session_stop",endReason:"stopped"})}async dispose(Y="session_manager_dispose"){let Z=[...this.sessions.values()];if(Z.length===0)return;await Promise.allSettled(Z.map((W)=>this.shutdownSession(W,{status:"cancelled",exitCode:0,shutdownReason:Y,endReason:"disposed"}))),this.usageBySession.clear()}async get(Y){let Z=await this.getRow(Y);return Z?TN(Z):void 0}async list(Y=200){return(await this.listRows(Y)).map(TN)}async delete(Y){if(this.sessions.has(Y))await this.stop(Y);let Z=await this.invoke("deleteSession",Y);if(Z.deleted)this.usageBySession.delete(Y);return Z.deleted}async readTranscript(Y,Z){let W=await this.getRow(Y);if(!W?.transcriptPath||!dN(W.transcriptPath))return"";let H=cN(W.transcriptPath,"utf8");if(typeof Z==="number"&&Number.isFinite(Z))return H.slice(-Math.max(0,Math.floor(Z)));return H}async readMessages(Y){let W=(await this.getRow(Y))?.messagesPath?.trim();if(!W||!dN(W))return[];try{let H=cN(W,"utf8").trim();if(!H)return[];let F=JSON.parse(H);if(Array.isArray(F))return F;if(F&&typeof F==="object"&&!Array.isArray(F)){let X=F.messages;if(Array.isArray(X))return X}return[]}catch{return[]}}async readHooks(Y,Z=200){let W=await this.getRow(Y);if(!W?.hookPath||!dN(W.hookPath))return[];return cN(W.hookPath,"utf8").split(`
977
+ `).filter((F)=>F.trim().length>0).slice(-Math.max(1,Math.floor(Z))).map((F)=>{try{return JSON.parse(F)}catch{return{raw:F}}})}subscribe(Y){return this.listeners.add(Y),()=>{this.listeners.delete(Y)}}async updateSessionModel(Y,Z){let W=this.getSessionOrThrow(Y);W.config.modelId=Z,W.runtime.delegatedAgentConfigProvider?.updateConnectionDefaults({modelId:Z}),this.updateAgentConnection(W,{modelId:Z})}async runTurn(Y,Z){let W=await this.prepareTurnInput(Y,Z),H=W.prompt.trim();if(!H)throw Error("prompt cannot be empty");if(!Y.artifacts&&!Y.pendingPrompt)Y.pendingPrompt=H;await this.ensureSessionPersisted(Y),await this.syncOAuthCredentials(Y);let F=await this.executeAgentTurn(Y,H,W.userImages,W.userFiles);while(b00(Y,F.finishReason)){let X=await u00(Y);if(X.length===0)break;let J=m00(Y,X);F=await this.executeAgentTurn(Y,J)}return F}async executeAgentTurn(Y,Z,W,H){let F=Y.started||Y.agent.getMessages().length>0,X=Y.persistedMessages??Y.agent.getMessages(),J=this.usageBySession.get(Y.sessionId)??wG();Y.turnUsageBaseline=J,Fz(Y.config.telemetry,Y.sessionId,Y.config.mode),SQ(Y.config.telemetry,{ulid:Y.sessionId,provider:Y.config.providerId,model:Y.config.modelId,source:"user",mode:Y.config.mode,...this.getSessionAgentTelemetryIdentity(Y)});try{let Q=F?()=>Y.agent.continue(Z,W,H):()=>Y.agent.run(Z,W,H),G=await this.runWithAuthRetry(Y,Q,X);Y.started=!0;let q=PG(G.messages,G,X);Y.persistedMessages=q;let K=nX(J,G.usage);return this.usageBySession.set(Y.sessionId,K),await this.persistSessionMetadata(Y.sessionId,(V)=>({...V??{},totalCost:K.totalCost})),await this.invoke("persistSessionMessages",Y.sessionId,q,Y.config.systemPrompt),G}catch(Q){throw await this.invoke("persistSessionMessages",Y.sessionId,Y.agent.getMessages(),Y.config.systemPrompt),Q}finally{Y.turnUsageBaseline=void 0}}async prepareTurnInput(Y,Z){let W=pX(Y.config),H=$Y(Z.prompt).trim();if(!H)return{prompt:"",userImages:Z.userImages,userFiles:this.resolveAbsoluteFilePaths(Y.config.cwd,Z.userFiles)};let F=await SK(H,W);d00(Y.config.telemetry,F);let X=mN(F.prompt,Y.config.mode),J=this.resolveAbsoluteFilePaths(Y.config.cwd,Z.userFiles),Q=this.resolveAbsoluteFilePaths(W,F.matchedFiles),G=Array.from(new Set([...J,...Q]));return{prompt:X,userImages:Z.userImages,userFiles:G.length>0?G:void 0}}async ensureSessionPersisted(Y){if(Y.artifacts)return;let Z=pX(Y.config);Y.artifacts=await this.invoke("createRootSessionWithArtifacts",{sessionId:Y.sessionId,source:Y.source,pid:process.pid,interactive:Y.interactive,provider:Y.config.providerId,model:Y.config.modelId,cwd:Y.config.cwd,workspaceRoot:Z,teamName:Y.config.teamName,enableTools:Y.config.enableTools,enableSpawn:Y.config.enableSpawnAgent,enableTeams:Y.config.enableAgentTeams,prompt:Y.pendingPrompt,startedAt:Y.startedAt})}async persistSessionMetadata(Y,Z){let W=this.sessions.get(Y),H=await this.invokeOptionalValue("readSessionManifest",Y)??W?.artifacts?.manifest,F=Z(H?.metadata);if(!W?.artifacts)return;if((await this.invokeOptionalValue("updateSession",{sessionId:Y,metadata:F}))?.updated===!1)return;W.artifacts.manifest.metadata=F}async finalizeSingleRun(Y,Z){if(bN(Y))return;let W=Z==="aborted"||Y.aborting;await this.shutdownSession(Y,{status:W?"cancelled":"completed",exitCode:0,shutdownReason:"session_complete",endReason:Z})}async failSession(Y){await this.shutdownSession(Y,{status:"failed",exitCode:1,shutdownReason:"session_error",endReason:"error"})}async shutdownSession(Y,Z){if(Z.status==="completed")Kz(Y.config.telemetry,{ulid:Y.sessionId,provider:Y.config.providerId,modelId:Y.config.modelId,mode:Y.config.mode,durationMs:Date.now()-Date.parse(Y.startedAt),...this.getSessionAgentTelemetryIdentity(Y)});if(uN(Y),Y.artifacts)await this.updateStatus(Y,Z.status,Z.exitCode),await Y.agent.shutdown(Z.shutdownReason);await Promise.resolve(Y.runtime.shutdown(Z.shutdownReason)),await Y.pluginSandboxShutdown?.(),this.sessions.delete(Y.sessionId),this.emit({type:"ended",payload:{sessionId:Y.sessionId,reason:Z.endReason,ts:Date.now()}})}async updateStatus(Y,Z,W){if(!Y.artifacts)return;let H=await this.invoke("updateSessionStatus",Y.sessionId,Z,W);if(!H.updated)return;let F=await this.invokeOptionalValue("readSessionManifest",Y.sessionId)??Y.artifacts.manifest;F.status=Z,F.ended_at=H.endedAt??Z8(),F.exit_code=typeof W==="number"?W:null,Y.artifacts.manifest=F,await this.invoke("writeSessionManifest",Y.artifacts.manifestPath,F),this.emitStatus(Y.sessionId,Z)}async handlePluginEvent(Y,Z){if(Z.name!=="steer_message"&&Z.name!=="queue_message"&&Z.name!=="pending_prompt")return;let W=Z.payload&&typeof Z.payload==="object"?Z.payload:void 0,H=typeof W?.sessionId==="string"&&W.sessionId.trim().length>0?W.sessionId.trim():Y,F=typeof W?.prompt==="string"?W.prompt.trim():"";if(!F)return;let X=Z.name==="steer_message"?"steer":Z.name==="queue_message"?"queue":W?.delivery==="steer"?"steer":"queue";this.enqueuePendingPrompt(H,{prompt:F,delivery:X})}consumeSteerMessage(Y){let Z=this.sessions.get(Y);if(!Z)return;let W=Z.pendingPrompts.findIndex((F)=>F.delivery==="steer");if(W<0)return;let[H]=Z.pendingPrompts.splice(W,1);return this.emitPendingPrompts(Z),this.emitPendingPromptSubmitted(Z,H),H.prompt}enqueuePendingPrompt(Y,Z){let W=this.sessions.get(Y);if(!W)return;let{prompt:H,delivery:F,userImages:X,userFiles:J}=Z,Q=W.pendingPrompts.findIndex((G)=>G.prompt===H);if(Q>=0){let[G]=W.pendingPrompts.splice(Q,1);if(F==="steer"||G.delivery==="steer")W.pendingPrompts.unshift({id:G.id,prompt:H,delivery:"steer",userImages:X??G.userImages,userFiles:J??G.userFiles});else W.pendingPrompts.push({...G,userImages:X??G.userImages,userFiles:J??G.userFiles})}else if(F==="steer")W.pendingPrompts.unshift({id:`pending_${Date.now()}_${c00(5)}`,prompt:H,delivery:F,userImages:X,userFiles:J});else W.pendingPrompts.push({id:`pending_${Date.now()}_${c00(5)}`,prompt:H,delivery:F,userImages:X,userFiles:J});this.emitPendingPrompts(W),queueMicrotask(()=>{this.drainPendingPrompts(Y)})}async drainPendingPrompts(Y){let Z=this.sessions.get(Y);if(!Z||Z.drainingPendingPrompts)return;if(!(typeof Z.agent.canStartRun==="function"?Z.agent.canStartRun():!0))return;let H=Z.pendingPrompts.shift();if(!H)return;this.emitPendingPrompts(Z),this.emitPendingPromptSubmitted(Z,H),Z.drainingPendingPrompts=!0;try{await this.send({sessionId:Y,prompt:H.prompt,userImages:H.userImages,userFiles:H.userFiles})}catch(F){if((F instanceof Error?F.message:String(F)).includes("already in progress"))Z.pendingPrompts.unshift(H),this.emitPendingPrompts(Z);else throw F}finally{if(Z.drainingPendingPrompts=!1,Z.pendingPrompts.length>0)queueMicrotask(()=>{this.drainPendingPrompts(Y)})}}onAgentEvent(Y,Z,W){let H=this.sessions.get(Y),F={sessionId:Y,config:Z,liveSession:H,usageBySession:this.usageBySession,persistMessages:(Q,G,q)=>{this.invoke("persistSessionMessages",Q,G,q)},emit:(Q)=>this.emit(Q)},X=EN(W),J=H&&X.agentId===this.readAgentId(H.agent);MN(F,W,J?{isPrimaryAgentEvent:!0,...H?.runtime.teamRuntime?{teamRole:"lead"}:{}}:{isPrimaryAgentEvent:!1})}emitPendingPrompts(Y){this.emit({type:"pending_prompts",payload:{sessionId:Y.sessionId,prompts:Y.pendingPrompts.map((Z)=>({id:Z.id,prompt:Z.prompt,delivery:Z.delivery,attachmentCount:(Z.userImages?.length??0)+(Z.userFiles?.length??0)}))}})}emitPendingPromptSubmitted(Y,Z){this.emit({type:"pending_prompt_submitted",payload:{sessionId:Y.sessionId,id:Z.id,prompt:Z.prompt,delivery:Z.delivery,attachmentCount:(Z.userImages?.length??0)+(Z.userFiles?.length??0)}})}createSpawnTool(Y,Z){return OG({configProvider:{getRuntimeConfig:()=>this.sessions.get(Z)?.runtime.delegatedAgentConfigProvider?.getRuntimeConfig()??{providerId:Y.providerId,modelId:Y.modelId,cwd:Y.cwd,apiKey:Y.apiKey,baseUrl:Y.baseUrl,headers:Y.headers,providerConfig:Y.providerConfig,knownModels:Y.knownModels,thinking:Y.thinking,maxIterations:Y.maxIterations,hooks:Y.hooks,extensions:Y.extensions,logger:Y.logger,telemetry:Y.telemetry},getConnectionConfig:()=>this.sessions.get(Z)?.runtime.delegatedAgentConfigProvider?.getConnectionConfig()??{providerId:Y.providerId,modelId:Y.modelId,apiKey:Y.apiKey,baseUrl:Y.baseUrl,headers:Y.headers,providerConfig:Y.providerConfig,knownModels:Y.knownModels,thinking:Y.thinking},updateConnectionDefaults:()=>{}},createSubAgentTools:()=>{let H=Y.enableTools?kX({cwd:Y.cwd,...R5[DZ({mode:Y.mode,yolo:Y.yolo})],executors:this.defaultToolExecutors}):[];if(Y.enableSpawnAgent)H.push(this.createSpawnTool(Y,Z));return H},onSubAgentEvent:(H)=>this.onAgentEvent(Z,Y,H),onSubAgentStart:(H)=>{let F=this.sessions.get(Z)?.runtime.teamRuntime;this.subAgentStarts.set(H.subAgentId,{startedAt:Date.now(),rootSessionId:Z});let X=x7({agentId:H.subAgentId,conversationId:H.conversationId,parentAgentId:H.parentAgentId,teamId:F?.getTeamId(),teamName:F?.getTeamName(),createdByAgentId:H.parentAgentId});if(X)fQ(Y.telemetry,{ulid:Z,modelId:Y.modelId,provider:Y.providerId,...X});nW(Y.telemetry,{event:"started",ulid:Z,durationMs:0,parentId:H.parentAgentId,agentId:H.subAgentId,...X}),this.invokeOptional("handleSubAgentStart",Z,H)},onSubAgentEnd:(H)=>{let F=this.sessions.get(Z)?.runtime.teamRuntime,X=this.subAgentStarts.get(H.subAgentId),J=X?Date.now()-X.startedAt:0,Q=H.result?.text?H.result.text.split(`
978
978
  `).length:0;nW(Y.telemetry,{event:"ended",ulid:Z,durationMs:J,outputLines:Q,errorMessage:H.error?String(H.error):void 0,agentId:H.subAgentId,parentId:H.parentAgentId,...x7({agentId:H.subAgentId,conversationId:H.conversationId,parentAgentId:H.parentAgentId,teamId:F?.getTeamId(),teamName:F?.getTeamName(),createdByAgentId:H.parentAgentId})}),this.subAgentStarts.delete(H.subAgentId),this.invokeOptional("handleSubAgentEnd",Z,H)}})}async handleTeamEvent(Y,Z){let W=this.sessions.get(Y);if(W){if(j00(W,Z),Z.type==="agent_event"){let H={sessionId:Y,config:W.config,liveSession:W,usageBySession:this.usageBySession,persistMessages:(F,X,J)=>{this.invoke("persistSessionMessages",F,X,J)},emit:(F)=>this.emit(F)};MN(H,Z.event,{teamRole:"teammate",teamAgentId:Z.agentId,isPrimaryAgentEvent:!1})}if(Z.type==="teammate_spawned"){let H=x7({agentId:Z.teammate.runtimeAgentId??Z.agentId,conversationId:Z.teammate.conversationId,parentAgentId:Z.teammate.parentAgentId,createdByAgentId:this.readAgentId(W.agent),teamId:W.runtime.teamRuntime?.getTeamId(),teamName:W.runtime.teamRuntime?.getTeamName(),teamRole:"teammate",teamAgentId:Z.agentId});if(H)fQ(W.config.telemetry,{ulid:Y,modelId:Z.teammate.modelId??W.config.modelId,provider:W.config.providerId,...H})}}if(await _00(Y,Z,this.invokeOptional.bind(this)),W)x00(W,Y,Z,(H)=>this.emit(H))}async runWithAuthRetry(Y,Z,W){try{return await Z()}catch(H){if(!Iq(H,Y.config.providerId))throw H;return await this.syncOAuthCredentials(Y,{forceRefresh:!0}),Y.agent.restore(W),Z()}}async syncOAuthCredentials(Y,Z){let W=null;try{W=await this.oauthTokenManager.resolveProviderApiKey({providerId:Y.config.providerId,forceRefresh:Z?.forceRefresh})}catch(H){if(H instanceof EG)throw Error(`OAuth session for "${H.providerId}" requires re-authentication. Run "clite auth ${H.providerId}" and retry.`);throw H}if(!W?.apiKey||Y.config.apiKey===W.apiKey)return;Y.config.apiKey=W.apiKey,this.updateAgentConnection(Y,{apiKey:W.apiKey}),Y.runtime.delegatedAgentConfigProvider?.updateConnectionDefaults({apiKey:W.apiKey}),Y.runtime.teamRuntime?.updateTeammateConnections({apiKey:W.apiKey})}getSessionOrThrow(Y){let Z=this.sessions.get(Y);if(!Z)throw Error(`session not found: ${Y}`);return Z}resolveAbsoluteFilePaths(Y,Z){if(!Z||Z.length===0)return[];let W=Z.map((H)=>H.trim()).filter((H)=>H.length>0).map((H)=>Cx0(H)?H:Ex0(Y,H));return Array.from(new Set(W))}updateAgentConnection(Y,Z){Y.agent.updateConnection?.(Z)}getSessionAgentTelemetryIdentity(Y){return x7({agentId:this.readAgentId(Y.agent),conversationId:this.readAgentConversationId(Y.agent),teamId:Y.runtime.teamRuntime?.getTeamId(),teamName:Y.runtime.teamRuntime?.getTeamName(),teamRole:Y.runtime.teamRuntime?"lead":void 0})}readAgentId(Y){return Y.getAgentId?.()}readAgentConversationId(Y){return Y.getConversationId?.()}emitStatus(Y,Z){this.emit({type:"status",payload:{sessionId:Y,status:Z}})}emit(Y){for(let Z of this.listeners)Z(Y)}async listRows(Y){return this.invoke("listSessions",Math.min(Math.max(1,Math.floor(Y)),l00))}async getRow(Y){let Z=Y.trim();if(!Z)return;return(await this.listRows(l00)).find((H)=>H.sessionId===Z)}async invoke(Y,...Z){let W=this.sessionService[Y];if(typeof W!=="function")throw Error(`session service method not available: ${Y}`);return Promise.resolve(W.apply(this.sessionService,Z))}async invokeOptional(Y,...Z){let W=this.sessionService[Y];if(typeof W!=="function")return;await Promise.resolve(W.apply(this.sessionService,Z))}async invokeOptionalValue(Y,...Z){let W=this.sessionService[Y];if(typeof W!=="function")return;return await Promise.resolve(W.apply(this.sessionService,Z))}}x6();import{existsSync as pN,mkdirSync as vx0,readFileSync as p00,renameSync as hx0,writeFileSync as jx0}from"node:fs";import{join as i00}from"node:path";import{appendFileSync as xG,existsSync as wx0,readFileSync as Sx0,writeFileSync as n00}from"node:fs";import{nanoid as fx0}from"nanoid";import{z as lN}from"zod";var kx0=dX.SUBAGENT,nN=4,yx0=lN.looseObject({task:lN.string().optional(),systemPrompt:lN.string().optional()});class u9{adapter;teamTaskSessionsByAgent=new Map;teamTaskLastHeartbeatBySession=new Map;teamTaskLastProgressLineBySession=new Map;artifacts;static STALE_REASON="failed_external_process_exit";static STALE_SOURCE="stale_session_reconciler";static TEAM_HEARTBEAT_LOG_INTERVAL_MS=30000;constructor(Y){this.adapter=Y;this.artifacts=new PN(()=>this.ensureSessionsDir())}ensureSessionsDir(){return this.adapter.ensureSessionsDir()}initializeMessagesFile(Y,Z,W){F00(Z,W,CN(Y))}toPersistedMessages(Y,Z,W){if(!Y)return;return Z?PG(Z.messages,Z,W):DN(Y)}writeManifestFile(Y,Z){n00(Y,`${JSON.stringify(L5.parse(Z),null,2)}
979
979
  `,"utf8")}writeSessionManifest(Y,Z){this.writeManifestFile(Y,Z)}readSessionManifest(Y){return this.readManifestFile(Y).manifest}readManifestFile(Y){let Z=this.artifacts.sessionManifestPath(Y,!1);if(!wx0(Z))return{path:Z};try{return{path:Z,manifest:L5.parse(JSON.parse(Sx0(Z,"utf8")))}}catch{return{path:Z}}}async resolveArtifactPath(Y,Z,W){let F=(await this.adapter.getSession(Y))?.[Z];return typeof F==="string"&&F.trim().length>0?F:W(Y)}teamTaskQueueKey(Y,Z){return`${Y}::${Z}`}activeTeamTaskSessionId(Y,Z){return this.teamTaskSessionsByAgent.get(this.teamTaskQueueKey(Y,Z))?.at(-1)}async createRootSessionWithArtifacts(Y){let Z=Y.startedAt??Z8(),W=Y.sessionId.trim(),H=W.length>0?W:`${Date.now()}_${fx0(5)}`,F=this.artifacts.sessionTranscriptPath(H),X=this.artifacts.sessionHookPath(H),J=this.artifacts.sessionMessagesPath(H),Q=this.artifacts.sessionManifestPath(H),G=LG({metadata:Y.metadata,prompt:Y.prompt}),q=L5.parse({version:1,session_id:H,source:Y.source,pid:Y.pid,started_at:Z,status:"running",interactive:Y.interactive,provider:Y.provider,model:Y.model,cwd:Y.cwd,workspace_root:Y.workspaceRoot,team_name:Y.teamName,enable_tools:Y.enableTools,enable_spawn:Y.enableSpawn,enable_teams:Y.enableTeams,prompt:Y.prompt?.trim()||void 0,metadata:G,messages_path:J});return await this.adapter.upsertSession({sessionId:H,source:Y.source,pid:Y.pid,startedAt:Z,endedAt:null,exitCode:null,status:"running",statusLock:0,interactive:Y.interactive,provider:Y.provider,model:Y.model,cwd:Y.cwd,workspaceRoot:Y.workspaceRoot,teamName:Y.teamName??null,enableTools:Y.enableTools,enableSpawn:Y.enableSpawn,enableTeams:Y.enableTeams,parentSessionId:null,parentAgentId:null,agentId:null,conversationId:null,isSubagent:!1,prompt:q.prompt??null,metadata:w5(q.metadata),transcriptPath:F,hookPath:X,messagesPath:J,updatedAt:Z8()}),this.initializeMessagesFile(H,J,Z),this.writeManifestFile(Q,q),{manifestPath:Q,transcriptPath:F,hookPath:X,messagesPath:J,manifest:q}}async updateSessionStatus(Y,Z,W){let H;if((await V00(()=>this.adapter.getSession(Y),async(X)=>{return H=Z8(),this.adapter.updateSession({sessionId:Y,status:Z,endedAt:H,exitCode:typeof W==="number"?W:null,expectedStatusLock:X})},nN)).updated){if(Z==="cancelled")await this.applyStatusToRunningChildSessions(Y,"cancelled");return{updated:!0,endedAt:H}}return{updated:!1}}async updateSession(Y){for(let Z=0;Z<nN;Z++){let W=await this.adapter.getSession(Y.sessionId);if(!W)return{updated:!1};let H=W.metadata??void 0,F=Y.metadata!==void 0?w5(Y.metadata)??{}:w5(H)??{},X=_7(typeof H?.title==="string"?H.title:void 0),J=Y.title!==void 0?_7(Y.title):Y.prompt!==void 0?IN(Y.prompt):X;if(J)F.title=J;else delete F.title;let Q=Y.metadata!==void 0||Y.prompt!==void 0||Y.title!==void 0;if(!(await this.adapter.updateSession({sessionId:Y.sessionId,prompt:Y.prompt,metadata:Q?Object.keys(F).length>0?F:null:void 0,title:J,expectedStatusLock:W.statusLock})).updated)continue;let{path:q,manifest:K}=this.readManifestFile(Y.sessionId);if(K){if(Y.prompt!==void 0)K.prompt=Y.prompt??void 0;let V=Y.metadata!==void 0?w5(Y.metadata)??{}:w5(K.metadata)??{};if(J)V.title=J;K.metadata=Object.keys(V).length>0?V:void 0,this.writeManifestFile(q,K)}return{updated:!0}}return{updated:!1}}async queueSpawnRequest(Y){if(Y.hookName!=="tool_call"||Y.parent_agent_id!==null)return;if(Y.tool_call?.name!=="spawn_agent")return;let Z=cW(Y.sessionContext);if(!Z)return;let W=yx0.safeParse(Y.tool_call.input);await this.adapter.enqueueSpawnRequest({rootSessionId:Z,parentAgentId:Y.agent_id,task:W.success?W.data.task:void 0,systemPrompt:W.success?W.data.systemPrompt:void 0})}buildSubsessionRow(Y,Z){return{sessionId:Z.sessionId,source:kx0,pid:process.ppid,startedAt:Z.startedAt,endedAt:null,exitCode:null,status:"running",statusLock:0,interactive:!1,provider:Y.provider,model:Y.model,cwd:Y.cwd,workspaceRoot:Y.workspaceRoot,teamName:Y.teamName??null,enableTools:Y.enableTools,enableSpawn:Y.enableSpawn,enableTeams:Y.enableTeams,parentSessionId:Z.parentSessionId,parentAgentId:Z.parentAgentId,agentId:Z.agentId,conversationId:Z.conversationId??null,isSubagent:!0,prompt:Z.prompt,metadata:LG({prompt:Z.prompt}),transcriptPath:Z.transcriptPath,hookPath:Z.hookPath,messagesPath:Z.messagesPath,updatedAt:Z.startedAt}}async upsertSubagentSession(Y){let Z=Y.rootSessionId;if(!Z)return;let W=await this.adapter.getSession(Z);if(!W)return;let H=MG(Z,Y.agentId),F=await this.adapter.getSession(H),X=Z8(),J=this.artifacts.subagentArtifactPaths(H,Y.agentId,this.activeTeamTaskSessionId(Z,Y.parentAgentId)),Q=Y.prompt??F?.prompt??void 0;if(!Q)Q=await this.adapter.claimSpawnRequest(Z,Y.parentAgentId)??`Subagent run by ${Y.parentAgentId}`;if(!F)return await this.adapter.upsertSession(this.buildSubsessionRow(W,{sessionId:H,parentSessionId:Z,parentAgentId:Y.parentAgentId,agentId:Y.agentId,conversationId:Y.conversationId,prompt:Q,startedAt:X,...J})),this.initializeMessagesFile(H,J.messagesPath,X),H;return await this.adapter.updateSession({sessionId:H,setRunning:!0,parentSessionId:Z,parentAgentId:Y.parentAgentId,agentId:Y.agentId,conversationId:Y.conversationId,prompt:F.prompt??Q??null,metadata:LG({metadata:F.metadata??void 0,prompt:F.prompt??Q??null}),expectedStatusLock:F.statusLock}),H}async upsertSubagentSessionFromHook(Y){if(!Y.parent_agent_id)return;let Z=cW(Y.sessionContext);if(!Z)return;if(Y.hookName==="session_shutdown"){let W=MG(Z,Y.agent_id);return await this.adapter.getSession(W)?W:void 0}return await this.upsertSubagentSession({agentId:Y.agent_id,parentAgentId:Y.parent_agent_id,conversationId:Y.taskId,rootSessionId:Z})}async appendSubagentHookAudit(Y,Z){let W=await this.resolveArtifactPath(Y,"hookPath",(H)=>this.artifacts.sessionHookPath(H));xG(W,`${JSON.stringify({ts:Z8(),...Z})}
980
980
  `,"utf8")}async appendSubagentTranscriptLine(Y,Z){if(!Z.trim())return;let W=await this.resolveArtifactPath(Y,"transcriptPath",(H)=>this.artifacts.sessionTranscriptPath(H));xG(W,`${Z}
@@ -982,7 +982,7 @@ ${F}`,Y.config.mode)}function mN(Y,Z){return Cq(Y,Z==="plan"?"plan":"act")}funct
982
982
  `,"utf8")}async applySubagentStatus(Y,Z){await this.applySubagentStatusBySessionId(Y,NN(Z))}async applySubagentStatusBySessionId(Y,Z){let W=await this.adapter.getSession(Y);if(!W)return;let H=Z==="running"?null:Z8(),F=Z==="running"?null:Z==="failed"?1:0;await this.adapter.updateSession({sessionId:Y,status:Z,endedAt:H,exitCode:F,expectedStatusLock:W.statusLock})}async applyStatusToRunningChildSessions(Y,Z){if(!Y)return;let W=await this.adapter.listSessions({limit:2000,parentSessionId:Y,status:"running"});for(let H of W)await this.applySubagentStatusBySessionId(H.sessionId,Z)}async onTeamTaskStart(Y,Z,W){let H=await this.adapter.getSession(Y);if(!H)return;let F=UN(Y,Z),X=Z8(),{transcriptPath:J,hookPath:Q,messagesPath:G}=this.artifacts.subagentArtifactPaths(F,Z);await this.adapter.upsertSession(this.buildSubsessionRow(H,{sessionId:F,parentSessionId:Y,parentAgentId:"lead",agentId:Z,prompt:W||`Team task for ${Z}`,startedAt:X,transcriptPath:J,hookPath:Q,messagesPath:G})),this.initializeMessagesFile(F,G,X),await this.appendSubagentTranscriptLine(F,`[start] ${W}`);let q=this.teamTaskQueueKey(Y,Z),K=this.teamTaskSessionsByAgent.get(q)??[];K.push(F),this.teamTaskSessionsByAgent.set(q,K)}async onTeamTaskEnd(Y,Z,W,H,F,X){let J=this.teamTaskQueueKey(Y,Z),Q=this.teamTaskSessionsByAgent.get(J);if(!Q||Q.length===0)return;let G=Q.shift();if(Q.length===0)this.teamTaskSessionsByAgent.delete(J);if(!G)return;let q=F?.messages??X,K=this.toPersistedMessages(q,F,X);if(K)await this.persistSessionMessages(G,K);await this.appendSubagentTranscriptLine(G,H??`[done] ${W}`),await this.applySubagentStatusBySessionId(G,W),this.teamTaskLastHeartbeatBySession.delete(G),this.teamTaskLastProgressLineBySession.delete(G)}async onTeamTaskProgress(Y,Z,W,H){let F=this.teamTaskQueueKey(Y,Z),X=this.teamTaskSessionsByAgent.get(F)?.[0];if(!X)return;let J=W.trim();if(!J)return;let Q=H?.kind??"progress";if(Q==="heartbeat"){let q=Date.now(),K=this.teamTaskLastHeartbeatBySession.get(X)??0;if(q-K<u9.TEAM_HEARTBEAT_LOG_INTERVAL_MS)return;this.teamTaskLastHeartbeatBySession.set(X,q)}let G=Q==="heartbeat"?"[progress] heartbeat":Q==="text"?`[progress] text: ${J}`:`[progress] ${J}`;if(this.teamTaskLastProgressLineBySession.get(X)===G)return;this.teamTaskLastProgressLineBySession.set(X,G),await this.appendSubagentTranscriptLine(X,G)}async handleSubAgentStart(Y,Z){let W=await this.upsertSubagentSession({agentId:Z.subAgentId,parentAgentId:Z.parentAgentId,conversationId:Z.conversationId,prompt:Z.input.task,rootSessionId:Y});if(!W)return;await this.appendSubagentTranscriptLine(W,`[start] ${Z.input.task}`),await this.applySubagentStatusBySessionId(W,"running")}async handleSubAgentEnd(Y,Z){let W=await this.upsertSubagentSession({agentId:Z.subAgentId,parentAgentId:Z.parentAgentId,conversationId:Z.conversationId,prompt:Z.input.task,rootSessionId:Y});if(!W)return;if(Z.error){await this.appendSubagentTranscriptLine(W,`[error] ${Z.error.message}`),await this.applySubagentStatusBySessionId(W,"failed");return}let H=Z.result?.finishReason??"completed";await this.appendSubagentTranscriptLine(W,`[done] ${H}`),await this.applySubagentStatusBySessionId(W,H==="aborted"?"cancelled":"completed")}isPidAlive(Y){if(!Number.isFinite(Y)||Y<=0)return!1;try{return process.kill(Math.floor(Y),0),!0}catch(Z){return typeof Z==="object"&&Z!==null&&"code"in Z&&Z.code==="EPERM"}}async reconcileDeadRunningSession(Y){if(Y.status!=="running"||this.isPidAlive(Y.pid))return Y;let Z=Z8(),W=u9.STALE_REASON;for(let H=0;H<nN;H++){let F=await this.adapter.getSession(Y.sessionId);if(!F)return;if(F.status!=="running")return F;let X={...F.metadata??{},terminal_marker:W,terminal_marker_at:Z,terminal_marker_pid:F.pid,terminal_marker_source:u9.STALE_SOURCE},J=await this.adapter.updateSession({sessionId:F.sessionId,status:"failed",endedAt:Z,exitCode:1,metadata:X,expectedStatusLock:F.statusLock});if(!J.updated)continue;await this.applyStatusToRunningChildSessions(F.sessionId,"failed");let Q=H00(F,{status:"failed",endedAt:Z,exitCode:1,metadata:X}),{path:G}=this.readManifestFile(F.sessionId);return this.writeManifestFile(G,Q),xG(F.hookPath,`${JSON.stringify({ts:Z,hookName:"session_shutdown",reason:W,sessionId:F.sessionId,pid:F.pid,source:u9.STALE_SOURCE})}
983
983
  `,"utf8"),xG(F.transcriptPath,`[shutdown] ${W} (pid=${F.pid})
984
984
  `,"utf8"),{...F,status:"failed",endedAt:Z,exitCode:1,metadata:X,statusLock:J.statusLock,updatedAt:Z}}return await this.adapter.getSession(Y.sessionId)}async listSessions(Y=200){let Z=Math.max(1,Math.floor(Y)),W=Math.min(Z*5,2000);return await this.reconcileDeadSessions(W),(await this.adapter.listSessions({limit:W})).slice(0,Z).map((F)=>{let X=w5(F.metadata??void 0),{manifest:J}=this.readManifestFile(F.sessionId),Q=_7(typeof J?.metadata?.title==="string"?J.metadata.title:void 0),G=Q?{...X??{},title:Q}:X;return{...F,metadata:G}})}async reconcileDeadSessions(Y=2000){let Z=await this.adapter.listSessions({limit:Math.max(1,Math.floor(Y)),status:"running"}),W=0;for(let H of Z){let F=await this.reconcileDeadRunningSession(H);if(F&&F.status!==H.status)W++}return W}async deleteSession(Y){let Z=Y.trim();if(!Z)throw Error("session id is required");let W=await this.adapter.getSession(Z);if(!W)return{deleted:!1};if(await this.adapter.deleteSession(Z,!1),!W.isSubagent){let H=await this.adapter.listSessions({limit:2000,parentSessionId:Z});await this.adapter.deleteSession(Z,!0);for(let F of H)j4(F.transcriptPath),j4(F.hookPath),j4(F.messagesPath),j4(this.artifacts.sessionManifestPath(F.sessionId,!1)),this.artifacts.removeSessionDirIfEmpty(F.sessionId)}return j4(W.transcriptPath),j4(W.hookPath),j4(W.messagesPath),j4(this.artifacts.sessionManifestPath(Z,!1)),this.artifacts.removeSessionDirIfEmpty(Z),{deleted:!0}}}function iN(){return new Date().toISOString()}function r00(Y,Z){let W=`${Y}.tmp`;jx0(W,`${JSON.stringify(Z,null,2)}
985
- `,"utf8"),hx0(W,Y)}function _x0(){return H9()}class a00{sessionsDirPath;constructor(Y=_x0()){this.sessionsDirPath=Y}ensureSessionsDir(){if(!pN(this.sessionsDirPath))vx0(this.sessionsDirPath,{recursive:!0});return this.sessionsDirPath}indexPath(){return i00(this.ensureSessionsDir(),"sessions.index.json")}spawnQueuePath(){return i00(this.ensureSessionsDir(),"subagent-spawn-queue.json")}readIndex(){let Y=this.indexPath();if(!pN(Y))return{version:1,sessions:{}};try{let Z=JSON.parse(p00(Y,"utf8"));if(Z?.version===1&&Z.sessions)return Z}catch{}return{version:1,sessions:{}}}writeIndex(Y){r00(this.indexPath(),Y)}readQueue(){let Y=this.spawnQueuePath();if(!pN(Y))return{version:1,nextId:1,requests:[]};try{let Z=JSON.parse(p00(Y,"utf8"));if(Z?.version===1&&typeof Z.nextId==="number"&&Array.isArray(Z.requests))return Z}catch{}return{version:1,nextId:1,requests:[]}}writeQueue(Y){r00(this.spawnQueuePath(),Y)}async upsertSession(Y){let Z=this.readIndex();Z.sessions[Y.sessionId]=Y,this.writeIndex(Z)}async getSession(Y){return this.readIndex().sessions[Y]}async listSessions(Y){return Object.values(this.readIndex().sessions).filter((Z)=>Y.parentSessionId!==void 0?Z.parentSessionId===Y.parentSessionId:!0).filter((Z)=>Y.status!==void 0?Z.status===Y.status:!0).sort((Z,W)=>W.startedAt.localeCompare(Z.startedAt)).slice(0,Y.limit)}async updateSession(Y){let Z=this.readIndex(),W=Z.sessions[Y.sessionId];if(!W)return{updated:!1,statusLock:0};if(Y.expectedStatusLock!==void 0&&W.statusLock!==Y.expectedStatusLock)return{updated:!1,statusLock:W.statusLock};let H=Y.expectedStatusLock!==void 0?Y.expectedStatusLock+1:W.statusLock,F={...W,status:Y.status??W.status,endedAt:Y.endedAt!==void 0?Y.endedAt:W.endedAt??null,exitCode:Y.exitCode!==void 0?Y.exitCode:W.exitCode??null,prompt:Y.prompt!==void 0?Y.prompt:W.prompt??null,metadata:Y.metadata!==void 0?Y.metadata??null:W.metadata??null,parentSessionId:Y.parentSessionId!==void 0?Y.parentSessionId??null:W.parentSessionId??null,parentAgentId:Y.parentAgentId!==void 0?Y.parentAgentId??null:W.parentAgentId??null,agentId:Y.agentId!==void 0?Y.agentId??null:W.agentId??null,conversationId:Y.conversationId!==void 0?Y.conversationId??null:W.conversationId??null,statusLock:H,isSubagent:Y.setRunning||Y.parentSessionId!==void 0?!0:W.isSubagent,updatedAt:iN()};if(Y.setRunning)F.status="running",F.endedAt=null,F.exitCode=null;return Z.sessions[Y.sessionId]=F,this.writeIndex(Z),{updated:!0,statusLock:F.statusLock}}async deleteSession(Y,Z){let W=this.readIndex();if(!W.sessions[Y])return!1;if(delete W.sessions[Y],Z){for(let F of Object.values(W.sessions))if(F.parentSessionId===Y)delete W.sessions[F.sessionId]}return this.writeIndex(W),!0}async enqueueSpawnRequest(Y){let Z=this.readQueue();Z.requests.push({id:Z.nextId,rootSessionId:Y.rootSessionId,parentAgentId:Y.parentAgentId,task:Y.task,systemPrompt:Y.systemPrompt,createdAt:iN()}),Z.nextId+=1,this.writeQueue(Z)}async claimSpawnRequest(Y,Z){let W=this.readQueue(),H=W.requests.find((F)=>F.rootSessionId===Y&&F.parentAgentId===Z&&!F.consumedAt);if(!H)return;return H.consumedAt=iN(),this.writeQueue(W),H.task}}class rN extends u9{constructor(Y){super(new a00(Y))}ensureSessionsDir(){return super.ensureSessionsDir()}}import{createHash as bx0}from"node:crypto";import{mkdir as oN,readFile as Z10,rm as Q10,writeFile as X10}from"node:fs/promises";import{createServer as ux0}from"node:net";import{dirname as J10,join as uG,resolve as mx0}from"node:path";x6();var o00="0.0.29";var aN=o00;var gx0=30000,dx0=15000,cx0=100,W10="CLINE_RPC_STARTUP_LOCK_HELD",K10="CLINE_RPC_OWNER_ID",G10="CLINE_RPC_BUILD_ID",F10="CLINE_RPC_DISCOVERY_PATH",eN=(Y)=>new Promise((Z)=>setTimeout(Z,Y));function lx0(Y){return Y.replace(/[^a-zA-Z0-9_.-]+/g,"_")}function t00(Y){return bx0("sha256").update(Y).digest("hex").slice(0,12)}function YO(Y){return Y&&typeof Y==="object"&&"code"in Y?String(Y.code):""}function H10(Y){let Z=Y.trim(),W=Z.lastIndexOf(":");if(W<=0||W>=Z.length-1)throw Error(`invalid rpc address: ${Y}`);let H=Z.slice(0,W),F=Number.parseInt(Z.slice(W+1),10);if(!Number.isInteger(F)||F<=0||F>65535)throw Error(`invalid rpc port in address: ${Y}`);return{host:H,port:F}}function nx0(){let Y=process.argv[1]?.trim();if(!Y)return;return mx0(process.cwd(),Y)}function V10(Y){let Z=`core=${aN}:rpc=${lt}`;return Y?.trim()?`${Z}:host=${Y.trim()}`:Z}function mG(Y={}){let Z=Y.identityPath?.trim()||nx0(),W=Y.ownerBasis?.trim()||(Z?`${Z}`:`pid:${process.pid}:cwd:${process.cwd()}`),H=Y.ownerPrefix?.trim()||"rpc",F=Y.ownerId?.trim()||process.env[K10]?.trim()||`${H}-${t00(W)}`,X=`${W}:${V10(Y.hostBuildKey)}`,J=process.env[G10]?.trim()||`build-${t00(X)}`,Q=Y.discoveryPath?.trim()||process.env[F10]?.trim()||uG(S8(),"rpc","owners",`${lx0(F)}.json`);return{ownerId:F,buildId:J,entryPath:Z,discoveryPath:Q}}async function q10(Y){try{let Z=JSON.parse(await Z10(Y.discoveryPath,"utf8"));if(typeof Z.ownerId!=="string"||typeof Z.buildId!=="string"||typeof Z.address!=="string"||typeof Z.protocolVersion!=="string")return;return{ownerId:Z.ownerId,buildId:Z.buildId,address:Z.address,protocolVersion:Z.protocolVersion,updatedAt:typeof Z.updatedAt==="string"?Z.updatedAt:new Date().toISOString(),entryPath:typeof Z.entryPath==="string"?Z.entryPath:void 0,pid:typeof Z.pid==="number"?Z.pid:void 0,serverId:typeof Z.serverId==="string"?Z.serverId:void 0,startedAt:typeof Z.startedAt==="string"?Z.startedAt:void 0}}catch{return}}async function z10(Y,Z){await oN(J10(Y.discoveryPath),{recursive:!0}),await X10(Y.discoveryPath,JSON.stringify({ownerId:Y.ownerId,buildId:Y.buildId,updatedAt:new Date().toISOString(),...Z},null,2),"utf8")}async function bG(Y){await Q10(Y.discoveryPath,{force:!0}).catch(()=>{return})}async function px0(Y,Z){if((await q10(Y))?.address===Z)await bG(Y)}function tN(Y){let Z=Y?.rpcVersion?.trim()||"";return!!Z&&Z===RX}function ix0(Y){if(Number(YO(Y))===12)return!0;return(Y instanceof Error?Y.message:String(Y)).toUpperCase().includes("UNIMPLEMENTED")}function rx0(Y){let Z=Y instanceof Error?Y.message:String(Y);return/missing authentication header|401\b|unauthenticated|unauthorized/i.test(Z)}function s00(Y){return ix0(Y)||rx0(Y)}async function sN(Y){let Z=new MX({address:Y});try{try{await Z.stopRuntimeSession("__rpc_probe__")}catch(W){if(s00(W))return!1}return!0}catch(W){return!s00(W)}finally{Z.close()}}async function B10(Y){let Z=await v4(Y);return!!Z?.running&&tN(Z)&&await sN(Y)}async function A10(Y,Z){return new Promise((W)=>{let H=ux0();H.once("error",()=>W(!1)),H.once("listening",()=>H.close(()=>W(!0))),H.listen({host:Y,port:Z})})}async function e00(Y){let{host:Z,port:W}=H10(Y);for(let H=1;H<=40;H+=1){let F=W+H;if(F>65535)break;if(await A10(Z,F))return`${Z}:${F}`}throw Error(`no available rpc port near ${Y}`)}function ax0(Y){let Z=Y.trim().replace(/[^a-zA-Z0-9_.-]+/g,"_");return uG(S8(),"locks",`rpc-start-${Z}.lock`)}function ox0(Y){if(!Number.isInteger(Y)||!Y||Y<=0)return!1;try{return process.kill(Y,0),!0}catch(Z){return YO(Z)==="EPERM"}}async function tx0(Y,Z){let W={pid:process.pid,address:Z,acquiredAt:new Date().toISOString()};await X10(uG(Y,"owner.json"),JSON.stringify(W,null,2),"utf8")}async function sx0(Y){try{let Z=JSON.parse(await Z10(uG(Y,"owner.json"),"utf8"));if(typeof Z.pid!=="number"||typeof Z.address!=="string"||typeof Z.acquiredAt!=="string")return;return{pid:Z.pid,address:Z.address,acquiredAt:Z.acquiredAt}}catch{return}}async function Y10(Y){await Q10(Y,{recursive:!0,force:!0}).catch(()=>{})}async function U10(Y,Z){if(process.env[W10]==="1")return await Z();let W=ax0(Y),H=Date.now();await oN(J10(W),{recursive:!0});while(!0)try{await oN(W,{recursive:!1}),await tx0(W,Y);try{return await Z()}finally{await Y10(W)}}catch(F){if(YO(F)!=="EEXIST")throw F;let X=await sx0(W),J=X?new Date(X.acquiredAt).getTime():Number.NaN;if(!X||!Number.isFinite(J)||Date.now()-J>gx0||!ox0(X.pid)){await Y10(W);continue}if(Date.now()-H>=dx0)throw Error(`timed out waiting for rpc startup lock at ${Y} (owner pid=${X.pid})`);await eN(cx0)}}async function ex0(Y,Z){let W=Z?.address?.trim();if(!W){await bG(Y);return}if((await ct(W).catch(()=>{return}))?.accepted)for(let F=0;F<20;F+=1){if(!(await v4(W))?.running){await bG(Y);return}await eN(100)}if(!(await v4(W))?.running)await bG(Y)}async function N10(Y,Z={}){let W=Z.owner??Z.resolveOwner?.()??mG();return await U10(Y,async()=>{let H=await q10(W);if(H?.address){let Q=await v4(H.address);if(Q?.running&&H.buildId===W.buildId&&H.protocolVersion===RX&&tN(Q)&&await sN(H.address))return{address:H.address,action:"reuse",owner:W};await ex0(W,H)}let F=await v4(Y),{host:X,port:J}=H10(Y);if(!F?.running){if(await A10(X,J))return{address:Y,action:"started",owner:W};return{address:await e00(Y),action:"new-port",owner:W}}if(tN(F)&&await sN(Y)){if(!H)return{address:Y,action:"reuse",owner:W}}return{address:await e00(Y),action:"new-port",owner:W}})}async function O10(Y,Z=B10){for(let W=0;W<60;W+=1){if(await Z(Y))return!0;await eN(100)}return!1}async function ZO(Y,Z){let W=await N10(Y,{owner:Z.owner,resolveOwner:Z.resolveOwner});if(W.action!=="reuse")await Z.spawnIfNeeded(W.address,W.owner);if(!await O10(W.address,Z.readinessCheck))throw Error(`failed to ensure rpc runtime at ${W.address}`);let H=await v4(W.address);return await z10(W.owner,{address:W.address,pid:void 0,serverId:H?.serverId,startedAt:H?.startedAt,protocolVersion:RX,entryPath:W.owner.entryPath}),W}import{existsSync as Yb0,mkdirSync as Zb0}from"node:fs";class D10{client;constructor(Y){this.client=Y}ensureSessionsDir(){return""}async upsertSession(Y){await this.client.upsertSession(Y)}async getSession(Y){return await this.client.getSession(Y)??void 0}async listSessions(Y){return await this.client.listSessions(Y)}async updateSession(Y){return this.client.updateSession({sessionId:Y.sessionId,status:Y.status,endedAt:Y.endedAt,exitCode:Y.exitCode,prompt:Y.prompt,metadata:Y.metadata,parentSessionId:Y.parentSessionId,parentAgentId:Y.parentAgentId,agentId:Y.agentId,conversationId:Y.conversationId,expectedStatusLock:Y.expectedStatusLock,setRunning:Y.setRunning})}async deleteSession(Y,Z){return this.client.deleteSession(Y,Z)}async enqueueSpawnRequest(Y){await this.client.enqueueSpawnRequest(Y)}async claimSpawnRequest(Y,Z){return this.client.claimSpawnRequest(Y,Z)}}class gG extends u9{sessionsDirPath;client;constructor(Y){let Z=new MX({address:Y.address?.trim()||"127.0.0.1:4317"});super(new D10(Z));this.sessionsDirPath=Y.sessionsDir,this.client=Z}ensureSessionsDir(){if(!Yb0(this.sessionsDirPath))Zb0(this.sessionsDirPath,{recursive:!0});return this.sessionsDirPath}close(){this.client.close()}}x6();import{closeSync as T10,existsSync as Qb0,mkdirSync as Xb0,openSync as Jb0,readFileSync as Wb0,rmSync as I10,writeFileSync as Kb0}from"node:fs";import{dirname as Gb0,resolve as Fb0}from"node:path";var Hb0=15000;function Vb0(Y){return Buffer.from(Y).toString("base64url")}function qb0(Y){return Fb0(H9(),"rpc","spawn-leases",`${Vb0(Y)}.lock`)}function zb0(Y){if(!Number.isInteger(Y)||Y<=0)return!1;try{return process.kill(Y,0),!0}catch{return!1}}function Bb0(Y,Z){try{let W=Wb0(Y,"utf8"),H=JSON.parse(W),F=Number(H.createdAt??0);if(!Number.isFinite(F)||F<=0)return!0;if(Date.now()-F>Z)return!0;return!zb0(Number(H.pid??0))}catch{return!0}}function QO(Y,Z){let W=Math.max(1000,Z?.ttlMs??Hb0),H=qb0(Y);if(Xb0(Gb0(H),{recursive:!0}),Qb0(H)&&Bb0(H,W))I10(H,{force:!0});let F;try{F=Jb0(H,"wx");let J={address:Y,pid:process.pid,createdAt:Date.now()};Kb0(F,JSON.stringify(J),"utf8")}catch{if(typeof F==="number")try{T10(F)}catch{}return}let X=!1;return{path:H,release:()=>{if(X)return;X=!0;try{if(typeof F==="number")T10(F)}catch{}try{I10(H,{force:!0})}catch{}}}}x6();var $10=`
985
+ `,"utf8"),hx0(W,Y)}function _x0(){return H9()}class a00{sessionsDirPath;constructor(Y=_x0()){this.sessionsDirPath=Y}ensureSessionsDir(){if(!pN(this.sessionsDirPath))vx0(this.sessionsDirPath,{recursive:!0});return this.sessionsDirPath}indexPath(){return i00(this.ensureSessionsDir(),"sessions.index.json")}spawnQueuePath(){return i00(this.ensureSessionsDir(),"subagent-spawn-queue.json")}readIndex(){let Y=this.indexPath();if(!pN(Y))return{version:1,sessions:{}};try{let Z=JSON.parse(p00(Y,"utf8"));if(Z?.version===1&&Z.sessions)return Z}catch{}return{version:1,sessions:{}}}writeIndex(Y){r00(this.indexPath(),Y)}readQueue(){let Y=this.spawnQueuePath();if(!pN(Y))return{version:1,nextId:1,requests:[]};try{let Z=JSON.parse(p00(Y,"utf8"));if(Z?.version===1&&typeof Z.nextId==="number"&&Array.isArray(Z.requests))return Z}catch{}return{version:1,nextId:1,requests:[]}}writeQueue(Y){r00(this.spawnQueuePath(),Y)}async upsertSession(Y){let Z=this.readIndex();Z.sessions[Y.sessionId]=Y,this.writeIndex(Z)}async getSession(Y){return this.readIndex().sessions[Y]}async listSessions(Y){return Object.values(this.readIndex().sessions).filter((Z)=>Y.parentSessionId!==void 0?Z.parentSessionId===Y.parentSessionId:!0).filter((Z)=>Y.status!==void 0?Z.status===Y.status:!0).sort((Z,W)=>W.startedAt.localeCompare(Z.startedAt)).slice(0,Y.limit)}async updateSession(Y){let Z=this.readIndex(),W=Z.sessions[Y.sessionId];if(!W)return{updated:!1,statusLock:0};if(Y.expectedStatusLock!==void 0&&W.statusLock!==Y.expectedStatusLock)return{updated:!1,statusLock:W.statusLock};let H=Y.expectedStatusLock!==void 0?Y.expectedStatusLock+1:W.statusLock,F={...W,status:Y.status??W.status,endedAt:Y.endedAt!==void 0?Y.endedAt:W.endedAt??null,exitCode:Y.exitCode!==void 0?Y.exitCode:W.exitCode??null,prompt:Y.prompt!==void 0?Y.prompt:W.prompt??null,metadata:Y.metadata!==void 0?Y.metadata??null:W.metadata??null,parentSessionId:Y.parentSessionId!==void 0?Y.parentSessionId??null:W.parentSessionId??null,parentAgentId:Y.parentAgentId!==void 0?Y.parentAgentId??null:W.parentAgentId??null,agentId:Y.agentId!==void 0?Y.agentId??null:W.agentId??null,conversationId:Y.conversationId!==void 0?Y.conversationId??null:W.conversationId??null,statusLock:H,isSubagent:Y.setRunning||Y.parentSessionId!==void 0?!0:W.isSubagent,updatedAt:iN()};if(Y.setRunning)F.status="running",F.endedAt=null,F.exitCode=null;return Z.sessions[Y.sessionId]=F,this.writeIndex(Z),{updated:!0,statusLock:F.statusLock}}async deleteSession(Y,Z){let W=this.readIndex();if(!W.sessions[Y])return!1;if(delete W.sessions[Y],Z){for(let F of Object.values(W.sessions))if(F.parentSessionId===Y)delete W.sessions[F.sessionId]}return this.writeIndex(W),!0}async enqueueSpawnRequest(Y){let Z=this.readQueue();Z.requests.push({id:Z.nextId,rootSessionId:Y.rootSessionId,parentAgentId:Y.parentAgentId,task:Y.task,systemPrompt:Y.systemPrompt,createdAt:iN()}),Z.nextId+=1,this.writeQueue(Z)}async claimSpawnRequest(Y,Z){let W=this.readQueue(),H=W.requests.find((F)=>F.rootSessionId===Y&&F.parentAgentId===Z&&!F.consumedAt);if(!H)return;return H.consumedAt=iN(),this.writeQueue(W),H.task}}class rN extends u9{constructor(Y){super(new a00(Y))}ensureSessionsDir(){return super.ensureSessionsDir()}}import{createHash as bx0}from"node:crypto";import{mkdir as oN,readFile as Z10,rm as Q10,writeFile as X10}from"node:fs/promises";import{createServer as ux0}from"node:net";import{dirname as J10,join as uG,resolve as mx0}from"node:path";x6();var o00="0.0.30";var aN=o00;var gx0=30000,dx0=15000,cx0=100,W10="CLINE_RPC_STARTUP_LOCK_HELD",K10="CLINE_RPC_OWNER_ID",G10="CLINE_RPC_BUILD_ID",F10="CLINE_RPC_DISCOVERY_PATH",eN=(Y)=>new Promise((Z)=>setTimeout(Z,Y));function lx0(Y){return Y.replace(/[^a-zA-Z0-9_.-]+/g,"_")}function t00(Y){return bx0("sha256").update(Y).digest("hex").slice(0,12)}function YO(Y){return Y&&typeof Y==="object"&&"code"in Y?String(Y.code):""}function H10(Y){let Z=Y.trim(),W=Z.lastIndexOf(":");if(W<=0||W>=Z.length-1)throw Error(`invalid rpc address: ${Y}`);let H=Z.slice(0,W),F=Number.parseInt(Z.slice(W+1),10);if(!Number.isInteger(F)||F<=0||F>65535)throw Error(`invalid rpc port in address: ${Y}`);return{host:H,port:F}}function nx0(){let Y=process.argv[1]?.trim();if(!Y)return;return mx0(process.cwd(),Y)}function V10(Y){let Z=`core=${aN}:rpc=${lt}`;return Y?.trim()?`${Z}:host=${Y.trim()}`:Z}function mG(Y={}){let Z=Y.identityPath?.trim()||nx0(),W=Y.ownerBasis?.trim()||(Z?`${Z}`:`pid:${process.pid}:cwd:${process.cwd()}`),H=Y.ownerPrefix?.trim()||"rpc",F=Y.ownerId?.trim()||process.env[K10]?.trim()||`${H}-${t00(W)}`,X=`${W}:${V10(Y.hostBuildKey)}`,J=process.env[G10]?.trim()||`build-${t00(X)}`,Q=Y.discoveryPath?.trim()||process.env[F10]?.trim()||uG(S8(),"rpc","owners",`${lx0(F)}.json`);return{ownerId:F,buildId:J,entryPath:Z,discoveryPath:Q}}async function q10(Y){try{let Z=JSON.parse(await Z10(Y.discoveryPath,"utf8"));if(typeof Z.ownerId!=="string"||typeof Z.buildId!=="string"||typeof Z.address!=="string"||typeof Z.protocolVersion!=="string")return;return{ownerId:Z.ownerId,buildId:Z.buildId,address:Z.address,protocolVersion:Z.protocolVersion,updatedAt:typeof Z.updatedAt==="string"?Z.updatedAt:new Date().toISOString(),entryPath:typeof Z.entryPath==="string"?Z.entryPath:void 0,pid:typeof Z.pid==="number"?Z.pid:void 0,serverId:typeof Z.serverId==="string"?Z.serverId:void 0,startedAt:typeof Z.startedAt==="string"?Z.startedAt:void 0}}catch{return}}async function z10(Y,Z){await oN(J10(Y.discoveryPath),{recursive:!0}),await X10(Y.discoveryPath,JSON.stringify({ownerId:Y.ownerId,buildId:Y.buildId,updatedAt:new Date().toISOString(),...Z},null,2),"utf8")}async function bG(Y){await Q10(Y.discoveryPath,{force:!0}).catch(()=>{return})}async function px0(Y,Z){if((await q10(Y))?.address===Z)await bG(Y)}function tN(Y){let Z=Y?.rpcVersion?.trim()||"";return!!Z&&Z===RX}function ix0(Y){if(Number(YO(Y))===12)return!0;return(Y instanceof Error?Y.message:String(Y)).toUpperCase().includes("UNIMPLEMENTED")}function rx0(Y){let Z=Y instanceof Error?Y.message:String(Y);return/missing authentication header|401\b|unauthenticated|unauthorized/i.test(Z)}function s00(Y){return ix0(Y)||rx0(Y)}async function sN(Y){let Z=new MX({address:Y});try{try{await Z.stopRuntimeSession("__rpc_probe__")}catch(W){if(s00(W))return!1}return!0}catch(W){return!s00(W)}finally{Z.close()}}async function B10(Y){let Z=await v4(Y);return!!Z?.running&&tN(Z)&&await sN(Y)}async function A10(Y,Z){return new Promise((W)=>{let H=ux0();H.once("error",()=>W(!1)),H.once("listening",()=>H.close(()=>W(!0))),H.listen({host:Y,port:Z})})}async function e00(Y){let{host:Z,port:W}=H10(Y);for(let H=1;H<=40;H+=1){let F=W+H;if(F>65535)break;if(await A10(Z,F))return`${Z}:${F}`}throw Error(`no available rpc port near ${Y}`)}function ax0(Y){let Z=Y.trim().replace(/[^a-zA-Z0-9_.-]+/g,"_");return uG(S8(),"locks",`rpc-start-${Z}.lock`)}function ox0(Y){if(!Number.isInteger(Y)||!Y||Y<=0)return!1;try{return process.kill(Y,0),!0}catch(Z){return YO(Z)==="EPERM"}}async function tx0(Y,Z){let W={pid:process.pid,address:Z,acquiredAt:new Date().toISOString()};await X10(uG(Y,"owner.json"),JSON.stringify(W,null,2),"utf8")}async function sx0(Y){try{let Z=JSON.parse(await Z10(uG(Y,"owner.json"),"utf8"));if(typeof Z.pid!=="number"||typeof Z.address!=="string"||typeof Z.acquiredAt!=="string")return;return{pid:Z.pid,address:Z.address,acquiredAt:Z.acquiredAt}}catch{return}}async function Y10(Y){await Q10(Y,{recursive:!0,force:!0}).catch(()=>{})}async function U10(Y,Z){if(process.env[W10]==="1")return await Z();let W=ax0(Y),H=Date.now();await oN(J10(W),{recursive:!0});while(!0)try{await oN(W,{recursive:!1}),await tx0(W,Y);try{return await Z()}finally{await Y10(W)}}catch(F){if(YO(F)!=="EEXIST")throw F;let X=await sx0(W),J=X?new Date(X.acquiredAt).getTime():Number.NaN;if(!X||!Number.isFinite(J)||Date.now()-J>gx0||!ox0(X.pid)){await Y10(W);continue}if(Date.now()-H>=dx0)throw Error(`timed out waiting for rpc startup lock at ${Y} (owner pid=${X.pid})`);await eN(cx0)}}async function ex0(Y,Z){let W=Z?.address?.trim();if(!W){await bG(Y);return}if((await ct(W).catch(()=>{return}))?.accepted)for(let F=0;F<20;F+=1){if(!(await v4(W))?.running){await bG(Y);return}await eN(100)}if(!(await v4(W))?.running)await bG(Y)}async function N10(Y,Z={}){let W=Z.owner??Z.resolveOwner?.()??mG();return await U10(Y,async()=>{let H=await q10(W);if(H?.address){let Q=await v4(H.address);if(Q?.running&&H.buildId===W.buildId&&H.protocolVersion===RX&&tN(Q)&&await sN(H.address))return{address:H.address,action:"reuse",owner:W};await ex0(W,H)}let F=await v4(Y),{host:X,port:J}=H10(Y);if(!F?.running){if(await A10(X,J))return{address:Y,action:"started",owner:W};return{address:await e00(Y),action:"new-port",owner:W}}if(tN(F)&&await sN(Y)){if(!H)return{address:Y,action:"reuse",owner:W}}return{address:await e00(Y),action:"new-port",owner:W}})}async function O10(Y,Z=B10){for(let W=0;W<60;W+=1){if(await Z(Y))return!0;await eN(100)}return!1}async function ZO(Y,Z){let W=await N10(Y,{owner:Z.owner,resolveOwner:Z.resolveOwner});if(W.action!=="reuse")await Z.spawnIfNeeded(W.address,W.owner);if(!await O10(W.address,Z.readinessCheck))throw Error(`failed to ensure rpc runtime at ${W.address}`);let H=await v4(W.address);return await z10(W.owner,{address:W.address,pid:void 0,serverId:H?.serverId,startedAt:H?.startedAt,protocolVersion:RX,entryPath:W.owner.entryPath}),W}import{existsSync as Yb0,mkdirSync as Zb0}from"node:fs";class D10{client;constructor(Y){this.client=Y}ensureSessionsDir(){return""}async upsertSession(Y){await this.client.upsertSession(Y)}async getSession(Y){return await this.client.getSession(Y)??void 0}async listSessions(Y){return await this.client.listSessions(Y)}async updateSession(Y){return this.client.updateSession({sessionId:Y.sessionId,status:Y.status,endedAt:Y.endedAt,exitCode:Y.exitCode,prompt:Y.prompt,metadata:Y.metadata,parentSessionId:Y.parentSessionId,parentAgentId:Y.parentAgentId,agentId:Y.agentId,conversationId:Y.conversationId,expectedStatusLock:Y.expectedStatusLock,setRunning:Y.setRunning})}async deleteSession(Y,Z){return this.client.deleteSession(Y,Z)}async enqueueSpawnRequest(Y){await this.client.enqueueSpawnRequest(Y)}async claimSpawnRequest(Y,Z){return this.client.claimSpawnRequest(Y,Z)}}class gG extends u9{sessionsDirPath;client;constructor(Y){let Z=new MX({address:Y.address?.trim()||"127.0.0.1:4317"});super(new D10(Z));this.sessionsDirPath=Y.sessionsDir,this.client=Z}ensureSessionsDir(){if(!Yb0(this.sessionsDirPath))Zb0(this.sessionsDirPath,{recursive:!0});return this.sessionsDirPath}close(){this.client.close()}}x6();import{closeSync as T10,existsSync as Qb0,mkdirSync as Xb0,openSync as Jb0,readFileSync as Wb0,rmSync as I10,writeFileSync as Kb0}from"node:fs";import{dirname as Gb0,resolve as Fb0}from"node:path";var Hb0=15000;function Vb0(Y){return Buffer.from(Y).toString("base64url")}function qb0(Y){return Fb0(H9(),"rpc","spawn-leases",`${Vb0(Y)}.lock`)}function zb0(Y){if(!Number.isInteger(Y)||Y<=0)return!1;try{return process.kill(Y,0),!0}catch{return!1}}function Bb0(Y,Z){try{let W=Wb0(Y,"utf8"),H=JSON.parse(W),F=Number(H.createdAt??0);if(!Number.isFinite(F)||F<=0)return!0;if(Date.now()-F>Z)return!0;return!zb0(Number(H.pid??0))}catch{return!0}}function QO(Y,Z){let W=Math.max(1000,Z?.ttlMs??Hb0),H=qb0(Y);if(Xb0(Gb0(H),{recursive:!0}),Qb0(H)&&Bb0(H,W))I10(H,{force:!0});let F;try{F=Jb0(H,"wx");let J={address:Y,pid:process.pid,createdAt:Date.now()};Kb0(F,JSON.stringify(J),"utf8")}catch{if(typeof F==="number")try{T10(F)}catch{}return}let X=!1;return{path:H,release:()=>{if(X)return;X=!0;try{if(typeof F==="number")T10(F)}catch{}try{I10(H,{force:!0})}catch{}}}}x6();var $10=`
986
986
  session_id AS sessionId,
987
987
  source,
988
988
  pid,