@sentio/runtime 4.3.2 → 4.3.3

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.
@@ -1,30 +1,30 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,d as t,f as n,g as r,h as i,i as a,l as o,m as s,n as c,p as l,s as u,t as d}from"./esm-Ajeyb2yg.js";import{B as f,C as p,D as m,E as h,F as g,I as _,L as v,M as y,N as b,O as x,P as S,R as C,S as w,T,V as E,a as D,b as O,g as k,h as A,j,k as M,m as N,n as ee,p as te,s as P,u as F,v as ne,w as re,x as I,y as ie,z as L}from"./plugin-BZBEYadJ.js";import{_ as ae,d as R,f as oe,g as se,m as z,n as ce,p as le,t as ue,x as de}from"./service-v3-3iFcydRx.js";import*as fe from"path";import{dirname as pe,join as me}from"path";import*as B from"fs";import{Readable as he}from"stream";import V from"node:process";import*as ge from"node:zlib";import{promisify as _e,stripVTControlCharacters as ve}from"node:util";import ye from"http";import be from"node:http2";import{Session as xe}from"node:inspector/promises";import{fork as Se}from"child_process";import{fileURLToPath as Ce}from"url";import*as we from"zlib";import{EventEmitter as Te}from"node:events";import Ee from"node:child_process";import H from"node:path";import De from"node:fs";const Oe=ne(`Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM`),ke=S(Oe,0),Ae={writeUnknownFields:!0};function je(e){return e?Object.assign(Object.assign({},Ae),e):Ae}function Me(e,t,n){return Ne(new x,je(n),I(e,t)).finish()}function Ne(e,t,n){for(let r of n.sortedFields){if(!n.isSet(r)){if(r.presence==3)throw Error(`cannot encode ${r} to binary: required field not set`);continue}Pe(e,t,n,r)}if(t.writeUnknownFields)for(let{no:t,wireType:r,data:i}of n.getUnknown()??[])e.tag(t,r).raw(i);return e}function Pe(e,t,n,r){switch(r.fieldKind){case`scalar`:case`enum`:Fe(e,n.desc.typeName,r.name,r.scalar??C.INT32,r.number,n.get(r));break;case`list`:Le(e,t,r,n.get(r));break;case`message`:Ie(e,t,r,n.get(r));break;case`map`:for(let[i,a]of n.get(r))Re(e,t,r,i,a);break}}function Fe(e,t,n,r,i,a){ze(e.tag(i,Be(r)),t,n,r,a)}function Ie(e,t,n,r){n.delimitedEncoding?Ne(e.tag(n.number,M.StartGroup),t,r).tag(n.number,M.EndGroup):Ne(e.tag(n.number,M.LengthDelimited).fork(),t,r).join()}function Le(e,t,n,r){if(n.listKind==`message`){for(let i of r)Ie(e,t,n,i);return}let i=n.scalar??C.INT32;if(n.packed){if(!r.size)return;e.tag(n.number,M.LengthDelimited).fork();for(let t of r)ze(e,n.parent.typeName,n.name,i,t);e.join();return}for(let t of r)Fe(e,n.parent.typeName,n.name,i,n.number,t)}function Re(e,t,n,r,i){switch(e.tag(n.number,M.LengthDelimited).fork(),Fe(e,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case`scalar`:case`enum`:Fe(e,n.parent.typeName,n.name,n.scalar??C.INT32,2,i);break;case`message`:Ne(e.tag(2,M.LengthDelimited).fork(),t,i).join();break}e.join()}function ze(e,t,n,r,i){try{switch(r){case C.STRING:e.string(i);break;case C.BOOL:e.bool(i);break;case C.DOUBLE:e.double(i);break;case C.FLOAT:e.float(i);break;case C.INT32:e.int32(i);break;case C.INT64:e.int64(i);break;case C.UINT64:e.uint64(i);break;case C.FIXED64:e.fixed64(i);break;case C.BYTES:e.bytes(i);break;case C.FIXED32:e.fixed32(i);break;case C.SFIXED32:e.sfixed32(i);break;case C.SFIXED64:e.sfixed64(i);break;case C.SINT64:e.sint64(i);break;case C.UINT32:e.uint32(i);break;case C.SINT32:e.sint32(i);break}}catch(e){throw e instanceof Error?Error(`cannot encode field ${t}.${n} to binary: ${e.message}`):e}}function Be(e){switch(e){case C.BYTES:case C.STRING:return M.LengthDelimited;case C.DOUBLE:case C.FIXED64:case C.SFIXED64:return M.Bit64;case C.FIXED32:case C.SFIXED32:case C.FLOAT:return M.Bit32;default:return M.Varint}}function Ve(e,t,n){let r=!1;return n||(n=w(ke),r=!0),n.value=Me(e,t),n.typeUrl=We(t.$typeName),r?n:void 0}function He(e,t){return e.typeUrl===``?!1:(typeof t==`string`?t:t.typeName)===Ge(e.typeUrl)}function Ue(e,t){if(e.typeUrl===``)return;let n=t.kind==`message`?t:t.getMessage(Ge(e.typeUrl));if(!(!n||!He(e,n)))return ie(n,e.value)}function We(e){return`type.googleapis.com/${e}`}function Ge(e){let t=e.lastIndexOf(`/`),n=t>=0?e.substring(t+1):e;if(!n.length)throw Error(`invalid type url: ${e}`);return n}function Ke(e,t){Xe(t,e);let n=Je(e.$unknown,t),[r,i,a]=Ye(t);for(let e of n)O(r,new m(e.data),i,e.wireType,{readUnknownFields:!0});return a()}function qe(e,t,n){Xe(t,e);let r=(e.$unknown??[]).filter(e=>e.no!==t.number),[i,a]=Ye(t,n),o=new x;Pe(o,{writeUnknownFields:!0},i,a);let s=new m(o.finish());for(;s.pos<s.len;){let[e,t]=s.tag(),n=s.skip(t,e);r.push({no:e,wireType:t,data:n})}e.$unknown=r}function Je(e,t){if(e===void 0)return[];if(t.fieldKind===`enum`||t.fieldKind===`scalar`){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.number)return[e[n]];return[]}return e.filter(e=>e.no===t.number)}function Ye(e,t){let n=e.typeName,r=Object.assign(Object.assign({},e),{kind:`field`,parent:e.extendee,localName:n}),i=Object.assign(Object.assign({},e.extendee),{fields:[r],members:[r],oneofs:[]}),a=w(i,t===void 0?void 0:{[n]:t});return[I(i,a),r,()=>{let t=a[n];if(t===void 0){let t=e.message;return re(t)?v(t.fields[0].scalar,t.fields[0].longAsString):w(t)}return t}]}function Xe(e,t){if(e.extendee.typeName!=t.$typeName)throw Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const Ze={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function Qe(e){return e?Object.assign(Object.assign({},Ze),e):Ze}function $e(e,t,n){return tt(I(e,t),Qe(n))}function et(e,t,n){let r=$e(e,t,n);return JSON.stringify(r,null,n?.prettySpaces??0)}function tt(e,t){let n=ct(e,t);if(n!==void 0)return n;let r={};for(let n of e.sortedFields){if(!e.isSet(n)){if(n.presence==3)throw Error(`cannot encode ${n} to JSON: required field not set`);if(!t.alwaysEmitImplicit||n.presence!==2)continue}let i=nt(n,e.get(n),t);i!==void 0&&(r[st(n,t)]=i)}if(t.registry){let n=new Set;for(let{no:i}of e.getUnknown()??[])if(!n.has(i)){n.add(i);let a=t.registry.getExtensionFor(e.desc,i);if(!a)continue;let[o,s]=Ye(a,Ke(e.message,a)),c=nt(s,o.get(s),t);c!==void 0&&(r[a.jsonName]=c)}}return r}function nt(e,t,n){switch(e.fieldKind){case`scalar`:return ot(e,t);case`message`:return tt(t,n);case`enum`:return at(e.enum,t,n.enumAsInteger);case`list`:return it(t,n);case`map`:return rt(t,n)}}function rt(e,t){let n=e.field(),r={};switch(n.mapKind){case`scalar`:for(let[t,i]of e)r[t]=ot(n,i);break;case`message`:for(let[n,i]of e)r[n]=tt(i,t);break;case`enum`:for(let[i,a]of e)r[i]=at(n.enum,a,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?r:void 0}function it(e,t){let n=e.field(),r=[];switch(n.listKind){case`scalar`:for(let t of e)r.push(ot(n,t));break;case`enum`:for(let i of e)r.push(at(n.enum,i,t.enumAsInteger));break;case`message`:for(let n of e)r.push(tt(n,t));break}return t.alwaysEmitImplicit||r.length>0?r:void 0}function at(e,t,n){if(typeof t!=`number`)throw Error(`cannot encode ${e} to JSON: expected number, got ${h(t)}`);return e.typeName==`google.protobuf.NullValue`?null:n?t:e.value[t]?.name??t}function ot(e,t){switch(e.scalar){case C.INT32:case C.SFIXED32:case C.SINT32:case C.FIXED32:case C.UINT32:if(typeof t!=`number`)throw Error(`cannot encode ${e} to JSON: ${T(e,t)?.message}`);return t;case C.FLOAT:case C.DOUBLE:if(typeof t!=`number`)throw Error(`cannot encode ${e} to JSON: ${T(e,t)?.message}`);return Number.isNaN(t)?`NaN`:t===1/0?`Infinity`:t===-1/0?`-Infinity`:t;case C.STRING:if(typeof t!=`string`)throw Error(`cannot encode ${e} to JSON: ${T(e,t)?.message}`);return t;case C.BOOL:if(typeof t!=`boolean`)throw Error(`cannot encode ${e} to JSON: ${T(e,t)?.message}`);return t;case C.UINT64:case C.FIXED64:case C.INT64:case C.SFIXED64:case C.SINT64:if(typeof t==`bigint`||typeof t==`string`||typeof t==`number`&&Number.isInteger(t))return t.toString();throw Error(`cannot encode ${e} to JSON: ${T(e,t)?.message}`);case C.BYTES:if(t instanceof Uint8Array)return _(t);throw Error(`cannot encode ${e} to JSON: ${T(e,t)?.message}`)}}function st(e,t){return t.useProtoFieldName?e.name:e.jsonName}function ct(e,t){if(e.desc.typeName.startsWith(`google.protobuf.`))switch(e.desc.typeName){case`google.protobuf.Any`:return lt(e.message,t);case`google.protobuf.Timestamp`:return ht(e.message);case`google.protobuf.Duration`:return ut(e.message);case`google.protobuf.FieldMask`:return dt(e.message);case`google.protobuf.Struct`:return ft(e.message);case`google.protobuf.Value`:return pt(e.message);case`google.protobuf.ListValue`:return mt(e.message);default:if(re(e.desc)){let t=e.desc.fields[0];return ot(t,e.get(t))}return}}function lt(e,t){if(e.typeUrl===``)return{};let{registry:n}=t,r,i;if(n&&(r=Ue(e,n),r&&(i=n.getMessage(r.$typeName))),!i||!r)throw Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let a=I(i,r),o=p(i)?{value:ct(a,t)}:tt(a,t);return o[`@type`]=e.typeUrl,o}function ut(e){let t=Number(e.seconds),n=e.nanos;if(t>315576e6||t<-315576e6)throw Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);if(t>0&&n<0||t<0&&n>0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos sign must match seconds sign`);let r=e.seconds.toString();if(n!==0){let e=Math.abs(n).toString();e=`0`.repeat(9-e.length)+e,e.substring(3)===`000000`?e=e.substring(0,3):e.substring(6)===`000`&&(e=e.substring(0,6)),r+=`.`+e,n<0&&t==0&&(r=`-`+r)}return r+`s`}function dt(e){return e.paths.map(t=>{if(E(f(t))!==t)throw Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "${t}" is irreversible`);return f(t)}).join(`,`)}function ft(e){let t={};for(let[n,r]of Object.entries(e.fields))t[n]=pt(r);return t}function pt(e){switch(e.kind.case){case`nullValue`:return null;case`numberValue`:if(!Number.isFinite(e.kind.value))throw Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case`boolValue`:return e.kind.value;case`stringValue`:return e.kind.value;case`structValue`:return ft(e.kind.value);case`listValue`:return mt(e.kind.value);default:throw Error(`${e.$typeName} must have a value`)}}function mt(e){return e.values.map(pt)}function ht(e){let t=Number(e.seconds)*1e3;if(t<Date.parse(`0001-01-01T00:00:00Z`)||t>Date.parse(`9999-12-31T23:59:59Z`))throw Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);if(e.nanos>999999999)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be greater than 99999999`);let n=`Z`;if(e.nanos>0){let t=(e.nanos+1e9).toString().substring(1);n=t.substring(3)===`000000`?`.`+t.substring(0,3)+`Z`:t.substring(6)===`000`?`.`+t.substring(0,6)+`Z`:`.`+t+`Z`}return new Date(t).toISOString().replace(`.000Z`,n)}const gt={ignoreUnknownFields:!1};function _t(e){return e?Object.assign(Object.assign({},gt),e):gt}function vt(e,t,n){return yt(e,It(t,e.typeName),n)}function yt(e,t,n){let r=I(e);try{St(r,t,_t(n))}catch(e){throw y(e)?Error(`cannot decode ${e.field()} from JSON: ${e.message}`,{cause:e}):e}return r.message}const bt=new WeakMap;function xt(e,t){if(!bt.has(e)){let t=new Map;for(let n of e.fields)t.set(n.name,n).set(n.jsonName,n);bt.set(e,t)}return bt.get(e)?.get(t)}function St(e,t,n){if(Lt(e,t,n))return;if(t==null||Array.isArray(t)||typeof t!=`object`)throw Error(`cannot decode ${e.desc} from JSON: ${h(t)}`);let r=new Map;for(let[i,a]of Object.entries(t)){let t=xt(e.desc,i);if(t){if(t.oneof){if(a===null&&t.fieldKind==`scalar`)continue;let e=r.get(t.oneof);if(e!==void 0)throw new j(t.oneof,`oneof set multiple times by ${e.name} and ${t.name}`);r.set(t.oneof,t)}Ct(e,t,a,n)}else{let t;if(i.startsWith(`[`)&&i.endsWith(`]`)&&(t=n.registry?.getExtension(i.substring(1,i.length-1)))&&t.extendee.typeName===e.desc.typeName){let[r,i,o]=Ye(t);Ct(r,i,a,n),qe(e.message,t,o())}if(!t&&!n.ignoreUnknownFields)throw Error(`cannot decode ${e.desc} from JSON: key "${i}" is unknown`)}}}function Ct(e,t,n,r){switch(t.fieldKind){case`scalar`:kt(e,t,n);break;case`enum`:Ot(e,t,n,r);break;case`message`:Dt(e,t,n,r);break;case`list`:Et(e.get(t),n,r);break;case`map`:Tt(e.get(t),n,r);break}}function wt(e,t,n){if(e.scalar&&t!==null)return Nt(e,t);if(e.message&&!At(e,t)){let r=I(e.message);return St(r,t,n),r}if(e.enum&&!At(e,t))return Mt(e.enum,t,n.ignoreUnknownFields);throw new j(e,`${e.fieldKind===`list`?`list item`:`map value`} must not be null`)}function Tt(e,t,n){if(t===null)return;let r=e.field();if(typeof t!=`object`||Array.isArray(t))throw new j(r,`expected object, got `+h(t));for(let[i,a]of Object.entries(t)){let t=Pt(r.mapKey,i),o=wt(r,a,n);o!==jt&&e.set(t,o)}}function Et(e,t,n){if(t===null)return;let r=e.field();if(!Array.isArray(t))throw new j(r,`expected Array, got `+h(t));for(let i of t){let t=wt(r,i,n);t!==jt&&e.add(t)}}function Dt(e,t,n,r){if(At(t,n)){e.clear(t);return}let i=e.isSet(t)?e.get(t):I(t.message);St(i,n,r),e.set(t,i)}function Ot(e,t,n,r){if(At(t,n)){e.clear(t);return}let i=Mt(t.enum,n,r.ignoreUnknownFields);i!==jt&&e.set(t,i)}function kt(e,t,n){n===null?e.clear(t):e.set(t,Nt(t,n))}function At(e,t){return t===null&&e.message?.typeName!=`google.protobuf.Value`&&e.enum?.typeName!=`google.protobuf.NullValue`}const jt=Symbol();function Mt(e,t,n){if(t===null)return e.values[0].number;switch(typeof t){case`number`:if(Number.isInteger(t))return t;break;case`string`:let r=e.values.find(e=>e.name===t);if(r!==void 0)return r.number;if(n)return jt;break}throw Error(`cannot decode ${e} from JSON: ${h(t)}`)}function Nt(e,t){switch(e.scalar){case C.DOUBLE:case C.FLOAT:if(t===`NaN`)return NaN;if(t===`Infinity`)return 1/0;if(t===`-Infinity`)return-1/0;if(typeof t==`number`){if(Number.isNaN(t))throw new j(e,`unexpected NaN number`);if(!Number.isFinite(t))throw new j(e,`unexpected infinite number`);break}if(typeof t==`string`){if(t===``||t.trim().length!==t.length)break;let e=Number(t);if(!Number.isFinite(e))break;return e}break;case C.INT32:case C.FIXED32:case C.SFIXED32:case C.SINT32:case C.UINT32:return Ft(t);case C.BYTES:if(typeof t==`string`){if(t===``)return new Uint8Array;try{return g(t)}catch(t){throw new j(e,t instanceof Error?t.message:String(t))}}break}return t}function Pt(e,t){switch(e){case C.BOOL:switch(t){case`true`:return!0;case`false`:return!1}return t;case C.INT32:case C.FIXED32:case C.UINT32:case C.SFIXED32:case C.SINT32:return Ft(t);default:return t}}function Ft(e){if(typeof e==`string`){if(e===``||e.trim().length!==e.length)return e;let t=Number(e);return Number.isNaN(t)?e:t}return e}function It(e,t){try{return JSON.parse(e)}catch(e){let n=e instanceof Error?e.message:String(e);throw Error(`cannot decode message ${t} from JSON: ${n}`,{cause:e})}}function Lt(e,t,n){if(!e.desc.typeName.startsWith(`google.protobuf.`))return!1;switch(e.desc.typeName){case`google.protobuf.Any`:return Rt(e.message,t,n),!0;case`google.protobuf.Timestamp`:return zt(e.message,t),!0;case`google.protobuf.Duration`:return Bt(e.message,t),!0;case`google.protobuf.FieldMask`:return Vt(e.message,t),!0;case`google.protobuf.Struct`:return Ht(e.message,t),!0;case`google.protobuf.Value`:return Ut(e.message,t),!0;case`google.protobuf.ListValue`:return Wt(e.message,t),!0;default:if(re(e.desc)){let n=e.desc.fields[0];return t===null?e.clear(n):e.set(n,Nt(n,t)),!0}return!1}}function Rt(e,t,n){if(t===null||Array.isArray(t)||typeof t!=`object`)throw Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${h(t)}`);if(Object.keys(t).length==0)return;let r=t[`@type`];if(typeof r!=`string`||r==``)throw Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);let i=r.includes(`/`)?r.substring(r.lastIndexOf(`/`)+1):r;if(!i.length)throw Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);let a=n.registry?.getMessage(i);if(!a)throw Error(`cannot decode message ${e.$typeName} from JSON: ${r} is not in the type registry`);let o=I(a);if(p(a)&&Object.prototype.hasOwnProperty.call(t,`value`)){let e=t.value;St(o,e,n)}else{let e=Object.assign({},t);delete e[`@type`],St(o,e,n)}Ve(o.desc,o.message,e)}function zt(e,t){if(typeof t!=`string`)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);let n=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);let r=Date.parse(n[1]+`-`+n[2]+`-`+n[3]+`T`+n[4]+`:`+n[5]+`:`+n[6]+(n[8]?n[8]:`Z`));if(Number.isNaN(r))throw Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(r<Date.parse(`0001-01-01T00:00:00Z`)||r>Date.parse(`9999-12-31T23:59:59Z`))throw Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=L.parse(r/1e3),e.nanos=0,n[7]&&(e.nanos=parseInt(`1`+n[7]+`0`.repeat(9-n[7].length))-1e9)}function Bt(e,t){if(typeof t!=`string`)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);let n=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);let r=Number(n[1]);if(r>315576e6||r<-315576e6)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);if(e.seconds=L.parse(r),typeof n[2]!=`string`)return;let i=n[2]+`0`.repeat(9-n[2].length);e.nanos=parseInt(i),(r<0||Object.is(r,-0))&&(e.nanos=-e.nanos)}function Vt(e,t){if(typeof t!=`string`)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);t!==``&&(e.paths=t.split(`,`).map(t=>{if(t.includes(`_`))throw Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);return E(t)}))}function Ht(e,t){if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`cannot decode message ${e.$typeName} from JSON ${h(t)}`);for(let[n,r]of Object.entries(t)){let t=w(k);Ut(t,r),e.fields[n]=t}}function Ut(e,t){switch(typeof t){case`number`:e.kind={case:`numberValue`,value:t};break;case`string`:e.kind={case:`stringValue`,value:t};break;case`boolean`:e.kind={case:`boolValue`,value:t};break;case`object`:if(t===null)e.kind={case:`nullValue`,value:N.NULL_VALUE};else if(Array.isArray(t)){let n=w(te);Wt(n,t),e.kind={case:`listValue`,value:n}}else{let n=w(A);Ht(n,t),e.kind={case:`structValue`,value:n}}break;default:throw Error(`cannot decode message ${e.$typeName} from JSON ${h(t)}`)}return e}function Wt(e,t){if(!Array.isArray(t))throw Error(`cannot decode message ${e.$typeName} from JSON ${h(t)}`);for(let n of t){let t=w(k);Ut(t,n),e.values.push(t)}}function Gt(...e){let t=new AbortController,n=e.filter(e=>e!==void 0).concat(t.signal);for(let e of n){if(e.aborted){r.apply(e);break}e.addEventListener(`abort`,r)}function r(){t.signal.aborted||t.abort(qt(this));for(let e of n)e.removeEventListener(`abort`,r)}return t}function Kt(e){let t=new AbortController,n=()=>{t.abort(new R(`the operation timed out`,z.DeadlineExceeded))},r;return e!==void 0&&(e<=0?n():r=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(r)}}function qt(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;let t=Error(`This operation was aborted`);return t.name=`AbortError`,t}function Jt(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}function Yt(e){let t;if(e.timeoutMs!==void 0){let n=new Date(Date.now()+e.timeoutMs);t=()=>n.getTime()-Date.now()}else t=()=>void 0;let n=Kt(e.timeoutMs),r=Gt(n.signal,e.requestSignal,e.shutdownSignal);return Object.assign(Object.assign({},e),{signal:r.signal,timeoutMs:t,requestHeader:new Headers(e.requestHeader),responseHeader:new Headers(e.responseHeader),responseTrailer:new Headers(e.responseTrailer),abort(e){n.cleanup(),r.abort(e)},values:e.contextValues??Jt()})}function Xt(e,t){return{kind:e.methodKind,method:e,impl:t}}function Zt(e,t){let n={service:e,methods:{}};for(let r of e.methods){let i=t[r.localName];if(typeof i==`function`)i=i.bind(t);else{let t=`${e.typeName}.${r.name} is not implemented`;i=function(){throw new R(t,z.Unimplemented)}}n.methods[r.localName]=Xt(r,i)}return n}function Qt(e){let t=new Headers,n=new TextDecoder().decode(e).split(`\r
3
- `);for(let e of n){if(e===``)continue;let n=e.indexOf(`:`);if(n>0){let r=e.substring(0,n).trim(),i=e.substring(n+1).trim();t.append(r,i)}}return t}function $t(e){let t=[];return e.forEach((e,n)=>{t.push(`${n}: ${e}\r\n`)}),new TextEncoder().encode(t.join(``))}function en(){return{serialize:$t,parse:Qt}}const tn=`Content-Type`,nn=`Grpc-Encoding`,rn=`Grpc-Accept-Encoding`,an=`Grpc-Timeout`,on=`Grpc-Status`,sn=/^application\/grpc-web(-text)?(?:\+(?:(json)(?:; ?charset=utf-?8)?|proto))?$/i;function cn(e){let t=e?.match(sn);if(t)return{text:!!t[1],binary:!t[2]}}function ln(e,t){if(e===null)return{};let n=/^(\d{1,8})([HMSmun])$/.exec(e);if(n===null)return{error:new R(`protocol error: invalid grpc timeout value: ${e}`,z.InvalidArgument)};let r={H:3600*1e3,M:60*1e3,S:1e3,m:1,u:.001,n:1e-6}[n[2]]*parseInt(n[1]);return r>t?{timeoutMs:r,error:new R(`timeout ${r}ms must be <= ${t}`,z.InvalidArgument)}:{timeoutMs:r}}const un=S(ne(`CgxzdGF0dXMucHJvdG8SCmdvb2dsZS5ycGMiTgoGU3RhdHVzEgwKBGNvZGUYASABKAUSDwoHbWVzc2FnZRgCIAEoCRIlCgdkZXRhaWxzGAMgAygLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUJeCg5jb20uZ29vZ2xlLnJwY0ILU3RhdHVzUHJvdG9QAVo3Z29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9ycGMvc3RhdHVzO3N0YXR1c6ICA1JQQ2IGcHJvdG8z`,[Oe]),0);function dn(e,t){let n;return n=t===void 0?typeof e==`string`?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e):Me(t,e),_(n,`std_raw`)}function fn(...e){let t=new Headers;for(let n of e)n.forEach((e,n)=>{t.append(n,e)});return t}function pn(e,t){if(t){if(t.metadata.forEach((t,n)=>{e.append(n,t)}),e.set(on,t.code.toString(10)),e.set(`Grpc-Message`,encodeURIComponent(t.rawMessage)),t.details.length>0){let n=w(un,{code:t.code,message:t.rawMessage,details:t.details.map(e=>`desc`in e?Ve(e.desc,w(e.desc,e.value)):{typeUrl:`type.googleapis.com/${e.type}`,value:e.value})});e.set(`Grpc-Status-Details-Bin`,dn(n,un))}}else e.set(on,`0`);return e}function mn(e,t,n,r){let i=null,a=null,o;if(t!==null&&t!==`identity`){let n=e.find(e=>e.name===t);if(n)i=n;else{let n=e.map(e=>e.name).join(`,`);o=new R(`unknown compression "${t}": supported encodings are ${n}`,z.Unimplemented,{[r]:n})}}if(n===null||n===``)a=i;else{let t=n.split(`,`).map(e=>e.trim());for(let n of t){let t=e.find(e=>e.name===n);if(t){a=t;break}}}return{request:i,response:a,error:o}}const hn=4294967295,gn=hn;function _n(e,t,n){if(t??=gn,e??=hn,n??=1024,t<1||t>gn)throw new R(`writeMaxBytes ${t} must be >= 1 and <= ${gn}`,z.Internal);if(e<1||e>hn)throw new R(`readMaxBytes ${e} must be >= 1 and <= ${hn}`,z.Internal);return{readMaxBytes:e,writeMaxBytes:t,compressMinBytes:n}}function vn(e,t){if(t>e)throw new R(`message size ${t} is larger than configured writeMaxBytes ${e}`,z.ResourceExhausted)}function yn(e,t,n=!1){if(t>e){let r=`message size is larger than configured readMaxBytes ${e}`;throw n&&(r=`message size ${t} is larger than configured readMaxBytes ${e}`),new R(r,z.ResourceExhausted)}}function bn(e){return new xn(e)}var xn=class{constructor(e){this.readMaxBytes=e,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((e,t)=>e+t.byteLength,0)}decode(e){this.buf.push(e);let t=[];for(;;){let e=this.pop();if(!e)break;t.push(e)}return t}pop(){if(!(!this.env&&(this.env=this.head(),!this.env))&&this.cons(this.env.data)){let e=this.env;return this.env=void 0,e}}head(){if(!this.cons(this.header))return;let e=this.headerView.getUint8(0),t=this.headerView.getUint32(1);return yn(this.readMaxBytes,t,!0),{flags:e,data:new Uint8Array(t)}}cons(e){let t=e.byteLength;if(this.byteLength<t)return!1;let n=0;for(;n<t;){let r=this.buf.shift();r.byteLength>t-n?(e.set(r.subarray(0,t-n),n),this.buf.unshift(r.subarray(t-n)),n+=t-n):(e.set(r,n),n+=r.byteLength)}return!0}};async function Sn(e,t,n){let{flags:r,data:i}=e;if((r&1)==1)throw new R(`invalid envelope, already compressed`,z.Internal);return t&&i.byteLength>=n&&(i=await t.compress(i),r|=1),{data:i,flags:r}}async function Cn(e,t,n){let{flags:r,data:i}=e;if((r&1)==1){if(!t)throw new R(`received compressed envelope, but do not know how to decompress`,z.Internal);i=await t.decompress(i,n),r^=1}return{data:i,flags:r}}function wn(e,t){let n=new Uint8Array(t.length+5);n.set(t,5);let r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var Tn=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},U=function(e){return this instanceof U?(this.v=e,this):new U(e)},En=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof U?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}},Dn=function(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:U(e[r](t)),done:!1}:i?i(t):t}:i}};function On(e,...t){return En(this,arguments,function*(){var n;let[r,i]=kn(t),a,o=e[Symbol.asyncIterator](),s={[Symbol.asyncIterator](){return o}};i?.propagateDownStreamError===!0&&(s=a=Vn(s));for(let e of r)s=e(s);let c=s[Symbol.asyncIterator]();try{for(;;){let e=yield U(c.next());if(e.done===!0)break;if(!a){yield yield U(e.value);continue}try{yield yield U(e.value)}catch(e){throw yield U(a.abort(e)),e}}}finally{i?.propagateDownStreamError===!0&&((n=o.return)==null||n.call(o).catch(()=>{}))}})}function kn(e){let t;return typeof e[e.length-1]!=`function`&&(t=e.pop()),[e,t]}function An(e){return function(t){return En(this,arguments,function*(){let n,r=t[Symbol.asyncIterator]();for(;;){let e;try{e=yield U(r.next())}catch(e){n=e;break}if(e.done===!0)break;yield yield U(e.value)}let i=yield U(e(n));i!==void 0&&(yield yield U(i))})}}function jn(e){return function(t){return En(this,arguments,function*(){var n,r,i,a;let o=yield U(e());o!==void 0&&(yield yield U(o));try{for(var s=!0,c=Tn(t),l;l=yield U(c.next()),n=l.done,!n;s=!0)a=l.value,s=!1,yield yield U(a)}catch(e){r={error:e}}finally{try{!s&&!n&&(i=c.return)&&(yield U(i.call(c)))}finally{if(r)throw r.error}}})}}function Mn(e,t,n){return t===void 0||n===void 0?function(t){return En(this,arguments,function*(){var n,r,i,a;try{for(var o=!0,s=Tn(t),c;c=yield U(s.next()),n=c.done,!n;o=!0){a=c.value,o=!1;let t=a;yield yield U({flags:0,data:e.serialize(t)})}}catch(e){r={error:e}}finally{try{!o&&!n&&(i=s.return)&&(yield U(i.call(s)))}finally{if(r)throw r.error}}})}:function(r){return En(this,arguments,function*(){var i,a,o,s;try{for(var c=!0,l=Tn(r),u;u=yield U(l.next()),i=u.done,!i;c=!0){s=u.value,c=!1;let r=s,i,a=0;r.end?(a|=t,i=n.serialize(r.value)):i=e.serialize(r.value),yield yield U({flags:a,data:i})}}catch(e){a={error:e}}finally{try{!c&&!i&&(o=l.return)&&(yield U(o.call(l)))}finally{if(a)throw a.error}}})}}function Nn(e,t,n){return n&&t!==void 0?function(r){return En(this,arguments,function*(){var i,a,o,s;try{for(var c=!0,l=Tn(r),u;u=yield U(l.next()),i=u.done,!i;c=!0){s=u.value,c=!1;let{flags:r,data:i}=s;(r&t)===t?yield yield U({value:n.parse(i),end:!0}):yield yield U({value:e.parse(i),end:!1})}}catch(e){a={error:e}}finally{try{!c&&!i&&(o=l.return)&&(yield U(o.call(l)))}finally{if(a)throw a.error}}})}:function(r){return En(this,arguments,function*(){var i,a,o,s;try{for(var c=!0,l=Tn(r),u;u=yield U(l.next()),i=u.done,!i;c=!0){s=u.value,c=!1;let{flags:r,data:i}=s;if(t!==void 0&&(r&t)===t){if(n===null)throw new R(`unexpected end flag`,z.InvalidArgument);continue}yield yield U(e.parse(i))}}catch(e){a={error:e}}finally{try{!c&&!i&&(o=l.return)&&(yield U(o.call(l)))}finally{if(a)throw a.error}}})}}function Pn(e,t){return function(n){return En(this,arguments,function*(){var r,i,a,o;try{for(var s=!0,c=Tn(n),l;l=yield U(c.next()),r=l.done,!r;s=!0)o=l.value,s=!1,yield yield U(yield U(Sn(o,e,t)))}catch(e){i={error:e}}finally{try{!s&&!r&&(a=c.return)&&(yield U(a.call(c)))}finally{if(i)throw i.error}}})}}function Fn(e,t){return function(n){return En(this,arguments,function*(){var r,i,a,o;try{for(var s=!0,c=Tn(n),l;l=yield U(c.next()),r=l.done,!r;s=!0)o=l.value,s=!1,yield yield U(yield U(Cn(o,e,t)))}catch(e){i={error:e}}finally{try{!s&&!r&&(a=c.return)&&(yield U(a.call(c)))}finally{if(i)throw i.error}}})}}function In(){return function(e){return En(this,arguments,function*(){var t,n,r,i;try{for(var a=!0,o=Tn(e),s;s=yield U(o.next()),t=s.done,!t;a=!0){i=s.value,a=!1;let{flags:e,data:t}=i;yield yield U(wn(e,t))}}catch(e){n={error:e}}finally{try{!a&&!t&&(r=o.return)&&(yield U(r.call(o)))}finally{if(n)throw n.error}}})}}function Ln(e){return function(t){return En(this,arguments,function*(){var n,r,i,a;let o=bn(e);try{for(var s=!0,c=Tn(t),l;l=yield U(c.next()),n=l.done,!n;s=!0){a=l.value,s=!1;let e=a;for(let t of o.decode(e))yield yield U(t)}}catch(e){r={error:e}}finally{try{!s&&!n&&(i=c.return)&&(yield U(i.call(c)))}finally{if(r)throw r.error}}if(o.byteLength>0)throw new R(`protocol error: incomplete envelope`,z.InvalidArgument)})}}async function Rn(e,t,n){var r,i,a,o,s,c,l,u;let[d,f]=zn(n);if(d){f>t&&yn(t,f,!0);let n=new Uint8Array(f),s=0;try{for(var p=!0,m=Tn(e),h;h=await m.next(),r=h.done,!r;p=!0){o=h.value,p=!1;let e=o;if(s+e.byteLength>f)throw new R(`protocol error: promised ${f} bytes, received ${s+e.byteLength}`,z.InvalidArgument);n.set(e,s),s+=e.byteLength}}catch(e){i={error:e}}finally{try{!p&&!r&&(a=m.return)&&await a.call(m)}finally{if(i)throw i.error}}if(s<f)throw new R(`protocol error: promised ${f} bytes, received ${s}`,z.InvalidArgument);return n}let g=[],_=0;try{for(var v=!0,y=Tn(e),b;b=await y.next(),s=b.done,!s;v=!0){u=b.value,v=!1;let e=u;_+=e.byteLength,yn(t,_),g.push(e)}}catch(e){c={error:e}}finally{try{!v&&!s&&(l=y.return)&&await l.call(y)}finally{if(c)throw c.error}}let x=new Uint8Array(_),S=0;for(let e=g.shift();e;e=g.shift())x.set(e,S),S+=e.byteLength;return x}function zn(e){if(e==null)return[!1,0];let t=typeof e==`string`?parseInt(e,10):e;return!Number.isSafeInteger(t)||t<0?[!1,t]:[!0,t]}async function Bn(e){let t=e[Symbol.asyncIterator](),n=await t.next();return{[Symbol.asyncIterator](){let e={async next(){if(n!==null){let e=n;return n=null,e}return await t.next()}};return t.throw!==void 0&&(e.throw=e=>t.throw(e)),t.return!==void 0&&(e.return=e=>t.return(e)),e}}}function Vn(e){let t=e[Symbol.asyncIterator]();if(t.throw===void 0)throw Error(`AsyncIterable does not implement throw`);let n=t,r,i,a={next(){return i=n.next().finally(()=>{i=void 0}),i},throw(e){return n.throw(e)}};t.return!==void 0&&(a=Object.assign(Object.assign({},a),{return(e){return n.return(e)}}));let o=!1;return{abort(e){if(r)return r.state;let t=()=>n.throw(e).then(e=>e.done===!0?`completed`:`caught`,()=>`rethrown`);return i?(r={reason:e,state:i.then(t,t)},r.state):(r={reason:e,state:t()},r.state)},[Symbol.asyncIterator](){if(o)throw Error(`AsyncIterable cannot be re-used`);return o=!0,a}}}function Hn(e){return En(this,arguments,function*(){yield U(yield*Dn(Tn(e)))})}function Un(...e){let t=new Map,n=e.reduce((e,t)=>e.concat(`supported`in t?t.supported:t),[]);function r(e){if(e===null||e.length==0)return!1;let r=t.get(e);if(r!==void 0)return r;let i=n.some(t=>t.test(e));return t.size<1024&&t.set(e,i),i}return r.supported=n,r}function Wn(e,t){return e.toString().replace(/\/?$/,`/${t.parent.typeName}/${t.name}`)}function Gn(e,t){return w(e,t)}function Kn(e,t){function n(t){return t.done===!0?t:{done:t.done,value:Gn(e,t.value)}}return{[Symbol.asyncIterator](){let e=t[Symbol.asyncIterator](),r={next:()=>e.next().then(n)};return e.throw!==void 0&&(r.throw=t=>e.throw(t).then(n)),e.return!==void 0&&(r.return=t=>e.return(t).then(n)),r}}}function qn(e,t){if(!t)return e;for(let n of t.concat().reverse())e=n(e);return e}var Jn=function(e){return this instanceof Jn?(this.v=e,this):new Jn(e)},Yn=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Jn?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}},Xn=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Zn=function(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Jn(e[r](t)),done:!1}:i?i(t):t}:i}};async function Qn(e,t,n,r){let{message:i,header:a,trailer:o}=await qn(async n=>Object.assign({message:Gn(e.method.output,await e.impl(n.message,ir(t,n))),stream:!1,method:e.method},rr(t,e)),r)(Object.assign({stream:!1,message:n,method:e.method},nr(t,e)));return ar(a,t.responseHeader),ar(o,t.responseTrailer),i}function $n(e,t,n){switch(e.kind){case`unary`:return function(r){return Yn(this,arguments,function*(){yield yield Jn(yield Jn(Qn(e,t,yield Jn(tr(r,`unary`)),n)))})};case`server_streaming`:return function(r){return er(e,t,r,n,async n=>{let r=Kn(e.method.output,e.impl(await tr(n.message,`server-streaming`),ir(t,n)));return Object.assign({stream:!0,message:r,method:e.method},rr(t,e))})};case`client_streaming`:return function(r){return er(e,t,r,n,async n=>Object.assign({message:Hn([Gn(e.method.output,await e.impl(n.message,ir(t,n)))]),stream:!0,method:e.method},rr(t,e)))};case`bidi_streaming`:return function(r){return er(e,t,r,n,n=>Promise.resolve(Object.assign({message:Kn(e.method.output,e.impl(n.message,ir(t,n))),stream:!0,method:e.method},rr(t,e))))}}}function er(e,t,n,r,i){return Yn(this,arguments,function*(){let{message:a,header:o,trailer:s}=yield Jn(qn(i,r)(Object.assign({stream:!0,message:n,method:e.method},nr(t,e))));ar(o,t.responseHeader),yield Jn(yield*Zn(Xn(a))),ar(s,t.responseTrailer)})}async function tr(e,t){let n=e[Symbol.asyncIterator](),r=await n.next();if(r.done===!0)throw new R(`protocol error: missing input message for ${t} method`,z.Unimplemented);if((await n.next()).done!==!0)throw new R(`protocol error: received extra input message for ${t} method`,z.Unimplemented);return r.value}function nr(e,t){return{requestMethod:e.requestMethod,url:e.url,signal:e.signal,header:e.requestHeader,service:t.method.parent,contextValues:e.values}}function rr(e,t){return{service:t.method.parent,header:e.responseHeader,trailer:e.responseTrailer}}function ir(e,t){return Object.assign(Object.assign({},e),{service:t.service,requestHeader:t.header,signal:t.signal,values:t.contextValues})}function ar(e,t){e!==t&&(t.forEach((e,n)=>{t.delete(n)}),e.forEach((e,n)=>{t.set(n,e)}))}function or(e){let t=Object.assign({},e);return t.ignoreUnknownFields??=!0,t}function sr(e,t,n,r){let i=cr(lr(e.input,t),r),a=cr(ur(e.input,n),r),o=cr(lr(e.output,t),r),s=cr(ur(e.output,n),r);return{getI(e){return e?i:a},getO(e){return e?o:s}}}function cr(e,t){return{serialize(n){let r=e.serialize(n);return vn(t.writeMaxBytes,r.byteLength),r},parse(n){return yn(t.readMaxBytes,n.byteLength,!0),e.parse(n)}}}function lr(e,t){return{parse(n){try{return ie(e,n,t)}catch(e){throw new R(`parse binary: ${e instanceof Error?e.message:String(e)}`,z.Internal)}},serialize(n){try{return Me(e,n,t)}catch(e){throw new R(`serialize binary: ${e instanceof Error?e.message:String(e)}`,z.Internal)}}}}function ur(e,t){let n=t?.textEncoder??new TextEncoder,r=t?.textDecoder??new TextDecoder,i=or(t);return{parse(t){try{return vt(e,r.decode(t),i)}catch(e){throw R.from(e,z.InvalidArgument)}},serialize(t){try{let r=et(e,t,i);return n.encode(r)}catch(e){throw R.from(e,z.Internal)}}}}function dr(e){if(!(typeof e.body==`object`&&e.body!==null&&Symbol.asyncIterator in e.body))throw Error(`byte stream required, but received JSON`)}const fr={status:200},pr={status:404},mr={status:415},hr={status:405},gr={status:505};function _r(e){e??={};let t=e.acceptCompression?[...e.acceptCompression]:[],n=e.requireConnectProtocolHeader??!1,r=e.maxTimeoutMs??2**53-1;return Object.assign(Object.assign({acceptCompression:t},_n(e.readMaxBytes,e.writeMaxBytes,e.compressMinBytes)),{jsonOptions:e.jsonOptions,binaryOptions:e.binaryOptions,maxTimeoutMs:r,shutdownSignal:e.shutdownSignal,requireConnectProtocolHeader:n,interceptors:e.interceptors??[]})}function vr(e,t){return Object.entries(e.methods).map(([,e])=>yr(e,t))}function yr(e,t){return br(t.map(t=>t(e)))}function br(e){if(e.length==0)throw new R(`at least one protocol is required`,z.Internal);let t=e[0].service,n=e[0].method,r=e[0].requestPath;if(e.some(e=>e.service!==t||e.method!==n))throw new R(`cannot negotiate protocol for different RPCs`,z.Internal);if(e.some(e=>e.requestPath!==r))throw new R(`cannot negotiate protocol for different requestPaths`,z.Internal);async function i(t){if(n.methodKind==`bidi_streaming`&&t.httpVersion.startsWith(`1.`))return Object.assign(Object.assign({},gr),{header:new Headers({Connection:`close`})});let r=t.header.get(`Content-Type`)??``,i=e.filter(e=>e.allowedMethods.includes(t.method));if(i.length==0)return hr;if(i.length==1&&r===``){let e=i[0];return e(t)}let a=i.filter(e=>e.supportedContentType(r));if(a.length==0)return mr;let o=a[0];return o(t)}return Object.assign(i,{service:t,method:n,requestPath:r,supportedContentType:Un(...e.map(e=>e.supportedContentType)),protocolNames:e.flatMap(e=>e.protocolNames).filter((e,t,n)=>n.indexOf(e)===t),allowedMethods:e.flatMap(e=>e.allowedMethods).filter((e,t,n)=>n.indexOf(e)===t)})}const xr=`grpc-web`,Sr=`POST`;function Cr(e){let t=_r(e),n=en();function r(e){let r=wr(t,n,e);return Object.assign(r,{protocolNames:[xr],allowedMethods:[Sr],supportedContentType:Un(sn),requestPath:Wn(`/`,e.method),service:e.method.parent,method:e.method})}return r.protocolName=xr,r}function wr(e,t,n){let r=sr(n.method,e.binaryOptions,e.jsonOptions,e);return async function(i){dr(i);let a=cn(i.header.get(tn));if(a==null||a.text)return mr;if(i.method!==Sr)return hr;let o=ln(i.header.get(an),e.maxTimeoutMs),s=Yt(Object.assign(Object.assign({},n),{service:n.method.parent,requestMethod:i.method,protocolName:xr,timeoutMs:o.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:i.signal,requestHeader:i.header,url:i.url,responseHeader:{[tn]:a.binary?`application/grpc-web+proto`:`application/grpc-web+json`},responseTrailer:{[on]:`0`},contextValues:i.contextValues})),c=mn(e.acceptCompression,i.header.get(nn),i.header.get(rn),rn);c.response&&s.responseHeader.set(nn,c.response.name);let l=On(i.body,jn(()=>{if(c.error)throw c.error;if(o.error)throw o.error}),Ln(e.readMaxBytes),Fn(c.request,e.readMaxBytes),Nn(r.getI(a.binary),128)),u=$n(n,s,e.interceptors)(l)[Symbol.asyncIterator](),d=On({[Symbol.asyncIterator](){return{next:()=>u.next(),throw:e=>(s.abort(e),u.throw?.call(u,e)??Promise.reject({done:!0})),return:e=>(s.abort(),u.return?.call(u,e)??Promise.resolve({done:!0,value:e}))}}},Mn(r.getO(a.binary)),An(e=>(s.abort(e),e instanceof R?pn(s.responseTrailer,e):e!==void 0&&pn(s.responseTrailer,new R(`internal error`,z.Internal,void 0,void 0,e)),{flags:128,data:t.serialize(s.responseTrailer)})),Pn(c.response,e.compressMinBytes),In(),{propagateDownStreamError:!0});return Object.assign(Object.assign({},fr),{body:await Bn(d),header:s.responseHeader})}}const Tr=/^application\/grpc(?:\+(?:(json)(?:; ?charset=utf-?8)?|proto))?$/i;function Er(e){let t=e?.match(Tr);if(t)return{binary:!t[1]}}const Dr=`grpc`,Or=`POST`;function kr(e){let t=_r(e);function n(e){let n=Ar(t,e);return Object.assign(n,{protocolNames:[Dr],allowedMethods:[Or],supportedContentType:Un(Tr),requestPath:Wn(`/`,e.method),service:e.method.parent,method:e.method})}return n.protocolName=Dr,n}function Ar(e,t){let n=sr(t.method,e.binaryOptions,e.jsonOptions,e);return async function(r){dr(r);let i=Er(r.header.get(tn));if(i==null)return mr;if(r.method!==Or)return hr;let a=ln(r.header.get(an),e.maxTimeoutMs),o=Yt(Object.assign(Object.assign({},t),{service:t.method.parent,requestMethod:r.method,protocolName:Dr,timeoutMs:a.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:r.signal,requestHeader:r.header,url:r.url,responseHeader:{[tn]:i.binary?`application/grpc+proto`:`application/grpc+json`},responseTrailer:{[on]:`0`},contextValues:r.contextValues})),s=mn(e.acceptCompression,r.header.get(nn),r.header.get(rn),rn);s.response&&o.responseHeader.set(nn,s.response.name);let c=On(r.body,jn(()=>{if(s.error)throw s.error;if(a.error)throw a.error}),Ln(e.readMaxBytes),Fn(s.request,e.readMaxBytes),Nn(n.getI(i.binary))),l=$n(t,o,e.interceptors)(c)[Symbol.asyncIterator](),u=On({[Symbol.asyncIterator](){return{next:()=>l.next(),throw:e=>(o.abort(e),l.throw?.call(l,e)??Promise.reject({done:!0})),return:e=>(o.abort(),l.return?.call(l,e)??Promise.resolve({done:!0,value:e}))}}},Mn(n.getO(i.binary)),Pn(s.response,e.compressMinBytes),In(),An(e=>{o.abort(e),e instanceof R?pn(o.responseTrailer,e):e!==void 0&&pn(o.responseTrailer,new R(`internal error`,z.Internal,void 0,void 0,e))}),{propagateDownStreamError:!0});return Object.assign(Object.assign({},fr),{body:await Bn(u),header:o.responseHeader,trailer:o.responseTrailer})}}const jr=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i,Mr=/^application\/(?:json(?:; ?charset=utf-?8)?|proto)$/i,Nr=/^application\/connect\+?(?:json(?:; ?charset=utf-?8)?|proto)$/i,Pr=`application/json`;function Fr(e){let t=e?.match(jr);if(t)return{stream:!!t[1],binary:!!t[3]}}function Ir(e){switch(e){case`proto`:return{stream:!1,binary:!0};case`json`:return{stream:!1,binary:!1};default:return}}var Lr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Rr(e,t,n){if(t&&new Headers(t).forEach((e,t)=>n.metadata.append(t,e)),typeof e!=`object`||!e||Array.isArray(e))throw n;let r=n.code;`code`in e&&typeof e.code==`string`&&(r=oe(e.code)??r);let i=e.message;if(i!=null&&typeof i!=`string`)throw n;let a=new R(i??``,r,t);if(`details`in e&&Array.isArray(e.details))for(let t of e.details){if(typeof t!=`object`||!t||Array.isArray(t)||typeof t.type!=`string`||typeof t.value!=`string`)throw n;try{a.details.push({type:t.type,value:g(t.value),debug:t.debug})}catch{throw n}}return a}function zr(e,t){let n={code:le(e.code)};return e.rawMessage.length>0&&(n.message=e.rawMessage),e.details.length>0&&(n.details=e.details.map(e=>{if(`desc`in e){let n=w(e.desc,e.value),r={type:e.desc.typeName,value:Me(e.desc,n)};try{r.debug=$e(e.desc,n,t)}catch{}return r}return e}).map(e=>{var{value:t}=e,n=Lr(e,[`value`]);return Object.assign(Object.assign({},n),{value:_(t,`std_raw`)})})),n}function Br(e,t){let n=new TextEncoder;try{let r=zr(e,t),i=JSON.stringify(r);return n.encode(i)}catch(e){throw new R(`failed to serialize Connect Error: ${e instanceof Error?e.message:String(e)}`,z.Internal)}}function Vr(e){let t=new R(`invalid end stream`,z.Unknown),n;try{n=JSON.parse(typeof e==`string`?e:new TextDecoder().decode(e))}catch{throw t}if(typeof n!=`object`||!n||Array.isArray(n))throw t;let r=new Headers;if(`metadata`in n){if(typeof n.metadata!=`object`||n.metadata==null||Array.isArray(n.metadata))throw t;for(let[e,i]of Object.entries(n.metadata)){if(!Array.isArray(i)||i.some(e=>typeof e!=`string`))throw t;for(let t of i)r.append(e,t)}}return{metadata:r,error:`error`in n&&n.error!=null?Rr(n.error,r,t):void 0}}function Hr(e,t,n){let r={};t!==void 0&&(r.error=zr(t,n),e=fn(e,t.metadata));let i=!1,a={};return e.forEach((e,t)=>{i=!0,a[t]=[e]}),i&&(r.metadata=a),r}function Ur(e){let t=new TextEncoder;return{serialize(n){try{let r=Hr(n.metadata,n.error,e),i=JSON.stringify(r);return t.encode(i)}catch(e){throw new R(`failed to serialize EndStreamResponse: ${e instanceof Error?e.message:String(e)}`,z.Internal)}},parse(e){try{return Vr(e)}catch(e){throw new R(`failed to parse EndStreamResponse: ${e instanceof Error?e.message:String(e)}`,z.InvalidArgument)}}}}const Wr=`Content-Type`,Gr=`Content-Length`,Kr=`Content-Encoding`,qr=`Connect-Content-Encoding`,Jr=`Accept-Encoding`,Yr=`Connect-Accept-Encoding`,Xr=`Connect-Timeout-Ms`,Zr=`Connect-Protocol-Version`;function Qr(e){switch(e){case z.Canceled:return 499;case z.Unknown:return 500;case z.InvalidArgument:return 400;case z.DeadlineExceeded:return 504;case z.NotFound:return 404;case z.AlreadyExists:return 409;case z.PermissionDenied:return 403;case z.ResourceExhausted:return 429;case z.FailedPrecondition:return 400;case z.Aborted:return 409;case z.OutOfRange:return 400;case z.Unimplemented:return 501;case z.Internal:return 500;case z.Unavailable:return 503;case z.DataLoss:return 500;case z.Unauthenticated:return 401;default:return 500}}function $r(e,t){if(e===null)return{};let n=/^\d{1,10}$/.exec(e);if(n===null)return{error:new R(`protocol error: invalid connect timeout value: ${e}`,z.InvalidArgument)};let r=parseInt(n[0]);return r>t?{timeoutMs:r,error:new R(`timeout ${r}ms must be <= ${t}`,z.InvalidArgument)}:{timeoutMs:parseInt(n[0])}}const ei=`connect`;function ti(e,t){let n=new Headers(e);return t.forEach((e,t)=>{n.append(`trailer-${t}`,e)}),n}function ni(e){let t=e.get(Zr);if(t===null)throw new R(`missing required header: set ${Zr} to "1"`,z.InvalidArgument);if(t!==`1`)throw new R(`${Zr} must be "1": got "${t}"`,z.InvalidArgument)}function ri(e){let t=e.get(ei);if(t===null)throw new R(`missing required parameter: set ${ei} to "v1"`,z.InvalidArgument);if(t!==`v1`)throw new R(`${ei} must be "v1": got "${t}"`,z.InvalidArgument)}const ii=`connect`,ai=`POST`;function oi(e){let t=_r(e),n=Ur(t.jsonOptions);function r(e){let r,i,a=sr(e.method,t.binaryOptions,t.jsonOptions,t);switch(e.kind){case`unary`:i=Mr,r=si(t,e,a);break;default:i=Nr,r=di(t,e,a,n);break}let o=[ai];return e.method.idempotency===b.NO_SIDE_EFFECTS&&o.push(`GET`),Object.assign(r,{protocolNames:[ii],supportedContentType:Un(i),allowedMethods:o,requestPath:Wn(`/`,e.method),service:e.method.parent,method:e.method})}return r.protocolName=ii,r}function si(e,t,n){return async function(r){let i=r.method==`GET`;if(i&&t.method.idempotency!=b.NO_SIDE_EFFECTS)return hr;let a=new URL(r.url).searchParams,o=i?a.get(`compression`):r.header.get(Kr),s=i?Ir(a.get(`encoding`)):Fr(r.header.get(Wr));if(s==null||s.stream)return mr;let c=$r(r.header.get(Xr),e.maxTimeoutMs),l=Yt(Object.assign(Object.assign({},t),{service:t.method.parent,requestMethod:r.method,protocolName:ii,timeoutMs:c.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:r.signal,requestHeader:r.header,url:r.url,responseHeader:{[Wr]:s.binary?`application/proto`:Pr},contextValues:r.contextValues})),u=mn(e.acceptCompression,o,r.header.get(Jr),Jr),d=fr.status,f;try{if(e.requireConnectProtocolHeader&&(i?ri(a):ni(r.header)),u.error)throw u.error;if(c.error)throw c.error;let o;o=i?await li(e.readMaxBytes,u.request,a):await ci(e.readMaxBytes,u.request,r);let d=await Qn(t,l,ui(t.method,s.binary,n,o),e.interceptors);f=n.getO(s.binary).serialize(d)}catch(t){l.abort(t);let n;n=t instanceof R?t:new R(`internal error`,z.Internal,void 0,void 0,t),d=Qr(n.code),l.responseHeader.set(Wr,Pr),n.metadata.forEach((e,t)=>{l.responseHeader.set(t,e)}),f=Br(n,e.jsonOptions)}finally{l.abort()}u.response&&f.byteLength>=e.compressMinBytes&&(f=await u.response.compress(f),l.responseHeader.set(Kr,u.response.name));let p=ti(l.responseHeader,l.responseTrailer);return p.set(Gr,f.byteLength.toString(10)),{status:d,body:Hn([f]),header:p}}}async function ci(e,t,n){if(typeof n.body==`object`&&n.body!==null&&Symbol.asyncIterator in n.body){let r=await Rn(n.body,e,n.header.get(Gr));return t&&(r=await t.decompress(r,e)),r}return n.body}async function li(e,t,n){let r=n.get(`base64`),i=n.get(`message`)??``,a;return a=r===`1`?g(i):new TextEncoder().encode(i),t&&(a=await t.decompress(a,e)),a}function ui(e,t,n,r){if(r instanceof Uint8Array)return n.getI(t).parse(r);if(t)throw new R(`received parsed JSON request body, but content-type indicates binary format`,z.Internal);try{return yt(e.input,r)}catch(e){throw R.from(e,z.InvalidArgument)}}function di(e,t,n,r){return async function(i){dr(i);let a=Fr(i.header.get(Wr));if(a==null||!a.stream)return mr;if(i.method!==ai)return hr;let o=$r(i.header.get(Xr),e.maxTimeoutMs),s=Yt(Object.assign(Object.assign({},t),{service:t.method.parent,requestMethod:i.method,protocolName:ii,timeoutMs:o.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:i.signal,requestHeader:i.header,url:i.url,responseHeader:{[Wr]:a.binary?`application/connect+proto`:`application/connect+json`},contextValues:i.contextValues})),c=mn(e.acceptCompression,i.header.get(qr),i.header.get(Yr),Yr);c.response&&s.responseHeader.set(qr,c.response.name);let l=On(i.body,jn(()=>{if(e.requireConnectProtocolHeader&&ni(i.header),c.error)throw c.error;if(o.error)throw o.error}),Ln(e.readMaxBytes),Fn(c.request,e.readMaxBytes),Nn(n.getI(a.binary),2)),u=$n(t,s,e.interceptors)(l)[Symbol.asyncIterator](),d=On({[Symbol.asyncIterator](){return{next:()=>u.next(),throw:e=>(s.abort(e),u.throw?.call(u,e)??Promise.reject({done:!0})),return:e=>(s.abort(),u.return?.call(u,e)??Promise.resolve({done:!0,value:e}))}}},Mn(n.getO(a.binary)),An(e=>{s.abort(e);let t={metadata:s.responseTrailer};return e instanceof R?t.error=e:e!==void 0&&(t.error=new R(`internal error`,z.Internal,void 0,void 0,e)),{flags:2,data:r.serialize(t)}}),Pn(c.response,e.compressMinBytes),In(),{propagateDownStreamError:!0});return Object.assign(Object.assign({},fr),{body:await Bn(d),header:s.responseHeader})}}function fi(e){let t=pi(e),n=[],r={handlers:n,service:(e,i,a)=>{let{protocols:o}=pi(a,t);return n.push(...vr(Zt(e,i),o)),r},rpc:(e,i,a)=>{let{protocols:o}=pi(a,t);return n.push(yr(Xt(e,i),o)),r}};return r}function pi(e,t){if(t&&!e)return t;let n=t?Object.assign(Object.assign({},_r(t.options)),e):Object.assign(Object.assign({},e),_r(e??{})),r=[];if(e?.grpc!==!1&&r.push(kr(n)),e?.grpcWeb!==!1&&r.push(Cr(n)),e?.connect!==!1&&r.push(oi(n)),r.length===0)throw new R(`cannot create handler, all protocols are disabled`,z.InvalidArgument);return{options:n,protocols:r}}function mi(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(!n.startsWith(`:`)&&r!==void 0)if(typeof r==`string`)t.append(n,r);else if(typeof r==`number`)t.append(n,String(r));else for(let e of r)t.append(n,e);return t}function hi(e,t){if(e===void 0&&t===void 0)return;let n=Object.create(null);if(t!==void 0)if(Array.isArray(t))for(let e=0;e+1<t.length;e+=2){let r=t[e],i=t[e+1];Array.isArray(n[r])?n[r].push(i):typeof n[r]==`string`?n[r]=[n[r],i]:n[r]=i}else for(let[e,r]of Object.entries(t))Array.isArray(r)?n[e]=r.concat():r!==void 0&&(n[e]=r);if(e!==void 0)if(Array.isArray(e))for(let[t,r]of e)gi(n,t,r);else if(`forEach`in e)typeof e.forEach==`function`&&e.forEach((e,t)=>{gi(n,t,e)});else for(let[t,r]of Object.entries(e))gi(n,t,r);return n}function gi(e,t,n){t=t.toLowerCase();let r=e[t];Array.isArray(r)?r.push(n):r===void 0?e[t]=n:e[t]=[r.toString(),n]}function _i(e){let t=z.Internal,n=vi(e).map(yi);n.some(e=>e.code==`ERR_STREAM_WRITE_AFTER_END`)||n.some(e=>e.code==`ERR_STREAM_DESTROYED`||e.code==`ERR_HTTP2_INVALID_STREAM`||e.code==`ECONNRESET`)?t=z.Aborted:n.some(e=>e.code==`ETIMEDOUT`||e.code==`ENOTFOUND`||e.code==`EAI_AGAIN`||e.code==`ECONNREFUSED`)&&(t=z.Unavailable);let r=R.from(e,t);return r!==e&&(r.cause=e),r}function vi(e){let t=[];for(;!(!(e instanceof Error)||t.includes(e)||(t.push(e),!(`cause`in e)));)e=e.cause;return t}function yi(e){let t={};return e instanceof Error&&(`code`in e&&typeof e.code==`string`&&(t.code=e.code),`syscall`in e&&typeof e.syscall==`string`&&(t.syscall=e.syscall)),t}function bi(e){switch(e){case W.PROTOCOL_ERROR:case W.INTERNAL_ERROR:case W.FLOW_CONTROL_ERROR:case W.SETTINGS_TIMEOUT:case W.FRAME_SIZE_ERROR:case W.COMPRESSION_ERROR:case W.CONNECT_ERROR:return new R(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,z.Internal);case W.REFUSED_STREAM:return new R(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,z.Unavailable);case W.CANCEL:return new R(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,z.Canceled);case W.ENHANCE_YOUR_CALM:return new R(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,z.ResourceExhausted);case W.INADEQUATE_SECURITY:return new R(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,z.PermissionDenied);case W.HTTP_1_1_REQUIRED:return new R(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,z.PermissionDenied);default:break}}var W;(function(e){e[e.PROTOCOL_ERROR=1]=`PROTOCOL_ERROR`,e[e.INTERNAL_ERROR=2]=`INTERNAL_ERROR`,e[e.FLOW_CONTROL_ERROR=3]=`FLOW_CONTROL_ERROR`,e[e.SETTINGS_TIMEOUT=4]=`SETTINGS_TIMEOUT`,e[e.STREAM_CLOSED=5]=`STREAM_CLOSED`,e[e.FRAME_SIZE_ERROR=6]=`FRAME_SIZE_ERROR`,e[e.REFUSED_STREAM=7]=`REFUSED_STREAM`,e[e.CANCEL=8]=`CANCEL`,e[e.COMPRESSION_ERROR=9]=`COMPRESSION_ERROR`,e[e.CONNECT_ERROR=10]=`CONNECT_ERROR`,e[e.ENHANCE_YOUR_CALM=11]=`ENHANCE_YOUR_CALM`,e[e.INADEQUATE_SECURITY=12]=`INADEQUATE_SECURITY`,e[e.HTTP_1_1_REQUIRED=13]=`HTTP_1_1_REQUIRED`})(W||={});var xi=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Si=function(e){return this instanceof Si?(this.v=e,this):new Si(e)},Ci=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Si?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function wi(e,...t){let n=t.length===3?t[0]:void 0,r=t.length===3?t[1]:t[0],i=t.length===3?t[2]:t[1],a=`encrypted`in e.socket&&e.socket.encrypted?`https`:`http`,o=`authority`in e?e.authority:e.headers.host,s=e.url??``;if(o===void 0)throw new R(`unable to determine request authority from Node.js server request`,z.Internal);let c=r===void 0?Ei(e):r,l=new AbortController;if(`stream`in e)e.once(`close`,()=>{let t=bi(e.stream.rstCode);t===void 0?l.abort():l.abort(t)});else{let t=n??e,r=n=>{e.off(`error`,r),t.off(`close`,i),l.abort(_i(n))},i=()=>{e.off(`error`,r),t.off(`close`,i),l.abort(e.errored?_i(e.errored):void 0)};e.once(`error`,r),t.once(`close`,i)}return{httpVersion:e.httpVersion,method:e.method??``,url:new URL(s,`${a}://${o}`).toString(),header:mi(e.headers),body:c,signal:l.signal,contextValues:i}}async function Ti(e,t){var n,r;let i=e.body?.[Symbol.asyncIterator](),a=!1;try{if(i!==void 0){let n=await i.next();for(a=!0,t.writeHead(e.status,hi(e.header)),a=!1;n.done!==!0;n=await i.next())a=!0,await Di(t,n.value),`flush`in t&&typeof t.flush==`function`&&t.flush(),a=!1}t.headersSent||t.writeHead(e.status,hi(e.header)),e.trailer&&t.addTrailers(hi(e.trailer)),await new Promise(e=>{t.once(`end`,e),t.end()})}catch(e){throw a&&((n=i?.throw)==null||n.call(i,e).catch(()=>{})),_i(e)}finally{(r=i?.return)==null||r.call(i).catch(()=>{})}}function Ei(e){return Ci(this,arguments,function*(){var t,n,r,i;try{for(var a=!0,o=xi(e),s;s=yield Si(o.next()),t=s.done,!t;a=!0)i=s.value,a=!1,yield yield Si(i)}catch(e){n={error:e}}finally{try{!a&&!t&&(r=o.return)&&(yield Si(r.call(o)))}finally{if(n)throw n.error}}})}function Di(e,t){return new Promise((n,r)=>{if(e.errored)return a(e.errored);e.once(`error`,a),e.once(`drain`,o);let i=e.write(t,`binary`,t=>{t&&!i&&(a(t),e.once(`error`,()=>{}))});i&&o();function a(t){e.off(`error`,a),e.off(`drain`,o),r(t)}function o(){e.off(`error`,a),e.off(`drain`,o),n()}})}const Oi=_e(ge.gzip),ki=_e(ge.gunzip),Ai=_e(ge.brotliCompress),ji=_e(ge.brotliDecompress),Mi={name:`gzip`,compress(e){return Pi(Oi(e,{}))},decompress(e,t){return e.length==0?Promise.resolve(new Uint8Array):Pi(Fi(ki(e,{maxOutputLength:t}),t))}},Ni={name:`br`,compress(e){return Pi(Ai(e,{}))},decompress(e,t){return e.length==0?Promise.resolve(new Uint8Array):Pi(Fi(ji(e,{maxOutputLength:t}),t))}};function Pi(e){return e.then(e=>e.buffer instanceof ArrayBuffer?e:new Uint8Array(e))}function Fi(e,t){return e.catch(e=>{let n=yi(e),r=z.Internal,i=`decompression failed`;switch(n.code){case`ERR_BUFFER_TOO_LARGE`:r=z.ResourceExhausted,i=`message is larger than configured readMaxBytes ${t} after decompression`;break;case`Z_DATA_ERROR`:case`ERR_PADDING_2`:r=z.InvalidArgument;break;default:n.code?.startsWith(`ERR__ERROR_FORMAT_`)&&(r=z.InvalidArgument);break}return Promise.reject(new R(i,r,void 0,void 0,e))})}function Ii(e){e.acceptCompression===void 0&&(e.acceptCompression=[Mi,Ni]);let t=fi(e);e.routes(t);let n=e.requestPathPrefix??``,r=new Map;for(let e of t.handlers)r.set(n+e.requestPath,e);return function(t,n){let i=r.get(t.url?.split(`?`,2)[0]??``);if(!i){(e.fallback??Li)(t,n);return}i(wi(t,n,void 0,e.contextValues?.call(e,t))).then(e=>Ti(e,n)).catch(e=>{R.from(e).code!=z.Aborted&&console.error(`handler for rpc ${i.method.name} of ${i.service.typeName} failed`,e)})}}const Li=(e,t)=>{t.writeHead(pr.status),t.end()};var Ri=r(ae(),1),zi=class{instance;constructor(e){this.instance=e}async start(e,t){return this.instance.start(e,t)}async getConfig(e,t){let n=await this.instance.getConfig(e,t);return n.executionConfig=w(D,ce.execution),n}async*processBindingsStream(e,t){yield*this.instance.processBindingsStream(e,t)}async updateTemplates(e,t){return this.instance.updateTemplates(e,t)}},Bi=t(((e,t)=>{var n=class e extends Error{constructor(t){super(`Format functions must be synchronous taking a two arguments: (info, opts)
2
+ import{a as e,d as t,f as n,g as r,h as i,i as a,l as o,m as s,n as c,p as l,s as u,t as d}from"./esm-Ajeyb2yg.js";import{A as f,B as p,C as m,D as h,E as g,F as _,H as v,I as y,L as b,M as x,N as S,O as C,P as w,R as T,S as E,T as D,V as O,a as k,b as A,g as j,h as ee,k as M,m as te,n as ne,p as N,s as P,u as re,v as ie,w as ae,x as oe,y as F,z as I}from"./plugin-zKrh74uo.js";import{_ as se,d as L,f as ce,g as le,m as R,n as ue,p as de,t as fe,x as pe}from"./service-v3-C-P_jSmD.js";import*as me from"path";import{dirname as he,join as z}from"path";import*as ge from"fs";import{Readable as _e}from"stream";import B from"node:process";import*as ve from"node:zlib";import{promisify as ye,stripVTControlCharacters as V}from"node:util";import be from"http";import xe from"node:http2";import{Session as Se}from"node:inspector/promises";import{fork as Ce}from"child_process";import{fileURLToPath as we}from"url";import*as Te from"zlib";import{EventEmitter as Ee}from"node:events";import H from"node:child_process";import De from"node:path";import Oe from"node:fs";const ke=ie(`Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM`),Ae=_(ke,0),je={writeUnknownFields:!0};function Me(e){return e?Object.assign(Object.assign({},je),e):je}function Ne(e,t,n){return Pe(new M,Me(n),E(e,t)).finish()}function Pe(e,t,n){for(let r of n.sortedFields){if(!n.isSet(r)){if(r.presence==3)throw Error(`cannot encode ${r} to binary: required field not set`);continue}Fe(e,t,n,r)}if(t.writeUnknownFields)for(let{no:t,wireType:r,data:i}of n.getUnknown()??[])e.tag(t,r).raw(i);return e}function Fe(e,t,n,r){switch(r.fieldKind){case`scalar`:case`enum`:Ie(e,n.desc.typeName,r.name,r.scalar??I.INT32,r.number,n.get(r));break;case`list`:Re(e,t,r,n.get(r));break;case`message`:Le(e,t,r,n.get(r));break;case`map`:for(let[i,a]of n.get(r))ze(e,t,r,i,a);break}}function Ie(e,t,n,r,i,a){Be(e.tag(i,Ve(r)),t,n,r,a)}function Le(e,t,n,r){n.delimitedEncoding?Pe(e.tag(n.number,f.StartGroup),t,r).tag(n.number,f.EndGroup):Pe(e.tag(n.number,f.LengthDelimited).fork(),t,r).join()}function Re(e,t,n,r){if(n.listKind==`message`){for(let i of r)Le(e,t,n,i);return}let i=n.scalar??I.INT32;if(n.packed){if(!r.size)return;e.tag(n.number,f.LengthDelimited).fork();for(let t of r)Be(e,n.parent.typeName,n.name,i,t);e.join();return}for(let t of r)Ie(e,n.parent.typeName,n.name,i,n.number,t)}function ze(e,t,n,r,i){switch(e.tag(n.number,f.LengthDelimited).fork(),Ie(e,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case`scalar`:case`enum`:Ie(e,n.parent.typeName,n.name,n.scalar??I.INT32,2,i);break;case`message`:Pe(e.tag(2,f.LengthDelimited).fork(),t,i).join();break}e.join()}function Be(e,t,n,r,i){try{switch(r){case I.STRING:e.string(i);break;case I.BOOL:e.bool(i);break;case I.DOUBLE:e.double(i);break;case I.FLOAT:e.float(i);break;case I.INT32:e.int32(i);break;case I.INT64:e.int64(i);break;case I.UINT64:e.uint64(i);break;case I.FIXED64:e.fixed64(i);break;case I.BYTES:e.bytes(i);break;case I.FIXED32:e.fixed32(i);break;case I.SFIXED32:e.sfixed32(i);break;case I.SFIXED64:e.sfixed64(i);break;case I.SINT64:e.sint64(i);break;case I.UINT32:e.uint32(i);break;case I.SINT32:e.sint32(i);break}}catch(e){throw e instanceof Error?Error(`cannot encode field ${t}.${n} to binary: ${e.message}`):e}}function Ve(e){switch(e){case I.BYTES:case I.STRING:return f.LengthDelimited;case I.DOUBLE:case I.FIXED64:case I.SFIXED64:return f.Bit64;case I.FIXED32:case I.SFIXED32:case I.FLOAT:return f.Bit32;default:return f.Varint}}function He(e,t,n){let r=!1;return n||(n=m(Ae),r=!0),n.value=Ne(e,t),n.typeUrl=Ge(t.$typeName),r?n:void 0}function Ue(e,t){return e.typeUrl===``?!1:(typeof t==`string`?t:t.typeName)===Ke(e.typeUrl)}function We(e,t){if(e.typeUrl===``)return;let n=t.kind==`message`?t:t.getMessage(Ke(e.typeUrl));if(!(!n||!Ue(e,n)))return F(n,e.value)}function Ge(e){return`type.googleapis.com/${e}`}function Ke(e){let t=e.lastIndexOf(`/`),n=t>=0?e.substring(t+1):e;if(!n.length)throw Error(`invalid type url: ${e}`);return n}function qe(e,t,n){Ze(t,e);let r=Ye(e.$unknown,t),[i,a,o]=Xe(t),s=A(n);for(let e of r)oe(i,new C(e.data),a,e.wireType,s);return o()}function Je(e,t,n){Ze(t,e);let r=(e.$unknown??[]).filter(e=>e.no!==t.number),[i,a]=Xe(t,n),o=new M;Fe(o,{writeUnknownFields:!0},i,a);let s=new C(o.finish());for(;s.pos<s.len;){let[e,t]=s.tag(),n=s.skip(t,e);r.push({no:e,wireType:t,data:n})}e.$unknown=r}function Ye(e,t){if(e===void 0)return[];if(t.fieldKind===`enum`||t.fieldKind===`scalar`){for(let n=e.length-1;n>=0;--n)if(e[n].no==t.number)return[e[n]];return[]}return e.filter(e=>e.no===t.number)}function Xe(e,t){let n=e.typeName,r=Object.assign(Object.assign({},e),{kind:`field`,parent:e.extendee,localName:n}),i=Object.assign(Object.assign({},e.extendee),{fields:[r],members:[r],oneofs:[]}),a=m(i,t===void 0?void 0:{[n]:t});return[E(i,a),r,()=>{let t=a[n];if(t===void 0){let t=e.message;return D(t)?T(t.fields[0].scalar,t.fields[0].longAsString):m(t)}return t}]}function Ze(e,t){if(e.extendee.typeName!=t.$typeName)throw Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const Qe={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function $e(e){return e?Object.assign(Object.assign({},Qe),e):Qe}function et(e,t,n){return nt(E(e,t),$e(n))}function tt(e,t,n){let r=et(e,t,n);return JSON.stringify(r,null,n?.prettySpaces??0)}function nt(e,t){let n=lt(e,t);if(n!==void 0)return n;let r={};for(let n of e.sortedFields){if(!e.isSet(n)){if(n.presence==3)throw Error(`cannot encode ${n} to JSON: required field not set`);if(!t.alwaysEmitImplicit||n.presence!==2)continue}let i=rt(n,e.get(n),t);i!==void 0&&(r[ct(n,t)]=i)}if(t.registry){let n=new Set;for(let{no:i}of e.getUnknown()??[])if(!n.has(i)){n.add(i);let a=t.registry.getExtensionFor(e.desc,i);if(!a)continue;let[o,s]=Xe(a,qe(e.message,a)),c=rt(s,o.get(s),t);c!==void 0&&(r[a.jsonName]=c)}}return r}function rt(e,t,n){switch(e.fieldKind){case`scalar`:return st(e,t);case`message`:return nt(t,n);case`enum`:return ot(e.enum,t,n.enumAsInteger);case`list`:return at(t,n);case`map`:return it(t,n)}}function it(e,t){let n=e.field(),r={};switch(n.mapKind){case`scalar`:for(let[t,i]of e)r[t]=st(n,i);break;case`message`:for(let[n,i]of e)r[n]=nt(i,t);break;case`enum`:for(let[i,a]of e)r[i]=ot(n.enum,a,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?r:void 0}function at(e,t){let n=e.field(),r=[];switch(n.listKind){case`scalar`:for(let t of e)r.push(st(n,t));break;case`enum`:for(let i of e)r.push(ot(n.enum,i,t.enumAsInteger));break;case`message`:for(let n of e)r.push(nt(n,t));break}return t.alwaysEmitImplicit||r.length>0?r:void 0}function ot(e,t,n){if(typeof t!=`number`)throw Error(`cannot encode ${e} to JSON: expected number, got ${h(t)}`);return e.typeName==`google.protobuf.NullValue`?null:n?t:e.value[t]?.name??t}function st(e,t){switch(e.scalar){case I.INT32:case I.SFIXED32:case I.SINT32:case I.FIXED32:case I.UINT32:if(typeof t!=`number`)throw Error(`cannot encode ${e} to JSON: ${g(e,t)?.message}`);return t;case I.FLOAT:case I.DOUBLE:if(typeof t!=`number`)throw Error(`cannot encode ${e} to JSON: ${g(e,t)?.message}`);return Number.isNaN(t)?`NaN`:t===1/0?`Infinity`:t===-1/0?`-Infinity`:t;case I.STRING:if(typeof t!=`string`)throw Error(`cannot encode ${e} to JSON: ${g(e,t)?.message}`);return t;case I.BOOL:if(typeof t!=`boolean`)throw Error(`cannot encode ${e} to JSON: ${g(e,t)?.message}`);return t;case I.UINT64:case I.FIXED64:case I.INT64:case I.SFIXED64:case I.SINT64:if(typeof t==`bigint`||typeof t==`string`||typeof t==`number`&&Number.isInteger(t))return t.toString();throw Error(`cannot encode ${e} to JSON: ${g(e,t)?.message}`);case I.BYTES:if(t instanceof Uint8Array)return b(t);throw Error(`cannot encode ${e} to JSON: ${g(e,t)?.message}`)}}function ct(e,t){return t.useProtoFieldName?e.name:e.jsonName}function lt(e,t){if(e.desc.typeName.startsWith(`google.protobuf.`))switch(e.desc.typeName){case`google.protobuf.Any`:return ut(e.message,t);case`google.protobuf.Timestamp`:return gt(e.message);case`google.protobuf.Duration`:return dt(e.message);case`google.protobuf.FieldMask`:return ft(e.message);case`google.protobuf.Struct`:return pt(e.message);case`google.protobuf.Value`:return mt(e.message);case`google.protobuf.ListValue`:return ht(e.message);default:if(D(e.desc)){let t=e.desc.fields[0];return st(t,e.get(t))}return}}function ut(e,t){if(e.typeUrl===``)return{};let{registry:n}=t,r,i;if(n&&(r=We(e,n),r&&(i=n.getMessage(r.$typeName))),!i||!r)throw Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let a=E(i,r),o=ae(i)?{value:lt(a,t)}:nt(a,t);return o[`@type`]=e.typeUrl,o}function dt(e){let t=Number(e.seconds),n=e.nanos;if(t>315576e6||t<-315576e6)throw Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);if(t>0&&n<0||t<0&&n>0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos sign must match seconds sign`);let r=e.seconds.toString();if(n!==0){let e=Math.abs(n).toString();e=`0`.repeat(9-e.length)+e,e.substring(3)===`000000`?e=e.substring(0,3):e.substring(6)===`000`&&(e=e.substring(0,6)),r+=`.`+e,n<0&&t==0&&(r=`-`+r)}return r+`s`}function ft(e){return e.paths.map(t=>{if(v(O(t))!==t)throw Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "${t}" is irreversible`);return O(t)}).join(`,`)}function pt(e){let t={};for(let[n,r]of Object.entries(e.fields))t[n]=mt(r);return t}function mt(e){switch(e.kind.case){case`nullValue`:return null;case`numberValue`:if(!Number.isFinite(e.kind.value))throw Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case`boolValue`:return e.kind.value;case`stringValue`:return e.kind.value;case`structValue`:return pt(e.kind.value);case`listValue`:return ht(e.kind.value);default:throw Error(`${e.$typeName} must have a value`)}}function ht(e){return e.values.map(mt)}function gt(e){let t=Number(e.seconds)*1e3;if(t<Date.parse(`0001-01-01T00:00:00Z`)||t>Date.parse(`9999-12-31T23:59:59Z`))throw Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);if(e.nanos>999999999)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be greater than 99999999`);let n=`Z`;if(e.nanos>0){let t=(e.nanos+1e9).toString().substring(1);n=t.substring(3)===`000000`?`.`+t.substring(0,3)+`Z`:t.substring(6)===`000`?`.`+t.substring(0,6)+`Z`:`.`+t+`Z`}return new Date(t).toISOString().replace(`.000Z`,n)}function _t(e){return Object.assign(Object.assign({ignoreUnknownFields:!1,recursionLimit:100},e),{depth:0})}function vt(e,t,n){return yt(e,It(t,e.typeName),n)}function yt(e,t,n){let r=E(e);try{St(r,t,_t(n))}catch(e){throw S(e)?Error(`cannot decode ${e.field()} from JSON: ${e.message}`,{cause:e}):e}return r.message}const bt=new WeakMap;function xt(e,t){if(!bt.has(e)){let t=new Map;for(let n of e.fields)t.set(n.name,n).set(n.jsonName,n);bt.set(e,t)}return bt.get(e)?.get(t)}function St(e,t,n){if(++n.depth>n.recursionLimit)throw Error(`cannot decode ${e.desc} from JSON: maximum recursion depth of ${n.recursionLimit} reached`);if(Rt(e,t,n)){n.depth--;return}if(t==null||Array.isArray(t)||typeof t!=`object`)throw Error(`cannot decode ${e.desc} from JSON: ${h(t)}`);let r=new Map,i=new Set;for(let[a,o]of Object.entries(t)){let t=xt(e.desc,a);if(t){if(i.has(t))throw new x(t,`set multiple times`);if(i.add(t),t.oneof&&o===null&&t.fieldKind==`scalar`)continue;if(t.oneof){let e=r.get(t.oneof);if(e!==void 0)throw new x(t.oneof,`oneof set multiple times by ${e.name} and ${t.name}`);r.set(t.oneof,t)}Ct(e,t,o,n)}else{let t;if(a.startsWith(`[`)&&a.endsWith(`]`)&&(t=n.registry?.getExtension(a.substring(1,a.length-1)))&&t.extendee.typeName===e.desc.typeName){let[r,i,a]=Xe(t);Ct(r,i,o,n),Je(e.message,t,a())}if(!t&&!n.ignoreUnknownFields)throw Error(`cannot decode ${e.desc} from JSON: key "${a}" is unknown`)}}n.depth--}function Ct(e,t,n,r){switch(t.fieldKind){case`scalar`:kt(e,t,n);break;case`enum`:Ot(e,t,n,r);break;case`message`:Dt(e,t,n,r);break;case`list`:Et(e.get(t),n,r);break;case`map`:Tt(e.get(t),n,r);break}}function wt(e,t,n){if(e.scalar&&t!==null)return Nt(e,t);if(e.message&&!At(e,t)){let r=E(e.message);return St(r,t,n),r}if(e.enum&&!At(e,t))return Mt(e.enum,t,n.ignoreUnknownFields);throw new x(e,`${e.fieldKind===`list`?`list item`:`map value`} must not be null`)}function Tt(e,t,n){if(t===null)return;let r=e.field();if(typeof t!=`object`||Array.isArray(t))throw new x(r,`expected object, got `+h(t));let i=new Set;for(let[a,o]of Object.entries(t)){let t=Pt(r.mapKey,a);if(i.has(t))throw new x(r,`duplicate map key "${a}"`);i.add(t);let s=wt(r,o,n);s!==jt&&e.set(t,s)}}function Et(e,t,n){if(t===null)return;let r=e.field();if(!Array.isArray(t))throw new x(r,`expected Array, got `+h(t));for(let i of t){let t=wt(r,i,n);t!==jt&&e.add(t)}}function Dt(e,t,n,r){if(At(t,n)){e.clear(t);return}let i=e.isSet(t)?e.get(t):E(t.message);St(i,n,r),e.set(t,i)}function Ot(e,t,n,r){if(At(t,n)){e.clear(t);return}let i=Mt(t.enum,n,r.ignoreUnknownFields);i!==jt&&e.set(t,i)}function kt(e,t,n){n===null?e.clear(t):e.set(t,Nt(t,n))}function At(e,t){return t===null&&e.message?.typeName!=`google.protobuf.Value`&&e.enum?.typeName!=`google.protobuf.NullValue`}const jt=Symbol();function Mt(e,t,n){if(t===null)return e.values[0].number;switch(typeof t){case`number`:if(Number.isInteger(t))return t;break;case`string`:let r=e.values.find(e=>e.name===t);if(r!==void 0)return r.number;if(n)return jt;break}throw Error(`cannot decode ${e} from JSON: ${h(t)}`)}function Nt(e,t){switch(e.scalar){case I.DOUBLE:case I.FLOAT:if(t===`NaN`)return NaN;if(t===`Infinity`)return 1/0;if(t===`-Infinity`)return-1/0;if(typeof t==`number`){if(Number.isNaN(t))throw new x(e,`unexpected NaN number`);if(!Number.isFinite(t))throw new x(e,`unexpected infinite number`);break}if(typeof t==`string`){if(t===``||t.trim().length!==t.length)break;let e=Number(t);if(!Number.isFinite(e))break;return e}break;case I.INT32:case I.FIXED32:case I.SFIXED32:case I.SINT32:case I.UINT32:return Ft(t);case I.BYTES:if(typeof t==`string`){if(t===``)return new Uint8Array;try{return y(t)}catch(t){throw new x(e,t instanceof Error?t.message:String(t))}}break}return t}function Pt(e,t){switch(e){case I.BOOL:switch(t){case`true`:return!0;case`false`:return!1}return t;case I.INT32:case I.FIXED32:case I.UINT32:case I.SFIXED32:case I.SINT32:return Ft(t);case I.INT64:case I.SINT64:case I.SFIXED64:case I.UINT64:case I.FIXED64:return/^-?0+$/.test(t)?`0`:t.replace(/^(-?)0+(?=\d)/,`$1`);default:return t}}function Ft(e){if(typeof e==`string`){if(e===``||e.trim().length!==e.length)return e;let t=Number(e);return Number.isNaN(t)?e:t}return e}function It(e,t){let n;try{n=JSON.parse(e)}catch(e){let n=e instanceof Error?e.message:String(e);throw Error(`cannot decode message ${t} from JSON: ${n}`,{cause:e})}return Lt(e,t),n}function Lt(e,t){let n=[],r=!1,i=0;for(;i<e.length;)switch(e[i]){case`{`:n.push(new Set),r=!0,i++;break;case`[`:n.push(null),r=!1,i++;break;case`}`:case`]`:n.pop(),r=!1,i++;break;case`,`:r=n[n.length-1]!=null,i++;break;case`:`:r=!1,i++;break;case`"`:{let a=i++,o=!1;for(;i<e.length;){if(e[i]==`\\`){o=!0,i+=2;continue}if(e[i]==`"`)break;i++}let s=i++,c=n[n.length-1];if(r&&c){let n=o?JSON.parse(e.substring(a,s+1)):e.substring(a+1,s);if(c.has(n))throw Error(`cannot decode message ${t} from JSON: duplicate object key "${n}"`);c.add(n)}r=!1;break}default:i++;break}}function Rt(e,t,n){if(!e.desc.typeName.startsWith(`google.protobuf.`))return!1;switch(e.desc.typeName){case`google.protobuf.Any`:return zt(e.message,t,n),!0;case`google.protobuf.Timestamp`:return Bt(e.message,t),!0;case`google.protobuf.Duration`:return Vt(e.message,t),!0;case`google.protobuf.FieldMask`:return Ht(e.message,t),!0;case`google.protobuf.Struct`:return Ut(e.message,t,n),!0;case`google.protobuf.Value`:return Wt(e.message,t,n),!0;case`google.protobuf.ListValue`:return Gt(e.message,t,n),!0;default:if(D(e.desc)){let n=e.desc.fields[0];return t===null?e.clear(n):e.set(n,Nt(n,t)),!0}return!1}}function zt(e,t,n){if(t===null||Array.isArray(t)||typeof t!=`object`)throw Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${h(t)}`);if(Object.keys(t).length==0)return;let r=t[`@type`];if(typeof r!=`string`||r==``)throw Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);let i=r.includes(`/`)?r.substring(r.lastIndexOf(`/`)+1):r;if(!i.length)throw Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);let a=n.registry?.getMessage(i);if(!a)throw Error(`cannot decode message ${e.$typeName} from JSON: ${r} is not in the type registry`);let o=E(a);if(ae(a)&&Object.prototype.hasOwnProperty.call(t,`value`)){let e=t.value;St(o,e,n)}else{let e=Object.assign({},t);delete e[`@type`],St(o,e,n)}He(o.desc,o.message,e)}function Bt(e,t){if(typeof t!=`string`)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);let n=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);let r=Date.parse(n[1]+`-`+n[2]+`-`+n[3]+`T`+n[4]+`:`+n[5]+`:`+n[6]+(n[8]?n[8]:`Z`));if(Number.isNaN(r))throw Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(r<Date.parse(`0001-01-01T00:00:00Z`)||r>Date.parse(`9999-12-31T23:59:59Z`))throw Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=p.parse(r/1e3),e.nanos=0,n[7]&&(e.nanos=parseInt(`1`+n[7]+`0`.repeat(9-n[7].length))-1e9)}function Vt(e,t){if(typeof t!=`string`)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);let n=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);let r=Number(n[1]);if(r>315576e6||r<-315576e6)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);if(e.seconds=p.parse(r),typeof n[2]!=`string`)return;let i=n[2]+`0`.repeat(9-n[2].length);e.nanos=parseInt(i),(r<0||Object.is(r,-0))&&(e.nanos=-e.nanos)}function Ht(e,t){if(typeof t!=`string`)throw Error(`cannot decode message ${e.$typeName} from JSON: ${h(t)}`);t!==``&&(e.paths=t.split(`,`).map(t=>{if(t.includes(`_`))throw Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);return v(t)}))}function Ut(e,t,n){if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`cannot decode message ${e.$typeName} from JSON ${h(t)}`);for(let[r,i]of Object.entries(t)){let t=m(j);Wt(t,i,n),e.fields[r]=t}}function Wt(e,t,n){if(++n.depth>n.recursionLimit)throw Error(`cannot decode ${e.$typeName} from JSON: maximum recursion depth of ${n.recursionLimit} reached`);switch(typeof t){case`number`:e.kind={case:`numberValue`,value:t};break;case`string`:e.kind={case:`stringValue`,value:t};break;case`boolean`:e.kind={case:`boolValue`,value:t};break;case`object`:if(t===null)e.kind={case:`nullValue`,value:te.NULL_VALUE};else if(Array.isArray(t)){let r=m(N);Gt(r,t,n),e.kind={case:`listValue`,value:r}}else{let r=m(ee);Ut(r,t,n),e.kind={case:`structValue`,value:r}}break;default:throw Error(`cannot decode message ${e.$typeName} from JSON ${h(t)}`)}return n.depth--,e}function Gt(e,t,n){if(!Array.isArray(t))throw Error(`cannot decode message ${e.$typeName} from JSON ${h(t)}`);for(let r of t){let t=m(j);Wt(t,r,n),e.values.push(t)}}function Kt(...e){let t=new AbortController,n=e.filter(e=>e!==void 0).concat(t.signal);for(let e of n){if(e.aborted){r.apply(e);break}e.addEventListener(`abort`,r)}function r(){t.signal.aborted||t.abort(Jt(this));for(let e of n)e.removeEventListener(`abort`,r)}return t}function qt(e){let t=new AbortController,n=()=>{t.abort(new L(`the operation timed out`,R.DeadlineExceeded))},r;return e!==void 0&&(e<=0?n():r=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(r)}}function Jt(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;let t=Error(`This operation was aborted`);return t.name=`AbortError`,t}function Yt(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}function Xt(e){let t;if(e.timeoutMs!==void 0){let n=new Date(Date.now()+e.timeoutMs);t=()=>n.getTime()-Date.now()}else t=()=>void 0;let n=qt(e.timeoutMs),r=Kt(n.signal,e.requestSignal,e.shutdownSignal);return Object.assign(Object.assign({},e),{signal:r.signal,timeoutMs:t,requestHeader:new Headers(e.requestHeader),responseHeader:new Headers(e.responseHeader),responseTrailer:new Headers(e.responseTrailer),abort(e){n.cleanup(),r.abort(e)},values:e.contextValues??Yt()})}function Zt(e,t){return{kind:e.methodKind,method:e,impl:t}}function Qt(e,t){let n={service:e,methods:{}};for(let r of e.methods){let i=t[r.localName];if(typeof i==`function`)i=i.bind(t);else{let t=`${e.typeName}.${r.name} is not implemented`;i=function(){throw new L(t,R.Unimplemented)}}n.methods[r.localName]=Zt(r,i)}return n}function $t(e){let t=new Headers,n=new TextDecoder().decode(e).split(`\r
3
+ `);for(let e of n){if(e===``)continue;let n=e.indexOf(`:`);if(n>0){let r=e.substring(0,n).trim(),i=e.substring(n+1).trim();t.append(r,i)}}return t}function en(e){let t=[];return e.forEach((e,n)=>{t.push(`${n}: ${e}\r\n`)}),new TextEncoder().encode(t.join(``))}function tn(){return{serialize:en,parse:$t}}const nn=`Content-Type`,rn=`Grpc-Encoding`,an=`Grpc-Accept-Encoding`,on=`Grpc-Timeout`,sn=`Grpc-Status`,cn=/^application\/grpc-web(-text)?(?:\+(?:(json)(?:; ?charset=utf-?8)?|proto))?$/i;function ln(e){let t=e?.match(cn);if(t)return{text:!!t[1],binary:!t[2]}}function un(e,t){if(e===null)return{};let n=/^(\d{1,8})([HMSmun])$/.exec(e);if(n===null)return{error:new L(`protocol error: invalid grpc timeout value: ${e}`,R.InvalidArgument)};let r={H:3600*1e3,M:60*1e3,S:1e3,m:1,u:.001,n:1e-6}[n[2]]*parseInt(n[1]);return r>t?{timeoutMs:r,error:new L(`timeout ${r}ms must be <= ${t}`,R.InvalidArgument)}:{timeoutMs:r}}const dn=_(ie(`CgxzdGF0dXMucHJvdG8SCmdvb2dsZS5ycGMiTgoGU3RhdHVzEgwKBGNvZGUYASABKAUSDwoHbWVzc2FnZRgCIAEoCRIlCgdkZXRhaWxzGAMgAygLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUJeCg5jb20uZ29vZ2xlLnJwY0ILU3RhdHVzUHJvdG9QAVo3Z29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9ycGMvc3RhdHVzO3N0YXR1c6ICA1JQQ2IGcHJvdG8z`,[ke]),0);function fn(e,t){let n;return n=t===void 0?typeof e==`string`?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e):Ne(t,e),b(n,`std_raw`)}function pn(...e){let t=new Headers;for(let n of e)n.forEach((e,n)=>{t.append(n,e)});return t}function mn(e,t){if(t){if(t.metadata.forEach((t,n)=>{e.append(n,t)}),e.set(sn,t.code.toString(10)),e.set(`Grpc-Message`,encodeURIComponent(t.rawMessage)),t.details.length>0){let n=m(dn,{code:t.code,message:t.rawMessage,details:t.details.map(e=>`desc`in e?He(e.desc,m(e.desc,e.value)):{typeUrl:`type.googleapis.com/${e.type}`,value:e.value})});e.set(`Grpc-Status-Details-Bin`,fn(n,dn))}}else e.set(sn,`0`);return e}function hn(e,t,n,r){let i=null,a=null,o;if(t!==null&&t!==`identity`){let n=e.find(e=>e.name===t);if(n)i=n;else{let n=e.map(e=>e.name).join(`,`);o=new L(`unknown compression "${t}": supported encodings are ${n}`,R.Unimplemented,{[r]:n})}}if(n===null||n===``)a=i;else{let t=n.split(`,`).map(e=>e.trim());for(let n of t){let t=e.find(e=>e.name===n);if(t){a=t;break}}}return{request:i,response:a,error:o}}const gn=4294967295,_n=gn;function vn(e,t,n){if(t??=_n,e??=gn,n??=1024,t<1||t>_n)throw new L(`writeMaxBytes ${t} must be >= 1 and <= ${_n}`,R.Internal);if(e<1||e>gn)throw new L(`readMaxBytes ${e} must be >= 1 and <= ${gn}`,R.Internal);return{readMaxBytes:e,writeMaxBytes:t,compressMinBytes:n}}function yn(e,t){if(t>e)throw new L(`message size ${t} is larger than configured writeMaxBytes ${e}`,R.ResourceExhausted)}function bn(e,t,n=!1){if(t>e){let r=`message size is larger than configured readMaxBytes ${e}`;throw n&&(r=`message size ${t} is larger than configured readMaxBytes ${e}`),new L(r,R.ResourceExhausted)}}function xn(e){return new Sn(e)}var Sn=class{constructor(e){this.readMaxBytes=e,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((e,t)=>e+t.byteLength,0)}decode(e){this.buf.push(e);let t=[];for(;;){let e=this.pop();if(!e)break;t.push(e)}return t}pop(){if(!(!this.env&&(this.env=this.head(),!this.env))&&this.cons(this.env.data)){let e=this.env;return this.env=void 0,e}}head(){if(!this.cons(this.header))return;let e=this.headerView.getUint8(0),t=this.headerView.getUint32(1);return bn(this.readMaxBytes,t,!0),{flags:e,data:new Uint8Array(t)}}cons(e){let t=e.byteLength;if(this.byteLength<t)return!1;let n=0;for(;n<t;){let r=this.buf.shift();r.byteLength>t-n?(e.set(r.subarray(0,t-n),n),this.buf.unshift(r.subarray(t-n)),n+=t-n):(e.set(r,n),n+=r.byteLength)}return!0}};async function Cn(e,t,n){let{flags:r,data:i}=e;if((r&1)==1)throw new L(`invalid envelope, already compressed`,R.Internal);return t&&i.byteLength>=n&&(i=await t.compress(i),r|=1),{data:i,flags:r}}async function wn(e,t,n){let{flags:r,data:i}=e;if((r&1)==1){if(!t)throw new L(`received compressed envelope, but do not know how to decompress`,R.Internal);i=await t.decompress(i,n),r^=1}return{data:i,flags:r}}function Tn(e,t){let n=new Uint8Array(t.length+5);n.set(t,5);let r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var En=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},U=function(e){return this instanceof U?(this.v=e,this):new U(e)},Dn=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof U?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}},On=function(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:U(e[r](t)),done:!1}:i?i(t):t}:i}};function kn(e,...t){return Dn(this,arguments,function*(){var n;let[r,i]=An(t),a,o=e[Symbol.asyncIterator](),s={[Symbol.asyncIterator](){return o}};i?.propagateDownStreamError===!0&&(s=a=Hn(s));for(let e of r)s=e(s);let c=s[Symbol.asyncIterator]();try{for(;;){let e=yield U(c.next());if(e.done===!0)break;if(!a){yield yield U(e.value);continue}try{yield yield U(e.value)}catch(e){throw yield U(a.abort(e)),e}}}finally{i?.propagateDownStreamError===!0&&((n=o.return)==null||n.call(o).catch(()=>{}))}})}function An(e){let t;return typeof e[e.length-1]!=`function`&&(t=e.pop()),[e,t]}function jn(e){return function(t){return Dn(this,arguments,function*(){let n,r=t[Symbol.asyncIterator]();for(;;){let e;try{e=yield U(r.next())}catch(e){n=e;break}if(e.done===!0)break;yield yield U(e.value)}let i=yield U(e(n));i!==void 0&&(yield yield U(i))})}}function Mn(e){return function(t){return Dn(this,arguments,function*(){var n,r,i,a;let o=yield U(e());o!==void 0&&(yield yield U(o));try{for(var s=!0,c=En(t),l;l=yield U(c.next()),n=l.done,!n;s=!0)a=l.value,s=!1,yield yield U(a)}catch(e){r={error:e}}finally{try{!s&&!n&&(i=c.return)&&(yield U(i.call(c)))}finally{if(r)throw r.error}}})}}function Nn(e,t,n){return t===void 0||n===void 0?function(t){return Dn(this,arguments,function*(){var n,r,i,a;try{for(var o=!0,s=En(t),c;c=yield U(s.next()),n=c.done,!n;o=!0){a=c.value,o=!1;let t=a;yield yield U({flags:0,data:e.serialize(t)})}}catch(e){r={error:e}}finally{try{!o&&!n&&(i=s.return)&&(yield U(i.call(s)))}finally{if(r)throw r.error}}})}:function(r){return Dn(this,arguments,function*(){var i,a,o,s;try{for(var c=!0,l=En(r),u;u=yield U(l.next()),i=u.done,!i;c=!0){s=u.value,c=!1;let r=s,i,a=0;r.end?(a|=t,i=n.serialize(r.value)):i=e.serialize(r.value),yield yield U({flags:a,data:i})}}catch(e){a={error:e}}finally{try{!c&&!i&&(o=l.return)&&(yield U(o.call(l)))}finally{if(a)throw a.error}}})}}function Pn(e,t,n){return n&&t!==void 0?function(r){return Dn(this,arguments,function*(){var i,a,o,s;try{for(var c=!0,l=En(r),u;u=yield U(l.next()),i=u.done,!i;c=!0){s=u.value,c=!1;let{flags:r,data:i}=s;(r&t)===t?yield yield U({value:n.parse(i),end:!0}):yield yield U({value:e.parse(i),end:!1})}}catch(e){a={error:e}}finally{try{!c&&!i&&(o=l.return)&&(yield U(o.call(l)))}finally{if(a)throw a.error}}})}:function(r){return Dn(this,arguments,function*(){var i,a,o,s;try{for(var c=!0,l=En(r),u;u=yield U(l.next()),i=u.done,!i;c=!0){s=u.value,c=!1;let{flags:r,data:i}=s;if(t!==void 0&&(r&t)===t){if(n===null)throw new L(`unexpected end flag`,R.InvalidArgument);continue}yield yield U(e.parse(i))}}catch(e){a={error:e}}finally{try{!c&&!i&&(o=l.return)&&(yield U(o.call(l)))}finally{if(a)throw a.error}}})}}function Fn(e,t){return function(n){return Dn(this,arguments,function*(){var r,i,a,o;try{for(var s=!0,c=En(n),l;l=yield U(c.next()),r=l.done,!r;s=!0)o=l.value,s=!1,yield yield U(yield U(Cn(o,e,t)))}catch(e){i={error:e}}finally{try{!s&&!r&&(a=c.return)&&(yield U(a.call(c)))}finally{if(i)throw i.error}}})}}function In(e,t){return function(n){return Dn(this,arguments,function*(){var r,i,a,o;try{for(var s=!0,c=En(n),l;l=yield U(c.next()),r=l.done,!r;s=!0)o=l.value,s=!1,yield yield U(yield U(wn(o,e,t)))}catch(e){i={error:e}}finally{try{!s&&!r&&(a=c.return)&&(yield U(a.call(c)))}finally{if(i)throw i.error}}})}}function Ln(){return function(e){return Dn(this,arguments,function*(){var t,n,r,i;try{for(var a=!0,o=En(e),s;s=yield U(o.next()),t=s.done,!t;a=!0){i=s.value,a=!1;let{flags:e,data:t}=i;yield yield U(Tn(e,t))}}catch(e){n={error:e}}finally{try{!a&&!t&&(r=o.return)&&(yield U(r.call(o)))}finally{if(n)throw n.error}}})}}function Rn(e){return function(t){return Dn(this,arguments,function*(){var n,r,i,a;let o=xn(e);try{for(var s=!0,c=En(t),l;l=yield U(c.next()),n=l.done,!n;s=!0){a=l.value,s=!1;let e=a;for(let t of o.decode(e))yield yield U(t)}}catch(e){r={error:e}}finally{try{!s&&!n&&(i=c.return)&&(yield U(i.call(c)))}finally{if(r)throw r.error}}if(o.byteLength>0)throw new L(`protocol error: incomplete envelope`,R.InvalidArgument)})}}async function zn(e,t,n){var r,i,a,o,s,c,l,u;let[d,f]=Bn(n);if(d){f>t&&bn(t,f,!0);let n=new Uint8Array(f),s=0;try{for(var p=!0,m=En(e),h;h=await m.next(),r=h.done,!r;p=!0){o=h.value,p=!1;let e=o;if(s+e.byteLength>f)throw new L(`protocol error: promised ${f} bytes, received ${s+e.byteLength}`,R.InvalidArgument);n.set(e,s),s+=e.byteLength}}catch(e){i={error:e}}finally{try{!p&&!r&&(a=m.return)&&await a.call(m)}finally{if(i)throw i.error}}if(s<f)throw new L(`protocol error: promised ${f} bytes, received ${s}`,R.InvalidArgument);return n}let g=[],_=0;try{for(var v=!0,y=En(e),b;b=await y.next(),s=b.done,!s;v=!0){u=b.value,v=!1;let e=u;_+=e.byteLength,bn(t,_),g.push(e)}}catch(e){c={error:e}}finally{try{!v&&!s&&(l=y.return)&&await l.call(y)}finally{if(c)throw c.error}}let x=new Uint8Array(_),S=0;for(let e=g.shift();e;e=g.shift())x.set(e,S),S+=e.byteLength;return x}function Bn(e){if(e==null)return[!1,0];let t=typeof e==`string`?parseInt(e,10):e;return!Number.isSafeInteger(t)||t<0?[!1,t]:[!0,t]}async function Vn(e){let t=e[Symbol.asyncIterator](),n=await t.next();return{[Symbol.asyncIterator](){let e={async next(){if(n!==null){let e=n;return n=null,e}return await t.next()}};return t.throw!==void 0&&(e.throw=e=>t.throw(e)),t.return!==void 0&&(e.return=e=>t.return(e)),e}}}function Hn(e){let t=e[Symbol.asyncIterator]();if(t.throw===void 0)throw Error(`AsyncIterable does not implement throw`);let n=t,r,i,a={next(){return i=n.next().finally(()=>{i=void 0}),i},throw(e){return n.throw(e)}};t.return!==void 0&&(a=Object.assign(Object.assign({},a),{return(e){return n.return(e)}}));let o=!1;return{abort(e){if(r)return r.state;let t=()=>n.throw(e).then(e=>e.done===!0?`completed`:`caught`,()=>`rethrown`);return i?(r={reason:e,state:i.then(t,t)},r.state):(r={reason:e,state:t()},r.state)},[Symbol.asyncIterator](){if(o)throw Error(`AsyncIterable cannot be re-used`);return o=!0,a}}}function Un(e){return Dn(this,arguments,function*(){yield U(yield*On(En(e)))})}function Wn(...e){let t=new Map,n=e.reduce((e,t)=>e.concat(`supported`in t?t.supported:t),[]);function r(e){if(e===null||e.length==0)return!1;let r=t.get(e);if(r!==void 0)return r;let i=n.some(t=>t.test(e));return t.size<1024&&t.set(e,i),i}return r.supported=n,r}function Gn(e,t){return e.toString().replace(/\/?$/,`/${t.parent.typeName}/${t.name}`)}function Kn(e,t){return m(e,t)}function qn(e,t){function n(t){return t.done===!0?t:{done:t.done,value:Kn(e,t.value)}}return{[Symbol.asyncIterator](){let e=t[Symbol.asyncIterator](),r={next:()=>e.next().then(n)};return e.throw!==void 0&&(r.throw=t=>e.throw(t).then(n)),e.return!==void 0&&(r.return=t=>e.return(t).then(n)),r}}}function Jn(e,t){if(!t)return e;for(let n of t.concat().reverse())e=n(e);return e}var Yn=function(e){return this instanceof Yn?(this.v=e,this):new Yn(e)},Xn=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Yn?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}},Zn=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Qn=function(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Yn(e[r](t)),done:!1}:i?i(t):t}:i}};async function $n(e,t,n,r){let{message:i,header:a,trailer:o}=await Jn(async n=>Object.assign({message:Kn(e.method.output,await e.impl(n.message,ar(t,n))),stream:!1,method:e.method},ir(t,e)),r)(Object.assign({stream:!1,message:n,method:e.method},rr(t,e)));return or(a,t.responseHeader),or(o,t.responseTrailer),i}function er(e,t,n){switch(e.kind){case`unary`:return function(r){return Xn(this,arguments,function*(){yield yield Yn(yield Yn($n(e,t,yield Yn(nr(r,`unary`)),n)))})};case`server_streaming`:return function(r){return tr(e,t,r,n,async n=>{let r=qn(e.method.output,e.impl(await nr(n.message,`server-streaming`),ar(t,n)));return Object.assign({stream:!0,message:r,method:e.method},ir(t,e))})};case`client_streaming`:return function(r){return tr(e,t,r,n,async n=>Object.assign({message:Un([Kn(e.method.output,await e.impl(n.message,ar(t,n)))]),stream:!0,method:e.method},ir(t,e)))};case`bidi_streaming`:return function(r){return tr(e,t,r,n,n=>Promise.resolve(Object.assign({message:qn(e.method.output,e.impl(n.message,ar(t,n))),stream:!0,method:e.method},ir(t,e))))}}}function tr(e,t,n,r,i){return Xn(this,arguments,function*(){let{message:a,header:o,trailer:s}=yield Yn(Jn(i,r)(Object.assign({stream:!0,message:n,method:e.method},rr(t,e))));or(o,t.responseHeader),yield Yn(yield*Qn(Zn(a))),or(s,t.responseTrailer)})}async function nr(e,t){let n=e[Symbol.asyncIterator](),r=await n.next();if(r.done===!0)throw new L(`protocol error: missing input message for ${t} method`,R.Unimplemented);if((await n.next()).done!==!0)throw new L(`protocol error: received extra input message for ${t} method`,R.Unimplemented);return r.value}function rr(e,t){return{requestMethod:e.requestMethod,url:e.url,signal:e.signal,header:e.requestHeader,service:t.method.parent,contextValues:e.values}}function ir(e,t){return{service:t.method.parent,header:e.responseHeader,trailer:e.responseTrailer}}function ar(e,t){return Object.assign(Object.assign({},e),{service:t.service,requestHeader:t.header,signal:t.signal,values:t.contextValues})}function or(e,t){e!==t&&(t.forEach((e,n)=>{t.delete(n)}),e.forEach((e,n)=>{t.set(n,e)}))}function sr(e){let t=Object.assign({},e);return t.ignoreUnknownFields??=!0,t}function cr(e,t,n,r){let i=lr(ur(e.input,t),r),a=lr(dr(e.input,n),r),o=lr(ur(e.output,t),r),s=lr(dr(e.output,n),r);return{getI(e){return e?i:a},getO(e){return e?o:s}}}function lr(e,t){return{serialize(n){let r=e.serialize(n);return yn(t.writeMaxBytes,r.byteLength),r},parse(n){return bn(t.readMaxBytes,n.byteLength,!0),e.parse(n)}}}function ur(e,t){return{parse(n){try{return F(e,n,t)}catch(e){throw new L(`parse binary: ${e instanceof Error?e.message:String(e)}`,R.Internal)}},serialize(n){try{return Ne(e,n,t)}catch(e){throw new L(`serialize binary: ${e instanceof Error?e.message:String(e)}`,R.Internal)}}}}function dr(e,t){let n=t?.textEncoder??new TextEncoder,r=t?.textDecoder??new TextDecoder,i=sr(t);return{parse(t){try{return vt(e,r.decode(t),i)}catch(e){throw L.from(e,R.InvalidArgument)}},serialize(t){try{let r=tt(e,t,i);return n.encode(r)}catch(e){throw L.from(e,R.Internal)}}}}function fr(e){if(!(typeof e.body==`object`&&e.body!==null&&Symbol.asyncIterator in e.body))throw Error(`byte stream required, but received JSON`)}const pr={status:200},mr={status:404},hr={status:415},gr={status:405},_r={status:505};function vr(e){e??={};let t=e.acceptCompression?[...e.acceptCompression]:[],n=e.requireConnectProtocolHeader??!1,r=e.maxTimeoutMs??2**53-1;return Object.assign(Object.assign({acceptCompression:t},vn(e.readMaxBytes,e.writeMaxBytes,e.compressMinBytes)),{jsonOptions:e.jsonOptions,binaryOptions:e.binaryOptions,maxTimeoutMs:r,shutdownSignal:e.shutdownSignal,requireConnectProtocolHeader:n,interceptors:e.interceptors??[]})}function yr(e,t){return Object.entries(e.methods).map(([,e])=>br(e,t))}function br(e,t){return xr(t.map(t=>t(e)))}function xr(e){if(e.length==0)throw new L(`at least one protocol is required`,R.Internal);let t=e[0].service,n=e[0].method,r=e[0].requestPath;if(e.some(e=>e.service!==t||e.method!==n))throw new L(`cannot negotiate protocol for different RPCs`,R.Internal);if(e.some(e=>e.requestPath!==r))throw new L(`cannot negotiate protocol for different requestPaths`,R.Internal);async function i(t){if(n.methodKind==`bidi_streaming`&&t.httpVersion.startsWith(`1.`))return Object.assign(Object.assign({},_r),{header:new Headers({Connection:`close`})});let r=t.header.get(`Content-Type`)??``,i=e.filter(e=>e.allowedMethods.includes(t.method));if(i.length==0)return gr;if(i.length==1&&r===``){let e=i[0];return e(t)}let a=i.filter(e=>e.supportedContentType(r));if(a.length==0)return hr;let o=a[0];return o(t)}return Object.assign(i,{service:t,method:n,requestPath:r,supportedContentType:Wn(...e.map(e=>e.supportedContentType)),protocolNames:e.flatMap(e=>e.protocolNames).filter((e,t,n)=>n.indexOf(e)===t),allowedMethods:e.flatMap(e=>e.allowedMethods).filter((e,t,n)=>n.indexOf(e)===t)})}const Sr=`grpc-web`,Cr=`POST`;function wr(e){let t=vr(e),n=tn();function r(e){let r=Tr(t,n,e);return Object.assign(r,{protocolNames:[Sr],allowedMethods:[Cr],supportedContentType:Wn(cn),requestPath:Gn(`/`,e.method),service:e.method.parent,method:e.method})}return r.protocolName=Sr,r}function Tr(e,t,n){let r=cr(n.method,e.binaryOptions,e.jsonOptions,e);return async function(i){fr(i);let a=ln(i.header.get(nn));if(a==null||a.text)return hr;if(i.method!==Cr)return gr;let o=un(i.header.get(on),e.maxTimeoutMs),s=Xt(Object.assign(Object.assign({},n),{service:n.method.parent,requestMethod:i.method,protocolName:Sr,timeoutMs:o.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:i.signal,requestHeader:i.header,url:i.url,responseHeader:{[nn]:a.binary?`application/grpc-web+proto`:`application/grpc-web+json`},responseTrailer:{[sn]:`0`},contextValues:i.contextValues})),c=hn(e.acceptCompression,i.header.get(rn),i.header.get(an),an);c.response&&s.responseHeader.set(rn,c.response.name);let l=kn(i.body,Mn(()=>{if(c.error)throw c.error;if(o.error)throw o.error}),Rn(e.readMaxBytes),In(c.request,e.readMaxBytes),Pn(r.getI(a.binary),128)),u=er(n,s,e.interceptors)(l)[Symbol.asyncIterator](),d=kn({[Symbol.asyncIterator](){return{next:()=>u.next(),throw:e=>(s.abort(e),u.throw?.call(u,e)??Promise.reject({done:!0})),return:e=>(s.abort(),u.return?.call(u,e)??Promise.resolve({done:!0,value:e}))}}},Nn(r.getO(a.binary)),jn(e=>(s.abort(e),e instanceof L?mn(s.responseTrailer,e):e!==void 0&&mn(s.responseTrailer,new L(`internal error`,R.Internal,void 0,void 0,e)),{flags:128,data:t.serialize(s.responseTrailer)})),Fn(c.response,e.compressMinBytes),Ln(),{propagateDownStreamError:!0});return Object.assign(Object.assign({},pr),{body:await Vn(d),header:s.responseHeader})}}const Er=/^application\/grpc(?:\+(?:(json)(?:; ?charset=utf-?8)?|proto))?$/i;function Dr(e){let t=e?.match(Er);if(t)return{binary:!t[1]}}const Or=`grpc`,kr=`POST`;function Ar(e){let t=vr(e);function n(e){let n=jr(t,e);return Object.assign(n,{protocolNames:[Or],allowedMethods:[kr],supportedContentType:Wn(Er),requestPath:Gn(`/`,e.method),service:e.method.parent,method:e.method})}return n.protocolName=Or,n}function jr(e,t){let n=cr(t.method,e.binaryOptions,e.jsonOptions,e);return async function(r){fr(r);let i=Dr(r.header.get(nn));if(i==null)return hr;if(r.method!==kr)return gr;let a=un(r.header.get(on),e.maxTimeoutMs),o=Xt(Object.assign(Object.assign({},t),{service:t.method.parent,requestMethod:r.method,protocolName:Or,timeoutMs:a.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:r.signal,requestHeader:r.header,url:r.url,responseHeader:{[nn]:i.binary?`application/grpc+proto`:`application/grpc+json`},responseTrailer:{[sn]:`0`},contextValues:r.contextValues})),s=hn(e.acceptCompression,r.header.get(rn),r.header.get(an),an);s.response&&o.responseHeader.set(rn,s.response.name);let c=kn(r.body,Mn(()=>{if(s.error)throw s.error;if(a.error)throw a.error}),Rn(e.readMaxBytes),In(s.request,e.readMaxBytes),Pn(n.getI(i.binary))),l=er(t,o,e.interceptors)(c)[Symbol.asyncIterator](),u=kn({[Symbol.asyncIterator](){return{next:()=>l.next(),throw:e=>(o.abort(e),l.throw?.call(l,e)??Promise.reject({done:!0})),return:e=>(o.abort(),l.return?.call(l,e)??Promise.resolve({done:!0,value:e}))}}},Nn(n.getO(i.binary)),Fn(s.response,e.compressMinBytes),Ln(),jn(e=>{o.abort(e),e instanceof L?mn(o.responseTrailer,e):e!==void 0&&mn(o.responseTrailer,new L(`internal error`,R.Internal,void 0,void 0,e))}),{propagateDownStreamError:!0});return Object.assign(Object.assign({},pr),{body:await Vn(u),header:o.responseHeader,trailer:o.responseTrailer})}}const Mr=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i,Nr=/^application\/(?:json(?:; ?charset=utf-?8)?|proto)$/i,Pr=/^application\/connect\+?(?:json(?:; ?charset=utf-?8)?|proto)$/i,Fr=`application/json`;function Ir(e){let t=e?.match(Mr);if(t)return{stream:!!t[1],binary:!!t[3]}}function Lr(e){switch(e){case`proto`:return{stream:!1,binary:!0};case`json`:return{stream:!1,binary:!1};default:return}}var Rr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function zr(e,t,n){if(t&&new Headers(t).forEach((e,t)=>n.metadata.append(t,e)),typeof e!=`object`||!e||Array.isArray(e))throw n;let r=n.code;`code`in e&&typeof e.code==`string`&&(r=ce(e.code)??r);let i=e.message;if(i!=null&&typeof i!=`string`)throw n;let a=new L(i??``,r,t);if(`details`in e&&Array.isArray(e.details))for(let t of e.details){if(typeof t!=`object`||!t||Array.isArray(t)||typeof t.type!=`string`||typeof t.value!=`string`)throw n;try{a.details.push({type:t.type,value:y(t.value),debug:t.debug})}catch{throw n}}return a}function Br(e,t){let n={code:de(e.code)};return e.rawMessage.length>0&&(n.message=e.rawMessage),e.details.length>0&&(n.details=e.details.map(e=>{if(`desc`in e){let n=m(e.desc,e.value),r={type:e.desc.typeName,value:Ne(e.desc,n)};try{r.debug=et(e.desc,n,t)}catch{}return r}return e}).map(e=>{var{value:t}=e,n=Rr(e,[`value`]);return Object.assign(Object.assign({},n),{value:b(t,`std_raw`)})})),n}function Vr(e,t){let n=new TextEncoder;try{let r=Br(e,t),i=JSON.stringify(r);return n.encode(i)}catch(e){throw new L(`failed to serialize Connect Error: ${e instanceof Error?e.message:String(e)}`,R.Internal)}}function Hr(e){let t=new L(`invalid end stream`,R.Unknown),n;try{n=JSON.parse(typeof e==`string`?e:new TextDecoder().decode(e))}catch{throw t}if(typeof n!=`object`||!n||Array.isArray(n))throw t;let r=new Headers;if(`metadata`in n){if(typeof n.metadata!=`object`||n.metadata==null||Array.isArray(n.metadata))throw t;for(let[e,i]of Object.entries(n.metadata)){if(!Array.isArray(i)||i.some(e=>typeof e!=`string`))throw t;for(let t of i)r.append(e,t)}}return{metadata:r,error:`error`in n&&n.error!=null?zr(n.error,r,t):void 0}}function Ur(e,t,n){let r={};t!==void 0&&(r.error=Br(t,n),e=pn(e,t.metadata));let i=!1,a={};return e.forEach((e,t)=>{i=!0,a[t]=[e]}),i&&(r.metadata=a),r}function Wr(e){let t=new TextEncoder;return{serialize(n){try{let r=Ur(n.metadata,n.error,e),i=JSON.stringify(r);return t.encode(i)}catch(e){throw new L(`failed to serialize EndStreamResponse: ${e instanceof Error?e.message:String(e)}`,R.Internal)}},parse(e){try{return Hr(e)}catch(e){throw new L(`failed to parse EndStreamResponse: ${e instanceof Error?e.message:String(e)}`,R.InvalidArgument)}}}}const Gr=`Content-Type`,Kr=`Content-Length`,qr=`Content-Encoding`,Jr=`Connect-Content-Encoding`,Yr=`Accept-Encoding`,Xr=`Connect-Accept-Encoding`,Zr=`Connect-Timeout-Ms`,Qr=`Connect-Protocol-Version`;function $r(e){switch(e){case R.Canceled:return 499;case R.Unknown:return 500;case R.InvalidArgument:return 400;case R.DeadlineExceeded:return 504;case R.NotFound:return 404;case R.AlreadyExists:return 409;case R.PermissionDenied:return 403;case R.ResourceExhausted:return 429;case R.FailedPrecondition:return 400;case R.Aborted:return 409;case R.OutOfRange:return 400;case R.Unimplemented:return 501;case R.Internal:return 500;case R.Unavailable:return 503;case R.DataLoss:return 500;case R.Unauthenticated:return 401;default:return 500}}function ei(e,t){if(e===null)return{};let n=/^\d{1,10}$/.exec(e);if(n===null)return{error:new L(`protocol error: invalid connect timeout value: ${e}`,R.InvalidArgument)};let r=parseInt(n[0]);return r>t?{timeoutMs:r,error:new L(`timeout ${r}ms must be <= ${t}`,R.InvalidArgument)}:{timeoutMs:parseInt(n[0])}}const ti=`connect`;function ni(e,t){let n=new Headers(e);return t.forEach((e,t)=>{n.append(`trailer-${t}`,e)}),n}function ri(e){let t=e.get(Qr);if(t===null)throw new L(`missing required header: set ${Qr} to "1"`,R.InvalidArgument);if(t!==`1`)throw new L(`${Qr} must be "1": got "${t}"`,R.InvalidArgument)}function ii(e){let t=e.get(ti);if(t===null)throw new L(`missing required parameter: set ${ti} to "v1"`,R.InvalidArgument);if(t!==`v1`)throw new L(`${ti} must be "v1": got "${t}"`,R.InvalidArgument)}const ai=`connect`,oi=`POST`;function si(e){let t=vr(e),n=Wr(t.jsonOptions);function r(e){let r,i,a=cr(e.method,t.binaryOptions,t.jsonOptions,t);switch(e.kind){case`unary`:i=Nr,r=ci(t,e,a);break;default:i=Pr,r=fi(t,e,a,n);break}let o=[oi];return e.method.idempotency===w.NO_SIDE_EFFECTS&&o.push(`GET`),Object.assign(r,{protocolNames:[ai],supportedContentType:Wn(i),allowedMethods:o,requestPath:Gn(`/`,e.method),service:e.method.parent,method:e.method})}return r.protocolName=ai,r}function ci(e,t,n){return async function(r){let i=r.method==`GET`;if(i&&t.method.idempotency!=w.NO_SIDE_EFFECTS)return gr;let a=new URL(r.url).searchParams,o=i?a.get(`compression`):r.header.get(qr),s=i?Lr(a.get(`encoding`)):Ir(r.header.get(Gr));if(s==null||s.stream)return hr;let c=ei(r.header.get(Zr),e.maxTimeoutMs),l=Xt(Object.assign(Object.assign({},t),{service:t.method.parent,requestMethod:r.method,protocolName:ai,timeoutMs:c.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:r.signal,requestHeader:r.header,url:r.url,responseHeader:{[Gr]:s.binary?`application/proto`:Fr},contextValues:r.contextValues})),u=hn(e.acceptCompression,o,r.header.get(Yr),Yr),d=pr.status,f;try{if(e.requireConnectProtocolHeader&&(i?ii(a):ri(r.header)),u.error)throw u.error;if(c.error)throw c.error;let o;o=i?await ui(e.readMaxBytes,u.request,a):await li(e.readMaxBytes,u.request,r);let d=await $n(t,l,di(t.method,s.binary,n,o),e.interceptors);f=n.getO(s.binary).serialize(d)}catch(t){l.abort(t);let n;n=t instanceof L?t:new L(`internal error`,R.Internal,void 0,void 0,t),d=$r(n.code),l.responseHeader.set(Gr,Fr),n.metadata.forEach((e,t)=>{l.responseHeader.set(t,e)}),f=Vr(n,e.jsonOptions)}finally{l.abort()}u.response&&f.byteLength>=e.compressMinBytes&&(f=await u.response.compress(f),l.responseHeader.set(qr,u.response.name));let p=ni(l.responseHeader,l.responseTrailer);return p.set(Kr,f.byteLength.toString(10)),{status:d,body:Un([f]),header:p}}}async function li(e,t,n){if(typeof n.body==`object`&&n.body!==null&&Symbol.asyncIterator in n.body){let r=await zn(n.body,e,n.header.get(Kr));return t&&(r=await t.decompress(r,e)),r}return n.body}async function ui(e,t,n){let r=n.get(`base64`),i=n.get(`message`)??``,a;return a=r===`1`?y(i):new TextEncoder().encode(i),t&&(a=await t.decompress(a,e)),a}function di(e,t,n,r){if(r instanceof Uint8Array)return n.getI(t).parse(r);if(t)throw new L(`received parsed JSON request body, but content-type indicates binary format`,R.Internal);try{return yt(e.input,r)}catch(e){throw L.from(e,R.InvalidArgument)}}function fi(e,t,n,r){return async function(i){fr(i);let a=Ir(i.header.get(Gr));if(a==null||!a.stream)return hr;if(i.method!==oi)return gr;let o=ei(i.header.get(Zr),e.maxTimeoutMs),s=Xt(Object.assign(Object.assign({},t),{service:t.method.parent,requestMethod:i.method,protocolName:ai,timeoutMs:o.timeoutMs,shutdownSignal:e.shutdownSignal,requestSignal:i.signal,requestHeader:i.header,url:i.url,responseHeader:{[Gr]:a.binary?`application/connect+proto`:`application/connect+json`},contextValues:i.contextValues})),c=hn(e.acceptCompression,i.header.get(Jr),i.header.get(Xr),Xr);c.response&&s.responseHeader.set(Jr,c.response.name);let l=kn(i.body,Mn(()=>{if(e.requireConnectProtocolHeader&&ri(i.header),c.error)throw c.error;if(o.error)throw o.error}),Rn(e.readMaxBytes),In(c.request,e.readMaxBytes),Pn(n.getI(a.binary),2)),u=er(t,s,e.interceptors)(l)[Symbol.asyncIterator](),d=kn({[Symbol.asyncIterator](){return{next:()=>u.next(),throw:e=>(s.abort(e),u.throw?.call(u,e)??Promise.reject({done:!0})),return:e=>(s.abort(),u.return?.call(u,e)??Promise.resolve({done:!0,value:e}))}}},Nn(n.getO(a.binary)),jn(e=>{s.abort(e);let t={metadata:s.responseTrailer};return e instanceof L?t.error=e:e!==void 0&&(t.error=new L(`internal error`,R.Internal,void 0,void 0,e)),{flags:2,data:r.serialize(t)}}),Fn(c.response,e.compressMinBytes),Ln(),{propagateDownStreamError:!0});return Object.assign(Object.assign({},pr),{body:await Vn(d),header:s.responseHeader})}}function pi(e){let t=mi(e),n=[],r={handlers:n,service:(e,i,a)=>{let{protocols:o}=mi(a,t);return n.push(...yr(Qt(e,i),o)),r},rpc:(e,i,a)=>{let{protocols:o}=mi(a,t);return n.push(br(Zt(e,i),o)),r}};return r}function mi(e,t){if(t&&!e)return t;let n=t?Object.assign(Object.assign({},vr(t.options)),e):Object.assign(Object.assign({},e),vr(e??{})),r=[];if(e?.grpc!==!1&&r.push(Ar(n)),e?.grpcWeb!==!1&&r.push(wr(n)),e?.connect!==!1&&r.push(si(n)),r.length===0)throw new L(`cannot create handler, all protocols are disabled`,R.InvalidArgument);return{options:n,protocols:r}}function hi(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(!n.startsWith(`:`)&&r!==void 0)if(typeof r==`string`)t.append(n,r);else if(typeof r==`number`)t.append(n,String(r));else for(let e of r)t.append(n,e);return t}function gi(e,t){if(e===void 0&&t===void 0)return;let n=Object.create(null);if(t!==void 0)if(Array.isArray(t))for(let e=0;e+1<t.length;e+=2){let r=t[e],i=t[e+1];Array.isArray(n[r])?n[r].push(i):typeof n[r]==`string`?n[r]=[n[r],i]:n[r]=i}else for(let[e,r]of Object.entries(t))Array.isArray(r)?n[e]=r.concat():r!==void 0&&(n[e]=r);if(e!==void 0)if(Array.isArray(e))for(let[t,r]of e)_i(n,t,r);else if(`forEach`in e)typeof e.forEach==`function`&&e.forEach((e,t)=>{_i(n,t,e)});else for(let[t,r]of Object.entries(e))_i(n,t,r);return n}function _i(e,t,n){t=t.toLowerCase();let r=e[t];Array.isArray(r)?r.push(n):r===void 0?e[t]=n:e[t]=[r.toString(),n]}function vi(e){let t=R.Internal,n=yi(e).map(bi);n.some(e=>e.code==`ERR_STREAM_WRITE_AFTER_END`)||n.some(e=>e.code==`ERR_STREAM_DESTROYED`||e.code==`ERR_HTTP2_INVALID_STREAM`||e.code==`ECONNRESET`)?t=R.Aborted:n.some(e=>e.code==`ETIMEDOUT`||e.code==`ENOTFOUND`||e.code==`EAI_AGAIN`||e.code==`ECONNREFUSED`)&&(t=R.Unavailable);let r=L.from(e,t);return r!==e&&(r.cause=e),r}function yi(e){let t=[];for(;!(!(e instanceof Error)||t.includes(e)||(t.push(e),!(`cause`in e)));)e=e.cause;return t}function bi(e){let t={};return e instanceof Error&&(`code`in e&&typeof e.code==`string`&&(t.code=e.code),`syscall`in e&&typeof e.syscall==`string`&&(t.syscall=e.syscall)),t}function xi(e){switch(e){case W.PROTOCOL_ERROR:case W.INTERNAL_ERROR:case W.FLOW_CONTROL_ERROR:case W.SETTINGS_TIMEOUT:case W.FRAME_SIZE_ERROR:case W.COMPRESSION_ERROR:case W.CONNECT_ERROR:return new L(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,R.Internal);case W.REFUSED_STREAM:return new L(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,R.Unavailable);case W.CANCEL:return new L(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,R.Canceled);case W.ENHANCE_YOUR_CALM:return new L(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,R.ResourceExhausted);case W.INADEQUATE_SECURITY:return new L(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,R.PermissionDenied);case W.HTTP_1_1_REQUIRED:return new L(`http/2 stream closed with error code ${W[e]} (0x${e.toString(16)})`,R.PermissionDenied);default:break}}var W;(function(e){e[e.PROTOCOL_ERROR=1]=`PROTOCOL_ERROR`,e[e.INTERNAL_ERROR=2]=`INTERNAL_ERROR`,e[e.FLOW_CONTROL_ERROR=3]=`FLOW_CONTROL_ERROR`,e[e.SETTINGS_TIMEOUT=4]=`SETTINGS_TIMEOUT`,e[e.STREAM_CLOSED=5]=`STREAM_CLOSED`,e[e.FRAME_SIZE_ERROR=6]=`FRAME_SIZE_ERROR`,e[e.REFUSED_STREAM=7]=`REFUSED_STREAM`,e[e.CANCEL=8]=`CANCEL`,e[e.COMPRESSION_ERROR=9]=`COMPRESSION_ERROR`,e[e.CONNECT_ERROR=10]=`CONNECT_ERROR`,e[e.ENHANCE_YOUR_CALM=11]=`ENHANCE_YOUR_CALM`,e[e.INADEQUATE_SECURITY=12]=`INADEQUATE_SECURITY`,e[e.HTTP_1_1_REQUIRED=13]=`HTTP_1_1_REQUIRED`})(W||={});var Si=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},Ci=function(e){return this instanceof Ci?(this.v=e,this):new Ci(e)},wi=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Ci?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function Ti(e,...t){let n=t.length===3?t[0]:void 0,r=t.length===3?t[1]:t[0],i=t.length===3?t[2]:t[1],a=`encrypted`in e.socket&&e.socket.encrypted?`https`:`http`,o=`authority`in e?e.authority:e.headers.host,s=e.url??``;if(o===void 0)throw new L(`unable to determine request authority from Node.js server request`,R.Internal);let c=r===void 0?Di(e):r,l=new AbortController;if(`stream`in e)e.once(`close`,()=>{let t=xi(e.stream.rstCode);t===void 0?l.abort():l.abort(t)});else{let t=n??e,r=n=>{e.off(`error`,r),t.off(`close`,i),l.abort(vi(n))},i=()=>{e.off(`error`,r),t.off(`close`,i),l.abort(e.errored?vi(e.errored):void 0)};e.once(`error`,r),t.once(`close`,i)}return{httpVersion:e.httpVersion,method:e.method??``,url:new URL(s,`${a}://${o}`).toString(),header:hi(e.headers),body:c,signal:l.signal,contextValues:i}}async function Ei(e,t){var n,r;let i=e.body?.[Symbol.asyncIterator](),a=!1;try{if(i!==void 0){let n=await i.next();for(a=!0,t.writeHead(e.status,gi(e.header)),a=!1;n.done!==!0;n=await i.next())a=!0,await Oi(t,n.value),`flush`in t&&typeof t.flush==`function`&&t.flush(),a=!1}t.headersSent||t.writeHead(e.status,gi(e.header)),e.trailer&&t.addTrailers(gi(e.trailer)),await new Promise(e=>{t.once(`end`,e),t.end()})}catch(e){throw a&&((n=i?.throw)==null||n.call(i,e).catch(()=>{})),vi(e)}finally{(r=i?.return)==null||r.call(i).catch(()=>{})}}function Di(e){return wi(this,arguments,function*(){var t,n,r,i;try{for(var a=!0,o=Si(e),s;s=yield Ci(o.next()),t=s.done,!t;a=!0)i=s.value,a=!1,yield yield Ci(i)}catch(e){n={error:e}}finally{try{!a&&!t&&(r=o.return)&&(yield Ci(r.call(o)))}finally{if(n)throw n.error}}})}function Oi(e,t){return new Promise((n,r)=>{if(e.errored)return a(e.errored);e.once(`error`,a),e.once(`drain`,o);let i=e.write(t,`binary`,t=>{t&&!i&&(a(t),e.once(`error`,()=>{}))});i&&o();function a(t){e.off(`error`,a),e.off(`drain`,o),r(t)}function o(){e.off(`error`,a),e.off(`drain`,o),n()}})}const ki=ye(ve.gzip),Ai=ye(ve.gunzip),ji=ye(ve.brotliCompress),Mi=ye(ve.brotliDecompress),Ni={name:`gzip`,compress(e){return Fi(ki(e,{}))},decompress(e,t){return e.length==0?Promise.resolve(new Uint8Array):Fi(Ii(Ai(e,{maxOutputLength:t}),t))}},Pi={name:`br`,compress(e){return Fi(ji(e,{}))},decompress(e,t){return e.length==0?Promise.resolve(new Uint8Array):Fi(Ii(Mi(e,{maxOutputLength:t}),t))}};function Fi(e){return e.then(e=>e.buffer instanceof ArrayBuffer?e:new Uint8Array(e))}function Ii(e,t){return e.catch(e=>{let n=bi(e),r=R.Internal,i=`decompression failed`;switch(n.code){case`ERR_BUFFER_TOO_LARGE`:r=R.ResourceExhausted,i=`message is larger than configured readMaxBytes ${t} after decompression`;break;case`Z_DATA_ERROR`:case`ERR_PADDING_2`:r=R.InvalidArgument;break;default:n.code?.startsWith(`ERR__ERROR_FORMAT_`)&&(r=R.InvalidArgument);break}return Promise.reject(new L(i,r,void 0,void 0,e))})}function Li(e){e.acceptCompression===void 0&&(e.acceptCompression=[Ni,Pi]);let t=pi(e);e.routes(t);let n=e.requestPathPrefix??``,r=new Map;for(let e of t.handlers)r.set(n+e.requestPath,e);return function(t,n){let i=r.get(t.url?.split(`?`,2)[0]??``);if(!i){(e.fallback??Ri)(t,n);return}i(Ti(t,n,void 0,e.contextValues?.call(e,t))).then(e=>Ei(e,n)).catch(e=>{L.from(e).code!=R.Aborted&&console.error(`handler for rpc ${i.method.name} of ${i.service.typeName} failed`,e)})}}const Ri=(e,t)=>{t.writeHead(mr.status),t.end()};var zi=r(se(),1),Bi=class{instance;constructor(e){this.instance=e}async start(e,t){return this.instance.start(e,t)}async getConfig(e,t){let n=await this.instance.getConfig(e,t);return n.executionConfig=m(k,ue.execution),n}async*processBindingsStream(e,t){yield*this.instance.processBindingsStream(e,t)}async updateTemplates(e,t){return this.instance.updateTemplates(e,t)}},Vi=t(((e,t)=>{var n=class e extends Error{constructor(t){super(`Format functions must be synchronous taking a two arguments: (info, opts)
4
4
  Found: ${t.toString().split(`
5
- `)[0]}\n`),Error.captureStackTrace(this,e)}};t.exports=e=>{if(e.length>2)throw new n(e);function t(e={}){this.options=e}t.prototype.transform=e;function r(e){return new t(e)}return r.Format=t,r}})),Vi=t(((e,t)=>{var n={};t.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(e){var t=r[e],i=n[e]=[];i.open=`\x1B[`+t[0]+`m`,i.close=`\x1B[`+t[1]+`m`})})),Hi=t(((e,t)=>{t.exports=function(e,t){t=t||process.argv||[];var n=t.indexOf(`--`),r=/^-{1,2}/.test(e)?``:`--`,i=t.indexOf(r+e);return i!==-1&&(n===-1?!0:i<n)}})),Ui=t(((e,t)=>{var n=s(`os`),r=Hi(),i=process.env,a=void 0;r(`no-color`)||r(`no-colors`)||r(`color=false`)?a=!1:(r(`color`)||r(`colors`)||r(`color=true`)||r(`color=always`))&&(a=!0),`FORCE_COLOR`in i&&(a=i.FORCE_COLOR.length===0||parseInt(i.FORCE_COLOR,10)!==0);function o(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e){if(a===!1)return 0;if(r(`color=16m`)||r(`color=full`)||r(`color=truecolor`))return 3;if(r(`color=256`))return 2;if(e&&!e.isTTY&&a!==!0)return 0;var t=+!!a;if(process.platform===`win32`){var o=n.release().split(`.`);return Number(process.versions.node.split(`.`)[0])>=8&&Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if(`CI`in i)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(function(e){return e in i})||i.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in i)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION);if(`TERM_PROGRAM`in i){var s=parseInt((i.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(i.TERM_PROGRAM){case`iTerm.app`:return s>=3?3:2;case`Hyper`:return 3;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||`COLORTERM`in i?1:(i.TERM,t)}function l(e){return o(c(e))}t.exports={supportsColor:l,stdout:l(process.stdout),stderr:l(process.stderr)}})),Wi=t(((e,t)=>{t.exports=function(e,t){var n=``;e||=`Run the trap, drop the bass`,e=e.split(``);var r={a:[`@`,`Ą`,`Ⱥ`,`Ʌ`,`Δ`,`Λ`,`Д`],b:[`ß`,`Ɓ`,`Ƀ`,`ɮ`,`β`,`฿`],c:[`©`,`Ȼ`,`Ͼ`],d:[`Ð`,`Ɗ`,`Ԁ`,`ԁ`,`Ԃ`,`ԃ`],e:[`Ë`,`ĕ`,`Ǝ`,`ɘ`,`Σ`,`ξ`,`Ҽ`,`੬`],f:[`Ӻ`],g:[`ɢ`],h:[`Ħ`,`ƕ`,`Ң`,`Һ`,`Ӈ`,`Ԋ`],i:[`༏`],j:[`Ĵ`],k:[`ĸ`,`Ҡ`,`Ӄ`,`Ԟ`],l:[`Ĺ`],m:[`ʍ`,`Ӎ`,`ӎ`,`Ԡ`,`ԡ`,`൩`],n:[`Ñ`,`ŋ`,`Ɲ`,`Ͷ`,`Π`,`Ҋ`],o:[`Ø`,`õ`,`ø`,`Ǿ`,`ʘ`,`Ѻ`,`ם`,`۝`,`๏`],p:[`Ƿ`,`Ҏ`],q:[`্`],r:[`®`,`Ʀ`,`Ȑ`,`Ɍ`,`ʀ`,`Я`],s:[`§`,`Ϟ`,`ϟ`,`Ϩ`],t:[`Ł`,`Ŧ`,`ͳ`],u:[`Ʊ`,`Ս`],v:[`ט`],w:[`Ш`,`Ѡ`,`Ѽ`,`൰`],x:[`Ҳ`,`Ӿ`,`Ӽ`,`ӽ`],y:[`¥`,`Ұ`,`Ӌ`],z:[`Ƶ`,`ɀ`]};return e.forEach(function(e){e=e.toLowerCase();var t=r[e]||[` `],i=Math.floor(Math.random()*t.length);r[e]===void 0?n+=e:n+=r[e][i]}),n}})),Gi=t(((e,t)=>{t.exports=function(e,t){e||=` he is here `;var n={up:`̍.̎.̄.̅.̿.̑.̆.̐.͒.͗.͑.̇.̈.̊.͂.̓.̈.͊.͋.͌.̃.̂.̌.͐.̀.́.̋.̏.̒.̓.̔.̽.̉.ͣ.ͤ.ͥ.ͦ.ͧ.ͨ.ͩ.ͪ.ͫ.ͬ.ͭ.ͮ.ͯ.̾.͛.͆.̚`.split(`.`),down:`̖.̗.̘.̙.̜.̝.̞.̟.̠.̤.̥.̦.̩.̪.̫.̬.̭.̮.̯.̰.̱.̲.̳.̹.̺.̻.̼.ͅ.͇.͈.͉.͍.͎.͓.͔.͕.͖.͙.͚.̣`.split(`.`),mid:[`̕`,`̛`,`̀`,`́`,`͘`,`̡`,`̢`,`̧`,`̨`,`̴`,`̵`,`̶`,`͜`,`͝`,`͞`,`͟`,`͠`,`͢`,`̸`,`̷`,`͡`,` ҉`]},r=[].concat(n.up,n.down,n.mid);function i(e){return Math.floor(Math.random()*e)}function a(e){var t=!1;return r.filter(function(n){t=n===e}),t}function o(e,t){var r=``,o,s;for(s in t||={},t.up=t.up===void 0?!0:t.up,t.mid=t.mid===void 0?!0:t.mid,t.down=t.down===void 0?!0:t.down,t.size=t.size===void 0?`maxi`:t.size,e=e.split(``),e)if(!a(s)){switch(r+=e[s],o={up:0,down:0,mid:0},t.size){case`mini`:o.up=i(8),o.mid=i(2),o.down=i(8);break;case`maxi`:o.up=i(16)+3,o.mid=i(4)+1,o.down=i(64)+3;break;default:o.up=i(8)+1,o.mid=i(6)/2,o.down=i(8)+1;break}var c=[`up`,`mid`,`down`];for(var l in c)for(var u=c[l],d=0;d<=o[u];d++)t[u]&&(r+=n[u][i(n[u].length)])}return r}return o(e,t)}})),Ki=t(((e,t)=>{t.exports=function(e){return function(t,n,r){if(t===` `)return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}})),qi=t(((e,t)=>{t.exports=function(e){return function(t,n,r){return n%2==0?t:e.inverse(t)}}})),Ji=t(((e,t)=>{t.exports=function(e){var t=[`red`,`yellow`,`green`,`blue`,`magenta`];return function(n,r,i){return n===` `?n:e[t[r++%t.length]](n)}}})),Yi=t(((e,t)=>{t.exports=function(e){var t=[`underline`,`inverse`,`grey`,`yellow`,`red`,`green`,`blue`,`white`,`cyan`,`magenta`,`brightYellow`,`brightRed`,`brightGreen`,`brightBlue`,`brightWhite`,`brightCyan`,`brightMagenta`];return function(n,r,i){return n===` `?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}})),Xi=t(((e,t)=>{var n={};t.exports=n,n.themes={};var r=s(`util`),i=n.styles=Vi(),a=Object.defineProperties,o=new RegExp(/[\r\n]+/g);n.supportsColor=Ui().supportsColor,n.enabled===void 0&&(n.enabled=n.supportsColor()!==!1),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(e){return(``+e).replace(/\x1B\[\d+m/g,``)},n.stylize=function(e,t){if(!n.enabled)return e+``;var r=i[t];return!r&&t in n?n[t](e):r.open+e+r.close};var c=/[|\\{}()[\]^$+*?.]/g,l=function(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(c,`\\$&`)};function u(e){var t=function e(){return p.apply(e,arguments)};return t._styles=e,t.__proto__=f,t}var d=(function(){var e={};return i.grey=i.gray,Object.keys(i).forEach(function(t){i[t].closeRe=new RegExp(l(i[t].close),`g`),e[t]={get:function(){return u(this._styles.concat(t))}}}),e})(),f=a(function(){},d);function p(){var e=Array.prototype.slice.call(arguments).map(function(e){return e!=null&&e.constructor===String?e:r.inspect(e)}).join(` `);if(!n.enabled||!e)return e;for(var t=e.indexOf(`
6
- `)!=-1,a=this._styles,s=a.length;s--;){var c=i[a[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,t&&(e=e.replace(o,function(e){return c.close+e+c.open}))}return e}n.setTheme=function(e){if(typeof e==`string`){console.log(`colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));`);return}for(var t in e)(function(t){n[t]=function(r){if(typeof e[t]==`object`){var i=r;for(var a in e[t])i=n[e[t][a]](i);return i}return n[e[t]](r)}})(t)};function m(){var e={};return Object.keys(d).forEach(function(t){e[t]={get:function(){return u([t])}}}),e}var h=function(e,t){var n=t.split(``);return n=n.map(e),n.join(``)};for(var g in n.trap=Wi(),n.zalgo=Gi(),n.maps={},n.maps.america=Ki()(n),n.maps.zebra=qi()(n),n.maps.rainbow=Ji()(n),n.maps.random=Yi()(n),n.maps)(function(e){n[e]=function(t){return h(n.maps[e],t)}})(g);a(n,m())})),Zi=t(((e,t)=>{t.exports=Xi()})),Qi=t((e=>{e.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9},e.colors={error:`red`,warn:`yellow`,help:`cyan`,data:`grey`,info:`green`,debug:`blue`,prompt:`grey`,verbose:`cyan`,input:`grey`,silly:`magenta`}})),$i=t((e=>{e.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6},e.colors={error:`red`,warn:`yellow`,info:`green`,http:`green`,verbose:`cyan`,debug:`blue`,silly:`magenta`}})),ea=t((e=>{e.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7},e.colors={emerg:`red`,alert:`yellow`,crit:`red`,error:`red`,warning:`red`,notice:`yellow`,info:`green`,debug:`blue`}})),ta=t((e=>{Object.defineProperty(e,"cli",{value:Qi()}),Object.defineProperty(e,"npm",{value:$i()}),Object.defineProperty(e,"syslog",{value:ea()})})),G=t((e=>{Object.defineProperty(e,"LEVEL",{value:Symbol.for(`level`)}),Object.defineProperty(e,"MESSAGE",{value:Symbol.for(`message`)}),Object.defineProperty(e,"SPLAT",{value:Symbol.for(`splat`)}),Object.defineProperty(e,"configs",{value:ta()})})),na=t(((e,t)=>{let n=Zi(),{LEVEL:r,MESSAGE:i}=G();n.enabled=!0;let a=/\s+/;var o=class e{constructor(e={}){e.colors&&this.addColors(e.colors),this.options=e}static addColors(t){let n=Object.keys(t).reduce((e,n)=>(e[n]=a.test(t[n])?t[n].split(a):t[n],e),{});return e.allColors=Object.assign({},e.allColors||{},n),e.allColors}addColors(t){return e.addColors(t)}colorize(t,r,i){if(i===void 0&&(i=r),!Array.isArray(e.allColors[t]))return n[e.allColors[t]](i);for(let r=0,a=e.allColors[t].length;r<a;r++)i=n[e.allColors[t][r]](i);return i}transform(e,t){return t.all&&typeof e[i]==`string`&&(e[i]=this.colorize(e[r],e.level,e[i])),(t.level||t.all||!t.message)&&(e.level=this.colorize(e[r],e.level)),(t.all||t.message)&&(e.message=this.colorize(e[r],e.level,e.message)),e}};t.exports=e=>new o(e),t.exports.Colorizer=t.exports.Format=o})),ra=t(((e,t)=>{let{Colorizer:n}=na();t.exports=e=>(n.addColors(e.colors||e),e)})),ia=t(((e,t)=>{t.exports=Bi()(e=>(e.message=`\t${e.message}`,e))})),aa=t(((e,t)=>{let n=Bi(),{LEVEL:r,MESSAGE:i}=G();t.exports=n((e,{stack:t,cause:n})=>{if(e instanceof Error){let a=Object.assign({},e,{level:e.level,[r]:e[r]||e.level,message:e.message,[i]:e[i]||e.message});return t&&(a.stack=e.stack),n&&(a.cause=e.cause),a}if(!(e.message instanceof Error))return e;let a=e.message;return Object.assign(e,a),e.message=a.message,e[i]=a.message,t&&(e.stack=a.stack),n&&(e.cause=a.cause),e})})),oa=t(((e,t)=>{let{configs:n,LEVEL:r,MESSAGE:i}=G();var a=class e{constructor(t={levels:n.npm.levels}){this.paddings=e.paddingForLevels(t.levels,t.filler),this.options=t}static getLongestLevel(e){let t=Object.keys(e).map(e=>e.length);return Math.max(...t)}static paddingForLevel(e,t,n){let r=n+1-e.length,i=Math.floor(r/t.length);return`${t}${t.repeat(i)}`.slice(0,r)}static paddingForLevels(t,n=` `){let r=e.getLongestLevel(t);return Object.keys(t).reduce((t,i)=>(t[i]=e.paddingForLevel(i,n,r),t),{})}transform(e,t){return e.message=`${this.paddings[e[r]]}${e.message}`,e[i]&&(e[i]=`${this.paddings[e[r]]}${e[i]}`),e}};t.exports=e=>new a(e),t.exports.Padder=t.exports.Format=a})),sa=t(((e,t)=>{let{Colorizer:n}=na(),{Padder:r}=oa(),{configs:i,MESSAGE:a}=G();var o=class{constructor(e={}){e.levels||=i.cli.levels,this.colorizer=new n(e),this.padder=new r(e),this.options=e}transform(e,t){return this.colorizer.transform(this.padder.transform(e,t),t),e[a]=`${e.level}:${e.message}`,e}};t.exports=e=>new o(e),t.exports.Format=o})),ca=t(((e,t)=>{let n=Bi();function r(e){if(e.every(i))return t=>{let n=t;for(let t=0;t<e.length;t++)if(n=e[t].transform(n,e[t].options),!n)return!1;return n}}function i(e){if(typeof e.transform!=`function`)throw Error([`No transform function found on format. Did you create a format instance?`,`const myFormat = format(formatFn);`,`const instance = myFormat();`].join(`
7
- `));return!0}t.exports=(...e)=>{let t=n(r(e)),i=t();return i.Format=t.Format,i},t.exports.cascade=r})),la=t(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=g();r.configure=g,r.stringify=r,r.default=r,e.stringify=r,e.configure=g,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e){if(e.length>200)return e.sort();for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function f(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function p(e){return e===1?`1 item`:`${e} items`}function m(e){let t=new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function h(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function g(e){e={...e};let t=h(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=d(e,`bigint`),i=d(e,`deterministic`),s=f(e,`maximumDepth`),g=f(e,`maximumBreadth`);function _(e,l,u,d,f,m){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=m;if(Array.isArray(h)){if(h.length===0)return`[]`;if(s<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(m+=f,e+=`\n${m}`,t=`,\n${m}`);let n=Math.min(h.length,g),i=0;for(;i<n-1;i++){let n=_(String(i),h,u,d,f,m);e+=n===void 0?`null`:n,e+=t}let a=_(String(i),h,u,d,f,m);if(e+=a===void 0?`null`:a,h.length-1>g){let n=h.length-g-1;e+=`${t}"... ${p(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),v=l.length;if(v===0)return`{}`;if(s<u.length+1)return`"[Object]"`;let y=``,b=``;f!==``&&(m+=f,t=`,\n${m}`,y=` `);let x=Math.min(v,g);i&&!c(h)&&(l=o(l)),u.push(h);for(let n=0;n<x;n++){let r=l[n],i=_(r,h,u,d,f,m);i!==void 0&&(e+=`${b}${a(r)}:${y}${i}`,b=t)}if(v>g){let n=v-g;e+=`${b}"...":${y}"${p(n)} not stringified"`,b=t}return f!==``&&b.length>1&&(e=`\n${m}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function v(e,i,o,c,l,u){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=u,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(s<o.length+1)return`"[Array]"`;o.push(i),l!==``&&(u+=l,t+=`\n${u}`,r=`,\n${u}`);let n=Math.min(i.length,g),a=0;for(;a<n-1;a++){let e=v(String(a),i[a],o,c,l,u);t+=e===void 0?`null`:e,t+=r}let d=v(String(a),i[a],o,c,l,u);if(t+=d===void 0?`null`:d,i.length-1>g){let e=i.length-g-1;t+=`${r}"... ${p(e)} not stringified"`}return l!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let d=``;l!==``&&(u+=l,r=`,\n${u}`,d=` `);let f=``;for(let e of c){let n=v(e,i[e],o,c,l,u);n!==void 0&&(t+=`${f}${a(e)}:${d}${n}`,f=r)}return l!==``&&f.length>1&&(t=`\n${u}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function y(e,u,d,f,m){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return y(e,u,d,f,m);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=m;if(Array.isArray(u)){if(u.length===0)return`[]`;if(s<d.length+1)return`"[Array]"`;d.push(u),m+=f;let e=`\n${m}`,n=`,\n${m}`,r=Math.min(u.length,g),i=0;for(;i<r-1;i++){let t=y(String(i),u[i],d,f,m);e+=t===void 0?`null`:t,e+=n}let a=y(String(i),u[i],d,f,m);if(e+=a===void 0?`null`:a,u.length-1>g){let t=u.length-g-1;e+=`${n}"... ${p(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(s<d.length+1)return`"[Object]"`;m+=f;let _=`,\n${m}`,v=``,b=``,x=Math.min(h,g);c(u)&&(v+=l(u,_,g),r=r.slice(u.length),x-=u.length,b=_),i&&(r=o(r)),d.push(u);for(let e=0;e<x;e++){let t=r[e],n=y(t,u[t],d,f,m);n!==void 0&&(v+=`${b}${a(t)}: ${n}`,b=_)}if(h>g){let e=h-g;v+=`${b}"...": "${p(e)} not stringified"`,b=_}return b!==``&&(v=`\n${m}${v}\n${t}`),d.pop(),`{${v}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function b(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return b(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``;if(Array.isArray(u)){if(u.length===0)return`[]`;if(s<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,g),n=0;for(;n<e-1;n++){let e=b(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=b(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>g){let e=u.length-g-1;t+=`,"... ${p(e)} not stringified"`}return d.pop(),`[${t}]`}let r=Object.keys(u),f=r.length;if(f===0)return`{}`;if(s<d.length+1)return`"[Object]"`;let m=``,h=Math.min(f,g);c(u)&&(t+=l(u,`,`,g),r=r.slice(u.length),h-=u.length,m=`,`),i&&(r=o(r)),d.push(u);for(let e=0;e<h;e++){let n=r[e],i=b(n,u[n],d);i!==void 0&&(t+=`${m}${a(n)}:${i}`,m=`,`)}if(f>g){let e=f-g;t+=`${m}"...":"${p(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function x(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return _(``,{"":e},[],t,r,``);if(Array.isArray(t))return v(``,e,[],m(t),r,``)}if(r.length!==0)return y(``,e,[],r,``)}return b(``,e,[])}return x}})),ua=t(((e,t)=>{let n=Bi(),{MESSAGE:r}=G(),i=la();function a(e,t){return typeof t==`bigint`?t.toString():t}t.exports=n((e,t)=>(e[r]=i.configure(t)(e,t.replacer||a,t.space),e))})),da=t(((e,t)=>{t.exports=Bi()((e,t)=>t.message?(e.message=`[${t.label}] ${e.message}`,e):(e.label=t.label,e))})),fa=t(((e,t)=>{let n=Bi(),{MESSAGE:r}=G(),i=la();t.exports=n(e=>{let t={};return e.message&&(t[`@message`]=e.message,delete e.message),e.timestamp&&(t[`@timestamp`]=e.timestamp,delete e.timestamp),t[`@fields`]=e,e[r]=i(t),e})})),pa=t(((e,t)=>{let n=Bi();function r(e,t,n){let r=t.reduce((t,n)=>(t[n]=e[n],delete e[n],t),{}),i=Object.keys(e).reduce((t,n)=>(t[n]=e[n],delete e[n],t),{});return Object.assign(e,r,{[n]:i}),e}function i(e,t,n){return e[n]=t.reduce((t,n)=>(t[n]=e[n],delete e[n],t),{}),e}t.exports=n((e,t={})=>{let n=`metadata`;t.key&&(n=t.key);let a=[];return!t.fillExcept&&!t.fillWith&&(a.push(`level`),a.push(`message`)),t.fillExcept&&(a=t.fillExcept),a.length>0?r(e,a,n):t.fillWith?i(e,t.fillWith,n):e})})),ma=t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),ha=t(((e,t)=>{let n=Bi(),r=ma();t.exports=n(t=>{let n=+new Date;return e.diff=n-(e.prevTime||n),e.prevTime=n,t.ms=`+${r(e.diff)}`,t})})),ga=t(((e,t)=>{let n=s(`util`).inspect,r=Bi(),{LEVEL:i,MESSAGE:a,SPLAT:o}=G();t.exports=r((e,t={})=>{let r=Object.assign({},e);return delete r[i],delete r[a],delete r[o],e[a]=n(r,!1,t.depth||null,t.colorize),e})})),_a=t(((e,t)=>{let{MESSAGE:n}=G();var r=class{constructor(e){this.template=e}transform(e){return e[n]=this.template(e),e}};t.exports=e=>new r(e),t.exports.Printf=t.exports.Format=r})),va=t(((e,t)=>{let n=Bi(),{MESSAGE:r}=G(),i=la();t.exports=n(e=>{let t=i(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),n=e.padding&&e.padding[e.level]||``;return t===`{}`?e[r]=`${e.level}:${n} ${e.message}`:e[r]=`${e.level}:${n} ${e.message} ${t}`,e})})),ya=t(((e,t)=>{let n=s(`util`),{SPLAT:r}=G(),i=/%[scdjifoO%]/g,a=/%%/g;var o=class{constructor(e){this.options=e}_splat(e,t){let i=e.message,o=e[r]||e.splat||[],s=i.match(a),c=s&&s.length||0,l=t.length-c-o.length,u=l<0?o.splice(l,-1*l):[],d=u.length;if(d)for(let t=0;t<d;t++)Object.assign(e,u[t]);return e.message=n.format(i,...o),e}transform(e){let t=e.message,n=e[r]||e.splat;if(!n||!n.length)return e;let a=t&&t.match&&t.match(i);if(!a&&(n||n.length)){let t=n.length>1?n.splice(0):n,r=t.length;if(r)for(let n=0;n<r;n++)Object.assign(e,t[n]);return e}return a?this._splat(e,a):e}};t.exports=e=>new o(e)})),ba=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r(n.fecha={})})(e,(function(e){var t=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,n=`\\d\\d?`,r=`\\d\\d`,i=`\\d{3}`,a=`\\d{4}`,o=`[^\\s]+`,s=/\[([^]*?)\]/gm;function c(e,t){for(var n=[],r=0,i=e.length;r<i;r++)n.push(e[r].substr(0,t));return n}var l=function(e){return function(t,n){var r=n[e].map(function(e){return e.toLowerCase()}).indexOf(t.toLowerCase());return r>-1?r:null}};function u(e){for(var t=[...arguments].slice(1),n=0,r=t;n<r.length;n++){var i=r[n];for(var a in i)e[a]=i[a]}return e}var d=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],f=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],p=c(f,3),m={dayNamesShort:c(d,3),dayNames:d,monthNamesShort:p,monthNames:f,amPm:[`am`,`pm`],DoFn:function(e){return e+[`th`,`st`,`nd`,`rd`][e%10>3?0:(e-e%10==10?0:1)*e%10]}},h=u({},m),g=function(e){return h=u(h,e)},_=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,`\\$&`)},v=function(e,t){for(t===void 0&&(t=2),e=String(e);e.length<t;)e=`0`+e;return e},y={D:function(e){return String(e.getDate())},DD:function(e){return v(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return v(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return v(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return v(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return v(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return v(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return v(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return v(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return v(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return v(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return v(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?`-`:`+`)+v(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?`-`:`+`)+v(Math.floor(Math.abs(t)/60),2)+`:`+v(Math.abs(t)%60,2)}},b=function(e){return e-1},x=[null,n],S=[null,o],C=[`isPm`,o,function(e,t){var n=e.toLowerCase();return n===t.amPm[0]?0:n===t.amPm[1]?1:null}],w=[`timezoneOffset`,`[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?`,function(e){var t=(e+``).match(/([+-]|\d\d)/gi);if(t){var n=t[1]*60+parseInt(t[2],10);return t[0]===`+`?n:-n}return 0}],T={D:[`day`,n],DD:[`day`,r],Do:[`day`,n+o,function(e){return parseInt(e,10)}],M:[`month`,n,b],MM:[`month`,r,b],YY:[`year`,r,function(e){var t=+(``+new Date().getFullYear()).substr(0,2);return+(``+(+e>68?t-1:t)+e)}],h:[`hour`,n,void 0,`isPm`],hh:[`hour`,r,void 0,`isPm`],H:[`hour`,n],HH:[`hour`,r],m:[`minute`,n],mm:[`minute`,r],s:[`second`,n],ss:[`second`,r],YYYY:[`year`,a],S:[`millisecond`,`\\d`,function(e){return e*100}],SS:[`millisecond`,r,function(e){return e*10}],SSS:[`millisecond`,i],d:x,dd:x,ddd:S,dddd:S,MMM:[`month`,o,l(`monthNamesShort`)],MMMM:[`month`,o,l(`monthNames`)],a:C,A:C,ZZ:w,Z:w},E={default:`ddd MMM DD YYYY HH:mm:ss`,shortDate:`M/D/YY`,mediumDate:`MMM D, YYYY`,longDate:`MMMM D, YYYY`,fullDate:`dddd, MMMM D, YYYY`,isoDate:`YYYY-MM-DD`,isoDateTime:`YYYY-MM-DDTHH:mm:ssZ`,shortTime:`HH:mm`,mediumTime:`HH:mm:ss`,longTime:`HH:mm:ss.SSS`},D=function(e){return u(E,e)},O=function(e,n,r){if(n===void 0&&(n=E.default),r===void 0&&(r={}),typeof e==`number`&&(e=new Date(e)),Object.prototype.toString.call(e)!==`[object Date]`||isNaN(e.getTime()))throw Error(`Invalid Date pass to format`);n=E[n]||n;var i=[];n=n.replace(s,function(e,t){return i.push(t),`@@@`});var a=u(u({},h),r);return n=n.replace(t,function(t){return y[t](e,a)}),n.replace(/@@@/g,function(){return i.shift()})};function k(e,n,r){if(r===void 0&&(r={}),typeof n!=`string`)throw Error(`Invalid format in fecha parse`);if(n=E[n]||n,e.length>1e3)return null;var i={year:new Date().getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],c=n.replace(s,function(e,t){return o.push(_(t)),`@@@`}),l={},d={};c=_(c).replace(t,function(e){var t=T[e],n=t[0],r=t[1],i=t[3];if(l[n])throw Error(`Invalid format. `+n+` specified twice in format`);return l[n]=!0,i&&(d[i]=!0),a.push(t),`(`+r+`)`}),Object.keys(d).forEach(function(e){if(!l[e])throw Error(`Invalid format. `+e+` is required in specified format`)}),c=c.replace(/@@@/g,function(){return o.shift()});var f=e.match(new RegExp(c,`i`));if(!f)return null;for(var p=u(u({},h),r),m=1;m<f.length;m++){var g=a[m-1],v=g[0],y=g[2],b=y?y(f[m],p):+f[m];if(b==null)return null;i[v]=b}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var x;if(i.timezoneOffset==null){x=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var S=[[`month`,`getMonth`],[`day`,`getDate`],[`hour`,`getHours`],[`minute`,`getMinutes`],[`second`,`getSeconds`]],m=0,C=S.length;m<C;m++)if(l[S[m][0]]&&i[S[m][0]]!==x[S[m][1]]())return null}else if(x=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return x}var A={format:O,parse:k,defaultI18n:m,setGlobalDateI18n:g,setGlobalDateMasks:D};e.assign=u,e.default=A,e.format=O,e.parse=k,e.defaultI18n=m,e.setGlobalDateI18n=g,e.setGlobalDateMasks=D,Object.defineProperty(e,"__esModule",{value:!0})}))})),xa=t(((e,t)=>{let n=ba();t.exports=Bi()((e,t={})=>(t.format&&(e.timestamp=typeof t.format==`function`?t.format():n.format(new Date,t.format)),e.timestamp||=new Date().toISOString(),t.alias&&(e[t.alias]=e.timestamp),e))})),Sa=t(((e,t)=>{let n=Zi(),r=Bi(),{MESSAGE:i}=G();t.exports=r((e,t)=>(t.level!==!1&&(e.level=n.strip(e.level)),t.message!==!1&&(e.message=n.strip(String(e.message))),t.raw!==!1&&e[i]&&(e[i]=n.strip(String(e[i]))),e))})),Ca=t((e=>{let t=e.format=Bi();e.levels=ra();function n(e,n){Object.defineProperty(t,e,{get(){return n()},configurable:!0})}n(`align`,function(){return ia()}),n(`errors`,function(){return aa()}),n(`cli`,function(){return sa()}),n(`combine`,function(){return ca()}),n(`colorize`,function(){return na()}),n(`json`,function(){return ua()}),n(`label`,function(){return da()}),n(`logstash`,function(){return fa()}),n(`metadata`,function(){return pa()}),n(`ms`,function(){return ha()}),n(`padLevels`,function(){return oa()}),n(`prettyPrint`,function(){return ga()}),n(`printf`,function(){return _a()}),n(`simple`,function(){return va()}),n(`splat`,function(){return ya()}),n(`timestamp`,function(){return xa()}),n(`uncolorize`,function(){return Sa()})})),wa=t((e=>{let{format:t}=s(`util`);e.warn={deprecated(e){return()=>{throw Error(t(`{ %s } was removed in winston@3.0.0.`,e))}},useFormat(e){return()=>{throw Error([t(`{ %s } was removed in winston@3.0.0.`,e),`Use a custom winston.format = winston.format(function) instead.`].join(`
8
- `))}},forFunctions(t,n,r){r.forEach(r=>{t[r]=e.warn[n](r)})},forProperties(t,n,r){r.forEach(r=>{let i=e.warn[n](r);Object.defineProperty(t,r,{get:i,set:i})})}}})),Ta=t(((e,t)=>{t.exports={name:`winston`,description:`A logger for just about everything.`,version:`3.19.0`,author:`Charlie Robbins <charlie.robbins@gmail.com>`,maintainers:[`David Hyde <dabh@alumni.stanford.edu>`],repository:{type:`git`,url:`https://github.com/winstonjs/winston.git`},keywords:[`winston`,`logger`,`logging`,`logs`,`sysadmin`,`bunyan`,`pino`,`loglevel`,`tools`,`json`,`stream`],dependencies:{"@dabh/diagnostics":`^2.0.8`,"@colors/colors":`^1.6.0`,async:`^3.2.3`,"is-stream":`^2.0.0`,logform:`^2.7.0`,"one-time":`^1.0.0`,"readable-stream":`^3.4.0`,"safe-stable-stringify":`^2.3.1`,"stack-trace":`0.0.x`,"triple-beam":`^1.3.0`,"winston-transport":`^4.9.0`},devDependencies:{"@babel/cli":`^7.23.9`,"@babel/core":`^7.24.0`,"@babel/preset-env":`^7.24.0`,"@dabh/eslint-config-populist":`^4.4.0`,"@types/node":`^20.11.24`,"abstract-winston-transport":`^0.5.1`,assume:`^2.2.0`,"cross-spawn-async":`^2.2.5`,eslint:`^8.57.0`,hock:`^1.4.1`,jest:`^29.7.0`,rimraf:`5.0.10`,split2:`^4.1.0`,"std-mocks":`^2.0.0`,through2:`^4.0.2`,"winston-compat":`^0.1.5`},main:`./lib/winston.js`,browser:`./dist/winston`,types:`./index.d.ts`,scripts:{lint:`eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist`,test:`jest`,"test:unit":`jest -c test/jest.config.unit.js`,"test:integration":`jest -c test/jest.config.integration.js`,"test:typescript":`npx --package typescript tsc --project test`,build:`babel lib -d dist`,prebuild:`rimraf dist`,prepublishOnly:`npm run build`},engines:{node:`>= 12.0.0`},license:`MIT`}})),Ea=t(((e,t)=>{t.exports=s(`util`).deprecate})),Da=t(((e,t)=>{t.exports=s(`stream`)})),Oa=t(((e,t)=>{function n(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(o,this,e)):process.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?n._writableState?n._writableState.errorEmitted?process.nextTick(i,n):(n._writableState.errorEmitted=!0,process.nextTick(r,n,e)):process.nextTick(r,n,e):t?(process.nextTick(i,n),t(e)):process.nextTick(i,n)}),this)}function r(e,t){o(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(`close`)}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit(`error`,t)}function s(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(`error`,t)}t.exports={destroy:n,undestroy:a,errorOrDestroy:s}})),ka=t(((e,t)=>{let n={};function r(e,t,r){r||=Error;function i(e,n,r){return typeof t==`string`?t:t(e,n,r)}class a extends r{constructor(e,t,n){super(i(e,t,n))}}a.prototype.name=r.name,a.prototype.code=e,n[e]=a}function i(e,t){if(Array.isArray(e)){let n=e.length;return e=e.map(e=>String(e)),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function a(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function o(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function s(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}r(`ERR_INVALID_OPT_VALUE`,function(e,t){return`The value "`+t+`" is invalid for option "`+e+`"`},TypeError),r(`ERR_INVALID_ARG_TYPE`,function(e,t,n){let r;typeof t==`string`&&a(t,`not `)?(r=`must not be`,t=t.replace(/^not /,``)):r=`must be`;let c;return c=o(e,` argument`)?`The ${e} ${r} ${i(t,`type`)}`:`The "${e}" ${s(e,`.`)?`property`:`argument`} ${r} ${i(t,`type`)}`,c+=`. Received type ${typeof n}`,c},TypeError),r(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`),r(`ERR_METHOD_NOT_IMPLEMENTED`,function(e){return`The `+e+` method is not implemented`}),r(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`),r(`ERR_STREAM_DESTROYED`,function(e){return`Cannot call `+e+` after a stream was destroyed`}),r(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`),r(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`),r(`ERR_STREAM_WRITE_AFTER_END`,`write after end`),r(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),r(`ERR_UNKNOWN_ENCODING`,function(e){return`Unknown encoding: `+e},TypeError),r(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`),t.exports.codes=n})),Aa=t(((e,t)=>{var n=ka().codes.ERR_INVALID_OPT_VALUE;function r(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function i(e,t,i,a){var o=r(t,a,i);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(a?i:`highWaterMark`,o);return Math.floor(o)}return e.objectMode?16:16*1024}t.exports={getHighWaterMark:i}})),ja=t(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),Ma=t(((e,t)=>{try{var n=s(`util`);if(typeof n.inherits!=`function`)throw``;t.exports=n.inherits}catch{t.exports=ja()}})),Na=t(((e,t)=>{function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t=l(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function c(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=u(e,`string`);return typeof t==`symbol`?t:String(t)}function u(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var d=s(`buffer`).Buffer,f=s(`util`).inspect,p=f&&f.custom||`inspect`;function m(e,t,n){d.prototype.copy.call(e,t,n)}t.exports=function(){function e(){a(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:`push`,value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:`unshift`,value:function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}},{key:`shift`,value:function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:`clear`,value:function(){this.head=this.tail=null,this.length=0}},{key:`join`,value:function(e){if(this.length===0)return``;for(var t=this.head,n=``+t.data;t=t.next;)n+=e+t.data;return n}},{key:`concat`,value:function(e){if(this.length===0)return d.alloc(0);for(var t=d.allocUnsafe(e>>>0),n=this.head,r=0;n;)m(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:`consume`,value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:`first`,value:function(){return this.head.data}},{key:`_getString`,value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),e-=a,e===0){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:`_getBuffer`,value:function(e){var t=d.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),e-=a,e===0){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:p,value:function(e,t){return f(this,r(r({},t),{},{depth:0,customInspect:!1}))}}]),e}()})),Pa=t(((e,t)=>{
5
+ `)[0]}\n`),Error.captureStackTrace(this,e)}};t.exports=e=>{if(e.length>2)throw new n(e);function t(e={}){this.options=e}t.prototype.transform=e;function r(e){return new t(e)}return r.Format=t,r}})),Hi=t(((e,t)=>{var n={};t.exports=n;var r={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(r).forEach(function(e){var t=r[e],i=n[e]=[];i.open=`\x1B[`+t[0]+`m`,i.close=`\x1B[`+t[1]+`m`})})),Ui=t(((e,t)=>{t.exports=function(e,t){t=t||process.argv||[];var n=t.indexOf(`--`),r=/^-{1,2}/.test(e)?``:`--`,i=t.indexOf(r+e);return i!==-1&&(n===-1?!0:i<n)}})),Wi=t(((e,t)=>{var n=s(`os`),r=Ui(),i=process.env,a=void 0;r(`no-color`)||r(`no-colors`)||r(`color=false`)?a=!1:(r(`color`)||r(`colors`)||r(`color=true`)||r(`color=always`))&&(a=!0),`FORCE_COLOR`in i&&(a=i.FORCE_COLOR.length===0||parseInt(i.FORCE_COLOR,10)!==0);function o(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e){if(a===!1)return 0;if(r(`color=16m`)||r(`color=full`)||r(`color=truecolor`))return 3;if(r(`color=256`))return 2;if(e&&!e.isTTY&&a!==!0)return 0;var t=+!!a;if(process.platform===`win32`){var o=n.release().split(`.`);return Number(process.versions.node.split(`.`)[0])>=8&&Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if(`CI`in i)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(function(e){return e in i})||i.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in i)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION);if(`TERM_PROGRAM`in i){var s=parseInt((i.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(i.TERM_PROGRAM){case`iTerm.app`:return s>=3?3:2;case`Hyper`:return 3;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||`COLORTERM`in i?1:(i.TERM,t)}function l(e){return o(c(e))}t.exports={supportsColor:l,stdout:l(process.stdout),stderr:l(process.stderr)}})),Gi=t(((e,t)=>{t.exports=function(e,t){var n=``;e||=`Run the trap, drop the bass`,e=e.split(``);var r={a:[`@`,`Ą`,`Ⱥ`,`Ʌ`,`Δ`,`Λ`,`Д`],b:[`ß`,`Ɓ`,`Ƀ`,`ɮ`,`β`,`฿`],c:[`©`,`Ȼ`,`Ͼ`],d:[`Ð`,`Ɗ`,`Ԁ`,`ԁ`,`Ԃ`,`ԃ`],e:[`Ë`,`ĕ`,`Ǝ`,`ɘ`,`Σ`,`ξ`,`Ҽ`,`੬`],f:[`Ӻ`],g:[`ɢ`],h:[`Ħ`,`ƕ`,`Ң`,`Һ`,`Ӈ`,`Ԋ`],i:[`༏`],j:[`Ĵ`],k:[`ĸ`,`Ҡ`,`Ӄ`,`Ԟ`],l:[`Ĺ`],m:[`ʍ`,`Ӎ`,`ӎ`,`Ԡ`,`ԡ`,`൩`],n:[`Ñ`,`ŋ`,`Ɲ`,`Ͷ`,`Π`,`Ҋ`],o:[`Ø`,`õ`,`ø`,`Ǿ`,`ʘ`,`Ѻ`,`ם`,`۝`,`๏`],p:[`Ƿ`,`Ҏ`],q:[`্`],r:[`®`,`Ʀ`,`Ȑ`,`Ɍ`,`ʀ`,`Я`],s:[`§`,`Ϟ`,`ϟ`,`Ϩ`],t:[`Ł`,`Ŧ`,`ͳ`],u:[`Ʊ`,`Ս`],v:[`ט`],w:[`Ш`,`Ѡ`,`Ѽ`,`൰`],x:[`Ҳ`,`Ӿ`,`Ӽ`,`ӽ`],y:[`¥`,`Ұ`,`Ӌ`],z:[`Ƶ`,`ɀ`]};return e.forEach(function(e){e=e.toLowerCase();var t=r[e]||[` `],i=Math.floor(Math.random()*t.length);r[e]===void 0?n+=e:n+=r[e][i]}),n}})),Ki=t(((e,t)=>{t.exports=function(e,t){e||=` he is here `;var n={up:`̍.̎.̄.̅.̿.̑.̆.̐.͒.͗.͑.̇.̈.̊.͂.̓.̈.͊.͋.͌.̃.̂.̌.͐.̀.́.̋.̏.̒.̓.̔.̽.̉.ͣ.ͤ.ͥ.ͦ.ͧ.ͨ.ͩ.ͪ.ͫ.ͬ.ͭ.ͮ.ͯ.̾.͛.͆.̚`.split(`.`),down:`̖.̗.̘.̙.̜.̝.̞.̟.̠.̤.̥.̦.̩.̪.̫.̬.̭.̮.̯.̰.̱.̲.̳.̹.̺.̻.̼.ͅ.͇.͈.͉.͍.͎.͓.͔.͕.͖.͙.͚.̣`.split(`.`),mid:[`̕`,`̛`,`̀`,`́`,`͘`,`̡`,`̢`,`̧`,`̨`,`̴`,`̵`,`̶`,`͜`,`͝`,`͞`,`͟`,`͠`,`͢`,`̸`,`̷`,`͡`,` ҉`]},r=[].concat(n.up,n.down,n.mid);function i(e){return Math.floor(Math.random()*e)}function a(e){var t=!1;return r.filter(function(n){t=n===e}),t}function o(e,t){var r=``,o,s;for(s in t||={},t.up=t.up===void 0?!0:t.up,t.mid=t.mid===void 0?!0:t.mid,t.down=t.down===void 0?!0:t.down,t.size=t.size===void 0?`maxi`:t.size,e=e.split(``),e)if(!a(s)){switch(r+=e[s],o={up:0,down:0,mid:0},t.size){case`mini`:o.up=i(8),o.mid=i(2),o.down=i(8);break;case`maxi`:o.up=i(16)+3,o.mid=i(4)+1,o.down=i(64)+3;break;default:o.up=i(8)+1,o.mid=i(6)/2,o.down=i(8)+1;break}var c=[`up`,`mid`,`down`];for(var l in c)for(var u=c[l],d=0;d<=o[u];d++)t[u]&&(r+=n[u][i(n[u].length)])}return r}return o(e,t)}})),qi=t(((e,t)=>{t.exports=function(e){return function(t,n,r){if(t===` `)return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}})),Ji=t(((e,t)=>{t.exports=function(e){return function(t,n,r){return n%2==0?t:e.inverse(t)}}})),Yi=t(((e,t)=>{t.exports=function(e){var t=[`red`,`yellow`,`green`,`blue`,`magenta`];return function(n,r,i){return n===` `?n:e[t[r++%t.length]](n)}}})),Xi=t(((e,t)=>{t.exports=function(e){var t=[`underline`,`inverse`,`grey`,`yellow`,`red`,`green`,`blue`,`white`,`cyan`,`magenta`,`brightYellow`,`brightRed`,`brightGreen`,`brightBlue`,`brightWhite`,`brightCyan`,`brightMagenta`];return function(n,r,i){return n===` `?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}})),Zi=t(((e,t)=>{var n={};t.exports=n,n.themes={};var r=s(`util`),i=n.styles=Hi(),a=Object.defineProperties,o=new RegExp(/[\r\n]+/g);n.supportsColor=Wi().supportsColor,n.enabled===void 0&&(n.enabled=n.supportsColor()!==!1),n.enable=function(){n.enabled=!0},n.disable=function(){n.enabled=!1},n.stripColors=n.strip=function(e){return(``+e).replace(/\x1B\[\d+m/g,``)},n.stylize=function(e,t){if(!n.enabled)return e+``;var r=i[t];return!r&&t in n?n[t](e):r.open+e+r.close};var c=/[|\\{}()[\]^$+*?.]/g,l=function(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(c,`\\$&`)};function u(e){var t=function e(){return p.apply(e,arguments)};return t._styles=e,t.__proto__=f,t}var d=(function(){var e={};return i.grey=i.gray,Object.keys(i).forEach(function(t){i[t].closeRe=new RegExp(l(i[t].close),`g`),e[t]={get:function(){return u(this._styles.concat(t))}}}),e})(),f=a(function(){},d);function p(){var e=Array.prototype.slice.call(arguments).map(function(e){return e!=null&&e.constructor===String?e:r.inspect(e)}).join(` `);if(!n.enabled||!e)return e;for(var t=e.indexOf(`
6
+ `)!=-1,a=this._styles,s=a.length;s--;){var c=i[a[s]];e=c.open+e.replace(c.closeRe,c.open)+c.close,t&&(e=e.replace(o,function(e){return c.close+e+c.open}))}return e}n.setTheme=function(e){if(typeof e==`string`){console.log(`colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));`);return}for(var t in e)(function(t){n[t]=function(r){if(typeof e[t]==`object`){var i=r;for(var a in e[t])i=n[e[t][a]](i);return i}return n[e[t]](r)}})(t)};function m(){var e={};return Object.keys(d).forEach(function(t){e[t]={get:function(){return u([t])}}}),e}var h=function(e,t){var n=t.split(``);return n=n.map(e),n.join(``)};for(var g in n.trap=Gi(),n.zalgo=Ki(),n.maps={},n.maps.america=qi()(n),n.maps.zebra=Ji()(n),n.maps.rainbow=Yi()(n),n.maps.random=Xi()(n),n.maps)(function(e){n[e]=function(t){return h(n.maps[e],t)}})(g);a(n,m())})),Qi=t(((e,t)=>{t.exports=Zi()})),$i=t((e=>{e.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9},e.colors={error:`red`,warn:`yellow`,help:`cyan`,data:`grey`,info:`green`,debug:`blue`,prompt:`grey`,verbose:`cyan`,input:`grey`,silly:`magenta`}})),ea=t((e=>{e.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6},e.colors={error:`red`,warn:`yellow`,info:`green`,http:`green`,verbose:`cyan`,debug:`blue`,silly:`magenta`}})),ta=t((e=>{e.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7},e.colors={emerg:`red`,alert:`yellow`,crit:`red`,error:`red`,warning:`red`,notice:`yellow`,info:`green`,debug:`blue`}})),na=t((e=>{Object.defineProperty(e,"cli",{value:$i()}),Object.defineProperty(e,"npm",{value:ea()}),Object.defineProperty(e,"syslog",{value:ta()})})),G=t((e=>{Object.defineProperty(e,"LEVEL",{value:Symbol.for(`level`)}),Object.defineProperty(e,"MESSAGE",{value:Symbol.for(`message`)}),Object.defineProperty(e,"SPLAT",{value:Symbol.for(`splat`)}),Object.defineProperty(e,"configs",{value:na()})})),ra=t(((e,t)=>{let n=Qi(),{LEVEL:r,MESSAGE:i}=G();n.enabled=!0;let a=/\s+/;var o=class e{constructor(e={}){e.colors&&this.addColors(e.colors),this.options=e}static addColors(t){let n=Object.keys(t).reduce((e,n)=>(e[n]=a.test(t[n])?t[n].split(a):t[n],e),{});return e.allColors=Object.assign({},e.allColors||{},n),e.allColors}addColors(t){return e.addColors(t)}colorize(t,r,i){if(i===void 0&&(i=r),!Array.isArray(e.allColors[t]))return n[e.allColors[t]](i);for(let r=0,a=e.allColors[t].length;r<a;r++)i=n[e.allColors[t][r]](i);return i}transform(e,t){return t.all&&typeof e[i]==`string`&&(e[i]=this.colorize(e[r],e.level,e[i])),(t.level||t.all||!t.message)&&(e.level=this.colorize(e[r],e.level)),(t.all||t.message)&&(e.message=this.colorize(e[r],e.level,e.message)),e}};t.exports=e=>new o(e),t.exports.Colorizer=t.exports.Format=o})),ia=t(((e,t)=>{let{Colorizer:n}=ra();t.exports=e=>(n.addColors(e.colors||e),e)})),aa=t(((e,t)=>{t.exports=Vi()(e=>(e.message=`\t${e.message}`,e))})),oa=t(((e,t)=>{let n=Vi(),{LEVEL:r,MESSAGE:i}=G();t.exports=n((e,{stack:t,cause:n})=>{if(e instanceof Error){let a=Object.assign({},e,{level:e.level,[r]:e[r]||e.level,message:e.message,[i]:e[i]||e.message});return t&&(a.stack=e.stack),n&&(a.cause=e.cause),a}if(!(e.message instanceof Error))return e;let a=e.message;return Object.assign(e,a),e.message=a.message,e[i]=a.message,t&&(e.stack=a.stack),n&&(e.cause=a.cause),e})})),sa=t(((e,t)=>{let{configs:n,LEVEL:r,MESSAGE:i}=G();var a=class e{constructor(t={levels:n.npm.levels}){this.paddings=e.paddingForLevels(t.levels,t.filler),this.options=t}static getLongestLevel(e){let t=Object.keys(e).map(e=>e.length);return Math.max(...t)}static paddingForLevel(e,t,n){let r=n+1-e.length,i=Math.floor(r/t.length);return`${t}${t.repeat(i)}`.slice(0,r)}static paddingForLevels(t,n=` `){let r=e.getLongestLevel(t);return Object.keys(t).reduce((t,i)=>(t[i]=e.paddingForLevel(i,n,r),t),{})}transform(e,t){return e.message=`${this.paddings[e[r]]}${e.message}`,e[i]&&(e[i]=`${this.paddings[e[r]]}${e[i]}`),e}};t.exports=e=>new a(e),t.exports.Padder=t.exports.Format=a})),ca=t(((e,t)=>{let{Colorizer:n}=ra(),{Padder:r}=sa(),{configs:i,MESSAGE:a}=G();var o=class{constructor(e={}){e.levels||=i.cli.levels,this.colorizer=new n(e),this.padder=new r(e),this.options=e}transform(e,t){return this.colorizer.transform(this.padder.transform(e,t),t),e[a]=`${e.level}:${e.message}`,e}};t.exports=e=>new o(e),t.exports.Format=o})),la=t(((e,t)=>{let n=Vi();function r(e){if(e.every(i))return t=>{let n=t;for(let t=0;t<e.length;t++)if(n=e[t].transform(n,e[t].options),!n)return!1;return n}}function i(e){if(typeof e.transform!=`function`)throw Error([`No transform function found on format. Did you create a format instance?`,`const myFormat = format(formatFn);`,`const instance = myFormat();`].join(`
7
+ `));return!0}t.exports=(...e)=>{let t=n(r(e)),i=t();return i.Format=t.Format,i},t.exports.cascade=r})),ua=t(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=g();r.configure=g,r.stringify=r,r.default=r,e.stringify=r,e.configure=g,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e){if(e.length>200)return e.sort();for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function f(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function p(e){return e===1?`1 item`:`${e} items`}function m(e){let t=new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function h(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function g(e){e={...e};let t=h(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=d(e,`bigint`),i=d(e,`deterministic`),s=f(e,`maximumDepth`),g=f(e,`maximumBreadth`);function _(e,l,u,d,f,m){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=m;if(Array.isArray(h)){if(h.length===0)return`[]`;if(s<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(m+=f,e+=`\n${m}`,t=`,\n${m}`);let n=Math.min(h.length,g),i=0;for(;i<n-1;i++){let n=_(String(i),h,u,d,f,m);e+=n===void 0?`null`:n,e+=t}let a=_(String(i),h,u,d,f,m);if(e+=a===void 0?`null`:a,h.length-1>g){let n=h.length-g-1;e+=`${t}"... ${p(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),v=l.length;if(v===0)return`{}`;if(s<u.length+1)return`"[Object]"`;let y=``,b=``;f!==``&&(m+=f,t=`,\n${m}`,y=` `);let x=Math.min(v,g);i&&!c(h)&&(l=o(l)),u.push(h);for(let n=0;n<x;n++){let r=l[n],i=_(r,h,u,d,f,m);i!==void 0&&(e+=`${b}${a(r)}:${y}${i}`,b=t)}if(v>g){let n=v-g;e+=`${b}"...":${y}"${p(n)} not stringified"`,b=t}return f!==``&&b.length>1&&(e=`\n${m}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function v(e,i,o,c,l,u){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=u,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(s<o.length+1)return`"[Array]"`;o.push(i),l!==``&&(u+=l,t+=`\n${u}`,r=`,\n${u}`);let n=Math.min(i.length,g),a=0;for(;a<n-1;a++){let e=v(String(a),i[a],o,c,l,u);t+=e===void 0?`null`:e,t+=r}let d=v(String(a),i[a],o,c,l,u);if(t+=d===void 0?`null`:d,i.length-1>g){let e=i.length-g-1;t+=`${r}"... ${p(e)} not stringified"`}return l!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let d=``;l!==``&&(u+=l,r=`,\n${u}`,d=` `);let f=``;for(let e of c){let n=v(e,i[e],o,c,l,u);n!==void 0&&(t+=`${f}${a(e)}:${d}${n}`,f=r)}return l!==``&&f.length>1&&(t=`\n${u}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function y(e,u,d,f,m){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return y(e,u,d,f,m);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=m;if(Array.isArray(u)){if(u.length===0)return`[]`;if(s<d.length+1)return`"[Array]"`;d.push(u),m+=f;let e=`\n${m}`,n=`,\n${m}`,r=Math.min(u.length,g),i=0;for(;i<r-1;i++){let t=y(String(i),u[i],d,f,m);e+=t===void 0?`null`:t,e+=n}let a=y(String(i),u[i],d,f,m);if(e+=a===void 0?`null`:a,u.length-1>g){let t=u.length-g-1;e+=`${n}"... ${p(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(s<d.length+1)return`"[Object]"`;m+=f;let _=`,\n${m}`,v=``,b=``,x=Math.min(h,g);c(u)&&(v+=l(u,_,g),r=r.slice(u.length),x-=u.length,b=_),i&&(r=o(r)),d.push(u);for(let e=0;e<x;e++){let t=r[e],n=y(t,u[t],d,f,m);n!==void 0&&(v+=`${b}${a(t)}: ${n}`,b=_)}if(h>g){let e=h-g;v+=`${b}"...": "${p(e)} not stringified"`,b=_}return b!==``&&(v=`\n${m}${v}\n${t}`),d.pop(),`{${v}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function b(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return b(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``;if(Array.isArray(u)){if(u.length===0)return`[]`;if(s<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,g),n=0;for(;n<e-1;n++){let e=b(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=b(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>g){let e=u.length-g-1;t+=`,"... ${p(e)} not stringified"`}return d.pop(),`[${t}]`}let r=Object.keys(u),f=r.length;if(f===0)return`{}`;if(s<d.length+1)return`"[Object]"`;let m=``,h=Math.min(f,g);c(u)&&(t+=l(u,`,`,g),r=r.slice(u.length),h-=u.length,m=`,`),i&&(r=o(r)),d.push(u);for(let e=0;e<h;e++){let n=r[e],i=b(n,u[n],d);i!==void 0&&(t+=`${m}${a(n)}:${i}`,m=`,`)}if(f>g){let e=f-g;t+=`${m}"...":"${p(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function x(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return _(``,{"":e},[],t,r,``);if(Array.isArray(t))return v(``,e,[],m(t),r,``)}if(r.length!==0)return y(``,e,[],r,``)}return b(``,e,[])}return x}})),da=t(((e,t)=>{let n=Vi(),{MESSAGE:r}=G(),i=ua();function a(e,t){return typeof t==`bigint`?t.toString():t}t.exports=n((e,t)=>(e[r]=i.configure(t)(e,t.replacer||a,t.space),e))})),fa=t(((e,t)=>{t.exports=Vi()((e,t)=>t.message?(e.message=`[${t.label}] ${e.message}`,e):(e.label=t.label,e))})),pa=t(((e,t)=>{let n=Vi(),{MESSAGE:r}=G(),i=ua();t.exports=n(e=>{let t={};return e.message&&(t[`@message`]=e.message,delete e.message),e.timestamp&&(t[`@timestamp`]=e.timestamp,delete e.timestamp),t[`@fields`]=e,e[r]=i(t),e})})),ma=t(((e,t)=>{let n=Vi();function r(e,t,n){let r=t.reduce((t,n)=>(t[n]=e[n],delete e[n],t),{}),i=Object.keys(e).reduce((t,n)=>(t[n]=e[n],delete e[n],t),{});return Object.assign(e,r,{[n]:i}),e}function i(e,t,n){return e[n]=t.reduce((t,n)=>(t[n]=e[n],delete e[n],t),{}),e}t.exports=n((e,t={})=>{let n=`metadata`;t.key&&(n=t.key);let a=[];return!t.fillExcept&&!t.fillWith&&(a.push(`level`),a.push(`message`)),t.fillExcept&&(a=t.fillExcept),a.length>0?r(e,a,n):t.fillWith?i(e,t.fillWith,n):e})})),ha=t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),ga=t(((e,t)=>{let n=Vi(),r=ha();t.exports=n(t=>{let n=+new Date;return e.diff=n-(e.prevTime||n),e.prevTime=n,t.ms=`+${r(e.diff)}`,t})})),_a=t(((e,t)=>{let n=s(`util`).inspect,r=Vi(),{LEVEL:i,MESSAGE:a,SPLAT:o}=G();t.exports=r((e,t={})=>{let r=Object.assign({},e);return delete r[i],delete r[a],delete r[o],e[a]=n(r,!1,t.depth||null,t.colorize),e})})),va=t(((e,t)=>{let{MESSAGE:n}=G();var r=class{constructor(e){this.template=e}transform(e){return e[n]=this.template(e),e}};t.exports=e=>new r(e),t.exports.Printf=t.exports.Format=r})),ya=t(((e,t)=>{let n=Vi(),{MESSAGE:r}=G(),i=ua();t.exports=n(e=>{let t=i(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),n=e.padding&&e.padding[e.level]||``;return t===`{}`?e[r]=`${e.level}:${n} ${e.message}`:e[r]=`${e.level}:${n} ${e.message} ${t}`,e})})),ba=t(((e,t)=>{let n=s(`util`),{SPLAT:r}=G(),i=/%[scdjifoO%]/g,a=/%%/g;var o=class{constructor(e){this.options=e}_splat(e,t){let i=e.message,o=e[r]||e.splat||[],s=i.match(a),c=s&&s.length||0,l=t.length-c-o.length,u=l<0?o.splice(l,-1*l):[],d=u.length;if(d)for(let t=0;t<d;t++)Object.assign(e,u[t]);return e.message=n.format(i,...o),e}transform(e){let t=e.message,n=e[r]||e.splat;if(!n||!n.length)return e;let a=t&&t.match&&t.match(i);if(!a&&(n||n.length)){let t=n.length>1?n.splice(0):n,r=t.length;if(r)for(let n=0;n<r;n++)Object.assign(e,t[n]);return e}return a?this._splat(e,a):e}};t.exports=e=>new o(e)})),xa=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r(n.fecha={})})(e,(function(e){var t=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,n=`\\d\\d?`,r=`\\d\\d`,i=`\\d{3}`,a=`\\d{4}`,o=`[^\\s]+`,s=/\[([^]*?)\]/gm;function c(e,t){for(var n=[],r=0,i=e.length;r<i;r++)n.push(e[r].substr(0,t));return n}var l=function(e){return function(t,n){var r=n[e].map(function(e){return e.toLowerCase()}).indexOf(t.toLowerCase());return r>-1?r:null}};function u(e){for(var t=[...arguments].slice(1),n=0,r=t;n<r.length;n++){var i=r[n];for(var a in i)e[a]=i[a]}return e}var d=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],f=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],p=c(f,3),m={dayNamesShort:c(d,3),dayNames:d,monthNamesShort:p,monthNames:f,amPm:[`am`,`pm`],DoFn:function(e){return e+[`th`,`st`,`nd`,`rd`][e%10>3?0:(e-e%10==10?0:1)*e%10]}},h=u({},m),g=function(e){return h=u(h,e)},_=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,`\\$&`)},v=function(e,t){for(t===void 0&&(t=2),e=String(e);e.length<t;)e=`0`+e;return e},y={D:function(e){return String(e.getDate())},DD:function(e){return v(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return v(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return v(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return v(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return v(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return v(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return v(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return v(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return v(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return v(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return v(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?`-`:`+`)+v(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?`-`:`+`)+v(Math.floor(Math.abs(t)/60),2)+`:`+v(Math.abs(t)%60,2)}},b=function(e){return e-1},x=[null,n],S=[null,o],C=[`isPm`,o,function(e,t){var n=e.toLowerCase();return n===t.amPm[0]?0:n===t.amPm[1]?1:null}],w=[`timezoneOffset`,`[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?`,function(e){var t=(e+``).match(/([+-]|\d\d)/gi);if(t){var n=t[1]*60+parseInt(t[2],10);return t[0]===`+`?n:-n}return 0}],T={D:[`day`,n],DD:[`day`,r],Do:[`day`,n+o,function(e){return parseInt(e,10)}],M:[`month`,n,b],MM:[`month`,r,b],YY:[`year`,r,function(e){var t=+(``+new Date().getFullYear()).substr(0,2);return+(``+(+e>68?t-1:t)+e)}],h:[`hour`,n,void 0,`isPm`],hh:[`hour`,r,void 0,`isPm`],H:[`hour`,n],HH:[`hour`,r],m:[`minute`,n],mm:[`minute`,r],s:[`second`,n],ss:[`second`,r],YYYY:[`year`,a],S:[`millisecond`,`\\d`,function(e){return e*100}],SS:[`millisecond`,r,function(e){return e*10}],SSS:[`millisecond`,i],d:x,dd:x,ddd:S,dddd:S,MMM:[`month`,o,l(`monthNamesShort`)],MMMM:[`month`,o,l(`monthNames`)],a:C,A:C,ZZ:w,Z:w},E={default:`ddd MMM DD YYYY HH:mm:ss`,shortDate:`M/D/YY`,mediumDate:`MMM D, YYYY`,longDate:`MMMM D, YYYY`,fullDate:`dddd, MMMM D, YYYY`,isoDate:`YYYY-MM-DD`,isoDateTime:`YYYY-MM-DDTHH:mm:ssZ`,shortTime:`HH:mm`,mediumTime:`HH:mm:ss`,longTime:`HH:mm:ss.SSS`},D=function(e){return u(E,e)},O=function(e,n,r){if(n===void 0&&(n=E.default),r===void 0&&(r={}),typeof e==`number`&&(e=new Date(e)),Object.prototype.toString.call(e)!==`[object Date]`||isNaN(e.getTime()))throw Error(`Invalid Date pass to format`);n=E[n]||n;var i=[];n=n.replace(s,function(e,t){return i.push(t),`@@@`});var a=u(u({},h),r);return n=n.replace(t,function(t){return y[t](e,a)}),n.replace(/@@@/g,function(){return i.shift()})};function k(e,n,r){if(r===void 0&&(r={}),typeof n!=`string`)throw Error(`Invalid format in fecha parse`);if(n=E[n]||n,e.length>1e3)return null;var i={year:new Date().getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],c=n.replace(s,function(e,t){return o.push(_(t)),`@@@`}),l={},d={};c=_(c).replace(t,function(e){var t=T[e],n=t[0],r=t[1],i=t[3];if(l[n])throw Error(`Invalid format. `+n+` specified twice in format`);return l[n]=!0,i&&(d[i]=!0),a.push(t),`(`+r+`)`}),Object.keys(d).forEach(function(e){if(!l[e])throw Error(`Invalid format. `+e+` is required in specified format`)}),c=c.replace(/@@@/g,function(){return o.shift()});var f=e.match(new RegExp(c,`i`));if(!f)return null;for(var p=u(u({},h),r),m=1;m<f.length;m++){var g=a[m-1],v=g[0],y=g[2],b=y?y(f[m],p):+f[m];if(b==null)return null;i[v]=b}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var x;if(i.timezoneOffset==null){x=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var S=[[`month`,`getMonth`],[`day`,`getDate`],[`hour`,`getHours`],[`minute`,`getMinutes`],[`second`,`getSeconds`]],m=0,C=S.length;m<C;m++)if(l[S[m][0]]&&i[S[m][0]]!==x[S[m][1]]())return null}else if(x=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return x}var A={format:O,parse:k,defaultI18n:m,setGlobalDateI18n:g,setGlobalDateMasks:D};e.assign=u,e.default=A,e.format=O,e.parse=k,e.defaultI18n=m,e.setGlobalDateI18n=g,e.setGlobalDateMasks=D,Object.defineProperty(e,"__esModule",{value:!0})}))})),Sa=t(((e,t)=>{let n=xa();t.exports=Vi()((e,t={})=>(t.format&&(e.timestamp=typeof t.format==`function`?t.format():n.format(new Date,t.format)),e.timestamp||=new Date().toISOString(),t.alias&&(e[t.alias]=e.timestamp),e))})),Ca=t(((e,t)=>{let n=Qi(),r=Vi(),{MESSAGE:i}=G();t.exports=r((e,t)=>(t.level!==!1&&(e.level=n.strip(e.level)),t.message!==!1&&(e.message=n.strip(String(e.message))),t.raw!==!1&&e[i]&&(e[i]=n.strip(String(e[i]))),e))})),wa=t((e=>{let t=e.format=Vi();e.levels=ia();function n(e,n){Object.defineProperty(t,e,{get(){return n()},configurable:!0})}n(`align`,function(){return aa()}),n(`errors`,function(){return oa()}),n(`cli`,function(){return ca()}),n(`combine`,function(){return la()}),n(`colorize`,function(){return ra()}),n(`json`,function(){return da()}),n(`label`,function(){return fa()}),n(`logstash`,function(){return pa()}),n(`metadata`,function(){return ma()}),n(`ms`,function(){return ga()}),n(`padLevels`,function(){return sa()}),n(`prettyPrint`,function(){return _a()}),n(`printf`,function(){return va()}),n(`simple`,function(){return ya()}),n(`splat`,function(){return ba()}),n(`timestamp`,function(){return Sa()}),n(`uncolorize`,function(){return Ca()})})),Ta=t((e=>{let{format:t}=s(`util`);e.warn={deprecated(e){return()=>{throw Error(t(`{ %s } was removed in winston@3.0.0.`,e))}},useFormat(e){return()=>{throw Error([t(`{ %s } was removed in winston@3.0.0.`,e),`Use a custom winston.format = winston.format(function) instead.`].join(`
8
+ `))}},forFunctions(t,n,r){r.forEach(r=>{t[r]=e.warn[n](r)})},forProperties(t,n,r){r.forEach(r=>{let i=e.warn[n](r);Object.defineProperty(t,r,{get:i,set:i})})}}})),Ea=t(((e,t)=>{t.exports={name:`winston`,description:`A logger for just about everything.`,version:`3.19.0`,author:`Charlie Robbins <charlie.robbins@gmail.com>`,maintainers:[`David Hyde <dabh@alumni.stanford.edu>`],repository:{type:`git`,url:`https://github.com/winstonjs/winston.git`},keywords:[`winston`,`logger`,`logging`,`logs`,`sysadmin`,`bunyan`,`pino`,`loglevel`,`tools`,`json`,`stream`],dependencies:{"@dabh/diagnostics":`^2.0.8`,"@colors/colors":`^1.6.0`,async:`^3.2.3`,"is-stream":`^2.0.0`,logform:`^2.7.0`,"one-time":`^1.0.0`,"readable-stream":`^3.4.0`,"safe-stable-stringify":`^2.3.1`,"stack-trace":`0.0.x`,"triple-beam":`^1.3.0`,"winston-transport":`^4.9.0`},devDependencies:{"@babel/cli":`^7.23.9`,"@babel/core":`^7.24.0`,"@babel/preset-env":`^7.24.0`,"@dabh/eslint-config-populist":`^4.4.0`,"@types/node":`^20.11.24`,"abstract-winston-transport":`^0.5.1`,assume:`^2.2.0`,"cross-spawn-async":`^2.2.5`,eslint:`^8.57.0`,hock:`^1.4.1`,jest:`^29.7.0`,rimraf:`5.0.10`,split2:`^4.1.0`,"std-mocks":`^2.0.0`,through2:`^4.0.2`,"winston-compat":`^0.1.5`},main:`./lib/winston.js`,browser:`./dist/winston`,types:`./index.d.ts`,scripts:{lint:`eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist`,test:`jest`,"test:unit":`jest -c test/jest.config.unit.js`,"test:integration":`jest -c test/jest.config.integration.js`,"test:typescript":`npx --package typescript tsc --project test`,build:`babel lib -d dist`,prebuild:`rimraf dist`,prepublishOnly:`npm run build`},engines:{node:`>= 12.0.0`},license:`MIT`}})),Da=t(((e,t)=>{t.exports=s(`util`).deprecate})),Oa=t(((e,t)=>{t.exports=s(`stream`)})),ka=t(((e,t)=>{function n(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(o,this,e)):process.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?n._writableState?n._writableState.errorEmitted?process.nextTick(i,n):(n._writableState.errorEmitted=!0,process.nextTick(r,n,e)):process.nextTick(r,n,e):t?(process.nextTick(i,n),t(e)):process.nextTick(i,n)}),this)}function r(e,t){o(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(`close`)}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit(`error`,t)}function s(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(`error`,t)}t.exports={destroy:n,undestroy:a,errorOrDestroy:s}})),Aa=t(((e,t)=>{let n={};function r(e,t,r){r||=Error;function i(e,n,r){return typeof t==`string`?t:t(e,n,r)}class a extends r{constructor(e,t,n){super(i(e,t,n))}}a.prototype.name=r.name,a.prototype.code=e,n[e]=a}function i(e,t){if(Array.isArray(e)){let n=e.length;return e=e.map(e=>String(e)),n>2?`one of ${t} ${e.slice(0,n-1).join(`, `)}, or `+e[n-1]:n===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function a(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function o(e,t,n){return(n===void 0||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function s(e,t,n){return typeof n!=`number`&&(n=0),n+t.length>e.length?!1:e.indexOf(t,n)!==-1}r(`ERR_INVALID_OPT_VALUE`,function(e,t){return`The value "`+t+`" is invalid for option "`+e+`"`},TypeError),r(`ERR_INVALID_ARG_TYPE`,function(e,t,n){let r;typeof t==`string`&&a(t,`not `)?(r=`must not be`,t=t.replace(/^not /,``)):r=`must be`;let c;return c=o(e,` argument`)?`The ${e} ${r} ${i(t,`type`)}`:`The "${e}" ${s(e,`.`)?`property`:`argument`} ${r} ${i(t,`type`)}`,c+=`. Received type ${typeof n}`,c},TypeError),r(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`),r(`ERR_METHOD_NOT_IMPLEMENTED`,function(e){return`The `+e+` method is not implemented`}),r(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`),r(`ERR_STREAM_DESTROYED`,function(e){return`Cannot call `+e+` after a stream was destroyed`}),r(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`),r(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`),r(`ERR_STREAM_WRITE_AFTER_END`,`write after end`),r(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),r(`ERR_UNKNOWN_ENCODING`,function(e){return`Unknown encoding: `+e},TypeError),r(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`),t.exports.codes=n})),ja=t(((e,t)=>{var n=Aa().codes.ERR_INVALID_OPT_VALUE;function r(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function i(e,t,i,a){var o=r(t,a,i);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(a?i:`highWaterMark`,o);return Math.floor(o)}return e.objectMode?16:16*1024}t.exports={getHighWaterMark:i}})),Ma=t(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),Na=t(((e,t)=>{try{var n=s(`util`);if(typeof n.inherits!=`function`)throw``;t.exports=n.inherits}catch{t.exports=Ma()}})),Pa=t(((e,t)=>{function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]==null?{}:arguments[t];t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return t=l(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function c(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=u(e,`string`);return typeof t==`symbol`?t:String(t)}function u(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var d=s(`buffer`).Buffer,f=s(`util`).inspect,p=f&&f.custom||`inspect`;function m(e,t,n){d.prototype.copy.call(e,t,n)}t.exports=function(){function e(){a(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:`push`,value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:`unshift`,value:function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}},{key:`shift`,value:function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:`clear`,value:function(){this.head=this.tail=null,this.length=0}},{key:`join`,value:function(e){if(this.length===0)return``;for(var t=this.head,n=``+t.data;t=t.next;)n+=e+t.data;return n}},{key:`concat`,value:function(e){if(this.length===0)return d.alloc(0);for(var t=d.allocUnsafe(e>>>0),n=this.head,r=0;n;)m(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:`consume`,value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:`first`,value:function(){return this.head.data}},{key:`_getString`,value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),e-=a,e===0){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:`_getBuffer`,value:function(e){var t=d.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),e-=a,e===0){a===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(a));break}++r}return this.length-=r,t}},{key:p,value:function(e,t){return f(this,r(r({},t),{},{depth:0,customInspect:!1}))}}]),e}()})),Fa=t(((e,t)=>{
9
9
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- var n=s(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),Fa=t((e=>{var t=Pa().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||``},a.prototype.end=d,a.prototype.text=u,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):``}})),Ia=t(((e,t)=>{var n=ka().codes.ERR_STREAM_PREMATURE_CLOSE;function r(e){var t=!1;return function(){if(!t){t=!0;var n=[...arguments];e.apply(this,n)}}}function i(){}function a(e){return e.setHeader&&typeof e.abort==`function`}function o(e,t,s){if(typeof t==`function`)return o(e,null,t);t||={},s=r(s||i);var c=t.readable||t.readable!==!1&&e.readable,l=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||f()},d=e._writableState&&e._writableState.finished,f=function(){l=!1,d=!0,c||s.call(e)},p=e._readableState&&e._readableState.endEmitted,m=function(){c=!1,p=!0,l||s.call(e)},h=function(t){s.call(e,t)},g=function(){var t;if(c&&!p)return(!e._readableState||!e._readableState.ended)&&(t=new n),s.call(e,t);if(l&&!d)return(!e._writableState||!e._writableState.ended)&&(t=new n),s.call(e,t)},_=function(){e.req.on(`finish`,f)};return a(e)?(e.on(`complete`,f),e.on(`abort`,g),e.req?_():e.on(`request`,_)):l&&!e._writableState&&(e.on(`end`,u),e.on(`close`,u)),e.on(`end`,m),e.on(`finish`,f),t.error!==!1&&e.on(`error`,h),e.on(`close`,g),function(){e.removeListener(`complete`,f),e.removeListener(`abort`,g),e.removeListener(`request`,_),e.req&&e.req.removeListener(`finish`,f),e.removeListener(`end`,u),e.removeListener(`close`,u),e.removeListener(`finish`,f),e.removeListener(`end`,m),e.removeListener(`error`,h),e.removeListener(`close`,g)}}t.exports=o})),La=t(((e,t)=>{var n;function r(e,t,n){return t=i(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t=a(e,`string`);return typeof t==`symbol`?t:String(t)}function a(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var o=Ia(),s=Symbol(`lastResolve`),c=Symbol(`lastReject`),l=Symbol(`error`),u=Symbol(`ended`),d=Symbol(`lastPromise`),f=Symbol(`handlePromise`),p=Symbol(`stream`);function m(e,t){return{value:e,done:t}}function h(e){var t=e[s];if(t!==null){var n=e[p].read();n!==null&&(e[d]=null,e[s]=null,e[c]=null,t(m(n,!1)))}}function g(e){process.nextTick(h,e)}function _(e,t){return function(n,r){e.then(function(){if(t[u]){n(m(void 0,!0));return}t[f](n,r)},r)}}var v=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(t!==null)return Promise.reject(t);if(this[u])return Promise.resolve(m(void 0,!0));if(this[p].destroyed)return new Promise(function(t,n){process.nextTick(function(){e[l]?n(e[l]):t(m(void 0,!0))})});var n=this[d],r;if(n)r=new Promise(_(n,this));else{var i=this[p].read();if(i!==null)return Promise.resolve(m(i,!1));r=new Promise(this[f])}return this[d]=r,r}},r(n,Symbol.asyncIterator,function(){return this}),r(n,`return`,function(){var e=this;return new Promise(function(t,n){e[p].destroy(null,function(e){if(e){n(e);return}t(m(void 0,!0))})})}),n),v);t.exports=function(e){var t,n=Object.create(y,(t={},r(t,p,{value:e,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,l,{value:null,writable:!0}),r(t,u,{value:e._readableState.endEmitted,writable:!0}),r(t,f,{value:function(e,t){var r=n[p].read();r?(n[d]=null,n[s]=null,n[c]=null,e(m(r,!1))):(n[s]=e,n[c]=t)},writable:!0}),t));return n[d]=null,o(e,function(e){if(e&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`){var t=n[c];t!==null&&(n[d]=null,n[s]=null,n[c]=null,t(e)),n[l]=e;return}var r=n[s];r!==null&&(n[d]=null,n[s]=null,n[c]=null,r(m(void 0,!0))),n[u]=!0}),e.on(`readable`,g.bind(null,n)),n}})),Ra=t(((e,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?i(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t,n){return t=s(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=c(e,`string`);return typeof t==`symbol`?t:String(t)}function c(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var l=ka().codes.ERR_INVALID_ARG_TYPE;function u(e,t,n){var i;if(t&&typeof t.next==`function`)i=t;else if(t&&t[Symbol.asyncIterator])i=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])i=t[Symbol.iterator]();else throw new l(`iterable`,[`Iterable`],t);var o=new e(a({objectMode:!0},n)),s=!1;o._read=function(){s||(s=!0,c())};function c(){return u.apply(this,arguments)}function u(){return u=r(function*(){try{var e=yield i.next(),t=e.value;e.done?o.push(null):o.push(yield t)?c():s=!1}catch(e){o.destroy(e)}}),u.apply(this,arguments)}return o}t.exports=u})),za=t(((e,t)=>{t.exports=D;var n;D.ReadableState=E,s(`events`).EventEmitter;var r=function(e,t){return e.listeners(t).length},i=Da(),a=s(`buffer`).Buffer,o=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function c(e){return a.from(e)}function l(e){return a.isBuffer(e)||e instanceof o}var u=s(`util`),d=u&&u.debuglog?u.debuglog(`stream`):function(){},f=Na(),p=Oa(),m=Aa().getHighWaterMark,h=ka().codes,g=h.ERR_INVALID_ARG_TYPE,_=h.ERR_STREAM_PUSH_AFTER_EOF,v=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,b,x,S;Ma()(D,i);var C=p.errorOrDestroy,w=[`error`,`close`,`destroy`,`pause`,`resume`];function T(e,t,n){if(typeof e.prependListener==`function`)return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function E(e,t,r){n||=Ba(),e||={},typeof r!=`boolean`&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,`readableHighWaterMark`,r),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(b||=Fa().StringDecoder,this.decoder=new b(e.encoding),this.encoding=e.encoding)}function D(e){if(n||=Ba(),!(this instanceof D))return new D(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy)),i.call(this)}Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),D.prototype.destroy=p.destroy,D.prototype._undestroy=p.undestroy,D.prototype._destroy=function(e,t){t(e)},D.prototype.push=function(e,t){var n=this._readableState,r;return n.objectMode?r=!0:typeof e==`string`&&(t||=n.defaultEncoding,t!==n.encoding&&(e=a.from(e,t),t=``),r=!0),O(this,e,t,!1,r)},D.prototype.unshift=function(e){return O(this,e,null,!0,!1)};function O(e,t,n,r,i){d(`readableAddChunk`,t);var o=e._readableState;if(t===null)o.reading=!1,ee(e,o);else{var s;if(i||(s=A(o,t)),s)C(e,s);else if(o.objectMode||t&&t.length>0)if(typeof t!=`string`&&!o.objectMode&&Object.getPrototypeOf(t)!==a.prototype&&(t=c(t)),r)o.endEmitted?C(e,new y):k(e,o,t,!0);else if(o.ended)C(e,new _);else if(o.destroyed)return!1;else o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||t.length!==0?k(e,o,t,!1):F(e,o)):k(e,o,t,!1);else r||(o.reading=!1,F(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function k(e,t,n,r){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&te(e)),F(e,t)}function A(e,t){var n;return!l(t)&&typeof t!=`string`&&t!==void 0&&!e.objectMode&&(n=new g(`chunk`,[`string`,`Buffer`,`Uint8Array`],t)),n}D.prototype.isPaused=function(){return this._readableState.flowing===!1},D.prototype.setEncoding=function(e){b||=Fa().StringDecoder;var t=new b(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r=``;n!==null;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),r!==``&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var j=1073741824;function M(e){return e>=j?e=j:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function N(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=M(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}D.prototype.read=function(e){d(`read`,e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return d(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?se(this):te(this),null;if(e=N(e,t),e===0&&t.ended)return t.length===0&&se(this),null;var r=t.needReadable;d(`need readable`,r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,d(`length less than watermark`,r)),t.ended||t.reading?(r=!1,d(`reading or ended`,r)):r&&(d(`do read`),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=N(n,t)));var i=e>0?oe(e,t):null;return i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&se(this)),i!==null&&this.emit(`data`,i),i};function ee(e,t){if(d(`onEofChunk`),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?te(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}}function te(e){var t=e._readableState;d(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d(`emitReadable`,t.flowing),t.emittedReadable=!0,process.nextTick(P,e))}function P(e){var t=e._readableState;d(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,R(e)}function F(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(ne,e,t))}function ne(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var n=t.length;if(d(`maybeReadMore read 0`),e.read(0),n===t.length)break}t.readingMore=!1}D.prototype._read=function(e){C(this,new v(`_read()`))},D.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,d(`pipe count=%d opts=%j`,i.pipesCount,t);var a=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr?s:g;i.endEmitted?process.nextTick(a):n.once(`end`,a),e.on(`unpipe`,o);function o(e,t){d(`onunpipe`),e===n&&t&&t.hasUnpiped===!1&&(t.hasUnpiped=!0,u())}function s(){d(`onend`),e.end()}var c=re(n);e.on(`drain`,c);var l=!1;function u(){d(`cleanup`),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`drain`,c),e.removeListener(`error`,p),e.removeListener(`unpipe`,o),n.removeListener(`end`,s),n.removeListener(`end`,g),n.removeListener(`data`,f),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}n.on(`data`,f);function f(t){d(`ondata`);var r=e.write(t);d(`dest.write`,r),r===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&ce(i.pipes,e)!==-1)&&!l&&(d(`false write response, pause`,i.awaitDrain),i.awaitDrain++),n.pause())}function p(t){d(`onerror`,t),g(),e.removeListener(`error`,p),r(e,`error`)===0&&C(e,t)}T(e,`error`,p);function m(){e.removeListener(`finish`,h),g()}e.once(`close`,m);function h(){d(`onfinish`),e.removeListener(`close`,m),g()}e.once(`finish`,h);function g(){d(`unpipe`),n.unpipe(e)}return e.emit(`pipe`,n),i.flowing||(d(`pipe resume`),n.resume()),e};function re(e){return function(){var t=e._readableState;d(`pipeOnDrain`,t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&r(e,`data`)&&(t.flowing=!0,R(e))}}D.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||=t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(`unpipe`,this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit(`unpipe`,this,{hasUnpiped:!1});return this}var o=ce(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),--t.pipesCount,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit(`unpipe`,this,n),this)},D.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t),r=this._readableState;return e===`data`?(r.readableListening=this.listenerCount(`readable`)>0,r.flowing!==!1&&this.resume()):e===`readable`&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,d(`on readable`,r.length,r.reading),r.length?te(this):r.reading||process.nextTick(ie,this)),n},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return e===`readable`&&process.nextTick(I,this),n},D.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&process.nextTick(I,this),t};function I(e){var t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(`data`)>0&&e.resume()}function ie(e){d(`readable nexttick read 0`),e.read(0)}D.prototype.resume=function(){var e=this._readableState;return e.flowing||(d(`resume`),e.flowing=!e.readableListening,L(this,e)),e.paused=!1,this};function L(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(ae,e,t))}function ae(e,t){d(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),R(e),t.flowing&&!t.reading&&e.read(0)}D.prototype.pause=function(){return d(`call pause flowing=%j`,this._readableState.flowing),this._readableState.flowing!==!1&&(d(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState.paused=!0,this};function R(e){var t=e._readableState;for(d(`flow`,t.flowing);t.flowing&&e.read()!==null;);}D.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on(`end`,function(){if(d(`wrapped end`),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on(`data`,function(i){d(`wrapped data`),n.decoder&&(i=n.decoder.write(i)),!(n.objectMode&&i==null)&&(!n.objectMode&&(!i||!i.length)||t.push(i)||(r=!0,e.pause()))}),e)this[i]===void 0&&typeof e[i]==`function`&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<w.length;a++)e.on(w[a],this.emit.bind(this,w[a]));return this._read=function(t){d(`wrapped _read`,t),r&&(r=!1,e.resume())},this},typeof Symbol==`function`&&(D.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=La()),x(this)}),Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(D.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(D.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),D._fromList=oe,Object.defineProperty(D.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function oe(e,t){if(t.length===0)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function se(e){var t=e._readableState;d(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(z,t,e))}function z(e,t){if(d(`endReadableNT`,e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit(`end`),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}typeof Symbol==`function`&&(D.from=function(e,t){return S===void 0&&(S=Ra()),S(D,e,t)});function ce(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}})),Ba=t(((e,t)=>{var n=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var r=za(),i=Va();Ma()(c,r);for(var a=n(i.prototype),o=0;o<a.length;o++){var s=a[o];c.prototype[s]||(c.prototype[s]=i.prototype[s])}function c(e){if(!(this instanceof c))return new c(e);r.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once(`end`,l)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||process.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})})),Va=t(((e,t)=>{t.exports=E;function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){ae(t,e)}}var r;E.WritableState=w;var i={deprecate:Ea()},a=Da(),o=s(`buffer`).Buffer,c=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function l(e){return o.from(e)}function u(e){return o.isBuffer(e)||e instanceof c}var d=Oa(),f=Aa().getHighWaterMark,p=ka().codes,m=p.ERR_INVALID_ARG_TYPE,h=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,_=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,y=p.ERR_STREAM_NULL_VALUES,b=p.ERR_STREAM_WRITE_AFTER_END,x=p.ERR_UNKNOWN_ENCODING,S=d.errorOrDestroy;Ma()(E,a);function C(){}function w(e,t,i){r||=Ba(),e||={},typeof i!=`boolean`&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,`writableHighWaterMark`,i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){ee(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},(function(){try{Object.defineProperty(w.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},`_writableState.buffer is deprecated. Use _writableState.getBuffer instead.`,`DEP0003`)})}catch{}})();var T;typeof Symbol==`function`&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==`function`?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return T.call(this,e)?!0:this===E?e&&e._writableState instanceof w:!1}})):T=function(e){return e instanceof this};function E(e){r||=Ba();var t=this instanceof r;if(!t&&!T.call(E,this))return new E(e);this._writableState=new w(e,this,t),this.writable=!0,e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final)),a.call(this)}E.prototype.pipe=function(){S(this,new _)};function D(e,t){var n=new b;S(e,n),process.nextTick(t,n)}function O(e,t,n,r){var i;return n===null?i=new y:typeof n!=`string`&&!t.objectMode&&(i=new m(`chunk`,[`string`,`Buffer`],n)),i?(S(e,i),process.nextTick(r,i),!1):!0}E.prototype.write=function(e,t,n){var r=this._writableState,i=!1,a=!r.objectMode&&u(e);return a&&!o.isBuffer(e)&&(e=l(e)),typeof t==`function`&&(n=t,t=null),a?t=`buffer`:t||=r.defaultEncoding,typeof n!=`function`&&(n=C),r.ending?D(this,n):(a||O(this,r,e,n))&&(r.pendingcb++,i=A(this,r,a,e,t,n)),i},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&F(this,e))},E.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=e.toLowerCase()),!([`hex`,`utf8`,`utf-8`,`ascii`,`binary`,`base64`,`ucs2`,`ucs-2`,`utf16le`,`utf-16le`,`raw`].indexOf((e+``).toLowerCase())>-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function k(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t==`string`&&(t=o.from(t,n)),t}Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function A(e,t,n,r,i,a){if(!n){var o=k(t,r,i);r!==o&&(n=!0,i=`buffer`,r=o)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,s,r,i,a);return c}function j(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v(`write`)):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function M(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(ie,e,t),e._writableState.errorEmitted=!0,S(e,r)):(i(r),e._writableState.errorEmitted=!0,S(e,r),ie(e,t))}function N(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function ee(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(typeof i!=`function`)throw new g;if(N(n),t)M(e,n,r,t,i);else{var a=ne(n)||e.destroyed;!a&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest&&F(e,n),r?process.nextTick(te,e,n,a,i):te(e,n,a,i)}}function te(e,t,n,r){n||P(e,t),t.pendingcb--,r(),ie(e,t)}function P(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`))}function F(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,a=Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,c=!0;r;)a[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;a.allBuffers=c,j(e,t,!0,t.length,a,``,o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,d=r.callback;if(j(e,t,!1,t.objectMode?1:l.length,l,u,d),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}E.prototype._write=function(e,t,n){n(new h(`_write()`))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var r=this._writableState;return typeof e==`function`?(n=e,e=null,t=null):typeof t==`function`&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||L(this,r,n),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ne(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function re(e,t){e._final(function(n){t.pendingcb--,n&&S(e,n),t.prefinished=!0,e.emit(`prefinish`),ie(e,t)})}function I(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final==`function`&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(re,e,t)):(t.prefinished=!0,e.emit(`prefinish`)))}function ie(e,t){var n=ne(t);if(n&&(I(e,t),t.pendingcb===0&&(t.finished=!0,e.emit(`finish`),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}function L(e,t,n){t.ending=!0,ie(e,t),n&&(t.finished?process.nextTick(n):e.once(`finish`,n)),t.ended=!0,e.writable=!1}function ae(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree.next=e}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=d.destroy,E.prototype._undestroy=d.undestroy,E.prototype._destroy=function(e,t){t(e)}})),Ha=t(((e,t)=>{let n=s(`util`),r=Va(),{LEVEL:i}=G(),a=t.exports=function(e={}){r.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once(`pipe`,e=>{this.levels=e.levels,this.parent=e}),this.once(`unpipe`,e=>{e===this.parent&&(this.parent=null,this.close&&this.close())})};n.inherits(a,r),a.prototype._write=function(e,t,n){if(this.silent||e.exception===!0&&!this.handleExceptions)return n(null);let r=this.level||this.parent&&this.parent.level;if(!r||this.levels[r]>=this.levels[e[i]]){if(e&&!this.format)return this.log(e,n);let t,r;try{r=this.format.transform(Object.assign({},e),this.format.options)}catch(e){t=e}if(t||!r){if(n(),t)throw t;return}return this.log(r,n)}return this._writableState.sync=!1,n(null)},a.prototype._writev=function(e,t){if(this.logv){let n=e.filter(this._accept,this);return n.length?this.logv(n,t):t(null)}for(let n=0;n<e.length;n++){if(!this._accept(e[n]))continue;if(e[n].chunk&&!this.format){this.log(e[n].chunk,e[n].callback);continue}let r,i;try{i=this.format.transform(Object.assign({},e[n].chunk),this.format.options)}catch(e){r=e}if(r||!i){if(e[n].callback(),r)throw t(null),r}else this.log(i,e[n].callback)}return t(null)},a.prototype._accept=function(e){let t=e.chunk;if(this.silent)return!1;let n=this.level||this.parent&&this.parent.level;return!!((t.exception===!0||!n||this.levels[n]>=this.levels[t[i]])&&(this.handleExceptions||t.exception!==!0))},a.prototype._nop=function(){}})),Ua=t(((e,t)=>{let n=s(`util`),{LEVEL:r}=G(),i=Ha(),a=t.exports=function(e={}){if(i.call(this,e),!e.transport||typeof e.transport.log!=`function`)throw Error(`Invalid transport, must be an object with a log method.`);this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function t(e){this.emit(`error`,e,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=t.bind(this),this.transport.on(`error`,this.transport.__winstonError))};n.inherits(a,i),a.prototype._write=function(e,t,n){if(this.silent||e.exception===!0&&!this.handleExceptions)return n(null);(!this.level||this.levels[this.level]>=this.levels[e[r]])&&this.transport.log(e[r],e.message,e,this._nop),n(null)},a.prototype._writev=function(e,t){for(let t=0;t<e.length;t++)this._accept(e[t])&&(this.transport.log(e[t].chunk[r],e[t].chunk.message,e[t].chunk,this._nop),e[t].callback());return t(null)},a.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,`- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md`].join(`
11
- `))},a.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener(`error`,this.transport.__winstonError),this.transport.__winstonError=null)}})),Wa=t(((e,t)=>{t.exports=Ha(),t.exports.LegacyTransportStream=Ua()})),Ga=t(((e,t)=>{let n=s(`os`),{LEVEL:r,MESSAGE:i}=G(),a=Wa();t.exports=class extends a{constructor(e={}){super(e),this.name=e.name||`console`,this.stderrLevels=this._stringArrayToSet(e.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(e.consoleWarnLevels),this.eol=typeof e.eol==`string`?e.eol:n.EOL,this.forceConsole=e.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(e,t){if(setImmediate(()=>this.emit(`logged`,e)),this.stderrLevels[e[r]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[i]}${this.eol}`):this._consoleError(e[i]),t&&t();return}else if(this.consoleWarnLevels[e[r]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[i]}${this.eol}`):this._consoleWarn(e[i]),t&&t();return}console._stdout&&!this.forceConsole?console._stdout.write(`${e[i]}${this.eol}`):this._consoleLog(e[i]),t&&t()}_stringArrayToSet(e,t){if(!e)return{};if(t||=`Cannot make set from type other than Array of string elements`,!Array.isArray(e))throw Error(t);return e.reduce((e,n)=>{if(typeof n!=`string`)throw Error(t);return e[n]=!0,e},{})}}})),Ka=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){return e&&typeof e.length==`number`&&e.length>=0&&e.length%1==0}t.exports=e.default})),qa=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return function(...t){var n=t.pop();return e.call(this,t,n)}},t.exports=e.default})),Ja=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fallback=i,e.wrap=a;var t=e.hasQueueMicrotask=typeof queueMicrotask==`function`&&queueMicrotask,n=e.hasSetImmediate=typeof setImmediate==`function`&&setImmediate,r=e.hasNextTick=typeof process==`object`&&typeof process.nextTick==`function`;function i(e){setTimeout(e,0)}function a(e){return(t,...n)=>e(()=>t(...n))}e.default=a(t?queueMicrotask:n?setImmediate:r?process.nextTick:i)})),Ya=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=a(qa()),r=a(Ja()),i=Xa();function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return(0,i.isAsync)(e)?function(...t){let n=t.pop();return s(e.apply(this,t),n)}:(0,n.default)(function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&typeof r.then==`function`)return s(r,n);n(null,r)})}function s(e,t){return e.then(e=>{c(t,null,e)},e=>{c(t,e&&(e instanceof Error||e.message)?e:Error(e))})}function c(e,t,n){try{e(t,n)}catch(e){(0,r.default)(e=>{throw e},e)}}t.exports=e.default})),Xa=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAsyncIterable=e.isAsyncGenerator=e.isAsync=void 0;var t=n(Ya());function n(e){return e&&e.__esModule?e:{default:e}}function r(e){return e[Symbol.toStringTag]===`AsyncFunction`}function i(e){return e[Symbol.toStringTag]===`AsyncGenerator`}function a(e){return typeof e[Symbol.asyncIterator]==`function`}function o(e){if(typeof e!=`function`)throw Error(`expected a function`);return r(e)?(0,t.default)(e):e}e.default=o,e.isAsync=r,e.isAsyncGenerator=i,e.isAsyncIterable=a})),Za=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e,t){if(t||=e.length,!t)throw Error(`arity is undefined`);function n(...n){return typeof n[t-1]==`function`?e.apply(this,n):new Promise((r,i)=>{n[t-1]=(e,...t)=>{if(e)return i(e);r(t.length>1?t:t[0])},e.apply(this,n)})}return n}t.exports=e.default})),Qa=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=a(Ka()),r=a(Xa()),i=a(Za());function a(e){return e&&e.__esModule?e:{default:e}}e.default=(0,i.default)((e,t,i)=>{var a=(0,n.default)(t)?[]:{};e(t,(e,t,n)=>{(0,r.default)(e)((e,...r)=>{r.length<2&&([r]=r),a[t]=r,n(e)})},e=>i(e,a))},3),t.exports=e.default})),$a=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){function t(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}t.exports=e.default})),eo=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()},t.exports=e.default})),to=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var n=i(Ka()),r=i(eo());function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}function o(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}function s(e){var t=e?Object.keys(e):[],n=-1,r=t.length;return function i(){var a=t[++n];return a===`__proto__`?i():n<r?{value:e[a],key:a}:null}}function c(e){if((0,n.default)(e))return a(e);var t=(0,r.default)(e);return t?o(t):s(e)}t.exports=e.default})),no=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){return function(...t){if(e===null)throw Error(`Callback was already called.`);var n=e;e=null,n.apply(this,t)}}t.exports=e.default})),ro=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={},t.exports=e.default})),io=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(ro());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r,i){let a=!1,o=!1,s=!1,c=0,l=0;function u(){c>=t||s||a||(s=!0,e.next().then(({value:e,done:t})=>{if(!(o||a)){if(s=!1,t){a=!0,c<=0&&i(null);return}c++,r(e,l,d),l++,u()}}).catch(f))}function d(e,t){if(--c,!o){if(e)return f(e);if(e===!1){a=!0,o=!0;return}if(t===n.default||a&&c<=0)return a=!0,i(null);u()}}function f(e){o||(s=!1,a=!0,i(e))}u()}t.exports=e.default})),ao=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=c($a()),r=c(to()),i=c(no()),a=Xa(),o=c(io()),s=c(ro());function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>(t,c,l)=>{if(l=(0,n.default)(l),e<=0)throw RangeError(`concurrency limit cannot be less than 1`);if(!t)return l(null);if((0,a.isAsyncGenerator)(t))return(0,o.default)(t,e,c,l);if((0,a.isAsyncIterable)(t))return(0,o.default)(t[Symbol.asyncIterator](),e,c,l);var u=(0,r.default)(t),d=!1,f=!1,p=0,m=!1;function h(e,t){if(!f)if(--p,e)d=!0,l(e);else if(e===!1)d=!0,f=!0;else if(t===s.default||d&&p<=0)return d=!0,l(null);else m||g()}function g(){for(m=!0;p<e&&!d;){var t=u();if(t===null){d=!0,p<=0&&l(null);return}p+=1,c(t.value,t.key,(0,i.default)(h))}m=!1}g()},t.exports=e.default})),oo=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=a(ao()),r=a(Xa()),i=a(Za());function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,i,a){return(0,n.default)(t)(e,(0,r.default)(i),a)}e.default=(0,i.default)(o,4),t.exports=e.default})),so=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=i(oo()),r=i(Za());function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){return(0,n.default)(e,1,t,r)}e.default=(0,r.default)(a,3),t.exports=e.default})),co=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=i(Qa()),r=i(so());function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return(0,n.default)(r.default,e,t)}t.exports=e.default})),lo=t(((e,t)=>{t.exports=l;var n=ka().codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=n.ERR_TRANSFORM_WITH_LENGTH_0,s=Ba();Ma()(l,s);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(r===null)return this.emit(`error`,new i);n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);s.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function u(){var e=this;typeof this._flush==`function`&&!this._readableState.destroyed?this._flush(function(t,n){d(e,t,n)}):d(this,null,null)}l.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new r(`_transform()`))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},l.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,function(e){t(e)})};function d(e,t,n){if(t)return e.emit(`error`,t);if(n!=null&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}})),uo=t(((e,t)=>{t.exports=r;var n=lo();Ma()(r,n);function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}r.prototype._transform=function(e,t,n){n(null,e)}})),fo=t(((e,t)=>{var n;function r(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i=ka().codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function c(e){return e.setHeader&&typeof e.abort==`function`}function l(e,t,i,a){a=r(a);var s=!1;e.on(`close`,function(){s=!0}),n===void 0&&(n=Ia()),n(e,{readable:t,writable:i},function(e){if(e)return a(e);s=!0,a()});var l=!1;return function(t){if(!s&&!l){if(l=!0,c(e))return e.abort();if(typeof e.destroy==`function`)return e.destroy();a(t||new o(`pipe`))}}}function u(e){e()}function d(e,t){return e.pipe(t)}function f(e){return!e.length||typeof e[e.length-1]!=`function`?s:e.pop()}function p(){var e=[...arguments],t=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new a(`streams`);var n,r=e.map(function(i,a){var o=a<e.length-1;return l(i,o,a>0,function(e){n||=e,e&&r.forEach(u),!o&&(r.forEach(u),t(n))})});return e.reduce(d)}t.exports=p})),po=t(((e,t)=>{var n=s(`stream`);process.env.READABLE_STREAM===`disable`&&n?(t.exports=n.Readable,Object.assign(t.exports,n),t.exports.Stream=n):(e=t.exports=za(),e.Stream=n||e,e.Readable=e,e.Writable=Va(),e.Duplex=Ba(),e.Transform=lo(),e.PassThrough=uo(),e.finished=Ia(),e.pipeline=fo())})),mo=t(((e,t)=>{var n=[],r=[],i=function(){};function a(e){return~n.indexOf(e)?!1:(n.push(e),!0)}function o(e){i=e}function s(e){for(var t=[],r=0;r<n.length;r++){if(n[r].async){t.push(n[r]);continue}if(n[r](e))return!0}return t.length?new Promise(function(n){Promise.all(t.map(function(t){return t(e)})).then(function(e){n(e.some(Boolean))})}):!1}function c(e){return~r.indexOf(e)?!1:(r.push(e),!0)}function l(){i.apply(i,arguments)}function u(e){for(var t=0;t<r.length;t++)e=r[t].apply(r[t],arguments);return e}function d(e,t){var n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&(e[r]=t[r]);return e}function f(e){return e.enabled=!1,e.modify=c,e.set=o,e.use=a,d(function(){return!1},e)}function p(e){function t(){var t=Array.prototype.slice.call(arguments,0);return l.call(l,e,u(t,e)),!0}return e.enabled=!0,e.modify=c,e.set=o,e.use=a,d(t,e)}t.exports=function(e){return e.introduce=d,e.enabled=s,e.process=u,e.modify=c,e.write=l,e.nope=f,e.yep=p,e.set=o,e.use=a,e}})),ho=t(((e,t)=>{t.exports=mo()(function e(t,n){return n||={},n.namespace=t,n.prod=!0,n.dev=!1,n.force||e.force?e.yep(n):e.nope(n)})})),go=t(((e,t)=>{var n={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};let r=Object.create(null);for(let e in n)Object.hasOwn(n,e)&&(r[n[e]]=e);let i={to:{},get:{}};i.get=function(e){let t=e.slice(0,3).toLowerCase(),n,r;switch(t){case`hsl`:n=i.get.hsl(e),r=`hsl`;break;case`hwb`:n=i.get.hwb(e),r=`hwb`;break;default:n=i.get.rgb(e),r=`rgb`;break}return n?{model:r,value:n}:null},i.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,c=[0,0,0,1],l,u,d;if(l=e.match(r)){for(d=l[2],l=l[1],u=0;u<3;u++){let e=u*2;c[u]=Number.parseInt(l.slice(e,e+2),16)}d&&(c[3]=Number.parseInt(d,16)/255)}else if(l=e.match(t)){for(l=l[1],d=l[3],u=0;u<3;u++)c[u]=Number.parseInt(l[u]+l[u],16);d&&(c[3]=Number.parseInt(d+d,16)/255)}else if(l=e.match(i)){for(u=0;u<3;u++)c[u]=Number.parseInt(l[u+1],10);l[4]&&(c[3]=l[5]?Number.parseFloat(l[4])*.01:Number.parseFloat(l[4]))}else if(l=e.match(o)){for(u=0;u<3;u++)c[u]=Math.round(Number.parseFloat(l[u+1])*2.55);l[4]&&(c[3]=l[5]?Number.parseFloat(l[4])*.01:Number.parseFloat(l[4]))}else if(l=e.match(s))return l[1]===`transparent`?[0,0,0,0]:Object.hasOwn(n,l[1])?(c=n[l[1]],c[3]=1,c):null;else return null;for(u=0;u<3;u++)c[u]=a(c[u],0,255);return c[3]=a(c[3],0,1),c},i.get.hsl=function(e){if(!e)return null;let t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){let e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,a(Number.parseFloat(t[2]),0,100),a(Number.parseFloat(t[3]),0,100),a(Number.isNaN(e)?1:e,0,1)]}return null},i.get.hwb=function(e){if(!e)return null;let t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){let e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,a(Number.parseFloat(t[2]),0,100),a(Number.parseFloat(t[3]),0,100),a(Number.isNaN(e)?1:e,0,1)]}return null},i.to.hex=function(...e){return`#`+o(e[0])+o(e[1])+o(e[2])+(e[3]<1?o(Math.round(e[3]*255)):``)},i.to.rgb=function(...e){return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},i.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+r+`%)`:`rgba(`+t+`%, `+n+`%, `+r+`%, `+e[3]+`)`},i.to.hsl=function(...e){return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},i.to.hwb=function(...e){let t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},i.to.keyword=function(...e){return r[e.slice(0,3)]};function a(e,t,n){return Math.min(Math.max(t,e),n)}function o(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}let s={};for(let e of Object.keys(n))s[n[e]]=e;let c={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},oklab:{channels:3,labels:[`okl`,`oka`,`okb`]},lch:{channels:3,labels:`lch`},oklch:{channels:3,labels:[`okl`,`okc`,`okh`]},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}},l=(6/29)**3;function u(e){let t=e>.0031308?1.055*e**(1/2.4)-.055:e*12.92;return Math.min(Math.max(0,t),1)}function d(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(c)){if(!(`channels`in c[e]))throw Error(`missing channels property: `+e);if(!(`labels`in c[e]))throw Error(`missing channel labels property: `+e);if(c[e].labels.length!==c[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=c[e];delete c[e].channels,delete c[e].labels,Object.defineProperty(c[e],"channels",{value:t}),Object.defineProperty(c[e],"labels",{value:n})}c.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;switch(a){case i:s=0;break;case t:s=(n-r)/o;break;case n:s=2+(r-t)/o;break;case r:s=4+(t-n)/o;break}s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},c.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};if(u===0)i=0,a=0;else{switch(a=u/l,t=d(o),n=d(s),r=d(c),l){case o:i=r-n;break;case s:i=1/3+t-r;break;case c:i=2/3+n-t;break}i<0?i+=1:i>1&&--i}return[i*360,a*100,l*100]},c.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=c.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]},c.rgb.oklab=function(e){let t=d(e[0]/255),n=d(e[1]/255),r=d(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),o=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o;return[s*100,c*100,l*100]},c.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function f(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}c.rgb.keyword=function(e){let t=s[e];if(t)return t;let r=1/0,i;for(let t of Object.keys(n)){let a=n[t],o=f(e,a);o<r&&(r=o,i=t)}return i},c.keyword.rgb=function(e){return n[e]},c.rgb.xyz=function(e){let t=d(e[0]/255),n=d(e[1]/255),r=d(e[2]/255),i=t*.4124564+n*.3575761+r*.1804375,a=t*.2126729+n*.7151522+r*.072175,o=t*.0193339+n*.119192+r*.9503041;return[i*100,a*100,o*100]},c.rgb.lab=function(e){let t=c.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>l?n**(1/3):7.787*n+16/116,r=r>l?r**(1/3):7.787*r+16/116,i=i>l?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},c.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a;if(n===0)return a=r*255,[a,a,a];let o=r<.5?r*(1+n):r+n-r*n,s=2*r-o,c=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,a=6*i<1?s+(o-s)*6*i:2*i<1?o:3*i<2?s+(o-s)*(2/3-i)*6:s,c[e]=a*255;return c},c.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},c.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},c.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},c.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},c.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},c.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2404542+n*-1.5371385+r*-.4985314,a=t*-.969266+n*1.8760108+r*.041556,o=t*.0556434+n*-.2040259+r*1.0572252,i=u(i),a=u(a),o=u(o),[i*255,a*255,o*255]},c.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>l?t**(1/3):7.787*t+16/116,n=n>l?n**(1/3):7.787*n+16/116,r=r>l?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},c.xyz.oklab=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),a=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),o=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o;return[s*100,c*100,l*100]},c.oklab.oklch=function(e){return c.lab.lch(e)},c.oklab.xyz=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(.999999998*t+.396337792*n+.215803758*r)**3,a=(1.000000008*t-.105561342*n-.063854175*r)**3,o=(1.000000055*t-.089484182*n-1.291485538*r)**3,s=1.227013851*i-.55779998*a+.281256149*o,c=-.040580178*i+1.11225687*a-.071676679*o,l=-.076381285*i-.421481978*a+1.58616322*o;return[s*100,c*100,l*100]},c.oklab.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(t+.3963377774*n+.2158037573*r)**3,a=(t-.1055613458*n-.0638541728*r)**3,o=(t-.0894841775*n-1.291485548*r)**3,s=u(4.0767416621*i-3.3077115913*a+.2309699292*o),c=u(-1.2684380046*i+2.6097574011*a-.3413193965*o),l=u(-.0041960863*i-.7034186147*a+1.707614701*o);return[s*255,c*255,l*255]},c.oklch.oklab=function(e){return c.lch.lab(e)},c.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,u=o**3;return a=s>l?s:(a-16/116)/7.787,i=c>l?c:(i-16/116)/7.787,o=u>l?u:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},c.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},c.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},c.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=t===null?c.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o},c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])},c.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t>>4==n>>4&&n>>4==r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},c.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(Math.trunc(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},c.ansi256.rgb=function(e){if(e=e[0],e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},c.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.slice(t.length)+t},c.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},c.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c=o<1?a/(1-o):0;return s=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,s/=6,s%=1,[s*360,o*100,c*100]},c.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},c.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},c.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},c.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},c.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},c.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},c.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},c.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},c.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},c.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},c.gray.hsl=function(e){return[0,0,e[0]]},c.gray.hsv=c.gray.hsl,c.gray.hwb=function(e){return[0,100,e[0]]},c.gray.cmyk=function(e){return[0,0,0,e[0]]},c.gray.lab=function(e){return[e[0],0,0]},c.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.slice(n.length)+n},c.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function p(){let e={},t=Object.keys(c);for(let{length:n}=t,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function m(e){let t=p(),n=[e];for(t[e].distance=0;n.length>0;){let e=n.pop(),r=Object.keys(c[e]);for(let{length:i}=r,a=0;a<i;a++){let i=r[a],o=t[i];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(i))}}return t}function h(e,t){return function(n){return t(e(n))}}function g(e,t){let n=[t[e].parent,e],r=c[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=h(c[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}function _(e){let t=m(e),n={},r=Object.keys(t);for(let{length:e}=r,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=g(e,t))}return n}let v={},y=Object.keys(c);function b(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function x(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let{length:e}=r,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}for(let e of y){v[e]={},Object.defineProperty(v[e],"channels",{value:c[e].channels}),Object.defineProperty(v[e],"labels",{value:c[e].labels});let t=_(e),n=Object.keys(t);for(let r of n){let n=t[r];v[e][r]=x(n),v[e][r].raw=b(n)}}let S=[`keyword`,`gray`,`hex`],C={};for(let e of Object.keys(v))C[[...v[e].labels].sort().join(``)]=e;let w={};function T(e,t){if(!(this instanceof T))return new T(e,t);if(t&&t in S&&(t=null),t&&!(t in v))throw Error(`Unknown model: `+t);let n,r;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof T)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=i.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,r=v[this.model].channels,this.color=t.value.slice(0,r),this.valpha=typeof t.value[r]==`number`?t.value[r]:1}else if(e.length>0){this.model=t||`rgb`,r=v[this.model].channels;let n=Array.prototype.slice.call(e,0,r);this.color=j(n,r),this.valpha=typeof e[r]==`number`?e[r]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let r=t.sort().join(``);if(!(r in C))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=C[r];let{labels:i}=v[this.model],a=[];for(n=0;n<i.length;n++)a.push(e[i[n]]);this.color=j(a)}if(w[this.model])for(r=v[this.model].channels,n=0;n<r;n++){let e=w[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}T.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in i.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return i.to[t.model](...n)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return i.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=v[this.model],{labels:n}=v[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new T([...this.color.map(D(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new T([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:O(`rgb`,0,k(255)),green:O(`rgb`,1,k(255)),blue:O(`rgb`,2,k(255)),hue:O([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:O(`hsl`,1,k(100)),lightness:O(`hsl`,2,k(100)),saturationv:O(`hsv`,1,k(100)),value:O(`hsv`,2,k(100)),chroma:O(`hcg`,1,k(100)),gray:O(`hcg`,2,k(100)),white:O(`hwb`,1,k(100)),wblack:O(`hwb`,2,k(100)),cyan:O(`cmyk`,0,k(100)),magenta:O(`cmyk`,1,k(100)),yellow:O(`cmyk`,2,k(100)),black:O(`cmyk`,3,k(100)),x:O(`xyz`,0,k(95.047)),y:O(`xyz`,1,k(100)),z:O(`xyz`,2,k(108.833)),l:O(`lab`,0,k(100)),a:O(`lab`,1),b:O(`lab`,2),keyword(e){return e===void 0?v[this.model].keyword(this.color):new T(e)},hex(e){return e===void 0?i.to.hex(...this.rgb().round().color):new T(e)},hexa(e){if(e!==void 0)return new T(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n=`0`+n),i.to.hex(...t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return T.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,c=1-s;return T.rgb(s*n.red()+c*r.red(),s*n.green()+c*r.green(),s*n.blue()+c*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(v)){if(S.includes(e))continue;let{channels:t}=v[e];T.prototype[e]=function(...t){return this.model===e?new T(this):t.length>0?new T(t,e):new T([...A(v[this.model][e].raw(this.color)),this.valpha],e)},T[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=j(n,t)),new T(r,e)}}function E(e,t){return Number(e.toFixed(t))}function D(e){return function(t){return E(t,e)}}function O(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(w[r]||=[])[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function k(e){return function(t){return Math.max(0,Math.min(e,t))}}function A(e){return Array.isArray(e)?e:[e]}function j(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var N=M(function(e){for(var t=0,n=0;t<e.length;n=e.charCodeAt(t++)+((n<<5)-n));var r=Math.floor(Math.abs(Math.sin(n)*1e4%1*16777216)).toString(16);return`#`+Array(6-r.length+1).join(`0`)+r});function ee(e,t){let n=e.split(t||`:`),r=N(n[0]);if(!n.length)return r;for(let e=0,t=n.length-1;e<t;e++)r=T(r).mix(T(N(n[e+1]))).saturate(1).hex();return r}t.exports=ee})),_o=t(((e,t)=>{function n(e,t){if(t)return new n(e).style(t);if(!(this instanceof n))return new n(e);this.text=e}n.prototype.prefix=`\x1B[`,n.prototype.suffix=`m`,n.prototype.hex=function(e){e=e[0]===`#`?e.substring(1):e,e.length===3&&(e=e.split(``),e[5]=e[2],e[4]=e[2],e[3]=e[1],e[2]=e[1],e[1]=e[0],e=e.join(``));var t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6);return[parseInt(t,16),parseInt(n,16),parseInt(r,16)]},n.prototype.rgb=function(e,t,n){var r=e/255*5,i=t/255*5,a=n/255*5;return this.ansi(r,i,a)},n.prototype.ansi=function(e,t,n){var r=Math.round(e),i=Math.round(t),a=Math.round(n);return 16+r*36+i*6+a},n.prototype.reset=function(){return this.prefix+`39;49`+this.suffix},n.prototype.style=function(e){return this.prefix+`38;5;`+this.rgb.apply(this,this.hex(e))+this.suffix+this.text+this.reset()},t.exports=n})),vo=t(((e,t)=>{var n=go(),r=_o();t.exports=function(e,t){var i=t.namespace;return e[0]=(t.colors===!1?i+`:`:r(i+`:`,n(i)))+` `+e[0],e}})),yo=t(((e,t)=>{t.exports=function(e,t){if(!t)return!1;for(var n=t.split(/[\s,]+/),r=0;r<n.length;r++){if(t=n[r].replace(`*`,`.*?`),t.charAt(0)===`-`){if(RegExp(`^`+t.substr(1)+`$`).test(e))return!1;continue}if(RegExp(`^`+t+`$`).test(e))return!0}return!1}})),bo=t(((e,t)=>{var n=yo();t.exports=function(e){return function(t){try{return n(t,e())}catch{}return!1}}})),xo=t(((e,t)=>{t.exports=bo()(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})})),So=t(((e,t)=>{t.exports=function(e,t){try{Function.prototype.apply.call(console.log,console,t)}catch{}}})),Co=t(((e,t)=>{var n=mo(),r=s(`tty`).isatty(1),i=n(function e(t,n){return n||={},n.colors=`colors`in n?n.colors:r,n.namespace=t,n.prod=!1,n.dev=!0,!e.enabled(t)&&!(n.force||e.force)?e.nope(n):e.yep(n)});i.modify(vo()),i.use(xo()),i.set(So()),t.exports=i})),wo=t(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=ho():t.exports=Co()})),To=t(((e,t)=>{let n=s(`fs`),{StringDecoder:r}=s(`string_decoder`),{Stream:i}=po();function a(){}t.exports=(e,t)=>{let o=Buffer.alloc(64*1024),s=new r(`utf8`),c=new i,l=``,u=0,d=0;return e.start===-1&&delete e.start,c.readable=!0,c.destroy=()=>{c.destroyed=!0,c.emit(`end`),c.emit(`close`)},n.open(e.file,`a+`,`0644`,(r,i)=>{if(r){t?t(r):c.emit(`error`,r),c.destroy();return}(function r(){if(c.destroyed){n.close(i,a);return}return n.read(i,o,0,o.length,u,(n,i)=>{if(n){t?t(n):c.emit(`error`,n),c.destroy();return}if(!i)return l&&=((e.start==null||d>e.start)&&(t?t(null,l):c.emit(`line`,l)),d++,``),setTimeout(r,1e3);let a=s.write(o.slice(0,i));t||c.emit(`data`,a),a=(l+a).split(/\n+/);let f=a.length-1,p=0;for(;p<f;p++)(e.start==null||d>e.start)&&(t?t(null,a[p]):c.emit(`line`,a[p])),d++;return l=a[f],u+=i,r()})})()}),t?c.destroy:c}})),Eo=t(((e,t)=>{let n=s(`fs`),r=s(`path`),i=co(),a=s(`zlib`),{MESSAGE:o}=G(),{Stream:c,PassThrough:l}=po(),u=Wa(),d=wo()(`winston:file`),f=s(`os`),p=To();t.exports=class extends u{constructor(e={}){super(e),this.name=e.name||`file`;function t(t,...n){n.slice(1).forEach(n=>{if(e[n])throw Error(`Cannot set ${n} and ${t} together`)})}if(this._stream=new l,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),e.filename||e.dirname)t(`filename or dirname`,`stream`),this._basename=this.filename=e.filename?r.basename(e.filename):`winston.log`,this.dirname=e.dirname||r.dirname(e.filename),this.options=e.options||{flags:`a`};else if(e.stream)console.warn(`options.stream will be removed in winston@4. Use winston.transports.Stream`),t(`stream`,`filename`,`maxsize`),this._dest=this._stream.pipe(this._setupStream(e.stream)),this.dirname=r.dirname(this._dest.path);else throw Error(`Cannot log to file without filename or stream.`);this.maxsize=e.maxsize||null,this.rotationFormat=e.rotationFormat||!1,this.zippedArchive=e.zippedArchive||!1,this.maxFiles=e.maxFiles||null,this.eol=typeof e.eol==`string`?e.eol:f.EOL,this.tailable=e.tailable||!1,this.lazy=e.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once(`open`,()=>{this._stream.once(`finish`,()=>this.emit(`finish`)),setImmediate(()=>this._stream.end())}):(this._stream.once(`finish`,()=>this.emit(`finish`)),setImmediate(()=>this._stream.end())))}_final(e){if(this._opening){this.once(`open`,()=>this._final(e));return}if(this._stream.end(),!this._dest||this._dest.writableFinished)return e();this._dest.once(`finish`,e),this._dest.once(`error`,e)}log(e,t=()=>{}){if(this.silent)return t(),!0;if(this._drain){this._stream.once(`drain`,()=>{this._drain=!1,this.log(e,t)});return}if(this._rotate){this._stream.once(`rotate`,()=>{this._rotate=!1,this.log(e,t)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once(`open`,()=>{this._fileExist=!0,this.log(e,t)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once(`close`,()=>{this._opening||this.open(),this.once(`open`,()=>{this.log(e,t)})});return}}let n=`${e[o]}${this.eol}`,r=Buffer.byteLength(n);function i(){if(this._size+=r,this._pendingSize-=r,d(`logged %s %s`,this._size,n),this.emit(`logged`,e),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit(`fileclosed`)});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=r,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let a=this._stream.write(n,i.bind(this));return a?t():(this._drain=!0,this._stream.once(`drain`,()=>{this._drain=!1,t()})),d(`written`,a,this._drain),this.finishIfEnding(),a}query(e,t){typeof e==`function`&&(t=e,e={}),e=f(e);let i=r.join(this.dirname,this.filename),a=``,o=[],s=0,c=n.createReadStream(i,{encoding:`utf8`});c.on(`error`,e=>{if(c.readable&&c.destroy(),t)return e.code===`ENOENT`?t(null,o):t(e)}),c.on(`data`,t=>{t=(a+t).split(/\n+/);let n=t.length-1,r=0;for(;r<n;r++)(!e.start||s>=e.start)&&l(t[r]),s++;a=t[n]}),c.on(`close`,()=>{a&&l(a,!0),e.order===`desc`&&(o=o.reverse()),t&&t(null,o)});function l(e,t){try{let t=JSON.parse(e);d(t)&&u(t)}catch(e){t||c.emit(`error`,e)}}function u(t){if(e.rows&&o.length>=e.rows&&e.order!==`desc`){c.readable&&c.destroy();return}e.fields&&(t=e.fields.reduce((e,n)=>(e[n]=t[n],e),{})),e.order===`desc`&&o.length>=e.rows&&o.shift(),o.push(t)}function d(t){if(!t||typeof t!=`object`)return;let n=new Date(t.timestamp);if(!(e.from&&n<e.from||e.until&&n>e.until||e.level&&e.level!==t.level))return!0}function f(e){return e||={},e.rows=e.rows||e.limit||10,e.start=e.start||0,e.until=e.until||new Date,typeof e.until!=`object`&&(e.until=new Date(e.until)),e.from=e.from||e.until-1440*60*1e3,typeof e.from!=`object`&&(e.from=new Date(e.from)),e.order=e.order||`desc`,e}}stream(e={}){let t=r.join(this.dirname,this.filename),n=new c;return n.destroy=p({file:t,start:e.start},(e,t)=>{if(e)return n.emit(`error`,e);try{n.emit(`data`,t),t=JSON.parse(t),n.emit(`log`,t)}catch(e){n.emit(`error`,e)}}),n}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((e,t)=>{if(e)return this.emit(`error`,e);d(`stat done: %s { size: %s }`,this.filename,t),this._size=t,this._dest=this._createStream(this._stream),this._opening=!1,this.once(`open`,()=>{this._stream.emit(`rotate`)||(this._rotate=!1)})})))}stat(e){let t=this._getFile(),i=r.join(this.dirname,t);n.stat(i,(n,r)=>{if(n&&n.code===`ENOENT`)return d(`ENOENT\xA0ok`,i),this.filename=t,e(null,0);if(n)return d(`err ${n.code} ${i}`),e(n);if(!r||this._needsNewFile(r.size))return this._incFile(()=>this.stat(e));this.filename=t,e(null,r.size)})}close(e){this._stream&&this._stream.end(()=>{e&&e(),this.emit(`flush`),this.emit(`closed`)})}_needsNewFile(e){return e||=this._size,this.maxsize&&e>=this.maxsize}_onError(e){this.emit(`error`,e)}_setupStream(e){return e.on(`error`,this._onError),e}_cleanupStream(e){return e.removeListener(`error`,this._onError),e.destroy(),e}_rotateFile(){this._incFile(()=>this.open())}_endStream(e=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),e()})):e()}_createStream(e){let t=r.join(this.dirname,this.filename);d(`create stream start`,t,this.options);let i=n.createWriteStream(t,this.options).on(`error`,e=>d(e)).on(`close`,()=>d(`close`,i.path,i.bytesWritten)).on(`open`,()=>{d(`file open ok`,t),this.emit(`open`,t),e.pipe(i),this.rotatedWhileOpening&&(this._stream=new l,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(i),e.end())});return d(`create stream ok`,t),i}_incFile(e){d(`_incFile`,this.filename);let t=r.extname(this._basename),n=r.basename(this._basename,t),a=[];this.zippedArchive&&a.push(function(e){let i=this._created>0&&!this.tailable?this._created:``;this._compressFile(r.join(this.dirname,`${n}${i}${t}`),r.join(this.dirname,`${n}${i}${t}.gz`),e)}.bind(this)),a.push(function(e){this.tailable?this._checkMaxFilesTailable(t,n,e):(this._created+=1,this._checkMaxFilesIncrementing(t,n,e))}.bind(this)),i(a,e)}_getFile(){let e=r.extname(this._basename),t=r.basename(this._basename,e),n=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${t}${n}${e}`:`${t}${e}`}_checkMaxFilesIncrementing(e,t,i){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(i);let a=this._created-this.maxFiles,o=`${t}${a===0?``:a}${e}${this.zippedArchive?`.gz`:``}`,s=r.join(this.dirname,o);n.unlink(s,i)}_checkMaxFilesTailable(e,t,a){let o=[];if(!this.maxFiles)return;let s=this.zippedArchive?`.gz`:``;for(let i=this.maxFiles-1;i>1;i--)o.push(function(i,a){let o=`${t}${i-1}${e}${s}`,c=r.join(this.dirname,o);n.exists(c,l=>{if(!l)return a(null);o=`${t}${i}${e}${s}`,n.rename(c,r.join(this.dirname,o),a)})}.bind(this,i));i(o,()=>{n.rename(r.join(this.dirname,`${t}${e}${s}`),r.join(this.dirname,`${t}1${e}${s}`),a)})}_compressFile(e,t,r){n.access(e,n.F_OK,i=>{if(i)return r();var o=a.createGzip(),s=n.createReadStream(e),c=n.createWriteStream(t);c.on(`finish`,()=>{n.unlink(e,r)}),s.pipe(o).pipe(c)})}_createLogDirIfNotExist(e){n.existsSync(e)||n.mkdirSync(e,{recursive:!0})}}})),Do=t(((e,t)=>{let n=s(`http`),r=s(`https`),{Stream:i}=po(),a=Wa(),{configure:o}=la();t.exports=class extends a{constructor(e={}){super(e),this.options=e,this.name=e.name||`http`,this.ssl=!!e.ssl,this.host=e.host||`localhost`,this.port=e.port,this.auth=e.auth,this.path=e.path||``,this.maximumDepth=e.maximumDepth,this.agent=e.agent,this.headers=e.headers||{},this.headers[`content-type`]=`application/json`,this.batch=e.batch||!1,this.batchInterval=e.batchInterval||5e3,this.batchCount=e.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||=this.ssl?443:80}log(e,t){this._request(e,null,null,(t,n)=>{n&&n.statusCode!==200&&(t=Error(`Invalid HTTP Status Code: ${n.statusCode}`)),t?this.emit(`warn`,t):this.emit(`logged`,e)}),t&&setImmediate(t)}query(e,t){typeof e==`function`&&(t=e,e={}),e={method:`query`,params:this.normalizeQuery(e)};let n=e.params.auth||null;delete e.params.auth;let r=e.params.path||null;delete e.params.path,this._request(e,n,r,(e,n,r)=>{if(n&&n.statusCode!==200&&(e=Error(`Invalid HTTP Status Code: ${n.statusCode}`)),e)return t(e);if(typeof r==`string`)try{r=JSON.parse(r)}catch(e){return t(e)}t(null,r)})}stream(e={}){let t=new i;e={method:`stream`,params:e};let n=e.params.path||null;delete e.params.path;let r=e.params.auth||null;delete e.params.auth;let a=``,o=this._request(e,r,n);return t.destroy=()=>o.destroy(),o.on(`data`,e=>{e=(a+e).split(/\n+/);let n=e.length-1,r=0;for(;r<n;r++)try{t.emit(`log`,JSON.parse(e[r]))}catch(e){t.emit(`error`,e)}a=e[n]}),o.on(`error`,e=>t.emit(`error`,e)),t}_request(e,t,n,r){e||={},t||=this.auth,n=n||this.path||``,this.batch?this._doBatch(e,r,t,n):this._doRequest(e,r,t,n)}_doBatch(e,t,n,r){if(this.batchOptions.push(e),this.batchOptions.length===1){let e=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){e.batchTimeoutID=-1,e._doBatchRequest(e.batchCallback,n,r)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,n,r)}_doBatchRequest(e,t,n){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let r=this.batchOptions.slice();this.batchOptions=[],this._doRequest(r,e,t,n)}_doRequest(e,t,i,a){let s=Object.assign({},this.headers);i&&i.bearer&&(s.Authorization=`Bearer ${i.bearer}`);let c=(this.ssl?r:n).request({...this.options,method:`POST`,host:this.host,port:this.port,path:`/${a.replace(/^\//,``)}`,headers:s,auth:i&&i.username&&i.password?`${i.username}:${i.password}`:``,agent:this.agent});c.on(`error`,t),c.on(`response`,e=>e.on(`end`,()=>t(null,e)).resume());let l=o({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});c.end(Buffer.from(l(e,this.options.replacer),`utf8`))}}})),Oo=t(((e,t)=>{let n=e=>typeof e==`object`&&!!e&&typeof e.pipe==`function`;n.writable=e=>n(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`,n.readable=e=>n(e)&&e.readable!==!1&&typeof e._read==`function`&&typeof e._readableState==`object`,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&typeof e._transform==`function`,t.exports=n})),ko=t(((e,t)=>{let n=Oo(),{MESSAGE:r}=G(),i=s(`os`),a=Wa();t.exports=class extends a{constructor(e={}){if(super(e),!e.stream||!n(e.stream))throw Error(`options.stream is required.`);this._stream=e.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=e.stream._writableState.objectMode,this.eol=typeof e.eol==`string`?e.eol:i.EOL}log(e,t){if(setImmediate(()=>this.emit(`logged`,e)),this.isObjectMode){this._stream.write(e),t&&t();return}this._stream.write(`${e[r]}${this.eol}`),t&&t()}}})),Ao=t((e=>{Object.defineProperty(e,"Console",{configurable:!0,enumerable:!0,get(){return Ga()}}),Object.defineProperty(e,"File",{configurable:!0,enumerable:!0,get(){return Eo()}}),Object.defineProperty(e,"Http",{configurable:!0,enumerable:!0,get(){return Do()}}),Object.defineProperty(e,"Stream",{configurable:!0,enumerable:!0,get(){return ko()}})})),jo=t((e=>{let t=Ca(),{configs:n}=G();e.cli=t.levels(n.cli),e.npm=t.levels(n.npm),e.syslog=t.levels(n.syslog),e.addColors=t.levels})),Mo=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=l(Ka()),r=l(ro()),i=l(oo()),a=l($a()),o=l(no()),s=l(Xa()),c=l(Za());function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t,n){n=(0,a.default)(n);var i=0,s=0,{length:c}=e,l=!1;c===0&&n(null);function u(e,t){e===!1&&(l=!0),l!==!0&&(e?n(e):(++s===c||t===r.default)&&n(null))}for(;i<c;i++)t(e[i],i,(0,o.default)(u))}function d(e,t,n){return(0,i.default)(e,1/0,t,n)}function f(e,t,r){return((0,n.default)(e)?u:d)(e,(0,s.default)(t),r)}e.default=(0,c.default)(f,3),t.exports=e.default})),No=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){return(t,n,r)=>e(t,r)}t.exports=e.default})),Po=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=o(Mo()),r=o(No()),i=o(Xa()),a=o(Za());function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t,a){return(0,n.default)(e,(0,r.default)((0,i.default)(t)),a)}e.default=(0,a.default)(s,3),t.exports=e.default})),Fo=t(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){if(typeof e.displayName==`string`&&e.constructor.name)return e.displayName;if(typeof e.name==`string`&&e.name)return e.name;if(typeof e==`object`&&e.constructor&&typeof e.constructor.name==`string`)return e.constructor.name;var t=e.toString(),r=n.call(e).slice(8,-1);return t=r===`Function`?t.substring(t.indexOf(`(`)+1,t.indexOf(`)`)):r,t||`anonymous`}})),Io=t(((e,t)=>{var n=Fo();t.exports=function(e){var t=0,r;function i(){return t?r:(t=1,r=e.apply(this,arguments),e=null,r)}return i.displayName=n(e),i}})),Lo=t((e=>{e.get=function(t){var n=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},i=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t},Error.captureStackTrace(r,t||e.get);var a=r.stack;return Error.prepareStackTrace=i,Error.stackTraceLimit=n,a},e.parse=function(e){if(!e.stack)return[];var t=this;return e.stack.split(`
12
- `).slice(1).map(function(e){if(e.match(/^\s*[-]{4,}$/))return t._createParsedCallSite({fileName:e,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var n=e.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(n){var r=null,i=null,a=null,o=null,s=null,c=n[5]===`native`;if(n[1]){a=n[1];var l=a.lastIndexOf(`.`);if(a[l-1]==`.`&&l--,l>0){r=a.substr(0,l),i=a.substr(l+1);var u=r.indexOf(`.Module`);u>0&&(a=a.substr(u+1),r=r.substr(0,u))}o=null}i&&(o=r,s=i),i===`<anonymous>`&&(s=null,a=null);var d={fileName:n[2]||null,lineNumber:parseInt(n[3],10)||null,functionName:a,typeName:o,methodName:s,columnNumber:parseInt(n[4],10)||null,native:c};return t._createParsedCallSite(d)}}).filter(function(e){return!!e})};function t(e){for(var t in e)this[t]=e[t]}[`this`,`typeName`,`functionName`,`methodName`,`fileName`,`lineNumber`,`columnNumber`,`function`,`evalOrigin`].forEach(function(e){t.prototype[e]=null,t.prototype[`get`+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}}),[`topLevel`,`eval`,`native`,`constructor`].forEach(function(e){t.prototype[e]=!1,t.prototype[`is`+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}}),e._createParsedCallSite=function(e){return new t(e)}})),Ro=t(((e,t)=>{let{Writable:n}=po();t.exports=class extends n{constructor(e){if(super({objectMode:!0}),!e)throw Error(`ExceptionStream requires a TransportStream instance.`);this.handleExceptions=!0,this.transport=e}_write(e,t,n){return e.exception?this.transport.log(e,n):(n(),!0)}}})),zo=t(((e,t)=>{let n=s(`os`),r=Po(),i=wo()(`winston:exception`),a=Io(),o=Lo(),c=Ro();t.exports=class{constructor(e){if(!e)throw Error(`Logger is required to handle exceptions`);this.logger=e,this.handlers=new Map}handle(...e){e.forEach(e=>{if(Array.isArray(e))return e.forEach(e=>this._addHandler(e));this._addHandler(e)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on(`uncaughtException`,this.catcher))}unhandle(){this.catcher&&(process.removeListener(`uncaughtException`,this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let t=null;return e&&(t=typeof e==`string`?e:e.message),{error:e,level:`error`,message:[`uncaughtException: ${t||`(no error message)`}`,e&&e.stack||` No stack trace`].join(`
13
- `),stack:e&&e.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:n.loadavg(),uptime:n.uptime()}}getTrace(e){return(e?o.parse(e):o.get()).map(e=>({column:e.getColumnNumber(),file:e.getFileName(),function:e.getFunctionName(),line:e.getLineNumber(),method:e.getMethodName(),native:e.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleExceptions=!0;let t=new c(e);this.handlers.set(e,t),this.logger.pipe(t)}}_uncaughtException(e){let t=this.getAllInfo(e),n=this._getExceptionHandlers(),o=typeof this.logger.exitOnError==`function`?this.logger.exitOnError(e):this.logger.exitOnError,s;!n.length&&o&&(console.warn(`winston: exitOnError cannot be true with no exception handlers.`),console.warn(`winston: not exiting process.`),o=!1);function c(){i(`doExit`,o),i(`process._exiting`,process._exiting),o&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(c);r(n,(e,t)=>{let n=a(t),r=e.transport||e;function o(e){return()=>{i(e),n()}}r._ending=!0,r.once(`finish`,o(`finished`)),r.once(`error`,o(`error`))},()=>o&&c()),this.logger.log(t),o&&(s=setTimeout(c,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleExceptions)}}})),Bo=t(((e,t)=>{let{Writable:n}=po();t.exports=class extends n{constructor(e){if(super({objectMode:!0}),!e)throw Error(`RejectionStream requires a TransportStream instance.`);this.handleRejections=!0,this.transport=e}_write(e,t,n){return e.rejection?this.transport.log(e,n):(n(),!0)}}})),Vo=t(((e,t)=>{let n=s(`os`),r=Po(),i=wo()(`winston:rejection`),a=Io(),o=Lo(),c=Bo();t.exports=class{constructor(e){if(!e)throw Error(`Logger is required to handle rejections`);this.logger=e,this.handlers=new Map}handle(...e){e.forEach(e=>{if(Array.isArray(e))return e.forEach(e=>this._addHandler(e));this._addHandler(e)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on(`unhandledRejection`,this.catcher))}unhandle(){this.catcher&&(process.removeListener(`unhandledRejection`,this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let t=null;return e&&(t=typeof e==`string`?e:e.message),{error:e,level:`error`,message:[`unhandledRejection: ${t||`(no error message)`}`,e&&e.stack||` No stack trace`].join(`
14
- `),stack:e&&e.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:n.loadavg(),uptime:n.uptime()}}getTrace(e){return(e?o.parse(e):o.get()).map(e=>({column:e.getColumnNumber(),file:e.getFileName(),function:e.getFunctionName(),line:e.getLineNumber(),method:e.getMethodName(),native:e.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleRejections=!0;let t=new c(e);this.handlers.set(e,t),this.logger.pipe(t)}}_unhandledRejection(e){let t=this.getAllInfo(e),n=this._getRejectionHandlers(),o=typeof this.logger.exitOnError==`function`?this.logger.exitOnError(e):this.logger.exitOnError,s;!n.length&&o&&(console.warn(`winston: exitOnError cannot be true with no rejection handlers.`),console.warn(`winston: not exiting process.`),o=!1);function c(){i(`doExit`,o),i(`process._exiting`,process._exiting),o&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(c);r(n,(e,t)=>{let n=a(t),r=e.transport||e;function o(e){return()=>{i(e),n()}}r._ending=!0,r.once(`finish`,o(`finished`)),r.once(`error`,o(`error`))},()=>o&&c()),this.logger.log(t),o&&(s=setTimeout(c,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleRejections)}}})),Ho=t(((e,t)=>{t.exports=class{constructor(e){let t=Uo();if(typeof e!=`object`||Array.isArray(e)||!(e instanceof t))throw Error(`Logger is required for profiling`);this.logger=e,this.start=Date.now()}done(...e){typeof e[e.length-1]==`function`&&(console.warn(`Callback function no longer supported as of winston@3.0.0`),e.pop());let t=typeof e[e.length-1]==`object`?e.pop():{};return t.level=t.level||`info`,t.durationMs=Date.now()-this.start,this.logger.write(t)}}})),Uo=t(((e,t)=>{let{Stream:n,Transform:r}=po(),i=Po(),{LEVEL:a,SPLAT:o}=G(),s=Oo(),c=zo(),l=Vo(),u=Ua(),d=Ho(),{warn:f}=wa(),p=jo(),m=/%[scdjifoO%]/g;var h=class extends r{constructor(e){super({objectMode:!0}),this.configure(e)}child(e){let t=this;return Object.create(t,{write:{value:function(n){let r=Object.assign({},e,n);n instanceof Error&&(r.stack=n.stack,r.message=n.message,r.cause=n.cause),t.write(r)}}})}configure({silent:e,format:t,defaultMeta:n,levels:r,level:i=`info`,exitOnError:a=!0,transports:o,colors:s,emitErrs:u,formatters:d,padLevels:f,rewriters:m,stripColors:h,exceptionHandlers:g,rejectionHandlers:_}={}){if(this.transports.length&&this.clear(),this.silent=e,this.format=t||this.format||ua()(),this.defaultMeta=n||null,this.levels=r||this.levels||p.npm.levels,this.level=i,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new c(this),this.rejections=new l(this),this.profilers={},this.exitOnError=a,o&&(o=Array.isArray(o)?o:[o],o.forEach(e=>this.add(e))),s||u||d||f||m||h)throw Error([`{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.`,`Use a custom winston.format(function) instead.`,`See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md`].join(`
10
+ var n=s(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),Ia=t((e=>{var t=Fa().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:case`raw`:return!0;default:return!1}};function r(e){if(!e)return`utf8`;for(var t;;)switch(e){case`utf8`:case`utf-8`:return`utf8`;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return`utf16le`;case`latin1`:case`binary`:return`latin1`;case`base64`:case`ascii`:case`hex`:return e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||``},a.prototype.end=d,a.prototype.text=u,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):``}})),La=t(((e,t)=>{var n=Aa().codes.ERR_STREAM_PREMATURE_CLOSE;function r(e){var t=!1;return function(){if(!t){t=!0;var n=[...arguments];e.apply(this,n)}}}function i(){}function a(e){return e.setHeader&&typeof e.abort==`function`}function o(e,t,s){if(typeof t==`function`)return o(e,null,t);t||={},s=r(s||i);var c=t.readable||t.readable!==!1&&e.readable,l=t.writable||t.writable!==!1&&e.writable,u=function(){e.writable||f()},d=e._writableState&&e._writableState.finished,f=function(){l=!1,d=!0,c||s.call(e)},p=e._readableState&&e._readableState.endEmitted,m=function(){c=!1,p=!0,l||s.call(e)},h=function(t){s.call(e,t)},g=function(){var t;if(c&&!p)return(!e._readableState||!e._readableState.ended)&&(t=new n),s.call(e,t);if(l&&!d)return(!e._writableState||!e._writableState.ended)&&(t=new n),s.call(e,t)},_=function(){e.req.on(`finish`,f)};return a(e)?(e.on(`complete`,f),e.on(`abort`,g),e.req?_():e.on(`request`,_)):l&&!e._writableState&&(e.on(`end`,u),e.on(`close`,u)),e.on(`end`,m),e.on(`finish`,f),t.error!==!1&&e.on(`error`,h),e.on(`close`,g),function(){e.removeListener(`complete`,f),e.removeListener(`abort`,g),e.removeListener(`request`,_),e.req&&e.req.removeListener(`finish`,f),e.removeListener(`end`,u),e.removeListener(`close`,u),e.removeListener(`finish`,f),e.removeListener(`end`,m),e.removeListener(`error`,h),e.removeListener(`close`,g)}}t.exports=o})),Ra=t(((e,t)=>{var n;function r(e,t,n){return t=i(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t=a(e,`string`);return typeof t==`symbol`?t:String(t)}function a(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var o=La(),s=Symbol(`lastResolve`),c=Symbol(`lastReject`),l=Symbol(`error`),u=Symbol(`ended`),d=Symbol(`lastPromise`),f=Symbol(`handlePromise`),p=Symbol(`stream`);function m(e,t){return{value:e,done:t}}function h(e){var t=e[s];if(t!==null){var n=e[p].read();n!==null&&(e[d]=null,e[s]=null,e[c]=null,t(m(n,!1)))}}function g(e){process.nextTick(h,e)}function _(e,t){return function(n,r){e.then(function(){if(t[u]){n(m(void 0,!0));return}t[f](n,r)},r)}}var v=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(t!==null)return Promise.reject(t);if(this[u])return Promise.resolve(m(void 0,!0));if(this[p].destroyed)return new Promise(function(t,n){process.nextTick(function(){e[l]?n(e[l]):t(m(void 0,!0))})});var n=this[d],r;if(n)r=new Promise(_(n,this));else{var i=this[p].read();if(i!==null)return Promise.resolve(m(i,!1));r=new Promise(this[f])}return this[d]=r,r}},r(n,Symbol.asyncIterator,function(){return this}),r(n,`return`,function(){var e=this;return new Promise(function(t,n){e[p].destroy(null,function(e){if(e){n(e);return}t(m(void 0,!0))})})}),n),v);t.exports=function(e){var t,n=Object.create(y,(t={},r(t,p,{value:e,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,l,{value:null,writable:!0}),r(t,u,{value:e._readableState.endEmitted,writable:!0}),r(t,f,{value:function(e,t){var r=n[p].read();r?(n[d]=null,n[s]=null,n[c]=null,e(m(r,!1))):(n[s]=e,n[c]=t)},writable:!0}),t));return n[d]=null,o(e,function(e){if(e&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`){var t=n[c];t!==null&&(n[d]=null,n[s]=null,n[c]=null,t(e)),n[l]=e;return}var r=n[s];r!==null&&(n[d]=null,n[s]=null,n[c]=null,r(m(void 0,!0))),n[u]=!0}),e.on(`readable`,g.bind(null,n)),n}})),za=t(((e,t)=>{function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?i(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e,t,n){return t=s(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=c(e,`string`);return typeof t==`symbol`?t:String(t)}function c(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var l=Aa().codes.ERR_INVALID_ARG_TYPE;function u(e,t,n){var i;if(t&&typeof t.next==`function`)i=t;else if(t&&t[Symbol.asyncIterator])i=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])i=t[Symbol.iterator]();else throw new l(`iterable`,[`Iterable`],t);var o=new e(a({objectMode:!0},n)),s=!1;o._read=function(){s||(s=!0,c())};function c(){return u.apply(this,arguments)}function u(){return u=r(function*(){try{var e=yield i.next(),t=e.value;e.done?o.push(null):o.push(yield t)?c():s=!1}catch(e){o.destroy(e)}}),u.apply(this,arguments)}return o}t.exports=u})),Ba=t(((e,t)=>{t.exports=D;var n;D.ReadableState=E,s(`events`).EventEmitter;var r=function(e,t){return e.listeners(t).length},i=Oa(),a=s(`buffer`).Buffer,o=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function c(e){return a.from(e)}function l(e){return a.isBuffer(e)||e instanceof o}var u=s(`util`),d=u&&u.debuglog?u.debuglog(`stream`):function(){},f=Pa(),p=ka(),m=ja().getHighWaterMark,h=Aa().codes,g=h.ERR_INVALID_ARG_TYPE,_=h.ERR_STREAM_PUSH_AFTER_EOF,v=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,b,x,S;Na()(D,i);var C=p.errorOrDestroy,w=[`error`,`close`,`destroy`,`pause`,`resume`];function T(e,t,n){if(typeof e.prependListener==`function`)return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}function E(e,t,r){n||=Va(),e||={},typeof r!=`boolean`&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,`readableHighWaterMark`,r),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||`utf8`,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(b||=Ia().StringDecoder,this.decoder=new b(e.encoding),this.encoding=e.encoding)}function D(e){if(n||=Va(),!(this instanceof D))return new D(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy)),i.call(this)}Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),D.prototype.destroy=p.destroy,D.prototype._undestroy=p.undestroy,D.prototype._destroy=function(e,t){t(e)},D.prototype.push=function(e,t){var n=this._readableState,r;return n.objectMode?r=!0:typeof e==`string`&&(t||=n.defaultEncoding,t!==n.encoding&&(e=a.from(e,t),t=``),r=!0),O(this,e,t,!1,r)},D.prototype.unshift=function(e){return O(this,e,null,!0,!1)};function O(e,t,n,r,i){d(`readableAddChunk`,t);var o=e._readableState;if(t===null)o.reading=!1,te(e,o);else{var s;if(i||(s=A(o,t)),s)C(e,s);else if(o.objectMode||t&&t.length>0)if(typeof t!=`string`&&!o.objectMode&&Object.getPrototypeOf(t)!==a.prototype&&(t=c(t)),r)o.endEmitted?C(e,new y):k(e,o,t,!0);else if(o.ended)C(e,new _);else if(o.destroyed)return!1;else o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||t.length!==0?k(e,o,t,!1):P(e,o)):k(e,o,t,!1);else r||(o.reading=!1,P(e,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function k(e,t,n,r){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&ne(e)),P(e,t)}function A(e,t){var n;return!l(t)&&typeof t!=`string`&&t!==void 0&&!e.objectMode&&(n=new g(`chunk`,[`string`,`Buffer`,`Uint8Array`],t)),n}D.prototype.isPaused=function(){return this._readableState.flowing===!1},D.prototype.setEncoding=function(e){b||=Ia().StringDecoder;var t=new b(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r=``;n!==null;)r+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),r!==``&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var j=1073741824;function ee(e){return e>=j?e=j:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function M(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=ee(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}D.prototype.read=function(e){d(`read`,e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return d(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?ce(this):ne(this),null;if(e=M(e,t),e===0&&t.ended)return t.length===0&&ce(this),null;var r=t.needReadable;d(`need readable`,r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,d(`length less than watermark`,r)),t.ended||t.reading?(r=!1,d(`reading or ended`,r)):r&&(d(`do read`),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=M(n,t)));var i=e>0?L(e,t):null;return i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ce(this)),i!==null&&this.emit(`data`,i),i};function te(e,t){if(d(`onEofChunk`),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?ne(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}function ne(e){var t=e._readableState;d(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d(`emitReadable`,t.flowing),t.emittedReadable=!0,process.nextTick(N,e))}function N(e){var t=e._readableState;d(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,se(e)}function P(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(re,e,t))}function re(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var n=t.length;if(d(`maybeReadMore read 0`),e.read(0),n===t.length)break}t.readingMore=!1}D.prototype._read=function(e){C(this,new v(`_read()`))},D.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,d(`pipe count=%d opts=%j`,i.pipesCount,t);var a=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr?s:g;i.endEmitted?process.nextTick(a):n.once(`end`,a),e.on(`unpipe`,o);function o(e,t){d(`onunpipe`),e===n&&t&&t.hasUnpiped===!1&&(t.hasUnpiped=!0,u())}function s(){d(`onend`),e.end()}var c=ie(n);e.on(`drain`,c);var l=!1;function u(){d(`cleanup`),e.removeListener(`close`,m),e.removeListener(`finish`,h),e.removeListener(`drain`,c),e.removeListener(`error`,p),e.removeListener(`unpipe`,o),n.removeListener(`end`,s),n.removeListener(`end`,g),n.removeListener(`data`,f),l=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c()}n.on(`data`,f);function f(t){d(`ondata`);var r=e.write(t);d(`dest.write`,r),r===!1&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&R(i.pipes,e)!==-1)&&!l&&(d(`false write response, pause`,i.awaitDrain),i.awaitDrain++),n.pause())}function p(t){d(`onerror`,t),g(),e.removeListener(`error`,p),r(e,`error`)===0&&C(e,t)}T(e,`error`,p);function m(){e.removeListener(`finish`,h),g()}e.once(`close`,m);function h(){d(`onfinish`),e.removeListener(`close`,m),g()}e.once(`finish`,h);function g(){d(`unpipe`),n.unpipe(e)}return e.emit(`pipe`,n),i.flowing||(d(`pipe resume`),n.resume()),e};function ie(e){return function(){var t=e._readableState;d(`pipeOnDrain`,t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&r(e,`data`)&&(t.flowing=!0,se(e))}}D.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||=t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit(`unpipe`,this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit(`unpipe`,this,{hasUnpiped:!1});return this}var o=R(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),--t.pipesCount,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit(`unpipe`,this,n),this)},D.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t),r=this._readableState;return e===`data`?(r.readableListening=this.listenerCount(`readable`)>0,r.flowing!==!1&&this.resume()):e===`readable`&&!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,d(`on readable`,r.length,r.reading),r.length?ne(this):r.reading||process.nextTick(oe,this)),n},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return e===`readable`&&process.nextTick(ae,this),n},D.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&process.nextTick(ae,this),t};function ae(e){var t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount(`data`)>0&&e.resume()}function oe(e){d(`readable nexttick read 0`),e.read(0)}D.prototype.resume=function(){var e=this._readableState;return e.flowing||(d(`resume`),e.flowing=!e.readableListening,F(this,e)),e.paused=!1,this};function F(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(I,e,t))}function I(e,t){d(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),se(e),t.flowing&&!t.reading&&e.read(0)}D.prototype.pause=function(){return d(`call pause flowing=%j`,this._readableState.flowing),this._readableState.flowing!==!1&&(d(`pause`),this._readableState.flowing=!1,this.emit(`pause`)),this._readableState.paused=!0,this};function se(e){var t=e._readableState;for(d(`flow`,t.flowing);t.flowing&&e.read()!==null;);}D.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on(`end`,function(){if(d(`wrapped end`),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on(`data`,function(i){d(`wrapped data`),n.decoder&&(i=n.decoder.write(i)),!(n.objectMode&&i==null)&&(!n.objectMode&&(!i||!i.length)||t.push(i)||(r=!0,e.pause()))}),e)this[i]===void 0&&typeof e[i]==`function`&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<w.length;a++)e.on(w[a],this.emit.bind(this,w[a]));return this._read=function(t){d(`wrapped _read`,t),r&&(r=!1,e.resume())},this},typeof Symbol==`function`&&(D.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=Ra()),x(this)}),Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(D.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(D.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),D._fromList=L,Object.defineProperty(D.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function L(e,t){if(t.length===0)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function ce(e){var t=e._readableState;d(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(le,t,e))}function le(e,t){if(d(`endReadableNT`,e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit(`end`),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}typeof Symbol==`function`&&(D.from=function(e,t){return S===void 0&&(S=za()),S(D,e,t)});function R(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}})),Va=t(((e,t)=>{var n=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=c;var r=Ba(),i=Ha();Na()(c,r);for(var a=n(i.prototype),o=0;o<a.length;o++){var s=a[o];c.prototype[s]||(c.prototype[s]=i.prototype[s])}function c(e){if(!(this instanceof c))return new c(e);r.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once(`end`,l)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||process.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})})),Ha=t(((e,t)=>{t.exports=E;function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){I(t,e)}}var r;E.WritableState=w;var i={deprecate:Da()},a=Oa(),o=s(`buffer`).Buffer,c=(typeof global<`u`?global:typeof window<`u`?window:typeof self<`u`?self:{}).Uint8Array||function(){};function l(e){return o.from(e)}function u(e){return o.isBuffer(e)||e instanceof c}var d=ka(),f=ja().getHighWaterMark,p=Aa().codes,m=p.ERR_INVALID_ARG_TYPE,h=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,_=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,y=p.ERR_STREAM_NULL_VALUES,b=p.ERR_STREAM_WRITE_AFTER_END,x=p.ERR_UNKNOWN_ENCODING,S=d.errorOrDestroy;Na()(E,a);function C(){}function w(e,t,i){r||=Va(),e||={},typeof i!=`boolean`&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,`writableHighWaterMark`,i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){te(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},(function(){try{Object.defineProperty(w.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},`_writableState.buffer is deprecated. Use _writableState.getBuffer instead.`,`DEP0003`)})}catch{}})();var T;typeof Symbol==`function`&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==`function`?(T=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return T.call(this,e)?!0:this===E?e&&e._writableState instanceof w:!1}})):T=function(e){return e instanceof this};function E(e){r||=Va();var t=this instanceof r;if(!t&&!T.call(E,this))return new E(e);this._writableState=new w(e,this,t),this.writable=!0,e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final)),a.call(this)}E.prototype.pipe=function(){S(this,new _)};function D(e,t){var n=new b;S(e,n),process.nextTick(t,n)}function O(e,t,n,r){var i;return n===null?i=new y:typeof n!=`string`&&!t.objectMode&&(i=new m(`chunk`,[`string`,`Buffer`],n)),i?(S(e,i),process.nextTick(r,i),!1):!0}E.prototype.write=function(e,t,n){var r=this._writableState,i=!1,a=!r.objectMode&&u(e);return a&&!o.isBuffer(e)&&(e=l(e)),typeof t==`function`&&(n=t,t=null),a?t=`buffer`:t||=r.defaultEncoding,typeof n!=`function`&&(n=C),r.ending?D(this,n):(a||O(this,r,e,n))&&(r.pendingcb++,i=A(this,r,a,e,t,n)),i},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&P(this,e))},E.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=e.toLowerCase()),!([`hex`,`utf8`,`utf-8`,`ascii`,`binary`,`base64`,`ucs2`,`ucs-2`,`utf16le`,`utf-16le`,`raw`].indexOf((e+``).toLowerCase())>-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function k(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&typeof t==`string`&&(t=o.from(t,n)),t}Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function A(e,t,n,r,i,a){if(!n){var o=k(t,r,i);r!==o&&(n=!0,i=`buffer`,r=o)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,s,r,i,a);return c}function j(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v(`write`)):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function ee(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(oe,e,t),e._writableState.errorEmitted=!0,S(e,r)):(i(r),e._writableState.errorEmitted=!0,S(e,r),oe(e,t))}function M(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function te(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(typeof i!=`function`)throw new g;if(M(n),t)ee(e,n,r,t,i);else{var a=re(n)||e.destroyed;!a&&!n.corked&&!n.bufferProcessing&&n.bufferedRequest&&P(e,n),r?process.nextTick(ne,e,n,a,i):ne(e,n,a,i)}}function ne(e,t,n,r){n||N(e,t),t.pendingcb--,r(),oe(e,t)}function N(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`))}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,a=Array(i),o=t.corkedRequestsFree;o.entry=r;for(var s=0,c=!0;r;)a[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;a.allBuffers=c,j(e,t,!0,t.length,a,``,o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,d=r.callback;if(j(e,t,!1,t.objectMode?1:l.length,l,u,d),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}E.prototype._write=function(e,t,n){n(new h(`_write()`))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var r=this._writableState;return typeof e==`function`?(n=e,e=null,t=null):typeof t==`function`&&(n=t,t=null),e!=null&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||F(this,r,n),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function re(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function ie(e,t){e._final(function(n){t.pendingcb--,n&&S(e,n),t.prefinished=!0,e.emit(`prefinish`),oe(e,t)})}function ae(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final==`function`&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(ie,e,t)):(t.prefinished=!0,e.emit(`prefinish`)))}function oe(e,t){var n=re(t);if(n&&(ae(e,t),t.pendingcb===0&&(t.finished=!0,e.emit(`finish`),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}function F(e,t,n){t.ending=!0,oe(e,t),n&&(t.finished?process.nextTick(n):e.once(`finish`,n)),t.ended=!0,e.writable=!1}function I(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree.next=e}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=d.destroy,E.prototype._undestroy=d.undestroy,E.prototype._destroy=function(e,t){t(e)}})),Ua=t(((e,t)=>{let n=s(`util`),r=Ha(),{LEVEL:i}=G(),a=t.exports=function(e={}){r.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once(`pipe`,e=>{this.levels=e.levels,this.parent=e}),this.once(`unpipe`,e=>{e===this.parent&&(this.parent=null,this.close&&this.close())})};n.inherits(a,r),a.prototype._write=function(e,t,n){if(this.silent||e.exception===!0&&!this.handleExceptions)return n(null);let r=this.level||this.parent&&this.parent.level;if(!r||this.levels[r]>=this.levels[e[i]]){if(e&&!this.format)return this.log(e,n);let t,r;try{r=this.format.transform(Object.assign({},e),this.format.options)}catch(e){t=e}if(t||!r){if(n(),t)throw t;return}return this.log(r,n)}return this._writableState.sync=!1,n(null)},a.prototype._writev=function(e,t){if(this.logv){let n=e.filter(this._accept,this);return n.length?this.logv(n,t):t(null)}for(let n=0;n<e.length;n++){if(!this._accept(e[n]))continue;if(e[n].chunk&&!this.format){this.log(e[n].chunk,e[n].callback);continue}let r,i;try{i=this.format.transform(Object.assign({},e[n].chunk),this.format.options)}catch(e){r=e}if(r||!i){if(e[n].callback(),r)throw t(null),r}else this.log(i,e[n].callback)}return t(null)},a.prototype._accept=function(e){let t=e.chunk;if(this.silent)return!1;let n=this.level||this.parent&&this.parent.level;return!!((t.exception===!0||!n||this.levels[n]>=this.levels[t[i]])&&(this.handleExceptions||t.exception!==!0))},a.prototype._nop=function(){}})),Wa=t(((e,t)=>{let n=s(`util`),{LEVEL:r}=G(),i=Ua(),a=t.exports=function(e={}){if(i.call(this,e),!e.transport||typeof e.transport.log!=`function`)throw Error(`Invalid transport, must be an object with a log method.`);this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function t(e){this.emit(`error`,e,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=t.bind(this),this.transport.on(`error`,this.transport.__winstonError))};n.inherits(a,i),a.prototype._write=function(e,t,n){if(this.silent||e.exception===!0&&!this.handleExceptions)return n(null);(!this.level||this.levels[this.level]>=this.levels[e[r]])&&this.transport.log(e[r],e.message,e,this._nop),n(null)},a.prototype._writev=function(e,t){for(let t=0;t<e.length;t++)this._accept(e[t])&&(this.transport.log(e[t].chunk[r],e[t].chunk.message,e[t].chunk,this._nop),e[t].callback());return t(null)},a.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,`- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md`].join(`
11
+ `))},a.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener(`error`,this.transport.__winstonError),this.transport.__winstonError=null)}})),Ga=t(((e,t)=>{t.exports=Ua(),t.exports.LegacyTransportStream=Wa()})),Ka=t(((e,t)=>{let n=s(`os`),{LEVEL:r,MESSAGE:i}=G(),a=Ga();t.exports=class extends a{constructor(e={}){super(e),this.name=e.name||`console`,this.stderrLevels=this._stringArrayToSet(e.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(e.consoleWarnLevels),this.eol=typeof e.eol==`string`?e.eol:n.EOL,this.forceConsole=e.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(e,t){if(setImmediate(()=>this.emit(`logged`,e)),this.stderrLevels[e[r]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[i]}${this.eol}`):this._consoleError(e[i]),t&&t();return}else if(this.consoleWarnLevels[e[r]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[i]}${this.eol}`):this._consoleWarn(e[i]),t&&t();return}console._stdout&&!this.forceConsole?console._stdout.write(`${e[i]}${this.eol}`):this._consoleLog(e[i]),t&&t()}_stringArrayToSet(e,t){if(!e)return{};if(t||=`Cannot make set from type other than Array of string elements`,!Array.isArray(e))throw Error(t);return e.reduce((e,n)=>{if(typeof n!=`string`)throw Error(t);return e[n]=!0,e},{})}}})),qa=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){return e&&typeof e.length==`number`&&e.length>=0&&e.length%1==0}t.exports=e.default})),Ja=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return function(...t){var n=t.pop();return e.call(this,t,n)}},t.exports=e.default})),Ya=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fallback=i,e.wrap=a;var t=e.hasQueueMicrotask=typeof queueMicrotask==`function`&&queueMicrotask,n=e.hasSetImmediate=typeof setImmediate==`function`&&setImmediate,r=e.hasNextTick=typeof process==`object`&&typeof process.nextTick==`function`;function i(e){setTimeout(e,0)}function a(e){return(t,...n)=>e(()=>t(...n))}e.default=a(t?queueMicrotask:n?setImmediate:r?process.nextTick:i)})),Xa=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var n=a(Ja()),r=a(Ya()),i=Za();function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return(0,i.isAsync)(e)?function(...t){let n=t.pop();return s(e.apply(this,t),n)}:(0,n.default)(function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&typeof r.then==`function`)return s(r,n);n(null,r)})}function s(e,t){return e.then(e=>{c(t,null,e)},e=>{c(t,e&&(e instanceof Error||e.message)?e:Error(e))})}function c(e,t,n){try{e(t,n)}catch(e){(0,r.default)(e=>{throw e},e)}}t.exports=e.default})),Za=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAsyncIterable=e.isAsyncGenerator=e.isAsync=void 0;var t=n(Xa());function n(e){return e&&e.__esModule?e:{default:e}}function r(e){return e[Symbol.toStringTag]===`AsyncFunction`}function i(e){return e[Symbol.toStringTag]===`AsyncGenerator`}function a(e){return typeof e[Symbol.asyncIterator]==`function`}function o(e){if(typeof e!=`function`)throw Error(`expected a function`);return r(e)?(0,t.default)(e):e}e.default=o,e.isAsync=r,e.isAsyncGenerator=i,e.isAsyncIterable=a})),Qa=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e,t){if(t||=e.length,!t)throw Error(`arity is undefined`);function n(...n){return typeof n[t-1]==`function`?e.apply(this,n):new Promise((r,i)=>{n[t-1]=(e,...t)=>{if(e)return i(e);r(t.length>1?t:t[0])},e.apply(this,n)})}return n}t.exports=e.default})),$a=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=a(qa()),r=a(Za()),i=a(Qa());function a(e){return e&&e.__esModule?e:{default:e}}e.default=(0,i.default)((e,t,i)=>{var a=(0,n.default)(t)?[]:{};e(t,(e,t,n)=>{(0,r.default)(e)((e,...r)=>{r.length<2&&([r]=r),a[t]=r,n(e)})},e=>i(e,a))},3),t.exports=e.default})),eo=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){function t(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}t.exports=e.default})),to=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()},t.exports=e.default})),no=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var n=i(qa()),r=i(to());function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}function o(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}function s(e){var t=e?Object.keys(e):[],n=-1,r=t.length;return function i(){var a=t[++n];return a===`__proto__`?i():n<r?{value:e[a],key:a}:null}}function c(e){if((0,n.default)(e))return a(e);var t=(0,r.default)(e);return t?o(t):s(e)}t.exports=e.default})),ro=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){return function(...t){if(e===null)throw Error(`Callback was already called.`);var n=e;e=null,n.apply(this,t)}}t.exports=e.default})),io=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={},t.exports=e.default})),ao=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var n=r(io());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r,i){let a=!1,o=!1,s=!1,c=0,l=0;function u(){c>=t||s||a||(s=!0,e.next().then(({value:e,done:t})=>{if(!(o||a)){if(s=!1,t){a=!0,c<=0&&i(null);return}c++,r(e,l,d),l++,u()}}).catch(f))}function d(e,t){if(--c,!o){if(e)return f(e);if(e===!1){a=!0,o=!0;return}if(t===n.default||a&&c<=0)return a=!0,i(null);u()}}function f(e){o||(s=!1,a=!0,i(e))}u()}t.exports=e.default})),oo=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=c(eo()),r=c(no()),i=c(ro()),a=Za(),o=c(ao()),s=c(io());function c(e){return e&&e.__esModule?e:{default:e}}e.default=e=>(t,c,l)=>{if(l=(0,n.default)(l),e<=0)throw RangeError(`concurrency limit cannot be less than 1`);if(!t)return l(null);if((0,a.isAsyncGenerator)(t))return(0,o.default)(t,e,c,l);if((0,a.isAsyncIterable)(t))return(0,o.default)(t[Symbol.asyncIterator](),e,c,l);var u=(0,r.default)(t),d=!1,f=!1,p=0,m=!1;function h(e,t){if(!f)if(--p,e)d=!0,l(e);else if(e===!1)d=!0,f=!0;else if(t===s.default||d&&p<=0)return d=!0,l(null);else m||g()}function g(){for(m=!0;p<e&&!d;){var t=u();if(t===null){d=!0,p<=0&&l(null);return}p+=1,c(t.value,t.key,(0,i.default)(h))}m=!1}g()},t.exports=e.default})),so=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=a(oo()),r=a(Za()),i=a(Qa());function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,i,a){return(0,n.default)(t)(e,(0,r.default)(i),a)}e.default=(0,i.default)(o,4),t.exports=e.default})),co=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=i(so()),r=i(Qa());function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){return(0,n.default)(e,1,t,r)}e.default=(0,r.default)(a,3),t.exports=e.default})),lo=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var n=i($a()),r=i(co());function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return(0,n.default)(r.default,e,t)}t.exports=e.default})),uo=t(((e,t)=>{t.exports=l;var n=Aa().codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=n.ERR_TRANSFORM_WITH_LENGTH_0,s=Va();Na()(l,s);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(r===null)return this.emit(`error`,new i);n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);s.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function u(){var e=this;typeof this._flush==`function`&&!this._readableState.destroyed?this._flush(function(t,n){d(e,t,n)}):d(this,null,null)}l.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,n){n(new r(`_transform()`))},l.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},l.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,function(e){t(e)})};function d(e,t,n){if(t)return e.emit(`error`,t);if(n!=null&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}})),fo=t(((e,t)=>{t.exports=r;var n=uo();Na()(r,n);function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}r.prototype._transform=function(e,t,n){n(null,e)}})),po=t(((e,t)=>{var n;function r(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i=Aa().codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function c(e){return e.setHeader&&typeof e.abort==`function`}function l(e,t,i,a){a=r(a);var s=!1;e.on(`close`,function(){s=!0}),n===void 0&&(n=La()),n(e,{readable:t,writable:i},function(e){if(e)return a(e);s=!0,a()});var l=!1;return function(t){if(!s&&!l){if(l=!0,c(e))return e.abort();if(typeof e.destroy==`function`)return e.destroy();a(t||new o(`pipe`))}}}function u(e){e()}function d(e,t){return e.pipe(t)}function f(e){return!e.length||typeof e[e.length-1]!=`function`?s:e.pop()}function p(){var e=[...arguments],t=f(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new a(`streams`);var n,r=e.map(function(i,a){var o=a<e.length-1;return l(i,o,a>0,function(e){n||=e,e&&r.forEach(u),!o&&(r.forEach(u),t(n))})});return e.reduce(d)}t.exports=p})),mo=t(((e,t)=>{var n=s(`stream`);process.env.READABLE_STREAM===`disable`&&n?(t.exports=n.Readable,Object.assign(t.exports,n),t.exports.Stream=n):(e=t.exports=Ba(),e.Stream=n||e,e.Readable=e,e.Writable=Ha(),e.Duplex=Va(),e.Transform=uo(),e.PassThrough=fo(),e.finished=La(),e.pipeline=po())})),ho=t(((e,t)=>{var n=[],r=[],i=function(){};function a(e){return~n.indexOf(e)?!1:(n.push(e),!0)}function o(e){i=e}function s(e){for(var t=[],r=0;r<n.length;r++){if(n[r].async){t.push(n[r]);continue}if(n[r](e))return!0}return t.length?new Promise(function(n){Promise.all(t.map(function(t){return t(e)})).then(function(e){n(e.some(Boolean))})}):!1}function c(e){return~r.indexOf(e)?!1:(r.push(e),!0)}function l(){i.apply(i,arguments)}function u(e){for(var t=0;t<r.length;t++)e=r[t].apply(r[t],arguments);return e}function d(e,t){var n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&(e[r]=t[r]);return e}function f(e){return e.enabled=!1,e.modify=c,e.set=o,e.use=a,d(function(){return!1},e)}function p(e){function t(){var t=Array.prototype.slice.call(arguments,0);return l.call(l,e,u(t,e)),!0}return e.enabled=!0,e.modify=c,e.set=o,e.use=a,d(t,e)}t.exports=function(e){return e.introduce=d,e.enabled=s,e.process=u,e.modify=c,e.write=l,e.nope=f,e.yep=p,e.set=o,e.use=a,e}})),go=t(((e,t)=>{t.exports=ho()(function e(t,n){return n||={},n.namespace=t,n.prod=!0,n.dev=!1,n.force||e.force?e.yep(n):e.nope(n)})})),_o=t(((e,t)=>{var n={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};let r=Object.create(null);for(let e in n)Object.hasOwn(n,e)&&(r[n[e]]=e);let i={to:{},get:{}};i.get=function(e){let t=e.slice(0,3).toLowerCase(),n,r;switch(t){case`hsl`:n=i.get.hsl(e),r=`hsl`;break;case`hwb`:n=i.get.hwb(e),r=`hwb`;break;default:n=i.get.rgb(e),r=`rgb`;break}return n?{model:r,value:n}:null},i.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,c=[0,0,0,1],l,u,d;if(l=e.match(r)){for(d=l[2],l=l[1],u=0;u<3;u++){let e=u*2;c[u]=Number.parseInt(l.slice(e,e+2),16)}d&&(c[3]=Number.parseInt(d,16)/255)}else if(l=e.match(t)){for(l=l[1],d=l[3],u=0;u<3;u++)c[u]=Number.parseInt(l[u]+l[u],16);d&&(c[3]=Number.parseInt(d+d,16)/255)}else if(l=e.match(i)){for(u=0;u<3;u++)c[u]=Number.parseInt(l[u+1],10);l[4]&&(c[3]=l[5]?Number.parseFloat(l[4])*.01:Number.parseFloat(l[4]))}else if(l=e.match(o)){for(u=0;u<3;u++)c[u]=Math.round(Number.parseFloat(l[u+1])*2.55);l[4]&&(c[3]=l[5]?Number.parseFloat(l[4])*.01:Number.parseFloat(l[4]))}else if(l=e.match(s))return l[1]===`transparent`?[0,0,0,0]:Object.hasOwn(n,l[1])?(c=n[l[1]],c[3]=1,c):null;else return null;for(u=0;u<3;u++)c[u]=a(c[u],0,255);return c[3]=a(c[3],0,1),c},i.get.hsl=function(e){if(!e)return null;let t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){let e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,a(Number.parseFloat(t[2]),0,100),a(Number.parseFloat(t[3]),0,100),a(Number.isNaN(e)?1:e,0,1)]}return null},i.get.hwb=function(e){if(!e)return null;let t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){let e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,a(Number.parseFloat(t[2]),0,100),a(Number.parseFloat(t[3]),0,100),a(Number.isNaN(e)?1:e,0,1)]}return null},i.to.hex=function(...e){return`#`+o(e[0])+o(e[1])+o(e[2])+(e[3]<1?o(Math.round(e[3]*255)):``)},i.to.rgb=function(...e){return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},i.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+r+`%)`:`rgba(`+t+`%, `+n+`%, `+r+`%, `+e[3]+`)`},i.to.hsl=function(...e){return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},i.to.hwb=function(...e){let t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},i.to.keyword=function(...e){return r[e.slice(0,3)]};function a(e,t,n){return Math.min(Math.max(t,e),n)}function o(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}let s={};for(let e of Object.keys(n))s[n[e]]=e;let c={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},oklab:{channels:3,labels:[`okl`,`oka`,`okb`]},lch:{channels:3,labels:`lch`},oklch:{channels:3,labels:[`okl`,`okc`,`okh`]},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}},l=(6/29)**3;function u(e){let t=e>.0031308?1.055*e**(1/2.4)-.055:e*12.92;return Math.min(Math.max(0,t),1)}function d(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(c)){if(!(`channels`in c[e]))throw Error(`missing channels property: `+e);if(!(`labels`in c[e]))throw Error(`missing channel labels property: `+e);if(c[e].labels.length!==c[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=c[e];delete c[e].channels,delete c[e].labels,Object.defineProperty(c[e],"channels",{value:t}),Object.defineProperty(c[e],"labels",{value:n})}c.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;switch(a){case i:s=0;break;case t:s=(n-r)/o;break;case n:s=2+(r-t)/o;break;case r:s=4+(t-n)/o;break}s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},c.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};if(u===0)i=0,a=0;else{switch(a=u/l,t=d(o),n=d(s),r=d(c),l){case o:i=r-n;break;case s:i=1/3+t-r;break;case c:i=2/3+n-t;break}i<0?i+=1:i>1&&--i}return[i*360,a*100,l*100]},c.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=c.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,a*100,r*100]},c.rgb.oklab=function(e){let t=d(e[0]/255),n=d(e[1]/255),r=d(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),o=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o;return[s*100,c*100,l*100]},c.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function f(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}c.rgb.keyword=function(e){let t=s[e];if(t)return t;let r=1/0,i;for(let t of Object.keys(n)){let a=n[t],o=f(e,a);o<r&&(r=o,i=t)}return i},c.keyword.rgb=function(e){return n[e]},c.rgb.xyz=function(e){let t=d(e[0]/255),n=d(e[1]/255),r=d(e[2]/255),i=t*.4124564+n*.3575761+r*.1804375,a=t*.2126729+n*.7151522+r*.072175,o=t*.0193339+n*.119192+r*.9503041;return[i*100,a*100,o*100]},c.rgb.lab=function(e){let t=c.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>l?n**(1/3):7.787*n+16/116,r=r>l?r**(1/3):7.787*r+16/116,i=i>l?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},c.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a;if(n===0)return a=r*255,[a,a,a];let o=r<.5?r*(1+n):r+n-r*n,s=2*r-o,c=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,a=6*i<1?s+(o-s)*6*i:2*i<1?o:3*i<2?s+(o-s)*(2/3-i)*6:s,c[e]=a*255;return c},c.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},c.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},c.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},c.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},c.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},c.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2404542+n*-1.5371385+r*-.4985314,a=t*-.969266+n*1.8760108+r*.041556,o=t*.0556434+n*-.2040259+r*1.0572252,i=u(i),a=u(a),o=u(o),[i*255,a*255,o*255]},c.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>l?t**(1/3):7.787*t+16/116,n=n>l?n**(1/3):7.787*n+16/116,r=r>l?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},c.xyz.oklab=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*r),a=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*r),o=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*r),s=.2104542553*i+.793617785*a-.0040720468*o,c=1.9779984951*i-2.428592205*a+.4505937099*o,l=.0259040371*i+.7827717662*a-.808675766*o;return[s*100,c*100,l*100]},c.oklab.oklch=function(e){return c.lab.lch(e)},c.oklab.xyz=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(.999999998*t+.396337792*n+.215803758*r)**3,a=(1.000000008*t-.105561342*n-.063854175*r)**3,o=(1.000000055*t-.089484182*n-1.291485538*r)**3,s=1.227013851*i-.55779998*a+.281256149*o,c=-.040580178*i+1.11225687*a-.071676679*o,l=-.076381285*i-.421481978*a+1.58616322*o;return[s*100,c*100,l*100]},c.oklab.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=(t+.3963377774*n+.2158037573*r)**3,a=(t-.1055613458*n-.0638541728*r)**3,o=(t-.0894841775*n-1.291485548*r)**3,s=u(4.0767416621*i-3.3077115913*a+.2309699292*o),c=u(-1.2684380046*i+2.6097574011*a-.3413193965*o),l=u(-.0041960863*i-.7034186147*a+1.707614701*o);return[s*255,c*255,l*255]},c.oklch.oklab=function(e){return c.lch.lab(e)},c.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,u=o**3;return a=s>l?s:(a-16/116)/7.787,i=c>l?c:(i-16/116)/7.787,o=u>l?u:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},c.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},c.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},c.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=t===null?c.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o},c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])},c.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t>>4==n>>4&&n>>4==r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},c.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(Math.trunc(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},c.ansi256.rgb=function(e){if(e=e[0],e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},c.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.slice(t.length)+t},c.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},c.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c=o<1?a/(1-o):0;return s=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,s/=6,s%=1,[s*360,o*100,c*100]},c.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},c.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},c.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},c.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},c.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},c.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},c.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},c.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},c.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},c.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},c.gray.hsl=function(e){return[0,0,e[0]]},c.gray.hsv=c.gray.hsl,c.gray.hwb=function(e){return[0,100,e[0]]},c.gray.cmyk=function(e){return[0,0,0,e[0]]},c.gray.lab=function(e){return[e[0],0,0]},c.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.slice(n.length)+n},c.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function p(){let e={},t=Object.keys(c);for(let{length:n}=t,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function m(e){let t=p(),n=[e];for(t[e].distance=0;n.length>0;){let e=n.pop(),r=Object.keys(c[e]);for(let{length:i}=r,a=0;a<i;a++){let i=r[a],o=t[i];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(i))}}return t}function h(e,t){return function(n){return t(e(n))}}function g(e,t){let n=[t[e].parent,e],r=c[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=h(c[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}function _(e){let t=m(e),n={},r=Object.keys(t);for(let{length:e}=r,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=g(e,t))}return n}let v={},y=Object.keys(c);function b(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function x(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let{length:e}=r,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}for(let e of y){v[e]={},Object.defineProperty(v[e],"channels",{value:c[e].channels}),Object.defineProperty(v[e],"labels",{value:c[e].labels});let t=_(e),n=Object.keys(t);for(let r of n){let n=t[r];v[e][r]=x(n),v[e][r].raw=b(n)}}let S=[`keyword`,`gray`,`hex`],C={};for(let e of Object.keys(v))C[[...v[e].labels].sort().join(``)]=e;let w={};function T(e,t){if(!(this instanceof T))return new T(e,t);if(t&&t in S&&(t=null),t&&!(t in v))throw Error(`Unknown model: `+t);let n,r;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof T)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=i.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,r=v[this.model].channels,this.color=t.value.slice(0,r),this.valpha=typeof t.value[r]==`number`?t.value[r]:1}else if(e.length>0){this.model=t||`rgb`,r=v[this.model].channels;let n=Array.prototype.slice.call(e,0,r);this.color=j(n,r),this.valpha=typeof e[r]==`number`?e[r]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let r=t.sort().join(``);if(!(r in C))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=C[r];let{labels:i}=v[this.model],a=[];for(n=0;n<i.length;n++)a.push(e[i[n]]);this.color=j(a)}if(w[this.model])for(r=v[this.model].channels,n=0;n<r;n++){let e=w[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}T.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in i.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return i.to[t.model](...n)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return i.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=v[this.model],{labels:n}=v[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new T([...this.color.map(D(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new T([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:O(`rgb`,0,k(255)),green:O(`rgb`,1,k(255)),blue:O(`rgb`,2,k(255)),hue:O([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:O(`hsl`,1,k(100)),lightness:O(`hsl`,2,k(100)),saturationv:O(`hsv`,1,k(100)),value:O(`hsv`,2,k(100)),chroma:O(`hcg`,1,k(100)),gray:O(`hcg`,2,k(100)),white:O(`hwb`,1,k(100)),wblack:O(`hwb`,2,k(100)),cyan:O(`cmyk`,0,k(100)),magenta:O(`cmyk`,1,k(100)),yellow:O(`cmyk`,2,k(100)),black:O(`cmyk`,3,k(100)),x:O(`xyz`,0,k(95.047)),y:O(`xyz`,1,k(100)),z:O(`xyz`,2,k(108.833)),l:O(`lab`,0,k(100)),a:O(`lab`,1),b:O(`lab`,2),keyword(e){return e===void 0?v[this.model].keyword(this.color):new T(e)},hex(e){return e===void 0?i.to.hex(...this.rgb().round().color):new T(e)},hexa(e){if(e!==void 0)return new T(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n=`0`+n),i.to.hex(...t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return T.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,c=1-s;return T.rgb(s*n.red()+c*r.red(),s*n.green()+c*r.green(),s*n.blue()+c*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(v)){if(S.includes(e))continue;let{channels:t}=v[e];T.prototype[e]=function(...t){return this.model===e?new T(this):t.length>0?new T(t,e):new T([...A(v[this.model][e].raw(this.color)),this.valpha],e)},T[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=j(n,t)),new T(r,e)}}function E(e,t){return Number(e.toFixed(t))}function D(e){return function(t){return E(t,e)}}function O(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(w[r]||=[])[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function k(e){return function(t){return Math.max(0,Math.min(e,t))}}function A(e){return Array.isArray(e)?e:[e]}function j(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var M=ee(function(e){for(var t=0,n=0;t<e.length;n=e.charCodeAt(t++)+((n<<5)-n));var r=Math.floor(Math.abs(Math.sin(n)*1e4%1*16777216)).toString(16);return`#`+Array(6-r.length+1).join(`0`)+r});function te(e,t){let n=e.split(t||`:`),r=M(n[0]);if(!n.length)return r;for(let e=0,t=n.length-1;e<t;e++)r=T(r).mix(T(M(n[e+1]))).saturate(1).hex();return r}t.exports=te})),vo=t(((e,t)=>{function n(e,t){if(t)return new n(e).style(t);if(!(this instanceof n))return new n(e);this.text=e}n.prototype.prefix=`\x1B[`,n.prototype.suffix=`m`,n.prototype.hex=function(e){e=e[0]===`#`?e.substring(1):e,e.length===3&&(e=e.split(``),e[5]=e[2],e[4]=e[2],e[3]=e[1],e[2]=e[1],e[1]=e[0],e=e.join(``));var t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6);return[parseInt(t,16),parseInt(n,16),parseInt(r,16)]},n.prototype.rgb=function(e,t,n){var r=e/255*5,i=t/255*5,a=n/255*5;return this.ansi(r,i,a)},n.prototype.ansi=function(e,t,n){var r=Math.round(e),i=Math.round(t),a=Math.round(n);return 16+r*36+i*6+a},n.prototype.reset=function(){return this.prefix+`39;49`+this.suffix},n.prototype.style=function(e){return this.prefix+`38;5;`+this.rgb.apply(this,this.hex(e))+this.suffix+this.text+this.reset()},t.exports=n})),yo=t(((e,t)=>{var n=_o(),r=vo();t.exports=function(e,t){var i=t.namespace;return e[0]=(t.colors===!1?i+`:`:r(i+`:`,n(i)))+` `+e[0],e}})),bo=t(((e,t)=>{t.exports=function(e,t){if(!t)return!1;for(var n=t.split(/[\s,]+/),r=0;r<n.length;r++){if(t=n[r].replace(`*`,`.*?`),t.charAt(0)===`-`){if(RegExp(`^`+t.substr(1)+`$`).test(e))return!1;continue}if(RegExp(`^`+t+`$`).test(e))return!0}return!1}})),xo=t(((e,t)=>{var n=bo();t.exports=function(e){return function(t){try{return n(t,e())}catch{}return!1}}})),So=t(((e,t)=>{t.exports=xo()(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})})),Co=t(((e,t)=>{t.exports=function(e,t){try{Function.prototype.apply.call(console.log,console,t)}catch{}}})),wo=t(((e,t)=>{var n=ho(),r=s(`tty`).isatty(1),i=n(function e(t,n){return n||={},n.colors=`colors`in n?n.colors:r,n.namespace=t,n.prod=!1,n.dev=!0,!e.enabled(t)&&!(n.force||e.force)?e.nope(n):e.yep(n)});i.modify(yo()),i.use(So()),i.set(Co()),t.exports=i})),To=t(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=go():t.exports=wo()})),Eo=t(((e,t)=>{let n=s(`fs`),{StringDecoder:r}=s(`string_decoder`),{Stream:i}=mo();function a(){}t.exports=(e,t)=>{let o=Buffer.alloc(64*1024),s=new r(`utf8`),c=new i,l=``,u=0,d=0;return e.start===-1&&delete e.start,c.readable=!0,c.destroy=()=>{c.destroyed=!0,c.emit(`end`),c.emit(`close`)},n.open(e.file,`a+`,`0644`,(r,i)=>{if(r){t?t(r):c.emit(`error`,r),c.destroy();return}(function r(){if(c.destroyed){n.close(i,a);return}return n.read(i,o,0,o.length,u,(n,i)=>{if(n){t?t(n):c.emit(`error`,n),c.destroy();return}if(!i)return l&&=((e.start==null||d>e.start)&&(t?t(null,l):c.emit(`line`,l)),d++,``),setTimeout(r,1e3);let a=s.write(o.slice(0,i));t||c.emit(`data`,a),a=(l+a).split(/\n+/);let f=a.length-1,p=0;for(;p<f;p++)(e.start==null||d>e.start)&&(t?t(null,a[p]):c.emit(`line`,a[p])),d++;return l=a[f],u+=i,r()})})()}),t?c.destroy:c}})),Do=t(((e,t)=>{let n=s(`fs`),r=s(`path`),i=lo(),a=s(`zlib`),{MESSAGE:o}=G(),{Stream:c,PassThrough:l}=mo(),u=Ga(),d=To()(`winston:file`),f=s(`os`),p=Eo();t.exports=class extends u{constructor(e={}){super(e),this.name=e.name||`file`;function t(t,...n){n.slice(1).forEach(n=>{if(e[n])throw Error(`Cannot set ${n} and ${t} together`)})}if(this._stream=new l,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),e.filename||e.dirname)t(`filename or dirname`,`stream`),this._basename=this.filename=e.filename?r.basename(e.filename):`winston.log`,this.dirname=e.dirname||r.dirname(e.filename),this.options=e.options||{flags:`a`};else if(e.stream)console.warn(`options.stream will be removed in winston@4. Use winston.transports.Stream`),t(`stream`,`filename`,`maxsize`),this._dest=this._stream.pipe(this._setupStream(e.stream)),this.dirname=r.dirname(this._dest.path);else throw Error(`Cannot log to file without filename or stream.`);this.maxsize=e.maxsize||null,this.rotationFormat=e.rotationFormat||!1,this.zippedArchive=e.zippedArchive||!1,this.maxFiles=e.maxFiles||null,this.eol=typeof e.eol==`string`?e.eol:f.EOL,this.tailable=e.tailable||!1,this.lazy=e.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once(`open`,()=>{this._stream.once(`finish`,()=>this.emit(`finish`)),setImmediate(()=>this._stream.end())}):(this._stream.once(`finish`,()=>this.emit(`finish`)),setImmediate(()=>this._stream.end())))}_final(e){if(this._opening){this.once(`open`,()=>this._final(e));return}if(this._stream.end(),!this._dest||this._dest.writableFinished)return e();this._dest.once(`finish`,e),this._dest.once(`error`,e)}log(e,t=()=>{}){if(this.silent)return t(),!0;if(this._drain){this._stream.once(`drain`,()=>{this._drain=!1,this.log(e,t)});return}if(this._rotate){this._stream.once(`rotate`,()=>{this._rotate=!1,this.log(e,t)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once(`open`,()=>{this._fileExist=!0,this.log(e,t)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once(`close`,()=>{this._opening||this.open(),this.once(`open`,()=>{this.log(e,t)})});return}}let n=`${e[o]}${this.eol}`,r=Buffer.byteLength(n);function i(){if(this._size+=r,this._pendingSize-=r,d(`logged %s %s`,this._size,n),this.emit(`logged`,e),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit(`fileclosed`)});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=r,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let a=this._stream.write(n,i.bind(this));return a?t():(this._drain=!0,this._stream.once(`drain`,()=>{this._drain=!1,t()})),d(`written`,a,this._drain),this.finishIfEnding(),a}query(e,t){typeof e==`function`&&(t=e,e={}),e=f(e);let i=r.join(this.dirname,this.filename),a=``,o=[],s=0,c=n.createReadStream(i,{encoding:`utf8`});c.on(`error`,e=>{if(c.readable&&c.destroy(),t)return e.code===`ENOENT`?t(null,o):t(e)}),c.on(`data`,t=>{t=(a+t).split(/\n+/);let n=t.length-1,r=0;for(;r<n;r++)(!e.start||s>=e.start)&&l(t[r]),s++;a=t[n]}),c.on(`close`,()=>{a&&l(a,!0),e.order===`desc`&&(o=o.reverse()),t&&t(null,o)});function l(e,t){try{let t=JSON.parse(e);d(t)&&u(t)}catch(e){t||c.emit(`error`,e)}}function u(t){if(e.rows&&o.length>=e.rows&&e.order!==`desc`){c.readable&&c.destroy();return}e.fields&&(t=e.fields.reduce((e,n)=>(e[n]=t[n],e),{})),e.order===`desc`&&o.length>=e.rows&&o.shift(),o.push(t)}function d(t){if(!t||typeof t!=`object`)return;let n=new Date(t.timestamp);if(!(e.from&&n<e.from||e.until&&n>e.until||e.level&&e.level!==t.level))return!0}function f(e){return e||={},e.rows=e.rows||e.limit||10,e.start=e.start||0,e.until=e.until||new Date,typeof e.until!=`object`&&(e.until=new Date(e.until)),e.from=e.from||e.until-1440*60*1e3,typeof e.from!=`object`&&(e.from=new Date(e.from)),e.order=e.order||`desc`,e}}stream(e={}){let t=r.join(this.dirname,this.filename),n=new c;return n.destroy=p({file:t,start:e.start},(e,t)=>{if(e)return n.emit(`error`,e);try{n.emit(`data`,t),t=JSON.parse(t),n.emit(`log`,t)}catch(e){n.emit(`error`,e)}}),n}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((e,t)=>{if(e)return this.emit(`error`,e);d(`stat done: %s { size: %s }`,this.filename,t),this._size=t,this._dest=this._createStream(this._stream),this._opening=!1,this.once(`open`,()=>{this._stream.emit(`rotate`)||(this._rotate=!1)})})))}stat(e){let t=this._getFile(),i=r.join(this.dirname,t);n.stat(i,(n,r)=>{if(n&&n.code===`ENOENT`)return d(`ENOENT\xA0ok`,i),this.filename=t,e(null,0);if(n)return d(`err ${n.code} ${i}`),e(n);if(!r||this._needsNewFile(r.size))return this._incFile(()=>this.stat(e));this.filename=t,e(null,r.size)})}close(e){this._stream&&this._stream.end(()=>{e&&e(),this.emit(`flush`),this.emit(`closed`)})}_needsNewFile(e){return e||=this._size,this.maxsize&&e>=this.maxsize}_onError(e){this.emit(`error`,e)}_setupStream(e){return e.on(`error`,this._onError),e}_cleanupStream(e){return e.removeListener(`error`,this._onError),e.destroy(),e}_rotateFile(){this._incFile(()=>this.open())}_endStream(e=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),e()})):e()}_createStream(e){let t=r.join(this.dirname,this.filename);d(`create stream start`,t,this.options);let i=n.createWriteStream(t,this.options).on(`error`,e=>d(e)).on(`close`,()=>d(`close`,i.path,i.bytesWritten)).on(`open`,()=>{d(`file open ok`,t),this.emit(`open`,t),e.pipe(i),this.rotatedWhileOpening&&(this._stream=new l,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(i),e.end())});return d(`create stream ok`,t),i}_incFile(e){d(`_incFile`,this.filename);let t=r.extname(this._basename),n=r.basename(this._basename,t),a=[];this.zippedArchive&&a.push(function(e){let i=this._created>0&&!this.tailable?this._created:``;this._compressFile(r.join(this.dirname,`${n}${i}${t}`),r.join(this.dirname,`${n}${i}${t}.gz`),e)}.bind(this)),a.push(function(e){this.tailable?this._checkMaxFilesTailable(t,n,e):(this._created+=1,this._checkMaxFilesIncrementing(t,n,e))}.bind(this)),i(a,e)}_getFile(){let e=r.extname(this._basename),t=r.basename(this._basename,e),n=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${t}${n}${e}`:`${t}${e}`}_checkMaxFilesIncrementing(e,t,i){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(i);let a=this._created-this.maxFiles,o=`${t}${a===0?``:a}${e}${this.zippedArchive?`.gz`:``}`,s=r.join(this.dirname,o);n.unlink(s,i)}_checkMaxFilesTailable(e,t,a){let o=[];if(!this.maxFiles)return;let s=this.zippedArchive?`.gz`:``;for(let i=this.maxFiles-1;i>1;i--)o.push(function(i,a){let o=`${t}${i-1}${e}${s}`,c=r.join(this.dirname,o);n.exists(c,l=>{if(!l)return a(null);o=`${t}${i}${e}${s}`,n.rename(c,r.join(this.dirname,o),a)})}.bind(this,i));i(o,()=>{n.rename(r.join(this.dirname,`${t}${e}${s}`),r.join(this.dirname,`${t}1${e}${s}`),a)})}_compressFile(e,t,r){n.access(e,n.F_OK,i=>{if(i)return r();var o=a.createGzip(),s=n.createReadStream(e),c=n.createWriteStream(t);c.on(`finish`,()=>{n.unlink(e,r)}),s.pipe(o).pipe(c)})}_createLogDirIfNotExist(e){n.existsSync(e)||n.mkdirSync(e,{recursive:!0})}}})),Oo=t(((e,t)=>{let n=s(`http`),r=s(`https`),{Stream:i}=mo(),a=Ga(),{configure:o}=ua();t.exports=class extends a{constructor(e={}){super(e),this.options=e,this.name=e.name||`http`,this.ssl=!!e.ssl,this.host=e.host||`localhost`,this.port=e.port,this.auth=e.auth,this.path=e.path||``,this.maximumDepth=e.maximumDepth,this.agent=e.agent,this.headers=e.headers||{},this.headers[`content-type`]=`application/json`,this.batch=e.batch||!1,this.batchInterval=e.batchInterval||5e3,this.batchCount=e.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||=this.ssl?443:80}log(e,t){this._request(e,null,null,(t,n)=>{n&&n.statusCode!==200&&(t=Error(`Invalid HTTP Status Code: ${n.statusCode}`)),t?this.emit(`warn`,t):this.emit(`logged`,e)}),t&&setImmediate(t)}query(e,t){typeof e==`function`&&(t=e,e={}),e={method:`query`,params:this.normalizeQuery(e)};let n=e.params.auth||null;delete e.params.auth;let r=e.params.path||null;delete e.params.path,this._request(e,n,r,(e,n,r)=>{if(n&&n.statusCode!==200&&(e=Error(`Invalid HTTP Status Code: ${n.statusCode}`)),e)return t(e);if(typeof r==`string`)try{r=JSON.parse(r)}catch(e){return t(e)}t(null,r)})}stream(e={}){let t=new i;e={method:`stream`,params:e};let n=e.params.path||null;delete e.params.path;let r=e.params.auth||null;delete e.params.auth;let a=``,o=this._request(e,r,n);return t.destroy=()=>o.destroy(),o.on(`data`,e=>{e=(a+e).split(/\n+/);let n=e.length-1,r=0;for(;r<n;r++)try{t.emit(`log`,JSON.parse(e[r]))}catch(e){t.emit(`error`,e)}a=e[n]}),o.on(`error`,e=>t.emit(`error`,e)),t}_request(e,t,n,r){e||={},t||=this.auth,n=n||this.path||``,this.batch?this._doBatch(e,r,t,n):this._doRequest(e,r,t,n)}_doBatch(e,t,n,r){if(this.batchOptions.push(e),this.batchOptions.length===1){let e=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){e.batchTimeoutID=-1,e._doBatchRequest(e.batchCallback,n,r)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,n,r)}_doBatchRequest(e,t,n){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let r=this.batchOptions.slice();this.batchOptions=[],this._doRequest(r,e,t,n)}_doRequest(e,t,i,a){let s=Object.assign({},this.headers);i&&i.bearer&&(s.Authorization=`Bearer ${i.bearer}`);let c=(this.ssl?r:n).request({...this.options,method:`POST`,host:this.host,port:this.port,path:`/${a.replace(/^\//,``)}`,headers:s,auth:i&&i.username&&i.password?`${i.username}:${i.password}`:``,agent:this.agent});c.on(`error`,t),c.on(`response`,e=>e.on(`end`,()=>t(null,e)).resume());let l=o({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});c.end(Buffer.from(l(e,this.options.replacer),`utf8`))}}})),ko=t(((e,t)=>{let n=e=>typeof e==`object`&&!!e&&typeof e.pipe==`function`;n.writable=e=>n(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`,n.readable=e=>n(e)&&e.readable!==!1&&typeof e._read==`function`&&typeof e._readableState==`object`,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&typeof e._transform==`function`,t.exports=n})),Ao=t(((e,t)=>{let n=ko(),{MESSAGE:r}=G(),i=s(`os`),a=Ga();t.exports=class extends a{constructor(e={}){if(super(e),!e.stream||!n(e.stream))throw Error(`options.stream is required.`);this._stream=e.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=e.stream._writableState.objectMode,this.eol=typeof e.eol==`string`?e.eol:i.EOL}log(e,t){if(setImmediate(()=>this.emit(`logged`,e)),this.isObjectMode){this._stream.write(e),t&&t();return}this._stream.write(`${e[r]}${this.eol}`),t&&t()}}})),jo=t((e=>{Object.defineProperty(e,"Console",{configurable:!0,enumerable:!0,get(){return Ka()}}),Object.defineProperty(e,"File",{configurable:!0,enumerable:!0,get(){return Do()}}),Object.defineProperty(e,"Http",{configurable:!0,enumerable:!0,get(){return Oo()}}),Object.defineProperty(e,"Stream",{configurable:!0,enumerable:!0,get(){return Ao()}})})),Mo=t((e=>{let t=wa(),{configs:n}=G();e.cli=t.levels(n.cli),e.npm=t.levels(n.npm),e.syslog=t.levels(n.syslog),e.addColors=t.levels})),No=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=l(qa()),r=l(io()),i=l(so()),a=l(eo()),o=l(ro()),s=l(Za()),c=l(Qa());function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t,n){n=(0,a.default)(n);var i=0,s=0,{length:c}=e,l=!1;c===0&&n(null);function u(e,t){e===!1&&(l=!0),l!==!0&&(e?n(e):(++s===c||t===r.default)&&n(null))}for(;i<c;i++)t(e[i],i,(0,o.default)(u))}function d(e,t,n){return(0,i.default)(e,1/0,t,n)}function f(e,t,r){return((0,n.default)(e)?u:d)(e,(0,s.default)(t),r)}e.default=(0,c.default)(f,3),t.exports=e.default})),Po=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(e){return(t,n,r)=>e(t,r)}t.exports=e.default})),Fo=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=o(No()),r=o(Po()),i=o(Za()),a=o(Qa());function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t,a){return(0,n.default)(e,(0,r.default)((0,i.default)(t)),a)}e.default=(0,a.default)(s,3),t.exports=e.default})),Io=t(((e,t)=>{var n=Object.prototype.toString;t.exports=function(e){if(typeof e.displayName==`string`&&e.constructor.name)return e.displayName;if(typeof e.name==`string`&&e.name)return e.name;if(typeof e==`object`&&e.constructor&&typeof e.constructor.name==`string`)return e.constructor.name;var t=e.toString(),r=n.call(e).slice(8,-1);return t=r===`Function`?t.substring(t.indexOf(`(`)+1,t.indexOf(`)`)):r,t||`anonymous`}})),Lo=t(((e,t)=>{var n=Io();t.exports=function(e){var t=0,r;function i(){return t?r:(t=1,r=e.apply(this,arguments),e=null,r)}return i.displayName=n(e),i}})),Ro=t((e=>{e.get=function(t){var n=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},i=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t},Error.captureStackTrace(r,t||e.get);var a=r.stack;return Error.prepareStackTrace=i,Error.stackTraceLimit=n,a},e.parse=function(e){if(!e.stack)return[];var t=this;return e.stack.split(`
12
+ `).slice(1).map(function(e){if(e.match(/^\s*[-]{4,}$/))return t._createParsedCallSite({fileName:e,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var n=e.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(n){var r=null,i=null,a=null,o=null,s=null,c=n[5]===`native`;if(n[1]){a=n[1];var l=a.lastIndexOf(`.`);if(a[l-1]==`.`&&l--,l>0){r=a.substr(0,l),i=a.substr(l+1);var u=r.indexOf(`.Module`);u>0&&(a=a.substr(u+1),r=r.substr(0,u))}o=null}i&&(o=r,s=i),i===`<anonymous>`&&(s=null,a=null);var d={fileName:n[2]||null,lineNumber:parseInt(n[3],10)||null,functionName:a,typeName:o,methodName:s,columnNumber:parseInt(n[4],10)||null,native:c};return t._createParsedCallSite(d)}}).filter(function(e){return!!e})};function t(e){for(var t in e)this[t]=e[t]}[`this`,`typeName`,`functionName`,`methodName`,`fileName`,`lineNumber`,`columnNumber`,`function`,`evalOrigin`].forEach(function(e){t.prototype[e]=null,t.prototype[`get`+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}}),[`topLevel`,`eval`,`native`,`constructor`].forEach(function(e){t.prototype[e]=!1,t.prototype[`is`+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}}),e._createParsedCallSite=function(e){return new t(e)}})),zo=t(((e,t)=>{let{Writable:n}=mo();t.exports=class extends n{constructor(e){if(super({objectMode:!0}),!e)throw Error(`ExceptionStream requires a TransportStream instance.`);this.handleExceptions=!0,this.transport=e}_write(e,t,n){return e.exception?this.transport.log(e,n):(n(),!0)}}})),Bo=t(((e,t)=>{let n=s(`os`),r=Fo(),i=To()(`winston:exception`),a=Lo(),o=Ro(),c=zo();t.exports=class{constructor(e){if(!e)throw Error(`Logger is required to handle exceptions`);this.logger=e,this.handlers=new Map}handle(...e){e.forEach(e=>{if(Array.isArray(e))return e.forEach(e=>this._addHandler(e));this._addHandler(e)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on(`uncaughtException`,this.catcher))}unhandle(){this.catcher&&(process.removeListener(`uncaughtException`,this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let t=null;return e&&(t=typeof e==`string`?e:e.message),{error:e,level:`error`,message:[`uncaughtException: ${t||`(no error message)`}`,e&&e.stack||` No stack trace`].join(`
13
+ `),stack:e&&e.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:n.loadavg(),uptime:n.uptime()}}getTrace(e){return(e?o.parse(e):o.get()).map(e=>({column:e.getColumnNumber(),file:e.getFileName(),function:e.getFunctionName(),line:e.getLineNumber(),method:e.getMethodName(),native:e.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleExceptions=!0;let t=new c(e);this.handlers.set(e,t),this.logger.pipe(t)}}_uncaughtException(e){let t=this.getAllInfo(e),n=this._getExceptionHandlers(),o=typeof this.logger.exitOnError==`function`?this.logger.exitOnError(e):this.logger.exitOnError,s;!n.length&&o&&(console.warn(`winston: exitOnError cannot be true with no exception handlers.`),console.warn(`winston: not exiting process.`),o=!1);function c(){i(`doExit`,o),i(`process._exiting`,process._exiting),o&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(c);r(n,(e,t)=>{let n=a(t),r=e.transport||e;function o(e){return()=>{i(e),n()}}r._ending=!0,r.once(`finish`,o(`finished`)),r.once(`error`,o(`error`))},()=>o&&c()),this.logger.log(t),o&&(s=setTimeout(c,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleExceptions)}}})),Vo=t(((e,t)=>{let{Writable:n}=mo();t.exports=class extends n{constructor(e){if(super({objectMode:!0}),!e)throw Error(`RejectionStream requires a TransportStream instance.`);this.handleRejections=!0,this.transport=e}_write(e,t,n){return e.rejection?this.transport.log(e,n):(n(),!0)}}})),Ho=t(((e,t)=>{let n=s(`os`),r=Fo(),i=To()(`winston:rejection`),a=Lo(),o=Ro(),c=Vo();t.exports=class{constructor(e){if(!e)throw Error(`Logger is required to handle rejections`);this.logger=e,this.handlers=new Map}handle(...e){e.forEach(e=>{if(Array.isArray(e))return e.forEach(e=>this._addHandler(e));this._addHandler(e)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on(`unhandledRejection`,this.catcher))}unhandle(){this.catcher&&(process.removeListener(`unhandledRejection`,this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(e=>this.logger.unpipe(e)))}getAllInfo(e){let t=null;return e&&(t=typeof e==`string`?e:e.message),{error:e,level:`error`,message:[`unhandledRejection: ${t||`(no error message)`}`,e&&e.stack||` No stack trace`].join(`
14
+ `),stack:e&&e.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(e)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:n.loadavg(),uptime:n.uptime()}}getTrace(e){return(e?o.parse(e):o.get()).map(e=>({column:e.getColumnNumber(),file:e.getFileName(),function:e.getFunctionName(),line:e.getLineNumber(),method:e.getMethodName(),native:e.isNative()}))}_addHandler(e){if(!this.handlers.has(e)){e.handleRejections=!0;let t=new c(e);this.handlers.set(e,t),this.logger.pipe(t)}}_unhandledRejection(e){let t=this.getAllInfo(e),n=this._getRejectionHandlers(),o=typeof this.logger.exitOnError==`function`?this.logger.exitOnError(e):this.logger.exitOnError,s;!n.length&&o&&(console.warn(`winston: exitOnError cannot be true with no rejection handlers.`),console.warn(`winston: not exiting process.`),o=!1);function c(){i(`doExit`,o),i(`process._exiting`,process._exiting),o&&!process._exiting&&(s&&clearTimeout(s),process.exit(1))}if(!n||n.length===0)return process.nextTick(c);r(n,(e,t)=>{let n=a(t),r=e.transport||e;function o(e){return()=>{i(e),n()}}r._ending=!0,r.once(`finish`,o(`finished`)),r.once(`error`,o(`error`))},()=>o&&c()),this.logger.log(t),o&&(s=setTimeout(c,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(e=>(e.transport||e).handleRejections)}}})),Uo=t(((e,t)=>{t.exports=class{constructor(e){let t=Wo();if(typeof e!=`object`||Array.isArray(e)||!(e instanceof t))throw Error(`Logger is required for profiling`);this.logger=e,this.start=Date.now()}done(...e){typeof e[e.length-1]==`function`&&(console.warn(`Callback function no longer supported as of winston@3.0.0`),e.pop());let t=typeof e[e.length-1]==`object`?e.pop():{};return t.level=t.level||`info`,t.durationMs=Date.now()-this.start,this.logger.write(t)}}})),Wo=t(((e,t)=>{let{Stream:n,Transform:r}=mo(),i=Fo(),{LEVEL:a,SPLAT:o}=G(),s=ko(),c=Bo(),l=Ho(),u=Wa(),d=Uo(),{warn:f}=Ta(),p=Mo(),m=/%[scdjifoO%]/g;var h=class extends r{constructor(e){super({objectMode:!0}),this.configure(e)}child(e){let t=this;return Object.create(t,{write:{value:function(n){let r=Object.assign({},e,n);n instanceof Error&&(r.stack=n.stack,r.message=n.message,r.cause=n.cause),t.write(r)}}})}configure({silent:e,format:t,defaultMeta:n,levels:r,level:i=`info`,exitOnError:a=!0,transports:o,colors:s,emitErrs:u,formatters:d,padLevels:f,rewriters:m,stripColors:h,exceptionHandlers:g,rejectionHandlers:_}={}){if(this.transports.length&&this.clear(),this.silent=e,this.format=t||this.format||da()(),this.defaultMeta=n||null,this.levels=r||this.levels||p.npm.levels,this.level=i,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new c(this),this.rejections=new l(this),this.profilers={},this.exitOnError=a,o&&(o=Array.isArray(o)?o:[o],o.forEach(e=>this.add(e))),s||u||d||f||m||h)throw Error([`{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.`,`Use a custom winston.format(function) instead.`,`See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md`].join(`
15
15
  `));g&&this.exceptions.handle(g),_&&this.rejections.handle(_)}getHighestLogLevel(){let e=g(this.levels,this.level);return!this.transports||this.transports.length===0?e:this.transports.reduce((e,t)=>{let n=g(this.levels,t.level);return n!==null&&n>e?n:e},e)}isLevelEnabled(e){let t=g(this.levels,e);if(t===null)return!1;let n=g(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=t:this.transports.findIndex(e=>{let r=g(this.levels,e.level);return r===null&&(r=n),r>=t})!==-1}log(e,t,...n){if(arguments.length===1)return e[a]=e.level,this._addDefaultMeta(e),this.write(e),this;if(arguments.length===2)return t&&typeof t==`object`?(t[a]=t.level=e,this._addDefaultMeta(t),this.write(t),this):(t={[a]:e,level:e,message:t},this._addDefaultMeta(t),this.write(t),this);let[r]=n;if(typeof r==`object`&&r&&!(t&&t.match&&t.match(m))){let i=Object.assign({},this.defaultMeta,r,{[a]:e,[o]:n,level:e,message:t});return r.message&&(i.message=`${i.message} ${r.message}`),r.stack&&(i.stack=r.stack),r.cause&&(i.cause=r.cause),this.write(i),this}return this.write(Object.assign({},this.defaultMeta,{[a]:e,[o]:n,level:e,message:t})),this}_transform(e,t,n){if(this.silent)return n();e[a]||(e[a]=e.level),!this.levels[e[a]]&&this.levels[e[a]]!==0&&console.error(`[winston] Unknown logger level: %s`,e[a]),this._readableState.pipes||console.error(`[winston] Attempt to write logs with no transports, which can increase memory usage: %j`,e);try{this.push(this.format.transform(e,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(e){i(this.transports.slice(),(e,t)=>{if(!e||e.finished)return setImmediate(t);e.once(`finish`,t),e.end()},e)}add(e){let t=!s(e)||e.log.length>2?new u({transport:e}):e;if(!t._writableState||!t._writableState.objectMode)throw Error(`Transports must WritableStreams in objectMode. Set { objectMode: true }.`);return this._onEvent(`error`,t),this._onEvent(`warn`,t),this.pipe(t),e.handleExceptions&&this.exceptions.handle(),e.handleRejections&&this.rejections.handle(),this}remove(e){if(!e)return this;let t=e;return(!s(e)||e.log.length>2)&&(t=this.transports.filter(t=>t.transport===e)[0]),t&&this.unpipe(t),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit(`close`),this}setLevels(){f.deprecated(`setLevels`)}query(e,t){typeof e==`function`&&(t=e,e={}),e||={};let n={},r=Object.assign({},e.query||{});function a(t,n){e.query&&typeof t.formatQuery==`function`&&(e.query=t.formatQuery(r)),t.query(e,(r,i)=>{if(r)return n(r);typeof t.formatResults==`function`&&(i=t.formatResults(i,e.format)),n(null,i)})}function o(e,t){a(e,(r,i)=>{t&&(i=r||i,i&&(n[e.name]=i),t()),t=null})}i(this.transports.filter(e=>!!e.query),o,()=>t(null,n))}stream(e={}){let t=new n,r=[];return t._streams=r,t.destroy=()=>{let e=r.length;for(;e--;)r[e].destroy()},this.transports.filter(e=>!!e.stream).forEach(n=>{let i=n.stream(e);i&&(r.push(i),i.on(`log`,e=>{e.transport=e.transport||[],e.transport.push(n.name),t.emit(`log`,e)}),i.on(`error`,e=>{e.transport=e.transport||[],e.transport.push(n.name),t.emit(`error`,e)}))}),t}startTimer(){return new d(this)}profile(e,...t){let n=Date.now();if(this.profilers[e]){let r=this.profilers[e];delete this.profilers[e],typeof t[t.length-2]==`function`&&(console.warn(`Callback function no longer supported as of winston@3.0.0`),t.pop());let i=typeof t[t.length-1]==`object`?t.pop():{};return i.level=i.level||`info`,i.durationMs=n-r,i.message=i.message||e,this.write(i)}return this.profilers[e]=n,this}handleExceptions(...e){console.warn(`Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()`),this.exceptions.handle(...e)}unhandleExceptions(...e){console.warn(`Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()`),this.exceptions.unhandle(...e)}cli(){throw Error([`Logger.cli() was removed in winston@3.0.0`,`Use a custom winston.formats.cli() instead.`,`See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md`].join(`
16
- `))}_onEvent(e,t){function n(n){e===`error`&&!this.transports.includes(t)&&this.add(t),this.emit(e,n,t)}t[`__winston`+e]||(t[`__winston`+e]=n.bind(this),t.on(e,t[`__winston`+e]))}_addDefaultMeta(e){this.defaultMeta&&Object.assign(e,this.defaultMeta)}};function g(e,t){let n=e[t];return!n&&n!==0?null:n}Object.defineProperty(h.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}}),t.exports=h})),Wo=t(((e,t)=>{let{LEVEL:n}=G(),r=jo(),i=Uo(),a=wo()(`winston:create-logger`);function o(e){return`is`+e.charAt(0).toUpperCase()+e.slice(1)+`Enabled`}t.exports=function(e={}){e.levels=e.levels||r.npm.levels;class t extends i{constructor(e){super(e)}}let s=new t(e);return Object.keys(e.levels).forEach(function(e){if(a(`Define prototype method for "%s"`,e),e===`log`){console.warn(`Level "log" not defined: conflicts with the method "log". Use a different level name.`);return}t.prototype[e]=function(...t){let r=this||s;if(t.length===1){let[i]=t,a=i&&i.message&&i||{message:i};return a.level=a[n]=e,r._addDefaultMeta(a),r.write(a),this||s}return t.length===0?(r.log(e,``),r):r.log(e,...t)},t.prototype[o(e)]=function(){return(this||s).isLevelEnabled(e)}}),s}})),Go=t(((e,t)=>{let n=Wo();t.exports=class{constructor(e={}){this.loggers=new Map,this.options=e}add(e,t){if(!this.loggers.has(e)){t=Object.assign({},t||this.options);let r=t.transports||this.options.transports;r?t.transports=Array.isArray(r)?r.slice():[r]:t.transports=[];let i=n(t);i.on(`close`,()=>this._delete(e)),this.loggers.set(e,i)}return this.loggers.get(e)}get(e,t){return this.add(e,t)}has(e){return!!this.loggers.has(e)}close(e){if(e)return this._removeLogger(e);this.loggers.forEach((e,t)=>this._removeLogger(t))}_removeLogger(e){this.loggers.has(e)&&(this.loggers.get(e).close(),this._delete(e))}_delete(e){this.loggers.delete(e)}}})),Ko=t((e=>{let t=Ca(),{warn:n}=wa();e.version=Ta().version,e.transports=Ao(),e.config=jo(),e.addColors=t.levels,e.format=t.format,e.createLogger=Wo(),e.Logger=Uo(),e.ExceptionHandler=zo(),e.RejectionHandler=Vo(),e.Container=Go(),e.Transport=Wa(),e.loggers=new e.Container;let r=e.createLogger();Object.keys(e.config.npm.levels).concat([`log`,`query`,`stream`,`add`,`remove`,`clear`,`profile`,`startTimer`,`handleExceptions`,`unhandleExceptions`,`handleRejections`,`unhandleRejections`,`configure`,`child`]).forEach(t=>e[t]=(...e)=>r[t](...e)),Object.defineProperty(e,"level",{get(){return r.level},set(e){r.level=e}}),Object.defineProperty(e,"exceptions",{get(){return r.exceptions}}),Object.defineProperty(e,"rejections",{get(){return r.rejections}}),[`exitOnError`].forEach(t=>{Object.defineProperty(e,t,{get(){return r[t]},set(e){r[t]=e}})}),Object.defineProperty(e,"default",{get(){return{exceptionHandlers:r.exceptionHandlers,rejectionHandlers:r.rejectionHandlers,transports:r.transports}}}),n.deprecated(e,`setLevels`),n.forFunctions(e,`useFormat`,[`cli`]),n.forProperties(e,`useFormat`,[`padLevels`,`stripColors`]),n.forFunctions(e,`deprecated`,[`addRewriter`,`addFilter`,`clone`,`extend`]),n.forProperties(e,`deprecated`,[`emitErrs`,`levelLength`])}))();function qo(e){let t=new WeakSet;return JSON.stringify(e,function(e,n){if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n})}function Jo(e,t,n){let r=(0,Ko.createLogger)({format:Ko.format.combine(Ko.format.timestamp({format:`YYYY-MM-DDTHH:mm:ss.SSSZ`}),{transform:e=>{let t=[];typeof e.message==`object`?t.push(qo(e.message)):t.push(e.message);let n=e[Symbol.for(`splat`)];if(n)for(let e in n){let r=n[e];typeof r==`object`?t.push(qo(r)):t.push(r)}return e.message=t.join(` `),e}},Ko.format.errors({stack:!0}),e?Ko.format.json():Ko.format.simple(),Ko.format.label({label:n?`worker #{workerId}`:``})),level:t?`debug`:`info`,transports:[new Ko.transports.Console]}),i=e=>(...t)=>{e.apply(r,t)};console.log=i(r.info),console.info=i(r.info),console.warn=i(r.warn),console.error=i(r.error),console.debug=i(r.debug)}var Yo=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AggregationTemporality=void 0,(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(e.AggregationTemporality||={})})),Xo=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataPointType=e.InstrumentType=void 0,(function(e){e.COUNTER=`COUNTER`,e.GAUGE=`GAUGE`,e.HISTOGRAM=`HISTOGRAM`,e.UP_DOWN_COUNTER=`UP_DOWN_COUNTER`,e.OBSERVABLE_COUNTER=`OBSERVABLE_COUNTER`,e.OBSERVABLE_GAUGE=`OBSERVABLE_GAUGE`,e.OBSERVABLE_UP_DOWN_COUNTER=`OBSERVABLE_UP_DOWN_COUNTER`})(e.InstrumentType||={}),(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(e.DataPointType||={})})),Zo=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.equalsCaseInsensitive=e.binarySearchUB=e.setEquals=e.callWithTimeout=e.TimeoutError=e.instrumentationScopeId=e.hashAttributes=void 0;function t(e){let t=Object.keys(e);return t.length===0?``:(t=t.sort(),JSON.stringify(t.map(t=>[t,e[t]])))}e.hashAttributes=t;function n(e){return`${e.name}:${e.version??``}:${e.schemaUrl??``}`}e.instrumentationScopeId=n;var r=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};e.TimeoutError=r;function i(e,t){let n,i=new Promise(function(e,i){n=setTimeout(function(){i(new r(`Operation timed out.`))},t)});return Promise.race([e,i]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}e.callWithTimeout=i;function a(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}e.setEquals=a;function o(e,t){let n=0,r=e.length-1,i=e.length;for(;r>=n;){let a=n+Math.trunc((r-n)/2);e[a]<t?n=a+1:(i=a,r=a-1)}return i}e.binarySearchUB=o;function s(e,t){return e.toLowerCase()===t.toLowerCase()}e.equalsCaseInsensitive=s})),Qo=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AggregatorKind=void 0,(function(e){e[e.DROP=0]=`DROP`,e[e.SUM=1]=`SUM`,e[e.LAST_VALUE=2]=`LAST_VALUE`,e[e.HISTOGRAM=3]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=4]=`EXPONENTIAL_HISTOGRAM`})(e.AggregatorKind||={})})),$o=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DropAggregator=void 0;let t=Qo();e.DropAggregator=class{kind=t.AggregatorKind.DROP;createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,r){}}})),es=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HistogramAggregator=e.HistogramAccumulation=void 0;let t=Qo(),n=Xo(),r=Zo();function i(e){let t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var a=class{startTime;_boundaries;_recordMinMax;_current;constructor(e,t,n=!0,r=i(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=r}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=(0,r.binarySearchUB)(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};e.HistogramAccumulation=a,e.HistogramAggregator=class{kind=t.AggregatorKind.HISTOGRAM;_boundaries;_recordMinMax;constructor(e,t){this._boundaries=e,this._recordMinMax=t}createAccumulation(e){return new a(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,o=r.buckets.counts,s=Array(i.length);for(let e=0;e<i.length;e++)s[e]=i[e]+o[e];let c=1/0,l=-1/0;return this._recordMinMax&&(n.hasMinMax&&r.hasMinMax?(c=Math.min(n.min,r.min),l=Math.max(n.max,r.max)):n.hasMinMax?(c=n.min,l=n.max):r.hasMinMax&&(c=r.min,l=r.max)),new a(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:s},count:n.count+r.count,sum:n.sum+r.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||r.hasMinMax),min:c,max:l})}diff(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,o=r.buckets.counts,s=Array(i.length);for(let e=0;e<i.length;e++)s[e]=o[e]-i[e];return new a(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:s},count:r.count-n.count,sum:r.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:n.DataPointType.HISTOGRAM,dataPoints:r.map(([t,r])=>{let a=r.toPointValue(),o=e.type===n.InstrumentType.GAUGE||e.type===n.InstrumentType.UP_DOWN_COUNTER||e.type===n.InstrumentType.OBSERVABLE_GAUGE||e.type===n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:o?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}}})),ts=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Buckets=void 0,e.Buckets=class e{backing;indexBase;indexStart;indexEnd;constructor(e=new t,n=0,r=0,i=0){this.backing=e,this.indexBase=n,this.indexStart=r,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,r=0,i=0;for(let e=this.indexStart;e<=this.indexEnd;){let a=e%n;a<0&&(a+=n);for(let o=a;o<n&&r<t;o++)this._relocateBucket(i,r),r++,e++;i++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new e(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}};var t=class e{_counts;constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let r=Array(e).fill(0);r.splice(n,this._counts.length-t,...this._counts.slice(t)),r.splice(0,t,...this._counts.slice(0,t)),this._counts=r}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let r=0;r<n;r++){let n=this._counts[e+r];this._counts[e+r]=this._counts[t-r-1],this._counts[t-r-1]=n}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new e([...this._counts])}}})),ns=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSignificand=e.getNormalBase2=e.MIN_VALUE=e.MAX_NORMAL_EXPONENT=e.MIN_NORMAL_EXPONENT=e.SIGNIFICAND_WIDTH=void 0,e.SIGNIFICAND_WIDTH=52;let t=1023;e.MIN_NORMAL_EXPONENT=-1022,e.MAX_NORMAL_EXPONENT=t,e.MIN_VALUE=2**-1022;function n(e){let n=new DataView(new ArrayBuffer(8));return n.setFloat64(0,e),((n.getUint32(0)&2146435072)>>20)-t}e.getNormalBase2=n;function r(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let n=t.getUint32(0),r=t.getUint32(4);return(n&1048575)*2**32+r}e.getSignificand=r})),rs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.nextGreaterSquare=e.ldexp=void 0;function t(e,t){return e===0||e===1/0||e===-1/0||Number.isNaN(e)?e:e*2**t}e.ldexp=t;function n(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}e.nextGreaterSquare=n})),is=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MappingError=void 0,e.MappingError=class extends Error{}})),as=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExponentMapping=void 0;let t=ns(),n=rs(),r=is();e.ExponentMapping=class{_shift;constructor(e){this._shift=-e}mapToIndex(e){return e<t.MIN_VALUE?this._minNormalLowerBoundaryIndex():t.getNormalBase2(e)+this._rightShift(t.getSignificand(e)-1,t.SIGNIFICAND_WIDTH)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new r.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let i=this._maxNormalLowerBoundaryIndex();if(e>i)throw new r.MappingError(`overflow: ${e} is > maximum lower boundary: ${i}`);return n.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=t.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return t.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*2**-t)}}})),os=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LogarithmMapping=void 0;let t=ns(),n=rs(),r=is();e.LogarithmMapping=class{_scale;_scaleFactor;_inverseFactor;constructor(e){this._scale=e,this._scaleFactor=n.ldexp(Math.LOG2E,e),this._inverseFactor=n.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=t.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(t.getSignificand(e)===0)return(t.getNormalBase2(e)<<this._scale)-1;let n=Math.floor(Math.log(e)*this._scaleFactor),r=this._maxNormalLowerBoundaryIndex();return n>=r?r:n}lowerBoundary(e){let n=this._maxNormalLowerBoundaryIndex();if(e>=n){if(e===n)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new r.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`)}let i=this._minNormalLowerBoundaryIndex();if(e<=i){if(e===i)return t.MIN_VALUE;if(e===i-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new r.MappingError(`overflow: ${e} is < minimum lower boundary: ${i}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return t.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(t.MAX_NORMAL_EXPONENT+1<<this._scale)-1}}})),ss=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getMapping=void 0;let t=as(),n=os(),r=is(),i=Array.from({length:31},(e,r)=>r>10?new n.LogarithmMapping(r-10):new t.ExponentMapping(r-10));function a(e){if(e>20||e<-10)throw new r.MappingError(`expected scale >= -10 && <= 20, got: ${e}`);return i[e+10]}e.getMapping=a})),cs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExponentialHistogramAggregator=e.ExponentialHistogramAccumulation=void 0;let t=Qo(),n=Xo(),r=(c(),i(d)),a=ts(),o=ss(),s=rs();var l=class e{static combine(t,n){return new e(Math.min(t.low,n.low),Math.max(t.high,n.high))}low;high;constructor(e,t){this.low=e,this.high=t}},u=class e{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(e,t=160,n=!0,i=0,s=0,c=0,l=1/0,u=-1/0,d=new a.Buckets,f=new a.Buckets,p=(0,o.getMapping)(20)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=c,this._min=l,this._max=u,this._positive=d,this._negative=f,this._mapping=p,this._maxSize<2&&(r.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \
17
- changing to the minimum size of: 2`),this._maxSize=2)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new e(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let r=this._mapping.mapToIndex(t),i=!1,a=0,o=0;if(e.length===0?(e.indexStart=r,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):r<e.indexStart&&e.indexEnd-r>=this._maxSize?(i=!0,o=r,a=e.indexEnd):r>e.indexEnd&&r-e.indexStart>=this._maxSize&&(i=!0,o=e.indexStart,a=r),i){let e=this._changeScale(a,o);this._downscale(e),r=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,r,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let n=e.indexEnd-t;n>=e.backing.length&&this._grow(e,n+1),e.indexStart=t}else if(t>e.indexEnd){let n=t-e.indexStart;n>=e.backing.length&&this._grow(e,n+1),e.indexEnd=t}let r=t-e.indexBase;r<0&&(r+=e.backing.length),e.incrementBucket(r,n)}_grow(e,t){let n=e.backing.length,r=e.indexBase-e.indexStart,i=n-r,a=(0,s.nextGreaterSquare)(t);a>this._maxSize&&(a=this._maxSize);let o=a-r;e.backing.growTo(a,i,o)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,o.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=l.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),r=l.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(r.high,r.low))}_highLowAtScale(e,t,n){if(e.length===0)return new l(0,-1);let r=t-n;return new l(e.indexStart>>r,e.indexEnd>>r)}_mergeBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++)this._incrementIndexBy(e,i+t>>a,n.at(t))}_diffBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++){let r=(i+t>>a)-e.indexBase;r<0&&(r+=e.backing.length),e.decrementBucket(r,n.at(t))}e.trim()}};e.ExponentialHistogramAccumulation=u,e.ExponentialHistogramAggregator=class{kind=t.AggregatorKind.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(e,t){this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new u(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:n.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:r.map(([t,r])=>{let a=r.toPointValue(),o=e.type===n.InstrumentType.GAUGE||e.type===n.InstrumentType.UP_DOWN_COUNTER||e.type===n.InstrumentType.OBSERVABLE_GAUGE||e.type===n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:o?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}}})),ls=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isTracingSuppressed=e.unsuppressTracing=e.suppressTracing=void 0;let t=(0,(c(),i(d)).createContextKey)(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function n(e){return e.setValue(t,!0)}e.suppressTracing=n;function r(e){return e.deleteValue(t)}e.unsuppressTracing=r;function a(e){return e.getValue(t)===!0}e.isTracingSuppressed=a})),us=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BAGGAGE_MAX_TOTAL_LENGTH=e.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=e.BAGGAGE_MAX_NAME_VALUE_PAIRS=e.BAGGAGE_HEADER=e.BAGGAGE_ITEMS_SEPARATOR=e.BAGGAGE_PROPERTIES_SEPARATOR=e.BAGGAGE_KEY_PAIR_SEPARATOR=void 0,e.BAGGAGE_KEY_PAIR_SEPARATOR=`=`,e.BAGGAGE_PROPERTIES_SEPARATOR=`;`,e.BAGGAGE_ITEMS_SEPARATOR=`,`,e.BAGGAGE_HEADER=`baggage`,e.BAGGAGE_MAX_NAME_VALUE_PAIRS=180,e.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096,e.BAGGAGE_MAX_TOTAL_LENGTH=8192})),ds=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseKeyPairsIntoRecord=e.parsePairKeyValue=e.getKeyPairs=e.serializeKeyPairs=void 0;let t=(c(),i(d)),n=us();function r(e){return e.reduce((e,t)=>{let r=`${e}${e===``?``:n.BAGGAGE_ITEMS_SEPARATOR}${t}`;return r.length>n.BAGGAGE_MAX_TOTAL_LENGTH?e:r},``)}e.serializeKeyPairs=r;function a(e){return e.getAllEntries().map(([e,t])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(r+=n.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),r})}e.getKeyPairs=a;function o(e){if(!e)return;let r=e.indexOf(n.BAGGAGE_PROPERTIES_SEPARATOR),i=r===-1?e:e.substring(0,r),a=i.indexOf(n.BAGGAGE_KEY_PAIR_SEPARATOR);if(a<=0)return;let o=i.substring(0,a).trim(),s=i.substring(a+1).trim();if(!o||!s)return;let c,l;try{c=decodeURIComponent(o),l=decodeURIComponent(s)}catch{return}let u;if(r!==-1&&r<e.length-1){let n=e.substring(r+1);u=(0,t.baggageEntryMetadataFromString)(n)}return{key:c,value:l,metadata:u}}e.parsePairKeyValue=o;function s(e){let t={};return typeof e==`string`&&e.length>0&&e.split(n.BAGGAGE_ITEMS_SEPARATOR).forEach(e=>{let n=o(e);n!==void 0&&n.value.length>0&&(t[n.key]=n.value)}),t}e.parseKeyPairsIntoRecord=s})),fs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.W3CBaggagePropagator=void 0;let t=(c(),i(d)),n=ls(),r=us(),a=ds();e.W3CBaggagePropagator=class{inject(e,i,o){let s=t.propagation.getBaggage(e);if(!s||(0,n.isTracingSuppressed)(e))return;let c=(0,a.getKeyPairs)(s).filter(e=>e.length<=r.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,r.BAGGAGE_MAX_NAME_VALUE_PAIRS),l=(0,a.serializeKeyPairs)(c);l.length>0&&o.set(i,r.BAGGAGE_HEADER,l)}extract(e,n,i){let o=i.get(n,r.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(r.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let c={};return s.length===0||(s.split(r.BAGGAGE_ITEMS_SEPARATOR).forEach(e=>{let t=(0,a.parsePairKeyValue)(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),c[t.key]=e}}),Object.entries(c).length===0)?e:t.propagation.setBaggage(e,t.propagation.createBaggage(c))}fields(){return[r.BAGGAGE_HEADER]}}})),ps=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnchoredClock=void 0,e.AnchoredClock=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}})),ms=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAttributeValue=e.isAttributeKey=e.sanitizeAttributes=void 0;let t=(c(),i(d));function n(e){let n={};if(typeof e!=`object`||!e)return n;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;if(!r(i)){t.diag.warn(`Invalid attribute key: ${i}`);continue}let o=e[i];if(!a(o)){t.diag.warn(`Invalid attribute value set for key: ${i}`);continue}Array.isArray(o)?n[i]=o.slice():n[i]=o}return n}e.sanitizeAttributes=n;function r(e){return typeof e==`string`&&e!==``}e.isAttributeKey=r;function a(e){return e==null?!0:Array.isArray(e)?o(e):s(typeof e)}e.isAttributeValue=a;function o(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(s(e)){t=e;continue}return!1}return!1}}return!0}function s(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}})),hs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.loggingErrorHandler=void 0;let t=(c(),i(d));function n(){return e=>{t.diag.error(r(e))}}e.loggingErrorHandler=n;function r(e){return typeof e==`string`?e:JSON.stringify(a(e))}function a(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}})),gs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.globalErrorHandler=e.setGlobalErrorHandler=void 0;let t=(0,hs().loggingErrorHandler)();function n(e){t=e}e.setGlobalErrorHandler=n;function r(e){try{t(e)}catch{}}e.globalErrorHandler=r})),_s=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getStringListFromEnv=e.getBooleanFromEnv=e.getStringFromEnv=e.getNumberFromEnv=void 0;let t=(c(),i(d)),n=s(`util`);function r(e){let r=process.env[e];if(r==null||r.trim()===``)return;let i=Number(r);if(isNaN(i)){t.diag.warn(`Unknown value ${(0,n.inspect)(r)} for ${e}, expected a number, using defaults`);return}return i}e.getNumberFromEnv=r;function a(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}e.getStringFromEnv=a;function o(e){let r=process.env[e]?.trim().toLowerCase();return r==null||r===``?!1:r===`true`?!0:(r===`false`||t.diag.warn(`Unknown value ${(0,n.inspect)(r)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}e.getBooleanFromEnv=o;function l(e){return a(e)?.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}e.getStringListFromEnv=l})),vs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._globalThis=void 0,e._globalThis=globalThis})),ys=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`2.7.1`}));function K(e){let t={},n=e.length;for(let r=0;r<n;r++){let n=e[r];n&&(t[String(n).toUpperCase().replace(/[-.]/g,`_`)]=n)}return t}var bs=n((()=>{})),xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,lf,uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh,Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg,Sg,Cg,wg,Tg,Eg,Dg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg=n((()=>{bs(),xs=`aws.lambda.invoked_arn`,Ss=`db.system`,Cs=`db.connection_string`,ws=`db.user`,Ts=`db.jdbc.driver_classname`,Es=`db.name`,Ds=`db.statement`,Os=`db.operation`,ks=`db.mssql.instance_name`,As=`db.cassandra.keyspace`,js=`db.cassandra.page_size`,Ms=`db.cassandra.consistency_level`,Ns=`db.cassandra.table`,Ps=`db.cassandra.idempotence`,Fs=`db.cassandra.speculative_execution_count`,Is=`db.cassandra.coordinator.id`,Ls=`db.cassandra.coordinator.dc`,Rs=`db.hbase.namespace`,zs=`db.redis.database_index`,Bs=`db.mongodb.collection`,Vs=`db.sql.table`,Hs=`exception.type`,Us=`exception.message`,Ws=`exception.stacktrace`,Gs=`exception.escaped`,Ks=`faas.trigger`,qs=`faas.execution`,Js=`faas.document.collection`,Ys=`faas.document.operation`,Xs=`faas.document.time`,Zs=`faas.document.name`,Qs=`faas.time`,$s=`faas.cron`,ec=`faas.coldstart`,tc=`faas.invoked_name`,nc=`faas.invoked_provider`,rc=`faas.invoked_region`,ic=`net.transport`,ac=`net.peer.ip`,oc=`net.peer.port`,sc=`net.peer.name`,cc=`net.host.ip`,lc=`net.host.port`,uc=`net.host.name`,dc=`net.host.connection.type`,fc=`net.host.connection.subtype`,pc=`net.host.carrier.name`,mc=`net.host.carrier.mcc`,hc=`net.host.carrier.mnc`,gc=`net.host.carrier.icc`,_c=`peer.service`,vc=`enduser.id`,yc=`enduser.role`,bc=`enduser.scope`,xc=`thread.id`,Sc=`thread.name`,Cc=`code.function`,wc=`code.namespace`,Tc=`code.filepath`,Ec=`code.lineno`,Dc=`http.method`,Oc=`http.url`,kc=`http.target`,Ac=`http.host`,jc=`http.scheme`,Mc=`http.status_code`,Nc=`http.flavor`,Pc=`http.user_agent`,Fc=`http.request_content_length`,Ic=`http.request_content_length_uncompressed`,Lc=`http.response_content_length`,Rc=`http.response_content_length_uncompressed`,zc=`http.server_name`,Bc=`http.route`,Vc=`http.client_ip`,Hc=`aws.dynamodb.table_names`,Uc=`aws.dynamodb.consumed_capacity`,Wc=`aws.dynamodb.item_collection_metrics`,Gc=`aws.dynamodb.provisioned_read_capacity`,Kc=`aws.dynamodb.provisioned_write_capacity`,qc=`aws.dynamodb.consistent_read`,Jc=`aws.dynamodb.projection`,Yc=`aws.dynamodb.limit`,Xc=`aws.dynamodb.attributes_to_get`,Zc=`aws.dynamodb.index_name`,Qc=`aws.dynamodb.select`,$c=`aws.dynamodb.global_secondary_indexes`,el=`aws.dynamodb.local_secondary_indexes`,tl=`aws.dynamodb.exclusive_start_table`,nl=`aws.dynamodb.table_count`,rl=`aws.dynamodb.scan_forward`,il=`aws.dynamodb.segment`,al=`aws.dynamodb.total_segments`,ol=`aws.dynamodb.count`,sl=`aws.dynamodb.scanned_count`,cl=`aws.dynamodb.attribute_definitions`,ll=`aws.dynamodb.global_secondary_index_updates`,ul=`messaging.system`,dl=`messaging.destination`,fl=`messaging.destination_kind`,pl=`messaging.temp_destination`,ml=`messaging.protocol`,hl=`messaging.protocol_version`,gl=`messaging.url`,_l=`messaging.message_id`,vl=`messaging.conversation_id`,yl=`messaging.message_payload_size_bytes`,bl=`messaging.message_payload_compressed_size_bytes`,xl=`messaging.operation`,Sl=`messaging.consumer_id`,Cl=`messaging.rabbitmq.routing_key`,wl=`messaging.kafka.message_key`,Tl=`messaging.kafka.consumer_group`,El=`messaging.kafka.client_id`,Dl=`messaging.kafka.partition`,Ol=`messaging.kafka.tombstone`,kl=`rpc.system`,Al=`rpc.service`,jl=`rpc.method`,Ml=`rpc.grpc.status_code`,Nl=`rpc.jsonrpc.version`,Pl=`rpc.jsonrpc.request_id`,Fl=`rpc.jsonrpc.error_code`,Il=`rpc.jsonrpc.error_message`,Ll=`message.type`,Rl=`message.id`,zl=`message.compressed_size`,Bl=`message.uncompressed_size`,Vl=xs,Hl=Ss,Ul=Cs,Wl=ws,Gl=Ts,Kl=Es,ql=Ds,Jl=Os,Yl=ks,Xl=As,Zl=js,Ql=Ms,$l=Ns,eu=Ps,tu=Fs,nu=Is,ru=Ls,iu=Rs,au=zs,ou=Bs,su=Vs,cu=Hs,lu=Us,uu=Ws,du=Gs,fu=Ks,pu=qs,mu=Js,hu=Ys,gu=Xs,_u=Zs,vu=Qs,yu=$s,bu=ec,xu=tc,Su=nc,Cu=rc,wu=ic,Tu=ac,Eu=oc,Du=sc,Ou=cc,ku=lc,Au=uc,ju=dc,Mu=fc,Nu=pc,Pu=mc,Fu=hc,Iu=gc,Lu=_c,Ru=vc,zu=yc,Bu=bc,Vu=xc,Hu=Sc,Uu=Cc,Wu=wc,Gu=Tc,Ku=Ec,qu=Dc,Ju=Oc,Yu=kc,Xu=Ac,Zu=jc,Qu=Mc,$u=Nc,ed=Pc,td=Fc,nd=Ic,rd=Lc,id=Rc,ad=zc,od=Bc,sd=Vc,cd=Hc,ld=Uc,ud=Wc,dd=Gc,fd=Kc,pd=qc,md=Jc,hd=Yc,gd=Xc,_d=Zc,vd=Qc,yd=$c,bd=el,xd=tl,Sd=nl,Cd=rl,wd=il,Td=al,Ed=ol,Dd=sl,Od=cl,kd=ll,Ad=ul,jd=dl,Md=fl,Nd=pl,Pd=ml,Fd=hl,Id=gl,Ld=_l,Rd=vl,zd=yl,Bd=bl,Vd=xl,Hd=Sl,Ud=Cl,Wd=wl,Gd=Tl,Kd=El,qd=Dl,Jd=Ol,Yd=kl,Xd=Al,Zd=jl,Qd=Ml,$d=Nl,ef=Pl,tf=Fl,nf=Il,rf=Ll,af=Rl,of=zl,sf=Bl,cf=K([xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl]),lf=`other_sql`,uf=`mssql`,df=`mysql`,ff=`oracle`,pf=`db2`,mf=`postgresql`,hf=`redshift`,gf=`hive`,_f=`cloudscape`,vf=`hsqldb`,yf=`progress`,bf=`maxdb`,xf=`hanadb`,Sf=`ingres`,Cf=`firstsql`,wf=`edb`,Tf=`cache`,Ef=`adabas`,Df=`firebird`,Of=`derby`,kf=`filemaker`,Af=`informix`,jf=`instantdb`,Mf=`interbase`,Nf=`mariadb`,Pf=`netezza`,Ff=`pervasive`,If=`pointbase`,Lf=`sqlite`,Rf=`sybase`,zf=`teradata`,Bf=`vertica`,Vf=`h2`,Hf=`coldfusion`,Uf=`cassandra`,Wf=`hbase`,Gf=`mongodb`,Kf=`redis`,qf=`couchbase`,Jf=`couchdb`,Yf=`cosmosdb`,Xf=`dynamodb`,Zf=`neo4j`,Qf=`geode`,$f=`elasticsearch`,ep=`memcached`,tp=`cockroachdb`,np=lf,rp=uf,ip=df,ap=ff,op=mf,sp=hf,cp=gf,lp=_f,up=vf,dp=yf,fp=bf,pp=xf,mp=Sf,hp=Cf,gp=Tf,_p=Ef,vp=Df,yp=Of,bp=kf,xp=Af,Sp=jf,Cp=Mf,wp=Nf,Tp=Pf,Ep=Ff,Dp=If,Op=Lf,kp=Rf,Ap=zf,jp=Bf,Mp=Hf,Np=Uf,Pp=Wf,Fp=Gf,Ip=Kf,Lp=qf,Rp=Jf,zp=Yf,Bp=Xf,Vp=Zf,Hp=Qf,Up=$f,Wp=ep,Gp=tp,Kp=K([lf,uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp]),qp=`all`,Jp=`each_quorum`,Yp=`quorum`,Xp=`local_quorum`,Zp=`one`,Qp=`two`,$p=`three`,em=`local_one`,tm=`any`,nm=`serial`,rm=`local_serial`,im=Jp,am=Yp,om=Xp,sm=$p,cm=em,lm=nm,um=rm,dm=K([qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm]),fm=`datasource`,pm=`http`,mm=`pubsub`,hm=`timer`,gm=`other`,_m=fm,vm=pm,ym=mm,bm=hm,xm=gm,Sm=K([fm,pm,mm,hm,gm]),Cm=`insert`,wm=`edit`,Tm=`delete`,Em=Cm,Dm=wm,Om=Tm,km=K([Cm,wm,Tm]),Am=`alibaba_cloud`,jm=`aws`,Mm=`azure`,Nm=`gcp`,Pm=Am,Fm=Mm,Im=K([Am,jm,Mm,Nm]),Lm=`ip_tcp`,Rm=`ip_udp`,zm=`ip`,Bm=`unix`,Vm=`pipe`,Hm=`inproc`,Um=`other`,Wm=Lm,Gm=Rm,Km=Bm,qm=Vm,Jm=Hm,Ym=Um,Xm=K([Lm,Rm,zm,Bm,Vm,Hm,Um]),Zm=`wifi`,Qm=`wired`,$m=`cell`,eh=`unavailable`,th=`unknown`,nh=Zm,rh=Qm,ih=$m,ah=eh,oh=th,sh=K([Zm,Qm,$m,eh,th]),ch=`gprs`,lh=`edge`,uh=`umts`,dh=`cdma`,fh=`evdo_0`,ph=`evdo_a`,mh=`cdma2000_1xrtt`,hh=`hsdpa`,gh=`hsupa`,_h=`hspa`,vh=`iden`,yh=`evdo_b`,bh=`lte`,xh=`ehrpd`,Sh=`hspap`,Ch=`gsm`,wh=`td_scdma`,Th=`iwlan`,Eh=`nr`,Dh=`nrnsa`,Oh=`lte_ca`,kh=ch,Ah=lh,jh=uh,Mh=dh,Nh=fh,Ph=ph,Fh=mh,Ih=hh,Lh=gh,Rh=_h,zh=vh,Bh=yh,Vh=xh,Hh=Sh,Uh=wh,Wh=Th,Gh=Dh,Kh=Oh,qh=K([ch,lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh]),Jh=`1.0`,Yh=`1.1`,Xh=`2.0`,Zh=`SPDY`,Qh=`QUIC`,$h=Zh,eg=Qh,tg={HTTP_1_0:Jh,HTTP_1_1:Yh,HTTP_2_0:Xh,SPDY:Zh,QUIC:Qh},ng=`queue`,rg=`topic`,ig=ng,ag=rg,og=K([ng,rg]),sg=`receive`,cg=`process`,lg=sg,ug=cg,dg=K([sg,cg]),fg=0,pg=1,mg=2,hg=3,gg=4,_g=5,vg=6,yg=7,bg=8,xg=9,Sg=10,Cg=11,wg=12,Tg=13,Eg=14,Dg=15,Og=16,kg={OK:fg,CANCELLED:pg,UNKNOWN:mg,INVALID_ARGUMENT:hg,DEADLINE_EXCEEDED:gg,NOT_FOUND:_g,ALREADY_EXISTS:vg,PERMISSION_DENIED:yg,RESOURCE_EXHAUSTED:bg,FAILED_PRECONDITION:xg,ABORTED:Sg,OUT_OF_RANGE:Cg,UNIMPLEMENTED:wg,INTERNAL:Tg,UNAVAILABLE:Eg,DATA_LOSS:Dg,UNAUTHENTICATED:Og},Ag=`SENT`,jg=`RECEIVED`,Mg=Ag,Ng=jg,Pg=K([Ag,jg])})),Ig=n((()=>{Fg()})),Lg,Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_,p_,m_,h_,g_,__,v_,y_,b_,x_,S_,C_,w_,T_,E_,D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,jv,Mv,Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y,vy,yy,by,xy,Sy,Cy,wy,Ty,Ey,Dy,Oy,ky,Ay,jy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb,cb,lb,ub,db,fb,pb,mb,hb,gb,_b,vb,yb,bb,xb,Sb,Cb,wb,Tb,Eb,Db,Ob,kb,Ab,jb,Mb,Nb,Pb,Fb,Ib,Lb,Rb,zb,Bb,Vb,Hb,Ub,Wb,Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx,nx,rx,ix,ax,ox,sx,cx,lx,ux,dx,fx,px,mx,hx,gx,_x,vx,yx,bx,xx,Sx,Cx,wx,Tx,Ex,Dx,Ox,kx,Ax=n((()=>{bs(),Lg=`cloud.provider`,Rg=`cloud.account.id`,zg=`cloud.region`,Bg=`cloud.availability_zone`,Vg=`cloud.platform`,Hg=`aws.ecs.container.arn`,Ug=`aws.ecs.cluster.arn`,Wg=`aws.ecs.launchtype`,Gg=`aws.ecs.task.arn`,Kg=`aws.ecs.task.family`,qg=`aws.ecs.task.revision`,Jg=`aws.eks.cluster.arn`,Yg=`aws.log.group.names`,Xg=`aws.log.group.arns`,Zg=`aws.log.stream.names`,Qg=`aws.log.stream.arns`,$g=`container.name`,e_=`container.id`,t_=`container.runtime`,n_=`container.image.name`,r_=`container.image.tag`,i_=`deployment.environment`,a_=`device.id`,o_=`device.model.identifier`,s_=`device.model.name`,c_=`faas.name`,l_=`faas.id`,u_=`faas.version`,d_=`faas.instance`,f_=`faas.max_memory`,p_=`host.id`,m_=`host.name`,h_=`host.type`,g_=`host.arch`,__=`host.image.name`,v_=`host.image.id`,y_=`host.image.version`,b_=`k8s.cluster.name`,x_=`k8s.node.name`,S_=`k8s.node.uid`,C_=`k8s.namespace.name`,w_=`k8s.pod.uid`,T_=`k8s.pod.name`,E_=`k8s.container.name`,D_=`k8s.replicaset.uid`,O_=`k8s.replicaset.name`,k_=`k8s.deployment.uid`,A_=`k8s.deployment.name`,j_=`k8s.statefulset.uid`,M_=`k8s.statefulset.name`,N_=`k8s.daemonset.uid`,P_=`k8s.daemonset.name`,F_=`k8s.job.uid`,I_=`k8s.job.name`,L_=`k8s.cronjob.uid`,R_=`k8s.cronjob.name`,z_=`os.type`,B_=`os.description`,V_=`os.name`,H_=`os.version`,U_=`process.pid`,W_=`process.executable.name`,G_=`process.executable.path`,K_=`process.command`,q_=`process.command_line`,J_=`process.command_args`,Y_=`process.owner`,X_=`process.runtime.name`,Z_=`process.runtime.version`,Q_=`process.runtime.description`,$_=`service.name`,ev=`service.namespace`,tv=`service.instance.id`,nv=`service.version`,rv=`telemetry.sdk.name`,iv=`telemetry.sdk.language`,av=`telemetry.sdk.version`,ov=`telemetry.auto.version`,sv=`webengine.name`,cv=`webengine.version`,lv=`webengine.description`,uv=Lg,dv=Rg,fv=zg,pv=Bg,mv=Vg,hv=Hg,gv=Ug,_v=Wg,vv=Gg,yv=Kg,bv=qg,xv=Jg,Sv=Yg,Cv=Xg,wv=Zg,Tv=Qg,Ev=$g,Dv=e_,Ov=t_,kv=n_,Av=r_,jv=i_,Mv=a_,Nv=o_,Pv=s_,Fv=c_,Iv=l_,Lv=u_,Rv=d_,zv=f_,Bv=p_,Vv=m_,Hv=h_,Uv=g_,Wv=__,Gv=v_,Kv=y_,qv=b_,Jv=x_,Yv=S_,Xv=C_,Zv=w_,Qv=T_,$v=E_,ey=D_,ty=O_,ny=k_,ry=A_,iy=j_,ay=M_,oy=N_,sy=P_,cy=F_,ly=I_,uy=L_,dy=R_,fy=z_,py=B_,my=V_,hy=H_,gy=U_,_y=W_,vy=G_,yy=K_,by=q_,xy=J_,Sy=Y_,Cy=X_,wy=Z_,Ty=Q_,Ey=$_,Dy=ev,Oy=tv,ky=nv,Ay=rv,jy=iv,My=av,Ny=ov,Py=sv,Fy=cv,Iy=lv,Ly=K([Lg,Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_,p_,m_,h_,g_,__,v_,y_,b_,x_,S_,C_,w_,T_,E_,D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv]),Ry=`alibaba_cloud`,zy=`aws`,By=`azure`,Vy=`gcp`,Hy=Ry,Uy=By,Wy=K([Ry,zy,By,Vy]),Gy=`alibaba_cloud_ecs`,Ky=`alibaba_cloud_fc`,qy=`aws_ec2`,Jy=`aws_ecs`,Yy=`aws_eks`,Xy=`aws_lambda`,Zy=`aws_elastic_beanstalk`,Qy=`azure_vm`,$y=`azure_container_instances`,eb=`azure_aks`,tb=`azure_functions`,nb=`azure_app_service`,rb=`gcp_compute_engine`,ib=`gcp_cloud_run`,ab=`gcp_kubernetes_engine`,ob=`gcp_cloud_functions`,sb=`gcp_app_engine`,cb=Gy,lb=Ky,ub=qy,db=Jy,fb=Yy,pb=Xy,mb=Zy,hb=Qy,gb=$y,_b=eb,vb=tb,yb=nb,bb=rb,xb=ib,Sb=ab,Cb=ob,wb=sb,Tb=K([Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb]),Eb=`ec2`,Db=`fargate`,Ob=Db,kb=K([Eb,Db]),Ab=`amd64`,jb=`arm32`,Mb=`arm64`,Nb=`ia64`,Pb=`ppc32`,Fb=`ppc64`,Ib=`x86`,Lb=Ab,Rb=jb,zb=Mb,Bb=Nb,Vb=Pb,Hb=Fb,Ub=K([Ab,jb,Mb,Nb,Pb,Fb,Ib]),Wb=`windows`,Gb=`linux`,Kb=`darwin`,qb=`freebsd`,Jb=`netbsd`,Yb=`openbsd`,Xb=`dragonflybsd`,Zb=`hpux`,Qb=`aix`,$b=`solaris`,ex=`z_os`,tx=Wb,nx=Gb,rx=Kb,ix=qb,ax=Jb,ox=Yb,sx=Xb,cx=Zb,lx=$b,ux=ex,dx=K([Wb,Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex]),fx=`cpp`,px=`dotnet`,mx=`erlang`,hx=`go`,gx=`java`,_x=`nodejs`,vx=`php`,yx=`python`,bx=`ruby`,xx=`webjs`,Sx=px,Cx=mx,wx=gx,Tx=_x,Ex=yx,Dx=bx,Ox=xx,kx=K([fx,px,mx,hx,gx,_x,vx,yx,bx,xx])})),jx=n((()=>{Ax()})),Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx,Ux,Wx,Gx,Kx,qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS,rS,iS,aS,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC=n((()=>{Mx=`aspnetcore.diagnostics.exception.result`,Nx=`aborted`,Px=`handled`,Fx=`skipped`,Ix=`unhandled`,Lx=`aspnetcore.diagnostics.handler.type`,Rx=`aspnetcore.rate_limiting.policy`,zx=`aspnetcore.rate_limiting.result`,Bx=`acquired`,Vx=`endpoint_limiter`,Hx=`global_limiter`,Ux=`request_canceled`,Wx=`aspnetcore.request.is_unhandled`,Gx=`aspnetcore.routing.is_fallback`,Kx=`aspnetcore.routing.match_status`,qx=`failure`,Jx=`success`,Yx=`aspnetcore.user.is_authenticated`,Xx=`client.address`,Zx=`client.port`,Qx=`code.column.number`,$x=`code.file.path`,eS=`code.function.name`,tS=`code.line.number`,nS=`code.stacktrace`,rS=`db.collection.name`,iS=`db.namespace`,aS=`db.operation.batch.size`,oS=`db.operation.name`,sS=`db.query.summary`,cS=`db.query.text`,lS=`db.response.status_code`,uS=`db.stored_procedure.name`,dS=`db.system.name`,fS=`mariadb`,pS=`microsoft.sql_server`,mS=`mysql`,hS=`postgresql`,gS=`dotnet.gc.heap.generation`,_S=`gen0`,vS=`gen1`,yS=`gen2`,bS=`error.type`,xS=`_OTHER`,SS=`exception.escaped`,CS=`exception.message`,wS=`exception.stacktrace`,TS=`exception.type`,ES=e=>`http.request.header.${e}`,DS=`http.request.method`,OS=`_OTHER`,kS=`CONNECT`,AS=`DELETE`,jS=`HEAD`,MS=`OPTIONS`,NS=`PATCH`,PS=`POST`,FS=`TRACE`,IS=`http.request.method_original`,LS=`http.request.resend_count`,RS=e=>`http.response.header.${e}`,zS=`http.response.status_code`,BS=`http.route`,VS=`jvm.gc.action`,HS=`jvm.gc.name`,US=`jvm.memory.pool.name`,WS=`jvm.memory.type`,GS=`heap`,KS=`non_heap`,qS=`jvm.thread.daemon`,JS=`jvm.thread.state`,YS=`blocked`,XS=`runnable`,ZS=`terminated`,QS=`timed_waiting`,$S=`waiting`,eC=`network.local.address`,tC=`network.local.port`,nC=`network.peer.address`,rC=`network.peer.port`,iC=`network.protocol.name`,aC=`network.protocol.version`,oC=`network.transport`,sC=`pipe`,cC=`quic`,lC=`unix`,uC=`network.type`,dC=`ipv4`,fC=`ipv6`,pC=`otel.scope.name`,mC=`otel.scope.version`,hC=`otel.status_code`,gC=`ERROR`,_C=`otel.status_description`,vC=`server.address`,yC=`server.port`,bC=`service.name`,xC=`service.version`,SC=`signalr.connection.status`,CC=`app_shutdown`,wC=`normal_closure`,TC=`timeout`,EC=`signalr.transport`,DC=`long_polling`,OC=`server_sent_events`,kC=`web_sockets`,AC=`telemetry.sdk.language`,jC=`dotnet`,MC=`erlang`,NC=`java`,PC=`nodejs`,FC=`python`,IC=`ruby`,LC=`rust`,RC=`swift`,zC=`webjs`,BC=`telemetry.sdk.name`,VC=`telemetry.sdk.version`,HC=`url.fragment`,UC=`url.full`,WC=`url.path`,GC=`url.query`,KC=`url.scheme`,qC=`user_agent.original`})),YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw=n((()=>{YC=`aspnetcore.diagnostics.exceptions`,XC=`aspnetcore.rate_limiting.active_request_leases`,ZC=`aspnetcore.rate_limiting.queued_requests`,QC=`aspnetcore.rate_limiting.request.time_in_queue`,$C=`aspnetcore.rate_limiting.request_lease.duration`,ew=`aspnetcore.rate_limiting.requests`,tw=`aspnetcore.routing.match_attempts`,nw=`db.client.operation.duration`,rw=`dotnet.assembly.count`,iw=`dotnet.exceptions`,aw=`dotnet.gc.collections`,ow=`dotnet.gc.heap.total_allocated`,sw=`dotnet.gc.last_collection.heap.fragmentation.size`,cw=`dotnet.gc.last_collection.heap.size`,lw=`dotnet.gc.last_collection.memory.committed_size`,uw=`dotnet.gc.pause.time`,dw=`dotnet.jit.compilation.time`,fw=`dotnet.jit.compiled_il.size`,pw=`dotnet.jit.compiled_methods`,mw=`dotnet.monitor.lock_contentions`,hw=`dotnet.process.cpu.count`,gw=`dotnet.process.cpu.time`,_w=`dotnet.process.memory.working_set`,vw=`dotnet.thread_pool.queue.length`,yw=`dotnet.thread_pool.thread.count`,bw=`dotnet.thread_pool.work_item.count`,xw=`dotnet.timer.count`,Sw=`http.client.request.duration`,Cw=`http.server.request.duration`,ww=`jvm.class.count`,Tw=`jvm.class.loaded`,Ew=`jvm.class.unloaded`,Dw=`jvm.cpu.count`,Ow=`jvm.cpu.recent_utilization`,kw=`jvm.cpu.time`,Aw=`jvm.gc.duration`,jw=`jvm.memory.committed`,Mw=`jvm.memory.limit`,Nw=`jvm.memory.used`,Pw=`jvm.memory.used_after_last_gc`,Fw=`jvm.thread.count`,Iw=`kestrel.active_connections`,Lw=`kestrel.active_tls_handshakes`,Rw=`kestrel.connection.duration`,zw=`kestrel.queued_connections`,Bw=`kestrel.queued_requests`,Vw=`kestrel.rejected_connections`,Hw=`kestrel.tls_handshake.duration`,Uw=`kestrel.upgraded_connections`,Ww=`signalr.server.active_connections`,Gw=`signalr.server.connection.duration`})),qw,Jw=n((()=>{qw=`exception`})),Yw=l({ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Nx,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Px,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Fx,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Ix,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Bx,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Vx,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Hx,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Ux,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>qx,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Jx,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Mx,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Lx,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Rx,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>zx,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Wx,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Gx,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Kx,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Yx,ATTR_CLIENT_ADDRESS:()=>Xx,ATTR_CLIENT_PORT:()=>Zx,ATTR_CODE_COLUMN_NUMBER:()=>Qx,ATTR_CODE_FILE_PATH:()=>$x,ATTR_CODE_FUNCTION_NAME:()=>eS,ATTR_CODE_LINE_NUMBER:()=>tS,ATTR_CODE_STACKTRACE:()=>nS,ATTR_DB_COLLECTION_NAME:()=>rS,ATTR_DB_NAMESPACE:()=>iS,ATTR_DB_OPERATION_BATCH_SIZE:()=>aS,ATTR_DB_OPERATION_NAME:()=>oS,ATTR_DB_QUERY_SUMMARY:()=>sS,ATTR_DB_QUERY_TEXT:()=>cS,ATTR_DB_RESPONSE_STATUS_CODE:()=>lS,ATTR_DB_STORED_PROCEDURE_NAME:()=>uS,ATTR_DB_SYSTEM_NAME:()=>dS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>gS,ATTR_ERROR_TYPE:()=>bS,ATTR_EXCEPTION_ESCAPED:()=>SS,ATTR_EXCEPTION_MESSAGE:()=>CS,ATTR_EXCEPTION_STACKTRACE:()=>wS,ATTR_EXCEPTION_TYPE:()=>TS,ATTR_HTTP_REQUEST_HEADER:()=>ES,ATTR_HTTP_REQUEST_METHOD:()=>DS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>IS,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>LS,ATTR_HTTP_RESPONSE_HEADER:()=>RS,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>zS,ATTR_HTTP_ROUTE:()=>BS,ATTR_JVM_GC_ACTION:()=>VS,ATTR_JVM_GC_NAME:()=>HS,ATTR_JVM_MEMORY_POOL_NAME:()=>US,ATTR_JVM_MEMORY_TYPE:()=>WS,ATTR_JVM_THREAD_DAEMON:()=>qS,ATTR_JVM_THREAD_STATE:()=>JS,ATTR_NETWORK_LOCAL_ADDRESS:()=>eC,ATTR_NETWORK_LOCAL_PORT:()=>tC,ATTR_NETWORK_PEER_ADDRESS:()=>nC,ATTR_NETWORK_PEER_PORT:()=>rC,ATTR_NETWORK_PROTOCOL_NAME:()=>iC,ATTR_NETWORK_PROTOCOL_VERSION:()=>aC,ATTR_NETWORK_TRANSPORT:()=>oC,ATTR_NETWORK_TYPE:()=>uC,ATTR_OTEL_SCOPE_NAME:()=>pC,ATTR_OTEL_SCOPE_VERSION:()=>mC,ATTR_OTEL_STATUS_CODE:()=>hC,ATTR_OTEL_STATUS_DESCRIPTION:()=>_C,ATTR_SERVER_ADDRESS:()=>vC,ATTR_SERVER_PORT:()=>yC,ATTR_SERVICE_NAME:()=>bC,ATTR_SERVICE_VERSION:()=>xC,ATTR_SIGNALR_CONNECTION_STATUS:()=>SC,ATTR_SIGNALR_TRANSPORT:()=>EC,ATTR_TELEMETRY_SDK_LANGUAGE:()=>AC,ATTR_TELEMETRY_SDK_NAME:()=>BC,ATTR_TELEMETRY_SDK_VERSION:()=>VC,ATTR_URL_FRAGMENT:()=>HC,ATTR_URL_FULL:()=>UC,ATTR_URL_PATH:()=>WC,ATTR_URL_QUERY:()=>GC,ATTR_URL_SCHEME:()=>KC,ATTR_USER_AGENT_ORIGINAL:()=>qC,AWSECSLAUNCHTYPEVALUES_EC2:()=>`ec2`,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Ob,AwsEcsLaunchtypeValues:()=>kb,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>cb,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>lb,CLOUDPLATFORMVALUES_AWS_EC2:()=>ub,CLOUDPLATFORMVALUES_AWS_ECS:()=>db,CLOUDPLATFORMVALUES_AWS_EKS:()=>fb,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>mb,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>pb,CLOUDPLATFORMVALUES_AZURE_AKS:()=>_b,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>yb,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>gb,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>vb,CLOUDPLATFORMVALUES_AZURE_VM:()=>hb,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>wb,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Cb,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>xb,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>bb,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Sb,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Hy,CLOUDPROVIDERVALUES_AWS:()=>`aws`,CLOUDPROVIDERVALUES_AZURE:()=>Uy,CLOUDPROVIDERVALUES_GCP:()=>`gcp`,CloudPlatformValues:()=>Tb,CloudProviderValues:()=>Wy,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>`all`,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>`any`,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>im,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>cm,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>om,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>um,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>`one`,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>am,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>lm,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>sm,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>`two`,DBSYSTEMVALUES_ADABAS:()=>_p,DBSYSTEMVALUES_CACHE:()=>gp,DBSYSTEMVALUES_CASSANDRA:()=>Np,DBSYSTEMVALUES_CLOUDSCAPE:()=>lp,DBSYSTEMVALUES_COCKROACHDB:()=>Gp,DBSYSTEMVALUES_COLDFUSION:()=>Mp,DBSYSTEMVALUES_COSMOSDB:()=>zp,DBSYSTEMVALUES_COUCHBASE:()=>Lp,DBSYSTEMVALUES_COUCHDB:()=>Rp,DBSYSTEMVALUES_DB2:()=>`db2`,DBSYSTEMVALUES_DERBY:()=>yp,DBSYSTEMVALUES_DYNAMODB:()=>Bp,DBSYSTEMVALUES_EDB:()=>`edb`,DBSYSTEMVALUES_ELASTICSEARCH:()=>Up,DBSYSTEMVALUES_FILEMAKER:()=>bp,DBSYSTEMVALUES_FIREBIRD:()=>vp,DBSYSTEMVALUES_FIRSTSQL:()=>hp,DBSYSTEMVALUES_GEODE:()=>Hp,DBSYSTEMVALUES_H2:()=>`h2`,DBSYSTEMVALUES_HANADB:()=>pp,DBSYSTEMVALUES_HBASE:()=>Pp,DBSYSTEMVALUES_HIVE:()=>cp,DBSYSTEMVALUES_HSQLDB:()=>up,DBSYSTEMVALUES_INFORMIX:()=>xp,DBSYSTEMVALUES_INGRES:()=>mp,DBSYSTEMVALUES_INSTANTDB:()=>Sp,DBSYSTEMVALUES_INTERBASE:()=>Cp,DBSYSTEMVALUES_MARIADB:()=>wp,DBSYSTEMVALUES_MAXDB:()=>fp,DBSYSTEMVALUES_MEMCACHED:()=>Wp,DBSYSTEMVALUES_MONGODB:()=>Fp,DBSYSTEMVALUES_MSSQL:()=>rp,DBSYSTEMVALUES_MYSQL:()=>ip,DBSYSTEMVALUES_NEO4J:()=>Vp,DBSYSTEMVALUES_NETEZZA:()=>Tp,DBSYSTEMVALUES_ORACLE:()=>ap,DBSYSTEMVALUES_OTHER_SQL:()=>np,DBSYSTEMVALUES_PERVASIVE:()=>Ep,DBSYSTEMVALUES_POINTBASE:()=>Dp,DBSYSTEMVALUES_POSTGRESQL:()=>op,DBSYSTEMVALUES_PROGRESS:()=>dp,DBSYSTEMVALUES_REDIS:()=>Ip,DBSYSTEMVALUES_REDSHIFT:()=>sp,DBSYSTEMVALUES_SQLITE:()=>Op,DBSYSTEMVALUES_SYBASE:()=>kp,DBSYSTEMVALUES_TERADATA:()=>Ap,DBSYSTEMVALUES_VERTICA:()=>jp,DB_SYSTEM_NAME_VALUE_MARIADB:()=>fS,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>pS,DB_SYSTEM_NAME_VALUE_MYSQL:()=>mS,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>hS,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>_S,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>vS,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>yS,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>`loh`,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>`poh`,DbCassandraConsistencyLevelValues:()=>dm,DbSystemValues:()=>Kp,ERROR_TYPE_VALUE_OTHER:()=>xS,EVENT_EXCEPTION:()=>qw,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Om,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Dm,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Em,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Pm,FAASINVOKEDPROVIDERVALUES_AWS:()=>`aws`,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Fm,FAASINVOKEDPROVIDERVALUES_GCP:()=>`gcp`,FAASTRIGGERVALUES_DATASOURCE:()=>_m,FAASTRIGGERVALUES_HTTP:()=>vm,FAASTRIGGERVALUES_OTHER:()=>xm,FAASTRIGGERVALUES_PUBSUB:()=>ym,FAASTRIGGERVALUES_TIMER:()=>bm,FaasDocumentOperationValues:()=>km,FaasInvokedProviderValues:()=>Im,FaasTriggerValues:()=>Sm,HOSTARCHVALUES_AMD64:()=>Lb,HOSTARCHVALUES_ARM32:()=>Rb,HOSTARCHVALUES_ARM64:()=>zb,HOSTARCHVALUES_IA64:()=>Bb,HOSTARCHVALUES_PPC32:()=>Vb,HOSTARCHVALUES_PPC64:()=>Hb,HOSTARCHVALUES_X86:()=>`x86`,HTTPFLAVORVALUES_HTTP_1_0:()=>`1.0`,HTTPFLAVORVALUES_HTTP_1_1:()=>`1.1`,HTTPFLAVORVALUES_HTTP_2_0:()=>`2.0`,HTTPFLAVORVALUES_QUIC:()=>eg,HTTPFLAVORVALUES_SPDY:()=>$h,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>kS,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>AS,HTTP_REQUEST_METHOD_VALUE_GET:()=>`GET`,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>jS,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>MS,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>OS,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>NS,HTTP_REQUEST_METHOD_VALUE_POST:()=>PS,HTTP_REQUEST_METHOD_VALUE_PUT:()=>`PUT`,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>FS,HostArchValues:()=>Ub,HttpFlavorValues:()=>tg,JVM_MEMORY_TYPE_VALUE_HEAP:()=>GS,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>KS,JVM_THREAD_STATE_VALUE_BLOCKED:()=>YS,JVM_THREAD_STATE_VALUE_NEW:()=>`new`,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>XS,JVM_THREAD_STATE_VALUE_TERMINATED:()=>ZS,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>QS,JVM_THREAD_STATE_VALUE_WAITING:()=>$S,MESSAGETYPEVALUES_RECEIVED:()=>Ng,MESSAGETYPEVALUES_SENT:()=>Mg,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>ig,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>ag,MESSAGINGOPERATIONVALUES_PROCESS:()=>ug,MESSAGINGOPERATIONVALUES_RECEIVE:()=>lg,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>YC,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>XC,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>ZC,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>ew,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>$C,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>QC,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>tw,METRIC_DB_CLIENT_OPERATION_DURATION:()=>nw,METRIC_DOTNET_ASSEMBLY_COUNT:()=>rw,METRIC_DOTNET_EXCEPTIONS:()=>iw,METRIC_DOTNET_GC_COLLECTIONS:()=>aw,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>ow,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>sw,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>cw,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>lw,METRIC_DOTNET_GC_PAUSE_TIME:()=>uw,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>dw,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>fw,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>pw,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>mw,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>hw,METRIC_DOTNET_PROCESS_CPU_TIME:()=>gw,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>_w,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>vw,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>yw,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>bw,METRIC_DOTNET_TIMER_COUNT:()=>xw,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Sw,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Cw,METRIC_JVM_CLASS_COUNT:()=>ww,METRIC_JVM_CLASS_LOADED:()=>Tw,METRIC_JVM_CLASS_UNLOADED:()=>Ew,METRIC_JVM_CPU_COUNT:()=>Dw,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Ow,METRIC_JVM_CPU_TIME:()=>kw,METRIC_JVM_GC_DURATION:()=>Aw,METRIC_JVM_MEMORY_COMMITTED:()=>jw,METRIC_JVM_MEMORY_LIMIT:()=>Mw,METRIC_JVM_MEMORY_USED:()=>Nw,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Pw,METRIC_JVM_THREAD_COUNT:()=>Fw,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Iw,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Lw,METRIC_KESTREL_CONNECTION_DURATION:()=>Rw,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>zw,METRIC_KESTREL_QUEUED_REQUESTS:()=>Bw,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Vw,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Hw,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Uw,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Ww,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Gw,MessageTypeValues:()=>Pg,MessagingDestinationKindValues:()=>og,MessagingOperationValues:()=>dg,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Mh,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Fh,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Ah,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Vh,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Nh,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Ph,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Bh,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>kh,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>`gsm`,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Ih,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Rh,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Hh,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Lh,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>zh,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Wh,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>`lte`,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Kh,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>`nr`,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Gh,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Uh,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>jh,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>ih,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>ah,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>oh,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>nh,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>rh,NETTRANSPORTVALUES_INPROC:()=>Jm,NETTRANSPORTVALUES_IP:()=>`ip`,NETTRANSPORTVALUES_IP_TCP:()=>Wm,NETTRANSPORTVALUES_IP_UDP:()=>Gm,NETTRANSPORTVALUES_OTHER:()=>Ym,NETTRANSPORTVALUES_PIPE:()=>qm,NETTRANSPORTVALUES_UNIX:()=>Km,NETWORK_TRANSPORT_VALUE_PIPE:()=>sC,NETWORK_TRANSPORT_VALUE_QUIC:()=>cC,NETWORK_TRANSPORT_VALUE_TCP:()=>`tcp`,NETWORK_TRANSPORT_VALUE_UDP:()=>`udp`,NETWORK_TRANSPORT_VALUE_UNIX:()=>lC,NETWORK_TYPE_VALUE_IPV4:()=>dC,NETWORK_TYPE_VALUE_IPV6:()=>fC,NetHostConnectionSubtypeValues:()=>qh,NetHostConnectionTypeValues:()=>sh,NetTransportValues:()=>Xm,OSTYPEVALUES_AIX:()=>`aix`,OSTYPEVALUES_DARWIN:()=>rx,OSTYPEVALUES_DRAGONFLYBSD:()=>sx,OSTYPEVALUES_FREEBSD:()=>ix,OSTYPEVALUES_HPUX:()=>cx,OSTYPEVALUES_LINUX:()=>nx,OSTYPEVALUES_NETBSD:()=>ax,OSTYPEVALUES_OPENBSD:()=>ox,OSTYPEVALUES_SOLARIS:()=>lx,OSTYPEVALUES_WINDOWS:()=>tx,OSTYPEVALUES_Z_OS:()=>ux,OTEL_STATUS_CODE_VALUE_ERROR:()=>gC,OTEL_STATUS_CODE_VALUE_OK:()=>`OK`,OsTypeValues:()=>dx,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>10,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>6,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>1,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>15,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>4,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>9,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>13,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>3,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>5,RPCGRPCSTATUSCODEVALUES_OK:()=>0,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>11,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>7,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>16,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>14,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>12,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>2,RpcGrpcStatusCodeValues:()=>kg,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>gd,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Od,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>pd,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>ld,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Ed,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>xd,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>yd,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>kd,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>_d,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>ud,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>hd,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>bd,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>md,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>dd,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>fd,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Dd,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Cd,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>wd,SEMATTRS_AWS_DYNAMODB_SELECT:()=>vd,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Sd,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>cd,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Td,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Vl,SEMATTRS_CODE_FILEPATH:()=>Gu,SEMATTRS_CODE_FUNCTION:()=>Uu,SEMATTRS_CODE_LINENO:()=>Ku,SEMATTRS_CODE_NAMESPACE:()=>Wu,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Ql,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>ru,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>nu,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>eu,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Xl,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Zl,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>tu,SEMATTRS_DB_CASSANDRA_TABLE:()=>$l,SEMATTRS_DB_CONNECTION_STRING:()=>Ul,SEMATTRS_DB_HBASE_NAMESPACE:()=>iu,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Gl,SEMATTRS_DB_MONGODB_COLLECTION:()=>ou,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Yl,SEMATTRS_DB_NAME:()=>Kl,SEMATTRS_DB_OPERATION:()=>Jl,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>au,SEMATTRS_DB_SQL_TABLE:()=>su,SEMATTRS_DB_STATEMENT:()=>ql,SEMATTRS_DB_SYSTEM:()=>Hl,SEMATTRS_DB_USER:()=>Wl,SEMATTRS_ENDUSER_ID:()=>Ru,SEMATTRS_ENDUSER_ROLE:()=>zu,SEMATTRS_ENDUSER_SCOPE:()=>Bu,SEMATTRS_EXCEPTION_ESCAPED:()=>du,SEMATTRS_EXCEPTION_MESSAGE:()=>lu,SEMATTRS_EXCEPTION_STACKTRACE:()=>uu,SEMATTRS_EXCEPTION_TYPE:()=>cu,SEMATTRS_FAAS_COLDSTART:()=>bu,SEMATTRS_FAAS_CRON:()=>yu,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>mu,SEMATTRS_FAAS_DOCUMENT_NAME:()=>_u,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>hu,SEMATTRS_FAAS_DOCUMENT_TIME:()=>gu,SEMATTRS_FAAS_EXECUTION:()=>pu,SEMATTRS_FAAS_INVOKED_NAME:()=>xu,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Su,SEMATTRS_FAAS_INVOKED_REGION:()=>Cu,SEMATTRS_FAAS_TIME:()=>vu,SEMATTRS_FAAS_TRIGGER:()=>fu,SEMATTRS_HTTP_CLIENT_IP:()=>sd,SEMATTRS_HTTP_FLAVOR:()=>$u,SEMATTRS_HTTP_HOST:()=>Xu,SEMATTRS_HTTP_METHOD:()=>qu,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>td,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>nd,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>rd,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>id,SEMATTRS_HTTP_ROUTE:()=>od,SEMATTRS_HTTP_SCHEME:()=>Zu,SEMATTRS_HTTP_SERVER_NAME:()=>ad,SEMATTRS_HTTP_STATUS_CODE:()=>Qu,SEMATTRS_HTTP_TARGET:()=>Yu,SEMATTRS_HTTP_URL:()=>Ju,SEMATTRS_HTTP_USER_AGENT:()=>ed,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>of,SEMATTRS_MESSAGE_ID:()=>af,SEMATTRS_MESSAGE_TYPE:()=>rf,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>sf,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Hd,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Rd,SEMATTRS_MESSAGING_DESTINATION:()=>jd,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Md,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Kd,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Gd,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Wd,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>qd,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Jd,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Ld,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Bd,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>zd,SEMATTRS_MESSAGING_OPERATION:()=>Vd,SEMATTRS_MESSAGING_PROTOCOL:()=>Pd,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Fd,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Ud,SEMATTRS_MESSAGING_SYSTEM:()=>Ad,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Nd,SEMATTRS_MESSAGING_URL:()=>Id,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Iu,SEMATTRS_NET_HOST_CARRIER_MCC:()=>Pu,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Fu,SEMATTRS_NET_HOST_CARRIER_NAME:()=>Nu,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Mu,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>ju,SEMATTRS_NET_HOST_IP:()=>Ou,SEMATTRS_NET_HOST_NAME:()=>Au,SEMATTRS_NET_HOST_PORT:()=>ku,SEMATTRS_NET_PEER_IP:()=>Tu,SEMATTRS_NET_PEER_NAME:()=>Du,SEMATTRS_NET_PEER_PORT:()=>Eu,SEMATTRS_NET_TRANSPORT:()=>wu,SEMATTRS_PEER_SERVICE:()=>Lu,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Qd,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>tf,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>nf,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>ef,SEMATTRS_RPC_JSONRPC_VERSION:()=>$d,SEMATTRS_RPC_METHOD:()=>Zd,SEMATTRS_RPC_SERVICE:()=>Xd,SEMATTRS_RPC_SYSTEM:()=>Yd,SEMATTRS_THREAD_ID:()=>Vu,SEMATTRS_THREAD_NAME:()=>Hu,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>gv,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>hv,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>_v,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>vv,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>yv,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>bv,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>xv,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Cv,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Sv,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Tv,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>wv,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>dv,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>pv,SEMRESATTRS_CLOUD_PLATFORM:()=>mv,SEMRESATTRS_CLOUD_PROVIDER:()=>uv,SEMRESATTRS_CLOUD_REGION:()=>fv,SEMRESATTRS_CONTAINER_ID:()=>Dv,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>kv,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Av,SEMRESATTRS_CONTAINER_NAME:()=>Ev,SEMRESATTRS_CONTAINER_RUNTIME:()=>Ov,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>jv,SEMRESATTRS_DEVICE_ID:()=>Mv,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Nv,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Pv,SEMRESATTRS_FAAS_ID:()=>Iv,SEMRESATTRS_FAAS_INSTANCE:()=>Rv,SEMRESATTRS_FAAS_MAX_MEMORY:()=>zv,SEMRESATTRS_FAAS_NAME:()=>Fv,SEMRESATTRS_FAAS_VERSION:()=>Lv,SEMRESATTRS_HOST_ARCH:()=>Uv,SEMRESATTRS_HOST_ID:()=>Bv,SEMRESATTRS_HOST_IMAGE_ID:()=>Gv,SEMRESATTRS_HOST_IMAGE_NAME:()=>Wv,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Kv,SEMRESATTRS_HOST_NAME:()=>Vv,SEMRESATTRS_HOST_TYPE:()=>Hv,SEMRESATTRS_K8S_CLUSTER_NAME:()=>qv,SEMRESATTRS_K8S_CONTAINER_NAME:()=>$v,SEMRESATTRS_K8S_CRONJOB_NAME:()=>dy,SEMRESATTRS_K8S_CRONJOB_UID:()=>uy,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>sy,SEMRESATTRS_K8S_DAEMONSET_UID:()=>oy,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>ry,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>ny,SEMRESATTRS_K8S_JOB_NAME:()=>ly,SEMRESATTRS_K8S_JOB_UID:()=>cy,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>Xv,SEMRESATTRS_K8S_NODE_NAME:()=>Jv,SEMRESATTRS_K8S_NODE_UID:()=>Yv,SEMRESATTRS_K8S_POD_NAME:()=>Qv,SEMRESATTRS_K8S_POD_UID:()=>Zv,SEMRESATTRS_K8S_REPLICASET_NAME:()=>ty,SEMRESATTRS_K8S_REPLICASET_UID:()=>ey,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>ay,SEMRESATTRS_K8S_STATEFULSET_UID:()=>iy,SEMRESATTRS_OS_DESCRIPTION:()=>py,SEMRESATTRS_OS_NAME:()=>my,SEMRESATTRS_OS_TYPE:()=>fy,SEMRESATTRS_OS_VERSION:()=>hy,SEMRESATTRS_PROCESS_COMMAND:()=>yy,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>xy,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>by,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>_y,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>vy,SEMRESATTRS_PROCESS_OWNER:()=>Sy,SEMRESATTRS_PROCESS_PID:()=>gy,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Ty,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Cy,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>wy,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Oy,SEMRESATTRS_SERVICE_NAME:()=>Ey,SEMRESATTRS_SERVICE_NAMESPACE:()=>Dy,SEMRESATTRS_SERVICE_VERSION:()=>ky,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Ny,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>jy,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Ay,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>My,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Iy,SEMRESATTRS_WEBENGINE_NAME:()=>Py,SEMRESATTRS_WEBENGINE_VERSION:()=>Fy,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>CC,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>wC,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>TC,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>DC,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>OC,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>kC,SemanticAttributes:()=>cf,SemanticResourceAttributes:()=>Ly,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>`cpp`,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Sx,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Cx,TELEMETRYSDKLANGUAGEVALUES_GO:()=>`go`,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>wx,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Tx,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>`php`,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Ex,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Dx,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Ox,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>`cpp`,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>jC,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>MC,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>`go`,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>NC,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>PC,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>`php`,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>FC,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>IC,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>LC,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>RC,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>zC,TelemetrySdkLanguageValues:()=>kx}),Xw=n((()=>{Ig(),jx(),JC(),Kw(),Jw()})),Zw=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ATTR_PROCESS_RUNTIME_NAME=void 0,e.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`})),Qw=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SDK_INFO=void 0;let t=ys(),n=(Xw(),i(Yw)),r=Zw();e.SDK_INFO={[n.ATTR_TELEMETRY_SDK_NAME]:`opentelemetry`,[r.ATTR_PROCESS_RUNTIME_NAME]:`node`,[n.ATTR_TELEMETRY_SDK_LANGUAGE]:n.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[n.ATTR_TELEMETRY_SDK_VERSION]:t.VERSION}})),$w=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.otperformance=e.SDK_INFO=e._globalThis=e.getStringListFromEnv=e.getNumberFromEnv=e.getBooleanFromEnv=e.getStringFromEnv=void 0;var t=_s();Object.defineProperty(e,"getStringFromEnv",{enumerable:!0,get:function(){return t.getStringFromEnv}}),Object.defineProperty(e,"getBooleanFromEnv",{enumerable:!0,get:function(){return t.getBooleanFromEnv}}),Object.defineProperty(e,"getNumberFromEnv",{enumerable:!0,get:function(){return t.getNumberFromEnv}}),Object.defineProperty(e,"getStringListFromEnv",{enumerable:!0,get:function(){return t.getStringListFromEnv}});var n=vs();Object.defineProperty(e,"_globalThis",{enumerable:!0,get:function(){return n._globalThis}});var r=Qw();Object.defineProperty(e,"SDK_INFO",{enumerable:!0,get:function(){return r.SDK_INFO}}),e.otperformance=performance})),eT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getStringListFromEnv=e.getNumberFromEnv=e.getStringFromEnv=e.getBooleanFromEnv=e.otperformance=e._globalThis=e.SDK_INFO=void 0;var t=$w();Object.defineProperty(e,"SDK_INFO",{enumerable:!0,get:function(){return t.SDK_INFO}}),Object.defineProperty(e,"_globalThis",{enumerable:!0,get:function(){return t._globalThis}}),Object.defineProperty(e,"otperformance",{enumerable:!0,get:function(){return t.otperformance}}),Object.defineProperty(e,"getBooleanFromEnv",{enumerable:!0,get:function(){return t.getBooleanFromEnv}}),Object.defineProperty(e,"getStringFromEnv",{enumerable:!0,get:function(){return t.getStringFromEnv}}),Object.defineProperty(e,"getNumberFromEnv",{enumerable:!0,get:function(){return t.getNumberFromEnv}}),Object.defineProperty(e,"getStringListFromEnv",{enumerable:!0,get:function(){return t.getStringListFromEnv}})})),tT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.addHrTimes=e.isTimeInput=e.isTimeInputHrTime=e.hrTimeToMicroseconds=e.hrTimeToMilliseconds=e.hrTimeToNanoseconds=e.hrTimeToTimeStamp=e.hrTimeDuration=e.timeInputToHrTime=e.hrTime=e.getTimeOrigin=e.millisToHrTime=void 0;let t=eT(),n=10**6,r=10**9;function i(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*n)]}e.millisToHrTime=i;function a(){return t.otperformance.timeOrigin}e.getTimeOrigin=a;function o(e){return h(i(t.otperformance.timeOrigin),i(typeof e==`number`?e:t.otperformance.now()))}e.hrTime=o;function s(e){if(p(e))return e;if(typeof e==`number`)return e<t.otperformance.timeOrigin?o(e):i(e);if(e instanceof Date)return i(e.getTime());throw TypeError(`Invalid input type`)}e.timeInputToHrTime=s;function c(e,t){let n=t[0]-e[0],i=t[1]-e[1];return i<0&&(--n,i+=r),[n,i]}e.hrTimeDuration=c;function l(e){let t=`${`0`.repeat(9)}${e[1]}Z`,n=t.substring(t.length-9-1);return new Date(e[0]*1e3).toISOString().replace(`000Z`,n)}e.hrTimeToTimeStamp=l;function u(e){return e[0]*r+e[1]}e.hrTimeToNanoseconds=u;function d(e){return e[0]*1e3+e[1]/1e6}e.hrTimeToMilliseconds=d;function f(e){return e[0]*1e6+e[1]/1e3}e.hrTimeToMicroseconds=f;function p(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}e.isTimeInputHrTime=p;function m(e){return p(e)||typeof e==`number`||e instanceof Date}e.isTimeInput=m;function h(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=r&&(n[1]-=r,n[0]+=1),n}e.addHrTimes=h})),nT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unrefTimer=void 0;function t(e){typeof e!=`number`&&e.unref()}e.unrefTimer=t})),rT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExportResultCode=void 0,(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(e.ExportResultCode||={})})),iT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompositePropagator=void 0;let t=(c(),i(d));e.CompositePropagator=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,n,r){for(let i of this._propagators)try{i.inject(e,n,r)}catch(e){t.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${e.message}`)}}extract(e,n,r){return this._propagators.reduce((e,i)=>{try{return i.extract(e,n,r)}catch(e){t.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}})),aT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateValue=e.validateKey=void 0;let t=`[_0-9a-z-*/]`,n=RegExp(`^(?:${`[a-z]${t}{0,255}`}|${`[a-z0-9]${t}{0,240}@[a-z]${t}{0,13}`})$`),r=/^[ -~]{0,255}[!-~]$/,i=/,|=/;function a(e){return n.test(e)}e.validateKey=a;function o(e){return r.test(e)&&!i.test(e)}e.validateValue=o})),oT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TraceState=void 0;let t=aT();e.TraceState=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,n){if(!(0,t.validateKey)(e)||!(0,t.validateValue)(n))return this;let r=this._getState(),i=r.get(e),a=this._length;if(typeof i==`string`?a+=n.length-i.length:a+=e.length+n.length+(r.size>0?2:1),a>512)return this;let o=new Map(r);return o.delete(e),o.set(e,n),this._fromState(o,a)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=`,`+e),e=`${n[0]}=${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(`,`),n=new Map,r=0;for(let i of e){let e=i.trim(),a=e.indexOf(`=`);if(a===-1)continue;let o=e.slice(0,a),s=e.slice(a+1);if(!(0,t.validateKey)(o)||!(0,t.validateValue)(s))continue;let c=r+e.length+ +(n.size>0);if(!(c>512)&&(n.set(o,s),r=c,n.size>=32))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}}})),sT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.W3CTraceContextPropagator=e.parseTraceParent=e.TRACE_STATE_HEADER=e.TRACE_PARENT_HEADER=void 0;let t=(c(),i(d)),n=ls(),r=oT();e.TRACE_PARENT_HEADER=`traceparent`,e.TRACE_STATE_HEADER=`tracestate`;let a=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function o(e){let t=a.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}e.parseTraceParent=o,e.W3CTraceContextPropagator=class{inject(r,i,a){let o=t.trace.getSpanContext(r);if(!o||(0,n.isTracingSuppressed)(r)||!(0,t.isSpanContextValid)(o))return;let s=`00-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||t.TraceFlags.NONE).toString(16)}`;a.set(i,e.TRACE_PARENT_HEADER,s),o.traceState&&a.set(i,e.TRACE_STATE_HEADER,o.traceState.serialize())}extract(n,i,a){let s=a.get(i,e.TRACE_PARENT_HEADER);if(!s)return n;let c=Array.isArray(s)?s[0]:s;if(typeof c!=`string`)return n;let l=o(c);if(!l)return n;l.isRemote=!0;let u=a.get(i,e.TRACE_STATE_HEADER);if(u){let e=Array.isArray(u)?u.join(`,`):u;l.traceState=new r.TraceState(typeof e==`string`?e:void 0)}return t.trace.setSpanContext(n,l)}fields(){return[e.TRACE_PARENT_HEADER,e.TRACE_STATE_HEADER]}}})),cT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRPCMetadata=e.deleteRPCMetadata=e.setRPCMetadata=e.RPCType=void 0;let t=(0,(c(),i(d)).createContextKey)(`OpenTelemetry SDK Context Key RPC_METADATA`);(function(e){e.HTTP=`http`})(e.RPCType||={});function n(e,n){return e.setValue(t,n)}e.setRPCMetadata=n;function r(e){return e.deleteValue(t)}e.deleteRPCMetadata=r;function a(e){return e.getValue(t)}e.getRPCMetadata=a})),lT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isPlainObject=void 0;let t=Function.prototype.toString,n=t.call(Object),r=Object.getPrototypeOf,i=Object.prototype,a=i.hasOwnProperty,o=Symbol?Symbol.toStringTag:void 0,s=i.toString;function c(e){if(!l(e)||u(e)!==`[object Object]`)return!1;let i=r(e);if(i===null)return!0;let o=a.call(i,`constructor`)&&i.constructor;return typeof o==`function`&&o instanceof o&&t.call(o)===n}e.isPlainObject=c;function l(e){return typeof e==`object`&&!!e}function u(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:o&&o in Object(e)?d(e):f(e)}function d(e){let t=a.call(e,o),n=e[o],r=!1;try{e[o]=void 0,r=!0}catch{}let i=s.call(e);return r&&(t?e[o]=n:delete e[o]),i}function f(e){return s.call(e)}})),uT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;let t=lT();function n(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=i(t,e.shift(),0,n);return t}e.merge=n;function r(e){return o(e)?e.slice():e}function i(e,t,n=0,d){let f;if(!(n>20)){if(n++,l(e)||l(t)||s(t))f=r(t);else if(o(e)){if(f=e.slice(),o(t))for(let e=0,n=t.length;e<n;e++)f.push(r(t[e]));else if(c(t)){let e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){let i=e[n];i===`__proto__`||i===`constructor`||i===`prototype`||(f[i]=r(t[i]))}}}else if(c(e))if(c(t)){if(!u(e,t))return t;f=Object.assign({},e);let r=Object.keys(t);for(let o=0,s=r.length;o<s;o++){let s=r[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let u=t[s];if(l(u))u===void 0?delete f[s]:f[s]=u;else{let r=f[s],o=u;if(a(e,s,d)||a(t,s,d))delete f[s];else{if(c(r)&&c(o)){let n=d.get(r)||[],i=d.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),d.set(r,n),d.set(o,i)}f[s]=i(f[s],u,n,d)}}}}else f=t;return f}}function a(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function o(e){return Array.isArray(e)}function s(e){return typeof e==`function`}function c(e){return!l(e)&&!o(e)&&!s(e)&&typeof e==`object`}function l(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function u(e,n){return!(!(0,t.isPlainObject)(e)||!(0,t.isPlainObject)(n))}})),dT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callWithTimeout=e.TimeoutError=void 0;var t=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};e.TimeoutError=t;function n(e,n){let r,i=new Promise(function(e,i){r=setTimeout(function(){i(new t(`Operation timed out.`))},n)});return Promise.race([e,i]).then(e=>(clearTimeout(r),e),e=>{throw clearTimeout(r),e})}e.callWithTimeout=n})),fT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isUrlIgnored=e.urlMatches=void 0;function t(e,t){return typeof t==`string`?e===t:!!e.match(t)}e.urlMatches=t;function n(e,n){if(!n)return!1;for(let r of n)if(t(e,r))return!0;return!1}e.isUrlIgnored=n})),pT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Deferred=void 0,e.Deferred=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),mT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BindOnceFuture=void 0;let t=pT();e.BindOnceFuture=class{_isCalled=!1;_deferred=new t.Deferred;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}})),hT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.diagLogLevelFromString=void 0;let t=(c(),i(d)),n={ALL:t.DiagLogLevel.ALL,VERBOSE:t.DiagLogLevel.VERBOSE,DEBUG:t.DiagLogLevel.DEBUG,INFO:t.DiagLogLevel.INFO,WARN:t.DiagLogLevel.WARN,ERROR:t.DiagLogLevel.ERROR,NONE:t.DiagLogLevel.NONE};function r(e){return e==null?void 0:n[e.toUpperCase()]??(t.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(n)}, using default`),t.DiagLogLevel.INFO)}e.diagLogLevelFromString=r})),gT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._export=void 0;let t=(c(),i(d)),n=ls();function r(e,r){return new Promise(i=>{t.context.with((0,n.suppressTracing)(t.context.active()),()=>{e.export(r,i)})})}e._export=r})),q=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.internal=e.diagLogLevelFromString=e.BindOnceFuture=e.urlMatches=e.isUrlIgnored=e.callWithTimeout=e.TimeoutError=e.merge=e.TraceState=e.unsuppressTracing=e.suppressTracing=e.isTracingSuppressed=e.setRPCMetadata=e.getRPCMetadata=e.deleteRPCMetadata=e.RPCType=e.parseTraceParent=e.W3CTraceContextPropagator=e.TRACE_STATE_HEADER=e.TRACE_PARENT_HEADER=e.CompositePropagator=e.otperformance=e.getStringListFromEnv=e.getNumberFromEnv=e.getBooleanFromEnv=e.getStringFromEnv=e._globalThis=e.SDK_INFO=e.parseKeyPairsIntoRecord=e.ExportResultCode=e.unrefTimer=e.timeInputToHrTime=e.millisToHrTime=e.isTimeInputHrTime=e.isTimeInput=e.hrTimeToTimeStamp=e.hrTimeToNanoseconds=e.hrTimeToMilliseconds=e.hrTimeToMicroseconds=e.hrTimeDuration=e.hrTime=e.getTimeOrigin=e.addHrTimes=e.loggingErrorHandler=e.setGlobalErrorHandler=e.globalErrorHandler=e.sanitizeAttributes=e.isAttributeValue=e.AnchoredClock=e.W3CBaggagePropagator=void 0;var t=fs();Object.defineProperty(e,"W3CBaggagePropagator",{enumerable:!0,get:function(){return t.W3CBaggagePropagator}});var n=ps();Object.defineProperty(e,"AnchoredClock",{enumerable:!0,get:function(){return n.AnchoredClock}});var r=ms();Object.defineProperty(e,"isAttributeValue",{enumerable:!0,get:function(){return r.isAttributeValue}}),Object.defineProperty(e,"sanitizeAttributes",{enumerable:!0,get:function(){return r.sanitizeAttributes}});var i=gs();Object.defineProperty(e,"globalErrorHandler",{enumerable:!0,get:function(){return i.globalErrorHandler}}),Object.defineProperty(e,"setGlobalErrorHandler",{enumerable:!0,get:function(){return i.setGlobalErrorHandler}});var a=hs();Object.defineProperty(e,"loggingErrorHandler",{enumerable:!0,get:function(){return a.loggingErrorHandler}});var o=tT();Object.defineProperty(e,"addHrTimes",{enumerable:!0,get:function(){return o.addHrTimes}}),Object.defineProperty(e,"getTimeOrigin",{enumerable:!0,get:function(){return o.getTimeOrigin}}),Object.defineProperty(e,"hrTime",{enumerable:!0,get:function(){return o.hrTime}}),Object.defineProperty(e,"hrTimeDuration",{enumerable:!0,get:function(){return o.hrTimeDuration}}),Object.defineProperty(e,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return o.hrTimeToMicroseconds}}),Object.defineProperty(e,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return o.hrTimeToMilliseconds}}),Object.defineProperty(e,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return o.hrTimeToNanoseconds}}),Object.defineProperty(e,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return o.hrTimeToTimeStamp}}),Object.defineProperty(e,"isTimeInput",{enumerable:!0,get:function(){return o.isTimeInput}}),Object.defineProperty(e,"isTimeInputHrTime",{enumerable:!0,get:function(){return o.isTimeInputHrTime}}),Object.defineProperty(e,"millisToHrTime",{enumerable:!0,get:function(){return o.millisToHrTime}}),Object.defineProperty(e,"timeInputToHrTime",{enumerable:!0,get:function(){return o.timeInputToHrTime}});var s=nT();Object.defineProperty(e,"unrefTimer",{enumerable:!0,get:function(){return s.unrefTimer}});var c=rT();Object.defineProperty(e,"ExportResultCode",{enumerable:!0,get:function(){return c.ExportResultCode}});var l=ds();Object.defineProperty(e,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return l.parseKeyPairsIntoRecord}});var u=eT();Object.defineProperty(e,"SDK_INFO",{enumerable:!0,get:function(){return u.SDK_INFO}}),Object.defineProperty(e,"_globalThis",{enumerable:!0,get:function(){return u._globalThis}}),Object.defineProperty(e,"getStringFromEnv",{enumerable:!0,get:function(){return u.getStringFromEnv}}),Object.defineProperty(e,"getBooleanFromEnv",{enumerable:!0,get:function(){return u.getBooleanFromEnv}}),Object.defineProperty(e,"getNumberFromEnv",{enumerable:!0,get:function(){return u.getNumberFromEnv}}),Object.defineProperty(e,"getStringListFromEnv",{enumerable:!0,get:function(){return u.getStringListFromEnv}}),Object.defineProperty(e,"otperformance",{enumerable:!0,get:function(){return u.otperformance}});var d=iT();Object.defineProperty(e,"CompositePropagator",{enumerable:!0,get:function(){return d.CompositePropagator}});var f=sT();Object.defineProperty(e,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return f.TRACE_PARENT_HEADER}}),Object.defineProperty(e,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return f.TRACE_STATE_HEADER}}),Object.defineProperty(e,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return f.W3CTraceContextPropagator}}),Object.defineProperty(e,"parseTraceParent",{enumerable:!0,get:function(){return f.parseTraceParent}});var p=cT();Object.defineProperty(e,"RPCType",{enumerable:!0,get:function(){return p.RPCType}}),Object.defineProperty(e,"deleteRPCMetadata",{enumerable:!0,get:function(){return p.deleteRPCMetadata}}),Object.defineProperty(e,"getRPCMetadata",{enumerable:!0,get:function(){return p.getRPCMetadata}}),Object.defineProperty(e,"setRPCMetadata",{enumerable:!0,get:function(){return p.setRPCMetadata}});var m=ls();Object.defineProperty(e,"isTracingSuppressed",{enumerable:!0,get:function(){return m.isTracingSuppressed}}),Object.defineProperty(e,"suppressTracing",{enumerable:!0,get:function(){return m.suppressTracing}}),Object.defineProperty(e,"unsuppressTracing",{enumerable:!0,get:function(){return m.unsuppressTracing}});var h=oT();Object.defineProperty(e,"TraceState",{enumerable:!0,get:function(){return h.TraceState}});var g=uT();Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return g.merge}});var _=dT();Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return _.TimeoutError}}),Object.defineProperty(e,"callWithTimeout",{enumerable:!0,get:function(){return _.callWithTimeout}});var v=fT();Object.defineProperty(e,"isUrlIgnored",{enumerable:!0,get:function(){return v.isUrlIgnored}}),Object.defineProperty(e,"urlMatches",{enumerable:!0,get:function(){return v.urlMatches}});var y=mT();Object.defineProperty(e,"BindOnceFuture",{enumerable:!0,get:function(){return y.BindOnceFuture}});var b=hT();Object.defineProperty(e,"diagLogLevelFromString",{enumerable:!0,get:function(){return b.diagLogLevelFromString}}),e.internal={_export:gT()._export}})),_T=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LastValueAggregator=e.LastValueAccumulation=void 0;let t=Qo(),n=q(),r=Xo();var i=class{startTime;_current;sampleTime;constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,n.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};e.LastValueAccumulation=i,e.LastValueAggregator=class{kind=t.AggregatorKind.LAST_VALUE;createAccumulation(e){return new i(e)}merge(e,t){let r=(0,n.hrTimeToMicroseconds)(t.sampleTime)>=(0,n.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new i(e.startTime,r.toPointValue(),r.sampleTime)}diff(e,t){let r=(0,n.hrTimeToMicroseconds)(t.sampleTime)>=(0,n.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new i(t.startTime,r.toPointValue(),r.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:r.DataPointType.GAUGE,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()}))}}}})),vT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SumAggregator=e.SumAccumulation=void 0;let t=Qo(),n=Xo();var r=class{startTime;monotonic;_current;reset;constructor(e,t,n=0,r=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=r}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};e.SumAccumulation=r,e.SumAggregator=class{kind=t.AggregatorKind.SUM;monotonic;constructor(e){this.monotonic=e}createAccumulation(e){return new r(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new r(t.startTime,this.monotonic,i,t.reset):new r(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new r(t.startTime,this.monotonic,i,!0):new r(t.startTime,this.monotonic,i-n)}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:n.DataPointType.SUM,dataPoints:r.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()})),isMonotonic:this.monotonic}}}})),yT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SumAggregator=e.SumAccumulation=e.LastValueAggregator=e.LastValueAccumulation=e.ExponentialHistogramAggregator=e.ExponentialHistogramAccumulation=e.HistogramAggregator=e.HistogramAccumulation=e.DropAggregator=void 0;var t=$o();Object.defineProperty(e,"DropAggregator",{enumerable:!0,get:function(){return t.DropAggregator}});var n=es();Object.defineProperty(e,"HistogramAccumulation",{enumerable:!0,get:function(){return n.HistogramAccumulation}}),Object.defineProperty(e,"HistogramAggregator",{enumerable:!0,get:function(){return n.HistogramAggregator}});var r=cs();Object.defineProperty(e,"ExponentialHistogramAccumulation",{enumerable:!0,get:function(){return r.ExponentialHistogramAccumulation}}),Object.defineProperty(e,"ExponentialHistogramAggregator",{enumerable:!0,get:function(){return r.ExponentialHistogramAggregator}});var i=_T();Object.defineProperty(e,"LastValueAccumulation",{enumerable:!0,get:function(){return i.LastValueAccumulation}}),Object.defineProperty(e,"LastValueAggregator",{enumerable:!0,get:function(){return i.LastValueAggregator}});var a=vT();Object.defineProperty(e,"SumAccumulation",{enumerable:!0,get:function(){return a.SumAccumulation}}),Object.defineProperty(e,"SumAggregator",{enumerable:!0,get:function(){return a.SumAggregator}})})),bT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_AGGREGATION=e.EXPONENTIAL_HISTOGRAM_AGGREGATION=e.HISTOGRAM_AGGREGATION=e.LAST_VALUE_AGGREGATION=e.SUM_AGGREGATION=e.DROP_AGGREGATION=e.DefaultAggregation=e.ExponentialHistogramAggregation=e.ExplicitBucketHistogramAggregation=e.HistogramAggregation=e.LastValueAggregation=e.SumAggregation=e.DropAggregation=void 0;let t=(c(),i(d)),n=yT(),r=Xo();var a=class e{static DEFAULT_INSTANCE=new n.DropAggregator;createAggregator(t){return e.DEFAULT_INSTANCE}};e.DropAggregation=a;var o=class e{static MONOTONIC_INSTANCE=new n.SumAggregator(!0);static NON_MONOTONIC_INSTANCE=new n.SumAggregator(!1);createAggregator(t){switch(t.type){case r.InstrumentType.COUNTER:case r.InstrumentType.OBSERVABLE_COUNTER:case r.InstrumentType.HISTOGRAM:return e.MONOTONIC_INSTANCE;default:return e.NON_MONOTONIC_INSTANCE}}};e.SumAggregation=o;var s=class e{static DEFAULT_INSTANCE=new n.LastValueAggregator;createAggregator(t){return e.DEFAULT_INSTANCE}};e.LastValueAggregation=s;var l=class e{static DEFAULT_INSTANCE=new n.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(t){return e.DEFAULT_INSTANCE}};e.HistogramAggregation=l;var u=class{_boundaries;_recordMinMax;constructor(e,t=!0){if(e==null)throw Error(`ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array`);e=e.concat(),e=e.sort((e,t)=>e-t);let n=e.lastIndexOf(-1/0),r=e.indexOf(1/0);r===-1&&(r=void 0),this._boundaries=e.slice(n+1,r),this._recordMinMax=t}createAggregator(e){return new n.HistogramAggregator(this._boundaries,this._recordMinMax)}};e.ExplicitBucketHistogramAggregation=u;var f=class{_maxSize;_recordMinMax;constructor(e=160,t=!0){this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new n.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};e.ExponentialHistogramAggregation=f;var p=class{_resolve(n){switch(n.type){case r.InstrumentType.COUNTER:case r.InstrumentType.UP_DOWN_COUNTER:case r.InstrumentType.OBSERVABLE_COUNTER:case r.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return e.SUM_AGGREGATION;case r.InstrumentType.GAUGE:case r.InstrumentType.OBSERVABLE_GAUGE:return e.LAST_VALUE_AGGREGATION;case r.InstrumentType.HISTOGRAM:return n.advice.explicitBucketBoundaries?new u(n.advice.explicitBucketBoundaries):e.HISTOGRAM_AGGREGATION}return t.diag.warn(`Unable to recognize instrument type: ${n.type}`),e.DROP_AGGREGATION}createAggregator(e){return this._resolve(e).createAggregator(e)}};e.DefaultAggregation=p,e.DROP_AGGREGATION=new a,e.SUM_AGGREGATION=new o,e.LAST_VALUE_AGGREGATION=new s,e.HISTOGRAM_AGGREGATION=new l,e.EXPONENTIAL_HISTOGRAM_AGGREGATION=new f,e.DEFAULT_AGGREGATION=new p})),xT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toAggregation=e.AggregationType=void 0;let t=bT();var n;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.DROP=1]=`DROP`,e[e.SUM=2]=`SUM`,e[e.LAST_VALUE=3]=`LAST_VALUE`,e[e.EXPLICIT_BUCKET_HISTOGRAM=4]=`EXPLICIT_BUCKET_HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=5]=`EXPONENTIAL_HISTOGRAM`})(n=e.AggregationType||={});function r(e){switch(e.type){case n.DEFAULT:return t.DEFAULT_AGGREGATION;case n.DROP:return t.DROP_AGGREGATION;case n.SUM:return t.SUM_AGGREGATION;case n.LAST_VALUE:return t.LAST_VALUE_AGGREGATION;case n.EXPONENTIAL_HISTOGRAM:{let n=e;return new t.ExponentialHistogramAggregation(n.options?.maxSize,n.options?.recordMinMax)}case n.EXPLICIT_BUCKET_HISTOGRAM:{let n=e;return n.options==null?t.HISTOGRAM_AGGREGATION:new t.ExplicitBucketHistogramAggregation(n.options?.boundaries,n.options?.recordMinMax)}default:throw Error(`Unsupported Aggregation`)}}e.toAggregation=r})),ST=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=e.DEFAULT_AGGREGATION_SELECTOR=void 0;let t=Yo(),n=xT();e.DEFAULT_AGGREGATION_SELECTOR=e=>({type:n.AggregationType.DEFAULT}),e.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=e=>t.AggregationTemporality.CUMULATIVE})),CT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricReader=void 0;let t=(c(),i(d)),n=Zo(),r=ST();e.MetricReader=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(e){this._aggregationSelector=e?.aggregationSelector??r.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??r.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=e?.metricProducers??[],this._cardinalitySelector=e?.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw Error(`MetricReader can not be bound to a MeterProvider again.`);this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw Error(`MetricReader is not bound to a MetricProducer`);if(this._shutdown)throw Error(`MetricReader is shutdown`);let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(t=>t.collect({timeoutMillis:e?.timeoutMillis}))]),r=t.errors.concat(n.flatMap(e=>e.errors));return{resourceMetrics:{resource:t.resourceMetrics.resource,scopeMetrics:t.resourceMetrics.scopeMetrics.concat(n.flatMap(e=>e.resourceMetrics.scopeMetrics))},errors:r}}async shutdown(e){if(this._shutdown){t.diag.error(`Cannot call shutdown twice.`);return}e?.timeoutMillis==null?await this.onShutdown():await(0,n.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){t.diag.warn(`Cannot forceFlush on already shutdown MetricReader.`);return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,n.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}}})),wT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PeriodicExportingMetricReader=void 0;let t=(c(),i(d)),n=q(),r=CT(),a=Zo(),o=Xo();e.PeriodicExportingMetricReader=class extends r.MetricReader{_interval;_exporter;_exportInterval;_exportTimeout;constructor(e){let{exporter:n,exportIntervalMillis:r=6e4,metricProducers:i,cardinalityLimits:a}=e,{exportTimeoutMillis:s=3e4}=e;if(super({aggregationSelector:n.selectAggregation?.bind(n),aggregationTemporalitySelector:n.selectAggregationTemporality?.bind(n),metricProducers:i,cardinalitySelector:e=>{let t={default:2e3,...a};switch(e){case o.InstrumentType.COUNTER:return t.counter??t.default;case o.InstrumentType.GAUGE:return t.gauge??t.default;case o.InstrumentType.HISTOGRAM:return t.histogram??t.default;case o.InstrumentType.OBSERVABLE_COUNTER:return t.observableCounter??t.default;case o.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return t.observableUpDownCounter??t.default;case o.InstrumentType.OBSERVABLE_GAUGE:return t.observableGauge??t.default;case o.InstrumentType.UP_DOWN_COUNTER:return t.upDownCounter??t.default;default:return t.default}}}),r<=0)throw Error(`exportIntervalMillis must be greater than 0`);if(s<=0)throw Error(`exportTimeoutMillis must be greater than 0`);if(r<s){if(`exportIntervalMillis`in e&&`exportTimeoutMillis`in e)throw Error(`exportIntervalMillis must be greater than or equal to exportTimeoutMillis`);t.diag.info(`Timeout of ${s} exceeds the interval of ${r}. Clamping timeout to interval duration.`),s=r}this._exportInterval=r,this._exportTimeout=s,this._exporter=n}async _runOnce(){try{await(0,a.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof a.TimeoutError){t.diag.error(`Export took longer than %s milliseconds and timed out.`,this._exportTimeout);return}(0,n.globalErrorHandler)(e)}}async _doRun(){let{resourceMetrics:e,errors:r}=await this.collect({timeoutMillis:this._exportTimeout});if(r.length>0&&t.diag.error(`PeriodicExportingMetricReader: metrics collection errors`,...r),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(e){t.diag.debug(`Error while resolving async portion of resource: `,e),(0,n.globalErrorHandler)(e)}if(e.scopeMetrics.length===0)return;let i=await n.internal._export(this._exporter,e);if(i.code!==n.ExportResultCode.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${i.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=`number`&&this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}})),TT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryMetricExporter=void 0;let t=q();e.InMemoryMetricExporter=class{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(e){this._aggregationTemporality=e}export(e,n){if(this._shutdown){setTimeout(()=>n({code:t.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>n({code:t.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}})),ET=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConsoleMetricExporter=void 0;let t=q(),n=ST();e.ConsoleMetricExporter=class e{_shutdown=!1;_temporalitySelector;constructor(e){this._temporalitySelector=e?.temporalitySelector??n.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(n,r){if(this._shutdown){r({code:t.ExportResultCode.FAILED});return}return e._sendMetrics(n,r)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,n){for(let t of e.scopeMetrics)for(let e of t.metrics)console.dir({descriptor:e.descriptor,dataPointType:e.dataPointType,dataPoints:e.dataPoints},{depth:null});n({code:t.ExportResultCode.SUCCESS})}}})),DT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._clearDefaultServiceNameCache=e.defaultServiceName=void 0;let t;function n(){if(t===void 0)try{let e=globalThis.process.argv0;t=e?`unknown_service:${e}`:`unknown_service`}catch{t=`unknown_service`}return t}e.defaultServiceName=n;function r(){t=void 0}e._clearDefaultServiceNameCache=r})),OT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isPromiseLike=void 0,e.isPromiseLike=e=>typeof e==`object`&&!!e&&typeof e.then==`function`})),kT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultResource=e.emptyResource=e.resourceFromDetectedResource=e.resourceFromAttributes=void 0;let t=(c(),i(d)),n=q(),r=(Xw(),i(Yw)),a=DT(),o=OT();var s=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=m(t),r._asyncAttributesPending=t.filter(([e,t])=>(0,o.isPromiseLike)(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>((0,o.isPromiseLike)(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=m(this._rawAttributes),this._schemaUrl=h(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,(0,o.isPromiseLike)(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&t.diag.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[n,r]of this._rawAttributes){if((0,o.isPromiseLike)(r)){t.diag.debug(`Unsettled resource attribute ${n} skipped`);continue}r!=null&&(e[n]??=r)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=g(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function l(e,t){return s.FromAttributeList(Object.entries(e),t)}e.resourceFromAttributes=l;function u(e,t){return new s(e,t)}e.resourceFromDetectedResource=u;function f(){return l({})}e.emptyResource=f;function p(){return l({[r.ATTR_SERVICE_NAME]:(0,a.defaultServiceName)(),[r.ATTR_TELEMETRY_SDK_LANGUAGE]:n.SDK_INFO[r.ATTR_TELEMETRY_SDK_LANGUAGE],[r.ATTR_TELEMETRY_SDK_NAME]:n.SDK_INFO[r.ATTR_TELEMETRY_SDK_NAME],[r.ATTR_TELEMETRY_SDK_VERSION]:n.SDK_INFO[r.ATTR_TELEMETRY_SDK_VERSION]})}e.defaultResource=p;function m(e){return e.map(([e,n])=>(0,o.isPromiseLike)(n)?[e,n.catch(n=>{t.diag.debug(`promise rejection for resource attribute: %s - %s`,e,n)})]:[e,n])}function h(e){if(typeof e==`string`||e===void 0)return e;t.diag.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function g(e,n){let r=e?.schemaUrl,i=n?.schemaUrl,a=r===void 0||r===``,o=i===void 0||i===``;if(a)return i;if(o||r===i)return r;t.diag.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,r,i)}})),AT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.detectResources=void 0;let t=(c(),i(d)),n=kT();e.detectResources=(e={})=>(e.detectors||[]).map(r=>{try{let i=(0,n.resourceFromDetectedResource)(r.detect(e));return t.diag.debug(`${r.constructor.name} found resource.`,i),i}catch(e){return t.diag.debug(`${r.constructor.name} failed: ${e.message}`),(0,n.emptyResource)()}}).reduce((e,t)=>e.merge(t),(0,n.emptyResource)())})),jT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.envDetector=void 0;let t=(c(),i(d)),n=(Xw(),i(Yw)),r=q();e.envDetector=new class{_MAX_LENGTH=255;_COMMA_SEPARATOR=`,`;_LABEL_KEY_VALUE_SPLITTER=`=`;detect(e){let i={},a=(0,r.getStringFromEnv)(`OTEL_RESOURCE_ATTRIBUTES`),o=(0,r.getStringFromEnv)(`OTEL_SERVICE_NAME`);if(a)try{let e=this._parseResourceAttributes(a);Object.assign(i,e)}catch(e){t.diag.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return o&&(i[n.ATTR_SERVICE_NAME]=o),{attributes:i}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`)}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}}})),MT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ATTR_WEBENGINE_VERSION=e.ATTR_WEBENGINE_NAME=e.ATTR_WEBENGINE_DESCRIPTION=e.ATTR_SERVICE_NAMESPACE=e.ATTR_SERVICE_INSTANCE_ID=e.ATTR_PROCESS_RUNTIME_VERSION=e.ATTR_PROCESS_RUNTIME_NAME=e.ATTR_PROCESS_RUNTIME_DESCRIPTION=e.ATTR_PROCESS_PID=e.ATTR_PROCESS_OWNER=e.ATTR_PROCESS_EXECUTABLE_PATH=e.ATTR_PROCESS_EXECUTABLE_NAME=e.ATTR_PROCESS_COMMAND_ARGS=e.ATTR_PROCESS_COMMAND=e.ATTR_OS_VERSION=e.ATTR_OS_TYPE=e.ATTR_K8S_POD_NAME=e.ATTR_K8S_NAMESPACE_NAME=e.ATTR_K8S_DEPLOYMENT_NAME=e.ATTR_K8S_CLUSTER_NAME=e.ATTR_HOST_TYPE=e.ATTR_HOST_NAME=e.ATTR_HOST_IMAGE_VERSION=e.ATTR_HOST_IMAGE_NAME=e.ATTR_HOST_IMAGE_ID=e.ATTR_HOST_ID=e.ATTR_HOST_ARCH=e.ATTR_CONTAINER_NAME=e.ATTR_CONTAINER_IMAGE_TAGS=e.ATTR_CONTAINER_IMAGE_NAME=e.ATTR_CONTAINER_ID=e.ATTR_CLOUD_REGION=e.ATTR_CLOUD_PROVIDER=e.ATTR_CLOUD_AVAILABILITY_ZONE=e.ATTR_CLOUD_ACCOUNT_ID=void 0,e.ATTR_CLOUD_ACCOUNT_ID=`cloud.account.id`,e.ATTR_CLOUD_AVAILABILITY_ZONE=`cloud.availability_zone`,e.ATTR_CLOUD_PROVIDER=`cloud.provider`,e.ATTR_CLOUD_REGION=`cloud.region`,e.ATTR_CONTAINER_ID=`container.id`,e.ATTR_CONTAINER_IMAGE_NAME=`container.image.name`,e.ATTR_CONTAINER_IMAGE_TAGS=`container.image.tags`,e.ATTR_CONTAINER_NAME=`container.name`,e.ATTR_HOST_ARCH=`host.arch`,e.ATTR_HOST_ID=`host.id`,e.ATTR_HOST_IMAGE_ID=`host.image.id`,e.ATTR_HOST_IMAGE_NAME=`host.image.name`,e.ATTR_HOST_IMAGE_VERSION=`host.image.version`,e.ATTR_HOST_NAME=`host.name`,e.ATTR_HOST_TYPE=`host.type`,e.ATTR_K8S_CLUSTER_NAME=`k8s.cluster.name`,e.ATTR_K8S_DEPLOYMENT_NAME=`k8s.deployment.name`,e.ATTR_K8S_NAMESPACE_NAME=`k8s.namespace.name`,e.ATTR_K8S_POD_NAME=`k8s.pod.name`,e.ATTR_OS_TYPE=`os.type`,e.ATTR_OS_VERSION=`os.version`,e.ATTR_PROCESS_COMMAND=`process.command`,e.ATTR_PROCESS_COMMAND_ARGS=`process.command_args`,e.ATTR_PROCESS_EXECUTABLE_NAME=`process.executable.name`,e.ATTR_PROCESS_EXECUTABLE_PATH=`process.executable.path`,e.ATTR_PROCESS_OWNER=`process.owner`,e.ATTR_PROCESS_PID=`process.pid`,e.ATTR_PROCESS_RUNTIME_DESCRIPTION=`process.runtime.description`,e.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`,e.ATTR_PROCESS_RUNTIME_VERSION=`process.runtime.version`,e.ATTR_SERVICE_INSTANCE_ID=`service.instance.id`,e.ATTR_SERVICE_NAMESPACE=`service.namespace`,e.ATTR_WEBENGINE_DESCRIPTION=`webengine.description`,e.ATTR_WEBENGINE_NAME=`webengine.name`,e.ATTR_WEBENGINE_VERSION=`webengine.version`})),NT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getMachineId=void 0;let t=s(`process`),n;async function i(){if(!n)switch(t.platform){case`darwin`:n=(await import(`./getMachineId-darwin-Dy0upv7d.js`).then(e=>r(e.default))).getMachineId;break;case`linux`:n=(await import(`./getMachineId-linux-1gt-JynE.js`).then(e=>r(e.default))).getMachineId;break;case`freebsd`:n=(await import(`./getMachineId-bsd-DMCgGTrk.js`).then(e=>r(e.default))).getMachineId;break;case`win32`:n=(await import(`./getMachineId-win-BOJrF7mQ.js`).then(e=>r(e.default))).getMachineId;break;default:n=(await import(`./getMachineId-unsupported-aqcKyF65.js`).then(e=>r(e.default))).getMachineId;break}return n()}e.getMachineId=i})),PT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeType=e.normalizeArch=void 0,e.normalizeArch=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},e.normalizeType=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),FT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hostDetector=void 0;let t=MT(),n=s(`os`),r=NT(),i=PT();e.hostDetector=new class{detect(e){return{attributes:{[t.ATTR_HOST_NAME]:(0,n.hostname)(),[t.ATTR_HOST_ARCH]:(0,i.normalizeArch)((0,n.arch)()),[t.ATTR_HOST_ID]:(0,r.getMachineId)()}}}}})),IT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.osDetector=void 0;let t=MT(),n=s(`os`),r=PT();e.osDetector=new class{detect(e){return{attributes:{[t.ATTR_OS_TYPE]:(0,r.normalizeType)((0,n.platform)()),[t.ATTR_OS_VERSION]:(0,n.release)()}}}}})),LT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.processDetector=void 0;let t=(c(),i(d)),n=MT(),r=s(`os`);e.processDetector=new class{detect(e){let i={[n.ATTR_PROCESS_PID]:process.pid,[n.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[n.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[n.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[n.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[n.ATTR_PROCESS_RUNTIME_NAME]:`nodejs`,[n.ATTR_PROCESS_RUNTIME_DESCRIPTION]:`Node.js`};process.argv.length>1&&(i[n.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let e=r.userInfo();i[n.ATTR_PROCESS_OWNER]=e.username}catch(e){t.diag.debug(`error obtaining process owner: ${e}`)}return{attributes:i}}}})),RT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serviceInstanceIdDetector=void 0;let t=MT(),n=s(`crypto`);e.serviceInstanceIdDetector=new class{detect(e){return{attributes:{[t.ATTR_SERVICE_INSTANCE_ID]:(0,n.randomUUID)()}}}}})),zT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=void 0;var t=FT();Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return t.hostDetector}});var n=IT();Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return n.osDetector}});var r=LT();Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return r.processDetector}});var i=RT();Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return i.serviceInstanceIdDetector}})})),BT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=void 0;var t=zT();Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return t.hostDetector}}),Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return t.osDetector}}),Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return t.processDetector}}),Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return t.serviceInstanceIdDetector}})})),VT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.noopDetector=e.NoopDetector=void 0;var t=class{detect(){return{attributes:{}}}};e.NoopDetector=t,e.noopDetector=new t})),HT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.noopDetector=e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=e.envDetector=void 0;var t=jT();Object.defineProperty(e,"envDetector",{enumerable:!0,get:function(){return t.envDetector}});var n=BT();Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return n.hostDetector}}),Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return n.osDetector}}),Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return n.processDetector}}),Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return n.serviceInstanceIdDetector}});var r=VT();Object.defineProperty(e,"noopDetector",{enumerable:!0,get:function(){return r.noopDetector}})})),UT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultServiceName=e.emptyResource=e.defaultResource=e.resourceFromAttributes=e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=e.envDetector=e.detectResources=void 0;var t=AT();Object.defineProperty(e,"detectResources",{enumerable:!0,get:function(){return t.detectResources}});var n=HT();Object.defineProperty(e,"envDetector",{enumerable:!0,get:function(){return n.envDetector}}),Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return n.hostDetector}}),Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return n.osDetector}}),Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return n.processDetector}}),Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return n.serviceInstanceIdDetector}});var r=kT();Object.defineProperty(e,"resourceFromAttributes",{enumerable:!0,get:function(){return r.resourceFromAttributes}}),Object.defineProperty(e,"defaultResource",{enumerable:!0,get:function(){return r.defaultResource}}),Object.defineProperty(e,"emptyResource",{enumerable:!0,get:function(){return r.emptyResource}});var i=DT();Object.defineProperty(e,"defaultServiceName",{enumerable:!0,get:function(){return i.defaultServiceName}})})),WT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ViewRegistry=void 0,e.ViewRegistry=class{_registeredViews=[];addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(n=>this._matchInstrument(n.instrumentSelector,e)&&this._matchMeter(n.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}})),GT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isValidName=e.isDescriptorCompatibleWith=e.createInstrumentDescriptorWithView=e.createInstrumentDescriptor=void 0;let t=(c(),i(d)),n=Zo();function r(e,n,r){return l(e)||t.diag.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:n,description:r?.description??``,unit:r?.unit??``,valueType:r?.valueType??t.ValueType.DOUBLE,advice:r?.advice??{}}}e.createInstrumentDescriptor=r;function a(e,t){return{name:e.name??t.name,description:e.description??t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}e.createInstrumentDescriptorWithView=a;function o(e,t){return(0,n.equalsCaseInsensitive)(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}e.isDescriptorCompatibleWith=o;let s=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function l(e){return s.test(e)}e.isValidName=l})),KT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isObservableInstrument=e.ObservableUpDownCounterInstrument=e.ObservableGaugeInstrument=e.ObservableCounterInstrument=e.ObservableInstrument=e.HistogramInstrument=e.GaugeInstrument=e.CounterInstrument=e.UpDownCounterInstrument=e.SyncInstrument=void 0;let t=(c(),i(d)),n=q();var r=class{_writableMetricStorage;_descriptor;constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,r={},i=t.context.active()){if(typeof e!=`number`){t.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===t.ValueType.INT&&!Number.isInteger(e)&&(t.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,r,i,(0,n.millisToHrTime)(Date.now()))}};e.SyncInstrument=r,e.UpDownCounterInstrument=class extends r{add(e,t,n){this._record(e,t,n)}},e.CounterInstrument=class extends r{add(e,n,r){if(e<0){t.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,n,r)}},e.GaugeInstrument=class extends r{record(e,t,n){this._record(e,t,n)}},e.HistogramInstrument=class extends r{record(e,n,r){if(e<0){t.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,n,r)}};var a=class{_metricStorages;_descriptor;_observableRegistry;constructor(e,t,n){this._descriptor=e,this._metricStorages=t,this._observableRegistry=n}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};e.ObservableInstrument=a,e.ObservableCounterInstrument=class extends a{},e.ObservableGaugeInstrument=class extends a{},e.ObservableUpDownCounterInstrument=class extends a{};function o(e){return e instanceof a}e.isObservableInstrument=o})),qT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Meter=void 0;let t=GT(),n=KT(),r=Xo();e.Meter=class{_meterSharedState;constructor(e){this._meterSharedState=e}createGauge(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.GAUGE,i),o=this._meterSharedState.registerMetricStorage(a);return new n.GaugeInstrument(o,a)}createHistogram(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.HISTOGRAM,i),o=this._meterSharedState.registerMetricStorage(a);return new n.HistogramInstrument(o,a)}createCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.COUNTER,i),o=this._meterSharedState.registerMetricStorage(a);return new n.CounterInstrument(o,a)}createUpDownCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.UP_DOWN_COUNTER,i),o=this._meterSharedState.registerMetricStorage(a);return new n.UpDownCounterInstrument(o,a)}createObservableGauge(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.OBSERVABLE_GAUGE,i),o=this._meterSharedState.registerAsyncMetricStorage(a);return new n.ObservableGaugeInstrument(a,o,this._meterSharedState.observableRegistry)}createObservableCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.OBSERVABLE_COUNTER,i),o=this._meterSharedState.registerAsyncMetricStorage(a);return new n.ObservableCounterInstrument(a,o,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,i),o=this._meterSharedState.registerAsyncMetricStorage(a);return new n.ObservableUpDownCounterInstrument(a,o,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}})),JT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricStorage=void 0;let t=GT();e.MetricStorage=class{_instrumentDescriptor;constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,t.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}})),YT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeHashMap=e.HashMap=void 0;let t=Zo();var n=class{_valueMap=new Map;_keyMap=new Map;_hash;constructor(e){this._hash=e}get(e,t){return t??=this._hash(e),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let r=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,r),r}set(e,t,n){n??=this._hash(e),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??=this._hash(e),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}};e.HashMap=n,e.AttributeHashMap=class extends n{constructor(){super(t.hashAttributes)}}})),XT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeltaMetricProcessor=void 0;let t=Zo(),n=YT();e.DeltaMetricProcessor=class{_activeCollectionStorage=new n.AttributeHashMap;_cumulativeMemoStorage=new n.AttributeHashMap;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(e,n){this._aggregator=e,this._cardinalityLimit=(n??2e3)-1,this._overflowHashCode=(0,t.hashAttributes)(this._overflowAttributes)}record(e,t,n,r){let i=this._activeCollectionStorage.get(t);if(!i){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(r))?.record(e);return}i=this._aggregator.createAccumulation(r),this._activeCollectionStorage.set(t,i)}i?.record(e)}batchCumulate(e,t){for(let[n,r,i]of e.entries()){let e=n,a=i,o=this._aggregator.createAccumulation(t);o?.record(r);let s=o;if(this._cumulativeMemoStorage.has(e,a)){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(e=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(e,a))){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}if(this._activeCollectionStorage.has(e,a)){let t=this._activeCollectionStorage.get(e,a);s=this._aggregator.merge(t,s)}this._cumulativeMemoStorage.set(e,o,a),this._activeCollectionStorage.set(e,s,a)}}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new n.AttributeHashMap,e}}})),ZT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TemporalMetricProcessor=void 0;let t=Yo(),n=YT();e.TemporalMetricProcessor=class e{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(e,t){this._aggregator=e,t.forEach(e=>{this._unreportedAccumulations.set(e,[])})}buildMetrics(n,i,a,o){this._stashAccumulations(a);let s=this._getMergedUnreportedAccumulations(n),c=s,l;if(this._reportHistory.has(n)){let r=this._reportHistory.get(n),i=r.collectionTime;l=r.aggregationTemporality,c=l===t.AggregationTemporality.CUMULATIVE?e.merge(r.accumulations,s,this._aggregator):e.calibrateStartTime(r.accumulations,s,i)}else l=n.selectAggregationTemporality(i.type);this._reportHistory.set(n,{accumulations:c,collectionTime:o,aggregationTemporality:l});let u=r(c);if(u.length!==0)return this._aggregator.toMetricData(i,l,u,o)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let t=this._unreportedAccumulations.get(n);t===void 0&&(t=[],this._unreportedAccumulations.set(n,t)),t.push(e)}}_getMergedUnreportedAccumulations(t){let r=new n.AttributeHashMap,i=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),i===void 0)return r;for(let t of i)r=e.merge(r,t,this._aggregator);return r}static merge(e,t,n){let r=e,i=t.entries(),a=i.next();for(;a.done!==!0;){let[t,o,s]=a.value;if(e.has(t,s)){let i=e.get(t,s),a=n.merge(i,o);r.set(t,a,s)}else r.set(t,o,s);a=i.next()}return r}static calibrateStartTime(e,t,n){for(let[r,i]of e.keys())t.get(r,i)?.setStartTime(n);return t}};function r(e){return Array.from(e.entries())}})),QT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncMetricStorage=void 0;let t=JT(),n=XT(),r=ZT(),i=YT();e.AsyncMetricStorage=class extends t.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,t,i,a,o){super(e),this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new n.DeltaMetricProcessor(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new r.TemporalMetricProcessor(t,a),this._attributesProcessor=i}record(e,t){let n=new i.AttributeHashMap;for(let[t,r]of e.entries())n.set(this._attributesProcessor.process(t),r);this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}}})),$T=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getConflictResolutionRecipe=e.getDescriptionResolutionRecipe=e.getTypeConflictResolutionRecipe=e.getUnitConflictResolutionRecipe=e.getValueTypeConflictResolutionRecipe=e.getIncompatibilityDetails=void 0;function t(e,t){let n=``;return e.unit!==t.unit&&(n+=`\t- Unit '${e.unit}' does not match '${t.unit}'\n`),e.type!==t.type&&(n+=`\t- Type '${e.type}' does not match '${t.type}'\n`),e.valueType!==t.valueType&&(n+=`\t- Value Type '${e.valueType}' does not match '${t.valueType}'\n`),e.description!==t.description&&(n+=`\t- Description '${e.description}' does not match '${t.description}'\n`),n}e.getIncompatibilityDetails=t;function n(e,t){return`\t- use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}e.getValueTypeConflictResolutionRecipe=n;function r(e,t){return`\t- use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}e.getUnitConflictResolutionRecipe=r;function i(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'`}e.getTypeConflictResolutionRecipe=i;function a(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'
16
+ `))}_onEvent(e,t){function n(n){e===`error`&&!this.transports.includes(t)&&this.add(t),this.emit(e,n,t)}t[`__winston`+e]||(t[`__winston`+e]=n.bind(this),t.on(e,t[`__winston`+e]))}_addDefaultMeta(e){this.defaultMeta&&Object.assign(e,this.defaultMeta)}};function g(e,t){let n=e[t];return!n&&n!==0?null:n}Object.defineProperty(h.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}}),t.exports=h})),Go=t(((e,t)=>{let{LEVEL:n}=G(),r=Mo(),i=Wo(),a=To()(`winston:create-logger`);function o(e){return`is`+e.charAt(0).toUpperCase()+e.slice(1)+`Enabled`}t.exports=function(e={}){e.levels=e.levels||r.npm.levels;class t extends i{constructor(e){super(e)}}let s=new t(e);return Object.keys(e.levels).forEach(function(e){if(a(`Define prototype method for "%s"`,e),e===`log`){console.warn(`Level "log" not defined: conflicts with the method "log". Use a different level name.`);return}t.prototype[e]=function(...t){let r=this||s;if(t.length===1){let[i]=t,a=i&&i.message&&i||{message:i};return a.level=a[n]=e,r._addDefaultMeta(a),r.write(a),this||s}return t.length===0?(r.log(e,``),r):r.log(e,...t)},t.prototype[o(e)]=function(){return(this||s).isLevelEnabled(e)}}),s}})),Ko=t(((e,t)=>{let n=Go();t.exports=class{constructor(e={}){this.loggers=new Map,this.options=e}add(e,t){if(!this.loggers.has(e)){t=Object.assign({},t||this.options);let r=t.transports||this.options.transports;r?t.transports=Array.isArray(r)?r.slice():[r]:t.transports=[];let i=n(t);i.on(`close`,()=>this._delete(e)),this.loggers.set(e,i)}return this.loggers.get(e)}get(e,t){return this.add(e,t)}has(e){return!!this.loggers.has(e)}close(e){if(e)return this._removeLogger(e);this.loggers.forEach((e,t)=>this._removeLogger(t))}_removeLogger(e){this.loggers.has(e)&&(this.loggers.get(e).close(),this._delete(e))}_delete(e){this.loggers.delete(e)}}})),qo=t((e=>{let t=wa(),{warn:n}=Ta();e.version=Ea().version,e.transports=jo(),e.config=Mo(),e.addColors=t.levels,e.format=t.format,e.createLogger=Go(),e.Logger=Wo(),e.ExceptionHandler=Bo(),e.RejectionHandler=Ho(),e.Container=Ko(),e.Transport=Ga(),e.loggers=new e.Container;let r=e.createLogger();Object.keys(e.config.npm.levels).concat([`log`,`query`,`stream`,`add`,`remove`,`clear`,`profile`,`startTimer`,`handleExceptions`,`unhandleExceptions`,`handleRejections`,`unhandleRejections`,`configure`,`child`]).forEach(t=>e[t]=(...e)=>r[t](...e)),Object.defineProperty(e,"level",{get(){return r.level},set(e){r.level=e}}),Object.defineProperty(e,"exceptions",{get(){return r.exceptions}}),Object.defineProperty(e,"rejections",{get(){return r.rejections}}),[`exitOnError`].forEach(t=>{Object.defineProperty(e,t,{get(){return r[t]},set(e){r[t]=e}})}),Object.defineProperty(e,"default",{get(){return{exceptionHandlers:r.exceptionHandlers,rejectionHandlers:r.rejectionHandlers,transports:r.transports}}}),n.deprecated(e,`setLevels`),n.forFunctions(e,`useFormat`,[`cli`]),n.forProperties(e,`useFormat`,[`padLevels`,`stripColors`]),n.forFunctions(e,`deprecated`,[`addRewriter`,`addFilter`,`clone`,`extend`]),n.forProperties(e,`deprecated`,[`emitErrs`,`levelLength`])}))();function Jo(e){let t=new WeakSet;return JSON.stringify(e,function(e,n){if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n})}function Yo(e,t,n){let r=(0,qo.createLogger)({format:qo.format.combine(qo.format.timestamp({format:`YYYY-MM-DDTHH:mm:ss.SSSZ`}),{transform:e=>{let t=[];typeof e.message==`object`?t.push(Jo(e.message)):t.push(e.message);let n=e[Symbol.for(`splat`)];if(n)for(let e in n){let r=n[e];typeof r==`object`?t.push(Jo(r)):t.push(r)}return e.message=t.join(` `),e}},qo.format.errors({stack:!0}),e?qo.format.json():qo.format.simple(),qo.format.label({label:n?`worker #{workerId}`:``})),level:t?`debug`:`info`,transports:[new qo.transports.Console]}),i=e=>(...t)=>{e.apply(r,t)};console.log=i(r.info),console.info=i(r.info),console.warn=i(r.warn),console.error=i(r.error),console.debug=i(r.debug)}var Xo=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AggregationTemporality=void 0,(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(e.AggregationTemporality||={})})),Zo=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataPointType=e.InstrumentType=void 0,(function(e){e.COUNTER=`COUNTER`,e.GAUGE=`GAUGE`,e.HISTOGRAM=`HISTOGRAM`,e.UP_DOWN_COUNTER=`UP_DOWN_COUNTER`,e.OBSERVABLE_COUNTER=`OBSERVABLE_COUNTER`,e.OBSERVABLE_GAUGE=`OBSERVABLE_GAUGE`,e.OBSERVABLE_UP_DOWN_COUNTER=`OBSERVABLE_UP_DOWN_COUNTER`})(e.InstrumentType||={}),(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(e.DataPointType||={})})),Qo=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.equalsCaseInsensitive=e.binarySearchUB=e.setEquals=e.callWithTimeout=e.TimeoutError=e.instrumentationScopeId=e.hashAttributes=void 0;function t(e){let t=Object.keys(e);return t.length===0?``:(t=t.sort(),JSON.stringify(t.map(t=>[t,e[t]])))}e.hashAttributes=t;function n(e){return`${e.name}:${e.version??``}:${e.schemaUrl??``}`}e.instrumentationScopeId=n;var r=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};e.TimeoutError=r;function i(e,t){let n,i=new Promise(function(e,i){n=setTimeout(function(){i(new r(`Operation timed out.`))},t)});return Promise.race([e,i]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}e.callWithTimeout=i;function a(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}e.setEquals=a;function o(e,t){let n=0,r=e.length-1,i=e.length;for(;r>=n;){let a=n+Math.trunc((r-n)/2);e[a]<t?n=a+1:(i=a,r=a-1)}return i}e.binarySearchUB=o;function s(e,t){return e.toLowerCase()===t.toLowerCase()}e.equalsCaseInsensitive=s})),$o=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AggregatorKind=void 0,(function(e){e[e.DROP=0]=`DROP`,e[e.SUM=1]=`SUM`,e[e.LAST_VALUE=2]=`LAST_VALUE`,e[e.HISTOGRAM=3]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=4]=`EXPONENTIAL_HISTOGRAM`})(e.AggregatorKind||={})})),es=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DropAggregator=void 0;let t=$o();e.DropAggregator=class{kind=t.AggregatorKind.DROP;createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,r){}}})),ts=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HistogramAggregator=e.HistogramAccumulation=void 0;let t=$o(),n=Zo(),r=Qo();function i(e){let t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var a=class{startTime;_boundaries;_recordMinMax;_current;constructor(e,t,n=!0,r=i(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=r}record(e){if(Number.isNaN(e))return;this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=(0,r.binarySearchUB)(this._boundaries,e);this._current.buckets.counts[t]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};e.HistogramAccumulation=a,e.HistogramAggregator=class{kind=t.AggregatorKind.HISTOGRAM;_boundaries;_recordMinMax;constructor(e,t){this._boundaries=e,this._recordMinMax=t}createAccumulation(e){return new a(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,o=r.buckets.counts,s=Array(i.length);for(let e=0;e<i.length;e++)s[e]=i[e]+o[e];let c=1/0,l=-1/0;return this._recordMinMax&&(n.hasMinMax&&r.hasMinMax?(c=Math.min(n.min,r.min),l=Math.max(n.max,r.max)):n.hasMinMax?(c=n.min,l=n.max):r.hasMinMax&&(c=r.min,l=r.max)),new a(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:s},count:n.count+r.count,sum:n.sum+r.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||r.hasMinMax),min:c,max:l})}diff(e,t){let n=e.toPointValue(),r=t.toPointValue(),i=n.buckets.counts,o=r.buckets.counts,s=Array(i.length);for(let e=0;e<i.length;e++)s[e]=o[e]-i[e];return new a(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:s},count:r.count-n.count,sum:r.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:n.DataPointType.HISTOGRAM,dataPoints:r.map(([t,r])=>{let a=r.toPointValue(),o=e.type===n.InstrumentType.GAUGE||e.type===n.InstrumentType.UP_DOWN_COUNTER||e.type===n.InstrumentType.OBSERVABLE_GAUGE||e.type===n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:o?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}}})),ns=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Buckets=void 0,e.Buckets=class e{backing;indexBase;indexStart;indexEnd;constructor(e=new t,n=0,r=0,i=0){this.backing=e,this.indexBase=n,this.indexStart=r,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,r=0,i=0;for(let e=this.indexStart;e<=this.indexEnd;){let a=e%n;a<0&&(a+=n);for(let o=a;o<n&&r<t;o++)this._relocateBucket(i,r),r++,e++;i++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new e(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}};var t=class e{_counts;constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let r=Array(e).fill(0);r.splice(n,this._counts.length-t,...this._counts.slice(t)),r.splice(0,t,...this._counts.slice(0,t)),this._counts=r}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let r=0;r<n;r++){let n=this._counts[e+r];this._counts[e+r]=this._counts[t-r-1],this._counts[t-r-1]=n}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new e([...this._counts])}}})),rs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSignificand=e.getNormalBase2=e.MIN_VALUE=e.MAX_NORMAL_EXPONENT=e.MIN_NORMAL_EXPONENT=e.SIGNIFICAND_WIDTH=void 0,e.SIGNIFICAND_WIDTH=52;let t=1023;e.MIN_NORMAL_EXPONENT=-1022,e.MAX_NORMAL_EXPONENT=t,e.MIN_VALUE=2**-1022;function n(e){let n=new DataView(new ArrayBuffer(8));return n.setFloat64(0,e),((n.getUint32(0)&2146435072)>>20)-t}e.getNormalBase2=n;function r(e){let t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);let n=t.getUint32(0),r=t.getUint32(4);return(n&1048575)*2**32+r}e.getSignificand=r})),is=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.nextGreaterSquare=e.ldexp=void 0;function t(e,t){return e===0||e===1/0||e===-1/0||Number.isNaN(e)?e:e*2**t}e.ldexp=t;function n(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}e.nextGreaterSquare=n})),as=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MappingError=void 0,e.MappingError=class extends Error{}})),os=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExponentMapping=void 0;let t=rs(),n=is(),r=as();e.ExponentMapping=class{_shift;constructor(e){this._shift=-e}mapToIndex(e){return e<t.MIN_VALUE?this._minNormalLowerBoundaryIndex():t.getNormalBase2(e)+this._rightShift(t.getSignificand(e)-1,t.SIGNIFICAND_WIDTH)>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new r.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let i=this._maxNormalLowerBoundaryIndex();if(e>i)throw new r.MappingError(`overflow: ${e} is > maximum lower boundary: ${i}`);return n.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=t.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return t.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*2**-t)}}})),ss=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LogarithmMapping=void 0;let t=rs(),n=is(),r=as();e.LogarithmMapping=class{_scale;_scaleFactor;_inverseFactor;constructor(e){this._scale=e,this._scaleFactor=n.ldexp(Math.LOG2E,e),this._inverseFactor=n.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=t.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(t.getSignificand(e)===0)return(t.getNormalBase2(e)<<this._scale)-1;let n=Math.floor(Math.log(e)*this._scaleFactor),r=this._maxNormalLowerBoundaryIndex();return n>=r?r:n}lowerBoundary(e){let n=this._maxNormalLowerBoundaryIndex();if(e>=n){if(e===n)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new r.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`)}let i=this._minNormalLowerBoundaryIndex();if(e<=i){if(e===i)return t.MIN_VALUE;if(e===i-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new r.MappingError(`overflow: ${e} is < minimum lower boundary: ${i}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return t.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(t.MAX_NORMAL_EXPONENT+1<<this._scale)-1}}})),cs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getMapping=void 0;let t=os(),n=ss(),r=as(),i=Array.from({length:31},(e,r)=>r>10?new n.LogarithmMapping(r-10):new t.ExponentMapping(r-10));function a(e){if(e>20||e<-10)throw new r.MappingError(`expected scale >= -10 && <= 20, got: ${e}`);return i[e+10]}e.getMapping=a})),ls=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExponentialHistogramAggregator=e.ExponentialHistogramAccumulation=void 0;let t=$o(),n=Zo(),r=(c(),i(d)),a=ns(),o=cs(),s=is();var l=class e{static combine(t,n){return new e(Math.min(t.low,n.low),Math.max(t.high,n.high))}low;high;constructor(e,t){this.low=e,this.high=t}},u=class e{startTime;_maxSize;_recordMinMax;_sum;_count;_zeroCount;_min;_max;_positive;_negative;_mapping;constructor(e,t=160,n=!0,i=0,s=0,c=0,l=1/0,u=-1/0,d=new a.Buckets,f=new a.Buckets,p=(0,o.getMapping)(20)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=c,this._min=l,this._max=u,this._positive=d,this._negative=f,this._mapping=p,this._maxSize<2&&(r.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \
17
+ changing to the minimum size of: 2`),this._maxSize=2)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(!Number.isNaN(e)){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new e(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let r=this._mapping.mapToIndex(t),i=!1,a=0,o=0;if(e.length===0?(e.indexStart=r,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):r<e.indexStart&&e.indexEnd-r>=this._maxSize?(i=!0,o=r,a=e.indexEnd):r>e.indexEnd&&r-e.indexStart>=this._maxSize&&(i=!0,o=e.indexStart,a=r),i){let e=this._changeScale(a,o);this._downscale(e),r=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,r,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(e.length===0&&(e.indexStart=e.indexEnd=e.indexBase=t),t<e.indexStart){let n=e.indexEnd-t;n>=e.backing.length&&this._grow(e,n+1),e.indexStart=t}else if(t>e.indexEnd){let n=t-e.indexStart;n>=e.backing.length&&this._grow(e,n+1),e.indexEnd=t}let r=t-e.indexBase;r<0&&(r+=e.backing.length),e.incrementBucket(r,n)}_grow(e,t){let n=e.backing.length,r=e.indexBase-e.indexStart,i=n-r,a=(0,s.nextGreaterSquare)(t);a>this._maxSize&&(a=this._maxSize);let o=a-r;e.backing.growTo(a,i,o)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,o.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=l.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),r=l.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(r.high,r.low))}_highLowAtScale(e,t,n){if(e.length===0)return new l(0,-1);let r=t-n;return new l(e.indexStart>>r,e.indexEnd>>r)}_mergeBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++)this._incrementIndexBy(e,i+t>>a,n.at(t))}_diffBuckets(e,t,n,r){let i=n.offset,a=t.scale-r;for(let t=0;t<n.length;t++){let r=(i+t>>a)-e.indexBase;r<0&&(r+=e.backing.length),e.decrementBucket(r,n.at(t))}e.trim()}};e.ExponentialHistogramAccumulation=u,e.ExponentialHistogramAggregator=class{kind=t.AggregatorKind.EXPONENTIAL_HISTOGRAM;_maxSize;_recordMinMax;constructor(e,t){this._maxSize=e,this._recordMinMax=t}createAccumulation(e){return new u(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:n.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:r.map(([t,r])=>{let a=r.toPointValue(),o=e.type===n.InstrumentType.GAUGE||e.type===n.InstrumentType.UP_DOWN_COUNTER||e.type===n.InstrumentType.OBSERVABLE_GAUGE||e.type===n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:t,startTime:r.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:o?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}}})),us=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isTracingSuppressed=e.unsuppressTracing=e.suppressTracing=void 0;let t=(0,(c(),i(d)).createContextKey)(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function n(e){return e.setValue(t,!0)}e.suppressTracing=n;function r(e){return e.deleteValue(t)}e.unsuppressTracing=r;function a(e){return e.getValue(t)===!0}e.isTracingSuppressed=a})),ds=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BAGGAGE_MAX_TOTAL_LENGTH=e.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=e.BAGGAGE_MAX_NAME_VALUE_PAIRS=e.BAGGAGE_HEADER=e.BAGGAGE_ITEMS_SEPARATOR=e.BAGGAGE_PROPERTIES_SEPARATOR=e.BAGGAGE_KEY_PAIR_SEPARATOR=void 0,e.BAGGAGE_KEY_PAIR_SEPARATOR=`=`,e.BAGGAGE_PROPERTIES_SEPARATOR=`;`,e.BAGGAGE_ITEMS_SEPARATOR=`,`,e.BAGGAGE_HEADER=`baggage`,e.BAGGAGE_MAX_NAME_VALUE_PAIRS=180,e.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096,e.BAGGAGE_MAX_TOTAL_LENGTH=8192})),fs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseKeyPairsIntoRecord=e.parsePairKeyValue=e.getKeyPairs=e.serializeKeyPairs=void 0;let t=(c(),i(d)),n=ds();function r(e){return e.reduce((e,t)=>{let r=`${e}${e===``?``:n.BAGGAGE_ITEMS_SEPARATOR}${t}`;return r.length>n.BAGGAGE_MAX_TOTAL_LENGTH?e:r},``)}e.serializeKeyPairs=r;function a(e){return e.getAllEntries().map(([e,t])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(r+=n.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),r})}e.getKeyPairs=a;function o(e){if(!e)return;let r=e.indexOf(n.BAGGAGE_PROPERTIES_SEPARATOR),i=r===-1?e:e.substring(0,r),a=i.indexOf(n.BAGGAGE_KEY_PAIR_SEPARATOR);if(a<=0)return;let o=i.substring(0,a).trim(),s=i.substring(a+1).trim();if(!o||!s)return;let c,l;try{c=decodeURIComponent(o),l=decodeURIComponent(s)}catch{return}let u;if(r!==-1&&r<e.length-1){let n=e.substring(r+1);u=(0,t.baggageEntryMetadataFromString)(n)}return{key:c,value:l,metadata:u}}e.parsePairKeyValue=o;function s(e){let t={};return typeof e==`string`&&e.length>0&&e.split(n.BAGGAGE_ITEMS_SEPARATOR).forEach(e=>{let n=o(e);n!==void 0&&n.value.length>0&&(t[n.key]=n.value)}),t}e.parseKeyPairsIntoRecord=s})),ps=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.W3CBaggagePropagator=void 0;let t=(c(),i(d)),n=us(),r=ds(),a=fs();e.W3CBaggagePropagator=class{inject(e,i,o){let s=t.propagation.getBaggage(e);if(!s||(0,n.isTracingSuppressed)(e))return;let c=(0,a.getKeyPairs)(s).filter(e=>e.length<=r.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,r.BAGGAGE_MAX_NAME_VALUE_PAIRS),l=(0,a.serializeKeyPairs)(c);l.length>0&&o.set(i,r.BAGGAGE_HEADER,l)}extract(e,n,i){let o=i.get(n,r.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(r.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let c={};return s.length===0||(s.split(r.BAGGAGE_ITEMS_SEPARATOR).forEach(e=>{let t=(0,a.parsePairKeyValue)(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),c[t.key]=e}}),Object.entries(c).length===0)?e:t.propagation.setBaggage(e,t.propagation.createBaggage(c))}fields(){return[r.BAGGAGE_HEADER]}}})),ms=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnchoredClock=void 0,e.AnchoredClock=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}})),hs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isAttributeValue=e.isAttributeKey=e.sanitizeAttributes=void 0;let t=(c(),i(d));function n(e){let n={};if(typeof e!=`object`||!e)return n;for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;if(!r(i)){t.diag.warn(`Invalid attribute key: ${i}`);continue}let o=e[i];if(!a(o)){t.diag.warn(`Invalid attribute value set for key: ${i}`);continue}Array.isArray(o)?n[i]=o.slice():n[i]=o}return n}e.sanitizeAttributes=n;function r(e){return typeof e==`string`&&e!==``}e.isAttributeKey=r;function a(e){return e==null?!0:Array.isArray(e)?o(e):s(typeof e)}e.isAttributeValue=a;function o(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(s(e)){t=e;continue}return!1}return!1}}return!0}function s(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}})),gs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.loggingErrorHandler=void 0;let t=(c(),i(d));function n(){return e=>{t.diag.error(r(e))}}e.loggingErrorHandler=n;function r(e){return typeof e==`string`?e:JSON.stringify(a(e))}function a(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}})),_s=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.globalErrorHandler=e.setGlobalErrorHandler=void 0;let t=(0,gs().loggingErrorHandler)();function n(e){t=e}e.setGlobalErrorHandler=n;function r(e){try{t(e)}catch{}}e.globalErrorHandler=r})),vs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getStringListFromEnv=e.getBooleanFromEnv=e.getStringFromEnv=e.getNumberFromEnv=void 0;let t=(c(),i(d)),n=s(`util`);function r(e){let r=process.env[e];if(r==null||r.trim()===``)return;let i=Number(r);if(isNaN(i)){t.diag.warn(`Unknown value ${(0,n.inspect)(r)} for ${e}, expected a number, using defaults`);return}return i}e.getNumberFromEnv=r;function a(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}e.getStringFromEnv=a;function o(e){let r=process.env[e]?.trim().toLowerCase();return r==null||r===``?!1:r===`true`?!0:(r===`false`||t.diag.warn(`Unknown value ${(0,n.inspect)(r)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}e.getBooleanFromEnv=o;function l(e){return a(e)?.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}e.getStringListFromEnv=l})),ys=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._globalThis=void 0,e._globalThis=globalThis})),bs=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`2.7.1`}));function K(e){let t={},n=e.length;for(let r=0;r<n;r++){let n=e[r];n&&(t[String(n).toUpperCase().replace(/[-.]/g,`_`)]=n)}return t}var xs=n((()=>{})),Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl,Gl,Kl,ql,Jl,Yl,Xl,Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd,zd,Bd,Vd,Hd,Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,lf,uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp,_p,vp,yp,bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh,ih,ah,oh,sh,ch,lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh,Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg,Sg,Cg,wg,Tg,Eg,Dg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg,Ig=n((()=>{xs(),Ss=`aws.lambda.invoked_arn`,Cs=`db.system`,ws=`db.connection_string`,Ts=`db.user`,Es=`db.jdbc.driver_classname`,Ds=`db.name`,Os=`db.statement`,ks=`db.operation`,As=`db.mssql.instance_name`,js=`db.cassandra.keyspace`,Ms=`db.cassandra.page_size`,Ns=`db.cassandra.consistency_level`,Ps=`db.cassandra.table`,Fs=`db.cassandra.idempotence`,Is=`db.cassandra.speculative_execution_count`,Ls=`db.cassandra.coordinator.id`,Rs=`db.cassandra.coordinator.dc`,zs=`db.hbase.namespace`,Bs=`db.redis.database_index`,Vs=`db.mongodb.collection`,Hs=`db.sql.table`,Us=`exception.type`,Ws=`exception.message`,Gs=`exception.stacktrace`,Ks=`exception.escaped`,qs=`faas.trigger`,Js=`faas.execution`,Ys=`faas.document.collection`,Xs=`faas.document.operation`,Zs=`faas.document.time`,Qs=`faas.document.name`,$s=`faas.time`,ec=`faas.cron`,tc=`faas.coldstart`,nc=`faas.invoked_name`,rc=`faas.invoked_provider`,ic=`faas.invoked_region`,ac=`net.transport`,oc=`net.peer.ip`,sc=`net.peer.port`,cc=`net.peer.name`,lc=`net.host.ip`,uc=`net.host.port`,dc=`net.host.name`,fc=`net.host.connection.type`,pc=`net.host.connection.subtype`,mc=`net.host.carrier.name`,hc=`net.host.carrier.mcc`,gc=`net.host.carrier.mnc`,_c=`net.host.carrier.icc`,vc=`peer.service`,yc=`enduser.id`,bc=`enduser.role`,xc=`enduser.scope`,Sc=`thread.id`,Cc=`thread.name`,wc=`code.function`,Tc=`code.namespace`,Ec=`code.filepath`,Dc=`code.lineno`,Oc=`http.method`,kc=`http.url`,Ac=`http.target`,jc=`http.host`,Mc=`http.scheme`,Nc=`http.status_code`,Pc=`http.flavor`,Fc=`http.user_agent`,Ic=`http.request_content_length`,Lc=`http.request_content_length_uncompressed`,Rc=`http.response_content_length`,zc=`http.response_content_length_uncompressed`,Bc=`http.server_name`,Vc=`http.route`,Hc=`http.client_ip`,Uc=`aws.dynamodb.table_names`,Wc=`aws.dynamodb.consumed_capacity`,Gc=`aws.dynamodb.item_collection_metrics`,Kc=`aws.dynamodb.provisioned_read_capacity`,qc=`aws.dynamodb.provisioned_write_capacity`,Jc=`aws.dynamodb.consistent_read`,Yc=`aws.dynamodb.projection`,Xc=`aws.dynamodb.limit`,Zc=`aws.dynamodb.attributes_to_get`,Qc=`aws.dynamodb.index_name`,$c=`aws.dynamodb.select`,el=`aws.dynamodb.global_secondary_indexes`,tl=`aws.dynamodb.local_secondary_indexes`,nl=`aws.dynamodb.exclusive_start_table`,rl=`aws.dynamodb.table_count`,il=`aws.dynamodb.scan_forward`,al=`aws.dynamodb.segment`,ol=`aws.dynamodb.total_segments`,sl=`aws.dynamodb.count`,cl=`aws.dynamodb.scanned_count`,ll=`aws.dynamodb.attribute_definitions`,ul=`aws.dynamodb.global_secondary_index_updates`,dl=`messaging.system`,fl=`messaging.destination`,pl=`messaging.destination_kind`,ml=`messaging.temp_destination`,hl=`messaging.protocol`,gl=`messaging.protocol_version`,_l=`messaging.url`,vl=`messaging.message_id`,yl=`messaging.conversation_id`,bl=`messaging.message_payload_size_bytes`,xl=`messaging.message_payload_compressed_size_bytes`,Sl=`messaging.operation`,Cl=`messaging.consumer_id`,wl=`messaging.rabbitmq.routing_key`,Tl=`messaging.kafka.message_key`,El=`messaging.kafka.consumer_group`,Dl=`messaging.kafka.client_id`,Ol=`messaging.kafka.partition`,kl=`messaging.kafka.tombstone`,Al=`rpc.system`,jl=`rpc.service`,Ml=`rpc.method`,Nl=`rpc.grpc.status_code`,Pl=`rpc.jsonrpc.version`,Fl=`rpc.jsonrpc.request_id`,Il=`rpc.jsonrpc.error_code`,Ll=`rpc.jsonrpc.error_message`,Rl=`message.type`,zl=`message.id`,Bl=`message.compressed_size`,Vl=`message.uncompressed_size`,Hl=Ss,Ul=Cs,Wl=ws,Gl=Ts,Kl=Es,ql=Ds,Jl=Os,Yl=ks,Xl=As,Zl=js,Ql=Ms,$l=Ns,eu=Ps,tu=Fs,nu=Is,ru=Ls,iu=Rs,au=zs,ou=Bs,su=Vs,cu=Hs,lu=Us,uu=Ws,du=Gs,fu=Ks,pu=qs,mu=Js,hu=Ys,gu=Xs,_u=Zs,vu=Qs,yu=$s,bu=ec,xu=tc,Su=nc,Cu=rc,wu=ic,Tu=ac,Eu=oc,Du=sc,Ou=cc,ku=lc,Au=uc,ju=dc,Mu=fc,Nu=pc,Pu=mc,Fu=hc,Iu=gc,Lu=_c,Ru=vc,zu=yc,Bu=bc,Vu=xc,Hu=Sc,Uu=Cc,Wu=wc,Gu=Tc,Ku=Ec,qu=Dc,Ju=Oc,Yu=kc,Xu=Ac,Zu=jc,Qu=Mc,$u=Nc,ed=Pc,td=Fc,nd=Ic,rd=Lc,id=Rc,ad=zc,od=Bc,sd=Vc,cd=Hc,ld=Uc,ud=Wc,dd=Gc,fd=Kc,pd=qc,md=Jc,hd=Yc,gd=Xc,_d=Zc,vd=Qc,yd=$c,bd=el,xd=tl,Sd=nl,Cd=rl,wd=il,Td=al,Ed=ol,Dd=sl,Od=cl,kd=ll,Ad=ul,jd=dl,Md=fl,Nd=pl,Pd=ml,Fd=hl,Id=gl,Ld=_l,Rd=vl,zd=yl,Bd=bl,Vd=xl,Hd=Sl,Ud=Cl,Wd=wl,Gd=Tl,Kd=El,qd=Dl,Jd=Ol,Yd=kl,Xd=Al,Zd=jl,Qd=Ml,$d=Nl,ef=Pl,tf=Fl,nf=Il,rf=Ll,af=Rl,of=zl,sf=Bl,cf=Vl,lf=K([Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs,Bs,Vs,Hs,Us,Ws,Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl,zl,Bl,Vl]),uf=`other_sql`,df=`mssql`,ff=`mysql`,pf=`oracle`,mf=`db2`,hf=`postgresql`,gf=`redshift`,_f=`hive`,vf=`cloudscape`,yf=`hsqldb`,bf=`progress`,xf=`maxdb`,Sf=`hanadb`,Cf=`ingres`,wf=`firstsql`,Tf=`edb`,Ef=`cache`,Df=`adabas`,Of=`firebird`,kf=`derby`,Af=`filemaker`,jf=`informix`,Mf=`instantdb`,Nf=`interbase`,Pf=`mariadb`,Ff=`netezza`,If=`pervasive`,Lf=`pointbase`,Rf=`sqlite`,zf=`sybase`,Bf=`teradata`,Vf=`vertica`,Hf=`h2`,Uf=`coldfusion`,Wf=`cassandra`,Gf=`hbase`,Kf=`mongodb`,qf=`redis`,Jf=`couchbase`,Yf=`couchdb`,Xf=`cosmosdb`,Zf=`dynamodb`,Qf=`neo4j`,$f=`geode`,ep=`elasticsearch`,tp=`memcached`,np=`cockroachdb`,rp=uf,ip=df,ap=ff,op=pf,sp=hf,cp=gf,lp=_f,up=vf,dp=yf,fp=bf,pp=xf,mp=Sf,hp=Cf,gp=wf,_p=Ef,vp=Df,yp=Of,bp=kf,xp=Af,Sp=jf,Cp=Mf,wp=Nf,Tp=Pf,Ep=Ff,Dp=If,Op=Lf,kp=Rf,Ap=zf,jp=Bf,Mp=Vf,Np=Uf,Pp=Wf,Fp=Gf,Ip=Kf,Lp=qf,Rp=Jf,zp=Yf,Bp=Xf,Vp=Zf,Hp=Qf,Up=$f,Wp=ep,Gp=tp,Kp=np,qp=K([uf,df,ff,pf,mf,hf,gf,_f,vf,yf,bf,xf,Sf,Cf,wf,Tf,Ef,Df,Of,kf,Af,jf,Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np]),Jp=`all`,Yp=`each_quorum`,Xp=`quorum`,Zp=`local_quorum`,Qp=`one`,$p=`two`,em=`three`,tm=`local_one`,nm=`any`,rm=`serial`,im=`local_serial`,am=Yp,om=Xp,sm=Zp,cm=em,lm=tm,um=rm,dm=im,fm=K([Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im]),pm=`datasource`,mm=`http`,hm=`pubsub`,gm=`timer`,_m=`other`,vm=pm,ym=mm,bm=hm,xm=gm,Sm=_m,Cm=K([pm,mm,hm,gm,_m]),wm=`insert`,Tm=`edit`,Em=`delete`,Dm=wm,Om=Tm,km=Em,Am=K([wm,Tm,Em]),jm=`alibaba_cloud`,Mm=`aws`,Nm=`azure`,Pm=`gcp`,Fm=jm,Im=Nm,Lm=K([jm,Mm,Nm,Pm]),Rm=`ip_tcp`,zm=`ip_udp`,Bm=`ip`,Vm=`unix`,Hm=`pipe`,Um=`inproc`,Wm=`other`,Gm=Rm,Km=zm,qm=Vm,Jm=Hm,Ym=Um,Xm=Wm,Zm=K([Rm,zm,Bm,Vm,Hm,Um,Wm]),Qm=`wifi`,$m=`wired`,eh=`cell`,th=`unavailable`,nh=`unknown`,rh=Qm,ih=$m,ah=eh,oh=th,sh=nh,ch=K([Qm,$m,eh,th,nh]),lh=`gprs`,uh=`edge`,dh=`umts`,fh=`cdma`,ph=`evdo_0`,mh=`evdo_a`,hh=`cdma2000_1xrtt`,gh=`hsdpa`,_h=`hsupa`,vh=`hspa`,yh=`iden`,bh=`evdo_b`,xh=`lte`,Sh=`ehrpd`,Ch=`hspap`,wh=`gsm`,Th=`td_scdma`,Eh=`iwlan`,Dh=`nr`,Oh=`nrnsa`,kh=`lte_ca`,Ah=lh,jh=uh,Mh=dh,Nh=fh,Ph=ph,Fh=mh,Ih=hh,Lh=gh,Rh=_h,zh=vh,Bh=yh,Vh=bh,Hh=Sh,Uh=Ch,Wh=Th,Gh=Eh,Kh=Oh,qh=kh,Jh=K([lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh]),Yh=`1.0`,Xh=`1.1`,Zh=`2.0`,Qh=`SPDY`,$h=`QUIC`,eg=Qh,tg=$h,ng={HTTP_1_0:Yh,HTTP_1_1:Xh,HTTP_2_0:Zh,SPDY:Qh,QUIC:$h},rg=`queue`,ig=`topic`,ag=rg,og=ig,sg=K([rg,ig]),cg=`receive`,lg=`process`,ug=cg,dg=lg,fg=K([cg,lg]),pg=0,mg=1,hg=2,gg=3,_g=4,vg=5,yg=6,bg=7,xg=8,Sg=9,Cg=10,wg=11,Tg=12,Eg=13,Dg=14,Og=15,kg=16,Ag={OK:pg,CANCELLED:mg,UNKNOWN:hg,INVALID_ARGUMENT:gg,DEADLINE_EXCEEDED:_g,NOT_FOUND:vg,ALREADY_EXISTS:yg,PERMISSION_DENIED:bg,RESOURCE_EXHAUSTED:xg,FAILED_PRECONDITION:Sg,ABORTED:Cg,OUT_OF_RANGE:wg,UNIMPLEMENTED:Tg,INTERNAL:Eg,UNAVAILABLE:Dg,DATA_LOSS:Og,UNAUTHENTICATED:kg},jg=`SENT`,Mg=`RECEIVED`,Ng=jg,Pg=Mg,Fg=K([jg,Mg])})),Lg=n((()=>{Ig()})),Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_,p_,m_,h_,g_,__,v_,y_,b_,x_,S_,C_,w_,T_,E_,D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv,dv,fv,pv,mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,jv,Mv,Nv,Pv,Fv,Iv,Lv,Rv,zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly,uy,dy,fy,py,my,hy,gy,_y,vy,yy,by,xy,Sy,Cy,wy,Ty,Ey,Dy,Oy,ky,Ay,jy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb,cb,lb,ub,db,fb,pb,mb,hb,gb,_b,vb,yb,bb,xb,Sb,Cb,wb,Tb,Eb,Db,Ob,kb,Ab,jb,Mb,Nb,Pb,Fb,Ib,Lb,Rb,zb,Bb,Vb,Hb,Ub,Wb,Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx,nx,rx,ix,ax,ox,sx,cx,lx,ux,dx,fx,px,mx,hx,gx,_x,vx,yx,bx,xx,Sx,Cx,wx,Tx,Ex,Dx,Ox,kx,Ax,jx=n((()=>{xs(),Rg=`cloud.provider`,zg=`cloud.account.id`,Bg=`cloud.region`,Vg=`cloud.availability_zone`,Hg=`cloud.platform`,Ug=`aws.ecs.container.arn`,Wg=`aws.ecs.cluster.arn`,Gg=`aws.ecs.launchtype`,Kg=`aws.ecs.task.arn`,qg=`aws.ecs.task.family`,Jg=`aws.ecs.task.revision`,Yg=`aws.eks.cluster.arn`,Xg=`aws.log.group.names`,Zg=`aws.log.group.arns`,Qg=`aws.log.stream.names`,$g=`aws.log.stream.arns`,e_=`container.name`,t_=`container.id`,n_=`container.runtime`,r_=`container.image.name`,i_=`container.image.tag`,a_=`deployment.environment`,o_=`device.id`,s_=`device.model.identifier`,c_=`device.model.name`,l_=`faas.name`,u_=`faas.id`,d_=`faas.version`,f_=`faas.instance`,p_=`faas.max_memory`,m_=`host.id`,h_=`host.name`,g_=`host.type`,__=`host.arch`,v_=`host.image.name`,y_=`host.image.id`,b_=`host.image.version`,x_=`k8s.cluster.name`,S_=`k8s.node.name`,C_=`k8s.node.uid`,w_=`k8s.namespace.name`,T_=`k8s.pod.uid`,E_=`k8s.pod.name`,D_=`k8s.container.name`,O_=`k8s.replicaset.uid`,k_=`k8s.replicaset.name`,A_=`k8s.deployment.uid`,j_=`k8s.deployment.name`,M_=`k8s.statefulset.uid`,N_=`k8s.statefulset.name`,P_=`k8s.daemonset.uid`,F_=`k8s.daemonset.name`,I_=`k8s.job.uid`,L_=`k8s.job.name`,R_=`k8s.cronjob.uid`,z_=`k8s.cronjob.name`,B_=`os.type`,V_=`os.description`,H_=`os.name`,U_=`os.version`,W_=`process.pid`,G_=`process.executable.name`,K_=`process.executable.path`,q_=`process.command`,J_=`process.command_line`,Y_=`process.command_args`,X_=`process.owner`,Z_=`process.runtime.name`,Q_=`process.runtime.version`,$_=`process.runtime.description`,ev=`service.name`,tv=`service.namespace`,nv=`service.instance.id`,rv=`service.version`,iv=`telemetry.sdk.name`,av=`telemetry.sdk.language`,ov=`telemetry.sdk.version`,sv=`telemetry.auto.version`,cv=`webengine.name`,lv=`webengine.version`,uv=`webengine.description`,dv=Rg,fv=zg,pv=Bg,mv=Vg,hv=Hg,gv=Ug,_v=Wg,vv=Gg,yv=Kg,bv=qg,xv=Jg,Sv=Yg,Cv=Xg,wv=Zg,Tv=Qg,Ev=$g,Dv=e_,Ov=t_,kv=n_,Av=r_,jv=i_,Mv=a_,Nv=o_,Pv=s_,Fv=c_,Iv=l_,Lv=u_,Rv=d_,zv=f_,Bv=p_,Vv=m_,Hv=h_,Uv=g_,Wv=__,Gv=v_,Kv=y_,qv=b_,Jv=x_,Yv=S_,Xv=C_,Zv=w_,Qv=T_,$v=E_,ey=D_,ty=O_,ny=k_,ry=A_,iy=j_,ay=M_,oy=N_,sy=P_,cy=F_,ly=I_,uy=L_,dy=R_,fy=z_,py=B_,my=V_,hy=H_,gy=U_,_y=W_,vy=G_,yy=K_,by=q_,xy=J_,Sy=Y_,Cy=X_,wy=Z_,Ty=Q_,Ey=$_,Dy=ev,Oy=tv,ky=nv,Ay=rv,jy=iv,My=av,Ny=ov,Py=sv,Fy=cv,Iy=lv,Ly=uv,Ry=K([Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_,p_,m_,h_,g_,__,v_,y_,b_,x_,S_,C_,w_,T_,E_,D_,O_,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv,lv,uv]),zy=`alibaba_cloud`,By=`aws`,Vy=`azure`,Hy=`gcp`,Uy=zy,Wy=Vy,Gy=K([zy,By,Vy,Hy]),Ky=`alibaba_cloud_ecs`,qy=`alibaba_cloud_fc`,Jy=`aws_ec2`,Yy=`aws_ecs`,Xy=`aws_eks`,Zy=`aws_lambda`,Qy=`aws_elastic_beanstalk`,$y=`azure_vm`,eb=`azure_container_instances`,tb=`azure_aks`,nb=`azure_functions`,rb=`azure_app_service`,ib=`gcp_compute_engine`,ab=`gcp_cloud_run`,ob=`gcp_kubernetes_engine`,sb=`gcp_cloud_functions`,cb=`gcp_app_engine`,lb=Ky,ub=qy,db=Jy,fb=Yy,pb=Xy,mb=Zy,hb=Qy,gb=$y,_b=eb,vb=tb,yb=nb,bb=rb,xb=ib,Sb=ab,Cb=ob,wb=sb,Tb=cb,Eb=K([Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb,cb]),Db=`ec2`,Ob=`fargate`,kb=Ob,Ab=K([Db,Ob]),jb=`amd64`,Mb=`arm32`,Nb=`arm64`,Pb=`ia64`,Fb=`ppc32`,Ib=`ppc64`,Lb=`x86`,Rb=jb,zb=Mb,Bb=Nb,Vb=Pb,Hb=Fb,Ub=Ib,Wb=K([jb,Mb,Nb,Pb,Fb,Ib,Lb]),Gb=`windows`,Kb=`linux`,qb=`darwin`,Jb=`freebsd`,Yb=`netbsd`,Xb=`openbsd`,Zb=`dragonflybsd`,Qb=`hpux`,$b=`aix`,ex=`solaris`,tx=`z_os`,nx=Gb,rx=Kb,ix=qb,ax=Jb,ox=Yb,sx=Xb,cx=Zb,lx=Qb,ux=ex,dx=tx,fx=K([Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx]),px=`cpp`,mx=`dotnet`,hx=`erlang`,gx=`go`,_x=`java`,vx=`nodejs`,yx=`php`,bx=`python`,xx=`ruby`,Sx=`webjs`,Cx=mx,wx=hx,Tx=_x,Ex=vx,Dx=bx,Ox=xx,kx=Sx,Ax=K([px,mx,hx,gx,_x,vx,yx,bx,xx,Sx])})),Mx=n((()=>{jx()})),Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx,Ux,Wx,Gx,Kx,qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS,rS,iS,aS,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC=n((()=>{Nx=`aspnetcore.diagnostics.exception.result`,Px=`aborted`,Fx=`handled`,Ix=`skipped`,Lx=`unhandled`,Rx=`aspnetcore.diagnostics.handler.type`,zx=`aspnetcore.rate_limiting.policy`,Bx=`aspnetcore.rate_limiting.result`,Vx=`acquired`,Hx=`endpoint_limiter`,Ux=`global_limiter`,Wx=`request_canceled`,Gx=`aspnetcore.request.is_unhandled`,Kx=`aspnetcore.routing.is_fallback`,qx=`aspnetcore.routing.match_status`,Jx=`failure`,Yx=`success`,Xx=`aspnetcore.user.is_authenticated`,Zx=`client.address`,Qx=`client.port`,$x=`code.column.number`,eS=`code.file.path`,tS=`code.function.name`,nS=`code.line.number`,rS=`code.stacktrace`,iS=`db.collection.name`,aS=`db.namespace`,oS=`db.operation.batch.size`,sS=`db.operation.name`,cS=`db.query.summary`,lS=`db.query.text`,uS=`db.response.status_code`,dS=`db.stored_procedure.name`,fS=`db.system.name`,pS=`mariadb`,mS=`microsoft.sql_server`,hS=`mysql`,gS=`postgresql`,_S=`dotnet.gc.heap.generation`,vS=`gen0`,yS=`gen1`,bS=`gen2`,xS=`error.type`,SS=`_OTHER`,CS=`exception.escaped`,wS=`exception.message`,TS=`exception.stacktrace`,ES=`exception.type`,DS=e=>`http.request.header.${e}`,OS=`http.request.method`,kS=`_OTHER`,AS=`CONNECT`,jS=`DELETE`,MS=`HEAD`,NS=`OPTIONS`,PS=`PATCH`,FS=`POST`,IS=`TRACE`,LS=`http.request.method_original`,RS=`http.request.resend_count`,zS=e=>`http.response.header.${e}`,BS=`http.response.status_code`,VS=`http.route`,HS=`jvm.gc.action`,US=`jvm.gc.name`,WS=`jvm.memory.pool.name`,GS=`jvm.memory.type`,KS=`heap`,qS=`non_heap`,JS=`jvm.thread.daemon`,YS=`jvm.thread.state`,XS=`blocked`,ZS=`runnable`,QS=`terminated`,$S=`timed_waiting`,eC=`waiting`,tC=`network.local.address`,nC=`network.local.port`,rC=`network.peer.address`,iC=`network.peer.port`,aC=`network.protocol.name`,oC=`network.protocol.version`,sC=`network.transport`,cC=`pipe`,lC=`quic`,uC=`unix`,dC=`network.type`,fC=`ipv4`,pC=`ipv6`,mC=`otel.scope.name`,hC=`otel.scope.version`,gC=`otel.status_code`,_C=`ERROR`,vC=`otel.status_description`,yC=`server.address`,bC=`server.port`,xC=`service.name`,SC=`service.version`,CC=`signalr.connection.status`,wC=`app_shutdown`,TC=`normal_closure`,EC=`timeout`,DC=`signalr.transport`,OC=`long_polling`,kC=`server_sent_events`,AC=`web_sockets`,jC=`telemetry.sdk.language`,MC=`dotnet`,NC=`erlang`,PC=`java`,FC=`nodejs`,IC=`python`,LC=`ruby`,RC=`rust`,zC=`swift`,BC=`webjs`,VC=`telemetry.sdk.name`,HC=`telemetry.sdk.version`,UC=`url.fragment`,WC=`url.full`,GC=`url.path`,KC=`url.query`,qC=`url.scheme`,JC=`user_agent.original`})),XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw,qw=n((()=>{XC=`aspnetcore.diagnostics.exceptions`,ZC=`aspnetcore.rate_limiting.active_request_leases`,QC=`aspnetcore.rate_limiting.queued_requests`,$C=`aspnetcore.rate_limiting.request.time_in_queue`,ew=`aspnetcore.rate_limiting.request_lease.duration`,tw=`aspnetcore.rate_limiting.requests`,nw=`aspnetcore.routing.match_attempts`,rw=`db.client.operation.duration`,iw=`dotnet.assembly.count`,aw=`dotnet.exceptions`,ow=`dotnet.gc.collections`,sw=`dotnet.gc.heap.total_allocated`,cw=`dotnet.gc.last_collection.heap.fragmentation.size`,lw=`dotnet.gc.last_collection.heap.size`,uw=`dotnet.gc.last_collection.memory.committed_size`,dw=`dotnet.gc.pause.time`,fw=`dotnet.jit.compilation.time`,pw=`dotnet.jit.compiled_il.size`,mw=`dotnet.jit.compiled_methods`,hw=`dotnet.monitor.lock_contentions`,gw=`dotnet.process.cpu.count`,_w=`dotnet.process.cpu.time`,vw=`dotnet.process.memory.working_set`,yw=`dotnet.thread_pool.queue.length`,bw=`dotnet.thread_pool.thread.count`,xw=`dotnet.thread_pool.work_item.count`,Sw=`dotnet.timer.count`,Cw=`http.client.request.duration`,ww=`http.server.request.duration`,Tw=`jvm.class.count`,Ew=`jvm.class.loaded`,Dw=`jvm.class.unloaded`,Ow=`jvm.cpu.count`,kw=`jvm.cpu.recent_utilization`,Aw=`jvm.cpu.time`,jw=`jvm.gc.duration`,Mw=`jvm.memory.committed`,Nw=`jvm.memory.limit`,Pw=`jvm.memory.used`,Fw=`jvm.memory.used_after_last_gc`,Iw=`jvm.thread.count`,Lw=`kestrel.active_connections`,Rw=`kestrel.active_tls_handshakes`,zw=`kestrel.connection.duration`,Bw=`kestrel.queued_connections`,Vw=`kestrel.queued_requests`,Hw=`kestrel.rejected_connections`,Uw=`kestrel.tls_handshake.duration`,Ww=`kestrel.upgraded_connections`,Gw=`signalr.server.active_connections`,Kw=`signalr.server.connection.duration`})),Jw,Yw=n((()=>{Jw=`exception`})),Xw=l({ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Px,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Fx,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Ix,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Lx,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Vx,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Hx,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Ux,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Wx,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Jx,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Yx,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Nx,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>Rx,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>zx,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Bx,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Gx,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Kx,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>qx,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Xx,ATTR_CLIENT_ADDRESS:()=>Zx,ATTR_CLIENT_PORT:()=>Qx,ATTR_CODE_COLUMN_NUMBER:()=>$x,ATTR_CODE_FILE_PATH:()=>eS,ATTR_CODE_FUNCTION_NAME:()=>tS,ATTR_CODE_LINE_NUMBER:()=>nS,ATTR_CODE_STACKTRACE:()=>rS,ATTR_DB_COLLECTION_NAME:()=>iS,ATTR_DB_NAMESPACE:()=>aS,ATTR_DB_OPERATION_BATCH_SIZE:()=>oS,ATTR_DB_OPERATION_NAME:()=>sS,ATTR_DB_QUERY_SUMMARY:()=>cS,ATTR_DB_QUERY_TEXT:()=>lS,ATTR_DB_RESPONSE_STATUS_CODE:()=>uS,ATTR_DB_STORED_PROCEDURE_NAME:()=>dS,ATTR_DB_SYSTEM_NAME:()=>fS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>_S,ATTR_ERROR_TYPE:()=>xS,ATTR_EXCEPTION_ESCAPED:()=>CS,ATTR_EXCEPTION_MESSAGE:()=>wS,ATTR_EXCEPTION_STACKTRACE:()=>TS,ATTR_EXCEPTION_TYPE:()=>ES,ATTR_HTTP_REQUEST_HEADER:()=>DS,ATTR_HTTP_REQUEST_METHOD:()=>OS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>LS,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>RS,ATTR_HTTP_RESPONSE_HEADER:()=>zS,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>BS,ATTR_HTTP_ROUTE:()=>VS,ATTR_JVM_GC_ACTION:()=>HS,ATTR_JVM_GC_NAME:()=>US,ATTR_JVM_MEMORY_POOL_NAME:()=>WS,ATTR_JVM_MEMORY_TYPE:()=>GS,ATTR_JVM_THREAD_DAEMON:()=>JS,ATTR_JVM_THREAD_STATE:()=>YS,ATTR_NETWORK_LOCAL_ADDRESS:()=>tC,ATTR_NETWORK_LOCAL_PORT:()=>nC,ATTR_NETWORK_PEER_ADDRESS:()=>rC,ATTR_NETWORK_PEER_PORT:()=>iC,ATTR_NETWORK_PROTOCOL_NAME:()=>aC,ATTR_NETWORK_PROTOCOL_VERSION:()=>oC,ATTR_NETWORK_TRANSPORT:()=>sC,ATTR_NETWORK_TYPE:()=>dC,ATTR_OTEL_SCOPE_NAME:()=>mC,ATTR_OTEL_SCOPE_VERSION:()=>hC,ATTR_OTEL_STATUS_CODE:()=>gC,ATTR_OTEL_STATUS_DESCRIPTION:()=>vC,ATTR_SERVER_ADDRESS:()=>yC,ATTR_SERVER_PORT:()=>bC,ATTR_SERVICE_NAME:()=>xC,ATTR_SERVICE_VERSION:()=>SC,ATTR_SIGNALR_CONNECTION_STATUS:()=>CC,ATTR_SIGNALR_TRANSPORT:()=>DC,ATTR_TELEMETRY_SDK_LANGUAGE:()=>jC,ATTR_TELEMETRY_SDK_NAME:()=>VC,ATTR_TELEMETRY_SDK_VERSION:()=>HC,ATTR_URL_FRAGMENT:()=>UC,ATTR_URL_FULL:()=>WC,ATTR_URL_PATH:()=>GC,ATTR_URL_QUERY:()=>KC,ATTR_URL_SCHEME:()=>qC,ATTR_USER_AGENT_ORIGINAL:()=>JC,AWSECSLAUNCHTYPEVALUES_EC2:()=>`ec2`,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>kb,AwsEcsLaunchtypeValues:()=>Ab,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>lb,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>ub,CLOUDPLATFORMVALUES_AWS_EC2:()=>db,CLOUDPLATFORMVALUES_AWS_ECS:()=>fb,CLOUDPLATFORMVALUES_AWS_EKS:()=>pb,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>hb,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>mb,CLOUDPLATFORMVALUES_AZURE_AKS:()=>vb,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>bb,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>_b,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>yb,CLOUDPLATFORMVALUES_AZURE_VM:()=>gb,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Tb,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>wb,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Sb,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>xb,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Cb,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Uy,CLOUDPROVIDERVALUES_AWS:()=>`aws`,CLOUDPROVIDERVALUES_AZURE:()=>Wy,CLOUDPROVIDERVALUES_GCP:()=>`gcp`,CloudPlatformValues:()=>Eb,CloudProviderValues:()=>Gy,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>`all`,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>`any`,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>am,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>lm,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>sm,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>dm,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>`one`,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>om,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>um,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>cm,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>`two`,DBSYSTEMVALUES_ADABAS:()=>vp,DBSYSTEMVALUES_CACHE:()=>_p,DBSYSTEMVALUES_CASSANDRA:()=>Pp,DBSYSTEMVALUES_CLOUDSCAPE:()=>up,DBSYSTEMVALUES_COCKROACHDB:()=>Kp,DBSYSTEMVALUES_COLDFUSION:()=>Np,DBSYSTEMVALUES_COSMOSDB:()=>Bp,DBSYSTEMVALUES_COUCHBASE:()=>Rp,DBSYSTEMVALUES_COUCHDB:()=>zp,DBSYSTEMVALUES_DB2:()=>`db2`,DBSYSTEMVALUES_DERBY:()=>bp,DBSYSTEMVALUES_DYNAMODB:()=>Vp,DBSYSTEMVALUES_EDB:()=>`edb`,DBSYSTEMVALUES_ELASTICSEARCH:()=>Wp,DBSYSTEMVALUES_FILEMAKER:()=>xp,DBSYSTEMVALUES_FIREBIRD:()=>yp,DBSYSTEMVALUES_FIRSTSQL:()=>gp,DBSYSTEMVALUES_GEODE:()=>Up,DBSYSTEMVALUES_H2:()=>`h2`,DBSYSTEMVALUES_HANADB:()=>mp,DBSYSTEMVALUES_HBASE:()=>Fp,DBSYSTEMVALUES_HIVE:()=>lp,DBSYSTEMVALUES_HSQLDB:()=>dp,DBSYSTEMVALUES_INFORMIX:()=>Sp,DBSYSTEMVALUES_INGRES:()=>hp,DBSYSTEMVALUES_INSTANTDB:()=>Cp,DBSYSTEMVALUES_INTERBASE:()=>wp,DBSYSTEMVALUES_MARIADB:()=>Tp,DBSYSTEMVALUES_MAXDB:()=>pp,DBSYSTEMVALUES_MEMCACHED:()=>Gp,DBSYSTEMVALUES_MONGODB:()=>Ip,DBSYSTEMVALUES_MSSQL:()=>ip,DBSYSTEMVALUES_MYSQL:()=>ap,DBSYSTEMVALUES_NEO4J:()=>Hp,DBSYSTEMVALUES_NETEZZA:()=>Ep,DBSYSTEMVALUES_ORACLE:()=>op,DBSYSTEMVALUES_OTHER_SQL:()=>rp,DBSYSTEMVALUES_PERVASIVE:()=>Dp,DBSYSTEMVALUES_POINTBASE:()=>Op,DBSYSTEMVALUES_POSTGRESQL:()=>sp,DBSYSTEMVALUES_PROGRESS:()=>fp,DBSYSTEMVALUES_REDIS:()=>Lp,DBSYSTEMVALUES_REDSHIFT:()=>cp,DBSYSTEMVALUES_SQLITE:()=>kp,DBSYSTEMVALUES_SYBASE:()=>Ap,DBSYSTEMVALUES_TERADATA:()=>jp,DBSYSTEMVALUES_VERTICA:()=>Mp,DB_SYSTEM_NAME_VALUE_MARIADB:()=>pS,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>mS,DB_SYSTEM_NAME_VALUE_MYSQL:()=>hS,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>gS,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>vS,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>yS,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>bS,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>`loh`,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>`poh`,DbCassandraConsistencyLevelValues:()=>fm,DbSystemValues:()=>qp,ERROR_TYPE_VALUE_OTHER:()=>SS,EVENT_EXCEPTION:()=>Jw,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>km,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Om,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Dm,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Fm,FAASINVOKEDPROVIDERVALUES_AWS:()=>`aws`,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Im,FAASINVOKEDPROVIDERVALUES_GCP:()=>`gcp`,FAASTRIGGERVALUES_DATASOURCE:()=>vm,FAASTRIGGERVALUES_HTTP:()=>ym,FAASTRIGGERVALUES_OTHER:()=>Sm,FAASTRIGGERVALUES_PUBSUB:()=>bm,FAASTRIGGERVALUES_TIMER:()=>xm,FaasDocumentOperationValues:()=>Am,FaasInvokedProviderValues:()=>Lm,FaasTriggerValues:()=>Cm,HOSTARCHVALUES_AMD64:()=>Rb,HOSTARCHVALUES_ARM32:()=>zb,HOSTARCHVALUES_ARM64:()=>Bb,HOSTARCHVALUES_IA64:()=>Vb,HOSTARCHVALUES_PPC32:()=>Hb,HOSTARCHVALUES_PPC64:()=>Ub,HOSTARCHVALUES_X86:()=>`x86`,HTTPFLAVORVALUES_HTTP_1_0:()=>`1.0`,HTTPFLAVORVALUES_HTTP_1_1:()=>`1.1`,HTTPFLAVORVALUES_HTTP_2_0:()=>`2.0`,HTTPFLAVORVALUES_QUIC:()=>tg,HTTPFLAVORVALUES_SPDY:()=>eg,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>AS,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>jS,HTTP_REQUEST_METHOD_VALUE_GET:()=>`GET`,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>MS,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>NS,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>kS,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>PS,HTTP_REQUEST_METHOD_VALUE_POST:()=>FS,HTTP_REQUEST_METHOD_VALUE_PUT:()=>`PUT`,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>IS,HostArchValues:()=>Wb,HttpFlavorValues:()=>ng,JVM_MEMORY_TYPE_VALUE_HEAP:()=>KS,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>qS,JVM_THREAD_STATE_VALUE_BLOCKED:()=>XS,JVM_THREAD_STATE_VALUE_NEW:()=>`new`,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>ZS,JVM_THREAD_STATE_VALUE_TERMINATED:()=>QS,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>$S,JVM_THREAD_STATE_VALUE_WAITING:()=>eC,MESSAGETYPEVALUES_RECEIVED:()=>Pg,MESSAGETYPEVALUES_SENT:()=>Ng,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>ag,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>og,MESSAGINGOPERATIONVALUES_PROCESS:()=>dg,MESSAGINGOPERATIONVALUES_RECEIVE:()=>ug,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>XC,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>ZC,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>QC,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>tw,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>ew,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>$C,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>nw,METRIC_DB_CLIENT_OPERATION_DURATION:()=>rw,METRIC_DOTNET_ASSEMBLY_COUNT:()=>iw,METRIC_DOTNET_EXCEPTIONS:()=>aw,METRIC_DOTNET_GC_COLLECTIONS:()=>ow,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>sw,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>cw,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>lw,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>uw,METRIC_DOTNET_GC_PAUSE_TIME:()=>dw,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>fw,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>pw,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>mw,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>hw,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>gw,METRIC_DOTNET_PROCESS_CPU_TIME:()=>_w,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>vw,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>yw,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>bw,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>xw,METRIC_DOTNET_TIMER_COUNT:()=>Sw,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Cw,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>ww,METRIC_JVM_CLASS_COUNT:()=>Tw,METRIC_JVM_CLASS_LOADED:()=>Ew,METRIC_JVM_CLASS_UNLOADED:()=>Dw,METRIC_JVM_CPU_COUNT:()=>Ow,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>kw,METRIC_JVM_CPU_TIME:()=>Aw,METRIC_JVM_GC_DURATION:()=>jw,METRIC_JVM_MEMORY_COMMITTED:()=>Mw,METRIC_JVM_MEMORY_LIMIT:()=>Nw,METRIC_JVM_MEMORY_USED:()=>Pw,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Fw,METRIC_JVM_THREAD_COUNT:()=>Iw,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Lw,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Rw,METRIC_KESTREL_CONNECTION_DURATION:()=>zw,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Bw,METRIC_KESTREL_QUEUED_REQUESTS:()=>Vw,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Hw,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Uw,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Ww,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Gw,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Kw,MessageTypeValues:()=>Fg,MessagingDestinationKindValues:()=>sg,MessagingOperationValues:()=>fg,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Nh,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Ih,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>jh,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Hh,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Ph,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Fh,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Vh,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Ah,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>`gsm`,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Lh,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>zh,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Uh,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Rh,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Bh,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Gh,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>`lte`,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>qh,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>`nr`,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Kh,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Wh,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Mh,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>ah,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>oh,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>sh,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>rh,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>ih,NETTRANSPORTVALUES_INPROC:()=>Ym,NETTRANSPORTVALUES_IP:()=>`ip`,NETTRANSPORTVALUES_IP_TCP:()=>Gm,NETTRANSPORTVALUES_IP_UDP:()=>Km,NETTRANSPORTVALUES_OTHER:()=>Xm,NETTRANSPORTVALUES_PIPE:()=>Jm,NETTRANSPORTVALUES_UNIX:()=>qm,NETWORK_TRANSPORT_VALUE_PIPE:()=>cC,NETWORK_TRANSPORT_VALUE_QUIC:()=>lC,NETWORK_TRANSPORT_VALUE_TCP:()=>`tcp`,NETWORK_TRANSPORT_VALUE_UDP:()=>`udp`,NETWORK_TRANSPORT_VALUE_UNIX:()=>uC,NETWORK_TYPE_VALUE_IPV4:()=>fC,NETWORK_TYPE_VALUE_IPV6:()=>pC,NetHostConnectionSubtypeValues:()=>Jh,NetHostConnectionTypeValues:()=>ch,NetTransportValues:()=>Zm,OSTYPEVALUES_AIX:()=>`aix`,OSTYPEVALUES_DARWIN:()=>ix,OSTYPEVALUES_DRAGONFLYBSD:()=>cx,OSTYPEVALUES_FREEBSD:()=>ax,OSTYPEVALUES_HPUX:()=>lx,OSTYPEVALUES_LINUX:()=>rx,OSTYPEVALUES_NETBSD:()=>ox,OSTYPEVALUES_OPENBSD:()=>sx,OSTYPEVALUES_SOLARIS:()=>ux,OSTYPEVALUES_WINDOWS:()=>nx,OSTYPEVALUES_Z_OS:()=>dx,OTEL_STATUS_CODE_VALUE_ERROR:()=>_C,OTEL_STATUS_CODE_VALUE_OK:()=>`OK`,OsTypeValues:()=>fx,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>10,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>6,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>1,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>15,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>4,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>9,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>13,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>3,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>5,RPCGRPCSTATUSCODEVALUES_OK:()=>0,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>11,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>7,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>8,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>16,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>14,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>12,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>2,RpcGrpcStatusCodeValues:()=>Ag,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>_d,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>kd,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>md,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>ud,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Dd,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Sd,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>bd,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Ad,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>vd,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>dd,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>gd,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>xd,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>hd,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>fd,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>pd,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Od,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>wd,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Td,SEMATTRS_AWS_DYNAMODB_SELECT:()=>yd,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Cd,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>ld,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Ed,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Hl,SEMATTRS_CODE_FILEPATH:()=>Ku,SEMATTRS_CODE_FUNCTION:()=>Wu,SEMATTRS_CODE_LINENO:()=>qu,SEMATTRS_CODE_NAMESPACE:()=>Gu,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>$l,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>iu,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>ru,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>tu,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Zl,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Ql,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>nu,SEMATTRS_DB_CASSANDRA_TABLE:()=>eu,SEMATTRS_DB_CONNECTION_STRING:()=>Wl,SEMATTRS_DB_HBASE_NAMESPACE:()=>au,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Kl,SEMATTRS_DB_MONGODB_COLLECTION:()=>su,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Xl,SEMATTRS_DB_NAME:()=>ql,SEMATTRS_DB_OPERATION:()=>Yl,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>ou,SEMATTRS_DB_SQL_TABLE:()=>cu,SEMATTRS_DB_STATEMENT:()=>Jl,SEMATTRS_DB_SYSTEM:()=>Ul,SEMATTRS_DB_USER:()=>Gl,SEMATTRS_ENDUSER_ID:()=>zu,SEMATTRS_ENDUSER_ROLE:()=>Bu,SEMATTRS_ENDUSER_SCOPE:()=>Vu,SEMATTRS_EXCEPTION_ESCAPED:()=>fu,SEMATTRS_EXCEPTION_MESSAGE:()=>uu,SEMATTRS_EXCEPTION_STACKTRACE:()=>du,SEMATTRS_EXCEPTION_TYPE:()=>lu,SEMATTRS_FAAS_COLDSTART:()=>xu,SEMATTRS_FAAS_CRON:()=>bu,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>hu,SEMATTRS_FAAS_DOCUMENT_NAME:()=>vu,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>gu,SEMATTRS_FAAS_DOCUMENT_TIME:()=>_u,SEMATTRS_FAAS_EXECUTION:()=>mu,SEMATTRS_FAAS_INVOKED_NAME:()=>Su,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Cu,SEMATTRS_FAAS_INVOKED_REGION:()=>wu,SEMATTRS_FAAS_TIME:()=>yu,SEMATTRS_FAAS_TRIGGER:()=>pu,SEMATTRS_HTTP_CLIENT_IP:()=>cd,SEMATTRS_HTTP_FLAVOR:()=>ed,SEMATTRS_HTTP_HOST:()=>Zu,SEMATTRS_HTTP_METHOD:()=>Ju,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>nd,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>rd,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>id,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>ad,SEMATTRS_HTTP_ROUTE:()=>sd,SEMATTRS_HTTP_SCHEME:()=>Qu,SEMATTRS_HTTP_SERVER_NAME:()=>od,SEMATTRS_HTTP_STATUS_CODE:()=>$u,SEMATTRS_HTTP_TARGET:()=>Xu,SEMATTRS_HTTP_URL:()=>Yu,SEMATTRS_HTTP_USER_AGENT:()=>td,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>sf,SEMATTRS_MESSAGE_ID:()=>of,SEMATTRS_MESSAGE_TYPE:()=>af,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>cf,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Ud,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>zd,SEMATTRS_MESSAGING_DESTINATION:()=>Md,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Nd,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>qd,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Kd,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Gd,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Jd,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Yd,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Rd,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Vd,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Bd,SEMATTRS_MESSAGING_OPERATION:()=>Hd,SEMATTRS_MESSAGING_PROTOCOL:()=>Fd,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Id,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Wd,SEMATTRS_MESSAGING_SYSTEM:()=>jd,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Pd,SEMATTRS_MESSAGING_URL:()=>Ld,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Lu,SEMATTRS_NET_HOST_CARRIER_MCC:()=>Fu,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Iu,SEMATTRS_NET_HOST_CARRIER_NAME:()=>Pu,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Nu,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>Mu,SEMATTRS_NET_HOST_IP:()=>ku,SEMATTRS_NET_HOST_NAME:()=>ju,SEMATTRS_NET_HOST_PORT:()=>Au,SEMATTRS_NET_PEER_IP:()=>Eu,SEMATTRS_NET_PEER_NAME:()=>Ou,SEMATTRS_NET_PEER_PORT:()=>Du,SEMATTRS_NET_TRANSPORT:()=>Tu,SEMATTRS_PEER_SERVICE:()=>Ru,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>$d,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>nf,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>rf,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>tf,SEMATTRS_RPC_JSONRPC_VERSION:()=>ef,SEMATTRS_RPC_METHOD:()=>Qd,SEMATTRS_RPC_SERVICE:()=>Zd,SEMATTRS_RPC_SYSTEM:()=>Xd,SEMATTRS_THREAD_ID:()=>Hu,SEMATTRS_THREAD_NAME:()=>Uu,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>_v,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>gv,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>vv,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>yv,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>bv,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>xv,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Sv,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>wv,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Cv,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Ev,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Tv,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>fv,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>mv,SEMRESATTRS_CLOUD_PLATFORM:()=>hv,SEMRESATTRS_CLOUD_PROVIDER:()=>dv,SEMRESATTRS_CLOUD_REGION:()=>pv,SEMRESATTRS_CONTAINER_ID:()=>Ov,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Av,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>jv,SEMRESATTRS_CONTAINER_NAME:()=>Dv,SEMRESATTRS_CONTAINER_RUNTIME:()=>kv,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Mv,SEMRESATTRS_DEVICE_ID:()=>Nv,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Pv,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Fv,SEMRESATTRS_FAAS_ID:()=>Lv,SEMRESATTRS_FAAS_INSTANCE:()=>zv,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Bv,SEMRESATTRS_FAAS_NAME:()=>Iv,SEMRESATTRS_FAAS_VERSION:()=>Rv,SEMRESATTRS_HOST_ARCH:()=>Wv,SEMRESATTRS_HOST_ID:()=>Vv,SEMRESATTRS_HOST_IMAGE_ID:()=>Kv,SEMRESATTRS_HOST_IMAGE_NAME:()=>Gv,SEMRESATTRS_HOST_IMAGE_VERSION:()=>qv,SEMRESATTRS_HOST_NAME:()=>Hv,SEMRESATTRS_HOST_TYPE:()=>Uv,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Jv,SEMRESATTRS_K8S_CONTAINER_NAME:()=>ey,SEMRESATTRS_K8S_CRONJOB_NAME:()=>fy,SEMRESATTRS_K8S_CRONJOB_UID:()=>dy,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>cy,SEMRESATTRS_K8S_DAEMONSET_UID:()=>sy,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>iy,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>ry,SEMRESATTRS_K8S_JOB_NAME:()=>uy,SEMRESATTRS_K8S_JOB_UID:()=>ly,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>Zv,SEMRESATTRS_K8S_NODE_NAME:()=>Yv,SEMRESATTRS_K8S_NODE_UID:()=>Xv,SEMRESATTRS_K8S_POD_NAME:()=>$v,SEMRESATTRS_K8S_POD_UID:()=>Qv,SEMRESATTRS_K8S_REPLICASET_NAME:()=>ny,SEMRESATTRS_K8S_REPLICASET_UID:()=>ty,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>oy,SEMRESATTRS_K8S_STATEFULSET_UID:()=>ay,SEMRESATTRS_OS_DESCRIPTION:()=>my,SEMRESATTRS_OS_NAME:()=>hy,SEMRESATTRS_OS_TYPE:()=>py,SEMRESATTRS_OS_VERSION:()=>gy,SEMRESATTRS_PROCESS_COMMAND:()=>by,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Sy,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>xy,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>vy,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>yy,SEMRESATTRS_PROCESS_OWNER:()=>Cy,SEMRESATTRS_PROCESS_PID:()=>_y,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Ey,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>wy,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Ty,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>ky,SEMRESATTRS_SERVICE_NAME:()=>Dy,SEMRESATTRS_SERVICE_NAMESPACE:()=>Oy,SEMRESATTRS_SERVICE_VERSION:()=>Ay,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Py,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>My,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>jy,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Ny,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Ly,SEMRESATTRS_WEBENGINE_NAME:()=>Fy,SEMRESATTRS_WEBENGINE_VERSION:()=>Iy,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>wC,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>TC,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>EC,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>OC,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>kC,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>AC,SemanticAttributes:()=>lf,SemanticResourceAttributes:()=>Ry,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>`cpp`,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Cx,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>wx,TELEMETRYSDKLANGUAGEVALUES_GO:()=>`go`,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Tx,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Ex,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>`php`,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Dx,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Ox,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>kx,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>`cpp`,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>MC,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>NC,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>`go`,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>PC,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>FC,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>`php`,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>IC,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>LC,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>RC,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>zC,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>BC,TelemetrySdkLanguageValues:()=>Ax}),Zw=n((()=>{Lg(),Mx(),YC(),qw(),Yw()})),Qw=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ATTR_PROCESS_RUNTIME_NAME=void 0,e.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`})),$w=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SDK_INFO=void 0;let t=bs(),n=(Zw(),i(Xw)),r=Qw();e.SDK_INFO={[n.ATTR_TELEMETRY_SDK_NAME]:`opentelemetry`,[r.ATTR_PROCESS_RUNTIME_NAME]:`node`,[n.ATTR_TELEMETRY_SDK_LANGUAGE]:n.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[n.ATTR_TELEMETRY_SDK_VERSION]:t.VERSION}})),eT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.otperformance=e.SDK_INFO=e._globalThis=e.getStringListFromEnv=e.getNumberFromEnv=e.getBooleanFromEnv=e.getStringFromEnv=void 0;var t=vs();Object.defineProperty(e,"getStringFromEnv",{enumerable:!0,get:function(){return t.getStringFromEnv}}),Object.defineProperty(e,"getBooleanFromEnv",{enumerable:!0,get:function(){return t.getBooleanFromEnv}}),Object.defineProperty(e,"getNumberFromEnv",{enumerable:!0,get:function(){return t.getNumberFromEnv}}),Object.defineProperty(e,"getStringListFromEnv",{enumerable:!0,get:function(){return t.getStringListFromEnv}});var n=ys();Object.defineProperty(e,"_globalThis",{enumerable:!0,get:function(){return n._globalThis}});var r=$w();Object.defineProperty(e,"SDK_INFO",{enumerable:!0,get:function(){return r.SDK_INFO}}),e.otperformance=performance})),tT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getStringListFromEnv=e.getNumberFromEnv=e.getStringFromEnv=e.getBooleanFromEnv=e.otperformance=e._globalThis=e.SDK_INFO=void 0;var t=eT();Object.defineProperty(e,"SDK_INFO",{enumerable:!0,get:function(){return t.SDK_INFO}}),Object.defineProperty(e,"_globalThis",{enumerable:!0,get:function(){return t._globalThis}}),Object.defineProperty(e,"otperformance",{enumerable:!0,get:function(){return t.otperformance}}),Object.defineProperty(e,"getBooleanFromEnv",{enumerable:!0,get:function(){return t.getBooleanFromEnv}}),Object.defineProperty(e,"getStringFromEnv",{enumerable:!0,get:function(){return t.getStringFromEnv}}),Object.defineProperty(e,"getNumberFromEnv",{enumerable:!0,get:function(){return t.getNumberFromEnv}}),Object.defineProperty(e,"getStringListFromEnv",{enumerable:!0,get:function(){return t.getStringListFromEnv}})})),nT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.addHrTimes=e.isTimeInput=e.isTimeInputHrTime=e.hrTimeToMicroseconds=e.hrTimeToMilliseconds=e.hrTimeToNanoseconds=e.hrTimeToTimeStamp=e.hrTimeDuration=e.timeInputToHrTime=e.hrTime=e.getTimeOrigin=e.millisToHrTime=void 0;let t=tT(),n=10**6,r=10**9;function i(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*n)]}e.millisToHrTime=i;function a(){return t.otperformance.timeOrigin}e.getTimeOrigin=a;function o(e){return h(i(t.otperformance.timeOrigin),i(typeof e==`number`?e:t.otperformance.now()))}e.hrTime=o;function s(e){if(p(e))return e;if(typeof e==`number`)return e<t.otperformance.timeOrigin?o(e):i(e);if(e instanceof Date)return i(e.getTime());throw TypeError(`Invalid input type`)}e.timeInputToHrTime=s;function c(e,t){let n=t[0]-e[0],i=t[1]-e[1];return i<0&&(--n,i+=r),[n,i]}e.hrTimeDuration=c;function l(e){let t=`${`0`.repeat(9)}${e[1]}Z`,n=t.substring(t.length-9-1);return new Date(e[0]*1e3).toISOString().replace(`000Z`,n)}e.hrTimeToTimeStamp=l;function u(e){return e[0]*r+e[1]}e.hrTimeToNanoseconds=u;function d(e){return e[0]*1e3+e[1]/1e6}e.hrTimeToMilliseconds=d;function f(e){return e[0]*1e6+e[1]/1e3}e.hrTimeToMicroseconds=f;function p(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}e.isTimeInputHrTime=p;function m(e){return p(e)||typeof e==`number`||e instanceof Date}e.isTimeInput=m;function h(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=r&&(n[1]-=r,n[0]+=1),n}e.addHrTimes=h})),rT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.unrefTimer=void 0;function t(e){typeof e!=`number`&&e.unref()}e.unrefTimer=t})),iT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExportResultCode=void 0,(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(e.ExportResultCode||={})})),aT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompositePropagator=void 0;let t=(c(),i(d));e.CompositePropagator=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,n,r){for(let i of this._propagators)try{i.inject(e,n,r)}catch(e){t.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${e.message}`)}}extract(e,n,r){return this._propagators.reduce((e,i)=>{try{return i.extract(e,n,r)}catch(e){t.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}})),oT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateValue=e.validateKey=void 0;let t=`[_0-9a-z-*/]`,n=RegExp(`^(?:${`[a-z]${t}{0,255}`}|${`[a-z0-9]${t}{0,240}@[a-z]${t}{0,13}`})$`),r=/^[ -~]{0,255}[!-~]$/,i=/,|=/;function a(e){return n.test(e)}e.validateKey=a;function o(e){return r.test(e)&&!i.test(e)}e.validateValue=o})),sT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TraceState=void 0;let t=oT();e.TraceState=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,n){if(!(0,t.validateKey)(e)||!(0,t.validateValue)(n))return this;let r=this._getState(),i=r.get(e),a=this._length;if(typeof i==`string`?a+=n.length-i.length:a+=e.length+n.length+(r.size>0?2:1),a>512)return this;let o=new Map(r);return o.delete(e),o.set(e,n),this._fromState(o,a)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=`,`+e),e=`${n[0]}=${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(`,`),n=new Map,r=0;for(let i of e){let e=i.trim(),a=e.indexOf(`=`);if(a===-1)continue;let o=e.slice(0,a),s=e.slice(a+1);if(!(0,t.validateKey)(o)||!(0,t.validateValue)(s))continue;let c=r+e.length+ +(n.size>0);if(!(c>512)&&(n.set(o,s),r=c,n.size>=32))break}return this._length=r,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}}})),cT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.W3CTraceContextPropagator=e.parseTraceParent=e.TRACE_STATE_HEADER=e.TRACE_PARENT_HEADER=void 0;let t=(c(),i(d)),n=us(),r=sT();e.TRACE_PARENT_HEADER=`traceparent`,e.TRACE_STATE_HEADER=`tracestate`;let a=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function o(e){let t=a.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}e.parseTraceParent=o,e.W3CTraceContextPropagator=class{inject(r,i,a){let o=t.trace.getSpanContext(r);if(!o||(0,n.isTracingSuppressed)(r)||!(0,t.isSpanContextValid)(o))return;let s=`00-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||t.TraceFlags.NONE).toString(16)}`;a.set(i,e.TRACE_PARENT_HEADER,s),o.traceState&&a.set(i,e.TRACE_STATE_HEADER,o.traceState.serialize())}extract(n,i,a){let s=a.get(i,e.TRACE_PARENT_HEADER);if(!s)return n;let c=Array.isArray(s)?s[0]:s;if(typeof c!=`string`)return n;let l=o(c);if(!l)return n;l.isRemote=!0;let u=a.get(i,e.TRACE_STATE_HEADER);if(u){let e=Array.isArray(u)?u.join(`,`):u;l.traceState=new r.TraceState(typeof e==`string`?e:void 0)}return t.trace.setSpanContext(n,l)}fields(){return[e.TRACE_PARENT_HEADER,e.TRACE_STATE_HEADER]}}})),lT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRPCMetadata=e.deleteRPCMetadata=e.setRPCMetadata=e.RPCType=void 0;let t=(0,(c(),i(d)).createContextKey)(`OpenTelemetry SDK Context Key RPC_METADATA`);(function(e){e.HTTP=`http`})(e.RPCType||={});function n(e,n){return e.setValue(t,n)}e.setRPCMetadata=n;function r(e){return e.deleteValue(t)}e.deleteRPCMetadata=r;function a(e){return e.getValue(t)}e.getRPCMetadata=a})),uT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isPlainObject=void 0;let t=Function.prototype.toString,n=t.call(Object),r=Object.getPrototypeOf,i=Object.prototype,a=i.hasOwnProperty,o=Symbol?Symbol.toStringTag:void 0,s=i.toString;function c(e){if(!l(e)||u(e)!==`[object Object]`)return!1;let i=r(e);if(i===null)return!0;let o=a.call(i,`constructor`)&&i.constructor;return typeof o==`function`&&o instanceof o&&t.call(o)===n}e.isPlainObject=c;function l(e){return typeof e==`object`&&!!e}function u(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:o&&o in Object(e)?d(e):f(e)}function d(e){let t=a.call(e,o),n=e[o],r=!1;try{e[o]=void 0,r=!0}catch{}let i=s.call(e);return r&&(t?e[o]=n:delete e[o]),i}function f(e){return s.call(e)}})),dT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;let t=uT();function n(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=i(t,e.shift(),0,n);return t}e.merge=n;function r(e){return o(e)?e.slice():e}function i(e,t,n=0,d){let f;if(!(n>20)){if(n++,l(e)||l(t)||s(t))f=r(t);else if(o(e)){if(f=e.slice(),o(t))for(let e=0,n=t.length;e<n;e++)f.push(r(t[e]));else if(c(t)){let e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){let i=e[n];i===`__proto__`||i===`constructor`||i===`prototype`||(f[i]=r(t[i]))}}}else if(c(e))if(c(t)){if(!u(e,t))return t;f=Object.assign({},e);let r=Object.keys(t);for(let o=0,s=r.length;o<s;o++){let s=r[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let u=t[s];if(l(u))u===void 0?delete f[s]:f[s]=u;else{let r=f[s],o=u;if(a(e,s,d)||a(t,s,d))delete f[s];else{if(c(r)&&c(o)){let n=d.get(r)||[],i=d.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),d.set(r,n),d.set(o,i)}f[s]=i(f[s],u,n,d)}}}}else f=t;return f}}function a(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function o(e){return Array.isArray(e)}function s(e){return typeof e==`function`}function c(e){return!l(e)&&!o(e)&&!s(e)&&typeof e==`object`}function l(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function u(e,n){return!(!(0,t.isPlainObject)(e)||!(0,t.isPlainObject)(n))}})),fT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callWithTimeout=e.TimeoutError=void 0;var t=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};e.TimeoutError=t;function n(e,n){let r,i=new Promise(function(e,i){r=setTimeout(function(){i(new t(`Operation timed out.`))},n)});return Promise.race([e,i]).then(e=>(clearTimeout(r),e),e=>{throw clearTimeout(r),e})}e.callWithTimeout=n})),pT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isUrlIgnored=e.urlMatches=void 0;function t(e,t){return typeof t==`string`?e===t:!!e.match(t)}e.urlMatches=t;function n(e,n){if(!n)return!1;for(let r of n)if(t(e,r))return!0;return!1}e.isUrlIgnored=n})),mT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Deferred=void 0,e.Deferred=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),hT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BindOnceFuture=void 0;let t=mT();e.BindOnceFuture=class{_isCalled=!1;_deferred=new t.Deferred;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}})),gT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.diagLogLevelFromString=void 0;let t=(c(),i(d)),n={ALL:t.DiagLogLevel.ALL,VERBOSE:t.DiagLogLevel.VERBOSE,DEBUG:t.DiagLogLevel.DEBUG,INFO:t.DiagLogLevel.INFO,WARN:t.DiagLogLevel.WARN,ERROR:t.DiagLogLevel.ERROR,NONE:t.DiagLogLevel.NONE};function r(e){return e==null?void 0:n[e.toUpperCase()]??(t.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(n)}, using default`),t.DiagLogLevel.INFO)}e.diagLogLevelFromString=r})),_T=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._export=void 0;let t=(c(),i(d)),n=us();function r(e,r){return new Promise(i=>{t.context.with((0,n.suppressTracing)(t.context.active()),()=>{e.export(r,i)})})}e._export=r})),q=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.internal=e.diagLogLevelFromString=e.BindOnceFuture=e.urlMatches=e.isUrlIgnored=e.callWithTimeout=e.TimeoutError=e.merge=e.TraceState=e.unsuppressTracing=e.suppressTracing=e.isTracingSuppressed=e.setRPCMetadata=e.getRPCMetadata=e.deleteRPCMetadata=e.RPCType=e.parseTraceParent=e.W3CTraceContextPropagator=e.TRACE_STATE_HEADER=e.TRACE_PARENT_HEADER=e.CompositePropagator=e.otperformance=e.getStringListFromEnv=e.getNumberFromEnv=e.getBooleanFromEnv=e.getStringFromEnv=e._globalThis=e.SDK_INFO=e.parseKeyPairsIntoRecord=e.ExportResultCode=e.unrefTimer=e.timeInputToHrTime=e.millisToHrTime=e.isTimeInputHrTime=e.isTimeInput=e.hrTimeToTimeStamp=e.hrTimeToNanoseconds=e.hrTimeToMilliseconds=e.hrTimeToMicroseconds=e.hrTimeDuration=e.hrTime=e.getTimeOrigin=e.addHrTimes=e.loggingErrorHandler=e.setGlobalErrorHandler=e.globalErrorHandler=e.sanitizeAttributes=e.isAttributeValue=e.AnchoredClock=e.W3CBaggagePropagator=void 0;var t=ps();Object.defineProperty(e,"W3CBaggagePropagator",{enumerable:!0,get:function(){return t.W3CBaggagePropagator}});var n=ms();Object.defineProperty(e,"AnchoredClock",{enumerable:!0,get:function(){return n.AnchoredClock}});var r=hs();Object.defineProperty(e,"isAttributeValue",{enumerable:!0,get:function(){return r.isAttributeValue}}),Object.defineProperty(e,"sanitizeAttributes",{enumerable:!0,get:function(){return r.sanitizeAttributes}});var i=_s();Object.defineProperty(e,"globalErrorHandler",{enumerable:!0,get:function(){return i.globalErrorHandler}}),Object.defineProperty(e,"setGlobalErrorHandler",{enumerable:!0,get:function(){return i.setGlobalErrorHandler}});var a=gs();Object.defineProperty(e,"loggingErrorHandler",{enumerable:!0,get:function(){return a.loggingErrorHandler}});var o=nT();Object.defineProperty(e,"addHrTimes",{enumerable:!0,get:function(){return o.addHrTimes}}),Object.defineProperty(e,"getTimeOrigin",{enumerable:!0,get:function(){return o.getTimeOrigin}}),Object.defineProperty(e,"hrTime",{enumerable:!0,get:function(){return o.hrTime}}),Object.defineProperty(e,"hrTimeDuration",{enumerable:!0,get:function(){return o.hrTimeDuration}}),Object.defineProperty(e,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return o.hrTimeToMicroseconds}}),Object.defineProperty(e,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return o.hrTimeToMilliseconds}}),Object.defineProperty(e,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return o.hrTimeToNanoseconds}}),Object.defineProperty(e,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return o.hrTimeToTimeStamp}}),Object.defineProperty(e,"isTimeInput",{enumerable:!0,get:function(){return o.isTimeInput}}),Object.defineProperty(e,"isTimeInputHrTime",{enumerable:!0,get:function(){return o.isTimeInputHrTime}}),Object.defineProperty(e,"millisToHrTime",{enumerable:!0,get:function(){return o.millisToHrTime}}),Object.defineProperty(e,"timeInputToHrTime",{enumerable:!0,get:function(){return o.timeInputToHrTime}});var s=rT();Object.defineProperty(e,"unrefTimer",{enumerable:!0,get:function(){return s.unrefTimer}});var c=iT();Object.defineProperty(e,"ExportResultCode",{enumerable:!0,get:function(){return c.ExportResultCode}});var l=fs();Object.defineProperty(e,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return l.parseKeyPairsIntoRecord}});var u=tT();Object.defineProperty(e,"SDK_INFO",{enumerable:!0,get:function(){return u.SDK_INFO}}),Object.defineProperty(e,"_globalThis",{enumerable:!0,get:function(){return u._globalThis}}),Object.defineProperty(e,"getStringFromEnv",{enumerable:!0,get:function(){return u.getStringFromEnv}}),Object.defineProperty(e,"getBooleanFromEnv",{enumerable:!0,get:function(){return u.getBooleanFromEnv}}),Object.defineProperty(e,"getNumberFromEnv",{enumerable:!0,get:function(){return u.getNumberFromEnv}}),Object.defineProperty(e,"getStringListFromEnv",{enumerable:!0,get:function(){return u.getStringListFromEnv}}),Object.defineProperty(e,"otperformance",{enumerable:!0,get:function(){return u.otperformance}});var d=aT();Object.defineProperty(e,"CompositePropagator",{enumerable:!0,get:function(){return d.CompositePropagator}});var f=cT();Object.defineProperty(e,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return f.TRACE_PARENT_HEADER}}),Object.defineProperty(e,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return f.TRACE_STATE_HEADER}}),Object.defineProperty(e,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return f.W3CTraceContextPropagator}}),Object.defineProperty(e,"parseTraceParent",{enumerable:!0,get:function(){return f.parseTraceParent}});var p=lT();Object.defineProperty(e,"RPCType",{enumerable:!0,get:function(){return p.RPCType}}),Object.defineProperty(e,"deleteRPCMetadata",{enumerable:!0,get:function(){return p.deleteRPCMetadata}}),Object.defineProperty(e,"getRPCMetadata",{enumerable:!0,get:function(){return p.getRPCMetadata}}),Object.defineProperty(e,"setRPCMetadata",{enumerable:!0,get:function(){return p.setRPCMetadata}});var m=us();Object.defineProperty(e,"isTracingSuppressed",{enumerable:!0,get:function(){return m.isTracingSuppressed}}),Object.defineProperty(e,"suppressTracing",{enumerable:!0,get:function(){return m.suppressTracing}}),Object.defineProperty(e,"unsuppressTracing",{enumerable:!0,get:function(){return m.unsuppressTracing}});var h=sT();Object.defineProperty(e,"TraceState",{enumerable:!0,get:function(){return h.TraceState}});var g=dT();Object.defineProperty(e,"merge",{enumerable:!0,get:function(){return g.merge}});var _=fT();Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return _.TimeoutError}}),Object.defineProperty(e,"callWithTimeout",{enumerable:!0,get:function(){return _.callWithTimeout}});var v=pT();Object.defineProperty(e,"isUrlIgnored",{enumerable:!0,get:function(){return v.isUrlIgnored}}),Object.defineProperty(e,"urlMatches",{enumerable:!0,get:function(){return v.urlMatches}});var y=hT();Object.defineProperty(e,"BindOnceFuture",{enumerable:!0,get:function(){return y.BindOnceFuture}});var b=gT();Object.defineProperty(e,"diagLogLevelFromString",{enumerable:!0,get:function(){return b.diagLogLevelFromString}}),e.internal={_export:_T()._export}})),vT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LastValueAggregator=e.LastValueAccumulation=void 0;let t=$o(),n=q(),r=Zo();var i=class{startTime;_current;sampleTime;constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,n.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};e.LastValueAccumulation=i,e.LastValueAggregator=class{kind=t.AggregatorKind.LAST_VALUE;createAccumulation(e){return new i(e)}merge(e,t){let r=(0,n.hrTimeToMicroseconds)(t.sampleTime)>=(0,n.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new i(e.startTime,r.toPointValue(),r.sampleTime)}diff(e,t){let r=(0,n.hrTimeToMicroseconds)(t.sampleTime)>=(0,n.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new i(t.startTime,r.toPointValue(),r.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:r.DataPointType.GAUGE,dataPoints:n.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()}))}}}})),yT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SumAggregator=e.SumAccumulation=void 0;let t=$o(),n=Zo();var r=class{startTime;monotonic;_current;reset;constructor(e,t,n=0,r=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=r}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};e.SumAccumulation=r,e.SumAggregator=class{kind=t.AggregatorKind.SUM;monotonic;constructor(e){this.monotonic=e}createAccumulation(e){return new r(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new r(t.startTime,this.monotonic,i,t.reset):new r(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new r(t.startTime,this.monotonic,i,!0):new r(t.startTime,this.monotonic,i-n)}toMetricData(e,t,r,i){return{descriptor:e,aggregationTemporality:t,dataPointType:n.DataPointType.SUM,dataPoints:r.map(([e,t])=>({attributes:e,startTime:t.startTime,endTime:i,value:t.toPointValue()})),isMonotonic:this.monotonic}}}})),bT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SumAggregator=e.SumAccumulation=e.LastValueAggregator=e.LastValueAccumulation=e.ExponentialHistogramAggregator=e.ExponentialHistogramAccumulation=e.HistogramAggregator=e.HistogramAccumulation=e.DropAggregator=void 0;var t=es();Object.defineProperty(e,"DropAggregator",{enumerable:!0,get:function(){return t.DropAggregator}});var n=ts();Object.defineProperty(e,"HistogramAccumulation",{enumerable:!0,get:function(){return n.HistogramAccumulation}}),Object.defineProperty(e,"HistogramAggregator",{enumerable:!0,get:function(){return n.HistogramAggregator}});var r=ls();Object.defineProperty(e,"ExponentialHistogramAccumulation",{enumerable:!0,get:function(){return r.ExponentialHistogramAccumulation}}),Object.defineProperty(e,"ExponentialHistogramAggregator",{enumerable:!0,get:function(){return r.ExponentialHistogramAggregator}});var i=vT();Object.defineProperty(e,"LastValueAccumulation",{enumerable:!0,get:function(){return i.LastValueAccumulation}}),Object.defineProperty(e,"LastValueAggregator",{enumerable:!0,get:function(){return i.LastValueAggregator}});var a=yT();Object.defineProperty(e,"SumAccumulation",{enumerable:!0,get:function(){return a.SumAccumulation}}),Object.defineProperty(e,"SumAggregator",{enumerable:!0,get:function(){return a.SumAggregator}})})),xT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_AGGREGATION=e.EXPONENTIAL_HISTOGRAM_AGGREGATION=e.HISTOGRAM_AGGREGATION=e.LAST_VALUE_AGGREGATION=e.SUM_AGGREGATION=e.DROP_AGGREGATION=e.DefaultAggregation=e.ExponentialHistogramAggregation=e.ExplicitBucketHistogramAggregation=e.HistogramAggregation=e.LastValueAggregation=e.SumAggregation=e.DropAggregation=void 0;let t=(c(),i(d)),n=bT(),r=Zo();var a=class e{static DEFAULT_INSTANCE=new n.DropAggregator;createAggregator(t){return e.DEFAULT_INSTANCE}};e.DropAggregation=a;var o=class e{static MONOTONIC_INSTANCE=new n.SumAggregator(!0);static NON_MONOTONIC_INSTANCE=new n.SumAggregator(!1);createAggregator(t){switch(t.type){case r.InstrumentType.COUNTER:case r.InstrumentType.OBSERVABLE_COUNTER:case r.InstrumentType.HISTOGRAM:return e.MONOTONIC_INSTANCE;default:return e.NON_MONOTONIC_INSTANCE}}};e.SumAggregation=o;var s=class e{static DEFAULT_INSTANCE=new n.LastValueAggregator;createAggregator(t){return e.DEFAULT_INSTANCE}};e.LastValueAggregation=s;var l=class e{static DEFAULT_INSTANCE=new n.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);createAggregator(t){return e.DEFAULT_INSTANCE}};e.HistogramAggregation=l;var u=class{_boundaries;_recordMinMax;constructor(e,t=!0){if(e==null)throw Error(`ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array`);e=e.concat(),e=e.sort((e,t)=>e-t);let n=e.lastIndexOf(-1/0),r=e.indexOf(1/0);r===-1&&(r=void 0),this._boundaries=e.slice(n+1,r),this._recordMinMax=t}createAggregator(e){return new n.HistogramAggregator(this._boundaries,this._recordMinMax)}};e.ExplicitBucketHistogramAggregation=u;var f=class{_maxSize;_recordMinMax;constructor(e=160,t=!0){this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new n.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};e.ExponentialHistogramAggregation=f;var p=class{_resolve(n){switch(n.type){case r.InstrumentType.COUNTER:case r.InstrumentType.UP_DOWN_COUNTER:case r.InstrumentType.OBSERVABLE_COUNTER:case r.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return e.SUM_AGGREGATION;case r.InstrumentType.GAUGE:case r.InstrumentType.OBSERVABLE_GAUGE:return e.LAST_VALUE_AGGREGATION;case r.InstrumentType.HISTOGRAM:return n.advice.explicitBucketBoundaries?new u(n.advice.explicitBucketBoundaries):e.HISTOGRAM_AGGREGATION}return t.diag.warn(`Unable to recognize instrument type: ${n.type}`),e.DROP_AGGREGATION}createAggregator(e){return this._resolve(e).createAggregator(e)}};e.DefaultAggregation=p,e.DROP_AGGREGATION=new a,e.SUM_AGGREGATION=new o,e.LAST_VALUE_AGGREGATION=new s,e.HISTOGRAM_AGGREGATION=new l,e.EXPONENTIAL_HISTOGRAM_AGGREGATION=new f,e.DEFAULT_AGGREGATION=new p})),ST=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toAggregation=e.AggregationType=void 0;let t=xT();var n;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.DROP=1]=`DROP`,e[e.SUM=2]=`SUM`,e[e.LAST_VALUE=3]=`LAST_VALUE`,e[e.EXPLICIT_BUCKET_HISTOGRAM=4]=`EXPLICIT_BUCKET_HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=5]=`EXPONENTIAL_HISTOGRAM`})(n=e.AggregationType||={});function r(e){switch(e.type){case n.DEFAULT:return t.DEFAULT_AGGREGATION;case n.DROP:return t.DROP_AGGREGATION;case n.SUM:return t.SUM_AGGREGATION;case n.LAST_VALUE:return t.LAST_VALUE_AGGREGATION;case n.EXPONENTIAL_HISTOGRAM:{let n=e;return new t.ExponentialHistogramAggregation(n.options?.maxSize,n.options?.recordMinMax)}case n.EXPLICIT_BUCKET_HISTOGRAM:{let n=e;return n.options==null?t.HISTOGRAM_AGGREGATION:new t.ExplicitBucketHistogramAggregation(n.options?.boundaries,n.options?.recordMinMax)}default:throw Error(`Unsupported Aggregation`)}}e.toAggregation=r})),CT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=e.DEFAULT_AGGREGATION_SELECTOR=void 0;let t=Xo(),n=ST();e.DEFAULT_AGGREGATION_SELECTOR=e=>({type:n.AggregationType.DEFAULT}),e.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=e=>t.AggregationTemporality.CUMULATIVE})),wT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricReader=void 0;let t=(c(),i(d)),n=Qo(),r=CT();e.MetricReader=class{_shutdown=!1;_metricProducers;_sdkMetricProducer;_aggregationTemporalitySelector;_aggregationSelector;_cardinalitySelector;constructor(e){this._aggregationSelector=e?.aggregationSelector??r.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=e?.aggregationTemporalitySelector??r.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=e?.metricProducers??[],this._cardinalitySelector=e?.cardinalitySelector}setMetricProducer(e){if(this._sdkMetricProducer)throw Error(`MetricReader can not be bound to a MeterProvider again.`);this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}selectCardinalityLimit(e){return this._cardinalitySelector?this._cardinalitySelector(e):2e3}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw Error(`MetricReader is not bound to a MetricProducer`);if(this._shutdown)throw Error(`MetricReader is shutdown`);let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(t=>t.collect({timeoutMillis:e?.timeoutMillis}))]),r=t.errors.concat(n.flatMap(e=>e.errors));return{resourceMetrics:{resource:t.resourceMetrics.resource,scopeMetrics:t.resourceMetrics.scopeMetrics.concat(n.flatMap(e=>e.resourceMetrics.scopeMetrics))},errors:r}}async shutdown(e){if(this._shutdown){t.diag.error(`Cannot call shutdown twice.`);return}e?.timeoutMillis==null?await this.onShutdown():await(0,n.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){t.diag.warn(`Cannot forceFlush on already shutdown MetricReader.`);return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,n.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}}})),TT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PeriodicExportingMetricReader=void 0;let t=(c(),i(d)),n=q(),r=wT(),a=Qo(),o=Zo();e.PeriodicExportingMetricReader=class extends r.MetricReader{_interval;_exporter;_exportInterval;_exportTimeout;constructor(e){let{exporter:n,exportIntervalMillis:r=6e4,metricProducers:i,cardinalityLimits:a}=e,{exportTimeoutMillis:s=3e4}=e;if(super({aggregationSelector:n.selectAggregation?.bind(n),aggregationTemporalitySelector:n.selectAggregationTemporality?.bind(n),metricProducers:i,cardinalitySelector:e=>{let t={default:2e3,...a};switch(e){case o.InstrumentType.COUNTER:return t.counter??t.default;case o.InstrumentType.GAUGE:return t.gauge??t.default;case o.InstrumentType.HISTOGRAM:return t.histogram??t.default;case o.InstrumentType.OBSERVABLE_COUNTER:return t.observableCounter??t.default;case o.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return t.observableUpDownCounter??t.default;case o.InstrumentType.OBSERVABLE_GAUGE:return t.observableGauge??t.default;case o.InstrumentType.UP_DOWN_COUNTER:return t.upDownCounter??t.default;default:return t.default}}}),r<=0)throw Error(`exportIntervalMillis must be greater than 0`);if(s<=0)throw Error(`exportTimeoutMillis must be greater than 0`);if(r<s){if(`exportIntervalMillis`in e&&`exportTimeoutMillis`in e)throw Error(`exportIntervalMillis must be greater than or equal to exportTimeoutMillis`);t.diag.info(`Timeout of ${s} exceeds the interval of ${r}. Clamping timeout to interval duration.`),s=r}this._exportInterval=r,this._exportTimeout=s,this._exporter=n}async _runOnce(){try{await(0,a.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof a.TimeoutError){t.diag.error(`Export took longer than %s milliseconds and timed out.`,this._exportTimeout);return}(0,n.globalErrorHandler)(e)}}async _doRun(){let{resourceMetrics:e,errors:r}=await this.collect({timeoutMillis:this._exportTimeout});if(r.length>0&&t.diag.error(`PeriodicExportingMetricReader: metrics collection errors`,...r),e.resource.asyncAttributesPending)try{await e.resource.waitForAsyncAttributes?.()}catch(e){t.diag.debug(`Error while resolving async portion of resource: `,e),(0,n.globalErrorHandler)(e)}if(e.scopeMetrics.length===0)return;let i=await n.internal._export(this._exporter,e);if(i.code!==n.ExportResultCode.SUCCESS)throw Error(`PeriodicExportingMetricReader: metrics export failed (error ${i.error})`)}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!=`number`&&this._interval.unref()}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}})),ET=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryMetricExporter=void 0;let t=q();e.InMemoryMetricExporter=class{_shutdown=!1;_aggregationTemporality;_metrics=[];constructor(e){this._aggregationTemporality=e}export(e,n){if(this._shutdown){setTimeout(()=>n({code:t.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>n({code:t.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}}})),DT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConsoleMetricExporter=void 0;let t=q(),n=CT();e.ConsoleMetricExporter=class e{_shutdown=!1;_temporalitySelector;constructor(e){this._temporalitySelector=e?.temporalitySelector??n.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(n,r){if(this._shutdown){r({code:t.ExportResultCode.FAILED});return}return e._sendMetrics(n,r)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,n){for(let t of e.scopeMetrics)for(let e of t.metrics)console.dir({descriptor:e.descriptor,dataPointType:e.dataPointType,dataPoints:e.dataPoints},{depth:null});n({code:t.ExportResultCode.SUCCESS})}}})),OT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._clearDefaultServiceNameCache=e.defaultServiceName=void 0;let t;function n(){if(t===void 0)try{let e=globalThis.process.argv0;t=e?`unknown_service:${e}`:`unknown_service`}catch{t=`unknown_service`}return t}e.defaultServiceName=n;function r(){t=void 0}e._clearDefaultServiceNameCache=r})),kT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isPromiseLike=void 0,e.isPromiseLike=e=>typeof e==`object`&&!!e&&typeof e.then==`function`})),AT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultResource=e.emptyResource=e.resourceFromDetectedResource=e.resourceFromAttributes=void 0;let t=(c(),i(d)),n=q(),r=(Zw(),i(Xw)),a=OT(),o=kT();var s=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=m(t),r._asyncAttributesPending=t.filter(([e,t])=>(0,o.isPromiseLike)(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>((0,o.isPromiseLike)(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=m(this._rawAttributes),this._schemaUrl=h(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,(0,o.isPromiseLike)(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&t.diag.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[n,r]of this._rawAttributes){if((0,o.isPromiseLike)(r)){t.diag.debug(`Unsettled resource attribute ${n} skipped`);continue}r!=null&&(e[n]??=r)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=g(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function l(e,t){return s.FromAttributeList(Object.entries(e),t)}e.resourceFromAttributes=l;function u(e,t){return new s(e,t)}e.resourceFromDetectedResource=u;function f(){return l({})}e.emptyResource=f;function p(){return l({[r.ATTR_SERVICE_NAME]:(0,a.defaultServiceName)(),[r.ATTR_TELEMETRY_SDK_LANGUAGE]:n.SDK_INFO[r.ATTR_TELEMETRY_SDK_LANGUAGE],[r.ATTR_TELEMETRY_SDK_NAME]:n.SDK_INFO[r.ATTR_TELEMETRY_SDK_NAME],[r.ATTR_TELEMETRY_SDK_VERSION]:n.SDK_INFO[r.ATTR_TELEMETRY_SDK_VERSION]})}e.defaultResource=p;function m(e){return e.map(([e,n])=>(0,o.isPromiseLike)(n)?[e,n.catch(n=>{t.diag.debug(`promise rejection for resource attribute: %s - %s`,e,n)})]:[e,n])}function h(e){if(typeof e==`string`||e===void 0)return e;t.diag.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function g(e,n){let r=e?.schemaUrl,i=n?.schemaUrl,a=r===void 0||r===``,o=i===void 0||i===``;if(a)return i;if(o||r===i)return r;t.diag.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,r,i)}})),jT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.detectResources=void 0;let t=(c(),i(d)),n=AT();e.detectResources=(e={})=>(e.detectors||[]).map(r=>{try{let i=(0,n.resourceFromDetectedResource)(r.detect(e));return t.diag.debug(`${r.constructor.name} found resource.`,i),i}catch(e){return t.diag.debug(`${r.constructor.name} failed: ${e.message}`),(0,n.emptyResource)()}}).reduce((e,t)=>e.merge(t),(0,n.emptyResource)())})),MT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.envDetector=void 0;let t=(c(),i(d)),n=(Zw(),i(Xw)),r=q();e.envDetector=new class{_MAX_LENGTH=255;_COMMA_SEPARATOR=`,`;_LABEL_KEY_VALUE_SPLITTER=`=`;detect(e){let i={},a=(0,r.getStringFromEnv)(`OTEL_RESOURCE_ATTRIBUTES`),o=(0,r.getStringFromEnv)(`OTEL_SERVICE_NAME`);if(a)try{let e=this._parseResourceAttributes(a);Object.assign(i,e)}catch(e){t.diag.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return o&&(i[n.ATTR_SERVICE_NAME]=o),{attributes:i}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`)}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}}})),NT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ATTR_WEBENGINE_VERSION=e.ATTR_WEBENGINE_NAME=e.ATTR_WEBENGINE_DESCRIPTION=e.ATTR_SERVICE_NAMESPACE=e.ATTR_SERVICE_INSTANCE_ID=e.ATTR_PROCESS_RUNTIME_VERSION=e.ATTR_PROCESS_RUNTIME_NAME=e.ATTR_PROCESS_RUNTIME_DESCRIPTION=e.ATTR_PROCESS_PID=e.ATTR_PROCESS_OWNER=e.ATTR_PROCESS_EXECUTABLE_PATH=e.ATTR_PROCESS_EXECUTABLE_NAME=e.ATTR_PROCESS_COMMAND_ARGS=e.ATTR_PROCESS_COMMAND=e.ATTR_OS_VERSION=e.ATTR_OS_TYPE=e.ATTR_K8S_POD_NAME=e.ATTR_K8S_NAMESPACE_NAME=e.ATTR_K8S_DEPLOYMENT_NAME=e.ATTR_K8S_CLUSTER_NAME=e.ATTR_HOST_TYPE=e.ATTR_HOST_NAME=e.ATTR_HOST_IMAGE_VERSION=e.ATTR_HOST_IMAGE_NAME=e.ATTR_HOST_IMAGE_ID=e.ATTR_HOST_ID=e.ATTR_HOST_ARCH=e.ATTR_CONTAINER_NAME=e.ATTR_CONTAINER_IMAGE_TAGS=e.ATTR_CONTAINER_IMAGE_NAME=e.ATTR_CONTAINER_ID=e.ATTR_CLOUD_REGION=e.ATTR_CLOUD_PROVIDER=e.ATTR_CLOUD_AVAILABILITY_ZONE=e.ATTR_CLOUD_ACCOUNT_ID=void 0,e.ATTR_CLOUD_ACCOUNT_ID=`cloud.account.id`,e.ATTR_CLOUD_AVAILABILITY_ZONE=`cloud.availability_zone`,e.ATTR_CLOUD_PROVIDER=`cloud.provider`,e.ATTR_CLOUD_REGION=`cloud.region`,e.ATTR_CONTAINER_ID=`container.id`,e.ATTR_CONTAINER_IMAGE_NAME=`container.image.name`,e.ATTR_CONTAINER_IMAGE_TAGS=`container.image.tags`,e.ATTR_CONTAINER_NAME=`container.name`,e.ATTR_HOST_ARCH=`host.arch`,e.ATTR_HOST_ID=`host.id`,e.ATTR_HOST_IMAGE_ID=`host.image.id`,e.ATTR_HOST_IMAGE_NAME=`host.image.name`,e.ATTR_HOST_IMAGE_VERSION=`host.image.version`,e.ATTR_HOST_NAME=`host.name`,e.ATTR_HOST_TYPE=`host.type`,e.ATTR_K8S_CLUSTER_NAME=`k8s.cluster.name`,e.ATTR_K8S_DEPLOYMENT_NAME=`k8s.deployment.name`,e.ATTR_K8S_NAMESPACE_NAME=`k8s.namespace.name`,e.ATTR_K8S_POD_NAME=`k8s.pod.name`,e.ATTR_OS_TYPE=`os.type`,e.ATTR_OS_VERSION=`os.version`,e.ATTR_PROCESS_COMMAND=`process.command`,e.ATTR_PROCESS_COMMAND_ARGS=`process.command_args`,e.ATTR_PROCESS_EXECUTABLE_NAME=`process.executable.name`,e.ATTR_PROCESS_EXECUTABLE_PATH=`process.executable.path`,e.ATTR_PROCESS_OWNER=`process.owner`,e.ATTR_PROCESS_PID=`process.pid`,e.ATTR_PROCESS_RUNTIME_DESCRIPTION=`process.runtime.description`,e.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`,e.ATTR_PROCESS_RUNTIME_VERSION=`process.runtime.version`,e.ATTR_SERVICE_INSTANCE_ID=`service.instance.id`,e.ATTR_SERVICE_NAMESPACE=`service.namespace`,e.ATTR_WEBENGINE_DESCRIPTION=`webengine.description`,e.ATTR_WEBENGINE_NAME=`webengine.name`,e.ATTR_WEBENGINE_VERSION=`webengine.version`})),PT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getMachineId=void 0;let t=s(`process`),n;async function i(){if(!n)switch(t.platform){case`darwin`:n=(await import(`./getMachineId-darwin-Dy0upv7d.js`).then(e=>r(e.default))).getMachineId;break;case`linux`:n=(await import(`./getMachineId-linux-1gt-JynE.js`).then(e=>r(e.default))).getMachineId;break;case`freebsd`:n=(await import(`./getMachineId-bsd-DMCgGTrk.js`).then(e=>r(e.default))).getMachineId;break;case`win32`:n=(await import(`./getMachineId-win-BOJrF7mQ.js`).then(e=>r(e.default))).getMachineId;break;default:n=(await import(`./getMachineId-unsupported-aqcKyF65.js`).then(e=>r(e.default))).getMachineId;break}return n()}e.getMachineId=i})),FT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeType=e.normalizeArch=void 0,e.normalizeArch=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},e.normalizeType=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),IT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hostDetector=void 0;let t=NT(),n=s(`os`),r=PT(),i=FT();e.hostDetector=new class{detect(e){return{attributes:{[t.ATTR_HOST_NAME]:(0,n.hostname)(),[t.ATTR_HOST_ARCH]:(0,i.normalizeArch)((0,n.arch)()),[t.ATTR_HOST_ID]:(0,r.getMachineId)()}}}}})),LT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.osDetector=void 0;let t=NT(),n=s(`os`),r=FT();e.osDetector=new class{detect(e){return{attributes:{[t.ATTR_OS_TYPE]:(0,r.normalizeType)((0,n.platform)()),[t.ATTR_OS_VERSION]:(0,n.release)()}}}}})),RT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.processDetector=void 0;let t=(c(),i(d)),n=NT(),r=s(`os`);e.processDetector=new class{detect(e){let i={[n.ATTR_PROCESS_PID]:process.pid,[n.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[n.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[n.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[n.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[n.ATTR_PROCESS_RUNTIME_NAME]:`nodejs`,[n.ATTR_PROCESS_RUNTIME_DESCRIPTION]:`Node.js`};process.argv.length>1&&(i[n.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let e=r.userInfo();i[n.ATTR_PROCESS_OWNER]=e.username}catch(e){t.diag.debug(`error obtaining process owner: ${e}`)}return{attributes:i}}}})),zT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serviceInstanceIdDetector=void 0;let t=NT(),n=s(`crypto`);e.serviceInstanceIdDetector=new class{detect(e){return{attributes:{[t.ATTR_SERVICE_INSTANCE_ID]:(0,n.randomUUID)()}}}}})),BT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=void 0;var t=IT();Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return t.hostDetector}});var n=LT();Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return n.osDetector}});var r=RT();Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return r.processDetector}});var i=zT();Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return i.serviceInstanceIdDetector}})})),VT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=void 0;var t=BT();Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return t.hostDetector}}),Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return t.osDetector}}),Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return t.processDetector}}),Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return t.serviceInstanceIdDetector}})})),HT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.noopDetector=e.NoopDetector=void 0;var t=class{detect(){return{attributes:{}}}};e.NoopDetector=t,e.noopDetector=new t})),UT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.noopDetector=e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=e.envDetector=void 0;var t=MT();Object.defineProperty(e,"envDetector",{enumerable:!0,get:function(){return t.envDetector}});var n=VT();Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return n.hostDetector}}),Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return n.osDetector}}),Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return n.processDetector}}),Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return n.serviceInstanceIdDetector}});var r=HT();Object.defineProperty(e,"noopDetector",{enumerable:!0,get:function(){return r.noopDetector}})})),WT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultServiceName=e.emptyResource=e.defaultResource=e.resourceFromAttributes=e.serviceInstanceIdDetector=e.processDetector=e.osDetector=e.hostDetector=e.envDetector=e.detectResources=void 0;var t=jT();Object.defineProperty(e,"detectResources",{enumerable:!0,get:function(){return t.detectResources}});var n=UT();Object.defineProperty(e,"envDetector",{enumerable:!0,get:function(){return n.envDetector}}),Object.defineProperty(e,"hostDetector",{enumerable:!0,get:function(){return n.hostDetector}}),Object.defineProperty(e,"osDetector",{enumerable:!0,get:function(){return n.osDetector}}),Object.defineProperty(e,"processDetector",{enumerable:!0,get:function(){return n.processDetector}}),Object.defineProperty(e,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return n.serviceInstanceIdDetector}});var r=AT();Object.defineProperty(e,"resourceFromAttributes",{enumerable:!0,get:function(){return r.resourceFromAttributes}}),Object.defineProperty(e,"defaultResource",{enumerable:!0,get:function(){return r.defaultResource}}),Object.defineProperty(e,"emptyResource",{enumerable:!0,get:function(){return r.emptyResource}});var i=OT();Object.defineProperty(e,"defaultServiceName",{enumerable:!0,get:function(){return i.defaultServiceName}})})),GT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ViewRegistry=void 0,e.ViewRegistry=class{_registeredViews=[];addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(n=>this._matchInstrument(n.instrumentSelector,e)&&this._matchMeter(n.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}}})),KT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isValidName=e.isDescriptorCompatibleWith=e.createInstrumentDescriptorWithView=e.createInstrumentDescriptor=void 0;let t=(c(),i(d)),n=Qo();function r(e,n,r){return l(e)||t.diag.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:n,description:r?.description??``,unit:r?.unit??``,valueType:r?.valueType??t.ValueType.DOUBLE,advice:r?.advice??{}}}e.createInstrumentDescriptor=r;function a(e,t){return{name:e.name??t.name,description:e.description??t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}e.createInstrumentDescriptorWithView=a;function o(e,t){return(0,n.equalsCaseInsensitive)(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}e.isDescriptorCompatibleWith=o;let s=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function l(e){return s.test(e)}e.isValidName=l})),qT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isObservableInstrument=e.ObservableUpDownCounterInstrument=e.ObservableGaugeInstrument=e.ObservableCounterInstrument=e.ObservableInstrument=e.HistogramInstrument=e.GaugeInstrument=e.CounterInstrument=e.UpDownCounterInstrument=e.SyncInstrument=void 0;let t=(c(),i(d)),n=q();var r=class{_writableMetricStorage;_descriptor;constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,r={},i=t.context.active()){if(typeof e!=`number`){t.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===t.ValueType.INT&&!Number.isInteger(e)&&(t.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,r,i,(0,n.millisToHrTime)(Date.now()))}};e.SyncInstrument=r,e.UpDownCounterInstrument=class extends r{add(e,t,n){this._record(e,t,n)}},e.CounterInstrument=class extends r{add(e,n,r){if(e<0){t.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,n,r)}},e.GaugeInstrument=class extends r{record(e,t,n){this._record(e,t,n)}},e.HistogramInstrument=class extends r{record(e,n,r){if(e<0){t.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,n,r)}};var a=class{_metricStorages;_descriptor;_observableRegistry;constructor(e,t,n){this._descriptor=e,this._metricStorages=t,this._observableRegistry=n}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};e.ObservableInstrument=a,e.ObservableCounterInstrument=class extends a{},e.ObservableGaugeInstrument=class extends a{},e.ObservableUpDownCounterInstrument=class extends a{};function o(e){return e instanceof a}e.isObservableInstrument=o})),JT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Meter=void 0;let t=KT(),n=qT(),r=Zo();e.Meter=class{_meterSharedState;constructor(e){this._meterSharedState=e}createGauge(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.GAUGE,i),o=this._meterSharedState.registerMetricStorage(a);return new n.GaugeInstrument(o,a)}createHistogram(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.HISTOGRAM,i),o=this._meterSharedState.registerMetricStorage(a);return new n.HistogramInstrument(o,a)}createCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.COUNTER,i),o=this._meterSharedState.registerMetricStorage(a);return new n.CounterInstrument(o,a)}createUpDownCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.UP_DOWN_COUNTER,i),o=this._meterSharedState.registerMetricStorage(a);return new n.UpDownCounterInstrument(o,a)}createObservableGauge(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.OBSERVABLE_GAUGE,i),o=this._meterSharedState.registerAsyncMetricStorage(a);return new n.ObservableGaugeInstrument(a,o,this._meterSharedState.observableRegistry)}createObservableCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.OBSERVABLE_COUNTER,i),o=this._meterSharedState.registerAsyncMetricStorage(a);return new n.ObservableCounterInstrument(a,o,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,i){let a=(0,t.createInstrumentDescriptor)(e,r.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,i),o=this._meterSharedState.registerAsyncMetricStorage(a);return new n.ObservableUpDownCounterInstrument(a,o,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}}})),YT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricStorage=void 0;let t=KT();e.MetricStorage=class{_instrumentDescriptor;constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,t.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}})),XT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeHashMap=e.HashMap=void 0;let t=Qo();var n=class{_valueMap=new Map;_keyMap=new Map;_hash;constructor(e){this._hash=e}get(e,t){return t??=this._hash(e),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let r=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,r),r}set(e,t,n){n??=this._hash(e),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??=this._hash(e),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}};e.HashMap=n,e.AttributeHashMap=class extends n{constructor(){super(t.hashAttributes)}}})),ZT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeltaMetricProcessor=void 0;let t=Qo(),n=XT();e.DeltaMetricProcessor=class{_activeCollectionStorage=new n.AttributeHashMap;_cumulativeMemoStorage=new n.AttributeHashMap;_cardinalityLimit;_overflowAttributes={"otel.metric.overflow":!0};_overflowHashCode;_aggregator;constructor(e,n){this._aggregator=e,this._cardinalityLimit=(n??2e3)-1,this._overflowHashCode=(0,t.hashAttributes)(this._overflowAttributes)}record(e,t,n,r){let i=this._activeCollectionStorage.get(t);if(!i){if(this._activeCollectionStorage.size>=this._cardinalityLimit){this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(r))?.record(e);return}i=this._aggregator.createAccumulation(r),this._activeCollectionStorage.set(t,i)}i?.record(e)}batchCumulate(e,t){for(let[n,r,i]of e.entries()){let e=n,a=i,o=this._aggregator.createAccumulation(t);o?.record(r);let s=o;if(this._cumulativeMemoStorage.has(e,a)){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(e=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(e,a))){let t=this._cumulativeMemoStorage.get(e,a);s=this._aggregator.diff(t,o)}if(this._activeCollectionStorage.has(e,a)){let t=this._activeCollectionStorage.get(e,a);s=this._aggregator.merge(t,s)}this._cumulativeMemoStorage.set(e,o,a),this._activeCollectionStorage.set(e,s,a)}}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new n.AttributeHashMap,e}}})),QT=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TemporalMetricProcessor=void 0;let t=Xo(),n=XT();e.TemporalMetricProcessor=class e{_aggregator;_unreportedAccumulations=new Map;_reportHistory=new Map;constructor(e,t){this._aggregator=e,t.forEach(e=>{this._unreportedAccumulations.set(e,[])})}buildMetrics(n,i,a,o){this._stashAccumulations(a);let s=this._getMergedUnreportedAccumulations(n),c=s,l;if(this._reportHistory.has(n)){let r=this._reportHistory.get(n),i=r.collectionTime;l=r.aggregationTemporality,c=l===t.AggregationTemporality.CUMULATIVE?e.merge(r.accumulations,s,this._aggregator):e.calibrateStartTime(r.accumulations,s,i)}else l=n.selectAggregationTemporality(i.type);this._reportHistory.set(n,{accumulations:c,collectionTime:o,aggregationTemporality:l});let u=r(c);if(u.length!==0)return this._aggregator.toMetricData(i,l,u,o)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let t=this._unreportedAccumulations.get(n);t===void 0&&(t=[],this._unreportedAccumulations.set(n,t)),t.push(e)}}_getMergedUnreportedAccumulations(t){let r=new n.AttributeHashMap,i=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),i===void 0)return r;for(let t of i)r=e.merge(r,t,this._aggregator);return r}static merge(e,t,n){let r=e,i=t.entries(),a=i.next();for(;a.done!==!0;){let[t,o,s]=a.value;if(e.has(t,s)){let i=e.get(t,s),a=n.merge(i,o);r.set(t,a,s)}else r.set(t,o,s);a=i.next()}return r}static calibrateStartTime(e,t,n){for(let[r,i]of e.keys())t.get(r,i)?.setStartTime(n);return t}};function r(e){return Array.from(e.entries())}})),$T=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncMetricStorage=void 0;let t=YT(),n=ZT(),r=QT(),i=XT();e.AsyncMetricStorage=class extends t.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,t,i,a,o){super(e),this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new n.DeltaMetricProcessor(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new r.TemporalMetricProcessor(t,a),this._attributesProcessor=i}record(e,t){let n=new i.AttributeHashMap;for(let[t,r]of e.entries())n.set(this._attributesProcessor.process(t),r);this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}}})),eE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getConflictResolutionRecipe=e.getDescriptionResolutionRecipe=e.getTypeConflictResolutionRecipe=e.getUnitConflictResolutionRecipe=e.getValueTypeConflictResolutionRecipe=e.getIncompatibilityDetails=void 0;function t(e,t){let n=``;return e.unit!==t.unit&&(n+=`\t- Unit '${e.unit}' does not match '${t.unit}'\n`),e.type!==t.type&&(n+=`\t- Type '${e.type}' does not match '${t.type}'\n`),e.valueType!==t.valueType&&(n+=`\t- Value Type '${e.valueType}' does not match '${t.valueType}'\n`),e.description!==t.description&&(n+=`\t- Description '${e.description}' does not match '${t.description}'\n`),n}e.getIncompatibilityDetails=t;function n(e,t){return`\t- use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}e.getValueTypeConflictResolutionRecipe=n;function r(e,t){return`\t- use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}e.getUnitConflictResolutionRecipe=r;function i(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'`}e.getTypeConflictResolutionRecipe=i;function a(e,t){let n={name:t.name,type:t.type,unit:t.unit},r=JSON.stringify(n);return`\t- create a new view with a name other than '${e.name}' and InstrumentSelector '${r}'
18
18
  \t- OR - create a new view with the name ${e.name} and description '${e.description}' and InstrumentSelector ${r}
19
- \t- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${r}`}e.getDescriptionResolutionRecipe=a;function o(e,t){return e.valueType===t.valueType?e.unit===t.unit?e.type===t.type?e.description===t.description?``:a(e,t):i(e,t):r(e,t):n(e,t)}e.getConflictResolutionRecipe=o})),eE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricStorageRegistry=void 0;let t=GT(),n=(c(),i(d)),r=$T();e.MetricStorageRegistry=class e{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new e}getStorages(e){let t=[];for(let e of this._sharedRegistry.values())t=t.concat(e);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let e of n.values())t=t.concat(e);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n??(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let r=n.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),r=t.get(n.name);if(r===void 0){t.set(n.name,[e]);return}r.push(e)}_findOrUpdateCompatibleStorage(e,i){let a=null;for(let o of i){let i=o.getInstrumentDescriptor();(0,t.isDescriptorCompatibleWith)(i,e)?(i.description!==e.description&&(e.description.length>i.description.length&&o.updateDescription(e.description),n.diag.warn(`A view or instrument with the name `,e.name,` has already been registered, but has a different description and is incompatible with another registered view.
19
+ \t- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${r}`}e.getDescriptionResolutionRecipe=a;function o(e,t){return e.valueType===t.valueType?e.unit===t.unit?e.type===t.type?e.description===t.description?``:a(e,t):i(e,t):r(e,t):n(e,t)}e.getConflictResolutionRecipe=o})),tE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricStorageRegistry=void 0;let t=KT(),n=(c(),i(d)),r=eE();e.MetricStorageRegistry=class e{_sharedRegistry=new Map;_perCollectorRegistry=new Map;static create(){return new e}getStorages(e){let t=[];for(let e of this._sharedRegistry.values())t=t.concat(e);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let e of n.values())t=t.concat(e);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n??(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let r=n.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),r=t.get(n.name);if(r===void 0){t.set(n.name,[e]);return}r.push(e)}_findOrUpdateCompatibleStorage(e,i){let a=null;for(let o of i){let i=o.getInstrumentDescriptor();(0,t.isDescriptorCompatibleWith)(i,e)?(i.description!==e.description&&(e.description.length>i.description.length&&o.updateDescription(e.description),n.diag.warn(`A view or instrument with the name `,e.name,` has already been registered, but has a different description and is incompatible with another registered view.
20
20
  `,`Details:
21
21
  `,(0,r.getIncompatibilityDetails)(i,e),`The longer description will be used.
22
22
  To resolve the conflict:`,(0,r.getConflictResolutionRecipe)(i,e))),a=o):n.diag.warn(`A view or instrument with the name `,e.name,` has already been registered and is incompatible with another registered view.
23
23
  `,`Details:
24
24
  `,(0,r.getIncompatibilityDetails)(i,e),`To resolve the conflict:
25
- `,(0,r.getConflictResolutionRecipe)(i,e))}return a}}})),tE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MultiMetricStorage=void 0,e.MultiMetricStorage=class{_backingStorages;constructor(e){this._backingStorages=e}record(e,t,n,r){let i=this._backingStorages;for(let a=0;a<i.length;a++)i[a].record(e,t,n,r)}}})),nE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BatchObservableResultImpl=e.ObservableResultImpl=void 0;let t=(c(),i(d)),n=YT(),r=KT();e.ObservableResultImpl=class{_buffer=new n.AttributeHashMap;_instrumentName;_valueType;constructor(e,t){this._instrumentName=e,this._valueType=t}observe(e,n={}){if(typeof e!=`number`){t.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===t.ValueType.INT&&!Number.isInteger(e)&&(t.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(n,e)}},e.BatchObservableResultImpl=class{_buffer=new Map;observe(e,i,a={}){if(!(0,r.isObservableInstrument)(e))return;let o=this._buffer.get(e);if(o??(o=new n.AttributeHashMap,this._buffer.set(e,o)),typeof i!=`number`){t.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${i}`);return}e._descriptor.valueType===t.ValueType.INT&&!Number.isInteger(i)&&(t.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),i=Math.trunc(i),!Number.isInteger(i))||o.set(a,i)}}})),rE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ObservableRegistry=void 0;let t=(c(),i(d)),n=KT(),r=nE(),a=Zo();e.ObservableRegistry=class{_callbacks=[];_batchCallbacks=[];addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,r){let i=new Set(r.filter(n.isObservableInstrument));if(i.size===0){t.diag.error(`BatchObservableCallback is not associated with valid instruments`,r);return}this._findBatchCallback(e,i)>=0||this._batchCallbacks.push({callback:e,instruments:i})}removeBatchCallback(e,t){let r=new Set(t.filter(n.isObservableInstrument)),i=this._findBatchCallback(e,r);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),r=this._observeBatchCallbacks(e,t);return(await Promise.allSettled([...n,...r])).filter(e=>e.status===`rejected`).map(e=>e.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let o=new r.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),s=Promise.resolve(n(o));t!=null&&(s=(0,a.callWithTimeout)(s,t)),await s,i._metricStorages.forEach(t=>{t.record(o._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let o=new r.BatchObservableResultImpl,s=Promise.resolve(n(o));t!=null&&(s=(0,a.callWithTimeout)(s,t)),await s,i.forEach(t=>{let n=o._buffer.get(t);n!=null&&t._metricStorages.forEach(t=>{t.record(n,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&(0,a.setEquals)(n.instruments,t))}}})),iE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SyncMetricStorage=void 0;let t=JT(),n=XT(),r=ZT();e.SyncMetricStorage=class extends t.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,t,i,a,o){super(e),this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new n.DeltaMetricProcessor(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new r.TemporalMetricProcessor(t,a),this._attributesProcessor=i}record(e,t,n,r){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,r)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}}})),aE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDenyListAttributesProcessor=e.createAllowListAttributesProcessor=e.createMultiAttributesProcessor=e.createNoopAttributesProcessor=void 0;var t=class{process(e,t){return e}},n=class{_processors;constructor(e){this._processors=e}process(e,t){let n=e;for(let e of this._processors)n=e.process(n,t);return n}},r=class{_allowedAttributeNames;constructor(e){this._allowedAttributeNames=new Set(e)}process(e,t){let n={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._allowedAttributeNames.has(t)&&(n[t]=e[t]);return n}},i=class{_deniedAttributeNames;constructor(e){this._deniedAttributeNames=new Set(e)}process(e,t){let n={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&!this._deniedAttributeNames.has(t)&&(n[t]=e[t]);return n}};function a(){return l}e.createNoopAttributesProcessor=a;function o(e){return new n(e)}e.createMultiAttributesProcessor=o;function s(e){return new r(e)}e.createAllowListAttributesProcessor=s;function c(e){return new i(e)}e.createDenyListAttributesProcessor=c;let l=new t})),oE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterSharedState=void 0;let t=GT(),n=qT(),r=QT(),i=eE(),a=tE(),o=rE(),s=iE(),c=aE();e.MeterSharedState=class{metricStorageRegistry=new i.MetricStorageRegistry;observableRegistry=new o.ObservableRegistry;meter;_meterProviderSharedState;_instrumentationScope;constructor(e,t){this.meter=new n.Meter(this),this._meterProviderSharedState=e,this._instrumentationScope=t}registerMetricStorage(e){let t=this._registerMetricStorage(e,s.SyncMetricStorage);return t.length===1?t[0]:new a.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,r.AsyncMetricStorage)}async collect(e,t,n){let r=await this.observableRegistry.observe(t,n?.timeoutMillis),i=this.metricStorageRegistry.getStorages(e);if(i.length===0)return null;let a=[];return i.forEach(n=>{let r=n.collect(e,t);r!=null&&a.push(r)}),a.length===0?{errors:r}:{scopeMetrics:{scope:this._instrumentationScope,metrics:a},errors:r}}_registerMetricStorage(e,n){let r=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(r=>{let i=(0,t.createInstrumentDescriptorWithView)(r,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(a!=null)return a;let o=new n(i,r.aggregation.createAggregator(i),r.attributesProcessor,this._meterProviderSharedState.metricCollectors,r.aggregationCardinalityLimit);return this.metricStorageRegistry.register(o),o});if(r.length===0){let t=this._meterProviderSharedState.selectAggregations(e.type).map(([t,r])=>{let i=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(t,e);if(i!=null)return i;let a=r.createAggregator(e),o=t.selectCardinalityLimit(e.type),s=new n(e,a,(0,c.createNoopAttributesProcessor)(),[t],o);return this.metricStorageRegistry.registerForCollector(t,s),s});r=r.concat(t)}return r}}})),sE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterProviderSharedState=void 0;let t=Zo(),n=WT(),r=oE(),i=xT();e.MeterProviderSharedState=class{viewRegistry=new n.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;resource;constructor(e){this.resource=e}getMeterSharedState(e){let n=(0,t.instrumentationScopeId)(e),i=this.meterSharedStates.get(n);return i??(i=new r.MeterSharedState(this,e),this.meterSharedStates.set(n,i)),i}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,(0,i.toAggregation)(n.selectAggregation(e))]);return t}}})),cE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricCollector=void 0;let t=q();e.MetricCollector=class{_sharedState;_metricReader;constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let n=(0,t.millisToHrTime)(Date.now()),r=[],i=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async t=>{let a=await t.collect(this,n,e);a?.scopeMetrics!=null&&r.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:r},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){return this._metricReader.selectCardinalityLimit?.(e)??2e3}}})),lE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExactPredicate=e.PatternPredicate=void 0;let t=/[\^$\\.+?()[\]{}|]/g;e.PatternPredicate=class e{_matchAll;_regexp;constructor(t){t===`*`?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(t,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(e){return e.includes(`*`)}},e.ExactPredicate=class{_matchAll;_pattern;constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}})),uE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentSelector=void 0;let t=lE();e.InstrumentSelector=class{_nameFilter;_type;_unitFilter;constructor(e){this._nameFilter=new t.PatternPredicate(e?.name??`*`),this._type=e?.type,this._unitFilter=new t.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}})),dE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterSelector=void 0;let t=lE();e.MeterSelector=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(e){this._nameFilter=new t.ExactPredicate(e?.name),this._versionFilter=new t.ExactPredicate(e?.version),this._schemaUrlFilter=new t.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}})),fE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.View=void 0;let t=lE(),n=aE(),r=uE(),i=dE(),a=xT();function o(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function s(e){if(o(e))throw Error(`Cannot create view with no selector arguments supplied`);if(e.name!=null&&(e?.instrumentName==null||t.PatternPredicate.hasWildcard(e.instrumentName)))throw Error(`Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.`)}e.View=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(e){s(e),e.attributesProcessors==null?this.attributesProcessor=(0,n.createNoopAttributesProcessor)():this.attributesProcessor=(0,n.createMultiAttributesProcessor)(e.attributesProcessors),this.name=e.name,this.description=e.description,this.aggregation=(0,a.toAggregation)(e.aggregation??{type:a.AggregationType.DEFAULT}),this.instrumentSelector=new r.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new i.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}})),pE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterProvider=void 0;let t=(c(),i(d)),n=UT(),r=sE(),a=cE(),o=fE();e.MeterProvider=class{_sharedState;_shutdown=!1;constructor(e){if(this._sharedState=new r.MeterProviderSharedState(e?.resource??(0,n.defaultResource)()),e?.views!=null&&e.views.length>0)for(let t of e.views)this._sharedState.viewRegistry.addView(new o.View(t));if(e?.readers!=null&&e.readers.length>0)for(let t of e.readers){let e=new a.MetricCollector(this._sharedState,t);t.setMetricProducer(e),this._sharedState.metricCollectors.push(e)}}getMeter(e,n=``,r={}){return this._shutdown?(t.diag.warn(`A shutdown MeterProvider cannot provide a Meter`),(0,t.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:n,schemaUrl:r.schemaUrl}).meter}async shutdown(e){if(this._shutdown){t.diag.warn(`shutdown may only be called once per MeterProvider`);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){t.diag.warn(`invalid attempt to force flush after MeterProvider shutdown`);return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}}})),mE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeoutError=e.createDenyListAttributesProcessor=e.createAllowListAttributesProcessor=e.AggregationType=e.MeterProvider=e.ConsoleMetricExporter=e.InMemoryMetricExporter=e.PeriodicExportingMetricReader=e.MetricReader=e.InstrumentType=e.DataPointType=e.AggregationTemporality=void 0;var t=Yo();Object.defineProperty(e,"AggregationTemporality",{enumerable:!0,get:function(){return t.AggregationTemporality}});var n=Xo();Object.defineProperty(e,"DataPointType",{enumerable:!0,get:function(){return n.DataPointType}}),Object.defineProperty(e,"InstrumentType",{enumerable:!0,get:function(){return n.InstrumentType}});var r=CT();Object.defineProperty(e,"MetricReader",{enumerable:!0,get:function(){return r.MetricReader}});var i=wT();Object.defineProperty(e,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return i.PeriodicExportingMetricReader}});var a=TT();Object.defineProperty(e,"InMemoryMetricExporter",{enumerable:!0,get:function(){return a.InMemoryMetricExporter}});var o=ET();Object.defineProperty(e,"ConsoleMetricExporter",{enumerable:!0,get:function(){return o.ConsoleMetricExporter}});var s=pE();Object.defineProperty(e,"MeterProvider",{enumerable:!0,get:function(){return s.MeterProvider}});var c=xT();Object.defineProperty(e,"AggregationType",{enumerable:!0,get:function(){return c.AggregationType}});var l=aE();Object.defineProperty(e,"createAllowListAttributesProcessor",{enumerable:!0,get:function(){return l.createAllowListAttributesProcessor}}),Object.defineProperty(e,"createDenyListAttributesProcessor",{enumerable:!0,get:function(){return l.createDenyListAttributesProcessor}});var u=Zo();Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return u.TimeoutError}})})),hE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AggregationTemporalityPreference=void 0,(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`,e[e.LOWMEMORY=2]=`LOWMEMORY`})(e.AggregationTemporalityPreference||={})})),gE,_E=n((()=>{gE=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}})),vE,yE=n((()=>{vE=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}}}));function bE(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function xE(e){if(e!=null)return async()=>e}function SE(e,t,n){return{timeoutMillis:bE(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function CE(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var wE=n((()=>{})),TE,EE=n((()=>{(function(e){e.NONE=`none`,e.GZIP=`gzip`})(TE||={})}));function DE(e){return new OE(e.concurrencyLimit)}var OE,kE=n((()=>{OE=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}}));function AE(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function jE(){return{handleResponse(t){t==null||!AE(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||e.warn(`Received Partial Success response:`,JSON.stringify(t.partialSuccess))}}}var ME=n((()=>{c()}));function NE(e,t){return new FE(e.transport,e.serializer,jE(),e.promiseHandler,t.timeout)}var PE,FE,IE=n((()=>{PE=q(),yE(),ME(),c(),FE=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(t,n,r,i,a){this._transport=t,this._serializer=n,this._responseHandler=r,this._promiseQueue=i,this._timeout=a,this._diagLogger=e.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:PE.ExportResultCode.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:PE.ExportResultCode.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:PE.ExportResultCode.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:PE.ExportResultCode.FAILED,error:e.error});return}else e.status===`retryable`?t({code:PE.ExportResultCode.FAILED,error:e.error??new vE(`Export failed with retryable status`)}):t({code:PE.ExportResultCode.FAILED,error:new vE(`Export failed with unknown error`)})},e=>t({code:PE.ExportResultCode.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}}}));function LE(e,t,n){return NE({transport:n,serializer:t,promiseHandler:DE(e)},{timeout:e.timeoutMillis})}var RE=n((()=>{kE(),IE()})),zE=l({CompressionAlgorithm:()=>TE,OTLPExporterBase:()=>gE,OTLPExporterError:()=>vE,createOtlpNetworkExportDelegate:()=>LE,getSharedConfigurationDefaults:()=>CE,mergeOtlpSharedConfigurationWithDefaults:()=>SE}),BE=n((()=>{_E(),yE(),wE(),EE(),RE()})),VE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporterBase=e.LowMemoryTemporalitySelector=e.DeltaTemporalitySelector=e.CumulativeTemporalitySelector=void 0;let t=q(),n=mE(),r=hE(),a=(BE(),i(zE)),o=(c(),i(d));e.CumulativeTemporalitySelector=()=>n.AggregationTemporality.CUMULATIVE,e.DeltaTemporalitySelector=e=>{switch(e){case n.InstrumentType.COUNTER:case n.InstrumentType.OBSERVABLE_COUNTER:case n.InstrumentType.GAUGE:case n.InstrumentType.HISTOGRAM:case n.InstrumentType.OBSERVABLE_GAUGE:return n.AggregationTemporality.DELTA;case n.InstrumentType.UP_DOWN_COUNTER:case n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return n.AggregationTemporality.CUMULATIVE}},e.LowMemoryTemporalitySelector=e=>{switch(e){case n.InstrumentType.COUNTER:case n.InstrumentType.HISTOGRAM:return n.AggregationTemporality.DELTA;case n.InstrumentType.GAUGE:case n.InstrumentType.UP_DOWN_COUNTER:case n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:case n.InstrumentType.OBSERVABLE_COUNTER:case n.InstrumentType.OBSERVABLE_GAUGE:return n.AggregationTemporality.CUMULATIVE}};function s(){let n=((0,t.getStringFromEnv)(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`)??`cumulative`).toLowerCase();return n===`cumulative`?e.CumulativeTemporalitySelector:n===`delta`?e.DeltaTemporalitySelector:n===`lowmemory`?e.LowMemoryTemporalitySelector:(o.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${n}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),e.CumulativeTemporalitySelector)}function l(t){return t==null?s():t===r.AggregationTemporalityPreference.DELTA?e.DeltaTemporalitySelector:t===r.AggregationTemporalityPreference.LOWMEMORY?e.LowMemoryTemporalitySelector:e.CumulativeTemporalitySelector}let u=Object.freeze({type:n.AggregationType.DEFAULT});function f(e){return e?.aggregationPreference??(()=>u)}e.OTLPMetricExporterBase=class extends a.OTLPExporterBase{_aggregationTemporalitySelector;_aggregationSelector;constructor(e,t){super(e),this._aggregationSelector=f(t),this._aggregationTemporalitySelector=l(t?.temporalityPreference)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}}})),HE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.estimateVarintSize=void 0;function t(e){return e<0?10:e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:9}e.estimateVarintSize=t})),UE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufWriter=e.GROWING_BUFFER_DEBUG_MESSAGE=void 0;let t=(c(),i(d)),n=HE();e.GROWING_BUFFER_DEBUG_MESSAGE=`ProtobufWriter: estimated size was too small, growing buffer.`,e.ProtobufWriter=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(n){let r=this.pos+n;if(r<=this._buffer.length)return;t.diag.debug(e.GROWING_BUFFER_DEBUG_MESSAGE);let i=this._buffer.length*2;for(;i<r;)i*=2;let a=new Uint8Array(i);a.set(this._buffer),this._buffer=a,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(1),this.pos+=1,e}finishLengthDelimited(e,t){let r=t>>>0,i=(0,n.estimateVarintSize)(r);if(i>1){let t=i-1;this._ensureCapacity(t),this._buffer.copyWithin(e+i,e+1,this.pos),this.pos+=t}let a=e;r<128?this._buffer[a]=r:r<16384?(this._buffer[a++]=r&127|128,this._buffer[a]=r>>>7):r<2097152?(this._buffer[a++]=r&127|128,this._buffer[a++]=r>>>7&127|128,this._buffer[a]=r>>>14):r<268435456?(this._buffer[a++]=r&127|128,this._buffer[a++]=r>>>7&127|128,this._buffer[a++]=r>>>14&127|128,this._buffer[a]=r>>>21):(this._buffer[a++]=r&127|128,this._buffer[a++]=r>>>7&127|128,this._buffer[a++]=r>>>14&127|128,this._buffer[a++]=r>>>21&127|128,this._buffer[a]=r>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let t,n;if(e>=0)t=e>>>0,n=e/4294967296>>>0;else{let r=Math.abs(e);t=r>>>0,n=r/4294967296>>>0,t=~t>>>0,n=~n>>>0,t=t+1>>>0,t===0&&(n=n+1>>>0)}this.writeFixed64(t,n)}writeVarint(e){if(this._ensureCapacity((0,n.estimateVarintSize)(e)),e>=0&&e<=4294967295){let t=e>>>0;for(;t>127;)this._buffer[this.pos++]=t&127|128,t>>>=7;this._buffer[this.pos++]=t}else{let t,n;if(e>=0)t=e>>>0,n=e/4294967296>>>0;else{let r=Math.abs(e);t=r>>>0,n=r/4294967296>>>0,t=~t>>>0,n=~n>>>0,t=t+1>>>0,t===0&&(n=n+1>>>0)}for(;n>0||t>127;)this._buffer[this.pos++]=t&127|128,t=(t>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=t&127}}writeFixed32(e){this._ensureCapacity(4);let t=e>>>0;this._buffer[this.pos++]=t&255,this._buffer[this.pos++]=t>>>8&255,this._buffer[this.pos++]=t>>>16&255,this._buffer[this.pos++]=t>>>24&255}writeFixed64(e,t){this._ensureCapacity(8);let n=e>>>0,r=t>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=r&255,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,t){this.writeVarint(e<<3|t)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let t=!0,n=e.length;for(let r=0;r<n;r++)if(e.charCodeAt(r)>127){t=!1;break}if(t){this.writeVarint(n),this._ensureCapacity(n);for(let t=0;t<n;t++)this._buffer[this.pos++]=e.charCodeAt(t)}else{let t=this._textEncoder.encode(e);this.writeBytes(t)}}}})),WE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBinary=void 0;function t(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function n(e){let n=new Uint8Array(e.length/2),r=0;for(let i=0;i<e.length;i+=2){let a=t(e.charCodeAt(i)),o=t(e.charCodeAt(i+1));n[r++]=a<<4|o}return n}e.hexToBinary=n})),GE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SeverityNumber=void 0,(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(e.SeverityNumber||={})})),KE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NOOP_LOGGER=e.NoopLogger=void 0;var t=class{emit(e){}enabled(){return!1}};e.NoopLogger=t,e.NOOP_LOGGER=new t})),qE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.API_BACKWARDS_COMPATIBILITY_VERSION=e.makeGetter=e._global=e.GLOBAL_LOGS_API_KEY=void 0,e.GLOBAL_LOGS_API_KEY=Symbol.for(`io.opentelemetry.js.api.logs`),e._global=globalThis;function t(e,t,n){return r=>r===e?t:n}e.makeGetter=t,e.API_BACKWARDS_COMPATIBILITY_VERSION=1})),JE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NOOP_LOGGER_PROVIDER=e.NoopLoggerProvider=void 0;let t=KE();var n=class{getLogger(e,n,r){return new t.NoopLogger}};e.NoopLoggerProvider=n,e.NOOP_LOGGER_PROVIDER=new n})),YE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyLogger=void 0;let t=KE();e.ProxyLogger=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):t.NOOP_LOGGER}}})),XE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyLoggerProvider=void 0;let t=JE(),n=YE();e.ProxyLoggerProvider=class{getLogger(e,t,r){return this._getDelegateLogger(e,t,r)??new n.ProxyLogger(this,e,t,r)}_getDelegate(){return this._delegate??t.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),ZE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LogsAPI=void 0;let t=qE(),n=JE(),r=XE();e.LogsAPI=class e{constructor(){this._proxyLoggerProvider=new r.ProxyLoggerProvider}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return t._global[t.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(t._global[t.GLOBAL_LOGS_API_KEY]=(0,t.makeGetter)(t.API_BACKWARDS_COMPATIBILITY_VERSION,e,n.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return t._global[t.GLOBAL_LOGS_API_KEY]?.call(t._global,t.API_BACKWARDS_COMPATIBILITY_VERSION)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete t._global[t.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new r.ProxyLoggerProvider}}})),QE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.logs=e.NoopLogger=e.NOOP_LOGGER=e.SeverityNumber=void 0;var t=GE();Object.defineProperty(e,"SeverityNumber",{enumerable:!0,get:function(){return t.SeverityNumber}});var n=KE();Object.defineProperty(e,"NOOP_LOGGER",{enumerable:!0,get:function(){return n.NOOP_LOGGER}}),Object.defineProperty(e,"NoopLogger",{enumerable:!0,get:function(){return n.NoopLogger}}),e.logs=ZE().LogsAPI.getInstance()})),$E=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.writeResource=e.writeInstrumentationScope=e.writeAnyValue=e.writeKeyValue=e.writeAttributes=e.writeHrTimeAsFixed64=void 0;function t(e,t){let n=t[0],r=t[1],i=1e9,a=n&65535,o=n/65536>>>0,s=a*i,c=o*i,l=s>>>0,u=Math.floor(s/4294967296),d=(c&65535)*65536>>>0,f=c/65536>>>0,p=l+d+r,m=p>>>0,h=Math.floor(p/4294967296),g=u+f+h>>>0;e.writeFixed64(m,g)}e.writeHrTimeAsFixed64=t;function n(e,t,n){for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];e.writeTag(n,2);let o=e.startLengthDelimited(),s=e.pos;r(e,i,a),e.finishLengthDelimited(o,e.pos-s)}}e.writeAttributes=n;function r(e,t,n){e.writeTag(1,2),e.writeString(t),e.writeTag(2,2);let r=e.startLengthDelimited(),i=e.pos;o(e,n),e.finishLengthDelimited(r,e.pos-i)}e.writeKeyValue=r;let i=-(2**63),a=2**63;function o(e,t){let n=typeof t;if(n===`string`)e.writeTag(1,2),e.writeString(t);else if(n===`boolean`)e.writeTag(2,0),e.writeVarint(+!!t);else if(n===`number`){let n=t;Number.isInteger(n)&&n>=i&&n<a?(e.writeTag(3,0),e.writeVarint(n)):(e.writeTag(4,1),e.writeDouble(n))}else if(t instanceof Uint8Array)e.writeTag(7,2),e.writeBytes(t);else if(Array.isArray(t)){e.writeTag(5,2);let n=e.startLengthDelimited(),r=e.pos;for(let n of t){e.writeTag(1,2);let t=e.startLengthDelimited(),r=e.pos;o(e,n),e.finishLengthDelimited(t,e.pos-r)}e.finishLengthDelimited(n,e.pos-r)}else if(n===`object`&&t!=null){e.writeTag(6,2);let n=e.startLengthDelimited(),r=e.pos,i=t;for(let t in i){if(!Object.prototype.hasOwnProperty.call(i,t))continue;let n=i[t];e.writeTag(1,2);let r=e.startLengthDelimited(),a=e.pos;e.writeTag(1,2),e.writeString(t),e.writeTag(2,2);let s=e.startLengthDelimited(),c=e.pos;o(e,n),e.finishLengthDelimited(s,e.pos-c),e.finishLengthDelimited(r,e.pos-a)}e.finishLengthDelimited(n,e.pos-r)}}e.writeAnyValue=o;function s(e,t,n){e.writeTag(n,2);let r=e.startLengthDelimited(),i=e.pos;e.writeTag(1,2),e.writeString(t.name),t.version&&(e.writeTag(2,2),e.writeString(t.version)),e.finishLengthDelimited(r,e.pos-i)}e.writeInstrumentationScope=s;function c(e,t,r){e.writeTag(r,2);let i=e.startLengthDelimited(),a=e.pos;t.attributes&&n(e,t.attributes,1),e.writeTag(2,0),e.writeVarint(0),e.finishLengthDelimited(i,e.pos-a)}e.writeResource=c})),eD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufSizeEstimator=void 0;let t=HE();function n(e){let t=e.length,n=0;for(let r=0;r<t;r++){let t=e.charCodeAt(r);t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4)}return n}e.ProtobufSizeEstimator=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,n){this.pos+=(0,t.estimateVarintSize)(n)}writeVarint(e){this.pos+=(0,t.estimateVarintSize)(e)}writeSint32(e){this.pos+=(0,t.estimateVarintSize)((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,t){this.pos+=8}writeBytes(e){this.pos+=(0,t.estimateVarintSize)(e.length),this.pos+=e.length}writeTag(e,t){this.writeVarint(e<<3|t)}writeDouble(e){this.pos+=8}writeString(e){let r=n(e);this.pos+=(0,t.estimateVarintSize)(r),this.pos+=r}}})),tD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeLogsExportRequest=void 0;let t=UE(),n=WE(),r=QE(),i=$E(),a=eD();function o(e,t){let a=e.startLengthDelimited(),o=e.pos;if(e.writeTag(1,1),(0,i.writeHrTimeAsFixed64)(e,t.hrTime),t.severityNumber!==void 0&&t.severityNumber!==r.SeverityNumber.UNSPECIFIED&&(e.writeTag(2,0),e.writeVarint(t.severityNumber)),t.severityText&&(e.writeTag(3,2),e.writeString(t.severityText)),t.body!==void 0){e.writeTag(5,2);let n=e.startLengthDelimited(),r=e.pos;(0,i.writeAnyValue)(e,t.body),e.finishLengthDelimited(n,e.pos-r)}t.attributes&&(0,i.writeAttributes)(e,t.attributes,6),e.writeTag(7,0),e.writeVarint(t.droppedAttributesCount),t.spanContext?.traceFlags&&(e.writeTag(8,5),e.writeFixed32(t.spanContext.traceFlags)),t.spanContext?.traceId&&(e.writeTag(9,2),e.writeBytes((0,n.hexToBinary)(t.spanContext.traceId))),t.spanContext?.spanId&&(e.writeTag(10,2),e.writeBytes((0,n.hexToBinary)(t.spanContext.spanId))),e.writeTag(11,1),(0,i.writeHrTimeAsFixed64)(e,t.hrTimeObserved),t.eventName&&(e.writeTag(12,2),e.writeString(t.eventName)),e.finishLengthDelimited(a,e.pos-o)}function s(e,t,n){let r=e.startLengthDelimited(),a=e.pos;(0,i.writeInstrumentationScope)(e,t,1);for(let t of n)e.writeTag(2,2),o(e,t);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(r,e.pos-a)}function c(e,t,n){let r=e.startLengthDelimited(),a=e.pos;(0,i.writeResource)(e,t,1);for(let t of n.values()){e.writeTag(2,2);let n=t[0].instrumentationScope;s(e,n,t)}t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(r,e.pos-a)}function l(e){let t=new Map;for(let n of e){let e=n.resource,r=n.instrumentationScope,i=t.get(e);i||(i=new Map,t.set(e,i));let a=i.get(r);a||(a=[],i.set(r,a)),a.push(n)}return t}function u(e){let n=l(e),r=new a.ProtobufSizeEstimator;for(let[e,t]of n)r.writeTag(1,2),c(r,e,t);let i=new t.ProtobufWriter(r.pos);for(let[e,t]of n)i.writeTag(1,2),c(i,e,t);return i.finish()}e.serializeLogsExportRequest=u})),nD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufReader=void 0,e.ProtobufReader=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,t=0,n=!1;for(;this.pos<this._buf.length;){let r=this._buf[this.pos++];if(e+=(r&127)*2**t,t+=7,!(r&128)){n=!0;break}}if(!n)throw Error(`Truncated buffer: unexpected end of data while reading varint`);return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let t=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,t}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:e}=this.readTag();if(e===4)break;this.skip(e)}break;case 4:break;case 5:this.pos+=4;break;default:throw Error(`Unknown wire type ${e}, cannot safely skip`)}}}})),rD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeExportLogsServiceResponse=void 0;let t=nD();function n(e){let n=new t.ProtobufReader(e),r={};for(;!n.isAtEnd();){let{fieldNumber:e,wireType:t}=n.readTag();switch(e){case 1:t===0?r.rejectedLogRecords=n.readVarint():n.skip(t);break;case 2:t===2?r.errorMessage=n.readString():n.skip(t);break;default:n.skip(t);break}}return r}function r(e){let r=new t.ProtobufReader(e),i={};for(;!r.isAtEnd();){let{fieldNumber:e,wireType:t}=r.readTag();switch(e){case 1:t===2?i.partialSuccess=n(r.readBytes()):r.skip(t);break;default:r.skip(t);break}}return i}e.deserializeExportLogsServiceResponse=r})),iD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufLogsSerializer=void 0;let t=tD(),n=rD();e.ProtobufLogsSerializer={serializeRequest:e=>(0,t.serializeLogsExportRequest)(e),deserializeResponse:e=>(0,n.deserializeExportLogsServiceResponse)(e)}})),aD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufLogsSerializer=void 0;var t=iD();Object.defineProperty(e,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return t.ProtobufLogsSerializer}})})),oD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeMetricsExportRequest=void 0;let t=(c(),i(d)),n=mE(),r=$E(),a=eD(),o=UE();function s(e,n,i){let a=e.startLengthDelimited(),o=e.pos;e.writeTag(2,1),(0,r.writeHrTimeAsFixed64)(e,n.startTime),e.writeTag(3,1),(0,r.writeHrTimeAsFixed64)(e,n.endTime),i===t.ValueType.INT?(e.writeTag(6,1),e.writeSfixed64(n.value)):(e.writeTag(4,1),e.writeDouble(n.value)),n.attributes&&(0,r.writeAttributes)(e,n.attributes,7),e.finishLengthDelimited(a,e.pos-o)}function l(e,t){let n=e.startLengthDelimited(),i=e.pos,a=t.value;if(e.writeTag(2,1),(0,r.writeHrTimeAsFixed64)(e,t.startTime),e.writeTag(3,1),(0,r.writeHrTimeAsFixed64)(e,t.endTime),e.writeTag(4,1),e.writeFixed64(a.count>>>0,a.count/4294967296>>>0),a.sum!==void 0&&(e.writeTag(5,1),e.writeDouble(a.sum)),a.buckets.counts.length>0){e.writeTag(6,2);let t=e.startLengthDelimited(),n=e.pos;for(let t of a.buckets.counts)e.writeFixed64(t>>>0,t/4294967296>>>0);e.finishLengthDelimited(t,e.pos-n)}if(a.buckets.boundaries.length>0){e.writeTag(7,2);let t=e.startLengthDelimited(),n=e.pos;for(let t of a.buckets.boundaries)e.writeDouble(t);e.finishLengthDelimited(t,e.pos-n)}t.attributes&&(0,r.writeAttributes)(e,t.attributes,9),a.min!==void 0&&(e.writeTag(11,1),e.writeDouble(a.min)),a.max!==void 0&&(e.writeTag(12,1),e.writeDouble(a.max)),e.finishLengthDelimited(n,e.pos-i)}function u(e,t,n){let r=e.startLengthDelimited(),i=e.pos;if(t!==0&&(e.writeTag(1,0),e.writeSint32(t)),n.length>0){e.writeTag(2,2);let t=e.startLengthDelimited(),r=e.pos;for(let t of n)e.writeVarint(t);e.finishLengthDelimited(t,e.pos-r)}e.finishLengthDelimited(r,e.pos-i)}function f(e,t){let n=e.startLengthDelimited(),i=e.pos,a=t.value;t.attributes&&(0,r.writeAttributes)(e,t.attributes,1),e.writeTag(2,1),(0,r.writeHrTimeAsFixed64)(e,t.startTime),e.writeTag(3,1),(0,r.writeHrTimeAsFixed64)(e,t.endTime),e.writeTag(4,1),e.writeFixed64(a.count>>>0,a.count/4294967296>>>0),a.sum!==void 0&&(e.writeTag(5,1),e.writeDouble(a.sum)),a.scale!==0&&(e.writeTag(6,0),e.writeSint32(a.scale)),e.writeTag(7,1),e.writeFixed64(a.zeroCount>>>0,a.zeroCount/4294967296>>>0),e.writeTag(8,2),u(e,a.positive.offset,a.positive.bucketCounts),e.writeTag(9,2),u(e,a.negative.offset,a.negative.bucketCounts),a.min!==void 0&&(e.writeTag(12,1),e.writeDouble(a.min)),a.max!==void 0&&(e.writeTag(13,1),e.writeDouble(a.max)),e.finishLengthDelimited(n,e.pos-i)}function p(e,t){let r=e.startLengthDelimited(),i=e.pos;switch(e.writeTag(1,2),e.writeString(t.descriptor.name),t.descriptor.description&&(e.writeTag(2,2),e.writeString(t.descriptor.description)),t.descriptor.unit&&(e.writeTag(3,2),e.writeString(t.descriptor.unit)),t.dataPointType){case n.DataPointType.GAUGE:e.writeTag(5,2),m(e,t);break;case n.DataPointType.SUM:e.writeTag(7,2),h(e,t);break;case n.DataPointType.HISTOGRAM:e.writeTag(9,2),g(e,t);break;case n.DataPointType.EXPONENTIAL_HISTOGRAM:e.writeTag(10,2),_(e,t);break;default:}e.finishLengthDelimited(r,e.pos-i)}function m(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),s(e,n,t.descriptor.valueType);e.finishLengthDelimited(n,e.pos-r)}function h(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),s(e,n,t.descriptor.valueType);let i=b(t.aggregationTemporality);i!==0&&(e.writeTag(2,0),e.writeVarint(i)),t.isMonotonic&&(e.writeTag(3,0),e.writeVarint(1)),e.finishLengthDelimited(n,e.pos-r)}function g(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),l(e,n);let i=b(t.aggregationTemporality);i!==0&&(e.writeTag(2,0),e.writeVarint(i)),e.finishLengthDelimited(n,e.pos-r)}function _(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),f(e,n);let i=b(t.aggregationTemporality);i!==0&&(e.writeTag(2,0),e.writeVarint(i)),e.finishLengthDelimited(n,e.pos-r)}function v(e,t){let n=e.startLengthDelimited(),i=e.pos;(0,r.writeInstrumentationScope)(e,t.scope,1);for(let n of t.metrics)e.writeTag(2,2),p(e,n);t.scope.schemaUrl&&(e.writeTag(3,2),e.writeString(t.scope.schemaUrl)),e.finishLengthDelimited(n,e.pos-i)}function y(e,t){let n=e.startLengthDelimited(),i=e.pos;(0,r.writeResource)(e,t.resource,1);for(let n of t.scopeMetrics)e.writeTag(2,2),v(e,n);t.resource.schemaUrl&&(e.writeTag(3,2),e.writeString(t.resource.schemaUrl)),e.finishLengthDelimited(n,e.pos-i)}function b(e){switch(e){case n.AggregationTemporality.DELTA:return 1;case n.AggregationTemporality.CUMULATIVE:return 2;default:return 0}}function x(e){let t=new a.ProtobufSizeEstimator;t.writeTag(1,2),y(t,e);let n=new o.ProtobufWriter(t.pos);return n.writeTag(1,2),y(n,e),n.finish()}e.serializeMetricsExportRequest=x})),sD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeExportMetricsServiceResponse=void 0;let t=nD();function n(e){let n=new t.ProtobufReader(e),r={};for(;!n.isAtEnd();){let{fieldNumber:e,wireType:t}=n.readTag();switch(e){case 1:t===0?r.rejectedDataPoints=n.readVarint():n.skip(t);break;case 2:t===2?r.errorMessage=n.readString():n.skip(t);break;default:n.skip(t);break}}return r}function r(e){let r=new t.ProtobufReader(e),i={};for(;!r.isAtEnd();){let{fieldNumber:e,wireType:t}=r.readTag();switch(e){case 1:t===2?i.partialSuccess=n(r.readBytes()):r.skip(t);break;default:r.skip(t);break}}return i}e.deserializeExportMetricsServiceResponse=r})),cD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufMetricsSerializer=void 0;let t=oD(),n=sD();e.ProtobufMetricsSerializer={serializeRequest:e=>(0,t.serializeMetricsExportRequest)(e),deserializeResponse:e=>(0,n.deserializeExportMetricsServiceResponse)(e)}})),lD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufMetricsSerializer=void 0;var t=cD();Object.defineProperty(e,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return t.ProtobufMetricsSerializer}})})),uD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeTraceExportRequest=void 0;let t=UE(),n=WE(),r=$E(),i=eD();function a(e,t){let n=e&255|256;return t&&(n|=512),n}function o(e,t){let n=e.startLengthDelimited(),r=e.pos;t.message&&(e.writeTag(2,2),e.writeString(t.message)),e.writeTag(3,0),e.writeVarint(t.code),e.finishLengthDelimited(n,e.pos-r)}function s(e,t){let n=e.startLengthDelimited(),i=e.pos;e.writeTag(1,1),(0,r.writeHrTimeAsFixed64)(e,t.time),e.writeTag(2,2),e.writeString(t.name),t.attributes&&(0,r.writeAttributes)(e,t.attributes,3),e.writeTag(4,0),e.writeVarint(t.droppedAttributesCount||0),e.finishLengthDelimited(n,e.pos-i)}function c(e,t){let i=e.startLengthDelimited(),o=e.pos,s=t.context;e.writeTag(1,2),e.writeBytes((0,n.hexToBinary)(s.traceId)),e.writeTag(2,2),e.writeBytes((0,n.hexToBinary)(s.spanId));let c=s.traceState?.serialize();c&&(e.writeTag(3,2),e.writeString(c)),t.attributes&&(0,r.writeAttributes)(e,t.attributes,4),e.writeTag(5,0),e.writeVarint(t.droppedAttributesCount||0);let l=a(s.traceFlags,s.isRemote);l&&(e.writeTag(6,5),e.writeFixed32(l)),e.finishLengthDelimited(i,e.pos-o)}function l(e,t){let i=e.startLengthDelimited(),l=e.pos,u=t.spanContext();e.writeTag(1,2),e.writeBytes((0,n.hexToBinary)(u.traceId)),e.writeTag(2,2),e.writeBytes((0,n.hexToBinary)(u.spanId));let d=u.traceState?.serialize();d&&(e.writeTag(3,2),e.writeString(d)),t.parentSpanContext?.spanId&&(e.writeTag(4,2),e.writeBytes((0,n.hexToBinary)(t.parentSpanContext.spanId))),e.writeTag(5,2),e.writeString(t.name);let f=t.kind==null?0:t.kind+1;f!==0&&(e.writeTag(6,0),e.writeVarint(f)),e.writeTag(7,1),(0,r.writeHrTimeAsFixed64)(e,t.startTime),e.writeTag(8,1),(0,r.writeHrTimeAsFixed64)(e,t.endTime),t.attributes&&(0,r.writeAttributes)(e,t.attributes,9),e.writeTag(10,0),e.writeVarint(t.droppedAttributesCount);for(let n of t.events)e.writeTag(11,2),s(e,n);e.writeTag(12,0),e.writeVarint(t.droppedEventsCount);for(let n of t.links)e.writeTag(13,2),c(e,n);e.writeTag(14,0),e.writeVarint(t.droppedLinksCount),e.writeTag(15,2),o(e,t.status);let p=a(u.traceFlags,t.parentSpanContext?.isRemote);p&&(e.writeTag(16,5),e.writeFixed32(p)),e.finishLengthDelimited(i,e.pos-l)}function u(e,t,n){let i=e.startLengthDelimited(),a=e.pos;(0,r.writeInstrumentationScope)(e,t,1);for(let t of n)e.writeTag(2,2),l(e,t);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-a)}function d(e,t,n){let i=e.startLengthDelimited(),a=e.pos;(0,r.writeResource)(e,t,1);for(let t of n.values()){e.writeTag(2,2);let n=t[0].instrumentationScope;u(e,n,t)}t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-a)}function f(e){let t=new Map;for(let n of e){let e=n.resource,r=n.instrumentationScope,i=t.get(e);i||(i=new Map,t.set(e,i));let a=i.get(r);a||(a=[],i.set(r,a)),a.push(n)}return t}function p(e){let n=f(e),r=new i.ProtobufSizeEstimator;for(let[e,t]of n)r.writeTag(1,2),d(r,e,t);let a=new t.ProtobufWriter(r.pos);for(let[e,t]of n)a.writeTag(1,2),d(a,e,t);return a.finish()}e.serializeTraceExportRequest=p})),dD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeExportTraceServiceResponse=void 0;let t=nD();function n(e){let n=new t.ProtobufReader(e),r={};for(;!n.isAtEnd();){let{fieldNumber:e,wireType:t}=n.readTag();switch(e){case 1:t===0?r.rejectedSpans=n.readVarint():n.skip(t);break;case 2:t===2?r.errorMessage=n.readString():n.skip(t);break;default:n.skip(t);break}}return r}function r(e){let r=new t.ProtobufReader(e),i={};for(;!r.isAtEnd();){let{fieldNumber:e,wireType:t}=r.readTag();switch(e){case 1:t===2?i.partialSuccess=n(r.readBytes()):r.skip(t);break;default:r.skip(t);break}}return i}e.deserializeExportTraceServiceResponse=r})),fD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufTraceSerializer=void 0;let t=uD(),n=dD();e.ProtobufTraceSerializer={serializeRequest:e=>(0,t.serializeTraceExportRequest)(e),deserializeResponse:e=>(0,n.deserializeExportTraceServiceResponse)(e)}})),pD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufTraceSerializer=void 0;var t=fD();Object.defineProperty(e,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return t.ProtobufTraceSerializer}})})),mD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toAnyValue=e.toKeyValue=e.toAttributes=e.createInstrumentationScope=e.createResource=void 0;function t(e,t){let n={attributes:r(e.attributes,t),droppedAttributesCount:0},i=e.schemaUrl;return i&&i!==``&&(n.schemaUrl=i),n}e.createResource=t;function n(e){return{name:e.name,version:e.version}}e.createInstrumentationScope=n;function r(e,t){return Object.keys(e).map(n=>i(n,e[n],t))}e.toAttributes=r;function i(e,t,n){return{key:e,value:a(t,n)}}e.toKeyValue=i;function a(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=a(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:a(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}e.toAnyValue=a})),hD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toLogAttributes=e.createExportLogsServiceRequest=void 0;let t=mD();function n(e,t){return{resourceLogs:i(e,t)}}e.createExportLogsServiceRequest=n;function r(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function i(e,n){let i=r(e);return Array.from(i,([e,r])=>{let i=(0,t.createResource)(e,n);return{resource:i,scopeLogs:Array.from(r,([,e])=>({scope:(0,t.createInstrumentationScope)(e[0].instrumentationScope),logRecords:e.map(e=>a(e,n)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:i.schemaUrl}})}function a(e,n){return{timeUnixNano:n.encodeHrTime(e.hrTime),observedTimeUnixNano:n.encodeHrTime(e.hrTimeObserved),severityNumber:o(e.severityNumber),severityText:e.severityText,body:(0,t.toAnyValue)(e.body,n),eventName:e.eventName,attributes:s(e.attributes,n),droppedAttributesCount:e.droppedAttributesCount,flags:e.spanContext?.traceFlags,traceId:n.encodeOptionalSpanContext(e.spanContext?.traceId),spanId:n.encodeOptionalSpanContext(e.spanContext?.spanId)}}function o(e){return e}function s(e,n){return Object.keys(e).map(r=>(0,t.toKeyValue)(r,e[r],n))}e.toLogAttributes=s})),gD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JSON_ENCODER=e.PROTOBUF_ENCODER=e.encodeAsString=e.encodeAsLongBits=e.toLongBits=e.hrTimeToNanos=void 0;let t=q(),n=WE();function r(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}e.hrTimeToNanos=r;function i(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}e.toLongBits=i;function a(e){return i(r(e))}e.encodeAsLongBits=a;function o(e){return r(e).toString()}e.encodeAsString=o;let s=typeof BigInt<`u`?o:t.hrTimeToNanoseconds;function c(e){return e}function l(e){if(e!==void 0)return(0,n.hexToBinary)(e)}e.PROTOBUF_ENCODER={encodeHrTime:a,encodeSpanContext:n.hexToBinary,encodeOptionalSpanContext:l,encodeUint8Array:c},e.JSON_ENCODER={encodeHrTime:s,encodeSpanContext:c,encodeOptionalSpanContext:c,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}}})),_D=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonLogsSerializer=void 0;let t=hD(),n=gD(),r=(c(),i(d));e.JsonLogsSerializer={serializeRequest:e=>{let r=(0,t.createExportLogsServiceRequest)(e,n.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(r))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return r.diag.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}}})),vD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonLogsSerializer=void 0;var t=_D();Object.defineProperty(e,"JsonLogsSerializer",{enumerable:!0,get:function(){return t.JsonLogsSerializer}})})),yD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EAggregationTemporality=void 0,(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]=`AGGREGATION_TEMPORALITY_UNSPECIFIED`,e[e.AGGREGATION_TEMPORALITY_DELTA=1]=`AGGREGATION_TEMPORALITY_DELTA`,e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]=`AGGREGATION_TEMPORALITY_CUMULATIVE`})(e.EAggregationTemporality||={})})),bD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createExportMetricsServiceRequest=e.toMetric=e.toScopeMetrics=e.toResourceMetrics=void 0;let t=(c(),i(d)),n=mE(),r=yD(),a=mD();function o(e,t){let n=(0,a.createResource)(e.resource,t);return{resource:n,schemaUrl:n.schemaUrl,scopeMetrics:s(e.scopeMetrics,t)}}e.toResourceMetrics=o;function s(e,t){return Array.from(e.map(e=>({scope:(0,a.createInstrumentationScope)(e.scope),metrics:e.metrics.map(e=>l(e,t)),schemaUrl:e.scope.schemaUrl})))}e.toScopeMetrics=s;function l(e,t){let r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},i=h(e.aggregationTemporality);switch(e.dataPointType){case n.DataPointType.SUM:r.sum={aggregationTemporality:i,isMonotonic:e.isMonotonic,dataPoints:f(e,t)};break;case n.DataPointType.GAUGE:r.gauge={dataPoints:f(e,t)};break;case n.DataPointType.HISTOGRAM:r.histogram={aggregationTemporality:i,dataPoints:p(e,t)};break;case n.DataPointType.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:i,dataPoints:m(e,t)};break}return r}e.toMetric=l;function u(e,n,r){let i={attributes:(0,a.toAttributes)(e.attributes,r),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(n){case t.ValueType.INT:i.asInt=e.value;break;case t.ValueType.DOUBLE:i.asDouble=e.value;break}return i}function f(e,t){return e.dataPoints.map(n=>u(n,e.descriptor.valueType,t))}function p(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:(0,a.toAttributes)(e.attributes,t),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function m(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:(0,a.toAttributes)(e.attributes,t),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function h(e){switch(e){case n.AggregationTemporality.DELTA:return r.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;case n.AggregationTemporality.CUMULATIVE:return r.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE}}function g(e,t){return{resourceMetrics:e.map(e=>o(e,t))}}e.createExportMetricsServiceRequest=g})),xD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonMetricsSerializer=void 0;let t=bD(),n=gD(),r=(c(),i(d));e.JsonMetricsSerializer={serializeRequest:e=>{let r=(0,t.createExportMetricsServiceRequest)([e],n.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(r))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return r.diag.warn(`Failed to parse metrics export response: ${e.message}. Returning empty response`),{}}}}})),SD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonMetricsSerializer=void 0;var t=xD();Object.defineProperty(e,"JsonMetricsSerializer",{enumerable:!0,get:function(){return t.JsonMetricsSerializer}})})),CD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createExportTraceServiceRequest=e.toOtlpSpanEvent=e.toOtlpLink=e.sdkSpanToOtlpSpan=void 0;let t=mD();function n(e,t){let n=e&255|256;return t&&(n|=512),n}function r(e,r){let o=e.spanContext(),s=e.status,c=e.parentSpanContext?.spanId?r.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:r.encodeSpanContext(o.traceId),spanId:r.encodeSpanContext(o.spanId),parentSpanId:c,traceState:o.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:r.encodeHrTime(e.startTime),endTimeUnixNano:r.encodeHrTime(e.endTime),attributes:(0,t.toAttributes)(e.attributes,r),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>a(e,r)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>i(e,r)),droppedLinksCount:e.droppedLinksCount,flags:n(o.traceFlags,e.parentSpanContext?.isRemote)}}e.sdkSpanToOtlpSpan=r;function i(e,r){return{attributes:e.attributes?(0,t.toAttributes)(e.attributes,r):[],spanId:r.encodeSpanContext(e.context.spanId),traceId:r.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:n(e.context.traceFlags,e.context.isRemote)}}e.toOtlpLink=i;function a(e,n){return{attributes:e.attributes?(0,t.toAttributes)(e.attributes,n):[],name:e.name,timeUnixNano:n.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}e.toOtlpSpanEvent=a;function o(e,t){return{resourceSpans:c(e,t)}}e.createExportTraceServiceRequest=o;function s(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function c(e,n){let i=s(e),a=[],o=i.entries(),c=o.next();for(;!c.done;){let[e,i]=c.value,s=[],l=i.values(),u=l.next();for(;!u.done;){let e=u.value;if(e.length>0){let i=e.map(e=>r(e,n));s.push({scope:(0,t.createInstrumentationScope)(e[0].instrumentationScope),spans:i,schemaUrl:e[0].instrumentationScope.schemaUrl})}u=l.next()}let d=(0,t.createResource)(e,n),f={resource:d,scopeSpans:s,schemaUrl:d.schemaUrl};a.push(f),c=o.next()}return a}})),wD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonTraceSerializer=void 0;let t=CD(),n=gD(),r=(c(),i(d));e.JsonTraceSerializer={serializeRequest:e=>{let r=(0,t.createExportTraceServiceRequest)(e,n.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(r))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return r.diag.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}}})),TD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonTraceSerializer=void 0;var t=wD();Object.defineProperty(e,"JsonTraceSerializer",{enumerable:!0,get:function(){return t.JsonTraceSerializer}})})),ED=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonTraceSerializer=e.JsonMetricsSerializer=e.JsonLogsSerializer=e.ProtobufTraceSerializer=e.ProtobufMetricsSerializer=e.ProtobufLogsSerializer=void 0;var t=aD();Object.defineProperty(e,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return t.ProtobufLogsSerializer}});var n=lD();Object.defineProperty(e,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return n.ProtobufMetricsSerializer}});var r=pD();Object.defineProperty(e,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return r.ProtobufTraceSerializer}});var i=vD();Object.defineProperty(e,"JsonLogsSerializer",{enumerable:!0,get:function(){return i.JsonLogsSerializer}});var a=SD();Object.defineProperty(e,"JsonMetricsSerializer",{enumerable:!0,get:function(){return a.JsonMetricsSerializer}});var o=TD();Object.defineProperty(e,"JsonTraceSerializer",{enumerable:!0,get:function(){return o.JsonTraceSerializer}})}));function DD(t){let n={};return Object.entries(t??{}).forEach(([t,r])=>{r===void 0?e.warn(`Header "${t}" has invalid value (${r}) and will be ignored`):n[t]=String(r)}),n}var OD=n((()=>{c()}));function kD(e,t,n){return async()=>{let r={...await n()},i={};return t!=null&&Object.assign(i,await t()),e!=null&&Object.assign(i,DD(await e())),Object.assign(i,r)}}function AD(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function jD(e,t,n){return{...SE(e,t,n),headers:kD(e.headers,t.headers,n.headers),url:AD(e.url)??t.url??n.url}}function MD(e,t){return{...CE(),headers:async()=>e,url:`http://localhost:4318/`+t}}var ND=n((()=>{wE(),OD()}));function PD(e){return async t=>{let n=t===`http:`,{Agent:r}=await(n?import(`http`):import(`https`));if(n){let{ca:t,cert:n,key:i,...a}=e;return new r(a)}return new r(e)}}function FD(e,t,n){return{...jD(e,t,n),agentFactory:e.agentFactory??t.agentFactory??n.agentFactory,userAgent:e.userAgent}}function ID(e,t){return{...MD(e,t),agentFactory:PD({keepAlive:!0})}}var LD=n((()=>{ND()}));function RD(e){return e===429||e===502||e===503||e===504}function zD(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var BD=n((()=>{})),VD,HD=n((()=>{VD=`0.218.0`}));function UD(e,t,n,r,i,a,o,s){return new Promise(c=>{let l=new URL(t);i?n[`User-Agent`]=`${i} ${qD}`:n[`User-Agent`]=qD;let u=e(l,{method:`POST`,headers:n,agent:a},e=>{let t=[],n=0;e.on(`data`,r=>{if(n+=r.length,n>4194304){c({status:`failure`,error:Error(`OTLP export response body exceeded size limit of ${JD} bytes`)}),e.destroy();return}t.push(r)}),e.on(`end`,()=>{e.statusCode&&e.statusCode<=299?c({status:`success`,data:Buffer.concat(t)}):e.statusCode&&RD(e.statusCode)?c({status:`retryable`,retryInMillis:zD(e.headers[`retry-after`])}):c({status:`failure`,error:new vE(e.statusMessage,e.statusCode,Buffer.concat(t).toString())})}),e.on(`error`,t=>{e.statusCode&&e.statusCode<=299?c({status:`success`}):e.statusCode&&RD(e.statusCode)?c({status:`retryable`,error:t,retryInMillis:zD(e.headers[`retry-after`])}):c({status:`failure`,error:t})})});u.setTimeout(s,()=>{u.destroy(),c({status:`retryable`,error:Error(`Request timed out`)})}),u.on(`error`,e=>{KD(e)?c({status:`retryable`,error:e}):c({status:`failure`,error:e})}),WD(u,r,o,e=>{c({status:`failure`,error:e})})})}function WD(e,t,n,r){let i=GD(n);t===`gzip`&&(e.setHeader(`Content-Encoding`,`gzip`),i=i.on(`error`,r).pipe(we.createGzip()).on(`error`,r)),i.pipe(e).on(`error`,r)}function GD(e){let t=new he;return t.push(e),t.push(null),t}function KD(e){let t=new Set([`ECONNRESET`,`ECONNREFUSED`,`EPIPE`,`ETIMEDOUT`,`EAI_AGAIN`,`ENOTFOUND`,`ENETUNREACH`,`EHOSTUNREACH`]);return`code`in e&&typeof e.code==`string`?t.has(e.code):!1}var qD,JD,YD=n((()=>{BD(),yE(),HD(),qD=`OTel-OTLP-Exporter-JavaScript/${VD}`,JD=4*1024*1024}));async function XD(e){let{request:t}=await(e===`http:`?import(`http`):import(`https`));return t}function ZD(e){return new QD(e)}var QD,$D=n((()=>{YD(),QD=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,t){let{agent:n,request:r}=await this._loadUtils(),i=await this._parameters.headers();return UD(r,this._parameters.url,i,this._parameters.compression,this._parameters.userAgent,n,e,t)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let t=new URL(this._parameters.url).protocol,[n,r]=await Promise.all([this._parameters.agentFactory(t),XD(t)]);e=this._utils={agent:n,request:r}}return e}}}));function eO(){return 2*oO*Math.random()-oO}function tO(e){return new sO(e.transport)}var nO,rO,iO,aO,oO,sO,cO=n((()=>{c(),nO=5,rO=1e3,iO=5e3,aO=1.5,oO=.2,sO=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(t,n){let r=nO,i=rO,a=Date.now()+n,o=await this._transport.send(t,n);for(;o.status===`retryable`&&r>0;){r--;let n=Math.max(Math.min(i*(1+eO()),iO),0);i*=aO;let s=o.retryInMillis??n,c=a-Date.now();if(s>c)return e.info(`Export retry time ${Math.round(s)}ms exceeds remaining timeout ${Math.round(c)}ms, not retrying further.`),o;e.verbose(`Scheduling export retry in ${Math.round(s)}ms`),o=await this.retry(t,c,s)}return o.status===`success`?e.verbose(`Export succeeded after ${nO-r} retry attempts.`):o.status===`retryable`?e.info(`Export failed after maximum retry attempts (${nO}).`):e.info(`Export failed with non-retryable error: ${o.error}`),o}shutdown(){return this._transport.shutdown()}}}));function lO(e,t){return NE({transport:tO({transport:ZD(e)}),serializer:t,promiseHandler:DE(e)},{timeout:e.timeoutMillis})}var uO=n((()=>{IE(),$D(),kE(),cO()}));function dO(t){let n=(0,gO.getNumberFromEnv)(t);if(n!=null){if(Number.isFinite(n)&&n>0)return n;e.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${n})`)}}function fO(e){let t=dO(`OTEL_EXPORTER_OTLP_${e}_TIMEOUT`),n=dO(`OTEL_EXPORTER_OTLP_TIMEOUT`);return t??n}function pO(t){let n=(0,gO.getStringFromEnv)(t)?.trim();if(n==null||n===`none`||n===`gzip`)return n;e.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${n}')`)}function mO(e){let t=pO(`OTEL_EXPORTER_OTLP_${e}_COMPRESSION`),n=pO(`OTEL_EXPORTER_OTLP_COMPRESSION`);return t??n}function hO(e){return{timeoutMillis:fO(e),compression:mO(e)}}var gO,_O=n((()=>{gO=q(),c()}));function vO(e){let t=(0,OO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_HEADERS`),n=(0,OO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_HEADERS`),r=(0,OO.parseKeyPairsIntoRecord)(t),i=(0,OO.parseKeyPairsIntoRecord)(n);if(!(Object.keys(r).length===0&&Object.keys(i).length===0))return Object.assign({},(0,OO.parseKeyPairsIntoRecord)(n),(0,OO.parseKeyPairsIntoRecord)(t))}function yO(t){try{return new URL(t).toString()}catch{e.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function bO(t,n){try{new URL(t)}catch{e.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith(`/`)||(t+=`/`),t+=n;try{new URL(t)}catch{e.warn(`Configuration: Provided URL appended with '${n}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function xO(e){let t=(0,OO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_ENDPOINT`);if(t!==void 0)return bO(t,e)}function SO(e){let t=(0,OO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`);if(t!==void 0)return yO(t)}function CO(t,n,r){let i=(0,OO.getStringFromEnv)(t),a=(0,OO.getStringFromEnv)(n),o=i??a;if(o!=null)try{return B.readFileSync(fe.resolve(process.cwd(),o))}catch{e.warn(r);return}else return}function wO(e){return CO(`OTEL_EXPORTER_OTLP_${e}_CLIENT_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`,`Failed to read client certificate chain file`)}function TO(e){return CO(`OTEL_EXPORTER_OTLP_${e}_CLIENT_KEY`,`OTEL_EXPORTER_OTLP_CLIENT_KEY`,`Failed to read client certificate private key file`)}function EO(e){return CO(`OTEL_EXPORTER_OTLP_${e}_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CERTIFICATE`,`Failed to read root certificate file`)}function DO(e,t){return{...hO(e),url:SO(e)??xO(t),headers:xE(vO(e)),agentFactory:PD({keepAlive:!0,ca:EO(e),cert:wO(e),key:TO(e)})}}var OO,kO=n((()=>{OO=q(),c(),_O(),wE(),LD()}));function AO(e){return typeof e.headers==`function`?e.headers:xE(e.headers)}var jO=n((()=>{wE()}));function MO(e){if(typeof e.httpAgentOptions==`function`)return e.httpAgentOptions;let t=e.httpAgentOptions;if(e.keepAlive!=null&&(t={keepAlive:e.keepAlive,...t}),t!=null)return PD(t)}function NO(t,n,r,i){return t.metadata&&e.warn(`Metadata cannot be set when using http`),FD({url:t.url,headers:AO(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:MO(t),userAgent:t.userAgent},DO(n,r),ID(i,r))}var PO=n((()=>{c(),LD(),IO(),kO(),jO()})),FO=l({convertLegacyHttpOptions:()=>NO,createOtlpHttpExportDelegate:()=>lO,getSharedConfigurationFromEnvironment:()=>hO,httpAgentFactoryFromOptions:()=>PD}),IO=n((()=>{LD(),uO(),_O(),PO()})),LO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;let t=VE(),n=ED(),r=(IO(),i(FO));e.OTLPMetricExporter=class extends t.OTLPMetricExporterBase{constructor(e){super((0,r.createOtlpHttpExportDelegate)((0,r.convertLegacyHttpOptions)(e??{},`METRICS`,`v1/metrics`,{"Content-Type":`application/json`}),n.JsonMetricsSerializer),e)}}})),RO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=LO();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})})),zO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=RO();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})})),BO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporterBase=e.LowMemoryTemporalitySelector=e.DeltaTemporalitySelector=e.CumulativeTemporalitySelector=e.AggregationTemporalityPreference=e.OTLPMetricExporter=void 0;var t=zO();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}});var n=hE();Object.defineProperty(e,"AggregationTemporalityPreference",{enumerable:!0,get:function(){return n.AggregationTemporalityPreference}});var r=VE();Object.defineProperty(e,"CumulativeTemporalitySelector",{enumerable:!0,get:function(){return r.CumulativeTemporalitySelector}}),Object.defineProperty(e,"DeltaTemporalitySelector",{enumerable:!0,get:function(){return r.DeltaTemporalitySelector}}),Object.defineProperty(e,"LowMemoryTemporalitySelector",{enumerable:!0,get:function(){return r.LowMemoryTemporalitySelector}}),Object.defineProperty(e,"OTLPMetricExporterBase",{enumerable:!0,get:function(){return r.OTLPMetricExporterBase}})})),VO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`0.218.0`})),J=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=e.Propagate=e.LogVerbosity=e.Status=void 0;var t;(function(e){e[e.OK=0]=`OK`,e[e.CANCELLED=1]=`CANCELLED`,e[e.UNKNOWN=2]=`UNKNOWN`,e[e.INVALID_ARGUMENT=3]=`INVALID_ARGUMENT`,e[e.DEADLINE_EXCEEDED=4]=`DEADLINE_EXCEEDED`,e[e.NOT_FOUND=5]=`NOT_FOUND`,e[e.ALREADY_EXISTS=6]=`ALREADY_EXISTS`,e[e.PERMISSION_DENIED=7]=`PERMISSION_DENIED`,e[e.RESOURCE_EXHAUSTED=8]=`RESOURCE_EXHAUSTED`,e[e.FAILED_PRECONDITION=9]=`FAILED_PRECONDITION`,e[e.ABORTED=10]=`ABORTED`,e[e.OUT_OF_RANGE=11]=`OUT_OF_RANGE`,e[e.UNIMPLEMENTED=12]=`UNIMPLEMENTED`,e[e.INTERNAL=13]=`INTERNAL`,e[e.UNAVAILABLE=14]=`UNAVAILABLE`,e[e.DATA_LOSS=15]=`DATA_LOSS`,e[e.UNAUTHENTICATED=16]=`UNAUTHENTICATED`})(t||(e.Status=t={}));var n;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.INFO=1]=`INFO`,e[e.ERROR=2]=`ERROR`,e[e.NONE=3]=`NONE`})(n||(e.LogVerbosity=n={}));var r;(function(e){e[e.DEADLINE=1]=`DEADLINE`,e[e.CENSUS_STATS_CONTEXT=2]=`CENSUS_STATS_CONTEXT`,e[e.CENSUS_TRACING_CONTEXT=4]=`CENSUS_TRACING_CONTEXT`,e[e.CANCELLATION=8]=`CANCELLATION`,e[e.DEFAULTS=65535]=`DEFAULTS`})(r||(e.Propagate=r={})),e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1,e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024})),HO=t(((e,t)=>{t.exports={name:`@grpc/grpc-js`,version:`1.14.4`,description:`gRPC Library for Node - pure JS implementation`,homepage:`https://grpc.io/`,repository:`https://github.com/grpc/grpc-node/tree/master/packages/grpc-js`,main:`build/src/index.js`,engines:{node:`>=12.10.0`},keywords:[],author:{name:`Google Inc.`},types:`build/src/index.d.ts`,license:`Apache-2.0`,devDependencies:{"@grpc/proto-loader":`file:../proto-loader`,"@types/gulp":`^4.0.17`,"@types/gulp-mocha":`0.0.37`,"@types/lodash":`^4.14.202`,"@types/mocha":`^10.0.6`,"@types/ncp":`^2.0.8`,"@types/node":`>=20.11.20`,"@types/pify":`^5.0.4`,"@types/semver":`^7.5.8`,"@typescript-eslint/eslint-plugin":`^7.1.0`,"@typescript-eslint/parser":`^7.1.0`,"@typescript-eslint/typescript-estree":`^7.1.0`,"clang-format":`^1.8.0`,eslint:`^8.42.0`,"eslint-config-prettier":`^8.8.0`,"eslint-plugin-node":`^11.1.0`,"eslint-plugin-prettier":`^4.2.1`,execa:`^2.0.3`,gulp:`^4.0.2`,"gulp-mocha":`^6.0.0`,lodash:`^4.17.21`,madge:`^5.0.1`,"mocha-jenkins-reporter":`^0.4.1`,ncp:`^2.0.0`,pify:`^4.0.1`,prettier:`^2.8.8`,rimraf:`^3.0.2`,semver:`^7.6.0`,"ts-node":`^10.9.2`,typescript:`^5.3.3`},contributors:[{name:`Google Inc.`}],scripts:{build:`npm run compile`,clean:`rimraf ./build`,compile:`tsc -p .`,format:`clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts`,lint:`eslint src/*.ts test/*.ts`,prepare:`npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile`,test:`gulp test`,check:`npm run lint`,fix:`eslint --fix src/*.ts test/*.ts`,pretest:`npm run generate-types && npm run generate-test-types && npm run compile`,posttest:`npm run check && madge -c ./build/src`,"generate-types":`proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto`,"generate-test-types":`proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto`,"copy-protos":`node ./copy-protos`},dependencies:{"@grpc/proto-loader":`^0.8.0`,"@js-sdsl/ordered-map":`^4.4.2`},files:[`src/**/*.ts`,`build/src/**/*.{js,d.ts,js.map}`,`proto/**/*.proto`,`proto/**/LICENSE`,`LICENSE`,`deps/envoy-api/envoy/api/v2/**/*.proto`,`deps/envoy-api/envoy/config/**/*.proto`,`deps/envoy-api/envoy/service/**/*.proto`,`deps/envoy-api/envoy/type/**/*.proto`,`deps/udpa/udpa/**/*.proto`,`deps/googleapis/google/api/*.proto`,`deps/googleapis/google/rpc/*.proto`,`deps/protoc-gen-validate/validate/**/*.proto`]}})),Y=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=d,e.isTracerEnabled=f;let t=J(),n=s(`process`),r=HO().version,i={error:(e,...t)=>{console.error(`E `+e,...t)},info:(e,...t)=>{console.error(`I `+e,...t)},debug:(e,...t)=>{console.error(`D `+e,...t)}},a=t.LogVerbosity.ERROR;switch((process.env.GRPC_NODE_VERBOSITY??process.env.GRPC_VERBOSITY??``).toUpperCase()){case`DEBUG`:a=t.LogVerbosity.DEBUG;break;case`INFO`:a=t.LogVerbosity.INFO;break;case`ERROR`:a=t.LogVerbosity.ERROR;break;case`NONE`:a=t.LogVerbosity.NONE;break;default:}e.getLogger=()=>i,e.setLogger=e=>{i=e},e.setLoggerVerbosity=e=>{a=e},e.log=(e,...n)=>{let r;if(e>=a){switch(e){case t.LogVerbosity.DEBUG:r=i.debug;break;case t.LogVerbosity.INFO:r=i.info;break;case t.LogVerbosity.ERROR:r=i.error;break}r||=i.error,r&&r.bind(i)(...n)}};let o=process.env.GRPC_NODE_TRACE??process.env.GRPC_TRACE??``,c=new Set,l=new Set;for(let e of o.split(`,`))e.startsWith(`-`)?l.add(e.substring(1)):c.add(e);let u=c.has(`all`);function d(t,i,a){f(i)&&(0,e.log)(t,new Date().toISOString()+` | v`+r+` `+n.pid+` | `+i+` | `+a)}function f(e){return!l.has(e)&&(u||c.has(e))}})),UO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorMessage=t,e.getErrorCode=n;function t(e){return e instanceof Error?e.message:String(e)}function n(e){return typeof e==`object`&&e&&`code`in e&&typeof e.code==`number`?e.code:null}})),X=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;let t=Y(),n=J(),r=UO(),i=/^[:0-9a-z_.-]+$/,a=/^[ -~]*$/;function o(e){return i.test(e)}function s(e){return a.test(e)}function c(e){return e.endsWith(`-bin`)}function l(e){return!e.startsWith(`grpc-`)}function u(e){return e.toLowerCase()}function d(e,t){if(!o(e))throw Error(`Metadata key "`+e+`" contains illegal characters`);if(t!=null)if(c(e)){if(!Buffer.isBuffer(t))throw Error(`keys that end with '-bin' must have Buffer values`)}else{if(Buffer.isBuffer(t))throw Error(`keys that don't end with '-bin' must have String values`);if(!s(t))throw Error(`Metadata string value "`+t+`" contains illegal characters`)}}e.Metadata=class e{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){e=u(e),d(e,t),this.internalRepr.set(e,[t])}add(e,t){e=u(e),d(e,t);let n=this.internalRepr.get(e);n===void 0?this.internalRepr.set(e,[t]):n.push(t)}remove(e){e=u(e),this.internalRepr.delete(e)}get(e){return e=u(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,n]of this.internalRepr)if(n.length>0){let r=n[0];e[t]=Buffer.isBuffer(r)?Buffer.from(r):r}return e}clone(){let t=new e(this.options),n=t.internalRepr;for(let[e,t]of this.internalRepr){let r=t.map(e=>Buffer.isBuffer(e)?Buffer.from(e):e);n.set(e,r)}return t}merge(e){for(let[t,n]of e.internalRepr){let e=(this.internalRepr.get(t)||[]).concat(n);this.internalRepr.set(t,e)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,n]of this.internalRepr)t.startsWith(`:`)||(e[t]=n.map(f));return e}toJSON(){let e={};for(let[t,n]of this.internalRepr)e[t]=n;return e}setOpaque(e,t){this.opaqueData.set(e,t)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(i){let a=new e;for(let e of Object.keys(i)){if(e.charAt(0)===`:`)continue;let o=i[e];try{c(e)?Array.isArray(o)?o.forEach(t=>{a.add(e,Buffer.from(t,`base64`))}):o!==void 0&&(l(e)?o.split(`,`).forEach(t=>{a.add(e,Buffer.from(t.trim(),`base64`))}):a.add(e,Buffer.from(o,`base64`))):Array.isArray(o)?o.forEach(t=>{a.add(e,t)}):o!==void 0&&a.add(e,o)}catch(i){let a=`Failed to add metadata entry ${e}: ${o}. ${(0,r.getErrorMessage)(i)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,t.log)(n.LogVerbosity.ERROR,a)}}return a}};let f=e=>Buffer.isBuffer(e)?e.toString(`base64`):e})),WO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallCredentials=void 0;let t=X();function n(e){return`getRequestHeaders`in e&&typeof e.getRequestHeaders==`function`}var r=class e{static createFromMetadataGenerator(e){return new a(e)}static createFromGoogleCredential(r){return e.createFromMetadataGenerator((e,i)=>{let a;a=n(r)?r.getRequestHeaders(e.service_url):new Promise((t,n)=>{r.getRequestMetadata(e.service_url,(e,r)=>{if(e){n(e);return}if(!r){n(Error(`Headers not set by metadata plugin`));return}t(r)})}),a.then(e=>{let n=new t.Metadata;for(let t of Object.keys(e))n.add(t,e[t]);i(null,n)},e=>{i(e)})})}static createEmpty(){return new o}};e.CallCredentials=r;var i=class e extends r{constructor(e){super(),this.creds=e}async generateMetadata(e){let n=new t.Metadata,r=await Promise.all(this.creds.map(t=>t.generateMetadata(e)));for(let e of r)n.merge(e);return n}compose(t){return new e(this.creds.concat([t]))}_equals(t){return this===t?!0:t instanceof e?this.creds.every((e,n)=>e._equals(t.creds[n])):!1}},a=class e extends r{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,n)=>{this.metadataGenerator(e,(e,r)=>{r===void 0?n(e):t(r)})})}compose(e){return new i([this,e])}_equals(t){return this===t?!0:t instanceof e?this.metadataGenerator===t.metadataGenerator:!1}},o=class e extends r{generateMetadata(e){return Promise.resolve(new t.Metadata)}compose(e){return e}_equals(t){return t instanceof e}}})),GO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CIPHER_SUITES=void 0,e.getDefaultRootsData=i;let t=s(`fs`);e.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;let n=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,r=null;function i(){return n?(r===null&&(r=t.readFileSync(n)),r):null}})),Z=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseUri=n,e.splitHostPort=i,e.combineHostPort=a,e.uriToString=o;let t=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function n(e){let n=t.exec(e);return n===null?null:{scheme:n[1],authority:n[2],path:n[3]}}let r=/^\d+$/;function i(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);if(t===-1)return null;let n=e.substring(1,t);if(n.indexOf(`:`)===-1)return null;if(e.length>t+1)if(e[t+1]===`:`){let i=e.substring(t+2);return r.test(i)?{host:n,port:+i}:null}else return null;else return{host:n}}else{let t=e.split(`:`);return t.length===2?r.test(t[1])?{host:t[0],port:+t[1]}:null:{host:e}}}function a(e){return e.port===void 0?e.host:e.host.includes(`:`)?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`}function o(e){let t=``;return e.scheme!==void 0&&(t+=e.scheme+`:`),e.authority!==void 0&&(t+=`//`+e.authority+`/`),t+=e.path,t}})),KO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0,e.registerResolver=i,e.registerDefaultScheme=a,e.createResolver=o,e.getDefaultAuthority=s,e.mapUriDefaultScheme=c;let t=Z();e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=`grpc.internal.config_selector`;let n={},r=null;function i(e,t){n[e]=t}function a(e){r=e}function o(e,r,i){if(e.scheme!==void 0&&e.scheme in n)return new n[e.scheme](e,r,i);throw Error(`No resolver could be created for target ${(0,t.uriToString)(e)}`)}function s(e){if(e.scheme!==void 0&&e.scheme in n)return n[e.scheme].getDefaultAuthority(e);throw Error(`Invalid target ${(0,t.uriToString)(e)}`)}function c(e){return e.scheme===void 0||!(e.scheme in n)?r===null?null:{scheme:r,authority:void 0,path:(0,t.uriToString)(e)}:e}})),qO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelCredentials=void 0,e.createCertificateProviderChannelCredentials=g;let t=s(`tls`),n=WO(),r=GO(),i=Z(),a=KO(),o=Y(),c=J();function l(e,t){if(e&&!(e instanceof Buffer))throw TypeError(`${t}, if provided, must be a Buffer.`)}var u=class{compose(e){return new _(this,e)}static createSsl(e,n,i,a){if(l(e,`Root certificate`),l(n,`Private key`),l(i,`Certificate chain`),n&&!i)throw Error(`Private key must be given with accompanying certificate chain`);if(!n&&i)throw Error(`Certificate chain must be given with accompanying private key`);return new m((0,t.createSecureContext)({ca:e??(0,r.getDefaultRootsData)()??void 0,key:n??void 0,cert:i??void 0,ciphers:r.CIPHER_SUITES}),a??{})}static createFromSecureContext(e,t){return new m(e,t??{})}static createInsecure(){return new d}};e.ChannelCredentials=u;var d=class e extends u{constructor(){super()}compose(e){throw Error(`Cannot compose insecure credentials`)}_isSecure(){return!1}_equals(t){return t instanceof e}_createSecureConnector(e,t,r){return{connect(e){return Promise.resolve({socket:e,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>r??n.CallCredentials.createEmpty(),destroy(){}}}};function f(e,n,r,o){let s={secureContext:e},c=r;if(`grpc.http_connect_target`in o){let e=(0,i.parseUri)(o[`grpc.http_connect_target`]);e&&(c=e)}let l=(0,a.getDefaultAuthority)(c),u=(0,i.splitHostPort)(l)?.host??l;if(s.host=u,n.checkServerIdentity&&(s.checkServerIdentity=n.checkServerIdentity),n.rejectUnauthorized!==void 0&&(s.rejectUnauthorized=n.rejectUnauthorized),s.ALPNProtocols=[`h2`],o[`grpc.ssl_target_name_override`]){let e=o[`grpc.ssl_target_name_override`],n=s.checkServerIdentity??t.checkServerIdentity;s.checkServerIdentity=(t,r)=>n(e,r),s.servername=e}else s.servername=u;return o[`grpc-node.tls_enable_trace`]&&(s.enableTrace=!0),s}var p=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let n=Object.assign({socket:e},this.connectionOptions);return new Promise((e,r)=>{let i=(0,t.connect)(n,()=>{if((this.connectionOptions.rejectUnauthorized??!0)&&!i.authorized){r(i.authorizationError);return}e({socket:i,secure:!0})});i.on(`error`,e=>{r(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},m=class e extends u{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.secureContext===t.secureContext&&this.verifyOptions.checkServerIdentity===t.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,r){return new p(f(this.secureContext,this.verifyOptions,e,t),r??n.CallCredentials.createEmpty())}},h=class e extends u{constructor(e,t,n){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=n,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&this.verifyOptions?.checkServerIdentity===t.verifyOptions?.checkServerIdentity:!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)==null||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;--this.refcount,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)==null||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(t,r,i){return this.ref(),new e.SecureConnectorImpl(this,t,r,i??n.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,t.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:this.latestIdentityUpdate?.privateKey,cert:this.latestIdentityUpdate?.certificate,ciphers:r.CIPHER_SUITES})}catch(e){return(0,o.log)(c.LogVerbosity.ERROR,`Failed to createSecureContext with error `+e.message),null}}};h.SecureConnectorImpl=class{constructor(e,t,n,r){this.parent=e,this.channelTarget=t,this.options=n,this.callCredentials=r}connect(e){return new Promise((n,r)=>{let i=this.parent.getLatestSecureContext();if(!i){r(Error(`Failed to load credentials`));return}e.closed&&r(Error(`Socket closed while loading credentials`));let a=f(i,this.parent.verifyOptions,this.channelTarget,this.options),o=Object.assign({socket:e},a),s=()=>{r(Error(`Socket closed`))},c=e=>{r(e)},l=(0,t.connect)(o,()=>{if(l.removeListener(`close`,s),l.removeListener(`error`,c),(this.parent.verifyOptions.rejectUnauthorized??!0)&&!l.authorized){r(l.authorizationError);return}n({socket:l,secure:!0})});l.once(`close`,s),l.once(`error`,c)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function g(e,t,n){return new h(e,t,n??{})}var _=class e extends u{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw Error(`Cannot compose insecure credentials`)}compose(t){let n=this.callCredentials.compose(t);return new e(this.channelCredentials,n)}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.channelCredentials._equals(t.channelCredentials)&&this.callCredentials._equals(t.callCredentials):!1}_createSecureConnector(e,t,r){let i=this.callCredentials.compose(r??n.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,i)}}})),JO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createChildChannelControlHelper=r,e.registerLoadBalancerType=o,e.registerDefaultLoadBalancerType=s,e.createLoadBalancer=c,e.isLoadBalancerNameRegistered=l,e.parseLoadBalancingConfig=u,e.getDefaultConfig=d,e.selectLbConfigFromList=f;let t=Y(),n=J();function r(e,t){return{createSubchannel:t.createSubchannel?.bind(t)??e.createSubchannel.bind(e),updateState:t.updateState?.bind(t)??e.updateState.bind(e),requestReresolution:t.requestReresolution?.bind(t)??e.requestReresolution.bind(e),addChannelzChild:t.addChannelzChild?.bind(t)??e.addChannelzChild.bind(e),removeChannelzChild:t.removeChannelzChild?.bind(t)??e.removeChannelzChild.bind(e)}}let i={},a=null;function o(e,t,n){i[e]={LoadBalancer:t,LoadBalancingConfig:n}}function s(e){a=e}function c(e,t){let n=e.getLoadBalancerName();return n in i?new i[n].LoadBalancer(t):null}function l(e){return e in i}function u(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Provided load balancing config has multiple conflicting entries`);let n=t[0];if(n in i)try{return i[n].LoadBalancingConfig.createFromJson(e[n])}catch(e){throw Error(`${n}: ${e.message}`)}else throw Error(`Unrecognized load balancing config name ${n}`)}function d(){if(!a)throw Error(`No default load balancer type registered`);return new i[a].LoadBalancingConfig}function f(e,r=!1){for(let r of e)try{return u(r)}catch(e){(0,t.log)(n.LogVerbosity.DEBUG,`Config parsing failed with error`,e.message);continue}return r&&a?new i[a].LoadBalancingConfig:null}})),YO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateRetryThrottling=l,e.validateServiceConfig=d,e.extractAndSelectServiceConfig=m;let t=s(`os`),n=J(),r=/^\d+(\.\d{1,9})?s$/;function i(e){if(`service`in e&&e.service!==``){if(typeof e.service!=`string`)throw Error(`Invalid method config name: invalid service: expected type string, got ${typeof e.service}`);if(`method`in e&&e.method!==``){if(typeof e.method!=`string`)throw Error(`Invalid method config name: invalid method: expected type string, got ${typeof e.service}`);return{service:e.service,method:e.method}}else return{service:e.service}}else{if(`method`in e&&e.method!==void 0)throw Error(`Invalid method config name: method set with empty or unset service`);return{}}}function a(e){if(!(`maxAttempts`in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw Error(`Invalid method config retry policy: maxAttempts must be an integer at least 2`);if(!(`initialBackoff`in e)||typeof e.initialBackoff!=`string`||!r.test(e.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 e)||typeof e.maxBackoff!=`string`||!r.test(e.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 e)||typeof e.backoffMultiplier!=`number`||e.backoffMultiplier<=0)throw Error(`Invalid method config retry policy: backoffMultiplier must be a number greater than 0`);if(!(`retryableStatusCodes`in e&&Array.isArray(e.retryableStatusCodes)))throw Error(`Invalid method config retry policy: retryableStatusCodes is required`);if(e.retryableStatusCodes.length===0)throw Error(`Invalid method config retry policy: retryableStatusCodes must be non-empty`);for(let t of e.retryableStatusCodes)if(typeof t==`number`){if(!Object.values(n.Status).includes(t))throw Error(`Invalid method config retry policy: retryableStatusCodes value not in status code range`)}else if(typeof t==`string`){if(!Object.values(n.Status).includes(t.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:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}function o(e){if(!(`maxAttempts`in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw Error(`Invalid method config hedging policy: maxAttempts must be an integer at least 2`);if(`hedgingDelay`in e&&(typeof e.hedgingDelay!=`string`||!r.test(e.hedgingDelay)))throw Error(`Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s`);if(`nonFatalStatusCodes`in e&&Array.isArray(e.nonFatalStatusCodes))for(let t of e.nonFatalStatusCodes)if(typeof t==`number`){if(!Object.values(n.Status).includes(t))throw Error(`Invalid method config hedging policy: nonFatalStatusCodes value not in status code range`)}else if(typeof t==`string`){if(!Object.values(n.Status).includes(t.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 t={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(t.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(t.nonFatalStatusCodes=e.nonFatalStatusCodes),t}function c(e){let t={name:[]};if(!(`name`in e)||!Array.isArray(e.name))throw Error(`Invalid method config: invalid name array`);for(let n of e.name)t.name.push(i(n));if(`waitForReady`in e){if(typeof e.waitForReady!=`boolean`)throw Error(`Invalid method config: invalid waitForReady`);t.waitForReady=e.waitForReady}if(`timeout`in e)if(typeof e.timeout==`object`){if(!(`seconds`in e.timeout)||typeof e.timeout.seconds!=`number`)throw Error(`Invalid method config: invalid timeout.seconds`);if(!(`nanos`in e.timeout)||typeof e.timeout.nanos!=`number`)throw Error(`Invalid method config: invalid timeout.nanos`);t.timeout=e.timeout}else if(typeof e.timeout==`string`&&r.test(e.timeout)){let n=e.timeout.substring(0,e.timeout.length-1).split(`.`);t.timeout={seconds:n[0]|0,nanos:(n[1]??0)|0}}else throw Error(`Invalid method config: invalid timeout`);if(`maxRequestBytes`in e){if(typeof e.maxRequestBytes!=`number`)throw Error(`Invalid method config: invalid maxRequestBytes`);t.maxRequestBytes=e.maxRequestBytes}if(`maxResponseBytes`in e){if(typeof e.maxResponseBytes!=`number`)throw Error(`Invalid method config: invalid maxRequestBytes`);t.maxResponseBytes=e.maxResponseBytes}if(`retryPolicy`in e){if(`hedgingPolicy`in e)throw Error(`Invalid method config: retryPolicy and hedgingPolicy cannot both be specified`);t.retryPolicy=a(e.retryPolicy)}else`hedgingPolicy`in e&&(t.hedgingPolicy=o(e.hedgingPolicy));return t}function l(e){if(!(`maxTokens`in e)||typeof e.maxTokens!=`number`||e.maxTokens<=0||e.maxTokens>1e3)throw Error(`Invalid retryThrottling: maxTokens must be a number in (0, 1000]`);if(!(`tokenRatio`in e)||typeof e.tokenRatio!=`number`||e.tokenRatio<=0)throw Error(`Invalid retryThrottling: tokenRatio must be a number greater than 0`);return{maxTokens:+e.maxTokens.toFixed(3),tokenRatio:+e.tokenRatio.toFixed(3)}}function u(e){if(!(typeof e==`object`&&e))throw Error(`Invalid loadBalancingConfig: unexpected type ${typeof e}`);let t=Object.keys(e);if(t.length>1)throw Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(t.length===0)throw Error(`Invalid loadBalancingConfig: load balancing policy name required`);return{[t[0]]:e[t[0]]}}function d(e){let t={loadBalancingConfig:[],methodConfig:[]};if(`loadBalancingPolicy`in e)if(typeof e.loadBalancingPolicy==`string`)t.loadBalancingPolicy=e.loadBalancingPolicy;else throw Error(`Invalid service config: invalid loadBalancingPolicy`);if(`loadBalancingConfig`in e)if(Array.isArray(e.loadBalancingConfig))for(let n of e.loadBalancingConfig)t.loadBalancingConfig.push(u(n));else throw Error(`Invalid service config: invalid loadBalancingConfig`);if(`methodConfig`in e&&Array.isArray(e.methodConfig))for(let n of e.methodConfig)t.methodConfig.push(c(n));`retryThrottling`in e&&(t.retryThrottling=l(e.retryThrottling));let n=[];for(let e of t.methodConfig)for(let t of e.name){for(let e of n)if(t.service===e.service&&t.method===e.method)throw Error(`Invalid service config: duplicate name ${t.service}/${t.method}`);n.push(t)}return t}function f(e){if(!(`serviceConfig`in e))throw Error(`Invalid service config choice: missing service config`);let t={serviceConfig:d(e.serviceConfig)};if(`clientLanguage`in e)if(Array.isArray(e.clientLanguage)){t.clientLanguage=[];for(let n of e.clientLanguage)if(typeof n==`string`)t.clientLanguage.push(n);else throw Error(`Invalid service config choice: invalid clientLanguage`)}else throw Error(`Invalid service config choice: invalid clientLanguage`);if(`clientHostname`in e)if(Array.isArray(e.clientHostname)){t.clientHostname=[];for(let n of e.clientHostname)if(typeof n==`string`)t.clientHostname.push(n);else throw Error(`Invalid service config choice: invalid clientHostname`)}else throw Error(`Invalid service config choice: invalid clientHostname`);if(`percentage`in e)if(typeof e.percentage==`number`&&0<=e.percentage&&e.percentage<=100)t.percentage=e.percentage;else throw Error(`Invalid service config choice: invalid percentage`);let n=[`clientLanguage`,`percentage`,`clientHostname`,`serviceConfig`];for(let t in e)if(!n.includes(t))throw Error(`Invalid service config choice: unexpected field ${t}`);return t}function p(e,n){if(!Array.isArray(e))throw Error(`Invalid service config list`);for(let r of e){let e=f(r);if(!(typeof e.percentage==`number`&&n>e.percentage)){if(Array.isArray(e.clientHostname)){let n=!1;for(let r of e.clientHostname)r===t.hostname()&&(n=!0);if(!n)continue}if(Array.isArray(e.clientLanguage)){let t=!1;for(let n of e.clientLanguage)n===`node`&&(t=!0);if(!t)continue}return e.serviceConfig}}throw Error(`No matching service config found`)}function m(e,t){for(let n of e)if(n.length>0&&n[0].startsWith(`grpc_config=`)){let e=n.join(``).substring(12);return p(JSON.parse(e),t)}return null}})),XO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectivityState=void 0;var t;(function(e){e[e.IDLE=0]=`IDLE`,e[e.CONNECTING=1]=`CONNECTING`,e[e.READY=2]=`READY`,e[e.TRANSIENT_FAILURE=3]=`TRANSIENT_FAILURE`,e[e.SHUTDOWN=4]=`SHUTDOWN`})(t||(e.ConnectivityState=t={}))})),ZO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.QueuePicker=e.UnavailablePicker=e.PickResultType=void 0;let t=X(),n=J();var r;(function(e){e[e.COMPLETE=0]=`COMPLETE`,e[e.QUEUE=1]=`QUEUE`,e[e.TRANSIENT_FAILURE=2]=`TRANSIENT_FAILURE`,e[e.DROP=3]=`DROP`})(r||(e.PickResultType=r={})),e.UnavailablePicker=class{constructor(e){this.status=Object.assign({code:n.Status.UNAVAILABLE,details:`No connection established`,metadata:new t.Metadata},e)}pick(e){return{pickResultType:r.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}},e.QueuePicker=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||=(process.nextTick(()=>{this.loadBalancer.exitIdle()}),!0),this.childPicker?this.childPicker.pick(e):{pickResultType:r.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}}})),QO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BackoffTimeout=void 0;let t=J(),n=Y();function r(e,t){return Math.random()*(t-e)+e}var i=class e{constructor(t,n){this.callback=t,this.initialDelay=1e3,this.multiplier=1.6,this.maxDelay=12e4,this.jitter=.2,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=e.getNextId(),n&&(n.initialDelay&&(this.initialDelay=n.initialDelay),n.multiplier&&(this.multiplier=n.multiplier),n.jitter&&(this.jitter=n.jitter),n.maxDelay&&(this.maxDelay=n.maxDelay)),this.trace(`constructed initialDelay=`+this.initialDelay+` multiplier=`+this.multiplier+` jitter=`+this.jitter+` maxDelay=`+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){n.trace(t.LogVerbosity.DEBUG,`backoff`,`{`+this.id+`} `+e)}runTimer(e){var t,n;this.trace(`runTimer(delay=`+e+`)`),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace(`timer fired`),this.running=!1,this.callback()},e),this.hasRef||(n=(t=this.timerId).unref)==null||n.call(t)}runOnce(){this.trace(`runOnce()`),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+r(-t,t)}stop(){this.trace(`stop()`),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace(`reset() running=`+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)==null||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)==null||t.call(e)}getEndTime(){return this.endTime}};e.BackoffTimeout=i,i.nextId=0})),$O=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChildLoadBalancerHandler=void 0;let t=JO(),n=XO();e.ChildLoadBalancerHandler=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(e){this.parent=e,this.child=null}createSubchannel(e,t){return this.parent.channelControlHelper.createSubchannel(e,t)}updateState(e,t,r){var i;if(this.calledByPendingChild()){if(e===n.ConnectivityState.CONNECTING)return;(i=this.parent.currentChild)==null||i.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(e,t,r)}requestReresolution(){let e=this.parent.pendingChild??this.parent.currentChild;this.child===e&&this.parent.channelControlHelper.requestReresolution()}setChild(e){this.child=e}addChannelzChild(e){this.parent.channelControlHelper.addChannelzChild(e)}removeChannelzChild(e){this.parent.channelControlHelper.removeChannelzChild(e)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,n,r,i){let a;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,n)){let e=new this.ChildPolicyHelper(this),r=(0,t.createLoadBalancer)(n,e);e.setChild(r),this.currentChild===null?(this.currentChild=r,a=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=r,a=this.pendingChild)}else a=this.pendingChild===null?this.currentChild:this.pendingChild;return this.latestConfig=n,a.updateAddressList(e,n,r,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&=(this.currentChild.destroy(),null),this.pendingChild&&=(this.pendingChild.destroy(),null)}getTypeName(){return`child_load_balancer_helper`}}})),ek=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ResolvingLoadBalancer=void 0;let t=JO(),n=YO(),r=XO(),i=KO(),a=ZO(),o=QO(),s=J(),c=X(),l=Y(),u=J(),d=Z(),f=$O();function p(e){l.trace(u.LogVerbosity.DEBUG,`resolving_load_balancer`,e)}let m=[`SERVICE_AND_METHOD`,`SERVICE`,`EMPTY`];function h(e,t,n,r){for(let i of n.name)switch(r){case`EMPTY`:if(!i.service&&!i.method)return!0;break;case`SERVICE`:if(i.service===e&&!i.method)return!0;break;case`SERVICE_AND_METHOD`:if(i.service===e&&i.method===t)return!0}return!1}function g(e,t,n,r){for(let i of n)if(h(e,t,i,r))return i;return null}function _(e){return{invoke(t,n){let r=t.split(`/`).filter(e=>e.length>0),i=r[0]??``,a=r[1]??``;if(e&&e.methodConfig)for(let t of m){let n=g(i,a,e.methodConfig,t);if(n)return{methodConfig:n,pickInformation:{},status:s.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:s.Status.OK,dynamicFilterFactories:[]}},unref(){}}}e.ResolvingLoadBalancer=class{constructor(e,t,s,c,l){this.target=e,this.channelControlHelper=t,this.channelOptions=s,this.onSuccessfulResolution=c,this.onFailedResolution=l,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new a.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,s[`grpc.service_config`]?this.defaultServiceConfig=(0,n.validateServiceConfig)(JSON.parse(s[`grpc.service_config`])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new a.QueuePicker(this),null),this.childLoadBalancer=new f.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?(p(`requestReresolution delayed by backoff timer until `+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(e,t,n)=>{this.latestChildState=e,this.latestChildPicker=t,this.latestChildErrorMessage=n,this.updateState(e,t,n)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,i.createResolver)(e,this.handleResolverResult.bind(this),s);let u={initialDelay:s[`grpc.initial_reconnect_backoff_ms`],maxDelay:s[`grpc.max_reconnect_backoff_ms`]};this.backoffTimeout=new o.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},u),this.backoffTimeout.unref()}handleResolverResult(e,n,r,a){this.backoffTimeout.stop(),this.backoffTimeout.reset();let o=!0,l=null;if(r===null?l=this.defaultServiceConfig:r.ok?l=r.value:this.previousServiceConfig===null?(o=!1,this.handleResolutionFailure(r.error)):l=this.previousServiceConfig,l!==null){let r=l?.loadBalancingConfig??[],i=(0,t.selectLbConfigFromList)(r,!0);i===null?(o=!1,this.handleResolutionFailure({code:s.Status.UNAVAILABLE,details:`All load balancer options in service config are not compatible`,metadata:new c.Metadata})):o=this.childLoadBalancer.updateAddressList(e,i,Object.assign(Object.assign({},this.channelOptions),n),a)}return o&&this.onSuccessfulResolution(l,n[i.CHANNEL_ARGS_CONFIG_SELECTOR_KEY]??_(l)),o}updateResolution(){this.innerResolver.updateResolution(),this.currentState===r.ConnectivityState.IDLE&&this.updateState(r.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){p((0,d.uriToString)(this.target)+` `+r.ConnectivityState[this.currentState]+` -> `+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new a.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===r.ConnectivityState.IDLE&&(this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new a.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===r.ConnectivityState.IDLE||this.currentState===r.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){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=r.ConnectivityState.IDLE,this.latestChildPicker=new a.QueuePicker(this),this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return`resolving_load_balancer`}}})),tk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.recognizedOptions=void 0,e.channelOptionsEqual=t,e.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 t(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1)if(n[i]!==r[i]||e[n[i]]!==t[r[i]])return!1;return!0}})),nk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointMap=void 0,e.isTcpSubchannelAddress=n,e.subchannelAddressEqual=r,e.subchannelAddressToString=i,e.stringToSubchannelAddress=a,e.endpointEqual=o,e.endpointToString=c,e.endpointHasAddress=l;let t=s(`net`);function n(e){return`port`in e}function r(e,t){return!e&&!t?!0:!e||!t?!1:n(e)?n(t)&&e.host===t.host&&e.port===t.port:!n(t)&&e.path===t.path}function i(e){return n(e)?(0,t.isIPv6)(e.host)?`[`+e.host+`]:`+e.port:e.host+`:`+e.port:e.path}function a(e,n){return(0,t.isIP)(e)?{host:e,port:n??443}:{path:e}}function o(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!r(e.addresses[n],t.addresses[n]))return!1;return!0}function c(e){return`[`+e.addresses.map(i).join(`, `)+`]`}function l(e,t){for(let n of e.addresses)if(r(n,t))return!0;return!1}function u(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n of e.addresses){let e=!1;for(let i of t.addresses)if(r(n,i)){e=!0;break}if(!e)return!1}return!0}e.EndpointMap=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(l(t.key,e))return t.value}deleteMissing(e){let t=[];for(let n of this.map){let r=!1;for(let t of e)u(t,n.key)&&(r=!0);r||(t.push(n.value),this.map.delete(n))}return t}get(e){for(let t of this.map)if(u(e,t.key))return t.value}set(e,t){for(let n of this.map)if(u(e,n.key)){n.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(u(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(u(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}}})),rk=t((e=>{Object.defineProperty(e,"t",{value:!0});var t=class{constructor(e,t,n=1){this.i=void 0,this.h=void 0,this.o=void 0,this.u=e,this.l=t,this.p=n}I(){let e=this,t=e.o.o===e;if(t&&e.p===1)e=e.h;else if(e.i)for(e=e.i;e.h;)e=e.h;else{if(t)return e.o;let n=e.o;for(;n.i===e;)e=n,n=e.o;e=n}return e}B(){let e=this;if(e.h){for(e=e.h;e.i;)e=e.i;return e}else{let t=e.o;for(;t.h===e;)e=t,t=e.o;return e.h===t?e:t}}_(){let e=this.o,t=this.h,n=t.i;return e.o===this?e.o=t:e.i===this?e.i=t:e.h=t,t.o=e,t.i=this,this.o=t,this.h=n,n&&(n.o=this),t}g(){let e=this.o,t=this.i,n=t.h;return e.o===this?e.o=t:e.i===this?e.i=t:e.h=t,t.o=e,t.h=this,this.o=t,this.i=n,n&&(n.o=this),t}},n=class extends t{constructor(){super(...arguments),this.M=1}_(){let e=super._();return this.O(),e.O(),e}g(){let e=super.g();return this.O(),e.O(),e}O(){this.M=1,this.i&&(this.M+=this.i.M),this.h&&(this.M+=this.h.M)}},r=class{constructor(e=0){this.iteratorType=e}equals(e){return this.T===e.T}},i=class{constructor(){this.m=0}get length(){return this.m}size(){return this.m}empty(){return this.m===0}},a=class extends i{};function o(){throw RangeError(`Iterator access denied!`)}var s=class extends a{constructor(e=function(e,t){return e<t?-1:+(e>t)},r=!1){super(),this.v=void 0,this.A=e,this.enableIndex=r,this.N=r?n:t,this.C=new this.N}R(e,t){let n=this.C;for(;e;){let r=this.A(e.u,t);if(r<0)e=e.h;else if(r>0)n=e,e=e.i;else return e}return n}K(e,t){let n=this.C;for(;e;)this.A(e.u,t)<=0?e=e.h:(n=e,e=e.i);return n}L(e,t){let n=this.C;for(;e;){let r=this.A(e.u,t);if(r<0)n=e,e=e.h;else if(r>0)e=e.i;else return e}return n}k(e,t){let n=this.C;for(;e;)this.A(e.u,t)<0?(n=e,e=e.h):e=e.i;return n}P(e){for(;;){let t=e.o;if(t===this.C)return;if(e.p===1){e.p=0;return}if(e===t.i){let n=t.h;if(n.p===1)n.p=0,t.p=1,t===this.v?this.v=t._():t._();else if(n.h&&n.h.p===1){n.p=t.p,t.p=0,n.h.p=0,t===this.v?this.v=t._():t._();return}else n.i&&n.i.p===1?(n.p=1,n.i.p=0,n.g()):(n.p=1,e=t)}else{let n=t.i;if(n.p===1)n.p=0,t.p=1,t===this.v?this.v=t.g():t.g();else if(n.i&&n.i.p===1){n.p=t.p,t.p=0,n.i.p=0,t===this.v?this.v=t.g():t.g();return}else n.h&&n.h.p===1?(n.p=1,n.h.p=0,n._()):(n.p=1,e=t)}}}S(e){if(this.m===1){this.clear();return}let t=e;for(;t.i||t.h;){if(t.h)for(t=t.h;t.i;)t=t.i;else t=t.i;let n=e.u;e.u=t.u,t.u=n;let r=e.l;e.l=t.l,t.l=r,e=t}this.C.i===t?this.C.i=t.o:this.C.h===t&&(this.C.h=t.o),this.P(t);let n=t.o;if(t===n.i?n.i=void 0:n.h=void 0,--this.m,this.v.p=0,this.enableIndex)for(;n!==this.C;)--n.M,n=n.o}U(e){let t=typeof e==`number`?e:void 0,n=typeof e==`function`?e:void 0,r=e===void 0?[]:void 0,i=0,a=this.v,o=[];for(;o.length||a;)if(a)o.push(a),a=a.i;else{if(a=o.pop(),i===t)return a;r&&r.push(a),n&&n(a,i,this),i+=1,a=a.h}return r}j(e){for(;;){let t=e.o;if(t.p===0)return;let n=t.o;if(t===n.i){let r=n.h;if(r&&r.p===1){if(r.p=t.p=0,n===this.v)return;n.p=1,e=n;continue}else if(e===t.h){if(e.p=0,e.i&&(e.i.o=t),e.h&&(e.h.o=n),t.h=e.i,n.i=e.h,e.i=t,e.h=n,n===this.v)this.v=e,this.C.o=e;else{let t=n.o;t.i===n?t.i=e:t.h=e}e.o=n.o,t.o=e,n.o=e,n.p=1}else{t.p=0,n===this.v?this.v=n.g():n.g(),n.p=1;return}}else{let r=n.i;if(r&&r.p===1){if(r.p=t.p=0,n===this.v)return;n.p=1,e=n;continue}else if(e===t.i){if(e.p=0,e.i&&(e.i.o=n),e.h&&(e.h.o=t),n.h=e.i,t.i=e.h,e.i=n,e.h=t,n===this.v)this.v=e,this.C.o=e;else{let t=n.o;t.i===n?t.i=e:t.h=e}e.o=n.o,t.o=e,n.o=e,n.p=1}else{t.p=0,n===this.v?this.v=n._():n._(),n.p=1;return}}this.enableIndex&&(t.O(),n.O(),e.O());return}}q(e,t,n){if(this.v===void 0)return this.m+=1,this.v=new this.N(e,t,0),this.v.o=this.C,this.C.o=this.C.i=this.C.h=this.v,this.m;let r,i=this.C.i,a=this.A(i.u,e);if(a===0)return i.l=t,this.m;if(a>0)i.i=new this.N(e,t),i.i.o=i,r=i.i,this.C.i=r;else{let i=this.C.h,a=this.A(i.u,e);if(a===0)return i.l=t,this.m;if(a<0)i.h=new this.N(e,t),i.h.o=i,r=i.h,this.C.h=r;else{if(n!==void 0){let i=n.T;if(i!==this.C){let n=this.A(i.u,e);if(n===0)return i.l=t,this.m;if(n>0){let n=i.I(),a=this.A(n.u,e);if(a===0)return n.l=t,this.m;a<0&&(r=new this.N(e,t),n.h===void 0?(n.h=r,r.o=n):(i.i=r,r.o=i))}}}if(r===void 0)for(r=this.v;;){let n=this.A(r.u,e);if(n>0){if(r.i===void 0){r.i=new this.N(e,t),r.i.o=r,r=r.i;break}r=r.i}else if(n<0){if(r.h===void 0){r.h=new this.N(e,t),r.h.o=r,r=r.h;break}r=r.h}else return r.l=t,this.m}}}if(this.enableIndex){let e=r.o;for(;e!==this.C;)e.M+=1,e=e.o}return this.j(r),this.m+=1,this.m}H(e,t){for(;e;){let n=this.A(e.u,t);if(n<0)e=e.h;else if(n>0)e=e.i;else return e}return e||this.C}clear(){this.m=0,this.v=void 0,this.C.o=void 0,this.C.i=this.C.h=void 0}updateKeyByIterator(e,t){let n=e.T;if(n===this.C&&o(),this.m===1)return n.u=t,!0;let r=n.B().u;if(n===this.C.i)return this.A(r,t)>0?(n.u=t,!0):!1;let i=n.I().u;return n===this.C.h?this.A(i,t)<0?(n.u=t,!0):!1:this.A(i,t)>=0||this.A(r,t)<=0?!1:(n.u=t,!0)}eraseElementByPos(e){if(e<0||e>this.m-1)throw RangeError();let t=this.U(e);return this.S(t),this.m}eraseElementByKey(e){if(this.m===0)return!1;let t=this.H(this.v,e);return t===this.C?!1:(this.S(t),!0)}eraseElementByIterator(e){let t=e.T;t===this.C&&o();let n=t.h===void 0;return e.iteratorType===0?n&&e.next():(!n||t.i===void 0)&&e.next(),this.S(t),e}getHeight(){if(this.m===0)return 0;function e(t){return t?Math.max(e(t.i),e(t.h))+1:0}return e(this.v)}},c=class extends r{constructor(e,t,n){super(n),this.T=e,this.C=t,this.iteratorType===0?(this.pre=function(){return this.T===this.C.i&&o(),this.T=this.T.I(),this},this.next=function(){return this.T===this.C&&o(),this.T=this.T.B(),this}):(this.pre=function(){return this.T===this.C.h&&o(),this.T=this.T.B(),this},this.next=function(){return this.T===this.C&&o(),this.T=this.T.I(),this})}get index(){let e=this.T,t=this.C.o;if(e===this.C)return t?t.M-1:0;let n=0;for(e.i&&(n+=e.i.M);e!==t;){let t=e.o;e===t.h&&(n+=1,t.i&&(n+=t.i.M)),e=t}return n}isAccessible(){return this.T!==this.C}},l=class e extends c{constructor(e,t,n,r){super(e,t,r),this.container=n}get pointer(){this.T===this.C&&o();let e=this;return new Proxy([],{get(t,n){return n===`0`?e.T.u:n===`1`?e.T.l:(t[0]=e.T.u,t[1]=e.T.l,t[n])},set(t,n,r){if(n!==`1`)throw TypeError(`prop must be 1`);return e.T.l=r,!0}})}copy(){return new e(this.T,this.C,this.container,this.iteratorType)}};e.OrderedMap=class extends s{constructor(e=[],t,n){super(t,n);let r=this;e.forEach((function(e){r.setElement(e[0],e[1])}))}begin(){return new l(this.C.i||this.C,this.C,this)}end(){return new l(this.C,this.C,this)}rBegin(){return new l(this.C.h||this.C,this.C,this,1)}rEnd(){return new l(this.C,this.C,this,1)}front(){if(this.m===0)return;let e=this.C.i;return[e.u,e.l]}back(){if(this.m===0)return;let e=this.C.h;return[e.u,e.l]}lowerBound(e){return new l(this.R(this.v,e),this.C,this)}upperBound(e){return new l(this.K(this.v,e),this.C,this)}reverseLowerBound(e){return new l(this.L(this.v,e),this.C,this)}reverseUpperBound(e){return new l(this.k(this.v,e),this.C,this)}forEach(e){this.U((function(t,n,r){e([t.u,t.l],n,r)}))}setElement(e,t,n){return this.q(e,t,n)}getElementByPos(e){if(e<0||e>this.m-1)throw RangeError();let t=this.U(e);return[t.u,t.l]}find(e){return new l(this.H(this.v,e),this.C,this)}getElementByKey(e){return this.H(this.v,e).l}union(e){let t=this;return e.forEach((function(e){t.setElement(e[0],e[1])})),this.m}*[Symbol.iterator](){let e=this.m,t=this.U();for(let n=0;n<e;++n){let e=t[n];yield[e.u,e.l]}}}})),ik=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.registerAdminService=n,e.addAdminServicesToServer=r;let t=[];function n(e,n){t.push({getServiceDefinition:e,getHandlers:n})}function r(e){for(let{getServiceDefinition:n,getHandlers:r}of t)e.addService(n(),r())}})),ak=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ClientDuplexStreamImpl=e.ClientWritableStreamImpl=e.ClientReadableStreamImpl=e.ClientUnaryCallImpl=void 0,e.callErrorFromStatus=i;let t=s(`events`),n=s(`stream`),r=J();function i(e,t){let n=`${e.code} ${r.Status[e.code]}: ${e.details}`,i=`${Error(n).stack}\nfor call at\n${t}`;return Object.assign(Error(n),e,{stack:i})}e.ClientUnaryCallImpl=class extends t.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}},e.ClientReadableStreamImpl=class extends n.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_read(e){var t;(t=this.call)==null||t.startRead()}},e.ClientWritableStreamImpl=class extends n.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_write(e,t,n){var r;let i={callback:n},a=Number(t);Number.isNaN(a)||(i.flags=a),(r=this.call)==null||r.sendMessageWithContext(i,e)}_final(e){var t;(t=this.call)==null||t.halfClose(),e()}},e.ClientDuplexStreamImpl=class extends n.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_read(e){var t;(t=this.call)==null||t.startRead()}_write(e,t,n){var r;let i={callback:n},a=Number(t);Number.isNaN(a)||(i.flags=a),(r=this.call)==null||r.sendMessageWithContext(i,e)}_final(e){var t;(t=this.call)==null||t.halfClose(),e()}}})),ok=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InterceptingListenerImpl=void 0,e.statusOrFromValue=n,e.statusOrFromError=r,e.isInterceptingListener=i;let t=X();function n(e){return{ok:!0,value:e}}function r(e){return{ok:!1,error:Object.assign(Object.assign({},e),{metadata:e.metadata??new t.Metadata})}}function i(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}e.InterceptingListenerImpl=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&=(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextListener.onReceiveStatus(e)})}}})),sk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InterceptingCall=e.RequesterBuilder=e.ListenerBuilder=e.InterceptorConfigurationError=void 0,e.getInterceptingCall=p;let t=X(),n=ok(),r=J(),i=UO();var a=class e extends Error{constructor(t){super(t),this.name=`InterceptorConfigurationError`,Error.captureStackTrace(this,e)}};e.InterceptorConfigurationError=a,e.ListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}},e.RequesterBuilder=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};let o={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},s={start:(e,t,n)=>{n(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}};e.InterceptingCall=class{constructor(e,t){this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:t.start??s.start,sendMessage:t.sendMessage??s.sendMessage,halfClose:t.halfClose??s.halfClose,cancel:t.cancel??s.cancel}:this.requester=s}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){let r={onReceiveMetadata:(t?.onReceiveMetadata)?.bind(t)??(e=>{}),onReceiveMessage:(t?.onReceiveMessage)?.bind(t)??(e=>{}),onReceiveStatus:(t?.onReceiveStatus)?.bind(t)??(e=>{})};this.processingMetadata=!0,this.requester.start(e,r,(e,t)=>{this.processingMetadata=!1;let i;if((0,n.isInterceptingListener)(t))i=t;else{let e={onReceiveMetadata:t.onReceiveMetadata??o.onReceiveMetadata,onReceiveMessage:t.onReceiveMessage??o.onReceiveMessage,onReceiveStatus:t.onReceiveStatus??o.onReceiveStatus};i=new n.InterceptingListenerImpl(e,r)}this.nextCall.start(e,i),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,n),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};function c(e,t,n){let r=n.deadline??1/0,i=n.host,a=n.parent??null,o=n.propagate_flags,s=n.credentials,c=e.createCall(t,r,i,a,o);return s&&c.setCredentials(s),c}var l=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let n;try{n=this.methodDefinition.requestSerialize(t)}catch(e){this.call.cancelWithStatus(r.Status.INTERNAL,`Request message serialization failure: ${(0,i.getErrorMessage)(e)}`);return}this.call.sendMessageWithContext(e,n)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,n){let a=null;this.call.start(e,{onReceiveMetadata:e=>{var t;(t=n?.onReceiveMetadata)==null||t.call(n,e)},onReceiveMessage:e=>{var o;let s;try{s=this.methodDefinition.responseDeserialize(e)}catch(e){a={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,i.getErrorMessage)(e)}`,metadata:new t.Metadata},this.call.cancelWithStatus(a.code,a.details);return}(o=n?.onReceiveMessage)==null||o.call(n,s)},onReceiveStatus:e=>{var t,r;a?(t=n?.onReceiveStatus)==null||t.call(n,a):(r=n?.onReceiveStatus)==null||r.call(n,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},u=class extends l{constructor(e,t){super(e,t)}start(e,t){let n=!1,r={onReceiveMetadata:(t?.onReceiveMetadata)?.bind(t)??(e=>{}),onReceiveMessage:e=>{var r;n=!0,(r=t?.onReceiveMessage)==null||r.call(t,e)},onReceiveStatus:e=>{var r,i;n||(r=t?.onReceiveMessage)==null||r.call(t,null),(i=t?.onReceiveStatus)==null||i.call(t,e)}};super.start(e,r),this.call.startRead()}},d=class extends l{};function f(e,t,n){let r=c(e,n.path,t);return n.responseStream?new d(r,n):new u(r,n)}function p(e,t,n,r){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new a(`Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.`);if(e.callInterceptors.length>0&&e.callInterceptorProviders.length>0)throw new a(`Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.`);let i=[];i=e.callInterceptors.length>0||e.callInterceptorProviders.length>0?[].concat(e.callInterceptors,e.callInterceptorProviders.map(e=>e(t))).filter(e=>e):[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(e=>e(t))).filter(e=>e);let o=Object.assign({},n,{method_definition:t});return i.reduceRight((e,t)=>n=>t(n,e),e=>f(r,e,t))(o)}})),ck=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Client=void 0;let t=ak(),n=PA(),r=XO(),i=J(),a=X(),o=sk(),s=Symbol(),c=Symbol(),l=Symbol(),u=Symbol();function d(e){return typeof e==`function`}function f(e){return e.stack?.split(`
25
+ `,(0,r.getConflictResolutionRecipe)(i,e))}return a}}})),nE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MultiMetricStorage=void 0,e.MultiMetricStorage=class{_backingStorages;constructor(e){this._backingStorages=e}record(e,t,n,r){let i=this._backingStorages;for(let a=0;a<i.length;a++)i[a].record(e,t,n,r)}}})),rE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BatchObservableResultImpl=e.ObservableResultImpl=void 0;let t=(c(),i(d)),n=XT(),r=qT();e.ObservableResultImpl=class{_buffer=new n.AttributeHashMap;_instrumentName;_valueType;constructor(e,t){this._instrumentName=e,this._valueType=t}observe(e,n={}){if(typeof e!=`number`){t.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===t.ValueType.INT&&!Number.isInteger(e)&&(t.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(n,e)}},e.BatchObservableResultImpl=class{_buffer=new Map;observe(e,i,a={}){if(!(0,r.isObservableInstrument)(e))return;let o=this._buffer.get(e);if(o??(o=new n.AttributeHashMap,this._buffer.set(e,o)),typeof i!=`number`){t.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${i}`);return}e._descriptor.valueType===t.ValueType.INT&&!Number.isInteger(i)&&(t.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),i=Math.trunc(i),!Number.isInteger(i))||o.set(a,i)}}})),iE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ObservableRegistry=void 0;let t=(c(),i(d)),n=qT(),r=rE(),a=Qo();e.ObservableRegistry=class{_callbacks=[];_batchCallbacks=[];addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,r){let i=new Set(r.filter(n.isObservableInstrument));if(i.size===0){t.diag.error(`BatchObservableCallback is not associated with valid instruments`,r);return}this._findBatchCallback(e,i)>=0||this._batchCallbacks.push({callback:e,instruments:i})}removeBatchCallback(e,t){let r=new Set(t.filter(n.isObservableInstrument)),i=this._findBatchCallback(e,r);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),r=this._observeBatchCallbacks(e,t);return(await Promise.allSettled([...n,...r])).filter(e=>e.status===`rejected`).map(e=>e.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let o=new r.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),s=Promise.resolve(n(o));t!=null&&(s=(0,a.callWithTimeout)(s,t)),await s,i._metricStorages.forEach(t=>{t.record(o._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let o=new r.BatchObservableResultImpl,s=Promise.resolve(n(o));t!=null&&(s=(0,a.callWithTimeout)(s,t)),await s,i.forEach(t=>{let n=o._buffer.get(t);n!=null&&t._metricStorages.forEach(t=>{t.record(n,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&(0,a.setEquals)(n.instruments,t))}}})),aE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SyncMetricStorage=void 0;let t=YT(),n=ZT(),r=QT();e.SyncMetricStorage=class extends t.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(e,t,i,a,o){super(e),this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new n.DeltaMetricProcessor(t,this._aggregationCardinalityLimit),this._temporalMetricStorage=new r.TemporalMetricProcessor(t,a),this._attributesProcessor=i}record(e,t,n,r){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,r)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}}})),oE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDenyListAttributesProcessor=e.createAllowListAttributesProcessor=e.createMultiAttributesProcessor=e.createNoopAttributesProcessor=void 0;var t=class{process(e,t){return e}},n=class{_processors;constructor(e){this._processors=e}process(e,t){let n=e;for(let e of this._processors)n=e.process(n,t);return n}},r=class{_allowedAttributeNames;constructor(e){this._allowedAttributeNames=new Set(e)}process(e,t){let n={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._allowedAttributeNames.has(t)&&(n[t]=e[t]);return n}},i=class{_deniedAttributeNames;constructor(e){this._deniedAttributeNames=new Set(e)}process(e,t){let n={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&!this._deniedAttributeNames.has(t)&&(n[t]=e[t]);return n}};function a(){return l}e.createNoopAttributesProcessor=a;function o(e){return new n(e)}e.createMultiAttributesProcessor=o;function s(e){return new r(e)}e.createAllowListAttributesProcessor=s;function c(e){return new i(e)}e.createDenyListAttributesProcessor=c;let l=new t})),sE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterSharedState=void 0;let t=KT(),n=JT(),r=$T(),i=tE(),a=nE(),o=iE(),s=aE(),c=oE();e.MeterSharedState=class{metricStorageRegistry=new i.MetricStorageRegistry;observableRegistry=new o.ObservableRegistry;meter;_meterProviderSharedState;_instrumentationScope;constructor(e,t){this.meter=new n.Meter(this),this._meterProviderSharedState=e,this._instrumentationScope=t}registerMetricStorage(e){let t=this._registerMetricStorage(e,s.SyncMetricStorage);return t.length===1?t[0]:new a.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,r.AsyncMetricStorage)}async collect(e,t,n){let r=await this.observableRegistry.observe(t,n?.timeoutMillis),i=this.metricStorageRegistry.getStorages(e);if(i.length===0)return null;let a=[];return i.forEach(n=>{let r=n.collect(e,t);r!=null&&a.push(r)}),a.length===0?{errors:r}:{scopeMetrics:{scope:this._instrumentationScope,metrics:a},errors:r}}_registerMetricStorage(e,n){let r=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(r=>{let i=(0,t.createInstrumentDescriptorWithView)(r,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(i);if(a!=null)return a;let o=new n(i,r.aggregation.createAggregator(i),r.attributesProcessor,this._meterProviderSharedState.metricCollectors,r.aggregationCardinalityLimit);return this.metricStorageRegistry.register(o),o});if(r.length===0){let t=this._meterProviderSharedState.selectAggregations(e.type).map(([t,r])=>{let i=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(t,e);if(i!=null)return i;let a=r.createAggregator(e),o=t.selectCardinalityLimit(e.type),s=new n(e,a,(0,c.createNoopAttributesProcessor)(),[t],o);return this.metricStorageRegistry.registerForCollector(t,s),s});r=r.concat(t)}return r}}})),cE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterProviderSharedState=void 0;let t=Qo(),n=GT(),r=sE(),i=ST();e.MeterProviderSharedState=class{viewRegistry=new n.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;resource;constructor(e){this.resource=e}getMeterSharedState(e){let n=(0,t.instrumentationScopeId)(e),i=this.meterSharedStates.get(n);return i??(i=new r.MeterSharedState(this,e),this.meterSharedStates.set(n,i)),i}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,(0,i.toAggregation)(n.selectAggregation(e))]);return t}}})),lE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MetricCollector=void 0;let t=q();e.MetricCollector=class{_sharedState;_metricReader;constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let n=(0,t.millisToHrTime)(Date.now()),r=[],i=[],a=Array.from(this._sharedState.meterSharedStates.values()).map(async t=>{let a=await t.collect(this,n,e);a?.scopeMetrics!=null&&r.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(a),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:r},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}selectCardinalityLimit(e){return this._metricReader.selectCardinalityLimit?.(e)??2e3}}})),uE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ExactPredicate=e.PatternPredicate=void 0;let t=/[\^$\\.+?()[\]{}|]/g;e.PatternPredicate=class e{_matchAll;_regexp;constructor(t){t===`*`?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(e.escapePattern(t)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(t,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(e){return e.includes(`*`)}},e.ExactPredicate=class{_matchAll;_pattern;constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}}})),dE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentSelector=void 0;let t=uE();e.InstrumentSelector=class{_nameFilter;_type;_unitFilter;constructor(e){this._nameFilter=new t.PatternPredicate(e?.name??`*`),this._type=e?.type,this._unitFilter=new t.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}})),fE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterSelector=void 0;let t=uE();e.MeterSelector=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(e){this._nameFilter=new t.ExactPredicate(e?.name),this._versionFilter=new t.ExactPredicate(e?.version),this._schemaUrlFilter=new t.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}})),pE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.View=void 0;let t=uE(),n=oE(),r=dE(),i=fE(),a=ST();function o(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function s(e){if(o(e))throw Error(`Cannot create view with no selector arguments supplied`);if(e.name!=null&&(e?.instrumentName==null||t.PatternPredicate.hasWildcard(e.instrumentName)))throw Error(`Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.`)}e.View=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(e){s(e),e.attributesProcessors==null?this.attributesProcessor=(0,n.createNoopAttributesProcessor)():this.attributesProcessor=(0,n.createMultiAttributesProcessor)(e.attributesProcessors),this.name=e.name,this.description=e.description,this.aggregation=(0,a.toAggregation)(e.aggregation??{type:a.AggregationType.DEFAULT}),this.instrumentSelector=new r.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new i.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl}),this.aggregationCardinalityLimit=e.aggregationCardinalityLimit}}})),mE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MeterProvider=void 0;let t=(c(),i(d)),n=WT(),r=cE(),a=lE(),o=pE();e.MeterProvider=class{_sharedState;_shutdown=!1;constructor(e){if(this._sharedState=new r.MeterProviderSharedState(e?.resource??(0,n.defaultResource)()),e?.views!=null&&e.views.length>0)for(let t of e.views)this._sharedState.viewRegistry.addView(new o.View(t));if(e?.readers!=null&&e.readers.length>0)for(let t of e.readers){let e=new a.MetricCollector(this._sharedState,t);t.setMetricProducer(e),this._sharedState.metricCollectors.push(e)}}getMeter(e,n=``,r={}){return this._shutdown?(t.diag.warn(`A shutdown MeterProvider cannot provide a Meter`),(0,t.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:n,schemaUrl:r.schemaUrl}).meter}async shutdown(e){if(this._shutdown){t.diag.warn(`shutdown may only be called once per MeterProvider`);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){t.diag.warn(`invalid attempt to force flush after MeterProvider shutdown`);return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}}})),hE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeoutError=e.createDenyListAttributesProcessor=e.createAllowListAttributesProcessor=e.AggregationType=e.MeterProvider=e.ConsoleMetricExporter=e.InMemoryMetricExporter=e.PeriodicExportingMetricReader=e.MetricReader=e.InstrumentType=e.DataPointType=e.AggregationTemporality=void 0;var t=Xo();Object.defineProperty(e,"AggregationTemporality",{enumerable:!0,get:function(){return t.AggregationTemporality}});var n=Zo();Object.defineProperty(e,"DataPointType",{enumerable:!0,get:function(){return n.DataPointType}}),Object.defineProperty(e,"InstrumentType",{enumerable:!0,get:function(){return n.InstrumentType}});var r=wT();Object.defineProperty(e,"MetricReader",{enumerable:!0,get:function(){return r.MetricReader}});var i=TT();Object.defineProperty(e,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return i.PeriodicExportingMetricReader}});var a=ET();Object.defineProperty(e,"InMemoryMetricExporter",{enumerable:!0,get:function(){return a.InMemoryMetricExporter}});var o=DT();Object.defineProperty(e,"ConsoleMetricExporter",{enumerable:!0,get:function(){return o.ConsoleMetricExporter}});var s=mE();Object.defineProperty(e,"MeterProvider",{enumerable:!0,get:function(){return s.MeterProvider}});var c=ST();Object.defineProperty(e,"AggregationType",{enumerable:!0,get:function(){return c.AggregationType}});var l=oE();Object.defineProperty(e,"createAllowListAttributesProcessor",{enumerable:!0,get:function(){return l.createAllowListAttributesProcessor}}),Object.defineProperty(e,"createDenyListAttributesProcessor",{enumerable:!0,get:function(){return l.createDenyListAttributesProcessor}});var u=Qo();Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return u.TimeoutError}})})),gE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AggregationTemporalityPreference=void 0,(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`,e[e.LOWMEMORY=2]=`LOWMEMORY`})(e.AggregationTemporalityPreference||={})})),_E,vE=n((()=>{_E=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}})),yE,bE=n((()=>{yE=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}}}));function xE(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function SE(e){if(e!=null)return async()=>e}function CE(e,t,n){return{timeoutMillis:xE(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function wE(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var TE=n((()=>{})),EE,DE=n((()=>{(function(e){e.NONE=`none`,e.GZIP=`gzip`})(EE||={})}));function OE(e){return new kE(e.concurrencyLimit)}var kE,AE=n((()=>{kE=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}}));function jE(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function ME(){return{handleResponse(t){t==null||!jE(t)||t.partialSuccess==null||Object.keys(t.partialSuccess).length===0||e.warn(`Received Partial Success response:`,JSON.stringify(t.partialSuccess))}}}var NE=n((()=>{c()}));function PE(e,t){return new IE(e.transport,e.serializer,ME(),e.promiseHandler,t.timeout)}var FE,IE,LE=n((()=>{FE=q(),bE(),NE(),c(),IE=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(t,n,r,i,a){this._transport=t,this._serializer=n,this._responseHandler=r,this._promiseQueue=i,this._timeout=a,this._diagLogger=e.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:FE.ExportResultCode.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:FE.ExportResultCode.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:FE.ExportResultCode.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:FE.ExportResultCode.FAILED,error:e.error});return}else e.status===`retryable`?t({code:FE.ExportResultCode.FAILED,error:e.error??new yE(`Export failed with retryable status`)}):t({code:FE.ExportResultCode.FAILED,error:new yE(`Export failed with unknown error`)})},e=>t({code:FE.ExportResultCode.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}}}));function RE(e,t,n){return PE({transport:n,serializer:t,promiseHandler:OE(e)},{timeout:e.timeoutMillis})}var zE=n((()=>{AE(),LE()})),BE=l({CompressionAlgorithm:()=>EE,OTLPExporterBase:()=>_E,OTLPExporterError:()=>yE,createOtlpNetworkExportDelegate:()=>RE,getSharedConfigurationDefaults:()=>wE,mergeOtlpSharedConfigurationWithDefaults:()=>CE}),VE=n((()=>{vE(),bE(),TE(),DE(),zE()})),HE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporterBase=e.LowMemoryTemporalitySelector=e.DeltaTemporalitySelector=e.CumulativeTemporalitySelector=void 0;let t=q(),n=hE(),r=gE(),a=(VE(),i(BE)),o=(c(),i(d));e.CumulativeTemporalitySelector=()=>n.AggregationTemporality.CUMULATIVE,e.DeltaTemporalitySelector=e=>{switch(e){case n.InstrumentType.COUNTER:case n.InstrumentType.OBSERVABLE_COUNTER:case n.InstrumentType.GAUGE:case n.InstrumentType.HISTOGRAM:case n.InstrumentType.OBSERVABLE_GAUGE:return n.AggregationTemporality.DELTA;case n.InstrumentType.UP_DOWN_COUNTER:case n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return n.AggregationTemporality.CUMULATIVE}},e.LowMemoryTemporalitySelector=e=>{switch(e){case n.InstrumentType.COUNTER:case n.InstrumentType.HISTOGRAM:return n.AggregationTemporality.DELTA;case n.InstrumentType.GAUGE:case n.InstrumentType.UP_DOWN_COUNTER:case n.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:case n.InstrumentType.OBSERVABLE_COUNTER:case n.InstrumentType.OBSERVABLE_GAUGE:return n.AggregationTemporality.CUMULATIVE}};function s(){let n=((0,t.getStringFromEnv)(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`)??`cumulative`).toLowerCase();return n===`cumulative`?e.CumulativeTemporalitySelector:n===`delta`?e.DeltaTemporalitySelector:n===`lowmemory`?e.LowMemoryTemporalitySelector:(o.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${n}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),e.CumulativeTemporalitySelector)}function l(t){return t==null?s():t===r.AggregationTemporalityPreference.DELTA?e.DeltaTemporalitySelector:t===r.AggregationTemporalityPreference.LOWMEMORY?e.LowMemoryTemporalitySelector:e.CumulativeTemporalitySelector}let u=Object.freeze({type:n.AggregationType.DEFAULT});function f(e){return e?.aggregationPreference??(()=>u)}e.OTLPMetricExporterBase=class extends a.OTLPExporterBase{_aggregationTemporalitySelector;_aggregationSelector;constructor(e,t){super(e),this._aggregationSelector=f(t),this._aggregationTemporalitySelector=l(t?.temporalityPreference)}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}}})),UE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.estimateVarintSize=void 0;function t(e){return e<0?10:e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:9}e.estimateVarintSize=t})),WE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufWriter=e.GROWING_BUFFER_DEBUG_MESSAGE=void 0;let t=(c(),i(d)),n=UE();e.GROWING_BUFFER_DEBUG_MESSAGE=`ProtobufWriter: estimated size was too small, growing buffer.`,e.ProtobufWriter=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(n){let r=this.pos+n;if(r<=this._buffer.length)return;t.diag.debug(e.GROWING_BUFFER_DEBUG_MESSAGE);let i=this._buffer.length*2;for(;i<r;)i*=2;let a=new Uint8Array(i);a.set(this._buffer),this._buffer=a,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(1),this.pos+=1,e}finishLengthDelimited(e,t){let r=t>>>0,i=(0,n.estimateVarintSize)(r);if(i>1){let t=i-1;this._ensureCapacity(t),this._buffer.copyWithin(e+i,e+1,this.pos),this.pos+=t}let a=e;r<128?this._buffer[a]=r:r<16384?(this._buffer[a++]=r&127|128,this._buffer[a]=r>>>7):r<2097152?(this._buffer[a++]=r&127|128,this._buffer[a++]=r>>>7&127|128,this._buffer[a]=r>>>14):r<268435456?(this._buffer[a++]=r&127|128,this._buffer[a++]=r>>>7&127|128,this._buffer[a++]=r>>>14&127|128,this._buffer[a]=r>>>21):(this._buffer[a++]=r&127|128,this._buffer[a++]=r>>>7&127|128,this._buffer[a++]=r>>>14&127|128,this._buffer[a++]=r>>>21&127|128,this._buffer[a]=r>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let t,n;if(e>=0)t=e>>>0,n=e/4294967296>>>0;else{let r=Math.abs(e);t=r>>>0,n=r/4294967296>>>0,t=~t>>>0,n=~n>>>0,t=t+1>>>0,t===0&&(n=n+1>>>0)}this.writeFixed64(t,n)}writeVarint(e){if(this._ensureCapacity((0,n.estimateVarintSize)(e)),e>=0&&e<=4294967295){let t=e>>>0;for(;t>127;)this._buffer[this.pos++]=t&127|128,t>>>=7;this._buffer[this.pos++]=t}else{let t,n;if(e>=0)t=e>>>0,n=e/4294967296>>>0;else{let r=Math.abs(e);t=r>>>0,n=r/4294967296>>>0,t=~t>>>0,n=~n>>>0,t=t+1>>>0,t===0&&(n=n+1>>>0)}for(;n>0||t>127;)this._buffer[this.pos++]=t&127|128,t=(t>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=t&127}}writeFixed32(e){this._ensureCapacity(4);let t=e>>>0;this._buffer[this.pos++]=t&255,this._buffer[this.pos++]=t>>>8&255,this._buffer[this.pos++]=t>>>16&255,this._buffer[this.pos++]=t>>>24&255}writeFixed64(e,t){this._ensureCapacity(8);let n=e>>>0,r=t>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=r&255,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,t){this.writeVarint(e<<3|t)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let t=!0,n=e.length;for(let r=0;r<n;r++)if(e.charCodeAt(r)>127){t=!1;break}if(t){this.writeVarint(n),this._ensureCapacity(n);for(let t=0;t<n;t++)this._buffer[this.pos++]=e.charCodeAt(t)}else{let t=this._textEncoder.encode(e);this.writeBytes(t)}}}})),GE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBinary=void 0;function t(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function n(e){let n=new Uint8Array(e.length/2),r=0;for(let i=0;i<e.length;i+=2){let a=t(e.charCodeAt(i)),o=t(e.charCodeAt(i+1));n[r++]=a<<4|o}return n}e.hexToBinary=n})),KE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SeverityNumber=void 0,(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(e.SeverityNumber||={})})),qE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NOOP_LOGGER=e.NoopLogger=void 0;var t=class{emit(e){}enabled(){return!1}};e.NoopLogger=t,e.NOOP_LOGGER=new t})),JE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.API_BACKWARDS_COMPATIBILITY_VERSION=e.makeGetter=e._global=e.GLOBAL_LOGS_API_KEY=void 0,e.GLOBAL_LOGS_API_KEY=Symbol.for(`io.opentelemetry.js.api.logs`),e._global=globalThis;function t(e,t,n){return r=>r===e?t:n}e.makeGetter=t,e.API_BACKWARDS_COMPATIBILITY_VERSION=1})),YE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NOOP_LOGGER_PROVIDER=e.NoopLoggerProvider=void 0;let t=qE();var n=class{getLogger(e,n,r){return new t.NoopLogger}};e.NoopLoggerProvider=n,e.NOOP_LOGGER_PROVIDER=new n})),XE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyLogger=void 0;let t=qE();e.ProxyLogger=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):t.NOOP_LOGGER}}})),ZE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProxyLoggerProvider=void 0;let t=YE(),n=XE();e.ProxyLoggerProvider=class{getLogger(e,t,r){return this._getDelegateLogger(e,t,r)??new n.ProxyLogger(this,e,t,r)}_getDelegate(){return this._delegate??t.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),QE=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LogsAPI=void 0;let t=JE(),n=YE(),r=ZE();e.LogsAPI=class e{constructor(){this._proxyLoggerProvider=new r.ProxyLoggerProvider}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return t._global[t.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(t._global[t.GLOBAL_LOGS_API_KEY]=(0,t.makeGetter)(t.API_BACKWARDS_COMPATIBILITY_VERSION,e,n.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return t._global[t.GLOBAL_LOGS_API_KEY]?.call(t._global,t.API_BACKWARDS_COMPATIBILITY_VERSION)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete t._global[t.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new r.ProxyLoggerProvider}}})),$E=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.logs=e.NoopLogger=e.NOOP_LOGGER=e.SeverityNumber=void 0;var t=KE();Object.defineProperty(e,"SeverityNumber",{enumerable:!0,get:function(){return t.SeverityNumber}});var n=qE();Object.defineProperty(e,"NOOP_LOGGER",{enumerable:!0,get:function(){return n.NOOP_LOGGER}}),Object.defineProperty(e,"NoopLogger",{enumerable:!0,get:function(){return n.NoopLogger}}),e.logs=QE().LogsAPI.getInstance()})),eD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.writeResource=e.writeInstrumentationScope=e.writeAnyValue=e.writeKeyValue=e.writeAttributes=e.writeHrTimeAsFixed64=void 0;function t(e,t){let n=t[0],r=t[1],i=1e9,a=n&65535,o=n/65536>>>0,s=a*i,c=o*i,l=s>>>0,u=Math.floor(s/4294967296),d=(c&65535)*65536>>>0,f=c/65536>>>0,p=l+d+r,m=p>>>0,h=Math.floor(p/4294967296),g=u+f+h>>>0;e.writeFixed64(m,g)}e.writeHrTimeAsFixed64=t;function n(e,t,n){for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;let a=t[i];e.writeTag(n,2);let o=e.startLengthDelimited(),s=e.pos;r(e,i,a),e.finishLengthDelimited(o,e.pos-s)}}e.writeAttributes=n;function r(e,t,n){e.writeTag(1,2),e.writeString(t),e.writeTag(2,2);let r=e.startLengthDelimited(),i=e.pos;o(e,n),e.finishLengthDelimited(r,e.pos-i)}e.writeKeyValue=r;let i=-(2**63),a=2**63;function o(e,t){let n=typeof t;if(n===`string`)e.writeTag(1,2),e.writeString(t);else if(n===`boolean`)e.writeTag(2,0),e.writeVarint(+!!t);else if(n===`number`){let n=t;Number.isInteger(n)&&n>=i&&n<a?(e.writeTag(3,0),e.writeVarint(n)):(e.writeTag(4,1),e.writeDouble(n))}else if(t instanceof Uint8Array)e.writeTag(7,2),e.writeBytes(t);else if(Array.isArray(t)){e.writeTag(5,2);let n=e.startLengthDelimited(),r=e.pos;for(let n of t){e.writeTag(1,2);let t=e.startLengthDelimited(),r=e.pos;o(e,n),e.finishLengthDelimited(t,e.pos-r)}e.finishLengthDelimited(n,e.pos-r)}else if(n===`object`&&t!=null){e.writeTag(6,2);let n=e.startLengthDelimited(),r=e.pos,i=t;for(let t in i){if(!Object.prototype.hasOwnProperty.call(i,t))continue;let n=i[t];e.writeTag(1,2);let r=e.startLengthDelimited(),a=e.pos;e.writeTag(1,2),e.writeString(t),e.writeTag(2,2);let s=e.startLengthDelimited(),c=e.pos;o(e,n),e.finishLengthDelimited(s,e.pos-c),e.finishLengthDelimited(r,e.pos-a)}e.finishLengthDelimited(n,e.pos-r)}}e.writeAnyValue=o;function s(e,t,n){e.writeTag(n,2);let r=e.startLengthDelimited(),i=e.pos;e.writeTag(1,2),e.writeString(t.name),t.version&&(e.writeTag(2,2),e.writeString(t.version)),e.finishLengthDelimited(r,e.pos-i)}e.writeInstrumentationScope=s;function c(e,t,r){e.writeTag(r,2);let i=e.startLengthDelimited(),a=e.pos;t.attributes&&n(e,t.attributes,1),e.writeTag(2,0),e.writeVarint(0),e.finishLengthDelimited(i,e.pos-a)}e.writeResource=c})),tD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufSizeEstimator=void 0;let t=UE();function n(e){let t=e.length,n=0;for(let r=0;r<t;r++){let t=e.charCodeAt(r);t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4)}return n}e.ProtobufSizeEstimator=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,n){this.pos+=(0,t.estimateVarintSize)(n)}writeVarint(e){this.pos+=(0,t.estimateVarintSize)(e)}writeSint32(e){this.pos+=(0,t.estimateVarintSize)((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,t){this.pos+=8}writeBytes(e){this.pos+=(0,t.estimateVarintSize)(e.length),this.pos+=e.length}writeTag(e,t){this.writeVarint(e<<3|t)}writeDouble(e){this.pos+=8}writeString(e){let r=n(e);this.pos+=(0,t.estimateVarintSize)(r),this.pos+=r}}})),nD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeLogsExportRequest=void 0;let t=WE(),n=GE(),r=$E(),i=eD(),a=tD();function o(e,t){let a=e.startLengthDelimited(),o=e.pos;if(e.writeTag(1,1),(0,i.writeHrTimeAsFixed64)(e,t.hrTime),t.severityNumber!==void 0&&t.severityNumber!==r.SeverityNumber.UNSPECIFIED&&(e.writeTag(2,0),e.writeVarint(t.severityNumber)),t.severityText&&(e.writeTag(3,2),e.writeString(t.severityText)),t.body!==void 0){e.writeTag(5,2);let n=e.startLengthDelimited(),r=e.pos;(0,i.writeAnyValue)(e,t.body),e.finishLengthDelimited(n,e.pos-r)}t.attributes&&(0,i.writeAttributes)(e,t.attributes,6),e.writeTag(7,0),e.writeVarint(t.droppedAttributesCount),t.spanContext?.traceFlags&&(e.writeTag(8,5),e.writeFixed32(t.spanContext.traceFlags)),t.spanContext?.traceId&&(e.writeTag(9,2),e.writeBytes((0,n.hexToBinary)(t.spanContext.traceId))),t.spanContext?.spanId&&(e.writeTag(10,2),e.writeBytes((0,n.hexToBinary)(t.spanContext.spanId))),e.writeTag(11,1),(0,i.writeHrTimeAsFixed64)(e,t.hrTimeObserved),t.eventName&&(e.writeTag(12,2),e.writeString(t.eventName)),e.finishLengthDelimited(a,e.pos-o)}function s(e,t,n){let r=e.startLengthDelimited(),a=e.pos;(0,i.writeInstrumentationScope)(e,t,1);for(let t of n)e.writeTag(2,2),o(e,t);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(r,e.pos-a)}function c(e,t,n){let r=e.startLengthDelimited(),a=e.pos;(0,i.writeResource)(e,t,1);for(let t of n.values()){e.writeTag(2,2);let n=t[0].instrumentationScope;s(e,n,t)}t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(r,e.pos-a)}function l(e){let t=new Map;for(let n of e){let e=n.resource,r=n.instrumentationScope,i=t.get(e);i||(i=new Map,t.set(e,i));let a=i.get(r);a||(a=[],i.set(r,a)),a.push(n)}return t}function u(e){let n=l(e),r=new a.ProtobufSizeEstimator;for(let[e,t]of n)r.writeTag(1,2),c(r,e,t);let i=new t.ProtobufWriter(r.pos);for(let[e,t]of n)i.writeTag(1,2),c(i,e,t);return i.finish()}e.serializeLogsExportRequest=u})),rD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufReader=void 0,e.ProtobufReader=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,t=0,n=!1;for(;this.pos<this._buf.length;){let r=this._buf[this.pos++];if(e+=(r&127)*2**t,t+=7,!(r&128)){n=!0;break}}if(!n)throw Error(`Truncated buffer: unexpected end of data while reading varint`);return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let t=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,t}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:e}=this.readTag();if(e===4)break;this.skip(e)}break;case 4:break;case 5:this.pos+=4;break;default:throw Error(`Unknown wire type ${e}, cannot safely skip`)}}}})),iD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeExportLogsServiceResponse=void 0;let t=rD();function n(e){let n=new t.ProtobufReader(e),r={};for(;!n.isAtEnd();){let{fieldNumber:e,wireType:t}=n.readTag();switch(e){case 1:t===0?r.rejectedLogRecords=n.readVarint():n.skip(t);break;case 2:t===2?r.errorMessage=n.readString():n.skip(t);break;default:n.skip(t);break}}return r}function r(e){let r=new t.ProtobufReader(e),i={};for(;!r.isAtEnd();){let{fieldNumber:e,wireType:t}=r.readTag();switch(e){case 1:t===2?i.partialSuccess=n(r.readBytes()):r.skip(t);break;default:r.skip(t);break}}return i}e.deserializeExportLogsServiceResponse=r})),aD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufLogsSerializer=void 0;let t=nD(),n=iD();e.ProtobufLogsSerializer={serializeRequest:e=>(0,t.serializeLogsExportRequest)(e),deserializeResponse:e=>(0,n.deserializeExportLogsServiceResponse)(e)}})),oD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufLogsSerializer=void 0;var t=aD();Object.defineProperty(e,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return t.ProtobufLogsSerializer}})})),sD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeMetricsExportRequest=void 0;let t=(c(),i(d)),n=hE(),r=eD(),a=tD(),o=WE();function s(e,n,i){let a=e.startLengthDelimited(),o=e.pos;e.writeTag(2,1),(0,r.writeHrTimeAsFixed64)(e,n.startTime),e.writeTag(3,1),(0,r.writeHrTimeAsFixed64)(e,n.endTime),i===t.ValueType.INT?(e.writeTag(6,1),e.writeSfixed64(n.value)):(e.writeTag(4,1),e.writeDouble(n.value)),n.attributes&&(0,r.writeAttributes)(e,n.attributes,7),e.finishLengthDelimited(a,e.pos-o)}function l(e,t){let n=e.startLengthDelimited(),i=e.pos,a=t.value;if(e.writeTag(2,1),(0,r.writeHrTimeAsFixed64)(e,t.startTime),e.writeTag(3,1),(0,r.writeHrTimeAsFixed64)(e,t.endTime),e.writeTag(4,1),e.writeFixed64(a.count>>>0,a.count/4294967296>>>0),a.sum!==void 0&&(e.writeTag(5,1),e.writeDouble(a.sum)),a.buckets.counts.length>0){e.writeTag(6,2);let t=e.startLengthDelimited(),n=e.pos;for(let t of a.buckets.counts)e.writeFixed64(t>>>0,t/4294967296>>>0);e.finishLengthDelimited(t,e.pos-n)}if(a.buckets.boundaries.length>0){e.writeTag(7,2);let t=e.startLengthDelimited(),n=e.pos;for(let t of a.buckets.boundaries)e.writeDouble(t);e.finishLengthDelimited(t,e.pos-n)}t.attributes&&(0,r.writeAttributes)(e,t.attributes,9),a.min!==void 0&&(e.writeTag(11,1),e.writeDouble(a.min)),a.max!==void 0&&(e.writeTag(12,1),e.writeDouble(a.max)),e.finishLengthDelimited(n,e.pos-i)}function u(e,t,n){let r=e.startLengthDelimited(),i=e.pos;if(t!==0&&(e.writeTag(1,0),e.writeSint32(t)),n.length>0){e.writeTag(2,2);let t=e.startLengthDelimited(),r=e.pos;for(let t of n)e.writeVarint(t);e.finishLengthDelimited(t,e.pos-r)}e.finishLengthDelimited(r,e.pos-i)}function f(e,t){let n=e.startLengthDelimited(),i=e.pos,a=t.value;t.attributes&&(0,r.writeAttributes)(e,t.attributes,1),e.writeTag(2,1),(0,r.writeHrTimeAsFixed64)(e,t.startTime),e.writeTag(3,1),(0,r.writeHrTimeAsFixed64)(e,t.endTime),e.writeTag(4,1),e.writeFixed64(a.count>>>0,a.count/4294967296>>>0),a.sum!==void 0&&(e.writeTag(5,1),e.writeDouble(a.sum)),a.scale!==0&&(e.writeTag(6,0),e.writeSint32(a.scale)),e.writeTag(7,1),e.writeFixed64(a.zeroCount>>>0,a.zeroCount/4294967296>>>0),e.writeTag(8,2),u(e,a.positive.offset,a.positive.bucketCounts),e.writeTag(9,2),u(e,a.negative.offset,a.negative.bucketCounts),a.min!==void 0&&(e.writeTag(12,1),e.writeDouble(a.min)),a.max!==void 0&&(e.writeTag(13,1),e.writeDouble(a.max)),e.finishLengthDelimited(n,e.pos-i)}function p(e,t){let r=e.startLengthDelimited(),i=e.pos;switch(e.writeTag(1,2),e.writeString(t.descriptor.name),t.descriptor.description&&(e.writeTag(2,2),e.writeString(t.descriptor.description)),t.descriptor.unit&&(e.writeTag(3,2),e.writeString(t.descriptor.unit)),t.dataPointType){case n.DataPointType.GAUGE:e.writeTag(5,2),m(e,t);break;case n.DataPointType.SUM:e.writeTag(7,2),h(e,t);break;case n.DataPointType.HISTOGRAM:e.writeTag(9,2),g(e,t);break;case n.DataPointType.EXPONENTIAL_HISTOGRAM:e.writeTag(10,2),_(e,t);break;default:}e.finishLengthDelimited(r,e.pos-i)}function m(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),s(e,n,t.descriptor.valueType);e.finishLengthDelimited(n,e.pos-r)}function h(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),s(e,n,t.descriptor.valueType);let i=b(t.aggregationTemporality);i!==0&&(e.writeTag(2,0),e.writeVarint(i)),t.isMonotonic&&(e.writeTag(3,0),e.writeVarint(1)),e.finishLengthDelimited(n,e.pos-r)}function g(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),l(e,n);let i=b(t.aggregationTemporality);i!==0&&(e.writeTag(2,0),e.writeVarint(i)),e.finishLengthDelimited(n,e.pos-r)}function _(e,t){let n=e.startLengthDelimited(),r=e.pos;for(let n of t.dataPoints)e.writeTag(1,2),f(e,n);let i=b(t.aggregationTemporality);i!==0&&(e.writeTag(2,0),e.writeVarint(i)),e.finishLengthDelimited(n,e.pos-r)}function v(e,t){let n=e.startLengthDelimited(),i=e.pos;(0,r.writeInstrumentationScope)(e,t.scope,1);for(let n of t.metrics)e.writeTag(2,2),p(e,n);t.scope.schemaUrl&&(e.writeTag(3,2),e.writeString(t.scope.schemaUrl)),e.finishLengthDelimited(n,e.pos-i)}function y(e,t){let n=e.startLengthDelimited(),i=e.pos;(0,r.writeResource)(e,t.resource,1);for(let n of t.scopeMetrics)e.writeTag(2,2),v(e,n);t.resource.schemaUrl&&(e.writeTag(3,2),e.writeString(t.resource.schemaUrl)),e.finishLengthDelimited(n,e.pos-i)}function b(e){switch(e){case n.AggregationTemporality.DELTA:return 1;case n.AggregationTemporality.CUMULATIVE:return 2;default:return 0}}function x(e){let t=new a.ProtobufSizeEstimator;t.writeTag(1,2),y(t,e);let n=new o.ProtobufWriter(t.pos);return n.writeTag(1,2),y(n,e),n.finish()}e.serializeMetricsExportRequest=x})),cD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeExportMetricsServiceResponse=void 0;let t=rD();function n(e){let n=new t.ProtobufReader(e),r={};for(;!n.isAtEnd();){let{fieldNumber:e,wireType:t}=n.readTag();switch(e){case 1:t===0?r.rejectedDataPoints=n.readVarint():n.skip(t);break;case 2:t===2?r.errorMessage=n.readString():n.skip(t);break;default:n.skip(t);break}}return r}function r(e){let r=new t.ProtobufReader(e),i={};for(;!r.isAtEnd();){let{fieldNumber:e,wireType:t}=r.readTag();switch(e){case 1:t===2?i.partialSuccess=n(r.readBytes()):r.skip(t);break;default:r.skip(t);break}}return i}e.deserializeExportMetricsServiceResponse=r})),lD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufMetricsSerializer=void 0;let t=sD(),n=cD();e.ProtobufMetricsSerializer={serializeRequest:e=>(0,t.serializeMetricsExportRequest)(e),deserializeResponse:e=>(0,n.deserializeExportMetricsServiceResponse)(e)}})),uD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufMetricsSerializer=void 0;var t=lD();Object.defineProperty(e,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return t.ProtobufMetricsSerializer}})})),dD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serializeTraceExportRequest=void 0;let t=WE(),n=GE(),r=eD(),i=tD();function a(e,t){let n=e&255|256;return t&&(n|=512),n}function o(e,t){let n=e.startLengthDelimited(),r=e.pos;t.message&&(e.writeTag(2,2),e.writeString(t.message)),e.writeTag(3,0),e.writeVarint(t.code),e.finishLengthDelimited(n,e.pos-r)}function s(e,t){let n=e.startLengthDelimited(),i=e.pos;e.writeTag(1,1),(0,r.writeHrTimeAsFixed64)(e,t.time),e.writeTag(2,2),e.writeString(t.name),t.attributes&&(0,r.writeAttributes)(e,t.attributes,3),e.writeTag(4,0),e.writeVarint(t.droppedAttributesCount||0),e.finishLengthDelimited(n,e.pos-i)}function c(e,t){let i=e.startLengthDelimited(),o=e.pos,s=t.context;e.writeTag(1,2),e.writeBytes((0,n.hexToBinary)(s.traceId)),e.writeTag(2,2),e.writeBytes((0,n.hexToBinary)(s.spanId));let c=s.traceState?.serialize();c&&(e.writeTag(3,2),e.writeString(c)),t.attributes&&(0,r.writeAttributes)(e,t.attributes,4),e.writeTag(5,0),e.writeVarint(t.droppedAttributesCount||0);let l=a(s.traceFlags,s.isRemote);l&&(e.writeTag(6,5),e.writeFixed32(l)),e.finishLengthDelimited(i,e.pos-o)}function l(e,t){let i=e.startLengthDelimited(),l=e.pos,u=t.spanContext();e.writeTag(1,2),e.writeBytes((0,n.hexToBinary)(u.traceId)),e.writeTag(2,2),e.writeBytes((0,n.hexToBinary)(u.spanId));let d=u.traceState?.serialize();d&&(e.writeTag(3,2),e.writeString(d)),t.parentSpanContext?.spanId&&(e.writeTag(4,2),e.writeBytes((0,n.hexToBinary)(t.parentSpanContext.spanId))),e.writeTag(5,2),e.writeString(t.name);let f=t.kind==null?0:t.kind+1;f!==0&&(e.writeTag(6,0),e.writeVarint(f)),e.writeTag(7,1),(0,r.writeHrTimeAsFixed64)(e,t.startTime),e.writeTag(8,1),(0,r.writeHrTimeAsFixed64)(e,t.endTime),t.attributes&&(0,r.writeAttributes)(e,t.attributes,9),e.writeTag(10,0),e.writeVarint(t.droppedAttributesCount);for(let n of t.events)e.writeTag(11,2),s(e,n);e.writeTag(12,0),e.writeVarint(t.droppedEventsCount);for(let n of t.links)e.writeTag(13,2),c(e,n);e.writeTag(14,0),e.writeVarint(t.droppedLinksCount),e.writeTag(15,2),o(e,t.status);let p=a(u.traceFlags,t.parentSpanContext?.isRemote);p&&(e.writeTag(16,5),e.writeFixed32(p)),e.finishLengthDelimited(i,e.pos-l)}function u(e,t,n){let i=e.startLengthDelimited(),a=e.pos;(0,r.writeInstrumentationScope)(e,t,1);for(let t of n)e.writeTag(2,2),l(e,t);t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-a)}function d(e,t,n){let i=e.startLengthDelimited(),a=e.pos;(0,r.writeResource)(e,t,1);for(let t of n.values()){e.writeTag(2,2);let n=t[0].instrumentationScope;u(e,n,t)}t.schemaUrl&&(e.writeTag(3,2),e.writeString(t.schemaUrl)),e.finishLengthDelimited(i,e.pos-a)}function f(e){let t=new Map;for(let n of e){let e=n.resource,r=n.instrumentationScope,i=t.get(e);i||(i=new Map,t.set(e,i));let a=i.get(r);a||(a=[],i.set(r,a)),a.push(n)}return t}function p(e){let n=f(e),r=new i.ProtobufSizeEstimator;for(let[e,t]of n)r.writeTag(1,2),d(r,e,t);let a=new t.ProtobufWriter(r.pos);for(let[e,t]of n)a.writeTag(1,2),d(a,e,t);return a.finish()}e.serializeTraceExportRequest=p})),fD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeExportTraceServiceResponse=void 0;let t=rD();function n(e){let n=new t.ProtobufReader(e),r={};for(;!n.isAtEnd();){let{fieldNumber:e,wireType:t}=n.readTag();switch(e){case 1:t===0?r.rejectedSpans=n.readVarint():n.skip(t);break;case 2:t===2?r.errorMessage=n.readString():n.skip(t);break;default:n.skip(t);break}}return r}function r(e){let r=new t.ProtobufReader(e),i={};for(;!r.isAtEnd();){let{fieldNumber:e,wireType:t}=r.readTag();switch(e){case 1:t===2?i.partialSuccess=n(r.readBytes()):r.skip(t);break;default:r.skip(t);break}}return i}e.deserializeExportTraceServiceResponse=r})),pD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufTraceSerializer=void 0;let t=dD(),n=fD();e.ProtobufTraceSerializer={serializeRequest:e=>(0,t.serializeTraceExportRequest)(e),deserializeResponse:e=>(0,n.deserializeExportTraceServiceResponse)(e)}})),mD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtobufTraceSerializer=void 0;var t=pD();Object.defineProperty(e,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return t.ProtobufTraceSerializer}})})),hD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toAnyValue=e.toKeyValue=e.toAttributes=e.createInstrumentationScope=e.createResource=void 0;function t(e,t){let n={attributes:r(e.attributes,t),droppedAttributesCount:0},i=e.schemaUrl;return i&&i!==``&&(n.schemaUrl=i),n}e.createResource=t;function n(e){return{name:e.name,version:e.version}}e.createInstrumentationScope=n;function r(e,t){return Object.keys(e).map(n=>i(n,e[n],t))}e.toAttributes=r;function i(e,t,n){return{key:e,value:a(t,n)}}e.toKeyValue=i;function a(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=a(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:a(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}e.toAnyValue=a})),gD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toLogAttributes=e.createExportLogsServiceRequest=void 0;let t=hD();function n(e,t){return{resourceLogs:i(e,t)}}e.createExportLogsServiceRequest=n;function r(e){let t=new Map;for(let n of e){let{resource:e,instrumentationScope:{name:r,version:i=``,schemaUrl:a=``}}=n,o=t.get(e);o||(o=new Map,t.set(e,o));let s=`${r}@${i}:${a}`,c=o.get(s);c||(c=[],o.set(s,c)),c.push(n)}return t}function i(e,n){let i=r(e);return Array.from(i,([e,r])=>{let i=(0,t.createResource)(e,n);return{resource:i,scopeLogs:Array.from(r,([,e])=>({scope:(0,t.createInstrumentationScope)(e[0].instrumentationScope),logRecords:e.map(e=>a(e,n)),schemaUrl:e[0].instrumentationScope.schemaUrl})),schemaUrl:i.schemaUrl}})}function a(e,n){return{timeUnixNano:n.encodeHrTime(e.hrTime),observedTimeUnixNano:n.encodeHrTime(e.hrTimeObserved),severityNumber:o(e.severityNumber),severityText:e.severityText,body:(0,t.toAnyValue)(e.body,n),eventName:e.eventName,attributes:s(e.attributes,n),droppedAttributesCount:e.droppedAttributesCount,flags:e.spanContext?.traceFlags,traceId:n.encodeOptionalSpanContext(e.spanContext?.traceId),spanId:n.encodeOptionalSpanContext(e.spanContext?.spanId)}}function o(e){return e}function s(e,n){return Object.keys(e).map(r=>(0,t.toKeyValue)(r,e[r],n))}e.toLogAttributes=s})),_D=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JSON_ENCODER=e.PROTOBUF_ENCODER=e.encodeAsString=e.encodeAsLongBits=e.toLongBits=e.hrTimeToNanos=void 0;let t=q(),n=GE();function r(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}e.hrTimeToNanos=r;function i(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}e.toLongBits=i;function a(e){return i(r(e))}e.encodeAsLongBits=a;function o(e){return r(e).toString()}e.encodeAsString=o;let s=typeof BigInt<`u`?o:t.hrTimeToNanoseconds;function c(e){return e}function l(e){if(e!==void 0)return(0,n.hexToBinary)(e)}e.PROTOBUF_ENCODER={encodeHrTime:a,encodeSpanContext:n.hexToBinary,encodeOptionalSpanContext:l,encodeUint8Array:c},e.JSON_ENCODER={encodeHrTime:s,encodeSpanContext:c,encodeOptionalSpanContext:c,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}}})),vD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonLogsSerializer=void 0;let t=gD(),n=_D(),r=(c(),i(d));e.JsonLogsSerializer={serializeRequest:e=>{let r=(0,t.createExportLogsServiceRequest)(e,n.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(r))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return r.diag.warn(`Failed to parse logs export response: ${e.message}. Returning empty response`),{}}}}})),yD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonLogsSerializer=void 0;var t=vD();Object.defineProperty(e,"JsonLogsSerializer",{enumerable:!0,get:function(){return t.JsonLogsSerializer}})})),bD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EAggregationTemporality=void 0,(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]=`AGGREGATION_TEMPORALITY_UNSPECIFIED`,e[e.AGGREGATION_TEMPORALITY_DELTA=1]=`AGGREGATION_TEMPORALITY_DELTA`,e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]=`AGGREGATION_TEMPORALITY_CUMULATIVE`})(e.EAggregationTemporality||={})})),xD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createExportMetricsServiceRequest=e.toMetric=e.toScopeMetrics=e.toResourceMetrics=void 0;let t=(c(),i(d)),n=hE(),r=bD(),a=hD();function o(e,t){let n=(0,a.createResource)(e.resource,t);return{resource:n,schemaUrl:n.schemaUrl,scopeMetrics:s(e.scopeMetrics,t)}}e.toResourceMetrics=o;function s(e,t){return Array.from(e.map(e=>({scope:(0,a.createInstrumentationScope)(e.scope),metrics:e.metrics.map(e=>l(e,t)),schemaUrl:e.scope.schemaUrl})))}e.toScopeMetrics=s;function l(e,t){let r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},i=h(e.aggregationTemporality);switch(e.dataPointType){case n.DataPointType.SUM:r.sum={aggregationTemporality:i,isMonotonic:e.isMonotonic,dataPoints:f(e,t)};break;case n.DataPointType.GAUGE:r.gauge={dataPoints:f(e,t)};break;case n.DataPointType.HISTOGRAM:r.histogram={aggregationTemporality:i,dataPoints:p(e,t)};break;case n.DataPointType.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:i,dataPoints:m(e,t)};break}return r}e.toMetric=l;function u(e,n,r){let i={attributes:(0,a.toAttributes)(e.attributes,r),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(n){case t.ValueType.INT:i.asInt=e.value;break;case t.ValueType.DOUBLE:i.asDouble=e.value;break}return i}function f(e,t){return e.dataPoints.map(n=>u(n,e.descriptor.valueType,t))}function p(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:(0,a.toAttributes)(e.attributes,t),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function m(e,t){return e.dataPoints.map(e=>{let n=e.value;return{attributes:(0,a.toAttributes)(e.attributes,t),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:t.encodeHrTime(e.startTime),timeUnixNano:t.encodeHrTime(e.endTime)}})}function h(e){switch(e){case n.AggregationTemporality.DELTA:return r.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA;case n.AggregationTemporality.CUMULATIVE:return r.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE}}function g(e,t){return{resourceMetrics:e.map(e=>o(e,t))}}e.createExportMetricsServiceRequest=g})),SD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonMetricsSerializer=void 0;let t=xD(),n=_D(),r=(c(),i(d));e.JsonMetricsSerializer={serializeRequest:e=>{let r=(0,t.createExportMetricsServiceRequest)([e],n.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(r))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return r.diag.warn(`Failed to parse metrics export response: ${e.message}. Returning empty response`),{}}}}})),CD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonMetricsSerializer=void 0;var t=SD();Object.defineProperty(e,"JsonMetricsSerializer",{enumerable:!0,get:function(){return t.JsonMetricsSerializer}})})),wD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createExportTraceServiceRequest=e.toOtlpSpanEvent=e.toOtlpLink=e.sdkSpanToOtlpSpan=void 0;let t=hD();function n(e,t){let n=e&255|256;return t&&(n|=512),n}function r(e,r){let o=e.spanContext(),s=e.status,c=e.parentSpanContext?.spanId?r.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:r.encodeSpanContext(o.traceId),spanId:r.encodeSpanContext(o.spanId),parentSpanId:c,traceState:o.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:r.encodeHrTime(e.startTime),endTimeUnixNano:r.encodeHrTime(e.endTime),attributes:(0,t.toAttributes)(e.attributes,r),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>a(e,r)),droppedEventsCount:e.droppedEventsCount,status:{code:s.code,message:s.message},links:e.links.map(e=>i(e,r)),droppedLinksCount:e.droppedLinksCount,flags:n(o.traceFlags,e.parentSpanContext?.isRemote)}}e.sdkSpanToOtlpSpan=r;function i(e,r){return{attributes:e.attributes?(0,t.toAttributes)(e.attributes,r):[],spanId:r.encodeSpanContext(e.context.spanId),traceId:r.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:n(e.context.traceFlags,e.context.isRemote)}}e.toOtlpLink=i;function a(e,n){return{attributes:e.attributes?(0,t.toAttributes)(e.attributes,n):[],name:e.name,timeUnixNano:n.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}e.toOtlpSpanEvent=a;function o(e,t){return{resourceSpans:c(e,t)}}e.createExportTraceServiceRequest=o;function s(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function c(e,n){let i=s(e),a=[],o=i.entries(),c=o.next();for(;!c.done;){let[e,i]=c.value,s=[],l=i.values(),u=l.next();for(;!u.done;){let e=u.value;if(e.length>0){let i=e.map(e=>r(e,n));s.push({scope:(0,t.createInstrumentationScope)(e[0].instrumentationScope),spans:i,schemaUrl:e[0].instrumentationScope.schemaUrl})}u=l.next()}let d=(0,t.createResource)(e,n),f={resource:d,scopeSpans:s,schemaUrl:d.schemaUrl};a.push(f),c=o.next()}return a}})),TD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonTraceSerializer=void 0;let t=wD(),n=_D(),r=(c(),i(d));e.JsonTraceSerializer={serializeRequest:e=>{let r=(0,t.createExportTraceServiceRequest)(e,n.JSON_ENCODER);return new TextEncoder().encode(JSON.stringify(r))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return r.diag.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}}})),ED=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonTraceSerializer=void 0;var t=TD();Object.defineProperty(e,"JsonTraceSerializer",{enumerable:!0,get:function(){return t.JsonTraceSerializer}})})),DD=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.JsonTraceSerializer=e.JsonMetricsSerializer=e.JsonLogsSerializer=e.ProtobufTraceSerializer=e.ProtobufMetricsSerializer=e.ProtobufLogsSerializer=void 0;var t=oD();Object.defineProperty(e,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return t.ProtobufLogsSerializer}});var n=uD();Object.defineProperty(e,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return n.ProtobufMetricsSerializer}});var r=mD();Object.defineProperty(e,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return r.ProtobufTraceSerializer}});var i=yD();Object.defineProperty(e,"JsonLogsSerializer",{enumerable:!0,get:function(){return i.JsonLogsSerializer}});var a=CD();Object.defineProperty(e,"JsonMetricsSerializer",{enumerable:!0,get:function(){return a.JsonMetricsSerializer}});var o=ED();Object.defineProperty(e,"JsonTraceSerializer",{enumerable:!0,get:function(){return o.JsonTraceSerializer}})}));function OD(t){let n={};return Object.entries(t??{}).forEach(([t,r])=>{r===void 0?e.warn(`Header "${t}" has invalid value (${r}) and will be ignored`):n[t]=String(r)}),n}var kD=n((()=>{c()}));function AD(e,t,n){return async()=>{let r={...await n()},i={};return t!=null&&Object.assign(i,await t()),e!=null&&Object.assign(i,OD(await e())),Object.assign(i,r)}}function jD(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function MD(e,t,n){return{...CE(e,t,n),headers:AD(e.headers,t.headers,n.headers),url:jD(e.url)??t.url??n.url}}function ND(e,t){return{...wE(),headers:async()=>e,url:`http://localhost:4318/`+t}}var PD=n((()=>{TE(),kD()}));function FD(e){return async t=>{let n=t===`http:`,{Agent:r}=await(n?import(`http`):import(`https`));if(n){let{ca:t,cert:n,key:i,...a}=e;return new r(a)}return new r(e)}}function ID(e,t,n){return{...MD(e,t,n),agentFactory:e.agentFactory??t.agentFactory??n.agentFactory,userAgent:e.userAgent}}function LD(e,t){return{...ND(e,t),agentFactory:FD({keepAlive:!0})}}var RD=n((()=>{PD()}));function zD(e){return e===429||e===502||e===503||e===504}function BD(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var VD=n((()=>{})),HD,UD=n((()=>{HD=`0.218.0`}));function WD(e,t,n,r,i,a,o,s){return new Promise(c=>{let l=new URL(t);i?n[`User-Agent`]=`${i} ${JD}`:n[`User-Agent`]=JD;let u=e(l,{method:`POST`,headers:n,agent:a},e=>{let t=[],n=0;e.on(`data`,r=>{if(n+=r.length,n>4194304){c({status:`failure`,error:Error(`OTLP export response body exceeded size limit of ${YD} bytes`)}),e.destroy();return}t.push(r)}),e.on(`end`,()=>{e.statusCode&&e.statusCode<=299?c({status:`success`,data:Buffer.concat(t)}):e.statusCode&&zD(e.statusCode)?c({status:`retryable`,retryInMillis:BD(e.headers[`retry-after`])}):c({status:`failure`,error:new yE(e.statusMessage,e.statusCode,Buffer.concat(t).toString())})}),e.on(`error`,t=>{e.statusCode&&e.statusCode<=299?c({status:`success`}):e.statusCode&&zD(e.statusCode)?c({status:`retryable`,error:t,retryInMillis:BD(e.headers[`retry-after`])}):c({status:`failure`,error:t})})});u.setTimeout(s,()=>{u.destroy(),c({status:`retryable`,error:Error(`Request timed out`)})}),u.on(`error`,e=>{qD(e)?c({status:`retryable`,error:e}):c({status:`failure`,error:e})}),GD(u,r,o,e=>{c({status:`failure`,error:e})})})}function GD(e,t,n,r){let i=KD(n);t===`gzip`&&(e.setHeader(`Content-Encoding`,`gzip`),i=i.on(`error`,r).pipe(Te.createGzip()).on(`error`,r)),i.pipe(e).on(`error`,r)}function KD(e){let t=new _e;return t.push(e),t.push(null),t}function qD(e){let t=new Set([`ECONNRESET`,`ECONNREFUSED`,`EPIPE`,`ETIMEDOUT`,`EAI_AGAIN`,`ENOTFOUND`,`ENETUNREACH`,`EHOSTUNREACH`]);return`code`in e&&typeof e.code==`string`?t.has(e.code):!1}var JD,YD,XD=n((()=>{VD(),bE(),UD(),JD=`OTel-OTLP-Exporter-JavaScript/${HD}`,YD=4*1024*1024}));async function ZD(e){let{request:t}=await(e===`http:`?import(`http`):import(`https`));return t}function QD(e){return new $D(e)}var $D,eO=n((()=>{XD(),$D=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,t){let{agent:n,request:r}=await this._loadUtils(),i=await this._parameters.headers();return WD(r,this._parameters.url,i,this._parameters.compression,this._parameters.userAgent,n,e,t)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let t=new URL(this._parameters.url).protocol,[n,r]=await Promise.all([this._parameters.agentFactory(t),ZD(t)]);e=this._utils={agent:n,request:r}}return e}}}));function tO(){return 2*sO*Math.random()-sO}function nO(e){return new cO(e.transport)}var rO,iO,aO,oO,sO,cO,lO=n((()=>{c(),rO=5,iO=1e3,aO=5e3,oO=1.5,sO=.2,cO=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(t,n){let r=rO,i=iO,a=Date.now()+n,o=await this._transport.send(t,n);for(;o.status===`retryable`&&r>0;){r--;let n=Math.max(Math.min(i*(1+tO()),aO),0);i*=oO;let s=o.retryInMillis??n,c=a-Date.now();if(s>c)return e.info(`Export retry time ${Math.round(s)}ms exceeds remaining timeout ${Math.round(c)}ms, not retrying further.`),o;e.verbose(`Scheduling export retry in ${Math.round(s)}ms`),o=await this.retry(t,c,s)}return o.status===`success`?e.verbose(`Export succeeded after ${rO-r} retry attempts.`):o.status===`retryable`?e.info(`Export failed after maximum retry attempts (${rO}).`):e.info(`Export failed with non-retryable error: ${o.error}`),o}shutdown(){return this._transport.shutdown()}}}));function uO(e,t){return PE({transport:nO({transport:QD(e)}),serializer:t,promiseHandler:OE(e)},{timeout:e.timeoutMillis})}var dO=n((()=>{LE(),eO(),AE(),lO()}));function fO(t){let n=(0,_O.getNumberFromEnv)(t);if(n!=null){if(Number.isFinite(n)&&n>0)return n;e.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${n})`)}}function pO(e){let t=fO(`OTEL_EXPORTER_OTLP_${e}_TIMEOUT`),n=fO(`OTEL_EXPORTER_OTLP_TIMEOUT`);return t??n}function mO(t){let n=(0,_O.getStringFromEnv)(t)?.trim();if(n==null||n===`none`||n===`gzip`)return n;e.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${n}')`)}function hO(e){let t=mO(`OTEL_EXPORTER_OTLP_${e}_COMPRESSION`),n=mO(`OTEL_EXPORTER_OTLP_COMPRESSION`);return t??n}function gO(e){return{timeoutMillis:pO(e),compression:hO(e)}}var _O,vO=n((()=>{_O=q(),c()}));function yO(e){let t=(0,kO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_HEADERS`),n=(0,kO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_HEADERS`),r=(0,kO.parseKeyPairsIntoRecord)(t),i=(0,kO.parseKeyPairsIntoRecord)(n);if(!(Object.keys(r).length===0&&Object.keys(i).length===0))return Object.assign({},(0,kO.parseKeyPairsIntoRecord)(n),(0,kO.parseKeyPairsIntoRecord)(t))}function bO(t){try{return new URL(t).toString()}catch{e.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function xO(t,n){try{new URL(t)}catch{e.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith(`/`)||(t+=`/`),t+=n;try{new URL(t)}catch{e.warn(`Configuration: Provided URL appended with '${n}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function SO(e){let t=(0,kO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_ENDPOINT`);if(t!==void 0)return xO(t,e)}function CO(e){let t=(0,kO.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`);if(t!==void 0)return bO(t)}function wO(t,n,r){let i=(0,kO.getStringFromEnv)(t),a=(0,kO.getStringFromEnv)(n),o=i??a;if(o!=null)try{return ge.readFileSync(me.resolve(process.cwd(),o))}catch{e.warn(r);return}else return}function TO(e){return wO(`OTEL_EXPORTER_OTLP_${e}_CLIENT_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`,`Failed to read client certificate chain file`)}function EO(e){return wO(`OTEL_EXPORTER_OTLP_${e}_CLIENT_KEY`,`OTEL_EXPORTER_OTLP_CLIENT_KEY`,`Failed to read client certificate private key file`)}function DO(e){return wO(`OTEL_EXPORTER_OTLP_${e}_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CERTIFICATE`,`Failed to read root certificate file`)}function OO(e,t){return{...gO(e),url:CO(e)??SO(t),headers:SE(yO(e)),agentFactory:FD({keepAlive:!0,ca:DO(e),cert:TO(e),key:EO(e)})}}var kO,AO=n((()=>{kO=q(),c(),vO(),TE(),RD()}));function jO(e){return typeof e.headers==`function`?e.headers:SE(e.headers)}var MO=n((()=>{TE()}));function NO(e){if(typeof e.httpAgentOptions==`function`)return e.httpAgentOptions;let t=e.httpAgentOptions;if(e.keepAlive!=null&&(t={keepAlive:e.keepAlive,...t}),t!=null)return FD(t)}function PO(t,n,r,i){return t.metadata&&e.warn(`Metadata cannot be set when using http`),ID({url:t.url,headers:jO(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:NO(t),userAgent:t.userAgent},OO(n,r),LD(i,r))}var FO=n((()=>{c(),RD(),LO(),AO(),MO()})),IO=l({convertLegacyHttpOptions:()=>PO,createOtlpHttpExportDelegate:()=>uO,getSharedConfigurationFromEnvironment:()=>gO,httpAgentFactoryFromOptions:()=>FD}),LO=n((()=>{RD(),dO(),vO(),FO()})),RO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;let t=HE(),n=DD(),r=(LO(),i(IO));e.OTLPMetricExporter=class extends t.OTLPMetricExporterBase{constructor(e){super((0,r.createOtlpHttpExportDelegate)((0,r.convertLegacyHttpOptions)(e??{},`METRICS`,`v1/metrics`,{"Content-Type":`application/json`}),n.JsonMetricsSerializer),e)}}})),zO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=RO();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})})),BO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=zO();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})})),VO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporterBase=e.LowMemoryTemporalitySelector=e.DeltaTemporalitySelector=e.CumulativeTemporalitySelector=e.AggregationTemporalityPreference=e.OTLPMetricExporter=void 0;var t=BO();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}});var n=gE();Object.defineProperty(e,"AggregationTemporalityPreference",{enumerable:!0,get:function(){return n.AggregationTemporalityPreference}});var r=HE();Object.defineProperty(e,"CumulativeTemporalitySelector",{enumerable:!0,get:function(){return r.CumulativeTemporalitySelector}}),Object.defineProperty(e,"DeltaTemporalitySelector",{enumerable:!0,get:function(){return r.DeltaTemporalitySelector}}),Object.defineProperty(e,"LowMemoryTemporalitySelector",{enumerable:!0,get:function(){return r.LowMemoryTemporalitySelector}}),Object.defineProperty(e,"OTLPMetricExporterBase",{enumerable:!0,get:function(){return r.OTLPMetricExporterBase}})})),HO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`0.218.0`})),J=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=e.Propagate=e.LogVerbosity=e.Status=void 0;var t;(function(e){e[e.OK=0]=`OK`,e[e.CANCELLED=1]=`CANCELLED`,e[e.UNKNOWN=2]=`UNKNOWN`,e[e.INVALID_ARGUMENT=3]=`INVALID_ARGUMENT`,e[e.DEADLINE_EXCEEDED=4]=`DEADLINE_EXCEEDED`,e[e.NOT_FOUND=5]=`NOT_FOUND`,e[e.ALREADY_EXISTS=6]=`ALREADY_EXISTS`,e[e.PERMISSION_DENIED=7]=`PERMISSION_DENIED`,e[e.RESOURCE_EXHAUSTED=8]=`RESOURCE_EXHAUSTED`,e[e.FAILED_PRECONDITION=9]=`FAILED_PRECONDITION`,e[e.ABORTED=10]=`ABORTED`,e[e.OUT_OF_RANGE=11]=`OUT_OF_RANGE`,e[e.UNIMPLEMENTED=12]=`UNIMPLEMENTED`,e[e.INTERNAL=13]=`INTERNAL`,e[e.UNAVAILABLE=14]=`UNAVAILABLE`,e[e.DATA_LOSS=15]=`DATA_LOSS`,e[e.UNAUTHENTICATED=16]=`UNAUTHENTICATED`})(t||(e.Status=t={}));var n;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.INFO=1]=`INFO`,e[e.ERROR=2]=`ERROR`,e[e.NONE=3]=`NONE`})(n||(e.LogVerbosity=n={}));var r;(function(e){e[e.DEADLINE=1]=`DEADLINE`,e[e.CENSUS_STATS_CONTEXT=2]=`CENSUS_STATS_CONTEXT`,e[e.CENSUS_TRACING_CONTEXT=4]=`CENSUS_TRACING_CONTEXT`,e[e.CANCELLATION=8]=`CANCELLATION`,e[e.DEFAULTS=65535]=`DEFAULTS`})(r||(e.Propagate=r={})),e.DEFAULT_MAX_SEND_MESSAGE_LENGTH=-1,e.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH=4*1024*1024})),UO=t(((e,t)=>{t.exports={name:`@grpc/grpc-js`,version:`1.14.4`,description:`gRPC Library for Node - pure JS implementation`,homepage:`https://grpc.io/`,repository:`https://github.com/grpc/grpc-node/tree/master/packages/grpc-js`,main:`build/src/index.js`,engines:{node:`>=12.10.0`},keywords:[],author:{name:`Google Inc.`},types:`build/src/index.d.ts`,license:`Apache-2.0`,devDependencies:{"@grpc/proto-loader":`file:../proto-loader`,"@types/gulp":`^4.0.17`,"@types/gulp-mocha":`0.0.37`,"@types/lodash":`^4.14.202`,"@types/mocha":`^10.0.6`,"@types/ncp":`^2.0.8`,"@types/node":`>=20.11.20`,"@types/pify":`^5.0.4`,"@types/semver":`^7.5.8`,"@typescript-eslint/eslint-plugin":`^7.1.0`,"@typescript-eslint/parser":`^7.1.0`,"@typescript-eslint/typescript-estree":`^7.1.0`,"clang-format":`^1.8.0`,eslint:`^8.42.0`,"eslint-config-prettier":`^8.8.0`,"eslint-plugin-node":`^11.1.0`,"eslint-plugin-prettier":`^4.2.1`,execa:`^2.0.3`,gulp:`^4.0.2`,"gulp-mocha":`^6.0.0`,lodash:`^4.17.21`,madge:`^5.0.1`,"mocha-jenkins-reporter":`^0.4.1`,ncp:`^2.0.0`,pify:`^4.0.1`,prettier:`^2.8.8`,rimraf:`^3.0.2`,semver:`^7.6.0`,"ts-node":`^10.9.2`,typescript:`^5.3.3`},contributors:[{name:`Google Inc.`}],scripts:{build:`npm run compile`,clean:`rimraf ./build`,compile:`tsc -p .`,format:`clang-format -i -style="{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}" src/*.ts test/*.ts`,lint:`eslint src/*.ts test/*.ts`,prepare:`npm run copy-protos && npm run generate-types && npm run generate-test-types && npm run compile`,test:`gulp test`,check:`npm run lint`,fix:`eslint --fix src/*.ts test/*.ts`,pretest:`npm run generate-types && npm run generate-test-types && npm run compile`,posttest:`npm run check && madge -c ./build/src`,"generate-types":`proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs proto/ proto/xds/ proto/protoc-gen-validate/ -O src/generated/ --grpcLib ../index channelz.proto xds/service/orca/v3/orca.proto`,"generate-test-types":`proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --include-dirs test/fixtures/ -O test/generated/ --grpcLib ../../src/index test_service.proto echo_service.proto`,"copy-protos":`node ./copy-protos`},dependencies:{"@grpc/proto-loader":`^0.8.0`,"@js-sdsl/ordered-map":`^4.4.2`},files:[`src/**/*.ts`,`build/src/**/*.{js,d.ts,js.map}`,`proto/**/*.proto`,`proto/**/LICENSE`,`LICENSE`,`deps/envoy-api/envoy/api/v2/**/*.proto`,`deps/envoy-api/envoy/config/**/*.proto`,`deps/envoy-api/envoy/service/**/*.proto`,`deps/envoy-api/envoy/type/**/*.proto`,`deps/udpa/udpa/**/*.proto`,`deps/googleapis/google/api/*.proto`,`deps/googleapis/google/rpc/*.proto`,`deps/protoc-gen-validate/validate/**/*.proto`]}})),Y=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.setLoggerVerbosity=e.setLogger=e.getLogger=void 0,e.trace=d,e.isTracerEnabled=f;let t=J(),n=s(`process`),r=UO().version,i={error:(e,...t)=>{console.error(`E `+e,...t)},info:(e,...t)=>{console.error(`I `+e,...t)},debug:(e,...t)=>{console.error(`D `+e,...t)}},a=t.LogVerbosity.ERROR;switch((process.env.GRPC_NODE_VERBOSITY??process.env.GRPC_VERBOSITY??``).toUpperCase()){case`DEBUG`:a=t.LogVerbosity.DEBUG;break;case`INFO`:a=t.LogVerbosity.INFO;break;case`ERROR`:a=t.LogVerbosity.ERROR;break;case`NONE`:a=t.LogVerbosity.NONE;break;default:}e.getLogger=()=>i,e.setLogger=e=>{i=e},e.setLoggerVerbosity=e=>{a=e},e.log=(e,...n)=>{let r;if(e>=a){switch(e){case t.LogVerbosity.DEBUG:r=i.debug;break;case t.LogVerbosity.INFO:r=i.info;break;case t.LogVerbosity.ERROR:r=i.error;break}r||=i.error,r&&r.bind(i)(...n)}};let o=process.env.GRPC_NODE_TRACE??process.env.GRPC_TRACE??``,c=new Set,l=new Set;for(let e of o.split(`,`))e.startsWith(`-`)?l.add(e.substring(1)):c.add(e);let u=c.has(`all`);function d(t,i,a){f(i)&&(0,e.log)(t,new Date().toISOString()+` | v`+r+` `+n.pid+` | `+i+` | `+a)}function f(e){return!l.has(e)&&(u||c.has(e))}})),WO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorMessage=t,e.getErrorCode=n;function t(e){return e instanceof Error?e.message:String(e)}function n(e){return typeof e==`object`&&e&&`code`in e&&typeof e.code==`number`?e.code:null}})),X=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;let t=Y(),n=J(),r=WO(),i=/^[:0-9a-z_.-]+$/,a=/^[ -~]*$/;function o(e){return i.test(e)}function s(e){return a.test(e)}function c(e){return e.endsWith(`-bin`)}function l(e){return!e.startsWith(`grpc-`)}function u(e){return e.toLowerCase()}function d(e,t){if(!o(e))throw Error(`Metadata key "`+e+`" contains illegal characters`);if(t!=null)if(c(e)){if(!Buffer.isBuffer(t))throw Error(`keys that end with '-bin' must have Buffer values`)}else{if(Buffer.isBuffer(t))throw Error(`keys that don't end with '-bin' must have String values`);if(!s(t))throw Error(`Metadata string value "`+t+`" contains illegal characters`)}}e.Metadata=class e{constructor(e={}){this.internalRepr=new Map,this.opaqueData=new Map,this.options=e}set(e,t){e=u(e),d(e,t),this.internalRepr.set(e,[t])}add(e,t){e=u(e),d(e,t);let n=this.internalRepr.get(e);n===void 0?this.internalRepr.set(e,[t]):n.push(t)}remove(e){e=u(e),this.internalRepr.delete(e)}get(e){return e=u(e),this.internalRepr.get(e)||[]}getMap(){let e={};for(let[t,n]of this.internalRepr)if(n.length>0){let r=n[0];e[t]=Buffer.isBuffer(r)?Buffer.from(r):r}return e}clone(){let t=new e(this.options),n=t.internalRepr;for(let[e,t]of this.internalRepr){let r=t.map(e=>Buffer.isBuffer(e)?Buffer.from(e):e);n.set(e,r)}return t}merge(e){for(let[t,n]of e.internalRepr){let e=(this.internalRepr.get(t)||[]).concat(n);this.internalRepr.set(t,e)}}setOptions(e){this.options=e}getOptions(){return this.options}toHttp2Headers(){let e={};for(let[t,n]of this.internalRepr)t.startsWith(`:`)||(e[t]=n.map(f));return e}toJSON(){let e={};for(let[t,n]of this.internalRepr)e[t]=n;return e}setOpaque(e,t){this.opaqueData.set(e,t)}getOpaque(e){return this.opaqueData.get(e)}static fromHttp2Headers(i){let a=new e;for(let e of Object.keys(i)){if(e.charAt(0)===`:`)continue;let o=i[e];try{c(e)?Array.isArray(o)?o.forEach(t=>{a.add(e,Buffer.from(t,`base64`))}):o!==void 0&&(l(e)?o.split(`,`).forEach(t=>{a.add(e,Buffer.from(t.trim(),`base64`))}):a.add(e,Buffer.from(o,`base64`))):Array.isArray(o)?o.forEach(t=>{a.add(e,t)}):o!==void 0&&a.add(e,o)}catch(i){let a=`Failed to add metadata entry ${e}: ${o}. ${(0,r.getErrorMessage)(i)}. For more information see https://github.com/grpc/grpc-node/issues/1173`;(0,t.log)(n.LogVerbosity.ERROR,a)}}return a}};let f=e=>Buffer.isBuffer(e)?e.toString(`base64`):e})),GO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallCredentials=void 0;let t=X();function n(e){return`getRequestHeaders`in e&&typeof e.getRequestHeaders==`function`}var r=class e{static createFromMetadataGenerator(e){return new a(e)}static createFromGoogleCredential(r){return e.createFromMetadataGenerator((e,i)=>{let a;a=n(r)?r.getRequestHeaders(e.service_url):new Promise((t,n)=>{r.getRequestMetadata(e.service_url,(e,r)=>{if(e){n(e);return}if(!r){n(Error(`Headers not set by metadata plugin`));return}t(r)})}),a.then(e=>{let n=new t.Metadata;for(let t of Object.keys(e))n.add(t,e[t]);i(null,n)},e=>{i(e)})})}static createEmpty(){return new o}};e.CallCredentials=r;var i=class e extends r{constructor(e){super(),this.creds=e}async generateMetadata(e){let n=new t.Metadata,r=await Promise.all(this.creds.map(t=>t.generateMetadata(e)));for(let e of r)n.merge(e);return n}compose(t){return new e(this.creds.concat([t]))}_equals(t){return this===t?!0:t instanceof e?this.creds.every((e,n)=>e._equals(t.creds[n])):!1}},a=class e extends r{constructor(e){super(),this.metadataGenerator=e}generateMetadata(e){return new Promise((t,n)=>{this.metadataGenerator(e,(e,r)=>{r===void 0?n(e):t(r)})})}compose(e){return new i([this,e])}_equals(t){return this===t?!0:t instanceof e?this.metadataGenerator===t.metadataGenerator:!1}},o=class e extends r{generateMetadata(e){return Promise.resolve(new t.Metadata)}compose(e){return e}_equals(t){return t instanceof e}}})),KO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CIPHER_SUITES=void 0,e.getDefaultRootsData=i;let t=s(`fs`);e.CIPHER_SUITES=process.env.GRPC_SSL_CIPHER_SUITES;let n=process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH,r=null;function i(){return n?(r===null&&(r=t.readFileSync(n)),r):null}})),Z=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseUri=n,e.splitHostPort=i,e.combineHostPort=a,e.uriToString=o;let t=/^(?:([A-Za-z0-9+.-]+):)?(?:\/\/([^/]*)\/)?(.+)$/;function n(e){let n=t.exec(e);return n===null?null:{scheme:n[1],authority:n[2],path:n[3]}}let r=/^\d+$/;function i(e){if(e.startsWith(`[`)){let t=e.indexOf(`]`);if(t===-1)return null;let n=e.substring(1,t);if(n.indexOf(`:`)===-1)return null;if(e.length>t+1)if(e[t+1]===`:`){let i=e.substring(t+2);return r.test(i)?{host:n,port:+i}:null}else return null;else return{host:n}}else{let t=e.split(`:`);return t.length===2?r.test(t[1])?{host:t[0],port:+t[1]}:null:{host:e}}}function a(e){return e.port===void 0?e.host:e.host.includes(`:`)?`[${e.host}]:${e.port}`:`${e.host}:${e.port}`}function o(e){let t=``;return e.scheme!==void 0&&(t+=e.scheme+`:`),e.authority!==void 0&&(t+=`//`+e.authority+`/`),t+=e.path,t}})),qO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=void 0,e.registerResolver=i,e.registerDefaultScheme=a,e.createResolver=o,e.getDefaultAuthority=s,e.mapUriDefaultScheme=c;let t=Z();e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=`grpc.internal.config_selector`;let n={},r=null;function i(e,t){n[e]=t}function a(e){r=e}function o(e,r,i){if(e.scheme!==void 0&&e.scheme in n)return new n[e.scheme](e,r,i);throw Error(`No resolver could be created for target ${(0,t.uriToString)(e)}`)}function s(e){if(e.scheme!==void 0&&e.scheme in n)return n[e.scheme].getDefaultAuthority(e);throw Error(`Invalid target ${(0,t.uriToString)(e)}`)}function c(e){return e.scheme===void 0||!(e.scheme in n)?r===null?null:{scheme:r,authority:void 0,path:(0,t.uriToString)(e)}:e}})),JO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelCredentials=void 0,e.createCertificateProviderChannelCredentials=g;let t=s(`tls`),n=GO(),r=KO(),i=Z(),a=qO(),o=Y(),c=J();function l(e,t){if(e&&!(e instanceof Buffer))throw TypeError(`${t}, if provided, must be a Buffer.`)}var u=class{compose(e){return new _(this,e)}static createSsl(e,n,i,a){if(l(e,`Root certificate`),l(n,`Private key`),l(i,`Certificate chain`),n&&!i)throw Error(`Private key must be given with accompanying certificate chain`);if(!n&&i)throw Error(`Certificate chain must be given with accompanying private key`);return new m((0,t.createSecureContext)({ca:e??(0,r.getDefaultRootsData)()??void 0,key:n??void 0,cert:i??void 0,ciphers:r.CIPHER_SUITES}),a??{})}static createFromSecureContext(e,t){return new m(e,t??{})}static createInsecure(){return new d}};e.ChannelCredentials=u;var d=class e extends u{constructor(){super()}compose(e){throw Error(`Cannot compose insecure credentials`)}_isSecure(){return!1}_equals(t){return t instanceof e}_createSecureConnector(e,t,r){return{connect(e){return Promise.resolve({socket:e,secure:!1})},waitForReady:()=>Promise.resolve(),getCallCredentials:()=>r??n.CallCredentials.createEmpty(),destroy(){}}}};function f(e,n,r,o){let s={secureContext:e},c=r;if(`grpc.http_connect_target`in o){let e=(0,i.parseUri)(o[`grpc.http_connect_target`]);e&&(c=e)}let l=(0,a.getDefaultAuthority)(c),u=(0,i.splitHostPort)(l)?.host??l;if(s.host=u,n.checkServerIdentity&&(s.checkServerIdentity=n.checkServerIdentity),n.rejectUnauthorized!==void 0&&(s.rejectUnauthorized=n.rejectUnauthorized),s.ALPNProtocols=[`h2`],o[`grpc.ssl_target_name_override`]){let e=o[`grpc.ssl_target_name_override`],n=s.checkServerIdentity??t.checkServerIdentity;s.checkServerIdentity=(t,r)=>n(e,r),s.servername=e}else s.servername=u;return o[`grpc-node.tls_enable_trace`]&&(s.enableTrace=!0),s}var p=class{constructor(e,t){this.connectionOptions=e,this.callCredentials=t}connect(e){let n=Object.assign({socket:e},this.connectionOptions);return new Promise((e,r)=>{let i=(0,t.connect)(n,()=>{if((this.connectionOptions.rejectUnauthorized??!0)&&!i.authorized){r(i.authorizationError);return}e({socket:i,secure:!0})});i.on(`error`,e=>{r(e)})})}waitForReady(){return Promise.resolve()}getCallCredentials(){return this.callCredentials}destroy(){}},m=class e extends u{constructor(e,t){super(),this.secureContext=e,this.verifyOptions=t}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.secureContext===t.secureContext&&this.verifyOptions.checkServerIdentity===t.verifyOptions.checkServerIdentity:!1}_createSecureConnector(e,t,r){return new p(f(this.secureContext,this.verifyOptions,e,t),r??n.CallCredentials.createEmpty())}},h=class e extends u{constructor(e,t,n){super(),this.caCertificateProvider=e,this.identityCertificateProvider=t,this.verifyOptions=n,this.refcount=0,this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this),this.secureContextWatchers=[]}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&this.verifyOptions?.checkServerIdentity===t.verifyOptions?.checkServerIdentity:!1}ref(){var e;this.refcount===0&&(this.caCertificateProvider.addCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)==null||e.addIdentityCertificateListener(this.identityCertificateUpdateListener)),this.refcount+=1}unref(){var e;--this.refcount,this.refcount===0&&(this.caCertificateProvider.removeCaCertificateListener(this.caCertificateUpdateListener),(e=this.identityCertificateProvider)==null||e.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_createSecureConnector(t,r,i){return this.ref(),new e.SecureConnectorImpl(this,t,r,i??n.CallCredentials.createEmpty())}maybeUpdateWatchers(){if(this.hasReceivedUpdates()){for(let e of this.secureContextWatchers)e(this.getLatestSecureContext());this.secureContextWatchers=[]}}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.maybeUpdateWatchers()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.maybeUpdateWatchers()}hasReceivedUpdates(){return!(this.latestCaUpdate===void 0||this.identityCertificateProvider&&this.latestIdentityUpdate===void 0)}getSecureContext(){return this.hasReceivedUpdates()?Promise.resolve(this.getLatestSecureContext()):new Promise(e=>{this.secureContextWatchers.push(e)})}getLatestSecureContext(){if(!this.latestCaUpdate||this.identityCertificateProvider!==null&&!this.latestIdentityUpdate)return null;try{return(0,t.createSecureContext)({ca:this.latestCaUpdate.caCertificate,key:this.latestIdentityUpdate?.privateKey,cert:this.latestIdentityUpdate?.certificate,ciphers:r.CIPHER_SUITES})}catch(e){return(0,o.log)(c.LogVerbosity.ERROR,`Failed to createSecureContext with error `+e.message),null}}};h.SecureConnectorImpl=class{constructor(e,t,n,r){this.parent=e,this.channelTarget=t,this.options=n,this.callCredentials=r}connect(e){return new Promise((n,r)=>{let i=this.parent.getLatestSecureContext();if(!i){r(Error(`Failed to load credentials`));return}e.closed&&r(Error(`Socket closed while loading credentials`));let a=f(i,this.parent.verifyOptions,this.channelTarget,this.options),o=Object.assign({socket:e},a),s=()=>{r(Error(`Socket closed`))},c=e=>{r(e)},l=(0,t.connect)(o,()=>{if(l.removeListener(`close`,s),l.removeListener(`error`,c),(this.parent.verifyOptions.rejectUnauthorized??!0)&&!l.authorized){r(l.authorizationError);return}n({socket:l,secure:!0})});l.once(`close`,s),l.once(`error`,c)})}async waitForReady(){await this.parent.getSecureContext()}getCallCredentials(){return this.callCredentials}destroy(){this.parent.unref()}};function g(e,t,n){return new h(e,t,n??{})}var _=class e extends u{constructor(e,t){if(super(),this.channelCredentials=e,this.callCredentials=t,!e._isSecure())throw Error(`Cannot compose insecure credentials`)}compose(t){let n=this.callCredentials.compose(t);return new e(this.channelCredentials,n)}_isSecure(){return!0}_equals(t){return this===t?!0:t instanceof e?this.channelCredentials._equals(t.channelCredentials)&&this.callCredentials._equals(t.callCredentials):!1}_createSecureConnector(e,t,r){let i=this.callCredentials.compose(r??n.CallCredentials.createEmpty());return this.channelCredentials._createSecureConnector(e,t,i)}}})),YO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createChildChannelControlHelper=r,e.registerLoadBalancerType=o,e.registerDefaultLoadBalancerType=s,e.createLoadBalancer=c,e.isLoadBalancerNameRegistered=l,e.parseLoadBalancingConfig=u,e.getDefaultConfig=d,e.selectLbConfigFromList=f;let t=Y(),n=J();function r(e,t){return{createSubchannel:t.createSubchannel?.bind(t)??e.createSubchannel.bind(e),updateState:t.updateState?.bind(t)??e.updateState.bind(e),requestReresolution:t.requestReresolution?.bind(t)??e.requestReresolution.bind(e),addChannelzChild:t.addChannelzChild?.bind(t)??e.addChannelzChild.bind(e),removeChannelzChild:t.removeChannelzChild?.bind(t)??e.removeChannelzChild.bind(e)}}let i={},a=null;function o(e,t,n){i[e]={LoadBalancer:t,LoadBalancingConfig:n}}function s(e){a=e}function c(e,t){let n=e.getLoadBalancerName();return n in i?new i[n].LoadBalancer(t):null}function l(e){return e in i}function u(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Provided load balancing config has multiple conflicting entries`);let n=t[0];if(n in i)try{return i[n].LoadBalancingConfig.createFromJson(e[n])}catch(e){throw Error(`${n}: ${e.message}`)}else throw Error(`Unrecognized load balancing config name ${n}`)}function d(){if(!a)throw Error(`No default load balancer type registered`);return new i[a].LoadBalancingConfig}function f(e,r=!1){for(let r of e)try{return u(r)}catch(e){(0,t.log)(n.LogVerbosity.DEBUG,`Config parsing failed with error`,e.message);continue}return r&&a?new i[a].LoadBalancingConfig:null}})),XO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateRetryThrottling=l,e.validateServiceConfig=d,e.extractAndSelectServiceConfig=m;let t=s(`os`),n=J(),r=/^\d+(\.\d{1,9})?s$/;function i(e){if(`service`in e&&e.service!==``){if(typeof e.service!=`string`)throw Error(`Invalid method config name: invalid service: expected type string, got ${typeof e.service}`);if(`method`in e&&e.method!==``){if(typeof e.method!=`string`)throw Error(`Invalid method config name: invalid method: expected type string, got ${typeof e.service}`);return{service:e.service,method:e.method}}else return{service:e.service}}else{if(`method`in e&&e.method!==void 0)throw Error(`Invalid method config name: method set with empty or unset service`);return{}}}function a(e){if(!(`maxAttempts`in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw Error(`Invalid method config retry policy: maxAttempts must be an integer at least 2`);if(!(`initialBackoff`in e)||typeof e.initialBackoff!=`string`||!r.test(e.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 e)||typeof e.maxBackoff!=`string`||!r.test(e.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 e)||typeof e.backoffMultiplier!=`number`||e.backoffMultiplier<=0)throw Error(`Invalid method config retry policy: backoffMultiplier must be a number greater than 0`);if(!(`retryableStatusCodes`in e&&Array.isArray(e.retryableStatusCodes)))throw Error(`Invalid method config retry policy: retryableStatusCodes is required`);if(e.retryableStatusCodes.length===0)throw Error(`Invalid method config retry policy: retryableStatusCodes must be non-empty`);for(let t of e.retryableStatusCodes)if(typeof t==`number`){if(!Object.values(n.Status).includes(t))throw Error(`Invalid method config retry policy: retryableStatusCodes value not in status code range`)}else if(typeof t==`string`){if(!Object.values(n.Status).includes(t.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:e.maxAttempts,initialBackoff:e.initialBackoff,maxBackoff:e.maxBackoff,backoffMultiplier:e.backoffMultiplier,retryableStatusCodes:e.retryableStatusCodes}}function o(e){if(!(`maxAttempts`in e)||!Number.isInteger(e.maxAttempts)||e.maxAttempts<2)throw Error(`Invalid method config hedging policy: maxAttempts must be an integer at least 2`);if(`hedgingDelay`in e&&(typeof e.hedgingDelay!=`string`||!r.test(e.hedgingDelay)))throw Error(`Invalid method config hedging policy: hedgingDelay must be a string consisting of a positive integer followed by s`);if(`nonFatalStatusCodes`in e&&Array.isArray(e.nonFatalStatusCodes))for(let t of e.nonFatalStatusCodes)if(typeof t==`number`){if(!Object.values(n.Status).includes(t))throw Error(`Invalid method config hedging policy: nonFatalStatusCodes value not in status code range`)}else if(typeof t==`string`){if(!Object.values(n.Status).includes(t.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 t={maxAttempts:e.maxAttempts};return e.hedgingDelay&&(t.hedgingDelay=e.hedgingDelay),e.nonFatalStatusCodes&&(t.nonFatalStatusCodes=e.nonFatalStatusCodes),t}function c(e){let t={name:[]};if(!(`name`in e)||!Array.isArray(e.name))throw Error(`Invalid method config: invalid name array`);for(let n of e.name)t.name.push(i(n));if(`waitForReady`in e){if(typeof e.waitForReady!=`boolean`)throw Error(`Invalid method config: invalid waitForReady`);t.waitForReady=e.waitForReady}if(`timeout`in e)if(typeof e.timeout==`object`){if(!(`seconds`in e.timeout)||typeof e.timeout.seconds!=`number`)throw Error(`Invalid method config: invalid timeout.seconds`);if(!(`nanos`in e.timeout)||typeof e.timeout.nanos!=`number`)throw Error(`Invalid method config: invalid timeout.nanos`);t.timeout=e.timeout}else if(typeof e.timeout==`string`&&r.test(e.timeout)){let n=e.timeout.substring(0,e.timeout.length-1).split(`.`);t.timeout={seconds:n[0]|0,nanos:(n[1]??0)|0}}else throw Error(`Invalid method config: invalid timeout`);if(`maxRequestBytes`in e){if(typeof e.maxRequestBytes!=`number`)throw Error(`Invalid method config: invalid maxRequestBytes`);t.maxRequestBytes=e.maxRequestBytes}if(`maxResponseBytes`in e){if(typeof e.maxResponseBytes!=`number`)throw Error(`Invalid method config: invalid maxRequestBytes`);t.maxResponseBytes=e.maxResponseBytes}if(`retryPolicy`in e){if(`hedgingPolicy`in e)throw Error(`Invalid method config: retryPolicy and hedgingPolicy cannot both be specified`);t.retryPolicy=a(e.retryPolicy)}else`hedgingPolicy`in e&&(t.hedgingPolicy=o(e.hedgingPolicy));return t}function l(e){if(!(`maxTokens`in e)||typeof e.maxTokens!=`number`||e.maxTokens<=0||e.maxTokens>1e3)throw Error(`Invalid retryThrottling: maxTokens must be a number in (0, 1000]`);if(!(`tokenRatio`in e)||typeof e.tokenRatio!=`number`||e.tokenRatio<=0)throw Error(`Invalid retryThrottling: tokenRatio must be a number greater than 0`);return{maxTokens:+e.maxTokens.toFixed(3),tokenRatio:+e.tokenRatio.toFixed(3)}}function u(e){if(!(typeof e==`object`&&e))throw Error(`Invalid loadBalancingConfig: unexpected type ${typeof e}`);let t=Object.keys(e);if(t.length>1)throw Error(`Invalid loadBalancingConfig: unexpected multiple keys ${t}`);if(t.length===0)throw Error(`Invalid loadBalancingConfig: load balancing policy name required`);return{[t[0]]:e[t[0]]}}function d(e){let t={loadBalancingConfig:[],methodConfig:[]};if(`loadBalancingPolicy`in e)if(typeof e.loadBalancingPolicy==`string`)t.loadBalancingPolicy=e.loadBalancingPolicy;else throw Error(`Invalid service config: invalid loadBalancingPolicy`);if(`loadBalancingConfig`in e)if(Array.isArray(e.loadBalancingConfig))for(let n of e.loadBalancingConfig)t.loadBalancingConfig.push(u(n));else throw Error(`Invalid service config: invalid loadBalancingConfig`);if(`methodConfig`in e&&Array.isArray(e.methodConfig))for(let n of e.methodConfig)t.methodConfig.push(c(n));`retryThrottling`in e&&(t.retryThrottling=l(e.retryThrottling));let n=[];for(let e of t.methodConfig)for(let t of e.name){for(let e of n)if(t.service===e.service&&t.method===e.method)throw Error(`Invalid service config: duplicate name ${t.service}/${t.method}`);n.push(t)}return t}function f(e){if(!(`serviceConfig`in e))throw Error(`Invalid service config choice: missing service config`);let t={serviceConfig:d(e.serviceConfig)};if(`clientLanguage`in e)if(Array.isArray(e.clientLanguage)){t.clientLanguage=[];for(let n of e.clientLanguage)if(typeof n==`string`)t.clientLanguage.push(n);else throw Error(`Invalid service config choice: invalid clientLanguage`)}else throw Error(`Invalid service config choice: invalid clientLanguage`);if(`clientHostname`in e)if(Array.isArray(e.clientHostname)){t.clientHostname=[];for(let n of e.clientHostname)if(typeof n==`string`)t.clientHostname.push(n);else throw Error(`Invalid service config choice: invalid clientHostname`)}else throw Error(`Invalid service config choice: invalid clientHostname`);if(`percentage`in e)if(typeof e.percentage==`number`&&0<=e.percentage&&e.percentage<=100)t.percentage=e.percentage;else throw Error(`Invalid service config choice: invalid percentage`);let n=[`clientLanguage`,`percentage`,`clientHostname`,`serviceConfig`];for(let t in e)if(!n.includes(t))throw Error(`Invalid service config choice: unexpected field ${t}`);return t}function p(e,n){if(!Array.isArray(e))throw Error(`Invalid service config list`);for(let r of e){let e=f(r);if(!(typeof e.percentage==`number`&&n>e.percentage)){if(Array.isArray(e.clientHostname)){let n=!1;for(let r of e.clientHostname)r===t.hostname()&&(n=!0);if(!n)continue}if(Array.isArray(e.clientLanguage)){let t=!1;for(let n of e.clientLanguage)n===`node`&&(t=!0);if(!t)continue}return e.serviceConfig}}throw Error(`No matching service config found`)}function m(e,t){for(let n of e)if(n.length>0&&n[0].startsWith(`grpc_config=`)){let e=n.join(``).substring(12);return p(JSON.parse(e),t)}return null}})),ZO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectivityState=void 0;var t;(function(e){e[e.IDLE=0]=`IDLE`,e[e.CONNECTING=1]=`CONNECTING`,e[e.READY=2]=`READY`,e[e.TRANSIENT_FAILURE=3]=`TRANSIENT_FAILURE`,e[e.SHUTDOWN=4]=`SHUTDOWN`})(t||(e.ConnectivityState=t={}))})),QO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.QueuePicker=e.UnavailablePicker=e.PickResultType=void 0;let t=X(),n=J();var r;(function(e){e[e.COMPLETE=0]=`COMPLETE`,e[e.QUEUE=1]=`QUEUE`,e[e.TRANSIENT_FAILURE=2]=`TRANSIENT_FAILURE`,e[e.DROP=3]=`DROP`})(r||(e.PickResultType=r={})),e.UnavailablePicker=class{constructor(e){this.status=Object.assign({code:n.Status.UNAVAILABLE,details:`No connection established`,metadata:new t.Metadata},e)}pick(e){return{pickResultType:r.TRANSIENT_FAILURE,subchannel:null,status:this.status,onCallStarted:null,onCallEnded:null}}},e.QueuePicker=class{constructor(e,t){this.loadBalancer=e,this.childPicker=t,this.calledExitIdle=!1}pick(e){return this.calledExitIdle||=(process.nextTick(()=>{this.loadBalancer.exitIdle()}),!0),this.childPicker?this.childPicker.pick(e):{pickResultType:r.QUEUE,subchannel:null,status:null,onCallStarted:null,onCallEnded:null}}}})),$O=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BackoffTimeout=void 0;let t=J(),n=Y();function r(e,t){return Math.random()*(t-e)+e}var i=class e{constructor(t,n){this.callback=t,this.initialDelay=1e3,this.multiplier=1.6,this.maxDelay=12e4,this.jitter=.2,this.running=!1,this.hasRef=!0,this.startTime=new Date,this.endTime=new Date,this.id=e.getNextId(),n&&(n.initialDelay&&(this.initialDelay=n.initialDelay),n.multiplier&&(this.multiplier=n.multiplier),n.jitter&&(this.jitter=n.jitter),n.maxDelay&&(this.maxDelay=n.maxDelay)),this.trace(`constructed initialDelay=`+this.initialDelay+` multiplier=`+this.multiplier+` jitter=`+this.jitter+` maxDelay=`+this.maxDelay),this.nextDelay=this.initialDelay,this.timerId=setTimeout(()=>{},0),clearTimeout(this.timerId)}static getNextId(){return this.nextId++}trace(e){n.trace(t.LogVerbosity.DEBUG,`backoff`,`{`+this.id+`} `+e)}runTimer(e){var t,n;this.trace(`runTimer(delay=`+e+`)`),this.endTime=this.startTime,this.endTime.setMilliseconds(this.endTime.getMilliseconds()+e),clearTimeout(this.timerId),this.timerId=setTimeout(()=>{this.trace(`timer fired`),this.running=!1,this.callback()},e),this.hasRef||(n=(t=this.timerId).unref)==null||n.call(t)}runOnce(){this.trace(`runOnce()`),this.running=!0,this.startTime=new Date,this.runTimer(this.nextDelay);let e=Math.min(this.nextDelay*this.multiplier,this.maxDelay),t=e*this.jitter;this.nextDelay=e+r(-t,t)}stop(){this.trace(`stop()`),clearTimeout(this.timerId),this.running=!1}reset(){if(this.trace(`reset() running=`+this.running),this.nextDelay=this.initialDelay,this.running){let e=new Date,t=this.startTime;t.setMilliseconds(t.getMilliseconds()+this.nextDelay),clearTimeout(this.timerId),e<t?this.runTimer(t.getTime()-e.getTime()):this.running=!1}}isRunning(){return this.running}ref(){var e,t;this.hasRef=!0,(t=(e=this.timerId).ref)==null||t.call(e)}unref(){var e,t;this.hasRef=!1,(t=(e=this.timerId).unref)==null||t.call(e)}getEndTime(){return this.endTime}};e.BackoffTimeout=i,i.nextId=0})),ek=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChildLoadBalancerHandler=void 0;let t=YO(),n=ZO();e.ChildLoadBalancerHandler=class{constructor(e){this.channelControlHelper=e,this.currentChild=null,this.pendingChild=null,this.latestConfig=null,this.ChildPolicyHelper=class{constructor(e){this.parent=e,this.child=null}createSubchannel(e,t){return this.parent.channelControlHelper.createSubchannel(e,t)}updateState(e,t,r){var i;if(this.calledByPendingChild()){if(e===n.ConnectivityState.CONNECTING)return;(i=this.parent.currentChild)==null||i.destroy(),this.parent.currentChild=this.parent.pendingChild,this.parent.pendingChild=null}else if(!this.calledByCurrentChild())return;this.parent.channelControlHelper.updateState(e,t,r)}requestReresolution(){let e=this.parent.pendingChild??this.parent.currentChild;this.child===e&&this.parent.channelControlHelper.requestReresolution()}setChild(e){this.child=e}addChannelzChild(e){this.parent.channelControlHelper.addChannelzChild(e)}removeChannelzChild(e){this.parent.channelControlHelper.removeChannelzChild(e)}calledByPendingChild(){return this.child===this.parent.pendingChild}calledByCurrentChild(){return this.child===this.parent.currentChild}}}configUpdateRequiresNewPolicyInstance(e,t){return e.getLoadBalancerName()!==t.getLoadBalancerName()}updateAddressList(e,n,r,i){let a;if(this.currentChild===null||this.latestConfig===null||this.configUpdateRequiresNewPolicyInstance(this.latestConfig,n)){let e=new this.ChildPolicyHelper(this),r=(0,t.createLoadBalancer)(n,e);e.setChild(r),this.currentChild===null?(this.currentChild=r,a=this.currentChild):(this.pendingChild&&this.pendingChild.destroy(),this.pendingChild=r,a=this.pendingChild)}else a=this.pendingChild===null?this.currentChild:this.pendingChild;return this.latestConfig=n,a.updateAddressList(e,n,r,i)}exitIdle(){this.currentChild&&(this.currentChild.exitIdle(),this.pendingChild&&this.pendingChild.exitIdle())}resetBackoff(){this.currentChild&&(this.currentChild.resetBackoff(),this.pendingChild&&this.pendingChild.resetBackoff())}destroy(){this.currentChild&&=(this.currentChild.destroy(),null),this.pendingChild&&=(this.pendingChild.destroy(),null)}getTypeName(){return`child_load_balancer_helper`}}})),tk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ResolvingLoadBalancer=void 0;let t=YO(),n=XO(),r=ZO(),i=qO(),a=QO(),o=$O(),s=J(),c=X(),l=Y(),u=J(),d=Z(),f=ek();function p(e){l.trace(u.LogVerbosity.DEBUG,`resolving_load_balancer`,e)}let m=[`SERVICE_AND_METHOD`,`SERVICE`,`EMPTY`];function h(e,t,n,r){for(let i of n.name)switch(r){case`EMPTY`:if(!i.service&&!i.method)return!0;break;case`SERVICE`:if(i.service===e&&!i.method)return!0;break;case`SERVICE_AND_METHOD`:if(i.service===e&&i.method===t)return!0}return!1}function g(e,t,n,r){for(let i of n)if(h(e,t,i,r))return i;return null}function _(e){return{invoke(t,n){let r=t.split(`/`).filter(e=>e.length>0),i=r[0]??``,a=r[1]??``;if(e&&e.methodConfig)for(let t of m){let n=g(i,a,e.methodConfig,t);if(n)return{methodConfig:n,pickInformation:{},status:s.Status.OK,dynamicFilterFactories:[]}}return{methodConfig:{name:[]},pickInformation:{},status:s.Status.OK,dynamicFilterFactories:[]}},unref(){}}}e.ResolvingLoadBalancer=class{constructor(e,t,s,c,l){this.target=e,this.channelControlHelper=t,this.channelOptions=s,this.onSuccessfulResolution=c,this.onFailedResolution=l,this.latestChildState=r.ConnectivityState.IDLE,this.latestChildPicker=new a.QueuePicker(this),this.latestChildErrorMessage=null,this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1,s[`grpc.service_config`]?this.defaultServiceConfig=(0,n.validateServiceConfig)(JSON.parse(s[`grpc.service_config`])):this.defaultServiceConfig={loadBalancingConfig:[],methodConfig:[]},this.updateState(r.ConnectivityState.IDLE,new a.QueuePicker(this),null),this.childLoadBalancer=new f.ChildLoadBalancerHandler({createSubchannel:t.createSubchannel.bind(t),requestReresolution:()=>{this.backoffTimeout.isRunning()?(p(`requestReresolution delayed by backoff timer until `+this.backoffTimeout.getEndTime().toISOString()),this.continueResolving=!0):this.updateResolution()},updateState:(e,t,n)=>{this.latestChildState=e,this.latestChildPicker=t,this.latestChildErrorMessage=n,this.updateState(e,t,n)},addChannelzChild:t.addChannelzChild.bind(t),removeChannelzChild:t.removeChannelzChild.bind(t)}),this.innerResolver=(0,i.createResolver)(e,this.handleResolverResult.bind(this),s);let u={initialDelay:s[`grpc.initial_reconnect_backoff_ms`],maxDelay:s[`grpc.max_reconnect_backoff_ms`]};this.backoffTimeout=new o.BackoffTimeout(()=>{this.continueResolving?(this.updateResolution(),this.continueResolving=!1):this.updateState(this.latestChildState,this.latestChildPicker,this.latestChildErrorMessage)},u),this.backoffTimeout.unref()}handleResolverResult(e,n,r,a){this.backoffTimeout.stop(),this.backoffTimeout.reset();let o=!0,l=null;if(r===null?l=this.defaultServiceConfig:r.ok?l=r.value:this.previousServiceConfig===null?(o=!1,this.handleResolutionFailure(r.error)):l=this.previousServiceConfig,l!==null){let r=l?.loadBalancingConfig??[],i=(0,t.selectLbConfigFromList)(r,!0);i===null?(o=!1,this.handleResolutionFailure({code:s.Status.UNAVAILABLE,details:`All load balancer options in service config are not compatible`,metadata:new c.Metadata})):o=this.childLoadBalancer.updateAddressList(e,i,Object.assign(Object.assign({},this.channelOptions),n),a)}return o&&this.onSuccessfulResolution(l,n[i.CHANNEL_ARGS_CONFIG_SELECTOR_KEY]??_(l)),o}updateResolution(){this.innerResolver.updateResolution(),this.currentState===r.ConnectivityState.IDLE&&this.updateState(r.ConnectivityState.CONNECTING,this.latestChildPicker,this.latestChildErrorMessage),this.backoffTimeout.runOnce()}updateState(e,t,n){p((0,d.uriToString)(this.target)+` `+r.ConnectivityState[this.currentState]+` -> `+r.ConnectivityState[e]),e===r.ConnectivityState.IDLE&&(t=new a.QueuePicker(this,t)),this.currentState=e,this.channelControlHelper.updateState(e,t,n)}handleResolutionFailure(e){this.latestChildState===r.ConnectivityState.IDLE&&(this.updateState(r.ConnectivityState.TRANSIENT_FAILURE,new a.UnavailablePicker(e),e.details),this.onFailedResolution(e))}exitIdle(){(this.currentState===r.ConnectivityState.IDLE||this.currentState===r.ConnectivityState.TRANSIENT_FAILURE)&&(this.backoffTimeout.isRunning()?this.continueResolving=!0:this.updateResolution()),this.childLoadBalancer.exitIdle()}updateAddressList(e,t){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=r.ConnectivityState.IDLE,this.latestChildPicker=new a.QueuePicker(this),this.currentState=r.ConnectivityState.IDLE,this.previousServiceConfig=null,this.continueResolving=!1}getTypeName(){return`resolving_load_balancer`}}})),nk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.recognizedOptions=void 0,e.channelOptionsEqual=t,e.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 t(e,t){let n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i+=1)if(n[i]!==r[i]||e[n[i]]!==t[r[i]])return!1;return!0}})),rk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EndpointMap=void 0,e.isTcpSubchannelAddress=n,e.subchannelAddressEqual=r,e.subchannelAddressToString=i,e.stringToSubchannelAddress=a,e.endpointEqual=o,e.endpointToString=c,e.endpointHasAddress=l;let t=s(`net`);function n(e){return`port`in e}function r(e,t){return!e&&!t?!0:!e||!t?!1:n(e)?n(t)&&e.host===t.host&&e.port===t.port:!n(t)&&e.path===t.path}function i(e){return n(e)?(0,t.isIPv6)(e.host)?`[`+e.host+`]:`+e.port:e.host+`:`+e.port:e.path}function a(e,n){return(0,t.isIP)(e)?{host:e,port:n??443}:{path:e}}function o(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n=0;n<e.addresses.length;n++)if(!r(e.addresses[n],t.addresses[n]))return!1;return!0}function c(e){return`[`+e.addresses.map(i).join(`, `)+`]`}function l(e,t){for(let n of e.addresses)if(r(n,t))return!0;return!1}function u(e,t){if(e.addresses.length!==t.addresses.length)return!1;for(let n of e.addresses){let e=!1;for(let i of t.addresses)if(r(n,i)){e=!0;break}if(!e)return!1}return!0}e.EndpointMap=class{constructor(){this.map=new Set}get size(){return this.map.size}getForSubchannelAddress(e){for(let t of this.map)if(l(t.key,e))return t.value}deleteMissing(e){let t=[];for(let n of this.map){let r=!1;for(let t of e)u(t,n.key)&&(r=!0);r||(t.push(n.value),this.map.delete(n))}return t}get(e){for(let t of this.map)if(u(e,t.key))return t.value}set(e,t){for(let n of this.map)if(u(e,n.key)){n.value=t;return}this.map.add({key:e,value:t})}delete(e){for(let t of this.map)if(u(e,t.key)){this.map.delete(t);return}}has(e){for(let t of this.map)if(u(e,t.key))return!0;return!1}clear(){this.map.clear()}*keys(){for(let e of this.map)yield e.key}*values(){for(let e of this.map)yield e.value}*entries(){for(let e of this.map)yield[e.key,e.value]}}})),ik=t((e=>{Object.defineProperty(e,"t",{value:!0});var t=class{constructor(e,t,n=1){this.i=void 0,this.h=void 0,this.o=void 0,this.u=e,this.l=t,this.p=n}I(){let e=this,t=e.o.o===e;if(t&&e.p===1)e=e.h;else if(e.i)for(e=e.i;e.h;)e=e.h;else{if(t)return e.o;let n=e.o;for(;n.i===e;)e=n,n=e.o;e=n}return e}B(){let e=this;if(e.h){for(e=e.h;e.i;)e=e.i;return e}else{let t=e.o;for(;t.h===e;)e=t,t=e.o;return e.h===t?e:t}}_(){let e=this.o,t=this.h,n=t.i;return e.o===this?e.o=t:e.i===this?e.i=t:e.h=t,t.o=e,t.i=this,this.o=t,this.h=n,n&&(n.o=this),t}g(){let e=this.o,t=this.i,n=t.h;return e.o===this?e.o=t:e.i===this?e.i=t:e.h=t,t.o=e,t.h=this,this.o=t,this.i=n,n&&(n.o=this),t}},n=class extends t{constructor(){super(...arguments),this.M=1}_(){let e=super._();return this.O(),e.O(),e}g(){let e=super.g();return this.O(),e.O(),e}O(){this.M=1,this.i&&(this.M+=this.i.M),this.h&&(this.M+=this.h.M)}},r=class{constructor(e=0){this.iteratorType=e}equals(e){return this.T===e.T}},i=class{constructor(){this.m=0}get length(){return this.m}size(){return this.m}empty(){return this.m===0}},a=class extends i{};function o(){throw RangeError(`Iterator access denied!`)}var s=class extends a{constructor(e=function(e,t){return e<t?-1:+(e>t)},r=!1){super(),this.v=void 0,this.A=e,this.enableIndex=r,this.N=r?n:t,this.C=new this.N}R(e,t){let n=this.C;for(;e;){let r=this.A(e.u,t);if(r<0)e=e.h;else if(r>0)n=e,e=e.i;else return e}return n}K(e,t){let n=this.C;for(;e;)this.A(e.u,t)<=0?e=e.h:(n=e,e=e.i);return n}L(e,t){let n=this.C;for(;e;){let r=this.A(e.u,t);if(r<0)n=e,e=e.h;else if(r>0)e=e.i;else return e}return n}k(e,t){let n=this.C;for(;e;)this.A(e.u,t)<0?(n=e,e=e.h):e=e.i;return n}P(e){for(;;){let t=e.o;if(t===this.C)return;if(e.p===1){e.p=0;return}if(e===t.i){let n=t.h;if(n.p===1)n.p=0,t.p=1,t===this.v?this.v=t._():t._();else if(n.h&&n.h.p===1){n.p=t.p,t.p=0,n.h.p=0,t===this.v?this.v=t._():t._();return}else n.i&&n.i.p===1?(n.p=1,n.i.p=0,n.g()):(n.p=1,e=t)}else{let n=t.i;if(n.p===1)n.p=0,t.p=1,t===this.v?this.v=t.g():t.g();else if(n.i&&n.i.p===1){n.p=t.p,t.p=0,n.i.p=0,t===this.v?this.v=t.g():t.g();return}else n.h&&n.h.p===1?(n.p=1,n.h.p=0,n._()):(n.p=1,e=t)}}}S(e){if(this.m===1){this.clear();return}let t=e;for(;t.i||t.h;){if(t.h)for(t=t.h;t.i;)t=t.i;else t=t.i;let n=e.u;e.u=t.u,t.u=n;let r=e.l;e.l=t.l,t.l=r,e=t}this.C.i===t?this.C.i=t.o:this.C.h===t&&(this.C.h=t.o),this.P(t);let n=t.o;if(t===n.i?n.i=void 0:n.h=void 0,--this.m,this.v.p=0,this.enableIndex)for(;n!==this.C;)--n.M,n=n.o}U(e){let t=typeof e==`number`?e:void 0,n=typeof e==`function`?e:void 0,r=e===void 0?[]:void 0,i=0,a=this.v,o=[];for(;o.length||a;)if(a)o.push(a),a=a.i;else{if(a=o.pop(),i===t)return a;r&&r.push(a),n&&n(a,i,this),i+=1,a=a.h}return r}j(e){for(;;){let t=e.o;if(t.p===0)return;let n=t.o;if(t===n.i){let r=n.h;if(r&&r.p===1){if(r.p=t.p=0,n===this.v)return;n.p=1,e=n;continue}else if(e===t.h){if(e.p=0,e.i&&(e.i.o=t),e.h&&(e.h.o=n),t.h=e.i,n.i=e.h,e.i=t,e.h=n,n===this.v)this.v=e,this.C.o=e;else{let t=n.o;t.i===n?t.i=e:t.h=e}e.o=n.o,t.o=e,n.o=e,n.p=1}else{t.p=0,n===this.v?this.v=n.g():n.g(),n.p=1;return}}else{let r=n.i;if(r&&r.p===1){if(r.p=t.p=0,n===this.v)return;n.p=1,e=n;continue}else if(e===t.i){if(e.p=0,e.i&&(e.i.o=n),e.h&&(e.h.o=t),n.h=e.i,t.i=e.h,e.i=n,e.h=t,n===this.v)this.v=e,this.C.o=e;else{let t=n.o;t.i===n?t.i=e:t.h=e}e.o=n.o,t.o=e,n.o=e,n.p=1}else{t.p=0,n===this.v?this.v=n._():n._(),n.p=1;return}}this.enableIndex&&(t.O(),n.O(),e.O());return}}q(e,t,n){if(this.v===void 0)return this.m+=1,this.v=new this.N(e,t,0),this.v.o=this.C,this.C.o=this.C.i=this.C.h=this.v,this.m;let r,i=this.C.i,a=this.A(i.u,e);if(a===0)return i.l=t,this.m;if(a>0)i.i=new this.N(e,t),i.i.o=i,r=i.i,this.C.i=r;else{let i=this.C.h,a=this.A(i.u,e);if(a===0)return i.l=t,this.m;if(a<0)i.h=new this.N(e,t),i.h.o=i,r=i.h,this.C.h=r;else{if(n!==void 0){let i=n.T;if(i!==this.C){let n=this.A(i.u,e);if(n===0)return i.l=t,this.m;if(n>0){let n=i.I(),a=this.A(n.u,e);if(a===0)return n.l=t,this.m;a<0&&(r=new this.N(e,t),n.h===void 0?(n.h=r,r.o=n):(i.i=r,r.o=i))}}}if(r===void 0)for(r=this.v;;){let n=this.A(r.u,e);if(n>0){if(r.i===void 0){r.i=new this.N(e,t),r.i.o=r,r=r.i;break}r=r.i}else if(n<0){if(r.h===void 0){r.h=new this.N(e,t),r.h.o=r,r=r.h;break}r=r.h}else return r.l=t,this.m}}}if(this.enableIndex){let e=r.o;for(;e!==this.C;)e.M+=1,e=e.o}return this.j(r),this.m+=1,this.m}H(e,t){for(;e;){let n=this.A(e.u,t);if(n<0)e=e.h;else if(n>0)e=e.i;else return e}return e||this.C}clear(){this.m=0,this.v=void 0,this.C.o=void 0,this.C.i=this.C.h=void 0}updateKeyByIterator(e,t){let n=e.T;if(n===this.C&&o(),this.m===1)return n.u=t,!0;let r=n.B().u;if(n===this.C.i)return this.A(r,t)>0?(n.u=t,!0):!1;let i=n.I().u;return n===this.C.h?this.A(i,t)<0?(n.u=t,!0):!1:this.A(i,t)>=0||this.A(r,t)<=0?!1:(n.u=t,!0)}eraseElementByPos(e){if(e<0||e>this.m-1)throw RangeError();let t=this.U(e);return this.S(t),this.m}eraseElementByKey(e){if(this.m===0)return!1;let t=this.H(this.v,e);return t===this.C?!1:(this.S(t),!0)}eraseElementByIterator(e){let t=e.T;t===this.C&&o();let n=t.h===void 0;return e.iteratorType===0?n&&e.next():(!n||t.i===void 0)&&e.next(),this.S(t),e}getHeight(){if(this.m===0)return 0;function e(t){return t?Math.max(e(t.i),e(t.h))+1:0}return e(this.v)}},c=class extends r{constructor(e,t,n){super(n),this.T=e,this.C=t,this.iteratorType===0?(this.pre=function(){return this.T===this.C.i&&o(),this.T=this.T.I(),this},this.next=function(){return this.T===this.C&&o(),this.T=this.T.B(),this}):(this.pre=function(){return this.T===this.C.h&&o(),this.T=this.T.B(),this},this.next=function(){return this.T===this.C&&o(),this.T=this.T.I(),this})}get index(){let e=this.T,t=this.C.o;if(e===this.C)return t?t.M-1:0;let n=0;for(e.i&&(n+=e.i.M);e!==t;){let t=e.o;e===t.h&&(n+=1,t.i&&(n+=t.i.M)),e=t}return n}isAccessible(){return this.T!==this.C}},l=class e extends c{constructor(e,t,n,r){super(e,t,r),this.container=n}get pointer(){this.T===this.C&&o();let e=this;return new Proxy([],{get(t,n){return n===`0`?e.T.u:n===`1`?e.T.l:(t[0]=e.T.u,t[1]=e.T.l,t[n])},set(t,n,r){if(n!==`1`)throw TypeError(`prop must be 1`);return e.T.l=r,!0}})}copy(){return new e(this.T,this.C,this.container,this.iteratorType)}};e.OrderedMap=class extends s{constructor(e=[],t,n){super(t,n);let r=this;e.forEach((function(e){r.setElement(e[0],e[1])}))}begin(){return new l(this.C.i||this.C,this.C,this)}end(){return new l(this.C,this.C,this)}rBegin(){return new l(this.C.h||this.C,this.C,this,1)}rEnd(){return new l(this.C,this.C,this,1)}front(){if(this.m===0)return;let e=this.C.i;return[e.u,e.l]}back(){if(this.m===0)return;let e=this.C.h;return[e.u,e.l]}lowerBound(e){return new l(this.R(this.v,e),this.C,this)}upperBound(e){return new l(this.K(this.v,e),this.C,this)}reverseLowerBound(e){return new l(this.L(this.v,e),this.C,this)}reverseUpperBound(e){return new l(this.k(this.v,e),this.C,this)}forEach(e){this.U((function(t,n,r){e([t.u,t.l],n,r)}))}setElement(e,t,n){return this.q(e,t,n)}getElementByPos(e){if(e<0||e>this.m-1)throw RangeError();let t=this.U(e);return[t.u,t.l]}find(e){return new l(this.H(this.v,e),this.C,this)}getElementByKey(e){return this.H(this.v,e).l}union(e){let t=this;return e.forEach((function(e){t.setElement(e[0],e[1])})),this.m}*[Symbol.iterator](){let e=this.m,t=this.U();for(let n=0;n<e;++n){let e=t[n];yield[e.u,e.l]}}}})),ak=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.registerAdminService=n,e.addAdminServicesToServer=r;let t=[];function n(e,n){t.push({getServiceDefinition:e,getHandlers:n})}function r(e){for(let{getServiceDefinition:n,getHandlers:r}of t)e.addService(n(),r())}})),ok=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ClientDuplexStreamImpl=e.ClientWritableStreamImpl=e.ClientReadableStreamImpl=e.ClientUnaryCallImpl=void 0,e.callErrorFromStatus=i;let t=s(`events`),n=s(`stream`),r=J();function i(e,t){let n=`${e.code} ${r.Status[e.code]}: ${e.details}`,i=`${Error(n).stack}\nfor call at\n${t}`;return Object.assign(Error(n),e,{stack:i})}e.ClientUnaryCallImpl=class extends t.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}},e.ClientReadableStreamImpl=class extends n.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_read(e){var t;(t=this.call)==null||t.startRead()}},e.ClientWritableStreamImpl=class extends n.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_write(e,t,n){var r;let i={callback:n},a=Number(t);Number.isNaN(a)||(i.flags=a),(r=this.call)==null||r.sendMessageWithContext(i,e)}_final(e){var t;(t=this.call)==null||t.halfClose(),e()}},e.ClientDuplexStreamImpl=class extends n.Duplex{constructor(e,t){super({objectMode:!0}),this.serialize=e,this.deserialize=t}cancel(){var e;(e=this.call)==null||e.cancelWithStatus(r.Status.CANCELLED,`Cancelled on client`)}getPeer(){return this.call?.getPeer()??`unknown`}getAuthContext(){return this.call?.getAuthContext()??null}_read(e){var t;(t=this.call)==null||t.startRead()}_write(e,t,n){var r;let i={callback:n},a=Number(t);Number.isNaN(a)||(i.flags=a),(r=this.call)==null||r.sendMessageWithContext(i,e)}_final(e){var t;(t=this.call)==null||t.halfClose(),e()}}})),sk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InterceptingListenerImpl=void 0,e.statusOrFromValue=n,e.statusOrFromError=r,e.isInterceptingListener=i;let t=X();function n(e){return{ok:!0,value:e}}function r(e){return{ok:!1,error:Object.assign(Object.assign({},e),{metadata:e.metadata??new t.Metadata})}}function i(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}e.InterceptingListenerImpl=class{constructor(e,t){this.listener=e,this.nextListener=t,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&=(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextListener.onReceiveStatus(e)})}}})),ck=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InterceptingCall=e.RequesterBuilder=e.ListenerBuilder=e.InterceptorConfigurationError=void 0,e.getInterceptingCall=p;let t=X(),n=sk(),r=J(),i=WO();var a=class e extends Error{constructor(t){super(t),this.name=`InterceptorConfigurationError`,Error.captureStackTrace(this,e)}};e.InterceptorConfigurationError=a,e.ListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}},e.RequesterBuilder=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};let o={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveStatus:(e,t)=>{t(e)}},s={start:(e,t,n)=>{n(e,t)},sendMessage:(e,t)=>{t(e)},halfClose:e=>{e()},cancel:e=>{e()}};e.InterceptingCall=class{constructor(e,t){this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,t?this.requester={start:t.start??s.start,sendMessage:t.sendMessage??s.sendMessage,halfClose:t.halfClose??s.halfClose,cancel:t.cancel??s.cancel}:this.requester=s}cancelWithStatus(e,t){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,t)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,t){let r={onReceiveMetadata:(t?.onReceiveMetadata)?.bind(t)??(e=>{}),onReceiveMessage:(t?.onReceiveMessage)?.bind(t)??(e=>{}),onReceiveStatus:(t?.onReceiveStatus)?.bind(t)??(e=>{})};this.processingMetadata=!0,this.requester.start(e,r,(e,t)=>{this.processingMetadata=!1;let i;if((0,n.isInterceptingListener)(t))i=t;else{let e={onReceiveMetadata:t.onReceiveMetadata??o.onReceiveMetadata,onReceiveMessage:t.onReceiveMessage??o.onReceiveMessage,onReceiveStatus:t.onReceiveStatus??o.onReceiveStatus};i=new n.InterceptingListenerImpl(e,r)}this.nextCall.start(e,i),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,t){this.processingMessage=!0,this.requester.sendMessage(t,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=t):(this.nextCall.sendMessageWithContext(e,n),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};function c(e,t,n){let r=n.deadline??1/0,i=n.host,a=n.parent??null,o=n.propagate_flags,s=n.credentials,c=e.createCall(t,r,i,a,o);return s&&c.setCredentials(s),c}var l=class{constructor(e,t){this.call=e,this.methodDefinition=t}cancelWithStatus(e,t){this.call.cancelWithStatus(e,t)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,t){let n;try{n=this.methodDefinition.requestSerialize(t)}catch(e){this.call.cancelWithStatus(r.Status.INTERNAL,`Request message serialization failure: ${(0,i.getErrorMessage)(e)}`);return}this.call.sendMessageWithContext(e,n)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,n){let a=null;this.call.start(e,{onReceiveMetadata:e=>{var t;(t=n?.onReceiveMetadata)==null||t.call(n,e)},onReceiveMessage:e=>{var o;let s;try{s=this.methodDefinition.responseDeserialize(e)}catch(e){a={code:r.Status.INTERNAL,details:`Response message parsing error: ${(0,i.getErrorMessage)(e)}`,metadata:new t.Metadata},this.call.cancelWithStatus(a.code,a.details);return}(o=n?.onReceiveMessage)==null||o.call(n,s)},onReceiveStatus:e=>{var t,r;a?(t=n?.onReceiveStatus)==null||t.call(n,a):(r=n?.onReceiveStatus)==null||r.call(n,e)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},u=class extends l{constructor(e,t){super(e,t)}start(e,t){let n=!1,r={onReceiveMetadata:(t?.onReceiveMetadata)?.bind(t)??(e=>{}),onReceiveMessage:e=>{var r;n=!0,(r=t?.onReceiveMessage)==null||r.call(t,e)},onReceiveStatus:e=>{var r,i;n||(r=t?.onReceiveMessage)==null||r.call(t,null),(i=t?.onReceiveStatus)==null||i.call(t,e)}};super.start(e,r),this.call.startRead()}},d=class extends l{};function f(e,t,n){let r=c(e,n.path,t);return n.responseStream?new d(r,n):new u(r,n)}function p(e,t,n,r){if(e.clientInterceptors.length>0&&e.clientInterceptorProviders.length>0)throw new a(`Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.`);if(e.callInterceptors.length>0&&e.callInterceptorProviders.length>0)throw new a(`Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.`);let i=[];i=e.callInterceptors.length>0||e.callInterceptorProviders.length>0?[].concat(e.callInterceptors,e.callInterceptorProviders.map(e=>e(t))).filter(e=>e):[].concat(e.clientInterceptors,e.clientInterceptorProviders.map(e=>e(t))).filter(e=>e);let o=Object.assign({},n,{method_definition:t});return i.reduceRight((e,t)=>n=>t(n,e),e=>f(r,e,t))(o)}})),lk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Client=void 0;let t=ok(),n=FA(),r=ZO(),i=J(),a=X(),o=ck(),s=Symbol(),c=Symbol(),l=Symbol(),u=Symbol();function d(e){return typeof e==`function`}function f(e){return e.stack?.split(`
26
26
  `).slice(1).join(`
27
- `)||`no stack trace available`}e.Client=class{constructor(e,t,r={}){if(r=Object.assign({},r),this[c]=r.interceptors??[],delete r.interceptors,this[l]=r.interceptor_providers??[],delete r.interceptor_providers,this[c].length>0&&this[l].length>0)throw Error(`Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.`);if(this[u]=r.callInvocationTransformer,delete r.callInvocationTransformer,r.channelOverride)this[s]=r.channelOverride;else if(r.channelFactoryOverride){let n=r.channelFactoryOverride;delete r.channelFactoryOverride,this[s]=n(e,t,r)}else this[s]=new n.ChannelImplementation(e,t,r)}close(){this[s].close()}getChannel(){return this[s]}waitForReady(e,t){let n=i=>{if(i){t(Error(`Failed to connect before the deadline`));return}let a;try{a=this[s].getConnectivityState(!0)}catch{t(Error(`The channel has been closed`));return}if(a===r.ConnectivityState.READY)t();else try{this[s].watchConnectivityState(a,e,n)}catch{t(Error(`The channel has been closed`))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,n){if(d(e))return{metadata:new a.Metadata,options:{},callback:e};if(d(t))return e instanceof a.Metadata?{metadata:e,options:{},callback:t}:{metadata:new a.Metadata,options:e,callback:t};if(!(e instanceof a.Metadata&&t instanceof Object&&d(n)))throw Error(`Incorrect arguments passed`);return{metadata:e,options:t,callback:n}}makeUnaryRequest(e,n,r,a,d,p,m){let h=this.checkOptionalUnaryResponseArguments(d,p,m),g={path:e,requestStream:!1,responseStream:!1,requestSerialize:n,responseDeserialize:r},_={argument:a,metadata:h.metadata,call:new t.ClientUnaryCallImpl,channel:this[s],methodDefinition:g,callOptions:h.options,callback:h.callback};this[u]&&(_=this[u](_));let v=_.call,y={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:_.callOptions.interceptors??[],callInterceptorProviders:_.callOptions.interceptor_providers??[]},b=(0,o.getInterceptingCall)(y,_.methodDefinition,_.callOptions,_.channel);v.call=b;let x=null,S=!1,C=Error();return b.start(_.metadata,{onReceiveMetadata:e=>{v.emit(`metadata`,e)},onReceiveMessage(e){x!==null&&b.cancelWithStatus(i.Status.UNIMPLEMENTED,`Too many responses received`),x=e},onReceiveStatus(e){if(!S){if(S=!0,e.code===i.Status.OK)if(x===null){let n=f(C);_.callback((0,t.callErrorFromStatus)({code:i.Status.UNIMPLEMENTED,details:`No message received`,metadata:e.metadata},n))}else _.callback(null,x);else{let n=f(C);_.callback((0,t.callErrorFromStatus)(e,n))}C=null,v.emit(`status`,e)}}}),b.sendMessage(a),b.halfClose(),v}makeClientStreamRequest(e,n,r,a,d,p){let m=this.checkOptionalUnaryResponseArguments(a,d,p),h={path:e,requestStream:!0,responseStream:!1,requestSerialize:n,responseDeserialize:r},g={metadata:m.metadata,call:new t.ClientWritableStreamImpl(n),channel:this[s],methodDefinition:h,callOptions:m.options,callback:m.callback};this[u]&&(g=this[u](g));let _=g.call,v={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:g.callOptions.interceptors??[],callInterceptorProviders:g.callOptions.interceptor_providers??[]},y=(0,o.getInterceptingCall)(v,g.methodDefinition,g.callOptions,g.channel);_.call=y;let b=null,x=!1,S=Error();return y.start(g.metadata,{onReceiveMetadata:e=>{_.emit(`metadata`,e)},onReceiveMessage(e){b!==null&&y.cancelWithStatus(i.Status.UNIMPLEMENTED,`Too many responses received`),b=e,y.startRead()},onReceiveStatus(e){if(!x){if(x=!0,e.code===i.Status.OK)if(b===null){let n=f(S);g.callback((0,t.callErrorFromStatus)({code:i.Status.UNIMPLEMENTED,details:`No message received`,metadata:e.metadata},n))}else g.callback(null,b);else{let n=f(S);g.callback((0,t.callErrorFromStatus)(e,n))}S=null,_.emit(`status`,e)}}}),_}checkMetadataAndOptions(e,t){let n,r;return e instanceof a.Metadata?(n=e,r=t||{}):(r=e||{},n=new a.Metadata),{metadata:n,options:r}}makeServerStreamRequest(e,n,r,a,d,p){let m=this.checkMetadataAndOptions(d,p),h={path:e,requestStream:!1,responseStream:!0,requestSerialize:n,responseDeserialize:r},g={argument:a,metadata:m.metadata,call:new t.ClientReadableStreamImpl(r),channel:this[s],methodDefinition:h,callOptions:m.options};this[u]&&(g=this[u](g));let _=g.call,v={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:g.callOptions.interceptors??[],callInterceptorProviders:g.callOptions.interceptor_providers??[]},y=(0,o.getInterceptingCall)(v,g.methodDefinition,g.callOptions,g.channel);_.call=y;let b=!1,x=Error();return y.start(g.metadata,{onReceiveMetadata(e){_.emit(`metadata`,e)},onReceiveMessage(e){_.push(e)},onReceiveStatus(e){if(!b){if(b=!0,_.push(null),e.code!==i.Status.OK){let n=f(x);_.emit(`error`,(0,t.callErrorFromStatus)(e,n))}x=null,_.emit(`status`,e)}}}),y.sendMessage(a),y.halfClose(),_}makeBidiStreamRequest(e,n,r,a,d){let p=this.checkMetadataAndOptions(a,d),m={path:e,requestStream:!0,responseStream:!0,requestSerialize:n,responseDeserialize:r},h={metadata:p.metadata,call:new t.ClientDuplexStreamImpl(n,r),channel:this[s],methodDefinition:m,callOptions:p.options};this[u]&&(h=this[u](h));let g=h.call,_={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:h.callOptions.interceptors??[],callInterceptorProviders:h.callOptions.interceptor_providers??[]},v=(0,o.getInterceptingCall)(_,h.methodDefinition,h.callOptions,h.channel);g.call=v;let y=!1,b=Error();return v.start(h.metadata,{onReceiveMetadata(e){g.emit(`metadata`,e)},onReceiveMessage(e){g.push(e)},onReceiveStatus(e){if(!y){if(y=!0,g.push(null),e.code!==i.Status.OK){let n=f(b);g.emit(`error`,(0,t.callErrorFromStatus)(e,n))}b=null,g.emit(`status`,e)}}}),g}}})),lk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.makeClientConstructor=i,e.loadPackageDefinition=s;let t=ck(),n={unary:t.Client.prototype.makeUnaryRequest,server_stream:t.Client.prototype.makeServerStreamRequest,client_stream:t.Client.prototype.makeClientStreamRequest,bidi:t.Client.prototype.makeBidiStreamRequest};function r(e){return[`__proto__`,`prototype`,`constructor`].includes(e)}function i(e,i,o){o||={};class s extends t.Client{}return Object.keys(e).forEach(t=>{if(r(t))return;let i=e[t],o;if(typeof t==`string`&&t.charAt(0)===`$`)throw Error(`Method names cannot start with $`);o=i.requestStream?i.responseStream?`bidi`:`client_stream`:i.responseStream?`server_stream`:`unary`;let c=i.requestSerialize,l=i.responseDeserialize,u=a(n[o],i.path,c,l);s.prototype[t]=u,Object.assign(s.prototype[t],i),i.originalName&&!r(i.originalName)&&(s.prototype[i.originalName]=s.prototype[t])}),s.service=e,s.serviceName=i,s}function a(e,t,n,r){return function(...i){return e.call(this,t,n,r,...i)}}function o(e){return`format`in e}function s(e){let t={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let a=e[n],s=n.split(`.`);if(s.some(e=>r(e)))continue;let c=s[s.length-1],l=t;for(let e of s.slice(0,-1))l[e]||(l[e]={}),l=l[e];o(a)?l[c]=a:l[c]=i(a,c,{})}return t}})),uk=t(((e,t)=>{var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i=`\\ud800-\\udfff`,a=`\\u0300-\\u036f\\ufe20-\\ufe23`,o=`\\u20d0-\\u20f0`,s=`\\u2700-\\u27bf`,c=`a-z\\xdf-\\xf6\\xf8-\\xff`,l=`\\xac\\xb1\\xd7\\xf7`,u=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,d=`\\u2000-\\u206f`,f=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,p=`A-Z\\xc0-\\xd6\\xd8-\\xde`,m=`\\ufe0e\\ufe0f`,h=l+u+d+f,g=`['’]`,_=`[`+i+`]`,v=`[`+h+`]`,y=`[`+a+o+`]`,b=`\\d+`,x=`[`+s+`]`,S=`[`+c+`]`,C=`[^`+i+h+b+s+c+p+`]`,w=`\\ud83c[\\udffb-\\udfff]`,T=`(?:`+y+`|`+w+`)`,E=`[^`+i+`]`,D=`(?:\\ud83c[\\udde6-\\uddff]){2}`,O=`[\\ud800-\\udbff][\\udc00-\\udfff]`,k=`[`+p+`]`,A=`\\u200d`,j=`(?:`+S+`|`+C+`)`,M=`(?:`+k+`|`+C+`)`,N=`(?:`+g+`(?:d|ll|m|re|s|t|ve))?`,ee=`(?:`+g+`(?:D|LL|M|RE|S|T|VE))?`,te=T+`?`,P=`[`+m+`]?`,F=`(?:`+A+`(?:`+[E,D,O].join(`|`)+`)`+P+te+`)*`,ne=P+te+F,re=`(?:`+[x,D,O].join(`|`)+`)`+ne,I=`(?:`+[E+y+`?`,y,D,O,_].join(`|`)+`)`,ie=RegExp(g,`g`),L=RegExp(y,`g`),ae=RegExp(w+`(?=`+w+`)|`+I+ne,`g`),R=RegExp([k+`?`+S+`+`+N+`(?=`+[v,k,`$`].join(`|`)+`)`,M+`+`+ee+`(?=`+[v,k+j,`$`].join(`|`)+`)`,k+`?`+j+`+`+N,k+`+`+ee,b,re].join(`|`),`g`),oe=RegExp(`[`+A+i+a+o+m+`]`),se=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,z={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`ss`},ce=typeof global==`object`&&global&&global.Object===Object&&global,le=typeof self==`object`&&self&&self.Object===Object&&self,ue=ce||le||Function(`return this`)();function de(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function fe(e){return e.split(``)}function pe(e){return e.match(n)||[]}function me(e){return function(t){return e?.[t]}}var B=me(z);function he(e){return oe.test(e)}function V(e){return se.test(e)}function ge(e){return he(e)?_e(e):fe(e)}function _e(e){return e.match(ae)||[]}function ve(e){return e.match(R)||[]}var ye=Object.prototype.toString,be=ue.Symbol,xe=be?be.prototype:void 0,Se=xe?xe.toString:void 0;function Ce(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function we(e){if(typeof e==`string`)return e;if(Oe(e))return Se?Se.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Te(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Ce(e,t,n)}function Ee(e){return function(t){t=ke(t);var n=he(t)?ge(t):void 0,r=n?n[0]:t.charAt(0),i=n?Te(n,1).join(``):t.slice(1);return r[e]()+i}}function H(e){return function(t){return de(Pe(Me(t).replace(ie,``)),e,``)}}function De(e){return!!e&&typeof e==`object`}function Oe(e){return typeof e==`symbol`||De(e)&&ye.call(e)==`[object Symbol]`}function ke(e){return e==null?``:we(e)}var Ae=H(function(e,t,n){return t=t.toLowerCase(),e+(n?je(t):t)});function je(e){return Ne(ke(e).toLowerCase())}function Me(e){return e=ke(e),e&&e.replace(r,B).replace(L,``)}var Ne=Ee(`toUpperCase`);function Pe(e,t,n){return e=ke(e),t=n?void 0:t,t===void 0?V(e)?ve(e):pe(e):e.match(t)||[]}t.exports=Ae})),dk=t(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),fk=t((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)===`=`;)++n;return Math.ceil(e.length*3)/4-n};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||=[]).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}})),pk=t(((e,t)=>{t.exports=n;function n(){this._listeners=Object.create(null)}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners=Object.create(null);else if(t===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r}return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),mk=t(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*2**-a*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*2**(a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*2**-c,e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*2**(c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),hk=t(((e,t)=>{t.exports=n;function n(e){try{if(typeof s!=`function`)return null;var t=s(e);return t&&(t.length||Object.keys(t).length)?t:null}catch{return null}}})),gk=t((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return``;for(var i=``,a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),_k=t(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),vk=t(((e,t)=>{t.exports=r;var n=bk();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.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)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),yk=t(((e,t)=>{(function(n,r){function i(e){return e.default||e}typeof define==`function`&&define.amd?define([],function(){var e={};return r(e),i(e)}):typeof e==`object`?(r(e),typeof t==`object`&&(t.exports=i(e))):(function(){var e={};r(e),n.Long=i(e)})()})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;
27
+ `)||`no stack trace available`}e.Client=class{constructor(e,t,r={}){if(r=Object.assign({},r),this[c]=r.interceptors??[],delete r.interceptors,this[l]=r.interceptor_providers??[],delete r.interceptor_providers,this[c].length>0&&this[l].length>0)throw Error(`Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.`);if(this[u]=r.callInvocationTransformer,delete r.callInvocationTransformer,r.channelOverride)this[s]=r.channelOverride;else if(r.channelFactoryOverride){let n=r.channelFactoryOverride;delete r.channelFactoryOverride,this[s]=n(e,t,r)}else this[s]=new n.ChannelImplementation(e,t,r)}close(){this[s].close()}getChannel(){return this[s]}waitForReady(e,t){let n=i=>{if(i){t(Error(`Failed to connect before the deadline`));return}let a;try{a=this[s].getConnectivityState(!0)}catch{t(Error(`The channel has been closed`));return}if(a===r.ConnectivityState.READY)t();else try{this[s].watchConnectivityState(a,e,n)}catch{t(Error(`The channel has been closed`))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,t,n){if(d(e))return{metadata:new a.Metadata,options:{},callback:e};if(d(t))return e instanceof a.Metadata?{metadata:e,options:{},callback:t}:{metadata:new a.Metadata,options:e,callback:t};if(!(e instanceof a.Metadata&&t instanceof Object&&d(n)))throw Error(`Incorrect arguments passed`);return{metadata:e,options:t,callback:n}}makeUnaryRequest(e,n,r,a,d,p,m){let h=this.checkOptionalUnaryResponseArguments(d,p,m),g={path:e,requestStream:!1,responseStream:!1,requestSerialize:n,responseDeserialize:r},_={argument:a,metadata:h.metadata,call:new t.ClientUnaryCallImpl,channel:this[s],methodDefinition:g,callOptions:h.options,callback:h.callback};this[u]&&(_=this[u](_));let v=_.call,y={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:_.callOptions.interceptors??[],callInterceptorProviders:_.callOptions.interceptor_providers??[]},b=(0,o.getInterceptingCall)(y,_.methodDefinition,_.callOptions,_.channel);v.call=b;let x=null,S=!1,C=Error();return b.start(_.metadata,{onReceiveMetadata:e=>{v.emit(`metadata`,e)},onReceiveMessage(e){x!==null&&b.cancelWithStatus(i.Status.UNIMPLEMENTED,`Too many responses received`),x=e},onReceiveStatus(e){if(!S){if(S=!0,e.code===i.Status.OK)if(x===null){let n=f(C);_.callback((0,t.callErrorFromStatus)({code:i.Status.UNIMPLEMENTED,details:`No message received`,metadata:e.metadata},n))}else _.callback(null,x);else{let n=f(C);_.callback((0,t.callErrorFromStatus)(e,n))}C=null,v.emit(`status`,e)}}}),b.sendMessage(a),b.halfClose(),v}makeClientStreamRequest(e,n,r,a,d,p){let m=this.checkOptionalUnaryResponseArguments(a,d,p),h={path:e,requestStream:!0,responseStream:!1,requestSerialize:n,responseDeserialize:r},g={metadata:m.metadata,call:new t.ClientWritableStreamImpl(n),channel:this[s],methodDefinition:h,callOptions:m.options,callback:m.callback};this[u]&&(g=this[u](g));let _=g.call,v={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:g.callOptions.interceptors??[],callInterceptorProviders:g.callOptions.interceptor_providers??[]},y=(0,o.getInterceptingCall)(v,g.methodDefinition,g.callOptions,g.channel);_.call=y;let b=null,x=!1,S=Error();return y.start(g.metadata,{onReceiveMetadata:e=>{_.emit(`metadata`,e)},onReceiveMessage(e){b!==null&&y.cancelWithStatus(i.Status.UNIMPLEMENTED,`Too many responses received`),b=e,y.startRead()},onReceiveStatus(e){if(!x){if(x=!0,e.code===i.Status.OK)if(b===null){let n=f(S);g.callback((0,t.callErrorFromStatus)({code:i.Status.UNIMPLEMENTED,details:`No message received`,metadata:e.metadata},n))}else g.callback(null,b);else{let n=f(S);g.callback((0,t.callErrorFromStatus)(e,n))}S=null,_.emit(`status`,e)}}}),_}checkMetadataAndOptions(e,t){let n,r;return e instanceof a.Metadata?(n=e,r=t||{}):(r=e||{},n=new a.Metadata),{metadata:n,options:r}}makeServerStreamRequest(e,n,r,a,d,p){let m=this.checkMetadataAndOptions(d,p),h={path:e,requestStream:!1,responseStream:!0,requestSerialize:n,responseDeserialize:r},g={argument:a,metadata:m.metadata,call:new t.ClientReadableStreamImpl(r),channel:this[s],methodDefinition:h,callOptions:m.options};this[u]&&(g=this[u](g));let _=g.call,v={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:g.callOptions.interceptors??[],callInterceptorProviders:g.callOptions.interceptor_providers??[]},y=(0,o.getInterceptingCall)(v,g.methodDefinition,g.callOptions,g.channel);_.call=y;let b=!1,x=Error();return y.start(g.metadata,{onReceiveMetadata(e){_.emit(`metadata`,e)},onReceiveMessage(e){_.push(e)},onReceiveStatus(e){if(!b){if(b=!0,_.push(null),e.code!==i.Status.OK){let n=f(x);_.emit(`error`,(0,t.callErrorFromStatus)(e,n))}x=null,_.emit(`status`,e)}}}),y.sendMessage(a),y.halfClose(),_}makeBidiStreamRequest(e,n,r,a,d){let p=this.checkMetadataAndOptions(a,d),m={path:e,requestStream:!0,responseStream:!0,requestSerialize:n,responseDeserialize:r},h={metadata:p.metadata,call:new t.ClientDuplexStreamImpl(n,r),channel:this[s],methodDefinition:m,callOptions:p.options};this[u]&&(h=this[u](h));let g=h.call,_={clientInterceptors:this[c],clientInterceptorProviders:this[l],callInterceptors:h.callOptions.interceptors??[],callInterceptorProviders:h.callOptions.interceptor_providers??[]},v=(0,o.getInterceptingCall)(_,h.methodDefinition,h.callOptions,h.channel);g.call=v;let y=!1,b=Error();return v.start(h.metadata,{onReceiveMetadata(e){g.emit(`metadata`,e)},onReceiveMessage(e){g.push(e)},onReceiveStatus(e){if(!y){if(y=!0,g.push(null),e.code!==i.Status.OK){let n=f(b);g.emit(`error`,(0,t.callErrorFromStatus)(e,n))}b=null,g.emit(`status`,e)}}}),g}}})),uk=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.makeClientConstructor=i,e.loadPackageDefinition=s;let t=lk(),n={unary:t.Client.prototype.makeUnaryRequest,server_stream:t.Client.prototype.makeServerStreamRequest,client_stream:t.Client.prototype.makeClientStreamRequest,bidi:t.Client.prototype.makeBidiStreamRequest};function r(e){return[`__proto__`,`prototype`,`constructor`].includes(e)}function i(e,i,o){o||={};class s extends t.Client{}return Object.keys(e).forEach(t=>{if(r(t))return;let i=e[t],o;if(typeof t==`string`&&t.charAt(0)===`$`)throw Error(`Method names cannot start with $`);o=i.requestStream?i.responseStream?`bidi`:`client_stream`:i.responseStream?`server_stream`:`unary`;let c=i.requestSerialize,l=i.responseDeserialize,u=a(n[o],i.path,c,l);s.prototype[t]=u,Object.assign(s.prototype[t],i),i.originalName&&!r(i.originalName)&&(s.prototype[i.originalName]=s.prototype[t])}),s.service=e,s.serviceName=i,s}function a(e,t,n,r){return function(...i){return e.call(this,t,n,r,...i)}}function o(e){return`format`in e}function s(e){let t={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let a=e[n],s=n.split(`.`);if(s.some(e=>r(e)))continue;let c=s[s.length-1],l=t;for(let e of s.slice(0,-1))l[e]||(l[e]={}),l=l[e];o(a)?l[c]=a:l[c]=i(a,c,{})}return t}})),dk=t(((e,t)=>{var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,i=`\\ud800-\\udfff`,a=`\\u0300-\\u036f\\ufe20-\\ufe23`,o=`\\u20d0-\\u20f0`,s=`\\u2700-\\u27bf`,c=`a-z\\xdf-\\xf6\\xf8-\\xff`,l=`\\xac\\xb1\\xd7\\xf7`,u=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,d=`\\u2000-\\u206f`,f=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,p=`A-Z\\xc0-\\xd6\\xd8-\\xde`,m=`\\ufe0e\\ufe0f`,h=l+u+d+f,g=`['’]`,_=`[`+i+`]`,v=`[`+h+`]`,y=`[`+a+o+`]`,b=`\\d+`,x=`[`+s+`]`,S=`[`+c+`]`,C=`[^`+i+h+b+s+c+p+`]`,w=`\\ud83c[\\udffb-\\udfff]`,T=`(?:`+y+`|`+w+`)`,E=`[^`+i+`]`,D=`(?:\\ud83c[\\udde6-\\uddff]){2}`,O=`[\\ud800-\\udbff][\\udc00-\\udfff]`,k=`[`+p+`]`,A=`\\u200d`,j=`(?:`+S+`|`+C+`)`,ee=`(?:`+k+`|`+C+`)`,M=`(?:`+g+`(?:d|ll|m|re|s|t|ve))?`,te=`(?:`+g+`(?:D|LL|M|RE|S|T|VE))?`,ne=T+`?`,N=`[`+m+`]?`,P=`(?:`+A+`(?:`+[E,D,O].join(`|`)+`)`+N+ne+`)*`,re=N+ne+P,ie=`(?:`+[x,D,O].join(`|`)+`)`+re,ae=`(?:`+[E+y+`?`,y,D,O,_].join(`|`)+`)`,oe=RegExp(g,`g`),F=RegExp(y,`g`),I=RegExp(w+`(?=`+w+`)|`+ae+re,`g`),se=RegExp([k+`?`+S+`+`+M+`(?=`+[v,k,`$`].join(`|`)+`)`,ee+`+`+te+`(?=`+[v,k+j,`$`].join(`|`)+`)`,k+`?`+j+`+`+M,k+`+`+te,b,ie].join(`|`),`g`),L=RegExp(`[`+A+i+a+o+m+`]`),ce=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,le={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`ss`},R=typeof global==`object`&&global&&global.Object===Object&&global,ue=typeof self==`object`&&self&&self.Object===Object&&self,de=R||ue||Function(`return this`)();function fe(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function pe(e){return e.split(``)}function me(e){return e.match(n)||[]}function he(e){return function(t){return e?.[t]}}var z=he(le);function ge(e){return L.test(e)}function _e(e){return ce.test(e)}function B(e){return ge(e)?ve(e):pe(e)}function ve(e){return e.match(I)||[]}function ye(e){return e.match(se)||[]}var V=Object.prototype.toString,be=de.Symbol,xe=be?be.prototype:void 0,Se=xe?xe.toString:void 0;function Ce(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function we(e){if(typeof e==`string`)return e;if(Oe(e))return Se?Se.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Te(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Ce(e,t,n)}function Ee(e){return function(t){t=ke(t);var n=ge(t)?B(t):void 0,r=n?n[0]:t.charAt(0),i=n?Te(n,1).join(``):t.slice(1);return r[e]()+i}}function H(e){return function(t){return fe(Pe(Me(t).replace(oe,``)),e,``)}}function De(e){return!!e&&typeof e==`object`}function Oe(e){return typeof e==`symbol`||De(e)&&V.call(e)==`[object Symbol]`}function ke(e){return e==null?``:we(e)}var Ae=H(function(e,t,n){return t=t.toLowerCase(),e+(n?je(t):t)});function je(e){return Ne(ke(e).toLowerCase())}function Me(e){return e=ke(e),e&&e.replace(r,z).replace(F,``)}var Ne=Ee(`toUpperCase`);function Pe(e,t,n){return e=ke(e),t=n?void 0:t,t===void 0?_e(e)?ye(e):me(e):e.match(t)||[]}t.exports=Ae})),fk=t(((e,t)=>{t.exports=n;function n(e,t){for(var n=Array(arguments.length-1),r=0,i=2,a=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise(function(i,o){n[r]=function(e){if(a)if(a=!1,e)o(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){a&&(a=!1,o(e))}})}})),pk=t((e=>{var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)===`=`;)++n;return Math.ceil(e.length*3)/4-n};for(var n=Array(64),r=Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,r){for(var i=null,a=[],o=0,s=0,c;t<r;){var l=e[t++];switch(s){case 0:a[o++]=n[l>>2],c=(l&3)<<4,s=1;break;case 1:a[o++]=n[c|l>>4],c=(l&15)<<2,s=2;break;case 2:a[o++]=n[c|l>>6],a[o++]=n[l&63],s=0;break}o>8191&&((i||=[]).push(String.fromCharCode.apply(String,a)),o=0)}return s&&(a[o++]=n[c],a[o++]=61,s===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join(``)):String.fromCharCode.apply(String,a.slice(0,o))};var a=`invalid encoding`;t.decode=function(e,t,n){for(var i=n,o=0,s,c=0;c<e.length;){var l=e.charCodeAt(c++);if(l===61&&o>1)break;if((l=r[l])===void 0)throw Error(a);switch(o){case 0:s=l,o=1;break;case 1:t[n++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:t[n++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:t[n++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(a);return n-i},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}})),mk=t(((e,t)=>{t.exports=n;function n(){this._listeners=Object.create(null)}n.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},n.prototype.off=function(e,t){if(e===void 0)this._listeners=Object.create(null);else if(t===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r}return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}})),hk=t(((e,t)=>{t.exports=n(n);function n(e){return typeof Float32Array<`u`?(function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=n[3]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function a(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}e.writeFloatLE=r?i:a,e.writeFloatBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.readFloatLE=r?o:s,e.readFloatBE=r?s:o})():(function(){function t(e,t,n,r){var i=+(t<0);if(i&&(t=-t),t===0)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var a=Math.floor(Math.log(t)/Math.LN2),o=Math.round(t*2**-a*8388608)&8388607;e((i<<31|a+127<<23|o)>>>0,n,r)}}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i);function n(e,t,n){var r=e(t,n),i=(r>>31)*2+1,a=r>>>23&255,o=r&8388607;return a===255?o?NaN:i*(1/0):a===0?i*1401298464324817e-60*o:i*2**(a-150)*(o+8388608)}e.readFloatLE=n.bind(null,a),e.readFloatBE=n.bind(null,o)})(),typeof Float64Array<`u`?(function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=n[7]===128;function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function a(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}e.writeDoubleLE=r?i:a,e.writeDoubleBE=r?a:i;function o(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.readDoubleLE=r?o:s,e.readDoubleBE=r?s:o})():(function(){function t(e,t,n,r,i,a){var o=+(r<0);if(o&&(r=-r),r===0)e(0,i,a+t),e(1/r>0?0:2147483648,i,a+n);else if(isNaN(r))e(0,i,a+t),e(2146959360,i,a+n);else if(r>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+n);else{var s;if(r<22250738585072014e-324)s=r/5e-324,e(s>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+n);else{var c=Math.floor(Math.log(r)/Math.LN2);c===1024&&(c=1023),s=r*2**-c,e(s*4503599627370496>>>0,i,a+t),e((o<<31|c+1023<<20|s*1048576&1048575)>>>0,i,a+n)}}}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0);function n(e,t,n,r,i){var a=e(r,i+t),o=e(r,i+n),s=(o>>31)*2+1,c=o>>>20&2047,l=4294967296*(o&1048575)+a;return c===2047?l?NaN:s*(1/0):c===0?s*5e-324*l:s*2**(c-1075)*(l+4503599627370496)}e.readDoubleLE=n.bind(null,a,0,4),e.readDoubleBE=n.bind(null,o,4,0)})(),e}function r(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=e&255}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}})),gk=t(((e,t)=>{t.exports=n;function n(e){try{if(typeof s!=`function`)return null;var t=s(e);return t&&(t.length||Object.keys(t).length)?t:null}catch{return null}}})),_k=t((e=>{var t=e,n=`�`;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?t+=1:n<2048?t+=2:(n&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320?(++r,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return``;for(var i=``,a=t;a<r;){var o=e[a++];if(o<=127)i+=String.fromCharCode(o);else if(o>=192&&o<224){var s=(o&31)<<6|e[a++]&63;i+=s>=128?String.fromCharCode(s):n}else if(o>=224&&o<240){var c=(o&15)<<12|(e[a++]&63)<<6|e[a++]&63;i+=c>=2048?String.fromCharCode(c):n}else if(o>=240){var l=(o&7)<<18|(e[a++]&63)<<12|(e[a++]&63)<<6|e[a++]&63;l<65536||l>1114111?i+=n:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i},t.write=function(e,t,n){for(var r=n,i,a,o=0;o<e.length;++o)i=e.charCodeAt(o),i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&((a=e.charCodeAt(o+1))&64512)==56320?(i=65536+((i&1023)<<10)+(a&1023),++o,t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128);return n-r}})),vk=t(((e,t)=>{t.exports=n;function n(e,t,n){var r=n||8192,i=r>>>1,a=null,o=r;return function(n){if(n<1||n>i)return e(n);o+n>r&&(a=e(r),o=0);var s=t.call(a,o,o+=n);return o&7&&(o=(o|7)+1),s}}})),yk=t(((e,t)=>{t.exports=r;var n=xk();function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=r.zeroHash=`\0\0\0\0\0\0\0\0`;r.fromNumber=function(e){if(e===0)return i;var t=e<0;t&&(e=-e);var n=e>>>0,a=(e-n)/4294967296>>>0;return t&&(a=~a>>>0,n=~n>>>0,++n>4294967295&&(n=0,++a>4294967295&&(a=0))),new r(n,a)},r.from=function(e){if(typeof e==`number`)return r.fromNumber(e);if(n.isString(e))if(n.Long)e=n.Long.fromString(e);else return r.fromNumber(parseInt(e,10));return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(e){return n.Long?new n.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var o=String.prototype.charCodeAt;r.fromHash=function(e){return e===a?i:new r((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},r.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)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}})),bk=t(((e,t)=>{(function(n,r){function i(e){return e.default||e}typeof define==`function`&&define.amd?define([],function(){var e={};return r(e),i(e)}):typeof e==`object`?(r(e),typeof t==`object`&&(t.exports=i(e))):(function(){var e={};r(e),n.Long=i(e)})()})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:e,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;
28
28
  /**
29
29
  * @license
30
30
  * Copyright 2009 The Closure Library Authors
@@ -44,17 +44,17 @@ To resolve the conflict:`,(0,r.getConflictResolutionRecipe)(i,e))),a=o):n.diag.w
44
44
  *
45
45
  * SPDX-License-Identifier: Apache-2.0
46
46
  */
47
- var t=null;try{t=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 n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var T=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var D=n.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},D.clz=D.countLeadingZeros,D.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},D.ctz=D.countTrailingZeros,D.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},D.rotl=D.rotateLeft,D.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},D.rotr=D.rotateRight,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(n.fromBigInt=function(e,t){return l(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},n.fromValue=function(e,t){return typeof e==`bigint`?n.fromBigInt(e,t):f(e,t)},D.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=n})})),bk=t((e=>{var t=e;t.asPromise=dk(),t.base64=fk(),t.EventEmitter=pk(),t.float=mk(),t.inquire=hk(),t.utf8=gk(),t.pool=_k(),t.LongBits=vk();function n(e){return e===`__proto__`||e===`prototype`||e===`constructor`}t.isUnsafeProperty=n,t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.global.Buffer;return e.prototype.utf8Write?e:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||(function(){try{var e=yk();return e&&e.isLong?e:null}catch{return null}})(),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function r(e){var t=typeof arguments[arguments.length-1]==`boolean`,r=t?arguments.length-1:arguments.length;t&&=arguments[arguments.length-1];for(var i=1;i<r;++i){var a=arguments[i];if(a)for(var o=Object.keys(a),s=0;s<o.length;++s)!n(o[s])&&(e[o[s]]===void 0||!t)&&(e[o[s]]=a[o[s]])}return e}t.merge=r,t.nestingLimit=32,t.recursionLimit=100,t.makeProp=function(e,t){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0})},t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||``}),n&&r(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=i,t.ProtocolError=i(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),xk=t(((e,t)=>{t.exports=u;var n=bk(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return(e|=0)<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(var r=e.lo,i=e.hi;i;)t[n++]=r&127|128,r=(r>>>7|i<<25)>>>0,i>>>=7;for(;r>127;)t[n++]=r&127|128,r>>>=7;t[n++]=r}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),Sk=t(((e,t)=>{t.exports=i;var n=xk();(i.prototype=Object.create(n.prototype)).constructor=i;var r=bk();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),Ck=t(((e,t)=>{t.exports=s;var n=bk(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var i=n.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.recursionLimit=n.recursionLimit,s.prototype.skipType=function(e,t){if(t===void 0&&(t=0),t>s.recursionLimit)throw Error(`maximum nesting depth exceeded`);switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e,t+1);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),wk=t(((e,t)=>{t.exports=i;var n=Ck();(i.prototype=Object.create(n.prototype)).constructor=i;var r=bk();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),Tk=t(((e,t)=>{t.exports=r;var n=bk();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),Ek=t((e=>{var t=e;t.Service=Tk()})),Dk=t(((e,t)=>{t.exports={}})),Ok=t((e=>{var t=e;t.build=`minimal`,t.Writer=xk(),t.BufferWriter=Sk(),t.Reader=Ck(),t.BufferReader=wk(),t.util=bk(),t.rpc=Ek(),t.roots=Dk(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),kk=t(((e,t)=>{t.exports=r;var n=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;function r(e,t){typeof e==`string`&&(t=e,e=void 0);var n=[];function a(e){if(typeof e!=`string`){var t=o();if(r.verbose&&console.log(`codegen: `+t),t=`return `+t,e){for(var i=Object.keys(e),s=Array(i.length+1),c=Array(i.length),l=0;l<i.length;)s[l]=i[l],c[l]=e[i[l++]];return s[l]=t,Function.apply(null,s).apply(null,c)}return Function(t)()}for(var u=Array(arguments.length-1),d=0;d<u.length;)u[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,function(e,t){var n=u[d++];switch(t){case`d`:case`f`:return String(Number(n));case`i`:return String(Math.floor(n));case`j`:return JSON.stringify(n);case`s`:return String(n)}return`%`}),d!==u.length)throw Error(`parameter count mismatch`);return n.push(e),a}function o(r){return`function `+i(r||t)+`(`+(e&&e.join(`,`)||``)+`){
47
+ var t=null;try{t=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 n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var T=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var D=n.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isSafeInteger=function(){var e=this.high>>21;return e?this.unsigned?!1:e===-1&&!(this.low===0&&this.high===-2097152):!0},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},D.clz=D.countLeadingZeros,D.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},D.ctz=D.countTrailingZeros,D.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},D.rotl=D.rotateLeft,D.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},D.rotr=D.rotateRight,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},typeof BigInt==`function`&&(n.fromBigInt=function(e,t){return l(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},n.fromValue=function(e,t){return typeof e==`bigint`?n.fromBigInt(e,t):f(e,t)},D.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e}),e.default=n})})),xk=t((e=>{var t=e;t.asPromise=fk(),t.base64=pk(),t.EventEmitter=mk(),t.float=hk(),t.inquire=gk(),t.utf8=_k(),t.pool=vk(),t.LongBits=yk();function n(e){return e===`__proto__`||e===`prototype`||e===`constructor`}t.isUnsafeProperty=n,t.isNode=!!(typeof global<`u`&&global&&global.process&&global.process.versions&&global.process.versions.node),t.global=t.isNode&&global||typeof window<`u`&&window||typeof self<`u`&&self||e,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return typeof e==`string`||e instanceof String},t.isObject=function(e){return e&&typeof e==`object`},t.isset=t.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!=`object`||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1},t.Buffer=(function(){try{var e=t.global.Buffer;return e.prototype.utf8Write?e:null}catch{return null}})(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return typeof e==`number`?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):typeof Uint8Array>`u`?e:new Uint8Array(e)},t.Array=typeof Uint8Array<`u`?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||(function(){try{var e=bk();return e&&e.isLong?e:null}catch{return null}})(),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(!!n)};function r(e){var t=typeof arguments[arguments.length-1]==`boolean`,r=t?arguments.length-1:arguments.length;t&&=arguments[arguments.length-1];for(var i=1;i<r;++i){var a=arguments[i];if(a)for(var o=Object.keys(a),s=0;s<o.length;++s)!n(o[s])&&(e[o[s]]===void 0||!t)&&(e[o[s]]=a[o[s]])}return e}t.merge=r,t.nestingLimit=32,t.recursionLimit=100,t.makeProp=function(e,t){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0})},t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||``}),n&&r(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+`: `+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}t.newError=i,t.ProtocolError=i(`ProtocolError`),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(t[e[n]]===1&&this[e[n]]!==void 0&&this[e[n]]!==null)return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;if(!e){t._Buffer_from=t._Buffer_allocUnsafe=null;return}t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}})),Sk=t(((e,t)=>{t.exports=u;var n=xk(),r,i=n.LongBits,a=n.base64,o=n.utf8;function s(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new s(c,0,0),this.tail=this.head,this.states=null}var d=function(){return n.Buffer?function(){return(u.create=function(){return new r})()}:function(){return new u}};u.create=d(),u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,n){return this.tail=this.tail.next=new s(e,t,n),this.len+=t,this};function f(e,t,n){t[n]=e&255}function p(e,t,n){for(;e>127;)t[n++]=e&127|128,e>>>=7;t[n]=e}function m(e,t){this.len=e,this.next=void 0,this.val=t}m.prototype=Object.create(s.prototype),m.prototype.fn=p,u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new m((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return(e|=0)<0?this._push(h,10,i.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function h(e,t,n){for(var r=e.lo,i=e.hi;i;)t[n++]=r&127|128,r=(r>>>7|i<<25)>>>0,i>>>=7;for(;r>127;)t[n++]=r&127|128,r>>>=7;t[n++]=r}u.prototype.uint64=function(e){var t=i.from(e);return this._push(h,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(h,t.length(),t)},u.prototype.bool=function(e){return this._push(f,1,+!!e)};function g(e,t,n){t[n]=e&255,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}u.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var _=n.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(n.isString(e)){var r=u.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(_,t,e)},u.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(f,1,0)},u.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new s(c,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(c,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},u._configure=function(e){r=e,u.create=d(),r._configure()}})),Ck=t(((e,t)=>{t.exports=i;var n=Sk();(i.prototype=Object.create(n.prototype)).constructor=i;var r=xk();function i(){n.call(this)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&r.Buffer.prototype.set.name===`set`?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,`base64`));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this};function a(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()})),wk=t(((e,t)=>{t.exports=s;var n=xk(),r,i=n.LongBits,a=n.utf8;function o(e,t){return RangeError(`index out of range: `+e.pos+` + `+(t||1)+` > `+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c=typeof Uint8Array<`u`?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new s(e);throw Error(`illegal buffer`)}:function(e){if(Array.isArray(e))return new s(e);throw Error(`illegal buffer`)},l=function(){return n.Buffer?function(e){return(s.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c};s.create=l(),s.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,s.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return e}})(),s.prototype.int32=function(){return this.uint32()|0},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function u(){var e=new i(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,e}if(this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error(`invalid varint encoding`)}s.prototype.bool=function(){return this.uint32()!==0};function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}s.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return d(this.buf,this.pos+=4)|0};function f(){if(this.pos+8>this.len)throw o(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw o(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var i=n.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},s.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},s.prototype.skip=function(e){if(typeof e==`number`){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do if(this.pos>=this.len)throw o(this);while(this.buf[this.pos++]&128);return this},s.recursionLimit=n.recursionLimit,s.prototype.skipType=function(e,t){if(t===void 0&&(t=0),t>s.recursionLimit)throw Error(`maximum nesting depth exceeded`);switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!=4;)this.skipType(e,t+1);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type `+e+` at offset `+this.pos)}return this},s._configure=function(e){r=e,s.create=l(),r._configure();var t=n.Long?`toLong`:`toNumber`;n.merge(s.prototype,{int64:function(){return u.call(this)[t](!1)},uint64:function(){return u.call(this)[t](!0)},sint64:function(){return u.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}})),Tk=t(((e,t)=>{t.exports=i;var n=wk();(i.prototype=Object.create(n.prototype)).constructor=i;var r=xk();function i(e){n.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString(`utf-8`,this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()})),Ek=t(((e,t)=>{t.exports=r;var n=xk();(r.prototype=Object.create(n.EventEmitter.prototype)).constructor=r;function r(e,t,r){if(typeof e!=`function`)throw TypeError(`rpcImpl must be a function`);n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!r}r.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError(`request must be specified`);var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(!s.rpcImpl){setTimeout(function(){o(Error(`already ended`))},0);return}try{return s.rpcImpl(t,r[s.requestDelimited?`encodeDelimited`:`encode`](a).finish(),function(e,n){if(e)return s.emit(`error`,e,t),o(e);if(n===null){s.end(!0);return}if(!(n instanceof i))try{n=i[s.responseDelimited?`decodeDelimited`:`decode`](n)}catch(e){return s.emit(`error`,e,t),o(e)}return s.emit(`data`,n,t),o(null,n)})}catch(e){s.emit(`error`,e,t),setTimeout(function(){o(e)},0);return}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit(`end`).off()),this}})),Dk=t((e=>{var t=e;t.Service=Ek()})),Ok=t(((e,t)=>{t.exports={}})),kk=t((e=>{var t=e;t.build=`minimal`,t.Writer=Sk(),t.BufferWriter=Ck(),t.Reader=wk(),t.BufferReader=Tk(),t.util=xk(),t.rpc=Dk(),t.roots=Ok(),t.configure=n;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}n()})),Ak=t(((e,t)=>{t.exports=r;var n=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;function r(e,t){typeof e==`string`&&(t=e,e=void 0);var n=[];function a(e){if(typeof e!=`string`){var t=o();if(r.verbose&&console.log(`codegen: `+t),t=`return `+t,e){for(var i=Object.keys(e),s=Array(i.length+1),c=Array(i.length),l=0;l<i.length;)s[l]=i[l],c[l]=e[i[l++]];return s[l]=t,Function.apply(null,s).apply(null,c)}return Function(t)()}for(var u=Array(arguments.length-1),d=0;d<u.length;)u[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,function(e,t){var n=u[d++];switch(t){case`d`:case`f`:return String(Number(n));case`i`:return String(Math.floor(n));case`j`:return JSON.stringify(n);case`s`:return String(n)}return`%`}),d!==u.length)throw Error(`parameter count mismatch`);return n.push(e),a}function o(r){return`function `+i(r||t)+`(`+(e&&e.join(`,`)||``)+`){
48
48
  `+n.join(`
49
49
  `)+`
50
- }`}return a.toString=o,a}r.verbose=!1;function i(e){return!e||(e=String(e).replace(/[^\w$]/g,``),!e)?``:(/^\d/.test(e)&&(e=`_`+e),n.test(e)?e+`_`:e)}})),Ak=t(((e,t)=>{var n=null;try{n=s(`fs`),(!n||!n.readFile||!n.readFileSync)&&(n=null)}catch{}t.exports=n})),jk=t(((e,t)=>{t.exports=i;var n=dk(),r=Ak();function i(e,t,a){return typeof t==`function`?(a=t,t={}):t||={},a?!t.xhr&&r&&r.readFile?r.readFile(e,function(n,r){return n&&typeof XMLHttpRequest<`u`?i.xhr(e,t,a):n?a(n):a(null,t.binary?r:r.toString(`utf8`))}):i.xhr(e,t,a):n(i,this,e,t)}i.xhr=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===4){if(r.status!==0&&r.status!==200)return n(Error(`status `+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var i=0;i<r.responseText.length;++i)e.push(r.responseText.charCodeAt(i)&255)}return n(null,typeof Uint8Array<`u`?new Uint8Array(e):e)}return n(null,r.responseText)}},t.binary&&(`overrideMimeType`in r&&r.overrideMimeType(`text/plain; charset=x-user-defined`),r.responseType=`arraybuffer`),r.open(`GET`,e),r.send()}})),Mk=t((e=>{var t=e,n=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},r=t.normalize=function(e){e=e.replace(/\\/g,`/`).replace(/\/{2,}/g,`/`);var t=e.split(`/`),r=n(e),i=``;r&&(i=t.shift()+`/`);for(var a=0;a<t.length;)t[a]===`..`?a>0&&t[a-1]!==`..`?t.splice(--a,2):r?t.splice(a,1):++a:t[a]===`.`?t.splice(a,1):++a;return i+t.join(`/`)};t.resolve=function(e,t,i){return i||(t=r(t)),n(t)?t:(i||(e=r(e)),(e=e.replace(/(?:\/|^)[^/]+$/,``)).length?r(e+`/`+t):t)}})),Nk=t((e=>{var t=e;t.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,t.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,t.reservedRe=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/})),Pk=t(((e,t)=>{var n=null;try{n=s(`fs`),(!n||!n.readFile||!n.readFileSync)&&(n=null)}catch{}t.exports=n})),Fk=t(((e,t)=>{t.exports=u;var n=Yk();((u.prototype=Object.create(n.prototype)).constructor=u).className=`Namespace`;var r=qk(),i=Q(),a=Jk(),o,s,c;u.fromJSON=function(e,t,n){return n=i.checkDepth(n),new u(e,t.options).addJSON(t.nested,n)};function l(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}u.arrayToJSON=l,u.isReservedId=function(e,t){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!=`string`&&e[n][0]<=t&&e[n][1]>t)return!0}return!1},u.isReservedName=function(e,t){if(e){for(var n=0;n<e.length;++n)if(e[n]===t)return!0}return!1};function u(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null,this._lookupCache=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function d(e){e._nestedArray=null,e._lookupCache=Object.create(null);for(var t=e;t=t.parent;)t._lookupCache=Object.create(null);return e}Object.defineProperty(u.prototype,"nestedArray",{get:function(){return this._nestedArray||=i.toArray(this.nested)}}),u.prototype.toJSON=function(e){return i.toObject([`options`,this.options,`nested`,l(this.nestedArray,e)])},u.prototype.addJSON=function(e,t){t=i.checkDepth(t);var n=this;if(e)for(var a=Object.keys(e),l=0,d;l<a.length;++l)d=e[a[l]],n.add((d.fields===void 0?d.values===void 0?d.methods===void 0?d.id===void 0?u.fromJSON:r.fromJSON:s.fromJSON:c.fromJSON:o.fromJSON)(a[l],d,t+1));return this},u.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null},u.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&this.nested[e]instanceof c)return this.nested[e].values;throw Error(`no such enum: `+e)},u.prototype.add=function(e){if(!(e instanceof r&&e.extend!==void 0||e instanceof o||e instanceof a||e instanceof c||e instanceof s||e instanceof u))throw TypeError(`object must be a valid nested object`);if(e.name===`__proto__`)return this;if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof u&&e instanceof u&&!(t instanceof o||t instanceof s)){for(var n=t.nestedArray,i=0;i<n.length;++i)e.add(n[i]);this.remove(t),this.nested||={},e.setOptions(t.options,!0)}else throw Error(`duplicate name '`+e.name+`' in `+this)}this.nested[e.name]=e,this instanceof o||this instanceof s||this instanceof c||this instanceof r||(e._edition||=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var l=this;l=l.parent;)l._needsRecursiveFeatureResolution=!0,l._needsRecursiveResolve=!0;return e.onAdd(this),d(this)},u.prototype.remove=function(e){if(!(e instanceof n))throw TypeError(`object must be a ReflectionObject`);if(e.parent!==this)throw Error(e+` is not a member of `+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),d(this)},u.prototype.define=function(e,t){if(i.isString(e))e=e.split(`.`);else if(!Array.isArray(e))throw TypeError(`illegal path`);if(e&&e.length&&e[0]===``)throw Error(`path must be relative`);if(e.length>i.recursionLimit)throw Error(`max depth exceeded`);for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(n=n.nested[r],!(n instanceof u))throw Error(`path conflicts with non-namespace objects`)}else n.add(n=new u(r))}return t&&n.addJSON(t),n},u.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof u?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},u.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this},u.prototype.lookup=function(e,t,n){if(typeof t==`boolean`?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.isString(e)&&e.length){if(e===`.`)return this.root;e=e.split(`.`)}else if(!e.length)return this;var r=e.join(`.`);if(e[0]===``)return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects[`.`+r];if(a&&(!t||t.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,r),a&&(!t||t.indexOf(a.constructor)>-1)))return a;if(n)return null;for(var o=this;o.parent;){if(a=o.parent._lookupImpl(e,r),a&&(!t||t.indexOf(a.constructor)>-1))return a;o=o.parent}return null},u.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var n=this.get(e[0]),r=null;if(n)e.length===1?r=n:n instanceof u&&(e=e.slice(1),r=n._lookupImpl(e,e.join(`.`)));else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof u&&(n=this._nestedArray[i]._lookupImpl(e,t))){r=n;break}return this._lookupCache[t]=r,r},u.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error(`no such type: `+e);return t},u.prototype.lookupEnum=function(e){var t=this.lookup(e,[c]);if(!t)throw Error(`no such Enum '`+e+`' in `+this);return t},u.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,c]);if(!t)throw Error(`no such Type or Enum '`+e+`' in `+this);return t},u.prototype.lookupService=function(e){var t=this.lookup(e,[s]);if(!t)throw Error(`no such Service '`+e+`' in `+this);return t},u._configure=function(e,t,n){o=e,s=t,c=n}})),Ik=t(((e,t)=>{t.exports=a;var n=qk();((a.prototype=Object.create(n.prototype)).constructor=a).className=`MapField`;var r=Kk(),i=Q();function a(e,t,r,a,o,s){if(n.call(this,e,t,a,void 0,void 0,o,s),!i.isString(r))throw TypeError(`keyType must be a string`);this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`keyType`,this.keyType,`type`,this.type,`id`,this.id,`extend`,this.extend,`options`,this.options,`comment`,t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(r.mapKey[this.keyType]===void 0)throw Error(`invalid key type: `+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,n){return typeof n==`function`?n=i.decorateType(n).name:n&&typeof n==`object`&&(n=i.decorateEnum(n).name),function(r,o){i.decorateType(r.constructor).add(new a(o,e,t,n))}}})),Lk=t(((e,t)=>{t.exports=i;var n=Yk();((i.prototype=Object.create(n.prototype)).constructor=i).className=`Method`;var r=Q();function i(e,t,i,a,o,s,c,l,u){if(r.isObject(o)?(c=o,o=s=void 0):r.isObject(s)&&(c=s,s=void 0),!(t===void 0||r.isString(t)))throw TypeError(`type must be a string`);if(!r.isString(i))throw TypeError(`requestType must be a string`);if(!r.isString(a))throw TypeError(`responseType must be a string`);n.call(this,e,c),this.type=t||`rpc`,this.requestType=i,this.requestStream=o?!0:void 0,this.responseType=a,this.responseStream=s?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=u}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return r.toObject([`type`,this.type!==`rpc`&&this.type||void 0,`requestType`,this.requestType,`requestStream`,this.requestStream,`responseType`,this.responseType,`responseStream`,this.responseStream,`options`,this.options,`comment`,t?this.comment:void 0,`parsedOptions`,this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}})),Rk=t(((e,t)=>{t.exports=s;var n=Fk();((s.prototype=Object.create(n.prototype)).constructor=s).className=`Service`;var r=Lk(),i=Q(),a=Ek(),o=i.patterns.reservedRe;function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}s.fromJSON=function(e,t,n){n=i.checkDepth(n);var a=new s(e,t.options);if(t.methods)for(var o=Object.keys(t.methods),c=0;c<o.length;++c)a.add(r.fromJSON(o[c],t.methods[o[c]]));return t.nested&&a.addJSON(t.nested,n),t.edition&&(a._edition=t.edition),a.comment=t.comment,a._defaultEdition=`proto3`,a},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return i.toObject([`edition`,this._editionToJSON(),`options`,t&&t.options||void 0,`methods`,n.arrayToJSON(this.methodsArray,e)||{},`nested`,t&&t.nested||void 0,`comment`,r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||=i.toArray(this.methods)}});function c(e){return e._methodsArray=null,e}s.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;n.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this},s.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this},s.prototype.add=function(e){if(this.get(e.name))throw Error(`duplicate name '`+e.name+`' in `+this);return e instanceof r?e.name===`__proto__`?this:(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof r){if(this.methods[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,n){for(var r=new a.Service(e,t,n),s=0,c;s<this.methodsArray.length;++s){var l=i.lcFirst((c=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,``);r[l]=i.codegen([`r`,`c`],o.test(l)?l+`_`:l)(`return this.rpcCall(m,q,s,r,c)`)({m:c,q:c.resolvedRequestType.ctor,s:c.resolvedResponseType.ctor})}return r}})),zk=t(((e,t)=>{t.exports=r;var n=bk();function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n){var r=t[n];r!==`__proto__`&&(this[r]=e[r])}}r.create=function(e){return this.$type.create(e)},r.encode=function(e,t){return this.$type.encode(e,t)},r.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},r.decode=function(e){return this.$type.decode(e)},r.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},r.verify=function(e){return this.$type.verify(e)},r.fromObject=function(e){return this.$type.fromObject(e)},r.toObject=function(e,t){return this.$type.toObject(e,t)},r.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}})),Bk=t(((e,t)=>{t.exports=o;var n=Xk(),r=Kk(),i=Q();function a(e){return`missing required '`+e.name+`'`}function o(e){for(var t=i.codegen([`r`,`l`,`e`,`n`],e.name+`$decode`)(`if(!(r instanceof Reader))`)(`r=Reader.create(r)`)(`if(n===undefined)n=0`)(`if(n>Reader.recursionLimit)`)(`throw Error("maximum nesting depth exceeded")`)(`var c=l===undefined?r.len:r.pos+l,m=new this.ctor`+(e.fieldsArray.filter(function(e){return e.map}).length?`,k,value`:``))(`while(r.pos<c){`)(`var t=r.uint32()`)(`if(t===e)`)(`break`)(`switch(t>>>3){`),o=0;o<e.fieldsArray.length;++o){var s=e._fieldsArray[o].resolve(),c=s.resolvedType instanceof n?`int32`:s.type,l=`m`+i.safeProp(s.name);t(`case %i: {`,s.id),s.map?(t(`if(%s===util.emptyObject)`,l)(`%s={}`,l)(`var c2 = r.uint32()+r.pos`),r.defaults[s.keyType]===void 0?t(`k=null`):t(`k=%j`,r.defaults[s.keyType]),r.defaults[c]===void 0?t(`value=null`):t(`value=%j`,r.defaults[c]),t(`while(r.pos<c2){`)(`var tag2=r.uint32()`)(`switch(tag2>>>3){`)(`case 1: k=r.%s(); break`,s.keyType)(`case 2:`),r.basic[c]===void 0?t(`value=types[%i].decode(r,r.uint32(),undefined,n+1)`,o):t(`value=r.%s()`,c),t(`break`)(`default:`)(`r.skipType(tag2&7,n)`)(`break`)(`}`)(`}`),r.long[s.keyType]===void 0?(s.keyType===`string`&&t(`if(k==="__proto__")`)(`util.makeProp(%s,k)`,l),t(`%s[k]=value`,l)):t(`%s[typeof k==="object"?util.longToHash(k):k]=value`,l)):s.repeated?(t(`if(!(%s&&%s.length))`,l,l)(`%s=[]`,l),r.packed[c]!==void 0&&t(`if((t&7)===2){`)(`var c2=r.uint32()+r.pos`)(`while(r.pos<c2)`)(`%s.push(r.%s())`,l,c)(`}else`),r.basic[c]===void 0?t(s.delimited?`%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))`:`%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))`,l,o):t(`%s.push(r.%s())`,l,c)):r.basic[c]===void 0?t(s.delimited?`%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)`:`%s=types[%i].decode(r,r.uint32(),undefined,n+1)`,l,o):t(`%s=r.%s()`,l,c),t(`break`)(`}`)}for(t(`default:`)(`r.skipType(t&7,n)`)(`break`)(`}`)(`}`),o=0;o<e._fieldsArray.length;++o){var u=e._fieldsArray[o];u.required&&t(`if(!m.hasOwnProperty(%j))`,u.name)(`throw util.ProtocolError(%j,{instance:m})`,a(u))}return t(`return m`)}})),Vk=t(((e,t)=>{t.exports=s;var n=Xk(),r=Q();function i(e,t){return e.name+`: `+t+(e.repeated&&t!==`array`?`[]`:e.map&&t!==`object`?`{k:`+e.keyType+`}`:``)+` expected`}function a(e,t,r,a){if(t.resolvedType)if(t.resolvedType instanceof n){e(`switch(%s){`,a)(`default:`)(`return%j`,i(t,`enum value`));for(var o=Object.keys(t.resolvedType.values),s=0;s<o.length;++s)e(`case %i:`,t.resolvedType.values[o[s]]);e(`break`)(`}`)}else e(`{`)(`var e=types[%i].verify(%s,n+1);`,r,a)(`if(e)`)(`return%j+e`,t.name+`.`)(`}`);else switch(t.type){case`int32`:case`uint32`:case`sint32`:case`fixed32`:case`sfixed32`:e(`if(!util.isInteger(%s))`,a)(`return%j`,i(t,`integer`));break;case`int64`:case`uint64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))`,a,a,a,a)(`return%j`,i(t,`integer|Long`));break;case`float`:case`double`:e(`if(typeof %s!=="number")`,a)(`return%j`,i(t,`number`));break;case`bool`:e(`if(typeof %s!=="boolean")`,a)(`return%j`,i(t,`boolean`));break;case`string`:e(`if(!util.isString(%s))`,a)(`return%j`,i(t,`string`));break;case`bytes`:e(`if(!(%s&&typeof %s.length==="number"||util.isString(%s)))`,a,a,a)(`return%j`,i(t,`buffer`));break}return e}function o(e,t,n){switch(t.keyType){case`int32`:case`uint32`:case`sint32`:case`fixed32`:case`sfixed32`:e(`if(!util.key32Re.test(%s))`,n)(`return%j`,i(t,`integer key`));break;case`int64`:case`uint64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(!util.key64Re.test(%s))`,n)(`return%j`,i(t,`integer|Long key`));break;case`bool`:e(`if(!util.key2Re.test(%s))`,n)(`return%j`,i(t,`boolean key`));break}return e}function s(e){var t=r.codegen([`m`,`n`],e.name+`$verify`)(`if(typeof m!=="object"||m===null)`)(`return%j`,`object expected`)(`if(n===undefined)n=0`)(`if(n>util.recursionLimit)`)(`return%j`,`maximum nesting depth exceeded`),n=e.oneofsArray,s={};n.length&&t(`var p={}`);for(var c=0;c<e.fieldsArray.length;++c){var l=e._fieldsArray[c].resolve(),u=`m`+r.safeProp(l.name);if(l.optional&&t(`if(%s!=null&&m.hasOwnProperty(%j)){`,u,l.name),l.map)t(`if(!util.isObject(%s))`,u)(`return%j`,i(l,`object`))(`var k=Object.keys(%s)`,u)(`for(var i=0;i<k.length;++i){`),o(t,l,`k[i]`),a(t,l,c,u+`[k[i]]`)(`}`);else if(l.repeated)t(`if(!Array.isArray(%s))`,u)(`return%j`,i(l,`array`))(`for(var i=0;i<%s.length;++i){`,u),a(t,l,c,u+`[i]`)(`}`);else{if(l.partOf){var d=r.safeProp(l.partOf.name);s[l.partOf.name]===1&&t(`if(p%s===1)`,d)(`return%j`,l.partOf.name+`: multiple values`),s[l.partOf.name]=1,t(`p%s=1`,d)}a(t,l,c,u)}l.optional&&t(`}`)}return t(`return null`)}})),Hk=t((e=>{var t=e,n=Xk(),r=Q();function i(e,t,r,i){var a=!1;if(t.resolvedType)if(t.resolvedType instanceof n){e(`switch(d%s){`,i);for(var o=t.resolvedType.values,s=Object.keys(o),c=0;c<s.length;++c)o[s[c]]===t.typeDefault&&!a&&(e(`default:`)(`if(typeof(d%s)==="number"){m%s=d%s;break}`,i,i,i),t.repeated||e(`break`),a=!0),e(`case%j:`,s[c])(`case %i:`,o[s[c]])(`m%s=%j`,i,o[s[c]])(`break`);e(`}`)}else e(`if(typeof d%s!=="object")`,i)(`throw TypeError(%j)`,t.fullName+`: object expected`)(`m%s=types[%i].fromObject(d%s,n+1)`,i,r,i);else{var l=!1;switch(t.type){case`double`:case`float`:e(`m%s=Number(d%s)`,i,i);break;case`uint32`:case`fixed32`:e(`m%s=d%s>>>0`,i,i);break;case`int32`:case`sint32`:case`sfixed32`:e(`m%s=d%s|0`,i,i);break;case`uint64`:case`fixed64`:l=!0;case`int64`:case`sint64`:case`sfixed64`:e(`if(util.Long)`)(`m%s=util.Long.fromValue(d%s,%j)`,i,i,l)(`else if(typeof d%s==="string")`,i)(`m%s=parseInt(d%s,10)`,i,i)(`else if(typeof d%s==="number")`,i)(`m%s=d%s`,i,i)(`else if(typeof d%s==="object")`,i)(`m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)`,i,i,i,l?`true`:``);break;case`bytes`:e(`if(typeof d%s==="string")`,i)(`util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)`,i,i,i)(`else if(d%s.length >= 0)`,i)(`m%s=d%s`,i,i);break;case`string`:e(`m%s=String(d%s)`,i,i);break;case`bool`:e(`m%s=Boolean(d%s)`,i,i);break}}return e}t.fromObject=function(e){var t=e.fieldsArray,a=r.codegen([`d`,`n`],e.name+`$fromObject`)(`if(d instanceof this.ctor)`)(`return d`)(`if(n===undefined)n=0`)(`if(n>util.recursionLimit)`)(`throw Error("maximum nesting depth exceeded")`);if(!t.length)return a(`return new this.ctor`);a(`var m=new this.ctor`);for(var o=0;o<t.length;++o){var s=t[o].resolve(),c=r.safeProp(s.name);s.map?(a(`if(d%s){`,c)(`if(typeof d%s!=="object")`,c)(`throw TypeError(%j)`,s.fullName+`: object expected`)(`m%s={}`,c)(`for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){`,c),a(`if(ks[i]==="__proto__")`)(`util.makeProp(m%s,ks[i])`,c),i(a,s,o,c+`[ks[i]]`)(`}`)(`}`)):s.repeated?(a(`if(d%s){`,c)(`if(!Array.isArray(d%s))`,c)(`throw TypeError(%j)`,s.fullName+`: array expected`)(`m%s=[]`,c)(`for(var i=0;i<d%s.length;++i){`,c),i(a,s,o,c+`[i]`)(`}`)(`}`)):(s.resolvedType instanceof n||a(`if(d%s!=null){`,c),i(a,s,o,c),s.resolvedType instanceof n||a(`}`))}return a(`return m`)};function a(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof n?e(`d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s`,i,r,i,i,r,i,i):e(`d%s=types[%i].toObject(m%s,o,q+1)`,i,r,i);else{var a=!1;switch(t.type){case`double`:case`float`:e(`d%s=o.json&&!isFinite(m%s)?String(m%s):m%s`,i,i,i,i);break;case`uint64`:case`fixed64`:a=!0;case`int64`:case`sint64`:case`sfixed64`:e(`if(typeof BigInt!=="undefined"&&o.longs===BigInt)`)(`d%s=typeof m%s==="number"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()`,i,i,i,i,i,a)(`else if(typeof m%s==="number")`,i)(`d%s=o.longs===String?String(m%s):m%s`,i,i,i)(`else`)(`d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s`,i,i,i,i,a?`true`:``,i);break;case`bytes`:e(`d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s`,i,i,i,i,i);break;default:e(`d%s=m%s`,i,i);break}}return e}t.toObject=function(e){var t=e.fieldsArray.slice().sort(r.compareFieldsById);if(!t.length)return r.codegen()(`return {}`);for(var i=r.codegen([`m`,`o`,`q`],e.name+`$toObject`)(`if(!o)`)(`o={}`)(`if(q===undefined)q=0`)(`if(q>util.recursionLimit)`)(`throw Error("max depth exceeded")`)(`var d={}`),o=[],s=[],c=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?o:t[l].map?s:c).push(t[l]);if(o.length){for(i(`if(o.arrays||o.defaults){`),l=0;l<o.length;++l)i(`d%s=[]`,r.safeProp(o[l].name));i(`}`)}if(s.length){for(i(`if(o.objects||o.defaults){`),l=0;l<s.length;++l)i(`d%s={}`,r.safeProp(s[l].name));i(`}`)}if(c.length){for(i(`if(o.defaults){`),l=0;l<c.length;++l){var u=c[l],d=r.safeProp(u.name);if(u.resolvedType instanceof n)i(`d%s=o.enums===String?%j:%j`,d,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)i(`if(util.Long){`)(`var n=new util.Long(%i,%i,%j)`,u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)(`d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!=="undefined"&&o.longs===BigInt?n.toBigInt():n`,d)(`}else`)(`d%s=o.longs===String?%j:typeof BigInt!=="undefined"&&o.longs===BigInt?BigInt(%j):%i`,d,u.typeDefault.toString(),u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var f=Array.prototype.slice.call(u.typeDefault);i(`if(o.bytes===String)d%s=%j`,d,String.fromCharCode.apply(String,u.typeDefault))(`else{`)(`d%s=%j`,d,f)(`if(o.bytes!==Array)d%s=util.newBuffer(d%s)`,d,d)(`}`)}else i(`d%s=%j`,d,u.typeDefault)}i(`}`)}var p=!1;for(l=0;l<t.length;++l){var u=t[l],m=e._fieldsArray.indexOf(u),d=r.safeProp(u.name);u.map?(p||(p=!0,i(`var ks2`)),i(`if(m%s&&(ks2=Object.keys(m%s)).length){`,d,d)(`d%s={}`,d)(`for(var j=0;j<ks2.length;++j){`),i(`if(ks2[j]==="__proto__")`)(`util.makeProp(d%s,ks2[j])`,d),a(i,u,m,d+`[ks2[j]]`)(`}`)):u.repeated?(i(`if(m%s&&m%s.length){`,d,d)(`d%s=[]`,d)(`for(var j=0;j<m%s.length;++j){`,d),a(i,u,m,d+`[j]`)(`}`)):(i(`if(m%s!=null&&m.hasOwnProperty(%j)){`,d,u.name),a(i,u,m,d),u.partOf&&i(`if(o.oneofs)`)(`d%s=%j`,r.safeProp(u.partOf.name),u.name)),i(`}`)}return i(`return d`)}})),Uk=t((e=>{var t=e,n=zk(),r=bk();t[`.google.protobuf.Any`]={fromObject:function(e,t){if(e&&e[`@type`]){var n=e[`@type`].substring(e[`@type`].lastIndexOf(`/`)+1),r=this.lookup(n);if(r){var i=e[`@type`].charAt(0)===`.`?e[`@type`].slice(1):e[`@type`];return i.indexOf(`/`)===-1&&(i=`/`+i),this.create({type_url:i,value:r.encode(r.fromObject(e,t===void 0?1:t+1)).finish()})}}return this.fromObject(e,t)},toObject:function(e,t,i){if(i===void 0&&(i=0),i>r.recursionLimit)throw Error(`max depth exceeded`);var a=`type.googleapis.com/`,o=``,s=``;if(t&&t.json&&e.type_url&&e.value){s=e.type_url.substring(e.type_url.lastIndexOf(`/`)+1),o=e.type_url.substring(0,e.type_url.lastIndexOf(`/`)+1);var c=this.lookup(s);c&&(e=c.decode(e.value,void 0,void 0,i+1))}if(!(e instanceof this.ctor)&&e instanceof n){var l=e.$type.toObject(e,t,i+1),u=e.$type.fullName[0]===`.`?e.$type.fullName.slice(1):e.$type.fullName;return o===``&&(o=a),s=o+u,l[`@type`]=s,l}return this.toObject(e,t,i)}}})),Wk=t(((e,t)=>{t.exports=_;var n=Fk();((_.prototype=Object.create(n.prototype)).constructor=_).className=`Type`;var r=Xk(),i=Jk(),a=qk(),o=Ik(),s=Rk(),c=zk(),l=Ck(),u=xk(),d=Q(),f=Zk(),p=Bk(),m=Vk(),h=Hk(),g=Uk();function _(e,t){e=e.replace(/\W/g,``),n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(_.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error(`duplicate id `+r+` in `+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||=d.toArray(this.fields)}},oneofsArray:{get:function(){return this._oneofsArray||=d.toArray(this.oneofs)}},ctor:{get:function(){return this._ctor||(this.ctor=_.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.merge(e,c,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:d.oneOfGetter(this._oneofsArray[n].oneof),set:d.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),_.generateConstructor=function(e){for(var t=d.codegen([`p`],e.name),n=0,r;n<e.fieldsArray.length;++n)(r=e._fieldsArray[n]).map?t(`this%s={}`,d.safeProp(r.name)):r.repeated&&t(`this%s=[]`,d.safeProp(r.name));return t(`if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")`)(`this[ks[i]]=p[ks[i]]`)};function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}_.fromJSON=function(e,t,c){if(c===void 0&&(c=0),c>d.nestingLimit)throw Error(`max depth exceeded`);var l=new _(e,t.options);l.extensions=t.extensions,l.reserved=t.reserved;for(var u=Object.keys(t.fields),f=0;f<u.length;++f)l.add((t.fields[u[f]].keyType===void 0?a.fromJSON:o.fromJSON)(u[f],t.fields[u[f]]));if(t.oneofs)for(u=Object.keys(t.oneofs),f=0;f<u.length;++f)l.add(i.fromJSON(u[f],t.oneofs[u[f]]));if(t.nested)for(u=Object.keys(t.nested),f=0;f<u.length;++f){var p=t.nested[u[f]];l.add((p.id===void 0?p.fields===void 0?p.values===void 0?p.methods===void 0?n.fromJSON:s.fromJSON:r.fromJSON:_.fromJSON:a.fromJSON)(u[f],p,c+1))}return t.extensions&&t.extensions.length&&(l.extensions=t.extensions),t.reserved&&t.reserved.length&&(l.reserved=t.reserved),t.group&&(l.group=!0),t.comment&&(l.comment=t.comment),t.edition&&(l._edition=t.edition),l._defaultEdition=`proto3`,l},_.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return d.toObject([`edition`,this._editionToJSON(),`options`,t&&t.options||void 0,`oneofs`,n.arrayToJSON(this.oneofsArray,e),`fields`,n.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),e)||{},`extensions`,this.extensions&&this.extensions.length?this.extensions:void 0,`reserved`,this.reserved&&this.reserved.length?this.reserved:void 0,`group`,this.group||void 0,`nested`,t&&t.nested||void 0,`comment`,r?this.comment:void 0])},_.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;n.prototype.resolveAll.call(this);var e=this.oneofsArray;for(r=0;r<e.length;)e[r++].resolve();for(var t=this.fieldsArray,r=0;r<t.length;)t[r++].resolve();return this},_.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=>{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=>{t._resolveFeatures(e)}),this):this},_.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null},_.prototype.add=function(e){if(this.get(e.name))throw Error(`duplicate name '`+e.name+`' in `+this);if(e instanceof a&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error(`duplicate id `+e.id+` in `+this);if(this.isReservedId(e.id))throw Error(`id `+e.id+` is reserved in `+this);if(this.isReservedName(e.name))throw Error(`name '`+e.name+`' is reserved in `+this);return e.name===`__proto__`?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),v(this))}return e instanceof i?e.name===`__proto__`?this:(this.oneofs||={},this.oneofs[e.name]=e,e.onAdd(this),v(this)):n.prototype.add.call(this,e)},_.prototype.remove=function(e){if(e instanceof a&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),v(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),v(this)}return n.prototype.remove.call(this,e)},_.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},_.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},_.prototype.create=function(e){return new this.ctor(e)},_.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=f(this)({Writer:u,types:t,util:d}),this.decode=p(this)({Reader:l,types:t,util:d}),this.verify=m(this)({types:t,util:d}),this.fromObject=h.fromObject(this)({types:t,util:d}),this.toObject=h.toObject(this)({types:t,util:d});var r=g[e];if(r){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(i),i.toObject=this.toObject,this.toObject=r.toObject.bind(i)}return this},_.prototype.encode=function(e,t){return this.setup().encode.apply(this,arguments)},_.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},_.prototype.decode=function(e,t,n,r){return this.setup().decode(e,t,n,r)},_.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},_.prototype.verify=function(e,t){return this.setup().verify(e,t)},_.prototype.fromObject=function(e,t){return this.setup().fromObject(e,t)},_.prototype.toObject=function(e,t){return this.setup().toObject.apply(this,arguments)},_.d=function(e){return function(t){d.decorateType(t,e)}}})),Gk=t(((e,t)=>{t.exports=u;var n=Fk();((u.prototype=Object.create(n.prototype)).constructor=u).className=`Root`;var r=qk(),i=Xk(),a=Jk(),o=Q(),s,c,l;function u(e){n.call(this,``,e),this.deferred=[],this.files=[],this._edition=`proto2`,this._fullyQualifiedObjects={}}u.fromJSON=function(e,t,n){return n=o.checkDepth(n),t||=new u,e.options&&t.setOptions(e.options),t.addJSON(e.nested,n).resolveAll()},u.prototype.resolvePath=o.path.resolve,u.prototype.fetch=o.fetch;function d(){}u.prototype.load=function e(t,n,r){typeof n==`function`&&(r=n,n=void 0);var i=this;if(!r)return o.asPromise(e,i,t,n);var a=r===d;function s(e,t){if(r){if(a)throw e;t&&t.resolveAll();var n=r;r=null,n(e,t)}}function u(e){var t=e.lastIndexOf(`google/protobuf/`);if(t>-1){var n=e.substring(t);if(n in l)return n}return null}function f(e,t,r){r===void 0&&(r=0);try{if(r>o.recursionLimit)throw Error(`max depth exceeded`);if(o.isString(t)&&t.charAt(0)===`{`&&(t=JSON.parse(t)),!o.isString(t))i.setOptions(t.options).addJSON(t.nested);else{c.filename=e;var l=c(t,i,n),d,f=0;if(l.imports)for(;f<l.imports.length;++f)(d=u(l.imports[f])||i.resolvePath(e,l.imports[f]))&&p(d,!1,r+1);if(l.weakImports)for(f=0;f<l.weakImports.length;++f)(d=u(l.weakImports[f])||i.resolvePath(e,l.weakImports[f]))&&p(d,!0,r+1)}}catch(e){s(e)}!a&&!m&&s(null,i)}function p(e,t,n){if(n===void 0&&(n=0),e=u(e)||e,!(i.files.indexOf(e)>-1)){if(i.files.push(e),e in l){a?f(e,l[e],n):(++m,setTimeout(function(){--m,f(e,l[e],n)}));return}if(a){var c;try{c=o.fs.readFileSync(e).toString(`utf8`)}catch(e){t||s(e);return}f(e,c,n)}else++m,i.fetch(e,function(a,o){if(--m,r){if(a){t?m||s(null,i):s(a);return}f(e,o,n)}})}}var m=0;o.isString(t)&&(t=[t]);for(var h=0,g;h<t.length;++h)(g=i.resolvePath(``,t[h]))&&p(g);return a?(i.resolveAll(),i):(m||s(null,i),i)},u.prototype.loadSync=function(e,t){if(!o.isNode)throw Error(`not supported`);return this.load(e,t,d)},u.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error(`unresolvable extensions: `+this.deferred.map(function(e){return`'extend `+e.extend+`' in `+e.parent.fullName}).join(`, `));return n.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function p(e,t){var n=t.parent.lookup(t.extend);if(n){var i=new r(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.get(i.name)?!0:(i.declaringField=t,t.extensionField=i,n.add(i),!0)}return!1}u.prototype._handleAdd=function(e){if(e instanceof r)e.extend!==void 0&&!e.extensionField&&(p(this,e)||this.deferred.push(e));else if(e instanceof i)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof s)for(var t=0;t<this.deferred.length;)p(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);f.test(e.name)&&(e.parent[e.name]=e)}(e instanceof s||e instanceof i||e instanceof r)&&(this._fullyQualifiedObjects[e.fullName]=e)},u.prototype._handleRemove=function(e){if(e instanceof r){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof i)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var a=0;a<e.nestedArray.length;++a)this._handleRemove(e._nestedArray[a]);f.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]},u._configure=function(e,t,n){s=e,c=t,l=n}})),Q=t(((e,t)=>{var n=t.exports=bk(),r=Dk(),i,a;n.codegen=kk(),n.fetch=jk(),n.path=Mk(),n.patterns=Nk();var o=n.patterns.reservedRe;n.fs=Pk(),n.checkDepth=function(e){if(e===void 0&&(e=0),e>n.recursionLimit)throw Error(`max depth exceeded`);return e},n.toArray=function(e){if(e){for(var t=Object.keys(e),n=Array(t.length),r=0;r<t.length;)n[r]=e[t[r++]];return n}return[]},n.toObject=function(e){for(var t={},n=0;n<e.length;){var r=e[n++],i=e[n++];i!==void 0&&(t[r]=i)}return t},n.isReserved=function(e){return o.test(e)},n.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.test(e)?`[`+JSON.stringify(e)+`]`:`.`+e},n.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var s=/_([a-z])/g;n.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(s,function(e,t){return t.toUpperCase()})},n.compareFieldsById=function(e,t){return e.id-t.id},n.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(n.decorateRoot.remove(e.$type),e.$type.name=t,n.decorateRoot.add(e.$type)),e.$type;i||=Wk();var r=new i(t||e.name);return n.decorateRoot.add(r),r.ctor=e,Object.defineProperty(e,"$type",{value:r,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:r,enumerable:!1}),r};var c=0;n.decorateEnum=function(e){if(e.$type)return e.$type;a||=Xk();var t=new a(`Enum`+c++,e);return n.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},n.setProperty=function(e,t,r,i){function a(e,t,r){var o=t.shift();if(n.isUnsafeProperty(o))return e;if(t.length>0)e[o]=a(e[o]||{},t,r);else{var s=e[o];if(s&&i)return e;s&&(r=[].concat(s,r)),e[o]=r}return e}if(typeof e!=`object`)throw TypeError(`dst must be an object`);if(!t)throw TypeError(`path must be specified`);if(t=t.split(`.`),t.length>n.recursionLimit)throw Error(`max depth exceeded`);return a(e,t,r)},Object.defineProperty(n,"decorateRoot",{get:function(){return r.decorated||=new(Gk())}})})),Kk=t((e=>{var t=e,n=Q(),r=[`double`,`float`,`int32`,`uint32`,`sint32`,`fixed32`,`sfixed32`,`int64`,`uint64`,`sint64`,`fixed64`,`sfixed64`,`bool`,`string`,`bytes`];function i(e,t){var n=0,i=Object.create(null);for(t|=0;n<e.length;)i[r[n+t]]=e[n++];return i}t.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),t.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,``,n.emptyArray,null]),t.long=i([0,0,0,1,1],7),t.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),t.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])})),qk=t(((e,t)=>{t.exports=c;var n=Yk();((c.prototype=Object.create(n.prototype)).constructor=c).className=`Field`;var r=Xk(),i=Kk(),a=Q(),o,s=/^required|optional|repeated$/;c.fromJSON=function(e,t){var n=new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(n._edition=t.edition),n._defaultEdition=`proto3`,n};function c(e,t,r,o,c,l,u){if(a.isObject(o)?(u=c,l=o,o=c=void 0):a.isObject(c)&&(u=l,l=c,c=void 0),n.call(this,e,l),!a.isInteger(t)||t<0)throw TypeError(`id must be a non-negative integer`);if(!a.isString(r))throw TypeError(`type must be a string`);if(o!==void 0&&!s.test(o=o.toString().toLowerCase()))throw TypeError(`rule must be a string rule`);if(c!==void 0&&!a.isString(c))throw TypeError(`extend must be a string`);o===`proto3_optional`&&(o=`optional`),this.rule=o&&o!==`optional`?o:void 0,this.type=r,this.id=t,this.extend=c||void 0,this.repeated=o===`repeated`,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=a.Long?i.long[r]!==void 0:!1,this.bytes=r===`bytes`,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=u}Object.defineProperty(c.prototype,"required",{get:function(){return this._features.field_presence===`LEGACY_REQUIRED`}}),Object.defineProperty(c.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(c.prototype,"delimited",{get:function(){return this.resolvedType instanceof o&&this._features.message_encoding===`DELIMITED`}}),Object.defineProperty(c.prototype,"packed",{get:function(){return this._features.repeated_field_encoding===`PACKED`}}),Object.defineProperty(c.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!==`IMPLICIT`}}),c.prototype.setOption=function(e,t,r){return n.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return a.toObject([`edition`,this._editionToJSON(),`rule`,this.rule!==`optional`&&this.rule||void 0,`type`,this.type,`id`,this.id,`extend`,this.extend,`options`,this.options,`comment`,t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=i.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&typeof this.typeDefault==`string`&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof r)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,this.type===`uint64`||this.type===`fixed64`),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault==`string`){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},c.prototype._inferLegacyProtoFeatures=function(e){if(e!==`proto2`&&e!==`proto3`)return{};var t={};if(this.rule===`required`&&(t.field_presence=`LEGACY_REQUIRED`),this.parent&&i.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(`.`).pop());n&&n instanceof o&&n.group&&(t.message_encoding=`DELIMITED`)}return this.getOption(`packed`)===!0?t.repeated_field_encoding=`PACKED`:this.getOption(`packed`)===!1&&(t.repeated_field_encoding=`EXPANDED`),t},c.prototype._resolveFeatures=function(e){return n.prototype._resolveFeatures.call(this,this._edition||e)},c.d=function(e,t,n,r){return typeof t==`function`?t=a.decorateType(t).name:t&&typeof t==`object`&&(t=a.decorateEnum(t).name),function(i,o){a.decorateType(i.constructor).add(new c(o,e,t,n,{default:r}))}},c._configure=function(e){o=e}})),Jk=t(((e,t)=>{t.exports=a;var n=Yk();((a.prototype=Object.create(n.prototype)).constructor=a).className=`OneOf`;var r=qk(),i=Q();function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),!(t===void 0||Array.isArray(t)))throw TypeError(`fieldNames must be an Array`);this.oneof=t||[],this.fieldsArray=[],this.comment=i}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`options`,this.options,`oneof`,this.oneof,`comment`,t?this.comment:void 0])};function o(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.prototype.add=function(e){if(!(e instanceof r))throw TypeError(`field must be a Field`);return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,o(this),this},a.prototype.remove=function(e){if(!(e instanceof r))throw TypeError(`field must be a Field`);var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+` is not a member of `+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=this,r=0;r<this.oneof.length;++r){var i=e.get(this.oneof[r]);i&&!i.partOf&&(i.partOf=t,t.fieldsArray.push(i))}o(this)},a.prototype.onRemove=function(e){for(var t=0,r;t<this.fieldsArray.length;++t)(r=this.fieldsArray[t]).parent&&r.parent.remove(r);n.prototype.onRemove.call(this,e)},Object.defineProperty(a.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var e=this.fieldsArray[0];return e.options!=null&&e.options.proto3_optional===!0}}),a.d=function(){for(var e=Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){i.decorateType(t.constructor).add(new a(n,e)),Object.defineProperty(t,n,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}})),Yk=t(((e,t)=>{t.exports=c,c.className=`ReflectionObject`;let n=Jk();var r=Q(),i,a={enum_type:`OPEN`,field_presence:`EXPLICIT`,json_format:`ALLOW`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`PACKED`,utf8_validation:`VERIFY`},o={enum_type:`CLOSED`,field_presence:`EXPLICIT`,json_format:`LEGACY_BEST_EFFORT`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`EXPANDED`,utf8_validation:`NONE`},s={enum_type:`OPEN`,field_presence:`IMPLICIT`,json_format:`ALLOW`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`PACKED`,utf8_validation:`VERIFY`};function c(e,t){if(!r.isString(e))throw TypeError(`name must be a string`);if(t&&!r.isObject(t))throw TypeError(`options must be an object`);this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition=`proto2`,this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(c.prototype,{root:{get:function(){for(var e=this;e.parent!==null;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(`.`)}}}),c.prototype.toJSON=function(){throw Error()},c.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},c.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},c.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},c.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},c.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw Error(`Unknown edition for `+this.fullName);var i=r.merge({},this.options&&this.options.features,this._inferLegacyProtoFeatures(e));if(this._edition){if(e===`proto2`)t=Object.assign({},o);else if(e===`proto3`)t=Object.assign({},s);else if(e===`2023`)t=Object.assign({},a);else throw Error(`Unknown edition: `+e);this._features=r.merge(t,i),this._featuresResolved=!0;return}if(this.partOf instanceof n){var c=r.merge({},this.partOf._features);this._features=r.merge(c,i)}else if(!this.declaringField)if(this.parent){var l=r.merge({},this.parent._features);this._features=r.merge(l,i)}else throw Error(`Unable to find a parent for `+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},c.prototype._inferLegacyProtoFeatures=function(){return{}},c.prototype.getOption=function(e){if(this.options)return this.options[e]},c.prototype.setOption=function(e,t,n){return e===`__proto__`?this:(this.options||={},/^features\./.test(e)?r.setProperty(this.options,e,t,n):(!n||this.options[e]===void 0)&&(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this)},c.prototype.setParsedOption=function(e,t,n){if(e===`__proto__`)return this;this.parsedOptions||=[];var i=this.parsedOptions;if(n){var a=i.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(a){var o=a[e];r.setProperty(o,n,t)}else a={},a[e]=r.setProperty({},n,t),i.push(a)}else{var s={};s[e]=t,i.push(s)}return this},c.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],t);return this},c.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+` `+t:e},c.prototype._editionToJSON=function(){if(!(!this._edition||this._edition===`proto3`))return this._edition},c._configure=function(e){i=e}})),Xk=t(((e,t)=>{t.exports=a;var n=Yk();((a.prototype=Object.create(n.prototype)).constructor=a).className=`Enum`;var r=Fk(),i=Q();function a(e,t,r,i,a,o){if(n.call(this,e,r),t&&typeof t!=`object`)throw TypeError(`values must be an object`);if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=a||{},this.valuesOptions=o,this._valuesFeatures={},this.reserved=void 0,t)for(var s=Object.keys(t),c=0;c<s.length;++c)s[c]!==`__proto__`&&typeof t[s[c]]==`number`&&(this.valuesById[this.values[s[c]]=t[s[c]]]=s[c])}a.prototype._resolveFeatures=function(e){return e=this._edition||e,n.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(e=>{var t=i.merge({},this._features);this._valuesFeatures[e]=i.merge(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features||{})}),this},a.fromJSON=function(e,t){var n=new a(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,t.edition&&(n._edition=t.edition),n._defaultEdition=`proto3`,n},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`edition`,this._editionToJSON(),`options`,this.options,`valuesOptions`,this.valuesOptions,`values`,this.values,`reserved`,this.reserved&&this.reserved.length?this.reserved:void 0,`comment`,t?this.comment:void 0,`comments`,t?this.comments:void 0])},a.prototype.add=function(e,t,n,r){if(!i.isString(e))throw TypeError(`name must be a string`);if(!i.isInteger(t))throw TypeError(`id must be an integer`);if(e===`__proto__`)return this;if(this.values[e]!==void 0)throw Error(`duplicate name '`+e+`' in `+this);if(this.isReservedId(t))throw Error(`id `+t+` is reserved in `+this);if(this.isReservedName(e))throw Error(`name '`+e+`' is reserved in `+this);if(this.valuesById[t]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error(`duplicate id `+t+` in `+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return r&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this},a.prototype.remove=function(e){if(!i.isString(e))throw TypeError(`name must be a string`);var t=this.values[e];if(t==null)throw Error(`name '`+e+`' does not exist in `+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)}})),Zk=t(((e,t)=>{t.exports=o;var n=Xk(),r=Kk(),i=Q();function a(e,t,n,r){return t.delimited?e(`types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)`,n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e(`types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()`,n,r,(t.id<<3|2)>>>0)}function o(e){for(var t=i.codegen([`m`,`w`,`q`],e.name+`$encode`)(`if(!w)`)(`w=Writer.create()`)(`if(q===undefined)q=0`)(`if(q>util.recursionLimit)`)(`throw Error("max depth exceeded")`),o,s,c=e.fieldsArray.slice().sort(i.compareFieldsById),o=0;o<c.length;++o){var l=c[o].resolve(),u=e._fieldsArray.indexOf(l),d=l.resolvedType instanceof n?`int32`:l.type,f=r.basic[d];s=`m`+i.safeProp(l.name),l.map?(t(`if(%s!=null&&Object.hasOwnProperty.call(m,%j)){`,s,l.name)(`for(var ks=Object.keys(%s),i=0;i<ks.length;++i){`,s)(`w.uint32(%i).fork().uint32(%i).%s(ks[i])`,(l.id<<3|2)>>>0,8|r.mapKey[l.keyType],l.keyType),f===void 0?t(`types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()`,u,s):t(`.uint32(%i).%s(%s[ks[i]]).ldelim()`,16|f,d,s),t(`}`)(`}`)):l.repeated?(t(`if(%s!=null&&%s.length){`,s,s),l.packed&&r.packed[d]!==void 0?t(`w.uint32(%i).fork()`,(l.id<<3|2)>>>0)(`for(var i=0;i<%s.length;++i)`,s)(`w.%s(%s[i])`,d,s)(`w.ldelim()`):(t(`for(var i=0;i<%s.length;++i)`,s),f===void 0?a(t,l,u,s+`[i]`):t(`w.uint32(%i).%s(%s[i])`,(l.id<<3|f)>>>0,d,s)),t(`}`)):(l.optional&&t(`if(%s!=null&&Object.hasOwnProperty.call(m,%j))`,s,l.name),f===void 0?a(t,l,u,s):t(`w.uint32(%i).%s(%s)`,(l.id<<3|f)>>>0,d,s))}return t(`return w`)}})),Qk=t(((e,t)=>{var n=t.exports=Ok();n.build=`light`;function r(e,t,r){return typeof t==`function`?(r=t,t=new n.Root):t||=new n.Root,t.load(e,r)}n.load=r;function i(e,t){return t||=new n.Root,t.loadSync(e)}n.loadSync=i,n.encoder=Zk(),n.decoder=Bk(),n.verifier=Vk(),n.converter=Hk(),n.ReflectionObject=Yk(),n.Namespace=Fk(),n.Root=Gk(),n.Enum=Xk(),n.Type=Wk(),n.Field=qk(),n.OneOf=Jk(),n.MapField=Ik(),n.Service=Rk(),n.Method=Lk(),n.Message=zk(),n.wrappers=Uk(),n.types=Kk(),n.util=Q(),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)})),$k=t(((e,t)=>{t.exports=f;var n=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,i=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a=/^ *[*/]+ */,o=/^\s*\*?\/*/,s=/\n/g,c=/\s/,l=/\\(.?)/g,u={0:`\0`,r:`\r`,n:`
50
+ }`}return a.toString=o,a}r.verbose=!1;function i(e){return!e||(e=String(e).replace(/[^\w$]/g,``),!e)?``:(/^\d/.test(e)&&(e=`_`+e),n.test(e)?e+`_`:e)}})),jk=t(((e,t)=>{var n=null;try{n=s(`fs`),(!n||!n.readFile||!n.readFileSync)&&(n=null)}catch{}t.exports=n})),Mk=t(((e,t)=>{t.exports=i;var n=fk(),r=jk();function i(e,t,a){return typeof t==`function`?(a=t,t={}):t||={},a?!t.xhr&&r&&r.readFile?r.readFile(e,function(n,r){return n&&typeof XMLHttpRequest<`u`?i.xhr(e,t,a):n?a(n):a(null,t.binary?r:r.toString(`utf8`))}):i.xhr(e,t,a):n(i,this,e,t)}i.xhr=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===4){if(r.status!==0&&r.status!==200)return n(Error(`status `+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var i=0;i<r.responseText.length;++i)e.push(r.responseText.charCodeAt(i)&255)}return n(null,typeof Uint8Array<`u`?new Uint8Array(e):e)}return n(null,r.responseText)}},t.binary&&(`overrideMimeType`in r&&r.overrideMimeType(`text/plain; charset=x-user-defined`),r.responseType=`arraybuffer`),r.open(`GET`,e),r.send()}})),Nk=t((e=>{var t=e,n=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},r=t.normalize=function(e){e=e.replace(/\\/g,`/`).replace(/\/{2,}/g,`/`);var t=e.split(`/`),r=n(e),i=``;r&&(i=t.shift()+`/`);for(var a=0;a<t.length;)t[a]===`..`?a>0&&t[a-1]!==`..`?t.splice(--a,2):r?t.splice(a,1):++a:t[a]===`.`?t.splice(a,1):++a;return i+t.join(`/`)};t.resolve=function(e,t,i){return i||(t=r(t)),n(t)?t:(i||(e=r(e)),(e=e.replace(/(?:\/|^)[^/]+$/,``)).length?r(e+`/`+t):t)}})),Pk=t((e=>{var t=e;t.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,t.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,t.reservedRe=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/})),Fk=t(((e,t)=>{var n=null;try{n=s(`fs`),(!n||!n.readFile||!n.readFileSync)&&(n=null)}catch{}t.exports=n})),Ik=t(((e,t)=>{t.exports=u;var n=Xk();((u.prototype=Object.create(n.prototype)).constructor=u).className=`Namespace`;var r=Jk(),i=Q(),a=Yk(),o,s,c;u.fromJSON=function(e,t,n){return n=i.checkDepth(n),new u(e,t.options).addJSON(t.nested,n)};function l(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}u.arrayToJSON=l,u.isReservedId=function(e,t){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!=`string`&&e[n][0]<=t&&e[n][1]>t)return!0}return!1},u.isReservedName=function(e,t){if(e){for(var n=0;n<e.length;++n)if(e[n]===t)return!0}return!1};function u(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null,this._lookupCache=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function d(e){e._nestedArray=null,e._lookupCache=Object.create(null);for(var t=e;t=t.parent;)t._lookupCache=Object.create(null);return e}Object.defineProperty(u.prototype,"nestedArray",{get:function(){return this._nestedArray||=i.toArray(this.nested)}}),u.prototype.toJSON=function(e){return i.toObject([`options`,this.options,`nested`,l(this.nestedArray,e)])},u.prototype.addJSON=function(e,t){t=i.checkDepth(t);var n=this;if(e)for(var a=Object.keys(e),l=0,d;l<a.length;++l)d=e[a[l]],n.add((d.fields===void 0?d.values===void 0?d.methods===void 0?d.id===void 0?u.fromJSON:r.fromJSON:s.fromJSON:c.fromJSON:o.fromJSON)(a[l],d,t+1));return this},u.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null},u.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&this.nested[e]instanceof c)return this.nested[e].values;throw Error(`no such enum: `+e)},u.prototype.add=function(e){if(!(e instanceof r&&e.extend!==void 0||e instanceof o||e instanceof a||e instanceof c||e instanceof s||e instanceof u))throw TypeError(`object must be a valid nested object`);if(e.name===`__proto__`)return this;if(!this.nested)this.nested={};else{var t=this.get(e.name);if(t)if(t instanceof u&&e instanceof u&&!(t instanceof o||t instanceof s)){for(var n=t.nestedArray,i=0;i<n.length;++i)e.add(n[i]);this.remove(t),this.nested||={},e.setOptions(t.options,!0)}else throw Error(`duplicate name '`+e.name+`' in `+this)}this.nested[e.name]=e,this instanceof o||this instanceof s||this instanceof c||this instanceof r||(e._edition||=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var l=this;l=l.parent;)l._needsRecursiveFeatureResolution=!0,l._needsRecursiveResolve=!0;return e.onAdd(this),d(this)},u.prototype.remove=function(e){if(!(e instanceof n))throw TypeError(`object must be a ReflectionObject`);if(e.parent!==this)throw Error(e+` is not a member of `+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),d(this)},u.prototype.define=function(e,t){if(i.isString(e))e=e.split(`.`);else if(!Array.isArray(e))throw TypeError(`illegal path`);if(e&&e.length&&e[0]===``)throw Error(`path must be relative`);if(e.length>i.recursionLimit)throw Error(`max depth exceeded`);for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(n=n.nested[r],!(n instanceof u))throw Error(`path conflicts with non-namespace objects`)}else n.add(n=new u(r))}return t&&n.addJSON(t),n},u.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof u?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},u.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this},u.prototype.lookup=function(e,t,n){if(typeof t==`boolean`?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.isString(e)&&e.length){if(e===`.`)return this.root;e=e.split(`.`)}else if(!e.length)return this;var r=e.join(`.`);if(e[0]===``)return this.root.lookup(e.slice(1),t);var a=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects[`.`+r];if(a&&(!t||t.indexOf(a.constructor)>-1)||(a=this._lookupImpl(e,r),a&&(!t||t.indexOf(a.constructor)>-1)))return a;if(n)return null;for(var o=this;o.parent;){if(a=o.parent._lookupImpl(e,r),a&&(!t||t.indexOf(a.constructor)>-1))return a;o=o.parent}return null},u.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var n=this.get(e[0]),r=null;if(n)e.length===1?r=n:n instanceof u&&(e=e.slice(1),r=n._lookupImpl(e,e.join(`.`)));else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof u&&(n=this._nestedArray[i]._lookupImpl(e,t))){r=n;break}return this._lookupCache[t]=r,r},u.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error(`no such type: `+e);return t},u.prototype.lookupEnum=function(e){var t=this.lookup(e,[c]);if(!t)throw Error(`no such Enum '`+e+`' in `+this);return t},u.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,c]);if(!t)throw Error(`no such Type or Enum '`+e+`' in `+this);return t},u.prototype.lookupService=function(e){var t=this.lookup(e,[s]);if(!t)throw Error(`no such Service '`+e+`' in `+this);return t},u._configure=function(e,t,n){o=e,s=t,c=n}})),Lk=t(((e,t)=>{t.exports=a;var n=Jk();((a.prototype=Object.create(n.prototype)).constructor=a).className=`MapField`;var r=qk(),i=Q();function a(e,t,r,a,o,s){if(n.call(this,e,t,a,void 0,void 0,o,s),!i.isString(r))throw TypeError(`keyType must be a string`);this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`keyType`,this.keyType,`type`,this.type,`id`,this.id,`extend`,this.extend,`options`,this.options,`comment`,t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(r.mapKey[this.keyType]===void 0)throw Error(`invalid key type: `+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,n){return typeof n==`function`?n=i.decorateType(n).name:n&&typeof n==`object`&&(n=i.decorateEnum(n).name),function(r,o){i.decorateType(r.constructor).add(new a(o,e,t,n))}}})),Rk=t(((e,t)=>{t.exports=i;var n=Xk();((i.prototype=Object.create(n.prototype)).constructor=i).className=`Method`;var r=Q();function i(e,t,i,a,o,s,c,l,u){if(r.isObject(o)?(c=o,o=s=void 0):r.isObject(s)&&(c=s,s=void 0),!(t===void 0||r.isString(t)))throw TypeError(`type must be a string`);if(!r.isString(i))throw TypeError(`requestType must be a string`);if(!r.isString(a))throw TypeError(`responseType must be a string`);n.call(this,e,c),this.type=t||`rpc`,this.requestType=i,this.requestStream=o?!0:void 0,this.responseType=a,this.responseStream=s?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=u}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return r.toObject([`type`,this.type!==`rpc`&&this.type||void 0,`requestType`,this.requestType,`requestStream`,this.requestStream,`responseType`,this.responseType,`responseStream`,this.responseStream,`options`,this.options,`comment`,t?this.comment:void 0,`parsedOptions`,this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}})),zk=t(((e,t)=>{t.exports=s;var n=Ik();((s.prototype=Object.create(n.prototype)).constructor=s).className=`Service`;var r=Rk(),i=Q(),a=Dk(),o=i.patterns.reservedRe;function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}s.fromJSON=function(e,t,n){n=i.checkDepth(n);var a=new s(e,t.options);if(t.methods)for(var o=Object.keys(t.methods),c=0;c<o.length;++c)a.add(r.fromJSON(o[c],t.methods[o[c]]));return t.nested&&a.addJSON(t.nested,n),t.edition&&(a._edition=t.edition),a.comment=t.comment,a._defaultEdition=`proto3`,a},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return i.toObject([`edition`,this._editionToJSON(),`options`,t&&t.options||void 0,`methods`,n.arrayToJSON(this.methodsArray,e)||{},`nested`,t&&t.nested||void 0,`comment`,r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||=i.toArray(this.methods)}});function c(e){return e._methodsArray=null,e}s.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;n.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this},s.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(t=>{t._resolveFeaturesRecursive(e)}),this):this},s.prototype.add=function(e){if(this.get(e.name))throw Error(`duplicate name '`+e.name+`' in `+this);return e instanceof r?e.name===`__proto__`?this:(this.methods[e.name]=e,e.parent=this,c(this)):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof r){if(this.methods[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.methods[e.name],e.parent=null,c(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,n){for(var r=new a.Service(e,t,n),s=0,c;s<this.methodsArray.length;++s){var l=i.lcFirst((c=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,``);r[l]=i.codegen([`r`,`c`],o.test(l)?l+`_`:l)(`return this.rpcCall(m,q,s,r,c)`)({m:c,q:c.resolvedRequestType.ctor,s:c.resolvedResponseType.ctor})}return r}})),Bk=t(((e,t)=>{t.exports=r;var n=xk();function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n){var r=t[n];r!==`__proto__`&&(this[r]=e[r])}}r.create=function(e){return this.$type.create(e)},r.encode=function(e,t){return this.$type.encode(e,t)},r.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},r.decode=function(e){return this.$type.decode(e)},r.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},r.verify=function(e){return this.$type.verify(e)},r.fromObject=function(e){return this.$type.fromObject(e)},r.toObject=function(e,t){return this.$type.toObject(e,t)},r.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}})),Vk=t(((e,t)=>{t.exports=o;var n=Zk(),r=qk(),i=Q();function a(e){return`missing required '`+e.name+`'`}function o(e){for(var t=i.codegen([`r`,`l`,`e`,`n`],e.name+`$decode`)(`if(!(r instanceof Reader))`)(`r=Reader.create(r)`)(`if(n===undefined)n=0`)(`if(n>Reader.recursionLimit)`)(`throw Error("maximum nesting depth exceeded")`)(`var c=l===undefined?r.len:r.pos+l,m=new this.ctor`+(e.fieldsArray.filter(function(e){return e.map}).length?`,k,value`:``))(`while(r.pos<c){`)(`var t=r.uint32()`)(`if(t===e)`)(`break`)(`switch(t>>>3){`),o=0;o<e.fieldsArray.length;++o){var s=e._fieldsArray[o].resolve(),c=s.resolvedType instanceof n?`int32`:s.type,l=`m`+i.safeProp(s.name);t(`case %i: {`,s.id),s.map?(t(`if(%s===util.emptyObject)`,l)(`%s={}`,l)(`var c2 = r.uint32()+r.pos`),r.defaults[s.keyType]===void 0?t(`k=null`):t(`k=%j`,r.defaults[s.keyType]),r.defaults[c]===void 0?t(`value=null`):t(`value=%j`,r.defaults[c]),t(`while(r.pos<c2){`)(`var tag2=r.uint32()`)(`switch(tag2>>>3){`)(`case 1: k=r.%s(); break`,s.keyType)(`case 2:`),r.basic[c]===void 0?t(`value=types[%i].decode(r,r.uint32(),undefined,n+1)`,o):t(`value=r.%s()`,c),t(`break`)(`default:`)(`r.skipType(tag2&7,n)`)(`break`)(`}`)(`}`),r.long[s.keyType]===void 0?(s.keyType===`string`&&t(`if(k==="__proto__")`)(`util.makeProp(%s,k)`,l),t(`%s[k]=value`,l)):t(`%s[typeof k==="object"?util.longToHash(k):k]=value`,l)):s.repeated?(t(`if(!(%s&&%s.length))`,l,l)(`%s=[]`,l),r.packed[c]!==void 0&&t(`if((t&7)===2){`)(`var c2=r.uint32()+r.pos`)(`while(r.pos<c2)`)(`%s.push(r.%s())`,l,c)(`}else`),r.basic[c]===void 0?t(s.delimited?`%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))`:`%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))`,l,o):t(`%s.push(r.%s())`,l,c)):r.basic[c]===void 0?t(s.delimited?`%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)`:`%s=types[%i].decode(r,r.uint32(),undefined,n+1)`,l,o):t(`%s=r.%s()`,l,c),t(`break`)(`}`)}for(t(`default:`)(`r.skipType(t&7,n)`)(`break`)(`}`)(`}`),o=0;o<e._fieldsArray.length;++o){var u=e._fieldsArray[o];u.required&&t(`if(!m.hasOwnProperty(%j))`,u.name)(`throw util.ProtocolError(%j,{instance:m})`,a(u))}return t(`return m`)}})),Hk=t(((e,t)=>{t.exports=s;var n=Zk(),r=Q();function i(e,t){return e.name+`: `+t+(e.repeated&&t!==`array`?`[]`:e.map&&t!==`object`?`{k:`+e.keyType+`}`:``)+` expected`}function a(e,t,r,a){if(t.resolvedType)if(t.resolvedType instanceof n){e(`switch(%s){`,a)(`default:`)(`return%j`,i(t,`enum value`));for(var o=Object.keys(t.resolvedType.values),s=0;s<o.length;++s)e(`case %i:`,t.resolvedType.values[o[s]]);e(`break`)(`}`)}else e(`{`)(`var e=types[%i].verify(%s,n+1);`,r,a)(`if(e)`)(`return%j+e`,t.name+`.`)(`}`);else switch(t.type){case`int32`:case`uint32`:case`sint32`:case`fixed32`:case`sfixed32`:e(`if(!util.isInteger(%s))`,a)(`return%j`,i(t,`integer`));break;case`int64`:case`uint64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))`,a,a,a,a)(`return%j`,i(t,`integer|Long`));break;case`float`:case`double`:e(`if(typeof %s!=="number")`,a)(`return%j`,i(t,`number`));break;case`bool`:e(`if(typeof %s!=="boolean")`,a)(`return%j`,i(t,`boolean`));break;case`string`:e(`if(!util.isString(%s))`,a)(`return%j`,i(t,`string`));break;case`bytes`:e(`if(!(%s&&typeof %s.length==="number"||util.isString(%s)))`,a,a,a)(`return%j`,i(t,`buffer`));break}return e}function o(e,t,n){switch(t.keyType){case`int32`:case`uint32`:case`sint32`:case`fixed32`:case`sfixed32`:e(`if(!util.key32Re.test(%s))`,n)(`return%j`,i(t,`integer key`));break;case`int64`:case`uint64`:case`sint64`:case`fixed64`:case`sfixed64`:e(`if(!util.key64Re.test(%s))`,n)(`return%j`,i(t,`integer|Long key`));break;case`bool`:e(`if(!util.key2Re.test(%s))`,n)(`return%j`,i(t,`boolean key`));break}return e}function s(e){var t=r.codegen([`m`,`n`],e.name+`$verify`)(`if(typeof m!=="object"||m===null)`)(`return%j`,`object expected`)(`if(n===undefined)n=0`)(`if(n>util.recursionLimit)`)(`return%j`,`maximum nesting depth exceeded`),n=e.oneofsArray,s={};n.length&&t(`var p={}`);for(var c=0;c<e.fieldsArray.length;++c){var l=e._fieldsArray[c].resolve(),u=`m`+r.safeProp(l.name);if(l.optional&&t(`if(%s!=null&&m.hasOwnProperty(%j)){`,u,l.name),l.map)t(`if(!util.isObject(%s))`,u)(`return%j`,i(l,`object`))(`var k=Object.keys(%s)`,u)(`for(var i=0;i<k.length;++i){`),o(t,l,`k[i]`),a(t,l,c,u+`[k[i]]`)(`}`);else if(l.repeated)t(`if(!Array.isArray(%s))`,u)(`return%j`,i(l,`array`))(`for(var i=0;i<%s.length;++i){`,u),a(t,l,c,u+`[i]`)(`}`);else{if(l.partOf){var d=r.safeProp(l.partOf.name);s[l.partOf.name]===1&&t(`if(p%s===1)`,d)(`return%j`,l.partOf.name+`: multiple values`),s[l.partOf.name]=1,t(`p%s=1`,d)}a(t,l,c,u)}l.optional&&t(`}`)}return t(`return null`)}})),Uk=t((e=>{var t=e,n=Zk(),r=Q();function i(e,t,r,i){var a=!1;if(t.resolvedType)if(t.resolvedType instanceof n){e(`switch(d%s){`,i);for(var o=t.resolvedType.values,s=Object.keys(o),c=0;c<s.length;++c)o[s[c]]===t.typeDefault&&!a&&(e(`default:`)(`if(typeof(d%s)==="number"){m%s=d%s;break}`,i,i,i),t.repeated||e(`break`),a=!0),e(`case%j:`,s[c])(`case %i:`,o[s[c]])(`m%s=%j`,i,o[s[c]])(`break`);e(`}`)}else e(`if(typeof d%s!=="object")`,i)(`throw TypeError(%j)`,t.fullName+`: object expected`)(`m%s=types[%i].fromObject(d%s,n+1)`,i,r,i);else{var l=!1;switch(t.type){case`double`:case`float`:e(`m%s=Number(d%s)`,i,i);break;case`uint32`:case`fixed32`:e(`m%s=d%s>>>0`,i,i);break;case`int32`:case`sint32`:case`sfixed32`:e(`m%s=d%s|0`,i,i);break;case`uint64`:case`fixed64`:l=!0;case`int64`:case`sint64`:case`sfixed64`:e(`if(util.Long)`)(`m%s=util.Long.fromValue(d%s,%j)`,i,i,l)(`else if(typeof d%s==="string")`,i)(`m%s=parseInt(d%s,10)`,i,i)(`else if(typeof d%s==="number")`,i)(`m%s=d%s`,i,i)(`else if(typeof d%s==="object")`,i)(`m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)`,i,i,i,l?`true`:``);break;case`bytes`:e(`if(typeof d%s==="string")`,i)(`util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)`,i,i,i)(`else if(d%s.length >= 0)`,i)(`m%s=d%s`,i,i);break;case`string`:e(`m%s=String(d%s)`,i,i);break;case`bool`:e(`m%s=Boolean(d%s)`,i,i);break}}return e}t.fromObject=function(e){var t=e.fieldsArray,a=r.codegen([`d`,`n`],e.name+`$fromObject`)(`if(d instanceof this.ctor)`)(`return d`)(`if(n===undefined)n=0`)(`if(n>util.recursionLimit)`)(`throw Error("maximum nesting depth exceeded")`);if(!t.length)return a(`return new this.ctor`);a(`var m=new this.ctor`);for(var o=0;o<t.length;++o){var s=t[o].resolve(),c=r.safeProp(s.name);s.map?(a(`if(d%s){`,c)(`if(typeof d%s!=="object")`,c)(`throw TypeError(%j)`,s.fullName+`: object expected`)(`m%s={}`,c)(`for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){`,c),a(`if(ks[i]==="__proto__")`)(`util.makeProp(m%s,ks[i])`,c),i(a,s,o,c+`[ks[i]]`)(`}`)(`}`)):s.repeated?(a(`if(d%s){`,c)(`if(!Array.isArray(d%s))`,c)(`throw TypeError(%j)`,s.fullName+`: array expected`)(`m%s=[]`,c)(`for(var i=0;i<d%s.length;++i){`,c),i(a,s,o,c+`[i]`)(`}`)(`}`)):(s.resolvedType instanceof n||a(`if(d%s!=null){`,c),i(a,s,o,c),s.resolvedType instanceof n||a(`}`))}return a(`return m`)};function a(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof n?e(`d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s`,i,r,i,i,r,i,i):e(`d%s=types[%i].toObject(m%s,o,q+1)`,i,r,i);else{var a=!1;switch(t.type){case`double`:case`float`:e(`d%s=o.json&&!isFinite(m%s)?String(m%s):m%s`,i,i,i,i);break;case`uint64`:case`fixed64`:a=!0;case`int64`:case`sint64`:case`sfixed64`:e(`if(typeof BigInt!=="undefined"&&o.longs===BigInt)`)(`d%s=typeof m%s==="number"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()`,i,i,i,i,i,a)(`else if(typeof m%s==="number")`,i)(`d%s=o.longs===String?String(m%s):m%s`,i,i,i)(`else`)(`d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s`,i,i,i,i,a?`true`:``,i);break;case`bytes`:e(`d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s`,i,i,i,i,i);break;default:e(`d%s=m%s`,i,i);break}}return e}t.toObject=function(e){var t=e.fieldsArray.slice().sort(r.compareFieldsById);if(!t.length)return r.codegen()(`return {}`);for(var i=r.codegen([`m`,`o`,`q`],e.name+`$toObject`)(`if(!o)`)(`o={}`)(`if(q===undefined)q=0`)(`if(q>util.recursionLimit)`)(`throw Error("max depth exceeded")`)(`var d={}`),o=[],s=[],c=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?o:t[l].map?s:c).push(t[l]);if(o.length){for(i(`if(o.arrays||o.defaults){`),l=0;l<o.length;++l)i(`d%s=[]`,r.safeProp(o[l].name));i(`}`)}if(s.length){for(i(`if(o.objects||o.defaults){`),l=0;l<s.length;++l)i(`d%s={}`,r.safeProp(s[l].name));i(`}`)}if(c.length){for(i(`if(o.defaults){`),l=0;l<c.length;++l){var u=c[l],d=r.safeProp(u.name);if(u.resolvedType instanceof n)i(`d%s=o.enums===String?%j:%j`,d,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)i(`if(util.Long){`)(`var n=new util.Long(%i,%i,%j)`,u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)(`d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!=="undefined"&&o.longs===BigInt?n.toBigInt():n`,d)(`}else`)(`d%s=o.longs===String?%j:typeof BigInt!=="undefined"&&o.longs===BigInt?BigInt(%j):%i`,d,u.typeDefault.toString(),u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var f=Array.prototype.slice.call(u.typeDefault);i(`if(o.bytes===String)d%s=%j`,d,String.fromCharCode.apply(String,u.typeDefault))(`else{`)(`d%s=%j`,d,f)(`if(o.bytes!==Array)d%s=util.newBuffer(d%s)`,d,d)(`}`)}else i(`d%s=%j`,d,u.typeDefault)}i(`}`)}var p=!1;for(l=0;l<t.length;++l){var u=t[l],m=e._fieldsArray.indexOf(u),d=r.safeProp(u.name);u.map?(p||(p=!0,i(`var ks2`)),i(`if(m%s&&(ks2=Object.keys(m%s)).length){`,d,d)(`d%s={}`,d)(`for(var j=0;j<ks2.length;++j){`),i(`if(ks2[j]==="__proto__")`)(`util.makeProp(d%s,ks2[j])`,d),a(i,u,m,d+`[ks2[j]]`)(`}`)):u.repeated?(i(`if(m%s&&m%s.length){`,d,d)(`d%s=[]`,d)(`for(var j=0;j<m%s.length;++j){`,d),a(i,u,m,d+`[j]`)(`}`)):(i(`if(m%s!=null&&m.hasOwnProperty(%j)){`,d,u.name),a(i,u,m,d),u.partOf&&i(`if(o.oneofs)`)(`d%s=%j`,r.safeProp(u.partOf.name),u.name)),i(`}`)}return i(`return d`)}})),Wk=t((e=>{var t=e,n=Bk(),r=xk();t[`.google.protobuf.Any`]={fromObject:function(e,t){if(e&&e[`@type`]){var n=e[`@type`].substring(e[`@type`].lastIndexOf(`/`)+1),r=this.lookup(n);if(r){var i=e[`@type`].charAt(0)===`.`?e[`@type`].slice(1):e[`@type`];return i.indexOf(`/`)===-1&&(i=`/`+i),this.create({type_url:i,value:r.encode(r.fromObject(e,t===void 0?1:t+1)).finish()})}}return this.fromObject(e,t)},toObject:function(e,t,i){if(i===void 0&&(i=0),i>r.recursionLimit)throw Error(`max depth exceeded`);var a=`type.googleapis.com/`,o=``,s=``;if(t&&t.json&&e.type_url&&e.value){s=e.type_url.substring(e.type_url.lastIndexOf(`/`)+1),o=e.type_url.substring(0,e.type_url.lastIndexOf(`/`)+1);var c=this.lookup(s);c&&(e=c.decode(e.value,void 0,void 0,i+1))}if(!(e instanceof this.ctor)&&e instanceof n){var l=e.$type.toObject(e,t,i+1),u=e.$type.fullName[0]===`.`?e.$type.fullName.slice(1):e.$type.fullName;return o===``&&(o=a),s=o+u,l[`@type`]=s,l}return this.toObject(e,t,i)}}})),Gk=t(((e,t)=>{t.exports=_;var n=Ik();((_.prototype=Object.create(n.prototype)).constructor=_).className=`Type`;var r=Zk(),i=Yk(),a=Jk(),o=Lk(),s=zk(),c=Bk(),l=wk(),u=Sk(),d=Q(),f=Qk(),p=Vk(),m=Hk(),h=Uk(),g=Wk();function _(e,t){e=e.replace(/\W/g,``),n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(_.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error(`duplicate id `+r+` in `+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||=d.toArray(this.fields)}},oneofsArray:{get:function(){return this._oneofsArray||=d.toArray(this.oneofs)}},ctor:{get:function(){return this._ctor||(this.ctor=_.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.merge(e,c,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:d.oneOfGetter(this._oneofsArray[n].oneof),set:d.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),_.generateConstructor=function(e){for(var t=d.codegen([`p`],e.name),n=0,r;n<e.fieldsArray.length;++n)(r=e._fieldsArray[n]).map?t(`this%s={}`,d.safeProp(r.name)):r.repeated&&t(`this%s=[]`,d.safeProp(r.name));return t(`if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")`)(`this[ks[i]]=p[ks[i]]`)};function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}_.fromJSON=function(e,t,c){if(c===void 0&&(c=0),c>d.nestingLimit)throw Error(`max depth exceeded`);var l=new _(e,t.options);l.extensions=t.extensions,l.reserved=t.reserved;for(var u=Object.keys(t.fields),f=0;f<u.length;++f)l.add((t.fields[u[f]].keyType===void 0?a.fromJSON:o.fromJSON)(u[f],t.fields[u[f]]));if(t.oneofs)for(u=Object.keys(t.oneofs),f=0;f<u.length;++f)l.add(i.fromJSON(u[f],t.oneofs[u[f]]));if(t.nested)for(u=Object.keys(t.nested),f=0;f<u.length;++f){var p=t.nested[u[f]];l.add((p.id===void 0?p.fields===void 0?p.values===void 0?p.methods===void 0?n.fromJSON:s.fromJSON:r.fromJSON:_.fromJSON:a.fromJSON)(u[f],p,c+1))}return t.extensions&&t.extensions.length&&(l.extensions=t.extensions),t.reserved&&t.reserved.length&&(l.reserved=t.reserved),t.group&&(l.group=!0),t.comment&&(l.comment=t.comment),t.edition&&(l._edition=t.edition),l._defaultEdition=`proto3`,l},_.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return d.toObject([`edition`,this._editionToJSON(),`options`,t&&t.options||void 0,`oneofs`,n.arrayToJSON(this.oneofsArray,e),`fields`,n.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),e)||{},`extensions`,this.extensions&&this.extensions.length?this.extensions:void 0,`reserved`,this.reserved&&this.reserved.length?this.reserved:void 0,`group`,this.group||void 0,`nested`,t&&t.nested||void 0,`comment`,r?this.comment:void 0])},_.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;n.prototype.resolveAll.call(this);var e=this.oneofsArray;for(r=0;r<e.length;)e[r++].resolve();for(var t=this.fieldsArray,r=0;r<t.length;)t[r++].resolve();return this},_.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,n.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(t=>{t._resolveFeatures(e)}),this.fieldsArray.forEach(t=>{t._resolveFeatures(e)}),this):this},_.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null},_.prototype.add=function(e){if(this.get(e.name))throw Error(`duplicate name '`+e.name+`' in `+this);if(e instanceof a&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error(`duplicate id `+e.id+` in `+this);if(this.isReservedId(e.id))throw Error(`id `+e.id+` is reserved in `+this);if(this.isReservedName(e.name))throw Error(`name '`+e.name+`' is reserved in `+this);return e.name===`__proto__`?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),v(this))}return e instanceof i?e.name===`__proto__`?this:(this.oneofs||={},this.oneofs[e.name]=e,e.onAdd(this),v(this)):n.prototype.add.call(this,e)},_.prototype.remove=function(e){if(e instanceof a&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),v(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+` is not a member of `+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),v(this)}return n.prototype.remove.call(this,e)},_.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},_.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},_.prototype.create=function(e){return new this.ctor(e)},_.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=f(this)({Writer:u,types:t,util:d}),this.decode=p(this)({Reader:l,types:t,util:d}),this.verify=m(this)({types:t,util:d}),this.fromObject=h.fromObject(this)({types:t,util:d}),this.toObject=h.toObject(this)({types:t,util:d});var r=g[e];if(r){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(i),i.toObject=this.toObject,this.toObject=r.toObject.bind(i)}return this},_.prototype.encode=function(e,t){return this.setup().encode.apply(this,arguments)},_.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},_.prototype.decode=function(e,t,n,r){return this.setup().decode(e,t,n,r)},_.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},_.prototype.verify=function(e,t){return this.setup().verify(e,t)},_.prototype.fromObject=function(e,t){return this.setup().fromObject(e,t)},_.prototype.toObject=function(e,t){return this.setup().toObject.apply(this,arguments)},_.d=function(e){return function(t){d.decorateType(t,e)}}})),Kk=t(((e,t)=>{t.exports=u;var n=Ik();((u.prototype=Object.create(n.prototype)).constructor=u).className=`Root`;var r=Jk(),i=Zk(),a=Yk(),o=Q(),s,c,l;function u(e){n.call(this,``,e),this.deferred=[],this.files=[],this._edition=`proto2`,this._fullyQualifiedObjects={}}u.fromJSON=function(e,t,n){return n=o.checkDepth(n),t||=new u,e.options&&t.setOptions(e.options),t.addJSON(e.nested,n).resolveAll()},u.prototype.resolvePath=o.path.resolve,u.prototype.fetch=o.fetch;function d(){}u.prototype.load=function e(t,n,r){typeof n==`function`&&(r=n,n=void 0);var i=this;if(!r)return o.asPromise(e,i,t,n);var a=r===d;function s(e,t){if(r){if(a)throw e;t&&t.resolveAll();var n=r;r=null,n(e,t)}}function u(e){var t=e.lastIndexOf(`google/protobuf/`);if(t>-1){var n=e.substring(t);if(n in l)return n}return null}function f(e,t,r){r===void 0&&(r=0);try{if(r>o.recursionLimit)throw Error(`max depth exceeded`);if(o.isString(t)&&t.charAt(0)===`{`&&(t=JSON.parse(t)),!o.isString(t))i.setOptions(t.options).addJSON(t.nested);else{c.filename=e;var l=c(t,i,n),d,f=0;if(l.imports)for(;f<l.imports.length;++f)(d=u(l.imports[f])||i.resolvePath(e,l.imports[f]))&&p(d,!1,r+1);if(l.weakImports)for(f=0;f<l.weakImports.length;++f)(d=u(l.weakImports[f])||i.resolvePath(e,l.weakImports[f]))&&p(d,!0,r+1)}}catch(e){s(e)}!a&&!m&&s(null,i)}function p(e,t,n){if(n===void 0&&(n=0),e=u(e)||e,!(i.files.indexOf(e)>-1)){if(i.files.push(e),e in l){a?f(e,l[e],n):(++m,setTimeout(function(){--m,f(e,l[e],n)}));return}if(a){var c;try{c=o.fs.readFileSync(e).toString(`utf8`)}catch(e){t||s(e);return}f(e,c,n)}else++m,i.fetch(e,function(a,o){if(--m,r){if(a){t?m||s(null,i):s(a);return}f(e,o,n)}})}}var m=0;o.isString(t)&&(t=[t]);for(var h=0,g;h<t.length;++h)(g=i.resolvePath(``,t[h]))&&p(g);return a?(i.resolveAll(),i):(m||s(null,i),i)},u.prototype.loadSync=function(e,t){if(!o.isNode)throw Error(`not supported`);return this.load(e,t,d)},u.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error(`unresolvable extensions: `+this.deferred.map(function(e){return`'extend `+e.extend+`' in `+e.parent.fullName}).join(`, `));return n.prototype.resolveAll.call(this)};var f=/^[A-Z]/;function p(e,t){var n=t.parent.lookup(t.extend);if(n){var i=new r(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.get(i.name)?!0:(i.declaringField=t,t.extensionField=i,n.add(i),!0)}return!1}u.prototype._handleAdd=function(e){if(e instanceof r)e.extend!==void 0&&!e.extensionField&&(p(this,e)||this.deferred.push(e));else if(e instanceof i)f.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof a)){if(e instanceof s)for(var t=0;t<this.deferred.length;)p(this,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);f.test(e.name)&&(e.parent[e.name]=e)}(e instanceof s||e instanceof i||e instanceof r)&&(this._fullyQualifiedObjects[e.fullName]=e)},u.prototype._handleRemove=function(e){if(e instanceof r){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof i)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var a=0;a<e.nestedArray.length;++a)this._handleRemove(e._nestedArray[a]);f.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]},u._configure=function(e,t,n){s=e,c=t,l=n}})),Q=t(((e,t)=>{var n=t.exports=xk(),r=Ok(),i,a;n.codegen=Ak(),n.fetch=Mk(),n.path=Nk(),n.patterns=Pk();var o=n.patterns.reservedRe;n.fs=Fk(),n.checkDepth=function(e){if(e===void 0&&(e=0),e>n.recursionLimit)throw Error(`max depth exceeded`);return e},n.toArray=function(e){if(e){for(var t=Object.keys(e),n=Array(t.length),r=0;r<t.length;)n[r]=e[t[r++]];return n}return[]},n.toObject=function(e){for(var t={},n=0;n<e.length;){var r=e[n++],i=e[n++];i!==void 0&&(t[r]=i)}return t},n.isReserved=function(e){return o.test(e)},n.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.test(e)?`[`+JSON.stringify(e)+`]`:`.`+e},n.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var s=/_([a-z])/g;n.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(s,function(e,t){return t.toUpperCase()})},n.compareFieldsById=function(e,t){return e.id-t.id},n.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(n.decorateRoot.remove(e.$type),e.$type.name=t,n.decorateRoot.add(e.$type)),e.$type;i||=Gk();var r=new i(t||e.name);return n.decorateRoot.add(r),r.ctor=e,Object.defineProperty(e,"$type",{value:r,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:r,enumerable:!1}),r};var c=0;n.decorateEnum=function(e){if(e.$type)return e.$type;a||=Zk();var t=new a(`Enum`+c++,e);return n.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},n.setProperty=function(e,t,r,i){function a(e,t,r){var o=t.shift();if(n.isUnsafeProperty(o))return e;if(t.length>0)e[o]=a(e[o]||{},t,r);else{var s=e[o];if(s&&i)return e;s&&(r=[].concat(s,r)),e[o]=r}return e}if(typeof e!=`object`)throw TypeError(`dst must be an object`);if(!t)throw TypeError(`path must be specified`);if(t=t.split(`.`),t.length>n.recursionLimit)throw Error(`max depth exceeded`);return a(e,t,r)},Object.defineProperty(n,"decorateRoot",{get:function(){return r.decorated||=new(Kk())}})})),qk=t((e=>{var t=e,n=Q(),r=[`double`,`float`,`int32`,`uint32`,`sint32`,`fixed32`,`sfixed32`,`int64`,`uint64`,`sint64`,`fixed64`,`sfixed64`,`bool`,`string`,`bytes`];function i(e,t){var n=0,i=Object.create(null);for(t|=0;n<e.length;)i[r[n+t]]=e[n++];return i}t.basic=i([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),t.defaults=i([0,0,0,0,0,0,0,0,0,0,0,0,!1,``,n.emptyArray,null]),t.long=i([0,0,0,1,1],7),t.mapKey=i([0,0,0,5,5,0,0,0,1,1,0,2],2),t.packed=i([1,5,0,0,0,5,5,0,0,0,1,1,0])})),Jk=t(((e,t)=>{t.exports=c;var n=Xk();((c.prototype=Object.create(n.prototype)).constructor=c).className=`Field`;var r=Zk(),i=qk(),a=Q(),o,s=/^required|optional|repeated$/;c.fromJSON=function(e,t){var n=new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(n._edition=t.edition),n._defaultEdition=`proto3`,n};function c(e,t,r,o,c,l,u){if(a.isObject(o)?(u=c,l=o,o=c=void 0):a.isObject(c)&&(u=l,l=c,c=void 0),n.call(this,e,l),!a.isInteger(t)||t<0)throw TypeError(`id must be a non-negative integer`);if(!a.isString(r))throw TypeError(`type must be a string`);if(o!==void 0&&!s.test(o=o.toString().toLowerCase()))throw TypeError(`rule must be a string rule`);if(c!==void 0&&!a.isString(c))throw TypeError(`extend must be a string`);o===`proto3_optional`&&(o=`optional`),this.rule=o&&o!==`optional`?o:void 0,this.type=r,this.id=t,this.extend=c||void 0,this.repeated=o===`repeated`,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=a.Long?i.long[r]!==void 0:!1,this.bytes=r===`bytes`,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=u}Object.defineProperty(c.prototype,"required",{get:function(){return this._features.field_presence===`LEGACY_REQUIRED`}}),Object.defineProperty(c.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(c.prototype,"delimited",{get:function(){return this.resolvedType instanceof o&&this._features.message_encoding===`DELIMITED`}}),Object.defineProperty(c.prototype,"packed",{get:function(){return this._features.repeated_field_encoding===`PACKED`}}),Object.defineProperty(c.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!==`IMPLICIT`}}),c.prototype.setOption=function(e,t,r){return n.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return a.toObject([`edition`,this._editionToJSON(),`rule`,this.rule!==`optional`&&this.rule||void 0,`type`,this.type,`id`,this.id,`extend`,this.extend,`options`,this.options,`comment`,t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=i.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof r&&typeof this.typeDefault==`string`&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof r)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,this.type===`uint64`||this.type===`fixed64`),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault==`string`){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},c.prototype._inferLegacyProtoFeatures=function(e){if(e!==`proto2`&&e!==`proto3`)return{};var t={};if(this.rule===`required`&&(t.field_presence=`LEGACY_REQUIRED`),this.parent&&i.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(`.`).pop());n&&n instanceof o&&n.group&&(t.message_encoding=`DELIMITED`)}return this.getOption(`packed`)===!0?t.repeated_field_encoding=`PACKED`:this.getOption(`packed`)===!1&&(t.repeated_field_encoding=`EXPANDED`),t},c.prototype._resolveFeatures=function(e){return n.prototype._resolveFeatures.call(this,this._edition||e)},c.d=function(e,t,n,r){return typeof t==`function`?t=a.decorateType(t).name:t&&typeof t==`object`&&(t=a.decorateEnum(t).name),function(i,o){a.decorateType(i.constructor).add(new c(o,e,t,n,{default:r}))}},c._configure=function(e){o=e}})),Yk=t(((e,t)=>{t.exports=a;var n=Xk();((a.prototype=Object.create(n.prototype)).constructor=a).className=`OneOf`;var r=Jk(),i=Q();function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),!(t===void 0||Array.isArray(t)))throw TypeError(`fieldNames must be an Array`);this.oneof=t||[],this.fieldsArray=[],this.comment=i}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`options`,this.options,`oneof`,this.oneof,`comment`,t?this.comment:void 0])};function o(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.prototype.add=function(e){if(!(e instanceof r))throw TypeError(`field must be a Field`);return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,o(this),this},a.prototype.remove=function(e){if(!(e instanceof r))throw TypeError(`field must be a Field`);var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+` is not a member of `+this);return this.fieldsArray.splice(t,1),t=this.oneof.indexOf(e.name),t>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=this,r=0;r<this.oneof.length;++r){var i=e.get(this.oneof[r]);i&&!i.partOf&&(i.partOf=t,t.fieldsArray.push(i))}o(this)},a.prototype.onRemove=function(e){for(var t=0,r;t<this.fieldsArray.length;++t)(r=this.fieldsArray[t]).parent&&r.parent.remove(r);n.prototype.onRemove.call(this,e)},Object.defineProperty(a.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var e=this.fieldsArray[0];return e.options!=null&&e.options.proto3_optional===!0}}),a.d=function(){for(var e=Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){i.decorateType(t.constructor).add(new a(n,e)),Object.defineProperty(t,n,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}})),Xk=t(((e,t)=>{t.exports=c,c.className=`ReflectionObject`;let n=Yk();var r=Q(),i,a={enum_type:`OPEN`,field_presence:`EXPLICIT`,json_format:`ALLOW`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`PACKED`,utf8_validation:`VERIFY`},o={enum_type:`CLOSED`,field_presence:`EXPLICIT`,json_format:`LEGACY_BEST_EFFORT`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`EXPANDED`,utf8_validation:`NONE`},s={enum_type:`OPEN`,field_presence:`IMPLICIT`,json_format:`ALLOW`,message_encoding:`LENGTH_PREFIXED`,repeated_field_encoding:`PACKED`,utf8_validation:`VERIFY`};function c(e,t){if(!r.isString(e))throw TypeError(`name must be a string`);if(t&&!r.isObject(t))throw TypeError(`options must be an object`);this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition=`proto2`,this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(c.prototype,{root:{get:function(){for(var e=this;e.parent!==null;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(`.`)}}}),c.prototype.toJSON=function(){throw Error()},c.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},c.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},c.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},c.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},c.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw Error(`Unknown edition for `+this.fullName);var i=r.merge({},this.options&&this.options.features,this._inferLegacyProtoFeatures(e));if(this._edition){if(e===`proto2`)t=Object.assign({},o);else if(e===`proto3`)t=Object.assign({},s);else if(e===`2023`)t=Object.assign({},a);else throw Error(`Unknown edition: `+e);this._features=r.merge(t,i),this._featuresResolved=!0;return}if(this.partOf instanceof n){var c=r.merge({},this.partOf._features);this._features=r.merge(c,i)}else if(!this.declaringField)if(this.parent){var l=r.merge({},this.parent._features);this._features=r.merge(l,i)}else throw Error(`Unable to find a parent for `+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},c.prototype._inferLegacyProtoFeatures=function(){return{}},c.prototype.getOption=function(e){if(this.options)return this.options[e]},c.prototype.setOption=function(e,t,n){return e===`__proto__`?this:(this.options||={},/^features\./.test(e)?r.setProperty(this.options,e,t,n):(!n||this.options[e]===void 0)&&(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this)},c.prototype.setParsedOption=function(e,t,n){if(e===`__proto__`)return this;this.parsedOptions||=[];var i=this.parsedOptions;if(n){var a=i.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(a){var o=a[e];r.setProperty(o,n,t)}else a={},a[e]=r.setProperty({},n,t),i.push(a)}else{var s={};s[e]=t,i.push(s)}return this},c.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],t);return this},c.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+` `+t:e},c.prototype._editionToJSON=function(){if(!(!this._edition||this._edition===`proto3`))return this._edition},c._configure=function(e){i=e}})),Zk=t(((e,t)=>{t.exports=a;var n=Xk();((a.prototype=Object.create(n.prototype)).constructor=a).className=`Enum`;var r=Ik(),i=Q();function a(e,t,r,i,a,o){if(n.call(this,e,r),t&&typeof t!=`object`)throw TypeError(`values must be an object`);if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=a||{},this.valuesOptions=o,this._valuesFeatures={},this.reserved=void 0,t)for(var s=Object.keys(t),c=0;c<s.length;++c)s[c]!==`__proto__`&&typeof t[s[c]]==`number`&&(this.valuesById[this.values[s[c]]=t[s[c]]]=s[c])}a.prototype._resolveFeatures=function(e){return e=this._edition||e,n.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(e=>{var t=i.merge({},this._features);this._valuesFeatures[e]=i.merge(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features||{})}),this},a.fromJSON=function(e,t){var n=new a(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,t.edition&&(n._edition=t.edition),n._defaultEdition=`proto3`,n},a.prototype.toJSON=function(e){var t=e?!!e.keepComments:!1;return i.toObject([`edition`,this._editionToJSON(),`options`,this.options,`valuesOptions`,this.valuesOptions,`values`,this.values,`reserved`,this.reserved&&this.reserved.length?this.reserved:void 0,`comment`,t?this.comment:void 0,`comments`,t?this.comments:void 0])},a.prototype.add=function(e,t,n,r){if(!i.isString(e))throw TypeError(`name must be a string`);if(!i.isInteger(t))throw TypeError(`id must be an integer`);if(e===`__proto__`)return this;if(this.values[e]!==void 0)throw Error(`duplicate name '`+e+`' in `+this);if(this.isReservedId(t))throw Error(`id `+t+` is reserved in `+this);if(this.isReservedName(e))throw Error(`name '`+e+`' is reserved in `+this);if(this.valuesById[t]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error(`duplicate id `+t+` in `+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return r&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this},a.prototype.remove=function(e){if(!i.isString(e))throw TypeError(`name must be a string`);var t=this.values[e];if(t==null)throw Error(`name '`+e+`' does not exist in `+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)}})),Qk=t(((e,t)=>{t.exports=o;var n=Zk(),r=qk(),i=Q();function a(e,t,n,r){return t.delimited?e(`types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)`,n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e(`types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()`,n,r,(t.id<<3|2)>>>0)}function o(e){for(var t=i.codegen([`m`,`w`,`q`],e.name+`$encode`)(`if(!w)`)(`w=Writer.create()`)(`if(q===undefined)q=0`)(`if(q>util.recursionLimit)`)(`throw Error("max depth exceeded")`),o,s,c=e.fieldsArray.slice().sort(i.compareFieldsById),o=0;o<c.length;++o){var l=c[o].resolve(),u=e._fieldsArray.indexOf(l),d=l.resolvedType instanceof n?`int32`:l.type,f=r.basic[d];s=`m`+i.safeProp(l.name),l.map?(t(`if(%s!=null&&Object.hasOwnProperty.call(m,%j)){`,s,l.name)(`for(var ks=Object.keys(%s),i=0;i<ks.length;++i){`,s)(`w.uint32(%i).fork().uint32(%i).%s(ks[i])`,(l.id<<3|2)>>>0,8|r.mapKey[l.keyType],l.keyType),f===void 0?t(`types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()`,u,s):t(`.uint32(%i).%s(%s[ks[i]]).ldelim()`,16|f,d,s),t(`}`)(`}`)):l.repeated?(t(`if(%s!=null&&%s.length){`,s,s),l.packed&&r.packed[d]!==void 0?t(`w.uint32(%i).fork()`,(l.id<<3|2)>>>0)(`for(var i=0;i<%s.length;++i)`,s)(`w.%s(%s[i])`,d,s)(`w.ldelim()`):(t(`for(var i=0;i<%s.length;++i)`,s),f===void 0?a(t,l,u,s+`[i]`):t(`w.uint32(%i).%s(%s[i])`,(l.id<<3|f)>>>0,d,s)),t(`}`)):(l.optional&&t(`if(%s!=null&&Object.hasOwnProperty.call(m,%j))`,s,l.name),f===void 0?a(t,l,u,s):t(`w.uint32(%i).%s(%s)`,(l.id<<3|f)>>>0,d,s))}return t(`return w`)}})),$k=t(((e,t)=>{var n=t.exports=kk();n.build=`light`;function r(e,t,r){return typeof t==`function`?(r=t,t=new n.Root):t||=new n.Root,t.load(e,r)}n.load=r;function i(e,t){return t||=new n.Root,t.loadSync(e)}n.loadSync=i,n.encoder=Qk(),n.decoder=Vk(),n.verifier=Hk(),n.converter=Uk(),n.ReflectionObject=Xk(),n.Namespace=Ik(),n.Root=Kk(),n.Enum=Zk(),n.Type=Gk(),n.Field=Jk(),n.OneOf=Yk(),n.MapField=Lk(),n.Service=zk(),n.Method=Rk(),n.Message=Bk(),n.wrappers=Wk(),n.types=qk(),n.util=Q(),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)})),eA=t(((e,t)=>{t.exports=f;var n=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,i=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a=/^ *[*/]+ */,o=/^\s*\*?\/*/,s=/\n/g,c=/\s/,l=/\\(.?)/g,u={0:`\0`,r:`\r`,n:`
51
51
  `,t:` `};function d(e){return e.replace(l,function(e,t){switch(t){case`\\`:case``:return t;default:return u[t]||``}})}f.unescape=d;function f(e,t){e=e.toString();var l=0,u=e.length,f=1,p=0,m={},h=[],g=null;function _(e){return Error(`illegal `+e+` (line `+f+`)`)}function v(){var t=g===`'`?i:r;t.lastIndex=l-1;var n=t.exec(e);if(!n)throw _(`string`);return l=t.lastIndex,w(g),g=null,d(n[1])}function y(t){return e.charAt(t)}function b(n,r,i){var c={type:e.charAt(n++),lineEmpty:!1,leading:i},l=n-(t?2:3),u;do if(--l<0||(u=e.charAt(l))===`
52
52
  `){c.lineEmpty=!0;break}while(u===` `||u===` `);for(var d=e.substring(n,r).split(s),h=0;h<d.length;++h)d[h]=d[h].replace(t?o:a,``).trim();c.text=d.join(`
53
53
  `).trim(),m[f]=c,p=f}function x(t){var n=S(t),r=e.substring(t,n);return/^\s*\/\//.test(r)}function S(e){for(var t=e;t<u&&y(t)!==`
54
54
  `;)t++;return t}function C(){if(h.length>0)return h.shift();if(g)return v();var r,i,a,o,s,d=l===0;do{if(l===u)return null;for(r=!1;c.test(a=y(l));)if(a===`
55
55
  `&&(d=!0,++f),++l===u)return null;if(y(l)===`/`){if(++l===u)throw _(`comment`);if(y(l)===`/`)if(t){if(o=l,s=!1,x(l-1)){s=!0;do if(l=S(l),l===u||(l++,!d))break;while(x(l))}else l=Math.min(u,S(l)+1);s&&(b(o,l,d),d=!0),f++,r=!0}else{for(s=y(o=l+1)===`/`;y(++l)!==`
56
56
  `;)if(l===u)return null;++l,s&&(b(o,l-1,d),d=!0),++f,r=!0}else if((a=y(l))===`*`){o=l+1,s=t||y(o)===`*`;do{if(a===`
57
- `&&++f,++l===u)throw _(`comment`);i=a,a=y(l)}while(i!==`*`||a!==`/`);++l,s&&(b(o,l-2,d),d=!0),r=!0}else return`/`}}while(r);var p=l;if(n.lastIndex=0,!n.test(y(p++)))for(;p<u&&!n.test(y(p));)++p;var m=e.substring(l,l=p);return(m===`"`||m===`'`)&&(g=m),m}function w(e){h.push(e)}function T(){if(!h.length){var e=C();if(e===null)return null;w(e)}return h[0]}function E(e,t){var n=T();if(n===e)return C(),!0;if(!t)throw _(`token '`+n+`', '`+e+`' expected`);return!1}function D(e){var n=null,r;return e===void 0?(r=m[f-1],delete m[f-1],r&&(t||r.type===`*`||r.lineEmpty)&&(n=r.leading?r.text:null)):(p<e&&T(),r=m[e],delete m[e],r&&!r.lineEmpty&&(t||r.type===`/`)&&(n=r.leading?null:r.text)),n}return Object.defineProperty({next:C,peek:T,push:w,skip:E,cmnt:D},"line",{get:function(){return f}})}})),eA=t(((e,t)=>{t.exports=C,C.filename=null,C.defaults={keepCase:!1};var n=$k(),r=Gk(),i=Wk(),a=qk(),o=Ik(),s=Jk(),c=Xk(),l=Rk(),u=Lk(),d=Yk(),f=Kk(),p=Q(),m=/^[1-9][0-9]*$/,h=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,_=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,y=/^-?0[0-7]+$/,b=p.patterns.numberRe,x=/^[a-zA-Z_][a-zA-Z_0-9]*$/,S=p.patterns.typeRefRe;function C(e,t,w){t instanceof r||(w=t,t=new r),w||=C.defaults;var T=w.preferTrailingComment||!1,E=n(e,w.alternateCommentMode||!1),D=E.next,O=E.push,k=E.peek,A=E.skip,j=E.cmnt,M=!0,N,ee,te,P=`proto2`,F=t,ne=[],re={},I=w.keepCase?function(e){return e}:p.camelCase;function ie(){ne.forEach(e=>{e._edition=P,Object.keys(re).forEach(t=>{e.getOption(t)===void 0&&e.setOption(t,re[t],!0)})})}function L(e,t,n){var r=C.filename;return n||(C.filename=null),Error(`illegal `+(t||`token`)+` '`+e+`' (`+(r?r+`, `:``)+`line `+E.line+`)`)}function ae(){var e=[],t;do{if((t=D())!==`"`&&t!==`'`)throw L(t);e.push(D()),A(t),t=k()}while(t===`"`||t===`'`);return e.join(``)}function R(e){var t=D();switch(t){case`'`:case`"`:return O(t),ae();case`true`:case`TRUE`:return!0;case`false`:case`FALSE`:return!1}try{return se(t,!0)}catch{if(e&&S.test(t))return t;throw L(t,`value`)}}function oe(e,t){var n,r;do if(t&&((n=k())===`"`||n===`'`)){var i=ae();if(e.push(i),P>=2023)throw L(i,`id`)}else try{e.push([r=z(D()),A(`to`,!0)?z(D()):r])}catch(r){if(t&&S.test(n)&&P>=2023)e.push(n);else throw r}while(A(`,`,!0));var a={options:void 0};a.setOption=function(e,t){this.options===void 0&&(this.options={}),this.options[e]=t},pe(a,function(e){if(e===`option`)ye(a,e),A(`;`);else throw L(e)},function(){Ce(a)})}function se(e,t){var n=1;switch(e.charAt(0)===`-`&&(n=-1,e=e.substring(1)),e){case`inf`:case`INF`:case`Inf`:return n*(1/0);case`nan`:case`NAN`:case`Nan`:case`NaN`:return NaN;case`0`:return 0}if(m.test(e))return n*parseInt(e,10);if(g.test(e))return n*parseInt(e,16);if(v.test(e))return n*parseInt(e,8);if(b.test(e))return n*parseFloat(e);throw L(e,`number`,t)}function z(e,t){switch(e){case`max`:case`MAX`:case`Max`:return 536870911;case`0`:return 0}if(!t&&e.charAt(0)===`-`)throw L(e,`id`);if(h.test(e))return parseInt(e,10);if(_.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw L(e,`id`)}function ce(){if(N!==void 0)throw L(`package`);if(N=D(),!S.test(N))throw L(N,`name`);F=F.define(N),A(`;`)}function le(){var e=k(),t;switch(e){case`weak`:t=te||=[],D();break;case`public`:D();default:t=ee||=[];break}e=ae(),A(`;`),t.push(e)}function ue(){if(A(`=`),P=ae(),P<2023)throw L(P,`syntax`);A(`;`)}function de(){if(A(`=`),P=ae(),![`2023`].includes(P))throw L(P,`edition`);A(`;`)}function fe(e,t,n){switch(n===void 0&&(n=0),t){case`option`:return ye(e,t),A(`;`),!0;case`message`:return me(e,t,n+1),!0;case`enum`:return _e(e,t),!0;case`service`:return we(e,t,n+1),!0;case`extend`:return Ee(e,t,n),!0}return!1}function pe(e,t,n){var r=E.line;if(e&&(typeof e.comment!=`string`&&(e.comment=j()),e.filename=C.filename),A(`{`,!0)){for(var i;(i=D())!==`}`;)t(i);A(`;`,!0)}else n&&n(),A(`;`),e&&(typeof e.comment!=`string`||T)&&(e.comment=j(r)||e.comment)}function me(e,t,n){if(n===void 0&&(n=0),n>p.nestingLimit)throw Error(`max depth exceeded`);if(!x.test(t=D()))throw L(t,`type name`);var r=new i(t);pe(r,function(e){if(!fe(r,e,n))switch(e){case`map`:V(r,e);break;case`required`:if(P!==`proto2`)throw L(e);case`repeated`:B(r,e,void 0,n+1);break;case`optional`:if(P===`proto3`)B(r,`proto3_optional`,void 0,n+1);else if(P!==`proto2`)throw L(e);else B(r,`optional`,void 0,n+1);break;case`oneof`:ge(r,e,n+1);break;case`extensions`:oe(r.extensions||=[]);break;case`reserved`:oe(r.reserved||=[],!0);break;default:if(P===`proto2`||!S.test(e))throw L(e);O(e),B(r,`optional`,void 0,n+1);break}}),e.add(r),e===F&&ne.push(r)}function B(e,t,n,r){var i=D();if(i===`group`){he(e,t,r);return}for(;i.endsWith(`.`)||k().startsWith(`.`);)i+=D();if(!S.test(i))throw L(i,`type`);var o=D();if(!x.test(o))throw L(o,`name`);o=I(o),A(`=`);var c=new a(o,z(D()),i,t,n);if(pe(c,function(e){if(e===`option`)ye(c,e),A(`;`);else throw L(e)},function(){Ce(c)}),t===`proto3_optional`){var l=new s(`_`+o);c.setOption(`proto3_optional`,!0),l.add(c),e.add(l)}else e.add(c);e===F&&ne.push(c)}function he(e,t,n){if(n===void 0&&(n=0),n>p.nestingLimit)throw Error(`max depth exceeded`);if(P>=2023)throw L(`group`);var r=D();if(!x.test(r))throw L(r,`name`);var o=p.lcFirst(r);r===o&&(r=p.ucFirst(r)),A(`=`);var s=z(D()),c=new i(r);c.group=!0;var l=new a(o,s,r,t);l.filename=C.filename,pe(c,function(e){switch(e){case`option`:ye(c,e),A(`;`);break;case`required`:case`repeated`:B(c,e,void 0,n+1);break;case`optional`:P===`proto3`?B(c,`proto3_optional`,void 0,n+1):B(c,`optional`,void 0,n+1);break;case`message`:me(c,e,n+1);break;case`enum`:_e(c,e);break;case`reserved`:oe(c.reserved||=[],!0);break;default:throw L(e)}}),e.add(c).add(l)}function V(e){A(`<`);var t=D();if(f.mapKey[t]===void 0)throw L(t,`type`);A(`,`);var n=D();if(!S.test(n))throw L(n,`type`);A(`>`);var r=D();if(!x.test(r))throw L(r,`name`);A(`=`);var i=new o(I(r),z(D()),t,n);pe(i,function(e){if(e===`option`)ye(i,e),A(`;`);else throw L(e)},function(){Ce(i)}),e.add(i)}function ge(e,t,n){if(!x.test(t=D()))throw L(t,`name`);var r=new s(I(t));pe(r,function(e){e===`option`?(ye(r,e),A(`;`)):(O(e),B(r,`optional`,void 0,n))}),e.add(r)}function _e(e,t){if(!x.test(t=D()))throw L(t,`name`);var n=new c(t);pe(n,function(e){switch(e){case`option`:ye(n,e),A(`;`);break;case`reserved`:oe(n.reserved||=[],!0),n.reserved===void 0&&(n.reserved=[]);break;default:ve(n,e)}}),e.add(n),e===F&&ne.push(n)}function ve(e,t){if(!x.test(t))throw L(t,`name`);A(`=`);var n=z(D(),!0),r={options:void 0};r.getOption=function(e){return this.options[e]},r.setOption=function(e,t){d.prototype.setOption.call(r,e,t)},r.setParsedOption=function(){},pe(r,function(e){if(e===`option`)ye(r,e),A(`;`);else throw L(e)},function(){Ce(r)}),e.add(t,n,r.comment,r.parsedOptions||r.options)}function ye(e,t){var n,r,i=!0;for(t===`option`&&(t=D());t!==`=`;){if(t===`(`){var a=D();A(`)`),t=`(`+a+`)`}if(i){if(i=!1,t.includes(`.`)&&!t.includes(`(`)){var o=t.split(`.`);n=o[0]+`.`,t=o[1];continue}n=t}else r=r?r+=t:t;t=D()}var s=be(e,r?n.concat(r):n);r=r&&r[0]===`.`?r.slice(1):r,n=n&&n[n.length-1]===`.`?n.slice(0,-1):n,Se(e,n,s,r)}function be(e,t,n){if(n===void 0&&(n=0),n>p.recursionLimit)throw Error(`max depth exceeded`);if(A(`{`,!0)){for(var r={};!A(`}`,!0);){if(!x.test(H=D()))throw L(H,`name`);if(H===null)throw L(H,`end of input`);var i,a=H;if(A(`:`,!0),k()===`{`)i=be(e,t+`.`+H,n+1);else if(k()===`[`){i=[];var o;if(A(`[`,!0)){do o=R(!0),i.push(o);while(A(`,`,!0));A(`]`),o!==void 0&&xe(e,t+`.`+H,o)}}else i=R(!0),xe(e,t+`.`+H,i);var s=r[a];s&&(i=[].concat(s,i)),a!==`__proto__`&&(r[a]=i),A(`,`,!0),A(`;`,!0)}return r}var c=R(!0);return xe(e,t,c),c}function xe(e,t,n){if(F===e&&/^features\./.test(t)){re[t]=n;return}e.setOption&&e.setOption(t,n)}function Se(e,t,n,r){e.setParsedOption&&e.setParsedOption(t,n,r)}function Ce(e){if(A(`[`,!0)){do ye(e,`option`);while(A(`,`,!0));A(`]`)}return e}function we(e,t,n){if(n===void 0&&(n=0),n>p.recursionLimit)throw Error(`max depth exceeded`);if(!x.test(t=D()))throw L(t,`service name`);var r=new l(t);pe(r,function(e){if(!fe(r,e,n))if(e===`rpc`)Te(r,e);else throw L(e)}),e.add(r),e===F&&ne.push(r)}function Te(e,t){var n=j(),r=t;if(!x.test(t=D()))throw L(t,`name`);var i=t,a,o,s,c;if(A(`(`),A(`stream`,!0)&&(o=!0),!S.test(t=D())||(a=t,A(`)`),A(`returns`),A(`(`),A(`stream`,!0)&&(c=!0),!S.test(t=D())))throw L(t);s=t,A(`)`);var l=new u(i,r,a,s,o,c);l.comment=n,pe(l,function(e){if(e===`option`)ye(l,e),A(`;`);else throw L(e)}),e.add(l)}function Ee(e,t,n){if(!S.test(t=D()))throw L(t,`reference`);var r=t;pe(null,function(t){switch(t){case`required`:case`repeated`:B(e,t,r,n+1);break;case`optional`:P===`proto3`?B(e,`proto3_optional`,r,n+1):B(e,`optional`,r,n+1);break;default:if(P===`proto2`||!S.test(t))throw L(t);O(t),B(e,`optional`,r,n+1);break}})}for(var H;(H=D())!==null;)switch(H){case`package`:if(!M)throw L(H);ce();break;case`import`:if(!M)throw L(H);le();break;case`syntax`:if(!M)throw L(H);ue();break;case`edition`:if(!M)throw L(H);de();break;case`option`:ye(F,H),A(`;`,!0);break;default:if(fe(F,H,0)){M=!1;continue}throw L(H)}return ie(),C.filename=null,{package:N,imports:ee,weakImports:te,root:t}}})),tA=t(((e,t)=>{t.exports=r;var n=/\/|\./;function r(e,t){n.test(e)||(e=`google/protobuf/`+e+`.proto`,t={nested:{google:{nested:{protobuf:{nested:t}}}}}),r[e]=t}r(`any`,{Any:{fields:{type_url:{type:`string`,id:1},value:{type:`bytes`,id:2}}}});var i;r(`duration`,{Duration:i={fields:{seconds:{type:`int64`,id:1},nanos:{type:`int32`,id:2}}}}),r(`timestamp`,{Timestamp:i}),r(`empty`,{Empty:{fields:{}}}),r(`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}}}}),r(`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}}}}),r(`field_mask`,{FieldMask:{fields:{paths:{rule:`repeated`,type:`string`,id:1}}}}),r.get=function(e){return r[e]||null}})),nA=t(((e,t)=>{var n=t.exports=Qk();n.build=`full`,n.tokenize=$k(),n.parse=eA(),n.common=tA(),n.Root._configure(n.Type,n.parse,n.common)})),rA=t(((e,t)=>{t.exports=nA()})),iA=t(((e,t)=>{t.exports={nested:{google:{nested:{protobuf:{options:{go_package:`google.golang.org/protobuf/types/descriptorpb`,java_package:`com.google.protobuf`,java_outer_classname:`DescriptorProtos`,csharp_namespace:`Google.Protobuf.Reflection`,objc_class_prefix:`GPB`,cc_enable_arenas:!0,optimize_for:`SPEED`},nested:{FileDescriptorSet:{edition:`proto2`,fields:{file:{rule:`repeated`,type:`FileDescriptorProto`,id:1}},extensions:[[536e6,536e6]]},Edition:{edition:`proto2`,values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},package:{type:`string`,id:2},dependency:{rule:`repeated`,type:`string`,id:3},publicDependency:{rule:`repeated`,type:`int32`,id:10},weakDependency:{rule:`repeated`,type:`int32`,id:11},optionDependency:{rule:`repeated`,type:`string`,id:15},messageType:{rule:`repeated`,type:`DescriptorProto`,id:4},enumType:{rule:`repeated`,type:`EnumDescriptorProto`,id:5},service:{rule:`repeated`,type:`ServiceDescriptorProto`,id:6},extension:{rule:`repeated`,type:`FieldDescriptorProto`,id:7},options:{type:`FileOptions`,id:8},sourceCodeInfo:{type:`SourceCodeInfo`,id:9},syntax:{type:`string`,id:12},edition:{type:`Edition`,id:14}}},DescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},field:{rule:`repeated`,type:`FieldDescriptorProto`,id:2},extension:{rule:`repeated`,type:`FieldDescriptorProto`,id:6},nestedType:{rule:`repeated`,type:`DescriptorProto`,id:3},enumType:{rule:`repeated`,type:`EnumDescriptorProto`,id:4},extensionRange:{rule:`repeated`,type:`ExtensionRange`,id:5},oneofDecl:{rule:`repeated`,type:`OneofDescriptorProto`,id:8},options:{type:`MessageOptions`,id:7},reservedRange:{rule:`repeated`,type:`ReservedRange`,id:9},reservedName:{rule:`repeated`,type:`string`,id:10},visibility:{type:`SymbolVisibility`,id:11}},nested:{ExtensionRange:{fields:{start:{type:`int32`,id:1},end:{type:`int32`,id:2},options:{type:`ExtensionRangeOptions`,id:3}}},ReservedRange:{fields:{start:{type:`int32`,id:1},end:{type:`int32`,id:2}}}}},ExtensionRangeOptions:{edition:`proto2`,fields:{uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999},declaration:{rule:`repeated`,type:`Declaration`,id:2,options:{retention:`RETENTION_SOURCE`}},features:{type:`FeatureSet`,id:50},verification:{type:`VerificationState`,id:3,options:{default:`UNVERIFIED`,retention:`RETENTION_SOURCE`}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:`int32`,id:1},fullName:{type:`string`,id:2},type:{type:`string`,id:3},reserved:{type:`bool`,id:5},repeated:{type:`bool`,id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},number:{type:`int32`,id:3},label:{type:`Label`,id:4},type:{type:`Type`,id:5},typeName:{type:`string`,id:6},extendee:{type:`string`,id:2},defaultValue:{type:`string`,id:7},oneofIndex:{type:`int32`,id:9},jsonName:{type:`string`,id:10},options:{type:`FieldOptions`,id:8},proto3Optional:{type:`bool`,id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},options:{type:`OneofOptions`,id:2}}},EnumDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},value:{rule:`repeated`,type:`EnumValueDescriptorProto`,id:2},options:{type:`EnumOptions`,id:3},reservedRange:{rule:`repeated`,type:`EnumReservedRange`,id:4},reservedName:{rule:`repeated`,type:`string`,id:5},visibility:{type:`SymbolVisibility`,id:6}},nested:{EnumReservedRange:{fields:{start:{type:`int32`,id:1},end:{type:`int32`,id:2}}}}},EnumValueDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},number:{type:`int32`,id:2},options:{type:`EnumValueOptions`,id:3}}},ServiceDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},method:{rule:`repeated`,type:`MethodDescriptorProto`,id:2},options:{type:`ServiceOptions`,id:3}}},MethodDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},inputType:{type:`string`,id:2},outputType:{type:`string`,id:3},options:{type:`MethodOptions`,id:4},clientStreaming:{type:`bool`,id:5},serverStreaming:{type:`bool`,id:6}}},FileOptions:{edition:`proto2`,fields:{javaPackage:{type:`string`,id:1},javaOuterClassname:{type:`string`,id:8},javaMultipleFiles:{type:`bool`,id:10},javaGenerateEqualsAndHash:{type:`bool`,id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:`bool`,id:27},optimizeFor:{type:`OptimizeMode`,id:9,options:{default:`SPEED`}},goPackage:{type:`string`,id:11},ccGenericServices:{type:`bool`,id:16},javaGenericServices:{type:`bool`,id:17},pyGenericServices:{type:`bool`,id:18},deprecated:{type:`bool`,id:23},ccEnableArenas:{type:`bool`,id:31,options:{default:!0}},objcClassPrefix:{type:`string`,id:36},csharpNamespace:{type:`string`,id:37},swiftPrefix:{type:`string`,id:39},phpClassPrefix:{type:`string`,id:40},phpNamespace:{type:`string`,id:41},phpMetadataNamespace:{type:`string`,id:44},rubyPackage:{type:`string`,id:45},features:{type:`FeatureSet`,id:50},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],`php_generic_services`],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:`proto2`,fields:{messageSetWireFormat:{type:`bool`,id:1},noStandardDescriptorAccessor:{type:`bool`,id:2},deprecated:{type:`bool`,id:3},mapEntry:{type:`bool`,id:7},deprecatedLegacyJsonFieldConflicts:{type:`bool`,id:11,options:{deprecated:!0}},features:{type:`FeatureSet`,id:12},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:`proto2`,fields:{ctype:{type:`CType`,id:1,options:{default:`STRING`}},packed:{type:`bool`,id:2},jstype:{type:`JSType`,id:6,options:{default:`JS_NORMAL`}},lazy:{type:`bool`,id:5},unverifiedLazy:{type:`bool`,id:15},deprecated:{type:`bool`,id:3},weak:{type:`bool`,id:10,options:{deprecated:!0}},debugRedact:{type:`bool`,id:16},retention:{type:`OptionRetention`,id:17},targets:{rule:`repeated`,type:`OptionTargetType`,id:19},editionDefaults:{rule:`repeated`,type:`EditionDefault`,id:20},features:{type:`FeatureSet`,id:21},featureSupport:{type:`FeatureSupport`,id:22},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:`Edition`,id:3},value:{type:`string`,id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:`Edition`,id:1},editionDeprecated:{type:`Edition`,id:2},deprecationWarning:{type:`string`,id:3},editionRemoved:{type:`Edition`,id:4}}}}},OneofOptions:{edition:`proto2`,fields:{features:{type:`FeatureSet`,id:1},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:`proto2`,fields:{allowAlias:{type:`bool`,id:2},deprecated:{type:`bool`,id:3},deprecatedLegacyJsonFieldConflicts:{type:`bool`,id:6,options:{deprecated:!0}},features:{type:`FeatureSet`,id:7},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:`proto2`,fields:{deprecated:{type:`bool`,id:1},features:{type:`FeatureSet`,id:2},debugRedact:{type:`bool`,id:3},featureSupport:{type:`FieldOptions.FeatureSupport`,id:4},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:`proto2`,fields:{features:{type:`FeatureSet`,id:34},deprecated:{type:`bool`,id:33},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:`proto2`,fields:{deprecated:{type:`bool`,id:33},idempotencyLevel:{type:`IdempotencyLevel`,id:34,options:{default:`IDEMPOTENCY_UNKNOWN`}},features:{type:`FeatureSet`,id:35},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:`proto2`,fields:{name:{rule:`repeated`,type:`NamePart`,id:2},identifierValue:{type:`string`,id:3},positiveIntValue:{type:`uint64`,id:4},negativeIntValue:{type:`int64`,id:5},doubleValue:{type:`double`,id:6},stringValue:{type:`bytes`,id:7},aggregateValue:{type:`string`,id:8}},nested:{NamePart:{fields:{namePart:{rule:`required`,type:`string`,id:1},isExtension:{rule:`required`,type:`bool`,id:2}}}}},FeatureSet:{edition:`proto2`,fields:{fieldPresence:{type:`FieldPresence`,id:1,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_2023`,"edition_defaults.value":`EXPLICIT`}},enumType:{type:`EnumType`,id:2,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`OPEN`}},repeatedFieldEncoding:{type:`RepeatedFieldEncoding`,id:3,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`PACKED`}},utf8Validation:{type:`Utf8Validation`,id:4,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`VERIFY`}},messageEncoding:{type:`MessageEncoding`,id:5,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_LEGACY`,"edition_defaults.value":`LENGTH_PREFIXED`}},jsonFormat:{type:`JsonFormat`,id:6,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`ALLOW`}},enforceNamingStyle:{type:`EnforceNamingStyle`,id:7,options:{retention:`RETENTION_SOURCE`,targets:`TARGET_TYPE_METHOD`,"feature_support.edition_introduced":`EDITION_2024`,"edition_defaults.edition":`EDITION_2024`,"edition_defaults.value":`STYLE2024`}},defaultSymbolVisibility:{type:`VisibilityFeature.DefaultSymbolVisibility`,id:8,options:{retention:`RETENTION_SOURCE`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2024`,"edition_defaults.edition":`EDITION_2024`,"edition_defaults.value":`EXPORT_TOP_LEVEL`}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:`proto2`,fields:{defaults:{rule:`repeated`,type:`FeatureSetEditionDefault`,id:1},minimumEdition:{type:`Edition`,id:4},maximumEdition:{type:`Edition`,id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:`Edition`,id:3},overridableFeatures:{type:`FeatureSet`,id:4},fixedFeatures:{type:`FeatureSet`,id:5}},reserved:[[1,1],[2,2],`features`]}}},SourceCodeInfo:{edition:`proto2`,fields:{location:{rule:`repeated`,type:`Location`,id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:`repeated`,type:`int32`,id:1,options:{packed:!0}},span:{rule:`repeated`,type:`int32`,id:2,options:{packed:!0}},leadingComments:{type:`string`,id:3},trailingComments:{type:`string`,id:4},leadingDetachedComments:{rule:`repeated`,type:`string`,id:6}}}}},GeneratedCodeInfo:{edition:`proto2`,fields:{annotation:{rule:`repeated`,type:`Annotation`,id:1}},nested:{Annotation:{fields:{path:{rule:`repeated`,type:`int32`,id:1,options:{packed:!0}},sourceFile:{type:`string`,id:2},begin:{type:`int32`,id:3},end:{type:`int32`,id:4},semantic:{type:`Semantic`,id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:`proto2`,values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}})),aA=t(((e,t)=>{var n=rA();t.exports=e=n.descriptor=n.Root.fromJSON(iA()).lookup(`.google.protobuf`);var r=n.Namespace,i=n.Root,a=n.Enum,o=n.Type,s=n.Field,c=n.MapField,l=n.OneOf,u=n.Service,d=n.Method,f=n.util.patterns,p=f.numberRe,m=f.typeRefRe;i.fromDescriptor=function(t){typeof t.length==`number`&&(t=e.FileDescriptorSet.decode(t));var n=new i;if(t.file)for(var r,c,l=0,d;l<t.file.length;++l){c=n,(r=t.file[l]).package&&r.package.length&&(c=n.define(r.package));var f=A(r);if(r.name&&r.name.length&&n.files.push(c.filename=r.name),r.messageType)for(d=0;d<r.messageType.length;++d)c.add(o.fromDescriptor(r.messageType[d],f));if(r.enumType)for(d=0;d<r.enumType.length;++d)c.add(a.fromDescriptor(r.enumType[d],f));if(r.extension)for(d=0;d<r.extension.length;++d)c.add(s.fromDescriptor(r.extension[d],f));if(r.service)for(d=0;d<r.service.length;++d)c.add(u.fromDescriptor(r.service[d],f));var p=T(r.options,e.FileOptions);if(p){var m=Object.keys(p);for(d=0;d<m.length;++d)c.setOption(m[d],p[m[d]])}}return n.resolveAll()},i.prototype.toDescriptor=function(t){var n=e.FileDescriptorSet.create();return h(this,n.file,t),n};function h(t,n,c){var l=e.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,`_`)||`root`)+`.proto`});j(c,l),t instanceof i||(l.package=t.fullName.substring(1));for(var d=0,f;d<t.nestedArray.length;++d)(f=t._nestedArray[d])instanceof o?l.messageType.push(f.toDescriptor(c)):f instanceof a?l.enumType.push(f.toDescriptor()):f instanceof s?l.extension.push(f.toDescriptor(c)):f instanceof u?l.service.push(f.toDescriptor()):f instanceof r&&h(f,n,c);l.options=D(t.options,e.FileOptions),l.messageType.length+l.enumType.length+l.extension.length+l.service.length&&n.push(l)}var g=0;o.fromDescriptor=function(t,r,i,c){if(c===void 0&&(c=0),c>n.util.nestingLimit)throw Error(`max depth exceeded`);typeof t.length==`number`&&(t=e.DescriptorProto.decode(t));var u=new o(t.name.length?t.name:`Type`+g++,T(t.options,e.MessageOptions)),d;if(i||(u._edition=r),t.oneofDecl)for(d=0;d<t.oneofDecl.length;++d)u.add(l.fromDescriptor(t.oneofDecl[d]));if(t.field)for(d=0;d<t.field.length;++d){var f=s.fromDescriptor(t.field[d],r,!0);u.add(f),t.field[d].hasOwnProperty(`oneofIndex`)&&u.oneofsArray[t.field[d].oneofIndex].add(f)}if(t.extension)for(d=0;d<t.extension.length;++d)u.add(s.fromDescriptor(t.extension[d],r,!0));if(t.nestedType)for(d=0;d<t.nestedType.length;++d)u.add(o.fromDescriptor(t.nestedType[d],r,!0,c+1)),t.nestedType[d].options&&t.nestedType[d].options.mapEntry&&u.setOption(`map_entry`,!0);if(t.enumType)for(d=0;d<t.enumType.length;++d)u.add(a.fromDescriptor(t.enumType[d],r,!0));if(t.extensionRange&&t.extensionRange.length)for(u.extensions=[],d=0;d<t.extensionRange.length;++d)u.extensions.push([t.extensionRange[d].start,t.extensionRange[d].end]);if(t.reservedRange&&t.reservedRange.length||t.reservedName&&t.reservedName.length){if(u.reserved=[],t.reservedRange)for(d=0;d<t.reservedRange.length;++d)u.reserved.push([t.reservedRange[d].start,t.reservedRange[d].end]);if(t.reservedName)for(d=0;d<t.reservedName.length;++d)u.reserved.push(t.reservedName[d])}return u},o.prototype.toDescriptor=function(t){var n=e.DescriptorProto.create({name:this.name}),r;for(r=0;r<this.fieldsArray.length;++r){var i;if(n.field.push(i=this._fieldsArray[r].toDescriptor(t)),this._fieldsArray[r]instanceof c){var l=C(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),u=C(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),d=u===11||u===14?this._fieldsArray[r].resolvedType&&O(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(e.DescriptorProto.create({name:i.typeName,field:[e.FieldDescriptorProto.create({name:`key`,number:1,label:1,type:l}),e.FieldDescriptorProto.create({name:`value`,number:2,label:1,type:u,typeName:d})],options:e.MessageOptions.create({mapEntry:!0})}))}}for(r=0;r<this.oneofsArray.length;++r)n.oneofDecl.push(this._oneofsArray[r].toDescriptor());for(r=0;r<this.nestedArray.length;++r)this._nestedArray[r]instanceof s?n.field.push(this._nestedArray[r].toDescriptor(t)):this._nestedArray[r]instanceof o?n.nestedType.push(this._nestedArray[r].toDescriptor(t)):this._nestedArray[r]instanceof a&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(e.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)typeof this.reserved[r]==`string`?n.reservedName.push(this.reserved[r]):n.reservedRange.push(e.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=D(this.options,e.MessageOptions),n},s.fromDescriptor=function(t,n,r){if(typeof t.length==`number`&&(t=e.DescriptorProto.decode(t)),typeof t.number!=`number`)throw Error(`missing field id`);var i=t.typeName,a;if(i!=null&&i!==``){if(typeof i!=`string`||!m.test(i))throw Error(`illegal type name: `+i);a=i}else a=x(t.type);var o;switch(t.label){case 1:o=void 0;break;case 2:o=`required`;break;case 3:o=`repeated`;break;default:throw Error(`illegal label: `+t.label)}var c=t.extendee;if(c!=null&&c!==``){if(typeof c!=`string`||!m.test(c))throw Error(`illegal type name: `+c)}else c=void 0;var l=new s(t.name.length?t.name:`field`+t.number,t.number,a,o,c);if(r||(l._edition=n),l.options=T(t.options,e.FieldOptions),t.proto3_optional&&(l.options.proto3_optional=!0),t.defaultValue&&t.defaultValue.length){var u=t.defaultValue;switch(u){case`true`:case`TRUE`:u=!0;break;case`false`:case`FALSE`:u=!1;break;default:p.exec(u)&&(u=parseInt(u));break}l.setOption(`default`,u)}return S(t.type)&&(n===`proto3`?t.options&&!t.options.packed&&l.setOption(`packed`,!1):(!n||n===`proto2`)&&t.options&&t.options.packed&&l.setOption(`packed`,!0)),l},s.prototype.toDescriptor=function(t){var r=e.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=n.util.ucFirst(this.name),r.label=3;else{switch(r.type=C(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?O(this.parent,this.resolvedType):this.type;break}this.rule===`repeated`?r.label=3:this.required&&t===`proto2`?r.label=2:r.label=1}if(r.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&this.parent instanceof o&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error(`missing oneof`);return this.options&&(r.options=D(this.options,e.FieldOptions),this.options.default!=null&&(r.defaultValue=String(this.options.default)),this.options.proto3_optional&&(r.proto3_optional=!0)),t===`proto3`?this.packed||((r.options||=e.FieldOptions.create()).packed=!1):(!t||t===`proto2`)&&this.packed&&((r.options||=e.FieldOptions.create()).packed=!0),r};var _=0;a.fromDescriptor=function(t,n,r){typeof t.length==`number`&&(t=e.EnumDescriptorProto.decode(t));var i={};if(t.value)for(var o=0;o<t.value.length;++o){var s=t.value[o].name,c=t.value[o].number||0;i[s&&s.length?s:`NAME`+c]=c}var l=new a(t.name&&t.name.length?t.name:`Enum`+_++,i,T(t.options,e.EnumOptions));return r||(l._edition=n),l},a.prototype.toDescriptor=function(){for(var t=[],n=0,r=Object.keys(this.values);n<r.length;++n)t.push(e.EnumValueDescriptorProto.create({name:r[n],number:this.values[r[n]]}));return e.EnumDescriptorProto.create({name:this.name,value:t,options:D(this.options,e.EnumOptions)})};var v=0;l.fromDescriptor=function(t){return typeof t.length==`number`&&(t=e.OneofDescriptorProto.decode(t)),new l(t.name&&t.name.length?t.name:`oneof`+v++)},l.prototype.toDescriptor=function(){return e.OneofDescriptorProto.create({name:this.name})};var y=0;u.fromDescriptor=function(t,n,r){typeof t.length==`number`&&(t=e.ServiceDescriptorProto.decode(t));var i=new u(t.name&&t.name.length?t.name:`Service`+y++,T(t.options,e.ServiceOptions));if(r||(i._edition=n),t.method)for(var a=0;a<t.method.length;++a)i.add(d.fromDescriptor(t.method[a]));return i},u.prototype.toDescriptor=function(){for(var t=[],n=0;n<this.methodsArray.length;++n)t.push(this._methodsArray[n].toDescriptor());return e.ServiceDescriptorProto.create({name:this.name,method:t,options:D(this.options,e.ServiceOptions)})};var b=0;d.fromDescriptor=function(t){typeof t.length==`number`&&(t=e.MethodDescriptorProto.decode(t));var n=t.inputType,r=t.outputType;if(n!=null&&n!==``&&(typeof n!=`string`||!m.test(n)))throw Error(`illegal type name: `+n);if(r!=null&&r!==``&&(typeof r!=`string`||!m.test(r)))throw Error(`illegal type name: `+r);return new d(t.name&&t.name.length?t.name:`Method`+b++,`rpc`,n,r,!!t.clientStreaming,!!t.serverStreaming,T(t.options,e.MethodOptions))},d.prototype.toDescriptor=function(){return e.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:D(this.options,e.MethodOptions)})};function x(e){switch(e){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: `+e)}function S(e){switch(e){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 C(e,t,n){switch(e){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(t instanceof a)return 14;if(t instanceof o)return n?10:11;throw Error(`illegal type: `+e)}function w(e,t){for(var n={},r=0,i,s;r<t.fieldsArray.length;++r)if((s=(i=t._fieldsArray[r]).name)!==`uninterpretedOption`&&Object.prototype.hasOwnProperty.call(e,s)){var c=k(s);i.resolvedType instanceof o?n[c]=w(e[s],i.resolvedType):i.resolvedType instanceof a?n[c]=i.resolvedType.valuesById[e[s]]:n[c]=e[s]}return n}function T(e,t){if(e)return w(t.toObject(e),t)}function E(e,t){for(var r={},i=Object.keys(e),a=0;a<i.length;++a){var s=i[a],c=n.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(t.fields,c)){var l=t.fields[c];l.resolvedType instanceof o?r[c]=E(e[s],l.resolvedType):r[c]=e[s],l.repeated&&!Array.isArray(r[c])&&(r[c]=[r[c]])}}return r}function D(e,t){if(e)return t.fromObject(E(e,t))}function O(e,t){var n=e.fullName.split(`.`),a=t.fullName.split(`.`),o=0,s=0,c=a.length-1;if(!(e instanceof i)&&t instanceof r)for(;o<n.length&&s<c&&n[o]===a[s];){var l=t.lookup(n[o++],!0);if(l!==null&&l!==t)break;++s}else for(;o<n.length&&s<c&&n[o]===a[s];++o,++s);return a.slice(s).join(`.`)}function k(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return`_`+t.toLowerCase()})}function A(t){if(t.syntax===`editions`)switch(t.edition){case e.Edition.EDITION_2023:return`2023`;default:throw Error(`Unsupported edition `+t.edition)}return t.syntax===`proto3`?`proto3`:`proto2`}function j(t,n){if(t)if(t===`proto2`||t===`proto3`)n.syntax=t;else switch(n.syntax=`editions`,t){case`2023`:n.edition=e.Edition.EDITION_2023;break;default:throw Error(`Unsupported edition `+t)}}})),oA=t(((e,t)=>{t.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}}}}}}}}})),sA=t(((e,t)=>{t.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:`string`,id:1}}}}}}}}}})),cA=t(((e,t)=>{t.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}}}}}}}}}})),lA=t((e=>{
57
+ `&&++f,++l===u)throw _(`comment`);i=a,a=y(l)}while(i!==`*`||a!==`/`);++l,s&&(b(o,l-2,d),d=!0),r=!0}else return`/`}}while(r);var p=l;if(n.lastIndex=0,!n.test(y(p++)))for(;p<u&&!n.test(y(p));)++p;var m=e.substring(l,l=p);return(m===`"`||m===`'`)&&(g=m),m}function w(e){h.push(e)}function T(){if(!h.length){var e=C();if(e===null)return null;w(e)}return h[0]}function E(e,t){var n=T();if(n===e)return C(),!0;if(!t)throw _(`token '`+n+`', '`+e+`' expected`);return!1}function D(e){var n=null,r;return e===void 0?(r=m[f-1],delete m[f-1],r&&(t||r.type===`*`||r.lineEmpty)&&(n=r.leading?r.text:null)):(p<e&&T(),r=m[e],delete m[e],r&&!r.lineEmpty&&(t||r.type===`/`)&&(n=r.leading?null:r.text)),n}return Object.defineProperty({next:C,peek:T,push:w,skip:E,cmnt:D},"line",{get:function(){return f}})}})),tA=t(((e,t)=>{t.exports=C,C.filename=null,C.defaults={keepCase:!1};var n=eA(),r=Kk(),i=Gk(),a=Jk(),o=Lk(),s=Yk(),c=Zk(),l=zk(),u=Rk(),d=Xk(),f=qk(),p=Q(),m=/^[1-9][0-9]*$/,h=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,_=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,y=/^-?0[0-7]+$/,b=p.patterns.numberRe,x=/^[a-zA-Z_][a-zA-Z_0-9]*$/,S=p.patterns.typeRefRe;function C(e,t,w){t instanceof r||(w=t,t=new r),w||=C.defaults;var T=w.preferTrailingComment||!1,E=n(e,w.alternateCommentMode||!1),D=E.next,O=E.push,k=E.peek,A=E.skip,j=E.cmnt,ee=!0,M,te,ne,N=`proto2`,P=t,re=[],ie={},ae=w.keepCase?function(e){return e}:p.camelCase;function oe(){re.forEach(e=>{e._edition=N,Object.keys(ie).forEach(t=>{e.getOption(t)===void 0&&e.setOption(t,ie[t],!0)})})}function F(e,t,n){var r=C.filename;return n||(C.filename=null),Error(`illegal `+(t||`token`)+` '`+e+`' (`+(r?r+`, `:``)+`line `+E.line+`)`)}function I(){var e=[],t;do{if((t=D())!==`"`&&t!==`'`)throw F(t);e.push(D()),A(t),t=k()}while(t===`"`||t===`'`);return e.join(``)}function se(e){var t=D();switch(t){case`'`:case`"`:return O(t),I();case`true`:case`TRUE`:return!0;case`false`:case`FALSE`:return!1}try{return ce(t,!0)}catch{if(e&&S.test(t))return t;throw F(t,`value`)}}function L(e,t){var n,r;do if(t&&((n=k())===`"`||n===`'`)){var i=I();if(e.push(i),N>=2023)throw F(i,`id`)}else try{e.push([r=le(D()),A(`to`,!0)?le(D()):r])}catch(r){if(t&&S.test(n)&&N>=2023)e.push(n);else throw r}while(A(`,`,!0));var a={options:void 0};a.setOption=function(e,t){this.options===void 0&&(this.options={}),this.options[e]=t},me(a,function(e){if(e===`option`)V(a,e),A(`;`);else throw F(e)},function(){Ce(a)})}function ce(e,t){var n=1;switch(e.charAt(0)===`-`&&(n=-1,e=e.substring(1)),e){case`inf`:case`INF`:case`Inf`:return n*(1/0);case`nan`:case`NAN`:case`Nan`:case`NaN`:return NaN;case`0`:return 0}if(m.test(e))return n*parseInt(e,10);if(g.test(e))return n*parseInt(e,16);if(v.test(e))return n*parseInt(e,8);if(b.test(e))return n*parseFloat(e);throw F(e,`number`,t)}function le(e,t){switch(e){case`max`:case`MAX`:case`Max`:return 536870911;case`0`:return 0}if(!t&&e.charAt(0)===`-`)throw F(e,`id`);if(h.test(e))return parseInt(e,10);if(_.test(e))return parseInt(e,16);if(y.test(e))return parseInt(e,8);throw F(e,`id`)}function R(){if(M!==void 0)throw F(`package`);if(M=D(),!S.test(M))throw F(M,`name`);P=P.define(M),A(`;`)}function ue(){var e=k(),t;switch(e){case`weak`:t=ne||=[],D();break;case`public`:D();default:t=te||=[];break}e=I(),A(`;`),t.push(e)}function de(){if(A(`=`),N=I(),N<2023)throw F(N,`syntax`);A(`;`)}function fe(){if(A(`=`),N=I(),![`2023`].includes(N))throw F(N,`edition`);A(`;`)}function pe(e,t,n){switch(n===void 0&&(n=0),t){case`option`:return V(e,t),A(`;`),!0;case`message`:return he(e,t,n+1),!0;case`enum`:return ve(e,t),!0;case`service`:return we(e,t,n+1),!0;case`extend`:return Ee(e,t,n),!0}return!1}function me(e,t,n){var r=E.line;if(e&&(typeof e.comment!=`string`&&(e.comment=j()),e.filename=C.filename),A(`{`,!0)){for(var i;(i=D())!==`}`;)t(i);A(`;`,!0)}else n&&n(),A(`;`),e&&(typeof e.comment!=`string`||T)&&(e.comment=j(r)||e.comment)}function he(e,t,n){if(n===void 0&&(n=0),n>p.nestingLimit)throw Error(`max depth exceeded`);if(!x.test(t=D()))throw F(t,`type name`);var r=new i(t);me(r,function(e){if(!pe(r,e,n))switch(e){case`map`:_e(r,e);break;case`required`:if(N!==`proto2`)throw F(e);case`repeated`:z(r,e,void 0,n+1);break;case`optional`:if(N===`proto3`)z(r,`proto3_optional`,void 0,n+1);else if(N!==`proto2`)throw F(e);else z(r,`optional`,void 0,n+1);break;case`oneof`:B(r,e,n+1);break;case`extensions`:L(r.extensions||=[]);break;case`reserved`:L(r.reserved||=[],!0);break;default:if(N===`proto2`||!S.test(e))throw F(e);O(e),z(r,`optional`,void 0,n+1);break}}),e.add(r),e===P&&re.push(r)}function z(e,t,n,r){var i=D();if(i===`group`){ge(e,t,r);return}for(;i.endsWith(`.`)||k().startsWith(`.`);)i+=D();if(!S.test(i))throw F(i,`type`);var o=D();if(!x.test(o))throw F(o,`name`);o=ae(o),A(`=`);var c=new a(o,le(D()),i,t,n);if(me(c,function(e){if(e===`option`)V(c,e),A(`;`);else throw F(e)},function(){Ce(c)}),t===`proto3_optional`){var l=new s(`_`+o);c.setOption(`proto3_optional`,!0),l.add(c),e.add(l)}else e.add(c);e===P&&re.push(c)}function ge(e,t,n){if(n===void 0&&(n=0),n>p.nestingLimit)throw Error(`max depth exceeded`);if(N>=2023)throw F(`group`);var r=D();if(!x.test(r))throw F(r,`name`);var o=p.lcFirst(r);r===o&&(r=p.ucFirst(r)),A(`=`);var s=le(D()),c=new i(r);c.group=!0;var l=new a(o,s,r,t);l.filename=C.filename,me(c,function(e){switch(e){case`option`:V(c,e),A(`;`);break;case`required`:case`repeated`:z(c,e,void 0,n+1);break;case`optional`:N===`proto3`?z(c,`proto3_optional`,void 0,n+1):z(c,`optional`,void 0,n+1);break;case`message`:he(c,e,n+1);break;case`enum`:ve(c,e);break;case`reserved`:L(c.reserved||=[],!0);break;default:throw F(e)}}),e.add(c).add(l)}function _e(e){A(`<`);var t=D();if(f.mapKey[t]===void 0)throw F(t,`type`);A(`,`);var n=D();if(!S.test(n))throw F(n,`type`);A(`>`);var r=D();if(!x.test(r))throw F(r,`name`);A(`=`);var i=new o(ae(r),le(D()),t,n);me(i,function(e){if(e===`option`)V(i,e),A(`;`);else throw F(e)},function(){Ce(i)}),e.add(i)}function B(e,t,n){if(!x.test(t=D()))throw F(t,`name`);var r=new s(ae(t));me(r,function(e){e===`option`?(V(r,e),A(`;`)):(O(e),z(r,`optional`,void 0,n))}),e.add(r)}function ve(e,t){if(!x.test(t=D()))throw F(t,`name`);var n=new c(t);me(n,function(e){switch(e){case`option`:V(n,e),A(`;`);break;case`reserved`:L(n.reserved||=[],!0),n.reserved===void 0&&(n.reserved=[]);break;default:ye(n,e)}}),e.add(n),e===P&&re.push(n)}function ye(e,t){if(!x.test(t))throw F(t,`name`);A(`=`);var n=le(D(),!0),r={options:void 0};r.getOption=function(e){return this.options[e]},r.setOption=function(e,t){d.prototype.setOption.call(r,e,t)},r.setParsedOption=function(){},me(r,function(e){if(e===`option`)V(r,e),A(`;`);else throw F(e)},function(){Ce(r)}),e.add(t,n,r.comment,r.parsedOptions||r.options)}function V(e,t){var n,r,i=!0;for(t===`option`&&(t=D());t!==`=`;){if(t===`(`){var a=D();A(`)`),t=`(`+a+`)`}if(i){if(i=!1,t.includes(`.`)&&!t.includes(`(`)){var o=t.split(`.`);n=o[0]+`.`,t=o[1];continue}n=t}else r=r?r+=t:t;t=D()}var s=be(e,r?n.concat(r):n);r=r&&r[0]===`.`?r.slice(1):r,n=n&&n[n.length-1]===`.`?n.slice(0,-1):n,Se(e,n,s,r)}function be(e,t,n){if(n===void 0&&(n=0),n>p.recursionLimit)throw Error(`max depth exceeded`);if(A(`{`,!0)){for(var r={};!A(`}`,!0);){if(!x.test(H=D()))throw F(H,`name`);if(H===null)throw F(H,`end of input`);var i,a=H;if(A(`:`,!0),k()===`{`)i=be(e,t+`.`+H,n+1);else if(k()===`[`){i=[];var o;if(A(`[`,!0)){do o=se(!0),i.push(o);while(A(`,`,!0));A(`]`),o!==void 0&&xe(e,t+`.`+H,o)}}else i=se(!0),xe(e,t+`.`+H,i);var s=r[a];s&&(i=[].concat(s,i)),a!==`__proto__`&&(r[a]=i),A(`,`,!0),A(`;`,!0)}return r}var c=se(!0);return xe(e,t,c),c}function xe(e,t,n){if(P===e&&/^features\./.test(t)){ie[t]=n;return}e.setOption&&e.setOption(t,n)}function Se(e,t,n,r){e.setParsedOption&&e.setParsedOption(t,n,r)}function Ce(e){if(A(`[`,!0)){do V(e,`option`);while(A(`,`,!0));A(`]`)}return e}function we(e,t,n){if(n===void 0&&(n=0),n>p.recursionLimit)throw Error(`max depth exceeded`);if(!x.test(t=D()))throw F(t,`service name`);var r=new l(t);me(r,function(e){if(!pe(r,e,n))if(e===`rpc`)Te(r,e);else throw F(e)}),e.add(r),e===P&&re.push(r)}function Te(e,t){var n=j(),r=t;if(!x.test(t=D()))throw F(t,`name`);var i=t,a,o,s,c;if(A(`(`),A(`stream`,!0)&&(o=!0),!S.test(t=D())||(a=t,A(`)`),A(`returns`),A(`(`),A(`stream`,!0)&&(c=!0),!S.test(t=D())))throw F(t);s=t,A(`)`);var l=new u(i,r,a,s,o,c);l.comment=n,me(l,function(e){if(e===`option`)V(l,e),A(`;`);else throw F(e)}),e.add(l)}function Ee(e,t,n){if(!S.test(t=D()))throw F(t,`reference`);var r=t;me(null,function(t){switch(t){case`required`:case`repeated`:z(e,t,r,n+1);break;case`optional`:N===`proto3`?z(e,`proto3_optional`,r,n+1):z(e,`optional`,r,n+1);break;default:if(N===`proto2`||!S.test(t))throw F(t);O(t),z(e,`optional`,r,n+1);break}})}for(var H;(H=D())!==null;)switch(H){case`package`:if(!ee)throw F(H);R();break;case`import`:if(!ee)throw F(H);ue();break;case`syntax`:if(!ee)throw F(H);de();break;case`edition`:if(!ee)throw F(H);fe();break;case`option`:V(P,H),A(`;`,!0);break;default:if(pe(P,H,0)){ee=!1;continue}throw F(H)}return oe(),C.filename=null,{package:M,imports:te,weakImports:ne,root:t}}})),nA=t(((e,t)=>{t.exports=r;var n=/\/|\./;function r(e,t){n.test(e)||(e=`google/protobuf/`+e+`.proto`,t={nested:{google:{nested:{protobuf:{nested:t}}}}}),r[e]=t}r(`any`,{Any:{fields:{type_url:{type:`string`,id:1},value:{type:`bytes`,id:2}}}});var i;r(`duration`,{Duration:i={fields:{seconds:{type:`int64`,id:1},nanos:{type:`int32`,id:2}}}}),r(`timestamp`,{Timestamp:i}),r(`empty`,{Empty:{fields:{}}}),r(`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}}}}),r(`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}}}}),r(`field_mask`,{FieldMask:{fields:{paths:{rule:`repeated`,type:`string`,id:1}}}}),r.get=function(e){return r[e]||null}})),rA=t(((e,t)=>{var n=t.exports=$k();n.build=`full`,n.tokenize=eA(),n.parse=tA(),n.common=nA(),n.Root._configure(n.Type,n.parse,n.common)})),iA=t(((e,t)=>{t.exports=rA()})),aA=t(((e,t)=>{t.exports={nested:{google:{nested:{protobuf:{options:{go_package:`google.golang.org/protobuf/types/descriptorpb`,java_package:`com.google.protobuf`,java_outer_classname:`DescriptorProtos`,csharp_namespace:`Google.Protobuf.Reflection`,objc_class_prefix:`GPB`,cc_enable_arenas:!0,optimize_for:`SPEED`},nested:{FileDescriptorSet:{edition:`proto2`,fields:{file:{rule:`repeated`,type:`FileDescriptorProto`,id:1}},extensions:[[536e6,536e6]]},Edition:{edition:`proto2`,values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},package:{type:`string`,id:2},dependency:{rule:`repeated`,type:`string`,id:3},publicDependency:{rule:`repeated`,type:`int32`,id:10},weakDependency:{rule:`repeated`,type:`int32`,id:11},optionDependency:{rule:`repeated`,type:`string`,id:15},messageType:{rule:`repeated`,type:`DescriptorProto`,id:4},enumType:{rule:`repeated`,type:`EnumDescriptorProto`,id:5},service:{rule:`repeated`,type:`ServiceDescriptorProto`,id:6},extension:{rule:`repeated`,type:`FieldDescriptorProto`,id:7},options:{type:`FileOptions`,id:8},sourceCodeInfo:{type:`SourceCodeInfo`,id:9},syntax:{type:`string`,id:12},edition:{type:`Edition`,id:14}}},DescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},field:{rule:`repeated`,type:`FieldDescriptorProto`,id:2},extension:{rule:`repeated`,type:`FieldDescriptorProto`,id:6},nestedType:{rule:`repeated`,type:`DescriptorProto`,id:3},enumType:{rule:`repeated`,type:`EnumDescriptorProto`,id:4},extensionRange:{rule:`repeated`,type:`ExtensionRange`,id:5},oneofDecl:{rule:`repeated`,type:`OneofDescriptorProto`,id:8},options:{type:`MessageOptions`,id:7},reservedRange:{rule:`repeated`,type:`ReservedRange`,id:9},reservedName:{rule:`repeated`,type:`string`,id:10},visibility:{type:`SymbolVisibility`,id:11}},nested:{ExtensionRange:{fields:{start:{type:`int32`,id:1},end:{type:`int32`,id:2},options:{type:`ExtensionRangeOptions`,id:3}}},ReservedRange:{fields:{start:{type:`int32`,id:1},end:{type:`int32`,id:2}}}}},ExtensionRangeOptions:{edition:`proto2`,fields:{uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999},declaration:{rule:`repeated`,type:`Declaration`,id:2,options:{retention:`RETENTION_SOURCE`}},features:{type:`FeatureSet`,id:50},verification:{type:`VerificationState`,id:3,options:{default:`UNVERIFIED`,retention:`RETENTION_SOURCE`}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:`int32`,id:1},fullName:{type:`string`,id:2},type:{type:`string`,id:3},reserved:{type:`bool`,id:5},repeated:{type:`bool`,id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},number:{type:`int32`,id:3},label:{type:`Label`,id:4},type:{type:`Type`,id:5},typeName:{type:`string`,id:6},extendee:{type:`string`,id:2},defaultValue:{type:`string`,id:7},oneofIndex:{type:`int32`,id:9},jsonName:{type:`string`,id:10},options:{type:`FieldOptions`,id:8},proto3Optional:{type:`bool`,id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},options:{type:`OneofOptions`,id:2}}},EnumDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},value:{rule:`repeated`,type:`EnumValueDescriptorProto`,id:2},options:{type:`EnumOptions`,id:3},reservedRange:{rule:`repeated`,type:`EnumReservedRange`,id:4},reservedName:{rule:`repeated`,type:`string`,id:5},visibility:{type:`SymbolVisibility`,id:6}},nested:{EnumReservedRange:{fields:{start:{type:`int32`,id:1},end:{type:`int32`,id:2}}}}},EnumValueDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},number:{type:`int32`,id:2},options:{type:`EnumValueOptions`,id:3}}},ServiceDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},method:{rule:`repeated`,type:`MethodDescriptorProto`,id:2},options:{type:`ServiceOptions`,id:3}}},MethodDescriptorProto:{edition:`proto2`,fields:{name:{type:`string`,id:1},inputType:{type:`string`,id:2},outputType:{type:`string`,id:3},options:{type:`MethodOptions`,id:4},clientStreaming:{type:`bool`,id:5},serverStreaming:{type:`bool`,id:6}}},FileOptions:{edition:`proto2`,fields:{javaPackage:{type:`string`,id:1},javaOuterClassname:{type:`string`,id:8},javaMultipleFiles:{type:`bool`,id:10},javaGenerateEqualsAndHash:{type:`bool`,id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:`bool`,id:27},optimizeFor:{type:`OptimizeMode`,id:9,options:{default:`SPEED`}},goPackage:{type:`string`,id:11},ccGenericServices:{type:`bool`,id:16},javaGenericServices:{type:`bool`,id:17},pyGenericServices:{type:`bool`,id:18},deprecated:{type:`bool`,id:23},ccEnableArenas:{type:`bool`,id:31,options:{default:!0}},objcClassPrefix:{type:`string`,id:36},csharpNamespace:{type:`string`,id:37},swiftPrefix:{type:`string`,id:39},phpClassPrefix:{type:`string`,id:40},phpNamespace:{type:`string`,id:41},phpMetadataNamespace:{type:`string`,id:44},rubyPackage:{type:`string`,id:45},features:{type:`FeatureSet`,id:50},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],`php_generic_services`],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:`proto2`,fields:{messageSetWireFormat:{type:`bool`,id:1},noStandardDescriptorAccessor:{type:`bool`,id:2},deprecated:{type:`bool`,id:3},mapEntry:{type:`bool`,id:7},deprecatedLegacyJsonFieldConflicts:{type:`bool`,id:11,options:{deprecated:!0}},features:{type:`FeatureSet`,id:12},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:`proto2`,fields:{ctype:{type:`CType`,id:1,options:{default:`STRING`}},packed:{type:`bool`,id:2},jstype:{type:`JSType`,id:6,options:{default:`JS_NORMAL`}},lazy:{type:`bool`,id:5},unverifiedLazy:{type:`bool`,id:15},deprecated:{type:`bool`,id:3},weak:{type:`bool`,id:10,options:{deprecated:!0}},debugRedact:{type:`bool`,id:16},retention:{type:`OptionRetention`,id:17},targets:{rule:`repeated`,type:`OptionTargetType`,id:19},editionDefaults:{rule:`repeated`,type:`EditionDefault`,id:20},features:{type:`FeatureSet`,id:21},featureSupport:{type:`FeatureSupport`,id:22},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:`Edition`,id:3},value:{type:`string`,id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:`Edition`,id:1},editionDeprecated:{type:`Edition`,id:2},deprecationWarning:{type:`string`,id:3},editionRemoved:{type:`Edition`,id:4}}}}},OneofOptions:{edition:`proto2`,fields:{features:{type:`FeatureSet`,id:1},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:`proto2`,fields:{allowAlias:{type:`bool`,id:2},deprecated:{type:`bool`,id:3},deprecatedLegacyJsonFieldConflicts:{type:`bool`,id:6,options:{deprecated:!0}},features:{type:`FeatureSet`,id:7},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:`proto2`,fields:{deprecated:{type:`bool`,id:1},features:{type:`FeatureSet`,id:2},debugRedact:{type:`bool`,id:3},featureSupport:{type:`FieldOptions.FeatureSupport`,id:4},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:`proto2`,fields:{features:{type:`FeatureSet`,id:34},deprecated:{type:`bool`,id:33},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:`proto2`,fields:{deprecated:{type:`bool`,id:33},idempotencyLevel:{type:`IdempotencyLevel`,id:34,options:{default:`IDEMPOTENCY_UNKNOWN`}},features:{type:`FeatureSet`,id:35},uninterpretedOption:{rule:`repeated`,type:`UninterpretedOption`,id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:`proto2`,fields:{name:{rule:`repeated`,type:`NamePart`,id:2},identifierValue:{type:`string`,id:3},positiveIntValue:{type:`uint64`,id:4},negativeIntValue:{type:`int64`,id:5},doubleValue:{type:`double`,id:6},stringValue:{type:`bytes`,id:7},aggregateValue:{type:`string`,id:8}},nested:{NamePart:{fields:{namePart:{rule:`required`,type:`string`,id:1},isExtension:{rule:`required`,type:`bool`,id:2}}}}},FeatureSet:{edition:`proto2`,fields:{fieldPresence:{type:`FieldPresence`,id:1,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_2023`,"edition_defaults.value":`EXPLICIT`}},enumType:{type:`EnumType`,id:2,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`OPEN`}},repeatedFieldEncoding:{type:`RepeatedFieldEncoding`,id:3,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`PACKED`}},utf8Validation:{type:`Utf8Validation`,id:4,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`VERIFY`}},messageEncoding:{type:`MessageEncoding`,id:5,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_LEGACY`,"edition_defaults.value":`LENGTH_PREFIXED`}},jsonFormat:{type:`JsonFormat`,id:6,options:{retention:`RETENTION_RUNTIME`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2023`,"edition_defaults.edition":`EDITION_PROTO3`,"edition_defaults.value":`ALLOW`}},enforceNamingStyle:{type:`EnforceNamingStyle`,id:7,options:{retention:`RETENTION_SOURCE`,targets:`TARGET_TYPE_METHOD`,"feature_support.edition_introduced":`EDITION_2024`,"edition_defaults.edition":`EDITION_2024`,"edition_defaults.value":`STYLE2024`}},defaultSymbolVisibility:{type:`VisibilityFeature.DefaultSymbolVisibility`,id:8,options:{retention:`RETENTION_SOURCE`,targets:`TARGET_TYPE_FILE`,"feature_support.edition_introduced":`EDITION_2024`,"edition_defaults.edition":`EDITION_2024`,"edition_defaults.value":`EXPORT_TOP_LEVEL`}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:`proto2`,fields:{defaults:{rule:`repeated`,type:`FeatureSetEditionDefault`,id:1},minimumEdition:{type:`Edition`,id:4},maximumEdition:{type:`Edition`,id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:`Edition`,id:3},overridableFeatures:{type:`FeatureSet`,id:4},fixedFeatures:{type:`FeatureSet`,id:5}},reserved:[[1,1],[2,2],`features`]}}},SourceCodeInfo:{edition:`proto2`,fields:{location:{rule:`repeated`,type:`Location`,id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:`repeated`,type:`int32`,id:1,options:{packed:!0}},span:{rule:`repeated`,type:`int32`,id:2,options:{packed:!0}},leadingComments:{type:`string`,id:3},trailingComments:{type:`string`,id:4},leadingDetachedComments:{rule:`repeated`,type:`string`,id:6}}}}},GeneratedCodeInfo:{edition:`proto2`,fields:{annotation:{rule:`repeated`,type:`Annotation`,id:1}},nested:{Annotation:{fields:{path:{rule:`repeated`,type:`int32`,id:1,options:{packed:!0}},sourceFile:{type:`string`,id:2},begin:{type:`int32`,id:3},end:{type:`int32`,id:4},semantic:{type:`Semantic`,id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:`proto2`,values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}})),oA=t(((e,t)=>{var n=iA();t.exports=e=n.descriptor=n.Root.fromJSON(aA()).lookup(`.google.protobuf`);var r=n.Namespace,i=n.Root,a=n.Enum,o=n.Type,s=n.Field,c=n.MapField,l=n.OneOf,u=n.Service,d=n.Method,f=n.util.patterns,p=f.numberRe,m=f.typeRefRe;i.fromDescriptor=function(t){typeof t.length==`number`&&(t=e.FileDescriptorSet.decode(t));var n=new i;if(t.file)for(var r,c,l=0,d;l<t.file.length;++l){c=n,(r=t.file[l]).package&&r.package.length&&(c=n.define(r.package));var f=A(r);if(r.name&&r.name.length&&n.files.push(c.filename=r.name),r.messageType)for(d=0;d<r.messageType.length;++d)c.add(o.fromDescriptor(r.messageType[d],f));if(r.enumType)for(d=0;d<r.enumType.length;++d)c.add(a.fromDescriptor(r.enumType[d],f));if(r.extension)for(d=0;d<r.extension.length;++d)c.add(s.fromDescriptor(r.extension[d],f));if(r.service)for(d=0;d<r.service.length;++d)c.add(u.fromDescriptor(r.service[d],f));var p=T(r.options,e.FileOptions);if(p){var m=Object.keys(p);for(d=0;d<m.length;++d)c.setOption(m[d],p[m[d]])}}return n.resolveAll()},i.prototype.toDescriptor=function(t){var n=e.FileDescriptorSet.create();return h(this,n.file,t),n};function h(t,n,c){var l=e.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,`_`)||`root`)+`.proto`});j(c,l),t instanceof i||(l.package=t.fullName.substring(1));for(var d=0,f;d<t.nestedArray.length;++d)(f=t._nestedArray[d])instanceof o?l.messageType.push(f.toDescriptor(c)):f instanceof a?l.enumType.push(f.toDescriptor()):f instanceof s?l.extension.push(f.toDescriptor(c)):f instanceof u?l.service.push(f.toDescriptor()):f instanceof r&&h(f,n,c);l.options=D(t.options,e.FileOptions),l.messageType.length+l.enumType.length+l.extension.length+l.service.length&&n.push(l)}var g=0;o.fromDescriptor=function(t,r,i,c){if(c===void 0&&(c=0),c>n.util.nestingLimit)throw Error(`max depth exceeded`);typeof t.length==`number`&&(t=e.DescriptorProto.decode(t));var u=new o(t.name.length?t.name:`Type`+g++,T(t.options,e.MessageOptions)),d;if(i||(u._edition=r),t.oneofDecl)for(d=0;d<t.oneofDecl.length;++d)u.add(l.fromDescriptor(t.oneofDecl[d]));if(t.field)for(d=0;d<t.field.length;++d){var f=s.fromDescriptor(t.field[d],r,!0);u.add(f),t.field[d].hasOwnProperty(`oneofIndex`)&&u.oneofsArray[t.field[d].oneofIndex].add(f)}if(t.extension)for(d=0;d<t.extension.length;++d)u.add(s.fromDescriptor(t.extension[d],r,!0));if(t.nestedType)for(d=0;d<t.nestedType.length;++d)u.add(o.fromDescriptor(t.nestedType[d],r,!0,c+1)),t.nestedType[d].options&&t.nestedType[d].options.mapEntry&&u.setOption(`map_entry`,!0);if(t.enumType)for(d=0;d<t.enumType.length;++d)u.add(a.fromDescriptor(t.enumType[d],r,!0));if(t.extensionRange&&t.extensionRange.length)for(u.extensions=[],d=0;d<t.extensionRange.length;++d)u.extensions.push([t.extensionRange[d].start,t.extensionRange[d].end]);if(t.reservedRange&&t.reservedRange.length||t.reservedName&&t.reservedName.length){if(u.reserved=[],t.reservedRange)for(d=0;d<t.reservedRange.length;++d)u.reserved.push([t.reservedRange[d].start,t.reservedRange[d].end]);if(t.reservedName)for(d=0;d<t.reservedName.length;++d)u.reserved.push(t.reservedName[d])}return u},o.prototype.toDescriptor=function(t){var n=e.DescriptorProto.create({name:this.name}),r;for(r=0;r<this.fieldsArray.length;++r){var i;if(n.field.push(i=this._fieldsArray[r].toDescriptor(t)),this._fieldsArray[r]instanceof c){var l=C(this._fieldsArray[r].keyType,this._fieldsArray[r].resolvedKeyType,!1),u=C(this._fieldsArray[r].type,this._fieldsArray[r].resolvedType,!1),d=u===11||u===14?this._fieldsArray[r].resolvedType&&O(this.parent,this._fieldsArray[r].resolvedType)||this._fieldsArray[r].type:void 0;n.nestedType.push(e.DescriptorProto.create({name:i.typeName,field:[e.FieldDescriptorProto.create({name:`key`,number:1,label:1,type:l}),e.FieldDescriptorProto.create({name:`value`,number:2,label:1,type:u,typeName:d})],options:e.MessageOptions.create({mapEntry:!0})}))}}for(r=0;r<this.oneofsArray.length;++r)n.oneofDecl.push(this._oneofsArray[r].toDescriptor());for(r=0;r<this.nestedArray.length;++r)this._nestedArray[r]instanceof s?n.field.push(this._nestedArray[r].toDescriptor(t)):this._nestedArray[r]instanceof o?n.nestedType.push(this._nestedArray[r].toDescriptor(t)):this._nestedArray[r]instanceof a&&n.enumType.push(this._nestedArray[r].toDescriptor());if(this.extensions)for(r=0;r<this.extensions.length;++r)n.extensionRange.push(e.DescriptorProto.ExtensionRange.create({start:this.extensions[r][0],end:this.extensions[r][1]}));if(this.reserved)for(r=0;r<this.reserved.length;++r)typeof this.reserved[r]==`string`?n.reservedName.push(this.reserved[r]):n.reservedRange.push(e.DescriptorProto.ReservedRange.create({start:this.reserved[r][0],end:this.reserved[r][1]}));return n.options=D(this.options,e.MessageOptions),n},s.fromDescriptor=function(t,n,r){if(typeof t.length==`number`&&(t=e.DescriptorProto.decode(t)),typeof t.number!=`number`)throw Error(`missing field id`);var i=t.typeName,a;if(i!=null&&i!==``){if(typeof i!=`string`||!m.test(i))throw Error(`illegal type name: `+i);a=i}else a=x(t.type);var o;switch(t.label){case 1:o=void 0;break;case 2:o=`required`;break;case 3:o=`repeated`;break;default:throw Error(`illegal label: `+t.label)}var c=t.extendee;if(c!=null&&c!==``){if(typeof c!=`string`||!m.test(c))throw Error(`illegal type name: `+c)}else c=void 0;var l=new s(t.name.length?t.name:`field`+t.number,t.number,a,o,c);if(r||(l._edition=n),l.options=T(t.options,e.FieldOptions),t.proto3_optional&&(l.options.proto3_optional=!0),t.defaultValue&&t.defaultValue.length){var u=t.defaultValue;switch(u){case`true`:case`TRUE`:u=!0;break;case`false`:case`FALSE`:u=!1;break;default:p.exec(u)&&(u=parseInt(u));break}l.setOption(`default`,u)}return S(t.type)&&(n===`proto3`?t.options&&!t.options.packed&&l.setOption(`packed`,!1):(!n||n===`proto2`)&&t.options&&t.options.packed&&l.setOption(`packed`,!0)),l},s.prototype.toDescriptor=function(t){var r=e.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=n.util.ucFirst(this.name),r.label=3;else{switch(r.type=C(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?O(this.parent,this.resolvedType):this.type;break}this.rule===`repeated`?r.label=3:this.required&&t===`proto2`?r.label=2:r.label=1}if(r.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&this.parent instanceof o&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error(`missing oneof`);return this.options&&(r.options=D(this.options,e.FieldOptions),this.options.default!=null&&(r.defaultValue=String(this.options.default)),this.options.proto3_optional&&(r.proto3_optional=!0)),t===`proto3`?this.packed||((r.options||=e.FieldOptions.create()).packed=!1):(!t||t===`proto2`)&&this.packed&&((r.options||=e.FieldOptions.create()).packed=!0),r};var _=0;a.fromDescriptor=function(t,n,r){typeof t.length==`number`&&(t=e.EnumDescriptorProto.decode(t));var i={};if(t.value)for(var o=0;o<t.value.length;++o){var s=t.value[o].name,c=t.value[o].number||0;i[s&&s.length?s:`NAME`+c]=c}var l=new a(t.name&&t.name.length?t.name:`Enum`+_++,i,T(t.options,e.EnumOptions));return r||(l._edition=n),l},a.prototype.toDescriptor=function(){for(var t=[],n=0,r=Object.keys(this.values);n<r.length;++n)t.push(e.EnumValueDescriptorProto.create({name:r[n],number:this.values[r[n]]}));return e.EnumDescriptorProto.create({name:this.name,value:t,options:D(this.options,e.EnumOptions)})};var v=0;l.fromDescriptor=function(t){return typeof t.length==`number`&&(t=e.OneofDescriptorProto.decode(t)),new l(t.name&&t.name.length?t.name:`oneof`+v++)},l.prototype.toDescriptor=function(){return e.OneofDescriptorProto.create({name:this.name})};var y=0;u.fromDescriptor=function(t,n,r){typeof t.length==`number`&&(t=e.ServiceDescriptorProto.decode(t));var i=new u(t.name&&t.name.length?t.name:`Service`+y++,T(t.options,e.ServiceOptions));if(r||(i._edition=n),t.method)for(var a=0;a<t.method.length;++a)i.add(d.fromDescriptor(t.method[a]));return i},u.prototype.toDescriptor=function(){for(var t=[],n=0;n<this.methodsArray.length;++n)t.push(this._methodsArray[n].toDescriptor());return e.ServiceDescriptorProto.create({name:this.name,method:t,options:D(this.options,e.ServiceOptions)})};var b=0;d.fromDescriptor=function(t){typeof t.length==`number`&&(t=e.MethodDescriptorProto.decode(t));var n=t.inputType,r=t.outputType;if(n!=null&&n!==``&&(typeof n!=`string`||!m.test(n)))throw Error(`illegal type name: `+n);if(r!=null&&r!==``&&(typeof r!=`string`||!m.test(r)))throw Error(`illegal type name: `+r);return new d(t.name&&t.name.length?t.name:`Method`+b++,`rpc`,n,r,!!t.clientStreaming,!!t.serverStreaming,T(t.options,e.MethodOptions))},d.prototype.toDescriptor=function(){return e.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:D(this.options,e.MethodOptions)})};function x(e){switch(e){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: `+e)}function S(e){switch(e){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 C(e,t,n){switch(e){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(t instanceof a)return 14;if(t instanceof o)return n?10:11;throw Error(`illegal type: `+e)}function w(e,t){for(var n={},r=0,i,s;r<t.fieldsArray.length;++r)if((s=(i=t._fieldsArray[r]).name)!==`uninterpretedOption`&&Object.prototype.hasOwnProperty.call(e,s)){var c=k(s);i.resolvedType instanceof o?n[c]=w(e[s],i.resolvedType):i.resolvedType instanceof a?n[c]=i.resolvedType.valuesById[e[s]]:n[c]=e[s]}return n}function T(e,t){if(e)return w(t.toObject(e),t)}function E(e,t){for(var r={},i=Object.keys(e),a=0;a<i.length;++a){var s=i[a],c=n.util.camelCase(s);if(Object.prototype.hasOwnProperty.call(t.fields,c)){var l=t.fields[c];l.resolvedType instanceof o?r[c]=E(e[s],l.resolvedType):r[c]=e[s],l.repeated&&!Array.isArray(r[c])&&(r[c]=[r[c]])}}return r}function D(e,t){if(e)return t.fromObject(E(e,t))}function O(e,t){var n=e.fullName.split(`.`),a=t.fullName.split(`.`),o=0,s=0,c=a.length-1;if(!(e instanceof i)&&t instanceof r)for(;o<n.length&&s<c&&n[o]===a[s];){var l=t.lookup(n[o++],!0);if(l!==null&&l!==t)break;++s}else for(;o<n.length&&s<c&&n[o]===a[s];++o,++s);return a.slice(s).join(`.`)}function k(e){return e.substring(0,1)+e.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,t){return`_`+t.toLowerCase()})}function A(t){if(t.syntax===`editions`)switch(t.edition){case e.Edition.EDITION_2023:return`2023`;default:throw Error(`Unsupported edition `+t.edition)}return t.syntax===`proto3`?`proto3`:`proto2`}function j(t,n){if(t)if(t===`proto2`||t===`proto3`)n.syntax=t;else switch(n.syntax=`editions`,t){case`2023`:n.edition=e.Edition.EDITION_2023;break;default:throw Error(`Unsupported edition `+t)}}})),sA=t(((e,t)=>{t.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}}}}}}}}})),cA=t(((e,t)=>{t.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:`string`,id:1}}}}}}}}}})),lA=t(((e,t)=>{t.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}}}}}}}}}})),uA=t((e=>{
58
58
  /**
59
59
  * @license
60
60
  * Copyright 2018 gRPC authors.
@@ -72,7 +72,7 @@ var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(
72
72
  * limitations under the License.
73
73
  *
74
74
  */
75
- Object.defineProperty(e,"__esModule",{value:!0}),e.addCommonProtos=e.loadProtosWithOptionsSync=e.loadProtosWithOptions=void 0;let t=s(`fs`),n=s(`path`),r=rA();function i(e,r){let i=e.resolvePath;e.resolvePath=(e,a)=>{if(n.isAbsolute(a))return a;for(let e of r){let r=n.join(e,a);try{return t.accessSync(r,t.constants.R_OK),r}catch{continue}}return process.emitWarning(`${a} not found in any of the include paths ${r}`),i(e,a)}}async function a(e,t){let n=new r.Root;if(t||={},t.includeDirs){if(!Array.isArray(t.includeDirs))return Promise.reject(Error(`The includeDirs option must be an array`));i(n,t.includeDirs)}let a=await n.load(e,t);return a.resolveAll(),a}e.loadProtosWithOptions=a;function o(e,t){let n=new r.Root;if(t||={},t.includeDirs){if(!Array.isArray(t.includeDirs))throw Error(`The includeDirs option must be an array`);i(n,t.includeDirs)}let a=n.loadSync(e,t);return a.resolveAll(),a}e.loadProtosWithOptionsSync=o;function c(){let e=oA(),t=iA(),n=sA(),i=cA();r.common(`api`,e.nested.google.nested.protobuf.nested),r.common(`descriptor`,t.nested.google.nested.protobuf.nested),r.common(`source_context`,n.nested.google.nested.protobuf.nested),r.common(`type`,i.nested.google.nested.protobuf.nested)}e.addCommonProtos=c})),uA=t(((e,t)=>{var n=(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;
75
+ Object.defineProperty(e,"__esModule",{value:!0}),e.addCommonProtos=e.loadProtosWithOptionsSync=e.loadProtosWithOptions=void 0;let t=s(`fs`),n=s(`path`),r=iA();function i(e,r){let i=e.resolvePath;e.resolvePath=(e,a)=>{if(n.isAbsolute(a))return a;for(let e of r){let r=n.join(e,a);try{return t.accessSync(r,t.constants.R_OK),r}catch{continue}}return process.emitWarning(`${a} not found in any of the include paths ${r}`),i(e,a)}}async function a(e,t){let n=new r.Root;if(t||={},t.includeDirs){if(!Array.isArray(t.includeDirs))return Promise.reject(Error(`The includeDirs option must be an array`));i(n,t.includeDirs)}let a=await n.load(e,t);return a.resolveAll(),a}e.loadProtosWithOptions=a;function o(e,t){let n=new r.Root;if(t||={},t.includeDirs){if(!Array.isArray(t.includeDirs))throw Error(`The includeDirs option must be an array`);i(n,t.includeDirs)}let a=n.loadSync(e,t);return a.resolveAll(),a}e.loadProtosWithOptionsSync=o;function c(){let e=sA(),t=aA(),n=cA(),i=lA();r.common(`api`,e.nested.google.nested.protobuf.nested),r.common(`descriptor`,t.nested.google.nested.protobuf.nested),r.common(`source_context`,n.nested.google.nested.protobuf.nested),r.common(`type`,i.nested.google.nested.protobuf.nested)}e.addCommonProtos=c})),dA=t(((e,t)=>{var n=(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;
76
76
  /**
77
77
  * @license
78
78
  * Copyright 2009 The Closure Library Authors
@@ -92,7 +92,7 @@ Object.defineProperty(e,"__esModule",{value:!0}),e.addCommonProtos=e.loadProtosW
92
92
  *
93
93
  * SPDX-License-Identifier: Apache-2.0
94
94
  */
95
- var t=null;try{t=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 n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var T=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var D=n.prototype;return D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},D.clz=D.countLeadingZeros,D.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},D.ctz=D.countTrailingZeros,D.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},D.rotl=D.rotateLeft,D.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},D.rotr=D.rotateRight,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},e.default=n,`default`in e?e.default:e})({});typeof define==`function`&&define.amd?define([],function(){return n}):typeof t==`object`&&typeof e==`object`&&(t.exports=n)})),dA=t((e=>{
95
+ var t=null;try{t=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 n(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0});function r(e){return(e&&e.__isLong__)===!0}function i(e){var t=Math.clz32(e&-e);return e?31-t:t}n.isLong=r;var a={},o={};function s(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=o[e],r)?r:(n=l(e,0,!0),i&&(o[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=a[e],r)?r:(n=l(e,e<0?-1:0,!1),i&&(a[e]=n),n))}n.fromInt=s;function c(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=g)return T}else{if(e<=-_)return E;if(e+1>=_)return w}return e<0?c(-e,t).neg():l(e%h|0,e/h|0,t)}n.fromNumber=c;function l(e,t,r){return new n(e,t,r)}n.fromBits=l;var u=Math.pow;function d(e,t,n){if(e.length===0)throw Error(`empty string`);if(typeof t==`number`?(n=t,t=!1):t=!!t,e===`NaN`||e===`Infinity`||e===`+Infinity`||e===`-Infinity`)return t?b:y;if(n||=10,n<2||36<n)throw RangeError(`radix`);var r;if((r=e.indexOf(`-`))>0)throw Error(`interior hyphen`);if(r===0)return d(e.substring(1),t,n).neg();for(var i=c(u(n,8)),a=y,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),n);if(s<8){var f=c(u(n,s));a=a.mul(f).add(c(l))}else a=a.mul(i),a=a.add(c(l))}return a.unsigned=t,a}n.fromString=d;function f(e,t){return typeof e==`number`?c(e,t):typeof e==`string`?d(e,t):l(e.low,e.high,typeof t==`boolean`?t:e.unsigned)}n.fromValue=f;var p=65536,m=1<<24,h=p*p,g=h*h,_=g/2,v=s(m),y=s(0);n.ZERO=y;var b=s(0,!0);n.UZERO=b;var x=s(1);n.ONE=x;var S=s(1,!0);n.UONE=S;var C=s(-1);n.NEG_ONE=C;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var T=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=T;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var D=n.prototype;return D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},D.toString=function(e){if(e||=10,e<2||36<e)throw RangeError(`radix`);if(this.isZero())return`0`;if(this.isNegative())if(this.eq(E)){var t=c(e),n=this.div(t),r=n.mul(t).sub(this);return n.toString(e)+r.toInt().toString(e)}else return`-`+this.neg().toString(e);for(var i=c(u(e,6),this.unsigned),a=this,o=``;;){var s=a.div(i),l=(a.sub(s.mul(i)).toInt()>>>0).toString(e);if(a=s,a.isZero())return l+o;for(;l.length<6;)l=`0`+l;o=``+l+o}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=this.high==0?this.low:this.high,t=31;t>0&&!(e&1<<t);t--);return this.high==0?t+1:t+33},D.isZero=function(){return this.high===0&&this.low===0},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&this.high<0},D.isPositive=function(){return this.unsigned||this.high>=0},D.isOdd=function(){return(this.low&1)==1},D.isEven=function(){return(this.low&1)==0},D.equals=function(e){return r(e)||(e=f(e)),this.unsigned!==e.unsigned&&this.high>>>31==1&&e.high>>>31==1?!1:this.high===e.high&&this.low===e.low},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return this.comp(e)<0},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return this.comp(e)<=0},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return this.comp(e)>0},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return this.comp(e)>=0},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(r(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(x)},D.neg=D.negate,D.add=function(e){r(e)||(e=f(e));var t=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=e.high>>>16,s=e.high&65535,c=e.low>>>16,u=e.low&65535,d=0,p=0,m=0,h=0;return h+=a+u,m+=h>>>16,h&=65535,m+=i+c,p+=m>>>16,m&=65535,p+=n+s,d+=p>>>16,p&=65535,d+=t+o,d&=65535,l(m<<16|h,d<<16|p,this.unsigned)},D.subtract=function(e){return r(e)||(e=f(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return this;if(r(e)||(e=f(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?b:y;if(this.eq(E))return e.isOdd()?E:y;if(e.eq(E))return this.isOdd()?E:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(v)&&e.lt(v))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=e.high>>>16,u=e.high&65535,d=e.low>>>16,p=e.low&65535,m=0,h=0,g=0,_=0;return _+=o*p,g+=_>>>16,_&=65535,g+=a*p,h+=g>>>16,g&=65535,g+=o*d,h+=g>>>16,g&=65535,h+=i*p,m+=h>>>16,h&=65535,h+=a*d,m+=h>>>16,h&=65535,h+=o*u,m+=h>>>16,h&=65535,m+=n*p+i*d+a*u+o*s,m&=65535,l(g<<16|_,m<<16|h,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(r(e)||(e=f(e)),e.isZero())throw Error(`division by zero`);if(t)return!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1?this:l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(this.isZero())return this.unsigned?b:y;var n,i,a;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return S;a=b}else{if(this.eq(E))return e.eq(x)||e.eq(C)?E:e.eq(E)?x:(n=this.shr(1).div(e).shl(1),n.eq(y)?e.isNegative()?x:C:(i=this.sub(e.mul(n)),a=n.add(i.div(e)),a));if(e.eq(E))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:u(2,o-48),d=c(n),p=d.mul(e);p.isNegative()||p.gt(i);)n-=s,d=c(n,this.unsigned),p=d.mul(e);d.isZero()&&(d=x),a=a.add(d),i=i.sub(p)}return a},D.div=D.divide,D.modulo=function(e){return r(e)||(e=f(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return l(~this.low,~this.high,this.unsigned)},D.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},D.clz=D.countLeadingZeros,D.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},D.ctz=D.countTrailingZeros,D.and=function(e){return r(e)||(e=f(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return r(e)||(e=f(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return r(e)||(e=f(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){return r(e)&&(e=e.toInt()),(e&=63)==0?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(e===32?this.high:this.high>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.rotateLeft=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(e-=32,t=32-e,l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},D.rotl=D.rotateLeft,D.rotateRight=function(e){var t;return r(e)&&(e=e.toInt()),(e&=63)==0?this:e===32?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(e-=32,t=32-e,l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},D.rotr=D.rotateRight,D.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},e.default=n,`default`in e?e.default:e})({});typeof define==`function`&&define.amd?define([],function(){return n}):typeof t==`object`&&typeof e==`object`&&(t.exports=n)})),fA=t((e=>{
96
96
  /**
97
97
  * @license
98
98
  * Copyright 2018 gRPC authors.
@@ -110,30 +110,30 @@ var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(
110
110
  * limitations under the License.
111
111
  *
112
112
  */
113
- Object.defineProperty(e,"__esModule",{value:!0}),e.loadFileDescriptorSetFromObject=e.loadFileDescriptorSetFromBuffer=e.fromJSON=e.loadSync=e.load=e.IdempotencyLevel=e.isAnyExtension=e.Long=void 0;let t=uk(),n=rA(),r=aA(),i=lA();e.Long=uA();function a(e){return`@type`in e&&typeof e[`@type`]==`string`}e.isAnyExtension=a;var o;(function(e){e.IDEMPOTENCY_UNKNOWN=`IDEMPOTENCY_UNKNOWN`,e.NO_SIDE_EFFECTS=`NO_SIDE_EFFECTS`,e.IDEMPOTENT=`IDEMPOTENT`})(o=e.IdempotencyLevel||={});let s={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function c(e,t){return e===``?t:e+`.`+t}function l(e){return e instanceof n.Service||e instanceof n.Type||e instanceof n.Enum}function u(e){return e instanceof n.Namespace||e instanceof n.Root}function d(e,t){let n=c(t,e.name);return l(e)?[[n,e]]:u(e)&&e.nested!==void 0?Object.keys(e.nested).map(t=>d(e.nested[t],n)).reduce((e,t)=>e.concat(t),[]):[]}function f(e,t){return function(n){return e.toObject(e.decode(n),t)}}function p(e){return function(t){if(Array.isArray(t))throw Error(`Failed to serialize message: expected object with ${e.name} structure, got array instead`);let n=e.fromObject(t);return e.encode(n).finish()}}function m(e){return(e||[]).reduce((e,t)=>{for(let[n,r]of Object.entries(t))switch(n){case`uninterpreted_option`:e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[n]=r}return e},{deprecated:!1,idempotency_level:o.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function h(e,n,r,i){let a=e.resolvedRequestType,o=e.resolvedResponseType;return{path:`/`+n+`/`+e.name,requestStream:!!e.requestStream,responseStream:!!e.responseStream,requestSerialize:p(a),requestDeserialize:f(a,r),responseSerialize:p(o),responseDeserialize:f(o,r),originalName:t(e.name),requestType:_(a,r,i),responseType:_(o,r,i),options:m(e.parsedOptions)}}function g(e,t,n,r){let i={};for(let a of e.methodsArray)i[a.name]=h(a,t,n,r);return i}function _(e,t,n){let r=e.toDescriptor(`proto3`);return{format:`Protocol Buffer 3 DescriptorProto`,type:r.$type.toObject(r,s),fileDescriptorProtos:n,serialize:p(e),deserialize:f(e,t)}}function v(e,t){let n=e.toDescriptor(`proto3`);return{format:`Protocol Buffer 3 EnumDescriptorProto`,type:n.$type.toObject(n,s),fileDescriptorProtos:t}}function y(e,t,r,i){if(e instanceof n.Service)return g(e,t,r,i);if(e instanceof n.Type)return _(e,r,i);if(e instanceof n.Enum)return v(e,i);throw Error(`Type mismatch in reflection object handling`)}function b(e,t){let n={};e.resolveAll();let i=e.toDescriptor(`proto3`).file.map(e=>Buffer.from(r.FileDescriptorProto.encode(e).finish()));for(let[r,a]of d(e,``))n[r]=y(a,r,t,i);return n}function x(e,t){t||={};let r=n.Root.fromDescriptor(e);return r.resolveAll(),b(r,t)}function S(e,t){return(0,i.loadProtosWithOptions)(e,t).then(e=>b(e,t))}e.load=S;function C(e,t){return b((0,i.loadProtosWithOptionsSync)(e,t),t)}e.loadSync=C;function w(e,t){t||={};let r=n.Root.fromJSON(e);return r.resolveAll(),b(r,t)}e.fromJSON=w;function T(e,t){return x(r.FileDescriptorSet.decode(e),t)}e.loadFileDescriptorSetFromBuffer=T;function E(e,t){return x(r.FileDescriptorSet.fromObject(e),t)}e.loadFileDescriptorSetFromObject=E,(0,i.addCommonProtos)()})),fA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.registerChannelzSocket=e.registerChannelzServer=e.registerChannelzSubchannel=e.registerChannelzChannel=e.ChannelzCallTrackerStub=e.ChannelzCallTracker=e.ChannelzChildrenTrackerStub=e.ChannelzChildrenTracker=e.ChannelzTrace=e.ChannelzTraceStub=void 0,e.unregisterChannelzRef=_,e.getChannelzHandlers=te,e.getChannelzServiceDefinition=F,e.setup=ne;let t=s(`net`),n=rk(),r=XO(),i=J(),a=nk(),o=ik(),c=lk();function l(e){return{channel_id:e.id,name:e.name}}function u(e){return{subchannel_id:e.id,name:e.name}}function d(e){return{server_id:e.id}}function f(e){return{socket_id:e.id,name:e.name}}e.ChannelzTraceStub=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:w(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}},e.ChannelzTrace=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,n){let r=new Date;this.events.push({description:t,severity:e,timestamp:r,childChannel:n?.kind===`channel`?n:void 0,childSubchannel:n?.kind===`subchannel`?n:void 0}),this.events.length>=64&&(this.events=this.events.slice(32)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:w(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:w(e.timestamp),channel_ref:e.childChannel?l(e.childChannel):null,subchannel_ref:e.childSubchannel?u(e.childSubchannel):null}))}}};var p=class{constructor(){this.channelChildren=new n.OrderedMap,this.subchannelChildren=new n.OrderedMap,this.socketChildren=new n.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],n=t.find(e.id);n.equals(t.end())?t.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],n=t.getElementByKey(e.id);n!==void 0&&(--n.count,n.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};e.ChannelzChildrenTracker=p,e.ChannelzChildrenTrackerStub=class extends p{refChild(){}unrefChild(){}};var m=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};e.ChannelzCallTracker=m,e.ChannelzCallTrackerStub=class extends m{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};let h={channel:new n.OrderedMap,subchannel:new n.OrderedMap,server:new n.OrderedMap,socket:new n.OrderedMap},g=e=>{let t=1;function n(){return t++}let r=h[e];return(t,i,a)=>{let o=n(),s={id:o,name:t,kind:e};return a&&r.setElement(o,{ref:s,getInfo:i}),s}};e.registerChannelzChannel=g(`channel`),e.registerChannelzSubchannel=g(`subchannel`),e.registerChannelzServer=g(`server`),e.registerChannelzSocket=g(`socket`);function _(e){h[e.kind].eraseElementByKey(e.id)}function v(e){let t=Number.parseInt(e,16);return[t/256|0,t%256]}function y(e){if(e===``)return[];let t=e.split(`:`).map(e=>v(e));return[].concat(...t)}function b(e){return(0,t.isIPv6)(e)&&e.toLowerCase().startsWith(`::ffff:`)&&(0,t.isIPv4)(e.substring(7))}function x(e){return Buffer.from(Uint8Array.from(e.split(`.`).map(e=>Number.parseInt(e))))}function S(e){if((0,t.isIPv4)(e))return x(e);if(b(e))return x(e.substring(7));if((0,t.isIPv6)(e)){let t,n,r=e.indexOf(`::`);r===-1?(t=e,n=``):(t=e.substring(0,r),n=e.substring(r+2));let i=Buffer.from(y(t)),a=Buffer.from(y(n)),o=Buffer.alloc(16-i.length-a.length,0);return Buffer.concat([i,o,a])}else return null}function C(e){switch(e){case r.ConnectivityState.CONNECTING:return{state:`CONNECTING`};case r.ConnectivityState.IDLE:return{state:`IDLE`};case r.ConnectivityState.READY:return{state:`READY`};case r.ConnectivityState.SHUTDOWN:return{state:`SHUTDOWN`};case r.ConnectivityState.TRANSIENT_FAILURE:return{state:`TRANSIENT_FAILURE`};default:return{state:`UNKNOWN`}}}function w(e){if(!e)return null;let t=e.getTime();return{seconds:t/1e3|0,nanos:t%1e3*1e6}}function T(e){let t=e.getInfo(),n=[],r=[];return t.children.channels.forEach(e=>{n.push(l(e[1].ref))}),t.children.subchannels.forEach(e=>{r.push(u(e[1].ref))}),{ref:l(e.ref),data:{target:t.target,state:C(t.state),calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:w(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},channel_ref:n,subchannel_ref:r}}function E(e,t){let n=parseInt(e.request.channel_id,10),r=h.channel.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No channel data found for id `+n});return}t(null,{channel:T(r)})}function D(e,t){let n=parseInt(e.request.max_results,10)||100,r=[],i=parseInt(e.request.start_channel_id,10),a=h.channel,o;for(o=a.lowerBound(i);!o.equals(a.end())&&r.length<n;o=o.next())r.push(T(o.pointer[1]));t(null,{channel:r,end:o.equals(a.end())})}function O(e){let t=e.getInfo(),n=[];return t.listenerChildren.sockets.forEach(e=>{n.push(f(e[1].ref))}),{ref:d(e.ref),data:{calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:w(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},listen_socket:n}}function k(e,t){let n=parseInt(e.request.server_id,10),r=h.server.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No server data found for id `+n});return}t(null,{server:O(r)})}function A(e,t){let n=parseInt(e.request.max_results,10)||100,r=parseInt(e.request.start_server_id,10),i=h.server,a=[],o;for(o=i.lowerBound(r);!o.equals(i.end())&&a.length<n;o=o.next())a.push(O(o.pointer[1]));t(null,{server:a,end:o.equals(i.end())})}function j(e,t){let n=parseInt(e.request.subchannel_id,10),r=h.subchannel.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No subchannel data found for id `+n});return}let a=r.getInfo(),o=[];a.children.sockets.forEach(e=>{o.push(f(e[1].ref))}),t(null,{subchannel:{ref:u(r.ref),data:{target:a.target,state:C(a.state),calls_started:a.callTracker.callsStarted,calls_succeeded:a.callTracker.callsSucceeded,calls_failed:a.callTracker.callsFailed,last_call_started_timestamp:w(a.callTracker.lastCallStartedTimestamp),trace:a.trace.getTraceMessage()},socket_ref:o}})}function M(e){return(0,a.isTcpSubchannelAddress)(e)?{address:`tcpip_address`,tcpip_address:{ip_address:S(e.host)??void 0,port:e.port}}:{address:`uds_address`,uds_address:{filename:e.path}}}function N(e,t){let n=parseInt(e.request.socket_id,10),r=h.socket.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No socket data found for id `+n});return}let a=r.getInfo(),o=a.security?{model:`tls`,tls:{cipher_suite:a.security.cipherSuiteStandardName?`standard_name`:`other_name`,standard_name:a.security.cipherSuiteStandardName??void 0,other_name:a.security.cipherSuiteOtherName??void 0,local_certificate:a.security.localCertificate??void 0,remote_certificate:a.security.remoteCertificate??void 0}}:null;t(null,{socket:{ref:f(r.ref),local:a.localAddress?M(a.localAddress):null,remote:a.remoteAddress?M(a.remoteAddress):null,remote_name:a.remoteName??void 0,security:o,data:{keep_alives_sent:a.keepAlivesSent,streams_started:a.streamsStarted,streams_succeeded:a.streamsSucceeded,streams_failed:a.streamsFailed,last_local_stream_created_timestamp:w(a.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:w(a.lastRemoteStreamCreatedTimestamp),messages_received:a.messagesReceived,messages_sent:a.messagesSent,last_message_received_timestamp:w(a.lastMessageReceivedTimestamp),last_message_sent_timestamp:w(a.lastMessageSentTimestamp),local_flow_control_window:a.localFlowControlWindow?{value:a.localFlowControlWindow}:null,remote_flow_control_window:a.remoteFlowControlWindow?{value:a.remoteFlowControlWindow}:null}}})}function ee(e,t){let n=parseInt(e.request.server_id,10),r=h.server.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No server data found for id `+n});return}let a=parseInt(e.request.start_socket_id,10),o=parseInt(e.request.max_results,10)||100,s=r.getInfo().sessionChildren.sockets,c=[],l;for(l=s.lowerBound(a);!l.equals(s.end())&&c.length<o;l=l.next())c.push(f(l.pointer[1].ref));t(null,{socket_ref:c,end:l.equals(s.end())})}function te(){return{GetChannel:E,GetTopChannels:D,GetServer:k,GetServers:A,GetSubchannel:j,GetSocket:N,GetServerSockets:ee}}let P=null;function F(){if(P)return P;let e=dA().loadSync,t=e(`channelz.proto`,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return P=(0,c.loadPackageDefinition)(t).grpc.channelz.v1.Channelz.service,P}function ne(){(0,o.registerAdminService)(F,te)}})),pA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNextCallNumber=n;let t=0;function n(){return t++}})),mA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompressionAlgorithms=void 0;var t;(function(e){e[e.identity=0]=`identity`,e[e.deflate=1]=`deflate`,e[e.gzip=2]=`gzip`})(t||(e.CompressionAlgorithms=t={}))})),hA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseFilter=void 0,e.BaseFilter=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}}})),gA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompressionFilterFactory=e.CompressionFilter=void 0;let t=s(`zlib`),n=mA(),r=J(),i=hA(),a=Y(),o=e=>typeof e==`number`&&typeof n.CompressionAlgorithms[e]==`string`;var c=class{async writeMessage(e,t){let n=e;t&&(n=await this.compressMessage(n));let r=Buffer.allocUnsafe(n.length+5);return r.writeUInt8(+!!t,0),r.writeUInt32BE(n.length,1),n.copy(r,5),r}async readMessage(e){let t=e.readUInt8(0)===1,n=e.slice(5);return t&&(n=await this.decompressMessage(n)),n}},l=class extends c{async compressMessage(e){return e}async writeMessage(e,t){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(Error(`Received compressed message but "grpc-encoding" header was identity`))}},u=class extends c{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((n,r)=>{t.deflate(e,(e,t)=>{e?r(e):n(t)})})}decompressMessage(e){return new Promise((n,i)=>{let a=0,o=[],s=t.createInflate();s.on(`error`,e=>{i({code:r.Status.INTERNAL,details:`Failed to decompress deflate-encoded message`})}),s.on(`data`,e=>{o.push(e),a+=e.byteLength,this.maxRecvMessageLength!==-1&&a>this.maxRecvMessageLength&&(s.destroy(),i({code:r.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on(`end`,()=>{n(Buffer.concat(o))}),s.write(e),s.end()})}},d=class extends c{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((n,r)=>{t.gzip(e,(e,t)=>{e?r(e):n(t)})})}decompressMessage(e){return new Promise((n,i)=>{let a=0,o=[],s=t.createGunzip();s.on(`error`,e=>{i({code:r.Status.INTERNAL,details:`Failed to decompress gzip-encoded message`})}),s.on(`data`,e=>{o.push(e),a+=e.byteLength,this.maxRecvMessageLength!==-1&&a>this.maxRecvMessageLength&&(s.destroy(),i({code:r.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on(`end`,()=>{n(Buffer.concat(o))}),s.write(e),s.end()})}},f=class extends c{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(Error(`Compression method not supported: ${this.compressionName}`))}};function p(e,t){switch(e){case`identity`:return new l;case`deflate`:return new u(t);case`gzip`:return new d(t);default:return new f(e)}}var m=class extends i.BaseFilter{constructor(e,t){super(),this.sharedFilterConfig=t,this.sendCompression=new l,this.receiveCompression=new l,this.currentCompressionAlgorithm=`identity`;let i=e[`grpc.default_compression_algorithm`];if(this.maxReceiveMessageLength=e[`grpc.max_receive_message_length`]??r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=e[`grpc.max_send_message_length`]??r.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(o(i)){let e=n.CompressionAlgorithms[i],r=t.serverSupportedEncodingHeader?.split(`,`);(!r||r.includes(e))&&(this.currentCompressionAlgorithm=e,this.sendCompression=p(this.currentCompressionAlgorithm,-1))}else a.log(r.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set(`grpc-accept-encoding`,`identity,deflate,gzip`),t.set(`accept-encoding`,`identity`),this.currentCompressionAlgorithm===`identity`?t.remove(`grpc-encoding`):t.set(`grpc-encoding`,this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get(`grpc-encoding`);if(t.length>0){let e=t[0];typeof e==`string`&&(this.receiveCompression=p(e,this.maxReceiveMessageLength))}e.remove(`grpc-encoding`);let n=e.get(`grpc-accept-encoding`)[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(`,`).includes(this.currentCompressionAlgorithm)||(this.sendCompression=new l,this.currentCompressionAlgorithm=`identity`)),e.remove(`grpc-accept-encoding`),e}async sendMessage(e){let t=await e;if(this.maxSendMessageLength!==-1&&t.message.length>this.maxSendMessageLength)throw{code:r.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let n;return n=this.sendCompression instanceof l?!1:((t.flags??0)&2)==0,{message:await this.sendCompression.writeMessage(t.message,n),flags:t.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};e.CompressionFilter=m,e.CompressionFilterFactory=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new m(this.options,this.sharedFilterConfig)}}})),_A=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.restrictControlPlaneStatusCode=r;let t=J(),n=[t.Status.OK,t.Status.INVALID_ARGUMENT,t.Status.NOT_FOUND,t.Status.ALREADY_EXISTS,t.Status.FAILED_PRECONDITION,t.Status.ABORTED,t.Status.OUT_OF_RANGE,t.Status.DATA_LOSS];function r(e,r){return n.includes(e)?{code:t.Status.INTERNAL,details:`Invalid status from control plane: ${e} ${t.Status[e]} ${r}`}:{code:e,details:r}}})),vA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.minDeadline=t,e.getDeadlineTimeoutString=r,e.getRelativeTimeout=i,e.deadlineToString=a,e.formatDateDifference=o;function t(...e){let t=1/0;for(let n of e){let e=n instanceof Date?n.getTime():n;e<t&&(t=e)}return t}let n=[[`m`,1],[`S`,1e3],[`M`,60*1e3],[`H`,3600*1e3]];function r(e){let t=new Date().getTime();e instanceof Date&&(e=e.getTime());let r=Math.max(e-t,0);for(let[e,t]of n){let n=r/t;if(n<1e8)return String(Math.ceil(n))+e}throw Error(`Deadline is too far in the future`)}function i(e){let t=(e instanceof Date?e.getTime():e)-new Date().getTime();return t<0?0:t>2147483647?1/0:t}function a(e){if(e instanceof Date)return e.toISOString();{let t=new Date(e);return Number.isNaN(t.getTime())?``+e:t.toISOString()}}function o(e,t){return((t.getTime()-e.getTime())/1e3).toFixed(3)+`s`}})),yA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FilterStackFactory=e.FilterStack=void 0;var t=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMessage(t);return t}receiveMessage(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};e.FilterStack=t,e.FilterStackFactory=class e{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new e([...this.factories])}createFilter(){return new t(this.factories.map(e=>e.createFilter()))}}})),bA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SingleSubchannelChannel=void 0;let t=pA(),n=fA(),r=gA(),i=XO(),a=J(),o=_A(),s=vA(),c=yA(),l=X(),u=KO(),d=Z();var f=class{constructor(e,t,n,r,i){this.subchannel=e,this.method=t,this.options=r,this.callNumber=i,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let o=this.method.split(`/`),c=``;o.length>=2&&(c=o[1]);let l=(0,d.splitHostPort)(this.options.host)?.host??`localhost`;this.serviceUrl=`https://${l}/${c}`;let u=(0,s.getRelativeTimeout)(r.deadline);u!==1/0&&(u<=0?this.cancelWithStatus(a.Status.DEADLINE_EXCEEDED,`Deadline exceeded`):setTimeout(()=>{this.cancelWithStatus(a.Status.DEADLINE_EXCEEDED,`Deadline exceeded`)},u)),this.filterStack=n.createFilter()}cancelWithStatus(e,t){this.childCall?this.childCall.cancelWithStatus(e,t):this.pendingStatus={code:e,details:t,metadata:new l.Metadata}}getPeer(){return this.childCall?.getPeer()??this.subchannel.getAddress()}async start(e,t){if(this.pendingStatus){t.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==i.ConnectivityState.READY){t.onReceiveStatus({code:a.Status.UNAVAILABLE,details:`Subchannel not ready`,metadata:new l.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),r;try{r=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(e){let n=e,{code:r,details:i}=(0,o.restrictControlPlaneStatusCode)(typeof n.code==`number`?n.code:a.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${n.message}`);t.onReceiveStatus({code:r,details:i,metadata:new l.Metadata});return}r.merge(n);let s={onReceiveMetadata:async e=>{t.onReceiveMetadata(await this.filterStack.receiveMetadata(e))},onReceiveMessage:async e=>{this.readFilterPending=!0;let n=await this.filterStack.receiveMessage(e);this.readFilterPending=!1,t.onReceiveMessage(n),this.pendingStatus&&t.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async e=>{let n=await this.filterStack.receiveTrailers(e);this.readFilterPending?this.pendingStatus=n:t.onReceiveStatus(n)}};this.childCall=this.subchannel.createCall(r,this.options.host,this.method,s),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,t){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw Error(`Method not implemented.`)}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}};e.SingleSubchannelChannel=class{constructor(e,t,i){this.subchannel=e,this.target=t,this.channelzEnabled=!1,this.channelzTrace=new n.ChannelzTrace,this.callTracker=new n.ChannelzCallTracker,this.childrenTracker=new n.ChannelzChildrenTracker,this.channelzEnabled=i[`grpc.enable_channelz`]!==0,this.channelzRef=(0,n.registerChannelzChannel)((0,d.uriToString)(t),()=>({target:`${(0,d.uriToString)(t)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new c.FilterStackFactory([new r.CompressionFilterFactory(this,i)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,n.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,d.uriToString)(this.target)}getConnectivityState(e){throw Error(`Method not implemented.`)}watchConnectivityState(e,t,n){throw Error(`Method not implemented.`)}getChannelzRef(){return this.channelzRef}createCall(e,n){let r={deadline:n,host:(0,u.getDefaultAuthority)(this.target),flags:a.Propagate.DEFAULTS,parentCall:null};return new f(this.subchannel,e,this.filterStackFactory,r,(0,t.getNextCallNumber)())}}})),xA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Subchannel=void 0;let t=XO(),n=QO(),r=Y(),i=J(),a=Z(),o=nk(),s=fA(),c=bA();e.Subchannel=class{constructor(e,r,i,a,c){this.channelTarget=e,this.subchannelAddress=r,this.options=i,this.connector=c,this.connectivityState=t.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 l={initialDelay:i[`grpc.initial_reconnect_backoff_ms`],maxDelay:i[`grpc.max_reconnect_backoff_ms`]};this.backoffTimeout=new n.BackoffTimeout(()=>{this.handleBackoffTimer()},l),this.backoffTimeout.unref(),this.subchannelAddressString=(0,o.subchannelAddressToString)(r),this.keepaliveTime=i[`grpc.keepalive_time_ms`]??-1,i[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.channelzTrace=new s.ChannelzTraceStub,this.callTracker=new s.ChannelzCallTrackerStub,this.childrenTracker=new s.ChannelzChildrenTrackerStub,this.streamTracker=new s.ChannelzCallTrackerStub):(this.channelzTrace=new s.ChannelzTrace,this.callTracker=new s.ChannelzCallTracker,this.childrenTracker=new s.ChannelzChildrenTracker,this.streamTracker=new s.ChannelzCallTracker),this.channelzRef=(0,s.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(`CT_INFO`,`Subchannel created`),this.trace(`Subchannel constructed with options `+JSON.stringify(i,void 0,2)),this.secureConnector=a._createSecureConnector(e,i)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){r.trace(i.LogVerbosity.DEBUG,`subchannel`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}refTrace(e){r.trace(i.LogVerbosity.DEBUG,`subchannel_refcount`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.CONNECTING):this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e[`grpc.keepalive_time_ms`]){let t=Math.min(this.keepaliveTime,2147483647);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(e=>{this.transitionToState([t.ConnectivityState.CONNECTING],t.ConnectivityState.READY)?(this.transport=e,this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),e.addDisconnectListener(e=>{this.transitionToState([t.ConnectivityState.READY],t.ConnectivityState.IDLE),e&&this.keepaliveTime>0&&(this.keepaliveTime*=2,r.log(i.LogVerbosity.ERROR,`Connection to ${(0,a.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):e.shutdown()},e=>{this.transitionToState([t.ConnectivityState.CONNECTING],t.ConnectivityState.TRANSIENT_FAILURE,`${e}`)})}transitionToState(e,n,r){var i,a;if(e.indexOf(this.connectivityState)===-1)return!1;r?this.trace(t.ConnectivityState[this.connectivityState]+` -> `+t.ConnectivityState[n]+` with error "`+r+`"`):this.trace(t.ConnectivityState[this.connectivityState]+` -> `+t.ConnectivityState[n]),this.channelzEnabled&&this.channelzTrace.addTrace(`CT_INFO`,`Connectivity state change to `+t.ConnectivityState[n]);let o=this.connectivityState;switch(this.connectivityState=n,n){case t.ConnectivityState.READY:this.stopBackoff();break;case t.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case t.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)==null||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case t.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)==null||a.shutdown(),this.transport=null;break;default:throw Error(`Invalid state: unknown ConnectivityState ${n}`)}for(let e of this.stateListeners)e(this,o,n,this.keepaliveTime,r);return!0}ref(){this.refTrace(`refcount `+this.refcount+` -> `+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace(`refcount `+this.refcount+` -> `+(this.refcount-1)),--this.refcount,this.refcount===0&&(this.channelzTrace.addTrace(`CT_INFO`,`Shutting down`),(0,s.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([t.ConnectivityState.CONNECTING,t.ConnectivityState.READY],t.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,n,r){if(!this.transport)throw Error(`Cannot create call, subchannel not READY`);let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:e=>{e.code===i.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,n,r,a)}startConnecting(){process.nextTick(()=>{this.transitionToState([t.ConnectivityState.IDLE],t.ConnectivityState.CONNECTING)||this.connectivityState===t.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||=new c.SingleSubchannelChannel(this,this.channelTarget,this.options),this.subchannelChannel}addDataWatcher(e){throw Error(`Not implemented`)}getOrCreateDataProducer(e,t){let n=this.dataProducers.get(e);if(n)return n;let r=t(this);return this.dataProducers.set(e,r),r}removeDataProducer(e){this.dataProducers.delete(e)}}})),SA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0,e.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=(process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER??`false`)===`true`})),CA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_PORT=void 0,e.setup=g;let t=KO(),n=s(`dns`),r=YO(),i=J(),a=ok(),o=X(),c=Y(),l=J(),u=Z(),d=s(`net`),f=QO(),p=SA();function m(e){c.trace(l.LogVerbosity.DEBUG,`dns_resolver`,e)}e.DEFAULT_PORT=443;var h=class{constructor(t,r,a){this.target=t,this.listener=r,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new n.promises.Resolver,m(`Resolver constructed for target `+(0,u.uriToString)(t)),t.authority&&this.alternativeResolver.setServers([t.authority]);let s=(0,u.splitHostPort)(t.path);s===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,d.isIPv4)(s.host)||(0,d.isIPv6)(s.host)?(this.ipResult=[{addresses:[{host:s.host,port:s.port??e.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=s.host,this.port=s.port??e.DEFAULT_PORT),this.percentage=Math.random()*100,a[`grpc.service_config_disable_resolution`]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:i.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,u.uriToString)(this.target)}`,metadata:new o.Metadata};let c={initialDelay:a[`grpc.initial_reconnect_backoff_ms`],maxDelay:a[`grpc.max_reconnect_backoff_ms`]};this.backoff=new f.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=a[`grpc.dns_min_time_between_resolutions_ms`]??3e4,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||=(m(`Returning IP address for target `+(0,u.uriToString)(this.target)),setImmediate(()=>{this.listener((0,a.statusOrFromValue)(this.ipResult),{},null,``)}),!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)m(`Failed to parse DNS address `+(0,u.uriToString)(this.target)),setImmediate(()=>{this.listener((0,a.statusOrFromError)({code:i.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,u.uriToString)(this.target)}`}),{},null,``)}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;m(`Looking up DNS hostname `+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(e=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,a.statusOrFromValue)(e.map(e=>({addresses:[e]})));let t=`[`+e.map(e=>e.host+`:`+e.port).join(`,`)+`]`;m(`Resolved addresses for target `+(0,u.uriToString)(this.target)+`: `+t);let n=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,``);this.handleHealthStatus(n)},e=>{this.pendingLookupPromise!==null&&(m(`Resolution error for target `+(0,u.uriToString)(this.target)+`: `+e.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,a.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,``))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(e=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let t;try{t=(0,r.extractAndSelectServiceConfig)(e,this.percentage),t?this.latestServiceConfigResult=(0,a.statusOrFromValue)(t):this.latestServiceConfigResult=null}catch(e){this.latestServiceConfigResult=(0,a.statusOrFromError)({code:i.Status.UNAVAILABLE,details:`Parsing service config failed with error ${e.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,``)},e=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(p.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){m(`Using alternative DNS resolver.`);let t=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(t.every(e=>e.status===`rejected`))throw Error(t[0].reason);return t.reduce((e,t)=>t.status===`fulfilled`?[...e,...t.value]:e,[]).map(e=>({host:e,port:+this.port}))}return(await n.promises.lookup(e,{all:!0})).map(e=>({host:e.address,port:+this.port}))}async resolveTxt(e){return p.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(m(`Using alternative DNS resolver.`),this.alternativeResolver.resolveTxt(e)):n.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)==null||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?m(`resolution update delayed by "min time between resolutions" rate limit`):m(`resolution update delayed by backoff timer until `+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function g(){(0,t.registerResolver)(`dns`,h),(0,t.registerDefaultScheme)(`dns`)}})),wA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseCIDR=m,e.mapProxyName=v,e.getProxiedConnection=y;let t=Y(),n=J(),r=s(`net`),i=s(`http`),a=Y(),o=nk(),c=Z(),l=s(`url`),u=CA();function d(e){a.trace(n.LogVerbosity.DEBUG,`proxy`,e)}function f(){let e=``,r=``;if(process.env.grpc_proxy)r=`grpc_proxy`,e=process.env.grpc_proxy;else if(process.env.https_proxy)r=`https_proxy`,e=process.env.https_proxy;else if(process.env.http_proxy)r=`http_proxy`,e=process.env.http_proxy;else return{};let i;try{i=new l.URL(e)}catch{return(0,t.log)(n.LogVerbosity.ERROR,`cannot parse value of "${r}" env var`),{}}if(i.protocol!==`http:`)return(0,t.log)(n.LogVerbosity.ERROR,`"${i.protocol}" scheme not supported in proxy URI`),{};let a=null;i.username&&(i.password?((0,t.log)(n.LogVerbosity.INFO,`userinfo found in proxy URI`),a=decodeURIComponent(`${i.username}:${i.password}`)):a=i.username);let o=i.hostname,s=i.port;s===``&&(s=`80`);let c={address:`${o}:${s}`};return a&&(c.creds=a),d(`Proxy server `+c.address+` set by environment variable `+r),c}function p(){let e=process.env.no_grpc_proxy,t=`no_grpc_proxy`;return e||(e=process.env.no_proxy,t=`no_proxy`),e?(d(`No proxy server list set by environment variable `+t),e.split(`,`)):[]}function m(e){let t=e.split(`/`);if(t.length!==2)return null;let n=parseInt(t[1],10);return!(0,r.isIPv4)(t[0])||Number.isNaN(n)||n<0||n>32?null:{ip:h(t[0]),prefixLength:n}}function h(e){return e.split(`.`).reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function g(e,t){let n=e.ip,r=-1<<32-e.prefixLength;return(h(t)&r)===(n&r)}function _(e){for(let t of p()){let n=m(t);if((0,r.isIPv4)(e)&&n&&g(n,e)||e.endsWith(t))return!0}return!1}function v(e,t){let n={target:e,extraOptions:{}};if((t[`grpc.enable_http_proxy`]??1)===0||e.scheme===`unix`)return n;let r=f();if(!r.address)return n;let i=(0,c.splitHostPort)(e.path);if(!i)return n;let a=i.host;if(_(a))return d(`Not using proxy for target in no_proxy list: `+(0,c.uriToString)(e)),n;let o={"grpc.http_connect_target":(0,c.uriToString)(e)};return r.creds&&(o[`grpc.http_connect_creds`]=r.creds),{target:{scheme:`dns`,path:r.address},extraOptions:o}}function y(e,r){if(!(`grpc.http_connect_target`in r))return Promise.resolve(null);let a=r[`grpc.http_connect_target`],s=(0,c.parseUri)(a);if(s===null)return Promise.resolve(null);let l=(0,c.splitHostPort)(s.path);if(l===null)return Promise.resolve(null);let f=`${l.host}:${l.port??u.DEFAULT_PORT}`,p={method:`CONNECT`,path:f},m={Host:f};(0,o.isTcpSubchannelAddress)(e)?(p.host=e.host,p.port=e.port):p.socketPath=e.path,`grpc.http_connect_creds`in r&&(m[`Proxy-Authorization`]=`Basic `+Buffer.from(r[`grpc.http_connect_creds`]).toString(`base64`)),p.headers=m;let h=(0,o.subchannelAddressToString)(e);return d(`Using proxy `+h+` to connect to `+p.path),new Promise((e,r)=>{let a=i.request(p);a.once(`connect`,(i,o,s)=>{a.removeAllListeners(),o.removeAllListeners(),i.statusCode===200?(d(`Successfully connected to `+p.path+` through proxy `+h),s.length>0&&o.unshift(s),d(`Successfully established a plaintext connection to `+p.path+` through proxy `+h),e(o)):((0,t.log)(n.LogVerbosity.ERROR,`Failed to connect to `+p.path+` through proxy `+h+` with status `+i.statusCode),r())}),a.once(`error`,e=>{a.removeAllListeners(),(0,t.log)(n.LogVerbosity.ERROR,`Failed to connect to proxy `+h+` with error `+e.message),r()}),a.end()})}})),TA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamDecoder=void 0;var t;(function(e){e[e.NO_DATA=0]=`NO_DATA`,e[e.READING_SIZE=1]=`READING_SIZE`,e[e.READING_MESSAGE=2]=`READING_MESSAGE`})(t||={}),e.StreamDecoder=class{constructor(e){this.maxReadMessageLength=e,this.readState=t.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let n=0,r,i=[];for(;n<e.length;)switch(this.readState){case t.NO_DATA:this.readCompressFlag=e.slice(n,n+1),n+=1,this.readState=t.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case t.READING_SIZE:if(r=Math.min(e.length-n,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,n,n+r),this.readSizeRemaining-=r,n+=r,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=t.READING_MESSAGE;else{let e=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=t.NO_DATA,i.push(e)}}break;case t.READING_MESSAGE:if(r=Math.min(e.length-n,this.readMessageRemaining),this.readPartialMessage.push(e.slice(n,n+r)),this.readMessageRemaining-=r,n+=r,this.readMessageRemaining===0){let e=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),n=Buffer.concat(e,this.readMessageSize+5);this.readState=t.NO_DATA,i.push(n)}break;default:throw Error(`Unexpected read state`)}return i}}})),EA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Http2SubchannelCall=void 0;let t=s(`http2`),n=s(`os`),r=J(),i=X(),a=TA(),o=Y(),c=J();function l(e){for(let[t,r]of Object.entries(n.constants.errno))if(r===e)return t;return`Unknown system error `+e}function u(e){let t=`Received HTTP status code ${e}`,n;switch(e){case 400:n=r.Status.INTERNAL;break;case 401:n=r.Status.UNAUTHENTICATED;break;case 403:n=r.Status.PERMISSION_DENIED;break;case 404:n=r.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:n=r.Status.UNAVAILABLE;break;default:n=r.Status.UNKNOWN}return{code:n,details:t,metadata:new i.Metadata}}e.Http2SubchannelCall=class{constructor(e,n,o,s,c){this.http2Stream=e,this.callEventTracker=n,this.listener=o,this.transport=s,this.callId=c,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 d=s.getOptions()[`grpc.max_receive_message_length`]??r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new a.StreamDecoder(d),e.on(`response`,(e,n)=>{let a=``;for(let t of Object.keys(e))a+=` `+t+`: `+e[t]+`
113
+ Object.defineProperty(e,"__esModule",{value:!0}),e.loadFileDescriptorSetFromObject=e.loadFileDescriptorSetFromBuffer=e.fromJSON=e.loadSync=e.load=e.IdempotencyLevel=e.isAnyExtension=e.Long=void 0;let t=dk(),n=iA(),r=oA(),i=uA();e.Long=dA();function a(e){return`@type`in e&&typeof e[`@type`]==`string`}e.isAnyExtension=a;var o;(function(e){e.IDEMPOTENCY_UNKNOWN=`IDEMPOTENCY_UNKNOWN`,e.NO_SIDE_EFFECTS=`NO_SIDE_EFFECTS`,e.IDEMPOTENT=`IDEMPOTENT`})(o=e.IdempotencyLevel||={});let s={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function c(e,t){return e===``?t:e+`.`+t}function l(e){return e instanceof n.Service||e instanceof n.Type||e instanceof n.Enum}function u(e){return e instanceof n.Namespace||e instanceof n.Root}function d(e,t){let n=c(t,e.name);return l(e)?[[n,e]]:u(e)&&e.nested!==void 0?Object.keys(e.nested).map(t=>d(e.nested[t],n)).reduce((e,t)=>e.concat(t),[]):[]}function f(e,t){return function(n){return e.toObject(e.decode(n),t)}}function p(e){return function(t){if(Array.isArray(t))throw Error(`Failed to serialize message: expected object with ${e.name} structure, got array instead`);let n=e.fromObject(t);return e.encode(n).finish()}}function m(e){return(e||[]).reduce((e,t)=>{for(let[n,r]of Object.entries(t))switch(n){case`uninterpreted_option`:e.uninterpreted_option.push(t.uninterpreted_option);break;default:e[n]=r}return e},{deprecated:!1,idempotency_level:o.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function h(e,n,r,i){let a=e.resolvedRequestType,o=e.resolvedResponseType;return{path:`/`+n+`/`+e.name,requestStream:!!e.requestStream,responseStream:!!e.responseStream,requestSerialize:p(a),requestDeserialize:f(a,r),responseSerialize:p(o),responseDeserialize:f(o,r),originalName:t(e.name),requestType:_(a,r,i),responseType:_(o,r,i),options:m(e.parsedOptions)}}function g(e,t,n,r){let i={};for(let a of e.methodsArray)i[a.name]=h(a,t,n,r);return i}function _(e,t,n){let r=e.toDescriptor(`proto3`);return{format:`Protocol Buffer 3 DescriptorProto`,type:r.$type.toObject(r,s),fileDescriptorProtos:n,serialize:p(e),deserialize:f(e,t)}}function v(e,t){let n=e.toDescriptor(`proto3`);return{format:`Protocol Buffer 3 EnumDescriptorProto`,type:n.$type.toObject(n,s),fileDescriptorProtos:t}}function y(e,t,r,i){if(e instanceof n.Service)return g(e,t,r,i);if(e instanceof n.Type)return _(e,r,i);if(e instanceof n.Enum)return v(e,i);throw Error(`Type mismatch in reflection object handling`)}function b(e,t){let n={};e.resolveAll();let i=e.toDescriptor(`proto3`).file.map(e=>Buffer.from(r.FileDescriptorProto.encode(e).finish()));for(let[r,a]of d(e,``))n[r]=y(a,r,t,i);return n}function x(e,t){t||={};let r=n.Root.fromDescriptor(e);return r.resolveAll(),b(r,t)}function S(e,t){return(0,i.loadProtosWithOptions)(e,t).then(e=>b(e,t))}e.load=S;function C(e,t){return b((0,i.loadProtosWithOptionsSync)(e,t),t)}e.loadSync=C;function w(e,t){t||={};let r=n.Root.fromJSON(e);return r.resolveAll(),b(r,t)}e.fromJSON=w;function T(e,t){return x(r.FileDescriptorSet.decode(e),t)}e.loadFileDescriptorSetFromBuffer=T;function E(e,t){return x(r.FileDescriptorSet.fromObject(e),t)}e.loadFileDescriptorSetFromObject=E,(0,i.addCommonProtos)()})),pA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.registerChannelzSocket=e.registerChannelzServer=e.registerChannelzSubchannel=e.registerChannelzChannel=e.ChannelzCallTrackerStub=e.ChannelzCallTracker=e.ChannelzChildrenTrackerStub=e.ChannelzChildrenTracker=e.ChannelzTrace=e.ChannelzTraceStub=void 0,e.unregisterChannelzRef=_,e.getChannelzHandlers=ne,e.getChannelzServiceDefinition=P,e.setup=re;let t=s(`net`),n=ik(),r=ZO(),i=J(),a=rk(),o=ak(),c=uk();function l(e){return{channel_id:e.id,name:e.name}}function u(e){return{subchannel_id:e.id,name:e.name}}function d(e){return{server_id:e.id}}function f(e){return{socket_id:e.id,name:e.name}}e.ChannelzTraceStub=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:w(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}},e.ChannelzTrace=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,t,n){let r=new Date;this.events.push({description:t,severity:e,timestamp:r,childChannel:n?.kind===`channel`?n:void 0,childSubchannel:n?.kind===`subchannel`?n:void 0}),this.events.length>=64&&(this.events=this.events.slice(32)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:w(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:w(e.timestamp),channel_ref:e.childChannel?l(e.childChannel):null,subchannel_ref:e.childSubchannel?u(e.childSubchannel):null}))}}};var p=class{constructor(){this.channelChildren=new n.OrderedMap,this.subchannelChildren=new n.OrderedMap,this.socketChildren=new n.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let t=this.trackerMap[e.kind],n=t.find(e.id);n.equals(t.end())?t.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let t=this.trackerMap[e.kind],n=t.getElementByKey(e.id);n!==void 0&&(--n.count,n.count===0&&t.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};e.ChannelzChildrenTracker=p,e.ChannelzChildrenTrackerStub=class extends p{refChild(){}unrefChild(){}};var m=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};e.ChannelzCallTracker=m,e.ChannelzCallTrackerStub=class extends m{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};let h={channel:new n.OrderedMap,subchannel:new n.OrderedMap,server:new n.OrderedMap,socket:new n.OrderedMap},g=e=>{let t=1;function n(){return t++}let r=h[e];return(t,i,a)=>{let o=n(),s={id:o,name:t,kind:e};return a&&r.setElement(o,{ref:s,getInfo:i}),s}};e.registerChannelzChannel=g(`channel`),e.registerChannelzSubchannel=g(`subchannel`),e.registerChannelzServer=g(`server`),e.registerChannelzSocket=g(`socket`);function _(e){h[e.kind].eraseElementByKey(e.id)}function v(e){let t=Number.parseInt(e,16);return[t/256|0,t%256]}function y(e){if(e===``)return[];let t=e.split(`:`).map(e=>v(e));return[].concat(...t)}function b(e){return(0,t.isIPv6)(e)&&e.toLowerCase().startsWith(`::ffff:`)&&(0,t.isIPv4)(e.substring(7))}function x(e){return Buffer.from(Uint8Array.from(e.split(`.`).map(e=>Number.parseInt(e))))}function S(e){if((0,t.isIPv4)(e))return x(e);if(b(e))return x(e.substring(7));if((0,t.isIPv6)(e)){let t,n,r=e.indexOf(`::`);r===-1?(t=e,n=``):(t=e.substring(0,r),n=e.substring(r+2));let i=Buffer.from(y(t)),a=Buffer.from(y(n)),o=Buffer.alloc(16-i.length-a.length,0);return Buffer.concat([i,o,a])}else return null}function C(e){switch(e){case r.ConnectivityState.CONNECTING:return{state:`CONNECTING`};case r.ConnectivityState.IDLE:return{state:`IDLE`};case r.ConnectivityState.READY:return{state:`READY`};case r.ConnectivityState.SHUTDOWN:return{state:`SHUTDOWN`};case r.ConnectivityState.TRANSIENT_FAILURE:return{state:`TRANSIENT_FAILURE`};default:return{state:`UNKNOWN`}}}function w(e){if(!e)return null;let t=e.getTime();return{seconds:t/1e3|0,nanos:t%1e3*1e6}}function T(e){let t=e.getInfo(),n=[],r=[];return t.children.channels.forEach(e=>{n.push(l(e[1].ref))}),t.children.subchannels.forEach(e=>{r.push(u(e[1].ref))}),{ref:l(e.ref),data:{target:t.target,state:C(t.state),calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:w(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},channel_ref:n,subchannel_ref:r}}function E(e,t){let n=parseInt(e.request.channel_id,10),r=h.channel.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No channel data found for id `+n});return}t(null,{channel:T(r)})}function D(e,t){let n=parseInt(e.request.max_results,10)||100,r=[],i=parseInt(e.request.start_channel_id,10),a=h.channel,o;for(o=a.lowerBound(i);!o.equals(a.end())&&r.length<n;o=o.next())r.push(T(o.pointer[1]));t(null,{channel:r,end:o.equals(a.end())})}function O(e){let t=e.getInfo(),n=[];return t.listenerChildren.sockets.forEach(e=>{n.push(f(e[1].ref))}),{ref:d(e.ref),data:{calls_started:t.callTracker.callsStarted,calls_succeeded:t.callTracker.callsSucceeded,calls_failed:t.callTracker.callsFailed,last_call_started_timestamp:w(t.callTracker.lastCallStartedTimestamp),trace:t.trace.getTraceMessage()},listen_socket:n}}function k(e,t){let n=parseInt(e.request.server_id,10),r=h.server.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No server data found for id `+n});return}t(null,{server:O(r)})}function A(e,t){let n=parseInt(e.request.max_results,10)||100,r=parseInt(e.request.start_server_id,10),i=h.server,a=[],o;for(o=i.lowerBound(r);!o.equals(i.end())&&a.length<n;o=o.next())a.push(O(o.pointer[1]));t(null,{server:a,end:o.equals(i.end())})}function j(e,t){let n=parseInt(e.request.subchannel_id,10),r=h.subchannel.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No subchannel data found for id `+n});return}let a=r.getInfo(),o=[];a.children.sockets.forEach(e=>{o.push(f(e[1].ref))}),t(null,{subchannel:{ref:u(r.ref),data:{target:a.target,state:C(a.state),calls_started:a.callTracker.callsStarted,calls_succeeded:a.callTracker.callsSucceeded,calls_failed:a.callTracker.callsFailed,last_call_started_timestamp:w(a.callTracker.lastCallStartedTimestamp),trace:a.trace.getTraceMessage()},socket_ref:o}})}function ee(e){return(0,a.isTcpSubchannelAddress)(e)?{address:`tcpip_address`,tcpip_address:{ip_address:S(e.host)??void 0,port:e.port}}:{address:`uds_address`,uds_address:{filename:e.path}}}function M(e,t){let n=parseInt(e.request.socket_id,10),r=h.socket.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No socket data found for id `+n});return}let a=r.getInfo(),o=a.security?{model:`tls`,tls:{cipher_suite:a.security.cipherSuiteStandardName?`standard_name`:`other_name`,standard_name:a.security.cipherSuiteStandardName??void 0,other_name:a.security.cipherSuiteOtherName??void 0,local_certificate:a.security.localCertificate??void 0,remote_certificate:a.security.remoteCertificate??void 0}}:null;t(null,{socket:{ref:f(r.ref),local:a.localAddress?ee(a.localAddress):null,remote:a.remoteAddress?ee(a.remoteAddress):null,remote_name:a.remoteName??void 0,security:o,data:{keep_alives_sent:a.keepAlivesSent,streams_started:a.streamsStarted,streams_succeeded:a.streamsSucceeded,streams_failed:a.streamsFailed,last_local_stream_created_timestamp:w(a.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:w(a.lastRemoteStreamCreatedTimestamp),messages_received:a.messagesReceived,messages_sent:a.messagesSent,last_message_received_timestamp:w(a.lastMessageReceivedTimestamp),last_message_sent_timestamp:w(a.lastMessageSentTimestamp),local_flow_control_window:a.localFlowControlWindow?{value:a.localFlowControlWindow}:null,remote_flow_control_window:a.remoteFlowControlWindow?{value:a.remoteFlowControlWindow}:null}}})}function te(e,t){let n=parseInt(e.request.server_id,10),r=h.server.getElementByKey(n);if(r===void 0){t({code:i.Status.NOT_FOUND,details:`No server data found for id `+n});return}let a=parseInt(e.request.start_socket_id,10),o=parseInt(e.request.max_results,10)||100,s=r.getInfo().sessionChildren.sockets,c=[],l;for(l=s.lowerBound(a);!l.equals(s.end())&&c.length<o;l=l.next())c.push(f(l.pointer[1].ref));t(null,{socket_ref:c,end:l.equals(s.end())})}function ne(){return{GetChannel:E,GetTopChannels:D,GetServer:k,GetServers:A,GetSubchannel:j,GetSocket:M,GetServerSockets:te}}let N=null;function P(){if(N)return N;let e=fA().loadSync,t=e(`channelz.proto`,{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return N=(0,c.loadPackageDefinition)(t).grpc.channelz.v1.Channelz.service,N}function re(){(0,o.registerAdminService)(P,ne)}})),mA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNextCallNumber=n;let t=0;function n(){return t++}})),hA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompressionAlgorithms=void 0;var t;(function(e){e[e.identity=0]=`identity`,e[e.deflate=1]=`deflate`,e[e.gzip=2]=`gzip`})(t||(e.CompressionAlgorithms=t={}))})),gA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseFilter=void 0,e.BaseFilter=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}}})),_A=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CompressionFilterFactory=e.CompressionFilter=void 0;let t=s(`zlib`),n=hA(),r=J(),i=gA(),a=Y(),o=e=>typeof e==`number`&&typeof n.CompressionAlgorithms[e]==`string`;var c=class{async writeMessage(e,t){let n=e;t&&(n=await this.compressMessage(n));let r=Buffer.allocUnsafe(n.length+5);return r.writeUInt8(+!!t,0),r.writeUInt32BE(n.length,1),n.copy(r,5),r}async readMessage(e){let t=e.readUInt8(0)===1,n=e.slice(5);return t&&(n=await this.decompressMessage(n)),n}},l=class extends c{async compressMessage(e){return e}async writeMessage(e,t){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(Error(`Received compressed message but "grpc-encoding" header was identity`))}},u=class extends c{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((n,r)=>{t.deflate(e,(e,t)=>{e?r(e):n(t)})})}decompressMessage(e){return new Promise((n,i)=>{let a=0,o=[],s=t.createInflate();s.on(`error`,e=>{i({code:r.Status.INTERNAL,details:`Failed to decompress deflate-encoded message`})}),s.on(`data`,e=>{o.push(e),a+=e.byteLength,this.maxRecvMessageLength!==-1&&a>this.maxRecvMessageLength&&(s.destroy(),i({code:r.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on(`end`,()=>{n(Buffer.concat(o))}),s.write(e),s.end()})}},d=class extends c{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((n,r)=>{t.gzip(e,(e,t)=>{e?r(e):n(t)})})}decompressMessage(e){return new Promise((n,i)=>{let a=0,o=[],s=t.createGunzip();s.on(`error`,e=>{i({code:r.Status.INTERNAL,details:`Failed to decompress gzip-encoded message`})}),s.on(`data`,e=>{o.push(e),a+=e.byteLength,this.maxRecvMessageLength!==-1&&a>this.maxRecvMessageLength&&(s.destroy(),i({code:r.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on(`end`,()=>{n(Buffer.concat(o))}),s.write(e),s.end()})}},f=class extends c{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(Error(`Compression method not supported: ${this.compressionName}`))}};function p(e,t){switch(e){case`identity`:return new l;case`deflate`:return new u(t);case`gzip`:return new d(t);default:return new f(e)}}var m=class extends i.BaseFilter{constructor(e,t){super(),this.sharedFilterConfig=t,this.sendCompression=new l,this.receiveCompression=new l,this.currentCompressionAlgorithm=`identity`;let i=e[`grpc.default_compression_algorithm`];if(this.maxReceiveMessageLength=e[`grpc.max_receive_message_length`]??r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=e[`grpc.max_send_message_length`]??r.DEFAULT_MAX_SEND_MESSAGE_LENGTH,i!==void 0)if(o(i)){let e=n.CompressionAlgorithms[i],r=t.serverSupportedEncodingHeader?.split(`,`);(!r||r.includes(e))&&(this.currentCompressionAlgorithm=e,this.sendCompression=p(this.currentCompressionAlgorithm,-1))}else a.log(r.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${i}`)}async sendMetadata(e){let t=await e;return t.set(`grpc-accept-encoding`,`identity,deflate,gzip`),t.set(`accept-encoding`,`identity`),this.currentCompressionAlgorithm===`identity`?t.remove(`grpc-encoding`):t.set(`grpc-encoding`,this.currentCompressionAlgorithm),t}receiveMetadata(e){let t=e.get(`grpc-encoding`);if(t.length>0){let e=t[0];typeof e==`string`&&(this.receiveCompression=p(e,this.maxReceiveMessageLength))}e.remove(`grpc-encoding`);let n=e.get(`grpc-accept-encoding`)[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(`,`).includes(this.currentCompressionAlgorithm)||(this.sendCompression=new l,this.currentCompressionAlgorithm=`identity`)),e.remove(`grpc-accept-encoding`),e}async sendMessage(e){let t=await e;if(this.maxSendMessageLength!==-1&&t.message.length>this.maxSendMessageLength)throw{code:r.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let n;return n=this.sendCompression instanceof l?!1:((t.flags??0)&2)==0,{message:await this.sendCompression.writeMessage(t.message,n),flags:t.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};e.CompressionFilter=m,e.CompressionFilterFactory=class{constructor(e,t){this.options=t,this.sharedFilterConfig={}}createFilter(){return new m(this.options,this.sharedFilterConfig)}}})),vA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.restrictControlPlaneStatusCode=r;let t=J(),n=[t.Status.OK,t.Status.INVALID_ARGUMENT,t.Status.NOT_FOUND,t.Status.ALREADY_EXISTS,t.Status.FAILED_PRECONDITION,t.Status.ABORTED,t.Status.OUT_OF_RANGE,t.Status.DATA_LOSS];function r(e,r){return n.includes(e)?{code:t.Status.INTERNAL,details:`Invalid status from control plane: ${e} ${t.Status[e]} ${r}`}:{code:e,details:r}}})),yA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.minDeadline=t,e.getDeadlineTimeoutString=r,e.getRelativeTimeout=i,e.deadlineToString=a,e.formatDateDifference=o;function t(...e){let t=1/0;for(let n of e){let e=n instanceof Date?n.getTime():n;e<t&&(t=e)}return t}let n=[[`m`,1],[`S`,1e3],[`M`,60*1e3],[`H`,3600*1e3]];function r(e){let t=new Date().getTime();e instanceof Date&&(e=e.getTime());let r=Math.max(e-t,0);for(let[e,t]of n){let n=r/t;if(n<1e8)return String(Math.ceil(n))+e}throw Error(`Deadline is too far in the future`)}function i(e){let t=(e instanceof Date?e.getTime():e)-new Date().getTime();return t<0?0:t>2147483647?1/0:t}function a(e){if(e instanceof Date)return e.toISOString();{let t=new Date(e);return Number.isNaN(t.getTime())?``+e:t.toISOString()}}function o(e,t){return((t.getTime()-e.getTime())/1e3).toFixed(3)+`s`}})),bA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FilterStackFactory=e.FilterStack=void 0;var t=class{constructor(e){this.filters=e}sendMetadata(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMetadata(t);return t}receiveMetadata(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMetadata(t);return t}sendMessage(e){let t=e;for(let e=0;e<this.filters.length;e++)t=this.filters[e].sendMessage(t);return t}receiveMessage(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveMessage(t);return t}receiveTrailers(e){let t=e;for(let e=this.filters.length-1;e>=0;e--)t=this.filters[e].receiveTrailers(t);return t}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};e.FilterStack=t,e.FilterStackFactory=class e{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new e([...this.factories])}createFilter(){return new t(this.factories.map(e=>e.createFilter()))}}})),xA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SingleSubchannelChannel=void 0;let t=mA(),n=pA(),r=_A(),i=ZO(),a=J(),o=vA(),s=yA(),c=bA(),l=X(),u=qO(),d=Z();var f=class{constructor(e,t,n,r,i){this.subchannel=e,this.method=t,this.options=r,this.callNumber=i,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let o=this.method.split(`/`),c=``;o.length>=2&&(c=o[1]);let l=(0,d.splitHostPort)(this.options.host)?.host??`localhost`;this.serviceUrl=`https://${l}/${c}`;let u=(0,s.getRelativeTimeout)(r.deadline);u!==1/0&&(u<=0?this.cancelWithStatus(a.Status.DEADLINE_EXCEEDED,`Deadline exceeded`):setTimeout(()=>{this.cancelWithStatus(a.Status.DEADLINE_EXCEEDED,`Deadline exceeded`)},u)),this.filterStack=n.createFilter()}cancelWithStatus(e,t){this.childCall?this.childCall.cancelWithStatus(e,t):this.pendingStatus={code:e,details:t,metadata:new l.Metadata}}getPeer(){return this.childCall?.getPeer()??this.subchannel.getAddress()}async start(e,t){if(this.pendingStatus){t.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==i.ConnectivityState.READY){t.onReceiveStatus({code:a.Status.UNAVAILABLE,details:`Subchannel not ready`,metadata:new l.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),r;try{r=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(e){let n=e,{code:r,details:i}=(0,o.restrictControlPlaneStatusCode)(typeof n.code==`number`?n.code:a.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${n.message}`);t.onReceiveStatus({code:r,details:i,metadata:new l.Metadata});return}r.merge(n);let s={onReceiveMetadata:async e=>{t.onReceiveMetadata(await this.filterStack.receiveMetadata(e))},onReceiveMessage:async e=>{this.readFilterPending=!0;let n=await this.filterStack.receiveMessage(e);this.readFilterPending=!1,t.onReceiveMessage(n),this.pendingStatus&&t.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async e=>{let n=await this.filterStack.receiveTrailers(e);this.readFilterPending?this.pendingStatus=n:t.onReceiveStatus(n)}};this.childCall=this.subchannel.createCall(r,this.options.host,this.method,s),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,t){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw Error(`Method not implemented.`)}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}};e.SingleSubchannelChannel=class{constructor(e,t,i){this.subchannel=e,this.target=t,this.channelzEnabled=!1,this.channelzTrace=new n.ChannelzTrace,this.callTracker=new n.ChannelzCallTracker,this.childrenTracker=new n.ChannelzChildrenTracker,this.channelzEnabled=i[`grpc.enable_channelz`]!==0,this.channelzRef=(0,n.registerChannelzChannel)((0,d.uriToString)(t),()=>({target:`${(0,d.uriToString)(t)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new c.FilterStackFactory([new r.CompressionFilterFactory(this,i)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,n.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,d.uriToString)(this.target)}getConnectivityState(e){throw Error(`Method not implemented.`)}watchConnectivityState(e,t,n){throw Error(`Method not implemented.`)}getChannelzRef(){return this.channelzRef}createCall(e,n){let r={deadline:n,host:(0,u.getDefaultAuthority)(this.target),flags:a.Propagate.DEFAULTS,parentCall:null};return new f(this.subchannel,e,this.filterStackFactory,r,(0,t.getNextCallNumber)())}}})),SA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Subchannel=void 0;let t=ZO(),n=$O(),r=Y(),i=J(),a=Z(),o=rk(),s=pA(),c=xA();e.Subchannel=class{constructor(e,r,i,a,c){this.channelTarget=e,this.subchannelAddress=r,this.options=i,this.connector=c,this.connectivityState=t.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 l={initialDelay:i[`grpc.initial_reconnect_backoff_ms`],maxDelay:i[`grpc.max_reconnect_backoff_ms`]};this.backoffTimeout=new n.BackoffTimeout(()=>{this.handleBackoffTimer()},l),this.backoffTimeout.unref(),this.subchannelAddressString=(0,o.subchannelAddressToString)(r),this.keepaliveTime=i[`grpc.keepalive_time_ms`]??-1,i[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.channelzTrace=new s.ChannelzTraceStub,this.callTracker=new s.ChannelzCallTrackerStub,this.childrenTracker=new s.ChannelzChildrenTrackerStub,this.streamTracker=new s.ChannelzCallTrackerStub):(this.channelzTrace=new s.ChannelzTrace,this.callTracker=new s.ChannelzCallTracker,this.childrenTracker=new s.ChannelzChildrenTracker,this.streamTracker=new s.ChannelzCallTracker),this.channelzRef=(0,s.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(`CT_INFO`,`Subchannel created`),this.trace(`Subchannel constructed with options `+JSON.stringify(i,void 0,2)),this.secureConnector=a._createSecureConnector(e,i)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){r.trace(i.LogVerbosity.DEBUG,`subchannel`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}refTrace(e){r.trace(i.LogVerbosity.DEBUG,`subchannel_refcount`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.CONNECTING):this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e[`grpc.keepalive_time_ms`]){let t=Math.min(this.keepaliveTime,2147483647);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":t})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(e=>{this.transitionToState([t.ConnectivityState.CONNECTING],t.ConnectivityState.READY)?(this.transport=e,this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),e.addDisconnectListener(e=>{this.transitionToState([t.ConnectivityState.READY],t.ConnectivityState.IDLE),e&&this.keepaliveTime>0&&(this.keepaliveTime*=2,r.log(i.LogVerbosity.ERROR,`Connection to ${(0,a.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):e.shutdown()},e=>{this.transitionToState([t.ConnectivityState.CONNECTING],t.ConnectivityState.TRANSIENT_FAILURE,`${e}`)})}transitionToState(e,n,r){var i,a;if(e.indexOf(this.connectivityState)===-1)return!1;r?this.trace(t.ConnectivityState[this.connectivityState]+` -> `+t.ConnectivityState[n]+` with error "`+r+`"`):this.trace(t.ConnectivityState[this.connectivityState]+` -> `+t.ConnectivityState[n]),this.channelzEnabled&&this.channelzTrace.addTrace(`CT_INFO`,`Connectivity state change to `+t.ConnectivityState[n]);let o=this.connectivityState;switch(this.connectivityState=n,n){case t.ConnectivityState.READY:this.stopBackoff();break;case t.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case t.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)==null||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case t.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(a=this.transport)==null||a.shutdown(),this.transport=null;break;default:throw Error(`Invalid state: unknown ConnectivityState ${n}`)}for(let e of this.stateListeners)e(this,o,n,this.keepaliveTime,r);return!0}ref(){this.refTrace(`refcount `+this.refcount+` -> `+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace(`refcount `+this.refcount+` -> `+(this.refcount-1)),--this.refcount,this.refcount===0&&(this.channelzTrace.addTrace(`CT_INFO`,`Shutting down`),(0,s.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([t.ConnectivityState.CONNECTING,t.ConnectivityState.READY],t.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,t,n,r){if(!this.transport)throw Error(`Cannot create call, subchannel not READY`);let a;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),a={onCallEnd:e=>{e.code===i.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):a={},this.transport.createCall(e,t,n,r,a)}startConnecting(){process.nextTick(()=>{this.transitionToState([t.ConnectivityState.IDLE],t.ConnectivityState.CONNECTING)||this.connectivityState===t.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([t.ConnectivityState.TRANSIENT_FAILURE],t.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||=new c.SingleSubchannelChannel(this,this.channelTarget,this.options),this.subchannelChannel}addDataWatcher(e){throw Error(`Not implemented`)}getOrCreateDataProducer(e,t){let n=this.dataProducers.get(e);if(n)return n;let r=t(this);return this.dataProducers.set(e,r),r}removeDataProducer(e){this.dataProducers.delete(e)}}})),CA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0,e.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=(process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER??`false`)===`true`})),wA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_PORT=void 0,e.setup=g;let t=qO(),n=s(`dns`),r=XO(),i=J(),a=sk(),o=X(),c=Y(),l=J(),u=Z(),d=s(`net`),f=$O(),p=CA();function m(e){c.trace(l.LogVerbosity.DEBUG,`dns_resolver`,e)}e.DEFAULT_PORT=443;var h=class{constructor(t,r,a){this.target=t,this.listener=r,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new n.promises.Resolver,m(`Resolver constructed for target `+(0,u.uriToString)(t)),t.authority&&this.alternativeResolver.setServers([t.authority]);let s=(0,u.splitHostPort)(t.path);s===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,d.isIPv4)(s.host)||(0,d.isIPv6)(s.host)?(this.ipResult=[{addresses:[{host:s.host,port:s.port??e.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=s.host,this.port=s.port??e.DEFAULT_PORT),this.percentage=Math.random()*100,a[`grpc.service_config_disable_resolution`]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:i.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,u.uriToString)(this.target)}`,metadata:new o.Metadata};let c={initialDelay:a[`grpc.initial_reconnect_backoff_ms`],maxDelay:a[`grpc.max_reconnect_backoff_ms`]};this.backoff=new f.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=a[`grpc.dns_min_time_between_resolutions_ms`]??3e4,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||=(m(`Returning IP address for target `+(0,u.uriToString)(this.target)),setImmediate(()=>{this.listener((0,a.statusOrFromValue)(this.ipResult),{},null,``)}),!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)m(`Failed to parse DNS address `+(0,u.uriToString)(this.target)),setImmediate(()=>{this.listener((0,a.statusOrFromError)({code:i.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,u.uriToString)(this.target)}`}),{},null,``)}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;m(`Looking up DNS hostname `+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(e=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,a.statusOrFromValue)(e.map(e=>({addresses:[e]})));let t=`[`+e.map(e=>e.host+`:`+e.port).join(`,`)+`]`;m(`Resolved addresses for target `+(0,u.uriToString)(this.target)+`: `+t);let n=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,``);this.handleHealthStatus(n)},e=>{this.pendingLookupPromise!==null&&(m(`Resolution error for target `+(0,u.uriToString)(this.target)+`: `+e.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,a.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,``))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(e=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let t;try{t=(0,r.extractAndSelectServiceConfig)(e,this.percentage),t?this.latestServiceConfigResult=(0,a.statusOrFromValue)(t):this.latestServiceConfigResult=null}catch(e){this.latestServiceConfigResult=(0,a.statusOrFromError)({code:i.Status.UNAVAILABLE,details:`Parsing service config failed with error ${e.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,``)},e=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(p.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){m(`Using alternative DNS resolver.`);let t=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(t.every(e=>e.status===`rejected`))throw Error(t[0].reason);return t.reduce((e,t)=>t.status===`fulfilled`?[...e,...t.value]:e,[]).map(e=>({host:e,port:+this.port}))}return(await n.promises.lookup(e,{all:!0})).map(e=>({host:e.address,port:+this.port}))}async resolveTxt(e){return p.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(m(`Using alternative DNS resolver.`),this.alternativeResolver.resolveTxt(e)):n.promises.resolveTxt(e)}startNextResolutionTimer(){var e,t;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(t=(e=this.nextResolutionTimer).unref)==null||t.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?m(`resolution update delayed by "min time between resolutions" rate limit`):m(`resolution update delayed by backoff timer until `+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function g(){(0,t.registerResolver)(`dns`,h),(0,t.registerDefaultScheme)(`dns`)}})),TA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseCIDR=m,e.mapProxyName=v,e.getProxiedConnection=y;let t=Y(),n=J(),r=s(`net`),i=s(`http`),a=Y(),o=rk(),c=Z(),l=s(`url`),u=wA();function d(e){a.trace(n.LogVerbosity.DEBUG,`proxy`,e)}function f(){let e=``,r=``;if(process.env.grpc_proxy)r=`grpc_proxy`,e=process.env.grpc_proxy;else if(process.env.https_proxy)r=`https_proxy`,e=process.env.https_proxy;else if(process.env.http_proxy)r=`http_proxy`,e=process.env.http_proxy;else return{};let i;try{i=new l.URL(e)}catch{return(0,t.log)(n.LogVerbosity.ERROR,`cannot parse value of "${r}" env var`),{}}if(i.protocol!==`http:`)return(0,t.log)(n.LogVerbosity.ERROR,`"${i.protocol}" scheme not supported in proxy URI`),{};let a=null;i.username&&(i.password?((0,t.log)(n.LogVerbosity.INFO,`userinfo found in proxy URI`),a=decodeURIComponent(`${i.username}:${i.password}`)):a=i.username);let o=i.hostname,s=i.port;s===``&&(s=`80`);let c={address:`${o}:${s}`};return a&&(c.creds=a),d(`Proxy server `+c.address+` set by environment variable `+r),c}function p(){let e=process.env.no_grpc_proxy,t=`no_grpc_proxy`;return e||(e=process.env.no_proxy,t=`no_proxy`),e?(d(`No proxy server list set by environment variable `+t),e.split(`,`)):[]}function m(e){let t=e.split(`/`);if(t.length!==2)return null;let n=parseInt(t[1],10);return!(0,r.isIPv4)(t[0])||Number.isNaN(n)||n<0||n>32?null:{ip:h(t[0]),prefixLength:n}}function h(e){return e.split(`.`).reduce((e,t)=>(e<<8)+parseInt(t,10),0)}function g(e,t){let n=e.ip,r=-1<<32-e.prefixLength;return(h(t)&r)===(n&r)}function _(e){for(let t of p()){let n=m(t);if((0,r.isIPv4)(e)&&n&&g(n,e)||e.endsWith(t))return!0}return!1}function v(e,t){let n={target:e,extraOptions:{}};if((t[`grpc.enable_http_proxy`]??1)===0||e.scheme===`unix`)return n;let r=f();if(!r.address)return n;let i=(0,c.splitHostPort)(e.path);if(!i)return n;let a=i.host;if(_(a))return d(`Not using proxy for target in no_proxy list: `+(0,c.uriToString)(e)),n;let o={"grpc.http_connect_target":(0,c.uriToString)(e)};return r.creds&&(o[`grpc.http_connect_creds`]=r.creds),{target:{scheme:`dns`,path:r.address},extraOptions:o}}function y(e,r){if(!(`grpc.http_connect_target`in r))return Promise.resolve(null);let a=r[`grpc.http_connect_target`],s=(0,c.parseUri)(a);if(s===null)return Promise.resolve(null);let l=(0,c.splitHostPort)(s.path);if(l===null)return Promise.resolve(null);let f=`${l.host}:${l.port??u.DEFAULT_PORT}`,p={method:`CONNECT`,path:f},m={Host:f};(0,o.isTcpSubchannelAddress)(e)?(p.host=e.host,p.port=e.port):p.socketPath=e.path,`grpc.http_connect_creds`in r&&(m[`Proxy-Authorization`]=`Basic `+Buffer.from(r[`grpc.http_connect_creds`]).toString(`base64`)),p.headers=m;let h=(0,o.subchannelAddressToString)(e);return d(`Using proxy `+h+` to connect to `+p.path),new Promise((e,r)=>{let a=i.request(p);a.once(`connect`,(i,o,s)=>{a.removeAllListeners(),o.removeAllListeners(),i.statusCode===200?(d(`Successfully connected to `+p.path+` through proxy `+h),s.length>0&&o.unshift(s),d(`Successfully established a plaintext connection to `+p.path+` through proxy `+h),e(o)):((0,t.log)(n.LogVerbosity.ERROR,`Failed to connect to `+p.path+` through proxy `+h+` with status `+i.statusCode),r())}),a.once(`error`,e=>{a.removeAllListeners(),(0,t.log)(n.LogVerbosity.ERROR,`Failed to connect to proxy `+h+` with error `+e.message),r()}),a.end()})}})),EA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StreamDecoder=void 0;var t;(function(e){e[e.NO_DATA=0]=`NO_DATA`,e[e.READING_SIZE=1]=`READING_SIZE`,e[e.READING_MESSAGE=2]=`READING_MESSAGE`})(t||={}),e.StreamDecoder=class{constructor(e){this.maxReadMessageLength=e,this.readState=t.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let n=0,r,i=[];for(;n<e.length;)switch(this.readState){case t.NO_DATA:this.readCompressFlag=e.slice(n,n+1),n+=1,this.readState=t.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case t.READING_SIZE:if(r=Math.min(e.length-n,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,n,n+r),this.readSizeRemaining-=r,n+=r,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=t.READING_MESSAGE;else{let e=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=t.NO_DATA,i.push(e)}}break;case t.READING_MESSAGE:if(r=Math.min(e.length-n,this.readMessageRemaining),this.readPartialMessage.push(e.slice(n,n+r)),this.readMessageRemaining-=r,n+=r,this.readMessageRemaining===0){let e=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),n=Buffer.concat(e,this.readMessageSize+5);this.readState=t.NO_DATA,i.push(n)}break;default:throw Error(`Unexpected read state`)}return i}}})),DA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Http2SubchannelCall=void 0;let t=s(`http2`),n=s(`os`),r=J(),i=X(),a=EA(),o=Y(),c=J();function l(e){for(let[t,r]of Object.entries(n.constants.errno))if(r===e)return t;return`Unknown system error `+e}function u(e){let t=`Received HTTP status code ${e}`,n;switch(e){case 400:n=r.Status.INTERNAL;break;case 401:n=r.Status.UNAUTHENTICATED;break;case 403:n=r.Status.PERMISSION_DENIED;break;case 404:n=r.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:n=r.Status.UNAVAILABLE;break;default:n=r.Status.UNKNOWN}return{code:n,details:t,metadata:new i.Metadata}}e.Http2SubchannelCall=class{constructor(e,n,o,s,c){this.http2Stream=e,this.callEventTracker=n,this.listener=o,this.transport=s,this.callId=c,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 d=s.getOptions()[`grpc.max_receive_message_length`]??r.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new a.StreamDecoder(d),e.on(`response`,(e,n)=>{let a=``;for(let t of Object.keys(e))a+=` `+t+`: `+e[t]+`
114
114
  `;if(this.trace(`Received server headers:
115
115
  `+a),this.httpStatusCode=e[`:status`],n&t.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(e);else{let t;try{t=i.Metadata.fromHttp2Headers(e)}catch(e){this.endCall({code:r.Status.UNKNOWN,details:e.message,metadata:new i.Metadata});return}this.listener.onReceiveMetadata(t)}}),e.on(`trailers`,e=>{this.handleTrailers(e)}),e.on(`data`,e=>{if(this.statusOutput)return;this.trace(`receive HTTP/2 data frame of length `+e.length);let t;try{t=this.decoder.write(e)}catch(e){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let e=u(this.httpStatusCode);this.cancelWithStatus(e.code,e.details)}else this.cancelWithStatus(r.Status.RESOURCE_EXHAUSTED,e.message);return}for(let e of t)this.trace(`parsed message of length `+e.length),this.callEventTracker.addMessageReceived(),this.tryPush(e)}),e.on(`end`,()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on(`close`,()=>{this.serverEndedCall=!0,process.nextTick(()=>{if(this.trace(`HTTP/2 stream closed with code `+e.rstCode),this.finalStatus?.code===r.Status.OK)return;let n,a=``;switch(e.rstCode){case t.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let e=u(this.httpStatusCode);n=e.code,a=e.details}else n=r.Status.INTERNAL,a=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case t.constants.NGHTTP2_REFUSED_STREAM:n=r.Status.UNAVAILABLE,a=`Stream refused by server`;break;case t.constants.NGHTTP2_CANCEL:this.connectionDropped?(n=r.Status.UNAVAILABLE,a=`Connection dropped`):(n=r.Status.CANCELLED,a=`Call cancelled`);break;case t.constants.NGHTTP2_ENHANCE_YOUR_CALM:n=r.Status.RESOURCE_EXHAUSTED,a=`Bandwidth exhausted or memory limit exceeded`;break;case t.constants.NGHTTP2_INADEQUATE_SECURITY:n=r.Status.PERMISSION_DENIED,a=`Protocol not secure enough`;break;case t.constants.NGHTTP2_INTERNAL_ERROR:n=r.Status.INTERNAL,this.internalError===null?a=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code===`ECONNRESET`||this.internalError.code===`ETIMEDOUT`?(n=r.Status.UNAVAILABLE,a=this.internalError.message):a=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:n=r.Status.INTERNAL,a=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:n,details:a,metadata:new i.Metadata,rstCode:e.rstCode})})}),e.on(`error`,e=>{e.code!==`ERR_HTTP2_STREAM_ERROR`&&(this.trace(`Node error event: message=`+e.message+` code=`+e.code+` errno=`+l(e.errno)+` syscall=`+e.syscall),this.internalError=e),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:r.Status.UNAVAILABLE,details:`Connection dropped`,metadata:new i.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace(`ended with status: code=`+this.finalStatus.code+` details="`+this.finalStatus.details+`"`),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){o.trace(c.LogVerbosity.DEBUG,`subchannel_call`,`[`+this.callId+`] `+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===r.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==r.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace(`pushing to reader message of length `+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace(`unpushedReadMessages.push message of length `+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let t=``;for(let n of Object.keys(e))t+=` `+n+`: `+e[n]+`
116
116
  `;this.trace(`Received server trailers:
117
- `+t);let n;try{n=i.Metadata.fromHttp2Headers(e)}catch{n=new i.Metadata}let a=n.getMap(),o;if(typeof a[`grpc-status`]==`string`){let e=Number(a[`grpc-status`]);this.trace(`received status code `+e+` from server`),n.remove(`grpc-status`);let t=``;if(typeof a[`grpc-message`]==`string`){try{t=decodeURI(a[`grpc-message`])}catch{t=a[`grpc-message`]}n.remove(`grpc-message`),this.trace(`received status details string "`+t+`" from server`)}o={code:e,details:t,metadata:n}}else this.httpStatusCode?(o=u(this.httpStatusCode),o.metadata=n):o={code:r.Status.UNKNOWN,details:`No status information received`,metadata:n};this.endCall(o)}destroyHttp2Stream(){if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let e;e=this.finalStatus?.code===r.Status.OK?t.constants.NGHTTP2_NO_ERROR:t.constants.NGHTTP2_CANCEL,this.trace(`close http2 stream with code `+e),this.http2Stream.close(e)}}cancelWithStatus(e,t){this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),this.endCall({code:e,details:t,metadata:new i.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!==r.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length);let n=t=>{process.nextTick(()=>{var n;let i=r.Status.UNAVAILABLE;t?.code===`ERR_STREAM_WRITE_AFTER_END`&&(i=r.Status.INTERNAL),t&&this.cancelWithStatus(i,`Write error: ${t.message}`),(n=e.callback)==null||n.call(e)})};this.trace(`sending data chunk of length `+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,n)}catch(e){this.endCall({code:r.Status.UNAVAILABLE,details:`Write failed with error ${e.message}`,metadata:new i.Metadata})}}halfClose(){this.trace(`end() called`),this.trace(`calling end() on HTTP/2 stream`),this.http2Stream.end()}}})),DA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Http2SubchannelConnector=void 0;let t=s(`http2`),n=s(`tls`),r=fA(),i=J(),a=wA(),o=Y(),c=KO(),l=nk(),u=Z(),d=s(`net`),f=EA(),p=pA(),m=`transport`,h=HO().version,{HTTP2_HEADER_AUTHORITY:g,HTTP2_HEADER_CONTENT_TYPE:_,HTTP2_HEADER_METHOD:v,HTTP2_HEADER_PATH:y,HTTP2_HEADER_TE:b,HTTP2_HEADER_USER_AGENT:x}=t.constants,S=Buffer.from(`too_many_pings`,`ascii`);var C=class{constructor(e,i,a,s){this.session=e,this.options=a,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,l.subchannelAddressToString)(i),a[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.streamTracker=new r.ChannelzCallTrackerStub):this.streamTracker=new r.ChannelzCallTracker,this.channelzRef=(0,r.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[a[`grpc.primary_user_agent`],`grpc-node-js/${h}`,a[`grpc.secondary_user_agent`]].filter(e=>e).join(` `),`grpc.keepalive_time_ms`in a?this.keepaliveTimeMs=a[`grpc.keepalive_time_ms`]:this.keepaliveTimeMs=-1,`grpc.keepalive_timeout_ms`in a?this.keepaliveTimeoutMs=a[`grpc.keepalive_timeout_ms`]:this.keepaliveTimeoutMs=2e4,`grpc.keepalive_permit_without_calls`in a?this.keepaliveWithoutCalls=a[`grpc.keepalive_permit_without_calls`]===1:this.keepaliveWithoutCalls=!1,e.once(`close`,()=>{this.trace(`session closed`),this.handleDisconnect()}),e.once(`goaway`,(e,n,r)=>{let i=!1;e===t.constants.NGHTTP2_ENHANCE_YOUR_CALM&&r&&r.equals(S)&&(i=!0),this.trace(`connection closed by GOAWAY with code `+e+` and data `+r?.toString()),this.reportDisconnectToOwner(i)}),e.once(`error`,e=>{this.trace(`connection closed with error `+e.message),this.handleDisconnect()}),e.socket.once(`close`,e=>{this.trace(`connection closed. hadError=`+e),this.handleDisconnect()}),o.isTracerEnabled(m)&&(e.on(`remoteSettings`,t=>{this.trace(`new settings received`+(this.session===e?``:` on the old connection`)+`: `+JSON.stringify(t))}),e.on(`localSettings`,t=>{this.trace(`local settings acknowledged by remote`+(this.session===e?``:` on the old connection`)+`: `+JSON.stringify(t))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof n.TLSSocket?this.authContext={transportSecurityType:`ssl`,sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){let e=this.session.socket,t=e.remoteAddress?(0,l.stringToSubchannelAddress)(e.remoteAddress,e.remotePort):null,n=e.localAddress?(0,l.stringToSubchannelAddress)(e.localAddress,e.localPort):null,r;if(this.session.encrypted){let t=e,n=t.getCipher(),i=t.getCertificate(),a=t.getPeerCertificate();r={cipherSuiteStandardName:n.standardName??null,cipherSuiteOtherName:n.standardName?null:n.name,localCertificate:i&&`raw`in i?i.raw:null,remoteCertificate:a&&`raw`in a?a.raw:null}}else r=null;return{remoteAddress:t,localAddress:n,security:r,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:this.session.state.localWindowSize??null,remoteFlowControlWindow:this.session.state.remoteWindowSize??null}}trace(e){o.trace(i.LogVerbosity.DEBUG,m,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}keepaliveTrace(e){o.trace(i.LogVerbosity.DEBUG,`keepalive`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}flowControlTrace(e){o.trace(i.LogVerbosity.DEBUG,`transport_flowctrl`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}internalsTrace(e){o.trace(i.LogVerbosity.DEBUG,`transport_internals`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error(`keepaliveTimeout is not null`);return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace(`Ping timeout passed without response`),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)==null||t.call(e);let n=``;try{this.session.ping((e,t,n)=>{this.clearKeepaliveTimeout(),e?(this.keepaliveTrace(`Ping failed with error `+e.message),this.handleDisconnect()):(this.keepaliveTrace(`Received ping response`),this.maybeStartKeepalivePingTimer())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}n&&(this.keepaliveTrace(`Ping send failed: `+n),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)==null||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&=(clearTimeout(this.keepaliveTimer),null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,n,r,i){let a=e.toHttp2Headers();a[g]=t,a[x]=this.userAgent,a[_]=`application/grpc`,a[v]=`POST`,a[y]=n,a[b]=`trailers`;let o;try{o=this.session.request(a)}catch(e){throw this.handleDisconnect(),e}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 s,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),s={addMessageSent:()=>{var e;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(e=i.addMessageSent)==null||e.call(i)},addMessageReceived:()=>{var e;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(e=i.addMessageReceived)==null||e.call(i)},onCallEnd:e=>{var t;(t=i.onCallEnd)==null||t.call(i,e),this.removeActiveCall(c)},onStreamEnd:e=>{var t;e?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(t=i.onStreamEnd)==null||t.call(i,e)}}):s={addMessageSent:()=>{var e;(e=i.addMessageSent)==null||e.call(i)},addMessageReceived:()=>{var e;(e=i.addMessageReceived)==null||e.call(i)},onCallEnd:e=>{var t;(t=i.onCallEnd)==null||t.call(i,e),this.removeActiveCall(c)},onStreamEnd:e=>{var t;(t=i.onStreamEnd)==null||t.call(i,e)}},c=new f.Http2SubchannelCall(o,s,r,this,(0,p.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,r.unregisterChannelzRef)(this.channelzRef)}};e.Http2SubchannelConnector=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){o.trace(i.LogVerbosity.DEBUG,m,(0,u.uriToString)(this.channelTarget)+` `+e)}createSession(e,n,r){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject(`Connection closed before starting HTTP/2 handshake`):new Promise((i,a)=>{let o=null,s=this.channelTarget;if(`grpc.http_connect_target`in r){let e=(0,u.parseUri)(r[`grpc.http_connect_target`]);e&&(s=e,o=(0,u.uriToString)(e))}let l=e.secure?`https`:`http`,d=(0,c.getDefaultAuthority)(s),f=()=>{var e;(e=this.session)==null||e.destroy(),this.session=null,setImmediate(()=>{y||(y=!0,a(`${v.trim()} (${new Date().toISOString()})`))})},p=e=>{var t;(t=this.session)==null||t.destroy(),v=e.message,this.trace(`connection failed with error `+v),y||(y=!0,a(`${v} (${new Date().toISOString()})`))},m={createConnection:(t,n)=>e.socket,settings:{initialWindowSize:r[`grpc-node.flow_control_window`]??t.getDefaultSettings?.call(t)?.initialWindowSize??65535},maxSendHeaderBlockLength:2**53-1,maxSessionMemory:r[`grpc-node.max_session_memory`]??2**53-1},h=t.connect(`${l}://${d}`,m),g=t.getDefaultSettings?.call(t)?.initialWindowSize??65535,_=r[`grpc-node.flow_control_window`];this.session=h;let v=`Failed to connect`,y=!1;h.unref(),h.once(`remoteSettings`,()=>{if(_&&_>g)try{h.setLocalWindowSize(_)}catch{let e=_-(h.state.localWindowSize??g);e>0&&h.incrementWindowSize(e)}h.removeAllListeners(),e.socket.removeListener(`close`,f),e.socket.removeListener(`error`,p),i(new C(h,n,r,o)),this.session=null}),h.once(`close`,f),h.once(`error`,p),e.socket.once(`close`,f),e.socket.once(`error`,p)})}tcpConnect(e,t){return(0,a.getProxiedConnection)(e,t).then(t=>t||new Promise((t,n)=>{let r=()=>{n(Error(`Socket closed`))},i=e=>{n(e)},a=d.connect(e,()=>{a.removeListener(`close`,r),a.removeListener(`error`,i),t(a)});a.once(`close`,r),a.once(`error`,i)}))}async connect(e,t,n){if(this.isShutdown)return Promise.reject();let r=null,i=null,a=(0,l.subchannelAddressToString)(e);try{return this.trace(a+` Waiting for secureConnector to be ready`),await t.waitForReady(),this.trace(a+` secureConnector is ready`),r=await this.tcpConnect(e,n),r.setNoDelay(),this.trace(a+` Established TCP connection`),i=await t.connect(r),this.trace(a+` Established secure connection`),this.createSession(i,e,n)}catch(e){throw r?.destroy(),i?.socket.destroy(),e}}shutdown(){var e;this.isShutdown=!0,(e=this.session)==null||e.close(),this.session=null}}})),OA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SubchannelPool=void 0,e.getSubchannelPool=c;let t=tk(),n=xA(),r=nk(),i=Z(),a=DA();var o=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let n=this.pool[t].filter(e=>!e.subchannel.unrefIfOneRef());n.length>0&&(e=!1),this.pool[t]=n}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},1e4),(t=(e=this.cleanupTimer).unref)==null||t.call(e))}getOrCreateSubchannel(e,o,s,c){this.ensureCleanupTask();let l=(0,i.uriToString)(e);if(l in this.pool){let e=this.pool[l];for(let n of e)if((0,r.subchannelAddressEqual)(o,n.subchannelAddress)&&(0,t.channelOptionsEqual)(s,n.channelArguments)&&c._equals(n.channelCredentials))return n.subchannel}let u=new n.Subchannel(e,o,s,c,new a.Http2SubchannelConnector(e));return l in this.pool||(this.pool[l]=[]),this.pool[l].push({subchannelAddress:o,channelArguments:s,channelCredentials:c,subchannel:u}),u.ref(),u}};e.SubchannelPool=o;let s=new o;function c(e){return e?s:new o}})),kA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LoadBalancingCall=void 0;let t=XO(),n=J(),r=vA(),i=X(),a=ZO(),o=Z(),c=Y(),l=_A(),u=s(`http2`);e.LoadBalancingCall=class{constructor(e,t,n,r,i,a,s){this.channel=e,this.callConfig=t,this.methodName=n,this.host=r,this.credentials=i,this.deadline=a,this.callNumber=s,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 c=this.methodName.split(`/`),l=``;c.length>=2&&(l=c[1]);let u=(0,o.splitHostPort)(this.host)?.host??`localhost`;this.serviceUrl=`https://${u}/${l}`,this.startTime=new Date}getDeadlineInfo(){let e=[];return this.childStartTime?(this.childStartTime>this.startTime&&(this.metadata?.getOptions().waitForReady&&e.push(`wait_for_ready`),e.push(`LB pick: ${(0,r.formatDateDifference)(this.startTime,this.childStartTime)}`)),e.push(...this.child.getDeadlineInfo()),e):(this.metadata?.getOptions().waitForReady&&e.push(`wait_for_ready`),e.push(`Waiting for LB pick`),e)}trace(e){c.trace(n.LogVerbosity.DEBUG,`load_balancing_call`,`[`+this.callNumber+`] `+e)}outputStatus(e,t){var n,r;if(!this.ended){this.ended=!0,this.trace(`ended with status: code=`+e.code+` details="`+e.details+`" start time=`+this.startTime.toISOString());let i=Object.assign(Object.assign({},e),{progress:t});(n=this.listener)==null||n.onReceiveStatus(i),(r=this.onCallEnded)==null||r.call(this,i.code,i.details,i.metadata)}}doPick(){if(this.ended)return;if(!this.metadata)throw Error(`doPick called before start`);this.trace(`Pick called`);let e=this.metadata.clone(),o=this.channel.doPick(e,this.callConfig.pickInformation),s=o.subchannel?`(`+o.subchannel.getChannelzRef().id+`) `+o.subchannel.getAddress():``+o.subchannel;switch(this.trace(`Pick result: `+a.PickResultType[o.pickResultType]+` subchannel: `+s+` status: `+o.status?.code+` `+o.status?.details),o.pickResultType){case a.PickResultType.COMPLETE:this.credentials.compose(o.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(a=>{var c;if(this.ended){this.trace(`Credentials metadata generation finished after call ended`);return}if(e.merge(a),e.get(`authorization`).length>1&&this.outputStatus({code:n.Status.INTERNAL,details:`"authorization" metadata cannot have multiple values`,metadata:new i.Metadata},`PROCESSED`),o.subchannel.getConnectivityState()!==t.ConnectivityState.READY){this.trace(`Picked subchannel `+s+` has state `+t.ConnectivityState[o.subchannel.getConnectivityState()]+` after getting credentials metadata. Retrying pick`),this.doPick();return}this.deadline!==1/0&&e.set(`grpc-timeout`,(0,r.getDeadlineTimeoutString)(this.deadline));try{this.child=o.subchannel.getRealSubchannel().createCall(e,this.host,this.methodName,{onReceiveMetadata:e=>{this.trace(`Received metadata`),this.listener.onReceiveMetadata(e)},onReceiveMessage:e=>{this.trace(`Received message`),this.listener.onReceiveMessage(e)},onReceiveStatus:e=>{this.trace(`Received status`),e.rstCode===u.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(e,`REFUSED`):this.outputStatus(e,`PROCESSED`)}}),this.childStartTime=new Date}catch(e){this.trace(`Failed to start call on picked subchannel `+s+` with error `+e.message),this.outputStatus({code:n.Status.INTERNAL,details:`Failed to start HTTP/2 stream with error `+e.message,metadata:new i.Metadata},`NOT_STARTED`);return}(c=o.onCallStarted)==null||c.call(o),this.onCallEnded=o.onCallEnded,this.trace(`Created child call [`+this.child.getCallNumber()+`]`),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},e=>{let{code:t,details:r}=(0,l.restrictControlPlaneStatusCode)(typeof e.code==`number`?e.code:n.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${e.message}`);this.outputStatus({code:t,details:r,metadata:new i.Metadata},`PROCESSED`)});break;case a.PickResultType.DROP:let{code:c,details:d}=(0,l.restrictControlPlaneStatusCode)(o.status.code,o.status.details);setImmediate(()=>{this.outputStatus({code:c,details:d,metadata:o.status.metadata},`DROP`)});break;case a.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:e,details:t}=(0,l.restrictControlPlaneStatusCode)(o.status.code,o.status.details);setImmediate(()=>{this.outputStatus({code:e,details:t,metadata:o.status.metadata},`PROCESSED`)})}break;case a.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var n;this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),(n=this.child)==null||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new i.Metadata},`PROCESSED`)}getPeer(){return this.child?.getPeer()??this.channel.getTarget()}start(e,t){this.trace(`start called`),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(`startRead called`),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(`halfClose called`),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw Error(`Method not implemented.`)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}}})),AA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ResolvingCall=void 0;let t=WO(),n=J(),r=vA(),i=X(),a=Y(),o=_A();e.ResolvingCall=class{constructor(e,i,a,o,s){this.channel=e,this.method=i,this.filterStackFactory=o,this.callNumber=s,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=t.CallCredentials.createEmpty(),this.deadline=a.deadline,this.host=a.host,a.parentCall&&(a.flags&n.Propagate.CANCELLATION&&a.parentCall.on(`cancelled`,()=>{this.cancelWithStatus(n.Status.CANCELLED,`Cancelled by parent call`)}),a.flags&n.Propagate.DEADLINE&&(this.trace(`Propagating deadline from parent: `+a.parentCall.getDeadline()),this.deadline=(0,r.minDeadline)(this.deadline,a.parentCall.getDeadline()))),this.trace(`Created`),this.runDeadlineTimer()}trace(e){a.trace(n.LogVerbosity.DEBUG,`resolving_call`,`[`+this.callNumber+`] `+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace(`Deadline: `+(0,r.deadlineToString)(this.deadline));let e=(0,r.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace(`Deadline will be reached in `+e+`ms`);let t=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(n.Status.DEADLINE_EXCEEDED,`Deadline exceeded`);return}let e=[],t=new Date;e.push(`Deadline exceeded after ${(0,r.formatDateDifference)(this.deadlineStartTime,t)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&e.push(`name resolution: ${(0,r.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&e.push(`metadata filters: ${(0,r.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):e.push(`waiting for metadata filters`)):e.push(`waiting for name resolution`),this.child&&e.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(n.Status.DEADLINE_EXCEEDED,e.join(`,`))};e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||=this.filterStackFactory.createFilter(),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace(`ended with status: code=`+t.code+` details="`+t.details+`"`),this.statusWatchers.forEach(e=>e(t)),process.nextTick(()=>{var e;(e=this.listener)==null||e.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw Error(`sendMessageonChild called with child not populated`);let n=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(t=>{this.writeFilterPending=!1,n.sendMessageWithContext(e,t.message),this.pendingHalfClose&&n.halfClose()},e=>{this.cancelWithStatus(e.code,e.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw Error(`getConfig called before start`);let e=this.channel.getConfig(this.method,this.metadata);if(e.type===`NONE`){this.channel.queueCallForConfig(this);return}else if(e.type===`ERROR`){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==n.Status.OK){let{code:e,details:n}=(0,o.restrictControlPlaneStatusCode)(t.status,`Failed to route call to method `+this.method);this.outputStatus({code:e,details:n,metadata:new i.Metadata});return}if(t.methodConfig.timeout){let e=new Date;e.setSeconds(e.getSeconds()+t.methodConfig.timeout.seconds),e.setMilliseconds(e.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,r.minDeadline)(this.deadline,e),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(e=>{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace(`Created child [`+this.child.getCallNumber()+`]`),this.childStartTime=new Date,this.child.start(e,{onReceiveMetadata:e=>{this.trace(`Received metadata`),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(e))},onReceiveMessage:e=>{this.trace(`Received message`),this.readFilterPending=!0,this.filterStack.receiveMessage(e).then(e=>{this.trace(`Finished filtering received message`),this.readFilterPending=!1,this.listener.onReceiveMessage(e),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},e=>{this.cancelWithStatus(e.code,e.details)})},onReceiveStatus:e=>{this.trace(`Received status`),this.readFilterPending?this.pendingChildStatus=e:this.outputStatus(e)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},e=>{this.outputStatus(e)})}reportResolverError(e){this.metadata?.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var n;this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),(n=this.child)==null||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new i.Metadata})}getPeer(){return this.child?.getPeer()??this.channel.getTarget()}start(e,t){this.trace(`start called`),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(`startRead called`),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(`halfClose called`),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}}})),jA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RetryingCall=e.MessageBufferTracker=e.RetryThrottler=void 0;let t=J(),n=vA(),r=X(),i=Y();e.RetryThrottler=class{constructor(e,t,n){this.maxTokens=e,this.tokenRatio=t,n?this.tokens=n.tokens*(e/n.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}},e.MessageBufferTracker=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){let n=this.allocatedPerCall.get(t)??0;return this.limitPerCall-n<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,n+e),this.totalAllocated+=e,!0)}free(e,t){if(this.totalAllocated<e)throw Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let n=this.allocatedPerCall.get(t)??0;if(n<e)throw Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${n}`);this.allocatedPerCall.set(t,n-e)}freeAll(e){let t=this.allocatedPerCall.get(e)??0;if(this.totalAllocated<t)throw Error(`Invalid buffer allocation state: call ${e} allocated ${t} > total allocated ${this.totalAllocated}`);this.totalAllocated-=t,this.allocatedPerCall.delete(e)}};let a=`grpc-previous-rpc-attempts`;e.RetryingCall=class{constructor(e,t,n,r,i,a,o,s,c){this.channel=e,this.callConfig=t,this.methodName=n,this.host=r,this.credentials=i,this.deadline=a,this.callNumber=o,this.bufferTracker=s,this.retryThrottler=c,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 l=e.getOptions()[`grpc-node.retry_max_attempts_limit`]??5;if(e.getOptions()[`grpc.enable_retries`]===0)this.state=`NO_RETRY`,this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state=`RETRY`;let e=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(e.initialBackoff.substring(0,e.initialBackoff.length-1)),this.maxAttempts=Math.min(e.maxAttempts,l)}else t.methodConfig.hedgingPolicy?(this.state=`HEDGING`,this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,l)):(this.state=`TRANSPARENT_ONLY`,this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,n.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){i.trace(t.LogVerbosity.DEBUG,`retrying_call`,`[`+this.callNumber+`] `+e)}reportStatus(e){this.trace(`ended with status: code=`+e.code+` details="`+e.details+`" start time=`+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset+=this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;(t=this.listener)==null||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),this.reportStatus({code:e,details:t,metadata:new r.Metadata});for(let{call:n}of this.underlyingCalls)n.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex===null?`unknown`:this.underlyingCalls[this.committedCallIndex].call.getPeer()}getBufferEntry(e){return this.writeBuffer[e-this.writeBufferOffset]??{entryType:`FREED`,allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!==`COMMITTED`)return;let e;e=this.underlyingCalls[this.committedCallIndex].state===`COMPLETED`?this.getNextBufferIndex():this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let e=this.getBufferEntry(t);e.allocated&&this.bufferTracker.free(e.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var n,r;if(this.state!==`COMMITTED`){this.trace(`Committing call [`+this.underlyingCalls[e].call.getCallNumber()+`] at index `+e),this.state=`COMMITTED`,(r=(n=this.callConfig).onCommitted)==null||r.call(n),this.committedCallIndex=e;for(let n=0;n<this.underlyingCalls.length;n++)n!==e&&this.underlyingCalls[n].state!==`COMPLETED`&&(this.underlyingCalls[n].state=`COMPLETED`,this.underlyingCalls[n].call.cancelWithStatus(t.Status.CANCELLED,`Discarded in favor of other hedged attempt`));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state===`COMMITTED`)return;let e=-1,t=-1;for(let[n,r]of this.underlyingCalls.entries())r.state===`ACTIVE`&&r.nextMessageToSend>e&&(e=r.nextMessageToSend,t=n);t===-1?this.state=`TRANSPARENT_ONLY`:this.commitCall(t)}isStatusCodeInList(e,n){return e.some(e=>e===n||e.toString().toLowerCase()===t.Status[n]?.toLowerCase())}getNextRetryJitter(){return Math.random()*.3999999999999999+.8}getNextRetryBackoffMs(){let e=this.callConfig?.methodConfig.retryPolicy;if(!e)return 0;let t=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,n=Number(e.maxBackoff.substring(0,e.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*e.backoffMultiplier,n),t}maybeRetryCall(e,t){if(this.state!==`RETRY`){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let n;if(e===null)n=this.getNextRetryBackoffMs();else if(e<0){this.state=`TRANSPARENT_ONLY`,t(!1);return}else n=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{if(this.state!==`RETRY`){t(!1);return}this.retryThrottler?.canRetryCall()??!0?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace(`Retry attempt denied by throttling policy`),t(!1))},n)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)t?.state===`ACTIVE`&&(e+=1);return e}handleProcessedStatus(e,t,n){var r,i;switch(this.state){case`COMMITTED`:case`NO_RETRY`:case`TRANSPARENT_ONLY`:this.commitCall(t),this.reportStatus(e);break;case`HEDGING`:if(this.isStatusCodeInList(this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes??[],e.code)){(r=this.retryThrottler)==null||r.addCallFailed();let i;if(n===null)i=0;else if(n<0){this.state=`TRANSPARENT_ONLY`,this.commitCall(t),this.reportStatus(e);return}else i=n;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},i)}else this.commitCall(t),this.reportStatus(e);break;case`RETRY`:this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)==null||i.addCallFailed(),this.maybeRetryCall(n,n=>{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get(`grpc-retry-pushback-ms`);if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,n){var r;if(this.underlyingCalls[n].state===`COMPLETED`)return;if(this.trace(`state=`+this.state+` handling status with progress `+e.progress+` from child [`+this.underlyingCalls[n].call.getCallNumber()+`] in state `+this.underlyingCalls[n].state),this.underlyingCalls[n].state=`COMPLETED`,e.code===t.Status.OK){(r=this.retryThrottler)==null||r.addCallSucceeded(),this.commitCall(n),this.reportStatus(e);return}if(this.state===`NO_RETRY`){this.commitCall(n),this.reportStatus(e);return}if(this.state===`COMMITTED`){this.reportStatus(e);return}let i=this.getPushback(e.metadata);switch(e.progress){case`NOT_STARTED`:this.startNewAttempt();break;case`REFUSED`:this.transparentRetryUsed?this.handleProcessedStatus(e,n,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case`DROP`:this.commitCall(n),this.reportStatus(e);break;case`PROCESSED`:this.handleProcessedStatus(e,n,i);break}}maybeStartHedgingAttempt(){this.state===`HEDGING`&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!==`HEDGING`||!this.callConfig.methodConfig.hedgingPolicy)return;let n=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let r=n.hedgingDelay??`0s`,i=Number(r.substring(0,r.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},i*1e3),(t=(e=this.hedgingTimer).unref)==null||t.call(e)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace(`Created child call [`+e.getCallNumber()+`] for attempt `+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:`ACTIVE`,call:e,nextMessageToSend:0,startTime:new Date});let n=this.attempts-1,r=this.initialMetadata.clone();n>0&&r.set(a,`${n}`);let i=!1;e.start(r,{onReceiveMetadata:r=>{this.trace(`Received metadata from child [`+e.getCallNumber()+`]`),this.commitCall(t),i=!0,n>0&&r.set(a,`${n}`),this.underlyingCalls[t].state===`ACTIVE`&&this.listener.onReceiveMetadata(r)},onReceiveMessage:n=>{this.trace(`Received message from child [`+e.getCallNumber()+`]`),this.commitCall(t),this.underlyingCalls[t].state===`ACTIVE`&&this.listener.onReceiveMessage(n)},onReceiveStatus:r=>{this.trace(`Received status from child [`+e.getCallNumber()+`]`),!i&&n>0&&r.metadata.set(a,`${n}`),this.handleChildStatus(r,t)}}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace(`start called`),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e,t){var n,r;(r=(n=this.getBufferEntry(t)).callback)==null||r.call(n),this.clearSentMessages();let i=this.underlyingCalls[e];i.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state===`COMPLETED`)return;let n=t.nextMessageToSend;if(this.getBufferEntry(n)){let r=this.getBufferEntry(n);switch(r.entryType){case`MESSAGE`:t.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,n)}},r.message.message),this.getBufferEntry(n+1).entryType===`HALF_CLOSE`&&(this.trace(`Sending halfClose immediately after message to child [`+t.call.getCallNumber()+`] - optimizing for unary/final message`),t.nextMessageToSend+=1,t.call.halfClose());break;case`HALF_CLOSE`:t.nextMessageToSend+=1,t.call.halfClose();break;case`FREED`:break}}}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length);let n={message:t,flags:e.flags},r=this.getNextBufferIndex(),i={entryType:`MESSAGE`,message:n,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){process.nextTick(()=>{var t;(t=e.callback)==null||t.call(e)});for(let[e,n]of this.underlyingCalls.entries())n.state===`ACTIVE`&&n.nextMessageToSend===r&&n.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,r)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state===`ACTIVE`&&n.nextMessageToSend===r&&n.call.sendMessageWithContext({callback:e=>{this.handleChildWriteCompleted(this.committedCallIndex,r)}},t)}}startRead(){this.trace(`startRead called`),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state===`ACTIVE`&&e.call.startRead()}halfClose(){this.trace(`halfClose called`);let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:`HALF_CLOSE`,allocated:!1});for(let t of this.underlyingCalls)t?.state===`ACTIVE`&&(t.nextMessageToSend===e||t.nextMessageToSend===e-1)&&(this.trace(`Sending halfClose immediately to child [`+t.call.getCallNumber()+`] - all messages already sent`),t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw Error(`Method not implemented.`)}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){return this.committedCallIndex===null?null:this.underlyingCalls[this.committedCallIndex].call.getAuthContext()}}})),MA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseSubchannelWrapper=void 0,e.BaseSubchannelWrapper=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,e.addHealthStateWatcher(e=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref(),this.refcount+=1}unref(){this.child.unref(),--this.refcount,this.refcount===0&&this.destroy()}destroy(){for(let e of this.dataWatchers)e.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}addDataWatcher(e){e.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}}})),NA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InternalChannel=e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;let t=qO(),n=ek(),r=OA(),i=ZO(),a=X(),o=J(),s=yA(),c=gA(),l=KO(),u=Y(),d=wA(),f=Z(),p=XO(),m=fA(),h=kA(),g=vA(),_=AA(),v=pA(),y=_A(),b=jA(),x=MA(),S=new Map;var C=class extends x.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(e,n,r,i)=>{t.throttleKeepalive(i)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),--this.refCount,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},w=class{pick(e){return{pickResultType:i.PickResultType.DROP,status:{code:o.Status.UNAVAILABLE,details:`Channel closed before call started`,metadata:new a.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=`grpc.internal.no_subchannel`;var T=class{constructor(e){this.target=e,this.trace=new m.ChannelzTrace,this.callTracker=new m.ChannelzCallTracker,this.childrenTracker=new m.ChannelzChildrenTracker,this.state=p.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}};e.InternalChannel=class{constructor(a,h,g){if(this.credentials=h,this.options=g,this.connectivityState=p.ConnectivityState.IDLE,this.currentPicker=new i.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()*(2**53-1)),typeof a!=`string`)throw TypeError(`Channel target must be a string`);if(!(h instanceof t.ChannelCredentials))throw TypeError(`Channel credentials must be a ChannelCredentials object`);if(g&&typeof g!=`object`)throw TypeError(`Channel options must be an object`);this.channelzInfoTracker=new T(a);let _=(0,f.parseUri)(a);if(_===null)throw Error(`Could not parse target name "${a}"`);let v=(0,l.mapUriDefaultScheme)(_);if(v===null)throw Error(`Could not find a default scheme for target name "${a}"`);this.options[`grpc.enable_channelz`]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,m.registerChannelzChannel)(a,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Channel created`),this.options[`grpc.default_authority`]?this.defaultAuthority=this.options[`grpc.default_authority`]:this.defaultAuthority=(0,l.getDefaultAuthority)(v);let x=(0,d.mapProxyName)(v,g);this.target=x.target,this.options=Object.assign({},this.options,x.extraOptions),this.subchannelPool=(0,r.getSubchannelPool)((this.options[`grpc.use_local_subchannel_pool`]??0)===0),this.retryBufferTracker=new b.MessageBufferTracker(this.options[`grpc.retry_buffer_size`]??16777216,this.options[`grpc.per_rpc_retry_buffer_size`]??1048576),this.keepaliveTime=this.options[`grpc.keepalive_time_ms`]??-1,this.idleTimeoutMs=Math.max(this.options[`grpc.client_idle_timeout_ms`]??18e5,1e3);let w={createSubchannel:(t,n)=>{let r={};for(let[t,i]of Object.entries(n))t.startsWith(e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(r[t]=i);let i=this.subchannelPool.getOrCreateSubchannel(this.target,t,r,this.credentials);return i.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Created subchannel or used existing subchannel`,i.getChannelzRef()),new C(i,this)},updateState:(e,t)=>{this.currentPicker=t;let n=this.pickQueue.slice();this.pickQueue=[],n.length>0&&this.callRefTimerUnref();for(let e of n)e.doPick();this.updateState(e)},requestReresolution:()=>{throw Error(`Resolving load balancer should never call requestReresolution`)},addChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(e)},removeChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(e)}};this.resolvingLoadBalancer=new n.ResolvingLoadBalancer(this.target,w,this.options,(e,t)=>{var n;e.retryThrottling?S.set(this.getTarget(),new b.RetryThrottler(e.retryThrottling.maxTokens,e.retryThrottling.tokenRatio,S.get(this.getTarget()))):S.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Address resolution succeeded`),(n=this.configSelector)==null||n.unref(),this.configSelector=t,this.currentResolutionError=null,process.nextTick(()=>{let e=this.configSelectionQueue;this.configSelectionQueue=[],e.length>0&&this.callRefTimerUnref();for(let t of e)t.getConfig()})},e=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_WARNING`,`Address resolution failed with code `+e.code+` and details "`+e.details+`"`),this.configSelectionQueue.length>0&&this.trace(`Name resolution failed with calls queued for config selection`),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,y.restrictControlPlaneStatusCode)(e.code,e.details)),{metadata:e.metadata}));let t=this.configSelectionQueue;this.configSelectionQueue=[],t.length>0&&this.callRefTimerUnref();for(let n of t)n.reportResolverError(e)}),this.filterStackFactory=new s.FilterStackFactory([new c.CompressionFilterFactory(this,this.options)]),this.trace(`Channel constructed with options `+JSON.stringify(g,void 0,2));let E=Error();(0,u.isTracerEnabled)(`channel_stacktrace`)&&(0,u.trace)(o.LogVerbosity.DEBUG,`channel_stacktrace`,`(`+this.channelzRef.id+`) Channel constructed
117
+ `+t);let n;try{n=i.Metadata.fromHttp2Headers(e)}catch{n=new i.Metadata}let a=n.getMap(),o;if(typeof a[`grpc-status`]==`string`){let e=Number(a[`grpc-status`]);this.trace(`received status code `+e+` from server`),n.remove(`grpc-status`);let t=``;if(typeof a[`grpc-message`]==`string`){try{t=decodeURI(a[`grpc-message`])}catch{t=a[`grpc-message`]}n.remove(`grpc-message`),this.trace(`received status details string "`+t+`" from server`)}o={code:e,details:t,metadata:n}}else this.httpStatusCode?(o=u(this.httpStatusCode),o.metadata=n):o={code:r.Status.UNKNOWN,details:`No status information received`,metadata:n};this.endCall(o)}destroyHttp2Stream(){if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let e;e=this.finalStatus?.code===r.Status.OK?t.constants.NGHTTP2_NO_ERROR:t.constants.NGHTTP2_CANCEL,this.trace(`close http2 stream with code `+e),this.http2Stream.close(e)}}cancelWithStatus(e,t){this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),this.endCall({code:e,details:t,metadata:new i.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!==r.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length);let n=t=>{process.nextTick(()=>{var n;let i=r.Status.UNAVAILABLE;t?.code===`ERR_STREAM_WRITE_AFTER_END`&&(i=r.Status.INTERNAL),t&&this.cancelWithStatus(i,`Write error: ${t.message}`),(n=e.callback)==null||n.call(e)})};this.trace(`sending data chunk of length `+t.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(t,n)}catch(e){this.endCall({code:r.Status.UNAVAILABLE,details:`Write failed with error ${e.message}`,metadata:new i.Metadata})}}halfClose(){this.trace(`end() called`),this.trace(`calling end() on HTTP/2 stream`),this.http2Stream.end()}}})),OA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Http2SubchannelConnector=void 0;let t=s(`http2`),n=s(`tls`),r=pA(),i=J(),a=TA(),o=Y(),c=qO(),l=rk(),u=Z(),d=s(`net`),f=DA(),p=mA(),m=`transport`,h=UO().version,{HTTP2_HEADER_AUTHORITY:g,HTTP2_HEADER_CONTENT_TYPE:_,HTTP2_HEADER_METHOD:v,HTTP2_HEADER_PATH:y,HTTP2_HEADER_TE:b,HTTP2_HEADER_USER_AGENT:x}=t.constants,S=Buffer.from(`too_many_pings`,`ascii`);var C=class{constructor(e,i,a,s){this.session=e,this.options=a,this.remoteName=s,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,l.subchannelAddressToString)(i),a[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.streamTracker=new r.ChannelzCallTrackerStub):this.streamTracker=new r.ChannelzCallTracker,this.channelzRef=(0,r.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[a[`grpc.primary_user_agent`],`grpc-node-js/${h}`,a[`grpc.secondary_user_agent`]].filter(e=>e).join(` `),`grpc.keepalive_time_ms`in a?this.keepaliveTimeMs=a[`grpc.keepalive_time_ms`]:this.keepaliveTimeMs=-1,`grpc.keepalive_timeout_ms`in a?this.keepaliveTimeoutMs=a[`grpc.keepalive_timeout_ms`]:this.keepaliveTimeoutMs=2e4,`grpc.keepalive_permit_without_calls`in a?this.keepaliveWithoutCalls=a[`grpc.keepalive_permit_without_calls`]===1:this.keepaliveWithoutCalls=!1,e.once(`close`,()=>{this.trace(`session closed`),this.handleDisconnect()}),e.once(`goaway`,(e,n,r)=>{let i=!1;e===t.constants.NGHTTP2_ENHANCE_YOUR_CALM&&r&&r.equals(S)&&(i=!0),this.trace(`connection closed by GOAWAY with code `+e+` and data `+r?.toString()),this.reportDisconnectToOwner(i)}),e.once(`error`,e=>{this.trace(`connection closed with error `+e.message),this.handleDisconnect()}),e.socket.once(`close`,e=>{this.trace(`connection closed. hadError=`+e),this.handleDisconnect()}),o.isTracerEnabled(m)&&(e.on(`remoteSettings`,t=>{this.trace(`new settings received`+(this.session===e?``:` on the old connection`)+`: `+JSON.stringify(t))}),e.on(`localSettings`,t=>{this.trace(`local settings acknowledged by remote`+(this.session===e?``:` on the old connection`)+`: `+JSON.stringify(t))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof n.TLSSocket?this.authContext={transportSecurityType:`ssl`,sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){let e=this.session.socket,t=e.remoteAddress?(0,l.stringToSubchannelAddress)(e.remoteAddress,e.remotePort):null,n=e.localAddress?(0,l.stringToSubchannelAddress)(e.localAddress,e.localPort):null,r;if(this.session.encrypted){let t=e,n=t.getCipher(),i=t.getCertificate(),a=t.getPeerCertificate();r={cipherSuiteStandardName:n.standardName??null,cipherSuiteOtherName:n.standardName?null:n.name,localCertificate:i&&`raw`in i?i.raw:null,remoteCertificate:a&&`raw`in a?a.raw:null}}else r=null;return{remoteAddress:t,localAddress:n,security:r,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:this.session.state.localWindowSize??null,remoteFlowControlWindow:this.session.state.remoteWindowSize??null}}trace(e){o.trace(i.LogVerbosity.DEBUG,m,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}keepaliveTrace(e){o.trace(i.LogVerbosity.DEBUG,`keepalive`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}flowControlTrace(e){o.trace(i.LogVerbosity.DEBUG,`transport_flowctrl`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}internalsTrace(e){o.trace(i.LogVerbosity.DEBUG,`transport_internals`,`(`+this.channelzRef.id+`) `+this.subchannelAddressString+` `+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(t=>t(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,t;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error(`keepaliveTimeout is not null`);return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace(`Ping timeout passed without response`),this.handleDisconnect()},this.keepaliveTimeoutMs),(t=(e=this.keepaliveTimer).unref)==null||t.call(e);let n=``;try{this.session.ping((e,t,n)=>{this.clearKeepaliveTimeout(),e?(this.keepaliveTrace(`Ping failed with error `+e.message),this.handleDisconnect()):(this.keepaliveTrace(`Received ping response`),this.maybeStartKeepalivePingTimer())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}n&&(this.keepaliveTrace(`Ping send failed: `+n),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,t;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(t=(e=this.keepaliveTimer).unref)==null||t.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&=(clearTimeout(this.keepaliveTimer),null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,t,n,r,i){let a=e.toHttp2Headers();a[g]=t,a[x]=this.userAgent,a[_]=`application/grpc`,a[v]=`POST`,a[y]=n,a[b]=`trailers`;let o;try{o=this.session.request(a)}catch(e){throw this.handleDisconnect(),e}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 s,c;return this.channelzEnabled?(this.streamTracker.addCallStarted(),s={addMessageSent:()=>{var e;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(e=i.addMessageSent)==null||e.call(i)},addMessageReceived:()=>{var e;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(e=i.addMessageReceived)==null||e.call(i)},onCallEnd:e=>{var t;(t=i.onCallEnd)==null||t.call(i,e),this.removeActiveCall(c)},onStreamEnd:e=>{var t;e?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(t=i.onStreamEnd)==null||t.call(i,e)}}):s={addMessageSent:()=>{var e;(e=i.addMessageSent)==null||e.call(i)},addMessageReceived:()=>{var e;(e=i.addMessageReceived)==null||e.call(i)},onCallEnd:e=>{var t;(t=i.onCallEnd)==null||t.call(i,e),this.removeActiveCall(c)},onStreamEnd:e=>{var t;(t=i.onStreamEnd)==null||t.call(i,e)}},c=new f.Http2SubchannelCall(o,s,r,this,(0,p.getNextCallNumber)()),this.addActiveCall(c),c}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,r.unregisterChannelzRef)(this.channelzRef)}};e.Http2SubchannelConnector=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){o.trace(i.LogVerbosity.DEBUG,m,(0,u.uriToString)(this.channelTarget)+` `+e)}createSession(e,n,r){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject(`Connection closed before starting HTTP/2 handshake`):new Promise((i,a)=>{let o=null,s=this.channelTarget;if(`grpc.http_connect_target`in r){let e=(0,u.parseUri)(r[`grpc.http_connect_target`]);e&&(s=e,o=(0,u.uriToString)(e))}let l=e.secure?`https`:`http`,d=(0,c.getDefaultAuthority)(s),f=()=>{var e;(e=this.session)==null||e.destroy(),this.session=null,setImmediate(()=>{y||(y=!0,a(`${v.trim()} (${new Date().toISOString()})`))})},p=e=>{var t;(t=this.session)==null||t.destroy(),v=e.message,this.trace(`connection failed with error `+v),y||(y=!0,a(`${v} (${new Date().toISOString()})`))},m={createConnection:(t,n)=>e.socket,settings:{initialWindowSize:r[`grpc-node.flow_control_window`]??t.getDefaultSettings?.call(t)?.initialWindowSize??65535},maxSendHeaderBlockLength:2**53-1,maxSessionMemory:r[`grpc-node.max_session_memory`]??2**53-1},h=t.connect(`${l}://${d}`,m),g=t.getDefaultSettings?.call(t)?.initialWindowSize??65535,_=r[`grpc-node.flow_control_window`];this.session=h;let v=`Failed to connect`,y=!1;h.unref(),h.once(`remoteSettings`,()=>{if(_&&_>g)try{h.setLocalWindowSize(_)}catch{let e=_-(h.state.localWindowSize??g);e>0&&h.incrementWindowSize(e)}h.removeAllListeners(),e.socket.removeListener(`close`,f),e.socket.removeListener(`error`,p),i(new C(h,n,r,o)),this.session=null}),h.once(`close`,f),h.once(`error`,p),e.socket.once(`close`,f),e.socket.once(`error`,p)})}tcpConnect(e,t){return(0,a.getProxiedConnection)(e,t).then(t=>t||new Promise((t,n)=>{let r=()=>{n(Error(`Socket closed`))},i=e=>{n(e)},a=d.connect(e,()=>{a.removeListener(`close`,r),a.removeListener(`error`,i),t(a)});a.once(`close`,r),a.once(`error`,i)}))}async connect(e,t,n){if(this.isShutdown)return Promise.reject();let r=null,i=null,a=(0,l.subchannelAddressToString)(e);try{return this.trace(a+` Waiting for secureConnector to be ready`),await t.waitForReady(),this.trace(a+` secureConnector is ready`),r=await this.tcpConnect(e,n),r.setNoDelay(),this.trace(a+` Established TCP connection`),i=await t.connect(r),this.trace(a+` Established secure connection`),this.createSession(i,e,n)}catch(e){throw r?.destroy(),i?.socket.destroy(),e}}shutdown(){var e;this.isShutdown=!0,(e=this.session)==null||e.close(),this.session=null}}})),kA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SubchannelPool=void 0,e.getSubchannelPool=c;let t=nk(),n=SA(),r=rk(),i=Z(),a=OA();var o=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let t in this.pool){let n=this.pool[t].filter(e=>!e.subchannel.unrefIfOneRef());n.length>0&&(e=!1),this.pool[t]=n}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,t;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},1e4),(t=(e=this.cleanupTimer).unref)==null||t.call(e))}getOrCreateSubchannel(e,o,s,c){this.ensureCleanupTask();let l=(0,i.uriToString)(e);if(l in this.pool){let e=this.pool[l];for(let n of e)if((0,r.subchannelAddressEqual)(o,n.subchannelAddress)&&(0,t.channelOptionsEqual)(s,n.channelArguments)&&c._equals(n.channelCredentials))return n.subchannel}let u=new n.Subchannel(e,o,s,c,new a.Http2SubchannelConnector(e));return l in this.pool||(this.pool[l]=[]),this.pool[l].push({subchannelAddress:o,channelArguments:s,channelCredentials:c,subchannel:u}),u.ref(),u}};e.SubchannelPool=o;let s=new o;function c(e){return e?s:new o}})),AA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LoadBalancingCall=void 0;let t=ZO(),n=J(),r=yA(),i=X(),a=QO(),o=Z(),c=Y(),l=vA(),u=s(`http2`);e.LoadBalancingCall=class{constructor(e,t,n,r,i,a,s){this.channel=e,this.callConfig=t,this.methodName=n,this.host=r,this.credentials=i,this.deadline=a,this.callNumber=s,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 c=this.methodName.split(`/`),l=``;c.length>=2&&(l=c[1]);let u=(0,o.splitHostPort)(this.host)?.host??`localhost`;this.serviceUrl=`https://${u}/${l}`,this.startTime=new Date}getDeadlineInfo(){let e=[];return this.childStartTime?(this.childStartTime>this.startTime&&(this.metadata?.getOptions().waitForReady&&e.push(`wait_for_ready`),e.push(`LB pick: ${(0,r.formatDateDifference)(this.startTime,this.childStartTime)}`)),e.push(...this.child.getDeadlineInfo()),e):(this.metadata?.getOptions().waitForReady&&e.push(`wait_for_ready`),e.push(`Waiting for LB pick`),e)}trace(e){c.trace(n.LogVerbosity.DEBUG,`load_balancing_call`,`[`+this.callNumber+`] `+e)}outputStatus(e,t){var n,r;if(!this.ended){this.ended=!0,this.trace(`ended with status: code=`+e.code+` details="`+e.details+`" start time=`+this.startTime.toISOString());let i=Object.assign(Object.assign({},e),{progress:t});(n=this.listener)==null||n.onReceiveStatus(i),(r=this.onCallEnded)==null||r.call(this,i.code,i.details,i.metadata)}}doPick(){if(this.ended)return;if(!this.metadata)throw Error(`doPick called before start`);this.trace(`Pick called`);let e=this.metadata.clone(),o=this.channel.doPick(e,this.callConfig.pickInformation),s=o.subchannel?`(`+o.subchannel.getChannelzRef().id+`) `+o.subchannel.getAddress():``+o.subchannel;switch(this.trace(`Pick result: `+a.PickResultType[o.pickResultType]+` subchannel: `+s+` status: `+o.status?.code+` `+o.status?.details),o.pickResultType){case a.PickResultType.COMPLETE:this.credentials.compose(o.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(a=>{var c;if(this.ended){this.trace(`Credentials metadata generation finished after call ended`);return}if(e.merge(a),e.get(`authorization`).length>1&&this.outputStatus({code:n.Status.INTERNAL,details:`"authorization" metadata cannot have multiple values`,metadata:new i.Metadata},`PROCESSED`),o.subchannel.getConnectivityState()!==t.ConnectivityState.READY){this.trace(`Picked subchannel `+s+` has state `+t.ConnectivityState[o.subchannel.getConnectivityState()]+` after getting credentials metadata. Retrying pick`),this.doPick();return}this.deadline!==1/0&&e.set(`grpc-timeout`,(0,r.getDeadlineTimeoutString)(this.deadline));try{this.child=o.subchannel.getRealSubchannel().createCall(e,this.host,this.methodName,{onReceiveMetadata:e=>{this.trace(`Received metadata`),this.listener.onReceiveMetadata(e)},onReceiveMessage:e=>{this.trace(`Received message`),this.listener.onReceiveMessage(e)},onReceiveStatus:e=>{this.trace(`Received status`),e.rstCode===u.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(e,`REFUSED`):this.outputStatus(e,`PROCESSED`)}}),this.childStartTime=new Date}catch(e){this.trace(`Failed to start call on picked subchannel `+s+` with error `+e.message),this.outputStatus({code:n.Status.INTERNAL,details:`Failed to start HTTP/2 stream with error `+e.message,metadata:new i.Metadata},`NOT_STARTED`);return}(c=o.onCallStarted)==null||c.call(o),this.onCallEnded=o.onCallEnded,this.trace(`Created child call [`+this.child.getCallNumber()+`]`),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},e=>{let{code:t,details:r}=(0,l.restrictControlPlaneStatusCode)(typeof e.code==`number`?e.code:n.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${e.message}`);this.outputStatus({code:t,details:r,metadata:new i.Metadata},`PROCESSED`)});break;case a.PickResultType.DROP:let{code:c,details:d}=(0,l.restrictControlPlaneStatusCode)(o.status.code,o.status.details);setImmediate(()=>{this.outputStatus({code:c,details:d,metadata:o.status.metadata},`DROP`)});break;case a.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:e,details:t}=(0,l.restrictControlPlaneStatusCode)(o.status.code,o.status.details);setImmediate(()=>{this.outputStatus({code:e,details:t,metadata:o.status.metadata},`PROCESSED`)})}break;case a.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,t){var n;this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),(n=this.child)==null||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new i.Metadata},`PROCESSED`)}getPeer(){return this.child?.getPeer()??this.channel.getTarget()}start(e,t){this.trace(`start called`),this.listener=t,this.metadata=e,this.doPick()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length),this.child?this.child.sendMessageWithContext(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(`startRead called`),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(`halfClose called`),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw Error(`Method not implemented.`)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}}})),jA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ResolvingCall=void 0;let t=GO(),n=J(),r=yA(),i=X(),a=Y(),o=vA();e.ResolvingCall=class{constructor(e,i,a,o,s){this.channel=e,this.method=i,this.filterStackFactory=o,this.callNumber=s,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=t.CallCredentials.createEmpty(),this.deadline=a.deadline,this.host=a.host,a.parentCall&&(a.flags&n.Propagate.CANCELLATION&&a.parentCall.on(`cancelled`,()=>{this.cancelWithStatus(n.Status.CANCELLED,`Cancelled by parent call`)}),a.flags&n.Propagate.DEADLINE&&(this.trace(`Propagating deadline from parent: `+a.parentCall.getDeadline()),this.deadline=(0,r.minDeadline)(this.deadline,a.parentCall.getDeadline()))),this.trace(`Created`),this.runDeadlineTimer()}trace(e){a.trace(n.LogVerbosity.DEBUG,`resolving_call`,`[`+this.callNumber+`] `+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace(`Deadline: `+(0,r.deadlineToString)(this.deadline));let e=(0,r.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace(`Deadline will be reached in `+e+`ms`);let t=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(n.Status.DEADLINE_EXCEEDED,`Deadline exceeded`);return}let e=[],t=new Date;e.push(`Deadline exceeded after ${(0,r.formatDateDifference)(this.deadlineStartTime,t)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&e.push(`name resolution: ${(0,r.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&e.push(`metadata filters: ${(0,r.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):e.push(`waiting for metadata filters`)):e.push(`waiting for name resolution`),this.child&&e.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(n.Status.DEADLINE_EXCEEDED,e.join(`,`))};e<=0?process.nextTick(t):this.deadlineTimer=setTimeout(t,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||=this.filterStackFactory.createFilter(),clearTimeout(this.deadlineTimer);let t=this.filterStack.receiveTrailers(e);this.trace(`ended with status: code=`+t.code+` details="`+t.details+`"`),this.statusWatchers.forEach(e=>e(t)),process.nextTick(()=>{var e;(e=this.listener)==null||e.onReceiveStatus(t)})}}sendMessageOnChild(e,t){if(!this.child)throw Error(`sendMessageonChild called with child not populated`);let n=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:t,flags:e.flags})).then(t=>{this.writeFilterPending=!1,n.sendMessageWithContext(e,t.message),this.pendingHalfClose&&n.halfClose()},e=>{this.cancelWithStatus(e.code,e.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw Error(`getConfig called before start`);let e=this.channel.getConfig(this.method,this.metadata);if(e.type===`NONE`){this.channel.queueCallForConfig(this);return}else if(e.type===`ERROR`){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let t=e.config;if(t.status!==n.Status.OK){let{code:e,details:n}=(0,o.restrictControlPlaneStatusCode)(t.status,`Failed to route call to method `+this.method);this.outputStatus({code:e,details:n,metadata:new i.Metadata});return}if(t.methodConfig.timeout){let e=new Date;e.setSeconds(e.getSeconds()+t.methodConfig.timeout.seconds),e.setMilliseconds(e.getMilliseconds()+t.methodConfig.timeout.nanos/1e6),this.deadline=(0,r.minDeadline)(this.deadline,e),this.runDeadlineTimer()}this.filterStackFactory.push(t.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(e=>{this.child=this.channel.createRetryingCall(t,this.method,this.host,this.credentials,this.deadline),this.trace(`Created child [`+this.child.getCallNumber()+`]`),this.childStartTime=new Date,this.child.start(e,{onReceiveMetadata:e=>{this.trace(`Received metadata`),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(e))},onReceiveMessage:e=>{this.trace(`Received message`),this.readFilterPending=!0,this.filterStack.receiveMessage(e).then(e=>{this.trace(`Finished filtering received message`),this.readFilterPending=!1,this.listener.onReceiveMessage(e),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},e=>{this.cancelWithStatus(e.code,e.details)})},onReceiveStatus:e=>{this.trace(`Received status`),this.readFilterPending?this.pendingChildStatus=e:this.outputStatus(e)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},e=>{this.outputStatus(e)})}reportResolverError(e){this.metadata?.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,t){var n;this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),(n=this.child)==null||n.cancelWithStatus(e,t),this.outputStatus({code:e,details:t,metadata:new i.Metadata})}getPeer(){return this.child?.getPeer()??this.channel.getTarget()}start(e,t){this.trace(`start called`),this.metadata=e.clone(),this.listener=t,this.getConfig()}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length),this.child?this.sendMessageOnChild(e,t):this.pendingMessage={context:e,message:t}}startRead(){this.trace(`startRead called`),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace(`halfClose called`),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}}})),MA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RetryingCall=e.MessageBufferTracker=e.RetryThrottler=void 0;let t=J(),n=yA(),r=X(),i=Y();e.RetryThrottler=class{constructor(e,t,n){this.maxTokens=e,this.tokenRatio=t,n?this.tokens=n.tokens*(e/n.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}},e.MessageBufferTracker=class{constructor(e,t){this.totalLimit=e,this.limitPerCall=t,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,t){let n=this.allocatedPerCall.get(t)??0;return this.limitPerCall-n<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(t,n+e),this.totalAllocated+=e,!0)}free(e,t){if(this.totalAllocated<e)throw Error(`Invalid buffer allocation state: call ${t} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let n=this.allocatedPerCall.get(t)??0;if(n<e)throw Error(`Invalid buffer allocation state: call ${t} freed ${e} > allocated for call ${n}`);this.allocatedPerCall.set(t,n-e)}freeAll(e){let t=this.allocatedPerCall.get(e)??0;if(this.totalAllocated<t)throw Error(`Invalid buffer allocation state: call ${e} allocated ${t} > total allocated ${this.totalAllocated}`);this.totalAllocated-=t,this.allocatedPerCall.delete(e)}};let a=`grpc-previous-rpc-attempts`;e.RetryingCall=class{constructor(e,t,n,r,i,a,o,s,c){this.channel=e,this.callConfig=t,this.methodName=n,this.host=r,this.credentials=i,this.deadline=a,this.callNumber=o,this.bufferTracker=s,this.retryThrottler=c,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 l=e.getOptions()[`grpc-node.retry_max_attempts_limit`]??5;if(e.getOptions()[`grpc.enable_retries`]===0)this.state=`NO_RETRY`,this.maxAttempts=1;else if(t.methodConfig.retryPolicy){this.state=`RETRY`;let e=t.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(e.initialBackoff.substring(0,e.initialBackoff.length-1)),this.maxAttempts=Math.min(e.maxAttempts,l)}else t.methodConfig.hedgingPolicy?(this.state=`HEDGING`,this.maxAttempts=Math.min(t.methodConfig.hedgingPolicy.maxAttempts,l)):(this.state=`TRANSPARENT_ONLY`,this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],t=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),t.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,n.formatDateDifference)(this.startTime,t.startTime)}`),e.push(...t.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){i.trace(t.LogVerbosity.DEBUG,`retrying_call`,`[`+this.callNumber+`] `+e)}reportStatus(e){this.trace(`ended with status: code=`+e.code+` details="`+e.details+`" start time=`+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset+=this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var t;(t=this.listener)==null||t.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,t){this.trace(`cancelWithStatus code: `+e+` details: "`+t+`"`),this.reportStatus({code:e,details:t,metadata:new r.Metadata});for(let{call:n}of this.underlyingCalls)n.cancelWithStatus(e,t)}getPeer(){return this.committedCallIndex===null?`unknown`:this.underlyingCalls[this.committedCallIndex].call.getPeer()}getBufferEntry(e){return this.writeBuffer[e-this.writeBufferOffset]??{entryType:`FREED`,allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!==`COMMITTED`)return;let e;e=this.underlyingCalls[this.committedCallIndex].state===`COMPLETED`?this.getNextBufferIndex():this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let t=this.writeBufferOffset;t<e;t++){let e=this.getBufferEntry(t);e.allocated&&this.bufferTracker.free(e.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var n,r;if(this.state!==`COMMITTED`){this.trace(`Committing call [`+this.underlyingCalls[e].call.getCallNumber()+`] at index `+e),this.state=`COMMITTED`,(r=(n=this.callConfig).onCommitted)==null||r.call(n),this.committedCallIndex=e;for(let n=0;n<this.underlyingCalls.length;n++)n!==e&&this.underlyingCalls[n].state!==`COMPLETED`&&(this.underlyingCalls[n].state=`COMPLETED`,this.underlyingCalls[n].call.cancelWithStatus(t.Status.CANCELLED,`Discarded in favor of other hedged attempt`));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state===`COMMITTED`)return;let e=-1,t=-1;for(let[n,r]of this.underlyingCalls.entries())r.state===`ACTIVE`&&r.nextMessageToSend>e&&(e=r.nextMessageToSend,t=n);t===-1?this.state=`TRANSPARENT_ONLY`:this.commitCall(t)}isStatusCodeInList(e,n){return e.some(e=>e===n||e.toString().toLowerCase()===t.Status[n]?.toLowerCase())}getNextRetryJitter(){return Math.random()*.3999999999999999+.8}getNextRetryBackoffMs(){let e=this.callConfig?.methodConfig.retryPolicy;if(!e)return 0;let t=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,n=Number(e.maxBackoff.substring(0,e.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*e.backoffMultiplier,n),t}maybeRetryCall(e,t){if(this.state!==`RETRY`){t(!1);return}if(this.attempts>=this.maxAttempts){t(!1);return}let n;if(e===null)n=this.getNextRetryBackoffMs();else if(e<0){this.state=`TRANSPARENT_ONLY`,t(!1);return}else n=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{if(this.state!==`RETRY`){t(!1);return}this.retryThrottler?.canRetryCall()??!0?(t(!0),this.attempts+=1,this.startNewAttempt()):(this.trace(`Retry attempt denied by throttling policy`),t(!1))},n)}countActiveCalls(){let e=0;for(let t of this.underlyingCalls)t?.state===`ACTIVE`&&(e+=1);return e}handleProcessedStatus(e,t,n){var r,i;switch(this.state){case`COMMITTED`:case`NO_RETRY`:case`TRANSPARENT_ONLY`:this.commitCall(t),this.reportStatus(e);break;case`HEDGING`:if(this.isStatusCodeInList(this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes??[],e.code)){(r=this.retryThrottler)==null||r.addCallFailed();let i;if(n===null)i=0;else if(n<0){this.state=`TRANSPARENT_ONLY`,this.commitCall(t),this.reportStatus(e);return}else i=n;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(t),this.reportStatus(e))},i)}else this.commitCall(t),this.reportStatus(e);break;case`RETRY`:this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((i=this.retryThrottler)==null||i.addCallFailed(),this.maybeRetryCall(n,n=>{n||(this.commitCall(t),this.reportStatus(e))})):(this.commitCall(t),this.reportStatus(e));break}}getPushback(e){let t=e.get(`grpc-retry-pushback-ms`);if(t.length===0)return null;try{return parseInt(t[0])}catch{return-1}}handleChildStatus(e,n){var r;if(this.underlyingCalls[n].state===`COMPLETED`)return;if(this.trace(`state=`+this.state+` handling status with progress `+e.progress+` from child [`+this.underlyingCalls[n].call.getCallNumber()+`] in state `+this.underlyingCalls[n].state),this.underlyingCalls[n].state=`COMPLETED`,e.code===t.Status.OK){(r=this.retryThrottler)==null||r.addCallSucceeded(),this.commitCall(n),this.reportStatus(e);return}if(this.state===`NO_RETRY`){this.commitCall(n),this.reportStatus(e);return}if(this.state===`COMMITTED`){this.reportStatus(e);return}let i=this.getPushback(e.metadata);switch(e.progress){case`NOT_STARTED`:this.startNewAttempt();break;case`REFUSED`:this.transparentRetryUsed?this.handleProcessedStatus(e,n,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case`DROP`:this.commitCall(n),this.reportStatus(e);break;case`PROCESSED`:this.handleProcessedStatus(e,n,i);break}}maybeStartHedgingAttempt(){this.state===`HEDGING`&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,t;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!==`HEDGING`||!this.callConfig.methodConfig.hedgingPolicy)return;let n=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let r=n.hedgingDelay??`0s`,i=Number(r.substring(0,r.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},i*1e3),(t=(e=this.hedgingTimer).unref)==null||t.call(e)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace(`Created child call [`+e.getCallNumber()+`] for attempt `+this.attempts);let t=this.underlyingCalls.length;this.underlyingCalls.push({state:`ACTIVE`,call:e,nextMessageToSend:0,startTime:new Date});let n=this.attempts-1,r=this.initialMetadata.clone();n>0&&r.set(a,`${n}`);let i=!1;e.start(r,{onReceiveMetadata:r=>{this.trace(`Received metadata from child [`+e.getCallNumber()+`]`),this.commitCall(t),i=!0,n>0&&r.set(a,`${n}`),this.underlyingCalls[t].state===`ACTIVE`&&this.listener.onReceiveMetadata(r)},onReceiveMessage:n=>{this.trace(`Received message from child [`+e.getCallNumber()+`]`),this.commitCall(t),this.underlyingCalls[t].state===`ACTIVE`&&this.listener.onReceiveMessage(n)},onReceiveStatus:r=>{this.trace(`Received status from child [`+e.getCallNumber()+`]`),!i&&n>0&&r.metadata.set(a,`${n}`),this.handleChildStatus(r,t)}}),this.sendNextChildMessage(t),this.readStarted&&e.startRead()}start(e,t){this.trace(`start called`),this.listener=t,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e,t){var n,r;(r=(n=this.getBufferEntry(t)).callback)==null||r.call(n),this.clearSentMessages();let i=this.underlyingCalls[e];i.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let t=this.underlyingCalls[e];if(t.state===`COMPLETED`)return;let n=t.nextMessageToSend;if(this.getBufferEntry(n)){let r=this.getBufferEntry(n);switch(r.entryType){case`MESSAGE`:t.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,n)}},r.message.message),this.getBufferEntry(n+1).entryType===`HALF_CLOSE`&&(this.trace(`Sending halfClose immediately after message to child [`+t.call.getCallNumber()+`] - optimizing for unary/final message`),t.nextMessageToSend+=1,t.call.halfClose());break;case`HALF_CLOSE`:t.nextMessageToSend+=1,t.call.halfClose();break;case`FREED`:break}}}sendMessageWithContext(e,t){this.trace(`write() called with message of length `+t.length);let n={message:t,flags:e.flags},r=this.getNextBufferIndex(),i={entryType:`MESSAGE`,message:n,allocated:this.bufferTracker.allocate(t.length,this.callNumber)};if(this.writeBuffer.push(i),i.allocated){process.nextTick(()=>{var t;(t=e.callback)==null||t.call(e)});for(let[e,n]of this.underlyingCalls.entries())n.state===`ACTIVE`&&n.nextMessageToSend===r&&n.call.sendMessageWithContext({callback:t=>{this.handleChildWriteCompleted(e,r)}},t)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let n=this.underlyingCalls[this.committedCallIndex];i.callback=e.callback,n.state===`ACTIVE`&&n.nextMessageToSend===r&&n.call.sendMessageWithContext({callback:e=>{this.handleChildWriteCompleted(this.committedCallIndex,r)}},t)}}startRead(){this.trace(`startRead called`),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state===`ACTIVE`&&e.call.startRead()}halfClose(){this.trace(`halfClose called`);let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:`HALF_CLOSE`,allocated:!1});for(let t of this.underlyingCalls)t?.state===`ACTIVE`&&(t.nextMessageToSend===e||t.nextMessageToSend===e-1)&&(this.trace(`Sending halfClose immediately to child [`+t.call.getCallNumber()+`] - all messages already sent`),t.nextMessageToSend+=1,t.call.halfClose())}setCredentials(e){throw Error(`Method not implemented.`)}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){return this.committedCallIndex===null?null:this.underlyingCalls[this.committedCallIndex].call.getAuthContext()}}})),NA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseSubchannelWrapper=void 0,e.BaseSubchannelWrapper=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,e.addHealthStateWatcher(e=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref(),this.refcount+=1}unref(){this.child.unref(),--this.refcount,this.refcount===0&&this.destroy()}destroy(){for(let e of this.dataWatchers)e.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}addDataWatcher(e){e.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}}})),PA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InternalChannel=e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;let t=JO(),n=tk(),r=kA(),i=QO(),a=X(),o=J(),s=bA(),c=_A(),l=qO(),u=Y(),d=TA(),f=Z(),p=ZO(),m=pA(),h=AA(),g=yA(),_=jA(),v=mA(),y=vA(),b=MA(),x=NA(),S=new Map;var C=class extends x.BaseSubchannelWrapper{constructor(e,t){super(e),this.channel=t,this.refCount=0,this.subchannelStateListener=(e,n,r,i)=>{t.throttleKeepalive(i)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),--this.refCount,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},w=class{pick(e){return{pickResultType:i.PickResultType.DROP,status:{code:o.Status.UNAVAILABLE,details:`Channel closed before call started`,metadata:new a.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=`grpc.internal.no_subchannel`;var T=class{constructor(e){this.target=e,this.trace=new m.ChannelzTrace,this.callTracker=new m.ChannelzCallTracker,this.childrenTracker=new m.ChannelzChildrenTracker,this.state=p.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}};e.InternalChannel=class{constructor(a,h,g){if(this.credentials=h,this.options=g,this.connectivityState=p.ConnectivityState.IDLE,this.currentPicker=new i.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()*(2**53-1)),typeof a!=`string`)throw TypeError(`Channel target must be a string`);if(!(h instanceof t.ChannelCredentials))throw TypeError(`Channel credentials must be a ChannelCredentials object`);if(g&&typeof g!=`object`)throw TypeError(`Channel options must be an object`);this.channelzInfoTracker=new T(a);let _=(0,f.parseUri)(a);if(_===null)throw Error(`Could not parse target name "${a}"`);let v=(0,l.mapUriDefaultScheme)(_);if(v===null)throw Error(`Could not find a default scheme for target name "${a}"`);this.options[`grpc.enable_channelz`]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,m.registerChannelzChannel)(a,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Channel created`),this.options[`grpc.default_authority`]?this.defaultAuthority=this.options[`grpc.default_authority`]:this.defaultAuthority=(0,l.getDefaultAuthority)(v);let x=(0,d.mapProxyName)(v,g);this.target=x.target,this.options=Object.assign({},this.options,x.extraOptions),this.subchannelPool=(0,r.getSubchannelPool)((this.options[`grpc.use_local_subchannel_pool`]??0)===0),this.retryBufferTracker=new b.MessageBufferTracker(this.options[`grpc.retry_buffer_size`]??16777216,this.options[`grpc.per_rpc_retry_buffer_size`]??1048576),this.keepaliveTime=this.options[`grpc.keepalive_time_ms`]??-1,this.idleTimeoutMs=Math.max(this.options[`grpc.client_idle_timeout_ms`]??18e5,1e3);let w={createSubchannel:(t,n)=>{let r={};for(let[t,i]of Object.entries(n))t.startsWith(e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(r[t]=i);let i=this.subchannelPool.getOrCreateSubchannel(this.target,t,r,this.credentials);return i.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Created subchannel or used existing subchannel`,i.getChannelzRef()),new C(i,this)},updateState:(e,t)=>{this.currentPicker=t;let n=this.pickQueue.slice();this.pickQueue=[],n.length>0&&this.callRefTimerUnref();for(let e of n)e.doPick();this.updateState(e)},requestReresolution:()=>{throw Error(`Resolving load balancer should never call requestReresolution`)},addChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(e)},removeChannelzChild:e=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(e)}};this.resolvingLoadBalancer=new n.ResolvingLoadBalancer(this.target,w,this.options,(e,t)=>{var n;e.retryThrottling?S.set(this.getTarget(),new b.RetryThrottler(e.retryThrottling.maxTokens,e.retryThrottling.tokenRatio,S.get(this.getTarget()))):S.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Address resolution succeeded`),(n=this.configSelector)==null||n.unref(),this.configSelector=t,this.currentResolutionError=null,process.nextTick(()=>{let e=this.configSelectionQueue;this.configSelectionQueue=[],e.length>0&&this.callRefTimerUnref();for(let t of e)t.getConfig()})},e=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_WARNING`,`Address resolution failed with code `+e.code+` and details "`+e.details+`"`),this.configSelectionQueue.length>0&&this.trace(`Name resolution failed with calls queued for config selection`),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,y.restrictControlPlaneStatusCode)(e.code,e.details)),{metadata:e.metadata}));let t=this.configSelectionQueue;this.configSelectionQueue=[],t.length>0&&this.callRefTimerUnref();for(let n of t)n.reportResolverError(e)}),this.filterStackFactory=new s.FilterStackFactory([new c.CompressionFilterFactory(this,this.options)]),this.trace(`Channel constructed with options `+JSON.stringify(g,void 0,2));let E=Error();(0,u.isTracerEnabled)(`channel_stacktrace`)&&(0,u.trace)(o.LogVerbosity.DEBUG,`channel_stacktrace`,`(`+this.channelzRef.id+`) Channel constructed
118
118
  `+E.stack?.substring(E.stack.indexOf(`
119
- `)+1)),this.lastActivityTimestamp=new Date}trace(e,t){(0,u.trace)(t??o.LogVerbosity.DEBUG,`channel`,`(`+this.channelzRef.id+`) `+(0,f.uriToString)(this.target)+` `+e)}callRefTimerRef(){var e,t,n;this.callRefTimer||=setInterval(()=>{},2147483647),(e=this.callRefTimer).hasRef?.call(e)||(this.trace(`callRefTimer.ref | configSelectionQueue.length=`+this.configSelectionQueue.length+` pickQueue.length=`+this.pickQueue.length),(n=(t=this.callRefTimer).ref)==null||n.call(t))}callRefTimerUnref(){var e,t;(!this.callRefTimer?.hasRef||this.callRefTimer.hasRef())&&(this.trace(`callRefTimer.unref | configSelectionQueue.length=`+this.configSelectionQueue.length+` pickQueue.length=`+this.pickQueue.length),(t=(e=this.callRefTimer)?.unref)==null||t.call(e))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(t=>t===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,u.trace)(o.LogVerbosity.DEBUG,`connectivity_state`,`(`+this.channelzRef.id+`) `+(0,f.uriToString)(this.target)+` `+p.ConnectivityState[this.connectivityState]+` -> `+p.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Connectivity state change to `+p.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let n of t)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==p.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==p.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:`SUCCESS`,config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:`ERROR`,error:this.currentResolutionError}:{type:`NONE`}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.IDLE),this.currentPicker=new i.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&=(clearTimeout(this.idleTimer),null),this.callRefTimer&&=(clearInterval(this.callRefTimer),null)}startIdleTimeout(e){var t,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let e=new Date().valueOf()-this.lastActivityTimestamp.valueOf();e>=this.idleTimeoutMs?(this.trace(`Idle timer triggered after `+this.idleTimeoutMs+`ms of inactivity`),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-e)},e),(n=(t=this.idleTimer).unref)==null||n.call(t)}maybeStartIdleTimer(){this.connectivityState!==p.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===o.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),--this.callCount,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();return this.trace(`createLoadBalancingCall [`+a+`] method="`+t+`"`),new h.LoadBalancingCall(this,e,t,n,r,i,a)}createRetryingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();return this.trace(`createRetryingCall [`+a+`] method="`+t+`"`),new b.RetryingCall(this,e,t,n,r,i,a,this.retryBufferTracker,S.get(this.getTarget()))}createResolvingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();this.trace(`createResolvingCall [`+a+`] method="`+e+`", deadline=`+(0,g.deadlineToString)(t));let s={deadline:t,flags:i??o.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:r},c=new _.ResolvingCall(this,e,s,this.filterStackFactory.clone(),a);return this.onCallStart(),c.addStatusWatcher(e=>{this.onCallEnd(e)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.SHUTDOWN),this.currentPicker=new w;for(let e of this.configSelectionQueue)e.cancelWithStatus(o.Status.UNAVAILABLE,`Channel closed before call started`);this.configSelectionQueue=[];for(let e of this.pickQueue)e.cancelWithStatus(o.Status.UNAVAILABLE,`Channel closed before call started`);this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,m.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)==null||e.unref(),this.configSelector=null}getTarget(){return(0,f.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,n){if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw Error(`Channel has been shut down`);let r=null;if(t!==1/0){let e=t instanceof Date?t:new Date(t),a=new Date;if(t===-1/0||e<=a){process.nextTick(n,Error(`Deadline passed without connectivity state change`));return}r=setTimeout(()=>{this.removeConnectivityStateWatcher(i),n(Error(`Deadline passed without connectivity state change`))},e.getTime()-a.getTime())}let i={currentState:e,callback:n,timer:r};this.connectivityStateWatchers.push(i)}getChannelzRef(){return this.channelzRef}createCall(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(`Channel#createCall: method must be a string`);if(!(typeof t==`number`||t instanceof Date))throw TypeError(`Channel#createCall: deadline must be a number or Date`);if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw Error(`Channel has been shut down`);return this.createResolvingCall(e,t,n,r,i)}getOptions(){return this.options}}})),PA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelImplementation=void 0;let t=qO(),n=NA();e.ChannelImplementation=class{constructor(e,r,i){if(typeof e!=`string`)throw TypeError(`Channel target must be a string`);if(!(r instanceof t.ChannelCredentials))throw TypeError(`Channel credentials must be a ChannelCredentials object`);if(i&&typeof i!=`object`)throw TypeError(`Channel options must be an object`);this.internalChannel=new n.InternalChannel(e,r,i)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,n){this.internalChannel.watchConnectivityState(e,t,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(`Channel#createCall: method must be a string`);if(!(typeof t==`number`||t instanceof Date))throw TypeError(`Channel#createCall: deadline must be a number or Date`);return this.internalChannel.createCall(e,t,n,r,i)}}})),FA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ServerDuplexStreamImpl=e.ServerWritableStreamImpl=e.ServerReadableStreamImpl=e.ServerUnaryCallImpl=void 0,e.serverErrorToStatus=a;let t=s(`events`),n=s(`stream`),r=J(),i=X();function a(e,t){let n={code:r.Status.UNKNOWN,details:`message`in e?e.message:`Unknown Error`,metadata:t??e.metadata??null};return`code`in e&&typeof e.code==`number`&&Number.isInteger(e.code)&&(n.code=e.code,`details`in e&&typeof e.details==`string`&&(n.details=e.details)),n}e.ServerUnaryCallImpl=class extends t.EventEmitter{constructor(e,t,n,r){super(),this.path=e,this.call=t,this.metadata=n,this.request=r,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}},e.ServerReadableStreamImpl=class extends n.Readable{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}},e.ServerWritableStreamImpl=class extends n.Writable{constructor(e,t,n,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.request=o,this.pendingStatus={code:r.Status.OK,details:`OK`},this.cancelled=!1,this.trailingMetadata=new i.Metadata,this.on(`error`,e=>{this.pendingStatus=a(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:this.pendingStatus.metadata??this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}},e.ServerDuplexStreamImpl=class extends n.Duplex{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.pendingStatus={code:r.Status.OK,details:`OK`},this.cancelled=!1,this.trailingMetadata=new i.Metadata,this.on(`error`,e=>{this.pendingStatus=a(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:this.pendingStatus.metadata??this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}}})),IA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ServerCredentials=void 0,e.createCertificateProviderServerCredentials=o,e.createServerCredentialsWithInterceptors=c;let t=GO();var n=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let e of this.watchers)e(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new r}static createSsl(e,n,r=!1){if(e!==null&&!Buffer.isBuffer(e))throw TypeError(`rootCerts must be null or a Buffer`);if(!Array.isArray(n))throw TypeError(`keyCertPairs must be an array`);if(typeof r!=`boolean`)throw TypeError(`checkClientCertificate must be a boolean`);let a=[],o=[];for(let e=0;e<n.length;e++){let t=n[e];if(typeof t!=`object`||!t)throw TypeError(`keyCertPair[${e}] must be an object`);if(!Buffer.isBuffer(t.private_key))throw TypeError(`keyCertPair[${e}].private_key must be a Buffer`);if(!Buffer.isBuffer(t.cert_chain))throw TypeError(`keyCertPair[${e}].cert_chain must be a Buffer`);a.push(t.cert_chain),o.push(t.private_key)}return new i({requestCert:r,ciphers:t.CIPHER_SUITES},{ca:e??(0,t.getDefaultRootsData)()??void 0,cert:a,key:o})}};e.ServerCredentials=n;var r=class e extends n{constructor(){super(null)}_getSettings(){return null}_equals(t){return t instanceof e}},i=class e extends n{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(t){if(this===t)return!0;if(!(t instanceof e))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(t.options.ca)){if(!this.options.ca.equals(t.options.ca))return!1}else if(this.options.ca!==t.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(t.options.cert)){if(this.options.cert.length!==t.options.cert.length)return!1;for(let e=0;e<this.options.cert.length;e++){let n=this.options.cert[e],r=t.options.cert[e];if(Buffer.isBuffer(n)&&Buffer.isBuffer(r)){if(!n.equals(r))return!1}else if(n!==r)return!1}}else if(this.options.cert!==t.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(t.options.key)){if(this.options.key.length!==t.options.key.length)return!1;for(let e=0;e<this.options.key.length;e++){let n=this.options.key[e],r=t.options.key[e];if(Buffer.isBuffer(n)&&Buffer.isBuffer(r)){if(!n.equals(r))return!1}else if(n!==r)return!1}}else if(this.options.key!==t.options.key)return!1;return this.options.requestCert===t.options.requestCert}},a=class e extends n{constructor(e,n,r){super({requestCert:n!==null,rejectUnauthorized:r,ciphers:t.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=n,this.requireClientCertificate=r,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&&((t=this.caCertificateProvider)==null||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)==null||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(t){return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&this.requireClientCertificate===t.requireClientCertificate:!1}calculateSecureContextOptions(){return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:this.latestCaUpdate?.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function o(e,t,n){return new a(e,t,n)}var s=class e extends n{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(t){if(!(t instanceof e)||!this.childCredentials._equals(t.childCredentials)||this.interceptors.length!==t.interceptors.length)return!1;for(let e=0;e<this.interceptors.length;e++)if(this.interceptors[e]!==t.interceptors[e])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function c(e,t){return new s(e,t)}})),LA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.durationMessageToDuration=t,e.msToDuration=n,e.durationToMs=r,e.isDuration=i,e.isDurationMessage=a,e.parseDuration=s,e.durationToString=c;function t(e){return{seconds:Number.parseInt(e.seconds),nanos:e.nanos}}function n(e){return{seconds:e/1e3|0,nanos:e%1e3*1e6|0}}function r(e){return e.seconds*1e3+e.nanos/1e6|0}function i(e){return typeof e.seconds==`number`&&typeof e.nanos==`number`}function a(e){return typeof e.seconds==`string`&&typeof e.nanos==`number`}let o=/^(\d+)(?:\.(\d+))?s$/;function s(e){let t=e.match(o);return t?{seconds:Number.parseInt(t[1],10),nanos:t[2]?Number.parseInt(t[2].padEnd(9,`0`),10):0}:null}function c(e){if(e.nanos===0)return`${e.seconds}s`;let t;return t=e.nanos%1e6==0?1e6:e.nanos%1e3==0?1e3:1,`${e.seconds}.${e.nanos/t}s`}})),RA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OrcaOobMetricsSubchannelWrapper=e.GRPC_METRICS_HEADER=e.ServerMetricRecorder=e.PerRequestMetricRecorder=void 0,e.createOrcaClient=l,e.createMetricsReader=d;let t=lk(),n=LA(),r=qO(),i=MA(),a=J(),o=QO(),s=XO();function c(){let e=dA().loadSync,n=e(`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,t.loadPackageDefinition)(n)}e.PerRequestMetricRecorder=class{constructor(){this.message={}}recordRequestCostMetric(e,t){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=t}recordUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}recordNamedMetric(e,t){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=t}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return c().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}},e.ServerMetricRecorder=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let t=e.request.report_interval?(0,n.durationToMs)((0,n.durationMessageToDuration)(e.request.report_interval)):3e4,r=setInterval(()=>{e.write(this.message)},t);e.on(`cancelled`,()=>{clearInterval(r)})}}}putUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var t;(t=this.message.utilization)==null||delete t[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let t=c().xds.service.orca.v3.OpenRcaService.service;e.addService(t,this.serviceImplementation)}};function l(e){let t=c().xds.service.orca.v3.OpenRcaService;return new t(`unused`,r.ChannelCredentials.createInsecure(),{channelOverride:e})}e.GRPC_METRICS_HEADER=`endpoint-load-metrics-bin`;let u=`grpc_orca_load_report`;function d(t,n){return(r,i,a)=>{let o=a.getOpaque(u);if(o)t(o);else{let n=a.get(e.GRPC_METRICS_HEADER);n.length>0&&(o=c().xds.data.orca.v3.OrcaLoadReport.deserialize(n[0]),t(o),a.setOpaque(u,o))}n&&n(r,i,a)}}let f=`orca_oob_metrics`;var p=class{constructor(e,t){this.metricsListener=e,this.intervalMs=t,this.dataProducer=null}setSubchannel(e){let t=e.getOrCreateDataProducer(f,h);this.dataProducer=t,t.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)==null||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},m=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new o.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let t=e.getChannel();this.client=l(t),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var t;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(f),(t=this.metricsCall)==null||t.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==s.ConnectivityState.READY)return;let t=Math.min(...Array.from(this.dataWatchers).map(e=>e.getInterval()));if(!this.metricsCall||t!==this.currentInterval){(e=this.metricsCall)==null||e.cancel(),this.currentInterval=t;let r=this.client.streamCoreMetrics({report_interval:(0,n.msToDuration)(t)});this.metricsCall=r,r.on(`data`,e=>{this.dataWatchers.forEach(t=>{t.onMetricsUpdate(e)})}),r.on(`error`,e=>{if(this.metricsCall=null,e.code===a.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}e.code!==a.Status.CANCELLED&&this.backoffTimer.runOnce()})}}};e.OrcaOobMetricsSubchannelWrapper=class extends i.BaseSubchannelWrapper{constructor(e,t,n){super(e),this.addDataWatcher(new p(t,n))}getWrappedSubchannel(){return this.child}};function h(e){return new m(e)}})),zA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseServerInterceptingCall=e.ServerInterceptingCall=e.ResponderBuilder=e.ServerListenerBuilder=void 0,e.isInterceptingServerListener=p,e.getServerInterceptingCall=O;let t=X(),n=J(),r=s(`http2`),i=UO(),a=s(`zlib`),o=TA(),c=Y(),l=s(`tls`),u=RA(),d=`server_call`;function f(e){c.trace(n.LogVerbosity.DEBUG,d,e)}e.ServerListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};function p(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}var m=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&=(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,!1)}processPendingHalfClose(){this.hasPendingHalfClose&&=(this.nextListener.onReceiveHalfClose(),!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}};e.ResponderBuilder=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};let h={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveHalfClose:e=>{e()},onCancel:()=>{}},g={start:e=>{e()},sendMetadata:(e,t)=>{t(e)},sendMessage:(e,t)=>{t(e)},sendStatus:(e,t)=>{t(e)}};e.ServerInterceptingCall=class{constructor(e,t){this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:t?.start??g.start,sendMetadata:t?.sendMetadata??g.sendMetadata,sendMessage:t?.sendMessage??g.sendMessage,sendStatus:t?.sendStatus??g.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&=(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,null)}processPendingStatus(){this.pendingStatus&&=(this.nextCall.sendStatus(this.pendingStatus),null)}start(e){this.responder.start(t=>{let n=new m({onReceiveMetadata:t?.onReceiveMetadata??h.onReceiveMetadata,onReceiveMessage:t?.onReceiveMessage??h.onReceiveMessage,onReceiveHalfClose:t?.onReceiveHalfClose??h.onReceiveHalfClose,onCancel:t?.onCancel??h.onCancel},e);this.nextCall.start(n)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,e=>{this.processingMetadata=!1,this.nextCall.sendMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,n){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new t.Metadata),this.responder.sendMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.pendingMessageCallback=n):this.nextCall.sendMessage(e,n)})}sendStatus(e){this.responder.sendStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextCall.sendStatus(e)})}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()}};let _=`grpc-accept-encoding`,v=`grpc-encoding`,y=`grpc-message`,b=`grpc-status`,x=`grpc-timeout`,S=/(\d{1,8})\s*([HMSmun])/,C={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},w={[_]:`identity,deflate,gzip`,[v]:`identity`},T={[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_OK,[r.constants.HTTP2_HEADER_CONTENT_TYPE]:`application/grpc+proto`},E={waitForTrailers:!0};var D=class{constructor(e,i,a,s,l){this.stream=e,this.callEventTracker=a,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=n.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=n.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 u.PerRequestMetricRecorder,this.stream.once(`close`,()=>{f(`Request to method `+this.handler?.path+` stream closed with rstCode `+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:n.Status.CANCELLED,details:`Stream closed before sending status`,metadata:null})),this.notifyOnCancel()}),this.stream.on(`data`,e=>{this.handleDataFrame(e)}),this.stream.pause(),this.stream.on(`end`,()=>{this.handleEndEvent()}),`grpc.max_send_message_length`in l&&(this.maxSendMessageSize=l[`grpc.max_send_message_length`]),`grpc.max_receive_message_length`in l&&(this.maxReceiveMessageSize=l[`grpc.max_receive_message_length`]),this.host=i[`:authority`]??i.host,this.decoder=new o.StreamDecoder(this.maxReceiveMessageSize);let p=t.Metadata.fromHttp2Headers(i);c.isTracerEnabled(d)&&f(`Request to `+this.handler.path+` received headers `+JSON.stringify(p.toJSON()));let m=p.get(x);m.length>0&&this.handleTimeoutHeader(m[0]);let h=p.get(v);h.length>0&&(this.incomingEncoding=h[0]),p.remove(x),p.remove(v),p.remove(_),p.remove(r.constants.HTTP2_HEADER_ACCEPT_ENCODING),p.remove(r.constants.HTTP2_HEADER_TE),p.remove(r.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=p;let g=e.session?.socket;this.connectionInfo={localAddress:g?.localAddress,localPort:g?.localPort,remoteAddress:g?.remoteAddress,remotePort:g?.remotePort},this.shouldSendMetrics=!!l[`grpc.server_call_metric_recording`]}handleTimeoutHeader(e){let t=e.toString().match(S);if(t===null){let t={code:n.Status.INTERNAL,details:`Invalid ${x} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(t)});return}let r=+t[1]*C[t[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+r),this.deadlineTimer=setTimeout(()=>{let e={code:n.Status.DEADLINE_EXCEEDED,details:`Deadline exceeded`,metadata:null};this.sendStatus(e)},r)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)==null||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new t.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),n=t.byteLength,r=Buffer.allocUnsafe(n+5);return r.writeUInt8(0,0),r.writeUInt32BE(n,1),t.copy(r,5),r}decompressMessage(e,t){let r=e.subarray(5);if(t===`identity`)return r;if(t===`deflate`||t===`gzip`){let e;return e=t===`deflate`?a.createInflate():a.createGunzip(),new Promise((t,i)=>{let a=0,o=[];e.on(`error`,e=>{i({code:n.Status.INTERNAL,details:`Failed to decompress message`})}),e.on(`data`,t=>{o.push(t),a+=t.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(e.destroy(),i({code:n.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),e.on(`end`,()=>{t(Buffer.concat(o))}),e.write(r),e.end()})}else return Promise.reject({code:n.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!==`COMPRESSED`)throw Error(`Invalid queue entry type: ${e.type}`);let t=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:`identity`,r;try{r=await this.decompressMessage(e.compressedMessage,t)}catch(e){this.sendStatus(e);return}try{e.parsedMessage=this.handler.deserialize(r)}catch(e){this.sendStatus({code:n.Status.INTERNAL,details:`Error deserializing request: ${e.message}`});return}e.type=`READABLE`,this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!==`COMPRESSED`){this.isReadPending=!1;let e=this.readQueue.shift();e.type===`READABLE`?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;f(`Request to `+this.handler.path+` received data frame of size `+e.length);let r;try{r=this.decoder.write(e)}catch(e){this.sendStatus({code:n.Status.RESOURCE_EXHAUSTED,details:e.message});return}for(let e of r){this.stream.pause();let n={type:`COMPRESSED`,compressedMessage:e,parsedMessage:null};this.readQueue.push(n),this.decompressAndMaybePush(n),(t=this.callEventTracker)==null||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:`HALF_CLOSE`,compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){f(`Request to `+this.handler.path+` start called`),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},T),w),t);this.stream.respond(n,E)}sendMessage(e,t){if(this.checkCancelled())return;let r;try{r=this.serializeMessage(e)}catch(e){this.sendStatus({code:n.Status.INTERNAL,details:`Error serializing response: ${(0,i.getErrorMessage)(e)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&r.length-5>this.maxSendMessageSize){this.sendStatus({code:n.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${r.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),f(`Request to `+this.handler.path+` sent data frame of size `+r.length),this.stream.write(r,e=>{var r;if(e){this.sendStatus({code:n.Status.INTERNAL,details:`Error writing message: ${(0,i.getErrorMessage)(e)}`,metadata:null});return}(r=this.callEventTracker)==null||r.addMessageSent(),t()})}sendStatus(e){if(this.checkCancelled())return;f(`Request to method `+this.handler?.path+` ended with status code: `+n.Status[e.code]+` details: `+e.details);let r=e.metadata?.clone()??new t.Metadata;if(this.shouldSendMetrics&&r.set(u.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once(`wantTrailers`,()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let t=Object.assign({[b]:e.code,[y]:encodeURI(e.details)},r.toHttp2Headers());this.stream.sendTrailers(t),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let t=Object.assign(Object.assign({[b]:e.code,[y]:encodeURI(e.details)},T),r.toHttp2Headers());this.stream.respond(t,{endStream:!0}),this.notifyOnCancel()}}startRead(){f(`Request to `+this.handler.path+` startRead called`),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){let e=this.stream.session?.socket;return e?.remoteAddress?e.remotePort?`${e.remoteAddress}:${e.remotePort}`:e.remoteAddress:`unknown`}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){if(this.stream.session?.socket instanceof l.TLSSocket){let e=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:`ssl`,sslPeerCertificate:e.raw?e:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};e.BaseServerInterceptingCall=D;function O(e,t,n,r,i,a){let o={path:i.path,requestStream:i.type===`clientStream`||i.type===`bidi`,responseStream:i.type===`serverStream`||i.type===`bidi`,requestDeserialize:i.deserialize,responseSerialize:i.serialize},s=new D(t,n,r,i,a);return e.reduce((e,t)=>t(o,e),s)}})),BA=t((e=>{var t=e&&e.__runInitializers||function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},n=e&&e.__esDecorate||function(e,t,n,r,i,a){function o(e){if(e!==void 0&&typeof e!=`function`)throw TypeError(`Function expected`);return e}for(var s=r.kind,c=s===`getter`?`get`:s===`setter`?`set`:`value`,l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]=h===`access`?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw TypeError(`Cannot add initializers after decoration has completed`);a.push(o(e||null))};var g=(0,n[p])(s===`accessor`?{get:u.get,set:u.set}:u[c],m);if(s===`accessor`){if(g===void 0)continue;if(typeof g!=`object`||!g)throw TypeError(`Object expected`);(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&i.unshift(d)}else(d=o(g))&&(s===`field`?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0};Object.defineProperty(e,"__esModule",{value:!0}),e.Server=void 0;let r=s(`http2`),i=s(`util`),a=J(),o=FA(),c=IA(),l=KO(),u=Y(),d=nk(),f=Z(),p=fA(),m=zA(),h=2147483647,g=2147483647,_=2147483647,{HTTP2_HEADER_PATH:v}=r.constants,y=Buffer.from(`max_age`);function b(e){u.trace(a.LogVerbosity.DEBUG,`server_call`,e)}function x(){}function S(e){return function(t,n){return i.deprecate(t,e)}}function C(e){return{code:a.Status.UNIMPLEMENTED,details:`The server does not implement the method ${e}`}}function w(e,t){let n=C(t);switch(e){case`unary`:return(e,t)=>{t(n,null)};case`clientStream`:return(e,t)=>{t(n,null)};case`serverStream`:return e=>{e.emit(`error`,n)};case`bidi`:return e=>{e.emit(`error`,n)};default:throw Error(`Invalid handlerType ${e}`)}}e.Server=(()=>{var e;let i=[],o;return e=class{constructor(e){this.boundPorts=(t(this,i),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=e??{},this.options[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.channelzTrace=new p.ChannelzTraceStub,this.callTracker=new p.ChannelzCallTrackerStub,this.listenerChildrenTracker=new p.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new p.ChannelzChildrenTrackerStub):(this.channelzTrace=new p.ChannelzTrace,this.callTracker=new p.ChannelzCallTracker,this.listenerChildrenTracker=new p.ChannelzChildrenTracker,this.sessionChildrenTracker=new p.ChannelzChildrenTracker),this.channelzRef=(0,p.registerChannelzServer)(`server`,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(`CT_INFO`,`Server created`),this.maxConnectionAgeMs=this.options[`grpc.max_connection_age_ms`]??h,this.maxConnectionAgeGraceMs=this.options[`grpc.max_connection_age_grace_ms`]??h,this.keepaliveTimeMs=this.options[`grpc.keepalive_time_ms`]??g,this.keepaliveTimeoutMs=this.options[`grpc.keepalive_timeout_ms`]??2e4,this.sessionIdleTimeout=this.options[`grpc.max_connection_idle_ms`]??_,this.commonServerOptions={maxSendHeaderBlockLength:2**53-1},`grpc-node.max_session_memory`in this.options?this.commonServerOptions.maxSessionMemory=this.options[`grpc-node.max_session_memory`]:this.commonServerOptions.maxSessionMemory=2**53-1,`grpc.max_concurrent_streams`in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options[`grpc.max_concurrent_streams`]}),this.interceptors=this.options.interceptors??[],this.trace(`Server constructed`)}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(e){let t=this.sessions.get(e),n=e.socket,r=n.remoteAddress?(0,d.stringToSubchannelAddress)(n.remoteAddress,n.remotePort):null,i=n.localAddress?(0,d.stringToSubchannelAddress)(n.localAddress,n.localPort):null,a;if(e.encrypted){let e=n,t=e.getCipher(),r=e.getCertificate(),i=e.getPeerCertificate();a={cipherSuiteStandardName:t.standardName??null,cipherSuiteOtherName:t.standardName?null:t.name,localCertificate:r&&`raw`in r?r.raw:null,remoteCertificate:i&&`raw`in i?i.raw:null}}else a=null;return{remoteAddress:r,localAddress:i,security:a,remoteName:null,streamsStarted:t.streamTracker.callsStarted,streamsSucceeded:t.streamTracker.callsSucceeded,streamsFailed:t.streamTracker.callsFailed,messagesSent:t.messagesSent,messagesReceived:t.messagesReceived,keepAlivesSent:t.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:t.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:t.lastMessageSentTimestamp,lastMessageReceivedTimestamp:t.lastMessageReceivedTimestamp,localFlowControlWindow:e.state.localWindowSize??null,remoteFlowControlWindow:e.state.remoteWindowSize??null}}trace(e){u.trace(a.LogVerbosity.DEBUG,`server`,`(`+this.channelzRef.id+`) `+e)}keepaliveTrace(e){u.trace(a.LogVerbosity.DEBUG,`keepalive`,`(`+this.channelzRef.id+`) `+e)}addProtoService(){throw Error(`Not implemented. Use addService() instead`)}addService(e,t){if(typeof e!=`object`||!e||typeof t!=`object`||!t)throw Error(`addService() requires two objects as arguments`);let n=Object.keys(e);if(n.length===0)throw Error(`Cannot add an empty service to a server`);n.forEach(n=>{let r=e[n],i;i=r.requestStream?r.responseStream?`bidi`:`clientStream`:r.responseStream?`serverStream`:`unary`;let a=t[n],o;if(a===void 0&&typeof r.originalName==`string`&&(a=t[r.originalName]),o=a===void 0?w(i,n):a.bind(t),this.register(r.path,o,r.responseSerialize,r.requestDeserialize,i)===!1)throw Error(`Method handler for ${r.path} already provided.`)})}removeService(e){if(typeof e!=`object`||!e)throw Error(`removeService() requires object as argument`);Object.keys(e).forEach(t=>{let n=e[t];this.unregister(n.path)})}bind(e,t){throw Error(`Not implemented. Use bindAsync() instead`)}experimentalRegisterListenerToChannelz(e){return(0,p.registerChannelzSocket)((0,d.subchannelAddressToString)(e),()=>({localAddress:e,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(e){(0,p.unregisterChannelzRef)(e)}createHttp2Server(e){let t;if(e._isSecure()){let n=e._getConstructorOptions(),i=e._getSecureContextOptions(),o=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),n),i),{enableTrace:this.options[`grpc-node.tls_enable_trace`]===1}),s=i!==null;this.trace(`Initial credentials valid: `+s),t=r.createSecureServer(o),t.prependListener(`connection`,e=>{s||(this.trace(`Dropped connection from `+JSON.stringify(e.address())+` due to unloaded credentials`),e.destroy())}),t.on(`secureConnection`,e=>{e.on(`error`,e=>{this.trace(`An incoming TLS connection closed with error: `+e.message)})});let c=e=>{if(e){let n=t;try{n.setSecureContext(e)}catch(t){u.log(a.LogVerbosity.ERROR,`Failed to set secure context with error `+t.message),e=null}}s=e!==null,this.trace(`Post-update credentials valid: `+s)};e._addWatcher(c),t.on(`close`,()=>{e._removeWatcher(c)})}else t=r.createServer(this.commonServerOptions);return t.setTimeout(0,x),this._setupHandlers(t,e._getInterceptors()),t}bindOneAddress(e,t){this.trace(`Attempting to bind `+(0,d.subchannelAddressToString)(e));let n=this.createHttp2Server(t.credentials);return new Promise((r,i)=>{let a=t=>{this.trace(`Failed to bind `+(0,d.subchannelAddressToString)(e)+` with error `+t.message),r({port:`port`in e?e.port:1,error:t.message})};n.once(`error`,a),n.listen(e,()=>{let e=n.address(),i;i=typeof e==`string`?{path:e}:{host:e.address,port:e.port};let o=this.experimentalRegisterListenerToChannelz(i);this.listenerChildrenTracker.refChild(o),this.http2Servers.set(n,{channelzRef:o,sessions:new Set,ownsChannelzRef:!0}),t.listeningServers.add(n),this.trace(`Successfully bound `+(0,d.subchannelAddressToString)(i)),r({port:`port`in i?i.port:1}),n.removeListener(`error`,a)})})}async bindManyPorts(e,t){if(e.length===0)return{count:0,port:0,errors:[]};if((0,d.isTcpSubchannelAddress)(e[0])&&e[0].port===0){let n=await this.bindOneAddress(e[0],t);if(n.error){let r=await this.bindManyPorts(e.slice(1),t);return Object.assign(Object.assign({},r),{errors:[n.error,...r.errors]})}else{let r=e.slice(1).map(e=>(0,d.isTcpSubchannelAddress)(e)?{host:e.host,port:n.port}:e),i=[n,...await Promise.all(r.map(e=>this.bindOneAddress(e,t)))];return{count:i.filter(e=>e.error===void 0).length,port:n.port,errors:i.filter(e=>e.error).map(e=>e.error)}}}else{let n=await Promise.all(e.map(e=>this.bindOneAddress(e,t)));return{count:n.filter(e=>e.error===void 0).length,port:n[0].port,errors:n.filter(e=>e.error).map(e=>e.error)}}}async bindAddressList(e,t){let n=await this.bindManyPorts(e,t);if(n.count>0)return n.count<e.length&&u.log(a.LogVerbosity.INFO,`WARNING Only ${n.count} addresses added out of total ${e.length} resolved`),n.port;{let t=`No address added out of total ${e.length} resolved`;throw u.log(a.LogVerbosity.ERROR,t),Error(`${t} errors: [${n.errors.join(`,`)}]`)}}resolvePort(e){return new Promise((t,n)=>{let r=!1;(0,l.createResolver)(e,(i,a,o,s)=>{if(r)return!0;if(r=!0,!i.ok)return n(Error(i.error.details)),!0;let c=[].concat(...i.value.map(e=>e.addresses));return c.length===0?(n(Error(`No addresses resolved for port ${e}`)),!0):(t(c),!0)},this.options).updateResolution()})}async bindPort(e,t){let n=await this.resolvePort(e);if(t.cancelled)throw this.completeUnbind(t),Error(`bindAsync operation cancelled by unbind call`);let r=await this.bindAddressList(n,t);if(t.cancelled)throw this.completeUnbind(t),Error(`bindAsync operation cancelled by unbind call`);return r}normalizePort(e){let t=(0,f.parseUri)(e);if(t===null)throw Error(`Could not parse port "${e}"`);let n=(0,l.mapUriDefaultScheme)(t);if(n===null)throw Error(`Could not get a default scheme for port "${e}"`);return n}bindAsync(e,t,n){if(this.shutdown)throw Error(`bindAsync called after shutdown`);if(typeof e!=`string`)throw TypeError(`port must be a string`);if(t===null||!(t instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);if(typeof n!=`function`)throw TypeError(`callback must be a function`);this.trace(`bindAsync port=`+e);let r=this.normalizePort(e),i=(e,t)=>{process.nextTick(()=>n(e,t))},a=this.boundPorts.get((0,f.uriToString)(r));if(a){if(!t._equals(a.credentials)){i(Error(`${e} already bound with incompatible credentials`),0);return}a.cancelled=!1,a.completionPromise?a.completionPromise.then(e=>n(null,e),e=>n(e,0)):i(null,a.portNumber);return}a={mapKey:(0,f.uriToString)(r),originalUri:r,completionPromise:null,cancelled:!1,portNumber:0,credentials:t,listeningServers:new Set};let o=(0,f.splitHostPort)(r.path),s=this.bindPort(r,a);a.completionPromise=s,o?.port===0?s.then(e=>{let t={scheme:r.scheme,authority:r.authority,path:(0,f.combineHostPort)({host:o.host,port:e})};a.mapKey=(0,f.uriToString)(t),a.completionPromise=null,a.portNumber=e,this.boundPorts.set(a.mapKey,a),n(null,e)},e=>{n(e,0)}):(this.boundPorts.set(a.mapKey,a),s.then(e=>{a.completionPromise=null,a.portNumber=e,n(null,e)},e=>{n(e,0)}))}registerInjectorToChannelz(){return(0,p.registerChannelzSocket)(`injector`,()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(e,t,n=!1){if(e===null||!(e instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);this.channelzEnabled&&this.listenerChildrenTracker.refChild(t);let i=this.createHttp2Server(e),a=new Set;return this.http2Servers.set(i,{channelzRef:t,sessions:a,ownsChannelzRef:n}),{injectConnection:e=>{i.emit(`connection`,e)},drain:e=>{var t,n;for(let e of a)this.closeSession(e);(n=(t=setTimeout(()=>{for(let e of a)e.destroy(r.constants.NGHTTP2_CANCEL)},e)).unref)==null||n.call(t)},destroy:()=>{this.closeServer(i);for(let e of a)this.closeSession(e)}}}createConnectionInjector(e){if(e===null||!(e instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);let t=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(e,t,!0)}closeServer(e,t){this.trace(`Closing server with address `+JSON.stringify(e.address()));let n=this.http2Servers.get(e);e.close(()=>{n&&n.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(n.channelzRef),(0,p.unregisterChannelzRef)(n.channelzRef)),this.http2Servers.delete(e),t?.()})}closeSession(e,t){this.trace(`Closing session initiated by `+e.socket?.remoteAddress);let n=this.sessions.get(e),r=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,p.unregisterChannelzRef)(n.ref)),t?.()};e.closed?queueMicrotask(r):e.close(r)}completeUnbind(e){for(let t of e.listeningServers){let n=this.http2Servers.get(t);if(this.closeServer(t,()=>{e.listeningServers.delete(t)}),n)for(let e of n.sessions)this.closeSession(e)}this.boundPorts.delete(e.mapKey)}unbind(e){this.trace(`unbind port=`+e);let t=this.normalizePort(e);if((0,f.splitHostPort)(t.path)?.port===0)throw Error(`Cannot unbind port 0`);let n=this.boundPorts.get((0,f.uriToString)(t));n&&(this.trace(`unbinding `+n.mapKey+` originally bound as `+(0,f.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(e,t){var n,i;this.trace(`drain port=`+e+` graceTimeMs=`+t);let a=this.normalizePort(e);if((0,f.splitHostPort)(a.path)?.port===0)throw Error(`Cannot drain port 0`);let o=this.boundPorts.get((0,f.uriToString)(a));if(!o)return;let s=new Set;for(let e of o.listeningServers){let t=this.http2Servers.get(e);if(t)for(let e of t.sessions)s.add(e),this.closeSession(e,()=>{s.delete(e)})}(i=(n=setTimeout(()=>{for(let e of s)e.destroy(r.constants.NGHTTP2_CANCEL)},t)).unref)==null||i.call(n)}forceShutdown(){for(let e of this.boundPorts.values())e.cancelled=!0;this.boundPorts.clear();for(let e of this.http2Servers.keys())this.closeServer(e);this.sessions.forEach((e,t)=>{this.closeSession(t),t.destroy(r.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,p.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(e,t,n,r,i){return this.handlers.has(e)?!1:(this.handlers.set(e,{func:t,serialize:n,deserialize:r,type:i,path:e}),!0)}unregister(e){return this.handlers.delete(e)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(e=>!e.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(e){let t=t=>{(0,p.unregisterChannelzRef)(this.channelzRef),e(t)},n=0;function r(){n--,n===0&&t()}this.shutdown=!0;for(let[e,t]of this.http2Servers.entries()){n++;let i=t.channelzRef.name;this.trace(`Waiting for server `+i+` to close`),this.closeServer(e,()=>{this.trace(`Server `+i+` finished closing`),r()});for(let e of t.sessions.keys()){n++;let t=e.socket?.remoteAddress;this.trace(`Waiting for session `+t+` to close`),this.closeSession(e,()=>{this.trace(`Session `+t+` finished closing`),r()})}}n===0&&t()}addHttp2Port(){throw Error(`Not yet implemented`)}getChannelzRef(){return this.channelzRef}_verifyContentType(e,t){let n=t[r.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof n!=`string`||!n.startsWith(`application/grpc`)?(e.respond({[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(e){b(`Received call to method `+e+` at address `+this.serverAddressString);let t=this.handlers.get(e);return t===void 0?(b(`No handler registered for method `+e+`. Sending UNIMPLEMENTED status.`),null):t}_respondWithError(e,t,n=null){let i=Object.assign({"grpc-status":e.code??a.Status.INTERNAL,"grpc-message":e.details,[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_OK,[r.constants.HTTP2_HEADER_CONTENT_TYPE]:`application/grpc+proto`},e.metadata?.toHttp2Headers());t.respond(i,{endStream:!0}),this.callTracker.addCallFailed(),n?.streamTracker.addCallFailed()}_channelzHandler(e,t,n){t.once(`error`,e=>{}),this.onStreamOpened(t);let r=this.sessions.get(t.session);if(this.callTracker.addCallStarted(),r?.streamTracker.addCallStarted(),!this._verifyContentType(t,n)){this.callTracker.addCallFailed(),r?.streamTracker.addCallFailed();return}let i=n[v],o=this._retrieveHandler(i);if(!o){this._respondWithError(C(i),t,r);return}let s={addMessageSent:()=>{r&&(r.messagesSent+=1,r.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{r&&(r.messagesReceived+=1,r.lastMessageReceivedTimestamp=new Date)},onCallEnd:e=>{e.code===a.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:e=>{r&&(e?r.streamTracker.addCallSucceeded():r.streamTracker.addCallFailed())}},c=(0,m.getServerInterceptingCall)([...e,...this.interceptors],t,n,s,o,this.options);this._runHandlerForCall(c,o)||(this.callTracker.addCallFailed(),r?.streamTracker.addCallFailed(),c.sendStatus({code:a.Status.INTERNAL,details:`Unknown handler type: ${o.type}`}))}_streamHandler(e,t,n){if(t.once(`error`,e=>{}),this.onStreamOpened(t),this._verifyContentType(t,n)!==!0)return;let r=n[v],i=this._retrieveHandler(r);if(!i){this._respondWithError(C(r),t,null);return}let o=(0,m.getServerInterceptingCall)([...e,...this.interceptors],t,n,null,i,this.options);this._runHandlerForCall(o,i)||o.sendStatus({code:a.Status.INTERNAL,details:`Unknown handler type: ${i.type}`})}_runHandlerForCall(e,t){let{type:n}=t;if(n===`unary`)T(e,t);else if(n===`clientStream`)E(e,t);else if(n===`serverStream`)D(e,t);else if(n===`bidi`)O(e,t);else return!1;return!0}_setupHandlers(e,t){if(e===null)return;let n=e.address(),r=`null`;n&&(r=typeof n==`string`?n:n.address+`:`+n.port),this.serverAddressString=r;let i=this.channelzEnabled?this._channelzHandler:this._streamHandler,a=this.channelzEnabled?this._channelzSessionHandler(e):this._sessionHandler(e);e.on(`stream`,i.bind(this,t)),e.on(`session`,a)}_sessionHandler(e){return t=>{var n,i;(n=this.http2Servers.get(e))==null||n.sessions.add(t);let a=null,o=null,s=null,c=!1,l=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==h){let e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;a=setTimeout(()=>{var e;c=!0,this.trace(`Connection dropped by max connection age: `+t.socket?.remoteAddress);try{t.goaway(r.constants.NGHTTP2_NO_ERROR,2147483647,y)}catch{t.destroy();return}t.close(),this.maxConnectionAgeGraceMs!==h&&(o=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),(e=o.unref)==null||e.call(o))},this.maxConnectionAgeMs+n),(i=a.unref)==null||i.call(a)}let u=()=>{s&&=(clearTimeout(s),null)},d=()=>!t.destroyed&&this.keepaliveTimeMs<g&&this.keepaliveTimeMs>0,f,p=()=>{var e;d()&&(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),s=setTimeout(()=>{u(),f()},this.keepaliveTimeMs),(e=s.unref)==null||e.call(s))};f=()=>{var e;if(!d())return;this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`);let n=``;try{t.ping((e,n,r)=>{u(),e?(this.keepaliveTrace(`Ping failed with error: `+e.message),c=!0,t.destroy()):(this.keepaliveTrace(`Received ping response`),p())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}if(n){this.keepaliveTrace(`Ping send failed: `+n),this.trace(`Connection dropped due to ping send error: `+n),c=!0,t.destroy();return}s=setTimeout(()=>{u(),this.keepaliveTrace(`Ping timeout passed without response`),this.trace(`Connection dropped by keepalive timeout`),c=!0,t.destroy()},this.keepaliveTimeoutMs),(e=s.unref)==null||e.call(s)},p(),t.on(`close`,()=>{var n;c||this.trace(`Connection dropped by client ${t.socket?.remoteAddress}`),a&&clearTimeout(a),o&&clearTimeout(o),u(),l!==null&&(clearTimeout(l.timeout),this.sessionIdleTimeouts.delete(t)),(n=this.http2Servers.get(e))==null||n.sessions.delete(t)})}}_channelzSessionHandler(e){return t=>{var n,i;let a=(0,p.registerChannelzSocket)(t.socket?.remoteAddress??`unknown`,this.getChannelzSessionInfo.bind(this,t),this.channelzEnabled),o={ref:a,streamTracker:new p.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(n=this.http2Servers.get(e))==null||n.sessions.add(t),this.sessions.set(t,o);let s=`${t.socket.remoteAddress}:${t.socket.remotePort}`;this.channelzTrace.addTrace(`CT_INFO`,`Connection established by client `+s),this.trace(`Connection established by client `+s),this.sessionChildrenTracker.refChild(a);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==h){let e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;c=setTimeout(()=>{var e;d=!0,this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by max connection age from `+s);try{t.goaway(r.constants.NGHTTP2_NO_ERROR,2147483647,y)}catch{t.destroy();return}t.close(),this.maxConnectionAgeGraceMs!==h&&(l=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),(e=l.unref)==null||e.call(l))},this.maxConnectionAgeMs+n),(i=c.unref)==null||i.call(c)}let m=()=>{u&&=(clearTimeout(u),null)},_=()=>!t.destroyed&&this.keepaliveTimeMs<g&&this.keepaliveTimeMs>0,v,b=()=>{var e;_()&&(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),u=setTimeout(()=>{m(),v()},this.keepaliveTimeMs),(e=u.unref)==null||e.call(u))};v=()=>{var e;if(!_())return;this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`);let n=``;try{t.ping((e,n,r)=>{m(),e?(this.keepaliveTrace(`Ping failed with error: `+e.message),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped due to error of a ping frame `+e.message+` return in `+n),d=!0,t.destroy()):(this.keepaliveTrace(`Received ping response`),b())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}if(n){this.keepaliveTrace(`Ping send failed: `+n),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped due to ping send error: `+n),d=!0,t.destroy();return}o.keepAlivesSent+=1,u=setTimeout(()=>{m(),this.keepaliveTrace(`Ping timeout passed without response`),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by keepalive timeout from `+s),d=!0,t.destroy()},this.keepaliveTimeoutMs),(e=u.unref)==null||e.call(u)},b(),t.on(`close`,()=>{var n;d||this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by client `+s),this.sessionChildrenTracker.unrefChild(a),(0,p.unregisterChannelzRef)(a),c&&clearTimeout(c),l&&clearTimeout(l),m(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(t)),(n=this.http2Servers.get(e))==null||n.sessions.delete(t),this.sessions.delete(t)})}}enableIdleTimeout(e){var t,n;if(this.sessionIdleTimeout>=_)return null;let r={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,e),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,e)};(n=(t=r.timeout).unref)==null||n.call(t),this.sessionIdleTimeouts.set(e,r);let{socket:i}=e;return this.trace(`Enable idle timeout for `+i.remoteAddress+`:`+i.remotePort),r}onIdleTimeout(e,t){let{socket:n}=t,r=e.sessionIdleTimeouts.get(t);r!==void 0&&r.activeStreams===0&&(Date.now()-r.lastIdle>=e.sessionIdleTimeout?(e.trace(`Session idle timeout triggered for `+n?.remoteAddress+`:`+n?.remotePort+` last idle at `+r.lastIdle),e.closeSession(t)):r.timeout.refresh())}onStreamOpened(e){let t=e.session,n=this.sessionIdleTimeouts.get(t);n&&(n.activeStreams+=1,e.once(`close`,n.onClose))}onStreamClose(e){let t=this.sessionIdleTimeouts.get(e);t&&(--t.activeStreams,t.activeStreams===0&&(t.lastIdle=Date.now(),t.timeout.refresh(),this.trace(`Session onStreamClose`+e.socket?.remoteAddress+`:`+e.socket?.remotePort+` at `+t.lastIdle)))}},(()=>{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(null):void 0;o=[S(`Calling start() is no longer necessary. It can be safely omitted.`)],n(e,null,o,{kind:`method`,name:`start`,static:!1,private:!1,access:{has:e=>`start`in e,get:e=>e.start},metadata:t},null,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();async function T(e,t){let n;function r(t,n,r,i){if(t){e.sendStatus((0,o.serverErrorToStatus)(t,r));return}e.sendMessage(n,()=>{e.sendStatus({code:a.Status.OK,details:`OK`,metadata:r??null})})}let i,s=null;e.start({onReceiveMetadata(t){i=t,e.startRead()},onReceiveMessage(n){if(s){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}s=n,e.startRead()},onReceiveHalfClose(){if(!s){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new o.ServerWritableStreamImpl(t.path,e,i,s);try{t.func(n,r)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`))}})}function E(e,t){let n;function r(t,n,r,i){if(t){e.sendStatus((0,o.serverErrorToStatus)(t,r));return}e.sendMessage(n,()=>{e.sendStatus({code:a.Status.OK,details:`OK`,metadata:r??null})})}e.start({onReceiveMetadata(i){n=new o.ServerDuplexStreamImpl(t.path,e,i);try{t.func(n,r)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){n.push(e)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}function D(e,t){let n,r,i=null;e.start({onReceiveMetadata(t){r=t,e.startRead()},onReceiveMessage(n){if(i){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}i=n,e.startRead()},onReceiveHalfClose(){if(!i){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new o.ServerWritableStreamImpl(t.path,e,r,i);try{t.func(n)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}function O(e,t){let n;e.start({onReceiveMetadata(r){n=new o.ServerDuplexStreamImpl(t.path,e,r);try{t.func(n)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){n.push(e)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}})),VA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatusBuilder=void 0,e.StatusBuilder=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}}})),HA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LeafLoadBalancer=e.PickFirstLoadBalancer=e.PickFirstLoadBalancingConfig=void 0,e.shuffled=h,e.setup=b;let t=JO(),n=XO(),r=ZO(),i=nk(),a=Y(),o=J(),c=nk(),l=s(`net`),u=ok();function d(e){a.trace(o.LogVerbosity.DEBUG,`pick_first`,e)}let f=`pick_first`;var p=class e{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return f}toJsonObject(){return{[f]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(t){if(`shuffleAddressList`in t&&typeof t.shuffleAddressList!=`boolean`)throw Error(`pick_first config field shuffleAddressList must be a boolean if provided`);return new e(t.shuffleAddressList===!0)}};e.PickFirstLoadBalancingConfig=p;var m=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:r.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function h(e){let t=e.slice();for(let e=t.length-1;e>1;e--){let n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}return t}function g(e){if(e.length===0)return[];let t=[],n=[],r=[],i=(0,c.isTcpSubchannelAddress)(e[0])&&(0,l.isIPv6)(e[0].host);for(let t of e)(0,c.isTcpSubchannelAddress)(t)&&(0,l.isIPv6)(t.host)?n.push(t):r.push(t);let a=i?n:r,o=i?r:n;for(let e=0;e<Math.max(a.length,o.length);e++)e<a.length&&t.push(a[e]),e<o.length&&t.push(o[e]);return t}let _=`grpc-node.internal.pick-first.report_health_status`;var v=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=n.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(e,t,n,r,i)=>{this.onSubchannelStateUpdate(e,t,n,i)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote=``,this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let e=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(n.ConnectivityState.READY,new m(this.currentPick),null);else if(this.latestAddressList?.length===0){let e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else if(this.children.length===0)this.updateState(n.ConnectivityState.IDLE,new r.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(n.ConnectivityState.CONNECTING,new r.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,r,i){if(this.currentPick?.realSubchannelEquals(e)){r!==n.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[t,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){r===n.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),r===n.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),t===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(t+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,r]of this.children.entries())if(t>=e){let e=r.subchannel.getConnectivityState();if(e===n.ConnectivityState.IDLE||e===n.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,r;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===n.ConnectivityState.IDLE&&(d(`Start connecting to subchannel with address `+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var t;(t=this.children[e])==null||t.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},250),(r=(t=this.connectionDelayTimeout).unref)==null||r.call(t)}pickSubchannel(e){d(`Pick subchannel with address `+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,r){d(n.ConnectivityState[this.currentState]+` -> `+n.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,r)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){d(`connectToAddressList([`+e.map(e=>(0,i.subchannelAddressToString)(e))+`])`);let r=e.map(e=>({subchannel:this.channelControlHelper.createSubchannel(e,t),hasReportedTransientFailure:!1}));for(let{subchannel:e}of r)if(e.getConnectivityState()===n.ConnectivityState.READY){this.pickSubchannel(e);return}for(let{subchannel:e}of r)e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef());this.resetSubchannelList(),this.children=r;for(let{subchannel:e}of this.children)e.addConnectivityStateListener(this.subchannelStateListener);for(let e of this.children)e.subchannel.getConnectivityState()===n.ConnectivityState.TRANSIENT_FAILURE&&(e.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,a,o){if(!(t instanceof p))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker(e.error),e.error.details),!0;let s=e.value;this.reportHealthStatus=a[_],t.getShuffleAddressList()&&(s=h(s));let c=[].concat(...s.map(e=>e.addresses));d(`updateAddressList([`+c.map(e=>(0,i.subchannelAddressToString)(e))+`])`);let l=g(c);return this.latestAddressList=l,this.latestOptions=a,this.connectToAddressList(l,a),this.latestResolutionNote=o,c.length>0?!0:(this.lastError=`No addresses resolved`,!1)}exitIdle(){this.currentState===n.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return f}};e.PickFirstLoadBalancer=v;let y=new p(!1);e.LeafLoadBalancer=class{constructor(e,i,a,o){this.endpoint=e,this.options=a,this.resolutionNote=o,this.latestState=n.ConnectivityState.IDLE;let s=(0,t.createChildChannelControlHelper)(i,{updateState:(e,t,n)=>{this.latestState=e,this.latestPicker=t,i.updateState(e,t,n)}});this.pickFirstBalancer=new v(s),this.latestPicker=new r.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,u.statusOrFromValue)([this.endpoint]),y,Object.assign(Object.assign({},this.options),{[_]:!0}),this.resolutionNote)}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==n.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};function b(){(0,t.registerLoadBalancerType)(f,v,p),(0,t.registerDefaultLoadBalancerType)(f)}})),UA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FileWatcherCertificateProvider=void 0;let t=s(`fs`),n=Y(),r=J(),i=s(`util`);function a(e){n.trace(r.LogVerbosity.DEBUG,`certificate_provider`,e)}let o=(0,i.promisify)(t.readFile);e.FileWatcherCertificateProvider=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw Error(`certificateFile and privateKeyFile must be set or unset together`);if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw Error(`At least one of certificateFile and caCertificateFile must be set`);a(`File watcher constructed with config `+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?o(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?o(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?o(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,n])=>{if(this.refreshTimer){a(`File watcher read certificates certificate `+e.status+`, privateKey `+t.status+`, CA certificate `+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status===`fulfilled`&&t.status===`fulfilled`?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,n.status===`fulfilled`?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let e of this.identityListeners)e(this.latestIdentityUpdate);for(let e of this.caListeners)e(this.latestCaUpdate)}}),a(`File watcher initiated certificate update`))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),a(`File watcher started watching`)}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&=(clearInterval(this.refreshTimer),null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}}})),WA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=e.createCertificateProviderChannelCredentials=e.FileWatcherCertificateProvider=e.createCertificateProviderServerCredentials=e.createServerCredentialsWithInterceptors=e.BaseSubchannelWrapper=e.registerAdminService=e.FilterStackFactory=e.BaseFilter=e.statusOrFromError=e.statusOrFromValue=e.PickResultType=e.QueuePicker=e.UnavailablePicker=e.ChildLoadBalancerHandler=e.EndpointMap=e.endpointHasAddress=e.endpointToString=e.subchannelAddressToString=e.LeafLoadBalancer=e.isLoadBalancerNameRegistered=e.parseLoadBalancingConfig=e.selectLbConfigFromList=e.registerLoadBalancerType=e.createChildChannelControlHelper=e.BackoffTimeout=e.parseDuration=e.durationToMs=e.splitHostPort=e.uriToString=e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=e.createResolver=e.registerResolver=e.log=e.trace=void 0;var t=Y();Object.defineProperty(e,"trace",{enumerable:!0,get:function(){return t.trace}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return t.log}});var n=KO();Object.defineProperty(e,"registerResolver",{enumerable:!0,get:function(){return n.registerResolver}}),Object.defineProperty(e,"createResolver",{enumerable:!0,get:function(){return n.createResolver}}),Object.defineProperty(e,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var r=Z();Object.defineProperty(e,"uriToString",{enumerable:!0,get:function(){return r.uriToString}}),Object.defineProperty(e,"splitHostPort",{enumerable:!0,get:function(){return r.splitHostPort}});var i=LA();Object.defineProperty(e,"durationToMs",{enumerable:!0,get:function(){return i.durationToMs}}),Object.defineProperty(e,"parseDuration",{enumerable:!0,get:function(){return i.parseDuration}});var a=QO();Object.defineProperty(e,"BackoffTimeout",{enumerable:!0,get:function(){return a.BackoffTimeout}});var o=JO();Object.defineProperty(e,"createChildChannelControlHelper",{enumerable:!0,get:function(){return o.createChildChannelControlHelper}}),Object.defineProperty(e,"registerLoadBalancerType",{enumerable:!0,get:function(){return o.registerLoadBalancerType}}),Object.defineProperty(e,"selectLbConfigFromList",{enumerable:!0,get:function(){return o.selectLbConfigFromList}}),Object.defineProperty(e,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return o.parseLoadBalancingConfig}}),Object.defineProperty(e,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return o.isLoadBalancerNameRegistered}});var s=HA();Object.defineProperty(e,"LeafLoadBalancer",{enumerable:!0,get:function(){return s.LeafLoadBalancer}});var c=nk();Object.defineProperty(e,"subchannelAddressToString",{enumerable:!0,get:function(){return c.subchannelAddressToString}}),Object.defineProperty(e,"endpointToString",{enumerable:!0,get:function(){return c.endpointToString}}),Object.defineProperty(e,"endpointHasAddress",{enumerable:!0,get:function(){return c.endpointHasAddress}}),Object.defineProperty(e,"EndpointMap",{enumerable:!0,get:function(){return c.EndpointMap}});var l=$O();Object.defineProperty(e,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return l.ChildLoadBalancerHandler}});var u=ZO();Object.defineProperty(e,"UnavailablePicker",{enumerable:!0,get:function(){return u.UnavailablePicker}}),Object.defineProperty(e,"QueuePicker",{enumerable:!0,get:function(){return u.QueuePicker}}),Object.defineProperty(e,"PickResultType",{enumerable:!0,get:function(){return u.PickResultType}});var d=ok();Object.defineProperty(e,"statusOrFromValue",{enumerable:!0,get:function(){return d.statusOrFromValue}}),Object.defineProperty(e,"statusOrFromError",{enumerable:!0,get:function(){return d.statusOrFromError}});var f=hA();Object.defineProperty(e,"BaseFilter",{enumerable:!0,get:function(){return f.BaseFilter}});var p=yA();Object.defineProperty(e,"FilterStackFactory",{enumerable:!0,get:function(){return p.FilterStackFactory}});var m=ik();Object.defineProperty(e,"registerAdminService",{enumerable:!0,get:function(){return m.registerAdminService}});var h=MA();Object.defineProperty(e,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return h.BaseSubchannelWrapper}});var g=IA();Object.defineProperty(e,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return g.createServerCredentialsWithInterceptors}}),Object.defineProperty(e,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return g.createCertificateProviderServerCredentials}});var _=UA();Object.defineProperty(e,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return _.FileWatcherCertificateProvider}});var v=qO();Object.defineProperty(e,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return v.createCertificateProviderChannelCredentials}});var y=NA();Object.defineProperty(e,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return y.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})})),GA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setup=i;let t=KO(),n=ok();var r=class{constructor(e,t,n){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let r;r=e.authority===``?`/`+e.path:e.path,this.endpoints=[{addresses:[{path:r}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,n.statusOrFromValue)(this.endpoints),{},null,``))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return`localhost`}};function i(){(0,t.registerResolver)(`unix`,r)}})),KA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setup=m;let t=s(`net`),n=ok(),r=J(),i=X(),a=KO(),o=nk(),c=Z(),l=Y();function u(e){l.trace(r.LogVerbosity.DEBUG,`ip_resolver`,e)}let d=`ipv4`,f=`ipv6`;var p=class{constructor(e,n,a){this.listener=n,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,u(`Resolver constructed for target `+(0,c.uriToString)(e));let s=[];if(!(e.scheme===d||e.scheme===f)){this.error={code:r.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new i.Metadata};return}let l=e.path.split(`,`);for(let n of l){let a=(0,c.splitHostPort)(n);if(a===null){this.error={code:r.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new i.Metadata};return}if(e.scheme===d&&!(0,t.isIPv4)(a.host)||e.scheme===f&&!(0,t.isIPv6)(a.host)){this.error={code:r.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new i.Metadata};return}s.push({host:a.host,port:a.port??443})}this.endpoints=s.map(e=>({addresses:[e]})),u(`Parsed `+e.scheme+` address list `+s.map(o.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,n.statusOrFromError)(this.error),{},null,``):this.listener((0,n.statusOrFromValue)(this.endpoints),{},null,``)}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(`,`)[0]}};function m(){(0,a.registerResolver)(d,p),(0,a.registerResolver)(f,p)}})),qA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RoundRobinLoadBalancer=void 0,e.setup=m;let t=JO(),n=XO(),r=ZO(),i=Y(),a=J(),o=nk(),s=HA();function c(e){i.trace(a.LogVerbosity.DEBUG,`round_robin`,e)}let l=`round_robin`;var u=class e{getLoadBalancerName(){return l}constructor(){}toJsonObject(){return{[l]:{}}}static createFromJson(t){return new e}},d=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function f(e,t){return[...e.slice(t),...e.slice(0,t)]}var p=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=n.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,t.createChildChannelControlHelper)(e,{updateState:(e,t,r)=>{this.currentState===n.ConnectivityState.READY&&e!==n.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),r&&(this.lastError=r),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(n.ConnectivityState.READY)>0){let e=this.children.filter(e=>e.getConnectivityState()===n.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(e=>(0,o.endpointEqual)(e.getEndpoint(),n)),t<0&&(t=0)}this.updateState(n.ConnectivityState.READY,new d(e.map(e=>({endpoint:e.getEndpoint(),picker:e.getPicker()})),t),null)}else if(this.countChildrenWithState(n.ConnectivityState.CONNECTING)>0)this.updateState(n.ConnectivityState.CONNECTING,new r.QueuePicker(this),null);else if(this.countChildrenWithState(n.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(n.ConnectivityState.IDLE,new r.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===n.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t,r){c(n.ConnectivityState[this.currentState]+` -> `+n.ConnectivityState[e]),e===n.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,r)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,t,i,a){if(!(t instanceof u))return!1;if(!e.ok)return this.children.length===0&&this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker(e.error),e.error.details),!0;let l=Math.random()*e.value.length|0,d=f(e.value,l);if(this.resetSubchannelList(),d.length===0){let e=`No addresses resolved. Resolution note: ${a}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}c(`Connect to endpoint list `+d.map(o.endpointToString)),this.updatesPaused=!0,this.children=d.map(e=>new s.LeafLoadBalancer(e,this.childChannelControlHelper,i,a));for(let e of this.children)e.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return l}};e.RoundRobinLoadBalancer=p;function m(){(0,t.registerLoadBalancerType)(l,p,u)}})),JA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OutlierDetectionLoadBalancer=e.OutlierDetectionLoadBalancingConfig=void 0,e.setup=T;let t=XO(),n=J(),r=LA(),i=WA(),a=JO(),o=$O(),s=ZO(),c=nk(),l=MA(),u=Y();function d(e){u.trace(n.LogVerbosity.DEBUG,`outlier_detection`,e)}let f=`outlier_detection`,p=(process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION??`true`)===`true`,m={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},h={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function g(e,t,n,r){if(t in e&&e[t]!==void 0&&typeof e[t]!==n){let i=r?`${r}.${t}`:t;throw Error(`outlier detection config ${i} parse error: expected ${n}, got ${typeof e[t]}`)}}function _(e,t,n){let i=n?`${n}.${t}`:t;if(t in e&&e[t]!==void 0){if(!(0,r.isDuration)(e[t]))throw Error(`outlier detection config ${i} parse error: expected Duration, got ${typeof e[t]}`);if(!(e[t].seconds>=0&&e[t].seconds<=315576e6&&e[t].nanos>=0&&e[t].nanos<=999999999))throw Error(`outlier detection config ${i} parse error: values out of range for non-negative Duaration`)}}function v(e,t,n){let r=n?`${n}.${t}`:t;if(g(e,t,`number`,n),t in e&&e[t]!==void 0&&!(e[t]>=0&&e[t]<=100))throw Error(`outlier detection config ${r} parse error: value out of range for percentage (0-100)`)}var y=class e{constructor(e,t,n,r,i,a,o){if(this.childPolicy=o,o.getLoadBalancerName()===`pick_first`)throw Error(`outlier_detection LB policy cannot have a pick_first child policy`);this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=r??10,this.successRateEjection=i?Object.assign(Object.assign({},m),i):null,this.failurePercentageEjection=a?Object.assign(Object.assign({},h),a):null}getLoadBalancerName(){return f}toJsonObject(){return{outlier_detection:{interval:(0,r.msToDuration)(this.intervalMs),base_ejection_time:(0,r.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,r.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:this.successRateEjection??void 0,failure_percentage_ejection:this.failurePercentageEjection??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(t){if(_(t,`interval`),_(t,`base_ejection_time`),_(t,`max_ejection_time`),v(t,`max_ejection_percent`),`success_rate_ejection`in t&&t.success_rate_ejection!==void 0){if(typeof t.success_rate_ejection!=`object`)throw Error(`outlier detection config success_rate_ejection must be an object`);g(t.success_rate_ejection,`stdev_factor`,`number`,`success_rate_ejection`),v(t.success_rate_ejection,`enforcement_percentage`,`success_rate_ejection`),g(t.success_rate_ejection,`minimum_hosts`,`number`,`success_rate_ejection`),g(t.success_rate_ejection,`request_volume`,`number`,`success_rate_ejection`)}if(`failure_percentage_ejection`in t&&t.failure_percentage_ejection!==void 0){if(typeof t.failure_percentage_ejection!=`object`)throw Error(`outlier detection config failure_percentage_ejection must be an object`);v(t.failure_percentage_ejection,`threshold`,`failure_percentage_ejection`),v(t.failure_percentage_ejection,`enforcement_percentage`,`failure_percentage_ejection`),g(t.failure_percentage_ejection,`minimum_hosts`,`number`,`failure_percentage_ejection`),g(t.failure_percentage_ejection,`request_volume`,`number`,`failure_percentage_ejection`)}if(!(`child_policy`in t)||!Array.isArray(t.child_policy))throw Error(`outlier detection config child_policy must be an array`);let n=(0,a.selectLbConfigFromList)(t.child_policy);if(!n)throw Error(`outlier detection config child_policy: no valid recognized policy found`);return new e(t.interval?(0,r.durationToMs)(t.interval):null,t.base_ejection_time?(0,r.durationToMs)(t.base_ejection_time):null,t.max_ejection_time?(0,r.durationToMs)(t.max_ejection_time):null,t.max_ejection_percent??null,t.success_rate_ejection,t.failure_percentage_ejection,n)}};e.OutlierDetectionLoadBalancingConfig=y;var b=class extends l.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),--this.refCount,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function x(){return{success:0,failure:0}}var S=class{constructor(){this.activeBucket=x(),this.inactiveBucket=x()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=x()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},C=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===s.PickResultType.COMPLETE){let e=t.subchannel,r=e.getMapEntry();if(r){let i=t.onCallEnded;return this.countCalls&&(i=(e,i,a)=>{var o;e===n.Status.OK?r.counter.addSuccess():r.counter.addFailure(),(o=t.onCallEnded)==null||o.call(t,e,i,a)}),Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel(),onCallEnded:i})}else return Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel()})}else return t}},w=class{constructor(e){this.entryMap=new c.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new o.ChildLoadBalancerHandler((0,i.createChildChannelControlHelper)(e,{createSubchannel:(t,n)=>{let r=e.createSubchannel(t,n),i=this.entryMap.getForSubchannelAddress(t),a=new b(r,i);return i?.currentEjectionTimestamp!==null&&a.eject(),i?.subchannelWrappers.push(a),a},updateState:(n,r,i)=>{n===t.ConnectivityState.READY?e.updateState(n,new C(r,this.isCountingEnabled()),i):e.updateState(n,r,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;d(`Running success rate check`);let n=t.request_volume,r=0,i=[];for(let[e,t]of this.entryMap.entries()){let a=t.counter.getLastSuccesses(),o=t.counter.getLastFailures();d(`Stats for `+(0,c.endpointToString)(e)+`: successes=`+a+` failures=`+o+` targetRequestVolume=`+n),a+o>=n&&(r+=1,i.push(a/(a+o)))}if(d(`Found `+r+` success rate candidates; currentEjectionPercent=`+this.getCurrentEjectionPercent()+` successRates=[`+i+`]`),r<t.minimum_hosts)return;let a=i.reduce((e,t)=>e+t)/i.length,o=0;for(let e of i){let t=e-a;o+=t*t}let s=o/i.length,l=Math.sqrt(s),u=a-l*(t.stdev_factor/1e3);d(`stdev=`+l+` ejectionThreshold=`+u);for(let[r,i]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let a=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();if(a+o<n)continue;let s=a/(a+o);if(d(`Checking candidate `+r+` successRate=`+s),s<u){let n=Math.random()*100;d(`Candidate `+r+` randomNumber=`+n+` enforcement_percentage=`+t.enforcement_percentage),n<t.enforcement_percentage&&(d(`Ejecting candidate `+r),this.eject(i,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;d(`Running failure percentage check. threshold=`+t.threshold+` request volume threshold=`+t.request_volume);let n=0;for(let e of this.entryMap.values())e.counter.getLastSuccesses()+e.counter.getLastFailures()>=t.request_volume&&(n+=1);if(!(n<t.minimum_hosts))for(let[n,r]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let i=r.counter.getLastSuccesses(),a=r.counter.getLastFailures();if(d(`Candidate successes=`+i+` failures=`+a),!(i+a<t.request_volume)&&a*100/(a+i)>t.threshold){let i=Math.random()*100;d(`Candidate `+n+` randomNumber=`+i+` enforcement_percentage=`+t.enforcement_percentage),i<t.enforcement_percentage&&(d(`Ejecting candidate `+n),this.eject(r,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let t of e.subchannelWrappers)t.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(t=this.ejectionTimer).unref)==null||n.call(t)}runChecks(){let e=new Date;if(d(`Ejection timer running`),this.switchAllBuckets(),this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[e,t]of this.entryMap.entries())if(t.currentEjectionTimestamp===null)t.ejectionTimeMultiplier>0&&--t.ejectionTimeMultiplier;else{let n=this.latestConfig.getBaseEjectionTimeMs(),r=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(t.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(n*t.ejectionTimeMultiplier,Math.max(n,r))),i<new Date&&(d(`Unejecting `+e),this.uneject(t))}}}updateAddressList(e,t,n,r){if(!(t instanceof y))return!1;if(d(`Received update with config: `+JSON.stringify(t.toJsonObject(),void 0,2)),e.ok){for(let t of e.value)this.entryMap.has(t)||(d(`Adding map entry for `+(0,c.endpointToString)(t)),this.entryMap.set(t,{counter:new S,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let i=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,i,n,r),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){d(`Previous timer existed. Replacing timer`),clearTimeout(this.ejectionTimer);let e=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(e)}else d(`Starting new timer`),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{d(`Counting disabled. Cancelling timer.`),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let e of this.entryMap.values())this.uneject(e),e.ejectionTimeMultiplier=0}return this.latestConfig=t,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return f}};e.OutlierDetectionLoadBalancer=w;function T(){p&&(0,i.registerLoadBalancerType)(f,w,y)}})),YA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PriorityQueue=void 0;let t=e=>Math.floor(e/2),n=e=>e*2+1,r=e=>e*2+2;e.PriorityQueue=class{constructor(e=(e,t)=>e>t){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[0]}push(...e){return e.forEach(e=>{this.heap.push(e),this.siftUp()}),this.size()}pop(){let e=this.peek(),t=this.size()-1;return t>0&&this.swap(0,t),this.heap.pop(),this.siftDown(),e}replace(e){let t=this.peek();return this.heap[0]=e,this.siftDown(),t}greater(e,t){return this.comparator(this.heap[e],this.heap[t])}swap(e,t){[this.heap[e],this.heap[t]]=[this.heap[t],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>0&&this.greater(e,t(e));)this.swap(e,t(e)),e=t(e)}siftDown(){let e=0;for(;n(e)<this.size()&&this.greater(n(e),e)||r(e)<this.size()&&this.greater(r(e),e);){let t=r(e)<this.size()&&this.greater(r(e),n(e))?r(e):n(e);this.swap(e,t),e=t}}}})),XA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WeightedRoundRobinLoadBalancingConfig=void 0,e.setup=v;let t=XO(),n=J(),r=LA(),i=JO(),a=HA(),o=Y(),s=RA(),c=ZO(),l=YA(),u=nk();function d(e){o.trace(n.LogVerbosity.DEBUG,`weighted_round_robin`,e)}let f=`weighted_round_robin`;function p(e,t,n){if(t in e&&e[t]!==void 0&&typeof e[t]!==n)throw Error(`weighted round robin config ${t} parse error: expected ${n}, got ${typeof e[t]}`)}function m(e,t){if(t in e&&e[t]!==void 0&&e[t]!==null){let n;if((0,r.isDuration)(e[t]))n=e[t];else if((0,r.isDurationMessage)(e[t]))n=(0,r.durationMessageToDuration)(e[t]);else if(typeof e[t]==`string`){let i=(0,r.parseDuration)(e[t]);if(!i)throw Error(`weighted round robin config ${t}: failed to parse duration string ${e[t]}`);n=i}else throw Error(`weighted round robin config ${t}: expected duration, got ${typeof e[t]}`);return(0,r.durationToMs)(n)}return null}var h=class e{constructor(e,t,n,r,i,a){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=t??1e4,this.blackoutPeriodMs=n??1e4,this.weightExpirationPeriodMs=r??18e4,this.weightUpdatePeriodMs=Math.max(i??1e3,100),this.errorUtilizationPenalty=a??1}getLoadBalancerName(){return f}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,r.durationToString)((0,r.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,r.durationToString)((0,r.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,r.durationToString)((0,r.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,r.durationToString)((0,r.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(t){if(p(t,`enable_oob_load_report`,`boolean`),p(t,`error_utilization_penalty`,`number`),t.error_utilization_penalty<0)throw Error(`weighted round robin config error_utilization_penalty < 0`);return new e(t.enable_oob_load_report,m(t,`oob_load_reporting_period`),m(t,`blackout_period`),m(t,`weight_expiration_period`),m(t,`weight_update_period`),t.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}};e.WeightedRoundRobinLoadBalancingConfig=h;var g=class{constructor(e,t){this.metricsHandler=t,this.queue=new l.PriorityQueue((e,t)=>e.deadline<t.deadline);let n=e.filter(e=>e.weight>0),r;if(n.length<2)r=1;else{let e=0;for(let{weight:t}of n)e+=t;r=e/n.length}for(let t of e){let e=t.weight>0?1/t.weight:r;this.queue.push({endpointName:t.endpointName,picker:t.picker,period:e,deadline:Math.random()*e})}}pick(e){let t=this.queue.pop();this.queue.push(Object.assign(Object.assign({},t),{deadline:t.deadline+t.period}));let n=t.picker.pick(e);if(n.pickResultType===c.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,s.createMetricsReader)(e=>this.metricsHandler(e,t.endpointName),n.onCallEnded)});{let e=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:e.getWrappedSubchannel()})}}else return n}},_=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=t.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let t=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(t+=1);return t}updateWeight(e,t){let n=t.rps_fractional,r=t.application_utilization;r>0&&n>0&&(r+=t.eps/n*(this.latestConfig?.getErrorUtilizationPenalty()??0));let i=r===0?0:n/r;if(i===0)return;let a=new Date;e.nonEmptySince===null&&(e.nonEmptySince=a),e.lastUpdated=a,e.weight=i}getWeight(e){if(!this.latestConfig)return 0;let t=new Date().getTime();if(t-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||t-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(t.ConnectivityState.READY)>0){let e=[];for(let[n,r]of this.children)r.child.getConnectivityState()===t.ConnectivityState.READY&&e.push({endpointName:n,picker:r.child.getPicker(),weight:this.getWeight(r)});d(`Created picker with weights: `+e.map(e=>e.endpointName+`:`+e.weight).join(`,`));let n;n=this.latestConfig.getEnableOobLoadReport()?null:(e,t)=>{let n=this.children.get(t);n&&this.updateWeight(n,e)},this.updateState(t.ConnectivityState.READY,new g(e,n),null)}else if(this.countChildrenWithState(t.ConnectivityState.CONNECTING)>0)this.updateState(t.ConnectivityState.CONNECTING,new c.QueuePicker(this),null);else if(this.countChildrenWithState(t.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker({details:e}),e)}else this.updateState(t.ConnectivityState.IDLE,new c.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===t.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,n,r){d(t.ConnectivityState[this.currentState]+` -> `+t.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,n,r)}updateAddressList(e,n,r,o){var l;if(!(n instanceof h))return!1;if(!e.ok)return this.children.size===0&&this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let e=`No addresses resolved. Resolution note: ${o}`;return this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker({details:e}),e),!1}d(`Connect to endpoint list `+e.value.map(u.endpointToString));let f=new Date,p=new Set;this.updatesPaused=!0,this.latestConfig=n;for(let c of e.value){let e=(0,u.endpointToString)(c);p.add(e);let l=this.children.get(e);l||(l={child:new a.LeafLoadBalancer(c,(0,i.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(e,n,r)=>{this.currentState===t.ConnectivityState.READY&&e!==t.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),e===t.ConnectivityState.READY&&(l.nonEmptySince=null),r&&(this.lastError=r),this.calculateAndUpdateState()},createSubchannel:(e,t)=>{let n=this.channelControlHelper.createSubchannel(e,t);return l?.oobMetricsListener?new s.OrcaOobMetricsSubchannelWrapper(n,l.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):n}}),r,o),lastUpdated:f,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(e,l)),n.getEnableOobLoadReport()?l.oobMetricsListener=e=>{this.updateWeight(l,e)}:l.oobMetricsListener=null}for(let[e,t]of this.children)p.has(e)?t.child.startConnecting():(t.child.destroy(),this.children.delete(e));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(l=setInterval(()=>{this.currentState===t.ConnectivityState.READY&&this.calculateAndUpdateState()},n.getWeightUpdatePeriodMs())).unref?.call(l),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return f}};function v(){(0,i.registerLoadBalancerType)(f,_,h)}})),ZA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.experimental=e.ServerMetricRecorder=e.ServerInterceptingCall=e.ResponderBuilder=e.ServerListenerBuilder=e.addAdminServicesToServer=e.getChannelzHandlers=e.getChannelzServiceDefinition=e.InterceptorConfigurationError=e.InterceptingCall=e.RequesterBuilder=e.ListenerBuilder=e.StatusBuilder=e.getClientChannel=e.ServerCredentials=e.Server=e.setLogVerbosity=e.setLogger=e.load=e.loadObject=e.CallCredentials=e.ChannelCredentials=e.waitForClientReady=e.closeClient=e.Channel=e.makeGenericClientConstructor=e.makeClientConstructor=e.loadPackageDefinition=e.Client=e.compressionAlgorithms=e.propagate=e.connectivityState=e.status=e.logVerbosity=e.Metadata=e.credentials=void 0;let t=WO();Object.defineProperty(e,"CallCredentials",{enumerable:!0,get:function(){return t.CallCredentials}});let n=PA();Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.ChannelImplementation}});let r=mA();Object.defineProperty(e,"compressionAlgorithms",{enumerable:!0,get:function(){return r.CompressionAlgorithms}});let i=XO();Object.defineProperty(e,"connectivityState",{enumerable:!0,get:function(){return i.ConnectivityState}});let a=qO();Object.defineProperty(e,"ChannelCredentials",{enumerable:!0,get:function(){return a.ChannelCredentials}});let o=ck();Object.defineProperty(e,"Client",{enumerable:!0,get:function(){return o.Client}});let s=J();Object.defineProperty(e,"logVerbosity",{enumerable:!0,get:function(){return s.LogVerbosity}}),Object.defineProperty(e,"status",{enumerable:!0,get:function(){return s.Status}}),Object.defineProperty(e,"propagate",{enumerable:!0,get:function(){return s.Propagate}});let c=Y(),l=lk();Object.defineProperty(e,"loadPackageDefinition",{enumerable:!0,get:function(){return l.loadPackageDefinition}}),Object.defineProperty(e,"makeClientConstructor",{enumerable:!0,get:function(){return l.makeClientConstructor}}),Object.defineProperty(e,"makeGenericClientConstructor",{enumerable:!0,get:function(){return l.makeClientConstructor}});let u=X();Object.defineProperty(e,"Metadata",{enumerable:!0,get:function(){return u.Metadata}});let d=BA();Object.defineProperty(e,"Server",{enumerable:!0,get:function(){return d.Server}});let f=IA();Object.defineProperty(e,"ServerCredentials",{enumerable:!0,get:function(){return f.ServerCredentials}});let p=VA();Object.defineProperty(e,"StatusBuilder",{enumerable:!0,get:function(){return p.StatusBuilder}}),e.credentials={combineChannelCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),combineCallCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),createInsecure:a.ChannelCredentials.createInsecure,createSsl:a.ChannelCredentials.createSsl,createFromSecureContext:a.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:t.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:t.CallCredentials.createFromGoogleCredential,createEmpty:t.CallCredentials.createEmpty},e.closeClient=e=>e.close(),e.waitForClientReady=(e,t,n)=>e.waitForReady(t,n),e.loadObject=(e,t)=>{throw Error(`Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead`)},e.load=(e,t,n)=>{throw Error(`Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead`)},e.setLogger=e=>{c.setLogger(e)},e.setLogVerbosity=e=>{c.setLoggerVerbosity(e)},e.getClientChannel=e=>o.Client.prototype.getChannel.call(e);var m=sk();Object.defineProperty(e,"ListenerBuilder",{enumerable:!0,get:function(){return m.ListenerBuilder}}),Object.defineProperty(e,"RequesterBuilder",{enumerable:!0,get:function(){return m.RequesterBuilder}}),Object.defineProperty(e,"InterceptingCall",{enumerable:!0,get:function(){return m.InterceptingCall}}),Object.defineProperty(e,"InterceptorConfigurationError",{enumerable:!0,get:function(){return m.InterceptorConfigurationError}});var h=fA();Object.defineProperty(e,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return h.getChannelzServiceDefinition}}),Object.defineProperty(e,"getChannelzHandlers",{enumerable:!0,get:function(){return h.getChannelzHandlers}});var g=ik();Object.defineProperty(e,"addAdminServicesToServer",{enumerable:!0,get:function(){return g.addAdminServicesToServer}});var _=zA();Object.defineProperty(e,"ServerListenerBuilder",{enumerable:!0,get:function(){return _.ServerListenerBuilder}}),Object.defineProperty(e,"ResponderBuilder",{enumerable:!0,get:function(){return _.ResponderBuilder}}),Object.defineProperty(e,"ServerInterceptingCall",{enumerable:!0,get:function(){return _.ServerInterceptingCall}});var v=RA();Object.defineProperty(e,"ServerMetricRecorder",{enumerable:!0,get:function(){return v.ServerMetricRecorder}}),e.experimental=WA();let y=CA(),b=GA(),x=KA(),S=HA(),C=qA(),w=JA(),T=XA(),E=fA();y.setup(),b.setup(),x.setup(),S.setup(),C.setup(),w.setup(),T.setup(),E.setup()})),QA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createServiceClientConstructor=void 0;let t=ZA();function n(e,n){let r={export:{path:e,requestStream:!1,responseStream:!1,requestSerialize:e=>e,requestDeserialize:e=>e,responseSerialize:e=>e,responseDeserialize:e=>e}};return t.makeGenericClientConstructor(r,n)}e.createServiceClientConstructor=n})),$A=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createOtlpGrpcExporterTransport=e.GrpcExporterTransport=e.createEmptyMetadata=e.createSslCredentials=e.createInsecureCredentials=void 0;let t=`OTel-OTLP-Exporter-JavaScript/${VO().VERSION}`;function n(e){return e?`${e} ${t}`:t}function r(e){return e===`gzip`?2:0}function i(){let{credentials:e}=ZA();return e.createInsecure()}e.createInsecureCredentials=i;function a(e,t,n){let{credentials:r}=ZA();return r.createSsl(e,t,n)}e.createSslCredentials=a;function o(){let{Metadata:e}=ZA();return new e}e.createEmptyMetadata=o;var s=class{_client;_metadata;_parameters;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,t){let i=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:e}=QA();try{this._metadata=this._parameters.metadata()}catch(e){return Promise.resolve({status:`failure`,error:e})}let t=e(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new t(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":r(this._parameters.compression),"grpc.primary_user_agent":n(this._parameters.userAgent)})}catch(e){return Promise.resolve({status:`failure`,error:e})}}return new Promise(e=>{let n=Date.now()+t;if(this._metadata==null)return e({error:Error(`metadata was null`),status:`failure`});this._client.export(i,this._metadata,{deadline:n},(t,n)=>{e(t?{status:`failure`,error:t}:{data:n,status:`success`})})})}};e.GrpcExporterTransport=s;function c(e){return new s(e)}e.createOtlpGrpcExporterTransport=c})),ej=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getOtlpGrpcDefaultConfiguration=e.mergeOtlpGrpcConfigurationWithDefaults=e.validateAndNormalizeUrl=void 0;let t=(BE(),i(zE)),n=$A(),r=s(`url`),a=(c(),i(d));function o(e){e=e.trim(),e.match(/^([\w]{1,8}):\/\//)||(e=`https://${e}`);let t=new r.URL(e);return t.protocol===`unix:`?e:(t.pathname&&t.pathname!==`/`&&a.diag.warn(`URL path should not be set when using grpc, the path part of the URL will be ignored.`),t.protocol!==``&&!t.protocol?.match(/^(http)s?:$/)&&a.diag.warn(`URL protocol should be http(s)://. Using http://.`),t.host)}e.validateAndNormalizeUrl=o;function l(e,t){for(let[n,r]of Object.entries(t.getMap()))e.get(n).length<1&&e.set(n,r)}function u(e,r,i){let a=e.url??r.url??i.url;return{...(0,t.mergeOtlpSharedConfigurationWithDefaults)(e,r,i),metadata:()=>{let t=i.metadata();return l(t,e.metadata?.().clone()??(0,n.createEmptyMetadata)()),l(t,r.metadata?.()??(0,n.createEmptyMetadata)()),t},url:o(a),credentials:e.credentials??r.credentials?.(a)??i.credentials(a),userAgent:e.userAgent}}e.mergeOtlpGrpcConfigurationWithDefaults=u;function f(){return{...(0,t.getSharedConfigurationDefaults)(),metadata:()=>(0,n.createEmptyMetadata)(),url:`http://localhost:4317`,credentials:e=>e.startsWith(`http://`)?()=>(0,n.createInsecureCredentials)():()=>(0,n.createSslCredentials)()}}e.getOtlpGrpcDefaultConfiguration=f})),tj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getOtlpGrpcConfigurationFromEnv=void 0;let t=q(),n=$A(),r=(IO(),i(FO)),a=s(`fs`),o=s(`path`),l=(c(),i(d));function u(e,t){if(e!=null&&e!==``)return e;if(t!=null&&t!==``)return t}function f(e){let r=process.env[`OTEL_EXPORTER_OTLP_${e}_HEADERS`]?.trim(),i=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),a=(0,t.parseKeyPairsIntoRecord)(r),o=(0,t.parseKeyPairsIntoRecord)(i);if(Object.keys(a).length===0&&Object.keys(o).length===0)return;let s=Object.assign({},o,a),c=(0,n.createEmptyMetadata)();for(let[e,t]of Object.entries(s))c.set(e,t);return c}function p(e){let t=f(e);if(t!=null)return()=>t}function m(e){let t=process.env[`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`]?.trim(),n=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return u(t,n)}function h(e){let t=process.env[`OTEL_EXPORTER_OTLP_${e}_INSECURE`]?.toLowerCase().trim(),n=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return u(t,n)===`true`}function g(e,t,n){let r=process.env[e]?.trim(),i=process.env[t]?.trim(),s=u(r,i);if(s!=null)try{return a.readFileSync(o.resolve(process.cwd(),s))}catch{l.diag.warn(n);return}else return}function _(e){return g(`OTEL_EXPORTER_OTLP_${e}_CLIENT_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`,`Failed to read client certificate chain file`)}function v(e){return g(`OTEL_EXPORTER_OTLP_${e}_CLIENT_KEY`,`OTEL_EXPORTER_OTLP_CLIENT_KEY`,`Failed to read client certificate private key file`)}function y(e){return g(`OTEL_EXPORTER_OTLP_${e}_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CERTIFICATE`,`Failed to read root certificate file`)}function b(e){let t=v(e),r=_(e),i=y(e);return i!=null&&!(t!=null&&r!=null)?(l.diag.warn(`Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate`),(0,n.createSslCredentials)(y(e))):(0,n.createSslCredentials)(i,t,r)}function x(e){return h(e)?(0,n.createInsecureCredentials)():b(e)}function S(e){return{...(0,r.getSharedConfigurationFromEnvironment)(e),metadata:p(e),url:m(e),credentials:t=>t.startsWith(`http://`)?()=>(0,n.createInsecureCredentials)():t.startsWith(`https://`)?()=>b(e):()=>x(e)}}e.getOtlpGrpcConfigurationFromEnv=S})),nj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertLegacyOtlpGrpcOptions=void 0;let t=ej(),n=$A(),r=tj();function i(e,i){let a=e.credentials;return(0,t.mergeOtlpGrpcConfigurationWithDefaults)({url:e.url,metadata:()=>e.metadata??(0,n.createEmptyMetadata)(),compression:e.compression,timeoutMillis:e.timeoutMillis,concurrencyLimit:e.concurrencyLimit,credentials:a==null?void 0:()=>a,userAgent:e.userAgent},(0,r.getOtlpGrpcConfigurationFromEnv)(i),(0,t.getOtlpGrpcDefaultConfiguration)())}e.convertLegacyOtlpGrpcOptions=i})),rj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createOtlpGrpcExportDelegate=void 0;let t=(BE(),i(zE)),n=$A();function r(e,r,i,a){return(0,t.createOtlpNetworkExportDelegate)(e,r,(0,n.createOtlpGrpcExporterTransport)({address:e.url,compression:e.compression,credentials:e.credentials,metadata:e.metadata,userAgent:e.userAgent,grpcName:i,grpcPath:a}))}e.createOtlpGrpcExportDelegate=r})),ij=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createOtlpGrpcExportDelegate=e.convertLegacyOtlpGrpcOptions=void 0;var t=nj();Object.defineProperty(e,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return t.convertLegacyOtlpGrpcOptions}});var n=rj();Object.defineProperty(e,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return n.createOtlpGrpcExportDelegate}})})),aj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;let t=BO(),n=ij(),r=ED();e.OTLPMetricExporter=class extends t.OTLPMetricExporterBase{constructor(e){super((0,n.createOtlpGrpcExportDelegate)((0,n.convertLegacyOtlpGrpcOptions)(e??{},`METRICS`),r.ProtobufMetricsSerializer,`MetricsExportService`,`/opentelemetry.proto.collector.metrics.v1.MetricsService/Export`),e)}}})),oj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=aj();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})})),sj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrometheusSerializer=void 0;let t=(c(),i(d)),n=mE(),r=q(),a=(Xw(),i(Yw));function o(e){return e.replace(/\\/g,`\\\\`).replace(/\n/g,`\\n`)}function s(e=``){return typeof e!=`string`&&(e=JSON.stringify(e)),o(e).replace(/"/g,`\\"`)}let l=/[^a-z0-9_]/gi,u=/_{2,}/g;function f(e){return e.replace(l,`_`).replace(u,`_`)}function p(e,t){return!e.endsWith(`_total`)&&t.dataPointType===n.DataPointType.SUM&&t.isMonotonic&&(e+=`_total`),e}function m(e){return e===1/0?`+Inf`:e===-1/0?`-Inf`:`${e}`}function h(e){switch(e.dataPointType){case n.DataPointType.SUM:return e.isMonotonic?`counter`:`gauge`;case n.DataPointType.GAUGE:return`gauge`;case n.DataPointType.HISTOGRAM:return`histogram`;default:return`untyped`}}function g(e,t,n,r,i){let a=!1,o=``;for(let[e,n]of Object.entries(t)){let t=f(e);a=!0,o+=`${o.length>0?`,`:``}${t}="${s(n)}"`}if(i)for(let[e,t]of Object.entries(i)){let n=f(e);a=!0,o+=`${o.length>0?`,`:``}${n}="${s(t)}"`}return a&&(e+=`{${o}}`),`${e} ${m(n)}${r===void 0?``:` `+String(r)}\n`}e.PrometheusSerializer=class{_prefix;_appendTimestamp;_additionalAttributes;_withResourceConstantLabels;_withoutScopeInfo;_withoutTargetInfo;constructor(e,t=!1,n,r,i){e&&(this._prefix=e+`_`),this._appendTimestamp=t,this._withResourceConstantLabels=n,this._withoutScopeInfo=!!i,this._withoutTargetInfo=!!r}serialize(e){let t=``;this._additionalAttributes=this._filterResourceConstantLabels(e.resource.attributes,this._withResourceConstantLabels);for(let n of e.scopeMetrics)t+=this._serializeScopeMetrics(n);return t===``&&(t+=`# no registered metrics`),this._serializeResource(e.resource)+t}_filterResourceConstantLabels(e,t){if(t){let n={};for(let[r,i]of Object.entries(e))r.match(t)&&(n[r]=i);return n}}_serializeScopeMetrics(e){let t=``;for(let n of e.metrics)t+=this._serializeMetricData(n,e.scope)+`
120
- `;return t}_serializeMetricData(e,r){let i=f(o(e.descriptor.name));this._prefix&&(i=`${this._prefix}${i}`);let s=e.dataPointType;i=p(i,e);let c=`# HELP ${i} ${o(e.descriptor.description||`description missing`)}`,l=e.descriptor.unit?`\n# UNIT ${i} ${o(e.descriptor.unit)}`:``,u=`# TYPE ${i} ${h(e)}`,d;if(this._withoutScopeInfo)d=this._additionalAttributes;else{let e={[a.ATTR_OTEL_SCOPE_NAME]:r.name};r.schemaUrl&&(e[`otel.scope.schema_url`]=r.schemaUrl),r.version&&(e[a.ATTR_OTEL_SCOPE_VERSION]=r.version),d=Object.assign(e,this._additionalAttributes)}let m=``;switch(s){case n.DataPointType.SUM:case n.DataPointType.GAUGE:m=e.dataPoints.map(t=>this._serializeSingularDataPoint(i,e,t,d)).join(``);break;case n.DataPointType.HISTOGRAM:m=e.dataPoints.map(t=>this._serializeHistogramDataPoint(i,e,t,d)).join(``);break;default:t.diag.error(`Unrecognizable DataPointType: ${s} for metric "${i}"`)}return`${c}${l}\n${u}\n${m}`.trim()}_serializeSingularDataPoint(e,t,n,i){let a=``,{value:o,attributes:s}=n,c=(0,r.hrTimeToMilliseconds)(n.endTime);return a+=g(e,s,o,this._appendTimestamp?c:void 0,i),a}_serializeHistogramDataPoint(e,t,n,i){let a=``,o=n.attributes,s=n.value,c=(0,r.hrTimeToMilliseconds)(n.endTime);for(let t of[`count`,`sum`]){let n=s[t];n!=null&&(a+=g(e+`_`+t,o,n,this._appendTimestamp?c:void 0,i))}let l=0,u=s.buckets.counts.entries(),d=!1;for(let[t,n]of u){l+=n;let r=s.buckets.boundaries[t];if(r===void 0&&d)break;r===1/0&&(d=!0),a+=g(e+`_bucket`,o,l,this._appendTimestamp?c:void 0,Object.assign({},i,{le:r===void 0||r===1/0?`+Inf`:String(r)}))}return a}_serializeResource(e){if(this._withoutTargetInfo===!0)return``;let t=`target_info`;return`${`# HELP ${t} Target metadata`}\n${`# TYPE ${t} gauge`}\n${g(t,e.attributes,1).trim()}\n`}}})),cj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrometheusExporter=void 0;let t=(c(),i(d)),n=q(),r=mE(),a=s(`http`),o=sj(),l=s(`url`);e.PrometheusExporter=class e extends r.MetricReader{static DEFAULT_OPTIONS={host:void 0,port:9464,endpoint:`/metrics`,prefix:``,appendTimestamp:!1,withResourceConstantLabels:void 0,withoutScopeInfo:!1,withoutTargetInfo:!1};_host;_port;_baseUrl;_endpoint;_server;_prefix;_appendTimestamp;_serializer;_startServerPromise;constructor(n={},i=()=>{}){super({aggregationSelector:e=>({type:r.AggregationType.DEFAULT}),aggregationTemporalitySelector:e=>r.AggregationTemporality.CUMULATIVE,metricProducers:n.metricProducers}),this._host=n.host||process.env.OTEL_EXPORTER_PROMETHEUS_HOST||e.DEFAULT_OPTIONS.host,this._port=n.port||Number(process.env.OTEL_EXPORTER_PROMETHEUS_PORT)||e.DEFAULT_OPTIONS.port,this._prefix=n.prefix||e.DEFAULT_OPTIONS.prefix,this._appendTimestamp=typeof n.appendTimestamp==`boolean`?n.appendTimestamp:e.DEFAULT_OPTIONS.appendTimestamp;let s=n.withResourceConstantLabels||e.DEFAULT_OPTIONS.withResourceConstantLabels,c=n.withoutScopeInfo||e.DEFAULT_OPTIONS.withoutScopeInfo,l=n.withoutTargetInfo||e.DEFAULT_OPTIONS.withoutTargetInfo;this._server=(0,a.createServer)(this._requestHandler).unref(),this._serializer=new o.PrometheusSerializer(this._prefix,this._appendTimestamp,s,l,c),this._baseUrl=`http://${this._host}:${this._port}/`,this._endpoint=(n.endpoint||e.DEFAULT_OPTIONS.endpoint).replace(/^([^/])/,`/$1`),n.preventServerStart===!0?i&&queueMicrotask(i):this.startServer().then(i,e=>{t.diag.error(e),i(e)})}async onForceFlush(){}onShutdown(){return this.stopServer()}stopServer(){return this._server?new Promise(e=>{this._server.close(r=>{r?r.code!==`ERR_SERVER_NOT_RUNNING`&&(0,n.globalErrorHandler)(r):t.diag.debug(`Prometheus exporter was stopped`),e()})}):(t.diag.debug(`Prometheus stopServer() was called but server was never started.`),Promise.resolve())}startServer(){return this._startServerPromise??=new Promise((e,n)=>{this._server.once(`error`,n),this._server.listen({port:this._port,host:this._host},()=>{t.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`),e()})}),this._startServerPromise}getMetricsRequestHandler(e,t){this._exportMetrics(t)}_requestHandler=(e,t)=>{let n;try{e.url!=null&&(n=new l.URL(e.url,this._baseUrl).pathname)}catch{t.statusCode=400,t.end(`Bad Request`);return}n===this._endpoint?this._exportMetrics(t):this._notFound(t)};_exportMetrics=e=>{e.statusCode=200,e.setHeader(`content-type`,`text/plain`),this.collect().then(n=>{let{resourceMetrics:r,errors:i}=n;i.length&&t.diag.error(`PrometheusExporter: metrics collection errors`,...i),e.end(this._serializer.serialize(r))},t=>{e.end(`# failed to export metrics: ${t}`)})};_notFound=e=>{e.statusCode=404,e.end()}}})),lj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrometheusSerializer=e.PrometheusExporter=void 0;var t=cj();Object.defineProperty(e,"PrometheusExporter",{enumerable:!0,get:function(){return t.PrometheusExporter}});var n=sj();Object.defineProperty(e,"PrometheusSerializer",{enumerable:!0,get:function(){return n.PrometheusSerializer}})})),uj=mE(),dj=oj(),fj=lj();c();async function pj(t){console.log(`Setting up OTLP metrics, debug=`,!!t),t&&e.setLogger(new u,o.DEBUG);let n=[new uj.PeriodicExportingMetricReader({exporter:new dj.OTLPMetricExporter,exportIntervalMillis:6e4})];t&&n.push(new fj.PrometheusExporter({host:`0.0.0.0`,port:4041}));let r=new uj.MeterProvider({readers:[new uj.PeriodicExportingMetricReader({exporter:new dj.OTLPMetricExporter,exportIntervalMillis:6e4})]});a.setGlobalMeterProvider(r),[`SIGINT`,`SIGTERM`].forEach(e=>{process.on(e,()=>r.forceFlush().catch(console.error))}),a.getMeter(`processor`).createGauge(`up`).record(1)}var mj=class{loader;constructor(e){this.loader=e}async listen(e){let t=ee.INSTANCE;await this.loader(),await t.configure(w(P)),console.log(`Starting Action Server at:`,e),await t.startServer(e)}forceShutdown(){ee.INSTANCE.shutdown()}},hj=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},gj=class extends hj{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},_j=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new gj(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function vj(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}var yj=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(e=>vj(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(t?` `+t:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
121
- `)}displayWidth(e){return ve(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
119
+ `)+1)),this.lastActivityTimestamp=new Date}trace(e,t){(0,u.trace)(t??o.LogVerbosity.DEBUG,`channel`,`(`+this.channelzRef.id+`) `+(0,f.uriToString)(this.target)+` `+e)}callRefTimerRef(){var e,t,n;this.callRefTimer||=setInterval(()=>{},2147483647),(e=this.callRefTimer).hasRef?.call(e)||(this.trace(`callRefTimer.ref | configSelectionQueue.length=`+this.configSelectionQueue.length+` pickQueue.length=`+this.pickQueue.length),(n=(t=this.callRefTimer).ref)==null||n.call(t))}callRefTimerUnref(){var e,t;(!this.callRefTimer?.hasRef||this.callRefTimer.hasRef())&&(this.trace(`callRefTimer.unref | configSelectionQueue.length=`+this.configSelectionQueue.length+` pickQueue.length=`+this.pickQueue.length),(t=(e=this.callRefTimer)?.unref)==null||t.call(e))}removeConnectivityStateWatcher(e){let t=this.connectivityStateWatchers.findIndex(t=>t===e);t>=0&&this.connectivityStateWatchers.splice(t,1)}updateState(e){(0,u.trace)(o.LogVerbosity.DEBUG,`connectivity_state`,`(`+this.channelzRef.id+`) `+(0,f.uriToString)(this.target)+` `+p.ConnectivityState[this.connectivityState]+` -> `+p.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace(`CT_INFO`,`Connectivity state change to `+p.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let t=this.connectivityStateWatchers.slice();for(let n of t)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==p.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let t of this.wrappedSubchannels)t.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,t){return this.currentPicker.pick({metadata:e,extraPickInfo:t})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,t){return this.connectivityState!==p.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:`SUCCESS`,config:this.configSelector.invoke(e,t,this.randomChannelId)}:this.currentResolutionError?{type:`ERROR`,error:this.currentResolutionError}:{type:`NONE`}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.IDLE),this.currentPicker=new i.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&=(clearTimeout(this.idleTimer),null),this.callRefTimer&&=(clearInterval(this.callRefTimer),null)}startIdleTimeout(e){var t,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let e=new Date().valueOf()-this.lastActivityTimestamp.valueOf();e>=this.idleTimeoutMs?(this.trace(`Idle timer triggered after `+this.idleTimeoutMs+`ms of inactivity`),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-e)},e),(n=(t=this.idleTimer).unref)==null||n.call(t)}maybeStartIdleTimer(){this.connectivityState!==p.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===o.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),--this.callCount,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();return this.trace(`createLoadBalancingCall [`+a+`] method="`+t+`"`),new h.LoadBalancingCall(this,e,t,n,r,i,a)}createRetryingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();return this.trace(`createRetryingCall [`+a+`] method="`+t+`"`),new b.RetryingCall(this,e,t,n,r,i,a,this.retryBufferTracker,S.get(this.getTarget()))}createResolvingCall(e,t,n,r,i){let a=(0,v.getNextCallNumber)();this.trace(`createResolvingCall [`+a+`] method="`+e+`", deadline=`+(0,g.deadlineToString)(t));let s={deadline:t,flags:i??o.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:r},c=new _.ResolvingCall(this,e,s,this.filterStackFactory.clone(),a);return this.onCallStart(),c.addStatusWatcher(e=>{this.onCallEnd(e)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(p.ConnectivityState.SHUTDOWN),this.currentPicker=new w;for(let e of this.configSelectionQueue)e.cancelWithStatus(o.Status.UNAVAILABLE,`Channel closed before call started`);this.configSelectionQueue=[];for(let e of this.pickQueue)e.cancelWithStatus(o.Status.UNAVAILABLE,`Channel closed before call started`);this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,m.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)==null||e.unref(),this.configSelector=null}getTarget(){return(0,f.uriToString)(this.target)}getConnectivityState(e){let t=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),t}watchConnectivityState(e,t,n){if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw Error(`Channel has been shut down`);let r=null;if(t!==1/0){let e=t instanceof Date?t:new Date(t),a=new Date;if(t===-1/0||e<=a){process.nextTick(n,Error(`Deadline passed without connectivity state change`));return}r=setTimeout(()=>{this.removeConnectivityStateWatcher(i),n(Error(`Deadline passed without connectivity state change`))},e.getTime()-a.getTime())}let i={currentState:e,callback:n,timer:r};this.connectivityStateWatchers.push(i)}getChannelzRef(){return this.channelzRef}createCall(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(`Channel#createCall: method must be a string`);if(!(typeof t==`number`||t instanceof Date))throw TypeError(`Channel#createCall: deadline must be a number or Date`);if(this.connectivityState===p.ConnectivityState.SHUTDOWN)throw Error(`Channel has been shut down`);return this.createResolvingCall(e,t,n,r,i)}getOptions(){return this.options}}})),FA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelImplementation=void 0;let t=JO(),n=PA();e.ChannelImplementation=class{constructor(e,r,i){if(typeof e!=`string`)throw TypeError(`Channel target must be a string`);if(!(r instanceof t.ChannelCredentials))throw TypeError(`Channel credentials must be a ChannelCredentials object`);if(i&&typeof i!=`object`)throw TypeError(`Channel options must be an object`);this.internalChannel=new n.InternalChannel(e,r,i)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,t,n){this.internalChannel.watchConnectivityState(e,t,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,t,n,r,i){if(typeof e!=`string`)throw TypeError(`Channel#createCall: method must be a string`);if(!(typeof t==`number`||t instanceof Date))throw TypeError(`Channel#createCall: deadline must be a number or Date`);return this.internalChannel.createCall(e,t,n,r,i)}}})),IA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ServerDuplexStreamImpl=e.ServerWritableStreamImpl=e.ServerReadableStreamImpl=e.ServerUnaryCallImpl=void 0,e.serverErrorToStatus=a;let t=s(`events`),n=s(`stream`),r=J(),i=X();function a(e,t){let n={code:r.Status.UNKNOWN,details:`message`in e?e.message:`Unknown Error`,metadata:t??e.metadata??null};return`code`in e&&typeof e.code==`number`&&Number.isInteger(e.code)&&(n.code=e.code,`details`in e&&typeof e.details==`string`&&(n.details=e.details)),n}e.ServerUnaryCallImpl=class extends t.EventEmitter{constructor(e,t,n,r){super(),this.path=e,this.call=t,this.metadata=n,this.request=r,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}},e.ServerReadableStreamImpl=class extends n.Readable{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}},e.ServerWritableStreamImpl=class extends n.Writable{constructor(e,t,n,o){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.request=o,this.pendingStatus={code:r.Status.OK,details:`OK`},this.cancelled=!1,this.trailingMetadata=new i.Metadata,this.on(`error`,e=>{this.pendingStatus=a(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:this.pendingStatus.metadata??this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}},e.ServerDuplexStreamImpl=class extends n.Duplex{constructor(e,t,n){super({objectMode:!0}),this.path=e,this.call=t,this.metadata=n,this.pendingStatus={code:r.Status.OK,details:`OK`},this.cancelled=!1,this.trailingMetadata=new i.Metadata,this.on(`error`,e=>{this.pendingStatus=a(e),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,t,n){this.call.sendMessage(e,n)}_final(e){e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:this.pendingStatus.metadata??this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}}})),LA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ServerCredentials=void 0,e.createCertificateProviderServerCredentials=o,e.createServerCredentialsWithInterceptors=c;let t=KO();var n=class{constructor(e,t){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=t??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let e of this.watchers)e(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new r}static createSsl(e,n,r=!1){if(e!==null&&!Buffer.isBuffer(e))throw TypeError(`rootCerts must be null or a Buffer`);if(!Array.isArray(n))throw TypeError(`keyCertPairs must be an array`);if(typeof r!=`boolean`)throw TypeError(`checkClientCertificate must be a boolean`);let a=[],o=[];for(let e=0;e<n.length;e++){let t=n[e];if(typeof t!=`object`||!t)throw TypeError(`keyCertPair[${e}] must be an object`);if(!Buffer.isBuffer(t.private_key))throw TypeError(`keyCertPair[${e}].private_key must be a Buffer`);if(!Buffer.isBuffer(t.cert_chain))throw TypeError(`keyCertPair[${e}].cert_chain must be a Buffer`);a.push(t.cert_chain),o.push(t.private_key)}return new i({requestCert:r,ciphers:t.CIPHER_SUITES},{ca:e??(0,t.getDefaultRootsData)()??void 0,cert:a,key:o})}};e.ServerCredentials=n;var r=class e extends n{constructor(){super(null)}_getSettings(){return null}_equals(t){return t instanceof e}},i=class e extends n{constructor(e,t){super(e,t),this.options=Object.assign(Object.assign({},e),t)}_equals(t){if(this===t)return!0;if(!(t instanceof e))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(t.options.ca)){if(!this.options.ca.equals(t.options.ca))return!1}else if(this.options.ca!==t.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(t.options.cert)){if(this.options.cert.length!==t.options.cert.length)return!1;for(let e=0;e<this.options.cert.length;e++){let n=this.options.cert[e],r=t.options.cert[e];if(Buffer.isBuffer(n)&&Buffer.isBuffer(r)){if(!n.equals(r))return!1}else if(n!==r)return!1}}else if(this.options.cert!==t.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(t.options.key)){if(this.options.key.length!==t.options.key.length)return!1;for(let e=0;e<this.options.key.length;e++){let n=this.options.key[e],r=t.options.key[e];if(Buffer.isBuffer(n)&&Buffer.isBuffer(r)){if(!n.equals(r))return!1}else if(n!==r)return!1}}else if(this.options.key!==t.options.key)return!1;return this.options.requestCert===t.options.requestCert}},a=class e extends n{constructor(e,n,r){super({requestCert:n!==null,rejectUnauthorized:r,ciphers:t.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=n,this.requireClientCertificate=r,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var t;this.getWatcherCount()===0&&((t=this.caCertificateProvider)==null||t.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var t;super._removeWatcher(e),this.getWatcherCount()===0&&((t=this.caCertificateProvider)==null||t.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(t){return this===t?!0:t instanceof e?this.caCertificateProvider===t.caCertificateProvider&&this.identityCertificateProvider===t.identityCertificateProvider&&this.requireClientCertificate===t.requireClientCertificate:!1}calculateSecureContextOptions(){return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:this.latestCaUpdate?.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function o(e,t,n){return new a(e,t,n)}var s=class e extends n{constructor(e,t){super({}),this.childCredentials=e,this.interceptors=t}_isSecure(){return this.childCredentials._isSecure()}_equals(t){if(!(t instanceof e)||!this.childCredentials._equals(t.childCredentials)||this.interceptors.length!==t.interceptors.length)return!1;for(let e=0;e<this.interceptors.length;e++)if(this.interceptors[e]!==t.interceptors[e])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function c(e,t){return new s(e,t)}})),RA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.durationMessageToDuration=t,e.msToDuration=n,e.durationToMs=r,e.isDuration=i,e.isDurationMessage=a,e.parseDuration=s,e.durationToString=c;function t(e){return{seconds:Number.parseInt(e.seconds),nanos:e.nanos}}function n(e){return{seconds:e/1e3|0,nanos:e%1e3*1e6|0}}function r(e){return e.seconds*1e3+e.nanos/1e6|0}function i(e){return typeof e.seconds==`number`&&typeof e.nanos==`number`}function a(e){return typeof e.seconds==`string`&&typeof e.nanos==`number`}let o=/^(\d+)(?:\.(\d+))?s$/;function s(e){let t=e.match(o);return t?{seconds:Number.parseInt(t[1],10),nanos:t[2]?Number.parseInt(t[2].padEnd(9,`0`),10):0}:null}function c(e){if(e.nanos===0)return`${e.seconds}s`;let t;return t=e.nanos%1e6==0?1e6:e.nanos%1e3==0?1e3:1,`${e.seconds}.${e.nanos/t}s`}})),zA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OrcaOobMetricsSubchannelWrapper=e.GRPC_METRICS_HEADER=e.ServerMetricRecorder=e.PerRequestMetricRecorder=void 0,e.createOrcaClient=l,e.createMetricsReader=d;let t=uk(),n=RA(),r=JO(),i=NA(),a=J(),o=$O(),s=ZO();function c(){let e=fA().loadSync,n=e(`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,t.loadPackageDefinition)(n)}e.PerRequestMetricRecorder=class{constructor(){this.message={}}recordRequestCostMetric(e,t){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=t}recordUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}recordNamedMetric(e,t){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=t}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return c().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}},e.ServerMetricRecorder=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let t=e.request.report_interval?(0,n.durationToMs)((0,n.durationMessageToDuration)(e.request.report_interval)):3e4,r=setInterval(()=>{e.write(this.message)},t);e.on(`cancelled`,()=>{clearInterval(r)})}}}putUtilizationMetric(e,t){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=t}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var t;(t=this.message.utilization)==null||delete t[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let t=c().xds.service.orca.v3.OpenRcaService.service;e.addService(t,this.serviceImplementation)}};function l(e){let t=c().xds.service.orca.v3.OpenRcaService;return new t(`unused`,r.ChannelCredentials.createInsecure(),{channelOverride:e})}e.GRPC_METRICS_HEADER=`endpoint-load-metrics-bin`;let u=`grpc_orca_load_report`;function d(t,n){return(r,i,a)=>{let o=a.getOpaque(u);if(o)t(o);else{let n=a.get(e.GRPC_METRICS_HEADER);n.length>0&&(o=c().xds.data.orca.v3.OrcaLoadReport.deserialize(n[0]),t(o),a.setOpaque(u,o))}n&&n(r,i,a)}}let f=`orca_oob_metrics`;var p=class{constructor(e,t){this.metricsListener=e,this.intervalMs=t,this.dataProducer=null}setSubchannel(e){let t=e.getOrCreateDataProducer(f,h);this.dataProducer=t,t.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)==null||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},m=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new o.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let t=e.getChannel();this.client=l(t),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var t;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(f),(t=this.metricsCall)==null||t.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==s.ConnectivityState.READY)return;let t=Math.min(...Array.from(this.dataWatchers).map(e=>e.getInterval()));if(!this.metricsCall||t!==this.currentInterval){(e=this.metricsCall)==null||e.cancel(),this.currentInterval=t;let r=this.client.streamCoreMetrics({report_interval:(0,n.msToDuration)(t)});this.metricsCall=r,r.on(`data`,e=>{this.dataWatchers.forEach(t=>{t.onMetricsUpdate(e)})}),r.on(`error`,e=>{if(this.metricsCall=null,e.code===a.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}e.code!==a.Status.CANCELLED&&this.backoffTimer.runOnce()})}}};e.OrcaOobMetricsSubchannelWrapper=class extends i.BaseSubchannelWrapper{constructor(e,t,n){super(e),this.addDataWatcher(new p(t,n))}getWrappedSubchannel(){return this.child}};function h(e){return new m(e)}})),BA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseServerInterceptingCall=e.ServerInterceptingCall=e.ResponderBuilder=e.ServerListenerBuilder=void 0,e.isInterceptingServerListener=p,e.getServerInterceptingCall=O;let t=X(),n=J(),r=s(`http2`),i=WO(),a=s(`zlib`),o=EA(),c=Y(),l=s(`tls`),u=zA(),d=`server_call`;function f(e){c.trace(n.LogVerbosity.DEBUG,d,e)}e.ServerListenerBuilder=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};function p(e){return e.onReceiveMetadata!==void 0&&e.onReceiveMetadata.length===1}var m=class{constructor(e,t){this.listener=e,this.nextListener=t,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&=(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,!1)}processPendingHalfClose(){this.hasPendingHalfClose&&=(this.nextListener.onReceiveHalfClose(),!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,e=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(e),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,e=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=e,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(e),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}};e.ResponderBuilder=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};let h={onReceiveMetadata:(e,t)=>{t(e)},onReceiveMessage:(e,t)=>{t(e)},onReceiveHalfClose:e=>{e()},onCancel:()=>{}},g={start:e=>{e()},sendMetadata:(e,t)=>{t(e)},sendMessage:(e,t)=>{t(e)},sendStatus:(e,t)=>{t(e)}};e.ServerInterceptingCall=class{constructor(e,t){this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:t?.start??g.start,sendMetadata:t?.sendMetadata??g.sendMetadata,sendMessage:t?.sendMessage??g.sendMessage,sendStatus:t?.sendStatus??g.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&=(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,null)}processPendingStatus(){this.pendingStatus&&=(this.nextCall.sendStatus(this.pendingStatus),null)}start(e){this.responder.start(t=>{let n=new m({onReceiveMetadata:t?.onReceiveMetadata??h.onReceiveMetadata,onReceiveMessage:t?.onReceiveMessage??h.onReceiveMessage,onReceiveHalfClose:t?.onReceiveHalfClose??h.onReceiveHalfClose,onCancel:t?.onCancel??h.onCancel},e);this.nextCall.start(n)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,e=>{this.processingMetadata=!1,this.nextCall.sendMetadata(e),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,n){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new t.Metadata),this.responder.sendMessage(e,e=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=e,this.pendingMessageCallback=n):this.nextCall.sendMessage(e,n)})}sendStatus(e){this.responder.sendStatus(e,e=>{this.processingMetadata||this.processingMessage?this.pendingStatus=e:this.nextCall.sendStatus(e)})}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()}};let _=`grpc-accept-encoding`,v=`grpc-encoding`,y=`grpc-message`,b=`grpc-status`,x=`grpc-timeout`,S=/(\d{1,8})\s*([HMSmun])/,C={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},w={[_]:`identity,deflate,gzip`,[v]:`identity`},T={[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_OK,[r.constants.HTTP2_HEADER_CONTENT_TYPE]:`application/grpc+proto`},E={waitForTrailers:!0};var D=class{constructor(e,i,a,s,l){this.stream=e,this.callEventTracker=a,this.handler=s,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=n.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=n.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 u.PerRequestMetricRecorder,this.stream.once(`close`,()=>{f(`Request to method `+this.handler?.path+` stream closed with rstCode `+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:n.Status.CANCELLED,details:`Stream closed before sending status`,metadata:null})),this.notifyOnCancel()}),this.stream.on(`data`,e=>{this.handleDataFrame(e)}),this.stream.pause(),this.stream.on(`end`,()=>{this.handleEndEvent()}),`grpc.max_send_message_length`in l&&(this.maxSendMessageSize=l[`grpc.max_send_message_length`]),`grpc.max_receive_message_length`in l&&(this.maxReceiveMessageSize=l[`grpc.max_receive_message_length`]),this.host=i[`:authority`]??i.host,this.decoder=new o.StreamDecoder(this.maxReceiveMessageSize);let p=t.Metadata.fromHttp2Headers(i);c.isTracerEnabled(d)&&f(`Request to `+this.handler.path+` received headers `+JSON.stringify(p.toJSON()));let m=p.get(x);m.length>0&&this.handleTimeoutHeader(m[0]);let h=p.get(v);h.length>0&&(this.incomingEncoding=h[0]),p.remove(x),p.remove(v),p.remove(_),p.remove(r.constants.HTTP2_HEADER_ACCEPT_ENCODING),p.remove(r.constants.HTTP2_HEADER_TE),p.remove(r.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=p;let g=e.session?.socket;this.connectionInfo={localAddress:g?.localAddress,localPort:g?.localPort,remoteAddress:g?.remoteAddress,remotePort:g?.remotePort},this.shouldSendMetrics=!!l[`grpc.server_call_metric_recording`]}handleTimeoutHeader(e){let t=e.toString().match(S);if(t===null){let t={code:n.Status.INTERNAL,details:`Invalid ${x} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(t)});return}let r=+t[1]*C[t[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+r),this.deadlineTimer=setTimeout(()=>{let e={code:n.Status.DEADLINE_EXCEEDED,details:`Deadline exceeded`,metadata:null};this.sendStatus(e)},r)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)==null||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new t.Metadata)}serializeMessage(e){let t=this.handler.serialize(e),n=t.byteLength,r=Buffer.allocUnsafe(n+5);return r.writeUInt8(0,0),r.writeUInt32BE(n,1),t.copy(r,5),r}decompressMessage(e,t){let r=e.subarray(5);if(t===`identity`)return r;if(t===`deflate`||t===`gzip`){let e;return e=t===`deflate`?a.createInflate():a.createGunzip(),new Promise((t,i)=>{let a=0,o=[];e.on(`error`,e=>{i({code:n.Status.INTERNAL,details:`Failed to decompress message`})}),e.on(`data`,t=>{o.push(t),a+=t.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(e.destroy(),i({code:n.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),e.on(`end`,()=>{t(Buffer.concat(o))}),e.write(r),e.end()})}else return Promise.reject({code:n.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${t}"`})}async decompressAndMaybePush(e){if(e.type!==`COMPRESSED`)throw Error(`Invalid queue entry type: ${e.type}`);let t=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:`identity`,r;try{r=await this.decompressMessage(e.compressedMessage,t)}catch(e){this.sendStatus(e);return}try{e.parsedMessage=this.handler.deserialize(r)}catch(e){this.sendStatus({code:n.Status.INTERNAL,details:`Error deserializing request: ${e.message}`});return}e.type=`READABLE`,this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!==`COMPRESSED`){this.isReadPending=!1;let e=this.readQueue.shift();e.type===`READABLE`?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var t;if(this.checkCancelled())return;f(`Request to `+this.handler.path+` received data frame of size `+e.length);let r;try{r=this.decoder.write(e)}catch(e){this.sendStatus({code:n.Status.RESOURCE_EXHAUSTED,details:e.message});return}for(let e of r){this.stream.pause();let n={type:`COMPRESSED`,compressedMessage:e,parsedMessage:null};this.readQueue.push(n),this.decompressAndMaybePush(n),(t=this.callEventTracker)==null||t.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:`HALF_CLOSE`,compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){f(`Request to `+this.handler.path+` start called`),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let t=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},T),w),t);this.stream.respond(n,E)}sendMessage(e,t){if(this.checkCancelled())return;let r;try{r=this.serializeMessage(e)}catch(e){this.sendStatus({code:n.Status.INTERNAL,details:`Error serializing response: ${(0,i.getErrorMessage)(e)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&r.length-5>this.maxSendMessageSize){this.sendStatus({code:n.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${r.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),f(`Request to `+this.handler.path+` sent data frame of size `+r.length),this.stream.write(r,e=>{var r;if(e){this.sendStatus({code:n.Status.INTERNAL,details:`Error writing message: ${(0,i.getErrorMessage)(e)}`,metadata:null});return}(r=this.callEventTracker)==null||r.addMessageSent(),t()})}sendStatus(e){if(this.checkCancelled())return;f(`Request to method `+this.handler?.path+` ended with status code: `+n.Status[e.code]+` details: `+e.details);let r=e.metadata?.clone()??new t.Metadata;if(this.shouldSendMetrics&&r.set(u.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once(`wantTrailers`,()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let t=Object.assign({[b]:e.code,[y]:encodeURI(e.details)},r.toHttp2Headers());this.stream.sendTrailers(t),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let t=Object.assign(Object.assign({[b]:e.code,[y]:encodeURI(e.details)},T),r.toHttp2Headers());this.stream.respond(t,{endStream:!0}),this.notifyOnCancel()}}startRead(){f(`Request to `+this.handler.path+` startRead called`),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){let e=this.stream.session?.socket;return e?.remoteAddress?e.remotePort?`${e.remoteAddress}:${e.remotePort}`:e.remoteAddress:`unknown`}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){if(this.stream.session?.socket instanceof l.TLSSocket){let e=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:`ssl`,sslPeerCertificate:e.raw?e:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};e.BaseServerInterceptingCall=D;function O(e,t,n,r,i,a){let o={path:i.path,requestStream:i.type===`clientStream`||i.type===`bidi`,responseStream:i.type===`serverStream`||i.type===`bidi`,requestDeserialize:i.deserialize,responseSerialize:i.serialize},s=new D(t,n,r,i,a);return e.reduce((e,t)=>t(o,e),s)}})),VA=t((e=>{var t=e&&e.__runInitializers||function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},n=e&&e.__esDecorate||function(e,t,n,r,i,a){function o(e){if(e!==void 0&&typeof e!=`function`)throw TypeError(`Function expected`);return e}for(var s=r.kind,c=s===`getter`?`get`:s===`setter`?`set`:`value`,l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]=h===`access`?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw TypeError(`Cannot add initializers after decoration has completed`);a.push(o(e||null))};var g=(0,n[p])(s===`accessor`?{get:u.get,set:u.set}:u[c],m);if(s===`accessor`){if(g===void 0)continue;if(typeof g!=`object`||!g)throw TypeError(`Object expected`);(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&i.unshift(d)}else(d=o(g))&&(s===`field`?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0};Object.defineProperty(e,"__esModule",{value:!0}),e.Server=void 0;let r=s(`http2`),i=s(`util`),a=J(),o=IA(),c=LA(),l=qO(),u=Y(),d=rk(),f=Z(),p=pA(),m=BA(),h=2147483647,g=2147483647,_=2147483647,{HTTP2_HEADER_PATH:v}=r.constants,y=Buffer.from(`max_age`);function b(e){u.trace(a.LogVerbosity.DEBUG,`server_call`,e)}function x(){}function S(e){return function(t,n){return i.deprecate(t,e)}}function C(e){return{code:a.Status.UNIMPLEMENTED,details:`The server does not implement the method ${e}`}}function w(e,t){let n=C(t);switch(e){case`unary`:return(e,t)=>{t(n,null)};case`clientStream`:return(e,t)=>{t(n,null)};case`serverStream`:return e=>{e.emit(`error`,n)};case`bidi`:return e=>{e.emit(`error`,n)};default:throw Error(`Invalid handlerType ${e}`)}}e.Server=(()=>{var e;let i=[],o;return e=class{constructor(e){this.boundPorts=(t(this,i),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=e??{},this.options[`grpc.enable_channelz`]===0?(this.channelzEnabled=!1,this.channelzTrace=new p.ChannelzTraceStub,this.callTracker=new p.ChannelzCallTrackerStub,this.listenerChildrenTracker=new p.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new p.ChannelzChildrenTrackerStub):(this.channelzTrace=new p.ChannelzTrace,this.callTracker=new p.ChannelzCallTracker,this.listenerChildrenTracker=new p.ChannelzChildrenTracker,this.sessionChildrenTracker=new p.ChannelzChildrenTracker),this.channelzRef=(0,p.registerChannelzServer)(`server`,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace(`CT_INFO`,`Server created`),this.maxConnectionAgeMs=this.options[`grpc.max_connection_age_ms`]??h,this.maxConnectionAgeGraceMs=this.options[`grpc.max_connection_age_grace_ms`]??h,this.keepaliveTimeMs=this.options[`grpc.keepalive_time_ms`]??g,this.keepaliveTimeoutMs=this.options[`grpc.keepalive_timeout_ms`]??2e4,this.sessionIdleTimeout=this.options[`grpc.max_connection_idle_ms`]??_,this.commonServerOptions={maxSendHeaderBlockLength:2**53-1},`grpc-node.max_session_memory`in this.options?this.commonServerOptions.maxSessionMemory=this.options[`grpc-node.max_session_memory`]:this.commonServerOptions.maxSessionMemory=2**53-1,`grpc.max_concurrent_streams`in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options[`grpc.max_concurrent_streams`]}),this.interceptors=this.options.interceptors??[],this.trace(`Server constructed`)}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(e){let t=this.sessions.get(e),n=e.socket,r=n.remoteAddress?(0,d.stringToSubchannelAddress)(n.remoteAddress,n.remotePort):null,i=n.localAddress?(0,d.stringToSubchannelAddress)(n.localAddress,n.localPort):null,a;if(e.encrypted){let e=n,t=e.getCipher(),r=e.getCertificate(),i=e.getPeerCertificate();a={cipherSuiteStandardName:t.standardName??null,cipherSuiteOtherName:t.standardName?null:t.name,localCertificate:r&&`raw`in r?r.raw:null,remoteCertificate:i&&`raw`in i?i.raw:null}}else a=null;return{remoteAddress:r,localAddress:i,security:a,remoteName:null,streamsStarted:t.streamTracker.callsStarted,streamsSucceeded:t.streamTracker.callsSucceeded,streamsFailed:t.streamTracker.callsFailed,messagesSent:t.messagesSent,messagesReceived:t.messagesReceived,keepAlivesSent:t.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:t.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:t.lastMessageSentTimestamp,lastMessageReceivedTimestamp:t.lastMessageReceivedTimestamp,localFlowControlWindow:e.state.localWindowSize??null,remoteFlowControlWindow:e.state.remoteWindowSize??null}}trace(e){u.trace(a.LogVerbosity.DEBUG,`server`,`(`+this.channelzRef.id+`) `+e)}keepaliveTrace(e){u.trace(a.LogVerbosity.DEBUG,`keepalive`,`(`+this.channelzRef.id+`) `+e)}addProtoService(){throw Error(`Not implemented. Use addService() instead`)}addService(e,t){if(typeof e!=`object`||!e||typeof t!=`object`||!t)throw Error(`addService() requires two objects as arguments`);let n=Object.keys(e);if(n.length===0)throw Error(`Cannot add an empty service to a server`);n.forEach(n=>{let r=e[n],i;i=r.requestStream?r.responseStream?`bidi`:`clientStream`:r.responseStream?`serverStream`:`unary`;let a=t[n],o;if(a===void 0&&typeof r.originalName==`string`&&(a=t[r.originalName]),o=a===void 0?w(i,n):a.bind(t),this.register(r.path,o,r.responseSerialize,r.requestDeserialize,i)===!1)throw Error(`Method handler for ${r.path} already provided.`)})}removeService(e){if(typeof e!=`object`||!e)throw Error(`removeService() requires object as argument`);Object.keys(e).forEach(t=>{let n=e[t];this.unregister(n.path)})}bind(e,t){throw Error(`Not implemented. Use bindAsync() instead`)}experimentalRegisterListenerToChannelz(e){return(0,p.registerChannelzSocket)((0,d.subchannelAddressToString)(e),()=>({localAddress:e,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(e){(0,p.unregisterChannelzRef)(e)}createHttp2Server(e){let t;if(e._isSecure()){let n=e._getConstructorOptions(),i=e._getSecureContextOptions(),o=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),n),i),{enableTrace:this.options[`grpc-node.tls_enable_trace`]===1}),s=i!==null;this.trace(`Initial credentials valid: `+s),t=r.createSecureServer(o),t.prependListener(`connection`,e=>{s||(this.trace(`Dropped connection from `+JSON.stringify(e.address())+` due to unloaded credentials`),e.destroy())}),t.on(`secureConnection`,e=>{e.on(`error`,e=>{this.trace(`An incoming TLS connection closed with error: `+e.message)})});let c=e=>{if(e){let n=t;try{n.setSecureContext(e)}catch(t){u.log(a.LogVerbosity.ERROR,`Failed to set secure context with error `+t.message),e=null}}s=e!==null,this.trace(`Post-update credentials valid: `+s)};e._addWatcher(c),t.on(`close`,()=>{e._removeWatcher(c)})}else t=r.createServer(this.commonServerOptions);return t.setTimeout(0,x),this._setupHandlers(t,e._getInterceptors()),t}bindOneAddress(e,t){this.trace(`Attempting to bind `+(0,d.subchannelAddressToString)(e));let n=this.createHttp2Server(t.credentials);return new Promise((r,i)=>{let a=t=>{this.trace(`Failed to bind `+(0,d.subchannelAddressToString)(e)+` with error `+t.message),r({port:`port`in e?e.port:1,error:t.message})};n.once(`error`,a),n.listen(e,()=>{let e=n.address(),i;i=typeof e==`string`?{path:e}:{host:e.address,port:e.port};let o=this.experimentalRegisterListenerToChannelz(i);this.listenerChildrenTracker.refChild(o),this.http2Servers.set(n,{channelzRef:o,sessions:new Set,ownsChannelzRef:!0}),t.listeningServers.add(n),this.trace(`Successfully bound `+(0,d.subchannelAddressToString)(i)),r({port:`port`in i?i.port:1}),n.removeListener(`error`,a)})})}async bindManyPorts(e,t){if(e.length===0)return{count:0,port:0,errors:[]};if((0,d.isTcpSubchannelAddress)(e[0])&&e[0].port===0){let n=await this.bindOneAddress(e[0],t);if(n.error){let r=await this.bindManyPorts(e.slice(1),t);return Object.assign(Object.assign({},r),{errors:[n.error,...r.errors]})}else{let r=e.slice(1).map(e=>(0,d.isTcpSubchannelAddress)(e)?{host:e.host,port:n.port}:e),i=[n,...await Promise.all(r.map(e=>this.bindOneAddress(e,t)))];return{count:i.filter(e=>e.error===void 0).length,port:n.port,errors:i.filter(e=>e.error).map(e=>e.error)}}}else{let n=await Promise.all(e.map(e=>this.bindOneAddress(e,t)));return{count:n.filter(e=>e.error===void 0).length,port:n[0].port,errors:n.filter(e=>e.error).map(e=>e.error)}}}async bindAddressList(e,t){let n=await this.bindManyPorts(e,t);if(n.count>0)return n.count<e.length&&u.log(a.LogVerbosity.INFO,`WARNING Only ${n.count} addresses added out of total ${e.length} resolved`),n.port;{let t=`No address added out of total ${e.length} resolved`;throw u.log(a.LogVerbosity.ERROR,t),Error(`${t} errors: [${n.errors.join(`,`)}]`)}}resolvePort(e){return new Promise((t,n)=>{let r=!1;(0,l.createResolver)(e,(i,a,o,s)=>{if(r)return!0;if(r=!0,!i.ok)return n(Error(i.error.details)),!0;let c=[].concat(...i.value.map(e=>e.addresses));return c.length===0?(n(Error(`No addresses resolved for port ${e}`)),!0):(t(c),!0)},this.options).updateResolution()})}async bindPort(e,t){let n=await this.resolvePort(e);if(t.cancelled)throw this.completeUnbind(t),Error(`bindAsync operation cancelled by unbind call`);let r=await this.bindAddressList(n,t);if(t.cancelled)throw this.completeUnbind(t),Error(`bindAsync operation cancelled by unbind call`);return r}normalizePort(e){let t=(0,f.parseUri)(e);if(t===null)throw Error(`Could not parse port "${e}"`);let n=(0,l.mapUriDefaultScheme)(t);if(n===null)throw Error(`Could not get a default scheme for port "${e}"`);return n}bindAsync(e,t,n){if(this.shutdown)throw Error(`bindAsync called after shutdown`);if(typeof e!=`string`)throw TypeError(`port must be a string`);if(t===null||!(t instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);if(typeof n!=`function`)throw TypeError(`callback must be a function`);this.trace(`bindAsync port=`+e);let r=this.normalizePort(e),i=(e,t)=>{process.nextTick(()=>n(e,t))},a=this.boundPorts.get((0,f.uriToString)(r));if(a){if(!t._equals(a.credentials)){i(Error(`${e} already bound with incompatible credentials`),0);return}a.cancelled=!1,a.completionPromise?a.completionPromise.then(e=>n(null,e),e=>n(e,0)):i(null,a.portNumber);return}a={mapKey:(0,f.uriToString)(r),originalUri:r,completionPromise:null,cancelled:!1,portNumber:0,credentials:t,listeningServers:new Set};let o=(0,f.splitHostPort)(r.path),s=this.bindPort(r,a);a.completionPromise=s,o?.port===0?s.then(e=>{let t={scheme:r.scheme,authority:r.authority,path:(0,f.combineHostPort)({host:o.host,port:e})};a.mapKey=(0,f.uriToString)(t),a.completionPromise=null,a.portNumber=e,this.boundPorts.set(a.mapKey,a),n(null,e)},e=>{n(e,0)}):(this.boundPorts.set(a.mapKey,a),s.then(e=>{a.completionPromise=null,a.portNumber=e,n(null,e)},e=>{n(e,0)}))}registerInjectorToChannelz(){return(0,p.registerChannelzSocket)(`injector`,()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(e,t,n=!1){if(e===null||!(e instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);this.channelzEnabled&&this.listenerChildrenTracker.refChild(t);let i=this.createHttp2Server(e),a=new Set;return this.http2Servers.set(i,{channelzRef:t,sessions:a,ownsChannelzRef:n}),{injectConnection:e=>{i.emit(`connection`,e)},drain:e=>{var t,n;for(let e of a)this.closeSession(e);(n=(t=setTimeout(()=>{for(let e of a)e.destroy(r.constants.NGHTTP2_CANCEL)},e)).unref)==null||n.call(t)},destroy:()=>{this.closeServer(i);for(let e of a)this.closeSession(e)}}}createConnectionInjector(e){if(e===null||!(e instanceof c.ServerCredentials))throw TypeError(`creds must be a ServerCredentials object`);let t=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(e,t,!0)}closeServer(e,t){this.trace(`Closing server with address `+JSON.stringify(e.address()));let n=this.http2Servers.get(e);e.close(()=>{n&&n.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(n.channelzRef),(0,p.unregisterChannelzRef)(n.channelzRef)),this.http2Servers.delete(e),t?.()})}closeSession(e,t){this.trace(`Closing session initiated by `+e.socket?.remoteAddress);let n=this.sessions.get(e),r=()=>{n&&(this.sessionChildrenTracker.unrefChild(n.ref),(0,p.unregisterChannelzRef)(n.ref)),t?.()};e.closed?queueMicrotask(r):e.close(r)}completeUnbind(e){for(let t of e.listeningServers){let n=this.http2Servers.get(t);if(this.closeServer(t,()=>{e.listeningServers.delete(t)}),n)for(let e of n.sessions)this.closeSession(e)}this.boundPorts.delete(e.mapKey)}unbind(e){this.trace(`unbind port=`+e);let t=this.normalizePort(e);if((0,f.splitHostPort)(t.path)?.port===0)throw Error(`Cannot unbind port 0`);let n=this.boundPorts.get((0,f.uriToString)(t));n&&(this.trace(`unbinding `+n.mapKey+` originally bound as `+(0,f.uriToString)(n.originalUri)),n.completionPromise?n.cancelled=!0:this.completeUnbind(n))}drain(e,t){var n,i;this.trace(`drain port=`+e+` graceTimeMs=`+t);let a=this.normalizePort(e);if((0,f.splitHostPort)(a.path)?.port===0)throw Error(`Cannot drain port 0`);let o=this.boundPorts.get((0,f.uriToString)(a));if(!o)return;let s=new Set;for(let e of o.listeningServers){let t=this.http2Servers.get(e);if(t)for(let e of t.sessions)s.add(e),this.closeSession(e,()=>{s.delete(e)})}(i=(n=setTimeout(()=>{for(let e of s)e.destroy(r.constants.NGHTTP2_CANCEL)},t)).unref)==null||i.call(n)}forceShutdown(){for(let e of this.boundPorts.values())e.cancelled=!0;this.boundPorts.clear();for(let e of this.http2Servers.keys())this.closeServer(e);this.sessions.forEach((e,t)=>{this.closeSession(t),t.destroy(r.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,p.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(e,t,n,r,i){return this.handlers.has(e)?!1:(this.handlers.set(e,{func:t,serialize:n,deserialize:r,type:i,path:e}),!0)}unregister(e){return this.handlers.delete(e)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(e=>!e.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(e){let t=t=>{(0,p.unregisterChannelzRef)(this.channelzRef),e(t)},n=0;function r(){n--,n===0&&t()}this.shutdown=!0;for(let[e,t]of this.http2Servers.entries()){n++;let i=t.channelzRef.name;this.trace(`Waiting for server `+i+` to close`),this.closeServer(e,()=>{this.trace(`Server `+i+` finished closing`),r()});for(let e of t.sessions.keys()){n++;let t=e.socket?.remoteAddress;this.trace(`Waiting for session `+t+` to close`),this.closeSession(e,()=>{this.trace(`Session `+t+` finished closing`),r()})}}n===0&&t()}addHttp2Port(){throw Error(`Not yet implemented`)}getChannelzRef(){return this.channelzRef}_verifyContentType(e,t){let n=t[r.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof n!=`string`||!n.startsWith(`application/grpc`)?(e.respond({[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(e){b(`Received call to method `+e+` at address `+this.serverAddressString);let t=this.handlers.get(e);return t===void 0?(b(`No handler registered for method `+e+`. Sending UNIMPLEMENTED status.`),null):t}_respondWithError(e,t,n=null){let i=Object.assign({"grpc-status":e.code??a.Status.INTERNAL,"grpc-message":e.details,[r.constants.HTTP2_HEADER_STATUS]:r.constants.HTTP_STATUS_OK,[r.constants.HTTP2_HEADER_CONTENT_TYPE]:`application/grpc+proto`},e.metadata?.toHttp2Headers());t.respond(i,{endStream:!0}),this.callTracker.addCallFailed(),n?.streamTracker.addCallFailed()}_channelzHandler(e,t,n){t.once(`error`,e=>{}),this.onStreamOpened(t);let r=this.sessions.get(t.session);if(this.callTracker.addCallStarted(),r?.streamTracker.addCallStarted(),!this._verifyContentType(t,n)){this.callTracker.addCallFailed(),r?.streamTracker.addCallFailed();return}let i=n[v],o=this._retrieveHandler(i);if(!o){this._respondWithError(C(i),t,r);return}let s={addMessageSent:()=>{r&&(r.messagesSent+=1,r.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{r&&(r.messagesReceived+=1,r.lastMessageReceivedTimestamp=new Date)},onCallEnd:e=>{e.code===a.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:e=>{r&&(e?r.streamTracker.addCallSucceeded():r.streamTracker.addCallFailed())}},c=(0,m.getServerInterceptingCall)([...e,...this.interceptors],t,n,s,o,this.options);this._runHandlerForCall(c,o)||(this.callTracker.addCallFailed(),r?.streamTracker.addCallFailed(),c.sendStatus({code:a.Status.INTERNAL,details:`Unknown handler type: ${o.type}`}))}_streamHandler(e,t,n){if(t.once(`error`,e=>{}),this.onStreamOpened(t),this._verifyContentType(t,n)!==!0)return;let r=n[v],i=this._retrieveHandler(r);if(!i){this._respondWithError(C(r),t,null);return}let o=(0,m.getServerInterceptingCall)([...e,...this.interceptors],t,n,null,i,this.options);this._runHandlerForCall(o,i)||o.sendStatus({code:a.Status.INTERNAL,details:`Unknown handler type: ${i.type}`})}_runHandlerForCall(e,t){let{type:n}=t;if(n===`unary`)T(e,t);else if(n===`clientStream`)E(e,t);else if(n===`serverStream`)D(e,t);else if(n===`bidi`)O(e,t);else return!1;return!0}_setupHandlers(e,t){if(e===null)return;let n=e.address(),r=`null`;n&&(r=typeof n==`string`?n:n.address+`:`+n.port),this.serverAddressString=r;let i=this.channelzEnabled?this._channelzHandler:this._streamHandler,a=this.channelzEnabled?this._channelzSessionHandler(e):this._sessionHandler(e);e.on(`stream`,i.bind(this,t)),e.on(`session`,a)}_sessionHandler(e){return t=>{var n,i;(n=this.http2Servers.get(e))==null||n.sessions.add(t);let a=null,o=null,s=null,c=!1,l=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==h){let e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;a=setTimeout(()=>{var e;c=!0,this.trace(`Connection dropped by max connection age: `+t.socket?.remoteAddress);try{t.goaway(r.constants.NGHTTP2_NO_ERROR,2147483647,y)}catch{t.destroy();return}t.close(),this.maxConnectionAgeGraceMs!==h&&(o=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),(e=o.unref)==null||e.call(o))},this.maxConnectionAgeMs+n),(i=a.unref)==null||i.call(a)}let u=()=>{s&&=(clearTimeout(s),null)},d=()=>!t.destroyed&&this.keepaliveTimeMs<g&&this.keepaliveTimeMs>0,f,p=()=>{var e;d()&&(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),s=setTimeout(()=>{u(),f()},this.keepaliveTimeMs),(e=s.unref)==null||e.call(s))};f=()=>{var e;if(!d())return;this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`);let n=``;try{t.ping((e,n,r)=>{u(),e?(this.keepaliveTrace(`Ping failed with error: `+e.message),c=!0,t.destroy()):(this.keepaliveTrace(`Received ping response`),p())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}if(n){this.keepaliveTrace(`Ping send failed: `+n),this.trace(`Connection dropped due to ping send error: `+n),c=!0,t.destroy();return}s=setTimeout(()=>{u(),this.keepaliveTrace(`Ping timeout passed without response`),this.trace(`Connection dropped by keepalive timeout`),c=!0,t.destroy()},this.keepaliveTimeoutMs),(e=s.unref)==null||e.call(s)},p(),t.on(`close`,()=>{var n;c||this.trace(`Connection dropped by client ${t.socket?.remoteAddress}`),a&&clearTimeout(a),o&&clearTimeout(o),u(),l!==null&&(clearTimeout(l.timeout),this.sessionIdleTimeouts.delete(t)),(n=this.http2Servers.get(e))==null||n.sessions.delete(t)})}}_channelzSessionHandler(e){return t=>{var n,i;let a=(0,p.registerChannelzSocket)(t.socket?.remoteAddress??`unknown`,this.getChannelzSessionInfo.bind(this,t),this.channelzEnabled),o={ref:a,streamTracker:new p.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(n=this.http2Servers.get(e))==null||n.sessions.add(t),this.sessions.set(t,o);let s=`${t.socket.remoteAddress}:${t.socket.remotePort}`;this.channelzTrace.addTrace(`CT_INFO`,`Connection established by client `+s),this.trace(`Connection established by client `+s),this.sessionChildrenTracker.refChild(a);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(t);if(this.maxConnectionAgeMs!==h){let e=this.maxConnectionAgeMs/10,n=Math.random()*e*2-e;c=setTimeout(()=>{var e;d=!0,this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by max connection age from `+s);try{t.goaway(r.constants.NGHTTP2_NO_ERROR,2147483647,y)}catch{t.destroy();return}t.close(),this.maxConnectionAgeGraceMs!==h&&(l=setTimeout(()=>{t.destroy()},this.maxConnectionAgeGraceMs),(e=l.unref)==null||e.call(l))},this.maxConnectionAgeMs+n),(i=c.unref)==null||i.call(c)}let m=()=>{u&&=(clearTimeout(u),null)},_=()=>!t.destroyed&&this.keepaliveTimeMs<g&&this.keepaliveTimeMs>0,v,b=()=>{var e;_()&&(this.keepaliveTrace(`Starting keepalive timer for `+this.keepaliveTimeMs+`ms`),u=setTimeout(()=>{m(),v()},this.keepaliveTimeMs),(e=u.unref)==null||e.call(u))};v=()=>{var e;if(!_())return;this.keepaliveTrace(`Sending ping with timeout `+this.keepaliveTimeoutMs+`ms`);let n=``;try{t.ping((e,n,r)=>{m(),e?(this.keepaliveTrace(`Ping failed with error: `+e.message),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped due to error of a ping frame `+e.message+` return in `+n),d=!0,t.destroy()):(this.keepaliveTrace(`Received ping response`),b())})||(n=`Ping returned false`)}catch(e){n=(e instanceof Error?e.message:``)||`Unknown error`}if(n){this.keepaliveTrace(`Ping send failed: `+n),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped due to ping send error: `+n),d=!0,t.destroy();return}o.keepAlivesSent+=1,u=setTimeout(()=>{m(),this.keepaliveTrace(`Ping timeout passed without response`),this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by keepalive timeout from `+s),d=!0,t.destroy()},this.keepaliveTimeoutMs),(e=u.unref)==null||e.call(u)},b(),t.on(`close`,()=>{var n;d||this.channelzTrace.addTrace(`CT_INFO`,`Connection dropped by client `+s),this.sessionChildrenTracker.unrefChild(a),(0,p.unregisterChannelzRef)(a),c&&clearTimeout(c),l&&clearTimeout(l),m(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(t)),(n=this.http2Servers.get(e))==null||n.sessions.delete(t),this.sessions.delete(t)})}}enableIdleTimeout(e){var t,n;if(this.sessionIdleTimeout>=_)return null;let r={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,e),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,e)};(n=(t=r.timeout).unref)==null||n.call(t),this.sessionIdleTimeouts.set(e,r);let{socket:i}=e;return this.trace(`Enable idle timeout for `+i.remoteAddress+`:`+i.remotePort),r}onIdleTimeout(e,t){let{socket:n}=t,r=e.sessionIdleTimeouts.get(t);r!==void 0&&r.activeStreams===0&&(Date.now()-r.lastIdle>=e.sessionIdleTimeout?(e.trace(`Session idle timeout triggered for `+n?.remoteAddress+`:`+n?.remotePort+` last idle at `+r.lastIdle),e.closeSession(t)):r.timeout.refresh())}onStreamOpened(e){let t=e.session,n=this.sessionIdleTimeouts.get(t);n&&(n.activeStreams+=1,e.once(`close`,n.onClose))}onStreamClose(e){let t=this.sessionIdleTimeouts.get(e);t&&(--t.activeStreams,t.activeStreams===0&&(t.lastIdle=Date.now(),t.timeout.refresh(),this.trace(`Session onStreamClose`+e.socket?.remoteAddress+`:`+e.socket?.remotePort+` at `+t.lastIdle)))}},(()=>{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(null):void 0;o=[S(`Calling start() is no longer necessary. It can be safely omitted.`)],n(e,null,o,{kind:`method`,name:`start`,static:!1,private:!1,access:{has:e=>`start`in e,get:e=>e.start},metadata:t},null,i),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();async function T(e,t){let n;function r(t,n,r,i){if(t){e.sendStatus((0,o.serverErrorToStatus)(t,r));return}e.sendMessage(n,()=>{e.sendStatus({code:a.Status.OK,details:`OK`,metadata:r??null})})}let i,s=null;e.start({onReceiveMetadata(t){i=t,e.startRead()},onReceiveMessage(n){if(s){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}s=n,e.startRead()},onReceiveHalfClose(){if(!s){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new o.ServerWritableStreamImpl(t.path,e,i,s);try{t.func(n,r)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`))}})}function E(e,t){let n;function r(t,n,r,i){if(t){e.sendStatus((0,o.serverErrorToStatus)(t,r));return}e.sendMessage(n,()=>{e.sendStatus({code:a.Status.OK,details:`OK`,metadata:r??null})})}e.start({onReceiveMetadata(i){n=new o.ServerDuplexStreamImpl(t.path,e,i);try{t.func(n,r)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){n.push(e)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}function D(e,t){let n,r,i=null;e.start({onReceiveMetadata(t){r=t,e.startRead()},onReceiveMessage(n){if(i){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${t.path}`,metadata:null});return}i=n,e.startRead()},onReceiveHalfClose(){if(!i){e.sendStatus({code:a.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${t.path}`,metadata:null});return}n=new o.ServerWritableStreamImpl(t.path,e,r,i);try{t.func(n)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}function O(e,t){let n;e.start({onReceiveMetadata(r){n=new o.ServerDuplexStreamImpl(t.path,e,r);try{t.func(n)}catch(t){e.sendStatus({code:a.Status.UNKNOWN,details:`Server method handler threw error ${t.message}`,metadata:null})}},onReceiveMessage(e){n.push(e)},onReceiveHalfClose(){n.push(null)},onCancel(){n&&(n.cancelled=!0,n.emit(`cancelled`,`cancelled`),n.destroy())}})}})),HA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatusBuilder=void 0,e.StatusBuilder=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}}})),UA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LeafLoadBalancer=e.PickFirstLoadBalancer=e.PickFirstLoadBalancingConfig=void 0,e.shuffled=h,e.setup=b;let t=YO(),n=ZO(),r=QO(),i=rk(),a=Y(),o=J(),c=rk(),l=s(`net`),u=sk();function d(e){a.trace(o.LogVerbosity.DEBUG,`pick_first`,e)}let f=`pick_first`;var p=class e{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return f}toJsonObject(){return{[f]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(t){if(`shuffleAddressList`in t&&typeof t.shuffleAddressList!=`boolean`)throw Error(`pick_first config field shuffleAddressList must be a boolean if provided`);return new e(t.shuffleAddressList===!0)}};e.PickFirstLoadBalancingConfig=p;var m=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:r.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function h(e){let t=e.slice();for(let e=t.length-1;e>1;e--){let n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}return t}function g(e){if(e.length===0)return[];let t=[],n=[],r=[],i=(0,c.isTcpSubchannelAddress)(e[0])&&(0,l.isIPv6)(e[0].host);for(let t of e)(0,c.isTcpSubchannelAddress)(t)&&(0,l.isIPv6)(t.host)?n.push(t):r.push(t);let a=i?n:r,o=i?r:n;for(let e=0;e<Math.max(a.length,o.length);e++)e<a.length&&t.push(a[e]),e<o.length&&t.push(o[e]);return t}let _=`grpc-node.internal.pick-first.report_health_status`;var v=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=n.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(e,t,n,r,i)=>{this.onSubchannelStateUpdate(e,t,n,i)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote=``,this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let e=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(n.ConnectivityState.READY,new m(this.currentPick),null);else if(this.latestAddressList?.length===0){let e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else if(this.children.length===0)this.updateState(n.ConnectivityState.IDLE,new r.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let e=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(n.ConnectivityState.CONNECTING,new r.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,t,r,i){if(this.currentPick?.realSubchannelEquals(e)){r!==n.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[t,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){r===n.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),r===n.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),t===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(t+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[t,r]of this.children.entries())if(t>=e){let e=r.subchannel.getConnectivityState();if(e===n.ConnectivityState.IDLE||e===n.ConnectivityState.CONNECTING){this.startConnecting(t);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var t,r;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===n.ConnectivityState.IDLE&&(d(`Start connecting to subchannel with address `+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var t;(t=this.children[e])==null||t.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},250),(r=(t=this.connectionDelayTimeout).unref)==null||r.call(t)}pickSubchannel(e){d(`Pick subchannel with address `+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,t,r){d(n.ConnectivityState[this.currentState]+` -> `+n.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,t,r)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,t){d(`connectToAddressList([`+e.map(e=>(0,i.subchannelAddressToString)(e))+`])`);let r=e.map(e=>({subchannel:this.channelControlHelper.createSubchannel(e,t),hasReportedTransientFailure:!1}));for(let{subchannel:e}of r)if(e.getConnectivityState()===n.ConnectivityState.READY){this.pickSubchannel(e);return}for(let{subchannel:e}of r)e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef());this.resetSubchannelList(),this.children=r;for(let{subchannel:e}of this.children)e.addConnectivityStateListener(this.subchannelStateListener);for(let e of this.children)e.subchannel.getConnectivityState()===n.ConnectivityState.TRANSIENT_FAILURE&&(e.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,t,a,o){if(!(t instanceof p))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker(e.error),e.error.details),!0;let s=e.value;this.reportHealthStatus=a[_],t.getShuffleAddressList()&&(s=h(s));let c=[].concat(...s.map(e=>e.addresses));d(`updateAddressList([`+c.map(e=>(0,i.subchannelAddressToString)(e))+`])`);let l=g(c);return this.latestAddressList=l,this.latestOptions=a,this.connectToAddressList(l,a),this.latestResolutionNote=o,c.length>0?!0:(this.lastError=`No addresses resolved`,!1)}exitIdle(){this.currentState===n.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return f}};e.PickFirstLoadBalancer=v;let y=new p(!1);e.LeafLoadBalancer=class{constructor(e,i,a,o){this.endpoint=e,this.options=a,this.resolutionNote=o,this.latestState=n.ConnectivityState.IDLE;let s=(0,t.createChildChannelControlHelper)(i,{updateState:(e,t,n)=>{this.latestState=e,this.latestPicker=t,i.updateState(e,t,n)}});this.pickFirstBalancer=new v(s),this.latestPicker=new r.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,u.statusOrFromValue)([this.endpoint]),y,Object.assign(Object.assign({},this.options),{[_]:!0}),this.resolutionNote)}updateEndpoint(e,t){this.options=t,this.endpoint=e,this.latestState!==n.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};function b(){(0,t.registerLoadBalancerType)(f,v,p),(0,t.registerDefaultLoadBalancerType)(f)}})),WA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FileWatcherCertificateProvider=void 0;let t=s(`fs`),n=Y(),r=J(),i=s(`util`);function a(e){n.trace(r.LogVerbosity.DEBUG,`certificate_provider`,e)}let o=(0,i.promisify)(t.readFile);e.FileWatcherCertificateProvider=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw Error(`certificateFile and privateKeyFile must be set or unset together`);if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw Error(`At least one of certificateFile and caCertificateFile must be set`);a(`File watcher constructed with config `+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?o(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?o(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?o(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,t,n])=>{if(this.refreshTimer){a(`File watcher read certificates certificate `+e.status+`, privateKey `+t.status+`, CA certificate `+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status===`fulfilled`&&t.status===`fulfilled`?this.latestIdentityUpdate={certificate:e.value,privateKey:t.value}:this.latestIdentityUpdate=null,n.status===`fulfilled`?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let e of this.identityListeners)e(this.latestIdentityUpdate);for(let e of this.caListeners)e(this.latestCaUpdate)}}),a(`File watcher initiated certificate update`))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),a(`File watcher started watching`)}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&=(clearInterval(this.refreshTimer),null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}}})),GA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=e.createCertificateProviderChannelCredentials=e.FileWatcherCertificateProvider=e.createCertificateProviderServerCredentials=e.createServerCredentialsWithInterceptors=e.BaseSubchannelWrapper=e.registerAdminService=e.FilterStackFactory=e.BaseFilter=e.statusOrFromError=e.statusOrFromValue=e.PickResultType=e.QueuePicker=e.UnavailablePicker=e.ChildLoadBalancerHandler=e.EndpointMap=e.endpointHasAddress=e.endpointToString=e.subchannelAddressToString=e.LeafLoadBalancer=e.isLoadBalancerNameRegistered=e.parseLoadBalancingConfig=e.selectLbConfigFromList=e.registerLoadBalancerType=e.createChildChannelControlHelper=e.BackoffTimeout=e.parseDuration=e.durationToMs=e.splitHostPort=e.uriToString=e.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=e.createResolver=e.registerResolver=e.log=e.trace=void 0;var t=Y();Object.defineProperty(e,"trace",{enumerable:!0,get:function(){return t.trace}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return t.log}});var n=qO();Object.defineProperty(e,"registerResolver",{enumerable:!0,get:function(){return n.registerResolver}}),Object.defineProperty(e,"createResolver",{enumerable:!0,get:function(){return n.createResolver}}),Object.defineProperty(e,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return n.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var r=Z();Object.defineProperty(e,"uriToString",{enumerable:!0,get:function(){return r.uriToString}}),Object.defineProperty(e,"splitHostPort",{enumerable:!0,get:function(){return r.splitHostPort}});var i=RA();Object.defineProperty(e,"durationToMs",{enumerable:!0,get:function(){return i.durationToMs}}),Object.defineProperty(e,"parseDuration",{enumerable:!0,get:function(){return i.parseDuration}});var a=$O();Object.defineProperty(e,"BackoffTimeout",{enumerable:!0,get:function(){return a.BackoffTimeout}});var o=YO();Object.defineProperty(e,"createChildChannelControlHelper",{enumerable:!0,get:function(){return o.createChildChannelControlHelper}}),Object.defineProperty(e,"registerLoadBalancerType",{enumerable:!0,get:function(){return o.registerLoadBalancerType}}),Object.defineProperty(e,"selectLbConfigFromList",{enumerable:!0,get:function(){return o.selectLbConfigFromList}}),Object.defineProperty(e,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return o.parseLoadBalancingConfig}}),Object.defineProperty(e,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return o.isLoadBalancerNameRegistered}});var s=UA();Object.defineProperty(e,"LeafLoadBalancer",{enumerable:!0,get:function(){return s.LeafLoadBalancer}});var c=rk();Object.defineProperty(e,"subchannelAddressToString",{enumerable:!0,get:function(){return c.subchannelAddressToString}}),Object.defineProperty(e,"endpointToString",{enumerable:!0,get:function(){return c.endpointToString}}),Object.defineProperty(e,"endpointHasAddress",{enumerable:!0,get:function(){return c.endpointHasAddress}}),Object.defineProperty(e,"EndpointMap",{enumerable:!0,get:function(){return c.EndpointMap}});var l=ek();Object.defineProperty(e,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return l.ChildLoadBalancerHandler}});var u=QO();Object.defineProperty(e,"UnavailablePicker",{enumerable:!0,get:function(){return u.UnavailablePicker}}),Object.defineProperty(e,"QueuePicker",{enumerable:!0,get:function(){return u.QueuePicker}}),Object.defineProperty(e,"PickResultType",{enumerable:!0,get:function(){return u.PickResultType}});var d=sk();Object.defineProperty(e,"statusOrFromValue",{enumerable:!0,get:function(){return d.statusOrFromValue}}),Object.defineProperty(e,"statusOrFromError",{enumerable:!0,get:function(){return d.statusOrFromError}});var f=gA();Object.defineProperty(e,"BaseFilter",{enumerable:!0,get:function(){return f.BaseFilter}});var p=bA();Object.defineProperty(e,"FilterStackFactory",{enumerable:!0,get:function(){return p.FilterStackFactory}});var m=ak();Object.defineProperty(e,"registerAdminService",{enumerable:!0,get:function(){return m.registerAdminService}});var h=NA();Object.defineProperty(e,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return h.BaseSubchannelWrapper}});var g=LA();Object.defineProperty(e,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return g.createServerCredentialsWithInterceptors}}),Object.defineProperty(e,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return g.createCertificateProviderServerCredentials}});var _=WA();Object.defineProperty(e,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return _.FileWatcherCertificateProvider}});var v=JO();Object.defineProperty(e,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return v.createCertificateProviderChannelCredentials}});var y=PA();Object.defineProperty(e,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return y.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})})),KA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setup=i;let t=qO(),n=sk();var r=class{constructor(e,t,n){this.listener=t,this.hasReturnedResult=!1,this.endpoints=[];let r;r=e.authority===``?`/`+e.path:e.path,this.endpoints=[{addresses:[{path:r}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,n.statusOrFromValue)(this.endpoints),{},null,``))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return`localhost`}};function i(){(0,t.registerResolver)(`unix`,r)}})),qA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.setup=m;let t=s(`net`),n=sk(),r=J(),i=X(),a=qO(),o=rk(),c=Z(),l=Y();function u(e){l.trace(r.LogVerbosity.DEBUG,`ip_resolver`,e)}let d=`ipv4`,f=`ipv6`;var p=class{constructor(e,n,a){this.listener=n,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,u(`Resolver constructed for target `+(0,c.uriToString)(e));let s=[];if(!(e.scheme===d||e.scheme===f)){this.error={code:r.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new i.Metadata};return}let l=e.path.split(`,`);for(let n of l){let a=(0,c.splitHostPort)(n);if(a===null){this.error={code:r.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new i.Metadata};return}if(e.scheme===d&&!(0,t.isIPv4)(a.host)||e.scheme===f&&!(0,t.isIPv6)(a.host)){this.error={code:r.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${n}`,metadata:new i.Metadata};return}s.push({host:a.host,port:a.port??443})}this.endpoints=s.map(e=>({addresses:[e]})),u(`Parsed `+e.scheme+` address list `+s.map(o.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,n.statusOrFromError)(this.error),{},null,``):this.listener((0,n.statusOrFromValue)(this.endpoints),{},null,``)}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(`,`)[0]}};function m(){(0,a.registerResolver)(d,p),(0,a.registerResolver)(f,p)}})),JA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RoundRobinLoadBalancer=void 0,e.setup=m;let t=YO(),n=ZO(),r=QO(),i=Y(),a=J(),o=rk(),s=UA();function c(e){i.trace(a.LogVerbosity.DEBUG,`round_robin`,e)}let l=`round_robin`;var u=class e{getLoadBalancerName(){return l}constructor(){}toJsonObject(){return{[l]:{}}}static createFromJson(t){return new e}},d=class{constructor(e,t=0){this.children=e,this.nextIndex=t}pick(e){let t=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,t.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function f(e,t){return[...e.slice(t),...e.slice(0,t)]}var p=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=n.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,t.createChildChannelControlHelper)(e,{updateState:(e,t,r)=>{this.currentState===n.ConnectivityState.READY&&e!==n.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),r&&(this.lastError=r),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(t=>t.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(n.ConnectivityState.READY)>0){let e=this.children.filter(e=>e.getConnectivityState()===n.ConnectivityState.READY),t=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();t=e.findIndex(e=>(0,o.endpointEqual)(e.getEndpoint(),n)),t<0&&(t=0)}this.updateState(n.ConnectivityState.READY,new d(e.map(e=>({endpoint:e.getEndpoint(),picker:e.getPicker()})),t),null)}else if(this.countChildrenWithState(n.ConnectivityState.CONNECTING)>0)this.updateState(n.ConnectivityState.CONNECTING,new r.QueuePicker(this),null);else if(this.countChildrenWithState(n.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}else this.updateState(n.ConnectivityState.IDLE,new r.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===n.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,t,r){c(n.ConnectivityState[this.currentState]+` -> `+n.ConnectivityState[e]),e===n.ConnectivityState.READY?this.currentReadyPicker=t:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,t,r)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,t,i,a){if(!(t instanceof u))return!1;if(!e.ok)return this.children.length===0&&this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker(e.error),e.error.details),!0;let l=Math.random()*e.value.length|0,d=f(e.value,l);if(this.resetSubchannelList(),d.length===0){let e=`No addresses resolved. Resolution note: ${a}`;this.updateState(n.ConnectivityState.TRANSIENT_FAILURE,new r.UnavailablePicker({details:e}),e)}c(`Connect to endpoint list `+d.map(o.endpointToString)),this.updatesPaused=!0,this.children=d.map(e=>new s.LeafLoadBalancer(e,this.childChannelControlHelper,i,a));for(let e of this.children)e.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return l}};e.RoundRobinLoadBalancer=p;function m(){(0,t.registerLoadBalancerType)(l,p,u)}})),YA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OutlierDetectionLoadBalancer=e.OutlierDetectionLoadBalancingConfig=void 0,e.setup=T;let t=ZO(),n=J(),r=RA(),i=GA(),a=YO(),o=ek(),s=QO(),c=rk(),l=NA(),u=Y();function d(e){u.trace(n.LogVerbosity.DEBUG,`outlier_detection`,e)}let f=`outlier_detection`,p=(process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION??`true`)===`true`,m={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},h={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function g(e,t,n,r){if(t in e&&e[t]!==void 0&&typeof e[t]!==n){let i=r?`${r}.${t}`:t;throw Error(`outlier detection config ${i} parse error: expected ${n}, got ${typeof e[t]}`)}}function _(e,t,n){let i=n?`${n}.${t}`:t;if(t in e&&e[t]!==void 0){if(!(0,r.isDuration)(e[t]))throw Error(`outlier detection config ${i} parse error: expected Duration, got ${typeof e[t]}`);if(!(e[t].seconds>=0&&e[t].seconds<=315576e6&&e[t].nanos>=0&&e[t].nanos<=999999999))throw Error(`outlier detection config ${i} parse error: values out of range for non-negative Duaration`)}}function v(e,t,n){let r=n?`${n}.${t}`:t;if(g(e,t,`number`,n),t in e&&e[t]!==void 0&&!(e[t]>=0&&e[t]<=100))throw Error(`outlier detection config ${r} parse error: value out of range for percentage (0-100)`)}var y=class e{constructor(e,t,n,r,i,a,o){if(this.childPolicy=o,o.getLoadBalancerName()===`pick_first`)throw Error(`outlier_detection LB policy cannot have a pick_first child policy`);this.intervalMs=e??1e4,this.baseEjectionTimeMs=t??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=r??10,this.successRateEjection=i?Object.assign(Object.assign({},m),i):null,this.failurePercentageEjection=a?Object.assign(Object.assign({},h),a):null}getLoadBalancerName(){return f}toJsonObject(){return{outlier_detection:{interval:(0,r.msToDuration)(this.intervalMs),base_ejection_time:(0,r.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,r.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:this.successRateEjection??void 0,failure_percentage_ejection:this.failurePercentageEjection??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(t){if(_(t,`interval`),_(t,`base_ejection_time`),_(t,`max_ejection_time`),v(t,`max_ejection_percent`),`success_rate_ejection`in t&&t.success_rate_ejection!==void 0){if(typeof t.success_rate_ejection!=`object`)throw Error(`outlier detection config success_rate_ejection must be an object`);g(t.success_rate_ejection,`stdev_factor`,`number`,`success_rate_ejection`),v(t.success_rate_ejection,`enforcement_percentage`,`success_rate_ejection`),g(t.success_rate_ejection,`minimum_hosts`,`number`,`success_rate_ejection`),g(t.success_rate_ejection,`request_volume`,`number`,`success_rate_ejection`)}if(`failure_percentage_ejection`in t&&t.failure_percentage_ejection!==void 0){if(typeof t.failure_percentage_ejection!=`object`)throw Error(`outlier detection config failure_percentage_ejection must be an object`);v(t.failure_percentage_ejection,`threshold`,`failure_percentage_ejection`),v(t.failure_percentage_ejection,`enforcement_percentage`,`failure_percentage_ejection`),g(t.failure_percentage_ejection,`minimum_hosts`,`number`,`failure_percentage_ejection`),g(t.failure_percentage_ejection,`request_volume`,`number`,`failure_percentage_ejection`)}if(!(`child_policy`in t)||!Array.isArray(t.child_policy))throw Error(`outlier detection config child_policy must be an array`);let n=(0,a.selectLbConfigFromList)(t.child_policy);if(!n)throw Error(`outlier detection config child_policy: no valid recognized policy found`);return new e(t.interval?(0,r.durationToMs)(t.interval):null,t.base_ejection_time?(0,r.durationToMs)(t.base_ejection_time):null,t.max_ejection_time?(0,r.durationToMs)(t.max_ejection_time):null,t.max_ejection_percent??null,t.success_rate_ejection,t.failure_percentage_ejection,n)}};e.OutlierDetectionLoadBalancingConfig=y;var b=class extends l.BaseSubchannelWrapper{constructor(e,t){super(e),this.mapEntry=t,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),--this.refCount,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function x(){return{success:0,failure:0}}var S=class{constructor(){this.activeBucket=x(),this.inactiveBucket=x()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=x()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},C=class{constructor(e,t){this.wrappedPicker=e,this.countCalls=t}pick(e){let t=this.wrappedPicker.pick(e);if(t.pickResultType===s.PickResultType.COMPLETE){let e=t.subchannel,r=e.getMapEntry();if(r){let i=t.onCallEnded;return this.countCalls&&(i=(e,i,a)=>{var o;e===n.Status.OK?r.counter.addSuccess():r.counter.addFailure(),(o=t.onCallEnded)==null||o.call(t,e,i,a)}),Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel(),onCallEnded:i})}else return Object.assign(Object.assign({},t),{subchannel:e.getWrappedSubchannel()})}else return t}},w=class{constructor(e){this.entryMap=new c.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new o.ChildLoadBalancerHandler((0,i.createChildChannelControlHelper)(e,{createSubchannel:(t,n)=>{let r=e.createSubchannel(t,n),i=this.entryMap.getForSubchannelAddress(t),a=new b(r,i);return i?.currentEjectionTimestamp!==null&&a.eject(),i?.subchannelWrappers.push(a),a},updateState:(n,r,i)=>{n===t.ConnectivityState.READY?e.updateState(n,new C(r,this.isCountingEnabled()),i):e.updateState(n,r,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let t of this.entryMap.values())t.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getSuccessRateEjectionConfig();if(!t)return;d(`Running success rate check`);let n=t.request_volume,r=0,i=[];for(let[e,t]of this.entryMap.entries()){let a=t.counter.getLastSuccesses(),o=t.counter.getLastFailures();d(`Stats for `+(0,c.endpointToString)(e)+`: successes=`+a+` failures=`+o+` targetRequestVolume=`+n),a+o>=n&&(r+=1,i.push(a/(a+o)))}if(d(`Found `+r+` success rate candidates; currentEjectionPercent=`+this.getCurrentEjectionPercent()+` successRates=[`+i+`]`),r<t.minimum_hosts)return;let a=i.reduce((e,t)=>e+t)/i.length,o=0;for(let e of i){let t=e-a;o+=t*t}let s=o/i.length,l=Math.sqrt(s),u=a-l*(t.stdev_factor/1e3);d(`stdev=`+l+` ejectionThreshold=`+u);for(let[r,i]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let a=i.counter.getLastSuccesses(),o=i.counter.getLastFailures();if(a+o<n)continue;let s=a/(a+o);if(d(`Checking candidate `+r+` successRate=`+s),s<u){let n=Math.random()*100;d(`Candidate `+r+` randomNumber=`+n+` enforcement_percentage=`+t.enforcement_percentage),n<t.enforcement_percentage&&(d(`Ejecting candidate `+r),this.eject(i,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let t=this.latestConfig.getFailurePercentageEjectionConfig();if(!t)return;d(`Running failure percentage check. threshold=`+t.threshold+` request volume threshold=`+t.request_volume);let n=0;for(let e of this.entryMap.values())e.counter.getLastSuccesses()+e.counter.getLastFailures()>=t.request_volume&&(n+=1);if(!(n<t.minimum_hosts))for(let[n,r]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let i=r.counter.getLastSuccesses(),a=r.counter.getLastFailures();if(d(`Candidate successes=`+i+` failures=`+a),!(i+a<t.request_volume)&&a*100/(a+i)>t.threshold){let i=Math.random()*100;d(`Candidate `+n+` randomNumber=`+i+` enforcement_percentage=`+t.enforcement_percentage),i<t.enforcement_percentage&&(d(`Ejecting candidate `+n),this.eject(r,e))}}}eject(e,t){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let t of e.subchannelWrappers)t.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let t of e.subchannelWrappers)t.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var t,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(t=this.ejectionTimer).unref)==null||n.call(t)}runChecks(){let e=new Date;if(d(`Ejection timer running`),this.switchAllBuckets(),this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[e,t]of this.entryMap.entries())if(t.currentEjectionTimestamp===null)t.ejectionTimeMultiplier>0&&--t.ejectionTimeMultiplier;else{let n=this.latestConfig.getBaseEjectionTimeMs(),r=this.latestConfig.getMaxEjectionTimeMs(),i=new Date(t.currentEjectionTimestamp.getTime());i.setMilliseconds(i.getMilliseconds()+Math.min(n*t.ejectionTimeMultiplier,Math.max(n,r))),i<new Date&&(d(`Unejecting `+e),this.uneject(t))}}}updateAddressList(e,t,n,r){if(!(t instanceof y))return!1;if(d(`Received update with config: `+JSON.stringify(t.toJsonObject(),void 0,2)),e.ok){for(let t of e.value)this.entryMap.has(t)||(d(`Adding map entry for `+(0,c.endpointToString)(t)),this.entryMap.set(t,{counter:new S,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let i=t.getChildPolicy();if(this.childBalancer.updateAddressList(e,i,n,r),t.getSuccessRateEjectionConfig()||t.getFailurePercentageEjectionConfig())if(this.timerStartTime){d(`Previous timer existed. Replacing timer`),clearTimeout(this.ejectionTimer);let e=t.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(e)}else d(`Starting new timer`),this.timerStartTime=new Date,this.startTimer(t.getIntervalMs()),this.switchAllBuckets();else{d(`Counting disabled. Cancelling timer.`),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let e of this.entryMap.values())this.uneject(e),e.ejectionTimeMultiplier=0}return this.latestConfig=t,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return f}};e.OutlierDetectionLoadBalancer=w;function T(){p&&(0,i.registerLoadBalancerType)(f,w,y)}})),XA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PriorityQueue=void 0;let t=e=>Math.floor(e/2),n=e=>e*2+1,r=e=>e*2+2;e.PriorityQueue=class{constructor(e=(e,t)=>e>t){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[0]}push(...e){return e.forEach(e=>{this.heap.push(e),this.siftUp()}),this.size()}pop(){let e=this.peek(),t=this.size()-1;return t>0&&this.swap(0,t),this.heap.pop(),this.siftDown(),e}replace(e){let t=this.peek();return this.heap[0]=e,this.siftDown(),t}greater(e,t){return this.comparator(this.heap[e],this.heap[t])}swap(e,t){[this.heap[e],this.heap[t]]=[this.heap[t],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>0&&this.greater(e,t(e));)this.swap(e,t(e)),e=t(e)}siftDown(){let e=0;for(;n(e)<this.size()&&this.greater(n(e),e)||r(e)<this.size()&&this.greater(r(e),e);){let t=r(e)<this.size()&&this.greater(r(e),n(e))?r(e):n(e);this.swap(e,t),e=t}}}})),ZA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WeightedRoundRobinLoadBalancingConfig=void 0,e.setup=v;let t=ZO(),n=J(),r=RA(),i=YO(),a=UA(),o=Y(),s=zA(),c=QO(),l=XA(),u=rk();function d(e){o.trace(n.LogVerbosity.DEBUG,`weighted_round_robin`,e)}let f=`weighted_round_robin`;function p(e,t,n){if(t in e&&e[t]!==void 0&&typeof e[t]!==n)throw Error(`weighted round robin config ${t} parse error: expected ${n}, got ${typeof e[t]}`)}function m(e,t){if(t in e&&e[t]!==void 0&&e[t]!==null){let n;if((0,r.isDuration)(e[t]))n=e[t];else if((0,r.isDurationMessage)(e[t]))n=(0,r.durationMessageToDuration)(e[t]);else if(typeof e[t]==`string`){let i=(0,r.parseDuration)(e[t]);if(!i)throw Error(`weighted round robin config ${t}: failed to parse duration string ${e[t]}`);n=i}else throw Error(`weighted round robin config ${t}: expected duration, got ${typeof e[t]}`);return(0,r.durationToMs)(n)}return null}var h=class e{constructor(e,t,n,r,i,a){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=t??1e4,this.blackoutPeriodMs=n??1e4,this.weightExpirationPeriodMs=r??18e4,this.weightUpdatePeriodMs=Math.max(i??1e3,100),this.errorUtilizationPenalty=a??1}getLoadBalancerName(){return f}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,r.durationToString)((0,r.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,r.durationToString)((0,r.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,r.durationToString)((0,r.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,r.durationToString)((0,r.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(t){if(p(t,`enable_oob_load_report`,`boolean`),p(t,`error_utilization_penalty`,`number`),t.error_utilization_penalty<0)throw Error(`weighted round robin config error_utilization_penalty < 0`);return new e(t.enable_oob_load_report,m(t,`oob_load_reporting_period`),m(t,`blackout_period`),m(t,`weight_expiration_period`),m(t,`weight_update_period`),t.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}};e.WeightedRoundRobinLoadBalancingConfig=h;var g=class{constructor(e,t){this.metricsHandler=t,this.queue=new l.PriorityQueue((e,t)=>e.deadline<t.deadline);let n=e.filter(e=>e.weight>0),r;if(n.length<2)r=1;else{let e=0;for(let{weight:t}of n)e+=t;r=e/n.length}for(let t of e){let e=t.weight>0?1/t.weight:r;this.queue.push({endpointName:t.endpointName,picker:t.picker,period:e,deadline:Math.random()*e})}}pick(e){let t=this.queue.pop();this.queue.push(Object.assign(Object.assign({},t),{deadline:t.deadline+t.period}));let n=t.picker.pick(e);if(n.pickResultType===c.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,s.createMetricsReader)(e=>this.metricsHandler(e,t.endpointName),n.onCallEnded)});{let e=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:e.getWrappedSubchannel()})}}else return n}},_=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=t.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let t=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(t+=1);return t}updateWeight(e,t){let n=t.rps_fractional,r=t.application_utilization;r>0&&n>0&&(r+=t.eps/n*(this.latestConfig?.getErrorUtilizationPenalty()??0));let i=r===0?0:n/r;if(i===0)return;let a=new Date;e.nonEmptySince===null&&(e.nonEmptySince=a),e.lastUpdated=a,e.weight=i}getWeight(e){if(!this.latestConfig)return 0;let t=new Date().getTime();if(t-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||t-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(t.ConnectivityState.READY)>0){let e=[];for(let[n,r]of this.children)r.child.getConnectivityState()===t.ConnectivityState.READY&&e.push({endpointName:n,picker:r.child.getPicker(),weight:this.getWeight(r)});d(`Created picker with weights: `+e.map(e=>e.endpointName+`:`+e.weight).join(`,`));let n;n=this.latestConfig.getEnableOobLoadReport()?null:(e,t)=>{let n=this.children.get(t);n&&this.updateWeight(n,e)},this.updateState(t.ConnectivityState.READY,new g(e,n),null)}else if(this.countChildrenWithState(t.ConnectivityState.CONNECTING)>0)this.updateState(t.ConnectivityState.CONNECTING,new c.QueuePicker(this),null);else if(this.countChildrenWithState(t.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker({details:e}),e)}else this.updateState(t.ConnectivityState.IDLE,new c.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===t.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,n,r){d(t.ConnectivityState[this.currentState]+` -> `+t.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,n,r)}updateAddressList(e,n,r,o){var l;if(!(n instanceof h))return!1;if(!e.ok)return this.children.size===0&&this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let e=`No addresses resolved. Resolution note: ${o}`;return this.updateState(t.ConnectivityState.TRANSIENT_FAILURE,new c.UnavailablePicker({details:e}),e),!1}d(`Connect to endpoint list `+e.value.map(u.endpointToString));let f=new Date,p=new Set;this.updatesPaused=!0,this.latestConfig=n;for(let c of e.value){let e=(0,u.endpointToString)(c);p.add(e);let l=this.children.get(e);l||(l={child:new a.LeafLoadBalancer(c,(0,i.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(e,n,r)=>{this.currentState===t.ConnectivityState.READY&&e!==t.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),e===t.ConnectivityState.READY&&(l.nonEmptySince=null),r&&(this.lastError=r),this.calculateAndUpdateState()},createSubchannel:(e,t)=>{let n=this.channelControlHelper.createSubchannel(e,t);return l?.oobMetricsListener?new s.OrcaOobMetricsSubchannelWrapper(n,l.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):n}}),r,o),lastUpdated:f,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(e,l)),n.getEnableOobLoadReport()?l.oobMetricsListener=e=>{this.updateWeight(l,e)}:l.oobMetricsListener=null}for(let[e,t]of this.children)p.has(e)?t.child.startConnecting():(t.child.destroy(),this.children.delete(e));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(l=setInterval(()=>{this.currentState===t.ConnectivityState.READY&&this.calculateAndUpdateState()},n.getWeightUpdatePeriodMs())).unref?.call(l),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return f}};function v(){(0,i.registerLoadBalancerType)(f,_,h)}})),QA=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.experimental=e.ServerMetricRecorder=e.ServerInterceptingCall=e.ResponderBuilder=e.ServerListenerBuilder=e.addAdminServicesToServer=e.getChannelzHandlers=e.getChannelzServiceDefinition=e.InterceptorConfigurationError=e.InterceptingCall=e.RequesterBuilder=e.ListenerBuilder=e.StatusBuilder=e.getClientChannel=e.ServerCredentials=e.Server=e.setLogVerbosity=e.setLogger=e.load=e.loadObject=e.CallCredentials=e.ChannelCredentials=e.waitForClientReady=e.closeClient=e.Channel=e.makeGenericClientConstructor=e.makeClientConstructor=e.loadPackageDefinition=e.Client=e.compressionAlgorithms=e.propagate=e.connectivityState=e.status=e.logVerbosity=e.Metadata=e.credentials=void 0;let t=GO();Object.defineProperty(e,"CallCredentials",{enumerable:!0,get:function(){return t.CallCredentials}});let n=FA();Object.defineProperty(e,"Channel",{enumerable:!0,get:function(){return n.ChannelImplementation}});let r=hA();Object.defineProperty(e,"compressionAlgorithms",{enumerable:!0,get:function(){return r.CompressionAlgorithms}});let i=ZO();Object.defineProperty(e,"connectivityState",{enumerable:!0,get:function(){return i.ConnectivityState}});let a=JO();Object.defineProperty(e,"ChannelCredentials",{enumerable:!0,get:function(){return a.ChannelCredentials}});let o=lk();Object.defineProperty(e,"Client",{enumerable:!0,get:function(){return o.Client}});let s=J();Object.defineProperty(e,"logVerbosity",{enumerable:!0,get:function(){return s.LogVerbosity}}),Object.defineProperty(e,"status",{enumerable:!0,get:function(){return s.Status}}),Object.defineProperty(e,"propagate",{enumerable:!0,get:function(){return s.Propagate}});let c=Y(),l=uk();Object.defineProperty(e,"loadPackageDefinition",{enumerable:!0,get:function(){return l.loadPackageDefinition}}),Object.defineProperty(e,"makeClientConstructor",{enumerable:!0,get:function(){return l.makeClientConstructor}}),Object.defineProperty(e,"makeGenericClientConstructor",{enumerable:!0,get:function(){return l.makeClientConstructor}});let u=X();Object.defineProperty(e,"Metadata",{enumerable:!0,get:function(){return u.Metadata}});let d=VA();Object.defineProperty(e,"Server",{enumerable:!0,get:function(){return d.Server}});let f=LA();Object.defineProperty(e,"ServerCredentials",{enumerable:!0,get:function(){return f.ServerCredentials}});let p=HA();Object.defineProperty(e,"StatusBuilder",{enumerable:!0,get:function(){return p.StatusBuilder}}),e.credentials={combineChannelCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),combineCallCredentials:(e,...t)=>t.reduce((e,t)=>e.compose(t),e),createInsecure:a.ChannelCredentials.createInsecure,createSsl:a.ChannelCredentials.createSsl,createFromSecureContext:a.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:t.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:t.CallCredentials.createFromGoogleCredential,createEmpty:t.CallCredentials.createEmpty},e.closeClient=e=>e.close(),e.waitForClientReady=(e,t,n)=>e.waitForReady(t,n),e.loadObject=(e,t)=>{throw Error(`Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead`)},e.load=(e,t,n)=>{throw Error(`Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead`)},e.setLogger=e=>{c.setLogger(e)},e.setLogVerbosity=e=>{c.setLoggerVerbosity(e)},e.getClientChannel=e=>o.Client.prototype.getChannel.call(e);var m=ck();Object.defineProperty(e,"ListenerBuilder",{enumerable:!0,get:function(){return m.ListenerBuilder}}),Object.defineProperty(e,"RequesterBuilder",{enumerable:!0,get:function(){return m.RequesterBuilder}}),Object.defineProperty(e,"InterceptingCall",{enumerable:!0,get:function(){return m.InterceptingCall}}),Object.defineProperty(e,"InterceptorConfigurationError",{enumerable:!0,get:function(){return m.InterceptorConfigurationError}});var h=pA();Object.defineProperty(e,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return h.getChannelzServiceDefinition}}),Object.defineProperty(e,"getChannelzHandlers",{enumerable:!0,get:function(){return h.getChannelzHandlers}});var g=ak();Object.defineProperty(e,"addAdminServicesToServer",{enumerable:!0,get:function(){return g.addAdminServicesToServer}});var _=BA();Object.defineProperty(e,"ServerListenerBuilder",{enumerable:!0,get:function(){return _.ServerListenerBuilder}}),Object.defineProperty(e,"ResponderBuilder",{enumerable:!0,get:function(){return _.ResponderBuilder}}),Object.defineProperty(e,"ServerInterceptingCall",{enumerable:!0,get:function(){return _.ServerInterceptingCall}});var v=zA();Object.defineProperty(e,"ServerMetricRecorder",{enumerable:!0,get:function(){return v.ServerMetricRecorder}}),e.experimental=GA();let y=wA(),b=KA(),x=qA(),S=UA(),C=JA(),w=YA(),T=ZA(),E=pA();y.setup(),b.setup(),x.setup(),S.setup(),C.setup(),w.setup(),T.setup(),E.setup()})),$A=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createServiceClientConstructor=void 0;let t=QA();function n(e,n){let r={export:{path:e,requestStream:!1,responseStream:!1,requestSerialize:e=>e,requestDeserialize:e=>e,responseSerialize:e=>e,responseDeserialize:e=>e}};return t.makeGenericClientConstructor(r,n)}e.createServiceClientConstructor=n})),ej=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createOtlpGrpcExporterTransport=e.GrpcExporterTransport=e.createEmptyMetadata=e.createSslCredentials=e.createInsecureCredentials=void 0;let t=`OTel-OTLP-Exporter-JavaScript/${HO().VERSION}`;function n(e){return e?`${e} ${t}`:t}function r(e){return e===`gzip`?2:0}function i(){let{credentials:e}=QA();return e.createInsecure()}e.createInsecureCredentials=i;function a(e,t,n){let{credentials:r}=QA();return r.createSsl(e,t,n)}e.createSslCredentials=a;function o(){let{Metadata:e}=QA();return new e}e.createEmptyMetadata=o;var s=class{_client;_metadata;_parameters;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,t){let i=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:e}=$A();try{this._metadata=this._parameters.metadata()}catch(e){return Promise.resolve({status:`failure`,error:e})}let t=e(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new t(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":r(this._parameters.compression),"grpc.primary_user_agent":n(this._parameters.userAgent)})}catch(e){return Promise.resolve({status:`failure`,error:e})}}return new Promise(e=>{let n=Date.now()+t;if(this._metadata==null)return e({error:Error(`metadata was null`),status:`failure`});this._client.export(i,this._metadata,{deadline:n},(t,n)=>{e(t?{status:`failure`,error:t}:{data:n,status:`success`})})})}};e.GrpcExporterTransport=s;function c(e){return new s(e)}e.createOtlpGrpcExporterTransport=c})),tj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getOtlpGrpcDefaultConfiguration=e.mergeOtlpGrpcConfigurationWithDefaults=e.validateAndNormalizeUrl=void 0;let t=(VE(),i(BE)),n=ej(),r=s(`url`),a=(c(),i(d));function o(e){e=e.trim(),e.match(/^([\w]{1,8}):\/\//)||(e=`https://${e}`);let t=new r.URL(e);return t.protocol===`unix:`?e:(t.pathname&&t.pathname!==`/`&&a.diag.warn(`URL path should not be set when using grpc, the path part of the URL will be ignored.`),t.protocol!==``&&!t.protocol?.match(/^(http)s?:$/)&&a.diag.warn(`URL protocol should be http(s)://. Using http://.`),t.host)}e.validateAndNormalizeUrl=o;function l(e,t){for(let[n,r]of Object.entries(t.getMap()))e.get(n).length<1&&e.set(n,r)}function u(e,r,i){let a=e.url??r.url??i.url;return{...(0,t.mergeOtlpSharedConfigurationWithDefaults)(e,r,i),metadata:()=>{let t=i.metadata();return l(t,e.metadata?.().clone()??(0,n.createEmptyMetadata)()),l(t,r.metadata?.()??(0,n.createEmptyMetadata)()),t},url:o(a),credentials:e.credentials??r.credentials?.(a)??i.credentials(a),userAgent:e.userAgent}}e.mergeOtlpGrpcConfigurationWithDefaults=u;function f(){return{...(0,t.getSharedConfigurationDefaults)(),metadata:()=>(0,n.createEmptyMetadata)(),url:`http://localhost:4317`,credentials:e=>e.startsWith(`http://`)?()=>(0,n.createInsecureCredentials)():()=>(0,n.createSslCredentials)()}}e.getOtlpGrpcDefaultConfiguration=f})),nj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getOtlpGrpcConfigurationFromEnv=void 0;let t=q(),n=ej(),r=(LO(),i(IO)),a=s(`fs`),o=s(`path`),l=(c(),i(d));function u(e,t){if(e!=null&&e!==``)return e;if(t!=null&&t!==``)return t}function f(e){let r=process.env[`OTEL_EXPORTER_OTLP_${e}_HEADERS`]?.trim(),i=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),a=(0,t.parseKeyPairsIntoRecord)(r),o=(0,t.parseKeyPairsIntoRecord)(i);if(Object.keys(a).length===0&&Object.keys(o).length===0)return;let s=Object.assign({},o,a),c=(0,n.createEmptyMetadata)();for(let[e,t]of Object.entries(s))c.set(e,t);return c}function p(e){let t=f(e);if(t!=null)return()=>t}function m(e){let t=process.env[`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`]?.trim(),n=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return u(t,n)}function h(e){let t=process.env[`OTEL_EXPORTER_OTLP_${e}_INSECURE`]?.toLowerCase().trim(),n=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return u(t,n)===`true`}function g(e,t,n){let r=process.env[e]?.trim(),i=process.env[t]?.trim(),s=u(r,i);if(s!=null)try{return a.readFileSync(o.resolve(process.cwd(),s))}catch{l.diag.warn(n);return}else return}function _(e){return g(`OTEL_EXPORTER_OTLP_${e}_CLIENT_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`,`Failed to read client certificate chain file`)}function v(e){return g(`OTEL_EXPORTER_OTLP_${e}_CLIENT_KEY`,`OTEL_EXPORTER_OTLP_CLIENT_KEY`,`Failed to read client certificate private key file`)}function y(e){return g(`OTEL_EXPORTER_OTLP_${e}_CERTIFICATE`,`OTEL_EXPORTER_OTLP_CERTIFICATE`,`Failed to read root certificate file`)}function b(e){let t=v(e),r=_(e),i=y(e);return i!=null&&!(t!=null&&r!=null)?(l.diag.warn(`Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate`),(0,n.createSslCredentials)(y(e))):(0,n.createSslCredentials)(i,t,r)}function x(e){return h(e)?(0,n.createInsecureCredentials)():b(e)}function S(e){return{...(0,r.getSharedConfigurationFromEnvironment)(e),metadata:p(e),url:m(e),credentials:t=>t.startsWith(`http://`)?()=>(0,n.createInsecureCredentials)():t.startsWith(`https://`)?()=>b(e):()=>x(e)}}e.getOtlpGrpcConfigurationFromEnv=S})),rj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertLegacyOtlpGrpcOptions=void 0;let t=tj(),n=ej(),r=nj();function i(e,i){let a=e.credentials;return(0,t.mergeOtlpGrpcConfigurationWithDefaults)({url:e.url,metadata:()=>e.metadata??(0,n.createEmptyMetadata)(),compression:e.compression,timeoutMillis:e.timeoutMillis,concurrencyLimit:e.concurrencyLimit,credentials:a==null?void 0:()=>a,userAgent:e.userAgent},(0,r.getOtlpGrpcConfigurationFromEnv)(i),(0,t.getOtlpGrpcDefaultConfiguration)())}e.convertLegacyOtlpGrpcOptions=i})),ij=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createOtlpGrpcExportDelegate=void 0;let t=(VE(),i(BE)),n=ej();function r(e,r,i,a){return(0,t.createOtlpNetworkExportDelegate)(e,r,(0,n.createOtlpGrpcExporterTransport)({address:e.url,compression:e.compression,credentials:e.credentials,metadata:e.metadata,userAgent:e.userAgent,grpcName:i,grpcPath:a}))}e.createOtlpGrpcExportDelegate=r})),aj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createOtlpGrpcExportDelegate=e.convertLegacyOtlpGrpcOptions=void 0;var t=rj();Object.defineProperty(e,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return t.convertLegacyOtlpGrpcOptions}});var n=ij();Object.defineProperty(e,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return n.createOtlpGrpcExportDelegate}})})),oj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;let t=VO(),n=aj(),r=DD();e.OTLPMetricExporter=class extends t.OTLPMetricExporterBase{constructor(e){super((0,n.createOtlpGrpcExportDelegate)((0,n.convertLegacyOtlpGrpcOptions)(e??{},`METRICS`),r.ProtobufMetricsSerializer,`MetricsExportService`,`/opentelemetry.proto.collector.metrics.v1.MetricsService/Export`),e)}}})),sj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=oj();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})})),cj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrometheusSerializer=void 0;let t=(c(),i(d)),n=hE(),r=q(),a=(Zw(),i(Xw));function o(e){return e.replace(/\\/g,`\\\\`).replace(/\n/g,`\\n`)}function s(e=``){return typeof e!=`string`&&(e=JSON.stringify(e)),o(e).replace(/"/g,`\\"`)}let l=/[^a-z0-9_]/gi,u=/_{2,}/g;function f(e){return e.replace(l,`_`).replace(u,`_`)}function p(e,t){return!e.endsWith(`_total`)&&t.dataPointType===n.DataPointType.SUM&&t.isMonotonic&&(e+=`_total`),e}function m(e){return e===1/0?`+Inf`:e===-1/0?`-Inf`:`${e}`}function h(e){switch(e.dataPointType){case n.DataPointType.SUM:return e.isMonotonic?`counter`:`gauge`;case n.DataPointType.GAUGE:return`gauge`;case n.DataPointType.HISTOGRAM:return`histogram`;default:return`untyped`}}function g(e,t,n,r,i){let a=!1,o=``;for(let[e,n]of Object.entries(t)){let t=f(e);a=!0,o+=`${o.length>0?`,`:``}${t}="${s(n)}"`}if(i)for(let[e,t]of Object.entries(i)){let n=f(e);a=!0,o+=`${o.length>0?`,`:``}${n}="${s(t)}"`}return a&&(e+=`{${o}}`),`${e} ${m(n)}${r===void 0?``:` `+String(r)}\n`}e.PrometheusSerializer=class{_prefix;_appendTimestamp;_additionalAttributes;_withResourceConstantLabels;_withoutScopeInfo;_withoutTargetInfo;constructor(e,t=!1,n,r,i){e&&(this._prefix=e+`_`),this._appendTimestamp=t,this._withResourceConstantLabels=n,this._withoutScopeInfo=!!i,this._withoutTargetInfo=!!r}serialize(e){let t=``;this._additionalAttributes=this._filterResourceConstantLabels(e.resource.attributes,this._withResourceConstantLabels);for(let n of e.scopeMetrics)t+=this._serializeScopeMetrics(n);return t===``&&(t+=`# no registered metrics`),this._serializeResource(e.resource)+t}_filterResourceConstantLabels(e,t){if(t){let n={};for(let[r,i]of Object.entries(e))r.match(t)&&(n[r]=i);return n}}_serializeScopeMetrics(e){let t=``;for(let n of e.metrics)t+=this._serializeMetricData(n,e.scope)+`
120
+ `;return t}_serializeMetricData(e,r){let i=f(o(e.descriptor.name));this._prefix&&(i=`${this._prefix}${i}`);let s=e.dataPointType;i=p(i,e);let c=`# HELP ${i} ${o(e.descriptor.description||`description missing`)}`,l=e.descriptor.unit?`\n# UNIT ${i} ${o(e.descriptor.unit)}`:``,u=`# TYPE ${i} ${h(e)}`,d;if(this._withoutScopeInfo)d=this._additionalAttributes;else{let e={[a.ATTR_OTEL_SCOPE_NAME]:r.name};r.schemaUrl&&(e[`otel.scope.schema_url`]=r.schemaUrl),r.version&&(e[a.ATTR_OTEL_SCOPE_VERSION]=r.version),d=Object.assign(e,this._additionalAttributes)}let m=``;switch(s){case n.DataPointType.SUM:case n.DataPointType.GAUGE:m=e.dataPoints.map(t=>this._serializeSingularDataPoint(i,e,t,d)).join(``);break;case n.DataPointType.HISTOGRAM:m=e.dataPoints.map(t=>this._serializeHistogramDataPoint(i,e,t,d)).join(``);break;default:t.diag.error(`Unrecognizable DataPointType: ${s} for metric "${i}"`)}return`${c}${l}\n${u}\n${m}`.trim()}_serializeSingularDataPoint(e,t,n,i){let a=``,{value:o,attributes:s}=n,c=(0,r.hrTimeToMilliseconds)(n.endTime);return a+=g(e,s,o,this._appendTimestamp?c:void 0,i),a}_serializeHistogramDataPoint(e,t,n,i){let a=``,o=n.attributes,s=n.value,c=(0,r.hrTimeToMilliseconds)(n.endTime);for(let t of[`count`,`sum`]){let n=s[t];n!=null&&(a+=g(e+`_`+t,o,n,this._appendTimestamp?c:void 0,i))}let l=0,u=s.buckets.counts.entries(),d=!1;for(let[t,n]of u){l+=n;let r=s.buckets.boundaries[t];if(r===void 0&&d)break;r===1/0&&(d=!0),a+=g(e+`_bucket`,o,l,this._appendTimestamp?c:void 0,Object.assign({},i,{le:r===void 0||r===1/0?`+Inf`:String(r)}))}return a}_serializeResource(e){if(this._withoutTargetInfo===!0)return``;let t=`target_info`;return`${`# HELP ${t} Target metadata`}\n${`# TYPE ${t} gauge`}\n${g(t,e.attributes,1).trim()}\n`}}})),lj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrometheusExporter=void 0;let t=(c(),i(d)),n=q(),r=hE(),a=s(`http`),o=cj(),l=s(`url`);e.PrometheusExporter=class e extends r.MetricReader{static DEFAULT_OPTIONS={host:void 0,port:9464,endpoint:`/metrics`,prefix:``,appendTimestamp:!1,withResourceConstantLabels:void 0,withoutScopeInfo:!1,withoutTargetInfo:!1};_host;_port;_baseUrl;_endpoint;_server;_prefix;_appendTimestamp;_serializer;_startServerPromise;constructor(n={},i=()=>{}){super({aggregationSelector:e=>({type:r.AggregationType.DEFAULT}),aggregationTemporalitySelector:e=>r.AggregationTemporality.CUMULATIVE,metricProducers:n.metricProducers}),this._host=n.host||process.env.OTEL_EXPORTER_PROMETHEUS_HOST||e.DEFAULT_OPTIONS.host,this._port=n.port||Number(process.env.OTEL_EXPORTER_PROMETHEUS_PORT)||e.DEFAULT_OPTIONS.port,this._prefix=n.prefix||e.DEFAULT_OPTIONS.prefix,this._appendTimestamp=typeof n.appendTimestamp==`boolean`?n.appendTimestamp:e.DEFAULT_OPTIONS.appendTimestamp;let s=n.withResourceConstantLabels||e.DEFAULT_OPTIONS.withResourceConstantLabels,c=n.withoutScopeInfo||e.DEFAULT_OPTIONS.withoutScopeInfo,l=n.withoutTargetInfo||e.DEFAULT_OPTIONS.withoutTargetInfo;this._server=(0,a.createServer)(this._requestHandler).unref(),this._serializer=new o.PrometheusSerializer(this._prefix,this._appendTimestamp,s,l,c),this._baseUrl=`http://${this._host}:${this._port}/`,this._endpoint=(n.endpoint||e.DEFAULT_OPTIONS.endpoint).replace(/^([^/])/,`/$1`),n.preventServerStart===!0?i&&queueMicrotask(i):this.startServer().then(i,e=>{t.diag.error(e),i(e)})}async onForceFlush(){}onShutdown(){return this.stopServer()}stopServer(){return this._server?new Promise(e=>{this._server.close(r=>{r?r.code!==`ERR_SERVER_NOT_RUNNING`&&(0,n.globalErrorHandler)(r):t.diag.debug(`Prometheus exporter was stopped`),e()})}):(t.diag.debug(`Prometheus stopServer() was called but server was never started.`),Promise.resolve())}startServer(){return this._startServerPromise??=new Promise((e,n)=>{this._server.once(`error`,n),this._server.listen({port:this._port,host:this._host},()=>{t.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`),e()})}),this._startServerPromise}getMetricsRequestHandler(e,t){this._exportMetrics(t)}_requestHandler=(e,t)=>{let n;try{e.url!=null&&(n=new l.URL(e.url,this._baseUrl).pathname)}catch{t.statusCode=400,t.end(`Bad Request`);return}n===this._endpoint?this._exportMetrics(t):this._notFound(t)};_exportMetrics=e=>{e.statusCode=200,e.setHeader(`content-type`,`text/plain`),this.collect().then(n=>{let{resourceMetrics:r,errors:i}=n;i.length&&t.diag.error(`PrometheusExporter: metrics collection errors`,...i),e.end(this._serializer.serialize(r))},t=>{e.end(`# failed to export metrics: ${t}`)})};_notFound=e=>{e.statusCode=404,e.end()}}})),uj=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrometheusSerializer=e.PrometheusExporter=void 0;var t=lj();Object.defineProperty(e,"PrometheusExporter",{enumerable:!0,get:function(){return t.PrometheusExporter}});var n=cj();Object.defineProperty(e,"PrometheusSerializer",{enumerable:!0,get:function(){return n.PrometheusSerializer}})})),dj=hE(),fj=sj(),pj=uj();c();async function mj(t){console.log(`Setting up OTLP metrics, debug=`,!!t),t&&e.setLogger(new u,o.DEBUG);let n=[new dj.PeriodicExportingMetricReader({exporter:new fj.OTLPMetricExporter,exportIntervalMillis:6e4})];t&&n.push(new pj.PrometheusExporter({host:`0.0.0.0`,port:4041}));let r=new dj.MeterProvider({readers:[new dj.PeriodicExportingMetricReader({exporter:new fj.OTLPMetricExporter,exportIntervalMillis:6e4})]});a.setGlobalMeterProvider(r),[`SIGINT`,`SIGTERM`].forEach(e=>{process.on(e,()=>r.forceFlush().catch(console.error))}),a.getMeter(`processor`).createGauge(`up`).record(1)}var hj=class{loader;constructor(e){this.loader=e}async listen(e){let t=ne.INSTANCE;await this.loader(),await t.configure(m(P)),console.log(`Starting Action Server at:`,e),await t.startServer(e)}forceShutdown(){ne.INSTANCE.shutdown()}},gj=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},_j=class extends gj{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},vj=class{constructor(e,t){switch(this.description=t||``,this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case`<`:this.required=!0,this._name=e.slice(1,-1);break;case`[`:this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith(`...`)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new _j(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function yj(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}var bj=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let n=e=>e.short?e.short.replace(/^-/,``):e.long.replace(/^--/,``);return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){let r=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!r&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||``}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(e=>yj(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(t?` `+t:``)}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+`|`+e._aliases[0]);let n=``;for(let t=e.parent;t;t=t.parent)n=t.name()+` `+n;return n+t+` `+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==`boolean`)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(`, `)}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(`, `)})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,``]}groupItems(e,t,n){let r=new Map;return e.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{let t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){let n=t.padWidth(e,t),r=t.helpWidth??80;function i(e,r){return t.formatItem(e,n,r,t)}let a=[`${t.styleTitle(`Usage:`)} ${t.styleUsage(t.commandUsage(e))}`,``],o=t.commandDescription(e);o.length>0&&(a=a.concat([t.boxWrap(t.styleCommandDescription(o),r),``]));let s=t.visibleArguments(e).map(e=>i(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));if(a=a.concat(this.formatItemList(`Arguments:`,s,t)),this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??`Options:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){let n=t.visibleGlobalOptions(e).map(e=>i(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));a=a.concat(this.formatItemList(`Global Options:`,n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||`Commands:`).forEach((e,n)=>{let r=e.map(e=>i(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));a=a.concat(this.formatItemList(n,r,t))}),a.join(`
121
+ `)}displayWidth(e){return V(e).length}styleTitle(e){return e}styleUsage(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e===`[command]`?this.styleSubcommandText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleCommandText(e)).join(` `)}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(` `).map(e=>e===`[options]`?this.styleOptionText(e):e[0]===`[`||e[0]===`<`?this.styleArgumentText(e):this.styleSubcommandText(e)).join(` `)}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){let i=` `.repeat(2);if(!n)return i+e;let a=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2,s;return s=o<this.minWidthToWrap||r.preformatted(n)?n:r.boxWrap(n,o).replace(/\n/g,`
122
122
  `+` `.repeat(t+2)),i+a+` `.repeat(2)+s.replace(/\n/g,`\n${i}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,i=[];return n.forEach(e=>{let n=e.match(r);if(n===null){i.push(``);return}let a=[n.shift()],o=this.displayWidth(a[0]);n.forEach(e=>{let n=this.displayWidth(e);if(o+n<=t){a.push(e),o+=n;return}i.push(a.join(``));let r=e.trimStart();a=[r],o=this.displayWidth(r)}),i.push(a.join(``))}),i.join(`
123
- `)}},bj=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Cj(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new gj(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?Sj(this.name().replace(/^no-/,``)):Sj(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},xj=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function Sj(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Cj(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
123
+ `)}},xj=class{constructor(e,t){this.flags=e,this.description=t||``,this.required=e.includes(`<`),this.optional=e.includes(`[`),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=wj(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith(`--no-`)),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e==`string`&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new _j(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,``):this.short.replace(/^-/,``)}attributeName(){return this.negate?Cj(this.name().replace(/^no-/,``)):Cj(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Sj=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let r=this.negativeOptions.get(n).presetArg,i=r===void 0?!1:r;return t.negate===(i===e)}};function Cj(e){return e.split(`-`).reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function wj(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,a=e.split(/[ |,]+/).concat(`guard`);if(r.test(a[0])&&(t=a.shift()),i.test(a[0])&&(n=a.shift()),!t&&r.test(a[0])&&(t=a.shift()),!t&&i.test(a[0])&&(t=n,n=a.shift()),a[0].startsWith(`-`)){let t=a[0],n=`option creation failed due to '${t}' in option flags '${e}'`;throw/^-[^-][^-]/.test(t)?Error(`${n}
124
124
  - a short flag is a single dash and a single character
125
125
  - either use a single dash and a single character (for a short flag)
126
126
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(t)?Error(`${n}
127
127
  - too many short flags`):i.test(t)?Error(`${n}
128
128
  - too many long flags`):Error(`${n}
129
- - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function wj(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function Tj(e,t){if(!t||t.length===0)return``;t=Array.from(new Set(t));let n=e.startsWith(`--`);n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return t.forEach(t=>{if(t.length<=1)return;let n=wj(e,t),a=Math.max(e.length,t.length);(a-n)/a>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(`, `)}?)`:r.length===1?`\n(Did you mean ${r[0]}?)`:``}var Ej=class e extends Te{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>V.stdout.write(e),writeErr:e=>V.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>V.stdout.isTTY?V.stdout.columns:void 0,getErrHelpWidth:()=>V.stderr.isTTY?V.stderr.columns:void 0,getOutHasColors:()=>Oj()??(V.stdout.isTTY&&V.stdout.hasColors?.()),getErrHasColors:()=>Oj()??(V.stderr.isTTY&&V.stderr.hasColors?.()),stripColor:e=>ve(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new yj,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
130
- - specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new _j(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
131
- Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new hj(e,t,n)),V.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new bj(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
132
- - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof bj)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){V.versions?.electron&&(t.from=`electron`);let e=V.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=V.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:V.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,`default`)}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
133
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(De.existsSync(e))return;let r=`'${e}' does not exist
129
+ - unrecognised flag format`)}if(t===void 0&&n===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function Tj(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let a;a=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+a),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function Ej(e,t){if(!t||t.length===0)return``;t=Array.from(new Set(t));let n=e.startsWith(`--`);n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],i=3;return t.forEach(t=>{if(t.length<=1)return;let n=Tj(e,t),a=Math.max(e.length,t.length);(a-n)/a>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(`, `)}?)`:r.length===1?`\n(Did you mean ${r[0]}?)`:``}var Dj=class e extends Ee{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||``,this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description=``,this._summary=``,this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:e=>B.stdout.write(e),writeErr:e=>B.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>B.stdout.isTTY?B.stdout.columns:void 0,getErrHelpWidth:()=>B.stderr.isTTY?B.stderr.columns:void 0,getOutHasColors:()=>kj()??(B.stdout.isTTY&&B.stdout.hasColors?.()),getErrHasColors:()=>kj()??(B.stderr.isTTY&&B.stderr.hasColors?.()),stripColor:e=>V(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;typeof r==`object`&&r&&(i=r,r=null),i||={};let[,a,o]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(a);return r&&(s.description(r),s._executableHandler=!0),i.isDefault&&(this._defaultCommandName=s._name),s._hidden=!!(i.noHelp||i.hidden),s._executableFile=i.executableFile||null,o&&s.arguments(o),this._registerCommand(s),s.parent=this,s.copyInheritedSettings(this),r?this:s}createCommand(t){return new e(t)}createHelp(){return Object.assign(new bj,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!=`string`&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
130
+ - specify the name in Command constructor or using .name()`);return t||={},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new vj(e,t)}argument(e,t,n,r){let i=this.createArgument(e,t);return typeof n==`function`?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==`boolean`)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let[,n,r]=(e??`help [command]`).match(/([^ ]+) *(.*)/),i=t??`display help for command`,a=this.createCommand(n);return a.helpOption(!1),r&&a.arguments(r),i&&a.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||t)&&this._initCommandGroup(a),this}addHelpCommand(e,t){return typeof e==`object`?(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this):(this.helpCommand(e,t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand(`help`))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=[`preSubcommand`,`preAction`,`postAction`];if(!n.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
131
+ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=e=>{if(e.code!==`commander.executeSubCommandAsync`)throw e},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new gj(e,t,n)),B.exit(e)}action(e){let t=t=>{let n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)};return this._actionHandler=t,this}createOption(e,t){return new xj(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if(e.code===`commander.invalidArgument`){let t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
132
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){let r=t(this._findCommand(n)).join(`|`),i=t(e).join(`|`);throw Error(`cannot add command '${i}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,`default`);let r=(t,r,i)=>{t==null&&e.presetArg!==void 0&&(t=e.presetArg);let a=this.getOptionValue(n);t!==null&&e.parseArg?t=this._callParseArg(e,t,a,r):t!==null&&e.variadic&&(t=e._collectValue(t,a)),t??=e.negate?!1:e.isBoolean()||e.optional?!0:``,this.setOptionValueWithSource(n,t,i)};return this.on(`option:`+t,t=>{r(t,`error: option '${e.flags}' argument '${t}' is invalid.`,`cli`)}),e.envVar&&this.on(`optionEnv:`+t,t=>{r(t,`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`,`env`)}),this}_optionEx(e,t,n,r,i){if(typeof t==`object`&&t instanceof xj)throw Error(`To add an Option object use addOption() instead of option() or requiredOption()`);let a=this.createOption(t,n);if(a.makeOptionMandatory(!!e.mandatory),typeof r==`function`)a.default(i).argParser(r);else if(r instanceof RegExp){let e=r;r=(t,n)=>{let r=e.exec(t);return r?r[0]:n},a.default(i).argParser(r)}else a.default(r);return this.addOption(a)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error(`call .storeOptionsAsProperties() before adding options`);if(Object.keys(this._optionValues).length)throw Error(`call .storeOptionsAsProperties() before setting option values`);return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error(`first parameter to parse must be array or undefined`);if(t||={},e===void 0&&t.from===void 0){B.versions?.electron&&(t.from=`electron`);let e=B.execArgv??[];(e.includes(`-e`)||e.includes(`--eval`)||e.includes(`-p`)||e.includes(`--print`))&&(t.from=`eval`)}e===void 0&&(e=B.argv),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case`node`:this._scriptPath=e[1],n=e.slice(2);break;case`electron`:B.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case`user`:n=e.slice(0);break;case`eval`:n=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||`program`,n}parse(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let t=e.long.replace(/^--no-/,`--`);this._findOption(t)||this.setOptionValueWithSource(e.attributeName(),!0,`default`)}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
133
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(Oe.existsSync(e))return;let r=`'${e}' does not exist
134
134
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
135
135
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
136
- - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function r(e,t){let r=H.resolve(e,t);if(De.existsSync(r))return r;if(n.includes(H.extname(t)))return;let i=n.find(e=>De.existsSync(`${r}${e}`));if(i)return`${r}${i}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||``;if(this._scriptPath){let e;try{e=De.realpathSync(this._scriptPath)}catch{e=this._scriptPath}a=H.resolve(H.dirname(e),a)}if(a){let t=r(a,i);if(!t&&!e._executableFile&&this._scriptPath){let n=H.basename(this._scriptPath,H.extname(this._scriptPath));n!==this._name&&(t=r(a,`${n}-${e._name}`))}i=t||i}let o=n.includes(H.extname(i)),s;V.platform===`win32`?(this._checkForMissingExecutable(i,a,e._name),t.unshift(i),t=Dj(V.execArgv).concat(t),s=Ee.spawn(V.execPath,t,{stdio:`inherit`})):o?(t.unshift(i),t=Dj(V.execArgv).concat(t),s=Ee.spawn(V.argv[0],t,{stdio:`inherit`})):s=Ee.spawn(i,t,{stdio:`inherit`}),s.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{V.on(e,()=>{s.killed===!1&&s.exitCode===null&&s.kill(e)})});let c=this._exitCallback;s.on(`close`,e=>{e??=1,c?c(new hj(e,`commander.executeSubCommandAsync`,`(close)`)):V.exit(e)}),s.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(i,a,e._name);else if(t.code===`EACCES`)throw Error(`'${i}' not executable`);if(!c)V.exit(1);else{let e=new hj(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,c(e)}}),this.runningCommand=s}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
137
- `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in V.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,V.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new xj(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=Tj(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=e.length,i=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${r}: ${e.join(`, `)}.`;this.error(i,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=Tj(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>vj(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=H.basename(e,H.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(V.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
138
- Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function Dj(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function Oj(){if(V.env.NO_COLOR||V.env.FORCE_COLOR===`0`||V.env.FORCE_COLOR===`false`)return!1;if(V.env.FORCE_COLOR||V.env.CLICOLOR_FORCE!==void 0)return!0}new Ej;let kj=1;try{kj=parseInt(process.env.PROCESSOR_WORKER?.trim()??`1`)}catch(e){console.error(`Failed to parse worker number`,e)}function Aj(e,t){let n=parseInt(e,10);if(isNaN(n))throw new gj(`Not a number.`);return n}const jj=new Ej(`processor-runner`).allowUnknownOption().allowExcessArguments().name(`processor-runner`).description(`Sentio Processor Runtime`).argument(`<target>`,`Path to the processor module to load`).option(`-p, --port <port>`,`Port to listen on`,`4000`).option(`--concurrency <number>`,`Number of concurrent workers(V2 only, deprecated)`,Aj,4).option(`--batch-count <number>`,`Batch count for processing`,Aj,1).option(`-c, --chains-config <path>`,`Path to chains configuration file`,`chains-config.json`).option(`--pricefeed-server <url>`,`Price feed server URL`).option(`--log-format <format>`,`Log format (console|json)`,`console`).option(`--debug`,`Enable debug mode`).option(`--otlp-debug`,`Enable OTLP debug mode`).option(`--start-action-server`,`Start action server instead of processor server`).option(`--worker <number>`,`Number of processor worker threads `,Aj,kj).option(`--process-timeout <seconds>`,`Process timeout in seconds`,Aj,60).option(`--worker-timeout <seconds>`,`Worker timeout in seconds`,Aj,parseInt(process.env.WORKER_TIMEOUT_SECONDS||`60`)).option(`--enable-partition`,`Enable binding data partition`,process.env.SENTIO_ENABLE_BINDING_DATA_PARTITION===`true`);jj.parse();const $={...jj.opts(),target:jj.args[jj.args.length-1]},Mj=process.env.LOG_LEVEL?.toLowerCase();let Nj=!1,Pj=!1,Fj=()=>{};Jo($.logFormat===`json`,Mj===`debug`?!0:$.debug),console.debug(`Starting with`,$.target),await pj($.otlpDebug),Error.stackTraceLimit=20,se($),console.debug(`Starting Server`,$);const Ij=process.env.IS_CHILD===`true`;function Lj(e){Ij||(Nj=!0,Fj()),process.exit(e)}if(!Ij){let e=de(`@sentio/sdk`),t=de(`@sentio/runtime`);console.log(`Runtime version:`,t.version,`SDK version:`,e.version)}let Rj,zj,Bj;const Vj=async()=>{let e=await import($.target);return console.debug(`Module loaded`,e),e};if($.startActionServer)Rj=new mj(Vj),Rj.listen($.port);else{let e=new zi(new ue(Vj,$,()=>zj?.close())),t=Ii({routes:t=>{t.service(F,e)},readMaxBytes:768*1024*1024,writeMaxBytes:768*1024*1024});zj=be.createServer(t),zj.listen(Number($.port)),console.log(`Processor Server Started at:`,$.port)}if(!Ij){let e=4040;if(Bj=ye.createServer(async function(e,t){if(e.url){let n=new URL(e.url,`http://${e.headers.host}`),r=n.searchParams;switch(n.pathname){case`/heap`:try{let e=`/tmp/`+Date.now()+`.heapsnapshot`;await Hj(e);let n=Ri.default.createReadStream(e);t.writeHead(200,{"Content-Type":`application/json`}),n.pipe(t),t.end()}catch{t.writeHead(500),t.end()}break;case`/profile`:try{let e=parseInt(r.get(`t`)||`1000`,10)||1e3,n=new xe;n.connect(),await n.post(`Profiler.enable`),await n.post(`Profiler.start`),await new Promise(t=>setTimeout(t,e));let{profile:i}=await n.post(`Profiler.stop`);t.writeHead(200,{"Content-Type":`application/json`}),t.write(JSON.stringify(i)),n.disconnect()}catch{t.writeHead(500)}break;default:t.writeHead(404)}}else t.writeHead(404);t.end()}).listen(e),console.log(`Metric Server Started at:`,e),process.env.OOM_DUMP_MEMORY_SIZE_GB){let e=!1,t=parseFloat(process.env.OOM_DUMP_MEMORY_SIZE_GB);console.log(`heap dumping is enabled, limit set to `,t,`gb`);let n=process.env.OOM_DUMP_DIR||`/tmp`;setInterval(async()=>{let r=process.memoryUsage();if(console.log(`Current Memory Usage`,r),r.heapTotal>t*1024*1024*1024&&!e){let t=me(n,`${Date.now()}.heapsnapshot`);e=!0,await Hj(t),process.exit(11)}},1e3*60)}}process.once(`SIGINT`,function(){Nj||(Nj=!0,Fj(),Uj(0))}).once(`SIGTERM`,function(){Nj||(Nj=!0,Fj(),Uj(0))}).on(`uncaughtException`,e=>{console.error(`Uncaught Exception, please checking if await is properly used`,e)}).on(`unhandledRejection`,(e,t)=>{e?.message.startsWith(`invalid ENS name (disallowed character: "*"`)||console.error(`Unhandled Rejection, please checking if await is properly`,e)});async function Hj(e){console.log(`Heap dumping to`,e);let t=new xe;Ri.default.mkdirSync(pe(e),{recursive:!0});let n=Ri.default.openSync(e,`w`);try{t.connect(),t.on(`HeapProfiler.addHeapSnapshotChunk`,e=>{Ri.default.writeSync(n,e.params.chunk)}),await t.post(`HeapProfiler.takeHeapSnapshot`),console.log(`Heap dumped to`,e)}finally{t.disconnect(),Ri.default.closeSync(n)}}function Uj(e){zj?zj.close():Rj?.forceShutdown&&Rj.forceShutdown(),console.log(`RPC server shut down`),Bj?Bj.close(function(){console.log(`Http server shut down`),Lj(e)}):Lj(e)}if($.worker>1&&!Ij){let e=new Map,t=new Map,n=parseInt($.port),r=1e3,i=n=>{let a=process.argv.slice(2),o=[`--port=`+String(n)];for(let e=0;e<a.length;e++){let t=a[e];if(t===`-p`||t===`--port`){e++;continue}else if(t.startsWith(`--port=`)||t.startsWith(`--inspect=`))continue;o.push(t)}let s=Se(Ce(import.meta.url),o,{env:{...process.env,IS_CHILD:`true`},stdio:`inherit`});s.on(`error`,e=>{console.error(`Child process on port ${n} error:`,e)}),s.on(`exit`,(a,o)=>{if(e.delete(n),console.log(`Child process on port ${n} exited with code ${a}, signal ${o??`none`}`),Nj||t.has(n))return;console.log(`Scheduling restart for child process on port ${n} in ${r}ms`);let s=setTimeout(()=>{t.delete(n),!Nj&&(console.log(`Restarting child process on port ${n}`),i(n))},r);t.set(n,s)}),e.set(n,s),console.log(`Spawned child server process for port ${n} (pid: ${s.pid})`)};for(let e=1;e<$.worker;e++)i(n+e);Fj=()=>{if(!Pj){Pj=!0,Nj=!0;for(let e of t.values())clearTimeout(e);t.clear();for(let t of e.values())t.kill(`SIGINT`)}}}export{};
136
+ - ${t?`searched for local subcommand relative to directory '${t}'`:`no directory for search for local subcommand, use .executableDir() to supply a custom directory`}`;throw Error(r)}_executeSubCommand(e,t){t=t.slice();let n=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function r(e,t){let r=De.resolve(e,t);if(Oe.existsSync(r))return r;if(n.includes(De.extname(t)))return;let i=n.find(e=>Oe.existsSync(`${r}${e}`));if(i)return`${r}${i}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||``;if(this._scriptPath){let e;try{e=Oe.realpathSync(this._scriptPath)}catch{e=this._scriptPath}a=De.resolve(De.dirname(e),a)}if(a){let t=r(a,i);if(!t&&!e._executableFile&&this._scriptPath){let n=De.basename(this._scriptPath,De.extname(this._scriptPath));n!==this._name&&(t=r(a,`${n}-${e._name}`))}i=t||i}let o=n.includes(De.extname(i)),s;B.platform===`win32`?(this._checkForMissingExecutable(i,a,e._name),t.unshift(i),t=Oj(B.execArgv).concat(t),s=H.spawn(B.execPath,t,{stdio:`inherit`})):o?(t.unshift(i),t=Oj(B.execArgv).concat(t),s=H.spawn(B.argv[0],t,{stdio:`inherit`})):s=H.spawn(i,t,{stdio:`inherit`}),s.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{B.on(e,()=>{s.killed===!1&&s.exitCode===null&&s.kill(e)})});let c=this._exitCallback;s.on(`close`,e=>{e??=1,c?c(new gj(e,`commander.executeSubCommandAsync`,`(close)`)):B.exit(e)}),s.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(i,a,e._name);else if(t.code===`EACCES`)throw Error(`'${i}' not executable`);if(!c)B.exit(1);else{let e=new gj(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,c(e)}}),this.runningCommand=s}_dispatchSubcommand(e,t,n){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,r,`preSubcommand`),i=this._chainOrCall(i,()=>{if(r._executableHandler)this._executeSubCommand(r,t.concat(n));else return r._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??`--help`])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(e,t,n)=>{let r=t;if(t!==null&&e.parseArg){let i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce((t,r)=>e(n,r,t),n.defaultValue))):i===void 0&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&typeof e.then==`function`?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,r=[];return this._getCommandAndAncestors().reverse().filter(e=>e._lifeCycleHooks[t]!==void 0).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),t===`postAction`&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let n;return n=this._chainOrCallHooks(n,`preAction`),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(i,e,t)})),n=this._chainOrCallHooks(n,`postAction`),n}if(this.parent?.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand(`*`))return this._dispatchSubcommand(`*`,e,t);this.listenerCount(`command:*`)?this.emit(`command:*`,e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(e=>{let t=e.attributeName();return this.getOptionValue(t)===void 0?!1:this.getOptionValueSource(t)!=="default"});e.filter(e=>e.conflictsWith.length>0).forEach(t=>{let n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],r=t;function i(e){return e.length>1&&e[0]===`-`}let a=e=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)?!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e))):!1,o=null,s=null,c=0;for(;c<e.length||s;){let l=s??e[c++];if(s=null,l===`--`){r===n&&r.push(l),r.push(...e.slice(c));break}if(o&&(!i(l)||a(l))){this.emit(`option:${o.name()}`,l);continue}if(o=null,i(l)){let t=this._findOption(l);if(t){if(t.required){let n=e[c++];n===void 0&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;c<e.length&&(!i(e[c])||a(e[c]))&&(n=e[c++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&l[0]===`-`&&l[1]!==`-`){let e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),s=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let e=l.indexOf(`=`),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r===t&&i(l)&&!(this.commands.length===0&&a(l))&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(l)){t.push(l),n.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(c));break}else if(this._defaultCommandName){n.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==`string`?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
137
+ `),this.outputHelp({error:!0}));let n=t||{},r=n.exitCode||1,i=n.code||`commander.error`;this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in B.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||[`default`,`config`,`env`].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,B.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Sj(this.options),t=e=>this.getOptionValue(e)!==void 0&&![`default`,`implied`].includes(this.getOptionValueSource(e));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],`implied`)})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:`commander.missingArgument`})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:`commander.optionMissingArgument`})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:`commander.missingMandatoryOptionValue`})}_conflictingOption(e,t){let n=e=>{let t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),i=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(r.presetArg===void 0&&n===!1||r.presetArg!==void 0&&n===r.presetArg)?r:i||e},r=e=>{let t=n(e),r=t.attributeName();return this.getOptionValueSource(r)===`env`?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:`commander.conflictingOption`})}unknownOption(e){if(this._allowUnknownOption)return;let t=``;if(e.startsWith(`--`)&&this._showSuggestionAfterError){let n=[],r=this;do{let e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=Ej(e,n)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:`commander.unknownOption`})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?``:`s`,r=e.length,i=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${r}: ${e.join(`, `)}.`;this.error(i,{code:`commander.excessArguments`})}unknownCommand(){let e=this.args[0],t=``;if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=Ej(e,n)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:`commander.unknownCommand`})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t||=`-V, --version`,n||=`output the version number`;let r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on(`option:`+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,`commander.version`,e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw Error(`Command alias can't be the same as its name`);let n=this.parent?._findCommand(e);if(n){let t=[n.name()].concat(n.aliases()).join(`|`);throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let e=this.registeredArguments.map(e=>yj(e));return[].concat(this.options.length||this._helpOption!==null?`[options]`:[],this.commands.length?`[command]`:[],this.registeredArguments.length?e:[]).join(` `)}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??``:(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??``:(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??``:(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=De.basename(e,De.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e||={};let t=!!e.error,n,r,i;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:i}}outputHelp(e){let t;typeof e==`function`&&(t=e,e=void 0);let n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit(`beforeAllHelp`,r)),this.emit(`beforeHelp`,r);let i=this.helpInformation({error:n.error});if(t&&(i=t(i),typeof i!=`string`&&!Buffer.isBuffer(i)))throw Error(`outputHelp callback must return a string or a Buffer`);n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit(`afterHelp`,r),this._getCommandAndAncestors().forEach(e=>e.emit(`afterAllHelp`,r))}helpOption(e,t){return typeof e==`boolean`?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??`-h, --help`,t??`display help for command`),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(B.exitCode??0);t===0&&e&&typeof e!=`function`&&e.error&&(t=1),this._exit(t,`commander.help`,`(outputHelp)`)}addHelpText(e,t){let n=[`beforeAll`,`before`,`after`,`afterAll`];if(!n.includes(e))throw Error(`Unexpected value for position to addHelpText.
138
+ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let n;n=typeof t==`function`?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,`commander.helpDisplayed`,`(outputHelp)`))}};function Oj(e){return e.map(e=>{if(!e.startsWith(`--inspect`))return e;let t,n=`127.0.0.1`,r=`9229`,i;return(i=e.match(/^(--inspect(-brk)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],r=i[4]):(t=i[1],/^\d+$/.test(i[3])?r=i[3]:n=i[3]):t=i[1],t&&r!==`0`?`${t}=${n}:${parseInt(r)+1}`:e})}function kj(){if(B.env.NO_COLOR||B.env.FORCE_COLOR===`0`||B.env.FORCE_COLOR===`false`)return!1;if(B.env.FORCE_COLOR||B.env.CLICOLOR_FORCE!==void 0)return!0}new Dj;let Aj=1;try{Aj=parseInt(process.env.PROCESSOR_WORKER?.trim()??`1`)}catch(e){console.error(`Failed to parse worker number`,e)}function jj(e,t){let n=parseInt(e,10);if(isNaN(n))throw new _j(`Not a number.`);return n}const Mj=new Dj(`processor-runner`).allowUnknownOption().allowExcessArguments().name(`processor-runner`).description(`Sentio Processor Runtime`).argument(`<target>`,`Path to the processor module to load`).option(`-p, --port <port>`,`Port to listen on`,`4000`).option(`--concurrency <number>`,`Number of concurrent workers(V2 only, deprecated)`,jj,4).option(`--batch-count <number>`,`Batch count for processing`,jj,1).option(`-c, --chains-config <path>`,`Path to chains configuration file`,`chains-config.json`).option(`--pricefeed-server <url>`,`Price feed server URL`).option(`--log-format <format>`,`Log format (console|json)`,`console`).option(`--debug`,`Enable debug mode`).option(`--otlp-debug`,`Enable OTLP debug mode`).option(`--start-action-server`,`Start action server instead of processor server`).option(`--worker <number>`,`Number of processor worker threads `,jj,Aj).option(`--process-timeout <seconds>`,`Process timeout in seconds`,jj,60).option(`--worker-timeout <seconds>`,`Worker timeout in seconds`,jj,parseInt(process.env.WORKER_TIMEOUT_SECONDS||`60`)).option(`--enable-partition`,`Enable binding data partition`,process.env.SENTIO_ENABLE_BINDING_DATA_PARTITION===`true`);Mj.parse();const $={...Mj.opts(),target:Mj.args[Mj.args.length-1]},Nj=process.env.LOG_LEVEL?.toLowerCase();let Pj=!1,Fj=!1,Ij=()=>{};Yo($.logFormat===`json`,Nj===`debug`?!0:$.debug),console.debug(`Starting with`,$.target),await mj($.otlpDebug),Error.stackTraceLimit=20,le($),console.debug(`Starting Server`,$);const Lj=process.env.IS_CHILD===`true`;function Rj(e){Lj||(Pj=!0,Ij()),process.exit(e)}if(!Lj){let e=pe(`@sentio/sdk`),t=pe(`@sentio/runtime`);console.log(`Runtime version:`,t.version,`SDK version:`,e.version)}let zj,Bj,Vj;const Hj=async()=>{let e=await import($.target);return console.debug(`Module loaded`,e),e};if($.startActionServer)zj=new hj(Hj),zj.listen($.port);else{let e=new Bi(new fe(Hj,$,()=>Bj?.close())),t=Li({routes:t=>{t.service(re,e)},readMaxBytes:768*1024*1024,writeMaxBytes:768*1024*1024});Bj=xe.createServer(t),Bj.listen(Number($.port)),console.log(`Processor Server Started at:`,$.port)}if(!Lj){let e=4040;if(Vj=be.createServer(async function(e,t){if(e.url){let n=new URL(e.url,`http://${e.headers.host}`),r=n.searchParams;switch(n.pathname){case`/heap`:try{let e=`/tmp/`+Date.now()+`.heapsnapshot`;await Uj(e);let n=zi.default.createReadStream(e);t.writeHead(200,{"Content-Type":`application/json`}),n.pipe(t),t.end()}catch{t.writeHead(500),t.end()}break;case`/profile`:try{let e=parseInt(r.get(`t`)||`1000`,10)||1e3,n=new Se;n.connect(),await n.post(`Profiler.enable`),await n.post(`Profiler.start`),await new Promise(t=>setTimeout(t,e));let{profile:i}=await n.post(`Profiler.stop`);t.writeHead(200,{"Content-Type":`application/json`}),t.write(JSON.stringify(i)),n.disconnect()}catch{t.writeHead(500)}break;default:t.writeHead(404)}}else t.writeHead(404);t.end()}).listen(e),console.log(`Metric Server Started at:`,e),process.env.OOM_DUMP_MEMORY_SIZE_GB){let e=!1,t=parseFloat(process.env.OOM_DUMP_MEMORY_SIZE_GB);console.log(`heap dumping is enabled, limit set to `,t,`gb`);let n=process.env.OOM_DUMP_DIR||`/tmp`;setInterval(async()=>{let r=process.memoryUsage();if(console.log(`Current Memory Usage`,r),r.heapTotal>t*1024*1024*1024&&!e){let t=z(n,`${Date.now()}.heapsnapshot`);e=!0,await Uj(t),process.exit(11)}},1e3*60)}}process.once(`SIGINT`,function(){Pj||(Pj=!0,Ij(),Wj(0))}).once(`SIGTERM`,function(){Pj||(Pj=!0,Ij(),Wj(0))}).on(`uncaughtException`,e=>{console.error(`Uncaught Exception, please checking if await is properly used`,e)}).on(`unhandledRejection`,(e,t)=>{e?.message.startsWith(`invalid ENS name (disallowed character: "*"`)||console.error(`Unhandled Rejection, please checking if await is properly`,e)});async function Uj(e){console.log(`Heap dumping to`,e);let t=new Se;zi.default.mkdirSync(he(e),{recursive:!0});let n=zi.default.openSync(e,`w`);try{t.connect(),t.on(`HeapProfiler.addHeapSnapshotChunk`,e=>{zi.default.writeSync(n,e.params.chunk)}),await t.post(`HeapProfiler.takeHeapSnapshot`),console.log(`Heap dumped to`,e)}finally{t.disconnect(),zi.default.closeSync(n)}}function Wj(e){Bj?Bj.close():zj?.forceShutdown&&zj.forceShutdown(),console.log(`RPC server shut down`),Vj?Vj.close(function(){console.log(`Http server shut down`),Rj(e)}):Rj(e)}if($.worker>1&&!Lj){let e=new Map,t=new Map,n=parseInt($.port),r=1e3,i=n=>{let a=process.argv.slice(2),o=[`--port=`+String(n)];for(let e=0;e<a.length;e++){let t=a[e];if(t===`-p`||t===`--port`){e++;continue}else if(t.startsWith(`--port=`)||t.startsWith(`--inspect=`))continue;o.push(t)}let s=Ce(we(import.meta.url),o,{env:{...process.env,IS_CHILD:`true`},stdio:`inherit`});s.on(`error`,e=>{console.error(`Child process on port ${n} error:`,e)}),s.on(`exit`,(a,o)=>{if(e.delete(n),console.log(`Child process on port ${n} exited with code ${a}, signal ${o??`none`}`),Pj||t.has(n))return;console.log(`Scheduling restart for child process on port ${n} in ${r}ms`);let s=setTimeout(()=>{t.delete(n),!Pj&&(console.log(`Restarting child process on port ${n}`),i(n))},r);t.set(n,s)}),e.set(n,s),console.log(`Spawned child server process for port ${n} (pid: ${s.pid})`)};for(let e=1;e<$.worker;e++)i(n+e);Ij=()=>{if(!Fj){Fj=!0,Pj=!0;for(let e of t.values())clearTimeout(e);t.clear();for(let t of e.values())t.kill(`SIGINT`)}}}export{};
139
139
  //# sourceMappingURL=processor-runner.js.map