@vercel/otel 1.14.0 → 1.14.1

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.
@@ -4,18 +4,18 @@ import _nPath from 'path'
4
4
  const require = topLevelCreateRequire(import.meta.url);
5
5
  const __filename = fileURLToPath(import.meta.url);
6
6
  const __dirname = _nPath.dirname(__filename);
7
- var ff=Object.create;var Fs=Object.defineProperty;var Ef=Object.getOwnPropertyDescriptor;var mf=Object.getOwnPropertyNames;var gf=Object.getPrototypeOf,Tf=Object.prototype.hasOwnProperty;var z=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var pc=(r,e)=>()=>(r&&(e=r(r=0)),e);var l=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Xr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of mf(e))!Tf.call(r,i)&&i!==t&&Fs(r,i,{get:()=>e[i],enumerable:!(n=Ef(e,i))||n.enumerable});return r},ht=(r,e,t)=>(Xr(r,e,"default"),t&&Xr(t,e,"default")),Y=(r,e,t)=>(t=r!=null?ff(gf(r)):{},Xr(e||!r||!r.__esModule?Fs(t,"default",{value:r,enumerable:!0}):t,r)),m=r=>Xr(Fs({},"__esModule",{value:!0}),r);var d={};import*as YO from"@opentelemetry/api";var h=pc(()=>{ht(d,YO)});var dr=l(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isTracingSuppressed=ye.unsuppressTracing=ye.suppressTracing=void 0;var Sf=(h(),m(d)),ks=(0,Sf.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Af(r){return r.setValue(ks,!0)}ye.suppressTracing=Af;function Of(r){return r.deleteValue(ks)}ye.unsuppressTracing=Of;function Rf(r){return r.getValue(ks)===!0}ye.isTracingSuppressed=Rf});var $s=l(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.BAGGAGE_MAX_TOTAL_LENGTH=F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=F.BAGGAGE_MAX_NAME_VALUE_PAIRS=F.BAGGAGE_HEADER=F.BAGGAGE_ITEMS_SEPARATOR=F.BAGGAGE_PROPERTIES_SEPARATOR=F.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;F.BAGGAGE_KEY_PAIR_SEPARATOR="=";F.BAGGAGE_PROPERTIES_SEPARATOR=";";F.BAGGAGE_ITEMS_SEPARATOR=",";F.BAGGAGE_HEADER="baggage";F.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;F.BAGGAGE_MAX_TOTAL_LENGTH=8192});var Xs=l(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseKeyPairsIntoRecord=pe.parsePairKeyValue=pe.getKeyPairs=pe.serializeKeyPairs=void 0;var bf=(h(),m(d)),je=$s();function Pf(r){return r.reduce((e,t)=>{let n=`${e}${e!==""?je.BAGGAGE_ITEMS_SEPARATOR:""}${t}`;return n.length>je.BAGGAGE_MAX_TOTAL_LENGTH?e:n},"")}pe.serializeKeyPairs=Pf;function yf(r){return r.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=je.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),n})}pe.getKeyPairs=yf;function hc(r){let e=r.split(je.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let t=e.shift();if(!t)return;let n=t.indexOf(je.BAGGAGE_KEY_PAIR_SEPARATOR);if(n<=0)return;let i=decodeURIComponent(t.substring(0,n).trim()),s=decodeURIComponent(t.substring(n+1).trim()),o;return e.length>0&&(o=(0,bf.baggageEntryMetadataFromString)(e.join(je.BAGGAGE_PROPERTIES_SEPARATOR))),{key:i,value:s,metadata:o}}pe.parsePairKeyValue=hc;function vf(r){return typeof r!="string"||r.length===0?{}:r.split(je.BAGGAGE_ITEMS_SEPARATOR).map(e=>hc(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}pe.parseKeyPairsIntoRecord=vf});var fc=l(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.W3CBaggagePropagator=void 0;var Ws=(h(),m(d)),If=dr(),Fe=$s(),Ks=Xs(),zs=class{inject(e,t,n){let i=Ws.propagation.getBaggage(e);if(!i||(0,If.isTracingSuppressed)(e))return;let s=(0,Ks.getKeyPairs)(i).filter(a=>a.length<=Fe.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Fe.BAGGAGE_MAX_NAME_VALUE_PAIRS),o=(0,Ks.serializeKeyPairs)(s);o.length>0&&n.set(t,Fe.BAGGAGE_HEADER,o)}extract(e,t,n){let i=n.get(t,Fe.BAGGAGE_HEADER),s=Array.isArray(i)?i.join(Fe.BAGGAGE_ITEMS_SEPARATOR):i;if(!s)return e;let o={};return s.length===0||(s.split(Fe.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let c=(0,Ks.parsePairKeyValue)(u);if(c){let _={value:c.value};c.metadata&&(_.metadata=c.metadata),o[c.key]=_}}),Object.entries(o).length===0)?e:Ws.propagation.setBaggage(e,Ws.propagation.createBaggage(o))}fields(){return[Fe.BAGGAGE_HEADER]}};Wr.W3CBaggagePropagator=zs});var Ec=l(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.AnchoredClock=void 0;var Ys=class{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}};Kr.AnchoredClock=Ys});var Ac=l(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isAttributeValue=ve.isAttributeKey=ve.sanitizeAttributes=void 0;var mc=(h(),m(d));function Lf(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,n]of Object.entries(r)){if(!gc(t)){mc.diag.warn(`Invalid attribute key: ${t}`);continue}if(!Tc(n)){mc.diag.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(n)?e[t]=n.slice():e[t]=n}return e}ve.sanitizeAttributes=Lf;function gc(r){return typeof r=="string"&&r.length>0}ve.isAttributeKey=gc;function Tc(r){return r==null?!0:Array.isArray(r)?Mf(r):Sc(r)}ve.isAttributeValue=Tc;function Mf(r){let e;for(let t of r)if(t!=null){if(!e){if(Sc(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Sc(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}});var Qs=l(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.loggingErrorHandler=void 0;var Nf=(h(),m(d));function Cf(){return r=>{Nf.diag.error(wf(r))}}zr.loggingErrorHandler=Cf;function wf(r){return typeof r=="string"?r:JSON.stringify(xf(r))}function xf(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(n=>{if(e[n])return;let i=t[n];i&&(e[n]=String(i))}),t=Object.getPrototypeOf(t);return e}});var Zs=l(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.globalErrorHandler=ft.setGlobalErrorHandler=void 0;var Df=Qs(),Oc=(0,Df.loggingErrorHandler)();function Uf(r){Oc=r}ft.setGlobalErrorHandler=Uf;function Bf(r){try{Oc(r)}catch{}}ft.globalErrorHandler=Bf});var Js=l(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TracesSamplerValues=void 0;var qf;(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(qf=_r.TracesSamplerValues||(_r.TracesSamplerValues={}))});var Rc=l(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr._globalThis=void 0;Yr._globalThis=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});var Qr=l(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.getEnvWithoutDefaults=v.parseEnvironment=v.DEFAULT_ENVIRONMENT=v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var Ie=(h(),m(d)),Gf=Js(),Vf=Rc(),Hf=",",jf=["OTEL_SDK_DISABLED"];function Ff(r){return jf.indexOf(r)>-1}var kf=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function $f(r){return kf.indexOf(r)>-1}var Xf=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function Wf(r){return Xf.indexOf(r)>-1}v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;v.DEFAULT_ENVIRONMENT={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Ie.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Gf.TracesSamplerValues.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function Kf(r,e,t){if(typeof t[r]>"u")return;let n=String(t[r]);e[r]=n.toLowerCase()==="true"}function zf(r,e,t,n=-1/0,i=1/0){if(typeof t[r]<"u"){let s=Number(t[r]);isNaN(s)||(s<n?e[r]=n:s>i?e[r]=i:e[r]=s)}}function Yf(r,e,t,n=Hf){let i=t[r];typeof i=="string"&&(e[r]=i.split(n).map(s=>s.trim()))}var Qf={ALL:Ie.DiagLogLevel.ALL,VERBOSE:Ie.DiagLogLevel.VERBOSE,DEBUG:Ie.DiagLogLevel.DEBUG,INFO:Ie.DiagLogLevel.INFO,WARN:Ie.DiagLogLevel.WARN,ERROR:Ie.DiagLogLevel.ERROR,NONE:Ie.DiagLogLevel.NONE};function Zf(r,e,t){let n=t[r];if(typeof n=="string"){let i=Qf[n.toUpperCase()];i!=null&&(e[r]=i)}}function eo(r){let e={};for(let t in v.DEFAULT_ENVIRONMENT){let n=t;switch(n){case"OTEL_LOG_LEVEL":Zf(n,e,r);break;default:if(Ff(n))Kf(n,e,r);else if($f(n))zf(n,e,r);else if(Wf(n))Yf(n,e,r);else{let i=r[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}v.parseEnvironment=eo;function Jf(){return typeof process<"u"&&process&&process.env?eo(process.env):eo(Vf._globalThis)}v.getEnvWithoutDefaults=Jf});var Pc=l(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getEnv=void 0;var eE=z("os"),bc=Qr();function tE(){let r=(0,bc.parseEnvironment)(process.env);return Object.assign({HOSTNAME:eE.hostname()},bc.DEFAULT_ENVIRONMENT,r)}Zr.getEnv=tE});var yc=l(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr._globalThis=void 0;Jr._globalThis=typeof globalThis=="object"?globalThis:global});var Ic=l(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.hexToBase64=void 0;function vc(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}var rE=Buffer.alloc(8),nE=Buffer.alloc(16);function iE(r){let e;r.length===16?e=rE:r.length===32?e=nE:e=Buffer.alloc(r.length/2);let t=0;for(let n=0;n<r.length;n+=2){let i=vc(r.charCodeAt(n)),s=vc(r.charCodeAt(n+1));e.writeUInt8(i<<4|s,t++)}return e.toString("base64")}en.hexToBase64=iE});var Nc=l(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.RandomIdGenerator=void 0;var sE=8,Mc=16,to=class{constructor(){this.generateTraceId=Lc(Mc),this.generateSpanId=Lc(sE)}};rn.RandomIdGenerator=to;var tn=Buffer.allocUnsafe(Mc);function Lc(r){return function(){for(let t=0;t<r/4;t++)tn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(tn[t]>0);t++)t===r-1&&(tn[r-1]=1);return tn.toString("hex",0,r)}}});var Cc=l(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.otperformance=void 0;var oE=z("perf_hooks");nn.otperformance=oE.performance});var ro=l(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.VERSION=void 0;sn.VERSION="1.19.0"});var wc=l(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.MessageTypeValues=b.RpcGrpcStatusCodeValues=b.MessagingOperationValues=b.MessagingDestinationKindValues=b.HttpFlavorValues=b.NetHostConnectionSubtypeValues=b.NetHostConnectionTypeValues=b.NetTransportValues=b.FaasInvokedProviderValues=b.FaasDocumentOperationValues=b.FaasTriggerValues=b.DbCassandraConsistencyLevelValues=b.DbSystemValues=b.SemanticAttributes=void 0;b.SemanticAttributes={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"};b.DbSystemValues={OTHER_SQL:"other_sql",MSSQL:"mssql",MYSQL:"mysql",ORACLE:"oracle",DB2:"db2",POSTGRESQL:"postgresql",REDSHIFT:"redshift",HIVE:"hive",CLOUDSCAPE:"cloudscape",HSQLDB:"hsqldb",PROGRESS:"progress",MAXDB:"maxdb",HANADB:"hanadb",INGRES:"ingres",FIRSTSQL:"firstsql",EDB:"edb",CACHE:"cache",ADABAS:"adabas",FIREBIRD:"firebird",DERBY:"derby",FILEMAKER:"filemaker",INFORMIX:"informix",INSTANTDB:"instantdb",INTERBASE:"interbase",MARIADB:"mariadb",NETEZZA:"netezza",PERVASIVE:"pervasive",POINTBASE:"pointbase",SQLITE:"sqlite",SYBASE:"sybase",TERADATA:"teradata",VERTICA:"vertica",H2:"h2",COLDFUSION:"coldfusion",CASSANDRA:"cassandra",HBASE:"hbase",MONGODB:"mongodb",REDIS:"redis",COUCHBASE:"couchbase",COUCHDB:"couchdb",COSMOSDB:"cosmosdb",DYNAMODB:"dynamodb",NEO4J:"neo4j",GEODE:"geode",ELASTICSEARCH:"elasticsearch",MEMCACHED:"memcached",COCKROACHDB:"cockroachdb"};b.DbCassandraConsistencyLevelValues={ALL:"all",EACH_QUORUM:"each_quorum",QUORUM:"quorum",LOCAL_QUORUM:"local_quorum",ONE:"one",TWO:"two",THREE:"three",LOCAL_ONE:"local_one",ANY:"any",SERIAL:"serial",LOCAL_SERIAL:"local_serial"};b.FaasTriggerValues={DATASOURCE:"datasource",HTTP:"http",PUBSUB:"pubsub",TIMER:"timer",OTHER:"other"};b.FaasDocumentOperationValues={INSERT:"insert",EDIT:"edit",DELETE:"delete"};b.FaasInvokedProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};b.NetTransportValues={IP_TCP:"ip_tcp",IP_UDP:"ip_udp",IP:"ip",UNIX:"unix",PIPE:"pipe",INPROC:"inproc",OTHER:"other"};b.NetHostConnectionTypeValues={WIFI:"wifi",WIRED:"wired",CELL:"cell",UNAVAILABLE:"unavailable",UNKNOWN:"unknown"};b.NetHostConnectionSubtypeValues={GPRS:"gprs",EDGE:"edge",UMTS:"umts",CDMA:"cdma",EVDO_0:"evdo_0",EVDO_A:"evdo_a",CDMA2000_1XRTT:"cdma2000_1xrtt",HSDPA:"hsdpa",HSUPA:"hsupa",HSPA:"hspa",IDEN:"iden",EVDO_B:"evdo_b",LTE:"lte",EHRPD:"ehrpd",HSPAP:"hspap",GSM:"gsm",TD_SCDMA:"td_scdma",IWLAN:"iwlan",NR:"nr",NRNSA:"nrnsa",LTE_CA:"lte_ca"};b.HttpFlavorValues={HTTP_1_0:"1.0",HTTP_1_1:"1.1",HTTP_2_0:"2.0",SPDY:"SPDY",QUIC:"QUIC"};b.MessagingDestinationKindValues={QUEUE:"queue",TOPIC:"topic"};b.MessagingOperationValues={RECEIVE:"receive",PROCESS:"process"};b.RpcGrpcStatusCodeValues={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16};b.MessageTypeValues={SENT:"SENT",RECEIVED:"RECEIVED"}});var xc=l(ke=>{"use strict";var aE=ke&&ke.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),uE=ke&&ke.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&aE(e,r,t)};Object.defineProperty(ke,"__esModule",{value:!0});uE(wc(),ke)});var Dc=l(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.TelemetrySdkLanguageValues=k.OsTypeValues=k.HostArchValues=k.AwsEcsLaunchtypeValues=k.CloudPlatformValues=k.CloudProviderValues=k.SemanticResourceAttributes=void 0;k.SemanticResourceAttributes={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"};k.CloudProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};k.CloudPlatformValues={ALIBABA_CLOUD_ECS:"alibaba_cloud_ecs",ALIBABA_CLOUD_FC:"alibaba_cloud_fc",AWS_EC2:"aws_ec2",AWS_ECS:"aws_ecs",AWS_EKS:"aws_eks",AWS_LAMBDA:"aws_lambda",AWS_ELASTIC_BEANSTALK:"aws_elastic_beanstalk",AZURE_VM:"azure_vm",AZURE_CONTAINER_INSTANCES:"azure_container_instances",AZURE_AKS:"azure_aks",AZURE_FUNCTIONS:"azure_functions",AZURE_APP_SERVICE:"azure_app_service",GCP_COMPUTE_ENGINE:"gcp_compute_engine",GCP_CLOUD_RUN:"gcp_cloud_run",GCP_KUBERNETES_ENGINE:"gcp_kubernetes_engine",GCP_CLOUD_FUNCTIONS:"gcp_cloud_functions",GCP_APP_ENGINE:"gcp_app_engine"};k.AwsEcsLaunchtypeValues={EC2:"ec2",FARGATE:"fargate"};k.HostArchValues={AMD64:"amd64",ARM32:"arm32",ARM64:"arm64",IA64:"ia64",PPC32:"ppc32",PPC64:"ppc64",X86:"x86"};k.OsTypeValues={WINDOWS:"windows",LINUX:"linux",DARWIN:"darwin",FREEBSD:"freebsd",NETBSD:"netbsd",OPENBSD:"openbsd",DRAGONFLYBSD:"dragonflybsd",HPUX:"hpux",AIX:"aix",SOLARIS:"solaris",Z_OS:"z_os"};k.TelemetrySdkLanguageValues={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"}});var Uc=l($e=>{"use strict";var cE=$e&&$e.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),lE=$e&&$e.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cE(e,r,t)};Object.defineProperty($e,"__esModule",{value:!0});lE(Dc(),$e)});var Ae=l(Le=>{"use strict";var dE=Le&&Le.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Bc=Le&&Le.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&dE(e,r,t)};Object.defineProperty(Le,"__esModule",{value:!0});Bc(xc(),Le);Bc(Uc(),Le)});var qc=l(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.SDK_INFO=void 0;var _E=ro(),pr=Ae();on.SDK_INFO={[pr.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:"opentelemetry",[pr.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"node",[pr.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:pr.TelemetrySdkLanguageValues.NODEJS,[pr.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:_E.VERSION}});var Gc=l(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.unrefTimer=void 0;function pE(r){r.unref()}an.unrefTimer=pE});var Vc=l(ee=>{"use strict";var hE=ee&&ee.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Xe=ee&&ee.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&hE(e,r,t)};Object.defineProperty(ee,"__esModule",{value:!0});Xe(Pc(),ee);Xe(yc(),ee);Xe(Ic(),ee);Xe(Nc(),ee);Xe(Cc(),ee);Xe(qc(),ee);Xe(Gc(),ee)});var no=l(We=>{"use strict";var fE=We&&We.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),EE=We&&We.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&fE(e,r,t)};Object.defineProperty(We,"__esModule",{value:!0});EE(Vc(),We)});var kc=l(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.addHrTimes=y.isTimeInput=y.isTimeInputHrTime=y.hrTimeToMicroseconds=y.hrTimeToMilliseconds=y.hrTimeToNanoseconds=y.hrTimeToTimeStamp=y.hrTimeDuration=y.timeInputToHrTime=y.hrTime=y.getTimeOrigin=y.millisToHrTime=void 0;var io=no(),Hc=9,mE=6,gE=Math.pow(10,mE),un=Math.pow(10,Hc);function hr(r){let e=r/1e3,t=Math.trunc(e),n=Math.round(r%1e3*gE);return[t,n]}y.millisToHrTime=hr;function so(){let r=io.otperformance.timeOrigin;if(typeof r!="number"){let e=io.otperformance;r=e.timing&&e.timing.fetchStart}return r}y.getTimeOrigin=so;function jc(r){let e=hr(so()),t=hr(typeof r=="number"?r:io.otperformance.now());return Fc(e,t)}y.hrTime=jc;function TE(r){if(oo(r))return r;if(typeof r=="number")return r<so()?jc(r):hr(r);if(r instanceof Date)return hr(r.getTime());throw TypeError("Invalid input type")}y.timeInputToHrTime=TE;function SE(r,e){let t=e[0]-r[0],n=e[1]-r[1];return n<0&&(t-=1,n+=un),[t,n]}y.hrTimeDuration=SE;function AE(r){let e=Hc,t=`${"0".repeat(e)}${r[1]}Z`,n=t.substr(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",n)}y.hrTimeToTimeStamp=AE;function OE(r){return r[0]*un+r[1]}y.hrTimeToNanoseconds=OE;function RE(r){return r[0]*1e3+r[1]/1e6}y.hrTimeToMilliseconds=RE;function bE(r){return r[0]*1e6+r[1]/1e3}y.hrTimeToMicroseconds=bE;function oo(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}y.isTimeInputHrTime=oo;function PE(r){return oo(r)||typeof r=="number"||r instanceof Date}y.isTimeInput=PE;function Fc(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=un&&(t[1]-=un,t[0]+=1),t}y.addHrTimes=Fc});var Xc=l($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0})});var Wc=l(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ExportResultCode=void 0;var yE;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(yE=fr.ExportResultCode||(fr.ExportResultCode={}))});var zc=l(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.CompositePropagator=void 0;var Kc=(h(),m(d)),ao=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,i)=>n.concat(i),[])))}inject(e,t,n){for(let i of this._propagators)try{i.inject(e,t,n)}catch(s){Kc.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,t,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,t,n)}catch(o){Kc.diag.warn(`Failed to inject with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}};cn.CompositePropagator=ao});var Yc=l(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.validateValue=Et.validateKey=void 0;var uo="[_0-9a-z-*/]",vE=`[a-z]${uo}{0,255}`,IE=`[a-z0-9]${uo}{0,240}@[a-z]${uo}{0,13}`,LE=new RegExp(`^(?:${vE}|${IE})$`),ME=/^[ -~]{0,255}[!-~]$/,NE=/,|=/;function CE(r){return LE.test(r)}Et.validateKey=CE;function wE(r){return ME.test(r)&&!NE.test(r)}Et.validateValue=wE});var lo=l(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.TraceState=void 0;var Qc=Yc(),Zc=32,xE=512,Jc=",",el="=",co=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+el+this.get(t)),e),[]).join(Jc)}_parse(e){e.length>xE||(this._internalState=e.split(Jc).reverse().reduce((t,n)=>{let i=n.trim(),s=i.indexOf(el);if(s!==-1){let o=i.slice(0,s),a=i.slice(s+1,n.length);(0,Qc.validateKey)(o)&&(0,Qc.validateValue)(a)&&t.set(o,a)}return t},new Map),this._internalState.size>Zc&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Zc))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}};ln.TraceState=co});var rl=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.W3CTraceContextPropagator=$.parseTraceParent=$.TRACE_STATE_HEADER=$.TRACE_PARENT_HEADER=void 0;var dn=(h(),m(d)),DE=dr(),UE=lo();$.TRACE_PARENT_HEADER="traceparent";$.TRACE_STATE_HEADER="tracestate";var BE="00",qE="(?!ff)[\\da-f]{2}",GE="(?![0]{32})[\\da-f]{32}",VE="(?![0]{16})[\\da-f]{16}",HE="[\\da-f]{2}",jE=new RegExp(`^\\s?(${qE})-(${GE})-(${VE})-(${HE})(-.*)?\\s?$`);function tl(r){let e=jE.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}$.parseTraceParent=tl;var _o=class{inject(e,t,n){let i=dn.trace.getSpanContext(e);if(!i||(0,DE.isTracingSuppressed)(e)||!(0,dn.isSpanContextValid)(i))return;let s=`${BE}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||dn.TraceFlags.NONE).toString(16)}`;n.set(t,$.TRACE_PARENT_HEADER,s),i.traceState&&n.set(t,$.TRACE_STATE_HEADER,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,$.TRACE_PARENT_HEADER);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=tl(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,$.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=new UE.TraceState(typeof u=="string"?u:void 0)}return dn.trace.setSpanContext(e,o)}fields(){return[$.TRACE_PARENT_HEADER,$.TRACE_STATE_HEADER]}};$.W3CTraceContextPropagator=_o});var il=l(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0})});var sl=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.getRPCMetadata=ue.deleteRPCMetadata=ue.setRPCMetadata=ue.RPCType=void 0;var FE=(h(),m(d)),po=(0,FE.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),kE;(function(r){r.HTTP="http"})(kE=ue.RPCType||(ue.RPCType={}));function $E(r,e){return r.setValue(po,e)}ue.setRPCMetadata=$E;function XE(r){return r.deleteValue(po)}ue.deleteRPCMetadata=XE;function WE(r){return r.getValue(po)}ue.getRPCMetadata=WE});var fo=l(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.AlwaysOffSampler=void 0;var KE=(h(),m(d)),ho=class{shouldSample(){return{decision:KE.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};_n.AlwaysOffSampler=ho});var mo=l(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.AlwaysOnSampler=void 0;var zE=(h(),m(d)),Eo=class{shouldSample(){return{decision:zE.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};pn.AlwaysOnSampler=Eo});var al=l(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.ParentBasedSampler=void 0;var hn=(h(),m(d)),YE=Zs(),ol=fo(),go=mo(),To=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,YE.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new go.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new go.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new ol.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new go.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new ol.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=hn.trace.getSpanContext(e);return!a||!(0,hn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&hn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&hn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};fn.ParentBasedSampler=To});var ul=l(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.TraceIdRatioBasedSampler=void 0;var So=(h(),m(d)),Ao=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,So.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?So.SamplingDecision.RECORD_AND_SAMPLED:So.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};En.TraceIdRatioBasedSampler=Ao});var pl=l(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.isPlainObject=void 0;var QE="[object Object]",ZE="[object Null]",JE="[object Undefined]",em=Function.prototype,cl=em.toString,tm=cl.call(Object),rm=nm(Object.getPrototypeOf,Object),ll=Object.prototype,dl=ll.hasOwnProperty,Ke=Symbol?Symbol.toStringTag:void 0,_l=ll.toString;function nm(r,e){return function(t){return r(e(t))}}function im(r){if(!sm(r)||om(r)!==QE)return!1;let e=rm(r);if(e===null)return!0;let t=dl.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&cl.call(t)===tm}mn.isPlainObject=im;function sm(r){return r!=null&&typeof r=="object"}function om(r){return r==null?r===void 0?JE:ZE:Ke&&Ke in Object(r)?am(r):um(r)}function am(r){let e=dl.call(r,Ke),t=r[Ke],n=!1;try{r[Ke]=void 0,n=!0}catch{}let i=_l.call(r);return n&&(e?r[Ke]=t:delete r[Ke]),i}function um(r){return _l.call(r)}});var gl=l(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.merge=void 0;var hl=pl(),cm=20;function lm(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=El(e,r.shift(),0,t);return e}Sn.merge=lm;function Oo(r){return Tn(r)?r.slice():r}function El(r,e,t=0,n){let i;if(!(t>cm)){if(t++,gn(r)||gn(e)||ml(e))i=Oo(e);else if(Tn(r)){if(i=r.slice(),Tn(e))for(let s=0,o=e.length;s<o;s++)i.push(Oo(e[s]));else if(Er(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o];i[u]=Oo(e[u])}}}else if(Er(r))if(Er(e)){if(!dm(r,e))return e;i=Object.assign({},r);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o],c=e[u];if(gn(c))typeof c>"u"?delete i[u]:i[u]=c;else{let _=i[u],p=c;if(fl(r,u,n)||fl(e,u,n))delete i[u];else{if(Er(_)&&Er(p)){let f=n.get(_)||[],L=n.get(p)||[];f.push({obj:r,key:u}),L.push({obj:e,key:u}),n.set(_,f),n.set(p,L)}i[u]=El(i[u],c,t,n)}}}}else i=e;return i}}function fl(r,e,t){let n=t.get(r[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===r)return!0}return!1}function Tn(r){return Array.isArray(r)}function ml(r){return typeof r=="function"}function Er(r){return!gn(r)&&!Tn(r)&&!ml(r)&&typeof r=="object"}function gn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function dm(r,e){return!(!(0,hl.isPlainObject)(r)||!(0,hl.isPlainObject)(e))}});var Tl=l(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.callWithTimeout=mt.TimeoutError=void 0;var An=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};mt.TimeoutError=An;function _m(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new An("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}mt.callWithTimeout=_m});var Al=l(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.isUrlIgnored=gt.urlMatches=void 0;function Sl(r,e){return typeof e=="string"?r===e:!!r.match(e)}gt.urlMatches=Sl;function pm(r,e){if(!e)return!1;for(let t of e)if(Sl(r,t))return!0;return!1}gt.isUrlIgnored=pm});var Ol=l(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.isWrapped=void 0;function hm(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}On.isWrapped=hm});var Rl=l(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Deferred=void 0;var Ro=class{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)}};Rn.Deferred=Ro});var bl=l(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.BindOnceFuture=void 0;var fm=Rl(),bo=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new fm.Deferred}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(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};bn.BindOnceFuture=bo});var yl=l(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn._export=void 0;var Pl=(h(),m(d)),Em=dr();function mm(r,e){return new Promise(t=>{Pl.context.with((0,Em.suppressTracing)(Pl.context.active()),()=>{r.export(e,n=>{t(n)})})})}Pn._export=mm});var A=l(T=>{"use strict";var gm=T&&T.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),P=T&&T.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&gm(e,r,t)};Object.defineProperty(T,"__esModule",{value:!0});T.internal=T.baggageUtils=void 0;P(fc(),T);P(Ec(),T);P(Ac(),T);P(Zs(),T);P(Qs(),T);P(kc(),T);P(Xc(),T);P(Wc(),T);T.baggageUtils=Xs();P(no(),T);P(zc(),T);P(rl(),T);P(il(),T);P(sl(),T);P(fo(),T);P(mo(),T);P(al(),T);P(ul(),T);P(dr(),T);P(lo(),T);P(Qr(),T);P(gl(),T);P(Js(),T);P(Tl(),T);P(Al(),T);P(Ol(),T);P(bl(),T);P(ro(),T);var Tm=yl();T.internal={_export:Tm._export}});var vl=l(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ExceptionEventName=void 0;yn.ExceptionEventName="exception"});var yo=l(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.Span=void 0;var he=(h(),m(d)),X=A(),ze=Ae(),Sm=vl(),Po=class{constructor(e,t,n,i,s,o,a=[],u,c,_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:he.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=o,this.kind=s,this.links=a;let p=Date.now();this._performanceStartTime=X.otperformance.now(),this._performanceOffset=p-(this._performanceStartTime+(0,X.getTimeOrigin)()),this._startTimeProvided=u!=null,this.startTime=this._getTime(u??p),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),_!=null&&this.setAttributes(_),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(he.diag.warn(`Invalid attribute key: ${e}`),this):(0,X.isAttributeValue)(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(he.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return he.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(he.diag.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,X.isTimeInput)(t)&&((0,X.isTimeInput)(n)||(n=t),t=void 0);let i=(0,X.sanitizeAttributes)(t);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}setStatus(e){return this._isSpanEnded()?this:(this.status=e,this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){he.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,X.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(he.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<X.otperformance.now())return(0,X.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,X.millisToHrTime)(e);if(e instanceof Date)return(0,X.millisToHrTime)(e.getTime());if((0,X.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,X.millisToHrTime)(Date.now());let t=X.otperformance.now()-this._performanceStartTime;return(0,X.addHrTimes)(this.startTime,(0,X.millisToHrTime)(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e=="string"?n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e:e&&(e.code?n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.name),e.message&&(n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[ze.SemanticAttributes.EXCEPTION_STACKTRACE]=e.stack)),n[ze.SemanticAttributes.EXCEPTION_TYPE]||n[ze.SemanticAttributes.EXCEPTION_MESSAGE]?this.addEvent(Sm.ExceptionEventName,n,t):he.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&he.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substr(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(he.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}};vn.Span=Po});var gr=l(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.SamplingDecision=void 0;var Am;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Am=mr.SamplingDecision||(mr.SamplingDecision={}))});var Ln=l(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.AlwaysOffSampler=void 0;var Om=gr(),vo=class{shouldSample(){return{decision:Om.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};In.AlwaysOffSampler=vo});var Nn=l(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.AlwaysOnSampler=void 0;var Rm=gr(),Io=class{shouldSample(){return{decision:Rm.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Mn.AlwaysOnSampler=Io});var No=l(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ParentBasedSampler=void 0;var Cn=(h(),m(d)),bm=A(),Il=Ln(),Lo=Nn(),Mo=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,bm.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Lo.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Lo.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new Il.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new Lo.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new Il.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=Cn.trace.getSpanContext(e);return!a||!(0,Cn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&Cn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&Cn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};wn.ParentBasedSampler=Mo});var wo=l(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.TraceIdRatioBasedSampler=void 0;var Pm=(h(),m(d)),Ll=gr(),Co=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,Pm.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?Ll.SamplingDecision.RECORD_AND_SAMPLED:Ll.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};xn.TraceIdRatioBasedSampler=Co});var Uo=l(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.buildSamplerFromEnv=St.loadDefaultConfig=void 0;var Dn=(h(),m(d)),H=A(),Ml=Ln(),xo=Nn(),Do=No(),Nl=wo(),ym=(0,H.getEnv)(),vm=H.TracesSamplerValues.AlwaysOn,Tt=1;function Im(){return{sampler:wl(ym),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,H.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,H.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}St.loadDefaultConfig=Im;function wl(r=(0,H.getEnv)()){switch(r.OTEL_TRACES_SAMPLER){case H.TracesSamplerValues.AlwaysOn:return new xo.AlwaysOnSampler;case H.TracesSamplerValues.AlwaysOff:return new Ml.AlwaysOffSampler;case H.TracesSamplerValues.ParentBasedAlwaysOn:return new Do.ParentBasedSampler({root:new xo.AlwaysOnSampler});case H.TracesSamplerValues.ParentBasedAlwaysOff:return new Do.ParentBasedSampler({root:new Ml.AlwaysOffSampler});case H.TracesSamplerValues.TraceIdRatio:return new Nl.TraceIdRatioBasedSampler(Cl(r));case H.TracesSamplerValues.ParentBasedTraceIdRatio:return new Do.ParentBasedSampler({root:new Nl.TraceIdRatioBasedSampler(Cl(r))});default:return Dn.diag.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${vm}".`),new xo.AlwaysOnSampler}}St.buildSamplerFromEnv=wl;function Cl(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Tt}.`),Tt;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Tt}.`),Tt):e<0||e>1?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Tt}.`),Tt):e}});var qo=l(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.reconfigureLimits=At.mergeConfig=void 0;var xl=Uo(),Bo=A();function Lm(r){let e={sampler:(0,xl.buildSamplerFromEnv)()},t=(0,xl.loadDefaultConfig)(),n=Object.assign({},t,e,r);return n.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),n.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),n}At.mergeConfig=Lm;function Mm(r){var e,t,n,i,s,o,a,u,c,_,p,f;let L=Object.assign({},r.spanLimits),R=(0,Bo.getEnvWithoutDefaults)();return L.attributeCountLimit=(o=(s=(i=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(n=r.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:R.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:R.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Bo.DEFAULT_ATTRIBUTE_COUNT_LIMIT,L.attributeValueLengthLimit=(f=(p=(_=(u=(a=r.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&u!==void 0?u:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&&_!==void 0?_:R.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&p!==void 0?p:R.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:Bo.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},r,{spanLimits:L})}At.reconfigureLimits=Mm});var Dl=l(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.BatchSpanProcessorBase=void 0;var Ot=(h(),m(d)),Ye=A(),Go=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let n=(0,Ye.getEnv)();this._maxExportBatchSize=typeof t?.maxExportBatchSize=="number"?t.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof t?.maxQueueSize=="number"?t.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis=="number"?t.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis=="number"?t.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Ye.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ot.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&Ot.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Ot.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Ot.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,o=i;s<o;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Ot.context.with((0,Ye.suppressTracing)(Ot.context.active()),()=>{let i=this._finishedSpans.splice(0,this._maxExportBatchSize),s=()=>this._exporter.export(i,a=>{var u;clearTimeout(n),a.code===Ye.ExportResultCode.SUCCESS?e():t((u=a.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))}),o=i.map(a=>a.resource).filter(a=>a.asyncAttributesPending);o.length===0?s():Promise.all(o.map(a=>{var u;return(u=a.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(a)})).then(s,a=>{(0,Ye.globalErrorHandler)(a),t(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,(0,Ye.globalErrorHandler)(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,Ye.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};Un.BatchSpanProcessorBase=Go});var Ul=l(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BatchSpanProcessor=void 0;var Nm=Dl(),Vo=class extends Nm.BatchSpanProcessorBase{onShutdown(){}};Bn.BatchSpanProcessor=Vo});var Gl=l(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.RandomIdGenerator=void 0;var Cm=8,ql=16,Ho=class{constructor(){this.generateTraceId=Bl(ql),this.generateSpanId=Bl(Cm)}};Gn.RandomIdGenerator=Ho;var qn=Buffer.allocUnsafe(ql);function Bl(r){return function(){for(let t=0;t<r/4;t++)qn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(qn[t]>0);t++)t===r-1&&(qn[r-1]=1);return qn.toString("hex",0,r)}}});var Hl=l(Me=>{"use strict";var wm=Me&&Me.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Vl=Me&&Me.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&wm(e,r,t)};Object.defineProperty(Me,"__esModule",{value:!0});Vl(Ul(),Me);Vl(Gl(),Me)});var Vn=l(Qe=>{"use strict";var xm=Qe&&Qe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Dm=Qe&&Qe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&xm(e,r,t)};Object.defineProperty(Qe,"__esModule",{value:!0});Dm(Hl(),Qe)});var jl=l(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Tracer=void 0;var j=(h(),m(d)),Hn=A(),Um=yo(),Bm=qo(),qm=Vn(),jo=class{constructor(e,t,n){this._tracerProvider=n;let i=(0,Bm.mergeConfig)(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new qm.RandomIdGenerator,this.resource=n.resource,this.instrumentationLibrary=e}startSpan(e,t={},n=j.context.active()){var i,s,o;t.root&&(n=j.trace.deleteSpan(n));let a=j.trace.getSpan(n);if((0,Hn.isTracingSuppressed)(n))return j.diag.debug("Instrumentation suppressed, returning Noop Span"),j.trace.wrapSpanContext(j.INVALID_SPAN_CONTEXT);let u=a?.spanContext(),c=this._idGenerator.generateSpanId(),_,p,f;!u||!j.trace.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,p=u.traceState,f=u.spanId);let L=(i=t.kind)!==null&&i!==void 0?i:j.SpanKind.INTERNAL,R=((s=t.links)!==null&&s!==void 0?s:[]).map(pt=>({context:pt.context,attributes:(0,Hn.sanitizeAttributes)(pt.attributes)})),w=(0,Hn.sanitizeAttributes)(t.attributes),U=this._sampler.shouldSample(n,_,e,L,w,R);p=(o=U.traceState)!==null&&o!==void 0?o:p;let S=U.decision===j.SamplingDecision.RECORD_AND_SAMPLED?j.TraceFlags.SAMPLED:j.TraceFlags.NONE,Te={traceId:_,spanId:c,traceFlags:S,traceState:p};if(U.decision===j.SamplingDecision.NOT_RECORD)return j.diag.debug("Recording is off, propagating context in a non-recording span"),j.trace.wrapSpanContext(Te);let Se=(0,Hn.sanitizeAttributes)(Object.assign(w,U.attributes));return new Um.Span(this,n,e,Te,L,f,R,t.startTime,void 0,Se)}startActiveSpan(e,t,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=t:arguments.length===3?(s=t,a=n):(s=t,o=n,a=i);let u=o??j.context.active(),c=this.startSpan(e,s,u),_=j.trace.setSpan(u,c);return j.context.with(_,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};jn.Tracer=jo});var Fl=l(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.defaultServiceName=void 0;function Gm(){return`unknown_service:${process.argv0}`}Fn.defaultServiceName=Gm});var Fo=l(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.normalizeType=Rt.normalizeArch=void 0;var Vm=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}};Rt.normalizeArch=Vm;var Hm=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}};Rt.normalizeType=Hm});var $n=l(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.execAsync=void 0;var jm=z("child_process"),Fm=z("util");kn.execAsync=Fm.promisify(jm.exec)});var kl=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getMachineId=void 0;var km=$n(),$m=(h(),m(d));async function Xm(){try{let e=(await(0,km.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
8
- `).find(n=>n.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){$m.diag.debug(`error reading machine id: ${r}`)}return""}Xn.getMachineId=Xm});var $l=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.getMachineId=void 0;var Wm=z("fs"),Km=(h(),m(d));async function zm(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await Wm.promises.readFile(e,{encoding:"utf8"})).trim()}catch(t){Km.diag.debug(`error reading machine id: ${t}`)}return""}Wn.getMachineId=zm});var Wl=l(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getMachineId=void 0;var Ym=z("fs"),Qm=$n(),Xl=(h(),m(d));async function Zm(){try{return(await Ym.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){Xl.diag.debug(`error reading machine id: ${r}`)}try{return(await(0,Qm.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){Xl.diag.debug(`error reading machine id: ${r}`)}return""}Kn.getMachineId=Zm});var zl=l(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.getMachineId=void 0;var Kl=z("process"),Jm=$n(),eg=(h(),m(d));async function tg(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Kl.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Kl.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let n=(await(0,Jm.execAsync)(`${e} ${r}`)).stdout.split("REG_SZ");if(n.length===2)return n[1].trim()}catch(t){eg.diag.debug(`error reading machine id: ${t}`)}return""}zn.getMachineId=tg});var Yl=l(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getMachineId=void 0;var rg=(h(),m(d));async function ng(){return rg.diag.debug("could not read machine-id: unsupported platform"),""}Yn.getMachineId=ng});var Ql=l(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.getMachineId=void 0;var ig=z("process"),bt;Oe.getMachineId=bt;switch(ig.platform){case"darwin":Oe.getMachineId=bt=kl().getMachineId;break;case"linux":Oe.getMachineId=bt=$l().getMachineId;break;case"freebsd":Oe.getMachineId=bt=Wl().getMachineId;break;case"win32":Oe.getMachineId=bt=zl().getMachineId;break;default:Oe.getMachineId=bt=Yl().getMachineId}});var Xo=l(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.hostDetectorSync=void 0;var ko=Ae(),sg=Ze(),Zl=z("os"),og=Fo(),ag=Ql(),$o=class{detect(e){let t={[ko.SemanticResourceAttributes.HOST_NAME]:(0,Zl.hostname)(),[ko.SemanticResourceAttributes.HOST_ARCH]:(0,og.normalizeArch)((0,Zl.arch)())};return new sg.Resource(t,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,ag.getMachineId)().then(e=>{let t={};return e&&(t[ko.SemanticResourceAttributes.HOST_ID]=e),t})}};Qn.hostDetectorSync=new $o});var Jl=l(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.hostDetector=void 0;var ug=Xo(),Wo=class{detect(e){return Promise.resolve(ug.hostDetectorSync.detect(e))}};Zn.hostDetector=new Wo});var zo=l(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.osDetectorSync=void 0;var ed=Ae(),cg=Ze(),td=z("os"),lg=Fo(),Ko=class{detect(e){let t={[ed.SemanticResourceAttributes.OS_TYPE]:(0,lg.normalizeType)((0,td.platform)()),[ed.SemanticResourceAttributes.OS_VERSION]:(0,td.release)()};return new cg.Resource(t)}};Jn.osDetectorSync=new Ko});var rd=l(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.osDetector=void 0;var dg=zo(),Yo=class{detect(e){return Promise.resolve(dg.osDetectorSync.detect(e))}};ei.osDetector=new Yo});var Zo=l(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.processDetectorSync=void 0;var _g=(h(),m(d)),Re=Ae(),pg=Ze(),hg=z("os"),Qo=class{detect(e){let t={[Re.SemanticResourceAttributes.PROCESS_PID]:process.pid,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]:process.title,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH]:process.execPath,[Re.SemanticResourceAttributes.PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Re.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:process.versions.node,[Re.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"nodejs",[Re.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(t[Re.SemanticResourceAttributes.PROCESS_COMMAND]=process.argv[1]);try{let n=hg.userInfo();t[Re.SemanticResourceAttributes.PROCESS_OWNER]=n.username}catch(n){_g.diag.debug(`error obtaining process owner: ${n}`)}return new pg.Resource(t)}};ti.processDetectorSync=new Qo});var nd=l(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.processDetector=void 0;var fg=Zo(),Jo=class{detect(e){return Promise.resolve(fg.processDetectorSync.detect(e))}};ri.processDetector=new Jo});var id=l(te=>{"use strict";var Eg=te&&te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Je=te&&te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Eg(e,r,t)};Object.defineProperty(te,"__esModule",{value:!0});Je(Fl(),te);Je(Jl(),te);Je(rd(),te);Je(Xo(),te);Je(zo(),te);Je(nd(),te);Je(Zo(),te)});var ea=l(et=>{"use strict";var mg=et&&et.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),gg=et&&et.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&mg(e,r,t)};Object.defineProperty(et,"__esModule",{value:!0});gg(id(),et)});var Ze=l(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Resource=void 0;var sd=(h(),m(d)),tt=Ae(),ta=A(),Tg=ea(),Tr=class r{constructor(e,t){var n;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(n=this._attributes)!==null&&n!==void 0?n:{},this._asyncAttributesPromise=t?.then(i=>(this._attributes=Object.assign({},this._attributes,i),this.asyncAttributesPending=!1,i),i=>(sd.diag.debug("a resource's async attributes promise rejected: %s",i),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[tt.SemanticResourceAttributes.SERVICE_NAME]:(0,Tg.defaultServiceName)(),[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:ta.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:ta.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME],[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:ta.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&sd.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let n=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(n);let i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([s,o])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),s),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),o)});return new r(n,i)}};ni.Resource=Tr;Tr.EMPTY=new Tr({})});var ad=l(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0})});var cd=l(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0})});var dd=l(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0})});var _d=l(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.browserDetector=void 0;var Sg=rt(),ra=class{detect(e){return Promise.resolve(Sg.browserDetectorSync.detect(e))}};ii.browserDetector=new ra});var ia=l(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.envDetectorSync=void 0;var Ag=(h(),m(d)),Og=A(),Rg=Ae(),bg=Ze(),na=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},n=(0,Og.getEnv)(),i=n.OTEL_RESOURCE_ATTRIBUTES,s=n.OTEL_SERVICE_NAME;if(i)try{let o=this._parseResourceAttributes(i);Object.assign(t,o)}catch(o){Ag.diag.debug(`EnvDetector failed: ${o.message}`)}return s&&(t[Rg.SemanticResourceAttributes.SERVICE_NAME]=s),new bg.Resource(t)}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR,-1);for(let i of n){let s=i.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(s.length!==2)continue;let[o,a]=s;if(o=o.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(o))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[o]=decodeURIComponent(a)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};si.envDetectorSync=new na});var pd=l(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.envDetector=void 0;var Pg=ia(),sa=class{detect(e){return Promise.resolve(Pg.envDetectorSync.detect(e))}};oi.envDetector=new sa});var hd=l(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.browserDetectorSync=void 0;var ai=Ae(),oa=rt(),yg=(h(),m(d)),aa=class{detect(e){if(!(typeof navigator<"u"))return oa.Resource.empty();let n={[ai.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(n,e)}_getResourceAttributes(e,t){return e[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]===""?(yg.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),oa.Resource.empty()):new oa.Resource(Object.assign({},e))}};ui.browserDetectorSync=new aa});var fd=l(fe=>{"use strict";var vg=fe&&fe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ci=fe&&fe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vg(e,r,t)};Object.defineProperty(fe,"__esModule",{value:!0});ci(_d(),fe);ci(pd(),fe);ci(hd(),fe);ci(ia(),fe)});var Ed=l(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.isPromiseLike=void 0;var Ig=r=>r!==null&&typeof r=="object"&&typeof r.then=="function";li.isPromiseLike=Ig});var gd=l(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.detectResourcesSync=yt.detectResources=void 0;var Sr=Ze(),Pt=(h(),m(d)),Lg=Ed(),Mg=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let n=await t.detect(r);return Pt.diag.debug(`${t.constructor.name} found resource.`,n),n}catch(n){return Pt.diag.debug(`${t.constructor.name} failed: ${n.message}`),Sr.Resource.empty()}}));return md(e),e.reduce((t,n)=>t.merge(n),Sr.Resource.empty())};yt.detectResources=Mg;var Ng=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(i=>{try{let s=i.detect(r),o;if((0,Lg.isPromiseLike)(s)){let a=async()=>(await s).attributes;o=new Sr.Resource({},a())}else o=s;return o.waitForAsyncAttributes?o.waitForAsyncAttributes().then(()=>Pt.diag.debug(`${i.constructor.name} found resource.`,o)):Pt.diag.debug(`${i.constructor.name} found resource.`,o),o}catch(s){return Pt.diag.error(`${i.constructor.name} failed: ${s.message}`),Sr.Resource.empty()}}),n=t.reduce((i,s)=>i.merge(s),Sr.Resource.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(()=>{md(t)}),n};yt.detectResourcesSync=Ng;var md=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);Pt.diag.verbose(t)}})}});var rt=l(re=>{"use strict";var Cg=re&&re.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nt=re&&re.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Cg(e,r,t)};Object.defineProperty(re,"__esModule",{value:!0});nt(Ze(),re);nt(ad(),re);nt(ea(),re);nt(cd(),re);nt(dd(),re);nt(fd(),re);nt(gd(),re)});var Td=l(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.MultiSpanProcessor=void 0;var wg=A(),ua=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(n=>{(0,wg.globalErrorHandler)(n||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}};di.MultiSpanProcessor=ua});var la=l(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.NoopSpanProcessor=void 0;var ca=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};_i.NoopSpanProcessor=ca});var Ad=l(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.BasicTracerProvider=it.ForceFlushState=void 0;var vt=(h(),m(d)),Lt=A(),Sd=rt(),xg=da(),Dg=Uo(),Ug=Td(),Bg=la(),qg=Vn(),Gg=qo(),It;(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(It=it.ForceFlushState||(it.ForceFlushState={}));var Ar=class{constructor(e={}){var t;this._registeredSpanProcessors=[],this._tracers=new Map;let n=(0,Lt.merge)({},(0,Dg.loadDefaultConfig)(),(0,Gg.reconfigureLimits)(e));this.resource=(t=n.resource)!==null&&t!==void 0?t:Sd.Resource.empty(),this.resource=Sd.Resource.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});let i=this._buildExporterFromEnv();if(i!==void 0){let s=new qg.BatchSpanProcessor(i);this.activeSpanProcessor=s}else this.activeSpanProcessor=new Bg.NoopSpanProcessor}getTracer(e,t,n){let i=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new xg.Tracer({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this)),this._tracers.get(i)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>vt.diag.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new Ug.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){vt.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&vt.context.setGlobalContextManager(e.contextManager),e.propagator&&vt.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(n=>new Promise(i=>{let s,o=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=It.timeout},e);n.forceFlush().then(()=>{clearTimeout(o),s!==It.timeout&&(s=It.resolved,i(s))}).catch(a=>{clearTimeout(o),s=It.error,i(a)})}));return new Promise((n,i)=>{Promise.all(t).then(s=>{let o=s.filter(a=>a!==It.resolved);o.length>0?i(o):n()}).catch(s=>i([s]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,Lt.getEnv)().OTEL_PROPAGATORS)),n=e.map(i=>{let s=this._getPropagator(i);return s||vt.diag.warn(`Propagator "${i}" requested through environment variable is unavailable.`),s}).reduce((i,s)=>(s&&i.push(s),i),[]);if(n.length!==0)return e.length===1?n[0]:new Lt.CompositePropagator({propagators:n})}_buildExporterFromEnv(){let e=(0,Lt.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||vt.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};it.BasicTracerProvider=Ar;Ar._registeredPropagators=new Map([["tracecontext",()=>new Lt.W3CTraceContextPropagator],["baggage",()=>new Lt.W3CBaggagePropagator]]);Ar._registeredExporters=new Map});var Od=l(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ConsoleSpanExporter=void 0;var _a=A(),pa=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,_a.hrTimeToMicroseconds)(e.startTime),duration:(0,_a.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(t)return t({code:_a.ExportResultCode.SUCCESS})}};pi.ConsoleSpanExporter=pa});var bd=l(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.InMemorySpanExporter=void 0;var Rd=A(),ha=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Rd.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Rd.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};hi.InMemorySpanExporter=ha});var yd=l(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0})});var vd=l(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.SimpleSpanProcessor=void 0;var Vg=(h(),m(d)),Mt=A(),fa=class{constructor(e){this._exporter=e,this._shutdownOnce=new Mt.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,n;if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&Vg.TraceFlags.SAMPLED))return;let i=()=>Mt.internal._export(this._exporter,[e]).then(s=>{var o;s.code!==Mt.ExportResultCode.SUCCESS&&(0,Mt.globalErrorHandler)((o=s.error)!==null&&o!==void 0?o:new Error(`SimpleSpanProcessor: span export failed (status ${s})`))}).catch(s=>{(0,Mt.globalErrorHandler)(s)});if(e.resource.asyncAttributesPending){let s=(n=(t=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(t).then(()=>(s!=null&&this._unresolvedExports.delete(s),i()),o=>(0,Mt.globalErrorHandler)(o));s!=null&&this._unresolvedExports.add(s)}else i()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};fi.SimpleSpanProcessor=fa});var Ld=l(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0})});var Nd=l(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0})});var wd=l(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0})});var Dd=l(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0})});var Bd=l(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0})});var da=l(I=>{"use strict";var Hg=I&&I.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),B=I&&I.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Hg(e,r,t)};Object.defineProperty(I,"__esModule",{value:!0});B(jl(),I);B(Ad(),I);B(Vn(),I);B(Od(),I);B(bd(),I);B(yd(),I);B(vd(),I);B(Ld(),I);B(la(),I);B(Ln(),I);B(Nn(),I);B(No(),I);B(wo(),I);B(gr(),I);B(yo(),I);B(Nd(),I);B(wd(),I);B(Dd(),I);B(Bd(),I)});var st={};import*as Kb from"@opentelemetry/api-logs";var Ea=pc(()=>{ht(st,Kb)});var Gd=l(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.disableInstrumentations=Ne.enableInstrumentations=Ne.parseInstrumentationOptions=void 0;function qd(r=[]){let e=[];for(let t=0,n=r.length;t<n;t++){let i=r[t];if(Array.isArray(i)){let s=qd(i);e=e.concat(s.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}Ne.parseInstrumentationOptions=qd;function jg(r,e,t){for(let n=0,i=r.length;n<i;n++){let s=r[n];e&&s.setTracerProvider(e),t&&s.setMeterProvider(t),s.getConfig().enabled||s.enable()}}Ne.enableInstrumentations=jg;function Fg(r){r.forEach(e=>e.disable())}Ne.disableInstrumentations=Fg});var Hd=l(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.registerInstrumentations=void 0;var Vd=(h(),m(d)),ma=Gd();function kg(r){let{instrumentations:e}=(0,ma.parseInstrumentationOptions)(r.instrumentations),t=r.tracerProvider||Vd.trace.getTracerProvider(),n=r.meterProvider||Vd.metrics.getMeterProvider();return(0,ma.enableInstrumentations)(e,t,n),()=>{(0,ma.disableInstrumentations)(e)}}Ei.registerInstrumentations=kg});var Ta=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.LogRecord=void 0;var $g=(h(),m(d)),Or=(h(),m(d)),mi=A(),ga=class{constructor(e,t,n){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:i,observedTimestamp:s,severityNumber:o,severityText:a,body:u,attributes:c={},context:_}=n,p=Date.now();if(this.hrTime=(0,mi.timeInputToHrTime)(i??p),this.hrTimeObserved=(0,mi.timeInputToHrTime)(s??p),_){let f=Or.trace.getSpanContext(_);f&&Or.isSpanContextValid(f)&&(this.spanContext=f)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(Or.diag.warn(`Invalid attribute key: ${e}`),this):!(0,mi.isAttributeValue)(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(Or.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?this:((0,mi.isAttributeValue)(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(Or.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&$g.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};gi.LogRecord=ga});var jd=l(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.Logger=void 0;var Xg=(h(),m(d)),Wg=Ta(),Sa=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||Xg.context.active(),n=new Wg.LogRecord(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}};Ti.Logger=Sa});var Fd=l(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.reconfigureLimits=Nt.loadDefaultConfig=void 0;var Rr=A();function Kg(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}Nt.loadDefaultConfig=Kg;function zg(r){var e,t,n,i,s,o;let a=(0,Rr.getEnvWithoutDefaults)();return{attributeCountLimit:(n=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:a.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:a.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&n!==void 0?n:Rr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,attributeValueLengthLimit:(o=(s=(i=r.attributeValueLengthLimit)!==null&&i!==void 0?i:a.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&s!==void 0?s:a.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&o!==void 0?o:Rr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}Nt.reconfigureLimits=zg});var kd=l(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.MultiLogRecordProcessor=void 0;var Yg=A(),Aa=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>(0,Yg.callWithTimeout)(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};Si.MultiLogRecordProcessor=Aa});var Ra=l(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.NoopLogRecordProcessor=void 0;var Oa=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}};Ai.NoopLogRecordProcessor=Oa});var $d=l(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.LoggerProviderSharedState=void 0;var Qg=Ra(),ba=class{constructor(e,t,n){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Qg.NoopLogRecordProcessor}};Oi.LoggerProviderSharedState=ba});var Kd=l(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.LoggerProvider=ot.DEFAULT_LOGGER_NAME=void 0;var br=(h(),m(d)),Zg=(Ea(),m(st)),Jg=rt(),Xd=A(),eT=jd(),Wd=Fd(),tT=kd(),rT=$d();ot.DEFAULT_LOGGER_NAME="unknown";var Pa=class{constructor(e={}){let{resource:t=Jg.Resource.default(),logRecordLimits:n,forceFlushTimeoutMillis:i}=(0,Xd.merge)({},(0,Wd.loadDefaultConfig)(),e);this._sharedState=new rT.LoggerProviderSharedState(t,i,(0,Wd.reconfigureLimits)(n)),this._shutdownOnce=new Xd.BindOnceFuture(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return br.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),Zg.NOOP_LOGGER;e||br.diag.warn("Logger requested without instrumentation scope name.");let i=e||ot.DEFAULT_LOGGER_NAME,s=`${i}@${t||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(s)||this._sharedState.loggers.set(s,new eT.Logger({name:i,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(s)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>br.diag.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new tT.MultiLogRecordProcessor(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(br.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(br.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};ot.LoggerProvider=Pa});var zd=l(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ConsoleLogRecordExporter=void 0;var nT=A(),iT=A(),ya=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,n,i;return{timestamp:(0,nT.hrTimeToMicroseconds)(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(n=e.spanContext)===null||n===void 0?void 0:n.spanId,traceFlags:(i=e.spanContext)===null||i===void 0?void 0:i.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});t?.({code:iT.ExportResultCode.SUCCESS})}};Ri.ConsoleLogRecordExporter=ya});var Yd=l(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.SimpleLogRecordProcessor=void 0;var va=A(),Ia=class{constructor(e){this._exporter=e,this._shutdownOnce=new va.BindOnceFuture(this._shutdown,this)}onEmit(e){this._shutdownOnce.isCalled||this._exporter.export([e],t=>{var n;if(t.code!==va.ExportResultCode.SUCCESS){(0,va.globalErrorHandler)((n=t.error)!==null&&n!==void 0?n:new Error(`SimpleLogRecordProcessor: log record export failed (status ${t})`));return}})}forceFlush(){return Promise.resolve()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};bi.SimpleLogRecordProcessor=Ia});var Zd=l(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.InMemoryLogRecordExporter=void 0;var Qd=A(),La=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Qd.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Qd.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};Pi.InMemoryLogRecordExporter=La});var Jd=l(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.BatchLogRecordProcessorBase=void 0;var sT=(h(),m(d)),Ct=A(),Ma=class{constructor(e,t){var n,i,s,o;this._exporter=e,this._finishedLogRecords=[];let a=(0,Ct.getEnv)();this._maxExportBatchSize=(n=t?.maxExportBatchSize)!==null&&n!==void 0?n:a.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(i=t?.maxQueueSize)!==null&&i!==void 0?i:a.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(s=t?.scheduledDelayMillis)!==null&&s!==void 0?s:a.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(o=t?.exportTimeoutMillis)!==null&&o!==void 0?o:a.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new Ct.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(sT.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let s=0;s<i;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{(0,Ct.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,Ct.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,Ct.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){return new Promise((t,n)=>{this._exporter.export(e,i=>{var s;if(i.code!==Ct.ExportResultCode.SUCCESS){n((s=i.error)!==null&&s!==void 0?s:new Error(`BatchLogRecordProcessorBase: log record export failed (status ${i})`));return}t(i)})})}};yi.BatchLogRecordProcessorBase=Ma});var e_=l(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.BatchLogRecordProcessor=void 0;var oT=Jd(),Na=class extends oT.BatchLogRecordProcessorBase{onShutdown(){}};vi.BatchLogRecordProcessor=Na});var t_=l(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.BatchLogRecordProcessor=void 0;var aT=e_();Object.defineProperty(Ii,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return aT.BatchLogRecordProcessor}})});var r_=l(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.BatchLogRecordProcessor=void 0;var uT=t_();Object.defineProperty(Li,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return uT.BatchLogRecordProcessor}})});var n_=l(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.BatchLogRecordProcessor=W.InMemoryLogRecordExporter=W.SimpleLogRecordProcessor=W.ConsoleLogRecordExporter=W.NoopLogRecordProcessor=W.LogRecord=W.LoggerProvider=void 0;var cT=Kd();Object.defineProperty(W,"LoggerProvider",{enumerable:!0,get:function(){return cT.LoggerProvider}});var lT=Ta();Object.defineProperty(W,"LogRecord",{enumerable:!0,get:function(){return lT.LogRecord}});var dT=Ra();Object.defineProperty(W,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return dT.NoopLogRecordProcessor}});var _T=zd();Object.defineProperty(W,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return _T.ConsoleLogRecordExporter}});var pT=Yd();Object.defineProperty(W,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return pT.SimpleLogRecordProcessor}});var hT=Zd();Object.defineProperty(W,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return hT.InMemoryLogRecordExporter}});var fT=r_();Object.defineProperty(W,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return fT.BatchLogRecordProcessor}})});var Mi=l(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.AggregationTemporality=void 0;var ET;(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(ET=Pr.AggregationTemporality||(Pr.AggregationTemporality={}))});var wt=l(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.DataPointType=void 0;var mT;(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(mT=yr.DataPointType||(yr.DataPointType={}))});var Ee=l(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.equalsCaseInsensitive=M.binarySearchLB=M.setEquals=M.FlatMap=M.isPromiseAllSettledRejectionResult=M.PromiseAllSettled=M.callWithTimeout=M.TimeoutError=M.instrumentationScopeId=M.hashAttributes=M.isNotNullish=void 0;function gT(r){return r!=null}M.isNotNullish=gT;function TT(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}M.hashAttributes=TT;function ST(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}M.instrumentationScopeId=ST;var Ni=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};M.TimeoutError=Ni;function AT(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new Ni("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}M.callWithTimeout=AT;async function OT(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}M.PromiseAllSettled=OT;function RT(r){return r.status==="rejected"}M.isPromiseAllSettledRejectionResult=RT;function bT(r,e){let t=[];return r.forEach(n=>{t.push(...e(n))}),t}M.FlatMap=bT;function PT(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}M.setEquals=PT;function yT(r,e){let t=0,n=r.length-1;for(;n-t>1;){let i=Math.trunc((n+t)/2);r[i]<=e?t=i:n=i-1}return r[n]<=e?n:r[t]<=e?t:-1}M.binarySearchLB=yT;function vT(r,e){return r.toLowerCase()===e.toLowerCase()}M.equalsCaseInsensitive=vT});var xt=l(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.AggregatorKind=void 0;var IT;(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(IT=vr.AggregatorKind||(vr.AggregatorKind={}))});var i_=l(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DropAggregator=void 0;var LT=xt(),Ca=class{constructor(){this.kind=LT.AggregatorKind.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,i){}};Ci.DropAggregator=Ca});var be=l(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isValidName=ne.isDescriptorCompatibleWith=ne.createInstrumentDescriptorWithView=ne.createInstrumentDescriptor=ne.InstrumentType=void 0;var s_=(h(),m(d)),MT=Ee(),NT;(function(r){r.COUNTER="COUNTER",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(NT=ne.InstrumentType||(ne.InstrumentType={}));function CT(r,e,t){var n,i,s,o;return o_(r)||s_.diag.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(n=t?.description)!==null&&n!==void 0?n:"",unit:(i=t?.unit)!==null&&i!==void 0?i:"",valueType:(s=t?.valueType)!==null&&s!==void 0?s:s_.ValueType.DOUBLE,advice:(o=t?.advice)!==null&&o!==void 0?o:{}}}ne.createInstrumentDescriptor=CT;function wT(r,e){var t,n;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(n=r.description)!==null&&n!==void 0?n:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}ne.createInstrumentDescriptorWithView=wT;function xT(r,e){return(0,MT.equalsCaseInsensitive)(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}ne.isDescriptorCompatibleWith=xT;var DT=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function o_(r){return r.match(DT)!=null}ne.isValidName=o_});var a_=l(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.HistogramAggregator=Ut.HistogramAccumulation=void 0;var UT=xt(),BT=wt(),wa=be(),qT=Ee();function GT(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var Dt=class{constructor(e,t,n=!0,i=GT(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=i}record(e){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,qT.binarySearchLB)(this._boundaries,e);this._current.buckets.counts[t+1]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ut.HistogramAccumulation=Dt;var xa=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=UT.AggregatorKind.HISTOGRAM}createAccumulation(e){return new Dt(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let _=0;_<s.length;_++)a[_]=s[_]+o[_];let u=1/0,c=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(u=Math.min(n.min,i.min),c=Math.max(n.max,i.max)):n.hasMinMax?(u=n.min,c=n.max):i.hasMinMax&&(u=i.min,c=i.max)),new Dt(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:u,max:c})}diff(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let u=0;u<s.length;u++)a[u]=o[u]-s[u];return new Dt(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:BT.DataPointType.HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===wa.InstrumentType.UP_DOWN_COUNTER||e.type===wa.InstrumentType.OBSERVABLE_GAUGE||e.type===wa.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}};Ut.HistogramAggregator=xa});var u_=l(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.Buckets=void 0;var Da=class r{constructor(e=new Ua,t=0,n=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,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,i=0,s=0;for(let o=this.indexStart;o<=this.indexEnd;){let a=o%n;a<0&&(a+=n);for(let u=a;u<n&&i<t;u++)this._relocateBucket(s,i),i++,o++;s++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(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))}};wi.Buckets=Da;var Ua=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let i=new Array(e).fill(0);i.splice(n,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let i=0;i<n;i++){let s=this._counts[e+i];this._counts[e+i]=this._counts[t-i-1],this._counts[t-i-1]=s}}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 r([...this._counts])}}});var qa=l(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.getSignificand=Q.getNormalBase2=Q.MIN_VALUE=Q.MAX_NORMAL_EXPONENT=Q.MIN_NORMAL_EXPONENT=Q.SIGNIFICAND_WIDTH=void 0;Q.SIGNIFICAND_WIDTH=52;var VT=2146435072,HT=1048575,Ba=1023;Q.MIN_NORMAL_EXPONENT=-Ba+1;Q.MAX_NORMAL_EXPONENT=Ba;Q.MIN_VALUE=Math.pow(2,-1022);function jT(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&VT)>>20)-Ba}Q.getNormalBase2=jT;function FT(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),n=e.getUint32(4);return(t&HT)*Math.pow(2,32)+n}Q.getSignificand=FT});var xi=l(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.nextGreaterSquare=Bt.ldexp=void 0;function kT(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}Bt.ldexp=kT;function $T(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}Bt.nextGreaterSquare=$T});var Ui=l(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MappingError=void 0;var Ga=class extends Error{};Di.MappingError=Ga});var l_=l(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ExponentMapping=void 0;var qt=qa(),XT=xi(),c_=Ui(),Va=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<qt.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let t=qt.getNormalBase2(e),n=this._rightShift(qt.getSignificand(e)-1,qt.SIGNIFICAND_WIDTH);return t+n>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new c_.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new c_.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`);return XT.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=qt.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return qt.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};Bi.ExponentMapping=Va});var p_=l(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.LogarithmMapping=void 0;var Gt=qa(),d_=xi(),__=Ui(),Ha=class{constructor(e){this._scale=e,this._scaleFactor=d_.ldexp(Math.LOG2E,e),this._inverseFactor=d_.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=Gt.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(Gt.getSignificand(e)===0)return(Gt.getNormalBase2(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new __.MappingError(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return Gt.MIN_VALUE;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new __.MappingError(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return Gt.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(Gt.MAX_NORMAL_EXPONENT+1<<this._scale)-1}};qi.LogarithmMapping=Ha});var E_=l(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.getMapping=void 0;var WT=l_(),KT=p_(),zT=Ui(),h_=-10,f_=20,YT=Array.from({length:31},(r,e)=>e>10?new KT.LogarithmMapping(e-10):new WT.ExponentMapping(e-10));function QT(r){if(r>f_||r<h_)throw new zT.MappingError(`expected scale >= ${h_} && <= ${f_}, got: ${r}`);return YT[r+10]}Gi.getMapping=QT});var T_=l(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ExponentialHistogramAggregator=Ht.ExponentialHistogramAccumulation=void 0;var ZT=xt(),JT=wt(),eS=(h(),m(d)),ja=be(),m_=u_(),g_=E_(),tS=xi(),Vt=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},rS=20,nS=160,Fa=2,Vi=class r{constructor(e=e,t=nS,n=!0,i=0,s=0,o=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=new m_.Buckets,_=new m_.Buckets,p=(0,g_.getMapping)(rS)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=o,this._min=a,this._max=u,this._positive=c,this._negative=_,this._mapping=p,this._maxSize<Fa&&(eS.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${Fa}`),this._maxSize=Fa)}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(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 r(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 i=this._mapping.mapToIndex(t),s=!1,o=0,a=0;if(e.length===0?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(s=!0,a=i,o=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(s=!0,a=e.indexStart,o=i),s){let u=this._changeScale(o,a);this._downscale(u),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(t<e.indexStart){let s=e.indexEnd-t;s>=e.backing.length&&this._grow(e,s+1),e.indexStart=t}else if(t>e.indexEnd){let s=t-e.indexStart;s>=e.backing.length&&this._grow(e,s+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,n)}_grow(e,t){let n=e.backing.length,i=e.indexBase-e.indexStart,s=n-i,o=(0,tS.nextGreaterSquare)(t);o>this._maxSize&&(o=this._maxSize);let a=o-i;e.backing.growTo(o,s,a)}_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 new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,g_.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=Vt.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=Vt.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(i.high,i.low))}_highLowAtScale(e,t,n){if(e.length===0)return new Vt(0,-1);let i=t-n;return new Vt(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++)this._incrementIndexBy(e,s+a>>o,n.at(a))}_diffBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++){let c=(s+a>>o)-e.indexBase;c<0&&(c+=e.backing.length),e.decrementBucket(c,n.at(a))}e.trim()}};Ht.ExponentialHistogramAccumulation=Vi;var ka=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=ZT.AggregatorKind.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new Vi(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,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:JT.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===ja.InstrumentType.UP_DOWN_COUNTER||e.type===ja.InstrumentType.OBSERVABLE_GAUGE||e.type===ja.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?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}}})}}};Ht.ExponentialHistogramAggregator=ka});var S_=l(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.LastValueAggregator=Ft.LastValueAccumulation=void 0;var iS=xt(),Ir=A(),sS=wt(),jt=class{constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,Ir.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ft.LastValueAccumulation=jt;var $a=class{constructor(){this.kind=iS.AggregatorKind.LAST_VALUE}createAccumulation(e){return new jt(e)}merge(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:sS.DataPointType.GAUGE,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()}))}}};Ft.LastValueAggregator=$a});var A_=l(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.SumAggregator=kt.SumAccumulation=void 0;var oS=xt(),aS=wt(),Ce=class{constructor(e,t,n=0,i=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};kt.SumAccumulation=Ce;var Xa=class{constructor(e){this.monotonic=e,this.kind=oS.AggregatorKind.SUM}createAccumulation(e){return new Ce(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new Ce(t.startTime,this.monotonic,i,t.reset):new Ce(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new Ce(t.startTime,this.monotonic,i,!0):new Ce(t.startTime,this.monotonic,i-n)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:aS.DataPointType.SUM,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()})),isMonotonic:this.monotonic}}};kt.SumAggregator=Xa});var O_=l(ce=>{"use strict";var uS=ce&&ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Lr=ce&&ce.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&uS(e,r,t)};Object.defineProperty(ce,"__esModule",{value:!0});Lr(i_(),ce);Lr(a_(),ce);Lr(T_(),ce);Lr(S_(),ce);Lr(A_(),ce)});var ki=l(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.DefaultAggregation=q.ExponentialHistogramAggregation=q.ExplicitBucketHistogramAggregation=q.HistogramAggregation=q.LastValueAggregation=q.SumAggregation=q.DropAggregation=q.Aggregation=void 0;var cS=(h(),m(d)),at=O_(),Pe=be(),me=class{static Drop(){return R_}static Sum(){return b_}static LastValue(){return P_}static Histogram(){return y_}static ExponentialHistogram(){return lS}static Default(){return dS}};q.Aggregation=me;var Mr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.DropAggregation=Mr;Mr.DEFAULT_INSTANCE=new at.DropAggregator;var $t=class r extends me{createAggregator(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};q.SumAggregation=$t;$t.MONOTONIC_INSTANCE=new at.SumAggregator(!0);$t.NON_MONOTONIC_INSTANCE=new at.SumAggregator(!1);var Nr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.LastValueAggregation=Nr;Nr.DEFAULT_INSTANCE=new at.LastValueAggregator;var Cr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.HistogramAggregation=Cr;Cr.DEFAULT_INSTANCE=new at.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);var Hi=class extends me{constructor(e,t=!0){if(super(),this._recordMinMax=t,e===void 0||e.length===0)throw new Error("HistogramAggregator should be created with boundaries.");e=e.concat(),e=e.sort((s,o)=>s-o);let n=e.lastIndexOf(-1/0),i=e.indexOf(1/0);i===-1&&(i=void 0),this._boundaries=e.slice(n+1,i)}createAggregator(e){return new at.HistogramAggregator(this._boundaries,this._recordMinMax)}};q.ExplicitBucketHistogramAggregation=Hi;var ji=class extends me{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new at.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};q.ExponentialHistogramAggregation=ji;var Fi=class extends me{_resolve(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.UP_DOWN_COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return b_;case Pe.InstrumentType.OBSERVABLE_GAUGE:return P_;case Pe.InstrumentType.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Hi(e.advice.explicitBucketBoundaries):y_}return cS.diag.warn(`Unable to recognize instrument type: ${e.type}`),R_}createAggregator(e){return this._resolve(e).createAggregator(e)}};q.DefaultAggregation=Fi;var R_=new Mr,b_=new $t,P_=new Nr,y_=new Cr,lS=new ji,dS=new Fi});var Wa=l(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Xt.DEFAULT_AGGREGATION_SELECTOR=void 0;var _S=ki(),pS=Mi(),hS=r=>_S.Aggregation.Default();Xt.DEFAULT_AGGREGATION_SELECTOR=hS;var fS=r=>pS.AggregationTemporality.CUMULATIVE;Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=fS});var za=l(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.MetricReader=void 0;var v_=(h(),m(d)),$i=Ee(),I_=Wa(),Ka=class{constructor(e){var t,n,i;this._shutdown=!1,this._aggregationSelector=(t=e?.aggregationSelector)!==null&&t!==void 0?t:I_.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=(n=e?.aggregationTemporalitySelector)!==null&&n!==void 0?n:I_.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=(i=e?.metricProducers)!==null&&i!==void 0?i:[]}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat((0,$i.FlatMap)(n,a=>a.errors)),s=t.resourceMetrics.resource,o=t.resourceMetrics.scopeMetrics.concat((0,$i.FlatMap)(n,a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:s,scopeMetrics:o},errors:i}}async shutdown(e){if(this._shutdown){v_.diag.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await(0,$i.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){v_.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,$i.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};Xi.MetricReader=Ka});var N_=l(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.PeriodicExportingMetricReader=void 0;var L_=(h(),m(d)),Wi=A(),ES=za(),M_=Ee(),mS=(h(),m(d)),Ya=class extends ES.MetricReader{constructor(e){var t,n,i,s;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(n=e.exporter.selectAggregationTemporality)===null||n===void 0?void 0:n.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(i=e.exportIntervalMillis)!==null&&i!==void 0?i:6e4,this._exportTimeout=(s=e.exportTimeoutMillis)!==null&&s!==void 0?s:3e4,this._exporter=e.exporter}async _runOnce(){try{await(0,M_.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof M_.TimeoutError){L_.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,Wi.globalErrorHandler)(e)}}async _doRun(){var e,t;let{resourceMetrics:n,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});i.length>0&&L_.diag.error("PeriodicExportingMetricReader: metrics collection errors",...i);let s=async()=>{let o=await Wi.internal._export(this._exporter,n);if(o.code!==Wi.ExportResultCode.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${o.error})`)};n.resource.asyncAttributesPending?(t=(e=n.resource).waitForAsyncAttributes)===null||t===void 0||t.call(e).then(s,o=>mS.diag.debug("Error while resolving async portion of resource: ",o)):await s()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,Wi.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}};Ki.PeriodicExportingMetricReader=Ya});var w_=l(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.InMemoryMetricExporter=void 0;var C_=A(),Qa=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:C_.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:C_.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()}};zi.InMemoryMetricExporter=Qa});var D_=l(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConsoleMetricExporter=void 0;var x_=A(),gS=Wa(),Za=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e?.temporalitySelector)!==null&&t!==void 0?t:gS.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(e,t){if(this._shutdown){setImmediate(t,{code:x_.ExportResultCode.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let n of e.scopeMetrics)for(let i of n.metrics)console.dir({descriptor:i.descriptor,dataPointType:i.dataPointType,dataPoints:i.dataPoints});t({code:x_.ExportResultCode.SUCCESS})}};Yi.ConsoleMetricExporter=Za});var U_=l(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ViewRegistry=void 0;var Ja=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(i=>this._matchInstrument(i.instrumentSelector,e)&&this._matchMeter(i.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))}};Qi.ViewRegistry=Ja});var Zi=l(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.isObservableInstrument=D.ObservableUpDownCounterInstrument=D.ObservableGaugeInstrument=D.ObservableCounterInstrument=D.ObservableInstrument=D.HistogramInstrument=D.CounterInstrument=D.UpDownCounterInstrument=D.SyncInstrument=void 0;var Wt=(h(),m(d)),TS=A(),Kt=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=Wt.context.active()){if(typeof e!="number"){Wt.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Wt.ValueType.INT&&!Number.isInteger(e)&&(Wt.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,t,n,(0,TS.millisToHrTime)(Date.now()))}};D.SyncInstrument=Kt;var eu=class extends Kt{add(e,t,n){this._record(e,t,n)}};D.UpDownCounterInstrument=eu;var tu=class extends Kt{add(e,t,n){if(e<0){Wt.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.CounterInstrument=tu;var ru=class extends Kt{record(e,t,n){if(e<0){Wt.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.HistogramInstrument=ru;var ut=class{constructor(e,t,n){this._observableRegistry=n,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};D.ObservableInstrument=ut;var nu=class extends ut{};D.ObservableCounterInstrument=nu;var iu=class extends ut{};D.ObservableGaugeInstrument=iu;var su=class extends ut{};D.ObservableUpDownCounterInstrument=su;function SS(r){return r instanceof ut}D.isObservableInstrument=SS});var B_=l(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Meter=void 0;var ie=be(),zt=Zi(),ou=class{constructor(e){this._meterSharedState=e}createHistogram(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.HISTOGRAM,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.HistogramInstrument(i,n)}createCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.CounterInstrument(i,n)}createUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.UP_DOWN_COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.UpDownCounterInstrument(i,n)}createObservableGauge(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableGaugeInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableCounterInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableUpDownCounterInstrument(n,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};Ji.Meter=ou});var uu=l(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MetricStorage=void 0;var AS=be(),au=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,AS.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};es.MetricStorage=au});var wr=l(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AttributeHashMap=Yt.HashMap=void 0;var OS=Ee(),ts=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(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 i=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,i),i}set(e,t,n){n??(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??(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}};Yt.HashMap=ts;var cu=class extends ts{constructor(){super(OS.hashAttributes)}};Yt.AttributeHashMap=cu});var _u=l(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.DeltaMetricProcessor=void 0;var lu=wr(),du=class{constructor(e){this._aggregator=e,this._activeCollectionStorage=new lu.AttributeHashMap,this._cumulativeMemoStorage=new lu.AttributeHashMap}record(e,t,n,i){let s=this._activeCollectionStorage.getOrDefault(t,()=>this._aggregator.createAccumulation(i));s?.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([n,i,s])=>{let o=this._aggregator.createAccumulation(t);o?.record(i);let a=o;if(this._cumulativeMemoStorage.has(n,s)){let u=this._cumulativeMemoStorage.get(n,s);a=this._aggregator.diff(u,o)}if(this._activeCollectionStorage.has(n,s)){let u=this._activeCollectionStorage.get(n,s);a=this._aggregator.merge(u,a)}this._cumulativeMemoStorage.set(n,o,s),this._activeCollectionStorage.set(n,a,s)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new lu.AttributeHashMap,e}};rs.DeltaMetricProcessor=du});var hu=l(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.TemporalMetricProcessor=void 0;var RS=Mi(),bS=wr(),pu=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(e,t,n,i){this._stashAccumulations(n);let s=this._getMergedUnreportedAccumulations(e),o=s,a;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),_=c.collectionTime;a=c.aggregationTemporality,a===RS.AggregationTemporality.CUMULATIVE?o=r.merge(c.accumulations,s,this._aggregator):o=r.calibrateStartTime(c.accumulations,s,_)}else a=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:a});let u=PS(o);if(u.length!==0)return this._aggregator.toMetricData(t,a,u,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let i=this._unreportedAccumulations.get(n);i===void 0&&(i=[],this._unreportedAccumulations.set(n,i)),i.push(e)}}_getMergedUnreportedAccumulations(e){let t=new bS.AttributeHashMap,n=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),n===void 0)return t;for(let i of n)t=r.merge(t,i,this._aggregator);return t}static merge(e,t,n){let i=e,s=t.entries(),o=s.next();for(;o.done!==!0;){let[a,u,c]=o.value;if(e.has(a,c)){let _=e.get(a,c),p=n.merge(_,u);i.set(a,p,c)}else i.set(a,u,c);o=s.next()}return i}static calibrateStartTime(e,t,n){for(let[i,s]of e.keys()){let o=t.get(i,s);o?.setStartTime(n)}return t}};ns.TemporalMetricProcessor=pu;function PS(r){return Array.from(r.entries())}});var q_=l(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.AsyncMetricStorage=void 0;var yS=uu(),vS=_u(),IS=hu(),LS=wr(),fu=class extends yS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new vS.DeltaMetricProcessor(t),this._temporalMetricStorage=new IS.TemporalMetricProcessor(t,i)}record(e,t){let n=new LS.AttributeHashMap;Array.from(e.entries()).forEach(([i,s])=>{n.set(this._attributesProcessor.process(i),s)}),this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};is.AsyncMetricStorage=fu});var F_=l(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getConflictResolutionRecipe=Z.getDescriptionResolutionRecipe=Z.getTypeConflictResolutionRecipe=Z.getUnitConflictResolutionRecipe=Z.getValueTypeConflictResolutionRecipe=Z.getIncompatibilityDetails=void 0;function MS(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}'
7
+ var bf=Object.create;var js=Object.defineProperty;var Pf=Object.getOwnPropertyDescriptor;var yf=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,If=Object.prototype.hasOwnProperty;var z=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var _c=(r,e)=>()=>(r&&(e=r(r=0)),e);var l=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Xr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yf(e))!If.call(r,i)&&i!==t&&js(r,i,{get:()=>e[i],enumerable:!(n=Pf(e,i))||n.enumerable});return r},ht=(r,e,t)=>(Xr(r,e,"default"),t&&Xr(t,e,"default")),Y=(r,e,t)=>(t=r!=null?bf(vf(r)):{},Xr(e||!r||!r.__esModule?js(t,"default",{value:r,enumerable:!0}):t,r)),m=r=>Xr(js({},"__esModule",{value:!0}),r);var d={};import*as sR from"@opentelemetry/api";var h=_c(()=>{ht(d,sR)});var dr=l(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isTracingSuppressed=ye.unsuppressTracing=ye.suppressTracing=void 0;var Mf=(h(),m(d)),Fs=(0,Mf.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Lf(r){return r.setValue(Fs,!0)}ye.suppressTracing=Lf;function Nf(r){return r.deleteValue(Fs)}ye.unsuppressTracing=Nf;function Cf(r){return r.getValue(Fs)===!0}ye.isTracingSuppressed=Cf});var ks=l(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.BAGGAGE_MAX_TOTAL_LENGTH=F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=F.BAGGAGE_MAX_NAME_VALUE_PAIRS=F.BAGGAGE_HEADER=F.BAGGAGE_ITEMS_SEPARATOR=F.BAGGAGE_PROPERTIES_SEPARATOR=F.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;F.BAGGAGE_KEY_PAIR_SEPARATOR="=";F.BAGGAGE_PROPERTIES_SEPARATOR=";";F.BAGGAGE_ITEMS_SEPARATOR=",";F.BAGGAGE_HEADER="baggage";F.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;F.BAGGAGE_MAX_TOTAL_LENGTH=8192});var $s=l(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseKeyPairsIntoRecord=pe.parsePairKeyValue=pe.getKeyPairs=pe.serializeKeyPairs=void 0;var wf=(h(),m(d)),je=ks();function xf(r){return r.reduce((e,t)=>{let n=`${e}${e!==""?je.BAGGAGE_ITEMS_SEPARATOR:""}${t}`;return n.length>je.BAGGAGE_MAX_TOTAL_LENGTH?e:n},"")}pe.serializeKeyPairs=xf;function Df(r){return r.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=je.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),n})}pe.getKeyPairs=Df;function pc(r){let e=r.split(je.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let t=e.shift();if(!t)return;let n=t.indexOf(je.BAGGAGE_KEY_PAIR_SEPARATOR);if(n<=0)return;let i=decodeURIComponent(t.substring(0,n).trim()),s=decodeURIComponent(t.substring(n+1).trim()),o;return e.length>0&&(o=(0,wf.baggageEntryMetadataFromString)(e.join(je.BAGGAGE_PROPERTIES_SEPARATOR))),{key:i,value:s,metadata:o}}pe.parsePairKeyValue=pc;function Uf(r){return typeof r!="string"||r.length===0?{}:r.split(je.BAGGAGE_ITEMS_SEPARATOR).map(e=>pc(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}pe.parseKeyPairsIntoRecord=Uf});var hc=l(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.W3CBaggagePropagator=void 0;var Xs=(h(),m(d)),Bf=dr(),Fe=ks(),Ws=$s(),Ks=class{inject(e,t,n){let i=Xs.propagation.getBaggage(e);if(!i||(0,Bf.isTracingSuppressed)(e))return;let s=(0,Ws.getKeyPairs)(i).filter(a=>a.length<=Fe.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Fe.BAGGAGE_MAX_NAME_VALUE_PAIRS),o=(0,Ws.serializeKeyPairs)(s);o.length>0&&n.set(t,Fe.BAGGAGE_HEADER,o)}extract(e,t,n){let i=n.get(t,Fe.BAGGAGE_HEADER),s=Array.isArray(i)?i.join(Fe.BAGGAGE_ITEMS_SEPARATOR):i;if(!s)return e;let o={};return s.length===0||(s.split(Fe.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let c=(0,Ws.parsePairKeyValue)(u);if(c){let _={value:c.value};c.metadata&&(_.metadata=c.metadata),o[c.key]=_}}),Object.entries(o).length===0)?e:Xs.propagation.setBaggage(e,Xs.propagation.createBaggage(o))}fields(){return[Fe.BAGGAGE_HEADER]}};Wr.W3CBaggagePropagator=Ks});var fc=l(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.AnchoredClock=void 0;var zs=class{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}};Kr.AnchoredClock=zs});var Sc=l(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isAttributeValue=ve.isAttributeKey=ve.sanitizeAttributes=void 0;var Ec=(h(),m(d));function qf(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,n]of Object.entries(r)){if(!mc(t)){Ec.diag.warn(`Invalid attribute key: ${t}`);continue}if(!gc(n)){Ec.diag.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(n)?e[t]=n.slice():e[t]=n}return e}ve.sanitizeAttributes=qf;function mc(r){return typeof r=="string"&&r.length>0}ve.isAttributeKey=mc;function gc(r){return r==null?!0:Array.isArray(r)?Vf(r):Tc(r)}ve.isAttributeValue=gc;function Vf(r){let e;for(let t of r)if(t!=null){if(!e){if(Tc(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Tc(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}});var Ys=l(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.loggingErrorHandler=void 0;var Gf=(h(),m(d));function Hf(){return r=>{Gf.diag.error(jf(r))}}zr.loggingErrorHandler=Hf;function jf(r){return typeof r=="string"?r:JSON.stringify(Ff(r))}function Ff(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(n=>{if(e[n])return;let i=t[n];i&&(e[n]=String(i))}),t=Object.getPrototypeOf(t);return e}});var Qs=l(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.globalErrorHandler=ft.setGlobalErrorHandler=void 0;var kf=Ys(),Ac=(0,kf.loggingErrorHandler)();function $f(r){Ac=r}ft.setGlobalErrorHandler=$f;function Xf(r){try{Ac(r)}catch{}}ft.globalErrorHandler=Xf});var Zs=l(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TracesSamplerValues=void 0;var Wf;(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Wf=_r.TracesSamplerValues||(_r.TracesSamplerValues={}))});var Oc=l(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr._globalThis=void 0;Yr._globalThis=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});var Qr=l(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.getEnvWithoutDefaults=v.parseEnvironment=v.DEFAULT_ENVIRONMENT=v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var Ie=(h(),m(d)),Kf=Zs(),zf=Oc(),Yf=",",Qf=["OTEL_SDK_DISABLED"];function Zf(r){return Qf.indexOf(r)>-1}var Jf=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function eE(r){return Jf.indexOf(r)>-1}var tE=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function rE(r){return tE.indexOf(r)>-1}v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;v.DEFAULT_ENVIRONMENT={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Ie.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Kf.TracesSamplerValues.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function nE(r,e,t){if(typeof t[r]>"u")return;let n=String(t[r]);e[r]=n.toLowerCase()==="true"}function iE(r,e,t,n=-1/0,i=1/0){if(typeof t[r]<"u"){let s=Number(t[r]);isNaN(s)||(s<n?e[r]=n:s>i?e[r]=i:e[r]=s)}}function sE(r,e,t,n=Yf){let i=t[r];typeof i=="string"&&(e[r]=i.split(n).map(s=>s.trim()))}var oE={ALL:Ie.DiagLogLevel.ALL,VERBOSE:Ie.DiagLogLevel.VERBOSE,DEBUG:Ie.DiagLogLevel.DEBUG,INFO:Ie.DiagLogLevel.INFO,WARN:Ie.DiagLogLevel.WARN,ERROR:Ie.DiagLogLevel.ERROR,NONE:Ie.DiagLogLevel.NONE};function aE(r,e,t){let n=t[r];if(typeof n=="string"){let i=oE[n.toUpperCase()];i!=null&&(e[r]=i)}}function Js(r){let e={};for(let t in v.DEFAULT_ENVIRONMENT){let n=t;switch(n){case"OTEL_LOG_LEVEL":aE(n,e,r);break;default:if(Zf(n))nE(n,e,r);else if(eE(n))iE(n,e,r);else if(rE(n))sE(n,e,r);else{let i=r[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}v.parseEnvironment=Js;function uE(){return typeof process<"u"&&process&&process.env?Js(process.env):Js(zf._globalThis)}v.getEnvWithoutDefaults=uE});var bc=l(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getEnv=void 0;var cE=z("os"),Rc=Qr();function lE(){let r=(0,Rc.parseEnvironment)(process.env);return Object.assign({HOSTNAME:cE.hostname()},Rc.DEFAULT_ENVIRONMENT,r)}Zr.getEnv=lE});var Pc=l(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr._globalThis=void 0;Jr._globalThis=typeof globalThis=="object"?globalThis:global});var vc=l(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.hexToBase64=void 0;function yc(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}var dE=Buffer.alloc(8),_E=Buffer.alloc(16);function pE(r){let e;r.length===16?e=dE:r.length===32?e=_E:e=Buffer.alloc(r.length/2);let t=0;for(let n=0;n<r.length;n+=2){let i=yc(r.charCodeAt(n)),s=yc(r.charCodeAt(n+1));e.writeUInt8(i<<4|s,t++)}return e.toString("base64")}en.hexToBase64=pE});var Lc=l(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.RandomIdGenerator=void 0;var hE=8,Mc=16,eo=class{constructor(){this.generateTraceId=Ic(Mc),this.generateSpanId=Ic(hE)}};rn.RandomIdGenerator=eo;var tn=Buffer.allocUnsafe(Mc);function Ic(r){return function(){for(let t=0;t<r/4;t++)tn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(tn[t]>0);t++)t===r-1&&(tn[r-1]=1);return tn.toString("hex",0,r)}}});var Nc=l(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.otperformance=void 0;var fE=z("perf_hooks");nn.otperformance=fE.performance});var to=l(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.VERSION=void 0;sn.VERSION="1.19.0"});var Cc=l(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.MessageTypeValues=b.RpcGrpcStatusCodeValues=b.MessagingOperationValues=b.MessagingDestinationKindValues=b.HttpFlavorValues=b.NetHostConnectionSubtypeValues=b.NetHostConnectionTypeValues=b.NetTransportValues=b.FaasInvokedProviderValues=b.FaasDocumentOperationValues=b.FaasTriggerValues=b.DbCassandraConsistencyLevelValues=b.DbSystemValues=b.SemanticAttributes=void 0;b.SemanticAttributes={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"};b.DbSystemValues={OTHER_SQL:"other_sql",MSSQL:"mssql",MYSQL:"mysql",ORACLE:"oracle",DB2:"db2",POSTGRESQL:"postgresql",REDSHIFT:"redshift",HIVE:"hive",CLOUDSCAPE:"cloudscape",HSQLDB:"hsqldb",PROGRESS:"progress",MAXDB:"maxdb",HANADB:"hanadb",INGRES:"ingres",FIRSTSQL:"firstsql",EDB:"edb",CACHE:"cache",ADABAS:"adabas",FIREBIRD:"firebird",DERBY:"derby",FILEMAKER:"filemaker",INFORMIX:"informix",INSTANTDB:"instantdb",INTERBASE:"interbase",MARIADB:"mariadb",NETEZZA:"netezza",PERVASIVE:"pervasive",POINTBASE:"pointbase",SQLITE:"sqlite",SYBASE:"sybase",TERADATA:"teradata",VERTICA:"vertica",H2:"h2",COLDFUSION:"coldfusion",CASSANDRA:"cassandra",HBASE:"hbase",MONGODB:"mongodb",REDIS:"redis",COUCHBASE:"couchbase",COUCHDB:"couchdb",COSMOSDB:"cosmosdb",DYNAMODB:"dynamodb",NEO4J:"neo4j",GEODE:"geode",ELASTICSEARCH:"elasticsearch",MEMCACHED:"memcached",COCKROACHDB:"cockroachdb"};b.DbCassandraConsistencyLevelValues={ALL:"all",EACH_QUORUM:"each_quorum",QUORUM:"quorum",LOCAL_QUORUM:"local_quorum",ONE:"one",TWO:"two",THREE:"three",LOCAL_ONE:"local_one",ANY:"any",SERIAL:"serial",LOCAL_SERIAL:"local_serial"};b.FaasTriggerValues={DATASOURCE:"datasource",HTTP:"http",PUBSUB:"pubsub",TIMER:"timer",OTHER:"other"};b.FaasDocumentOperationValues={INSERT:"insert",EDIT:"edit",DELETE:"delete"};b.FaasInvokedProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};b.NetTransportValues={IP_TCP:"ip_tcp",IP_UDP:"ip_udp",IP:"ip",UNIX:"unix",PIPE:"pipe",INPROC:"inproc",OTHER:"other"};b.NetHostConnectionTypeValues={WIFI:"wifi",WIRED:"wired",CELL:"cell",UNAVAILABLE:"unavailable",UNKNOWN:"unknown"};b.NetHostConnectionSubtypeValues={GPRS:"gprs",EDGE:"edge",UMTS:"umts",CDMA:"cdma",EVDO_0:"evdo_0",EVDO_A:"evdo_a",CDMA2000_1XRTT:"cdma2000_1xrtt",HSDPA:"hsdpa",HSUPA:"hsupa",HSPA:"hspa",IDEN:"iden",EVDO_B:"evdo_b",LTE:"lte",EHRPD:"ehrpd",HSPAP:"hspap",GSM:"gsm",TD_SCDMA:"td_scdma",IWLAN:"iwlan",NR:"nr",NRNSA:"nrnsa",LTE_CA:"lte_ca"};b.HttpFlavorValues={HTTP_1_0:"1.0",HTTP_1_1:"1.1",HTTP_2_0:"2.0",SPDY:"SPDY",QUIC:"QUIC"};b.MessagingDestinationKindValues={QUEUE:"queue",TOPIC:"topic"};b.MessagingOperationValues={RECEIVE:"receive",PROCESS:"process"};b.RpcGrpcStatusCodeValues={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16};b.MessageTypeValues={SENT:"SENT",RECEIVED:"RECEIVED"}});var wc=l(ke=>{"use strict";var EE=ke&&ke.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),mE=ke&&ke.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&EE(e,r,t)};Object.defineProperty(ke,"__esModule",{value:!0});mE(Cc(),ke)});var xc=l(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.TelemetrySdkLanguageValues=k.OsTypeValues=k.HostArchValues=k.AwsEcsLaunchtypeValues=k.CloudPlatformValues=k.CloudProviderValues=k.SemanticResourceAttributes=void 0;k.SemanticResourceAttributes={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"};k.CloudProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};k.CloudPlatformValues={ALIBABA_CLOUD_ECS:"alibaba_cloud_ecs",ALIBABA_CLOUD_FC:"alibaba_cloud_fc",AWS_EC2:"aws_ec2",AWS_ECS:"aws_ecs",AWS_EKS:"aws_eks",AWS_LAMBDA:"aws_lambda",AWS_ELASTIC_BEANSTALK:"aws_elastic_beanstalk",AZURE_VM:"azure_vm",AZURE_CONTAINER_INSTANCES:"azure_container_instances",AZURE_AKS:"azure_aks",AZURE_FUNCTIONS:"azure_functions",AZURE_APP_SERVICE:"azure_app_service",GCP_COMPUTE_ENGINE:"gcp_compute_engine",GCP_CLOUD_RUN:"gcp_cloud_run",GCP_KUBERNETES_ENGINE:"gcp_kubernetes_engine",GCP_CLOUD_FUNCTIONS:"gcp_cloud_functions",GCP_APP_ENGINE:"gcp_app_engine"};k.AwsEcsLaunchtypeValues={EC2:"ec2",FARGATE:"fargate"};k.HostArchValues={AMD64:"amd64",ARM32:"arm32",ARM64:"arm64",IA64:"ia64",PPC32:"ppc32",PPC64:"ppc64",X86:"x86"};k.OsTypeValues={WINDOWS:"windows",LINUX:"linux",DARWIN:"darwin",FREEBSD:"freebsd",NETBSD:"netbsd",OPENBSD:"openbsd",DRAGONFLYBSD:"dragonflybsd",HPUX:"hpux",AIX:"aix",SOLARIS:"solaris",Z_OS:"z_os"};k.TelemetrySdkLanguageValues={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"}});var Dc=l($e=>{"use strict";var gE=$e&&$e.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),TE=$e&&$e.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&gE(e,r,t)};Object.defineProperty($e,"__esModule",{value:!0});TE(xc(),$e)});var Ae=l(Me=>{"use strict";var SE=Me&&Me.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Uc=Me&&Me.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&SE(e,r,t)};Object.defineProperty(Me,"__esModule",{value:!0});Uc(wc(),Me);Uc(Dc(),Me)});var Bc=l(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.SDK_INFO=void 0;var AE=to(),pr=Ae();on.SDK_INFO={[pr.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:"opentelemetry",[pr.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"node",[pr.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:pr.TelemetrySdkLanguageValues.NODEJS,[pr.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:AE.VERSION}});var qc=l(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.unrefTimer=void 0;function OE(r){r.unref()}an.unrefTimer=OE});var Vc=l(ee=>{"use strict";var RE=ee&&ee.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Xe=ee&&ee.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&RE(e,r,t)};Object.defineProperty(ee,"__esModule",{value:!0});Xe(bc(),ee);Xe(Pc(),ee);Xe(vc(),ee);Xe(Lc(),ee);Xe(Nc(),ee);Xe(Bc(),ee);Xe(qc(),ee)});var ro=l(We=>{"use strict";var bE=We&&We.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PE=We&&We.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bE(e,r,t)};Object.defineProperty(We,"__esModule",{value:!0});PE(Vc(),We)});var Fc=l(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.addHrTimes=y.isTimeInput=y.isTimeInputHrTime=y.hrTimeToMicroseconds=y.hrTimeToMilliseconds=y.hrTimeToNanoseconds=y.hrTimeToTimeStamp=y.hrTimeDuration=y.timeInputToHrTime=y.hrTime=y.getTimeOrigin=y.millisToHrTime=void 0;var no=ro(),Gc=9,yE=6,vE=Math.pow(10,yE),un=Math.pow(10,Gc);function hr(r){let e=r/1e3,t=Math.trunc(e),n=Math.round(r%1e3*vE);return[t,n]}y.millisToHrTime=hr;function io(){let r=no.otperformance.timeOrigin;if(typeof r!="number"){let e=no.otperformance;r=e.timing&&e.timing.fetchStart}return r}y.getTimeOrigin=io;function Hc(r){let e=hr(io()),t=hr(typeof r=="number"?r:no.otperformance.now());return jc(e,t)}y.hrTime=Hc;function IE(r){if(so(r))return r;if(typeof r=="number")return r<io()?Hc(r):hr(r);if(r instanceof Date)return hr(r.getTime());throw TypeError("Invalid input type")}y.timeInputToHrTime=IE;function ME(r,e){let t=e[0]-r[0],n=e[1]-r[1];return n<0&&(t-=1,n+=un),[t,n]}y.hrTimeDuration=ME;function LE(r){let e=Gc,t=`${"0".repeat(e)}${r[1]}Z`,n=t.substr(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",n)}y.hrTimeToTimeStamp=LE;function NE(r){return r[0]*un+r[1]}y.hrTimeToNanoseconds=NE;function CE(r){return r[0]*1e3+r[1]/1e6}y.hrTimeToMilliseconds=CE;function wE(r){return r[0]*1e6+r[1]/1e3}y.hrTimeToMicroseconds=wE;function so(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}y.isTimeInputHrTime=so;function xE(r){return so(r)||typeof r=="number"||r instanceof Date}y.isTimeInput=xE;function jc(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=un&&(t[1]-=un,t[0]+=1),t}y.addHrTimes=jc});var $c=l(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0})});var Xc=l(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ExportResultCode=void 0;var DE;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(DE=fr.ExportResultCode||(fr.ExportResultCode={}))});var Kc=l(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.CompositePropagator=void 0;var Wc=(h(),m(d)),oo=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,i)=>n.concat(i),[])))}inject(e,t,n){for(let i of this._propagators)try{i.inject(e,t,n)}catch(s){Wc.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,t,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,t,n)}catch(o){Wc.diag.warn(`Failed to inject with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}};cn.CompositePropagator=oo});var zc=l(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.validateValue=Et.validateKey=void 0;var ao="[_0-9a-z-*/]",UE=`[a-z]${ao}{0,255}`,BE=`[a-z0-9]${ao}{0,240}@[a-z]${ao}{0,13}`,qE=new RegExp(`^(?:${UE}|${BE})$`),VE=/^[ -~]{0,255}[!-~]$/,GE=/,|=/;function HE(r){return qE.test(r)}Et.validateKey=HE;function jE(r){return VE.test(r)&&!GE.test(r)}Et.validateValue=jE});var co=l(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.TraceState=void 0;var Yc=zc(),Qc=32,FE=512,Zc=",",Jc="=",uo=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Jc+this.get(t)),e),[]).join(Zc)}_parse(e){e.length>FE||(this._internalState=e.split(Zc).reverse().reduce((t,n)=>{let i=n.trim(),s=i.indexOf(Jc);if(s!==-1){let o=i.slice(0,s),a=i.slice(s+1,n.length);(0,Yc.validateKey)(o)&&(0,Yc.validateValue)(a)&&t.set(o,a)}return t},new Map),this._internalState.size>Qc&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Qc))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}};ln.TraceState=uo});var tl=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.W3CTraceContextPropagator=$.parseTraceParent=$.TRACE_STATE_HEADER=$.TRACE_PARENT_HEADER=void 0;var dn=(h(),m(d)),kE=dr(),$E=co();$.TRACE_PARENT_HEADER="traceparent";$.TRACE_STATE_HEADER="tracestate";var XE="00",WE="(?!ff)[\\da-f]{2}",KE="(?![0]{32})[\\da-f]{32}",zE="(?![0]{16})[\\da-f]{16}",YE="[\\da-f]{2}",QE=new RegExp(`^\\s?(${WE})-(${KE})-(${zE})-(${YE})(-.*)?\\s?$`);function el(r){let e=QE.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}$.parseTraceParent=el;var lo=class{inject(e,t,n){let i=dn.trace.getSpanContext(e);if(!i||(0,kE.isTracingSuppressed)(e)||!(0,dn.isSpanContextValid)(i))return;let s=`${XE}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||dn.TraceFlags.NONE).toString(16)}`;n.set(t,$.TRACE_PARENT_HEADER,s),i.traceState&&n.set(t,$.TRACE_STATE_HEADER,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,$.TRACE_PARENT_HEADER);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=el(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,$.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=new $E.TraceState(typeof u=="string"?u:void 0)}return dn.trace.setSpanContext(e,o)}fields(){return[$.TRACE_PARENT_HEADER,$.TRACE_STATE_HEADER]}};$.W3CTraceContextPropagator=lo});var nl=l(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0})});var il=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.getRPCMetadata=ue.deleteRPCMetadata=ue.setRPCMetadata=ue.RPCType=void 0;var ZE=(h(),m(d)),_o=(0,ZE.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),JE;(function(r){r.HTTP="http"})(JE=ue.RPCType||(ue.RPCType={}));function em(r,e){return r.setValue(_o,e)}ue.setRPCMetadata=em;function tm(r){return r.deleteValue(_o)}ue.deleteRPCMetadata=tm;function rm(r){return r.getValue(_o)}ue.getRPCMetadata=rm});var ho=l(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.AlwaysOffSampler=void 0;var nm=(h(),m(d)),po=class{shouldSample(){return{decision:nm.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};_n.AlwaysOffSampler=po});var Eo=l(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.AlwaysOnSampler=void 0;var im=(h(),m(d)),fo=class{shouldSample(){return{decision:im.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};pn.AlwaysOnSampler=fo});var ol=l(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.ParentBasedSampler=void 0;var hn=(h(),m(d)),sm=Qs(),sl=ho(),mo=Eo(),go=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,sm.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new mo.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new mo.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new sl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new mo.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new sl.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=hn.trace.getSpanContext(e);return!a||!(0,hn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&hn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&hn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};fn.ParentBasedSampler=go});var al=l(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.TraceIdRatioBasedSampler=void 0;var To=(h(),m(d)),So=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,To.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?To.SamplingDecision.RECORD_AND_SAMPLED:To.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};En.TraceIdRatioBasedSampler=So});var _l=l(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.isPlainObject=void 0;var om="[object Object]",am="[object Null]",um="[object Undefined]",cm=Function.prototype,ul=cm.toString,lm=ul.call(Object),dm=_m(Object.getPrototypeOf,Object),cl=Object.prototype,ll=cl.hasOwnProperty,Ke=Symbol?Symbol.toStringTag:void 0,dl=cl.toString;function _m(r,e){return function(t){return r(e(t))}}function pm(r){if(!hm(r)||fm(r)!==om)return!1;let e=dm(r);if(e===null)return!0;let t=ll.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ul.call(t)===lm}mn.isPlainObject=pm;function hm(r){return r!=null&&typeof r=="object"}function fm(r){return r==null?r===void 0?um:am:Ke&&Ke in Object(r)?Em(r):mm(r)}function Em(r){let e=ll.call(r,Ke),t=r[Ke],n=!1;try{r[Ke]=void 0,n=!0}catch{}let i=dl.call(r);return n&&(e?r[Ke]=t:delete r[Ke]),i}function mm(r){return dl.call(r)}});var ml=l(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.merge=void 0;var pl=_l(),gm=20;function Tm(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=fl(e,r.shift(),0,t);return e}Sn.merge=Tm;function Ao(r){return Tn(r)?r.slice():r}function fl(r,e,t=0,n){let i;if(!(t>gm)){if(t++,gn(r)||gn(e)||El(e))i=Ao(e);else if(Tn(r)){if(i=r.slice(),Tn(e))for(let s=0,o=e.length;s<o;s++)i.push(Ao(e[s]));else if(Er(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o];i[u]=Ao(e[u])}}}else if(Er(r))if(Er(e)){if(!Sm(r,e))return e;i=Object.assign({},r);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o],c=e[u];if(gn(c))typeof c>"u"?delete i[u]:i[u]=c;else{let _=i[u],p=c;if(hl(r,u,n)||hl(e,u,n))delete i[u];else{if(Er(_)&&Er(p)){let f=n.get(_)||[],M=n.get(p)||[];f.push({obj:r,key:u}),M.push({obj:e,key:u}),n.set(_,f),n.set(p,M)}i[u]=fl(i[u],c,t,n)}}}}else i=e;return i}}function hl(r,e,t){let n=t.get(r[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===r)return!0}return!1}function Tn(r){return Array.isArray(r)}function El(r){return typeof r=="function"}function Er(r){return!gn(r)&&!Tn(r)&&!El(r)&&typeof r=="object"}function gn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Sm(r,e){return!(!(0,pl.isPlainObject)(r)||!(0,pl.isPlainObject)(e))}});var gl=l(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.callWithTimeout=mt.TimeoutError=void 0;var An=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};mt.TimeoutError=An;function Am(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new An("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}mt.callWithTimeout=Am});var Sl=l(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.isUrlIgnored=gt.urlMatches=void 0;function Tl(r,e){return typeof e=="string"?r===e:!!r.match(e)}gt.urlMatches=Tl;function Om(r,e){if(!e)return!1;for(let t of e)if(Tl(r,t))return!0;return!1}gt.isUrlIgnored=Om});var Al=l(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.isWrapped=void 0;function Rm(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}On.isWrapped=Rm});var Ol=l(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Deferred=void 0;var Oo=class{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)}};Rn.Deferred=Oo});var Rl=l(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.BindOnceFuture=void 0;var bm=Ol(),Ro=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new bm.Deferred}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(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};bn.BindOnceFuture=Ro});var Pl=l(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn._export=void 0;var bl=(h(),m(d)),Pm=dr();function ym(r,e){return new Promise(t=>{bl.context.with((0,Pm.suppressTracing)(bl.context.active()),()=>{r.export(e,n=>{t(n)})})})}Pn._export=ym});var A=l(T=>{"use strict";var vm=T&&T.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),P=T&&T.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vm(e,r,t)};Object.defineProperty(T,"__esModule",{value:!0});T.internal=T.baggageUtils=void 0;P(hc(),T);P(fc(),T);P(Sc(),T);P(Qs(),T);P(Ys(),T);P(Fc(),T);P($c(),T);P(Xc(),T);T.baggageUtils=$s();P(ro(),T);P(Kc(),T);P(tl(),T);P(nl(),T);P(il(),T);P(ho(),T);P(Eo(),T);P(ol(),T);P(al(),T);P(dr(),T);P(co(),T);P(Qr(),T);P(ml(),T);P(Zs(),T);P(gl(),T);P(Sl(),T);P(Al(),T);P(Rl(),T);P(to(),T);var Im=Pl();T.internal={_export:Im._export}});var yl=l(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ExceptionEventName=void 0;yn.ExceptionEventName="exception"});var Po=l(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.Span=void 0;var he=(h(),m(d)),X=A(),ze=Ae(),Mm=yl(),bo=class{constructor(e,t,n,i,s,o,a=[],u,c,_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:he.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=o,this.kind=s,this.links=a;let p=Date.now();this._performanceStartTime=X.otperformance.now(),this._performanceOffset=p-(this._performanceStartTime+(0,X.getTimeOrigin)()),this._startTimeProvided=u!=null,this.startTime=this._getTime(u??p),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),_!=null&&this.setAttributes(_),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(he.diag.warn(`Invalid attribute key: ${e}`),this):(0,X.isAttributeValue)(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(he.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return he.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(he.diag.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,X.isTimeInput)(t)&&((0,X.isTimeInput)(n)||(n=t),t=void 0);let i=(0,X.sanitizeAttributes)(t);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}setStatus(e){return this._isSpanEnded()?this:(this.status=e,this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){he.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,X.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(he.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<X.otperformance.now())return(0,X.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,X.millisToHrTime)(e);if(e instanceof Date)return(0,X.millisToHrTime)(e.getTime());if((0,X.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,X.millisToHrTime)(Date.now());let t=X.otperformance.now()-this._performanceStartTime;return(0,X.addHrTimes)(this.startTime,(0,X.millisToHrTime)(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e=="string"?n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e:e&&(e.code?n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.name),e.message&&(n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[ze.SemanticAttributes.EXCEPTION_STACKTRACE]=e.stack)),n[ze.SemanticAttributes.EXCEPTION_TYPE]||n[ze.SemanticAttributes.EXCEPTION_MESSAGE]?this.addEvent(Mm.ExceptionEventName,n,t):he.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&he.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substr(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(he.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}};vn.Span=bo});var gr=l(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.SamplingDecision=void 0;var Lm;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Lm=mr.SamplingDecision||(mr.SamplingDecision={}))});var Mn=l(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.AlwaysOffSampler=void 0;var Nm=gr(),yo=class{shouldSample(){return{decision:Nm.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};In.AlwaysOffSampler=yo});var Nn=l(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.AlwaysOnSampler=void 0;var Cm=gr(),vo=class{shouldSample(){return{decision:Cm.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Ln.AlwaysOnSampler=vo});var Lo=l(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ParentBasedSampler=void 0;var Cn=(h(),m(d)),wm=A(),vl=Mn(),Io=Nn(),Mo=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,wm.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Io.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Io.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new vl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new Io.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new vl.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=Cn.trace.getSpanContext(e);return!a||!(0,Cn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&Cn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&Cn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};wn.ParentBasedSampler=Mo});var Co=l(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.TraceIdRatioBasedSampler=void 0;var xm=(h(),m(d)),Il=gr(),No=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,xm.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?Il.SamplingDecision.RECORD_AND_SAMPLED:Il.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};xn.TraceIdRatioBasedSampler=No});var Do=l(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.buildSamplerFromEnv=St.loadDefaultConfig=void 0;var Dn=(h(),m(d)),H=A(),Ml=Mn(),wo=Nn(),xo=Lo(),Ll=Co(),Dm=(0,H.getEnv)(),Um=H.TracesSamplerValues.AlwaysOn,Tt=1;function Bm(){return{sampler:Cl(Dm),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,H.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,H.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}St.loadDefaultConfig=Bm;function Cl(r=(0,H.getEnv)()){switch(r.OTEL_TRACES_SAMPLER){case H.TracesSamplerValues.AlwaysOn:return new wo.AlwaysOnSampler;case H.TracesSamplerValues.AlwaysOff:return new Ml.AlwaysOffSampler;case H.TracesSamplerValues.ParentBasedAlwaysOn:return new xo.ParentBasedSampler({root:new wo.AlwaysOnSampler});case H.TracesSamplerValues.ParentBasedAlwaysOff:return new xo.ParentBasedSampler({root:new Ml.AlwaysOffSampler});case H.TracesSamplerValues.TraceIdRatio:return new Ll.TraceIdRatioBasedSampler(Nl(r));case H.TracesSamplerValues.ParentBasedTraceIdRatio:return new xo.ParentBasedSampler({root:new Ll.TraceIdRatioBasedSampler(Nl(r))});default:return Dn.diag.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Um}".`),new wo.AlwaysOnSampler}}St.buildSamplerFromEnv=Cl;function Nl(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Tt}.`),Tt;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Tt}.`),Tt):e<0||e>1?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Tt}.`),Tt):e}});var Bo=l(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.reconfigureLimits=At.mergeConfig=void 0;var wl=Do(),Uo=A();function qm(r){let e={sampler:(0,wl.buildSamplerFromEnv)()},t=(0,wl.loadDefaultConfig)(),n=Object.assign({},t,e,r);return n.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),n.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),n}At.mergeConfig=qm;function Vm(r){var e,t,n,i,s,o,a,u,c,_,p,f;let M=Object.assign({},r.spanLimits),R=(0,Uo.getEnvWithoutDefaults)();return M.attributeCountLimit=(o=(s=(i=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(n=r.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:R.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:R.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Uo.DEFAULT_ATTRIBUTE_COUNT_LIMIT,M.attributeValueLengthLimit=(f=(p=(_=(u=(a=r.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&u!==void 0?u:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&&_!==void 0?_:R.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&p!==void 0?p:R.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:Uo.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},r,{spanLimits:M})}At.reconfigureLimits=Vm});var xl=l(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.BatchSpanProcessorBase=void 0;var Ot=(h(),m(d)),Ye=A(),qo=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let n=(0,Ye.getEnv)();this._maxExportBatchSize=typeof t?.maxExportBatchSize=="number"?t.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof t?.maxQueueSize=="number"?t.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis=="number"?t.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis=="number"?t.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Ye.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ot.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&Ot.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Ot.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Ot.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,o=i;s<o;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Ot.context.with((0,Ye.suppressTracing)(Ot.context.active()),()=>{let i=this._finishedSpans.splice(0,this._maxExportBatchSize),s=()=>this._exporter.export(i,a=>{var u;clearTimeout(n),a.code===Ye.ExportResultCode.SUCCESS?e():t((u=a.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))}),o=i.map(a=>a.resource).filter(a=>a.asyncAttributesPending);o.length===0?s():Promise.all(o.map(a=>{var u;return(u=a.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(a)})).then(s,a=>{(0,Ye.globalErrorHandler)(a),t(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,(0,Ye.globalErrorHandler)(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,Ye.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};Un.BatchSpanProcessorBase=qo});var Dl=l(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BatchSpanProcessor=void 0;var Gm=xl(),Vo=class extends Gm.BatchSpanProcessorBase{onShutdown(){}};Bn.BatchSpanProcessor=Vo});var ql=l(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.RandomIdGenerator=void 0;var Hm=8,Bl=16,Go=class{constructor(){this.generateTraceId=Ul(Bl),this.generateSpanId=Ul(Hm)}};Vn.RandomIdGenerator=Go;var qn=Buffer.allocUnsafe(Bl);function Ul(r){return function(){for(let t=0;t<r/4;t++)qn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(qn[t]>0);t++)t===r-1&&(qn[r-1]=1);return qn.toString("hex",0,r)}}});var Gl=l(Le=>{"use strict";var jm=Le&&Le.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Vl=Le&&Le.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&jm(e,r,t)};Object.defineProperty(Le,"__esModule",{value:!0});Vl(Dl(),Le);Vl(ql(),Le)});var Gn=l(Qe=>{"use strict";var Fm=Qe&&Qe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),km=Qe&&Qe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Fm(e,r,t)};Object.defineProperty(Qe,"__esModule",{value:!0});km(Gl(),Qe)});var Hl=l(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Tracer=void 0;var j=(h(),m(d)),Hn=A(),$m=Po(),Xm=Bo(),Wm=Gn(),Ho=class{constructor(e,t,n){this._tracerProvider=n;let i=(0,Xm.mergeConfig)(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Wm.RandomIdGenerator,this.resource=n.resource,this.instrumentationLibrary=e}startSpan(e,t={},n=j.context.active()){var i,s,o;t.root&&(n=j.trace.deleteSpan(n));let a=j.trace.getSpan(n);if((0,Hn.isTracingSuppressed)(n))return j.diag.debug("Instrumentation suppressed, returning Noop Span"),j.trace.wrapSpanContext(j.INVALID_SPAN_CONTEXT);let u=a?.spanContext(),c=this._idGenerator.generateSpanId(),_,p,f;!u||!j.trace.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,p=u.traceState,f=u.spanId);let M=(i=t.kind)!==null&&i!==void 0?i:j.SpanKind.INTERNAL,R=((s=t.links)!==null&&s!==void 0?s:[]).map(pt=>({context:pt.context,attributes:(0,Hn.sanitizeAttributes)(pt.attributes)})),w=(0,Hn.sanitizeAttributes)(t.attributes),U=this._sampler.shouldSample(n,_,e,M,w,R);p=(o=U.traceState)!==null&&o!==void 0?o:p;let S=U.decision===j.SamplingDecision.RECORD_AND_SAMPLED?j.TraceFlags.SAMPLED:j.TraceFlags.NONE,Te={traceId:_,spanId:c,traceFlags:S,traceState:p};if(U.decision===j.SamplingDecision.NOT_RECORD)return j.diag.debug("Recording is off, propagating context in a non-recording span"),j.trace.wrapSpanContext(Te);let Se=(0,Hn.sanitizeAttributes)(Object.assign(w,U.attributes));return new $m.Span(this,n,e,Te,M,f,R,t.startTime,void 0,Se)}startActiveSpan(e,t,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=t:arguments.length===3?(s=t,a=n):(s=t,o=n,a=i);let u=o??j.context.active(),c=this.startSpan(e,s,u),_=j.trace.setSpan(u,c);return j.context.with(_,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};jn.Tracer=Ho});var jl=l(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.defaultServiceName=void 0;function Km(){return`unknown_service:${process.argv0}`}Fn.defaultServiceName=Km});var jo=l(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.normalizeType=Rt.normalizeArch=void 0;var zm=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}};Rt.normalizeArch=zm;var Ym=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}};Rt.normalizeType=Ym});var $n=l(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.execAsync=void 0;var Qm=z("child_process"),Zm=z("util");kn.execAsync=Zm.promisify(Qm.exec)});var Fl=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getMachineId=void 0;var Jm=$n(),eg=(h(),m(d));async function tg(){try{let e=(await(0,Jm.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
8
+ `).find(n=>n.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){eg.diag.debug(`error reading machine id: ${r}`)}return""}Xn.getMachineId=tg});var kl=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.getMachineId=void 0;var rg=z("fs"),ng=(h(),m(d));async function ig(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await rg.promises.readFile(e,{encoding:"utf8"})).trim()}catch(t){ng.diag.debug(`error reading machine id: ${t}`)}return""}Wn.getMachineId=ig});var Xl=l(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getMachineId=void 0;var sg=z("fs"),og=$n(),$l=(h(),m(d));async function ag(){try{return(await sg.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}try{return(await(0,og.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}return""}Kn.getMachineId=ag});var Kl=l(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.getMachineId=void 0;var Wl=z("process"),ug=$n(),cg=(h(),m(d));async function lg(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Wl.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Wl.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let n=(await(0,ug.execAsync)(`${e} ${r}`)).stdout.split("REG_SZ");if(n.length===2)return n[1].trim()}catch(t){cg.diag.debug(`error reading machine id: ${t}`)}return""}zn.getMachineId=lg});var zl=l(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getMachineId=void 0;var dg=(h(),m(d));async function _g(){return dg.diag.debug("could not read machine-id: unsupported platform"),""}Yn.getMachineId=_g});var Yl=l(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.getMachineId=void 0;var pg=z("process"),bt;Oe.getMachineId=bt;switch(pg.platform){case"darwin":Oe.getMachineId=bt=Fl().getMachineId;break;case"linux":Oe.getMachineId=bt=kl().getMachineId;break;case"freebsd":Oe.getMachineId=bt=Xl().getMachineId;break;case"win32":Oe.getMachineId=bt=Kl().getMachineId;break;default:Oe.getMachineId=bt=zl().getMachineId}});var $o=l(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.hostDetectorSync=void 0;var Fo=Ae(),hg=Ze(),Ql=z("os"),fg=jo(),Eg=Yl(),ko=class{detect(e){let t={[Fo.SemanticResourceAttributes.HOST_NAME]:(0,Ql.hostname)(),[Fo.SemanticResourceAttributes.HOST_ARCH]:(0,fg.normalizeArch)((0,Ql.arch)())};return new hg.Resource(t,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,Eg.getMachineId)().then(e=>{let t={};return e&&(t[Fo.SemanticResourceAttributes.HOST_ID]=e),t})}};Qn.hostDetectorSync=new ko});var Zl=l(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.hostDetector=void 0;var mg=$o(),Xo=class{detect(e){return Promise.resolve(mg.hostDetectorSync.detect(e))}};Zn.hostDetector=new Xo});var Ko=l(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.osDetectorSync=void 0;var Jl=Ae(),gg=Ze(),ed=z("os"),Tg=jo(),Wo=class{detect(e){let t={[Jl.SemanticResourceAttributes.OS_TYPE]:(0,Tg.normalizeType)((0,ed.platform)()),[Jl.SemanticResourceAttributes.OS_VERSION]:(0,ed.release)()};return new gg.Resource(t)}};Jn.osDetectorSync=new Wo});var td=l(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.osDetector=void 0;var Sg=Ko(),zo=class{detect(e){return Promise.resolve(Sg.osDetectorSync.detect(e))}};ei.osDetector=new zo});var Qo=l(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.processDetectorSync=void 0;var Ag=(h(),m(d)),Re=Ae(),Og=Ze(),Rg=z("os"),Yo=class{detect(e){let t={[Re.SemanticResourceAttributes.PROCESS_PID]:process.pid,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]:process.title,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH]:process.execPath,[Re.SemanticResourceAttributes.PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Re.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:process.versions.node,[Re.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"nodejs",[Re.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(t[Re.SemanticResourceAttributes.PROCESS_COMMAND]=process.argv[1]);try{let n=Rg.userInfo();t[Re.SemanticResourceAttributes.PROCESS_OWNER]=n.username}catch(n){Ag.diag.debug(`error obtaining process owner: ${n}`)}return new Og.Resource(t)}};ti.processDetectorSync=new Yo});var rd=l(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.processDetector=void 0;var bg=Qo(),Zo=class{detect(e){return Promise.resolve(bg.processDetectorSync.detect(e))}};ri.processDetector=new Zo});var nd=l(te=>{"use strict";var Pg=te&&te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Je=te&&te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Pg(e,r,t)};Object.defineProperty(te,"__esModule",{value:!0});Je(jl(),te);Je(Zl(),te);Je(td(),te);Je($o(),te);Je(Ko(),te);Je(rd(),te);Je(Qo(),te)});var Jo=l(et=>{"use strict";var yg=et&&et.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),vg=et&&et.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&yg(e,r,t)};Object.defineProperty(et,"__esModule",{value:!0});vg(nd(),et)});var Ze=l(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Resource=void 0;var id=(h(),m(d)),tt=Ae(),ea=A(),Ig=Jo(),Tr=class r{constructor(e,t){var n;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(n=this._attributes)!==null&&n!==void 0?n:{},this._asyncAttributesPromise=t?.then(i=>(this._attributes=Object.assign({},this._attributes,i),this.asyncAttributesPending=!1,i),i=>(id.diag.debug("a resource's async attributes promise rejected: %s",i),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[tt.SemanticResourceAttributes.SERVICE_NAME]:(0,Ig.defaultServiceName)(),[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME],[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&id.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let n=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(n);let i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([s,o])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),s),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),o)});return new r(n,i)}};ni.Resource=Tr;Tr.EMPTY=new Tr({})});var od=l(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0})});var ud=l(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0})});var ld=l(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0})});var dd=l(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.browserDetector=void 0;var Mg=rt(),ta=class{detect(e){return Promise.resolve(Mg.browserDetectorSync.detect(e))}};ii.browserDetector=new ta});var na=l(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.envDetectorSync=void 0;var Lg=(h(),m(d)),Ng=A(),Cg=Ae(),wg=Ze(),ra=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},n=(0,Ng.getEnv)(),i=n.OTEL_RESOURCE_ATTRIBUTES,s=n.OTEL_SERVICE_NAME;if(i)try{let o=this._parseResourceAttributes(i);Object.assign(t,o)}catch(o){Lg.diag.debug(`EnvDetector failed: ${o.message}`)}return s&&(t[Cg.SemanticResourceAttributes.SERVICE_NAME]=s),new wg.Resource(t)}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR,-1);for(let i of n){let s=i.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(s.length!==2)continue;let[o,a]=s;if(o=o.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(o))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[o]=decodeURIComponent(a)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};si.envDetectorSync=new ra});var _d=l(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.envDetector=void 0;var xg=na(),ia=class{detect(e){return Promise.resolve(xg.envDetectorSync.detect(e))}};oi.envDetector=new ia});var pd=l(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.browserDetectorSync=void 0;var ai=Ae(),sa=rt(),Dg=(h(),m(d)),oa=class{detect(e){if(!(typeof navigator<"u"))return sa.Resource.empty();let n={[ai.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(n,e)}_getResourceAttributes(e,t){return e[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]===""?(Dg.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),sa.Resource.empty()):new sa.Resource(Object.assign({},e))}};ui.browserDetectorSync=new oa});var hd=l(fe=>{"use strict";var Ug=fe&&fe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ci=fe&&fe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ug(e,r,t)};Object.defineProperty(fe,"__esModule",{value:!0});ci(dd(),fe);ci(_d(),fe);ci(pd(),fe);ci(na(),fe)});var fd=l(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.isPromiseLike=void 0;var Bg=r=>r!==null&&typeof r=="object"&&typeof r.then=="function";li.isPromiseLike=Bg});var md=l(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.detectResourcesSync=yt.detectResources=void 0;var Sr=Ze(),Pt=(h(),m(d)),qg=fd(),Vg=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let n=await t.detect(r);return Pt.diag.debug(`${t.constructor.name} found resource.`,n),n}catch(n){return Pt.diag.debug(`${t.constructor.name} failed: ${n.message}`),Sr.Resource.empty()}}));return Ed(e),e.reduce((t,n)=>t.merge(n),Sr.Resource.empty())};yt.detectResources=Vg;var Gg=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(i=>{try{let s=i.detect(r),o;if((0,qg.isPromiseLike)(s)){let a=async()=>(await s).attributes;o=new Sr.Resource({},a())}else o=s;return o.waitForAsyncAttributes?o.waitForAsyncAttributes().then(()=>Pt.diag.debug(`${i.constructor.name} found resource.`,o)):Pt.diag.debug(`${i.constructor.name} found resource.`,o),o}catch(s){return Pt.diag.error(`${i.constructor.name} failed: ${s.message}`),Sr.Resource.empty()}}),n=t.reduce((i,s)=>i.merge(s),Sr.Resource.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(()=>{Ed(t)}),n};yt.detectResourcesSync=Gg;var Ed=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);Pt.diag.verbose(t)}})}});var rt=l(re=>{"use strict";var Hg=re&&re.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nt=re&&re.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Hg(e,r,t)};Object.defineProperty(re,"__esModule",{value:!0});nt(Ze(),re);nt(od(),re);nt(Jo(),re);nt(ud(),re);nt(ld(),re);nt(hd(),re);nt(md(),re)});var gd=l(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.MultiSpanProcessor=void 0;var jg=A(),aa=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(n=>{(0,jg.globalErrorHandler)(n||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}};di.MultiSpanProcessor=aa});var ca=l(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.NoopSpanProcessor=void 0;var ua=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};_i.NoopSpanProcessor=ua});var Sd=l(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.BasicTracerProvider=it.ForceFlushState=void 0;var vt=(h(),m(d)),Mt=A(),Td=rt(),Fg=la(),kg=Do(),$g=gd(),Xg=ca(),Wg=Gn(),Kg=Bo(),It;(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(It=it.ForceFlushState||(it.ForceFlushState={}));var Ar=class{constructor(e={}){var t;this._registeredSpanProcessors=[],this._tracers=new Map;let n=(0,Mt.merge)({},(0,kg.loadDefaultConfig)(),(0,Kg.reconfigureLimits)(e));this.resource=(t=n.resource)!==null&&t!==void 0?t:Td.Resource.empty(),this.resource=Td.Resource.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});let i=this._buildExporterFromEnv();if(i!==void 0){let s=new Wg.BatchSpanProcessor(i);this.activeSpanProcessor=s}else this.activeSpanProcessor=new Xg.NoopSpanProcessor}getTracer(e,t,n){let i=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new Fg.Tracer({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this)),this._tracers.get(i)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>vt.diag.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new $g.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){vt.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&vt.context.setGlobalContextManager(e.contextManager),e.propagator&&vt.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(n=>new Promise(i=>{let s,o=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=It.timeout},e);n.forceFlush().then(()=>{clearTimeout(o),s!==It.timeout&&(s=It.resolved,i(s))}).catch(a=>{clearTimeout(o),s=It.error,i(a)})}));return new Promise((n,i)=>{Promise.all(t).then(s=>{let o=s.filter(a=>a!==It.resolved);o.length>0?i(o):n()}).catch(s=>i([s]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,Mt.getEnv)().OTEL_PROPAGATORS)),n=e.map(i=>{let s=this._getPropagator(i);return s||vt.diag.warn(`Propagator "${i}" requested through environment variable is unavailable.`),s}).reduce((i,s)=>(s&&i.push(s),i),[]);if(n.length!==0)return e.length===1?n[0]:new Mt.CompositePropagator({propagators:n})}_buildExporterFromEnv(){let e=(0,Mt.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||vt.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};it.BasicTracerProvider=Ar;Ar._registeredPropagators=new Map([["tracecontext",()=>new Mt.W3CTraceContextPropagator],["baggage",()=>new Mt.W3CBaggagePropagator]]);Ar._registeredExporters=new Map});var Ad=l(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ConsoleSpanExporter=void 0;var da=A(),_a=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,da.hrTimeToMicroseconds)(e.startTime),duration:(0,da.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(t)return t({code:da.ExportResultCode.SUCCESS})}};pi.ConsoleSpanExporter=_a});var Rd=l(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.InMemorySpanExporter=void 0;var Od=A(),pa=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Od.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Od.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};hi.InMemorySpanExporter=pa});var Pd=l(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0})});var yd=l(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.SimpleSpanProcessor=void 0;var zg=(h(),m(d)),Lt=A(),ha=class{constructor(e){this._exporter=e,this._shutdownOnce=new Lt.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,n;if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&zg.TraceFlags.SAMPLED))return;let i=()=>Lt.internal._export(this._exporter,[e]).then(s=>{var o;s.code!==Lt.ExportResultCode.SUCCESS&&(0,Lt.globalErrorHandler)((o=s.error)!==null&&o!==void 0?o:new Error(`SimpleSpanProcessor: span export failed (status ${s})`))}).catch(s=>{(0,Lt.globalErrorHandler)(s)});if(e.resource.asyncAttributesPending){let s=(n=(t=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(t).then(()=>(s!=null&&this._unresolvedExports.delete(s),i()),o=>(0,Lt.globalErrorHandler)(o));s!=null&&this._unresolvedExports.add(s)}else i()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};fi.SimpleSpanProcessor=ha});var Id=l(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0})});var Ld=l(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0})});var Cd=l(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0})});var xd=l(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0})});var Ud=l(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0})});var la=l(I=>{"use strict";var Yg=I&&I.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),B=I&&I.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Yg(e,r,t)};Object.defineProperty(I,"__esModule",{value:!0});B(Hl(),I);B(Sd(),I);B(Gn(),I);B(Ad(),I);B(Rd(),I);B(Pd(),I);B(yd(),I);B(Id(),I);B(ca(),I);B(Mn(),I);B(Nn(),I);B(Lo(),I);B(Co(),I);B(gr(),I);B(Po(),I);B(Ld(),I);B(Cd(),I);B(xd(),I);B(Ud(),I)});var st={};import*as nP from"@opentelemetry/api-logs";var fa=_c(()=>{ht(st,nP)});var qd=l(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.disableInstrumentations=Ne.enableInstrumentations=Ne.parseInstrumentationOptions=void 0;function Bd(r=[]){let e=[];for(let t=0,n=r.length;t<n;t++){let i=r[t];if(Array.isArray(i)){let s=Bd(i);e=e.concat(s.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}Ne.parseInstrumentationOptions=Bd;function Qg(r,e,t){for(let n=0,i=r.length;n<i;n++){let s=r[n];e&&s.setTracerProvider(e),t&&s.setMeterProvider(t),s.getConfig().enabled||s.enable()}}Ne.enableInstrumentations=Qg;function Zg(r){r.forEach(e=>e.disable())}Ne.disableInstrumentations=Zg});var Gd=l(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.registerInstrumentations=void 0;var Vd=(h(),m(d)),Ea=qd();function Jg(r){let{instrumentations:e}=(0,Ea.parseInstrumentationOptions)(r.instrumentations),t=r.tracerProvider||Vd.trace.getTracerProvider(),n=r.meterProvider||Vd.metrics.getMeterProvider();return(0,Ea.enableInstrumentations)(e,t,n),()=>{(0,Ea.disableInstrumentations)(e)}}Ei.registerInstrumentations=Jg});var ga=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.LogRecord=void 0;var eT=(h(),m(d)),Or=(h(),m(d)),mi=A(),ma=class{constructor(e,t,n){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:i,observedTimestamp:s,severityNumber:o,severityText:a,body:u,attributes:c={},context:_}=n,p=Date.now();if(this.hrTime=(0,mi.timeInputToHrTime)(i??p),this.hrTimeObserved=(0,mi.timeInputToHrTime)(s??p),_){let f=Or.trace.getSpanContext(_);f&&Or.isSpanContextValid(f)&&(this.spanContext=f)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(Or.diag.warn(`Invalid attribute key: ${e}`),this):!(0,mi.isAttributeValue)(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(Or.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?this:((0,mi.isAttributeValue)(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(Or.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&eT.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};gi.LogRecord=ma});var Hd=l(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.Logger=void 0;var tT=(h(),m(d)),rT=ga(),Ta=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||tT.context.active(),n=new rT.LogRecord(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}};Ti.Logger=Ta});var jd=l(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.reconfigureLimits=Nt.loadDefaultConfig=void 0;var Rr=A();function nT(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}Nt.loadDefaultConfig=nT;function iT(r){var e,t,n,i,s,o;let a=(0,Rr.getEnvWithoutDefaults)();return{attributeCountLimit:(n=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:a.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:a.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&n!==void 0?n:Rr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,attributeValueLengthLimit:(o=(s=(i=r.attributeValueLengthLimit)!==null&&i!==void 0?i:a.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&s!==void 0?s:a.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&o!==void 0?o:Rr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}Nt.reconfigureLimits=iT});var Fd=l(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.MultiLogRecordProcessor=void 0;var sT=A(),Sa=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>(0,sT.callWithTimeout)(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};Si.MultiLogRecordProcessor=Sa});var Oa=l(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.NoopLogRecordProcessor=void 0;var Aa=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}};Ai.NoopLogRecordProcessor=Aa});var kd=l(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.LoggerProviderSharedState=void 0;var oT=Oa(),Ra=class{constructor(e,t,n){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new oT.NoopLogRecordProcessor}};Oi.LoggerProviderSharedState=Ra});var Wd=l(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.LoggerProvider=ot.DEFAULT_LOGGER_NAME=void 0;var br=(h(),m(d)),aT=(fa(),m(st)),uT=rt(),$d=A(),cT=Hd(),Xd=jd(),lT=Fd(),dT=kd();ot.DEFAULT_LOGGER_NAME="unknown";var ba=class{constructor(e={}){let{resource:t=uT.Resource.default(),logRecordLimits:n,forceFlushTimeoutMillis:i}=(0,$d.merge)({},(0,Xd.loadDefaultConfig)(),e);this._sharedState=new dT.LoggerProviderSharedState(t,i,(0,Xd.reconfigureLimits)(n)),this._shutdownOnce=new $d.BindOnceFuture(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return br.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),aT.NOOP_LOGGER;e||br.diag.warn("Logger requested without instrumentation scope name.");let i=e||ot.DEFAULT_LOGGER_NAME,s=`${i}@${t||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(s)||this._sharedState.loggers.set(s,new cT.Logger({name:i,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(s)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>br.diag.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new lT.MultiLogRecordProcessor(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(br.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(br.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};ot.LoggerProvider=ba});var Kd=l(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ConsoleLogRecordExporter=void 0;var _T=A(),pT=A(),Pa=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,n,i;return{timestamp:(0,_T.hrTimeToMicroseconds)(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(n=e.spanContext)===null||n===void 0?void 0:n.spanId,traceFlags:(i=e.spanContext)===null||i===void 0?void 0:i.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});t?.({code:pT.ExportResultCode.SUCCESS})}};Ri.ConsoleLogRecordExporter=Pa});var zd=l(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.SimpleLogRecordProcessor=void 0;var ya=A(),va=class{constructor(e){this._exporter=e,this._shutdownOnce=new ya.BindOnceFuture(this._shutdown,this)}onEmit(e){this._shutdownOnce.isCalled||this._exporter.export([e],t=>{var n;if(t.code!==ya.ExportResultCode.SUCCESS){(0,ya.globalErrorHandler)((n=t.error)!==null&&n!==void 0?n:new Error(`SimpleLogRecordProcessor: log record export failed (status ${t})`));return}})}forceFlush(){return Promise.resolve()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};bi.SimpleLogRecordProcessor=va});var Qd=l(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.InMemoryLogRecordExporter=void 0;var Yd=A(),Ia=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yd.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Yd.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};Pi.InMemoryLogRecordExporter=Ia});var Zd=l(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.BatchLogRecordProcessorBase=void 0;var hT=(h(),m(d)),Ct=A(),Ma=class{constructor(e,t){var n,i,s,o;this._exporter=e,this._finishedLogRecords=[];let a=(0,Ct.getEnv)();this._maxExportBatchSize=(n=t?.maxExportBatchSize)!==null&&n!==void 0?n:a.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(i=t?.maxQueueSize)!==null&&i!==void 0?i:a.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(s=t?.scheduledDelayMillis)!==null&&s!==void 0?s:a.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(o=t?.exportTimeoutMillis)!==null&&o!==void 0?o:a.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new Ct.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(hT.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let s=0;s<i;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{(0,Ct.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,Ct.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,Ct.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){return new Promise((t,n)=>{this._exporter.export(e,i=>{var s;if(i.code!==Ct.ExportResultCode.SUCCESS){n((s=i.error)!==null&&s!==void 0?s:new Error(`BatchLogRecordProcessorBase: log record export failed (status ${i})`));return}t(i)})})}};yi.BatchLogRecordProcessorBase=Ma});var Jd=l(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.BatchLogRecordProcessor=void 0;var fT=Zd(),La=class extends fT.BatchLogRecordProcessorBase{onShutdown(){}};vi.BatchLogRecordProcessor=La});var e_=l(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.BatchLogRecordProcessor=void 0;var ET=Jd();Object.defineProperty(Ii,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return ET.BatchLogRecordProcessor}})});var t_=l(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.BatchLogRecordProcessor=void 0;var mT=e_();Object.defineProperty(Mi,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return mT.BatchLogRecordProcessor}})});var r_=l(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.BatchLogRecordProcessor=W.InMemoryLogRecordExporter=W.SimpleLogRecordProcessor=W.ConsoleLogRecordExporter=W.NoopLogRecordProcessor=W.LogRecord=W.LoggerProvider=void 0;var gT=Wd();Object.defineProperty(W,"LoggerProvider",{enumerable:!0,get:function(){return gT.LoggerProvider}});var TT=ga();Object.defineProperty(W,"LogRecord",{enumerable:!0,get:function(){return TT.LogRecord}});var ST=Oa();Object.defineProperty(W,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return ST.NoopLogRecordProcessor}});var AT=Kd();Object.defineProperty(W,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return AT.ConsoleLogRecordExporter}});var OT=zd();Object.defineProperty(W,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return OT.SimpleLogRecordProcessor}});var RT=Qd();Object.defineProperty(W,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return RT.InMemoryLogRecordExporter}});var bT=t_();Object.defineProperty(W,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return bT.BatchLogRecordProcessor}})});var Li=l(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.AggregationTemporality=void 0;var PT;(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(PT=Pr.AggregationTemporality||(Pr.AggregationTemporality={}))});var wt=l(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.DataPointType=void 0;var yT;(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(yT=yr.DataPointType||(yr.DataPointType={}))});var Ee=l(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.equalsCaseInsensitive=L.binarySearchLB=L.setEquals=L.FlatMap=L.isPromiseAllSettledRejectionResult=L.PromiseAllSettled=L.callWithTimeout=L.TimeoutError=L.instrumentationScopeId=L.hashAttributes=L.isNotNullish=void 0;function vT(r){return r!=null}L.isNotNullish=vT;function IT(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}L.hashAttributes=IT;function MT(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}L.instrumentationScopeId=MT;var Ni=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};L.TimeoutError=Ni;function LT(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new Ni("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}L.callWithTimeout=LT;async function NT(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}L.PromiseAllSettled=NT;function CT(r){return r.status==="rejected"}L.isPromiseAllSettledRejectionResult=CT;function wT(r,e){let t=[];return r.forEach(n=>{t.push(...e(n))}),t}L.FlatMap=wT;function xT(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}L.setEquals=xT;function DT(r,e){let t=0,n=r.length-1;for(;n-t>1;){let i=Math.trunc((n+t)/2);r[i]<=e?t=i:n=i-1}return r[n]<=e?n:r[t]<=e?t:-1}L.binarySearchLB=DT;function UT(r,e){return r.toLowerCase()===e.toLowerCase()}L.equalsCaseInsensitive=UT});var xt=l(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.AggregatorKind=void 0;var BT;(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(BT=vr.AggregatorKind||(vr.AggregatorKind={}))});var n_=l(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DropAggregator=void 0;var qT=xt(),Na=class{constructor(){this.kind=qT.AggregatorKind.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,i){}};Ci.DropAggregator=Na});var be=l(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isValidName=ne.isDescriptorCompatibleWith=ne.createInstrumentDescriptorWithView=ne.createInstrumentDescriptor=ne.InstrumentType=void 0;var i_=(h(),m(d)),VT=Ee(),GT;(function(r){r.COUNTER="COUNTER",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(GT=ne.InstrumentType||(ne.InstrumentType={}));function HT(r,e,t){var n,i,s,o;return s_(r)||i_.diag.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(n=t?.description)!==null&&n!==void 0?n:"",unit:(i=t?.unit)!==null&&i!==void 0?i:"",valueType:(s=t?.valueType)!==null&&s!==void 0?s:i_.ValueType.DOUBLE,advice:(o=t?.advice)!==null&&o!==void 0?o:{}}}ne.createInstrumentDescriptor=HT;function jT(r,e){var t,n;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(n=r.description)!==null&&n!==void 0?n:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}ne.createInstrumentDescriptorWithView=jT;function FT(r,e){return(0,VT.equalsCaseInsensitive)(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}ne.isDescriptorCompatibleWith=FT;var kT=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function s_(r){return r.match(kT)!=null}ne.isValidName=s_});var o_=l(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.HistogramAggregator=Ut.HistogramAccumulation=void 0;var $T=xt(),XT=wt(),Ca=be(),WT=Ee();function KT(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var Dt=class{constructor(e,t,n=!0,i=KT(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=i}record(e){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,WT.binarySearchLB)(this._boundaries,e);this._current.buckets.counts[t+1]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ut.HistogramAccumulation=Dt;var wa=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=$T.AggregatorKind.HISTOGRAM}createAccumulation(e){return new Dt(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let _=0;_<s.length;_++)a[_]=s[_]+o[_];let u=1/0,c=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(u=Math.min(n.min,i.min),c=Math.max(n.max,i.max)):n.hasMinMax?(u=n.min,c=n.max):i.hasMinMax&&(u=i.min,c=i.max)),new Dt(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:u,max:c})}diff(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let u=0;u<s.length;u++)a[u]=o[u]-s[u];return new Dt(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:XT.DataPointType.HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===Ca.InstrumentType.UP_DOWN_COUNTER||e.type===Ca.InstrumentType.OBSERVABLE_GAUGE||e.type===Ca.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}};Ut.HistogramAggregator=wa});var a_=l(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.Buckets=void 0;var xa=class r{constructor(e=new Da,t=0,n=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,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,i=0,s=0;for(let o=this.indexStart;o<=this.indexEnd;){let a=o%n;a<0&&(a+=n);for(let u=a;u<n&&i<t;u++)this._relocateBucket(s,i),i++,o++;s++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(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))}};wi.Buckets=xa;var Da=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let i=new Array(e).fill(0);i.splice(n,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let i=0;i<n;i++){let s=this._counts[e+i];this._counts[e+i]=this._counts[t-i-1],this._counts[t-i-1]=s}}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 r([...this._counts])}}});var Ba=l(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.getSignificand=Q.getNormalBase2=Q.MIN_VALUE=Q.MAX_NORMAL_EXPONENT=Q.MIN_NORMAL_EXPONENT=Q.SIGNIFICAND_WIDTH=void 0;Q.SIGNIFICAND_WIDTH=52;var zT=2146435072,YT=1048575,Ua=1023;Q.MIN_NORMAL_EXPONENT=-Ua+1;Q.MAX_NORMAL_EXPONENT=Ua;Q.MIN_VALUE=Math.pow(2,-1022);function QT(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&zT)>>20)-Ua}Q.getNormalBase2=QT;function ZT(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),n=e.getUint32(4);return(t&YT)*Math.pow(2,32)+n}Q.getSignificand=ZT});var xi=l(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.nextGreaterSquare=Bt.ldexp=void 0;function JT(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}Bt.ldexp=JT;function eS(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}Bt.nextGreaterSquare=eS});var Ui=l(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MappingError=void 0;var qa=class extends Error{};Di.MappingError=qa});var c_=l(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ExponentMapping=void 0;var qt=Ba(),tS=xi(),u_=Ui(),Va=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<qt.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let t=qt.getNormalBase2(e),n=this._rightShift(qt.getSignificand(e)-1,qt.SIGNIFICAND_WIDTH);return t+n>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new u_.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new u_.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`);return tS.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=qt.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return qt.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};Bi.ExponentMapping=Va});var __=l(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.LogarithmMapping=void 0;var Vt=Ba(),l_=xi(),d_=Ui(),Ga=class{constructor(e){this._scale=e,this._scaleFactor=l_.ldexp(Math.LOG2E,e),this._inverseFactor=l_.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=Vt.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(Vt.getSignificand(e)===0)return(Vt.getNormalBase2(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new d_.MappingError(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return Vt.MIN_VALUE;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new d_.MappingError(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return Vt.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(Vt.MAX_NORMAL_EXPONENT+1<<this._scale)-1}};qi.LogarithmMapping=Ga});var f_=l(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.getMapping=void 0;var rS=c_(),nS=__(),iS=Ui(),p_=-10,h_=20,sS=Array.from({length:31},(r,e)=>e>10?new nS.LogarithmMapping(e-10):new rS.ExponentMapping(e-10));function oS(r){if(r>h_||r<p_)throw new iS.MappingError(`expected scale >= ${p_} && <= ${h_}, got: ${r}`);return sS[r+10]}Vi.getMapping=oS});var g_=l(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ExponentialHistogramAggregator=Ht.ExponentialHistogramAccumulation=void 0;var aS=xt(),uS=wt(),cS=(h(),m(d)),Ha=be(),E_=a_(),m_=f_(),lS=xi(),Gt=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},dS=20,_S=160,ja=2,Gi=class r{constructor(e=e,t=_S,n=!0,i=0,s=0,o=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=new E_.Buckets,_=new E_.Buckets,p=(0,m_.getMapping)(dS)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=o,this._min=a,this._max=u,this._positive=c,this._negative=_,this._mapping=p,this._maxSize<ja&&(cS.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${ja}`),this._maxSize=ja)}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(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 r(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 i=this._mapping.mapToIndex(t),s=!1,o=0,a=0;if(e.length===0?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(s=!0,a=i,o=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(s=!0,a=e.indexStart,o=i),s){let u=this._changeScale(o,a);this._downscale(u),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(t<e.indexStart){let s=e.indexEnd-t;s>=e.backing.length&&this._grow(e,s+1),e.indexStart=t}else if(t>e.indexEnd){let s=t-e.indexStart;s>=e.backing.length&&this._grow(e,s+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,n)}_grow(e,t){let n=e.backing.length,i=e.indexBase-e.indexStart,s=n-i,o=(0,lS.nextGreaterSquare)(t);o>this._maxSize&&(o=this._maxSize);let a=o-i;e.backing.growTo(o,s,a)}_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 new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,m_.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=Gt.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=Gt.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(i.high,i.low))}_highLowAtScale(e,t,n){if(e.length===0)return new Gt(0,-1);let i=t-n;return new Gt(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++)this._incrementIndexBy(e,s+a>>o,n.at(a))}_diffBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++){let c=(s+a>>o)-e.indexBase;c<0&&(c+=e.backing.length),e.decrementBucket(c,n.at(a))}e.trim()}};Ht.ExponentialHistogramAccumulation=Gi;var Fa=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=aS.AggregatorKind.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new Gi(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,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:uS.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===Ha.InstrumentType.UP_DOWN_COUNTER||e.type===Ha.InstrumentType.OBSERVABLE_GAUGE||e.type===Ha.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?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}}})}}};Ht.ExponentialHistogramAggregator=Fa});var T_=l(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.LastValueAggregator=Ft.LastValueAccumulation=void 0;var pS=xt(),Ir=A(),hS=wt(),jt=class{constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,Ir.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ft.LastValueAccumulation=jt;var ka=class{constructor(){this.kind=pS.AggregatorKind.LAST_VALUE}createAccumulation(e){return new jt(e)}merge(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:hS.DataPointType.GAUGE,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()}))}}};Ft.LastValueAggregator=ka});var S_=l(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.SumAggregator=kt.SumAccumulation=void 0;var fS=xt(),ES=wt(),Ce=class{constructor(e,t,n=0,i=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};kt.SumAccumulation=Ce;var $a=class{constructor(e){this.monotonic=e,this.kind=fS.AggregatorKind.SUM}createAccumulation(e){return new Ce(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new Ce(t.startTime,this.monotonic,i,t.reset):new Ce(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new Ce(t.startTime,this.monotonic,i,!0):new Ce(t.startTime,this.monotonic,i-n)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:ES.DataPointType.SUM,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()})),isMonotonic:this.monotonic}}};kt.SumAggregator=$a});var A_=l(ce=>{"use strict";var mS=ce&&ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Mr=ce&&ce.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&mS(e,r,t)};Object.defineProperty(ce,"__esModule",{value:!0});Mr(n_(),ce);Mr(o_(),ce);Mr(g_(),ce);Mr(T_(),ce);Mr(S_(),ce)});var ki=l(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.DefaultAggregation=q.ExponentialHistogramAggregation=q.ExplicitBucketHistogramAggregation=q.HistogramAggregation=q.LastValueAggregation=q.SumAggregation=q.DropAggregation=q.Aggregation=void 0;var gS=(h(),m(d)),at=A_(),Pe=be(),me=class{static Drop(){return O_}static Sum(){return R_}static LastValue(){return b_}static Histogram(){return P_}static ExponentialHistogram(){return TS}static Default(){return SS}};q.Aggregation=me;var Lr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.DropAggregation=Lr;Lr.DEFAULT_INSTANCE=new at.DropAggregator;var $t=class r extends me{createAggregator(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};q.SumAggregation=$t;$t.MONOTONIC_INSTANCE=new at.SumAggregator(!0);$t.NON_MONOTONIC_INSTANCE=new at.SumAggregator(!1);var Nr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.LastValueAggregation=Nr;Nr.DEFAULT_INSTANCE=new at.LastValueAggregator;var Cr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.HistogramAggregation=Cr;Cr.DEFAULT_INSTANCE=new at.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);var Hi=class extends me{constructor(e,t=!0){if(super(),this._recordMinMax=t,e===void 0||e.length===0)throw new Error("HistogramAggregator should be created with boundaries.");e=e.concat(),e=e.sort((s,o)=>s-o);let n=e.lastIndexOf(-1/0),i=e.indexOf(1/0);i===-1&&(i=void 0),this._boundaries=e.slice(n+1,i)}createAggregator(e){return new at.HistogramAggregator(this._boundaries,this._recordMinMax)}};q.ExplicitBucketHistogramAggregation=Hi;var ji=class extends me{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new at.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};q.ExponentialHistogramAggregation=ji;var Fi=class extends me{_resolve(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.UP_DOWN_COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return R_;case Pe.InstrumentType.OBSERVABLE_GAUGE:return b_;case Pe.InstrumentType.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Hi(e.advice.explicitBucketBoundaries):P_}return gS.diag.warn(`Unable to recognize instrument type: ${e.type}`),O_}createAggregator(e){return this._resolve(e).createAggregator(e)}};q.DefaultAggregation=Fi;var O_=new Lr,R_=new $t,b_=new Nr,P_=new Cr,TS=new ji,SS=new Fi});var Xa=l(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Xt.DEFAULT_AGGREGATION_SELECTOR=void 0;var AS=ki(),OS=Li(),RS=r=>AS.Aggregation.Default();Xt.DEFAULT_AGGREGATION_SELECTOR=RS;var bS=r=>OS.AggregationTemporality.CUMULATIVE;Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=bS});var Ka=l(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.MetricReader=void 0;var y_=(h(),m(d)),$i=Ee(),v_=Xa(),Wa=class{constructor(e){var t,n,i;this._shutdown=!1,this._aggregationSelector=(t=e?.aggregationSelector)!==null&&t!==void 0?t:v_.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=(n=e?.aggregationTemporalitySelector)!==null&&n!==void 0?n:v_.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=(i=e?.metricProducers)!==null&&i!==void 0?i:[]}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat((0,$i.FlatMap)(n,a=>a.errors)),s=t.resourceMetrics.resource,o=t.resourceMetrics.scopeMetrics.concat((0,$i.FlatMap)(n,a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:s,scopeMetrics:o},errors:i}}async shutdown(e){if(this._shutdown){y_.diag.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await(0,$i.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){y_.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,$i.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};Xi.MetricReader=Wa});var L_=l(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.PeriodicExportingMetricReader=void 0;var I_=(h(),m(d)),Wi=A(),PS=Ka(),M_=Ee(),yS=(h(),m(d)),za=class extends PS.MetricReader{constructor(e){var t,n,i,s;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(n=e.exporter.selectAggregationTemporality)===null||n===void 0?void 0:n.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(i=e.exportIntervalMillis)!==null&&i!==void 0?i:6e4,this._exportTimeout=(s=e.exportTimeoutMillis)!==null&&s!==void 0?s:3e4,this._exporter=e.exporter}async _runOnce(){try{await(0,M_.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof M_.TimeoutError){I_.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,Wi.globalErrorHandler)(e)}}async _doRun(){var e,t;let{resourceMetrics:n,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});i.length>0&&I_.diag.error("PeriodicExportingMetricReader: metrics collection errors",...i);let s=async()=>{let o=await Wi.internal._export(this._exporter,n);if(o.code!==Wi.ExportResultCode.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${o.error})`)};n.resource.asyncAttributesPending?(t=(e=n.resource).waitForAsyncAttributes)===null||t===void 0||t.call(e).then(s,o=>yS.diag.debug("Error while resolving async portion of resource: ",o)):await s()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,Wi.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}};Ki.PeriodicExportingMetricReader=za});var C_=l(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.InMemoryMetricExporter=void 0;var N_=A(),Ya=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:N_.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:N_.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()}};zi.InMemoryMetricExporter=Ya});var x_=l(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConsoleMetricExporter=void 0;var w_=A(),vS=Xa(),Qa=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e?.temporalitySelector)!==null&&t!==void 0?t:vS.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(e,t){if(this._shutdown){setImmediate(t,{code:w_.ExportResultCode.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let n of e.scopeMetrics)for(let i of n.metrics)console.dir({descriptor:i.descriptor,dataPointType:i.dataPointType,dataPoints:i.dataPoints});t({code:w_.ExportResultCode.SUCCESS})}};Yi.ConsoleMetricExporter=Qa});var D_=l(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ViewRegistry=void 0;var Za=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(i=>this._matchInstrument(i.instrumentSelector,e)&&this._matchMeter(i.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))}};Qi.ViewRegistry=Za});var Zi=l(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.isObservableInstrument=D.ObservableUpDownCounterInstrument=D.ObservableGaugeInstrument=D.ObservableCounterInstrument=D.ObservableInstrument=D.HistogramInstrument=D.CounterInstrument=D.UpDownCounterInstrument=D.SyncInstrument=void 0;var Wt=(h(),m(d)),IS=A(),Kt=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=Wt.context.active()){if(typeof e!="number"){Wt.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Wt.ValueType.INT&&!Number.isInteger(e)&&(Wt.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,t,n,(0,IS.millisToHrTime)(Date.now()))}};D.SyncInstrument=Kt;var Ja=class extends Kt{add(e,t,n){this._record(e,t,n)}};D.UpDownCounterInstrument=Ja;var eu=class extends Kt{add(e,t,n){if(e<0){Wt.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.CounterInstrument=eu;var tu=class extends Kt{record(e,t,n){if(e<0){Wt.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.HistogramInstrument=tu;var ut=class{constructor(e,t,n){this._observableRegistry=n,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};D.ObservableInstrument=ut;var ru=class extends ut{};D.ObservableCounterInstrument=ru;var nu=class extends ut{};D.ObservableGaugeInstrument=nu;var iu=class extends ut{};D.ObservableUpDownCounterInstrument=iu;function MS(r){return r instanceof ut}D.isObservableInstrument=MS});var U_=l(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Meter=void 0;var ie=be(),zt=Zi(),su=class{constructor(e){this._meterSharedState=e}createHistogram(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.HISTOGRAM,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.HistogramInstrument(i,n)}createCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.CounterInstrument(i,n)}createUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.UP_DOWN_COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.UpDownCounterInstrument(i,n)}createObservableGauge(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableGaugeInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableCounterInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableUpDownCounterInstrument(n,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};Ji.Meter=su});var au=l(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MetricStorage=void 0;var LS=be(),ou=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,LS.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};es.MetricStorage=ou});var wr=l(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AttributeHashMap=Yt.HashMap=void 0;var NS=Ee(),ts=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(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 i=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,i),i}set(e,t,n){n??(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??(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}};Yt.HashMap=ts;var uu=class extends ts{constructor(){super(NS.hashAttributes)}};Yt.AttributeHashMap=uu});var du=l(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.DeltaMetricProcessor=void 0;var cu=wr(),lu=class{constructor(e){this._aggregator=e,this._activeCollectionStorage=new cu.AttributeHashMap,this._cumulativeMemoStorage=new cu.AttributeHashMap}record(e,t,n,i){let s=this._activeCollectionStorage.getOrDefault(t,()=>this._aggregator.createAccumulation(i));s?.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([n,i,s])=>{let o=this._aggregator.createAccumulation(t);o?.record(i);let a=o;if(this._cumulativeMemoStorage.has(n,s)){let u=this._cumulativeMemoStorage.get(n,s);a=this._aggregator.diff(u,o)}if(this._activeCollectionStorage.has(n,s)){let u=this._activeCollectionStorage.get(n,s);a=this._aggregator.merge(u,a)}this._cumulativeMemoStorage.set(n,o,s),this._activeCollectionStorage.set(n,a,s)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new cu.AttributeHashMap,e}};rs.DeltaMetricProcessor=lu});var pu=l(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.TemporalMetricProcessor=void 0;var CS=Li(),wS=wr(),_u=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(e,t,n,i){this._stashAccumulations(n);let s=this._getMergedUnreportedAccumulations(e),o=s,a;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),_=c.collectionTime;a=c.aggregationTemporality,a===CS.AggregationTemporality.CUMULATIVE?o=r.merge(c.accumulations,s,this._aggregator):o=r.calibrateStartTime(c.accumulations,s,_)}else a=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:a});let u=xS(o);if(u.length!==0)return this._aggregator.toMetricData(t,a,u,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let i=this._unreportedAccumulations.get(n);i===void 0&&(i=[],this._unreportedAccumulations.set(n,i)),i.push(e)}}_getMergedUnreportedAccumulations(e){let t=new wS.AttributeHashMap,n=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),n===void 0)return t;for(let i of n)t=r.merge(t,i,this._aggregator);return t}static merge(e,t,n){let i=e,s=t.entries(),o=s.next();for(;o.done!==!0;){let[a,u,c]=o.value;if(e.has(a,c)){let _=e.get(a,c),p=n.merge(_,u);i.set(a,p,c)}else i.set(a,u,c);o=s.next()}return i}static calibrateStartTime(e,t,n){for(let[i,s]of e.keys()){let o=t.get(i,s);o?.setStartTime(n)}return t}};ns.TemporalMetricProcessor=_u;function xS(r){return Array.from(r.entries())}});var B_=l(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.AsyncMetricStorage=void 0;var DS=au(),US=du(),BS=pu(),qS=wr(),hu=class extends DS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new US.DeltaMetricProcessor(t),this._temporalMetricStorage=new BS.TemporalMetricProcessor(t,i)}record(e,t){let n=new qS.AttributeHashMap;Array.from(e.entries()).forEach(([i,s])=>{n.set(this._attributesProcessor.process(i),s)}),this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};is.AsyncMetricStorage=hu});var j_=l(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getConflictResolutionRecipe=Z.getDescriptionResolutionRecipe=Z.getTypeConflictResolutionRecipe=Z.getUnitConflictResolutionRecipe=Z.getValueTypeConflictResolutionRecipe=Z.getIncompatibilityDetails=void 0;function VS(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}'
9
9
  `),r.type!==e.type&&(t+=` - Type '${r.type}' does not match '${e.type}'
10
10
  `),r.valueType!==e.valueType&&(t+=` - Value Type '${r.valueType}' does not match '${e.valueType}'
11
11
  `),r.description!==e.description&&(t+=` - Description '${r.description}' does not match '${e.description}'
12
- `),t}Z.getIncompatibilityDetails=MS;function G_(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getValueTypeConflictResolutionRecipe=G_;function V_(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getUnitConflictResolutionRecipe=V_;function H_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'`}Z.getTypeConflictResolutionRecipe=H_;function j_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'
12
+ `),t}Z.getIncompatibilityDetails=VS;function q_(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getValueTypeConflictResolutionRecipe=q_;function V_(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getUnitConflictResolutionRecipe=V_;function G_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'`}Z.getTypeConflictResolutionRecipe=G_;function H_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'
13
13
  - OR - create a new view with the name ${r.name} and description '${r.description}' and InstrumentSelector ${n}
14
- - OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${n}`}Z.getDescriptionResolutionRecipe=j_;function NS(r,e){return r.valueType!==e.valueType?G_(r,e):r.unit!==e.unit?V_(r,e):r.type!==e.type?H_(r,e):r.description!==e.description?j_(r,e):""}Z.getConflictResolutionRecipe=NS});var $_=l(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.MetricStorageRegistry=void 0;var CS=be(),k_=(h(),m(d)),ss=F_(),Eu=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let i of this._sharedRegistry.values())t=t.concat(i);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let i of n.values())t=t.concat(i);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n==null&&(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 i=n.get(t.name);return i===void 0?null:this._findOrUpdateCompatibleStorage(t,i)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),i=t.get(n.name);if(i===void 0){t.set(n.name,[e]);return}i.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let i of t){let s=i.getInstrumentDescriptor();(0,CS.isDescriptorCompatibleWith)(s,e)?(s.description!==e.description&&(e.description.length>s.description.length&&i.updateDescription(e.description),k_.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.
14
+ - OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${n}`}Z.getDescriptionResolutionRecipe=H_;function GS(r,e){return r.valueType!==e.valueType?q_(r,e):r.unit!==e.unit?V_(r,e):r.type!==e.type?G_(r,e):r.description!==e.description?H_(r,e):""}Z.getConflictResolutionRecipe=GS});var k_=l(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.MetricStorageRegistry=void 0;var HS=be(),F_=(h(),m(d)),ss=j_(),fu=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let i of this._sharedRegistry.values())t=t.concat(i);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let i of n.values())t=t.concat(i);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n==null&&(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 i=n.get(t.name);return i===void 0?null:this._findOrUpdateCompatibleStorage(t,i)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),i=t.get(n.name);if(i===void 0){t.set(n.name,[e]);return}i.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let i of t){let s=i.getInstrumentDescriptor();(0,HS.isDescriptorCompatibleWith)(s,e)?(s.description!==e.description&&(e.description.length>s.description.length&&i.updateDescription(e.description),F_.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.
15
15
  `,`Details:
16
16
  `,(0,ss.getIncompatibilityDetails)(s,e),`The longer description will be used.
17
- To resolve the conflict:`,(0,ss.getConflictResolutionRecipe)(s,e))),n=i):k_.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
17
+ To resolve the conflict:`,(0,ss.getConflictResolutionRecipe)(s,e))),n=i):F_.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
18
18
  `,`Details:
19
19
  `,(0,ss.getIncompatibilityDetails)(s,e),`To resolve the conflict:
20
- `,(0,ss.getConflictResolutionRecipe)(s,e))}return n}};os.MetricStorageRegistry=Eu});var X_=l(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MultiMetricStorage=void 0;var mu=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(s=>{s.record(e,t,n,i)})}};as.MultiMetricStorage=mu});var K_=l(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.BatchObservableResultImpl=Zt.ObservableResultImpl=void 0;var Qt=(h(),m(d)),W_=wr(),wS=Zi(),gu=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new W_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Qt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Qt.ValueType.INT&&!Number.isInteger(e)&&(Qt.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(t,e)}};Zt.ObservableResultImpl=gu;var Tu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,wS.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new W_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Qt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Qt.ValueType.INT&&!Number.isInteger(t)&&(Qt.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||i.set(n,t)}};Zt.BatchObservableResultImpl=Tu});var Q_=l(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.ObservableRegistry=void 0;var xS=(h(),m(d)),z_=Zi(),Y_=K_(),xr=Ee(),Su=class{constructor(){this._callbacks=[],this._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,t){let n=new Set(t.filter(z_.isObservableInstrument));if(n.size===0){xS.diag.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(z_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,xr.PromiseAllSettled)([...n,...i])).filter(xr.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new Y_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new Y_.BatchObservableResultImpl,o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i.forEach(a=>{let u=s._buffer.get(a);u!=null&&a._metricStorages.forEach(c=>{c.record(u,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,xr.setEquals)(n.instruments,t))}};us.ObservableRegistry=Su});var Z_=l(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.SyncMetricStorage=void 0;var DS=uu(),US=_u(),BS=hu(),Au=class extends DS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new US.DeltaMetricProcessor(t),this._temporalMetricStorage=new BS.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};cs.SyncMetricStorage=Au});var Ru=l(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.FilteringAttributesProcessor=we.NoopAttributesProcessor=we.AttributesProcessor=void 0;var Dr=class{static Noop(){return qS}};we.AttributesProcessor=Dr;var ls=class extends Dr{process(e,t){return e}};we.NoopAttributesProcessor=ls;var Ou=class extends Dr{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};we.FilteringAttributesProcessor=Ou;var qS=new ls});var J_=l(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.MeterSharedState=void 0;var GS=be(),VS=B_(),HS=Ee(),jS=q_(),FS=$_(),kS=X_(),$S=Q_(),XS=Z_(),WS=Ru(),bu=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new FS.MetricStorageRegistry,this.observableRegistry=new $S.ObservableRegistry,this.meter=new VS.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,XS.SyncMetricStorage);return t.length===1?t[0]:new kS.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,jS.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=s.map(a=>a.collect(e,t)).filter(HS.isNotNullish);return o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=(0,GS.createInstrumentDescriptorWithView)(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let u=s.aggregation.createAggregator(o),c=new t(o,u,s.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(c),c});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(c!=null)return c;let _=u.createAggregator(e),p=new t(e,_,WS.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,p),p});i=i.concat(o)}return i}};ds.MeterSharedState=bu});var ep=l(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.MeterProviderSharedState=void 0;var KS=Ee(),zS=U_(),YS=J_(),Pu=class{constructor(e){this.resource=e,this.viewRegistry=new zS.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,KS.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new YS.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};_s.MeterProviderSharedState=Pu});var tp=l(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.MetricCollector=void 0;var QS=A(),yu=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,QS.millisToHrTime)(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};ps.MetricCollector=yu});var np=l(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.MeterProvider=void 0;var hs=(h(),m(d)),rp=rt(),ZS=ep(),JS=tp(),vu=class{constructor(e){var t;this._shutdown=!1;let n=rp.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:rp.Resource.empty());if(this._sharedState=new ZS.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(hs.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,hs.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new JS.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){hs.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){hs.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};fs.MeterProvider=vu});var Es=l(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ExactPredicate=Jt.PatternPredicate=void 0;var eA=/[\^$\\.+?()[\]{}|]/g,Iu=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(eA,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};Jt.PatternPredicate=Iu;var Lu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};Jt.ExactPredicate=Lu});var sp=l(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.InstrumentSelector=void 0;var ip=Es(),Mu=class{constructor(e){var t;this._nameFilter=new ip.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new ip.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};ms.InstrumentSelector=Mu});var op=l(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.MeterSelector=void 0;var Nu=Es(),Cu=class{constructor(e){this._nameFilter=new Nu.ExactPredicate(e?.name),this._versionFilter=new Nu.ExactPredicate(e?.version),this._schemaUrlFilter=new Nu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};gs.MeterSelector=Cu});var up=l(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.View=void 0;var tA=Es(),ap=Ru(),rA=sp(),nA=op(),iA=ki();function sA(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var wu=class{constructor(e){var t;if(sA(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||tA.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new ap.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=ap.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:iA.Aggregation.Default(),this.instrumentSelector=new rA.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new nA.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};Ts.View=wu});var xu=l(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var oA=Mi();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return oA.AggregationTemporality}});var aA=wt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return aA.DataPointType}});var uA=za();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return uA.MetricReader}});var cA=N_();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return cA.PeriodicExportingMetricReader}});var lA=w_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return lA.InMemoryMetricExporter}});var dA=D_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return dA.ConsoleMetricExporter}});var _A=be();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return _A.InstrumentType}});var pA=np();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return pA.MeterProvider}});var xe=ki();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return xe.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return xe.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return xe.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return xe.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return xe.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return xe.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return xe.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return xe.Aggregation}});var hA=up();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return hA.View}});var fA=Ee();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return fA.TimeoutError}})});var cp=l(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.AbstractAsyncHooksContextManager=void 0;var EA=z("events"),mA=["addListener","on","once","prependListener","prependOnceListener"],Du=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof EA.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...s){return n.with(e,()=>t.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),mA.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,s){var o;let a=(o=n._getPatchMap(e))===null||o===void 0?void 0:o[i];if(a===void 0)return t.call(this,i,s);let u=a.get(s);return t.call(this,i,u||s)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(s,o){if(i._wrapped)return t.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[s];u===void 0&&(u=new WeakMap,a[s]=u);let c=i.bind(n,o);u.set(o,c),i._wrapped=!0;try{return t.call(this,s,c)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Ss.AbstractAsyncHooksContextManager=Du});var lp=l(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.AsyncLocalStorageContextManager=void 0;var gA=(h(),m(d)),TA=z("async_hooks"),SA=cp(),Uu=class extends SA.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new TA.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:gA.ROOT_CONTEXT}with(e,t,n,...i){let s=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};As.AsyncLocalStorageContextManager=Uu});var Ur=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.toAnyValue=De.toKeyValue=De.toAttributes=void 0;function yA(r){return Object.keys(r).map(e=>Vu(e,r[e]))}De.toAttributes=yA;function Vu(r,e){return{key:r,value:Hu(e)}}De.toKeyValue=Vu;function Hu(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(Hu)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Vu(t,n))}}:{}}De.toAnyValue=Hu});var bp=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.toOtlpSpanEvent=Ue.toOtlpLink=Ue.sdkSpanToOtlpSpan=void 0;var ju=Ur();function vA(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,ju.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(s=>Rp(s,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(s=>Op(s,e)),droppedLinksCount:r.droppedLinksCount}}Ue.sdkSpanToOtlpSpan=vA;function Op(r,e){var t;return{attributes:r.attributes?(0,ju.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpLink=Op;function Rp(r,e){return{attributes:r.attributes?(0,ju.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpSpanEvent=Rp});var Br=l(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.getOtlpEncoder=oe.encodeAsString=oe.encodeAsLongBits=oe.toLongBits=oe.hrTimeToNanos=void 0;var Ps=A(),IA=BigInt(1e9);function Fu(r){return BigInt(r[0])*IA+BigInt(r[1])}oe.hrTimeToNanos=Fu;function yp(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}oe.toLongBits=yp;function ku(r){let e=Fu(r);return yp(e)}oe.encodeAsLongBits=ku;function vp(r){return Fu(r).toString()}oe.encodeAsString=vp;var LA=typeof BigInt<"u"?vp:Ps.hrTimeToNanoseconds;function Pp(r){return r}function Ip(r){if(r!==void 0)return(0,Ps.hexToBase64)(r)}var MA={encodeHrTime:ku,encodeSpanContext:Ps.hexToBase64,encodeOptionalSpanContext:Ip};function NA(r){var e,t;if(r===void 0)return MA;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?ku:LA,encodeSpanContext:i?Pp:Ps.hexToBase64,encodeOptionalSpanContext:i?Pp:Ip}}oe.getOtlpEncoder=NA});var vs=l(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.createExportTraceServiceRequest=void 0;var CA=Ur(),wA=bp(),xA=Br();function DA(r,e){let t=(0,xA.getOtlpEncoder)(e);return{resourceSpans:BA(r,t)}}ys.createExportTraceServiceRequest=DA;function UA(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(t)}return e}function BA(r,e){let t=UA(r),n=[],i=t.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,u=[],c=a.values(),_=c.next();for(;!_.done;){let f=_.value;if(f.length>0){let{name:L,version:R,schemaUrl:w}=f[0].instrumentationLibrary,U=f.map(S=>(0,wA.sdkSpanToOtlpSpan)(S,e));u.push({scope:{name:L,version:R},spans:U,schemaUrl:w})}_=c.next()}let p={resource:{attributes:(0,CA.toAttributes)(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(p),s=i.next()}return n}});var Np=l(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.parseRetryAfterToMills=N.isExportRetryable=N.invalidTimeout=N.configureExporterTimeout=N.appendRootPathToUrlIfNeeded=N.appendResourcePathToUrl=N.parseHeaders=N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=N.DEFAULT_EXPORT_MAX_BACKOFF=N.DEFAULT_EXPORT_INITIAL_BACKOFF=N.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var $u=(h(),m(d)),Lp=A(),Mp=1e4;N.DEFAULT_EXPORT_MAX_ATTEMPTS=5;N.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;N.DEFAULT_EXPORT_MAX_BACKOFF=5e3;N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function qA(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):$u.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}N.parseHeaders=qA;function GA(r,e){return r.endsWith("/")||(r=r+"/"),r+e}N.appendResourcePathToUrl=GA;function VA(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return $u.diag.warn(`Could not parse export URL: '${r}'`),r}}N.appendRootPathToUrlIfNeeded=VA;function HA(r){return typeof r=="number"?r<=0?Xu(r,Mp):r:jA()}N.configureExporterTimeout=HA;function jA(){var r;let e=Number((r=(0,Lp.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,Lp.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?Xu(e,Mp):e}function Xu(r,e){return $u.diag.warn("Timeout must be greater than 0",r),e}N.invalidTimeout=Xu;function FA(r){return[429,502,503,504].includes(r)}N.isExportRetryable=FA;function kA(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}N.parseRetryAfterToMills=kA});var wp=l(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.OTLPExporterBase=void 0;var Cp=(h(),m(d)),qr=A(),$A=Np(),Wu=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new qr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,$A.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:qr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:qr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:qr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:qr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{Cp.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return Cp.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};Is.OTLPExporterBase=Wu});var Bp=l((xy,Up)=>{"use strict";Up.exports=KA;function KA(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(s)if(s=!1,_)u(_);else{for(var p=new Array(arguments.length-1),f=0;f<p.length;)p[f++]=arguments[f];a.apply(null,p)}};try{r.apply(e||null,t)}catch(c){s&&(s=!1,u(c))}})}});var Hp=l(Vp=>{"use strict";var Ms=Vp;Ms.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};var nr=new Array(64),Gp=new Array(123);for(le=0;le<64;)Gp[nr[le]=le<26?le+65:le<52?le+71:le<62?le-4:le-59|43]=le++;var le;Ms.encode=function(e,t,n){for(var i=null,s=[],o=0,a=0,u;t<n;){var c=e[t++];switch(a){case 0:s[o++]=nr[c>>2],u=(c&3)<<4,a=1;break;case 1:s[o++]=nr[u|c>>4],u=(c&15)<<2,a=2;break;case 2:s[o++]=nr[u|c>>6],s[o++]=nr[c&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=nr[u],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var qp="invalid encoding";Ms.decode=function(e,t,n){for(var i=n,s=0,o,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&s>1)break;if((u=Gp[u])===void 0)throw Error(qp);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(u&48)>>4,o=u,s=2;break;case 2:t[n++]=(o&15)<<4|(u&60)>>2,o=u,s=3;break;case 3:t[n++]=(o&3)<<6|u,s=0;break}}if(s===1)throw Error(qp);return n-i};Ms.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Fp=l((Uy,jp)=>{"use strict";jp.exports=Ns;function Ns(){this._listeners={}}Ns.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};Ns.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};Ns.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var Yp=l((By,zp)=>{"use strict";zp.exports=kp(kp);function kp(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3]}function s(u,c,_){e[0]=u,c[_]=t[3],c[_+1]=t[2],c[_+2]=t[1],c[_+3]=t[0]}r.writeFloatLE=n?i:s,r.writeFloatBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],e[0]}function a(u,c){return t[3]=u[c],t[2]=u[c+1],t[1]=u[c+2],t[0]=u[c+3],e[0]}r.readFloatLE=n?o:a,r.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var u=Math.floor(Math.log(i)/Math.LN2),c=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|c)>>>0,s,o)}}r.writeFloatLE=e.bind(null,$p),r.writeFloatBE=e.bind(null,Xp);function t(n,i,s){var o=n(i,s),a=(o>>31)*2+1,u=o>>>23&255,c=o&8388607;return u===255?c?NaN:a*(1/0):u===0?a*1401298464324817e-60*c:a*Math.pow(2,u-150)*(c+8388608)}r.readFloatLE=t.bind(null,Wp),r.readFloatBE=t.bind(null,Kp)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3],c[_+4]=t[4],c[_+5]=t[5],c[_+6]=t[6],c[_+7]=t[7]}function s(u,c,_){e[0]=u,c[_]=t[7],c[_+1]=t[6],c[_+2]=t[5],c[_+3]=t[4],c[_+4]=t[3],c[_+5]=t[2],c[_+6]=t[1],c[_+7]=t[0]}r.writeDoubleLE=n?i:s,r.writeDoubleBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],t[4]=u[c+4],t[5]=u[c+5],t[6]=u[c+6],t[7]=u[c+7],e[0]}function a(u,c){return t[7]=u[c],t[6]=u[c+1],t[5]=u[c+2],t[4]=u[c+3],t[3]=u[c+4],t[2]=u[c+5],t[1]=u[c+6],t[0]=u[c+7],e[0]}r.readDoubleLE=n?o:a,r.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,u){var c=o<0?1:0;if(c&&(o=-o),o===0)n(0,a,u+i),n(1/o>0?0:2147483648,a,u+s);else if(isNaN(o))n(0,a,u+i),n(2146959360,a,u+s);else if(o>17976931348623157e292)n(0,a,u+i),n((c<<31|2146435072)>>>0,a,u+s);else{var _;if(o<22250738585072014e-324)_=o/5e-324,n(_>>>0,a,u+i),n((c<<31|_/4294967296)>>>0,a,u+s);else{var p=Math.floor(Math.log(o)/Math.LN2);p===1024&&(p=1023),_=o*Math.pow(2,-p),n(_*4503599627370496>>>0,a,u+i),n((c<<31|p+1023<<20|_*1048576&1048575)>>>0,a,u+s)}}}r.writeDoubleLE=e.bind(null,$p,0,4),r.writeDoubleBE=e.bind(null,Xp,4,0);function t(n,i,s,o,a){var u=n(o,a+i),c=n(o,a+s),_=(c>>31)*2+1,p=c>>>20&2047,f=4294967296*(c&1048575)+u;return p===2047?f?NaN:_*(1/0):p===0?_*5e-324*f:_*Math.pow(2,p-1075)*(f+4503599627370496)}r.readDoubleLE=t.bind(null,Wp,0,4),r.readDoubleBE=t.bind(null,Kp,4,0)}(),r}function $p(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Xp(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function Wp(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function Kp(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var Qp=l((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var Jp=l(Zp=>{"use strict";var zu=Zp;zu.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};zu.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var s=null,o=[],a=0,u;t<n;)u=e[t++],u<128?o[a++]=u:u>191&&u<224?o[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[a++]=55296+(u>>10),o[a++]=56320+(u&1023)):o[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};zu.write=function(e,t,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128);return n-i}});var th=l((Gy,eh)=>{"use strict";eh.exports=zA;function zA(r,e,t){var n=t||8192,i=n>>>1,s=null,o=n;return function(u){if(u<1||u>i)return r(u);o+u>n&&(s=r(n),o=0);var c=e.call(s,o,o+=u);return o&7&&(o=(o|7)+1),c}}});var nh=l((Vy,rh)=>{"use strict";rh.exports=G;var Gr=qe();function G(r,e){this.lo=r>>>0,this.hi=e>>>0}var ct=G.zero=new G(0,0);ct.toNumber=function(){return 0};ct.zzEncode=ct.zzDecode=function(){return this};ct.length=function(){return 1};var YA=G.zeroHash="\0\0\0\0\0\0\0\0";G.fromNumber=function(e){if(e===0)return ct;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new G(n,i)};G.from=function(e){if(typeof e=="number")return G.fromNumber(e);if(Gr.isString(e))if(Gr.Long)e=Gr.Long.fromString(e);else return G.fromNumber(parseInt(e,10));return e.low||e.high?new G(e.low>>>0,e.high>>>0):ct};G.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};G.prototype.toLong=function(e){return Gr.Long?new Gr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Be=String.prototype.charCodeAt;G.fromHash=function(e){return e===YA?ct:new G((Be.call(e,0)|Be.call(e,1)<<8|Be.call(e,2)<<16|Be.call(e,3)<<24)>>>0,(Be.call(e,4)|Be.call(e,5)<<8|Be.call(e,6)<<16|Be.call(e,7)<<24)>>>0)};G.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)};G.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};G.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};G.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}});var qe=l(Yu=>{"use strict";var E=Yu;E.asPromise=Bp();E.base64=Hp();E.EventEmitter=Fp();E.float=Yp();E.inquire=Qp();E.utf8=Jp();E.pool=th();E.LongBits=nh();E.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);E.global=E.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||Yu;E.emptyArray=Object.freeze?Object.freeze([]):[];E.emptyObject=Object.freeze?Object.freeze({}):{};E.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};E.isString=function(e){return typeof e=="string"||e instanceof String};E.isObject=function(e){return e&&typeof e=="object"};E.isset=E.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};E.Buffer=function(){try{var r=E.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();E._Buffer_from=null;E._Buffer_allocUnsafe=null;E.newBuffer=function(e){return typeof e=="number"?E.Buffer?E._Buffer_allocUnsafe(e):new E.Array(e):E.Buffer?E._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};E.Array=typeof Uint8Array<"u"?Uint8Array:Array;E.Long=E.global.dcodeIO&&E.global.dcodeIO.Long||E.global.Long||E.inquire("long");E.key2Re=/^true|false|0|1$/;E.key32Re=/^-?(?:0|[1-9][0-9]*)$/;E.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;E.longToHash=function(e){return e?E.LongBits.from(e).toHash():E.LongBits.zeroHash};E.longFromHash=function(e,t){var n=E.LongBits.fromHash(e);return E.Long?E.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function ih(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}E.merge=ih;E.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function sh(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&ih(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}E.newError=sh;E.ProtocolError=sh("ProtocolError");E.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(t[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};E.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};E.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};E._configure=function(){var r=E.Buffer;if(!r){E._Buffer_from=E._Buffer_allocUnsafe=null;return}E._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},E._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var nc=l((jy,ch)=>{"use strict";ch.exports=O;var ae=qe(),Qu,Cs=ae.LongBits,oh=ae.base64,ah=ae.utf8;function Vr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Ju(){}function QA(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function O(){this.len=0,this.head=new Vr(Ju,0,0),this.tail=this.head,this.states=null}var uh=function(){return ae.Buffer?function(){return(O.create=function(){return new Qu})()}:function(){return new O}};O.create=uh();O.alloc=function(e){return new ae.Array(e)};ae.Array!==Array&&(O.alloc=ae.pool(O.alloc,ae.Array.prototype.subarray));O.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Vr(e,t,n),this.len+=t,this};function ec(r,e,t){e[t]=r&255}function ZA(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function tc(r,e){this.len=r,this.next=void 0,this.val=e}tc.prototype=Object.create(Vr.prototype);tc.prototype.fn=ZA;O.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new tc((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};O.prototype.int32=function(e){return e<0?this._push(rc,10,Cs.fromNumber(e)):this.uint32(e)};O.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function rc(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}O.prototype.uint64=function(e){var t=Cs.from(e);return this._push(rc,t.length(),t)};O.prototype.int64=O.prototype.uint64;O.prototype.sint64=function(e){var t=Cs.from(e).zzEncode();return this._push(rc,t.length(),t)};O.prototype.bool=function(e){return this._push(ec,1,e?1:0)};function Zu(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}O.prototype.fixed32=function(e){return this._push(Zu,4,e>>>0)};O.prototype.sfixed32=O.prototype.fixed32;O.prototype.fixed64=function(e){var t=Cs.from(e);return this._push(Zu,4,t.lo)._push(Zu,4,t.hi)};O.prototype.sfixed64=O.prototype.fixed64;O.prototype.float=function(e){return this._push(ae.float.writeFloatLE,4,e)};O.prototype.double=function(e){return this._push(ae.float.writeDoubleLE,8,e)};var JA=ae.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};O.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(ec,1,0);if(ae.isString(e)){var n=O.alloc(t=oh.length(e));oh.decode(e,n,0),e=n}return this.uint32(t)._push(JA,t,e)};O.prototype.string=function(e){var t=ah.length(e);return t?this.uint32(t)._push(ah.write,t,e):this._push(ec,1,0)};O.prototype.fork=function(){return this.states=new QA(this),this.head=this.tail=new Vr(Ju,0,0),this.len=0,this};O.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 Vr(Ju,0,0),this.len=0),this};O.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};O.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};O._configure=function(r){Qu=r,O.create=uh(),Qu._configure()}});var _h=l((Fy,dh)=>{"use strict";dh.exports=ge;var lh=nc();(ge.prototype=Object.create(lh.prototype)).constructor=ge;var Ge=qe();function ge(){lh.call(this)}ge._configure=function(){ge.alloc=Ge._Buffer_allocUnsafe,ge.writeBytesBuffer=Ge.Buffer&&Ge.Buffer.prototype instanceof Uint8Array&&Ge.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 i=0;i<e.length;)t[n++]=e[i++]}};ge.prototype.bytes=function(e){Ge.isString(e)&&(e=Ge._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(ge.writeBytesBuffer,t,e),this};function eO(r,e,t){r.length<40?Ge.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}ge.prototype.string=function(e){var t=Ge.Buffer.byteLength(e);return this.uint32(t),t&&this._push(eO,t,e),this};ge._configure()});var oc=l((ky,mh)=>{"use strict";mh.exports=x;var de=qe(),sc,fh=de.LongBits,tO=de.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function x(r){this.buf=r,this.pos=0,this.len=r.length}var ph=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new x(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new x(e);throw Error("illegal buffer")},Eh=function(){return de.Buffer?function(t){return(x.create=function(i){return de.Buffer.isBuffer(i)?new sc(i):ph(i)})(t)}:ph};x.create=Eh();x.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;x.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,_e(this,10);return e}}();x.prototype.int32=function(){return this.uint32()|0};x.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function ic(){var r=new fh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw _e(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw _e(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}x.prototype.bool=function(){return this.uint32()!==0};function ws(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}x.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return ws(this.buf,this.pos+=4)};x.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return ws(this.buf,this.pos+=4)|0};function hh(){if(this.pos+8>this.len)throw _e(this,8);return new fh(ws(this.buf,this.pos+=4),ws(this.buf,this.pos+=4))}x.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};x.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};x.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=de.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};x.prototype.string=function(){var e=this.bytes();return tO.read(e,0,e.length)};x.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};x.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};x._configure=function(r){sc=r,x.create=Eh(),sc._configure();var e=de.Long?"toLong":"toNumber";de.merge(x.prototype,{int64:function(){return ic.call(this)[e](!1)},uint64:function(){return ic.call(this)[e](!0)},sint64:function(){return ic.call(this).zzDecode()[e](!1)},fixed64:function(){return hh.call(this)[e](!0)},sfixed64:function(){return hh.call(this)[e](!1)}})}});var Ah=l(($y,Sh)=>{"use strict";Sh.exports=lt;var Th=oc();(lt.prototype=Object.create(Th.prototype)).constructor=lt;var gh=qe();function lt(r){Th.call(this,r)}lt._configure=function(){gh.Buffer&&(lt.prototype._slice=gh.Buffer.prototype.slice)};lt.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))};lt._configure()});var Rh=l((Xy,Oh)=>{"use strict";Oh.exports=Hr;var ac=qe();(Hr.prototype=Object.create(ac.EventEmitter.prototype)).constructor=Hr;function Hr(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");ac.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Hr.prototype.rpcCall=function r(e,t,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return ac.asPromise(r,o,e,t,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,c){if(u)return o.emit("error",u,e),s(u);if(c===null){o.end(!0);return}if(!(c instanceof n))try{c=n[o.responseDelimited?"decodeDelimited":"decode"](c)}catch(_){return o.emit("error",_,e),s(_)}return o.emit("data",c,e),s(null,c)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Hr.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Ph=l(bh=>{"use strict";var rO=bh;rO.Service=Rh()});var vh=l((Ky,yh)=>{"use strict";yh.exports={}});var Mh=l(Lh=>{"use strict";var J=Lh;J.build="minimal";J.Writer=nc();J.BufferWriter=_h();J.Reader=oc();J.BufferReader=Ah();J.util=qe();J.rpc=Ph();J.roots=vh();J.configure=Ih;function Ih(){J.util._configure(),J.Writer._configure(J.BufferWriter),J.Reader._configure(J.BufferReader)}Ih()});var Ch=l((Yy,Nh)=>{"use strict";Nh.exports=Mh()});var jh=l(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0})});var kh=l(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0})});var Xh=l($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0})});var Wh=l(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ESpanKind=void 0;var AO;(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(AO=Fr.ESpanKind||(Fr.ESpanKind={}))});var zh=l(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0})});var ef=l(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.toMetric=Ve.toScopeMetrics=Ve.toResourceMetrics=void 0;var Yh=(h(),m(d)),or=xu(),Us=Ur(),OO=Br();function RO(r,e){let t=(0,OO.getOtlpEncoder)(e);return{resource:{attributes:(0,Us.toAttributes)(r.resource.attributes),droppedAttributesCount:0},schemaUrl:void 0,scopeMetrics:Zh(r.scopeMetrics,t)}}Ve.toResourceMetrics=RO;function Zh(r,e){return Array.from(r.map(t=>({scope:{name:t.scope.name,version:t.scope.version},metrics:t.metrics.map(n=>Jh(n,e)),schemaUrl:t.scope.schemaUrl})))}Ve.toScopeMetrics=Zh;function Jh(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},n=vO(r.aggregationTemporality);switch(r.dataPointType){case or.DataPointType.SUM:t.sum={aggregationTemporality:n,isMonotonic:r.isMonotonic,dataPoints:Qh(r,e)};break;case or.DataPointType.GAUGE:t.gauge={dataPoints:Qh(r,e)};break;case or.DataPointType.HISTOGRAM:t.histogram={aggregationTemporality:n,dataPoints:PO(r,e)};break;case or.DataPointType.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:n,dataPoints:yO(r,e)};break}return t}Ve.toMetric=Jh;function bO(r,e,t){let n={attributes:(0,Us.toAttributes)(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case Yh.ValueType.INT:n.asInt=r.value;break;case Yh.ValueType.DOUBLE:n.asDouble=r.value;break}return n}function Qh(r,e){return r.dataPoints.map(t=>bO(t,r.descriptor.valueType,e))}function PO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Us.toAttributes)(t.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function yO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Us.toAttributes)(t.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function vO(r){switch(r){case or.AggregationTemporality.DELTA:return 1;case or.AggregationTemporality.CUMULATIVE:return 2}}});var tf=l(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.createExportMetricsServiceRequest=void 0;var IO=ef();function LO(r,e){return{resourceMetrics:r.map(t=>(0,IO.toResourceMetrics)(t,e))}}Bs.createExportMetricsServiceRequest=LO});var nf=l(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.toLogAttributes=ar.createExportLogsServiceRequest=void 0;var MO=Br(),dc=Ur();function NO(r,e){let t=(0,MO.getOtlpEncoder)(e);return{resourceLogs:wO(r,t)}}ar.createExportLogsServiceRequest=NO;function CO(r){let e=new Map;for(let t of r){let{resource:n,instrumentationScope:{name:i,version:s="",schemaUrl:o=""}}=t,a=e.get(n);a||(a=new Map,e.set(n,a));let u=`${i}@${s}:${o}`,c=a.get(u);c||(c=[],a.set(u,c)),c.push(t)}return e}function wO(r,e){let t=CO(r);return Array.from(t,([n,i])=>({resource:{attributes:(0,dc.toAttributes)(n.attributes),droppedAttributesCount:0},scopeLogs:Array.from(i,([,s])=>{let{instrumentationScope:{name:o,version:a,schemaUrl:u}}=s[0];return{scope:{name:o,version:a},logRecords:s.map(c=>xO(c,e)),schemaUrl:u}}),schemaUrl:void 0}))}function xO(r,e){var t,n,i;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:(0,dc.toAnyValue)(r.body),attributes:rf(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((n=r.spanContext)===null||n===void 0?void 0:n.traceId),spanId:e.encodeOptionalSpanContext((i=r.spanContext)===null||i===void 0?void 0:i.spanId)}}function rf(r){return Object.keys(r).map(e=>(0,dc.toKeyValue)(e,r[e]))}ar.toLogAttributes=rf});var sf=l(V=>{"use strict";var DO=V&&V.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ur=V&&V.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&DO(e,r,t)};Object.defineProperty(V,"__esModule",{value:!0});V.createExportLogsServiceRequest=V.createExportMetricsServiceRequest=V.createExportTraceServiceRequest=void 0;ur(jh(),V);ur(Br(),V);ur(kh(),V);ur(Xh(),V);ur(Wh(),V);ur(zh(),V);var UO=vs();Object.defineProperty(V,"createExportTraceServiceRequest",{enumerable:!0,get:function(){return UO.createExportTraceServiceRequest}});var BO=tf();Object.defineProperty(V,"createExportMetricsServiceRequest",{enumerable:!0,get:function(){return BO.createExportMetricsServiceRequest}});var qO=nf();Object.defineProperty(V,"createExportLogsServiceRequest",{enumerable:!0,get:function(){return qO.createExportLogsServiceRequest}})});var C=Y(da(),1);h();Ea();var lf=Y(Hd(),1),lr=Y(rt(),1),df=Y(n_(),1),_f=Y(xu(),1),Hs=Y(Qr(),1),pf=Y(lp(),1),He=Y(A(),1);var dp="http.method",_p="http.url",Os="http.host",pp="http.scheme",Bu="http.status_code",hp="http.user_agent",qu="http.response_content_length_uncompressed",fp="net.peer.port",Ep="net.peer.name";var mp="service.name",gp="service.version";h();var AA=Symbol.for("@vercel/request-context");function se(){return globalThis[AA]?.get()}function Rs(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function Tp(r){return r?r.split("::").at(-1):void 0}function Sp(r=se(),e){if(!r)return;let t=e?RA(e,r.headers):void 0;return Rs({[Os]:r.headers.host,[hp]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":Tp(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":process.env.VERCEL_REGION,...t})}var OA={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function RA(r,e){if(typeof r=="function")return r(e,OA);let t={};for(let[n,i]of Object.entries(r)){let s=e[i.toLocaleLowerCase()];s!==void 0&&(t[n]=s)}return t}h();function er(r){return(r&d.TraceFlags.SAMPLED)!==0}var bs=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:s}=e.spanContext(),o=!e.parentSpanId||!this.rootSpanIds.has(n);if(o?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),o&&er(s)){let a=se(),u=Sp(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let c=new Promise(p=>{this.waitSpanEnd.set(n,p)}),_;await Promise.race([c,new Promise(p=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),p(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),s=er(i),o=this.rootSpanIds.get(t),a=o?.rootSpanId===n;if(s){let u=PA(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),o.open.length>0){for(let u of o.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(c){d.diag.error("@vercel/otel: onEnd failed:",c)}}}else if(o)for(let u=0;u<o.open.length;u++)o.open[u]?.spanContext().spanId===n&&o.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},bA={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function PA(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resource.name":i,"span.type":s,"next.span_type":o,"http.method":a,"http.route":u}=t;if(n)return;let c=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":c};let _=r.instrumentationLibrary.name,p=o??s;if(p&&typeof p=="string"){let f=Ap(_,p);return u?{"operation.name":f,"resource.name":c}:{"operation.name":f}}return{"operation.name":Ap(_,e===d.SpanKind.INTERNAL?"":bA[e])}}function Ap(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var Dp=Y(vs(),1);var xp=Y(wp(),1);h();var tr=class extends xp.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),s,o,a;try{({body:s,contentType:o,headers:a}=this.toMessage(i))}catch(c){d.diag.warn("@vercel/otel/otlp: no proto",c);return}let u=fetch(this.url,{method:"POST",body:s,headers:{...this._headers,...a,"Content-Type":o,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(c=>{d.diag.debug("@vercel/otel/otlp: onSuccess",c.status,c.statusText),t(),c.arrayBuffer().catch(()=>{})}).catch(c=>{d.diag.error("@vercel/otel/otlp: onError",c),n(c)}).finally(()=>{let c=this._sendingPromises.indexOf(u);this._sendingPromises.splice(c,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var XA="v1/traces",WA=`http://localhost:4318/${XA}`;function Ls(r){return typeof r.url=="string"?r.url:WA}var rr=class{constructor(e={}){this.impl=new Ku(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Ku=class extends tr{convert(e){return(0,Dp.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Ls(e)}};var Uh=Y(vs(),1);var wh=Y(Ch(),1);function xh(r){let e=new wh.Writer;return nO(r,e),e.finish()}function nO(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)iO(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function iO(r,e){if(r.resource!=null&&sO(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)oO(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function sO(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function oO(r,e){if(r.scope!=null&&cO(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)lO(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function ir(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&Dh(r.value,e.uint32(18).fork()).ldelim(),e}function Dh(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&aO(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&uO(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function aO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)Dh(r.values[t],e.uint32(10).fork()).ldelim();return e}function uO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)ir(r.values[t],e.uint32(10).fork()).ldelim();return e}function cO(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function lO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)_O(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)pO(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&dO(r.status,e.uint32(122).fork()).ldelim(),e}function dO(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function _O(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function pO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var dt=class{constructor(e={}){this.impl=new uc(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},uc=class extends tr{convert(e){return(0,Uh.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:xh(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Ls(e)}};h();function Bh(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var sr=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}shouldIgnore(e,t){let n=this.config.ignoreUrls??[];if(t?.opentelemetry?.ignore!==void 0)return t.opentelemetry.ignore;if(n.length===0)return!1;let i=e.toString();return n.some(s=>typeof s=="string"?s==="*"?!0:i.startsWith(s):s.test(i))}shouldPropagate(e,t){let n=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,i=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,s=this.config.propagateContextUrls??[],o=this.config.dontPropagateContextUrls??[];if(t?.opentelemetry?.propagateContext)return t.opentelemetry.propagateContext;let a=e.toString();return o.length>0&&o.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))?!1:n&&e.protocol==="https:"&&(e.host===n||e.host===i||e.host===se()?.headers.host)||!n&&e.protocol==="http:"&&e.hostname==="localhost"?!0:s.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))}startSpan({tracer:e,url:t,fetchType:n,method:i="GET",name:s,attributes:o={}}){let a=this.config.resourceNameTemplate,u={[dp]:i,[_p]:t.toString(),[Os]:t.host,[pp]:t.protocol.replace(":",""),[Ep]:t.hostname,[fp]:t.port},c=a?Bh(a,u):EO(t.toString()),_=s??`${n} ${i} ${t.toString()}`,p=d.context.active();return e.startSpan(_,{kind:d.SpanKind.CLIENT,attributes:{...u,"operation.name":`${n}.${i}`,"http.client.name":n,"resource.name":c,...o}},p)}instrumentHttp(e,t){let{tracerProvider:n}=this;if(!n)return;let i=n.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:s,attributesFromResponseHeaders:o}=this.config,a=e.request,u=e.get,c=_=>(p,f,L)=>{let R,w={},U;if(typeof p=="string"||p instanceof URL?(R=new URL(p.toString()),typeof f=="function"?U=f:f&&typeof L=="function"?(w=f,U=L):f&&(w=f)):(w=p,typeof f=="function"&&(U=f),R=gO(w,t)),this.shouldIgnore(R))return _.apply(this,[R,w,U]);let S=this.startSpan({tracer:i,url:R,fetchType:"http",method:w.method||"GET"});if(!S.isRecording()||!er(S.spanContext().traceFlags))return S.end(),_.apply(this,[R,w,U]);if(this.shouldPropagate(R)){let Te=d.context.active(),Se=d.trace.setSpan(Te,S);d.propagation.inject(Se,w.headers||{},fO)}s&&xs(S,s,w.headers||{},Gh);try{let Te=Date.now(),Se=_.apply(this,[R,w,U]);return Se.prependListener("response",K=>{let pt=Date.now()-Te;S.setAttribute("http.response_time",pt),K.statusCode!==void 0?(S.setAttribute(Bu,K.statusCode),K.statusCode>=500&&_t(S,`Status: ${K.statusCode}`)):_t(S,"Response status code is undefined"),o&&xs(S,o,K.headers,Gh),Se.listenerCount("response")<=1&&K.resume(),K.on("end",()=>{let $r,js=K.statusCode;K.aborted&&!K.complete?$r={code:d.SpanStatusCode.ERROR}:js&&js>=100&&js<500?$r={code:d.SpanStatusCode.UNSET}:$r={code:d.SpanStatusCode.ERROR},S.setStatus($r),S.isRecording()&&(K.headers["content-length"]&&S.setAttribute(qu,K.headers["content-length"]),S.end())})}),Se.on("error",K=>{S.isRecording()&&(_t(S,K),S.end())}),Se.on("close",()=>{S.isRecording()&&S.end()}),Se}catch(Te){throw _t(S,Te),S.end(),Te}};e.request=c(a),e.get=c(u)}instrumentFetch(){let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:n,attributesFromResponseHeaders:i}=this.config;process.env.NEXT_OTEL_FETCH_DISABLED="1";let s=globalThis.fetch;this.originalFetch=s;let o=async(a,u)=>{let c=u;if(c?.next?.internal)return s(a,c);let _=new Request(a instanceof Request?a.clone():a,c),p=new URL(_.url);if(this.shouldIgnore(p,c))return s(a,c);let f=this.startSpan({tracer:t,url:p,fetchType:"fetch",method:_.method,name:c?.opentelemetry?.spanName,attributes:c?.opentelemetry?.attributes});if(!f.isRecording()||!er(f.spanContext().traceFlags))return f.end(),s(a,c);if(this.shouldPropagate(p,c)){let L=d.context.active(),R=d.trace.setSpan(L,f);d.propagation.inject(R,_.headers,hO)}n&&xs(f,n,_.headers,qh);try{let L=Date.now();c?.body&&c.body instanceof FormData&&_.headers.delete("content-type");let R=await s(a,{...c,headers:_.headers}),w=Date.now()-L;return f.setAttribute(Bu,R.status),f.setAttribute("http.response_time",w),i&&xs(f,i,R.headers,qh),R.status>=500&&_t(f,`Status: ${R.status} (${R.statusText})`),R.body?mO(R).then(U=>{f.isRecording()&&(f.setAttribute(qu,U),f.end())},U=>{f.isRecording()&&(_t(f,U),f.end())}):f.end(),R}catch(L){throw _t(f,L),f.end(),L}};globalThis.fetch=o}enable(){this.disable(),this.instrumentFetch();try{let e=z("node:http"),t=z("node:https");this.instrumentHttp(e,"http:"),this.instrumentHttp(t,"https:")}catch{}}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},hO={set(r,e,t){r.set(e,t)}},qh={get(r,e){let t=r.get(e);if(t!==null)return t.includes(",")?t.split(",").map(n=>n.trimStart()):t},keys(r){let e=[];return r.forEach((t,n)=>{e.push(n)}),e}},fO={set(r,e,t){r[e.toLowerCase()]=t}},Gh={get(r,e){return r[e.toLowerCase()]},keys(r){return Object.keys(r)}};function EO(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function mO(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:s,value:o})=>{if(!s)return e+=o.byteLength,i()});return i().then(()=>e)}function _t(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function xs(r,e,t,n){for(let[i,s]of Object.entries(e)){let o=n.get(t,s);o!==void 0&&r.setAttribute(i,o)}}function gO(r,e){if(r.socketPath)throw new Error("Cannot construct a network URL: options.socketPath is specified, indicating a Unix domain socket.");let t=r.protocol??e;t&&!t.endsWith(":")&&(t+=":");let n=r.hostname,i=r.port??r.defaultPort;if(!n&&r.host){let c=r.host.split(":");n=c[0];let _=c[1];if(c.length>1&&_&&i===void 0){let p=parseInt(_,10);isNaN(p)||(i=p)}}n||(n="localhost");let s;if(i!==void 0&&i!==""){let c=parseInt(String(i),10);isNaN(c)?s=t==="https:"?443:80:s=c}else s=t==="https:"?443:80;let o=r.path||"/",a=`${t}//${n}:${s}`,u=new URL(o,a);if(r.auth){let c=r.auth.split(":");u.username=decodeURIComponent(c[0]||""),c.length>1&&(u.password=decodeURIComponent(c[1]||""))}return u}h();var Vh=Y(A(),1),TO="00",cc="traceparent",lc="tracestate",jr=class{fields(){return[cc,lc]}inject(e,t,n){let i=d.trace.getSpanContext(e);if(!i||(0,Vh.isTracingSuppressed)(e)||!(0,d.isSpanContextValid)(i))return;let s=`${TO}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||0).toString(16)}`;n.set(t,cc,s),i.traceState&&n.set(t,lc,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,cc);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=SO(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,lc);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=(0,d.createTraceState)(typeof u=="string"?u:void 0)}return d.trace.setSpanContext(e,o)}};function SO(r){let[e,t,n,i,s]=r.split("-");return!e||!t||!n||!i||e.length!==2||t.length!==32||n.length!==16||i.length!==2||e==="00"&&s?null:{traceId:t,spanId:n,traceFlags:parseInt(i,16)}}h();var Ds=class{fields(){return[]}inject(){}extract(e){let t=se();if(!t?.telemetry)return d.diag.warn("@vercel/otel: Vercel telemetry extension not found."),e;let{rootSpanContext:n}=t.telemetry;return n?(d.diag.debug("@vercel/otel: Extracted root SpanContext from Vercel request context.",n),d.trace.setSpanContext(e,{...n,isRemote:!0,traceFlags:n.traceFlags||d.TraceFlags.SAMPLED})):e}};h();var qs=Y(A(),1),of=Y(sf(),1);var Gs=class{export(e,t){let n=se();if(!n?.telemetry){d.diag.warn("@vercel/otel: no telemetry context found"),t({code:qs.ExportResultCode.SUCCESS,error:void 0});return}try{let i=(0,of.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1});n.telemetry.reportSpans(i),t({code:qs.ExportResultCode.SUCCESS,error:void 0})}catch(i){t({code:qs.ExportResultCode.FAILED,error:i instanceof Error?i:new Error(String(i))})}}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};h();function _c(){return!!se()?.telemetry?.traceDrains?.length}var af=!1,kr=class{constructor(e){this.processor=e}forceFlush(){return this.processor.forceFlush()}shutdown(){return this.processor.shutdown()}onStart(e,t){if(_c()){af||(af=!0,d.diag.debug("@vercel/otel: skipping automatic exporter due to configured trace drains"));return}this.processor.onStart(e,t)}onEnd(e){_c()||this.processor.onEnd(e)}};var GO={ALL:d.DiagLogLevel.ALL,VERBOSE:d.DiagLogLevel.VERBOSE,DEBUG:d.DiagLogLevel.DEBUG,INFO:d.DiagLogLevel.INFO,WARN:d.DiagLogLevel.WARN,ERROR:d.DiagLogLevel.ERROR,NONE:d.DiagLogLevel.NONE},Vs=class{constructor(e={}){this.configuration=e}start(){let e=VO(),t=this.configuration,n=process.env.NEXT_RUNTIME||"nodejs",i=!!e.OTEL_SDK_DISABLED;if(process.env.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:GO[process.env.OTEL_LOG_LEVEL.toUpperCase()]}),i)return;let s=t.idGenerator??new C.RandomIdGenerator,o=t.contextManager??new pf.AsyncLocalStorageContextManager;o.enable(),this.contextManager=o;let a=e.OTEL_SERVICE_NAME||t.serviceName||"app",u=new lr.Resource(Rs({[mp]:a,"node.ci":process.env.CI?!0:void 0,"node.env":process.env.NODE_ENV,env:process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,"vercel.region":process.env.VERCEL_REGION,"vercel.runtime":n,"vercel.sha":process.env.VERCEL_GIT_COMMIT_SHA||process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,"vercel.host":process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||void 0,"vercel.branch_host":process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,"vercel.deployment_id":process.env.VERCEL_DEPLOYMENT_ID||void 0,[gp]:process.env.VERCEL_DEPLOYMENT_ID,"vercel.project_id":process.env.VERCEL_PROJECT_ID||void 0,...t.attributes})),c=t.resourceDetectors??[lr.envDetectorSync];if(t.autoDetectResources??!0){let S={detectors:c};u=u.merge((0,lr.detectResourcesSync)(S))}let p=jO(t.propagators,t,e),f=FO(t.traceSampler,e),L=kO(t.spanProcessors,t,e);L.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let R=t.spanLimits,w=new C.BasicTracerProvider({resource:u,idGenerator:s,sampler:f,spanLimits:R});if(w.addSpanProcessor(new bs(L,t.attributesFromHeaders)),w.register({contextManager:o,propagator:new He.CompositePropagator({propagators:p})}),this.tracerProvider=w,t.logRecordProcessor){let S=new df.LoggerProvider({resource:u});this.loggerProvider=S,S.addLogRecordProcessor(t.logRecordProcessor),st.logs.setGlobalLoggerProvider(S)}if(t.metricReader||t.views){let S=new _f.MeterProvider({resource:u,views:t.views??[]});t.metricReader&&S.addMetricReader(t.metricReader),d.metrics.setGlobalMeterProvider(S),this.meterProvider=S}let U=HO(t.instrumentations,t.instrumentationConfig);this.disableInstrumentations=(0,lf.registerInstrumentations)({instrumentations:U}),d.diag.info("@vercel/otel: started",a,n)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function VO(){let r=(0,Hs.parseEnvironment)(process.env);return{...Hs.DEFAULT_ENVIRONMENT,...r}}function HO(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new sr(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new sr(e?.fetch)):t).flat()}function jO(r,e,t){let n=process.env.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS.length>0?t.OTEL_PROPAGATORS:void 0;return(r??n??["auto"]).map(i=>{if(i==="none")return[];if(i==="auto"){let s=[];return s.push({name:"tracecontext",propagator:new jr}),s.push({name:"baggage",propagator:new He.W3CBaggagePropagator}),s.push({name:"vercel-runtime",propagator:new Ds}),d.diag.debug(`@vercel/otel: Configure propagators: ${s.map(o=>o.name).join(", ")}`),s.map(o=>o.propagator)}if(i==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new jr;if(i==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new He.W3CBaggagePropagator;if(typeof i=="string")throw new Error(`Unknown propagator: "${i}"`);return i}).flat()}var uf="always_on",cr=1;function FO(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||uf;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new C.AlwaysOnSampler;case"always_off":return new C.AlwaysOffSampler;case"parentbased_always_on":return new C.ParentBasedSampler({root:new C.AlwaysOnSampler});case"parentbased_always_off":return new C.ParentBasedSampler({root:new C.AlwaysOffSampler});case"traceidratio":return new C.TraceIdRatioBasedSampler(cf(e));case"parentbased_traceidratio":return new C.ParentBasedSampler({root:new C.TraceIdRatioBasedSampler(cf(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${uf}".`),new C.AlwaysOnSampler}}function cf(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${cr}.`),cr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${cr}.`),cr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${cr}.`),cr):e}function kO(r,e,t){return[...(r??["auto"]).flatMap(n=>{if(n==="auto"){let i=[new C.BatchSpanProcessor(new Gs)];if(process.env.VERCEL_OTEL_ENDPOINTS){let s=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",o=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",s,o);let a={url:`http://localhost:${s}/v1/traces`,headers:{}},u=o==="http/protobuf"?new dt(a):new rr(a);i.push(new kr(new C.BatchSpanProcessor(u)))}else(!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT)&&i.push(new kr(new C.BatchSpanProcessor($O(t))));return i}return n}).filter(KO),...e.traceExporter&&e.traceExporter!=="auto"?[new C.BatchSpanProcessor(e.traceExporter)]:[]]}function $O(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=WO(r),n={...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new rr({url:t,headers:n});case"http/protobuf":return new dt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new dt}}var hf="v1/traces",XO=`http://localhost:4318/${hf}`;function WO(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${hf}`:XO}function KO(r){return r!=null}function Fv(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new Vs(e).start()}export{sr as FetchInstrumentation,rr as OTLPHttpJsonTraceExporter,dt as OTLPHttpProtoTraceExporter,Fv as registerOTel};
20
+ `,(0,ss.getConflictResolutionRecipe)(s,e))}return n}};os.MetricStorageRegistry=fu});var $_=l(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MultiMetricStorage=void 0;var Eu=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(s=>{s.record(e,t,n,i)})}};as.MultiMetricStorage=Eu});var W_=l(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.BatchObservableResultImpl=Zt.ObservableResultImpl=void 0;var Qt=(h(),m(d)),X_=wr(),jS=Zi(),mu=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new X_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Qt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Qt.ValueType.INT&&!Number.isInteger(e)&&(Qt.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(t,e)}};Zt.ObservableResultImpl=mu;var gu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,jS.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new X_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Qt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Qt.ValueType.INT&&!Number.isInteger(t)&&(Qt.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||i.set(n,t)}};Zt.BatchObservableResultImpl=gu});var Y_=l(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.ObservableRegistry=void 0;var FS=(h(),m(d)),K_=Zi(),z_=W_(),xr=Ee(),Tu=class{constructor(){this._callbacks=[],this._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,t){let n=new Set(t.filter(K_.isObservableInstrument));if(n.size===0){FS.diag.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(K_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,xr.PromiseAllSettled)([...n,...i])).filter(xr.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new z_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new z_.BatchObservableResultImpl,o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i.forEach(a=>{let u=s._buffer.get(a);u!=null&&a._metricStorages.forEach(c=>{c.record(u,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,xr.setEquals)(n.instruments,t))}};us.ObservableRegistry=Tu});var Q_=l(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.SyncMetricStorage=void 0;var kS=au(),$S=du(),XS=pu(),Su=class extends kS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new $S.DeltaMetricProcessor(t),this._temporalMetricStorage=new XS.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};cs.SyncMetricStorage=Su});var Ou=l(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.FilteringAttributesProcessor=we.NoopAttributesProcessor=we.AttributesProcessor=void 0;var Dr=class{static Noop(){return WS}};we.AttributesProcessor=Dr;var ls=class extends Dr{process(e,t){return e}};we.NoopAttributesProcessor=ls;var Au=class extends Dr{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};we.FilteringAttributesProcessor=Au;var WS=new ls});var Z_=l(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.MeterSharedState=void 0;var KS=be(),zS=U_(),YS=Ee(),QS=B_(),ZS=k_(),JS=$_(),eA=Y_(),tA=Q_(),rA=Ou(),Ru=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new ZS.MetricStorageRegistry,this.observableRegistry=new eA.ObservableRegistry,this.meter=new zS.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,tA.SyncMetricStorage);return t.length===1?t[0]:new JS.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,QS.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=s.map(a=>a.collect(e,t)).filter(YS.isNotNullish);return o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=(0,KS.createInstrumentDescriptorWithView)(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let u=s.aggregation.createAggregator(o),c=new t(o,u,s.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(c),c});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(c!=null)return c;let _=u.createAggregator(e),p=new t(e,_,rA.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,p),p});i=i.concat(o)}return i}};ds.MeterSharedState=Ru});var J_=l(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.MeterProviderSharedState=void 0;var nA=Ee(),iA=D_(),sA=Z_(),bu=class{constructor(e){this.resource=e,this.viewRegistry=new iA.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,nA.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new sA.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};_s.MeterProviderSharedState=bu});var ep=l(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.MetricCollector=void 0;var oA=A(),Pu=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,oA.millisToHrTime)(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};ps.MetricCollector=Pu});var rp=l(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.MeterProvider=void 0;var hs=(h(),m(d)),tp=rt(),aA=J_(),uA=ep(),yu=class{constructor(e){var t;this._shutdown=!1;let n=tp.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:tp.Resource.empty());if(this._sharedState=new aA.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(hs.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,hs.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new uA.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){hs.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){hs.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};fs.MeterProvider=yu});var Es=l(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ExactPredicate=Jt.PatternPredicate=void 0;var cA=/[\^$\\.+?()[\]{}|]/g,vu=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(cA,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};Jt.PatternPredicate=vu;var Iu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};Jt.ExactPredicate=Iu});var ip=l(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.InstrumentSelector=void 0;var np=Es(),Mu=class{constructor(e){var t;this._nameFilter=new np.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new np.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};ms.InstrumentSelector=Mu});var sp=l(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.MeterSelector=void 0;var Lu=Es(),Nu=class{constructor(e){this._nameFilter=new Lu.ExactPredicate(e?.name),this._versionFilter=new Lu.ExactPredicate(e?.version),this._schemaUrlFilter=new Lu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};gs.MeterSelector=Nu});var ap=l(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.View=void 0;var lA=Es(),op=Ou(),dA=ip(),_A=sp(),pA=ki();function hA(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var Cu=class{constructor(e){var t;if(hA(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||lA.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new op.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=op.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:pA.Aggregation.Default(),this.instrumentSelector=new dA.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new _A.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};Ts.View=Cu});var wu=l(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var fA=Li();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return fA.AggregationTemporality}});var EA=wt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return EA.DataPointType}});var mA=Ka();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return mA.MetricReader}});var gA=L_();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return gA.PeriodicExportingMetricReader}});var TA=C_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return TA.InMemoryMetricExporter}});var SA=x_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return SA.ConsoleMetricExporter}});var AA=be();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return AA.InstrumentType}});var OA=rp();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return OA.MeterProvider}});var xe=ki();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return xe.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return xe.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return xe.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return xe.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return xe.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return xe.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return xe.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return xe.Aggregation}});var RA=ap();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return RA.View}});var bA=Ee();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return bA.TimeoutError}})});var up=l(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.AbstractAsyncHooksContextManager=void 0;var PA=z("events"),yA=["addListener","on","once","prependListener","prependOnceListener"],xu=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof PA.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...s){return n.with(e,()=>t.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),yA.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,s){var o;let a=(o=n._getPatchMap(e))===null||o===void 0?void 0:o[i];if(a===void 0)return t.call(this,i,s);let u=a.get(s);return t.call(this,i,u||s)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(s,o){if(i._wrapped)return t.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[s];u===void 0&&(u=new WeakMap,a[s]=u);let c=i.bind(n,o);u.set(o,c),i._wrapped=!0;try{return t.call(this,s,c)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Ss.AbstractAsyncHooksContextManager=xu});var cp=l(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.AsyncLocalStorageContextManager=void 0;var vA=(h(),m(d)),IA=z("async_hooks"),MA=up(),Du=class extends MA.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new IA.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:vA.ROOT_CONTEXT}with(e,t,n,...i){let s=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};As.AsyncLocalStorageContextManager=Du});var Ur=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.toAnyValue=De.toKeyValue=De.toAttributes=void 0;function DA(r){return Object.keys(r).map(e=>Vu(e,r[e]))}De.toAttributes=DA;function Vu(r,e){return{key:r,value:Gu(e)}}De.toKeyValue=Vu;function Gu(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(Gu)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Vu(t,n))}}:{}}De.toAnyValue=Gu});var wp=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.toOtlpSpanEvent=Ue.toOtlpLink=Ue.sdkSpanToOtlpSpan=void 0;var Hu=Ur();function UA(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,Hu.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(s=>Cp(s,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(s=>Np(s,e)),droppedLinksCount:r.droppedLinksCount}}Ue.sdkSpanToOtlpSpan=UA;function Np(r,e){var t;return{attributes:r.attributes?(0,Hu.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpLink=Np;function Cp(r,e){return{attributes:r.attributes?(0,Hu.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpSpanEvent=Cp});var Br=l(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.getOtlpEncoder=oe.encodeAsString=oe.encodeAsLongBits=oe.toLongBits=oe.hrTimeToNanos=void 0;var bs=A(),BA=BigInt(1e9);function ju(r){return BigInt(r[0])*BA+BigInt(r[1])}oe.hrTimeToNanos=ju;function Dp(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}oe.toLongBits=Dp;function Fu(r){let e=ju(r);return Dp(e)}oe.encodeAsLongBits=Fu;function Up(r){return ju(r).toString()}oe.encodeAsString=Up;var qA=typeof BigInt<"u"?Up:bs.hrTimeToNanoseconds;function xp(r){return r}function Bp(r){if(r!==void 0)return(0,bs.hexToBase64)(r)}var VA={encodeHrTime:Fu,encodeSpanContext:bs.hexToBase64,encodeOptionalSpanContext:Bp};function GA(r){var e,t;if(r===void 0)return VA;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?Fu:qA,encodeSpanContext:i?xp:bs.hexToBase64,encodeOptionalSpanContext:i?xp:Bp}}oe.getOtlpEncoder=GA});var ys=l(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.createExportTraceServiceRequest=void 0;var HA=Ur(),jA=wp(),FA=Br();function kA(r,e){let t=(0,FA.getOtlpEncoder)(e);return{resourceSpans:XA(r,t)}}Ps.createExportTraceServiceRequest=kA;function $A(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(t)}return e}function XA(r,e){let t=$A(r),n=[],i=t.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,u=[],c=a.values(),_=c.next();for(;!_.done;){let f=_.value;if(f.length>0){let{name:M,version:R,schemaUrl:w}=f[0].instrumentationLibrary,U=f.map(S=>(0,jA.sdkSpanToOtlpSpan)(S,e));u.push({scope:{name:M,version:R},spans:U,schemaUrl:w})}_=c.next()}let p={resource:{attributes:(0,HA.toAttributes)(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(p),s=i.next()}return n}});var Gp=l(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.parseRetryAfterToMills=N.isExportRetryable=N.invalidTimeout=N.configureExporterTimeout=N.appendRootPathToUrlIfNeeded=N.appendResourcePathToUrl=N.parseHeaders=N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=N.DEFAULT_EXPORT_MAX_BACKOFF=N.DEFAULT_EXPORT_INITIAL_BACKOFF=N.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var ku=(h(),m(d)),qp=A(),Vp=1e4;N.DEFAULT_EXPORT_MAX_ATTEMPTS=5;N.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;N.DEFAULT_EXPORT_MAX_BACKOFF=5e3;N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function WA(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):ku.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}N.parseHeaders=WA;function KA(r,e){return r.endsWith("/")||(r=r+"/"),r+e}N.appendResourcePathToUrl=KA;function zA(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return ku.diag.warn(`Could not parse export URL: '${r}'`),r}}N.appendRootPathToUrlIfNeeded=zA;function YA(r){return typeof r=="number"?r<=0?$u(r,Vp):r:QA()}N.configureExporterTimeout=YA;function QA(){var r;let e=Number((r=(0,qp.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,qp.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?$u(e,Vp):e}function $u(r,e){return ku.diag.warn("Timeout must be greater than 0",r),e}N.invalidTimeout=$u;function ZA(r){return[429,502,503,504].includes(r)}N.isExportRetryable=ZA;function JA(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}N.parseRetryAfterToMills=JA});var jp=l(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.OTLPExporterBase=void 0;var Hp=(h(),m(d)),qr=A(),eO=Gp(),Xu=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new qr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,eO.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:qr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:qr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:qr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:qr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{Hp.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return Hp.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};vs.OTLPExporterBase=Xu});var Xp=l((ky,$p)=>{"use strict";$p.exports=nO;function nO(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(s)if(s=!1,_)u(_);else{for(var p=new Array(arguments.length-1),f=0;f<p.length;)p[f++]=arguments[f];a.apply(null,p)}};try{r.apply(e||null,t)}catch(c){s&&(s=!1,u(c))}})}});var Yp=l(zp=>{"use strict";var Ms=zp;Ms.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};var nr=new Array(64),Kp=new Array(123);for(le=0;le<64;)Kp[nr[le]=le<26?le+65:le<52?le+71:le<62?le-4:le-59|43]=le++;var le;Ms.encode=function(e,t,n){for(var i=null,s=[],o=0,a=0,u;t<n;){var c=e[t++];switch(a){case 0:s[o++]=nr[c>>2],u=(c&3)<<4,a=1;break;case 1:s[o++]=nr[u|c>>4],u=(c&15)<<2,a=2;break;case 2:s[o++]=nr[u|c>>6],s[o++]=nr[c&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=nr[u],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var Wp="invalid encoding";Ms.decode=function(e,t,n){for(var i=n,s=0,o,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&s>1)break;if((u=Kp[u])===void 0)throw Error(Wp);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(u&48)>>4,o=u,s=2;break;case 2:t[n++]=(o&15)<<4|(u&60)>>2,o=u,s=3;break;case 3:t[n++]=(o&3)<<6|u,s=0;break}}if(s===1)throw Error(Wp);return n-i};Ms.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Zp=l((Xy,Qp)=>{"use strict";Qp.exports=Ls;function Ls(){this._listeners={}}Ls.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};Ls.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};Ls.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var sh=l((Wy,ih)=>{"use strict";ih.exports=Jp(Jp);function Jp(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3]}function s(u,c,_){e[0]=u,c[_]=t[3],c[_+1]=t[2],c[_+2]=t[1],c[_+3]=t[0]}r.writeFloatLE=n?i:s,r.writeFloatBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],e[0]}function a(u,c){return t[3]=u[c],t[2]=u[c+1],t[1]=u[c+2],t[0]=u[c+3],e[0]}r.readFloatLE=n?o:a,r.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var u=Math.floor(Math.log(i)/Math.LN2),c=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|c)>>>0,s,o)}}r.writeFloatLE=e.bind(null,eh),r.writeFloatBE=e.bind(null,th);function t(n,i,s){var o=n(i,s),a=(o>>31)*2+1,u=o>>>23&255,c=o&8388607;return u===255?c?NaN:a*(1/0):u===0?a*1401298464324817e-60*c:a*Math.pow(2,u-150)*(c+8388608)}r.readFloatLE=t.bind(null,rh),r.readFloatBE=t.bind(null,nh)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3],c[_+4]=t[4],c[_+5]=t[5],c[_+6]=t[6],c[_+7]=t[7]}function s(u,c,_){e[0]=u,c[_]=t[7],c[_+1]=t[6],c[_+2]=t[5],c[_+3]=t[4],c[_+4]=t[3],c[_+5]=t[2],c[_+6]=t[1],c[_+7]=t[0]}r.writeDoubleLE=n?i:s,r.writeDoubleBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],t[4]=u[c+4],t[5]=u[c+5],t[6]=u[c+6],t[7]=u[c+7],e[0]}function a(u,c){return t[7]=u[c],t[6]=u[c+1],t[5]=u[c+2],t[4]=u[c+3],t[3]=u[c+4],t[2]=u[c+5],t[1]=u[c+6],t[0]=u[c+7],e[0]}r.readDoubleLE=n?o:a,r.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,u){var c=o<0?1:0;if(c&&(o=-o),o===0)n(0,a,u+i),n(1/o>0?0:2147483648,a,u+s);else if(isNaN(o))n(0,a,u+i),n(2146959360,a,u+s);else if(o>17976931348623157e292)n(0,a,u+i),n((c<<31|2146435072)>>>0,a,u+s);else{var _;if(o<22250738585072014e-324)_=o/5e-324,n(_>>>0,a,u+i),n((c<<31|_/4294967296)>>>0,a,u+s);else{var p=Math.floor(Math.log(o)/Math.LN2);p===1024&&(p=1023),_=o*Math.pow(2,-p),n(_*4503599627370496>>>0,a,u+i),n((c<<31|p+1023<<20|_*1048576&1048575)>>>0,a,u+s)}}}r.writeDoubleLE=e.bind(null,eh,0,4),r.writeDoubleBE=e.bind(null,th,4,0);function t(n,i,s,o,a){var u=n(o,a+i),c=n(o,a+s),_=(c>>31)*2+1,p=c>>>20&2047,f=4294967296*(c&1048575)+u;return p===2047?f?NaN:_*(1/0):p===0?_*5e-324*f:_*Math.pow(2,p-1075)*(f+4503599627370496)}r.readDoubleLE=t.bind(null,rh,0,4),r.readDoubleBE=t.bind(null,nh,4,0)}(),r}function eh(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function th(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function rh(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function nh(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var oh=l((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var uh=l(ah=>{"use strict";var Ku=ah;Ku.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};Ku.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var s=null,o=[],a=0,u;t<n;)u=e[t++],u<128?o[a++]=u:u>191&&u<224?o[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[a++]=55296+(u>>10),o[a++]=56320+(u&1023)):o[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};Ku.write=function(e,t,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128);return n-i}});var lh=l((zy,ch)=>{"use strict";ch.exports=iO;function iO(r,e,t){var n=t||8192,i=n>>>1,s=null,o=n;return function(u){if(u<1||u>i)return r(u);o+u>n&&(s=r(n),o=0);var c=e.call(s,o,o+=u);return o&7&&(o=(o|7)+1),c}}});var _h=l((Yy,dh)=>{"use strict";dh.exports=V;var Vr=qe();function V(r,e){this.lo=r>>>0,this.hi=e>>>0}var ct=V.zero=new V(0,0);ct.toNumber=function(){return 0};ct.zzEncode=ct.zzDecode=function(){return this};ct.length=function(){return 1};var sO=V.zeroHash="\0\0\0\0\0\0\0\0";V.fromNumber=function(e){if(e===0)return ct;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new V(n,i)};V.from=function(e){if(typeof e=="number")return V.fromNumber(e);if(Vr.isString(e))if(Vr.Long)e=Vr.Long.fromString(e);else return V.fromNumber(parseInt(e,10));return e.low||e.high?new V(e.low>>>0,e.high>>>0):ct};V.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};V.prototype.toLong=function(e){return Vr.Long?new Vr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Be=String.prototype.charCodeAt;V.fromHash=function(e){return e===sO?ct:new V((Be.call(e,0)|Be.call(e,1)<<8|Be.call(e,2)<<16|Be.call(e,3)<<24)>>>0,(Be.call(e,4)|Be.call(e,5)<<8|Be.call(e,6)<<16|Be.call(e,7)<<24)>>>0)};V.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)};V.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};V.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};V.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}});var qe=l(zu=>{"use strict";var E=zu;E.asPromise=Xp();E.base64=Yp();E.EventEmitter=Zp();E.float=sh();E.inquire=oh();E.utf8=uh();E.pool=lh();E.LongBits=_h();E.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);E.global=E.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||zu;E.emptyArray=Object.freeze?Object.freeze([]):[];E.emptyObject=Object.freeze?Object.freeze({}):{};E.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};E.isString=function(e){return typeof e=="string"||e instanceof String};E.isObject=function(e){return e&&typeof e=="object"};E.isset=E.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};E.Buffer=function(){try{var r=E.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();E._Buffer_from=null;E._Buffer_allocUnsafe=null;E.newBuffer=function(e){return typeof e=="number"?E.Buffer?E._Buffer_allocUnsafe(e):new E.Array(e):E.Buffer?E._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};E.Array=typeof Uint8Array<"u"?Uint8Array:Array;E.Long=E.global.dcodeIO&&E.global.dcodeIO.Long||E.global.Long||E.inquire("long");E.key2Re=/^true|false|0|1$/;E.key32Re=/^-?(?:0|[1-9][0-9]*)$/;E.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;E.longToHash=function(e){return e?E.LongBits.from(e).toHash():E.LongBits.zeroHash};E.longFromHash=function(e,t){var n=E.LongBits.fromHash(e);return E.Long?E.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function ph(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}E.merge=ph;E.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function hh(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&ph(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}E.newError=hh;E.ProtocolError=hh("ProtocolError");E.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(t[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};E.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};E.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};E._configure=function(){var r=E.Buffer;if(!r){E._Buffer_from=E._Buffer_allocUnsafe=null;return}E._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},E._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var rc=l((Zy,gh)=>{"use strict";gh.exports=O;var ae=qe(),Yu,Ns=ae.LongBits,fh=ae.base64,Eh=ae.utf8;function Gr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Zu(){}function oO(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function O(){this.len=0,this.head=new Gr(Zu,0,0),this.tail=this.head,this.states=null}var mh=function(){return ae.Buffer?function(){return(O.create=function(){return new Yu})()}:function(){return new O}};O.create=mh();O.alloc=function(e){return new ae.Array(e)};ae.Array!==Array&&(O.alloc=ae.pool(O.alloc,ae.Array.prototype.subarray));O.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Gr(e,t,n),this.len+=t,this};function Ju(r,e,t){e[t]=r&255}function aO(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function ec(r,e){this.len=r,this.next=void 0,this.val=e}ec.prototype=Object.create(Gr.prototype);ec.prototype.fn=aO;O.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new ec((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};O.prototype.int32=function(e){return e<0?this._push(tc,10,Ns.fromNumber(e)):this.uint32(e)};O.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function tc(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}O.prototype.uint64=function(e){var t=Ns.from(e);return this._push(tc,t.length(),t)};O.prototype.int64=O.prototype.uint64;O.prototype.sint64=function(e){var t=Ns.from(e).zzEncode();return this._push(tc,t.length(),t)};O.prototype.bool=function(e){return this._push(Ju,1,e?1:0)};function Qu(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}O.prototype.fixed32=function(e){return this._push(Qu,4,e>>>0)};O.prototype.sfixed32=O.prototype.fixed32;O.prototype.fixed64=function(e){var t=Ns.from(e);return this._push(Qu,4,t.lo)._push(Qu,4,t.hi)};O.prototype.sfixed64=O.prototype.fixed64;O.prototype.float=function(e){return this._push(ae.float.writeFloatLE,4,e)};O.prototype.double=function(e){return this._push(ae.float.writeDoubleLE,8,e)};var uO=ae.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};O.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Ju,1,0);if(ae.isString(e)){var n=O.alloc(t=fh.length(e));fh.decode(e,n,0),e=n}return this.uint32(t)._push(uO,t,e)};O.prototype.string=function(e){var t=Eh.length(e);return t?this.uint32(t)._push(Eh.write,t,e):this._push(Ju,1,0)};O.prototype.fork=function(){return this.states=new oO(this),this.head=this.tail=new Gr(Zu,0,0),this.len=0,this};O.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 Gr(Zu,0,0),this.len=0),this};O.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};O.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};O._configure=function(r){Yu=r,O.create=mh(),Yu._configure()}});var Ah=l((Jy,Sh)=>{"use strict";Sh.exports=ge;var Th=rc();(ge.prototype=Object.create(Th.prototype)).constructor=ge;var Ve=qe();function ge(){Th.call(this)}ge._configure=function(){ge.alloc=Ve._Buffer_allocUnsafe,ge.writeBytesBuffer=Ve.Buffer&&Ve.Buffer.prototype instanceof Uint8Array&&Ve.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 i=0;i<e.length;)t[n++]=e[i++]}};ge.prototype.bytes=function(e){Ve.isString(e)&&(e=Ve._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(ge.writeBytesBuffer,t,e),this};function cO(r,e,t){r.length<40?Ve.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}ge.prototype.string=function(e){var t=Ve.Buffer.byteLength(e);return this.uint32(t),t&&this._push(cO,t,e),this};ge._configure()});var sc=l((ev,yh)=>{"use strict";yh.exports=x;var de=qe(),ic,bh=de.LongBits,lO=de.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function x(r){this.buf=r,this.pos=0,this.len=r.length}var Oh=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new x(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new x(e);throw Error("illegal buffer")},Ph=function(){return de.Buffer?function(t){return(x.create=function(i){return de.Buffer.isBuffer(i)?new ic(i):Oh(i)})(t)}:Oh};x.create=Ph();x.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;x.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,_e(this,10);return e}}();x.prototype.int32=function(){return this.uint32()|0};x.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function nc(){var r=new bh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw _e(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw _e(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}x.prototype.bool=function(){return this.uint32()!==0};function Cs(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}x.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Cs(this.buf,this.pos+=4)};x.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Cs(this.buf,this.pos+=4)|0};function Rh(){if(this.pos+8>this.len)throw _e(this,8);return new bh(Cs(this.buf,this.pos+=4),Cs(this.buf,this.pos+=4))}x.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};x.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};x.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=de.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};x.prototype.string=function(){var e=this.bytes();return lO.read(e,0,e.length)};x.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};x.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};x._configure=function(r){ic=r,x.create=Ph(),ic._configure();var e=de.Long?"toLong":"toNumber";de.merge(x.prototype,{int64:function(){return nc.call(this)[e](!1)},uint64:function(){return nc.call(this)[e](!0)},sint64:function(){return nc.call(this).zzDecode()[e](!1)},fixed64:function(){return Rh.call(this)[e](!0)},sfixed64:function(){return Rh.call(this)[e](!1)}})}});var Lh=l((tv,Mh)=>{"use strict";Mh.exports=lt;var Ih=sc();(lt.prototype=Object.create(Ih.prototype)).constructor=lt;var vh=qe();function lt(r){Ih.call(this,r)}lt._configure=function(){vh.Buffer&&(lt.prototype._slice=vh.Buffer.prototype.slice)};lt.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))};lt._configure()});var Ch=l((rv,Nh)=>{"use strict";Nh.exports=Hr;var oc=qe();(Hr.prototype=Object.create(oc.EventEmitter.prototype)).constructor=Hr;function Hr(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");oc.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Hr.prototype.rpcCall=function r(e,t,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return oc.asPromise(r,o,e,t,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,c){if(u)return o.emit("error",u,e),s(u);if(c===null){o.end(!0);return}if(!(c instanceof n))try{c=n[o.responseDelimited?"decodeDelimited":"decode"](c)}catch(_){return o.emit("error",_,e),s(_)}return o.emit("data",c,e),s(null,c)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Hr.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var xh=l(wh=>{"use strict";var dO=wh;dO.Service=Ch()});var Uh=l((iv,Dh)=>{"use strict";Dh.exports={}});var Vh=l(qh=>{"use strict";var J=qh;J.build="minimal";J.Writer=rc();J.BufferWriter=Ah();J.Reader=sc();J.BufferReader=Lh();J.util=qe();J.rpc=xh();J.roots=Uh();J.configure=Bh;function Bh(){J.util._configure(),J.Writer._configure(J.BufferWriter),J.Reader._configure(J.BufferReader)}Bh()});var Hh=l((ov,Gh)=>{"use strict";Gh.exports=Vh()});var Qh=l(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0})});var Jh=l(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0})});var tf=l(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0})});var rf=l(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ESpanKind=void 0;var LO;(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(LO=Fr.ESpanKind||(Fr.ESpanKind={}))});var sf=l(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0})});var lf=l(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.toMetric=Ge.toScopeMetrics=Ge.toResourceMetrics=void 0;var of=(h(),m(d)),or=wu(),Ds=Ur(),NO=Br();function CO(r,e){let t=(0,NO.getOtlpEncoder)(e);return{resource:{attributes:(0,Ds.toAttributes)(r.resource.attributes),droppedAttributesCount:0},schemaUrl:void 0,scopeMetrics:uf(r.scopeMetrics,t)}}Ge.toResourceMetrics=CO;function uf(r,e){return Array.from(r.map(t=>({scope:{name:t.scope.name,version:t.scope.version},metrics:t.metrics.map(n=>cf(n,e)),schemaUrl:t.scope.schemaUrl})))}Ge.toScopeMetrics=uf;function cf(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},n=UO(r.aggregationTemporality);switch(r.dataPointType){case or.DataPointType.SUM:t.sum={aggregationTemporality:n,isMonotonic:r.isMonotonic,dataPoints:af(r,e)};break;case or.DataPointType.GAUGE:t.gauge={dataPoints:af(r,e)};break;case or.DataPointType.HISTOGRAM:t.histogram={aggregationTemporality:n,dataPoints:xO(r,e)};break;case or.DataPointType.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:n,dataPoints:DO(r,e)};break}return t}Ge.toMetric=cf;function wO(r,e,t){let n={attributes:(0,Ds.toAttributes)(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case of.ValueType.INT:n.asInt=r.value;break;case of.ValueType.DOUBLE:n.asDouble=r.value;break}return n}function af(r,e){return r.dataPoints.map(t=>wO(t,r.descriptor.valueType,e))}function xO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Ds.toAttributes)(t.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function DO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Ds.toAttributes)(t.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function UO(r){switch(r){case or.AggregationTemporality.DELTA:return 1;case or.AggregationTemporality.CUMULATIVE:return 2}}});var df=l(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.createExportMetricsServiceRequest=void 0;var BO=lf();function qO(r,e){return{resourceMetrics:r.map(t=>(0,BO.toResourceMetrics)(t,e))}}Us.createExportMetricsServiceRequest=qO});var pf=l(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.toLogAttributes=ar.createExportLogsServiceRequest=void 0;var VO=Br(),lc=Ur();function GO(r,e){let t=(0,VO.getOtlpEncoder)(e);return{resourceLogs:jO(r,t)}}ar.createExportLogsServiceRequest=GO;function HO(r){let e=new Map;for(let t of r){let{resource:n,instrumentationScope:{name:i,version:s="",schemaUrl:o=""}}=t,a=e.get(n);a||(a=new Map,e.set(n,a));let u=`${i}@${s}:${o}`,c=a.get(u);c||(c=[],a.set(u,c)),c.push(t)}return e}function jO(r,e){let t=HO(r);return Array.from(t,([n,i])=>({resource:{attributes:(0,lc.toAttributes)(n.attributes),droppedAttributesCount:0},scopeLogs:Array.from(i,([,s])=>{let{instrumentationScope:{name:o,version:a,schemaUrl:u}}=s[0];return{scope:{name:o,version:a},logRecords:s.map(c=>FO(c,e)),schemaUrl:u}}),schemaUrl:void 0}))}function FO(r,e){var t,n,i;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:(0,lc.toAnyValue)(r.body),attributes:_f(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((n=r.spanContext)===null||n===void 0?void 0:n.traceId),spanId:e.encodeOptionalSpanContext((i=r.spanContext)===null||i===void 0?void 0:i.spanId)}}function _f(r){return Object.keys(r).map(e=>(0,lc.toKeyValue)(e,r[e]))}ar.toLogAttributes=_f});var hf=l(G=>{"use strict";var kO=G&&G.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ur=G&&G.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kO(e,r,t)};Object.defineProperty(G,"__esModule",{value:!0});G.createExportLogsServiceRequest=G.createExportMetricsServiceRequest=G.createExportTraceServiceRequest=void 0;ur(Qh(),G);ur(Br(),G);ur(Jh(),G);ur(tf(),G);ur(rf(),G);ur(sf(),G);var $O=ys();Object.defineProperty(G,"createExportTraceServiceRequest",{enumerable:!0,get:function(){return $O.createExportTraceServiceRequest}});var XO=df();Object.defineProperty(G,"createExportMetricsServiceRequest",{enumerable:!0,get:function(){return XO.createExportMetricsServiceRequest}});var WO=pf();Object.defineProperty(G,"createExportLogsServiceRequest",{enumerable:!0,get:function(){return WO.createExportLogsServiceRequest}})});var C=Y(la(),1);h();fa();var Tf=Y(Gd(),1),lr=Y(rt(),1),Sf=Y(r_(),1),Af=Y(wu(),1),Gs=Y(Qr(),1),Of=Y(cp(),1),He=Y(A(),1);h();var LA=Symbol.for("@vercel/request-context");function se(){return globalThis[LA]?.get()}var lp="http.method",dp="http.url",Os="http.host",_p="http.scheme",Uu="http.status_code",pp="http.user_agent",Bu="http.response_content_length_uncompressed",hp="net.peer.port",fp="net.peer.name",Ep="cloud.region";var mp="deployment.environment.name",gp="deployment.id";var Tp="process.runtime.name",Sp="vcs.ref.head.name",Ap="vcs.ref.head.revision",Op="vcs.repository.name",Rp="vcs.repository.ref.revision";var bp="service.name",Pp="service.version";function qu(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function vp({attributes:r,env:e=process.env,runtime:t,serviceName:n}){let i=e.VERCEL_ENV||e.NEXT_PUBLIC_VERCEL_ENV,s=e.VERCEL_DEPLOYMENT_ID,o=e.VERCEL_GIT_COMMIT_SHA||e.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,a=e.VERCEL_REGION,u=e.VERCEL_GIT_COMMIT_REF,c=e.VERCEL_URL||e.NEXT_PUBLIC_VERCEL_URL||void 0,_=e.VERCEL_BRANCH_URL||e.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,p=e.VERCEL_GIT_REPO_SLUG;return qu({[bp]:n,"node.ci":e.CI?!0:void 0,"node.env":e.NODE_ENV,[mp]:i,env:i,[Ep]:a,"vercel.region":a,[Tp]:t,"vercel.runtime":t,[Sp]:u,[Ap]:o,[Op]:p,[Rp]:o,"vercel.sha":o,"vercel.host":c,"vercel.branch_host":_,[gp]:s,"vercel.deployment_id":s,[Pp]:s,"vercel.project_id":e.VERCEL_PROJECT_ID||void 0,...r})}function Ip(r){return r?r.split("::").at(-1):void 0}function Mp(r=se(),e){if(!r)return;let t=e?CA(e,r.headers):void 0;return qu({[Os]:r.headers.host,[pp]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":Ip(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":process.env.VERCEL_REGION,...t})}var NA={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function CA(r,e){if(typeof r=="function")return r(e,NA);let t={};for(let[n,i]of Object.entries(r)){let s=e[i.toLocaleLowerCase()];s!==void 0&&(t[n]=s)}return t}h();function er(r){return(r&d.TraceFlags.SAMPLED)!==0}var Rs=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:s}=e.spanContext(),o=!e.parentSpanId||!this.rootSpanIds.has(n);if(o?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),o&&er(s)){let a=se(),u=Mp(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let c=new Promise(p=>{this.waitSpanEnd.set(n,p)}),_;await Promise.race([c,new Promise(p=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),p(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),s=er(i),o=this.rootSpanIds.get(t),a=o?.rootSpanId===n;if(s){let u=xA(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),o.open.length>0){for(let u of o.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(c){d.diag.error("@vercel/otel: onEnd failed:",c)}}}else if(o)for(let u=0;u<o.open.length;u++)o.open[u]?.spanContext().spanId===n&&o.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},wA={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function xA(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resource.name":i,"span.type":s,"next.span_type":o,"http.method":a,"http.route":u}=t;if(n)return;let c=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":c};let _=r.instrumentationLibrary.name,p=o??s;if(p&&typeof p=="string"){let f=Lp(_,p);return u?{"operation.name":f,"resource.name":c}:{"operation.name":f}}return{"operation.name":Lp(_,e===d.SpanKind.INTERNAL?"":wA[e])}}function Lp(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var kp=Y(ys(),1);var Fp=Y(jp(),1);h();var tr=class extends Fp.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),s,o,a;try{({body:s,contentType:o,headers:a}=this.toMessage(i))}catch(c){d.diag.warn("@vercel/otel/otlp: no proto",c);return}let u=fetch(this.url,{method:"POST",body:s,headers:{...this._headers,...a,"Content-Type":o,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(c=>{d.diag.debug("@vercel/otel/otlp: onSuccess",c.status,c.statusText),t(),c.arrayBuffer().catch(()=>{})}).catch(c=>{d.diag.error("@vercel/otel/otlp: onError",c),n(c)}).finally(()=>{let c=this._sendingPromises.indexOf(u);this._sendingPromises.splice(c,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var tO="v1/traces",rO=`http://localhost:4318/${tO}`;function Is(r){return typeof r.url=="string"?r.url:rO}var rr=class{constructor(e={}){this.impl=new Wu(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Wu=class extends tr{convert(e){return(0,kp.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Is(e)}};var $h=Y(ys(),1);var jh=Y(Hh(),1);function Fh(r){let e=new jh.Writer;return _O(r,e),e.finish()}function _O(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)pO(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function pO(r,e){if(r.resource!=null&&hO(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)fO(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function hO(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function fO(r,e){if(r.scope!=null&&gO(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)TO(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function ir(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&kh(r.value,e.uint32(18).fork()).ldelim(),e}function kh(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&EO(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&mO(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function EO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)kh(r.values[t],e.uint32(10).fork()).ldelim();return e}function mO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)ir(r.values[t],e.uint32(10).fork()).ldelim();return e}function gO(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function TO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)AO(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)OO(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&SO(r.status,e.uint32(122).fork()).ldelim(),e}function SO(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function AO(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function OO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var dt=class{constructor(e={}){this.impl=new ac(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},ac=class extends tr{convert(e){return(0,$h.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:Fh(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Is(e)}};h();function Xh(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var sr=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}shouldIgnore(e,t){let n=this.config.ignoreUrls??[];if(t?.opentelemetry?.ignore!==void 0)return t.opentelemetry.ignore;if(n.length===0)return!1;let i=e.toString();return n.some(s=>typeof s=="string"?s==="*"?!0:i.startsWith(s):s.test(i))}shouldPropagate(e,t){let n=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,i=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,s=this.config.propagateContextUrls??[],o=this.config.dontPropagateContextUrls??[];if(t?.opentelemetry?.propagateContext)return t.opentelemetry.propagateContext;let a=e.toString();return o.length>0&&o.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))?!1:n&&e.protocol==="https:"&&(e.host===n||e.host===i||e.host===se()?.headers.host)||!n&&e.protocol==="http:"&&e.hostname==="localhost"?!0:s.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))}startSpan({tracer:e,url:t,fetchType:n,method:i="GET",name:s,attributes:o={}}){let a=this.config.resourceNameTemplate,u={[lp]:i,[dp]:t.toString(),[Os]:t.host,[_p]:t.protocol.replace(":",""),[fp]:t.hostname,[hp]:t.port},c=a?Xh(a,u):PO(t.toString()),_=s??`${n} ${i} ${t.toString()}`,p=d.context.active();return e.startSpan(_,{kind:d.SpanKind.CLIENT,attributes:{...u,"operation.name":`${n}.${i}`,"http.client.name":n,"resource.name":c,...o}},p)}instrumentHttp(e,t){let{tracerProvider:n}=this;if(!n)return;let i=n.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:s,attributesFromResponseHeaders:o}=this.config,a=e.request,u=e.get,c=_=>(p,f,M)=>{let R,w={},U;if(typeof p=="string"||p instanceof URL?(R=new URL(p.toString()),typeof f=="function"?U=f:f&&typeof M=="function"?(w=f,U=M):f&&(w=f)):(w=p,typeof f=="function"&&(U=f),R=vO(w,t)),this.shouldIgnore(R))return _.apply(this,[R,w,U]);let S=this.startSpan({tracer:i,url:R,fetchType:"http",method:w.method||"GET"});if(!S.isRecording()||!er(S.spanContext().traceFlags))return S.end(),_.apply(this,[R,w,U]);if(this.shouldPropagate(R)){let Te=d.context.active(),Se=d.trace.setSpan(Te,S);d.propagation.inject(Se,w.headers||{},bO)}s&&ws(S,s,w.headers||{},Kh);try{let Te=Date.now(),Se=_.apply(this,[R,w,U]);return Se.prependListener("response",K=>{let pt=Date.now()-Te;S.setAttribute("http.response_time",pt),K.statusCode!==void 0?(S.setAttribute(Uu,K.statusCode),K.statusCode>=500&&_t(S,`Status: ${K.statusCode}`)):_t(S,"Response status code is undefined"),o&&ws(S,o,K.headers,Kh),Se.listenerCount("response")<=1&&K.resume(),K.on("end",()=>{let $r,Hs=K.statusCode;K.aborted&&!K.complete?$r={code:d.SpanStatusCode.ERROR}:Hs&&Hs>=100&&Hs<500?$r={code:d.SpanStatusCode.UNSET}:$r={code:d.SpanStatusCode.ERROR},S.setStatus($r),S.isRecording()&&(K.headers["content-length"]&&S.setAttribute(Bu,K.headers["content-length"]),S.end())})}),Se.on("error",K=>{S.isRecording()&&(_t(S,K),S.end())}),Se.on("close",()=>{S.isRecording()&&S.end()}),Se}catch(Te){throw _t(S,Te),S.end(),Te}};e.request=c(a),e.get=c(u)}instrumentFetch(){let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:n,attributesFromResponseHeaders:i}=this.config;process.env.NEXT_OTEL_FETCH_DISABLED="1";let s=globalThis.fetch;this.originalFetch=s;let o=async(a,u)=>{let c=u;if(c?.next?.internal)return s(a,c);let _=new Request(a instanceof Request?a.clone():a,c),p=new URL(_.url);if(this.shouldIgnore(p,c))return s(a,c);let f=this.startSpan({tracer:t,url:p,fetchType:"fetch",method:_.method,name:c?.opentelemetry?.spanName,attributes:c?.opentelemetry?.attributes});if(!f.isRecording()||!er(f.spanContext().traceFlags))return f.end(),s(a,c);if(this.shouldPropagate(p,c)){let M=d.context.active(),R=d.trace.setSpan(M,f);d.propagation.inject(R,_.headers,RO)}n&&ws(f,n,_.headers,Wh);try{let M=Date.now();c?.body&&c.body instanceof FormData&&_.headers.delete("content-type");let R=await s(a,{...c,headers:_.headers}),w=Date.now()-M;return f.setAttribute(Uu,R.status),f.setAttribute("http.response_time",w),i&&ws(f,i,R.headers,Wh),R.status>=500&&_t(f,`Status: ${R.status} (${R.statusText})`),R.body?yO(R).then(U=>{f.isRecording()&&(f.setAttribute(Bu,U),f.end())},U=>{f.isRecording()&&(_t(f,U),f.end())}):f.end(),R}catch(M){throw _t(f,M),f.end(),M}};globalThis.fetch=o}enable(){this.disable(),this.instrumentFetch();try{let e=z("node:http"),t=z("node:https");this.instrumentHttp(e,"http:"),this.instrumentHttp(t,"https:")}catch{}}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},RO={set(r,e,t){r.set(e,t)}},Wh={get(r,e){let t=r.get(e);if(t!==null)return t.includes(",")?t.split(",").map(n=>n.trimStart()):t},keys(r){let e=[];return r.forEach((t,n)=>{e.push(n)}),e}},bO={set(r,e,t){r[e.toLowerCase()]=t}},Kh={get(r,e){return r[e.toLowerCase()]},keys(r){return Object.keys(r)}};function PO(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function yO(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:s,value:o})=>{if(!s)return e+=o.byteLength,i()});return i().then(()=>e)}function _t(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function ws(r,e,t,n){for(let[i,s]of Object.entries(e)){let o=n.get(t,s);o!==void 0&&r.setAttribute(i,o)}}function vO(r,e){if(r.socketPath)throw new Error("Cannot construct a network URL: options.socketPath is specified, indicating a Unix domain socket.");let t=r.protocol??e;t&&!t.endsWith(":")&&(t+=":");let n=r.hostname,i=r.port??r.defaultPort;if(!n&&r.host){let c=r.host.split(":");n=c[0];let _=c[1];if(c.length>1&&_&&i===void 0){let p=parseInt(_,10);isNaN(p)||(i=p)}}n||(n="localhost");let s;if(i!==void 0&&i!==""){let c=parseInt(String(i),10);isNaN(c)?s=t==="https:"?443:80:s=c}else s=t==="https:"?443:80;let o=r.path||"/",a=`${t}//${n}:${s}`,u=new URL(o,a);if(r.auth){let c=r.auth.split(":");u.username=decodeURIComponent(c[0]||""),c.length>1&&(u.password=decodeURIComponent(c[1]||""))}return u}h();var zh=Y(A(),1),IO="00",uc="traceparent",cc="tracestate",jr=class{fields(){return[uc,cc]}inject(e,t,n){let i=d.trace.getSpanContext(e);if(!i||(0,zh.isTracingSuppressed)(e)||!(0,d.isSpanContextValid)(i))return;let s=`${IO}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||0).toString(16)}`;n.set(t,uc,s),i.traceState&&n.set(t,cc,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,uc);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=MO(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,cc);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=(0,d.createTraceState)(typeof u=="string"?u:void 0)}return d.trace.setSpanContext(e,o)}};function MO(r){let[e,t,n,i,s]=r.split("-");return!e||!t||!n||!i||e.length!==2||t.length!==32||n.length!==16||i.length!==2||e==="00"&&s?null:{traceId:t,spanId:n,traceFlags:parseInt(i,16)}}h();var xs=class{fields(){return[]}inject(){}extract(e){let t=se();if(!t?.telemetry)return d.diag.warn("@vercel/otel: Vercel telemetry extension not found."),e;let{rootSpanContext:n}=t.telemetry;return n?(d.diag.debug("@vercel/otel: Extracted root SpanContext from Vercel request context.",n),d.trace.setSpanContext(e,{...n,isRemote:!0,traceFlags:n.traceFlags||d.TraceFlags.SAMPLED})):e}};h();var Bs=Y(A(),1),ff=Y(hf(),1);var qs=class{export(e,t){let n=se();if(!n?.telemetry){d.diag.warn("@vercel/otel: no telemetry context found"),t({code:Bs.ExportResultCode.SUCCESS,error:void 0});return}try{let i=(0,ff.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1});n.telemetry.reportSpans(i),t({code:Bs.ExportResultCode.SUCCESS,error:void 0})}catch(i){t({code:Bs.ExportResultCode.FAILED,error:i instanceof Error?i:new Error(String(i))})}}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};h();function dc(){return!!se()?.telemetry?.traceDrains?.length}var Ef=!1,kr=class{constructor(e){this.processor=e}forceFlush(){return this.processor.forceFlush()}shutdown(){return this.processor.shutdown()}onStart(e,t){if(dc()){Ef||(Ef=!0,d.diag.debug("@vercel/otel: skipping automatic exporter due to configured trace drains"));return}this.processor.onStart(e,t)}onEnd(e){dc()||this.processor.onEnd(e)}};var KO={ALL:d.DiagLogLevel.ALL,VERBOSE:d.DiagLogLevel.VERBOSE,DEBUG:d.DiagLogLevel.DEBUG,INFO:d.DiagLogLevel.INFO,WARN:d.DiagLogLevel.WARN,ERROR:d.DiagLogLevel.ERROR,NONE:d.DiagLogLevel.NONE},Vs=class{constructor(e={}){this.configuration=e}start(){let e=zO(),t=this.configuration,n=process.env.NEXT_RUNTIME||"nodejs",i=!!e.OTEL_SDK_DISABLED;if(process.env.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:KO[process.env.OTEL_LOG_LEVEL.toUpperCase()]}),i)return;let s=t.idGenerator??new C.RandomIdGenerator,o=t.contextManager??new Of.AsyncLocalStorageContextManager;o.enable(),this.contextManager=o;let a=e.OTEL_SERVICE_NAME||t.serviceName||"app",u=new lr.Resource(vp({attributes:t.attributes,runtime:n,serviceName:a})),c=t.resourceDetectors??[lr.envDetectorSync];if(t.autoDetectResources??!0){let S={detectors:c};u=u.merge((0,lr.detectResourcesSync)(S))}let p=QO(t.propagators,t,e),f=ZO(t.traceSampler,e),M=JO(t.spanProcessors,t,e);M.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let R=t.spanLimits,w=new C.BasicTracerProvider({resource:u,idGenerator:s,sampler:f,spanLimits:R});if(w.addSpanProcessor(new Rs(M,t.attributesFromHeaders)),w.register({contextManager:o,propagator:new He.CompositePropagator({propagators:p})}),this.tracerProvider=w,t.logRecordProcessor){let S=new Sf.LoggerProvider({resource:u});this.loggerProvider=S,S.addLogRecordProcessor(t.logRecordProcessor),st.logs.setGlobalLoggerProvider(S)}if(t.metricReader||t.views){let S=new Af.MeterProvider({resource:u,views:t.views??[]});t.metricReader&&S.addMetricReader(t.metricReader),d.metrics.setGlobalMeterProvider(S),this.meterProvider=S}let U=YO(t.instrumentations,t.instrumentationConfig);this.disableInstrumentations=(0,Tf.registerInstrumentations)({instrumentations:U}),d.diag.info("@vercel/otel: started",a,n)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function zO(){let r=(0,Gs.parseEnvironment)(process.env);return{...Gs.DEFAULT_ENVIRONMENT,...r}}function YO(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new sr(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new sr(e?.fetch)):t).flat()}function QO(r,e,t){let n=process.env.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS.length>0?t.OTEL_PROPAGATORS:void 0;return(r??n??["auto"]).map(i=>{if(i==="none")return[];if(i==="auto"){let s=[];return s.push({name:"tracecontext",propagator:new jr}),s.push({name:"baggage",propagator:new He.W3CBaggagePropagator}),s.push({name:"vercel-runtime",propagator:new xs}),d.diag.debug(`@vercel/otel: Configure propagators: ${s.map(o=>o.name).join(", ")}`),s.map(o=>o.propagator)}if(i==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new jr;if(i==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new He.W3CBaggagePropagator;if(typeof i=="string")throw new Error(`Unknown propagator: "${i}"`);return i}).flat()}var mf="always_on",cr=1;function ZO(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||mf;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new C.AlwaysOnSampler;case"always_off":return new C.AlwaysOffSampler;case"parentbased_always_on":return new C.ParentBasedSampler({root:new C.AlwaysOnSampler});case"parentbased_always_off":return new C.ParentBasedSampler({root:new C.AlwaysOffSampler});case"traceidratio":return new C.TraceIdRatioBasedSampler(gf(e));case"parentbased_traceidratio":return new C.ParentBasedSampler({root:new C.TraceIdRatioBasedSampler(gf(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${mf}".`),new C.AlwaysOnSampler}}function gf(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${cr}.`),cr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${cr}.`),cr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${cr}.`),cr):e}function JO(r,e,t){return[...(r??["auto"]).flatMap(n=>{if(n==="auto"){let i=[new C.BatchSpanProcessor(new qs)];if(process.env.VERCEL_OTEL_ENDPOINTS){let s=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",o=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",s,o);let a={url:`http://localhost:${s}/v1/traces`,headers:{}},u=o==="http/protobuf"?new dt(a):new rr(a);i.push(new kr(new C.BatchSpanProcessor(u)))}else(!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT)&&i.push(new kr(new C.BatchSpanProcessor(eR(t))));return i}return n}).filter(nR),...e.traceExporter&&e.traceExporter!=="auto"?[new C.BatchSpanProcessor(e.traceExporter)]:[]]}function eR(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=rR(r),n={...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new rr({url:t,headers:n});case"http/protobuf":return new dt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new dt}}var Rf="v1/traces",tR=`http://localhost:4318/${Rf}`;function rR(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${Rf}`:tR}function nR(r){return r!=null}function Jv(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new Vs(e).start()}export{sr as FetchInstrumentation,rr as OTLPHttpJsonTraceExporter,dt as OTLPHttpProtoTraceExporter,Jv as registerOTel};
21
21
  //# sourceMappingURL=index.js.map