@digital-realty/app-shell 14.0.1 → 14.0.2-otel-test.549961
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap.js +13 -1
- package/package.json +13 -1
package/dist/bootstrap.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
import{__decorate as w}from"tslib";import{LitElement as A,html as c}from"lit";import{property as I}from"lit/decorators.js";import{ApplicationInsights as Z,DistributedTracingModes as ee}from"@microsoft/applicationinsights-web";import{authedUser as P}from"@digital-realty/ix-account-switcher";import{UserManager as te}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as se,action as ne,observable as oe,toJS as ae}from"mobx";function i(){var e;const t=(e=window.gpConfig)==null?void 0:e["app-shell"];if(!t)throw new Error("App-shell config not loaded. Ensure config.json is fetched before app bootstrap.");return t}const{PortalInterxion:re,PortalGlobalPortal:ie,PortalServiceFabric:le,PortalMarketplacePortal:ce}=i(),pe={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},ue={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell",bypass:"gpc_bypass"},b="globalportalappshell",u="user-authentication",g="redirect-url",de="ui-cookie-policy",me="date-format",R="Global Portal",T="Service Fabric",y="Marketplace Portal",v="EMEA Customer Portal",N="x-auth",[d,he,ge,_e]=["CREATE","UPDATE","READ","APPROVE"],[O,_,Ee,fe,k,Ce,_t,Se,L,Et,we,Ae,x,U,M,ft,Ie,Ct,Pe,D,V,G,be,j,Re,Te,$,ye]=["Cloud Connect","Cross Connect","Custom Roles","Customer Care","Customer Equipment Connection (CEC)","Customer Support","DCIM-enabled location data","Default System Roles","External User","Facility Access","Internal Roles","Internal User","Internet Exchange","Intra-Customer Connectivity (ICC)","IP Bandwidth","OSP Access","Permanent Badge","PoP/POE Room Access","Remote Hands","Remote Hands Package","Service Exchange Cloud Router","Service Exchange Port","Shipping & Receiving","Space & Power","Trouble Ticket","Visitor Access","User","ESG Reporting"],ve=[Pe,Ce,Re,be,Te,Ie,fe],Ne=[_,O,k,x,U,M,D,V,G,j],H=[_,O,k,x,U,M,D,V,G,j],Oe={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},B={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges",ShowLastLoginPopup:"showLastLoginPopup"}},[ke,Le,xe]=["Security","DCIM","Planned Site Maintenance"],Ue=[ke,Le,xe],Me=[{label:R,href:ie,selected:!0},{label:y,href:ce},{label:v,href:re},{label:T,href:le,target:"_blank"}],F={appInsights:"_appInsights"},De=()=>{const{ApplicationInsightsInstrumentationKey:e,ApplicationInsightsCorrelationHeaderExcludedDomains:t}=i(),s=new Z({config:{instrumentationKey:e,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:ee.AI_AND_W3C,correlationHeaderExcludedDomains:t.split(",").map(n=>n.trim())}});return s.loadAppInsights(),s.trackPageView(),s.addTelemetryInitializer(n=>{n.tags["ai.cloud.role"]=b}),s},m=(e,t,s)=>(...n)=>{const[o,...a]=n;typeof o=="string"&&o.startsWith("[mobx]")&&t===4?s.trackException({exception:{message:a[0].message,stack:a[0].stack,name:o},severityLevel:4}):s.trackTrace({severityLevel:t,message:o},a),e.apply(console,[o,...a])},Ve=e=>{console.log=m(console.log,2,e),console.info=m(console.info,2,e),console.warn=m(console.warn,3,e),console.error=m(console.error,4,e),window.console=console},Ge=()=>{const{ApplicationInsightsInstrumentationKey:e}=i();if(!e)return;const t=De();window[F.appInsights]=t,window.dispatchEvent(new Event("appInsightsInitialized")),Ve(t)},z=async e=>{const t=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(s)).map(n=>n.toString(16).padStart(2,"0")).join("")};function je(){const{location:e}=window,t=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`,{LoginAuthority:s,GlobalPortalClientId:n,GlobalPortalUIScopes:o,GlobalPlanBShellPostLogoutRedirectUrl:a}=i();return{authority:s,client_id:n,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:o,post_logout_redirect_uri:a,monitorSession:!1}}const E=new te(je()),$e=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(window.atob(t).split("").map(n=>`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(s)},He=()=>{localStorage.removeItem(u)},l=()=>{const e=localStorage.getItem(u);return e?JSON.parse(e):null},K=()=>{var e;const t=localStorage.getItem(N);return t?(e=JSON.parse(t))==null?void 0:e.email:null},Be=async()=>{const e=l();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await z(t)},J=()=>{const e=l();return e?e.id_token:null},W=(e,t)=>{const s={...t,...e},n=$e(e.access_token);return s.profile.sub=n.sub,s.profile.account_number=n.account_number,s.expires_at=n.exp,s.is_federated=n.is_federated,n.previous_login_date&&(s.profile.previous_login_date=n.previous_login_date),P.setAccount({accountNumber:n.account_number,email:n.email,name:n.name,givenName:n.given_name,familyName:n.family_name,authTime:n.exp,accessToken:e.access_token,idToken:e.id_token}),localStorage.setItem(u,JSON.stringify(s)),s},Fe=e=>{W(e,null)},Y=()=>{const e=l();return e?e.access_token:null},ze=()=>{const e=l();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},Ke=()=>{const e=l();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},Je=()=>{var e;const t=l();return((e=t==null?void 0:t.profile)==null?void 0:e.previous_login_date)||null},We=["authenticate","auth-callback","logout"],Ye=e=>e.expires_at&&new Date(e.expires_at*1e3),qe=e=>e.expires_at&&new Date(e.expires_at*1e3+i().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),q=()=>{if(!i().IsLoginEnabled)return!1;const e=l();if(!J())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>Ye(e):t>qe(e)},Xe=()=>{const e=window.location.pathname.split("/");return We.includes(e[e.length-1])},Qe=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(i().IsLoginEnabled?E.signinRedirect():window.location.href="/",!0):!1},Ze=()=>{let e="/";const t=localStorage.getItem(g);t&&(localStorage.removeItem(g),e=t),sessionStorage.setItem(B.SessionStorage.ShowLastLoginPopup,"true"),window.location.href=e},et=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},f=e=>{const t=Xe();(!t||e)&&(t||localStorage.setItem(g,window.location.href),window.location.href="/authenticate")},tt=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,s=await z(t);return{...e,profile:{...e.profile,hashed_identifier:s}}},st=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(E.signinRedirectCallback().then(et).then(tt).then(Fe).then(Ze).catch(f),!0):!1};class nt extends A{render(){return c` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",nt);class ot{constructor(){this.permissions=[],this.loading=!1,this.getPermissions=async()=>{var t;const s=(t=P)==null?void 0:t.access_token;if(!s)return[];const{ApiBaseUrl:n}=i(),o=await fetch(`${n}/usermanagement/my-permissions?exclude_parents=false&exclude_siblings=true`,{headers:{Authorization:`Bearer ${s}`}});return o.ok?o.json():[]},se(this,{permissions:oe,setPermissions:ne})}setPermissions(t){this.permissions=t}tryLoadPermissions(){try{this.loading||(this.loading=!0,this.getPermissions().then(t=>{this.setPermissions(t),this.loading=!1}).catch(()=>{this.loading=!1}))}catch(t){this.loading=!1}}clearPermissions(){this.setPermissions([])}hasExternalUserCreate(){return this.hasPermission(L,d)||this.hasPermission($,d)}hasConnectivityCreate(){return this.hasPermission(_,d)}hasPrivilegeLevel(t,s){const n=[_e,d,he,ge],o=n.findIndex(r=>r===t),a=n.findIndex(r=>r===s);return o>=a}hasPermission(t,s){return ae(this.permissions).some(n=>n.permission_name===t&&this.hasPrivilegeLevel(s,n.privilege))}}const C=new ot,X=()=>{const e=new Headers;return e.append("Authorization",`Bearer ${Y()}`),e},at=async()=>{const{ApiBaseUrl:e}=i(),t=`${e}/inventory/locations?embed=permissions&page_size=1000`;let s=[],n=1;for(;;){const a=await fetch(`${t}&cursor=${n}`,{headers:X()});if(!a.ok)return Promise.reject();const r=await a.json();if(s.push(...r.items),r.self===r.last)break;n++}s=s.filter(a=>a.permissions.some(r=>H.includes(r.name)));const o=new Map;for(const a of s)o.has(a.account_number)?o.get(a.account_number).push(a.site_id):o.set(a.account_number,[a.site_id]);return o},rt=async e=>{const{ApiBaseUrl:t}=i(),s=new URLSearchParams;s.append("process","Cross_connect");const n=[...e.keys()],o=[...new Set([...e.values()].flat())];s.append("account_number",n.join(",")),s.append("site",o.join(","));const a=await fetch(`${t}/site-navigations/site-configurations?${s}`,{headers:X()});return a.ok?await a.json():Promise.reject()},it=async()=>{try{const e=await at();return e.size===0?!1:(await rt(e)).some(t=>{var s;return t.portal==="GlobalPortal"&&!!((s=e.get(t.account_number))!=null&&s.includes(t.site))})}catch(e){return console.error("Failed to determine portal-managed inventory:",e),!1}};class S extends A{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{i().IsLoginEnabled&&q()&&f()};try{Ge()}catch(s){console.error("Telemetry initialization failed:",s)}const t=window.location.pathname;if(t==="/session-expired"){this._currentView="session-expired",this._loadView("session-expired");return}if(t==="/logout"){this._currentView="logout",this._loadView("logout");return}if(Qe()||st()){this._currentView="splash";return}if(q()){this._currentView="splash",f();return}this._currentView="app",this._loadApp()}async _loadView(t){t==="session-expired"?await import("@digital-realty/ix-app-logic/views/session-expiry.js"):t==="logout"&&await import("./logout-DHu3NPe-.js")}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._onPopState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._onPopState)}_getAccountNumber(){var t,s,n;return(n=new URLSearchParams(window.location.search).get("selected_account_number"))!=null?n:(s=(t=l())==null?void 0:t.profile)==null?void 0:s.account_number}_isESGAccessOnly(t,s){const n=t.filter(o=>o.account_number===s);return n.length===1&&n[0].permission_name==="ESG Reporting"}async _applyGomFF(){var t,s;const n=K(),o=structuredClone(window.gpConfig);if(!n||!o)return;const a=((t=i().SuperusersWhitelist)!=null?t:"").split(",").map(h=>h.trim().toLowerCase()).includes(n.toLowerCase()),r=!!((s=o["app-shell"])!=null&&s.IsInventoryManagementEnabled),p=await it()&&(a||r);o["app-shell"].IsInventoryManagementEnabled=p,o["ui-launchpad"].IsInventoryManagementEnabled=p,window.gpConfig=Object.freeze(o)}_applyMfeOverrides(t,s){const n={};for(const o of Object.keys(t))n[o]={...t[o],enabled:s.includes(o)};return n}async _loadApp(){var t;const{authedUser:s}=await import("@digital-realty/ix-account-switcher");await s.hydrateStore();const[n,o]=await Promise.allSettled([fetch("./registered-apps.json").then(Q=>Q.json()),C.getPermissions()]);if(n.status==="rejected"){console.error("Failed to load registered apps:",n.reason);return}if(o.status==="rejected"){console.error("Failed to load permissions:",o.reason);return}const{registeredApps:a}=n.value,r=o.value,p=(t=this._getAccountNumber())!=null?t:"",h=this._isESGAccessOnly(r,p)?this._applyMfeOverrides(a,["ui-esg"]):a;await this._applyGomFF(),window.registeredApps=Object.freeze(h),C.setPermissions(r),await import("./app-CQYtI6QN.js"),this.appLoaded=!0}render(){switch(this._currentView){case"session-expired":return c`<ix-session-expiry></ix-session-expiry>`;case"logout":return c`<ixp-logout></ixp-logout>`;case"app":return this.appLoaded?c`<global-portal-app appTitle="DLR" showDrawer></global-portal-app>`:c`<splash-screen></splash-screen>`;default:return c`<splash-screen></splash-screen>`}}}w([I({type:String})],S.prototype,"_currentView",void 0),w([I({type:Boolean})],S.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",S);export{Oe as A,N as B,Ee as C,me as D,ye as E,de as F,R as G,Ne as I,y as M,H as O,Ue as R,ve as S,$ as U,J as a,Be as b,He as c,K as d,Y as e,l as f,i as g,W as h,Je as i,ze as j,B as k,Ae as l,L as m,Se as n,we as o,C as p,v as q,Me as r,T as s,F as t,E as u,b as v,pe as w,Ke as x,ue as y,u as z};
|
|
1
|
+
var Fi=Object.defineProperty;var $i=(e,t,r)=>t in e?Fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var c=(e,t,r)=>$i(e,typeof t!="symbol"?t+"":t,r);import{__decorate as qr}from"tslib";import{LitElement as Wr,html as lt}from"lit";import{property as Xr}from"lit/decorators.js";import{ApplicationInsights as Vi,DistributedTracingModes as Hi}from"@microsoft/applicationinsights-web";import{authedUser as Yr}from"@digital-realty/ix-account-switcher";import{UserManager as zi}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as ji,action as qi,observable as Wi,toJS as Xi}from"mobx";function P(){var e;const t=(e=window.gpConfig)==null?void 0:e["app-shell"];if(!t)throw new Error("App-shell config not loaded. Ensure config.json is fetched before app bootstrap.");return t}const{PortalInterxion:Yi,PortalGlobalPortal:Ki,PortalServiceFabric:Qi,PortalMarketplacePortal:Ji}=P(),Zi={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},to={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell",bypass:"gpc_bypass"},Ce="globalportalappshell",Xt="user-authentication",ye="redirect-url",eo="ui-cookie-policy",ro="date-format",Kr="Global Portal",Qr="Service Fabric",Jr="Marketplace Portal",Zr="EMEA Customer Portal",tn="x-auth",[Yt,no,so,io]=["CREATE","UPDATE","READ","APPROVE"],[en,Pe,oo,ao,rn,co,R_,uo,nn,O_,lo,ho,sn,on,an,C_,_o,y_,fo,cn,un,ln,po,hn,mo,go,dn,Eo]=["Cloud Connect","Cross Connect","Custom Roles","Customer Care","Customer Equipment Connection (CEC)","Customer Support","DCIM-enabled location data","Default System Roles","External User","Facility Access","Internal Roles","Internal User","Internet Exchange","Intra-Customer Connectivity (ICC)","IP Bandwidth","OSP Access","Permanent Badge","PoP/POE Room Access","Remote Hands","Remote Hands Package","Service Exchange Cloud Router","Service Exchange Port","Shipping & Receiving","Space & Power","Trouble Ticket","Visitor Access","User","ESG Reporting"],To=[fo,co,mo,po,go,_o,ao],So=[Pe,en,rn,sn,on,an,cn,un,ln,hn],_n=[Pe,en,rn,sn,on,an,cn,un,ln,hn],Ao={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},fn={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges",ShowLastLoginPopup:"showLastLoginPopup"}},[bo,wo,Ro]=["Security","DCIM","Planned Site Maintenance"],Oo=[bo,wo,Ro],Co=[{label:Kr,href:Ki,selected:!0},{label:Jr,href:Ji},{label:Zr,href:Yi},{label:Qr,href:Qi,target:"_blank"}],Me={appInsights:"_appInsights",otel:"_otel"},yo=()=>{const{ApplicationInsightsInstrumentationKey:e,ApplicationInsightsCorrelationHeaderExcludedDomains:t}=P(),r=new Vi({config:{instrumentationKey:e,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:Hi.AI_AND_W3C,correlationHeaderExcludedDomains:t.split(",").map(n=>n.trim())}});return r.loadAppInsights(),r.trackPageView(),r.addTelemetryInitializer(n=>{n.tags["ai.cloud.role"]=Ce}),r},Kt=(e,t,r)=>(...n)=>{const[s,...i]=n;typeof s=="string"&&s.startsWith("[mobx]")&&t===4?r.trackException({exception:{message:i[0].message,stack:i[0].stack,name:s},severityLevel:4}):r.trackTrace({severityLevel:t,message:s},i),e.apply(console,[s,...i])},Po=e=>{console.log=Kt(console.log,2,e),console.info=Kt(console.info,2,e),console.warn=Kt(console.warn,3,e),console.error=Kt(console.error,4,e),window.console=console},Mo=()=>{const{ApplicationInsightsInstrumentationKey:e}=P();if(!e)return;const t=yo();window[Me.appInsights]=t,window.dispatchEvent(new Event("appInsightsInitialized")),Po(t)},Z="1.9.1",pn=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function vo(e){const t=new Set([e]),r=new Set,n=e.match(pn);if(!n)return()=>!1;const s={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(s.prerelease!=null)return function(u){return u===e};function i(a){return r.add(a),!1}function o(a){return t.add(a),!0}return function(u){if(t.has(u))return!0;if(r.has(u))return!1;const l=u.match(pn);if(!l)return i(u);const h={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return h.prerelease!=null||s.major!==h.major?i(u):s.major===0?s.minor===h.minor&&s.patch<=h.patch?o(u):i(u):s.minor<=h.minor?o(u):i(u)}}const Io=vo(Z),Lo=Z.split(".")[0],bt=Symbol.for(`opentelemetry.js.api.${Lo}`),wt=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};function Rt(e,t,r,n=!1){var s;const i=wt[bt]=(s=wt[bt])!==null&&s!==void 0?s:{version:Z};if(!n&&i[e]){const o=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(o.stack||o.message),!1}if(i.version!==Z){const o=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Z}`);return r.error(o.stack||o.message),!1}return i[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${Z}.`),!0}function tt(e){var t,r;const n=(t=wt[bt])===null||t===void 0?void 0:t.version;if(!(!n||!Io(n)))return(r=wt[bt])===null||r===void 0?void 0:r[e]}function Ot(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Z}.`);const r=wt[bt];r&&delete r[e]}class No{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return Ct("debug",this._namespace,t)}error(...t){return Ct("error",this._namespace,t)}info(...t){return Ct("info",this._namespace,t)}warn(...t){return Ct("warn",this._namespace,t)}verbose(...t){return Ct("verbose",this._namespace,t)}}function Ct(e,t,r){const n=tt("diag");if(n)return n[e](t,...r)}var w;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(w||(w={}));function xo(e,t){e<w.NONE?e=w.NONE:e>w.ALL&&(e=w.ALL),t=t||{};function r(n,s){const i=t[n];return typeof i=="function"&&e>=s?i.bind(t):function(){}}return{error:r("error",w.ERROR),warn:r("warn",w.WARN),info:r("info",w.INFO),debug:r("debug",w.DEBUG),verbose:r("verbose",w.VERBOSE)}}const Uo="diag";class x{static instance(){return this._instance||(this._instance=new x),this._instance}constructor(){function t(s){return function(...i){const o=tt("diag");if(o)return o[s](...i)}}const r=this,n=(s,i={logLevel:w.INFO})=>{var o,a,u;if(s===r){const d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((o=d.stack)!==null&&o!==void 0?o:d.message),!1}typeof i=="number"&&(i={logLevel:i});const l=tt("diag"),h=xo((a=i.logLevel)!==null&&a!==void 0?a:w.INFO,s);if(l&&!i.suppressOverrideMessage){const d=(u=new Error().stack)!==null&&u!==void 0?u:"<failed to generate stacktrace>";l.warn(`Current logger will be overwritten from ${d}`),h.warn(`Current logger will overwrite one already registered from ${d}`)}return Rt("diag",h,r,!0)};r.setLogger=n,r.disable=()=>{Ot(Uo,r)},r.createComponentLogger=s=>new No(s),r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}}class mt{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){const r=this._entries.get(t);if(r)return Object.assign({},r)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,r){const n=new mt(this._entries);return n._entries.set(t,r),n}removeEntry(t){const r=new mt(this._entries);return r._entries.delete(t),r}removeEntries(...t){const r=new mt(this._entries);for(const n of t)r._entries.delete(n);return r}clear(){return new mt}}const Do=Symbol("BaggageEntryMetadata"),ko=x.instance();function Bo(e={}){return new mt(new Map(Object.entries(e)))}function Go(e){return typeof e!="string"&&(ko.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Do,toString(){return e}}}function ve(e){return Symbol.for(e)}class Ee{constructor(t){const r=this;r._currentContext=t?new Map(t):new Map,r.getValue=n=>r._currentContext.get(n),r.setValue=(n,s)=>{const i=new Ee(r._currentContext);return i._currentContext.set(n,s),i},r.deleteValue=n=>{const s=new Ee(r._currentContext);return s._currentContext.delete(n),s}}}const et=new Ee;if(typeof console<"u"){const e=["error","warn","info","debug","trace","log"];for(const t of e);}class Fo{constructor(){}createGauge(t,r){return Yo}createHistogram(t,r){return Ko}createCounter(t,r){return Xo}createUpDownCounter(t,r){return Qo}createObservableGauge(t,r){return Zo}createObservableCounter(t,r){return Jo}createObservableUpDownCounter(t,r){return ta}addBatchObservableCallback(t,r){}removeBatchObservableCallback(t){}}class Qt{}class $o extends Qt{add(t,r){}}class Vo extends Qt{add(t,r){}}class Ho extends Qt{record(t,r){}}class zo extends Qt{record(t,r){}}class Ie{addCallback(t){}removeCallback(t){}}class jo extends Ie{}class qo extends Ie{}class Wo extends Ie{}const mn=new Fo,Xo=new $o,Yo=new Ho,Ko=new zo,Qo=new Vo,Jo=new jo,Zo=new qo,ta=new Wo;function yt(){return mn}var X;(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(X||(X={}));const ea={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},ra={set(e,t,r){e!=null&&(e[t]=r)}};class na{active(){return et}with(t,r,n,...s){return r.call(n,...s)}bind(t,r){return r}enable(){return this}disable(){return this}}const Le="context",sa=new na;class gt{constructor(){}static getInstance(){return this._instance||(this._instance=new gt),this._instance}setGlobalContextManager(t){return Rt(Le,t,x.instance())}active(){return this._getContextManager().active()}with(t,r,n,...s){return this._getContextManager().with(t,r,n,...s)}bind(t,r){return this._getContextManager().bind(t,r)}_getContextManager(){return tt(Le)||sa}disable(){this._getContextManager().disable(),Ot(Le,x.instance())}}var H;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(H||(H={}));const gn="0000000000000000",En="00000000000000000000000000000000",Tn={traceId:En,spanId:gn,traceFlags:H.NONE};class Pt{constructor(t=Tn){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,r){return this}setAttributes(t){return this}addEvent(t,r){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,r){}}const Ne=ve("OpenTelemetry Context Key SPAN");function xe(e){return e.getValue(Ne)||void 0}function ia(){return xe(gt.getInstance().active())}function Ue(e,t){return e.setValue(Ne,t)}function oa(e){return e.deleteValue(Ne)}function aa(e,t){return Ue(e,new Pt(t))}function Sn(e){var t;return(t=xe(e))===null||t===void 0?void 0:t.spanContext()}const Jt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function An(e,t){if(typeof e!="string"||e.length!==t)return!1;let r=0;for(let n=0;n<e.length;n+=4)r+=(Jt[e.charCodeAt(n)]|0)+(Jt[e.charCodeAt(n+1)]|0)+(Jt[e.charCodeAt(n+2)]|0)+(Jt[e.charCodeAt(n+3)]|0);return r===t}function bn(e){return An(e,32)&&e!==En}function ca(e){return An(e,16)&&e!==gn}function Zt(e){return bn(e.traceId)&&ca(e.spanId)}function ua(e){return new Pt(e)}const De=gt.getInstance();class wn{startSpan(t,r,n=De.active()){if(!!(r!=null&&r.root))return new Pt;const i=n&&Sn(n);return la(i)&&Zt(i)?new Pt(i):new Pt}startActiveSpan(t,r,n,s){let i,o,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(i=r,a=n):(i=r,o=n,a=s);const u=o!=null?o:De.active(),l=this.startSpan(t,i,u),h=Ue(u,l);return De.with(h,a,void 0,l)}}function la(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}const ha=new wn;class da{constructor(t,r,n,s){this._provider=t,this.name=r,this.version=n,this.options=s}startSpan(t,r,n){return this._getTracer().startSpan(t,r,n)}startActiveSpan(t,r,n,s){const i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;const t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):ha}}class _a{getTracer(t,r,n){return new wn}}const fa=new _a;class Rn{getTracer(t,r,n){var s;return(s=this.getDelegateTracer(t,r,n))!==null&&s!==void 0?s:new da(this,t,r,n)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:fa}setDelegate(t){this._delegate=t}getDelegateTracer(t,r,n){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getTracer(t,r,n)}}var te;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(te||(te={}));var Mt;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(Mt||(Mt={}));var z;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(z||(z={}));const b=gt.getInstance(),p=x.instance();class pa{getMeter(t,r,n){return mn}}const ma=new pa,ke="metrics";class Br{constructor(){}static getInstance(){return this._instance||(this._instance=new Br),this._instance}setGlobalMeterProvider(t){return Rt(ke,t,x.instance())}getMeterProvider(){return tt(ke)||ma}getMeter(t,r,n){return this.getMeterProvider().getMeter(t,r,n)}disable(){Ot(ke,x.instance())}}const Be=Br.getInstance();class ga{inject(t,r){}extract(t,r){return t}fields(){return[]}}const Ge=ve("OpenTelemetry Baggage Key");function On(e){return e.getValue(Ge)||void 0}function Ea(){return On(gt.getInstance().active())}function Ta(e,t){return e.setValue(Ge,t)}function Sa(e){return e.deleteValue(Ge)}const Fe="propagation",Aa=new ga;class Gr{constructor(){this.createBaggage=Bo,this.getBaggage=On,this.getActiveBaggage=Ea,this.setBaggage=Ta,this.deleteBaggage=Sa}static getInstance(){return this._instance||(this._instance=new Gr),this._instance}setGlobalPropagator(t){return Rt(Fe,t,x.instance())}inject(t,r,n=ra){return this._getGlobalPropagator().inject(t,r,n)}extract(t,r,n=ea){return this._getGlobalPropagator().extract(t,r,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Ot(Fe,x.instance())}_getGlobalPropagator(){return tt(Fe)||Aa}}const U=Gr.getInstance(),$e="trace";class Fr{constructor(){this._proxyTracerProvider=new Rn,this.wrapSpanContext=ua,this.isSpanContextValid=Zt,this.deleteSpan=oa,this.getSpan=xe,this.getActiveSpan=ia,this.getSpanContext=Sn,this.setSpan=Ue,this.setSpanContext=aa}static getInstance(){return this._instance||(this._instance=new Fr),this._instance}setGlobalTracerProvider(t){const r=Rt($e,this._proxyTracerProvider,x.instance());return r&&this._proxyTracerProvider.setDelegate(t),r}getTracerProvider(){return tt($e)||this._proxyTracerProvider}getTracer(t,r){return this.getTracerProvider().getTracer(t,r)}disable(){Ot($e,x.instance()),this._proxyTracerProvider=new Rn}}const R=Fr.getInstance(),Cn=ve("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function yn(e){return e.setValue(Cn,!0)}function Ve(e){return e.getValue(Cn)===!0}const ba="=",Pn=";",Mn=",",He="baggage",vn=180,In=4096,Ln=8192;function wa(e){return e.reduce((t,r)=>{const n=`${t}${t!==""?Mn:""}${r}`;return n.length>Ln?t:n},"")}function Ra(e){return e.getAllEntries().map(([t,r])=>{let n=`${encodeURIComponent(t)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=Pn+r.metadata.toString()),n})}function Oa(e){if(!e)return;const t=e.indexOf(Pn),r=t===-1?e:e.substring(0,t),n=r.indexOf(ba);if(n<=0)return;const s=r.substring(0,n).trim(),i=r.substring(n+1).trim();if(!s||!i)return;let o,a;try{o=decodeURIComponent(s),a=decodeURIComponent(i)}catch(l){return}let u;if(t!==-1&&t<e.length-1){const l=e.substring(t+1);u=Go(l)}return{key:o,value:a,metadata:u}}function Nn(e,t,r,n){let s=0;for(;s<e.length&&r<vn;){const i=e.indexOf(Mn,s),o=i===-1?e.length:i,a=o-s;if(a<=In){const u=Oa(e.substring(s,o));if(u){const l=(r===0?0:1)+a;if(n+l>Ln)break;t[u.key]=u.metadata?{value:u.value,metadata:u.metadata}:{value:u.value},r++,n+=l}}if(i===-1)break;s=i+1}return[r,n]}class Ca{inject(t,r,n){const s=U.getBaggage(t);if(!s||Ve(t))return;const i=Ra(s).filter(a=>a.length<=In).slice(0,vn),o=wa(i);o.length>0&&n.set(r,He,o)}extract(t,r,n){const s=n.get(r,He);if(!s)return t;const i={};let o=0,a=0;if(Array.isArray(s))for(let u=0;u<s.length;u++)[o,a]=Nn(s[u],i,o,a);else[o]=Nn(s,i,o,a);return o===0?t:U.setBaggage(t,U.createBaggage(i))}fields(){return[He]}}function vt(e){const t={};if(typeof e!="object"||e==null)return t;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if(!ya(r)){p.warn(`Invalid attribute key: ${r}`);continue}const n=e[r];if(!xn(n)){p.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?t[r]=n.slice():t[r]=n}return t}function ya(e){return typeof e=="string"&&e!==""}function xn(e){return e==null?!0:Array.isArray(e)?Pa(e):Un(typeof e)}function Pa(e){let t;for(const r of e){if(r==null)continue;const n=typeof r;if(n!==t){if(!t){if(Un(n)){t=n;continue}return!1}return!1}}return!0}function Un(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}function Ma(){return e=>{p.error(va(e))}}function va(e){return typeof e=="string"?e:JSON.stringify(Ia(e))}function Ia(e){const t={};let r=e;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(t[n])return;const s=r[n];s&&(t[n]=String(s))}),r=Object.getPrototypeOf(r);return t}let La=Ma();function Y(e){try{La(e)}catch(t){}}function P_(e){}const Na="2.10.0",It="error.type",ze="exception.message",xa="exception.stacktrace",je="exception.type",Dn="http.request.method",kn="http.request.method_original",Bn="http.response.status_code",Gn="server.address",Fn="server.port",$n="service.name",qe="telemetry.sdk.language",Ua="webjs",We="telemetry.sdk.name",Xe="telemetry.sdk.version",Lt="url.full",Da="user_agent.original",ka="process.runtime.name",Ye={[We]:"opentelemetry",[ka]:"browser",[qe]:Ua,[Xe]:Na},O=performance,Ba=9,Ga=6,Fa=Math.pow(10,Ga),Nt=Math.pow(10,Ba);function L(e){const t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*Fa);return[r,n]}function G(e){const t=L(O.timeOrigin),r=L(typeof e=="number"?e:O.now());return Hn(t,r)}function xt(e){if(Qe(e))return e;if(typeof e=="number")return e<O.timeOrigin/2?G(e):L(e);if(e instanceof Date)return L(e.getTime());throw TypeError("Invalid input type")}function Ke(e,t){let r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=Nt),[r,n]}function j(e){return e[0]*Nt+e[1]}function ee(e){return e[0]*1e6+e[1]/1e3}function $a(e){return e[0]*1e3+e[1]/1e6}function Va(e){return e[0]+e[1]/Nt}function Qe(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}function Vn(e){return Qe(e)||typeof e=="number"||e instanceof Date}function Hn(e,t){const r=[e[0]+t[0],e[1]+t[1]];return r[1]>=Nt&&(r[1]-=Nt,r[0]+=1),r}var D;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(D||(D={}));class Ha{constructor(t={}){c(this,"_propagators");c(this,"_fields");var n;this._propagators=(n=t.propagators)!=null?n:[];const r=new Set;for(const s of this._propagators){const i=typeof s.fields=="function"?s.fields():[];for(const o of i)r.add(o)}this._fields=Array.from(r)}inject(t,r,n){for(const s of this._propagators)try{s.inject(t,r,n)}catch(i){p.warn(`Failed to inject with ${s.constructor.name}. Err: ${i.message}`)}}extract(t,r,n){return this._propagators.reduce((s,i)=>{try{return i.extract(s,r,n)}catch(o){p.warn(`Failed to extract with ${i.constructor.name}. Err: ${o.message}`)}return s},t)}fields(){return this._fields.slice()}}const Je="[_0-9a-z-*/]",za=`[a-z]${Je}{0,255}`,ja=`[a-z0-9]${Je}{0,240}@[a-z]${Je}{0,13}`,qa=new RegExp(`^(?:${za}|${ja})$`),Wa=/^[ -~]{0,255}[!-~]$/,Xa=/,|=/;function zn(e){return qa.test(e)}function jn(e){return Wa.test(e)&&!Xa.test(e)}const Ya=32,qn=512,Wn=",",Xn="=";class $r{constructor(t){c(this,"_length");c(this,"_rawTraceState");c(this,"_internalState");this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,r){if(!zn(t)||!jn(r))return this;const n=this._getState(),s=n.get(t);let i=this._length;if(typeof s=="string"?i+=r.length-s.length:i+=t.length+r.length+(n.size>0?2:1),i>qn)return this;const o=new Map(n);return o.delete(t),o.set(t,r),this._fromState(o,i)}unset(t){const r=this._getState(),n=r.get(t);if(typeof n!="string")return this;let s=this._length-(t.length+n.length+1);r.size>1&&(s=s-1);const i=new Map(r);return i.delete(t),this._fromState(i,s)}get(t){return this._getState().get(t)}serialize(){let t="",r=0;for(const n of this._getState())r>0&&(t=Wn+t),t=`${n[0]}${Xn}${n[1]}`+t,r++;return t}_getState(){if(this._internalState)return this._internalState;const t=this._rawTraceState.split(Wn),r=new Map;let n=0;for(const s of t){const i=s.trim(),o=i.indexOf(Xn);if(o===-1)continue;const a=i.slice(0,o),u=i.slice(o+1);if(!zn(a)||!jn(u))continue;const l=n+i.length+(r.size>0?1:0);if(!(l>qn)&&(r.set(a,u),n=l,r.size>=Ya))break}return this._length=n,this._internalState=new Map(Array.from(r.entries()).reverse()),this._internalState}_fromState(t,r){const n=Object.create($r.prototype);return n._internalState=t,n._length=r,n}}const re="traceparent",Ze="tracestate",Ka="00",Qa="(?!ff)[\\da-f]{2}",Ja="(?![0]{32})[\\da-f]{32}",Za="(?![0]{16})[\\da-f]{16}",tc="[\\da-f]{2}",ec=new RegExp(`^\\s?(${Qa})-(${Ja})-(${Za})-(${tc})(-.*)?\\s?$`);function rc(e){const t=ec.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}class nc{inject(t,r,n){const s=R.getSpanContext(t);if(!s||Ve(t)||!Zt(s))return;const i=`${Ka}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||H.NONE).toString(16)}`;n.set(r,re,i),s.traceState&&n.set(r,Ze,s.traceState.serialize())}extract(t,r,n){const s=n.get(r,re);if(!s)return t;const i=Array.isArray(s)?s[0]:s;if(typeof i!="string")return t;const o=rc(i);if(!o)return t;o.isRemote=!0;const a=n.get(r,Ze);if(a){const u=Array.isArray(a)?a.join(","):a;o.traceState=new $r(typeof u=="string"?u:void 0)}return R.setSpanContext(t,o)}fields(){return[re,Ze]}}var Yn;(function(e){e.HTTP="http"})(Yn||(Yn={}));const sc="[object Object]",ic="[object Null]",oc="[object Undefined]",ac=Function.prototype,Kn=ac.toString,cc=Kn.call(Object),uc=Object.getPrototypeOf,Qn=Object.prototype,Jn=Qn.hasOwnProperty,rt=Symbol?Symbol.toStringTag:void 0,Zn=Qn.toString;function ts(e){if(!lc(e)||hc(e)!==sc)return!1;const t=uc(e);if(t===null)return!0;const r=Jn.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Kn.call(r)===cc}function lc(e){return e!=null&&typeof e=="object"}function hc(e){return e==null?e===void 0?oc:ic:rt&&rt in Object(e)?dc(e):_c(e)}function dc(e){const t=Jn.call(e,rt),r=e[rt];let n=!1;try{e[rt]=void 0,n=!0}catch(i){}const s=Zn.call(e);return n&&(t?e[rt]=r:delete e[rt]),s}function _c(e){return Zn.call(e)}const fc=20;function pc(...e){let t=e.shift();const r=new WeakMap;for(;e.length>0;)t=es(t,e.shift(),0,r);return t}function tr(e){return ne(e)?e.slice():e}function es(e,t,r=0,n){let s;if(!(r>fc)){if(r++,se(e)||se(t)||ns(t))s=tr(t);else if(ne(e)){if(s=e.slice(),ne(t))for(let i=0,o=t.length;i<o;i++)s.push(tr(t[i]));else if(Ut(t)){const i=Object.keys(t);for(let o=0,a=i.length;o<a;o++){const u=i[o];u==="__proto__"||u==="constructor"||u==="prototype"||(s[u]=tr(t[u]))}}}else if(Ut(e))if(Ut(t)){if(!mc(e,t))return t;s=Object.assign({},e);const i=Object.keys(t);for(let o=0,a=i.length;o<a;o++){const u=i[o];if(u==="__proto__"||u==="constructor"||u==="prototype")continue;const l=t[u];if(se(l))typeof l>"u"?delete s[u]:s[u]=l;else{const h=s[u],d=l;if(rs(e,u,n)||rs(t,u,n))delete s[u];else{if(Ut(h)&&Ut(d)){const f=n.get(h)||[],_=n.get(d)||[];f.push({obj:e,key:u}),_.push({obj:t,key:u}),n.set(h,f),n.set(d,_)}s[u]=es(s[u],l,r,n)}}}}else s=t;return s}}function rs(e,t,r){const n=r.get(e[t])||[];for(let s=0,i=n.length;s<i;s++){const o=n[s];if(o.key===t&&o.obj===e)return!0}return!1}function ne(e){return Array.isArray(e)}function ns(e){return typeof e=="function"}function Ut(e){return!se(e)&&!ne(e)&&!ns(e)&&typeof e=="object"}function se(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function mc(e,t){return!(!ts(e)||!ts(t))}function ss(e,t){return typeof t=="string"?e===t:!!e.match(t)}function is(e,t){if(!t)return!1;for(const r of t)if(ss(e,r))return!0;return!1}class gc{constructor(){c(this,"_promise");c(this,"_resolve");c(this,"_reject");this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}class Ec{constructor(t,r){c(this,"_isCalled",!1);c(this,"_deferred",new gc);c(this,"_callback");c(this,"_that");this._callback=t,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}w.ALL,w.VERBOSE,w.DEBUG,w.INFO,w.WARN,w.ERROR,w.NONE;function Tc(e,t){return new Promise(r=>{b.with(yn(b.active()),()=>{e.export(t,r)})})}const Sc={_export:Tc};let ie;function Ac(){if(ie===void 0)try{const e=globalThis.process.argv0;ie=e?`unknown_service:${e}`:"unknown_service"}catch(e){ie="unknown_service"}return ie}const Dt=e=>e!==null&&typeof e=="object"&&typeof e.then=="function";class Te{constructor(t,r){c(this,"_rawAttributes");c(this,"_asyncAttributesPending",!1);c(this,"_schemaUrl");c(this,"_memoizedAttributes");var s;const n=(s=t.attributes)!=null?s:{};this._rawAttributes=Object.entries(n).map(([i,o])=>(Dt(o)&&(this._asyncAttributesPending=!0),[i,o])),this._rawAttributes=cs(this._rawAttributes),this._schemaUrl=bc(r==null?void 0:r.schemaUrl)}static FromAttributeList(t,r){const n=new Te({},r);return n._rawAttributes=cs(t),n._asyncAttributesPending=t.filter(([s,i])=>Dt(i)).length>0,n}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){const[r,n]=this._rawAttributes[t];this._rawAttributes[t]=[r,Dt(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){var r;if(this.asyncAttributesPending&&p.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const t={};for(const[n,s]of this._rawAttributes){if(Dt(s)){p.debug(`Unsettled resource attribute ${n} skipped`);continue}s!=null&&((r=t[n])!=null||(t[n]=s))}return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;const r=wc(this,t),n=r?{schemaUrl:r}:void 0;return Te.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],n)}}function os(e,t){return Te.FromAttributeList(Object.entries(e),t)}function as(){return os({[$n]:Ac(),[qe]:Ye[qe],[We]:Ye[We],[Xe]:Ye[Xe]})}function cs(e){return e.map(([t,r])=>Dt(r)?[t,r.catch(n=>{p.debug("promise rejection for resource attribute: %s - %s",t,n)})]:[t,r])}function bc(e){if(typeof e=="string"||e===void 0)return e;p.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}function wc(e,t){const r=e==null?void 0:e.schemaUrl,n=t==null?void 0:t.schemaUrl,s=r===void 0||r==="",i=n===void 0||n==="";if(s)return n;if(i||r===n)return r;p.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}const Rc="exception",er=Symbol.for("nodejs.util.inspect.custom");function rr(e){var r;const t={};for(const[n,s]of e.getRawAttributes())typeof(s==null?void 0:s.then)!="function"&&s!=null&&((r=t[n])!=null||(t[n]=s));return t}function nr(e,t,r,n,s){if(typeof r=="number"&&r<0){const o=`[${e}]`;return n!=null&&n.stylize?n.stylize(o,"special"):o}if(typeof s!="function"||!n)return t;const i={...n,depth:n.depth==null?n.depth:n.depth-1};return`${e} ${s(t,i)}`}class Oc{constructor(t){c(this,"_spanContext");c(this,"kind");c(this,"parentSpanContext");c(this,"attributes",{});c(this,"links",[]);c(this,"events",[]);c(this,"startTime");c(this,"resource");c(this,"instrumentationScope");c(this,"_droppedAttributesCount",0);c(this,"_droppedEventsCount",0);c(this,"_droppedLinksCount",0);c(this,"_attributesCount",0);c(this,"name");c(this,"status",{code:z.UNSET});c(this,"endTime",[0,0]);c(this,"_ended",!1);c(this,"_duration",[-1,-1]);c(this,"_spanProcessor");c(this,"_spanLimits");c(this,"_attributeValueLengthLimit");c(this,"_recordEndMetrics");c(this,"_performanceStartTime");c(this,"_performanceOffset");c(this,"_startTimeProvided");var n,s;const r=Date.now();if(this._spanContext=t.spanContext,this._performanceStartTime=O.now(),this._performanceOffset=r-(this._performanceStartTime+O.timeOrigin),this._startTimeProvided=t.startTime!=null,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=(n=this._spanLimits.attributeValueLengthLimit)!=null?n:0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,t.links)for(const i of t.links)this.addLink(i);this.startTime=this._getTime((s=t.startTime)!=null?s:r),this.resource=t.resource,this.instrumentationScope=t.scope,this._recordEndMetrics=t.recordEndMetrics,t.attributes!=null&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,r){if(r==null||this._isSpanEnded())return this;if(t.length===0)return p.warn(`Invalid attribute key: ${t}`),this;if(!xn(r))return p.warn(`Invalid attribute value set for key: ${t}`),this;const{attributeCountLimit:n}=this._spanLimits,s=!Object.prototype.hasOwnProperty.call(this.attributes,t);return n!==void 0&&this._attributesCount>=n&&s?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),s&&this._attributesCount++,this)}setAttributes(t){for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.setAttribute(r,t[r]);return this}addEvent(t,r,n){if(this._isSpanEnded())return this;const{eventCountLimit:s}=this._spanLimits;if(s===0)return p.warn("No events allowed."),this._droppedEventsCount++,this;s!==void 0&&this.events.length>=s&&(this._droppedEventsCount===0&&p.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Vn(r)&&(Vn(n)||(n=r),r=void 0);const i=vt(r),{attributePerEventCountLimit:o}=this._spanLimits,a={};let u=0,l=0;for(const h in i){if(!Object.prototype.hasOwnProperty.call(i,h))continue;const d=i[h];if(o!==void 0&&l>=o){u++;continue}a[h]=this._truncateToSize(d),l++}return this.events.push({name:t,attributes:a,time:this._getTime(n),droppedAttributesCount:u}),this}addLink(t){if(this._isSpanEnded())return this;const{linkCountLimit:r}=this._spanLimits;if(r===0)return this._droppedLinksCount++,this;r!==void 0&&this.links.length>=r&&(this._droppedLinksCount===0&&p.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);const{attributePerLinkCountLimit:n}=this._spanLimits,s=vt(t.attributes),i={};let o=0,a=0;for(const l in s){if(!Object.prototype.hasOwnProperty.call(s,l))continue;const h=s[l];if(n!==void 0&&a>=n){o++;continue}i[l]=this._truncateToSize(h),a++}const u={context:t.context};return a>0&&(u.attributes=i),o>0&&(u.droppedAttributesCount=o),this.links.push(u),this}addLinks(t){for(const r of t)this.addLink(r);return this}setStatus(t){if(this._isSpanEnded())return this;if(t.code===z.UNSET)return this;if(this.status.code===z.OK)return this;const r={code:t.code};return t.code===z.ERROR&&(typeof t.message=="string"?r.message=t.message:t.message!=null&&p.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`)),this.status=r,this}updateName(t){return this._isSpanEnded()?this:(this.name=t,this)}end(t){var r;if(this._isSpanEnded()){p.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(t),this._duration=Ke(this.startTime,this.endTime),this._duration[0]<0&&(p.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&p.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&p.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(r=this._recordEndMetrics)==null||r.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(t){if(typeof t=="number"&&t<=O.now())return G(t+this._performanceOffset);if(typeof t=="number")return L(t);if(t instanceof Date)return L(t.getTime());if(Qe(t))return t;if(this._startTimeProvided)return L(Date.now());const r=O.now()-this._performanceStartTime;return Hn(this.startTime,L(r))}isRecording(){return this._ended===!1}recordException(t,r){const n={};typeof t=="string"?n[ze]=t:t&&(t.code?n[je]=t.code.toString():t.name&&(n[je]=t.name),t.message&&(n[ze]=t.message),t.stack&&(n[xa]=t.stack)),n[je]||n[ze]?this.addEvent(Rc,n,r):p.warn(`Failed to record an exception ${t}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);p.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,r){return t.length<=r?t:t.substring(0,r)}_truncateToSize(t){const r=this._attributeValueLengthLimit;return r<=0?(p.warn(`Attribute value limit must be positive, got ${r}`),t):typeof t=="string"?this._truncateToLimitUtil(t,r):Array.isArray(t)?t.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):t}[er](t,r,n){const s={name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:rr(this.resource)}};return nr("SpanImpl",s,t,r,n)}}var F;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(F||(F={}));const Cc="otel.component.name",yc="otel.component.type",Pc="otel.span.parent.origin",us="otel.span.sampling_result",Mc="otel.sdk.processor.span.processed",vc="otel.sdk.processor.span.queue.capacity",Ic="otel.sdk.processor.span.queue.size",Lc="otel.sdk.span.live",Nc="otel.sdk.span.started",xc="batching_span_processor";class Uc{constructor(t){c(this,"startedSpans");c(this,"liveSpans");this.startedSpans=t.createCounter(Nc,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter(Lc,{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,r){const n=kc(r);if(this.startedSpans.add(1,{[Pc]:Dc(t),[us]:n}),r===F.NOT_RECORD)return()=>{};const s={[us]:n};return this.liveSpans.add(1,s),()=>{this.liveSpans.add(-1,s)}}}function Dc(e){return e?e.isRemote?"remote":"local":"none"}function kc(e){switch(e){case F.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case F.RECORD:return"RECORD_ONLY";case F.NOT_RECORD:return"DROP"}}const Bc="2.10.0";class Gc{constructor(t,r){c(this,"_sampler");c(this,"_spanLimits");c(this,"_idGenerator");c(this,"instrumentationScope");c(this,"_resource");c(this,"_spanProcessor");c(this,"_tracerMetrics");this.instrumentationScope=t,this._sampler=r.sampler,this._spanLimits=r.spanLimits,this._resource=r.resource,this._idGenerator=r.idGenerator,this._spanProcessor=r.spanProcessor;const n=r.meterProvider.getMeter("@opentelemetry/sdk-trace",Bc);this._tracerMetrics=new Uc(n)}startSpan(t,r={},n=b.active()){var y,At,ut;r.root&&(n=R.deleteSpan(n));const s=R.getSpan(n);if(Ve(n))return p.debug("Instrumentation suppressed, returning Noop Span"),R.wrapSpanContext(Tn);const i=s==null?void 0:s.spanContext(),o=this._idGenerator.generateSpanId();let a,u,l;!i||!R.isSpanContextValid(i)?u=this._idGenerator.generateTraceId():(u=i.traceId,l=i.traceState,a=i);const h=(y=r.kind)!=null?y:Mt.INTERNAL,d=((At=r.links)!=null?At:[]).map(Wt=>({context:Wt.context,attributes:vt(Wt.attributes)})),f=vt(r.attributes),_=this._sampler.shouldSample(n,u,t,h,f,d),E=this._tracerMetrics.startSpan(i,_.decision);l=(ut=_.traceState)!=null?ut:l;const m=_.decision===te.RECORD_AND_SAMPLED?H.SAMPLED:H.NONE,T={traceId:u,spanId:o,traceFlags:m,traceState:l};if(_.decision===te.NOT_RECORD)return p.debug("Recording is off, propagating context in a non-recording span"),R.wrapSpanContext(T);const A=vt(Object.assign(f,_.attributes));return new Oc({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:T,name:t,kind:h,links:d,parentSpanContext:a,attributes:A,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:E})}startActiveSpan(t,r,n,s){let i,o,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(i=r,a=n):(i=r,o=n,a=s);const u=o!=null?o:b.active(),l=this.startSpan(t,i,u),h=R.setSpan(u,l);return b.with(h,a,void 0,l)}[er](t,r,n){const s={instrumentationScope:this.instrumentationScope,resource:{attributes:rr(this._resource)},spanLimits:this._spanLimits};return nr("Tracer",s,t,r,n)}}class Fc{constructor(t){c(this,"_spanProcessors");this._spanProcessors=t}forceFlush(){const t=[];for(const r of this._spanProcessors)t.push(r.forceFlush());return new Promise(r=>{Promise.all(t).then(()=>{r()}).catch(n=>{Y(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(t,r){for(const n of this._spanProcessors)n.onStart(t,r)}onEnding(t){for(const r of this._spanProcessors)r.onEnding&&r.onEnding(t)}onEnd(t){for(const r of this._spanProcessors)r.onEnd(t)}shutdown(){const t=[];for(const r of this._spanProcessors)t.push(r.shutdown());return new Promise((r,n)=>{Promise.all(t).then(()=>{r()},n)})}}class oe{shouldSample(){return{decision:F.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class nt{shouldSample(){return{decision:F.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class ht{constructor(t){c(this,"_root");c(this,"_remoteParentSampled");c(this,"_remoteParentNotSampled");c(this,"_localParentSampled");c(this,"_localParentNotSampled");var r,n,s,i;this._root=t.root,this._root||(Y(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new nt),this._remoteParentSampled=(r=t.remoteParentSampled)!=null?r:new nt,this._remoteParentNotSampled=(n=t.remoteParentNotSampled)!=null?n:new oe,this._localParentSampled=(s=t.localParentSampled)!=null?s:new nt,this._localParentNotSampled=(i=t.localParentNotSampled)!=null?i:new oe}shouldSample(t,r,n,s,i,o){const a=R.getSpanContext(t);return!a||!Zt(a)?this._root.shouldSample(t,r,n,s,i,o):a.isRemote?a.traceFlags&H.SAMPLED?this._remoteParentSampled.shouldSample(t,r,n,s,i,o):this._remoteParentNotSampled.shouldSample(t,r,n,s,i,o):a.traceFlags&H.SAMPLED?this._localParentSampled.shouldSample(t,r,n,s,i,o):this._localParentNotSampled.shouldSample(t,r,n,s,i,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}const ls=new Map;class $c{constructor(t,r,n){c(this,"processedSpans");c(this,"queueSize");c(this,"queueSizeCallback");c(this,"standardAttrs");c(this,"droppedAttrs");var i;const s=(i=ls.get(t))!=null?i:0;if(ls.set(t,s+1),this.standardAttrs={[yc]:t,[Cc]:`${t}/${s}`},this.droppedAttrs={...this.standardAttrs,[It]:"queue_full"},this.processedSpans=r.createCounter(Mc,{unit:"{span}",description:"The number of spans for which the processing has finished, either successful or failed."}),n){const{capacity:o,getQueueSize:a}=n;r.createUpDownCounter(vc,{unit:"{span}",description:"The maximum number of spans the queue of a given instance of an SDK span processor can hold."}).add(o,this.standardAttrs),this.queueSize=r.createObservableUpDownCounter(Ic,{unit:"{span}",description:"The number of spans in the queue of a given instance of an SDK span processor."}),this.queueSizeCallback=l=>l.observe(a(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(t){this.processedSpans.add(t,this.droppedAttrs)}finishSpans(t,r){if(!r){this.processedSpans.add(t,this.standardAttrs);return}const n={...this.standardAttrs,[It]:r.name};this.processedSpans.add(t,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}}class Vc{constructor(t){c(this,"_maxExportBatchSize");c(this,"_maxQueueSize");c(this,"_scheduledDelayMillis");c(this,"_exportTimeoutMillis");c(this,"_exporter");c(this,"_metrics");c(this,"_isExporting",!1);c(this,"_finishedSpans",[]);c(this,"_timer");c(this,"_shutdownOnce");c(this,"_droppedSpansCount",0);var n,s,i,o;this._exporter=t.exporter,this._maxExportBatchSize=(n=t.maxExportBatchSize)!=null?n:512,this._maxQueueSize=(s=t.maxQueueSize)!=null?s:2048,this._scheduledDelayMillis=(i=t.scheduledDelayMillis)!=null?i:5e3,this._exportTimeoutMillis=(o=t.exportTimeoutMillis)!=null?o:3e4,this._shutdownOnce=new Ec(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize);const r=t.selfObsMeterProvider?t.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace"):yt();this._metrics=new $c(xc,r,{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(t,r){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&H.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&p.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(p.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,r)=>{const n=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let i=0,o=s;i<o;i++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{t()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((t,r)=>{const n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);b.with(yn(b.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);const i=()=>this._exporter.export(s,a=>{var u;clearTimeout(n),this._metrics.finishSpans(s.length,a.error),a.code===D.SUCCESS?t():r((u=a.error)!=null?u:new Error("BatchSpanProcessor: span export failed"))});let o=null;for(let a=0,u=s.length;a<u;a++){const l=s[a];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(o!=null||(o=[]),o.push(l.resource.waitForAsyncAttributes()))}o===null?i():Promise.all(o).then(i,a=>{Y(a),r(a)})})})}_maybeStartTimer(){if(this._isExporting)return;const t=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,Y(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return t();this._timer===void 0&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}let Hc=class extends Vc{constructor(r){super(r);c(this,"_visibilityChangeListener");c(this,"_pageHideListener");this.onInit(r)}onInit(r){r.disableAutoFlushOnDocumentHide!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(n=>{Y(n)})},this._pageHideListener=()=>{this.forceFlush().catch(n=>{Y(n)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}};const zc=16,jc=8,hs=new Uint8Array(zc),ds=new Uint8Array(jc),qc=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _s(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function fs(e){let t="";for(let r=0;r<e.length;r++)t+=qc[e[r]];return t}class Wc{generateTraceId(){return _s(hs),fs(hs)}generateSpanId(){return _s(ds),fs(ds)}}var st;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(st||(st={}));class Xc{constructor(t={}){c(this,"_resource");c(this,"_activeSpanProcessor");c(this,"_forceFlushTimeoutMillis");c(this,"_tracerOptions");c(this,"_tracers",new Map);var n,s,i,o,a,u,l,h,d,f,_,E,m,T,A,M,y;this._forceFlushTimeoutMillis=(n=t.forceFlushTimeoutMillis)!=null?n:3e4,this._resource=(s=t.resource)!=null?s:as();const r=(i=t.spanProcessors)!=null?i:[];this._activeSpanProcessor=new Fc(r),this._tracerOptions={resource:this._resource,sampler:(o=t.sampler)!=null?o:new ht({root:new nt}),spanLimits:{attributeCountLimit:(u=(a=t.spanLimits)==null?void 0:a.attributeCountLimit)!=null?u:128,attributeValueLengthLimit:(h=(l=t.spanLimits)==null?void 0:l.attributeValueLengthLimit)!=null?h:1/0,eventCountLimit:(f=(d=t.spanLimits)==null?void 0:d.eventCountLimit)!=null?f:128,linkCountLimit:(E=(_=t.spanLimits)==null?void 0:_.linkCountLimit)!=null?E:128,attributePerEventCountLimit:(T=(m=t.spanLimits)==null?void 0:m.attributePerEventCountLimit)!=null?T:128,attributePerLinkCountLimit:(M=(A=t.spanLimits)==null?void 0:A.attributePerLinkCountLimit)!=null?M:128},idGenerator:t.idGenerator||new Wc,spanProcessor:this._activeSpanProcessor,meterProvider:(y=t.meterProvider)!=null?y:{getMeter(){return yt()}}}}getTracer(t,r,n){const s=`${t}@${r||""}:${(n==null?void 0:n.schemaUrl)||""}`;return this._tracers.has(s)||this._tracers.set(s,new Gc({name:t,version:r,schemaUrl:n==null?void 0:n.schemaUrl},this._tracerOptions)),this._tracers.get(s)}forceFlush(){const t=this._forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(s=>{let i;const o=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${t} ms`)),i=st.timeout},t);n.forceFlush().then(()=>{clearTimeout(o),i!==st.timeout&&(i=st.resolved,s(i))}).catch(a=>{clearTimeout(o),i=st.error,s(a)})}));return new Promise((n,s)=>{Promise.all(r).then(i=>{const o=i.filter(a=>a!==st.resolved);o.length>0?s(o):n()}).catch(i=>s([i]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[er](t,r,n){const s=this._activeSpanProcessor._spanProcessors,i={resource:{attributes:rr(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:s.map(o=>{var a,u;return(u=(a=o.constructor)==null?void 0:a.name)!=null?u:"SpanProcessor"})};return nr("TracerProvider",i,t,r,n)}}class sr{constructor(t=0){c(this,"_ratio");c(this,"_upperBound");this._ratio=this._normalize(t),this._upperBound=this._ratio===1?4294967296:Math.floor(this._ratio*4294967295)}shouldSample(t,r){return{decision:bn(r)&&this._accumulate(r)<this._upperBound?F.RECORD_AND_SAMPLED:F.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return typeof t!="number"||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let r=0;for(let n=0;n<32;n+=8){let s=0;for(let i=0;i<8;i++){const o=t.charCodeAt(n+i),a=o<58?o-48:o<71?o-55:o-87;s=s<<4|a}r=(r^s)>>>0}return r}}var $;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})($||($={}));const ps=1;function Yc(){return{sampler:Kc(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Kc(){const e=$.ParentBasedAlwaysOn;switch(e){case $.AlwaysOn:return new nt;case $.AlwaysOff:return new oe;case $.ParentBasedAlwaysOn:return new ht({root:new nt});case $.ParentBasedAlwaysOff:return new ht({root:new oe});case $.TraceIdRatio:return new sr(ms());case $.ParentBasedTraceIdRatio:return new ht({root:new sr(ms())});default:return p.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${$.ParentBasedAlwaysOn}".`),new ht({root:new nt})}}function ms(){return p.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${ps}.`),ps}const Qc=128,Jc=1/0;function Zc(e){var r,n,s,i,o,a,u,l,h,d,f,_;const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=(a=(o=(i=(s=(r=e.spanLimits)==null?void 0:r.attributeCountLimit)!=null?s:(n=e.generalLimits)==null?void 0:n.attributeCountLimit)!=null?i:void 0)!=null?o:void 0)!=null?a:Qc,t.attributeValueLengthLimit=(_=(f=(d=(h=(u=e.spanLimits)==null?void 0:u.attributeValueLengthLimit)!=null?h:(l=e.generalLimits)==null?void 0:l.attributeValueLengthLimit)!=null?d:void 0)!=null?f:void 0)!=null?_:Jc,Object.assign({},e,{spanLimits:t})}class tu extends Xc{constructor(t={}){const r=pc({},Yc(),Zc(t));delete r.generalLimits,super(r)}}class eu extends Hc{constructor(t,r){r||(r={});const n=[["maxExportBatchSize","OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],["maxQueueSize","OTEL_BSP_MAX_QUEUE_SIZE"],["scheduledDelayMillis","OTEL_BSP_SCHEDULE_DELAY"],["exportTimeoutMillis","OTEL_BSP_EXPORT_TIMEOUT"]];for(const[s,i]of n)r[s];super({exporter:t,...r})}}class ru{constructor(){c(this,"_enabled",!1);c(this,"_currentContext",et)}_bindFunction(t=et,r){const n=this,s=function(...i){return n.with(t,()=>r.apply(this,i))};return Object.defineProperty(s,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),s}active(){return this._currentContext}bind(t,r){return t===void 0&&(t=this.active()),typeof r=="function"?this._bindFunction(t,r):r}disable(){return this._currentContext=et,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=et,this)}with(t,r,n,...s){const i=this._currentContext;this._currentContext=t||et;try{return r.call(n,...s)}finally{this._currentContext=i}}}function nu(e){if(e!==null){if(e===void 0){const t=new ru;t.enable(),b.setGlobalContextManager(t);return}e.enable(),b.setGlobalContextManager(e)}}function su(e){if(e!==null){if(e===void 0){U.setGlobalPropagator(new Ha({propagators:[new nc,new Ca]}));return}U.setGlobalPropagator(e)}}class iu extends tu{constructor(t={}){super(t)}register(t={}){R.setGlobalTracerProvider(this),su(t.propagator),nu(t.contextManager)}}var S;(function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"})(S||(S={}));const ou="http.response_content_length",au="http.response_content_length_uncompressed";let ir;function cu(){return ir||(ir=document.createElement("a")),ir}function dt(e,t){return t in e}function C(e,t,r,n=!0){if(dt(r,t)&&typeof r[t]=="number"&&!(n&&r[t]===0))return e.addEvent(t,r[t])}function _t(e,t,r=!1,n,s){if(n===void 0&&(n=t[S.START_TIME]!==0),r||(C(e,S.FETCH_START,t,n),C(e,S.DOMAIN_LOOKUP_START,t,n),C(e,S.DOMAIN_LOOKUP_END,t,n),C(e,S.CONNECT_START,t,n),C(e,S.SECURE_CONNECTION_START,t,n),C(e,S.CONNECT_END,t,n),C(e,S.REQUEST_START,t,n),C(e,S.RESPONSE_START,t,n),C(e,S.RESPONSE_END,t,n)),!s){const i=t[S.ENCODED_BODY_SIZE];i!==void 0&&e.setAttribute(ou,i);const o=t[S.DECODED_BODY_SIZE];o!==void 0&&i!==o&&e.setAttribute(au,o)}}function uu(e){return e.slice().sort((t,r)=>{const n=t[S.FETCH_START],s=r[S.FETCH_START];return n>s?1:n<s?-1:0})}function gs(){return typeof location<"u"?location.origin:void 0}function Es(e,t,r,n,s=new WeakSet,i){const o=K(e);e=o.toString();const a=hu(e,t,r,n,s,i);if(a.length===0)return{mainRequest:void 0};if(a.length===1)return{mainRequest:a[0]};const u=uu(a);if(o.origin!==gs()&&u.length>1){let l=u[0],h=lu(u,l[S.RESPONSE_END],r);const d=l[S.RESPONSE_END];return h[S.FETCH_START]<d&&(h=l,l=void 0),{corsPreFlightRequest:l,mainRequest:h}}else return{mainRequest:a[0]}}function lu(e,t,r){const n=j(r),s=j(xt(t));let i=e[1],o;const a=e.length;for(let u=1;u<a;u++){const l=e[u],h=j(xt(l[S.FETCH_START])),d=j(xt(l[S.RESPONSE_END])),f=n-d;h>=s&&(!o||f<o)&&(o=f,i=l)}return i}function hu(e,t,r,n,s,i){const o=j(t),a=j(r);let u=n.filter(l=>{const h=j(xt(l[S.FETCH_START])),d=j(xt(l[S.RESPONSE_END]));return l.initiatorType.toLowerCase()===(i||"xmlhttprequest")&&l.name===e&&h>=o&&d<=a});return u.length>0&&(u=u.filter(l=>!s.has(l))),u}function K(e){if(typeof URL=="function")return new URL(e,typeof document<"u"?document.baseURI:typeof location<"u"?location.href:void 0);const t=cu();return t.href=e,t}function Ts(e,t){let r=t||[];return(typeof r=="string"||r instanceof RegExp)&&(r=[r]),K(e).origin===gs()?!0:r.some(s=>ss(e,s))}var k;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE"})(k||(k={}));var g;(function(e){e.COUNTER="COUNTER",e.GAUGE="GAUGE",e.HISTOGRAM="HISTOGRAM",e.UP_DOWN_COUNTER="UP_DOWN_COUNTER",e.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",e.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",e.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(g||(g={}));var V;(function(e){e[e.HISTOGRAM=0]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",e[e.GAUGE=2]="GAUGE",e[e.SUM=3]="SUM"})(V||(V={}));function Ss(e){let t=Object.keys(e);return t.length===0?"":(t=t.sort(),JSON.stringify(t.map(r=>[r,e[r]])))}function du(e){var t,r;return`${e.name}:${(t=e.version)!=null?t:""}:${(r=e.schemaUrl)!=null?r:""}`}class Se extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Se.prototype)}}function kt(e,t){let r;const n=new Promise(function(i,o){r=setTimeout(function(){o(new Se("Operation timed out."))},t)});return Promise.race([e,n]).then(s=>(clearTimeout(r),s),s=>{throw clearTimeout(r),s})}function _u(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function fu(e,t){let r=0,n=e.length-1,s=e.length;for(;n>=r;){const i=r+Math.trunc((n-r)/2);e[i]<t?r=i+1:(s=i,n=i-1)}return s}function pu(e,t){return e.toLowerCase()===t.toLowerCase()}var it;(function(e){e[e.DROP=0]="DROP",e[e.SUM=1]="SUM",e[e.LAST_VALUE=2]="LAST_VALUE",e[e.HISTOGRAM=3]="HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(it||(it={}));class mu{constructor(){c(this,"kind",it.DROP)}createAccumulation(){}merge(t,r){}diff(t,r){}toMetricData(t,r,n,s){}}function gu(e){const t=e.map(()=>0);return t.push(0),{buckets:{boundaries:e,counts:t},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}class or{constructor(t,r,n=!0,s=gu(r)){c(this,"startTime");c(this,"_boundaries");c(this,"_recordMinMax");c(this,"_current");this.startTime=t,this._boundaries=r,this._recordMinMax=n,this._current=s}record(t){if(Number.isNaN(t))return;this._current.count+=1,this._current.sum+=t,this._recordMinMax&&(this._current.min=Math.min(t,this._current.min),this._current.max=Math.max(t,this._current.max),this._current.hasMinMax=!0);const r=fu(this._boundaries,t);this._current.buckets.counts[r]+=1}setStartTime(t){this.startTime=t}toPointValue(){return this._current}}class As{constructor(t,r){c(this,"kind",it.HISTOGRAM);c(this,"_boundaries");c(this,"_recordMinMax");this._boundaries=t,this._recordMinMax=r}createAccumulation(t){return new or(t,this._boundaries,this._recordMinMax)}merge(t,r){const n=t.toPointValue(),s=r.toPointValue(),i=n.buckets.counts,o=s.buckets.counts,a=new Array(i.length);for(let h=0;h<i.length;h++)a[h]=i[h]+o[h];let u=1/0,l=-1/0;return this._recordMinMax&&(n.hasMinMax&&s.hasMinMax?(u=Math.min(n.min,s.min),l=Math.max(n.max,s.max)):n.hasMinMax?(u=n.min,l=n.max):s.hasMinMax&&(u=s.min,l=s.max)),new or(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+s.count,sum:n.sum+s.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||s.hasMinMax),min:u,max:l})}diff(t,r){const n=t.toPointValue(),s=r.toPointValue(),i=n.buckets.counts,o=s.buckets.counts,a=new Array(i.length);for(let u=0;u<i.length;u++)a[u]=o[u]-i[u];return new or(r.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:s.count-n.count,sum:s.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(t,r,n,s){return{descriptor:t,aggregationTemporality:r,dataPointType:V.HISTOGRAM,dataPoints:n.map(([i,o])=>{const a=o.toPointValue(),u=t.type===g.GAUGE||t.type===g.UP_DOWN_COUNTER||t.type===g.OBSERVABLE_GAUGE||t.type===g.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:i,startTime:o.startTime,endTime:s,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}}})}}}class Ae{constructor(t=new Vr,r=0,n=0,s=0){c(this,"backing");c(this,"indexBase");c(this,"indexStart");c(this,"indexEnd");this.backing=t,this.indexBase=r,this.indexStart=n,this.indexEnd=s}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(t,r)=>this.at(r))}at(t){const r=this.indexBase-this.indexStart;return t<r&&(t+=this.backing.length),t-=r,this.backing.countAt(t)}incrementBucket(t,r){this.backing.increment(t,r)}decrementBucket(t,r){this.backing.decrement(t,r)}trim(){for(let t=0;t<this.length;t++)if(this.at(t)!==0){this.indexStart+=t;break}else if(t===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let t=this.length-1;t>=0;t--)if(this.at(t)!==0){this.indexEnd-=this.length-t-1;break}this._rotate()}downscale(t){this._rotate();const r=1+this.indexEnd-this.indexStart,n=1<<t;let s=0,i=0;for(let o=this.indexStart;o<=this.indexEnd;){let a=o%n;a<0&&(a+=n);for(let u=a;u<n&&s<r;u++)this._relocateBucket(i,s),s++,o++;i++}this.indexStart>>=t,this.indexEnd>>=t,this.indexBase=this.indexStart}clone(){return new Ae(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){const t=this.indexBase-this.indexStart;t!==0&&(t>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,t),this.backing.reverse(t,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+t)),this.indexBase=this.indexStart)}_relocateBucket(t,r){t!==r&&this.incrementBucket(t,this.backing.emptyBucket(r))}}class Vr{constructor(t=[0]){c(this,"_counts");this._counts=t}get length(){return this._counts.length}countAt(t){return this._counts[t]}growTo(t,r,n){const s=new Array(t).fill(0);s.splice(n,this._counts.length-r,...this._counts.slice(r)),s.splice(0,r,...this._counts.slice(0,r)),this._counts=s}reverse(t,r){const n=Math.floor((t+r)/2)-t;for(let s=0;s<n;s++){const i=this._counts[t+s];this._counts[t+s]=this._counts[r-s-1],this._counts[r-s-1]=i}}emptyBucket(t){const r=this._counts[t];return this._counts[t]=0,r}increment(t,r){this._counts[t]+=r}decrement(t,r){this._counts[t]>=r?this._counts[t]-=r:this._counts[t]=0}clone(){return new Vr([...this._counts])}}const Eu=52,Tu=2146435072,Su=1048575,ar=1023,bs=-ar+1,ws=ar,cr=Math.pow(2,-1022);function Rs(e){const t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e),((t.getUint32(0)&Tu)>>20)-ar}function Os(e){const t=new DataView(new ArrayBuffer(8));t.setFloat64(0,e);const r=t.getUint32(0),n=t.getUint32(4);return(r&Su)*Math.pow(2,32)+n}function ur(e,t){return e===0||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||Number.isNaN(e)?e:e*Math.pow(2,t)}function Au(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}class Bt extends Error{}class bu{constructor(t){c(this,"_shift");this._shift=-t}mapToIndex(t){if(t<cr)return this._minNormalLowerBoundaryIndex();const r=Rs(t),n=this._rightShift(Os(t)-1,Eu);return r+n>>this._shift}lowerBoundary(t){const r=this._minNormalLowerBoundaryIndex();if(t<r)throw new Bt(`underflow: ${t} is < minimum lower boundary: ${r}`);const n=this._maxNormalLowerBoundaryIndex();if(t>n)throw new Bt(`overflow: ${t} is > maximum lower boundary: ${n}`);return ur(1,t<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let t=bs>>this._shift;return this._shift<2&&t--,t}_maxNormalLowerBoundaryIndex(){return ws>>this._shift}_rightShift(t,r){return Math.floor(t*Math.pow(2,-r))}}class wu{constructor(t){c(this,"_scale");c(this,"_scaleFactor");c(this,"_inverseFactor");this._scale=t,this._scaleFactor=ur(Math.LOG2E,t),this._inverseFactor=ur(Math.LN2,-t)}mapToIndex(t){if(t<=cr)return this._minNormalLowerBoundaryIndex()-1;if(Os(t)===0)return(Rs(t)<<this._scale)-1;const r=Math.floor(Math.log(t)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return r>=n?n:r}lowerBoundary(t){const r=this._maxNormalLowerBoundaryIndex();if(t>=r){if(t===r)return 2*Math.exp((t-(1<<this._scale))/this._scaleFactor);throw new Bt(`overflow: ${t} is > maximum lower boundary: ${r}`)}const n=this._minNormalLowerBoundaryIndex();if(t<=n){if(t===n)return cr;if(t===n-1)return Math.exp((t+(1<<this._scale))/this._scaleFactor)/2;throw new Bt(`overflow: ${t} is < minimum lower boundary: ${n}`)}return Math.exp(t*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return bs<<this._scale}_maxNormalLowerBoundaryIndex(){return(ws+1<<this._scale)-1}}const Cs=-10,ys=20,Ru=Array.from({length:31},(e,t)=>t>10?new wu(t-10):new bu(t-10));function Ps(e){if(e>ys||e<Cs)throw new Bt(`expected scale >= ${Cs} && <= ${ys}, got: ${e}`);return Ru[e+10]}class Et{constructor(t,r){c(this,"low");c(this,"high");this.low=t,this.high=r}static combine(t,r){return new Et(Math.min(t.low,r.low),Math.max(t.high,r.high))}}const Ou=20,Cu=160,lr=2;class Hr{constructor(t,r=Cu,n=!0,s=0,i=0,o=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,l=new Ae,h=new Ae,d=Ps(Ou)){c(this,"startTime");c(this,"_maxSize");c(this,"_recordMinMax");c(this,"_sum");c(this,"_count");c(this,"_zeroCount");c(this,"_min");c(this,"_max");c(this,"_positive");c(this,"_negative");c(this,"_mapping");this.startTime=t,this._maxSize=r,this._recordMinMax=n,this._sum=s,this._count=i,this._zeroCount=o,this._min=a,this._max=u,this._positive=l,this._negative=h,this._mapping=d,this._maxSize<lr&&(p.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${lr}`),this._maxSize=lr)}record(t){this.updateByIncrement(t,1)}setStartTime(t){this.startTime=t}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(t,r){if(!Number.isNaN(t)){if(t>this._max&&(this._max=t),t<this._min&&(this._min=t),this._count+=r,t===0){this._zeroCount+=r;return}this._sum+=t*r,t>0?this._updateBuckets(this._positive,t,r):this._updateBuckets(this._negative,-t,r)}}merge(t){this._count===0?(this._min=t.min,this._max=t.max):t.count!==0&&(t.min<this.min&&(this._min=t.min),t.max>this.max&&(this._max=t.max)),this.startTime=t.startTime,this._sum+=t.sum,this._count+=t.count,this._zeroCount+=t.zeroCount;const r=this._minScale(t);this._downscale(this.scale-r),this._mergeBuckets(this.positive,t,t.positive,r),this._mergeBuckets(this.negative,t,t.negative,r)}diff(t){this._min=1/0,this._max=-1/0,this._sum-=t.sum,this._count-=t.count,this._zeroCount-=t.zeroCount;const r=this._minScale(t);this._downscale(this.scale-r),this._diffBuckets(this.positive,t,t.positive,r),this._diffBuckets(this.negative,t,t.negative,r)}clone(){return new Hr(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(t,r,n){let s=this._mapping.mapToIndex(r),i=!1,o=0,a=0;if(t.length===0?(t.indexStart=s,t.indexEnd=t.indexStart,t.indexBase=t.indexStart):s<t.indexStart&&t.indexEnd-s>=this._maxSize?(i=!0,a=s,o=t.indexEnd):s>t.indexEnd&&s-t.indexStart>=this._maxSize&&(i=!0,a=t.indexStart,o=s),i){const u=this._changeScale(o,a);this._downscale(u),s=this._mapping.mapToIndex(r)}this._incrementIndexBy(t,s,n)}_incrementIndexBy(t,r,n){if(n===0)return;if(t.length===0&&(t.indexStart=t.indexEnd=t.indexBase=r),r<t.indexStart){const i=t.indexEnd-r;i>=t.backing.length&&this._grow(t,i+1),t.indexStart=r}else if(r>t.indexEnd){const i=r-t.indexStart;i>=t.backing.length&&this._grow(t,i+1),t.indexEnd=r}let s=r-t.indexBase;s<0&&(s+=t.backing.length),t.incrementBucket(s,n)}_grow(t,r){const n=t.backing.length,s=t.indexBase-t.indexStart,i=n-s;let o=Au(r);o>this._maxSize&&(o=this._maxSize);const a=o-s;t.backing.growTo(o,i,a)}_changeScale(t,r){let n=0;for(;t-r>=this._maxSize;)t>>=1,r>>=1,n++;return n}_downscale(t){if(t===0)return;if(t<0)throw new Error(`impossible change of scale: ${this.scale}`);const r=this._mapping.scale-t;this._positive.downscale(t),this._negative.downscale(t),this._mapping=Ps(r)}_minScale(t){const r=Math.min(this.scale,t.scale),n=Et.combine(this._highLowAtScale(this.positive,this.scale,r),this._highLowAtScale(t.positive,t.scale,r)),s=Et.combine(this._highLowAtScale(this.negative,this.scale,r),this._highLowAtScale(t.negative,t.scale,r));return Math.min(r-this._changeScale(n.high,n.low),r-this._changeScale(s.high,s.low))}_highLowAtScale(t,r,n){if(t.length===0)return new Et(0,-1);const s=r-n;return new Et(t.indexStart>>s,t.indexEnd>>s)}_mergeBuckets(t,r,n,s){const i=n.offset,o=r.scale-s;for(let a=0;a<n.length;a++)this._incrementIndexBy(t,i+a>>o,n.at(a))}_diffBuckets(t,r,n,s){const i=n.offset,o=r.scale-s;for(let a=0;a<n.length;a++){let l=(i+a>>o)-t.indexBase;l<0&&(l+=t.backing.length),t.decrementBucket(l,n.at(a))}t.trim()}}class yu{constructor(t,r){c(this,"kind",it.EXPONENTIAL_HISTOGRAM);c(this,"_maxSize");c(this,"_recordMinMax");this._maxSize=t,this._recordMinMax=r}createAccumulation(t){return new Hr(t,this._maxSize,this._recordMinMax)}merge(t,r){const n=r.clone();return n.merge(t),n}diff(t,r){const n=r.clone();return n.diff(t),n}toMetricData(t,r,n,s){return{descriptor:t,aggregationTemporality:r,dataPointType:V.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([i,o])=>{const a=o.toPointValue(),u=t.type===g.GAUGE||t.type===g.UP_DOWN_COUNTER||t.type===g.OBSERVABLE_GAUGE||t.type===g.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:i,startTime:o.startTime,endTime:s,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}}})}}}class hr{constructor(t,r=0,n=[0,0]){c(this,"startTime");c(this,"_current");c(this,"sampleTime");this.startTime=t,this._current=r,this.sampleTime=n}record(t){this._current=t,this.sampleTime=L(Date.now())}setStartTime(t){this.startTime=t}toPointValue(){return this._current}}class Pu{constructor(){c(this,"kind",it.LAST_VALUE)}createAccumulation(t){return new hr(t)}merge(t,r){const n=ee(r.sampleTime)>=ee(t.sampleTime)?r:t;return new hr(t.startTime,n.toPointValue(),n.sampleTime)}diff(t,r){const n=ee(r.sampleTime)>=ee(t.sampleTime)?r:t;return new hr(r.startTime,n.toPointValue(),n.sampleTime)}toMetricData(t,r,n,s){return{descriptor:t,aggregationTemporality:r,dataPointType:V.GAUGE,dataPoints:n.map(([i,o])=>({attributes:i,startTime:o.startTime,endTime:s,value:o.toPointValue()}))}}}class Gt{constructor(t,r,n=0,s=!1){c(this,"startTime");c(this,"monotonic");c(this,"_current");c(this,"reset");this.startTime=t,this.monotonic=r,this._current=n,this.reset=s}record(t){this.monotonic&&t<0||(this._current+=t)}setStartTime(t){this.startTime=t}toPointValue(){return this._current}}class Ms{constructor(t){c(this,"kind",it.SUM);c(this,"monotonic");this.monotonic=t}createAccumulation(t){return new Gt(t,this.monotonic)}merge(t,r){const n=t.toPointValue(),s=r.toPointValue();return r.reset?new Gt(r.startTime,this.monotonic,s,r.reset):new Gt(t.startTime,this.monotonic,n+s)}diff(t,r){const n=t.toPointValue(),s=r.toPointValue();return this.monotonic&&n>s?new Gt(r.startTime,this.monotonic,s,!0):new Gt(r.startTime,this.monotonic,s-n)}toMetricData(t,r,n,s){return{descriptor:t,aggregationTemporality:r,dataPointType:V.SUM,dataPoints:n.map(([i,o])=>({attributes:i,startTime:o.startTime,endTime:s,value:o.toPointValue()})),isMonotonic:this.monotonic}}}const we=class we{createAggregator(t){return we.DEFAULT_INSTANCE}};c(we,"DEFAULT_INSTANCE",new mu);let dr=we;const Tt=class Tt{createAggregator(t){switch(t.type){case g.COUNTER:case g.OBSERVABLE_COUNTER:case g.HISTOGRAM:return Tt.MONOTONIC_INSTANCE;default:return Tt.NON_MONOTONIC_INSTANCE}}};c(Tt,"MONOTONIC_INSTANCE",new Ms(!0)),c(Tt,"NON_MONOTONIC_INSTANCE",new Ms(!1));let _r=Tt;const Re=class Re{createAggregator(t){return Re.DEFAULT_INSTANCE}};c(Re,"DEFAULT_INSTANCE",new Pu);let fr=Re;const Oe=class Oe{createAggregator(t){return Oe.DEFAULT_INSTANCE}};c(Oe,"DEFAULT_INSTANCE",new As([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0));let pr=Oe;class vs{constructor(t,r=!0){c(this,"_boundaries");c(this,"_recordMinMax");if(t==null)throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array");t=t.concat(),t=t.sort((i,o)=>i-o);const n=t.lastIndexOf(-1/0);let s=t.indexOf(1/0);s===-1&&(s=void 0),this._boundaries=t.slice(n+1,s),this._recordMinMax=r}createAggregator(t){return new As(this._boundaries,this._recordMinMax)}}class Mu{constructor(t=160,r=!0){c(this,"_maxSize");c(this,"_recordMinMax");this._maxSize=t,this._recordMinMax=r}createAggregator(t){return new yu(this._maxSize,this._recordMinMax)}}class vu{_resolve(t){switch(t.type){case g.COUNTER:case g.UP_DOWN_COUNTER:case g.OBSERVABLE_COUNTER:case g.OBSERVABLE_UP_DOWN_COUNTER:return Ls;case g.GAUGE:case g.OBSERVABLE_GAUGE:return Ns;case g.HISTOGRAM:return t.advice.explicitBucketBoundaries?new vs(t.advice.explicitBucketBoundaries):xs}return p.warn(`Unable to recognize instrument type: ${t.type}`),Is}createAggregator(t){return this._resolve(t).createAggregator(t)}}const Is=new dr,Ls=new _r,Ns=new fr,xs=new pr,Iu=new vu;var B;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.DROP=1]="DROP",e[e.SUM=2]="SUM",e[e.LAST_VALUE=3]="LAST_VALUE",e[e.EXPLICIT_BUCKET_HISTOGRAM=4]="EXPLICIT_BUCKET_HISTOGRAM",e[e.EXPONENTIAL_HISTOGRAM=5]="EXPONENTIAL_HISTOGRAM"})(B||(B={}));function Us(e){var t,r,n,s;switch(e.type){case B.DEFAULT:return Iu;case B.DROP:return Is;case B.SUM:return Ls;case B.LAST_VALUE:return Ns;case B.EXPONENTIAL_HISTOGRAM:{const i=e;return new Mu((t=i.options)==null?void 0:t.maxSize,(r=i.options)==null?void 0:r.recordMinMax)}case B.EXPLICIT_BUCKET_HISTOGRAM:{const i=e;return i.options==null?xs:new vs((n=i.options)==null?void 0:n.boundaries,(s=i.options)==null?void 0:s.recordMinMax)}default:throw new Error("Unsupported Aggregation")}}const Lu=e=>({type:B.DEFAULT}),Nu=e=>k.CUMULATIVE,xu="otel.component.name",Uu="otel.component.type",Du="periodic_metric_reader",ku="otel.sdk.metric_reader.collection.duration",Bu="error.type",Ds=new Map;class ks{constructor(t,r){c(this,"collectionDuration");c(this,"standardAttrs");var s;const n=(s=Ds.get(t))!=null?s:0;Ds.set(t,n+1),this.standardAttrs={[Uu]:t,[xu]:`${t}/${n}`},this.collectionDuration=r.createHistogram(ku,{unit:"s",description:"The duration of the collect operation of the metric reader.",advice:{explicitBucketBoundaries:[]}})}recordCollection(t,r){const n=r?{...this.standardAttrs,[Bu]:r}:this.standardAttrs;this.collectionDuration.record(t,n)}}const Gu="2.10.0";class Bs{constructor(t){c(this,"_shutdown",!1);c(this,"_metricProducers");c(this,"_sdkMetricProducer");c(this,"_selfObsMetrics");c(this,"_aggregationTemporalitySelector");c(this,"_aggregationSelector");c(this,"_cardinalitySelector");c(this,"_otelComponentType");var r,n,s,i;this._aggregationSelector=(r=t==null?void 0:t.aggregationSelector)!=null?r:Lu,this._aggregationTemporalitySelector=(n=t==null?void 0:t.aggregationTemporalitySelector)!=null?n:Nu,this._metricProducers=(s=t==null?void 0:t.metricProducers)!=null?s:[],this._cardinalitySelector=t==null?void 0:t.cardinalitySelector,this._otelComponentType=(i=t==null?void 0:t.otelComponentType)!=null?i:this.constructor.name,this._selfObsMetrics=new ks(this._otelComponentType,yt())}setMetricProducer(t){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=t,this.onInitialized()}_setSelfObsMeterProvider(t){const r=t.getMeter("@opentelemetry/sdk-metrics",Gu);this._selfObsMetrics=new ks(this._otelComponentType,r)}selectAggregation(t){return this._aggregationSelector(t)}selectAggregationTemporality(t){return this._aggregationTemporalitySelector(t)}selectCardinalityLimit(t){return this._cardinalitySelector?this._cardinalitySelector(t):2e3}onInitialized(){}async collect(t){var h;if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");const r=G(),[n,...s]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:t==null?void 0:t.timeoutMillis}),...this._metricProducers.map(d=>d.collect({timeoutMillis:t==null?void 0:t.timeoutMillis}))]),i=G(),o=n.errors.concat(s.flatMap(d=>d.errors)),a=Va(Ke(r,i));this._selfObsMetrics.recordCollection(a,o.length>0?(h=o[0].name)!=null?h:"collect_error":void 0);const u=n.resourceMetrics.resource,l=n.resourceMetrics.scopeMetrics.concat(s.flatMap(d=>d.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:u,scopeMetrics:l},errors:o}}async shutdown(t){if(this._shutdown){p.error("Cannot call shutdown twice.");return}(t==null?void 0:t.timeoutMillis)==null?await this.onShutdown():await kt(this.onShutdown(),t.timeoutMillis),this._shutdown=!0}async forceFlush(t){if(this._shutdown){p.warn("Cannot forceFlush on already shutdown MetricReader.");return}if((t==null?void 0:t.timeoutMillis)==null){await this.onForceFlush();return}await kt(this.onForceFlush(),t.timeoutMillis)}}function Fu(e,t){if(!Number.isInteger(t)||t<=0)throw new Error("maxExportBatchSize must be a positive integer");const r=[];let n=0,s=[];function i(){s.length>0&&(r.push({resource:e.resource,scopeMetrics:s}),s=[],n=0)}for(const o of e.scopeMetrics){let a=null;for(const u of o.metrics){const l=u.dataPoints;if(l.length===0){a||(a={scope:o.scope,metrics:[]},s.push(a)),a.metrics.push(u);continue}let h=0;for(;h<l.length;){const d=t-n,f=Math.min(d,l.length-h);a||(a={scope:o.scope,metrics:[]},s.push(a));const _={...u,dataPoints:l.slice(h,h+f)};a.metrics.push(_),h+=f,n+=f,n===t&&(i(),a=null)}}}return i(),r}class $u extends Bs{constructor(r){var l,h;const{exporter:n,exportIntervalMillis:s=6e4,metricProducers:i,cardinalityLimits:o,maxExportBatchSize:a}=r;let{exportTimeoutMillis:u=3e4}=r;super({aggregationSelector:(l=n.selectAggregation)==null?void 0:l.bind(n),aggregationTemporalitySelector:(h=n.selectAggregationTemporality)==null?void 0:h.bind(n),otelComponentType:Du,metricProducers:i,cardinalitySelector:d=>{var _,E,m,T,A,M,y;const f={default:2e3,...o};switch(d){case g.COUNTER:return(_=f.counter)!=null?_:f.default;case g.GAUGE:return(E=f.gauge)!=null?E:f.default;case g.HISTOGRAM:return(m=f.histogram)!=null?m:f.default;case g.OBSERVABLE_COUNTER:return(T=f.observableCounter)!=null?T:f.default;case g.OBSERVABLE_UP_DOWN_COUNTER:return(A=f.observableUpDownCounter)!=null?A:f.default;case g.OBSERVABLE_GAUGE:return(M=f.observableGauge)!=null?M:f.default;case g.UP_DOWN_COUNTER:return(y=f.upDownCounter)!=null?y:f.default;default:return f.default}}});c(this,"_interval");c(this,"_exporter");c(this,"_exportInterval");c(this,"_exportTimeout");c(this,"_maxExportBatchSize");c(this,"_ongoingExportPromise",null);if(s<=0)throw Error("exportIntervalMillis must be greater than 0");if(u<=0)throw Error("exportTimeoutMillis must be greater than 0");if(a!==void 0&&(!Number.isInteger(a)||a<=0))throw Error("maxExportBatchSize must be a positive integer");if(s<u){if("exportIntervalMillis"in r&&"exportTimeoutMillis"in r)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");p.info(`Timeout of ${u} exceeds the interval of ${s}. Clamping timeout to interval duration.`),u=s}this._exportInterval=s,this._exportTimeout=u,this._exporter=n,this._maxExportBatchSize=a}async _runOnce(){try{await this._doRun()}catch(r){Y(r)}}async _doRun(){if(this._ongoingExportPromise){p.debug("PeriodicExportingMetricReader: export already in progress, skipping");return}const r=async()=>{var a,u;const{resourceMetrics:n,errors:s}=await this.collect({timeoutMillis:this._exportTimeout});if(s.length>0&&p.error("PeriodicExportingMetricReader: metrics collection errors",...s),n.resource.asyncAttributesPending)try{await((u=(a=n.resource).waitForAsyncAttributes)==null?void 0:u.call(a))}catch(l){p.debug("Error while resolving async portion of resource: ",l),Y(l)}if(n.scopeMetrics.length===0)return;const i=this._maxExportBatchSize?Fu(n,this._maxExportBatchSize):[n];let o=null;for(const l of i)try{const h=await kt(Sc._export(this._exporter,l),this._exportTimeout);h.code!==D.SUCCESS&&(o=new Error(`PeriodicExportingMetricReader: metrics export failed (error ${h.error})`))}catch(h){if(h instanceof Se){p.error(`PeriodicExportingMetricReader: metrics export timed out after ${this._exportTimeout}ms`);break}else p.error("PeriodicExportingMetricReader: metrics export threw error",h),o=h instanceof Error?h:new Error(String(h))}if(o)throw o};this._ongoingExportPromise=r();try{await this._ongoingExportPromise}finally{this._ongoingExportPromise=null}}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),typeof this._interval!="number"&&this._interval.unref()}async onForceFlush(){await this._awaitOngoingExport(),this._ongoingExportPromise?await this._awaitOngoingExport():await this._runOnce(),await this._exporter.forceFlush()}async _awaitOngoingExport(){if(this._ongoingExportPromise){p.debug("PeriodicExportingMetricReader: export already in progress, awaiting ongoing export");try{await this._ongoingExportPromise}catch(r){}}}async onShutdown(){this._interval&&clearInterval(this._interval),await this.onForceFlush(),await this._exporter.shutdown()}}class Vu{constructor(){c(this,"_registeredViews",[])}addView(t){this._registeredViews.push(t)}findViews(t,r){return this._registeredViews.filter(s=>this._matchInstrument(s.instrumentSelector,t)&&this._matchMeter(s.meterSelector,r))}_matchInstrument(t,r){return(t.getType()===void 0||r.type===t.getType())&&t.getNameFilter().match(r.name)&&t.getUnitFilter().match(r.unit)}_matchMeter(t,r){return t.getNameFilter().match(r.name)&&(r.version===void 0||t.getVersionFilter().match(r.version))&&(r.schemaUrl===void 0||t.getSchemaUrlFilter().match(r.schemaUrl))}}function Q(e,t,r){var n,s,i,o;return qu(e)||p.warn(`Invalid metric name: "${e}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:e,type:t,description:(n=r==null?void 0:r.description)!=null?n:"",unit:(s=r==null?void 0:r.unit)!=null?s:"",valueType:(i=r==null?void 0:r.valueType)!=null?i:X.DOUBLE,advice:(o=r==null?void 0:r.advice)!=null?o:{}}}function Hu(e,t){var r,n;return{name:(r=e.name)!=null?r:t.name,description:(n=e.description)!=null?n:t.description,type:t.type,unit:t.unit,valueType:t.valueType,advice:t.advice}}function zu(e,t){return pu(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}const ju=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function qu(e){return ju.test(e)}class ae{constructor(t,r){c(this,"_writableMetricStorage");c(this,"_descriptor");this._writableMetricStorage=t,this._descriptor=r}_record(t,r={},n){if(typeof t!="number"){p.warn(`non-number value provided to metric ${this._descriptor.name}: ${t}`);return}this._descriptor.valueType===X.INT&&!Number.isInteger(t)&&(p.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._writableMetricStorage.record(t,r,n,Date.now())}}class Wu extends ae{add(t,r,n){this._record(t,r,n)}}class Xu extends ae{add(t,r,n){if(t<0){p.warn(`negative value provided to counter ${this._descriptor.name}: ${t}`);return}this._record(t,r,n)}}class Yu extends ae{record(t,r,n){this._record(t,r,n)}}class Ku extends ae{record(t,r,n){if(t<0){p.warn(`negative value provided to histogram ${this._descriptor.name}: ${t}`);return}this._record(t,r,n)}}class ce{constructor(t,r,n){c(this,"_metricStorages");c(this,"_descriptor");c(this,"_observableRegistry");this._descriptor=t,this._metricStorages=r,this._observableRegistry=n}addCallback(t){this._observableRegistry.addCallback(t,this)}removeCallback(t){this._observableRegistry.removeCallback(t,this)}}class Qu extends ce{}class Ju extends ce{}class Zu extends ce{}function mr(e){return e instanceof ce}class tl{constructor(t){c(this,"_meterSharedState");this._meterSharedState=t}createGauge(t,r){const n=Q(t,g.GAUGE,r),s=this._meterSharedState.registerMetricStorage(n);return new Yu(s,n)}createHistogram(t,r){const n=Q(t,g.HISTOGRAM,r),s=this._meterSharedState.registerMetricStorage(n);return new Ku(s,n)}createCounter(t,r){const n=Q(t,g.COUNTER,r),s=this._meterSharedState.registerMetricStorage(n);return new Xu(s,n)}createUpDownCounter(t,r){const n=Q(t,g.UP_DOWN_COUNTER,r),s=this._meterSharedState.registerMetricStorage(n);return new Wu(s,n)}createObservableGauge(t,r){const n=Q(t,g.OBSERVABLE_GAUGE,r),s=this._meterSharedState.registerAsyncMetricStorage(n);return new Ju(n,s,this._meterSharedState.observableRegistry)}createObservableCounter(t,r){const n=Q(t,g.OBSERVABLE_COUNTER,r),s=this._meterSharedState.registerAsyncMetricStorage(n);return new Qu(n,s,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(t,r){const n=Q(t,g.OBSERVABLE_UP_DOWN_COUNTER,r),s=this._meterSharedState.registerAsyncMetricStorage(n);return new Zu(n,s,this._meterSharedState.observableRegistry)}addBatchObservableCallback(t,r){this._meterSharedState.observableRegistry.addBatchCallback(t,r)}removeBatchObservableCallback(t,r){this._meterSharedState.observableRegistry.removeBatchCallback(t,r)}}class Gs{constructor(t){c(this,"_instrumentDescriptor");this._instrumentDescriptor=t}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(t){this._instrumentDescriptor=Q(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:t,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}}class el{constructor(t){c(this,"_valueMap",new Map);c(this,"_keyMap",new Map);c(this,"_hash");this._hash=t}get(t,r){return r!=null||(r=this._hash(t)),this._valueMap.get(r)}getOrDefault(t,r){const n=this._hash(t);if(this._valueMap.has(n))return this._valueMap.get(n);const s=r();return this._keyMap.has(n)||this._keyMap.set(n,t),this._valueMap.set(n,s),s}set(t,r,n){n!=null||(n=this._hash(t)),this._keyMap.has(n)||this._keyMap.set(n,t),this._valueMap.set(n,r)}has(t,r){return r!=null||(r=this._hash(t)),this._valueMap.has(r)}*keys(){const t=this._keyMap.entries();let r=t.next();for(;r.done!==!0;)yield[r.value[1],r.value[0]],r=t.next()}*entries(){const t=this._valueMap.entries();let r=t.next();for(;r.done!==!0;)yield[this._keyMap.get(r.value[0]),r.value[1],r.value[0]],r=t.next()}get size(){return this._valueMap.size}}class ot extends el{constructor(){super(Ss)}}class Fs{constructor(t,r){c(this,"_activeCollectionStorage",new ot);c(this,"_cumulativeMemoStorage",new ot);c(this,"_cardinalityLimit");c(this,"_overflowAttributes",{"otel.metric.overflow":!0});c(this,"_overflowHashCode");c(this,"_aggregator");this._aggregator=t,this._cardinalityLimit=(r!=null?r:2e3)-1,this._overflowHashCode=Ss(this._overflowAttributes)}record(t,r,n){let s=this._activeCollectionStorage.get(r);if(!s){const i=L(n);if(this._activeCollectionStorage.size>=this._cardinalityLimit){const o=this._activeCollectionStorage.getOrDefault(this._overflowAttributes,()=>this._aggregator.createAccumulation(i));o==null||o.record(t);return}s=this._aggregator.createAccumulation(i),this._activeCollectionStorage.set(r,s)}s==null||s.record(t)}batchCumulate(t,r){for(const[n,s,i]of t.entries()){let o=n,a=i;const u=this._aggregator.createAccumulation(r);u==null||u.record(s);let l=u;if(this._cumulativeMemoStorage.has(o,a)){const h=this._cumulativeMemoStorage.get(o,a);l=this._aggregator.diff(h,u)}else if(this._cumulativeMemoStorage.size>=this._cardinalityLimit&&(o=this._overflowAttributes,a=this._overflowHashCode,this._cumulativeMemoStorage.has(o,a))){const h=this._cumulativeMemoStorage.get(o,a);l=this._aggregator.diff(h,u)}if(this._activeCollectionStorage.has(o,a)){const h=this._activeCollectionStorage.get(o,a);l=this._aggregator.merge(h,l)}this._cumulativeMemoStorage.set(o,u,a),this._activeCollectionStorage.set(o,l,a)}}collect(){const t=this._activeCollectionStorage;return this._activeCollectionStorage=new ot,t}}class St{constructor(t,r){c(this,"_aggregator");c(this,"_unreportedAccumulations",new Map);c(this,"_reportHistory",new Map);this._aggregator=t,r.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(t,r,n,s){this._stashAccumulations(n);const i=this._getMergedUnreportedAccumulations(t);let o=i,a;if(this._reportHistory.has(t)){const l=this._reportHistory.get(t),h=l.collectionTime;a=l.aggregationTemporality,a===k.CUMULATIVE?o=St.merge(l.accumulations,i,this._aggregator):o=St.calibrateStartTime(l.accumulations,i,h)}else a=t.selectAggregationTemporality(r.type);this._reportHistory.set(t,{accumulations:o,collectionTime:s,aggregationTemporality:a});const u=rl(o);if(u.length!==0)return this._aggregator.toMetricData(r,a,u,s)}_stashAccumulations(t){const r=this._unreportedAccumulations.keys();for(const n of r){let s=this._unreportedAccumulations.get(n);s===void 0&&(s=[],this._unreportedAccumulations.set(n,s)),s.push(t)}}_getMergedUnreportedAccumulations(t){let r=new ot;const n=this._unreportedAccumulations.get(t);if(this._unreportedAccumulations.set(t,[]),n===void 0)return r;for(const s of n)r=St.merge(r,s,this._aggregator);return r}static merge(t,r,n){const s=t,i=r.entries();let o=i.next();for(;o.done!==!0;){const[a,u,l]=o.value;if(t.has(a,l)){const h=t.get(a,l),d=n.merge(h,u);s.set(a,d,l)}else s.set(a,u,l);o=i.next()}return s}static calibrateStartTime(t,r,n){for(const[s,i]of t.keys()){const o=r.get(s,i);o==null||o.setStartTime(n)}return r}}function rl(e){return Array.from(e.entries())}class nl extends Gs{constructor(r,n,s,i,o){super(r);c(this,"_aggregationCardinalityLimit");c(this,"_deltaMetricStorage");c(this,"_temporalMetricStorage");c(this,"_attributesProcessor");this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new Fs(n,this._aggregationCardinalityLimit),this._temporalMetricStorage=new St(n,i),this._attributesProcessor=s}record(r,n){if(this._attributesProcessor===void 0){this._deltaMetricStorage.batchCumulate(r,n);return}const s=new ot;for(const[i,o]of r.entries())s.set(this._attributesProcessor.process(i),o);this._deltaMetricStorage.batchCumulate(s,n)}collect(r,n){const s=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(r,this._instrumentDescriptor,s,n)}}function $s(e,t){let r="";return e.unit!==t.unit&&(r+=` - Unit '${e.unit}' does not match '${t.unit}'
|
|
2
|
+
`),e.type!==t.type&&(r+=` - Type '${e.type}' does not match '${t.type}'
|
|
3
|
+
`),e.valueType!==t.valueType&&(r+=` - Value Type '${e.valueType}' does not match '${t.valueType}'
|
|
4
|
+
`),e.description!==t.description&&(r+=` - Description '${e.description}' does not match '${t.description}'
|
|
5
|
+
`),r}function sl(e,t){return` - use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function il(e,t){return` - use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function ol(e,t){const r={name:t.name,type:t.type,unit:t.unit},n=JSON.stringify(r);return` - create a new view with a name other than '${e.name}' and InstrumentSelector '${n}'`}function al(e,t){const r={name:t.name,type:t.type,unit:t.unit},n=JSON.stringify(r);return` - create a new view with a name other than '${e.name}' and InstrumentSelector '${n}'
|
|
6
|
+
- OR - create a new view with the name ${e.name} and description '${e.description}' and InstrumentSelector ${n}
|
|
7
|
+
- OR - create a new view with the name ${t.name} and description '${e.description}' and InstrumentSelector ${n}`}function Vs(e,t){return e.valueType!==t.valueType?sl(e,t):e.unit!==t.unit?il(e,t):e.type!==t.type?ol(e,t):e.description!==t.description?al(e,t):""}class zr{constructor(){c(this,"_sharedRegistry",new Map);c(this,"_perCollectorRegistry",new Map)}static create(){return new zr}getStorages(t){let r=[];for(const s of this._sharedRegistry.values())r=r.concat(s);const n=this._perCollectorRegistry.get(t);if(n!=null)for(const s of n.values())r=r.concat(s);return r}register(t){this._registerStorage(t,this._sharedRegistry)}registerForCollector(t,r){let n=this._perCollectorRegistry.get(t);n==null&&(n=new Map,this._perCollectorRegistry.set(t,n)),this._registerStorage(r,n)}findOrUpdateCompatibleStorage(t){const r=this._sharedRegistry.get(t.name);return r===void 0?null:this._findOrUpdateCompatibleStorage(t,r)}findOrUpdateCompatibleCollectorStorage(t,r){const n=this._perCollectorRegistry.get(t);if(n===void 0)return null;const s=n.get(r.name);return s===void 0?null:this._findOrUpdateCompatibleStorage(r,s)}_registerStorage(t,r){const n=t.getInstrumentDescriptor(),s=r.get(n.name);if(s===void 0){r.set(n.name,[t]);return}s.push(t)}_findOrUpdateCompatibleStorage(t,r){let n=null;for(const s of r){const i=s.getInstrumentDescriptor();zu(i,t)?(i.description!==t.description&&(t.description.length>i.description.length&&s.updateDescription(t.description),p.warn("A view or instrument with the name ",t.name,` has already been registered, but has a different description and is incompatible with another registered view.
|
|
8
|
+
`,`Details:
|
|
9
|
+
`,$s(i,t),`The longer description will be used.
|
|
10
|
+
To resolve the conflict:`,Vs(i,t))),n=s):p.warn("A view or instrument with the name ",t.name,` has already been registered and is incompatible with another registered view.
|
|
11
|
+
`,`Details:
|
|
12
|
+
`,$s(i,t),`To resolve the conflict:
|
|
13
|
+
`,Vs(i,t))}return n}}class cl{constructor(t){c(this,"_backingStorages");c(this,"hasAttributeProcessor");this._backingStorages=t,this.hasAttributeProcessor=t.some(r=>r.hasAttributeProcessor)}record(t,r,n,s){this.hasAttributeProcessor&&n===void 0&&(n=b.active());const i=this._backingStorages;for(let o=0;o<i.length;o++)i[o].record(t,r,n,s)}}class ul{constructor(t,r){c(this,"_buffer",new ot);c(this,"_instrumentName");c(this,"_valueType");this._instrumentName=t,this._valueType=r}observe(t,r={}){if(typeof t!="number"){p.warn(`non-number value provided to metric ${this._instrumentName}: ${t}`);return}this._valueType===X.INT&&!Number.isInteger(t)&&(p.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||this._buffer.set(r,t)}}class ll{constructor(){c(this,"_buffer",new Map)}observe(t,r,n={}){if(!mr(t))return;let s=this._buffer.get(t);if(s==null&&(s=new ot,this._buffer.set(t,s)),typeof r!="number"){p.warn(`non-number value provided to metric ${t._descriptor.name}: ${r}`);return}t._descriptor.valueType===X.INT&&!Number.isInteger(r)&&(p.warn(`INT value type cannot accept a floating-point value for ${t._descriptor.name}, ignoring the fractional digits.`),r=Math.trunc(r),!Number.isInteger(r))||s.set(n,r)}}class hl{constructor(){c(this,"_callbacks",[]);c(this,"_batchCallbacks",[])}addCallback(t,r){this._findCallback(t,r)>=0||this._callbacks.push({callback:t,instrument:r})}removeCallback(t,r){const n=this._findCallback(t,r);n<0||this._callbacks.splice(n,1)}addBatchCallback(t,r){const n=new Set(r.filter(mr));if(n.size===0){p.error("BatchObservableCallback is not associated with valid instruments",r);return}this._findBatchCallback(t,n)>=0||this._batchCallbacks.push({callback:t,instruments:n})}removeBatchCallback(t,r){const n=new Set(r.filter(mr)),s=this._findBatchCallback(t,n);s<0||this._batchCallbacks.splice(s,1)}async observe(t,r){const n=this._observeCallbacks(t,r),s=this._observeBatchCallbacks(t,r);return(await Promise.allSettled([...n,...s])).filter(a=>a.status==="rejected").map(a=>a.reason)}_observeCallbacks(t,r){return this._callbacks.map(async({callback:n,instrument:s})=>{const i=new ul(s._descriptor.name,s._descriptor.valueType);let o=Promise.resolve(n(i));r!=null&&(o=kt(o,r)),await o,s._metricStorages.forEach(a=>{a.record(i._buffer,t)})})}_observeBatchCallbacks(t,r){return this._batchCallbacks.map(async({callback:n,instruments:s})=>{const i=new ll;let o=Promise.resolve(n(i));r!=null&&(o=kt(o,r)),await o,s.forEach(a=>{const u=i._buffer.get(a);u!=null&&a._metricStorages.forEach(l=>{l.record(u,t)})})})}_findCallback(t,r){return this._callbacks.findIndex(n=>n.callback===t&&n.instrument===r)}_findBatchCallback(t,r){return this._batchCallbacks.findIndex(n=>n.callback===t&&_u(n.instruments,r))}}class dl extends Gs{constructor(r,n,s,i,o){super(r);c(this,"_aggregationCardinalityLimit");c(this,"_deltaMetricStorage");c(this,"_temporalMetricStorage");c(this,"_attributesProcessor");c(this,"hasAttributeProcessor");this._aggregationCardinalityLimit=o,this._deltaMetricStorage=new Fs(n,this._aggregationCardinalityLimit),this._temporalMetricStorage=new St(n,i),this._attributesProcessor=s,this.hasAttributeProcessor=s!==void 0}record(r,n,s,i){this._attributesProcessor!==void 0&&(n=this._attributesProcessor.process(n,s!=null?s:b.active())),this._deltaMetricStorage.record(r,n,i)}collect(r,n){const s=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(r,this._instrumentDescriptor,s,n)}}class _l{constructor(t,r){c(this,"metricStorageRegistry",new zr);c(this,"observableRegistry",new hl);c(this,"meter");c(this,"_meterProviderSharedState");c(this,"_instrumentationScope");this.meter=new tl(this),this._meterProviderSharedState=t,this._instrumentationScope=r}registerMetricStorage(t){const r=this._registerMetricStorage(t,dl);return r.length===1?r[0]:new cl(r)}registerAsyncMetricStorage(t){return this._registerMetricStorage(t,nl)}async collect(t,r,n){const s=await this.observableRegistry.observe(r,n==null?void 0:n.timeoutMillis),i=this.metricStorageRegistry.getStorages(t);if(i.length===0)return null;const o=[];return i.forEach(a=>{const u=a.collect(t,r);u!=null&&o.push(u)}),o.length===0?{errors:s}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:s}}_registerMetricStorage(t,r){let s=this._meterProviderSharedState.viewRegistry.findViews(t,this._instrumentationScope).map(i=>{const o=Hu(i,t),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;const u=i.aggregation.createAggregator(o),l=new r(o,u,i.attributesProcessor,this._meterProviderSharedState.metricCollectors,i.aggregationCardinalityLimit);return this.metricStorageRegistry.register(l),l});if(s.length===0){const o=this._meterProviderSharedState.selectAggregations(t.type).map(([a,u])=>{const l=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,t);if(l!=null)return l;const h=u.createAggregator(t),d=a.selectCardinalityLimit(t.type),f=new r(t,h,void 0,[a],d);return this.metricStorageRegistry.registerForCollector(a,f),f});s=s.concat(o)}return s}}class fl{constructor(t){c(this,"viewRegistry",new Vu);c(this,"metricCollectors",[]);c(this,"meterSharedStates",new Map);c(this,"resource");this.resource=t}getMeterSharedState(t){const r=du(t);let n=this.meterSharedStates.get(r);return n==null&&(n=new _l(this,t),this.meterSharedStates.set(r,n)),n}selectAggregations(t){const r=[];for(const n of this.metricCollectors)r.push([n,Us(n.selectAggregation(t))]);return r}}class pl{constructor(t,r){c(this,"_sharedState");c(this,"_metricReader");this._sharedState=t,this._metricReader=r}async collect(t){const r=L(Date.now()),n=[],s=[],i=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{const a=await o.collect(this,r,t);(a==null?void 0:a.scopeMetrics)!=null&&n.push(a.scopeMetrics),(a==null?void 0:a.errors)!=null&&s.push(...a.errors)});return await Promise.all(i),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:s}}async forceFlush(t){await this._metricReader.forceFlush(t)}async shutdown(t){await this._metricReader.shutdown(t)}selectAggregationTemporality(t){return this._metricReader.selectAggregationTemporality(t)}selectAggregation(t){return this._metricReader.selectAggregation(t)}selectCardinalityLimit(t){var r,n,s;return(s=(n=(r=this._metricReader).selectCardinalityLimit)==null?void 0:n.call(r,t))!=null?s:2e3}}const ml=/[\^$\\.+?()[\]{}|]/g;class be{constructor(t){c(this,"_matchAll");c(this,"_regexp");t==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(be.escapePattern(t)))}match(t){return this._matchAll?!0:this._regexp.test(t)}static escapePattern(t){return`^${t.replace(ml,"\\$&").replace("*",".*")}$`}static hasWildcard(t){return t.includes("*")}}class ue{constructor(t){c(this,"_matchAll");c(this,"_pattern");this._matchAll=t===void 0,this._pattern=t}match(t){return!!(this._matchAll||t===this._pattern)}}class gl{process(t,r){return t}}class El{constructor(t){c(this,"_processors");this._processors=t}process(t,r){let n=t;for(const s of this._processors)n=s.process(n,r);return n}}function Tl(){return Al}function Sl(e){return new El(e)}const Al=new gl;class bl{constructor(t){c(this,"_nameFilter");c(this,"_type");c(this,"_unitFilter");var r;this._nameFilter=new be((r=t==null?void 0:t.name)!=null?r:"*"),this._type=t==null?void 0:t.type,this._unitFilter=new ue(t==null?void 0:t.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}class wl{constructor(t){c(this,"_nameFilter");c(this,"_versionFilter");c(this,"_schemaUrlFilter");this._nameFilter=new ue(t==null?void 0:t.name),this._versionFilter=new ue(t==null?void 0:t.version),this._schemaUrlFilter=new ue(t==null?void 0:t.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}function Rl(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function Ol(e){if(Rl(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&((e==null?void 0:e.instrumentName)==null||be.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.")}class Cl{constructor(t){c(this,"name");c(this,"description");c(this,"aggregation");c(this,"attributesProcessor");c(this,"instrumentSelector");c(this,"meterSelector");c(this,"aggregationCardinalityLimit");var r;Ol(t),t.attributesProcessors!=null?this.attributesProcessor=Sl(t.attributesProcessors):this.attributesProcessor=Tl(),this.name=t.name,this.description=t.description,this.aggregation=Us((r=t.aggregation)!=null?r:{type:B.DEFAULT}),this.instrumentSelector=new bl({name:t.instrumentName,type:t.instrumentType,unit:t.instrumentUnit}),this.meterSelector=new wl({name:t.meterName,version:t.meterVersion,schemaUrl:t.meterSchemaUrl}),this.aggregationCardinalityLimit=t.aggregationCardinalityLimit}}class yl{constructor(t){c(this,"_sharedState");c(this,"_shutdown",!1);var r;if(this._sharedState=new fl((r=t==null?void 0:t.resource)!=null?r:as()),(t==null?void 0:t.views)!=null&&t.views.length>0)for(const n of t.views)this._sharedState.viewRegistry.addView(new Cl(n));if((t==null?void 0:t.readers)!=null&&t.readers.length>0)for(const n of t.readers){const s=new pl(this._sharedState,n);n.setMetricProducer(s),this._sharedState.metricCollectors.push(s),t.sdkMetricsEnabled&&n instanceof Bs&&n._setSelfObsMeterProvider(this)}}getMeter(t,r="",n={}){return this._shutdown?(p.warn("A shutdown MeterProvider cannot provide a Meter"),yt()):this._sharedState.getMeterSharedState({name:t,version:r,schemaUrl:n.schemaUrl}).meter}async shutdown(t){if(this._shutdown){p.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(r=>r.shutdown(t)))}async forceFlush(t){if(this._shutdown){p.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(r=>r.forceFlush(t)))}}class Hs{constructor(t){c(this,"_delegate");this._delegate=t}export(t,r){this._delegate.export(t,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}setMetrics(t){this._delegate.setMetrics(t)}}class zs extends Error{constructor(r,n,s){super(r);c(this,"code");c(this,"name","OTLPExporterError");c(this,"data");this.data=s,this.code=n}}function Pl(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function Ml(e){if(e!=null)return async()=>e}function vl(e,t,r){var n,s,i,o,a,u;return{timeoutMillis:Pl((s=(n=e.timeoutMillis)!=null?n:t.timeoutMillis)!=null?s:r.timeoutMillis),concurrencyLimit:(o=(i=e.concurrencyLimit)!=null?i:t.concurrencyLimit)!=null?o:r.concurrencyLimit,compression:(u=(a=e.compression)!=null?a:t.compression)!=null?u:r.compression}}function Il(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class Ll{constructor(t){c(this,"_concurrencyLimit");c(this,"_sendingPromises",[]);this._concurrencyLimit=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);const r=()=>{const n=this._sendingPromises.indexOf(t);this._sendingPromises.splice(n,1)};t.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function Nl(e){return new Ll(e.concurrencyLimit)}function xl(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function Ul(){return{handleResponse(e){e==null||!xl(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||p.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class Dl{constructor(t,r,n,s,i,o){c(this,"_metrics");c(this,"_diagLogger");c(this,"_transport");c(this,"_serializer");c(this,"_responseHandler");c(this,"_promiseQueue");c(this,"_timeout");this._transport=t,this._serializer=r,this._responseHandler=n,this._promiseQueue=s,this._timeout=o,this._diagLogger=p.createComponentLogger({namespace:"OTLPExportDelegate"}),this._metrics=i}export(t,r){if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit()){r({code:D.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(t);if(n==null){r({code:D.FAILED,error:new Error("Nothing to send")});return}const s=this._metrics.startExport(t);this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(i=>{var o;if(i.status==="success"){if(s(void 0),i.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(i.data))}catch(a){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",a,i.data)}r({code:D.SUCCESS});return}else if(i.status==="failure"&&i.error){s(i.error),r({code:D.FAILED,error:i.error});return}else i.status==="retryable"?(s("export_max_retries"),r({code:D.FAILED,error:(o=i.error)!=null?o:new zs("Export failed with retryable status")})):(s("export_failed"),r({code:D.FAILED,error:new zs("Export failed with unknown error")}))},i=>{s(i),r({code:D.FAILED,error:i})}))}forceFlush(){return this._promiseQueue.awaitAll()}setMetrics(t){this._metrics=t}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function kl(e,t){return new Dl(e.transport,e.serializer,Ul(),e.promiseHandler,e.metrics,t.timeout)}function Bl(e,t,r,n){return kl({transport:n,serializer:t,promiseHandler:Nl(e),metrics:r},{timeout:e.timeoutMillis})}const js="http.response.status_code",Gl="otel.component.name",Fl="otel.component.type",$l="server.address",Vl="server.port",Hl="error.type",zl="0.221.0",qs=new Map;class jl{constructor(t){c(this,"inflight");c(this,"exported");c(this,"duration");c(this,"standardAttrs");c(this,"responseAttributesFromError");c(this,"helper");var l;const{componentType:r,metricsHelper:n,meterProvider:s,url:i,responseAttributesFromError:o}=t;this.responseAttributesFromError=o;const a=s?s.getMeter("@opentelemetry/otlp-exporter",zl):yt(),u=(l=qs.get(r))!=null?l:0;if(qs.set(r,u+1),this.standardAttrs={[Fl]:r,[Gl]:`${r}/${u}`},i){let h=i;i.includes("://")||(h=`http://${i}`);try{const d=new URL(h);this.standardAttrs[$l]=d.hostname;let f;d.port?f=Number(d.port):d.protocol==="http:"?f=80:d.protocol==="https:"&&(f=443),typeof f=="number"&&(this.standardAttrs[Vl]=f)}catch(d){}}this.helper=n,this.inflight=a.createUpDownCounter(`otel.sdk.exporter.${this.helper.name}.inflight`,{unit:`{${this.helper.name}}`,description:`The number of ${this.helper.name}s which were passed to the exporter, but that have not been exported yet (neither successful, nor failed).`}),this.exported=a.createCounter(`otel.sdk.exporter.${this.helper.name}.exported`,{unit:`{${this.helper.name}}`,description:`The number of ${this.helper.name}s for which the export has finished, either successful or failed.`}),this.duration=a.createHistogram("otel.sdk.exporter.operation.duration",{unit:"s",description:"The duration of exporting a batch of telemetry records.",advice:{explicitBucketBoundaries:[]}})}startExport(t){const r=this.helper.countItems(t),n=G();return this.inflight.add(r,this.standardAttrs),s=>{const i=G();this.inflight.add(-r,this.standardAttrs);const o=s?{...this.standardAttrs,[Hl]:s instanceof Error?s.name:"export_failed"}:this.standardAttrs;this.exported.add(r,o);const a={...o,...this.responseAttributesFromError(s)},u=$a(Ke(n,i))/1e3;this.duration.record(u,a)}}}const Ws={name:"metric_data_point",countItems:e=>{let t=0;for(const r of e.scopeMetrics)for(const n of r.metrics)t+=n.dataPoints.length;return t}},ql={name:"span",countItems:e=>e.length};var Xs;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Xs||(Xs={}));class Ys{emit(t){}enabled(){return!1}}const Wl=new Ys,le=Symbol.for("io.opentelemetry.js.api.logs"),Ft=globalThis;function Xl(e,t,r){return n=>n===e?t:r}const Ks=1;class Yl{getLogger(t,r,n){return new Ys}}const Qs=new Yl;class Kl{constructor(t,r,n,s){this._provider=t,this.name=r,this.version=n,this.options=s}emit(t){this._getLogger().emit(t)}enabled(t){return this._getLogger().enabled(t)}_getLogger(){if(this._delegate)return this._delegate;const t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Wl}}class Js{getLogger(t,r,n){var s;return(s=this._getDelegateLogger(t,r,n))!==null&&s!==void 0?s:new Kl(this,t,r,n)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Qs}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,r,n){var s;return(s=this._delegate)===null||s===void 0?void 0:s.getLogger(t,r,n)}}class jr{constructor(){this._proxyLoggerProvider=new Js}static getInstance(){return this._instance||(this._instance=new jr),this._instance}setGlobalLoggerProvider(t){return Ft[le]?this.getLoggerProvider():(Ft[le]=Xl(Ks,t,Qs),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=Ft[le])===null||t===void 0?void 0:t.call(Ft,Ks))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete Ft[le],this._proxyLoggerProvider=new Js}}const Zs=jr.getInstance();function ti(e,t){const r={attributes:J(e.attributes,t),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function ei(e,t){var n;const r={name:e.name,version:e.version};return e.attributes&&Object.keys(e.attributes).length>0&&(r.attributes=J(e.attributes,t),r.droppedAttributesCount=(n=e.droppedAttributesCount)!=null?n:0),r}function J(e,t){return Object.keys(e).map(r=>Ql(r,e[r],t))}function Ql(e,t,r){return{key:e,value:gr(t,r)}}function gr(e,t){const r=typeof e;if(r==="string")return{stringValue:e};if(r==="number")return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(r==="boolean")return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=gr(e[s],t);return{arrayValue:{values:n}}}if(r==="object"&&e!=null){const n=Object.keys(e),s=new Array(n.length);for(let i=0;i<n.length;i++)s[i]={key:n[i],value:gr(e[n[i]],t)};return{kvlistValue:{values:s}}}return{}}function Jl(e){const t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Zl(e){return Jl(e).toString()}const th=typeof BigInt<"u"?Zl:j;function ri(e){return e}const ni={encodeHrTime:th,encodeSpanContext:ri,encodeOptionalSpanContext:ri,encodeUint8Array:e=>{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");const t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return btoa(t.join(""))}};var he;(function(e){e[e.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",e[e.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",e[e.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(he||(he={}));function eh(e,t){const r=ti(e.resource,t);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:rh(e.scopeMetrics,t)}}function rh(e,t){return Array.from(e.map(r=>({scope:ei(r.scope,t),metrics:r.metrics.map(n=>nh(n,t)),schemaUrl:r.scope.schemaUrl})))}function nh(e,t){const r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},n=ah(e.aggregationTemporality);switch(e.dataPointType){case V.SUM:r.sum={aggregationTemporality:n,isMonotonic:e.isMonotonic,dataPoints:si(e,t)};break;case V.GAUGE:r.gauge={dataPoints:si(e,t)};break;case V.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:ih(e,t)};break;case V.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:oh(e,t)};break}return r}function sh(e,t,r){const n={attributes:J(e.attributes,r),startTimeUnixNano:r.encodeHrTime(e.startTime),timeUnixNano:r.encodeHrTime(e.endTime)};switch(t){case X.INT:n.asInt=e.value;break;case X.DOUBLE:n.asDouble=e.value;break}return n}function si(e,t){return e.dataPoints.map(r=>sh(r,e.descriptor.valueType,t))}function ih(e,t){return e.dataPoints.map(r=>{const n=r.value;return{attributes:J(r.attributes,t),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}function oh(e,t){return e.dataPoints.map(r=>{const n=r.value;return{attributes:J(r.attributes,t),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)}})}function ah(e){switch(e){case k.DELTA:return he.AGGREGATION_TEMPORALITY_DELTA;case k.CUMULATIVE:return he.AGGREGATION_TEMPORALITY_CUMULATIVE}}function ch(e,t){return{resourceMetrics:e.map(r=>eh(r,t))}}const uh={serializeRequest:e=>{const t=ch([e],ni);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};const t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(r){return p.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}},lh=256,hh=512;function ii(e,t){let r=e&255|lh;return t&&(r|=hh),r}function dh(e,t){var i,o,a,u;const r=e.spanContext(),n=e.status,s=(i=e.parentSpanContext)!=null&&i.spanId?t.encodeSpanContext((o=e.parentSpanContext)==null?void 0:o.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:s,traceState:(a=r.traceState)==null?void 0:a.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:J(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(l=>fh(l,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(l=>_h(l,t)),droppedLinksCount:e.droppedLinksCount,flags:ii(r.traceFlags,(u=e.parentSpanContext)==null?void 0:u.isRemote)}}function _h(e,t){var r;return{attributes:e.attributes?J(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(r=e.context.traceState)==null?void 0:r.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:ii(e.context.traceFlags,e.context.isRemote)}}function fh(e,t){return{attributes:e.attributes?J(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function ph(e,t){return{resourceSpans:gh(e,t)}}function mh(e){const t=new Map;for(const r of e){let n=t.get(r.resource);n||(n=new Map,t.set(r.resource,n));const s=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let i=n.get(s);i||(i=[],n.set(s,i)),i.push(r)}return t}function gh(e,t){const r=mh(e),n=[],s=r.entries();let i=s.next();for(;!i.done;){const[o,a]=i.value,u=[],l=a.values();let h=l.next();for(;!h.done;){const _=h.value;if(_.length>0){const E=_.map(m=>dh(m,t));u.push({scope:ei(_[0].instrumentationScope,t),spans:E,schemaUrl:_[0].instrumentationScope.schemaUrl})}h=l.next()}const d=ti(o,t),f={resource:d,scopeSpans:u,schemaUrl:d.schemaUrl};n.push(f),i=s.next()}return n}const Eh={serializeRequest:e=>{const t=ph(e,ni);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};const t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(r){return p.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}},Er=5,Th=1e3,Sh=5e3,Ah=1.5,oi=.2;function bh(){return Math.random()*(2*oi)-oi}class wh{constructor(t){c(this,"_transport");this._transport=t}retry(t,r,n){return new Promise((s,i)=>{setTimeout(()=>{this._transport.send(t,r).then(s,i)},n)})}async send(t,r){var a;let n=Er,s=Th;const i=Date.now()+r;let o=await this._transport.send(t,r);for(;o.status==="retryable"&&n>0;){n--;const u=Math.max(Math.min(s*(1+bh()),Sh),0);s=s*Ah;const l=(a=o.retryInMillis)!=null?a:u,h=i-Date.now();if(l>h)return p.info(`Export retry time ${Math.round(l)}ms exceeds remaining timeout ${Math.round(h)}ms, not retrying further.`),o;p.verbose(`Scheduling export retry in ${Math.round(l)}ms`),o=await this.retry(t,h,l)}return o.status==="success"?p.verbose(`Export succeeded after ${Er-n} retry attempts.`):o.status==="retryable"?p.info(`Export failed after maximum retry attempts (${Er}).`):p.info(`Export failed with non-retryable error: ${o.error}`),o}shutdown(){return this._transport.shutdown()}}function Rh(e){return new wh(e.transport)}function Oh(e){return e===429||e===502||e===503||e===504}function Ch(e){if(e==null)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}const yh=60*1024,Ph=9;let Tr=0,de=0;class Mh{constructor(t){c(this,"_parameters");this._parameters=t}async send(t,r){const n=new AbortController,s=setTimeout(()=>n.abort(),r);let i=globalThis.fetch;typeof i.__original=="function"&&(i=i.__original);const o=t.byteLength,a=Tr+o>yh,u=de>=Ph,l=!a&&!u;if(l)Tr+=o,de++;else{const h=a?"size limit":"count limit";p.debug(`keepalive disabled: ${(o/1024).toFixed(1)}KB payload, ${de} pending (${h})`)}try{const h=new URL(this._parameters.url),d=await i(h.href,{method:"POST",headers:await this._parameters.headers(),body:t,signal:n.signal,keepalive:l,mode:globalThis.location?globalThis.location.origin===h.origin?"same-origin":"cors":"no-cors"});if(d.status>=200&&d.status<=299)return p.debug(`export response success (status: ${d.status})`),{status:"success"};if(Oh(d.status)){p.warn(`export response retryable (status: ${d.status})`);const f=d.headers.get("Retry-After");return{status:"retryable",retryInMillis:Ch(f)}}return p.error(`export response failure (status: ${d.status})`),{status:"failure",error:new Error(`Fetch request failed with non-retryable status ${d.status}`)}}catch(h){return Ih(h)?(p.warn(`export request retryable (network error: ${h})`),{status:"retryable",error:new Error("Fetch request encountered a network error",{cause:h})}):(p.error(`export request failure (error: ${h})`),{status:"failure",error:new Error("Fetch request errored",{cause:h})})}finally{clearTimeout(s),l&&(Tr-=o,de--)}}shutdown(){}}function vh(e){return new Mh(e)}function Ih(e){return e instanceof TypeError&&!e.cause}function Lh(e,t,r){return Bl(e,t,r,Rh({transport:vh(e)}))}function Nh(e){const t={};return Object.entries(e!=null?e:{}).forEach(([r,n])=>{typeof n<"u"?t[r]=String(n):p.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),t}function xh(e,t,r){return async()=>{const n={...await r()},s={};return t!=null&&Object.assign(s,await t()),e!=null&&Object.assign(s,Nh(await e())),Object.assign(s,n)}}function Uh(e){var t;if(e!=null)try{const r=(t=globalThis.location)==null?void 0:t.href;return new URL(e,r).href}catch(r){throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function Dh(e,t,r){var n,s;return{...vl(e,t,r),headers:xh(e.headers,t.headers,r.headers),url:(s=(n=Uh(e.url))!=null?n:t.url)!=null?s:r.url}}function kh(e,t){return{...Il(),headers:async()=>e,url:"http://localhost:4318/"+t}}function Bh(e){return typeof e.headers=="function"?e.headers:Ml(e.headers)}function Gh(e,t,r){return Dh({url:e.url,timeoutMillis:e.timeoutMillis,headers:Bh(e),concurrencyLimit:e.concurrencyLimit},{},kh(r,t))}function ai(e,t,r,n){return new jl({componentType:e,metricsHelper:t,url:r,meterProvider:n,responseAttributesFromError:s=>{if(!s)return{[js]:200};if(!(s instanceof Error))return{};if(s.message.startsWith("Fetch request failed with non-retryable status ")){const i=s.message.substring(47);return{[js]:Number(i)}}return{}}})}function ci(e,t,r,n,s,i,o){const a=Gh(e,i,o);return Lh(a,t,ai(r,n,a.url,e.selfObsMeterProvider))}const Fh="otlp_http_span_exporter";class $h extends Hs{constructor(t={}){super(ci(t,Eh,Fh,ql,t.selfObsMeterProvider,"v1/traces",{"Content-Type":"application/json"}))}}var _e;(function(e){e[e.DELTA=0]="DELTA",e[e.CUMULATIVE=1]="CUMULATIVE",e[e.LOWMEMORY=2]="LOWMEMORY"})(_e||(_e={}));const Sr=()=>k.CUMULATIVE,ui=e=>{switch(e){case g.COUNTER:case g.OBSERVABLE_COUNTER:case g.GAUGE:case g.HISTOGRAM:case g.OBSERVABLE_GAUGE:return k.DELTA;case g.UP_DOWN_COUNTER:case g.OBSERVABLE_UP_DOWN_COUNTER:return k.CUMULATIVE}},li=e=>{switch(e){case g.COUNTER:case g.HISTOGRAM:return k.DELTA;case g.GAUGE:case g.UP_DOWN_COUNTER:case g.OBSERVABLE_UP_DOWN_COUNTER:case g.OBSERVABLE_COUNTER:case g.OBSERVABLE_GAUGE:return k.CUMULATIVE}};function Vh(){const e="cumulative".toLowerCase();return e==="cumulative"?Sr:e==="delta"?ui:e==="lowmemory"?li:(p.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${e}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),Sr)}function Hh(e){return e!=null?e===_e.DELTA?ui:e===_e.LOWMEMORY?li:Sr:Vh()}const zh=Object.freeze({type:B.DEFAULT});function jh(e){var t;return(t=e==null?void 0:e.aggregationPreference)!=null?t:(()=>zh)}class qh extends Hs{constructor(r,n){super(r);c(this,"_aggregationTemporalitySelector");c(this,"_aggregationSelector");this._aggregationSelector=jh(n),this._aggregationTemporalitySelector=Hh(n==null?void 0:n.temporalityPreference)}selectAggregation(r){return this._aggregationSelector(r)}selectAggregationTemporality(r){return this._aggregationTemporalitySelector(r)}}const hi="otlp_http_metric_exporter";class Wh extends qh{constructor(r){super(ci(r!=null?r:{},uh,hi,Ws,r==null?void 0:r.selfObsMeterProvider,"v1/metrics",{"Content-Type":"application/json"}),r);c(this,"_url");this._url=r==null?void 0:r.url}setSelfObsMeterProvider(r){this.setMetrics(ai(hi,Ws,this._url,r))}}function Xh(e,t,r,n){for(let s=0,i=e.length;s<i;s++){const o=e[s];t&&o.setTracerProvider(t),r&&o.setMeterProvider(r),n&&o.setLoggerProvider&&o.setLoggerProvider(n),o.getConfig().enabled||o.enable()}}function Yh(e){e.forEach(t=>t.disable())}function Kh(e){var i,o;const t=e.tracerProvider||R.getTracerProvider(),r=e.meterProvider||Be.getMeterProvider(),n=e.loggerProvider||Zs.getLoggerProvider(),s=(o=(i=e.instrumentations)==null?void 0:i.flat())!=null?o:[];return Xh(s,t,r,n),()=>{Yh(s)}}let v=console.error.bind(console);function $t(e,t,r){const n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}const di=(e,t,r)=>{if(!e||!e[t]){v("no original function "+String(t)+" to wrap");return}if(!r){v("no wrapper function"),v(new Error().stack);return}const n=e[t];if(typeof n!="function"||typeof r!="function"){v("original object and wrapper must be functions");return}const s=r(n,t);return $t(s,"__original",n),$t(s,"__unwrap",()=>{e[t]===s&&$t(e,t,n)}),$t(s,"__wrapped",!0),$t(e,t,s),s},Qh=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{v("must provide one or more modules to patch"),v(new Error().stack);return}if(!(t&&Array.isArray(t))){v("must provide one or more functions to wrap on modules");return}e.forEach(n=>{t.forEach(s=>{di(n,s,r)})})},_i=(e,t)=>{if(!e||!e[t]){v("no function to unwrap."),v(new Error().stack);return}const r=e[t];if(!r.__unwrap)v("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{r.__unwrap();return}},Jh=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{v("must provide one or more modules to patch"),v(new Error().stack);return}if(!(t&&Array.isArray(t))){v("must provide one or more functions to unwrap on modules");return}e.forEach(r=>{t.forEach(n=>{_i(r,n)})})};class Zh{constructor(t,r,n){c(this,"_config",{});c(this,"_tracer");c(this,"_meter");c(this,"_logger");c(this,"_diag");c(this,"instrumentationName");c(this,"instrumentationVersion");c(this,"_wrap",di);c(this,"_unwrap",_i);c(this,"_massWrap",Qh);c(this,"_massUnwrap",Jh);this.instrumentationName=t,this.instrumentationVersion=r,this.setConfig(n),this._diag=p.createComponentLogger({namespace:t}),this._tracer=R.getTracer(t,r),this._meter=Be.getMeter(t,r),this._logger=Zs.getLogger(t,r),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var r;const t=(r=this.init())!=null?r:[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,r,n,s){if(t)try{t(n,s)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},i)}}}class Ar extends Zh{constructor(t,r,n){super(t,r,n),this._config.enabled&&this.enable()}}function Vt(e,t,r){let n,s;try{s=e()}catch(i){n=i}finally{return t(n,s),s}}var Ht;(function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"})(Ht||(Ht={}));const td="0.66.0",ed="@opentelemetry/instrumentation-document-load";var fe;(function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"})(fe||(fe={}));const rd=()=>{var r;const e={},t=(r=O.getEntriesByType)==null?void 0:r.call(O,"navigation")[0];if(t)Object.values(S).forEach(s=>{if(dt(t,s)){const i=t[s];typeof i=="number"&&(e[s]=i)}});else{const s=O.timing;s&&Object.values(S).forEach(o=>{if(dt(s,o)){const a=s[o];typeof a=="number"&&(e[o]=a)}})}return e},fi={"first-paint":fe.FIRST_PAINT,"first-contentful-paint":fe.FIRST_CONTENTFUL_PAINT},nd=e=>{var r;const t=(r=O.getEntriesByType)==null?void 0:r.call(O,"paint");t&&t.forEach(({name:n,startTime:s})=>{dt(fi,n)&&e.addEvent(fi[n],s)})};class sd extends Ar{constructor(r={}){super(ed,td,r);c(this,"component","document-load");c(this,"version","1");c(this,"moduleName",this.component)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(r){var s;const n=(s=O.getEntriesByType)==null?void 0:s.call(O,"resource");n&&n.forEach(i=>{this._initResourceSpan(i,r)})}_collectPerformance(){const r=Array.from(document.getElementsByTagName("meta")).find(i=>i.getAttribute("name")===re),n=rd(),s=r&&r.content||"";b.with(U.extract(et,{traceparent:s}),()=>{var o;const i=this._startSpan(Ht.DOCUMENT_LOAD,S.FETCH_START,n);i&&(b.with(R.setSpan(b.active(),i),()=>{const a=this._startSpan(Ht.DOCUMENT_FETCH,S.FETCH_START,n);a&&(a.setAttribute(Lt,location.href),b.with(R.setSpan(b.active(),a),()=>{var u;_t(a,n,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(a,(u=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:u.documentFetch),this._endSpan(a,S.RESPONSE_END,n)}))}),i.setAttribute(Lt,location.href),i.setAttribute(Da,navigator.userAgent),this._addResourcesSpans(i),this.getConfig().ignoreNetworkEvents||(C(i,S.FETCH_START,n),C(i,S.UNLOAD_EVENT_START,n),C(i,S.UNLOAD_EVENT_END,n),C(i,S.DOM_INTERACTIVE,n),C(i,S.DOM_CONTENT_LOADED_EVENT_START,n),C(i,S.DOM_CONTENT_LOADED_EVENT_END,n),C(i,S.DOM_COMPLETE,n),C(i,S.LOAD_EVENT_START,n),C(i,S.LOAD_EVENT_END,n)),this.getConfig().ignorePerformancePaintEvents||nd(i),this._addCustomAttributesOnSpan(i,(o=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:o.documentLoad),this._endSpan(i,S.LOAD_EVENT_END,n))})}_endSpan(r,n,s){r&&(dt(s,n)?r.end(s[n]):r.end())}_initResourceSpan(r,n){var i;const s=this._startSpan(Ht.RESOURCE_FETCH,S.FETCH_START,r,n);s&&(s.setAttribute(Lt,r.name),_t(s,r,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(s,r,(i=this.getConfig().applyCustomAttributesOnSpan)==null?void 0:i.resourceFetch),this._endSpan(s,S.RESPONSE_END,r))}_startSpan(r,n,s,i){if(dt(s,n)&&typeof s[n]=="number")return this.tracer.startSpan(r,{startTime:s[n]},i?R.setSpan(b.active(),i):void 0)}_waitForPageLoad(){window.document.readyState==="complete"?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(r,n){n&&Vt(()=>n(r),s=>{s&&this._diag.error("addCustomAttributesOnSpan",s)})}_addCustomAttributesOnResourceSpan(r,n,s){s&&Vt(()=>s(r,n),i=>{i&&this._diag.error("addCustomAttributesOnResourceSpan",i)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const id="http.request.body.size",pi=p.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function od(...e){if(e[0]instanceof URL||typeof e[0]=="string"){const t=e[1];if(!(t!=null&&t.body))return Promise.resolve();if(t.body instanceof ReadableStream){const{body:r,length:n}=ad(t.body);return t.body=r,n}else return Promise.resolve(ud(t.body))}else{const t=e[0];return t!=null&&t.body?t.clone().text().then(r=>br(r)):Promise.resolve()}}function ad(e){if(!e.pipeThrough)return pi.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t=0,r;const n=new Promise(i=>{r=i}),s=new TransformStream({start(){},async transform(i,o){const a=await i;t+=a.byteLength,o.enqueue(i)},flush(){r(t)}});return{body:e.pipeThrough(s),length:n}}function cd(e){return typeof Document<"u"&&e instanceof Document}function ud(e){if(cd(e))return new XMLSerializer().serializeToString(document).length;if(typeof e=="string")return br(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return hd(e);if(e instanceof URLSearchParams)return br(e.toString());if(e.byteLength!==void 0)return e.byteLength;pi.warn("unknown body type")}const ld=new TextEncoder;function br(e){return ld.encode(e).byteLength}function hd(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}function dd(e){const t=fd(),r=e.toUpperCase();return r in t?r:"_OTHER"}const _d={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let wr;function fd(){return wr===void 0&&(wr=_d),wr}const pd={"https:":"443","http:":"80"};function md(e){const t=Number(e.port||pd[e.protocol]);if(t&&!isNaN(t))return t}const mi="0.221.0",gd=300,gi=typeof PerformanceObserver<"u";class Ed extends Ar{constructor(r={}){super("@opentelemetry/instrumentation-fetch",mi,r);c(this,"component","fetch");c(this,"version",mi);c(this,"moduleName",this.component);c(this,"_usedResources",new WeakSet);c(this,"_tasksCount",0)}init(){}_addChildSpan(r,n){const s=this.tracer.startSpan("CORS Preflight",{startTime:n[S.FETCH_START]},R.setSpan(b.active(),r));_t(s,n,this.getConfig().ignoreNetworkEvents,void 0,!0),s.end(n[S.RESPONSE_END])}_addFinalSpanAttributes(r,n){const s=K(n.url);r.setAttribute(Bn,n.status),r.setAttribute(Gn,s.hostname);const i=md(s);i&&r.setAttribute(Fn,i)}_addHeaders(r,n){if(!Ts(n,this.getConfig().propagateTraceHeaderCorsUrls)){const s={};U.inject(b.active(),s),Object.keys(s).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}if(r instanceof Request)U.inject(b.active(),r.headers,{set:(s,i,o)=>s.set(i,typeof o=="string"?o:String(o))});else{const s=new Headers(r.headers);U.inject(b.active(),s,{set:(i,o,a)=>i.set(o,typeof a=="string"?a:String(a))}),r.headers=s}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(r,n={}){if(is(r,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}const s={},i=n.method,o=dd(n.method||"GET"),a=o;return s[Dn]=o,o!==i&&(s[kn]=i),s[Lt]=r,this.tracer.startSpan(a,{kind:Mt.CLIENT,attributes:s})}_findResourceAndAddNetworkEvents(r,n,s){let i=n.entries;if(!i.length){if(!performance.getEntriesByType)return;i=performance.getEntriesByType("resource")}const o=Es(n.spanUrl,n.startTime,s,i,this._usedResources,"fetch");if(o.mainRequest){const a=o.mainRequest;this._markResourceAsUsed(a);const u=o.corsPreFlightRequest;u&&(this._addChildSpan(r,u),this._markResourceAsUsed(u)),_t(r,a,this.getConfig().ignoreNetworkEvents,void 0,!0)}}_markResourceAsUsed(r){this._usedResources.add(r)}_endSpan(r,n,s){const i=L(Date.now()),o=G();this._addFinalSpanAttributes(r,s),s.status>=400&&(r.setStatus({code:z.ERROR}),r.setAttribute(It,String(s.status))),setTimeout(()=>{var a;(a=n.observer)==null||a.disconnect(),this._findResourceAndAddNetworkEvents(r,n,o),this._tasksCount--,this._clearResources(),r.end(i)},gd)}_patchConstructor(){return r=>{const n=this;return function(...i){if(!n._isEnabled)return r.apply(this,i);const o=this,a=K(i[0]instanceof Request?i[0].url:String(i[0])).href;let u;i[0]instanceof Request?u=i[1]!=null?new Request(i[0],i[1]):i[0]:u=i[1]||{};const l=n._createSpan(a,u);if(!l)return r.apply(this,i);const h=n._prepareSpanData(a);n.getConfig().measureRequestSize&&od(...i).then(m=>{m&&l.setAttribute(id,m)}).catch(m=>{n._diag.warn("getFetchBodyLength",m)});function d(m,T){n._applyAttributesAfterFetch(m,u,T),n._endSpan(m,h,{status:T.status||0,statusText:T.message,url:a})}function f(m,T){n._applyAttributesAfterFetch(m,u,T),T.status>=200&&T.status<400?n._endSpan(m,h,T):n._endSpan(m,h,{status:T.status,statusText:T.statusText,url:a})}function _(m,T){try{const M=T.clone().body;if(M){const y=M.getReader(),At=()=>{y.read().then(({done:ut})=>{ut?f(m,T):At()},ut=>{d(m,ut)})};At()}else f(m,T)}catch(A){n._diag.error("Failed to read fetch response body",A),n._endSpan(m,h,{status:0,url:a})}return T}function E(m,T){try{d(m,T)}catch(A){n._diag.error("Failed to end span on fetch error",A),n._endSpan(m,h,{status:T.status||0,url:a})}throw T}return b.with(R.setSpan(b.active(),l),()=>(n._callRequestHook(l,u),n._addHeaders(u,a),n._tasksCount++,r.apply(o,u instanceof Request?[u]:[a,u]).then(_.bind(o,l),E.bind(o,l))))}}}_applyAttributesAfterFetch(r,n,s){const i=this.getConfig().applyCustomAttributesOnSpan;i&&Vt(()=>i(r,n,s),o=>{o&&this._diag.error("applyCustomAttributesOnSpan",o)})}_callRequestHook(r,n){const s=this.getConfig().requestHook;s&&Vt(()=>s(r,n),i=>{i&&this._diag.error("requestHook",i)})}_prepareSpanData(r){const n=G(),s=[];if(typeof PerformanceObserver!="function")return{entries:s,startTime:n,spanUrl:r};const i=new PerformanceObserver(o=>{o.getEntries().forEach(u=>{u.initiatorType==="fetch"&&u.name===r&&s.push(u)})});return i.observe({entryTypes:["resource"]}),{entries:s,observer:i,startTime:n,spanUrl:r}}enable(){if(!gi){this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()");return}if(!this._isEnabled){if(this._isFetchPatched){this._diag.debug("fetch constructor already patched"),this._isEnabled=!0;return}try{this._wrap(globalThis,"fetch",this._patchConstructor()),this._isFetchPatched=!0,this._isEnabled=!0}catch(r){this._diag.warn("Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.",r)}}}disable(){gi&&this._isEnabled&&(this._isEnabled=!1,this._usedResources=new WeakSet)}}const Td="http.request.body.size";var q;(function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"})(q||(q={}));const Sd=p.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function Ad(e){return typeof Document<"u"&&e instanceof Document}function bd(e){if(Ad(e))return new XMLSerializer().serializeToString(document).length;if(typeof e=="string")return Ei(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return Rd(e);if(e instanceof URLSearchParams)return Ei(e.toString());if(e.byteLength!==void 0)return e.byteLength;Sd.warn("unknown body type")}const wd=new TextEncoder;function Ei(e){return wd.encode(e).byteLength}function Rd(e){let t=0;for(const[r,n]of e.entries())t+=r.length,n instanceof Blob?t+=n.size:t+=n.length;return t}function Od(e){const t=yd(),r=e.toUpperCase();return r in t?r:"_OTHER"}const Cd={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let Rr;function yd(){return Rr===void 0&&(Rr=Cd),Rr}const Pd={"https:":"443","http:":"80"};function Md(e){const t=Number(e.port||Pd[e.protocol]);if(t&&!isNaN(t))return t}const Ti="0.221.0",vd=300;class Id extends Ar{constructor(r={}){super("@opentelemetry/instrumentation-xml-http-request",Ti,r);c(this,"component","xml-http-request");c(this,"version",Ti);c(this,"moduleName",this.component);c(this,"_tasksCount",0);c(this,"_xhrMem",new WeakMap);c(this,"_usedResources",new WeakSet)}init(){}_addHeaders(r,n){const s=K(n).href;if(!Ts(s,this.getConfig().propagateTraceHeaderCorsUrls)){const o={};U.inject(b.active(),o),Object.keys(o).length>0&&this._diag.debug("headers inject skipped due to CORS policy");return}const i={};U.inject(b.active(),i),Object.keys(i).forEach(o=>{r.setRequestHeader(o,String(i[o]))})}_addChildSpan(r,n){b.with(R.setSpan(b.active(),r),()=>{const s=this.tracer.startSpan("CORS Preflight",{startTime:n[S.FETCH_START]});_t(s,n,this.getConfig().ignoreNetworkEvents,void 0,!0),s.end(n[S.RESPONSE_END])})}_addFinalSpanAttributes(r,n){n.status&&r.setAttribute(Bn,n.status)}_applyAttributesAfterXHR(r,n){const s=this.getConfig().applyCustomAttributesOnSpan;typeof s=="function"&&Vt(()=>s(r,n),i=>{i&&this._diag.error("applyCustomAttributesOnSpan",i)})}_addResourceObserver(r,n){const s=this._xhrMem.get(r);!s||typeof PerformanceObserver!="function"||typeof PerformanceResourceTiming!="function"||(s.createdResources={observer:new PerformanceObserver(i=>{const o=i.getEntries(),a=K(n);o.forEach(u=>{u.initiatorType==="xmlhttprequest"&&u.name===a.href&&s.createdResources&&s.createdResources.entries.push(u)})}),entries:[]},s.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(O.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(r,n,s,i,o){if(!s||!i||!o||!r.createdResources)return;let a=r.createdResources.entries;(!a||!a.length)&&(a=O.getEntriesByType("resource"));const u=Es(K(s).href,i,o,a,this._usedResources);if(u.mainRequest){const l=u.mainRequest;this._markResourceAsUsed(l);const h=u.corsPreFlightRequest;h&&(this._addChildSpan(n,h),this._markResourceAsUsed(h)),_t(n,l,this.getConfig().ignoreNetworkEvents,void 0,!0)}}_cleanPreviousSpanInformation(r){const n=this._xhrMem.get(r);if(n){const s=n.callbackToRemoveEvents;s&&s(),this._xhrMem.delete(r)}}_createSpan(r,n,s){const i=K(n);if(is(i.href,this.getConfig().ignoreUrls)){this._diag.debug("ignoring span as url matches ignored url");return}const o={},a=s,u=Od(s),l=u;o[Dn]=u,u!==a&&(o[kn]=a),o[Lt]=i.toString(),o[Gn]=i.hostname;const h=Md(i);h&&(o[Fn]=h);const d=this.tracer.startSpan(l,{kind:Mt.CLIENT,attributes:o});return d.addEvent(q.METHOD_OPEN),this._cleanPreviousSpanInformation(r),this._xhrMem.set(r,{span:d,spanUrl:n}),d}_markResourceAsUsed(r){this._usedResources.add(r)}_patchOpen(){return r=>{const n=this;return function(...i){if(!n._isEnabled)return r.apply(this,i);const o=i[0],a=i[1];return n._createSpan(this,a,o),r.apply(this,i)}}}_patchSend(){const r=this;function n(h,d,f,_){const E=d.callbackToRemoveEvents;typeof E=="function"&&E();const{span:m,spanUrl:T,sendStartTime:A}=d;m&&(r._findResourceAndAddNetworkEvents(d,m,T,A,f),m.addEvent(h,_),r._addFinalSpanAttributes(m,d),m.end(_),r._tasksCount--),r._clearResources()}function s(h,d,f,_){const E=r._xhrMem.get(d);if(!E)return;if(E.status=d.status,E.statusText=d.statusText,r._xhrMem.delete(d),E.span){const A=E.span;r._applyAttributesAfterXHR(A,d),f?_&&(A.setStatus({code:z.ERROR,message:_}),A.setAttribute(It,_)):E.status&&E.status>=400&&(A.setStatus({code:z.ERROR}),A.setAttribute(It,String(E.status)))}const m=G(),T=Date.now();setTimeout(()=>{n(h,E,m,T)},vd)}function i(){s(q.EVENT_ERROR,this,!0,"error")}function o(){s(q.EVENT_ABORT,this,!1)}function a(){s(q.EVENT_TIMEOUT,this,!0,"timeout")}function u(){this.status<299?s(q.EVENT_LOAD,this,!1):s(q.EVENT_ERROR,this,!1)}function l(h){h.removeEventListener("abort",o),h.removeEventListener("error",i),h.removeEventListener("load",u),h.removeEventListener("timeout",a);const d=r._xhrMem.get(h);d&&(d.callbackToRemoveEvents=void 0)}return h=>function(...f){if(!r._isEnabled)return h.apply(this,f);const _=r._xhrMem.get(this);if(!_)return h.apply(this,f);const E=_.span,m=_.spanUrl;if(E&&m){if(r.getConfig().measureRequestSize&&(f!=null&&f[0])){const T=f[0],A=bd(T);A!==void 0&&E.setAttribute(Td,A)}b.with(R.setSpan(b.active(),E),()=>{r._tasksCount++,_.sendStartTime=G(),E.addEvent(q.METHOD_SEND),this.addEventListener("abort",o),this.addEventListener("error",i),this.addEventListener("load",u),this.addEventListener("timeout",a),_.callbackToRemoveEvents=()=>{l(this),_.createdResources&&_.createdResources.observer.disconnect()},r._addHeaders(this,m),r._addResourceObserver(this,m)})}return h.apply(this,f)}}enable(){if(!this._isEnabled){if(this._isXhrPatched){this._diag.debug("reactivating existing patch on",this.moduleName,this.version),this._isEnabled=!0;return}try{this._diag.debug("applying patch to",this.moduleName,this.version),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend()),this._isXhrPatched=!0,this._isEnabled=!0}catch(r){this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.warn("Failed to patch globalThis.XMLHttpRequest; instrumentation will not be enabled. Another script may have locked globalThis.XMLHttpRequest via Object.defineProperty.",r)}}}disable(){this._isEnabled&&(this._isEnabled=!1,this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}}let Si=-1;const ft=()=>Si,pt=e=>{addEventListener("pageshow",t=>{t.persisted&&(Si=t.timeStamp,e(t))},!0)},I=(e,t,r,n)=>{let s,i;return o=>{t.value>=0&&(o||n)&&(i=t.value-(s!=null?s:0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=((a,u)=>a>u[1]?"poor":a>u[0]?"needs-improvement":"good")(t.value,r),e(t)))}},Or=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Cr=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},zt=()=>{var e,t;return(t=(e=Cr())==null?void 0:e.activationStart)!=null?t:0};let at=-1;const Ai=new Set,bi=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,yr=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of Ai)t();isFinite(at)||(at=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",yr,!0))}},jt=(e=!1)=>{var t;if(e&&(at=1/0),at<0){const r=zt(),n=document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").find(s=>s.name==="hidden"&&s.startTime>=r))==null?void 0:t.startTime;at=n!=null?n:bi(),addEventListener("visibilitychange",yr,!0),addEventListener("prerenderingchange",yr,!0),pt(()=>{setTimeout(()=>{at=bi()})})}return{get firstHiddenTime(){return at},onHidden(r){Ai.add(r)}}},N=(e,t=-1,r,n=0,s,i,o)=>{const a=Cr(),u=(a==null?void 0:a.navigationId)||0;let l="navigate";return r?l=r:ft()>=0?l="back-forward-cache":a&&(document.prerendering||zt()>0?l="prerender":document.wasDiscarded?l="restore":a.type&&(l=a.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:l,navigationId:n||u,navigationInteractionId:s,navigationURL:i||(a==null?void 0:a.name),navigationStartTime:o||0}},wi=new WeakMap;function pe(e,t){let r=wi.get(t);return r||(r=new WeakMap,wi.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}class Ld{constructor(){c(this,"t");c(this,"i",0);c(this,"o",[])}h(t){var s;if(t.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),(s=this.t)==null||s.call(this,t)}}const ct=(e,t,r={})=>{try{const n=e.filter(s=>PerformanceObserver.supportedEntryTypes.includes(s));if(n.length>0){const s=new PerformanceObserver(i=>{queueMicrotask(()=>{const o=i.getEntries();n.length>1&&o.sort((a,u)=>a.startTime+a.duration-(u.startTime+u.duration)),t(o)})});for(const i of n)s.observe({type:i,buffered:!0,...r});return s}}catch(n){}},qt=e=>{var t,r,n;return((t=globalThis.PerformanceObserver)==null?void 0:t.supportedEntryTypes.includes("soft-navigation"))&&typeof((n=(r=globalThis.PerformanceSoftNavigation)==null?void 0:r.prototype)==null?void 0:n.getLargestInteractionContentfulPaint)=="function"&&e&&e.reportSoftNavs},Ri=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const r=e.keys().next().value;r!==void 0&&e.delete(r)}},Oi=e=>{let t=!1;return()=>{t||(e(),t=!0)}};class Nd{constructor(){c(this,"l")}}const me=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Pr=[1800,3e3],Ci=(e,t={})=>{const r=qt(t);me(()=>{const n=pe(t,Nd),s=jt();let i,o=N("FCP");const a=ct(["paint"],u=>{for(const l of u)l.name==="first-contentful-paint"&&(a.disconnect(),l.startTime<s.firstHiddenTime&&(o.value=Math.max(l.startTime-zt(),0),o.entries.push(l),o.navigationId=l.navigationId||o.navigationId,i(!0)))});a&&(i=I(e,o,Pr,t.reportAllChanges),pt(u=>{o=N("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ft()),i=I(e,o,Pr,t.reportAllChanges),Or(()=>{o.value=performance.now()-u.timeStamp,i(!0)})})),r&&ct(["soft-navigation"],u=>{u.forEach(l=>{n.l&&l.navigationId&&Ri(n.l,l);const h=Math.max((l.presentationTime||l.paintTime||0)-l.startTime,0);o=N("FCP",h,"soft-navigation",l.navigationId,l.interactionId,l.name,l.startTime),i=I(e,o,Pr,t.reportAllChanges),i(!0)})},t)})},yi=[.1,.25],xd=(e,t={})=>{const r=jt();Ci(Oi(()=>{let n,s=N("CLS",0);const i=pe(t,Ld),o=(f,_,E,m,T)=>{s=N("CLS",0,f,_,E,m,T),i.i=0,n=I(e,s,yi,t.reportAllChanges)},a=(f=!1)=>{i.i>s.value&&(s.value=i.i,s.entries=i.o),n(f)},u=f=>{a(!0),o("soft-navigation",f.navigationId,f.interactionId,f.name,f.startTime)},l=f=>{for(const _ of f)_.entryType!=="soft-navigation"?i.h(_):u(_);a()},h=["layout-shift"];qt(t)&&h.push("soft-navigation");const d=ct(h,l);d&&(n=I(e,s,yi,t.reportAllChanges),r.onHidden(()=>{l(d.takeRecords()),n(!0)}),pt(()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,ft()),Or(n)}),setTimeout(n))}))};let Pi=0,Mr=1/0,ge=0;const Ud=e=>{for(const t of e)t.interactionId&&(Mr=Math.min(Mr,t.interactionId),ge=Math.max(ge,t.interactionId),Pi=ge?(ge-Mr)/7+1:0)};let vr;const Mi=()=>{var e;return vr?Pi:(e=performance.interactionCount)!=null?e:0},Dd=()=>{"interactionCount"in performance||vr||(vr=ct(["event"],Ud,{durationThreshold:0}))};let vi=0;class kd{constructor(){c(this,"u",[]);c(this,"v",new Map);c(this,"m");c(this,"p")}T(){vi=Mi(),this.u.length=0,this.v.clear()}M(t){const r=Mi()-vi,n=Math.min(this.u.length-1,Math.floor(r/50));return!r||n!==-1||t!=="soft-navigation"&&t!=="back-forward-cache"?this.u[n]:{_:8,id:-1,entries:[]}}h(t){var s,i;if((s=this.m)==null||s.call(this,t),!t.interactionId&&t.entryType!=="first-input")return;const r=this.u.at(-1);let n=this.v.get(t.interactionId);if(n||this.u.length<10||t.duration>r._){if(n?t.duration>n._?(n.entries=[t],n._=t.duration):t.duration===n._&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],_:t.duration},this.v.set(n.id,n),this.u.push(n)),this.u.sort((o,a)=>a._-o._),this.u.length>10){const o=this.u.splice(10);for(const a of o)this.v.delete(a.id)}(i=this.p)==null||i.call(this,n)}}}const Ii=e=>{const t="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState==="hidden")e();else{const s=Oi(e);let i=-1;const o=()=>{n(i),s()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),i=r(()=>{removeEventListener("visibilitychange",o,{capture:!0}),s()},{timeout:t})}},Li=[200,500],Bd=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=jt();me(()=>{var f;Dd();let n,s=N("INP");const i=pe(t,kd),o=(_,E,m,T,A)=>{i.T(),s=N("INP",-1,_,E,m,T,A),n=I(e,s,Li,t.reportAllChanges)},a=()=>{const _=i.M(s.navigationType);_&&_._!==s.value&&(s.value=_._,s.entries=_.entries,n())},u=_=>{a(),n(!0),o("soft-navigation",_.navigationId,_.interactionId,_.name,_.startTime)},l=(_,E=!1)=>{Ii(()=>{for(const m of _)m.entryType!=="soft-navigation"?i.h(m):u(m);a(),E&&n(!0)})},h=["event","first-input"];qt(t)&&h.push("soft-navigation");const d=ct(h,l,{...t,durationThreshold:(f=t.durationThreshold)!=null?f:40});n=I(e,s,Li,t.reportAllChanges),d&&(r.onHidden(()=>{l(d.takeRecords(),!0)}),pt(()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,ft())}))})};class Gd{constructor(){c(this,"m");c(this,"l")}h(t){var r;(r=this.m)==null||r.call(this,t)}}const Ir=[2500,4e3],Fd=(e,t={})=>{let r=!1;const n=qt(t);me(()=>{let s,i=jt(),o=N("LCP");const a=pe(t,Gd),u=(_,E,m,T,A)=>{o=N("LCP",-1,_,E,m,T,A),s=I(e,o,Ir,t.reportAllChanges),r=!1,_==="soft-navigation"&&(i=jt(!0))},l=_=>{var m;a.l&&_.navigationId&&Ri(a.l,_),r||s(!0),u("soft-navigation",_.navigationId,_.interactionId,_.name,_.startTime);const E=(m=_.getLargestInteractionContentfulPaint)==null?void 0:m.call(_);E&&h([E])},h=_=>{var E;t.reportAllChanges||n||(_=_.slice(-1));for(const m of _){if(!m)continue;if(m.entryType==="soft-navigation"){l(m);continue}let T=0,A=[],M=m.startTime;if(m.entryType==="largest-contentful-paint")T=Math.max(m.startTime-zt(),0),a.h(m),A=[m];else if(m.entryType==="interaction-contentful-paint"){const y=m;if(!o.navigationId||"interactionId"in y&&y.interactionId!=o.navigationInteractionId)continue;M=((E=y.largestContentfulPaint)==null?void 0:E.renderTime)||0,T=Math.max(M-m.startTime,0),y.largestContentfulPaint&&(a.h(y.largestContentfulPaint),A=[y.largestContentfulPaint])}M<i.firstHiddenTime&&(o.value=T,o.entries=A,s())}},d=["largest-contentful-paint"];n&&d.push("interaction-contentful-paint","soft-navigation");const f=ct(d,h);if(f){s=I(e,o,Ir,t.reportAllChanges);const _=["keydown","click","visibilitychange"],E=m=>{if(m.isTrusted&&!r){const T=o.id;Ii(()=>{if(!r){if(!n){f.disconnect();for(const A of _)removeEventListener(A,E,{capture:!0})}T===o.id&&(r=!0,s(!0))}})}};for(const m of _)addEventListener(m,E,{capture:!0});pt(m=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,ft()),s=I(e,o,Ir,t.reportAllChanges),Or(()=>{o.value=performance.now()-m.timeStamp,r=!0,s(!0)})})}})},Lr=[800,1800],Nr=e=>{document.prerendering?me(()=>Nr(e)):document.readyState!=="complete"?addEventListener("load",()=>Nr(e),!0):setTimeout(e)},$d=(e,t={})=>{const r=qt(t);let n=N("TTFB"),s=I(e,n,Lr,t.reportAllChanges);Nr(()=>{const i=Cr();if(i){const o=i.responseStart;n.value=Math.max(o-zt(),0),n.entries=[i],s(!0),pt(()=>{n=N("TTFB",0,"back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,ft()),s=I(e,n,Lr,t.reportAllChanges),s(!0)}),r&&ct(["soft-navigation"],a=>{a.forEach(u=>{u.navigationId&&(n=N("TTFB",0,"soft-navigation",u.navigationId,u.interactionId,u.name,u.startTime),n.entries=[u],s=I(e,n,Lr,t.reportAllChanges),s(!0))})},t)}})},Vd=3e4,Hd=[{register:Fd,name:"web_vitals.lcp",unit:"ms",boundaries:[100,250,500,1e3,1500,2e3,2500,3e3,4e3,6e3,8e3,12e3]},{register:Bd,name:"web_vitals.inp",unit:"ms",boundaries:[8,16,40,75,100,150,200,300,500,750,1e3]},{register:xd,name:"web_vitals.cls",unit:"1",boundaries:[.01,.025,.05,.075,.1,.15,.25,.5,1]},{register:Ci,name:"web_vitals.fcp",unit:"ms",boundaries:[100,250,500,900,1200,1500,1800,2200,3e3,4e3,6e3]},{register:$d,name:"web_vitals.ttfb",unit:"ms",boundaries:[50,100,200,400,600,800,1200,1800,2500,4e3]}],zd=()=>{var e;return`/${(e=window.location.pathname.split("/")[1])!=null?e:""}`},jd=e=>{Hd.forEach(({register:t,name:r,unit:n,boundaries:s})=>{const i=e.createHistogram(r,{unit:n,advice:{explicitBucketBoundaries:s}});t(o=>{i.record(o.value,{"web_vital.rating":o.rating,"web_vital.navigation_type":o.navigationType,"page.route":zd()})})})},qd=()=>{const{GPv2UIOtelEndpoint:e,OtelTracesSamplerRatio:t}=P();if(typeof e!="string"||e.trim()==="")return;const r=e.trim().replace(/\/+$/,""),n=os({[$n]:Ce,"deployment.environment":window.location.hostname}),s=new iu({resource:n,sampler:new ht({root:new sr(t!=null?t:1)}),spanProcessors:[new eu(new $h({url:`${r}/v1/traces`}))]});s.register();const i=new yl({resource:n,readers:[new $u({exporter:new Wh({url:`${r}/v1/metrics`}),exportIntervalMillis:Vd})]});Be.setGlobalMeterProvider(i);const o=[new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),/dc\.services\.visualstudio\.com/,/google-analytics\.com|googletagmanager\.com/];Kh({tracerProvider:s,meterProvider:i,instrumentations:[new sd,new Ed({ignoreUrls:o}),new Id({ignoreUrls:o})]}),jd(i.getMeter("app-shell")),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&(s.forceFlush().catch(()=>{}),i.forceFlush().catch(()=>{}))}),window[Me.otel]=Object.freeze({tracerProvider:s,meterProvider:i})},Ni=async e=>{const t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("")};function Wd(){const{location:e}=window,t=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`,{LoginAuthority:r,GlobalPortalClientId:n,GlobalPortalUIScopes:s,GlobalPlanBShellPostLogoutRedirectUrl:i}=P();return{authority:r,client_id:n,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:s,post_logout_redirect_uri:i,monitorSession:!1}}const xr=new zi(Wd()),Xd=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(window.atob(t).split("").map(n=>`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(r)},Yd=()=>{localStorage.removeItem(Xt)},W=()=>{const e=localStorage.getItem(Xt);return e?JSON.parse(e):null},xi=()=>{var e;const t=localStorage.getItem(tn);return t?(e=JSON.parse(t))==null?void 0:e.email:null},Kd=async()=>{const e=W();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await Ni(t)},Ui=()=>{const e=W();return e?e.id_token:null},Di=(e,t)=>{const r={...t,...e},n=Xd(e.access_token);return r.profile.sub=n.sub,r.profile.account_number=n.account_number,r.expires_at=n.exp,r.is_federated=n.is_federated,n.previous_login_date&&(r.profile.previous_login_date=n.previous_login_date),Yr.setAccount({accountNumber:n.account_number,email:n.email,name:n.name,givenName:n.given_name,familyName:n.family_name,authTime:n.exp,accessToken:e.access_token,idToken:e.id_token}),localStorage.setItem(Xt,JSON.stringify(r)),r},Qd=e=>{Di(e,null)},ki=()=>{const e=W();return e?e.access_token:null},Jd=()=>{const e=W();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},Zd=()=>{const e=W();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},t_=()=>{var e;const t=W();return((e=t==null?void 0:t.profile)==null?void 0:e.previous_login_date)||null},e_=["authenticate","auth-callback","logout"],r_=e=>e.expires_at&&new Date(e.expires_at*1e3),n_=e=>e.expires_at&&new Date(e.expires_at*1e3+P().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),Bi=()=>{if(!P().IsLoginEnabled)return!1;const e=W();if(!Ui())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>r_(e):t>n_(e)},s_=()=>{const e=window.location.pathname.split("/");return e_.includes(e[e.length-1])},i_=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(P().IsLoginEnabled?xr.signinRedirect():window.location.href="/",!0):!1},o_=()=>{let e="/";const t=localStorage.getItem(ye);t&&(localStorage.removeItem(ye),e=t),sessionStorage.setItem(fn.SessionStorage.ShowLastLoginPopup,"true"),window.location.href=e},a_=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},Ur=e=>{const t=s_();(!t||e)&&(t||localStorage.setItem(ye,window.location.href),window.location.href="/authenticate")},c_=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,r=await Ni(t);return{...e,profile:{...e.profile,hashed_identifier:r}}},u_=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(xr.signinRedirectCallback().then(a_).then(c_).then(Qd).then(o_).catch(Ur),!0):!1};class l_ extends Wr{render(){return lt` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",l_);class h_{constructor(){this.permissions=[],this.loading=!1,this.getPermissions=async()=>{var t;const r=(t=Yr)==null?void 0:t.access_token;if(!r)return[];const{ApiBaseUrl:n}=P(),s=await fetch(`${n}/usermanagement/my-permissions?exclude_parents=false&exclude_siblings=true`,{headers:{Authorization:`Bearer ${r}`}});return s.ok?s.json():[]},ji(this,{permissions:Wi,setPermissions:qi})}setPermissions(t){this.permissions=t}tryLoadPermissions(){try{this.loading||(this.loading=!0,this.getPermissions().then(t=>{this.setPermissions(t),this.loading=!1}).catch(()=>{this.loading=!1}))}catch(t){this.loading=!1}}clearPermissions(){this.setPermissions([])}hasExternalUserCreate(){return this.hasPermission(nn,Yt)||this.hasPermission(dn,Yt)}hasConnectivityCreate(){return this.hasPermission(Pe,Yt)}hasPrivilegeLevel(t,r){const n=[io,Yt,no,so],s=n.findIndex(o=>o===t),i=n.findIndex(o=>o===r);return s>=i}hasPermission(t,r){return Xi(this.permissions).some(n=>n.permission_name===t&&this.hasPrivilegeLevel(r,n.privilege))}}const Dr=new h_,Gi=()=>{const e=new Headers;return e.append("Authorization",`Bearer ${ki()}`),e},d_=async()=>{const{ApiBaseUrl:e}=P(),t=`${e}/inventory/locations?embed=permissions&page_size=1000`;let r=[],n=1;for(;;){const i=await fetch(`${t}&cursor=${n}`,{headers:Gi()});if(!i.ok)return Promise.reject();const o=await i.json();if(r.push(...o.items),o.self===o.last)break;n++}r=r.filter(i=>i.permissions.some(o=>_n.includes(o.name)));const s=new Map;for(const i of r)s.has(i.account_number)?s.get(i.account_number).push(i.site_id):s.set(i.account_number,[i.site_id]);return s},__=async e=>{const{ApiBaseUrl:t}=P(),r=new URLSearchParams;r.append("process","Cross_connect");const n=[...e.keys()],s=[...new Set([...e.values()].flat())];r.append("account_number",n.join(",")),r.append("site",s.join(","));const i=await fetch(`${t}/site-navigations/site-configurations?${r}`,{headers:Gi()});return i.ok?await i.json():Promise.reject()},f_=async()=>{try{const e=await d_();return e.size===0?!1:(await __(e)).some(t=>{var r;return t.portal==="GlobalPortal"&&!!((r=e.get(t.account_number))!=null&&r.includes(t.site))})}catch(e){return console.error("Failed to determine portal-managed inventory:",e),!1}};class kr extends Wr{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{P().IsLoginEnabled&&Bi()&&Ur()};try{Mo()}catch(r){console.error("Telemetry initialization failed:",r)}try{qd()}catch(r){console.error("OpenTelemetry initialization failed:",r)}const t=window.location.pathname;if(t==="/session-expired"){this._currentView="session-expired",this._loadView("session-expired");return}if(t==="/logout"){this._currentView="logout",this._loadView("logout");return}if(i_()||u_()){this._currentView="splash";return}if(Bi()){this._currentView="splash",Ur();return}this._currentView="app",this._loadApp()}async _loadView(t){t==="session-expired"?await import("@digital-realty/ix-app-logic/views/session-expiry.js"):t==="logout"&&await import("./logout-DHu3NPe-.js")}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._onPopState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._onPopState)}_getAccountNumber(){var t,r,n;return(n=new URLSearchParams(window.location.search).get("selected_account_number"))!=null?n:(r=(t=W())==null?void 0:t.profile)==null?void 0:r.account_number}_isESGAccessOnly(t,r){const n=t.filter(s=>s.account_number===r);return n.length===1&&n[0].permission_name==="ESG Reporting"}async _applyGomFF(){var t,r;const n=xi(),s=structuredClone(window.gpConfig);if(!n||!s)return;const i=((t=P().SuperusersWhitelist)!=null?t:"").split(",").map(u=>u.trim().toLowerCase()).includes(n.toLowerCase()),o=!!((r=s["app-shell"])!=null&&r.IsInventoryManagementEnabled),a=await f_()&&(i||o);s["app-shell"].IsInventoryManagementEnabled=a,s["ui-launchpad"].IsInventoryManagementEnabled=a,window.gpConfig=Object.freeze(s)}_applyMfeOverrides(t,r){const n={};for(const s of Object.keys(t))n[s]={...t[s],enabled:r.includes(s)};return n}async _loadApp(){var t;const{authedUser:r}=await import("@digital-realty/ix-account-switcher");await r.hydrateStore();const[n,s]=await Promise.allSettled([fetch("./registered-apps.json").then(l=>l.json()),Dr.getPermissions()]);if(n.status==="rejected"){console.error("Failed to load registered apps:",n.reason);return}if(s.status==="rejected"){console.error("Failed to load permissions:",s.reason);return}const{registeredApps:i}=n.value,o=s.value,a=(t=this._getAccountNumber())!=null?t:"",u=this._isESGAccessOnly(o,a)?this._applyMfeOverrides(i,["ui-esg"]):i;await this._applyGomFF(),window.registeredApps=Object.freeze(u),Dr.setPermissions(o),await import("./app-CQYtI6QN.js"),this.appLoaded=!0}render(){switch(this._currentView){case"session-expired":return lt`<ix-session-expiry></ix-session-expiry>`;case"logout":return lt`<ixp-logout></ixp-logout>`;case"app":return this.appLoaded?lt`<global-portal-app appTitle="DLR" showDrawer></global-portal-app>`:lt`<splash-screen></splash-screen>`;default:return lt`<splash-screen></splash-screen>`}}}qr([Xr({type:String})],kr.prototype,"_currentView",void 0),qr([Xr({type:Boolean})],kr.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",kr);export{Ao as A,tn as B,oo as C,ro as D,Eo as E,eo as F,Kr as G,So as I,Jr as M,_n as O,Oo as R,To as S,dn as U,Ui as a,Kd as b,Yd as c,xi as d,ki as e,W as f,P as g,Di as h,t_ as i,Jd as j,fn as k,ho as l,nn as m,uo as n,lo as o,Dr as p,Zr as q,Co as r,Qr as s,Me as t,xr as u,Ce as v,Zi as w,Zd as x,to as y,Xt as z};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-realty/app-shell",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.2-otel-test.549961",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"DLR"
|
|
@@ -44,6 +44,17 @@
|
|
|
44
44
|
"@lit/reactive-element": "^2.0.4",
|
|
45
45
|
"@material/web": "2.4.0",
|
|
46
46
|
"@microsoft/applicationinsights-web": "^2.5.10",
|
|
47
|
+
"@opentelemetry/api": "^1.9.1",
|
|
48
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.221.0",
|
|
49
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
|
|
50
|
+
"@opentelemetry/instrumentation": "^0.221.0",
|
|
51
|
+
"@opentelemetry/instrumentation-document-load": "^0.66.0",
|
|
52
|
+
"@opentelemetry/instrumentation-fetch": "^0.221.0",
|
|
53
|
+
"@opentelemetry/instrumentation-xml-http-request": "^0.221.0",
|
|
54
|
+
"@opentelemetry/resources": "^2.10.0",
|
|
55
|
+
"@opentelemetry/sdk-metrics": "^2.10.0",
|
|
56
|
+
"@opentelemetry/sdk-trace-web": "^2.10.0",
|
|
57
|
+
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
47
58
|
"@vaadin/grid": "^24.4.7",
|
|
48
59
|
"@vaadin/router": "^1.7.2",
|
|
49
60
|
"@web/dev-server-rollup": "^0.3.19",
|
|
@@ -57,6 +68,7 @@
|
|
|
57
68
|
"oidc-client-ts": "^3.0.1",
|
|
58
69
|
"path": "^0.12.7",
|
|
59
70
|
"tslib": "^2.8.1",
|
|
71
|
+
"web-vitals": "^6.0.1",
|
|
60
72
|
"workbox-window": "^7.3.0"
|
|
61
73
|
},
|
|
62
74
|
"devDependencies": {
|