@digital-realty/app-shell 14.0.3 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bootstrap.js +13 -1
  2. package/package.json +13 -1
package/dist/bootstrap.js CHANGED
@@ -1 +1,13 @@
1
- import{__decorate as w}from"tslib";import{LitElement as C,html as l}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 re}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:ae,PortalGlobalPortal:ie,PortalServiceFabric:ce,PortalMarketplacePortal:le}=i(),pe={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},ue={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell",bypass:"gpc_bypass"},R="globalportalappshell",u="user-authentication",g="redirect-url",de="ui-cookie-policy",he="date-format",b="Global Portal",T="Service Fabric",y="Marketplace Portal",v="EMEA Customer Portal",N="x-auth",[d,me,ge,_e]=["CREATE","UPDATE","READ","APPROVE"],[O,_,Ee,fe,k,Se,Et,Ae,L,ft,we,Ce,U,x,M,St,Ie,At,Pe,D,V,G,Re,j,be,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,Se,be,Re,Te,Ie,fe],Ne=[_,O,k,U,x,M,D,V,G,j],H=[_,O,k,U,x,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,Ue]=["Security","DCIM","Planned Site Maintenance"],xe=[ke,Le,Ue],Me=[{label:b,href:ie,selected:!0},{label:y,href:le},{label:v,href:ae},{label:T,href:ce,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"]=R}),s},h=(e,t,s)=>(...n)=>{const[o,...r]=n;typeof o=="string"&&o.startsWith("[mobx]")&&t===4?s.trackException({exception:{message:r[0].message,stack:r[0].stack,name:o},severityLevel:4}):s.trackTrace({severityLevel:t,message:o},r),e.apply(console,[o,...r])},Ve=e=>{console.log=h(console.log,2,e),console.info=h(console.info,2,e),console.warn=h(console.warn,3,e),console.error=h(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:r}=i();return{authority:s,client_id:n,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:o,post_logout_redirect_uri:r,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)},c=()=>{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=c();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await z(t)},J=()=>{const e=c();return e?e.id_token:null},Y=(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=>{Y(e,null)},q=()=>{const e=c();return e?e.access_token:null},ze=()=>{const e=c();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},Ke=()=>{const e=c();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},Je=()=>{var e;const t=c();return((e=t==null?void 0:t.profile)==null?void 0:e.previous_login_date)||null},Ye=["authenticate","auth-callback","logout"],qe=e=>e.expires_at&&new Date(e.expires_at*1e3),We=e=>e.expires_at&&new Date(e.expires_at*1e3+i().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),W=()=>{if(!i().IsLoginEnabled)return!1;const e=c();if(!J())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>qe(e):t>We(e)},Xe=()=>{const e=window.location.pathname.split("/");return Ye.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 C{render(){return l` <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,me,ge],o=n.findIndex(a=>a===t),r=n.findIndex(a=>a===s);return o>=r}hasPermission(t,s){return re(this.permissions).some(n=>n.permission_name===t&&this.hasPrivilegeLevel(s,n.privilege))}}const S=new ot,X=()=>{const e=new Headers;return e.append("Authorization",`Bearer ${q()}`),e},rt=async()=>{const{ApiBaseUrl:e}=i(),t=`${e}/inventory/locations?embed=permissions&page_size=1000`;let s=[],n=1;for(;;){const r=await fetch(`${t}&cursor=${n}`,{headers:X()});if(!r.ok)return Promise.reject();const a=await r.json();if(s.push(...a.items),a.self===a.last)break;n++}s=s.filter(r=>r.permissions.some(a=>H.includes(a.name)));const o=new Map;for(const r of s)o.has(r.account_number)?o.get(r.account_number).push(r.site_id):o.set(r.account_number,[r.site_id]);return o},at=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 r=await fetch(`${t}/site-navigations/site-configurations?${s}`,{headers:X()});return r.ok?await r.json():Promise.reject()},it=async()=>{try{const e=await rt();return e.size===0?!1:(await at(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}},ct="SUPERUSER";class A extends C{_isSuperUser(t){return t.some(s=>{var n;return(n=s.provenance)==null?void 0:n.includes(ct)})}constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{i().IsLoginEnabled&&W()&&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(W()){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=c())==null?void 0:t.profile)==null?void 0:s.account_number}_redirectTo(t){window.location.href=t}_isESGAccessOnly(t,s){const n=t.filter(o=>o.account_number===s);return n.length===1&&n[0].permission_name==="ESG Reporting"}async _applyGomFF(t){var s;const n=K(),o=structuredClone(window.gpConfig);if(!n||!o)return;const r=this._isSuperUser(t),a=!!((s=o["app-shell"])!=null&&s.IsInventoryManagementEnabled),p=await it()&&(r||a);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(m=>m.json()),S.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:r}=n.value,a=o.value,p=(t=this._getAccountNumber())!=null?t:"";if(!p){const{LoginAuthority:m}=i();this._redirectTo(`${m}/Account/NoAccess`);return}const Q=this._isESGAccessOnly(a,p)?this._applyMfeOverrides(r,["ui-esg"]):r;await this._applyGomFF(a),window.registeredApps=Object.freeze(Q),S.setPermissions(a),await import("./app-CQYtI6QN.js"),this.appLoaded=!0}render(){switch(this._currentView){case"session-expired":return l`<ix-session-expiry></ix-session-expiry>`;case"logout":return l`<ixp-logout></ixp-logout>`;case"app":return this.appLoaded?l`<global-portal-app appTitle="DLR" showDrawer></global-portal-app>`:l`<splash-screen></splash-screen>`;default:return l`<splash-screen></splash-screen>`}}}w([I({type:String})],A.prototype,"_currentView",void 0),w([I({type:Boolean})],A.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",A);export{Oe as A,N as B,Ee as C,he as D,ye as E,de as F,b as G,Ne as I,y as M,H as O,xe as R,ve as S,$ as U,J as a,Be as b,He as c,K as d,q as e,c as f,i as g,Y as h,Je as i,ze as j,B as k,Ce as l,L as m,Ae as n,we as o,S as p,v as q,Me as r,T as s,F as t,E as u,R as v,pe as w,Ke as x,ue as y,u as z};
1
+ var zi=Object.defineProperty;var ji=(e,t,r)=>t in e?zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var c=(e,t,r)=>ji(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 qi,DistributedTracingModes as Wi}from"@microsoft/applicationinsights-web";import{authedUser as Yr}from"@digital-realty/ix-account-switcher";import{UserManager as Xi}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as Yi,action as Ki,observable as Qi,toJS as Ji}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:Zi,PortalGlobalPortal:to,PortalServiceFabric:eo,PortalMarketplacePortal:ro}=P(),no={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},so={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell",bypass:"gpc_bypass"},Ce="globalportalappshell",Xt="user-authentication",ye="redirect-url",io="ui-cookie-policy",oo="date-format",Kr="Global Portal",Qr="Service Fabric",Jr="Marketplace Portal",Zr="EMEA Customer Portal",tn="x-auth",[Yt,ao,co,uo]=["CREATE","UPDATE","READ","APPROVE"],[en,Pe,lo,ho,rn,_o,M_,po,nn,v_,fo,mo,sn,on,an,I_,go,L_,Eo,cn,un,ln,To,hn,So,Ao,dn,bo]=["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"],wo=[Eo,_o,So,To,Ao,go,ho],Ro=[Pe,en,rn,sn,on,an,cn,un,ln,hn],_n=[Pe,en,rn,sn,on,an,cn,un,ln,hn],Oo={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},pn={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges",ShowLastLoginPopup:"showLastLoginPopup"}},[Co,yo,Po]=["Security","DCIM","Planned Site Maintenance"],Mo=[Co,yo,Po],vo=[{label:Kr,href:to,selected:!0},{label:Jr,href:ro},{label:Zr,href:Zi},{label:Qr,href:eo,target:"_blank"}],Me={appInsights:"_appInsights",otel:"_otel"},Io=()=>{const{ApplicationInsightsInstrumentationKey:e,ApplicationInsightsCorrelationHeaderExcludedDomains:t}=P(),r=new qi({config:{instrumentationKey:e,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:Wi.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])},Lo=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},No=()=>{const{ApplicationInsightsInstrumentationKey:e}=P();if(!e)return;const t=Io();window[Me.appInsights]=t,window.dispatchEvent(new Event("appInsightsInitialized")),Lo(t)},Z="1.9.1",fn=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function xo(e){const t=new Set([e]),r=new Set,n=e.match(fn);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(fn);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 Uo=xo(Z),Do=Z.split(".")[0],bt=Symbol.for(`opentelemetry.js.api.${Do}`),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||!Uo(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 ko{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 Bo(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 Go="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=Bo((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(Go,r)},r.createComponentLogger=s=>new ko(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 Fo=Symbol("BaggageEntryMetadata"),$o=x.instance();function Vo(e={}){return new mt(new Map(Object.entries(e)))}function Ho(e){return typeof e!="string"&&($o.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Fo,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 zo{constructor(){}createGauge(t,r){return Zo}createHistogram(t,r){return ta}createCounter(t,r){return Jo}createUpDownCounter(t,r){return ea}createObservableGauge(t,r){return na}createObservableCounter(t,r){return ra}createObservableUpDownCounter(t,r){return sa}addBatchObservableCallback(t,r){}removeBatchObservableCallback(t){}}class Qt{}class jo extends Qt{add(t,r){}}class qo extends Qt{add(t,r){}}class Wo extends Qt{record(t,r){}}class Xo extends Qt{record(t,r){}}class Ie{addCallback(t){}removeCallback(t){}}class Yo extends Ie{}class Ko extends Ie{}class Qo extends Ie{}const mn=new zo,Jo=new jo,Zo=new Wo,ta=new Xo,ea=new qo,ra=new Yo,na=new Ko,sa=new Qo;function yt(){return mn}var X;(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(X||(X={}));const ia={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},oa={set(e,t,r){e!=null&&(e[t]=r)}};class aa{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",ca=new aa;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)||ca}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 ua(){return xe(gt.getInstance().active())}function Ue(e,t){return e.setValue(Ne,t)}function la(e){return e.deleteValue(Ne)}function ha(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 da(e){return An(e,16)&&e!==gn}function Zt(e){return bn(e.traceId)&&da(e.spanId)}function _a(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 pa(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 pa(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 fa=new wn;class ma{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):fa}}class ga{getTracer(t,r,n){return new wn}}const Ea=new ga;class Rn{getTracer(t,r,n){var s;return(s=this.getDelegateTracer(t,r,n))!==null&&s!==void 0?s:new ma(this,t,r,n)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Ea}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(),f=x.instance();class Ta{getMeter(t,r,n){return mn}}const Sa=new Ta,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)||Sa}getMeter(t,r,n){return this.getMeterProvider().getMeter(t,r,n)}disable(){Ot(ke,x.instance())}}const Be=Br.getInstance();class Aa{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 ba(){return On(gt.getInstance().active())}function wa(e,t){return e.setValue(Ge,t)}function Ra(e){return e.deleteValue(Ge)}const Fe="propagation",Oa=new Aa;class Gr{constructor(){this.createBaggage=Vo,this.getBaggage=On,this.getActiveBaggage=ba,this.setBaggage=wa,this.deleteBaggage=Ra}static getInstance(){return this._instance||(this._instance=new Gr),this._instance}setGlobalPropagator(t){return Rt(Fe,t,x.instance())}inject(t,r,n=oa){return this._getGlobalPropagator().inject(t,r,n)}extract(t,r,n=ia){return this._getGlobalPropagator().extract(t,r,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Ot(Fe,x.instance())}_getGlobalPropagator(){return tt(Fe)||Oa}}const U=Gr.getInstance(),$e="trace";class Fr{constructor(){this._proxyTracerProvider=new Rn,this.wrapSpanContext=_a,this.isSpanContextValid=Zt,this.deleteSpan=la,this.getSpan=xe,this.getActiveSpan=ua,this.getSpanContext=Sn,this.setSpan=Ue,this.setSpanContext=ha}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 Ca="=",Pn=";",Mn=",",He="baggage",vn=180,In=4096,Ln=8192;function ya(e){return e.reduce((t,r)=>{const n=`${t}${t!==""?Mn:""}${r}`;return n.length>Ln?t:n},"")}function Pa(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 Ma(e){if(!e)return;const t=e.indexOf(Pn),r=t===-1?e:e.substring(0,t),n=r.indexOf(Ca);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=Ho(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=Ma(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 va{inject(t,r,n){const s=U.getBaggage(t);if(!s||Ve(t))return;const i=Pa(s).filter(a=>a.length<=In).slice(0,vn),o=ya(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(!Ia(r)){f.warn(`Invalid attribute key: ${r}`);continue}const n=e[r];if(!xn(n)){f.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?t[r]=n.slice():t[r]=n}return t}function Ia(e){return typeof e=="string"&&e!==""}function xn(e){return e==null?!0:Array.isArray(e)?La(e):Un(typeof e)}function La(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 Na(){return e=>{f.error(xa(e))}}function xa(e){return typeof e=="string"?e:JSON.stringify(Ua(e))}function Ua(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 Da=Na();function Y(e){try{Da(e)}catch(t){}}function N_(e){}const ka="2.10.0",It="error.type",ze="exception.message",Ba="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",Ga="service.instance.id",$n="service.name",qe="telemetry.sdk.language",Fa="webjs",We="telemetry.sdk.name",Xe="telemetry.sdk.version",Lt="url.full",$a="user_agent.original",Va="process.runtime.name",Ye={[We]:"opentelemetry",[Va]:"browser",[qe]:Fa,[Xe]:ka},O=performance,Ha=9,za=6,ja=Math.pow(10,za),Nt=Math.pow(10,Ha);function L(e){const t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*ja);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 qa(e){return e[0]*1e3+e[1]/1e6}function Wa(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 Xa{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){f.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){f.warn(`Failed to extract with ${i.constructor.name}. Err: ${o.message}`)}return s},t)}fields(){return this._fields.slice()}}const Je="[_0-9a-z-*/]",Ya=`[a-z]${Je}{0,255}`,Ka=`[a-z0-9]${Je}{0,240}@[a-z]${Je}{0,13}`,Qa=new RegExp(`^(?:${Ya}|${Ka})$`),Ja=/^[ -~]{0,255}[!-~]$/,Za=/,|=/;function zn(e){return Qa.test(e)}function jn(e){return Ja.test(e)&&!Za.test(e)}const tc=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>=tc))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",ec="00",rc="(?!ff)[\\da-f]{2}",nc="(?![0]{32})[\\da-f]{32}",sc="(?![0]{16})[\\da-f]{16}",ic="[\\da-f]{2}",oc=new RegExp(`^\\s?(${rc})-(${nc})-(${sc})-(${ic})(-.*)?\\s?$`);function ac(e){const t=oc.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}class cc{inject(t,r,n){const s=R.getSpanContext(t);if(!s||Ve(t)||!Zt(s))return;const i=`${ec}-${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=ac(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 uc="[object Object]",lc="[object Null]",hc="[object Undefined]",dc=Function.prototype,Kn=dc.toString,_c=Kn.call(Object),pc=Object.getPrototypeOf,Qn=Object.prototype,Jn=Qn.hasOwnProperty,rt=Symbol?Symbol.toStringTag:void 0,Zn=Qn.toString;function ts(e){if(!fc(e)||mc(e)!==uc)return!1;const t=pc(e);if(t===null)return!0;const r=Jn.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Kn.call(r)===_c}function fc(e){return e!=null&&typeof e=="object"}function mc(e){return e==null?e===void 0?hc:lc:rt&&rt in Object(e)?gc(e):Ec(e)}function gc(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 Ec(e){return Zn.call(e)}const Tc=20;function Sc(...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>Tc)){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(!Ac(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 p=n.get(h)||[],_=n.get(d)||[];p.push({obj:e,key:u}),_.push({obj:t,key:u}),n.set(h,p),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 Ac(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 bc{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 wc{constructor(t,r){c(this,"_isCalled",!1);c(this,"_deferred",new bc);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 Rc(e,t){return new Promise(r=>{b.with(yn(b.active()),()=>{e.export(t,r)})})}const Oc={_export:Rc};let ie;function Cc(){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=yc(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&&f.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)){f.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=Pc(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]:Cc(),[qe]:Ye[qe],[We]:Ye[We],[Xe]:Ye[Xe]})}function cs(e){return e.map(([t,r])=>Dt(r)?[t,r.catch(n=>{f.debug("promise rejection for resource attribute: %s - %s",t,n)})]:[t,r])}function yc(e){if(typeof e=="string"||e===void 0)return e;f.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}function Pc(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;f.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}const Mc="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 vc{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 f.warn(`Invalid attribute key: ${t}`),this;if(!xn(r))return f.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 f.warn("No events allowed."),this._droppedEventsCount++,this;s!==void 0&&this.events.length>=s&&(this._droppedEventsCount===0&&f.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&&f.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&&f.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()){f.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&&(f.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&&f.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&f.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[Ba]=t.stack)),n[je]||n[ze]?this.addEvent(Mc,n,r):f.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}}`);f.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?(f.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 Ic="otel.component.name",Lc="otel.component.type",Nc="otel.span.parent.origin",us="otel.span.sampling_result",xc="otel.sdk.processor.span.processed",Uc="otel.sdk.processor.span.queue.capacity",Dc="otel.sdk.processor.span.queue.size",kc="otel.sdk.span.live",Bc="otel.sdk.span.started",Gc="batching_span_processor";class Fc{constructor(t){c(this,"startedSpans");c(this,"liveSpans");this.startedSpans=t.createCounter(Bc,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter(kc,{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,r){const n=Vc(r);if(this.startedSpans.add(1,{[Nc]:$c(t),[us]:n}),r===F.NOT_RECORD)return()=>{};const s={[us]:n};return this.liveSpans.add(1,s),()=>{this.liveSpans.add(-1,s)}}}function $c(e){return e?e.isRemote?"remote":"local":"none"}function Vc(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 Hc="2.10.0";class zc{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",Hc);this._tracerMetrics=new Fc(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 f.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)})),p=vt(r.attributes),_=this._sampler.shouldSample(n,u,t,h,p,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 f.debug("Recording is off, propagating context in a non-recording span"),R.wrapSpanContext(T);const A=vt(Object.assign(p,_.attributes));return new vc({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 jc{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 qc{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={[Lc]:t,[Ic]:`${t}/${s}`},this.droppedAttrs={...this.standardAttrs,[It]:"queue_full"},this.processedSpans=r.createCounter(xc,{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(Uc,{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(Dc,{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 Wc{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 wc(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(f.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 qc(Gc,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&&f.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(f.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 Xc=class extends Wc{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 Yc=16,Kc=8,hs=new Uint8Array(Yc),ds=new Uint8Array(Kc),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 ps(e){let t="";for(let r=0;r<e.length;r++)t+=Qc[e[r]];return t}class Jc{generateTraceId(){return _s(hs),ps(hs)}generateSpanId(){return _s(ds),ps(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 Zc{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,p,_,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 jc(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:(p=(d=t.spanLimits)==null?void 0:d.eventCountLimit)!=null?p: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 Jc,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 zc({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 fs=1;function tu(){return{sampler:eu(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function eu(){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 f.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${$.ParentBasedAlwaysOn}".`),new ht({root:new nt})}}function ms(){return f.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${fs}.`),fs}const ru=128,nu=1/0;function su(e){var r,n,s,i,o,a,u,l,h,d,p,_;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:ru,t.attributeValueLengthLimit=(_=(p=(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?p:void 0)!=null?_:nu,Object.assign({},e,{spanLimits:t})}class iu extends Zc{constructor(t={}){const r=Sc({},tu(),su(t));delete r.generalLimits,super(r)}}class ou extends Xc{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 au{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 cu(e){if(e!==null){if(e===void 0){const t=new au;t.enable(),b.setGlobalContextManager(t);return}e.enable(),b.setGlobalContextManager(e)}}function uu(e){if(e!==null){if(e===void 0){U.setGlobalPropagator(new Xa({propagators:[new cc,new va]}));return}U.setGlobalPropagator(e)}}class lu extends iu{constructor(t={}){super(t)}register(t={}){R.setGlobalTracerProvider(this),uu(t.propagator),cu(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 hu="http.response_content_length",du="http.response_content_length_uncompressed";let ir;function _u(){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(hu,i);const o=t[S.DECODED_BODY_SIZE];o!==void 0&&i!==o&&e.setAttribute(du,o)}}function pu(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=mu(e,t,r,n,s,i);if(a.length===0)return{mainRequest:void 0};if(a.length===1)return{mainRequest:a[0]};const u=pu(a);if(o.origin!==gs()&&u.length>1){let l=u[0],h=fu(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 fu(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])),p=n-d;h>=s&&(!o||p<o)&&(o=p,i=l)}return i}function mu(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=_u();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 gu(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 Eu(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function Tu(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 Su(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 Au{constructor(){c(this,"kind",it.DROP)}createAccumulation(){}merge(t,r){}diff(t,r){}toMetricData(t,r,n,s){}}function bu(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=bu(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=Tu(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 wu=52,Ru=2146435072,Ou=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)&Ru)>>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&Ou)*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 Cu(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 yu{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,wu);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 Pu{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,Mu=Array.from({length:31},(e,t)=>t>10?new Pu(t-10):new yu(t-10));function Ps(e){if(e>ys||e<Cs)throw new Bt(`expected scale >= ${Cs} && <= ${ys}, got: ${e}`);return Mu[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 vu=20,Iu=160,lr=2;class Hr{constructor(t,r=Iu,n=!0,s=0,i=0,o=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,l=new Ae,h=new Ae,d=Ps(vu)){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&&(f.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=Cu(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 Lu{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 Nu{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 Au);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 Nu);let pr=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 fr=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 xu{constructor(t=160,r=!0){c(this,"_maxSize");c(this,"_recordMinMax");this._maxSize=t,this._recordMinMax=r}createAggregator(t){return new Lu(this._maxSize,this._recordMinMax)}}class Uu{_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 f.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 pr,xs=new fr,Du=new Uu;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 Du;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 xu((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 ku=e=>({type:B.DEFAULT}),Bu=e=>k.CUMULATIVE,Gu="otel.component.name",Fu="otel.component.type",$u="periodic_metric_reader",Vu="otel.sdk.metric_reader.collection.duration",Hu="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={[Fu]:t,[Gu]:`${t}/${n}`},this.collectionDuration=r.createHistogram(Vu,{unit:"s",description:"The duration of the collect operation of the metric reader.",advice:{explicitBucketBoundaries:[]}})}recordCollection(t,r){const n=r?{...this.standardAttrs,[Hu]:r}:this.standardAttrs;this.collectionDuration.record(t,n)}}const zu="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:ku,this._aggregationTemporalitySelector=(n=t==null?void 0:t.aggregationTemporalitySelector)!=null?n:Bu,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",zu);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=Wa(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){f.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){f.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 ju(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,p=Math.min(d,l.length-h);a||(a={scope:o.scope,metrics:[]},s.push(a));const _={...u,dataPoints:l.slice(h,h+p)};a.metrics.push(_),h+=p,n+=p,n===t&&(i(),a=null)}}}return i(),r}class qu 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:$u,metricProducers:i,cardinalitySelector:d=>{var _,E,m,T,A,M,y;const p={default:2e3,...o};switch(d){case g.COUNTER:return(_=p.counter)!=null?_:p.default;case g.GAUGE:return(E=p.gauge)!=null?E:p.default;case g.HISTOGRAM:return(m=p.histogram)!=null?m:p.default;case g.OBSERVABLE_COUNTER:return(T=p.observableCounter)!=null?T:p.default;case g.OBSERVABLE_UP_DOWN_COUNTER:return(A=p.observableUpDownCounter)!=null?A:p.default;case g.OBSERVABLE_GAUGE:return(M=p.observableGauge)!=null?M:p.default;case g.UP_DOWN_COUNTER:return(y=p.upDownCounter)!=null?y:p.default;default:return p.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");f.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){f.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&&f.error("PeriodicExportingMetricReader: metrics collection errors",...s),n.resource.asyncAttributesPending)try{await((u=(a=n.resource).waitForAsyncAttributes)==null?void 0:u.call(a))}catch(l){f.debug("Error while resolving async portion of resource: ",l),Y(l)}if(n.scopeMetrics.length===0)return;const i=this._maxExportBatchSize?ju(n,this._maxExportBatchSize):[n];let o=null;for(const l of i)try{const h=await kt(Oc._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){f.error(`PeriodicExportingMetricReader: metrics export timed out after ${this._exportTimeout}ms`);break}else f.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){f.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 Wu{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)||f.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 Xu(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 Yu(e,t){return Su(e.name,t.name)&&e.unit===t.unit&&e.type===t.type&&e.valueType===t.valueType}const Ku=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function Qu(e){return Ku.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"){f.warn(`non-number value provided to metric ${this._descriptor.name}: ${t}`);return}this._descriptor.valueType===X.INT&&!Number.isInteger(t)&&(f.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 Ju extends ae{add(t,r,n){this._record(t,r,n)}}class Zu extends ae{add(t,r,n){if(t<0){f.warn(`negative value provided to counter ${this._descriptor.name}: ${t}`);return}this._record(t,r,n)}}class tl extends ae{record(t,r,n){this._record(t,r,n)}}class el extends ae{record(t,r,n){if(t<0){f.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 rl extends ce{}class nl extends ce{}class sl extends ce{}function mr(e){return e instanceof ce}class il{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 tl(s,n)}createHistogram(t,r){const n=Q(t,g.HISTOGRAM,r),s=this._meterSharedState.registerMetricStorage(n);return new el(s,n)}createCounter(t,r){const n=Q(t,g.COUNTER,r),s=this._meterSharedState.registerMetricStorage(n);return new Zu(s,n)}createUpDownCounter(t,r){const n=Q(t,g.UP_DOWN_COUNTER,r),s=this._meterSharedState.registerMetricStorage(n);return new Ju(s,n)}createObservableGauge(t,r){const n=Q(t,g.OBSERVABLE_GAUGE,r),s=this._meterSharedState.registerAsyncMetricStorage(n);return new nl(n,s,this._meterSharedState.observableRegistry)}createObservableCounter(t,r){const n=Q(t,g.OBSERVABLE_COUNTER,r),s=this._meterSharedState.registerAsyncMetricStorage(n);return new rl(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 sl(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 ol{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 ol{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=al(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 al(e){return Array.from(e.entries())}class cl 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 ul(e,t){return` - use valueType '${e.valueType}' on instrument creation or use an instrument name other than '${t.name}'`}function ll(e,t){return` - use unit '${e.unit}' on instrument creation or use an instrument name other than '${t.name}'`}function hl(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 dl(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?ul(e,t):e.unit!==t.unit?ll(e,t):e.type!==t.type?hl(e,t):e.description!==t.description?dl(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();Yu(i,t)?(i.description!==t.description&&(t.description.length>i.description.length&&s.updateDescription(t.description),f.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):f.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 _l{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 pl{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"){f.warn(`non-number value provided to metric ${this._instrumentName}: ${t}`);return}this._valueType===X.INT&&!Number.isInteger(t)&&(f.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 fl{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"){f.warn(`non-number value provided to metric ${t._descriptor.name}: ${r}`);return}t._descriptor.valueType===X.INT&&!Number.isInteger(r)&&(f.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 ml{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){f.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 pl(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 fl;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&&Eu(n.instruments,r))}}class gl 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 El{constructor(t,r){c(this,"metricStorageRegistry",new zr);c(this,"observableRegistry",new ml);c(this,"meter");c(this,"_meterProviderSharedState");c(this,"_instrumentationScope");this.meter=new il(this),this._meterProviderSharedState=t,this._instrumentationScope=r}registerMetricStorage(t){const r=this._registerMetricStorage(t,gl);return r.length===1?r[0]:new _l(r)}registerAsyncMetricStorage(t){return this._registerMetricStorage(t,cl)}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=Xu(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),p=new r(t,h,void 0,[a],d);return this.metricStorageRegistry.registerForCollector(a,p),p});s=s.concat(o)}return s}}class Tl{constructor(t){c(this,"viewRegistry",new Wu);c(this,"metricCollectors",[]);c(this,"meterSharedStates",new Map);c(this,"resource");this.resource=t}getMeterSharedState(t){const r=gu(t);let n=this.meterSharedStates.get(r);return n==null&&(n=new El(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 Sl{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 Al=/[\^$\\.+?()[\]{}|]/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(Al,"\\$&").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 bl{process(t,r){return t}}class wl{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 Rl(){return Cl}function Ol(e){return new wl(e)}const Cl=new bl;class yl{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 Pl{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 Ml(e){return e.instrumentName==null&&e.instrumentType==null&&e.instrumentUnit==null&&e.meterName==null&&e.meterVersion==null&&e.meterSchemaUrl==null}function vl(e){if(Ml(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 Il{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;vl(t),t.attributesProcessors!=null?this.attributesProcessor=Ol(t.attributesProcessors):this.attributesProcessor=Rl(),this.name=t.name,this.description=t.description,this.aggregation=Us((r=t.aggregation)!=null?r:{type:B.DEFAULT}),this.instrumentSelector=new yl({name:t.instrumentName,type:t.instrumentType,unit:t.instrumentUnit}),this.meterSelector=new Pl({name:t.meterName,version:t.meterVersion,schemaUrl:t.meterSchemaUrl}),this.aggregationCardinalityLimit=t.aggregationCardinalityLimit}}class Ll{constructor(t){c(this,"_sharedState");c(this,"_shutdown",!1);var r;if(this._sharedState=new Tl((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 Il(n));if((t==null?void 0:t.readers)!=null&&t.readers.length>0)for(const n of t.readers){const s=new Sl(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?(f.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){f.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){f.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 Nl(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function xl(e){if(e!=null)return async()=>e}function Ul(e,t,r){var n,s,i,o,a,u;return{timeoutMillis:Nl((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 Dl(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class kl{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 Bl(e){return new kl(e.concurrencyLimit)}function Gl(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function Fl(){return{handleResponse(e){e==null||!Gl(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||f.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class $l{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=f.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 Vl(e,t){return new $l(e.transport,e.serializer,Fl(),e.promiseHandler,e.metrics,t.timeout)}function Hl(e,t,r,n){return Vl({transport:n,serializer:t,promiseHandler:Bl(e),metrics:r},{timeout:e.timeoutMillis})}const js="http.response.status_code",zl="otel.component.name",jl="otel.component.type",ql="server.address",Wl="server.port",Xl="error.type",Yl="0.221.0",qs=new Map;class Kl{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",Yl):yt(),u=(l=qs.get(r))!=null?l:0;if(qs.set(r,u+1),this.standardAttrs={[jl]:r,[zl]:`${r}/${u}`},i){let h=i;i.includes("://")||(h=`http://${i}`);try{const d=new URL(h);this.standardAttrs[ql]=d.hostname;let p;d.port?p=Number(d.port):d.protocol==="http:"?p=80:d.protocol==="https:"&&(p=443),typeof p=="number"&&(this.standardAttrs[Wl]=p)}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,[Xl]:s instanceof Error?s.name:"export_failed"}:this.standardAttrs;this.exported.add(r,o);const a={...o,...this.responseAttributesFromError(s)},u=qa(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 Jl=new Ys,le=Symbol.for("io.opentelemetry.js.api.logs"),Ft=globalThis;function Zl(e,t,r){return n=>n===e?t:r}const Ks=1;class th{getLogger(t,r,n){return new Ys}}const Qs=new th;class eh{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):Jl}}class Js{getLogger(t,r,n){var s;return(s=this._getDelegateLogger(t,r,n))!==null&&s!==void 0?s:new eh(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]=Zl(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=>rh(r,e[r],t))}function rh(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 nh(e){const t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function sh(e){return nh(e).toString()}const ih=typeof BigInt<"u"?sh:j;function ri(e){return e}const ni={encodeHrTime:ih,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 oh(e,t){const r=ti(e.resource,t);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:ah(e.scopeMetrics,t)}}function ah(e,t){return Array.from(e.map(r=>({scope:ei(r.scope,t),metrics:r.metrics.map(n=>ch(n,t)),schemaUrl:r.scope.schemaUrl})))}function ch(e,t){const r={name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit},n=dh(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:lh(e,t)};break;case V.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:hh(e,t)};break}return r}function uh(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=>uh(r,e.descriptor.valueType,t))}function lh(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 hh(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 dh(e){switch(e){case k.DELTA:return he.AGGREGATION_TEMPORALITY_DELTA;case k.CUMULATIVE:return he.AGGREGATION_TEMPORALITY_CUMULATIVE}}function _h(e,t){return{resourceMetrics:e.map(r=>oh(r,t))}}const ph={serializeRequest:e=>{const t=_h([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 f.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}},fh=256,mh=512;function ii(e,t){let r=e&255|fh;return t&&(r|=mh),r}function gh(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=>Th(l,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(l=>Eh(l,t)),droppedLinksCount:e.droppedLinksCount,flags:ii(r.traceFlags,(u=e.parentSpanContext)==null?void 0:u.isRemote)}}function Eh(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 Th(e,t){return{attributes:e.attributes?J(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Sh(e,t){return{resourceSpans:bh(e,t)}}function Ah(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 bh(e,t){const r=Ah(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=>gh(m,t));u.push({scope:ei(_[0].instrumentationScope,t),spans:E,schemaUrl:_[0].instrumentationScope.schemaUrl})}h=l.next()}const d=ti(o,t),p={resource:d,scopeSpans:u,schemaUrl:d.schemaUrl};n.push(p),i=s.next()}return n}const wh={serializeRequest:e=>{const t=Sh(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 f.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}},Er=5,Rh=1e3,Oh=5e3,Ch=1.5,oi=.2;function yh(){return Math.random()*(2*oi)-oi}class Ph{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=Rh;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+yh()),Oh),0);s=s*Ch;const l=(a=o.retryInMillis)!=null?a:u,h=i-Date.now();if(l>h)return f.info(`Export retry time ${Math.round(l)}ms exceeds remaining timeout ${Math.round(h)}ms, not retrying further.`),o;f.verbose(`Scheduling export retry in ${Math.round(l)}ms`),o=await this.retry(t,h,l)}return o.status==="success"?f.verbose(`Export succeeded after ${Er-n} retry attempts.`):o.status==="retryable"?f.info(`Export failed after maximum retry attempts (${Er}).`):f.info(`Export failed with non-retryable error: ${o.error}`),o}shutdown(){return this._transport.shutdown()}}function Mh(e){return new Ph(e.transport)}function vh(e){return e===429||e===502||e===503||e===504}function Ih(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 Lh=60*1024,Nh=9;let Tr=0,de=0;class xh{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>Lh,u=de>=Nh,l=!a&&!u;if(l)Tr+=o,de++;else{const h=a?"size limit":"count limit";f.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 f.debug(`export response success (status: ${d.status})`),{status:"success"};if(vh(d.status)){f.warn(`export response retryable (status: ${d.status})`);const p=d.headers.get("Retry-After");return{status:"retryable",retryInMillis:Ih(p)}}return f.error(`export response failure (status: ${d.status})`),{status:"failure",error:new Error(`Fetch request failed with non-retryable status ${d.status}`)}}catch(h){return Dh(h)?(f.warn(`export request retryable (network error: ${h})`),{status:"retryable",error:new Error("Fetch request encountered a network error",{cause:h})}):(f.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 Uh(e){return new xh(e)}function Dh(e){return e instanceof TypeError&&!e.cause}function kh(e,t,r){return Hl(e,t,r,Mh({transport:Uh(e)}))}function Bh(e){const t={};return Object.entries(e!=null?e:{}).forEach(([r,n])=>{typeof n<"u"?t[r]=String(n):f.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),t}function Gh(e,t,r){return async()=>{const n={...await r()},s={};return t!=null&&Object.assign(s,await t()),e!=null&&Object.assign(s,Bh(await e())),Object.assign(s,n)}}function Fh(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 $h(e,t,r){var n,s;return{...Ul(e,t,r),headers:Gh(e.headers,t.headers,r.headers),url:(s=(n=Fh(e.url))!=null?n:t.url)!=null?s:r.url}}function Vh(e,t){return{...Dl(),headers:async()=>e,url:"http://localhost:4318/"+t}}function Hh(e){return typeof e.headers=="function"?e.headers:xl(e.headers)}function zh(e,t,r){return $h({url:e.url,timeoutMillis:e.timeoutMillis,headers:Hh(e),concurrencyLimit:e.concurrencyLimit},{},Vh(r,t))}function ai(e,t,r,n){return new Kl({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=zh(e,i,o);return kh(a,t,ai(r,n,a.url,e.selfObsMeterProvider))}const jh="otlp_http_span_exporter";class qh extends Hs{constructor(t={}){super(ci(t,wh,jh,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 Wh(){const e="cumulative".toLowerCase();return e==="cumulative"?Sr:e==="delta"?ui:e==="lowmemory"?li:(f.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${e}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),Sr)}function Xh(e){return e!=null?e===_e.DELTA?ui:e===_e.LOWMEMORY?li:Sr:Wh()}const Yh=Object.freeze({type:B.DEFAULT});function Kh(e){var t;return(t=e==null?void 0:e.aggregationPreference)!=null?t:(()=>Yh)}class Qh extends Hs{constructor(r,n){super(r);c(this,"_aggregationTemporalitySelector");c(this,"_aggregationSelector");this._aggregationSelector=Kh(n),this._aggregationTemporalitySelector=Xh(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 Jh extends Qh{constructor(r){super(ci(r!=null?r:{},ph,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 Zh(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 td(e){e.forEach(t=>t.disable())}function ed(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 Zh(s,t,r,n),()=>{td(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},rd=(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}},nd=(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 sd{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",rd);c(this,"_massUnwrap",nd);this.instrumentationName=t,this.instrumentationVersion=r,this.setConfig(n),this._diag=f.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 sd{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 id="0.66.0",od="@opentelemetry/instrumentation-document-load";var pe;(function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"})(pe||(pe={}));const ad=()=>{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},pi={"first-paint":pe.FIRST_PAINT,"first-contentful-paint":pe.FIRST_CONTENTFUL_PAINT},cd=e=>{var r;const t=(r=O.getEntriesByType)==null?void 0:r.call(O,"paint");t&&t.forEach(({name:n,startTime:s})=>{dt(pi,n)&&e.addEvent(pi[n],s)})};class ud extends Ar{constructor(r={}){super(od,id,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=ad(),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($a,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||cd(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 ld="http.request.body.size",fi=f.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function hd(...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}=dd(t.body);return t.body=r,n}else return Promise.resolve(pd(t.body))}else{const t=e[0];return t!=null&&t.body?t.clone().text().then(r=>br(r)):Promise.resolve()}}function dd(e){if(!e.pipeThrough)return fi.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 _d(e){return typeof Document<"u"&&e instanceof Document}function pd(e){if(_d(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 md(e);if(e instanceof URLSearchParams)return br(e.toString());if(e.byteLength!==void 0)return e.byteLength;fi.warn("unknown body type")}const fd=new TextEncoder;function br(e){return fd.encode(e).byteLength}function md(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 gd(e){const t=Td(),r=e.toUpperCase();return r in t?r:"_OTHER"}const Ed={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let wr;function Td(){return wr===void 0&&(wr=Ed),wr}const Sd={"https:":"443","http:":"80"};function Ad(e){const t=Number(e.port||Sd[e.protocol]);if(t&&!isNaN(t))return t}const mi="0.221.0",bd=300,gi=typeof PerformanceObserver<"u";class wd 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=Ad(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=gd(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)},bd)}_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&&hd(...i).then(m=>{m&&l.setAttribute(ld,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 p(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?p(m,T):At()},ut=>{d(m,ut)})};At()}else p(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 Rd="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 Od=f.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function Cd(e){return typeof Document<"u"&&e instanceof Document}function yd(e){if(Cd(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 Md(e);if(e instanceof URLSearchParams)return Ei(e.toString());if(e.byteLength!==void 0)return e.byteLength;Od.warn("unknown body type")}const Pd=new TextEncoder;function Ei(e){return Pd.encode(e).byteLength}function Md(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 vd(e){const t=Ld(),r=e.toUpperCase();return r in t?r:"_OTHER"}const Id={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0,QUERY:!0};let Rr;function Ld(){return Rr===void 0&&(Rr=Id),Rr}const Nd={"https:":"443","http:":"80"};function xd(e){const t=Number(e.port||Nd[e.protocol]);if(t&&!isNaN(t))return t}const Ti="0.221.0",Ud=300;class Dd 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=vd(s),l=u;o[Dn]=u,u!==a&&(o[kn]=a),o[Lt]=i.toString(),o[Gn]=i.hostname;const h=xd(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,p,_){const E=d.callbackToRemoveEvents;typeof E=="function"&&E();const{span:m,spanUrl:T,sendStartTime:A}=d;m&&(r._findResourceAndAddNetworkEvents(d,m,T,A,p),m.addEvent(h,_),r._addFinalSpanAttributes(m,d),m.end(_),r._tasksCount--),r._clearResources()}function s(h,d,p,_){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),p?_&&(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)},Ud)}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(...p){if(!r._isEnabled)return h.apply(this,p);const _=r._xhrMem.get(this);if(!_)return h.apply(this,p);const E=_.span,m=_.spanUrl;if(E&&m){if(r.getConfig().measureRequestSize&&(p!=null&&p[0])){const T=p[0],A=yd(T);A!==void 0&&E.setAttribute(Rd,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,p)}}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 pt=()=>Si,ft=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),ft(()=>{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:pt()>=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 fe(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 kd{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 Bd{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=fe(t,Bd),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),ft(u=>{o=N("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pt()),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],Gd=(e,t={})=>{const r=jt();Ci(Oi(()=>{let n,s=N("CLS",0);const i=fe(t,kd),o=(p,_,E,m,T)=>{s=N("CLS",0,p,_,E,m,T),i.i=0,n=I(e,s,yi,t.reportAllChanges)},a=(p=!1)=>{i.i>s.value&&(s.value=i.i,s.entries=i.o),n(p)},u=p=>{a(!0),o("soft-navigation",p.navigationId,p.interactionId,p.name,p.startTime)},l=p=>{for(const _ of p)_.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)}),ft(()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,pt()),Or(n)}),setTimeout(n))}))};let Pi=0,Mr=1/0,ge=0;const Fd=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},$d=()=>{"interactionCount"in performance||vr||(vr=ct(["event"],Fd,{durationThreshold:0}))};let vi=0;class Vd{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],Hd=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=jt();me(()=>{var p;$d();let n,s=N("INP");const i=fe(t,Vd),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:(p=t.durationThreshold)!=null?p:40});n=I(e,s,Li,t.reportAllChanges),d&&(r.onHidden(()=>{l(d.takeRecords(),!0)}),ft(()=>{o("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,pt())}))})};class zd{constructor(){c(this,"m");c(this,"l")}h(t){var r;(r=this.m)==null||r.call(this,t)}}const Ir=[2500,4e3],jd=(e,t={})=>{let r=!1;const n=qt(t);me(()=>{let s,i=jt(),o=N("LCP");const a=fe(t,zd),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 p=ct(d,h);if(p){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){p.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});ft(m=>{u("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,pt()),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)},qd=(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),ft(()=>{n=N("TTFB",0,"back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,pt()),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)}})},Wd=3e4,Xd=[{register:jd,name:"web_vitals.lcp",unit:"ms",boundaries:[100,250,500,1e3,1500,2e3,2500,3e3,4e3,6e3,8e3,12e3]},{register:Hd,name:"web_vitals.inp",unit:"ms",boundaries:[8,16,40,75,100,150,200,300,500,750,1e3]},{register:Gd,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:qd,name:"web_vitals.ttfb",unit:"ms",boundaries:[50,100,200,400,600,800,1200,1800,2500,4e3]}],Ni=()=>{var e;return`/${(e=window.location.pathname.split("/")[1])!=null?e:""}`},xi={login_redirect:{name:"app_shell.login_redirect",description:"Time from navigation start until the shell redirects to the login service",boundaries:[50,100,200,400,700,1e3,1500,2500,4e3,6e3]},app_ready:{name:"app_shell.app_ready",description:"Time from navigation start until the splash screen is replaced by the app",boundaries:[500,1e3,1500,2e3,3e3,4e3,6e3,8e3,12e3,2e4]}},Ui=new Map,Di=e=>{var t;(t=Ui.get(e))==null||t.record(performance.now(),{"page.route":Ni()})},Yd=e=>{Xd.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":Ni()})})})},Kd=()=>{const{GPv2UIOtelEndpoint:e,OtelTracesSamplerRatio:t}=P();if(typeof e!="string"||e.trim()==="")return;const r=e.trim().replace(/\/+$/,""),n=crypto.randomUUID(),s=os({[$n]:Ce,"deployment.environment":window.location.hostname,[Ga]:n}),i=new lu({resource:s,sampler:new ht({root:new sr(t!=null?t:1)}),spanProcessors:[new ou(new qh({url:`${r}/v1/traces`}))]});i.register();const o=new Ll({resource:s,readers:[new qu({exporter:new Jh({url:`${r}/v1/metrics`}),exportIntervalMillis:Wd})]});Be.setGlobalMeterProvider(o);const a=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),u=[new RegExp(`^${a}(/|$)`,"i"),/^https?:\/\/([a-z0-9-]+\.)*dc\.services\.visualstudio\.com(\/|$)/i,/^https?:\/\/([a-z0-9-]+\.)*(google-analytics|googletagmanager)\.com(\/|$)/i];ed({tracerProvider:i,meterProvider:o,instrumentations:[new ud,new wd({ignoreUrls:u}),new Dd({ignoreUrls:u})]});const l=o.getMeter("app-shell");Yd(l),Object.keys(xi).forEach(h=>{const{name:d,description:p,boundaries:_}=xi[h];Ui.set(h,l.createHistogram(d,{unit:"ms",description:p,advice:{explicitBucketBoundaries:_}}))}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&(i.forceFlush().catch(()=>{}),o.forceFlush().catch(()=>{}))}),window[Me.otel]=Object.freeze({tracerProvider:i,meterProvider:o,serviceInstanceId:n})},ki=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 Qd(){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 Xi(Qd()),Jd=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)},Zd=()=>{localStorage.removeItem(Xt)},W=()=>{const e=localStorage.getItem(Xt);return e?JSON.parse(e):null},Bi=()=>{var e;const t=localStorage.getItem(tn);return t?(e=JSON.parse(t))==null?void 0:e.email:null},t_=async()=>{const e=W();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await ki(t)},Gi=()=>{const e=W();return e?e.id_token:null},Fi=(e,t)=>{const r={...t,...e},n=Jd(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},e_=e=>{Fi(e,null)},$i=()=>{const e=W();return e?e.access_token:null},r_=()=>{const e=W();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},n_=()=>{const e=W();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},s_=()=>{var e;const t=W();return((e=t==null?void 0:t.profile)==null?void 0:e.previous_login_date)||null},i_=["authenticate","auth-callback","logout"],o_=e=>e.expires_at&&new Date(e.expires_at*1e3),a_=e=>e.expires_at&&new Date(e.expires_at*1e3+P().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),Vi=()=>{if(!P().IsLoginEnabled)return!1;const e=W();if(!Gi())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>o_(e):t>a_(e)},c_=()=>{const e=window.location.pathname.split("/");return i_.includes(e[e.length-1])},u_=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(P().IsLoginEnabled?xr.signinRedirect():window.location.href="/",!0):!1},l_=()=>{let e="/";const t=localStorage.getItem(ye);t&&(localStorage.removeItem(ye),e=t),sessionStorage.setItem(pn.SessionStorage.ShowLastLoginPopup,"true"),window.location.href=e},h_=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},Ur=e=>{const t=c_();(!t||e)&&(t||localStorage.setItem(ye,window.location.href),window.location.href="/authenticate")},d_=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,r=await ki(t);return{...e,profile:{...e.profile,hashed_identifier:r}}},__=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(xr.signinRedirectCallback().then(h_).then(d_).then(e_).then(l_).catch(Ur),!0):!1};class p_ extends Wr{render(){return lt` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",p_);class f_{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():[]},Yi(this,{permissions:Qi,setPermissions:Ki})}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=[uo,Yt,ao,co],s=n.findIndex(o=>o===t),i=n.findIndex(o=>o===r);return s>=i}hasPermission(t,r){return Ji(this.permissions).some(n=>n.permission_name===t&&this.hasPrivilegeLevel(r,n.privilege))}}const Dr=new f_,Hi=()=>{const e=new Headers;return e.append("Authorization",`Bearer ${$i()}`),e},m_=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:Hi()});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},g_=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:Hi()});return i.ok?await i.json():Promise.reject()},E_=async()=>{try{const e=await m_();return e.size===0?!1:(await g_(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}},T_="SUPERUSER";class kr extends Wr{_isSuperUser(t){return t.some(r=>{var n;return(n=r.provenance)==null?void 0:n.includes(T_)})}constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{P().IsLoginEnabled&&Vi()&&Ur()};try{No()}catch(r){console.error("Telemetry initialization failed:",r)}try{Kd()}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(u_()||__()){this._currentView="splash";return}if(Vi()){this._currentView="splash",Di("login_redirect"),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}_redirectTo(t){window.location.href=t}_isESGAccessOnly(t,r){const n=t.filter(s=>s.account_number===r);return n.length===1&&n[0].permission_name==="ESG Reporting"}async _applyGomFF(t){var r;const n=Bi(),s=structuredClone(window.gpConfig);if(!n||!s)return;const i=this._isSuperUser(t),o=!!((r=s["app-shell"])!=null&&r.IsInventoryManagementEnabled),a=await E_()&&(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:"";if(!a){const{LoginAuthority:l}=P();this._redirectTo(`${l}/Account/NoAccess`);return}const u=this._isESGAccessOnly(o,a)?this._applyMfeOverrides(i,["ui-esg"]):i;await this._applyGomFF(o),window.registeredApps=Object.freeze(u),Dr.setPermissions(o),await import("./app-CQYtI6QN.js"),this.appLoaded=!0,Di("app_ready")}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{Oo as A,tn as B,lo as C,oo as D,bo as E,io as F,Kr as G,Ro as I,Jr as M,_n as O,Mo as R,wo as S,dn as U,Gi as a,t_ as b,Zd as c,Bi as d,$i as e,W as f,P as g,Fi as h,s_ as i,r_ as j,pn as k,mo as l,nn as m,po as n,fo as o,Dr as p,Zr as q,vo as r,Qr as s,Me as t,xr as u,Ce as v,no as w,n_ as x,so 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",
3
+ "version": "15.0.0",
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": {