@abyss-project/monitor-browser 1.2.0 → 1.3.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.
package/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  SDK navigateur d'AbyssMonitor : mesure de l'expérience réelle (sessions, pages vues, requêtes,
4
4
  erreurs JS, web vitals, gels, frustration, actions, feature flags, retours utilisateurs, messages
5
- WebSocket et SSE). Spécification : `docs/superpowers/specs/2026-10-07-rum-navigateur-design.md`.
5
+ WebSocket et SSE, session replay). Spécification :
6
+ `docs/superpowers/specs/2026-10-07-rum-navigateur-design.md`.
6
7
 
7
8
  ```ts
8
9
  import { AbyssRum } from '@abyss-project/monitor-browser';
@@ -37,6 +38,7 @@ configuration distante, échantillonnage, pages vues, requêtes `fetch` et XHR,
37
38
  | `deferred` | web vitals (`web-vitals`), gels, mesures personnalisées, ressources en échec, violations CSP, frustration, console | après la réponse de configuration, si le RUM est actif |
38
39
  | `socket-messages` | contenu des messages WebSocket et SSE (§38) | après la configuration, seulement avec l'option `captureSocketMessages`, le panneau `socketMessages.enabled` et une session échantillonnée |
39
40
  | `send` | envoi d'un retour utilisateur (§37.1) | au premier `sendFeedback` ou `showReportDialog` |
41
+ | `replay` | enregistrement du session replay (`rrweb`, §29) | après la configuration, seulement pour une session tirée pour le replay dans un environnement où il est actif |
40
42
  | `dialog` | fenêtre de signalement, en shadow DOM | à la première ouverture de la fenêtre |
41
43
 
42
44
  Rien n'est perdu pendant le chargement : les web vitals et les gels sont lus dans les entrées
@@ -55,6 +57,7 @@ comme ses fichiers mis bout à bout, comme le bundler de l'application les regro
55
57
  | Morceau | Plafond gzip | Ce qui est mesuré |
56
58
  |---|---|---|
57
59
  | entrée | 12 Ko (12 288 octets) | `index` et les morceaux partagés qu'il importe statiquement : tout ce qui se charge au démarrage |
60
+ | `replay` | 60 Ko | idem (décision du 2026-10-11) |
58
61
  | `deferred` | 7 Ko | le morceau et les morceaux partagés qu'il est seul à amener |
59
62
  | `dialog` | 4 Ko | idem |
60
63
  | `socket-messages` | 2 Ko | idem |
@@ -63,6 +66,11 @@ comme ses fichiers mis bout à bout, comme le bundler de l'application les regro
63
66
  Un nouveau morceau dynamique sans plafond fait échouer la vérification : il faut lui en donner un
64
67
  ici et dans `check-bundle.mjs`.
65
68
 
69
+ Un module importé à la fois par l'entrée et par un morceau dynamique part dans un fichier partagé
70
+ que l'entrée charge : l'entrée grossit d'autant. C'est pourquoi le morceau `replay` n'importe rien
71
+ des modules de l'entrée (il reçoit le runtime entier, voir `ReplayHost`) et refait les quelques
72
+ lignes dont il a besoin (URL de la route, accès au `sessionStorage`).
73
+
66
74
  Le sous-chemin pur `@abyss-project/monitor/rum` est compilé depuis ses sources TypeScript (alias
67
75
  dans `tsup.config.ts`). esbuild remplace alors les valeurs des enums du contrat par leurs
68
76
  littéraux et retire ce que le SDK n'utilise pas, ce qu'il ne peut pas faire sur le build CommonJS
@@ -89,3 +97,57 @@ frustration, requête en échec, ou fin anormale d'une connexion (WebSocket ferm
89
97
  SSE en échec). Les messages des 10 secondes suivantes partent aussi. Au-delà de 600 messages par
90
98
  minute et par connexion, ou de 10 000 par session, un message est compté dans `droppedMessages`
91
99
  sur la connexion, sans être stocké.
100
+
101
+ ## Session replay (§29, §30, §36.3, §39.4)
102
+
103
+ ```ts
104
+ AbyssRum.init({
105
+ // …
106
+ consent: () => ({ analytics: cookieBanner.analyticsAccepted() }), // relu toutes les 2 s
107
+ unmaskSelectors: ['.page-title', '[data-public]'], // ajoutés à ceux de l'environnement
108
+ replayExcludedRoutes: ['/account/billing', /^\/admin\//], // chaîne : route égale ; RegExp : cherchée
109
+ });
110
+ ```
111
+
112
+ Une session est enregistrée quand les trois conditions tiennent : replay actif pour l'environnement
113
+ (`replay.enabled`, palier et réglage), session tirée sur `replay.sampleRate` (ou par `sampler`),
114
+ consentement analytics. Le morceau `replay` (`rrweb` 2.0.0-alpha.20, épinglé) n'est chargé que pour
115
+ une session tirée ; il relit ensuite les conditions toutes les 2 s et à chaque changement
116
+ enregistré. Sans consentement, rien n'est enregistré ; au retrait du consentement, à `stop()` ou à la
117
+ coupure de la session, l'enregistrement s'arrête aussitôt et ce qui n'est pas parti est jeté. Un
118
+ consentement redonné relance l'enregistrement, avec un instantané complet. Sur une route de
119
+ `replayExcludedRoutes`, rien n'est enregistré ; ce qui l'a été avant d'y entrer part.
120
+
121
+ **Masquage, non surchargeable** (aucune option ne le change) :
122
+
123
+ - tout champ de saisie (`input`, `textarea`, `select`, `[contenteditable]`) est enregistré en `*`,
124
+ y compris sous `unmaskSelectors` ou `data-abyss-privacy="allow"` ;
125
+ - le texte est masqué en `*`, sauf dans un élément de `unmaskSelectors` (ceux du code et ceux de
126
+ l'environnement, l'union des deux) ;
127
+ - images, vidéos, `canvas` et `input type="hidden"` sont remplacés par un bloc de leur taille ;
128
+ - `data-abyss-privacy` sur un élément et ce qu'il contient : `mask` (texte masqué), `allow` (texte
129
+ visible), `hidden` (bloc de même taille ; un clic dedans est décrit par l'élément caché lui-même,
130
+ jamais par son contenu). L'élément le plus proche qui porte l'attribut ou correspond à
131
+ `unmaskSelectors` décide ; à défaut, le niveau de l'environnement (`replay.defaultPrivacy`) :
132
+ `MASK` masque le texte, `MASK_INPUTS_ONLY` le montre. Une valeur inconnue est ignorée.
133
+
134
+ Un sélecteur que le navigateur ne sait pas lire est ignoré et compté dans `droppedEvents`.
135
+
136
+ **Envoi** : un morceau gzip (`CompressionStream`) toutes les 10 s, vers
137
+ `POST /api/rum/:applicationId/replay/:sessionId/chunk?token=&seq=` (ou `proxyUrl` +
138
+ `/rum/:applicationId/replay/:sessionId/chunk`, le relais `AbyssMonitorCore.rumProxy()` le relaie).
139
+ `seq` croît sur toute la session, rechargements de l'onglet compris (`sessionStorage`). Toutes les
140
+ 2 s tant que la dernière réponse, à un morceau ou à un lot, porte `liveWatched: true`, puis de
141
+ nouveau 10 s. Quand la page s'en va (`pagehide`), les morceaux en attente puis le dernier partent par
142
+ `sendBeacon`, celui-ci écrit d'un coup en gzip non compressé ; au passage en arrière-plan, il part par `fetch`. Un navigateur sans
143
+ `CompressionStream` n'enregistre pas de replay.
144
+
145
+ **Arrêts** : la session n'enregistre plus, rechargements compris, après 60 minutes
146
+ d'enregistrement, à `replay.maxSessionBytes` octets stockés (vérifié avant chaque envoi), ou sur une
147
+ réponse 413 (taille de session), 507 (stockage plein) ou 410 (enregistrement supprimé pendant la
148
+ session). Sans `replay.maxSessionBytes` positif dans la configuration, rien n'est enregistré. Les
149
+ morceaux partent un par un, dans l'ordre de `seq`. Un 404 (session pas encore créée par le premier
150
+ lot) garde le morceau, et ceux qui suivent derrière lui ; il est renvoyé toutes les 2 s pendant
151
+ 30 s, puis la page n'enregistre plus. Ce qui attend compte dans `replay.maxSessionBytes`, ce qui
152
+ borne la mémoire retenue. Un autre refus (401, 403…) arrête l'enregistrement de la page. Un morceau perdu (réseau, 5xx) ou refusé en 429 (pause d'une minute) est compté dans
153
+ `droppedEvents`, puis un instantané complet repart pour que la suite reste lisible.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var c=n=>new Date(n).toISOString(),u= exports.b =(n,e)=>n>0&&e>=n?Math.round(e-n):null,g= exports.c =n=>{var e;if(typeof n=="string")return n;if(n instanceof Error)return`${n.name}: ${n.message}`;try{return(e=JSON.stringify(n))!=null?e:String(n)}catch (e2){return String(n)}},l= exports.d =(n,e,t,r=!1)=>{let o={capture:r,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)},s= exports.e =n=>{let e=0;for(let t=0;t<n.length;t+=1){let r=n.charCodeAt(t);r<128?e+=1:r<2048?e+=2:r>=55296&&r<56320?(e+=4,t+=1):e+=3}return e},f= exports.f =(n,e)=>{if(s(n)<=e)return n;let t=0;for(let r=0;r<n.length;r+=1){let o=n.charCodeAt(r)>=55296&&n.charCodeAt(r)<56320,i=s(n.slice(r,o?r+2:r+1));if(t+i>e)return n.slice(0,r);t+=i,o&&(r+=1)}return n},p= exports.g =n=>{if(typeof n=="string")return s(n);if(typeof Blob!="undefined"&&n instanceof Blob)return n.size;let e=n==null?void 0:n.byteLength;return typeof e=="number"?e:0},y= exports.h =n=>{try{let e=sessionStorage.getItem(n);return e===null?null:JSON.parse(e)}catch (e3){return null}},d= exports.i =(n,e)=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch (e4){}},b= exports.j =n=>{try{sessionStorage.removeItem(n)}catch (e5){}};var h=()=>{let n=globalThis.crypto;if(typeof(n==null?void 0:n.randomUUID)=="function")return n.randomUUID();let e=new Uint8Array(16);n.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,r=>(r+256).toString(16).slice(1)).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`};exports.a = c; exports.b = u; exports.c = g; exports.d = l; exports.e = s; exports.f = f; exports.g = p; exports.h = y; exports.i = d; exports.j = b; exports.k = h;
@@ -0,0 +1 @@
1
+ var c=n=>new Date(n).toISOString(),u=(n,e)=>n>0&&e>=n?Math.round(e-n):null,g=n=>{var e;if(typeof n=="string")return n;if(n instanceof Error)return`${n.name}: ${n.message}`;try{return(e=JSON.stringify(n))!=null?e:String(n)}catch{return String(n)}},l=(n,e,t,r=!1)=>{let o={capture:r,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)},s=n=>{let e=0;for(let t=0;t<n.length;t+=1){let r=n.charCodeAt(t);r<128?e+=1:r<2048?e+=2:r>=55296&&r<56320?(e+=4,t+=1):e+=3}return e},f=(n,e)=>{if(s(n)<=e)return n;let t=0;for(let r=0;r<n.length;r+=1){let o=n.charCodeAt(r)>=55296&&n.charCodeAt(r)<56320,i=s(n.slice(r,o?r+2:r+1));if(t+i>e)return n.slice(0,r);t+=i,o&&(r+=1)}return n},p=n=>{if(typeof n=="string")return s(n);if(typeof Blob!="undefined"&&n instanceof Blob)return n.size;let e=n==null?void 0:n.byteLength;return typeof e=="number"?e:0},y=n=>{try{let e=sessionStorage.getItem(n);return e===null?null:JSON.parse(e)}catch{return null}},d=(n,e)=>{try{sessionStorage.setItem(n,JSON.stringify(e))}catch{}},b=n=>{try{sessionStorage.removeItem(n)}catch{}};var h=()=>{let n=globalThis.crypto;if(typeof(n==null?void 0:n.randomUUID)=="function")return n.randomUUID();let e=new Uint8Array(16);n.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,r=>(r+256).toString(16).slice(1)).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`};export{c as a,u as b,g as c,l as d,s as e,f,p as g,y as h,d as i,b as j,h as k};
@@ -0,0 +1 @@
1
+ var M="text/plain",N=(t,o)=>`/rum/${t}/replay/${o}/chunk`;var r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,T=t=>typeof t=="string"&&r.test(t);var e=":id",I=40,p=/^\d{3,}$/,A=/^[0-9a-f]{16,}$/i,O=/^[a-z][a-z0-9+.-]*:\/\//i,a=t=>t.length>I||r.test(t)||p.test(t)||A.test(t),_=t=>t===""?"/":t.split("/").map(o=>a(o)?e:o).join("/"),l=t=>{try{let o=new URL(t.startsWith("//")?`https:${t}`:t);return{host:o.host===""?null:o.host.toLowerCase(),path:o.pathname}}catch{return{host:null,path:"/"}}},C=t=>{let s=(typeof t=="string"?t.trim():"").split("#")[0].split("?")[0],{host:E,path:n}=O.test(s)||s.startsWith("//")?l(s):{host:null,path:s};return{host:E,path:_(n)}};var U="x-abyss-request-id",f="x-abyss-session-id";var L="abyss_rid",P="abyss_sid";export{M as a,N as b,T as c,C as d,U as e,f,L as g,P as h};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkLRYKS5XRjs = require('./chunk-LRYKS5XR.js');var _chunkUZZNGXXEjs = require('./chunk-UZZNGXXE.js');var F=2e3,b= exports.b =5,g=255,k=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=new Map,A= exports.c =e=>{var t,n;return(n=e.unavailable())!=null?n:((t=i.get(e.sessionId()))!=null?t:0)>=b?"LIMIT_REACHED":null},D=(e,t)=>{let n=t==null?void 0:t.message;if(typeof n!="string"||n.trim().length===0||n.length>F)return"INVALID_MESSAGE";let r=t==null?void 0:t.email,a=null;if(r!=null&&r!==""){let s=typeof r=="string"?r.trim():"";if(s.length>g||!k.test(s))return"INVALID_EMAIL";a=s}let o=Date.now();return{id:_chunkUZZNGXXEjs.q.call(void 0, ),type:"feedback",pageViewId:e.pageViewId(),occurredAt:_chunkUZZNGXXEjs.g.call(void 0, o),offsetMs:Math.max(0,o-e.sessionStartedAt()),route:e.resolveRoute(),message:n,email:a}},v=e=>e>=200&&e<300?null:e===409?"LIMIT_REACHED":e===0||e===429||e>=500?"SEND_FAILED":"REFUSED",y= exports.d =async(e,t)=>{var d,u,c;let n=A(e);if(n!==null)throw new (0, _chunkLRYKS5XRjs.b)(n);let r=D(e,t);if(typeof r=="string")throw new (0, _chunkLRYKS5XRjs.b)(r);let a=e.prepare(r);if(!a)throw new (0, _chunkLRYKS5XRjs.b)("DISCARDED");let o=e.sessionId();i.set(o,((d=i.get(o))!=null?d:0)+1);let s=v(await e.post(a).catch(()=>0));if(s==="SEND_FAILED"?i.set(o,((u=i.get(o))!=null?u:1)-1):s==="LIMIT_REACHED"&&i.set(o,b),s!==null)throw new (0, _chunkLRYKS5XRjs.b)(s);let{offsetMs:R,route:f,message:p,email:I}=a;(c=e.sent)==null||c.call(e,{sessionId:o,offsetMs:R,route:f,message:p,email:I})},H= exports.e =(e,t)=>Promise.resolve().then(() => _interopRequireWildcard(require("./dialog-KZS5WNFT.js"))).then(({openReportDialog:n})=>n(e,t));exports.a = F; exports.b = b; exports.c = A; exports.d = y; exports.e = H;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkLRYKS5XRjs = require('./chunk-LRYKS5XR.js');var _chunk2TDEJLQ7js = require('./chunk-2TDEJLQ7.js');var F=2e3,b= exports.b =5,g=255,k=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=new Map,A= exports.c =e=>{var t,n;return(n=e.unavailable())!=null?n:((t=i.get(e.sessionId()))!=null?t:0)>=b?"LIMIT_REACHED":null},D=(e,t)=>{let n=t==null?void 0:t.message;if(typeof n!="string"||n.trim().length===0||n.length>F)return"INVALID_MESSAGE";let r=t==null?void 0:t.email,a=null;if(r!=null&&r!==""){let s=typeof r=="string"?r.trim():"";if(s.length>g||!k.test(s))return"INVALID_EMAIL";a=s}let o=Date.now();return{id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"feedback",pageViewId:e.pageViewId(),occurredAt:_chunk2TDEJLQ7js.a.call(void 0, o),offsetMs:Math.max(0,o-e.sessionStartedAt()),route:e.resolveRoute(),message:n,email:a}},v=e=>e>=200&&e<300?null:e===409?"LIMIT_REACHED":e===0||e===429||e>=500?"SEND_FAILED":"REFUSED",y= exports.d =async(e,t)=>{var d,u,c;let n=A(e);if(n!==null)throw new (0, _chunkLRYKS5XRjs.b)(n);let r=D(e,t);if(typeof r=="string")throw new (0, _chunkLRYKS5XRjs.b)(r);let a=e.prepare(r);if(!a)throw new (0, _chunkLRYKS5XRjs.b)("DISCARDED");let o=e.sessionId();i.set(o,((d=i.get(o))!=null?d:0)+1);let s=v(await e.post(a).catch(()=>0));if(s==="SEND_FAILED"?i.set(o,((u=i.get(o))!=null?u:1)-1):s==="LIMIT_REACHED"&&i.set(o,b),s!==null)throw new (0, _chunkLRYKS5XRjs.b)(s);let{offsetMs:R,route:f,message:p,email:I}=a;(c=e.sent)==null||c.call(e,{sessionId:o,offsetMs:R,route:f,message:p,email:I})},H= exports.e =(e,t)=>Promise.resolve().then(() => _interopRequireWildcard(require("./dialog-GI4DHRV3.js"))).then(({openReportDialog:n})=>n(e,t));exports.a = F; exports.b = b; exports.c = A; exports.d = y; exports.e = H;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var M="text/plain",N= exports.b =(t,o)=>`/rum/${t}/replay/${o}/chunk`;var r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,T= exports.c =t=>typeof t=="string"&&r.test(t);var e=":id",I=40,p=/^\d{3,}$/,A=/^[0-9a-f]{16,}$/i,O=/^[a-z][a-z0-9+.-]*:\/\//i,a=t=>t.length>I||r.test(t)||p.test(t)||A.test(t),_=t=>t===""?"/":t.split("/").map(o=>a(o)?e:o).join("/"),l=t=>{try{let o=new URL(t.startsWith("//")?`https:${t}`:t);return{host:o.host===""?null:o.host.toLowerCase(),path:o.pathname}}catch (e2){return{host:null,path:"/"}}},C= exports.d =t=>{let s=(typeof t=="string"?t.trim():"").split("#")[0].split("?")[0],{host:E,path:n}=O.test(s)||s.startsWith("//")?l(s):{host:null,path:s};return{host:E,path:_(n)}};var U="x-abyss-request-id",f= exports.f ="x-abyss-session-id";var L="abyss_rid",P= exports.h ="abyss_sid";exports.a = M; exports.b = N; exports.c = T; exports.d = C; exports.e = U; exports.f = f; exports.g = L; exports.h = P;
@@ -1 +1 @@
1
- import{g as c,h as i,q as l}from"./chunk-AAXB6P4Z.mjs";var a=/^[a-zA-Z0-9_.-]{1,64}$/,m=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),p=t=>typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t)||typeof t=="string"&&t.length<=256,f=(t,e,o,n=30)=>{let r={...t};if(!e||typeof e!="object"||Array.isArray(e))return o(),r;for(let[s,u]of Object.entries(e))!a.test(s)||s==="__proto__"?o():u===null?delete r[s]:!p(u)||!m(r,s)&&Object.keys(r).length>=n?o():r[s]=u;return r};var S=4096,d=t=>{try{return new URL(t,window.location.href)}catch{return null}},R=t=>{let e=d(t);return e?`${e.protocol==="ws:"?"http:":e.protocol==="wss:"?"https:":e.protocol}//${e.host}`.toLowerCase():null},y=(t,e)=>{var o;return t.instrumentedOrigins.includes((o=R(e.href))!=null?o:"")},O=t=>{let e=t==null?void 0:t.name;return e==="AbortError"?"ABORTED":e==="TimeoutError"?"TIMEOUT":navigator.onLine===!1?"OFFLINE":"NETWORK_ERROR"},I=t=>t>=400?"HTTP_ERROR":"SUCCESS",v=(t,e,o,n,r,s)=>({id:l(),type:"request",pageViewId:t.pageViewId(),kind:e,method:o,url:n,startedAt:c(r),status:null,outcome:"SUCCESS",durationMs:null,dnsMs:null,tcpMs:null,tlsMs:null,ttfbMs:null,downloadMs:null,requestId:s,instrumented:s!==null}),w=(t,e)=>{let o;try{o=performance.getEntriesByName(t,"resource")}catch{return null}let n=o.filter(r=>performance.timeOrigin+r.startTime>=e-50).pop();return!n||!n.requestStart?null:{dnsMs:i(n.domainLookupStart,n.domainLookupEnd),tcpMs:i(n.connectStart,n.connectEnd),tlsMs:n.secureConnectionStart>0?i(n.secureConnectionStart,n.connectEnd):null,ttfbMs:i(n.requestStart,n.responseStart),downloadMs:i(n.responseStart,n.responseEnd)}};export{f as a,S as b,d as c,R as d,y as e,O as f,I as g,v as h,w as i};
1
+ import{a as c,b as i,k as l}from"./chunk-57O4BMUU.mjs";var a=/^[a-zA-Z0-9_.-]{1,64}$/,m=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),p=t=>typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t)||typeof t=="string"&&t.length<=256,f=(t,e,o,n=30)=>{let r={...t};if(!e||typeof e!="object"||Array.isArray(e))return o(),r;for(let[s,u]of Object.entries(e))!a.test(s)||s==="__proto__"?o():u===null?delete r[s]:!p(u)||!m(r,s)&&Object.keys(r).length>=n?o():r[s]=u;return r};var S=4096,d=t=>{try{return new URL(t,window.location.href)}catch{return null}},R=t=>{let e=d(t);return e?`${e.protocol==="ws:"?"http:":e.protocol==="wss:"?"https:":e.protocol}//${e.host}`.toLowerCase():null},y=(t,e)=>{var o;return t.instrumentedOrigins.includes((o=R(e.href))!=null?o:"")},O=t=>{let e=t==null?void 0:t.name;return e==="AbortError"?"ABORTED":e==="TimeoutError"?"TIMEOUT":navigator.onLine===!1?"OFFLINE":"NETWORK_ERROR"},I=t=>t>=400?"HTTP_ERROR":"SUCCESS",v=(t,e,o,n,r,s)=>({id:l(),type:"request",pageViewId:t.pageViewId(),kind:e,method:o,url:n,startedAt:c(r),status:null,outcome:"SUCCESS",durationMs:null,dnsMs:null,tcpMs:null,tlsMs:null,ttfbMs:null,downloadMs:null,requestId:s,instrumented:s!==null}),w=(t,e)=>{let o;try{o=performance.getEntriesByName(t,"resource")}catch{return null}let n=o.filter(r=>performance.timeOrigin+r.startTime>=e-50).pop();return!n||!n.requestStart?null:{dnsMs:i(n.domainLookupStart,n.domainLookupEnd),tcpMs:i(n.connectStart,n.connectEnd),tlsMs:n.secureConnectionStart>0?i(n.secureConnectionStart,n.connectEnd):null,ttfbMs:i(n.requestStart,n.responseStart),downloadMs:i(n.responseStart,n.responseEnd)}};export{f as a,S as b,d as c,R as d,y as e,O as f,I as g,v as h,w as i};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUZZNGXXEjs = require('./chunk-UZZNGXXE.js');var a=/^[a-zA-Z0-9_.-]{1,64}$/,m=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),p=t=>typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t)||typeof t=="string"&&t.length<=256,f= exports.a =(t,e,o,n=30)=>{let r={...t};if(!e||typeof e!="object"||Array.isArray(e))return o(),r;for(let[s,u]of Object.entries(e))!a.test(s)||s==="__proto__"?o():u===null?delete r[s]:!p(u)||!m(r,s)&&Object.keys(r).length>=n?o():r[s]=u;return r};var S=4096,d= exports.c =t=>{try{return new URL(t,window.location.href)}catch (e2){return null}},R= exports.d =t=>{let e=d(t);return e?`${e.protocol==="ws:"?"http:":e.protocol==="wss:"?"https:":e.protocol}//${e.host}`.toLowerCase():null},y= exports.e =(t,e)=>{var o;return t.instrumentedOrigins.includes((o=R(e.href))!=null?o:"")},O= exports.f =t=>{let e=t==null?void 0:t.name;return e==="AbortError"?"ABORTED":e==="TimeoutError"?"TIMEOUT":navigator.onLine===!1?"OFFLINE":"NETWORK_ERROR"},I= exports.g =t=>t>=400?"HTTP_ERROR":"SUCCESS",v= exports.h =(t,e,o,n,r,s)=>({id:_chunkUZZNGXXEjs.q.call(void 0, ),type:"request",pageViewId:t.pageViewId(),kind:e,method:o,url:n,startedAt:_chunkUZZNGXXEjs.g.call(void 0, r),status:null,outcome:"SUCCESS",durationMs:null,dnsMs:null,tcpMs:null,tlsMs:null,ttfbMs:null,downloadMs:null,requestId:s,instrumented:s!==null}),w= exports.i =(t,e)=>{let o;try{o=performance.getEntriesByName(t,"resource")}catch (e3){return null}let n=o.filter(r=>performance.timeOrigin+r.startTime>=e-50).pop();return!n||!n.requestStart?null:{dnsMs:_chunkUZZNGXXEjs.h.call(void 0, n.domainLookupStart,n.domainLookupEnd),tcpMs:_chunkUZZNGXXEjs.h.call(void 0, n.connectStart,n.connectEnd),tlsMs:n.secureConnectionStart>0?_chunkUZZNGXXEjs.h.call(void 0, n.secureConnectionStart,n.connectEnd):null,ttfbMs:_chunkUZZNGXXEjs.h.call(void 0, n.requestStart,n.responseStart),downloadMs:_chunkUZZNGXXEjs.h.call(void 0, n.responseStart,n.responseEnd)}};exports.a = f; exports.b = S; exports.c = d; exports.d = R; exports.e = y; exports.f = O; exports.g = I; exports.h = v; exports.i = w;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2TDEJLQ7js = require('./chunk-2TDEJLQ7.js');var a=/^[a-zA-Z0-9_.-]{1,64}$/,m=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),p=t=>typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t)||typeof t=="string"&&t.length<=256,f= exports.a =(t,e,o,n=30)=>{let r={...t};if(!e||typeof e!="object"||Array.isArray(e))return o(),r;for(let[s,u]of Object.entries(e))!a.test(s)||s==="__proto__"?o():u===null?delete r[s]:!p(u)||!m(r,s)&&Object.keys(r).length>=n?o():r[s]=u;return r};var S=4096,d= exports.c =t=>{try{return new URL(t,window.location.href)}catch (e2){return null}},R= exports.d =t=>{let e=d(t);return e?`${e.protocol==="ws:"?"http:":e.protocol==="wss:"?"https:":e.protocol}//${e.host}`.toLowerCase():null},y= exports.e =(t,e)=>{var o;return t.instrumentedOrigins.includes((o=R(e.href))!=null?o:"")},O= exports.f =t=>{let e=t==null?void 0:t.name;return e==="AbortError"?"ABORTED":e==="TimeoutError"?"TIMEOUT":navigator.onLine===!1?"OFFLINE":"NETWORK_ERROR"},I= exports.g =t=>t>=400?"HTTP_ERROR":"SUCCESS",v= exports.h =(t,e,o,n,r,s)=>({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"request",pageViewId:t.pageViewId(),kind:e,method:o,url:n,startedAt:_chunk2TDEJLQ7js.a.call(void 0, r),status:null,outcome:"SUCCESS",durationMs:null,dnsMs:null,tcpMs:null,tlsMs:null,ttfbMs:null,downloadMs:null,requestId:s,instrumented:s!==null}),w= exports.i =(t,e)=>{let o;try{o=performance.getEntriesByName(t,"resource")}catch (e3){return null}let n=o.filter(r=>performance.timeOrigin+r.startTime>=e-50).pop();return!n||!n.requestStart?null:{dnsMs:_chunk2TDEJLQ7js.b.call(void 0, n.domainLookupStart,n.domainLookupEnd),tcpMs:_chunk2TDEJLQ7js.b.call(void 0, n.connectStart,n.connectEnd),tlsMs:n.secureConnectionStart>0?_chunk2TDEJLQ7js.b.call(void 0, n.secureConnectionStart,n.connectEnd):null,ttfbMs:_chunk2TDEJLQ7js.b.call(void 0, n.requestStart,n.responseStart),downloadMs:_chunk2TDEJLQ7js.b.call(void 0, n.responseStart,n.responseEnd)}};exports.a = f; exports.b = S; exports.c = d; exports.d = R; exports.e = y; exports.f = O; exports.g = I; exports.h = v; exports.i = w;
@@ -1 +1 @@
1
- import{b as m}from"./chunk-QEU2JJHJ.mjs";import{g as l,q as E}from"./chunk-AAXB6P4Z.mjs";var F=2e3,b=5,g=255,k=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=new Map,A=e=>{var t,n;return(n=e.unavailable())!=null?n:((t=i.get(e.sessionId()))!=null?t:0)>=b?"LIMIT_REACHED":null},D=(e,t)=>{let n=t==null?void 0:t.message;if(typeof n!="string"||n.trim().length===0||n.length>F)return"INVALID_MESSAGE";let r=t==null?void 0:t.email,a=null;if(r!=null&&r!==""){let s=typeof r=="string"?r.trim():"";if(s.length>g||!k.test(s))return"INVALID_EMAIL";a=s}let o=Date.now();return{id:E(),type:"feedback",pageViewId:e.pageViewId(),occurredAt:l(o),offsetMs:Math.max(0,o-e.sessionStartedAt()),route:e.resolveRoute(),message:n,email:a}},v=e=>e>=200&&e<300?null:e===409?"LIMIT_REACHED":e===0||e===429||e>=500?"SEND_FAILED":"REFUSED",y=async(e,t)=>{var d,u,c;let n=A(e);if(n!==null)throw new m(n);let r=D(e,t);if(typeof r=="string")throw new m(r);let a=e.prepare(r);if(!a)throw new m("DISCARDED");let o=e.sessionId();i.set(o,((d=i.get(o))!=null?d:0)+1);let s=v(await e.post(a).catch(()=>0));if(s==="SEND_FAILED"?i.set(o,((u=i.get(o))!=null?u:1)-1):s==="LIMIT_REACHED"&&i.set(o,b),s!==null)throw new m(s);let{offsetMs:R,route:f,message:p,email:I}=a;(c=e.sent)==null||c.call(e,{sessionId:o,offsetMs:R,route:f,message:p,email:I})},H=(e,t)=>import("./dialog-QWESR3KT.mjs").then(({openReportDialog:n})=>n(e,t));export{F as a,b,A as c,y as d,H as e};
1
+ import{b as m}from"./chunk-QEU2JJHJ.mjs";import{a as l,k as E}from"./chunk-57O4BMUU.mjs";var F=2e3,b=5,g=255,k=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=new Map,A=e=>{var t,n;return(n=e.unavailable())!=null?n:((t=i.get(e.sessionId()))!=null?t:0)>=b?"LIMIT_REACHED":null},D=(e,t)=>{let n=t==null?void 0:t.message;if(typeof n!="string"||n.trim().length===0||n.length>F)return"INVALID_MESSAGE";let r=t==null?void 0:t.email,a=null;if(r!=null&&r!==""){let s=typeof r=="string"?r.trim():"";if(s.length>g||!k.test(s))return"INVALID_EMAIL";a=s}let o=Date.now();return{id:E(),type:"feedback",pageViewId:e.pageViewId(),occurredAt:l(o),offsetMs:Math.max(0,o-e.sessionStartedAt()),route:e.resolveRoute(),message:n,email:a}},v=e=>e>=200&&e<300?null:e===409?"LIMIT_REACHED":e===0||e===429||e>=500?"SEND_FAILED":"REFUSED",y=async(e,t)=>{var d,u,c;let n=A(e);if(n!==null)throw new m(n);let r=D(e,t);if(typeof r=="string")throw new m(r);let a=e.prepare(r);if(!a)throw new m("DISCARDED");let o=e.sessionId();i.set(o,((d=i.get(o))!=null?d:0)+1);let s=v(await e.post(a).catch(()=>0));if(s==="SEND_FAILED"?i.set(o,((u=i.get(o))!=null?u:1)-1):s==="LIMIT_REACHED"&&i.set(o,b),s!==null)throw new m(s);let{offsetMs:R,route:f,message:p,email:I}=a;(c=e.sent)==null||c.call(e,{sessionId:o,offsetMs:R,route:f,message:p,email:I})},H=(e,t)=>import("./dialog-MVRAIURN.mjs").then(({openReportDialog:n})=>n(e,t));export{F as a,b,A as c,y as d,H as e};
@@ -0,0 +1 @@
1
+ import{a as U,c as B,h as W}from"./chunk-QL6P3CII.mjs";import{a as d,c as K,d as h,f as j,k as l}from"./chunk-57O4BMUU.mjs";import"./chunk-5S3SDOLF.mjs";var vt=1024,gt=50,q=r=>{let t=[["error","error"],["warn","warn"]],e=null,n=0,i=t.map(([o,s])=>{let a=console[o],u=(...c)=>{try{let y=r.pageViewId();y!==e&&(e=y,n=0),n+=1,n>gt?r.drop():r.record({id:l(),type:"console",pageViewId:y,occurredAt:d(Date.now()),level:s,message:j(c.map(K).join(" "),vt)})}catch{r.drop()}a.apply(console,c)};return console[o]=u,()=>{console[o]===u&&(console[o]=a)}});return()=>i.forEach(o=>o())};var yt=/^[a-z][a-z0-9-]{0,31}$/,Tt=r=>{try{let e=new URL(r);if(e.host)return`${e.protocol}//${e.host}`}catch{}let t=r.trim().toLowerCase().replace(/:.*$/,"");return yt.test(t)?t:null},$=r=>{let t=null,e=new Set;return h(document,"securitypolicyviolation",n=>{var i;try{let o=r.pageViewId();o!==t&&(t=o,e=new Set);let s=n.effectiveDirective||n.violatedDirective,a=Tt((i=n.blockedURI)!=null?i:""),u=`${s}${a!=null?a:""}`;if(!s||e.has(u))return;e.add(u),r.record({id:l(),type:"cspViolation",pageViewId:o,occurredAt:d(Date.now()),effectiveDirective:s,blockedUri:a,sourceFile:n.sourceFile||null,lineNumber:n.lineNumber||null,disposition:n.disposition==="report"?"report":"enforce"})}catch{r.drop()}},!0)};var w=1e3,Et=3,wt='button,a,[role="button"],input[type="submit"]',R=class{constructor(t){this.host=t;this.last=null;this.burst=[];this.raged=!1;this.activity=0;this.watched=new Set;this.observer=null}start(){typeof MutationObserver!="undefined"&&(this.observer=new MutationObserver(()=>this.notifyActivity()));let t=[h(window,"click",e=>{try{e.target instanceof Element&&this.click(e.target)}catch{this.host.drop()}},!0),h(window,"pagehide",()=>this.cancel())];return()=>{t.forEach(e=>e()),this.cancel(),this.observer=null}}notifyActivity(){this.activity+=1}notifyError(){let t=this.last;!t||t.errored||Date.now()-t.at>w||(t.errored=!0,this.settle(t),this.emit(t,"ERROR_CLICK"))}click(t){let e=Date.now(),n=this.last,o=n!==null&&n.element===t&&e-n.at<=w;o&&this.settle(n),this.burst=o?[...this.burst.filter(a=>e-a<=w),e]:[e],o||(this.raged=!1);let s={element:t,at:e,pageViewId:this.host.pageViewId(),route:this.host.resolveRoute(),activity:this.activity,errored:!1,timer:null};this.last=s,this.burst.length>=Et&&!this.raged&&(this.raged=!0,this.emit(s,"RAGE_CLICK")),!o&&t.closest(wt)&&this.watch(s)}watch(t){this.watched.size===0&&this.observer&&this.observer.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),this.watched.add(t),t.timer=setTimeout(()=>{try{this.settle(t),t.activity===this.activity&&!t.errored&&this.emit(t,"DEAD_CLICK")}catch{this.host.drop()}},w)}settle(t){var e;t.timer!==null&&(clearTimeout(t.timer),t.timer=null),this.watched.delete(t)&&this.watched.size===0&&((e=this.observer)==null||e.disconnect())}cancel(){this.watched.forEach(t=>this.settle(t)),this.last=null,this.burst=[],this.raged=!1}emit(t,e){this.host.record({id:l(),type:"frustration",pageViewId:t.pageViewId,occurredAt:d(t.at),frustrationType:e,route:t.route,element:this.host.describe(t.element)})}};var Rt=50,It=1e3,bt=(r,t)=>{let e=typeof performance=="undefined"?NaN:performance.timeOrigin;return Number.isFinite(e)&&e>0&&Number.isFinite(r)?e+r:Date.now()-t},Ct=()=>{var t;if(typeof PerformanceObserver=="undefined")return null;let r=(t=PerformanceObserver.supportedEntryTypes)!=null?t:[];return r.includes("long-animation-frame")?"long-animation-frame":r.includes("longtask")?"longtask":null},I=class{constructor(t){this.host=t;this.page=null}start(){let t=Ct();if(!t)return()=>{};let e=new PerformanceObserver(n=>{try{n.getEntries().forEach(i=>this.add(i.duration,i.startTime))}catch{this.host.drop()}});return e.observe({type:t,buffered:!0}),()=>e.disconnect()}annotate(t){var e;((e=this.page)==null?void 0:e.id)===t.id&&(t.longTaskCount=this.page.count,t.longTaskTotalMs=Math.round(this.page.totalMs))}add(t,e){var i;let n=this.host.pageViewId();!n||!(t>=Rt)||(((i=this.page)==null?void 0:i.id)!==n&&(this.page={id:n,count:0,totalMs:0}),this.page.count+=1,this.page.totalMs+=t,t>=It&&this.host.record({id:l(),type:"longTask",pageViewId:n,route:this.host.resolveRoute(),startedAt:d(bt(e,t)),durationMs:Math.round(t)}))}};var Vt=64,z=20,O=r=>typeof r=="string"&&r.length>0&&r.length<=Vt,X=()=>{let r=typeof performance=="undefined"?NaN:performance.timeOrigin;return Number.isFinite(r)&&r>0&&r<=Date.now()?r:null},b=class{constructor(t){this.host=t;this.page=null;this.pending=[];this.durations=new Map}pageView(t){var o,s;if(((o=this.page)==null?void 0:o.id)===t.id)return;let e=this.page===null,n=(s=e?X():null)!=null?s:Date.parse(t.startedAt);this.page={id:t.id,origin:n,count:0};for(let[a,u]of this.durations)e&&u.pageViewId===null?u.pageViewId=t.id:this.durations.delete(a);let i=this.pending;this.pending=[],i.forEach(a=>this.send(a))}addTiming(t,e=Date.now()){if(!O(t)){this.host.drop();return}let n=this.page?this.page.origin:X();if(n===null){this.host.drop();return}this.send({id:l(),type:"timing",occurredAt:d(e),name:t,kind:"TIMING",valueMs:Math.max(0,Math.round(e-n))})}startDuration(t,e,n=Date.now()){var o,s;if(!O(t)){this.host.drop();return}let i={startedAt:n,pageViewId:(s=(o=this.page)==null?void 0:o.id)!=null?s:null};if(e!==void 0){let a=U({},e,this.host.drop);Object.keys(a).length>0&&(i.attributes=a)}this.durations.set(t,i)}stopDuration(t,e=Date.now()){let n=O(t)?this.durations.get(t):void 0;if(!n){this.host.drop();return}this.durations.delete(t),this.send({id:l(),type:"timing",occurredAt:d(n.startedAt),name:t,kind:"DURATION",valueMs:Math.max(0,Math.round(e-n.startedAt)),...n.attributes?{attributes:n.attributes}:{}})}send(t){if(!this.page){this.pending.length<z?this.pending.push(t):this.host.drop();return}if(this.page.count>=z){this.host.drop();return}this.page.count+=1,this.host.record({...t,pageViewId:this.page.id})}};var _;var nt=-1,g=function(r){addEventListener("pageshow",(function(t){t.persisted&&(nt=t.timeStamp,r(t))}),!0)},x=function(){var r=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(r&&r.responseStart>0&&r.responseStart<performance.now())return r},M=function(){var r=x();return r&&r.activationStart||0},m=function(r,t){var e=x(),n="navigate";return nt>=0?n="back-forward-cache":e&&(document.prerendering||M()>0?n="prerender":document.wasDiscarded?n="restore":e.type&&(n=e.type.replace(/_/g,"-"))),{name:r,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},E=function(r,t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(r)){var n=new PerformanceObserver((function(i){Promise.resolve().then((function(){t(i.getEntries())}))}));return n.observe(Object.assign({type:r,buffered:!0},e||{})),n}}catch{}},f=function(r,t,e,n){var i,o;return function(s){t.value>=0&&(s||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=(function(a,u){return a>u[1]?"poor":a>u[0]?"needs-improvement":"good"})(t.value,e),r(t))}},F=function(r){requestAnimationFrame((function(){return requestAnimationFrame((function(){return r()}))}))},A=function(r){document.addEventListener("visibilitychange",(function(){document.visibilityState==="hidden"&&r()}))},H=function(r){var t=!1;return function(){t||(r(),t=!0)}},v=-1,Y=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},S=function(r){document.visibilityState==="hidden"&&v>-1&&(v=r.type==="visibilitychange"?r.timeStamp:0,St())},J=function(){addEventListener("visibilitychange",S,!0),addEventListener("prerenderingchange",S,!0)},St=function(){removeEventListener("visibilitychange",S,!0),removeEventListener("prerenderingchange",S,!0)},it=function(){return v<0&&(v=Y(),J(),g((function(){setTimeout((function(){v=Y(),J()}),0)}))),{get firstHiddenTime(){return v}}},P=function(r){document.prerendering?addEventListener("prerenderingchange",(function(){return r()}),!0):r()},Q=[1800,3e3],G=function(r,t){t=t||{},P((function(){var e,n=it(),i=m("FCP"),o=E("paint",(function(s){s.forEach((function(a){a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-M(),0),i.entries.push(a),e(!0)))}))}));o&&(e=f(r,i,Q,t.reportAllChanges),g((function(s){i=m("FCP"),e=f(r,i,Q,t.reportAllChanges),F((function(){i.value=performance.now()-s.timeStamp,e(!0)}))})))}))},Z=[.1,.25],ot=function(r,t){t=t||{},G(H((function(){var e,n=m("CLS",0),i=0,o=[],s=function(u){u.forEach((function(c){if(!c.hadRecentInput){var y=o[0],ht=o[o.length-1];i&&c.startTime-ht.startTime<1e3&&c.startTime-y.startTime<5e3?(i+=c.value,o.push(c)):(i=c.value,o=[c])}})),i>n.value&&(n.value=i,n.entries=o,e())},a=E("layout-shift",s);a&&(e=f(r,n,Z,t.reportAllChanges),A((function(){s(a.takeRecords()),e(!0)})),g((function(){i=0,n=m("CLS",0),e=f(r,n,Z,t.reportAllChanges),F((function(){return e()}))})),setTimeout(e,0))})))},st=0,N=1/0,C=0,Mt=function(r){r.forEach((function(t){t.interactionId&&(N=Math.min(N,t.interactionId),C=Math.max(C,t.interactionId),st=C?(C-N)/7+1:0)}))},at=function(){return _?st:performance.interactionCount||0},At=function(){"interactionCount"in performance||_||(_=E("event",Mt,{type:"event",buffered:!0,durationThreshold:0}))},p=[],V=new Map,ut=0,Pt=function(){var r=Math.min(p.length-1,Math.floor((at()-ut)/50));return p[r]},Lt=[],Dt=function(r){if(Lt.forEach((function(i){return i(r)})),r.interactionId||r.entryType==="first-input"){var t=p[p.length-1],e=V.get(r.interactionId);if(e||p.length<10||r.duration>t.latency){if(e)r.duration>e.latency?(e.entries=[r],e.latency=r.duration):r.duration===e.latency&&r.startTime===e.entries[0].startTime&&e.entries.push(r);else{var n={id:r.interactionId,latency:r.duration,entries:[r]};V.set(n.id,n),p.push(n)}p.sort((function(i,o){return o.latency-i.latency})),p.length>10&&p.splice(10).forEach((function(i){return V.delete(i.id)}))}}},ct=function(r){var t=self.requestIdleCallback||self.setTimeout,e=-1;return r=H(r),document.visibilityState==="hidden"?r():(e=t(r),A(r)),e},tt=[200,500],lt=function(r,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},P((function(){var e;At();var n,i=m("INP"),o=function(a){ct((function(){a.forEach(Dt);var u=Pt();u&&u.latency!==i.value&&(i.value=u.latency,i.entries=u.entries,n())}))},s=E("event",o,{durationThreshold:(e=t.durationThreshold)!==null&&e!==void 0?e:40});n=f(r,i,tt,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),A((function(){o(s.takeRecords()),n(!0)})),g((function(){ut=at(),p.length=0,V.clear(),i=m("INP"),n=f(r,i,tt,t.reportAllChanges)})))})))},et=[2500,4e3],k={},dt=function(r,t){t=t||{},P((function(){var e,n=it(),i=m("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach((function(c){c.startTime<n.firstHiddenTime&&(i.value=Math.max(c.startTime-M(),0),i.entries=[c],e())}))},s=E("largest-contentful-paint",o);if(s){e=f(r,i,et,t.reportAllChanges);var a=H((function(){k[i.id]||(o(s.takeRecords()),s.disconnect(),k[i.id]=!0,e(!0))}));["keydown","click"].forEach((function(u){addEventListener(u,(function(){return ct(a)}),{once:!0,capture:!0})})),A(a),g((function(u){i=m("LCP"),e=f(r,i,et,t.reportAllChanges),F((function(){i.value=performance.now()-u.timeStamp,k[i.id]=!0,e(!0)}))}))}}))},rt=[800,1800],Ot=function r(t){document.prerendering?P((function(){return r(t)})):document.readyState!=="complete"?addEventListener("load",(function(){return r(t)}),!0):setTimeout(t,0)},pt=function(r,t){t=t||{};var e=m("TTFB"),n=f(r,e,rt,t.reportAllChanges);Ot((function(){var i=x();i&&(e.value=Math.max(i.responseStart-M(),0),e.entries=[i],n(!0),g((function(){e=m("TTFB",0),(n=f(r,e,rt,t.reportAllChanges))(!0)})))}))};var Nt={LCP:"lcpMs",FCP:"fcpMs",TTFB:"ttfbMs"},mt=()=>({lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null}),kt=r=>Math.round(r*1e4)/1e4,L=class{constructor(t){this.host=t;this.initial=null;this.current=null;this.early=mt();this.stopped=!1;var e;this.layoutShifts=typeof PerformanceObserver!="undefined"&&((e=PerformanceObserver.supportedEntryTypes)!=null?e:[]).includes("layout-shift")}start(){let t=n=>{try{this.report(n)}catch{this.host.drop()}},e={reportAllChanges:!0};dt(t,e),G(t,e),pt(t,e),lt(t,e),ot(t,e)}stop(){this.stopped=!0}pageView(t){var i;if(((i=this.current)==null?void 0:i.pageViewId)===t)return;let e=this.initial?mt():this.early;this.layoutShifts&&(e.cls=0);let n={pageViewId:t,values:e,dirty:Object.values(e).some(o=>o!==null)};this.initial||(this.initial=n),this.current=n}flush(){this.stopped||(this.send(this.initial),this.current!==this.initial&&this.send(this.current))}report(t){var i,o;if(this.stopped)return;let e=Nt[t.name];if(e){let s=t.navigationType==="back-forward-cache"?this.current:this.initial,a=s?s.values:this.early;a[e]=Math.round(t.value),s&&(s.dirty=!0);return}let n=this.current;n&&(t.name==="INP"?(n.values.inpMs=Math.max((i=n.values.inpMs)!=null?i:0,Math.round(t.value)),n.dirty=!0):t.name==="CLS"&&t.delta>0&&(n.values.cls=kt(((o=n.values.cls)!=null?o:0)+t.delta),n.dirty=!0))}send(t){!t||!t.dirty||(t.dirty=!1,this.host.record({id:l(),type:"vitals",pageViewId:t.pageViewId,...t.values}))}};var D=class{constructor(t){this.timings=new b(t),this.vitals=new L(t),this.longTasks=new I(t)}annotate(t){this.longTasks.annotate(t)}pageViewSent(t){this.timings.pageView(t),this.vitals.pageView(t.id),t.durationMs!==null&&this.vitals.flush()}hidden(){this.vitals.flush()}install(){this.vitals.start();let t=this.longTasks.start();return()=>{this.vitals.stop(),t()}}};var _t={IMG:"src",SCRIPT:"src",LINK:"href",AUDIO:"src",VIDEO:"src",SOURCE:"src",TRACK:"src",IFRAME:"src",EMBED:"src",INPUT:"src",OBJECT:"data"},xt=r=>{if(!(r instanceof Element))return null;let t=_t[r.tagName];if(!t)return null;let n=r.currentSrc||r.getAttribute(t),i=n?B(n):null;return i&&(i.protocol==="http:"||i.protocol==="https:")?i.href:null},ft=r=>h(window,"error",t=>{try{let e=xt(t.target);if(e===null)return;let n=W(r,"RESOURCE","GET",e,Date.now(),null);n.outcome="NETWORK_ERROR",r.record(n)}catch{r.drop()}},!0);var Ae=r=>{let{instrument:t}=r,e={pageViewId:t.pageViewId,resolveRoute:r.resolveRoute,record:s=>t.record(s),drop:t.drop,describe:r.describe},n=new D(e),i=new R(e),o=[n.install(),i.start(),ft(t),$(t),...r.captureConsole?[q(t)]:[]];return{perf:n,frustration:i,teardown:()=>o.reverse().forEach(s=>{try{s()}catch{t.drop()}})}};export{Ae as installDeferred};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTJIA62OAjs = require('./chunk-TJIA62OA.js');var _chunk2TDEJLQ7js = require('./chunk-2TDEJLQ7.js');require('./chunk-KD6VO7IK.js');var vt=1024,gt=50,q=r=>{let t=[["error","error"],["warn","warn"]],e=null,n=0,i=t.map(([o,s])=>{let a=console[o],u=(...c)=>{try{let y=r.pageViewId();y!==e&&(e=y,n=0),n+=1,n>gt?r.drop():r.record({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"console",pageViewId:y,occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now()),level:s,message:_chunk2TDEJLQ7js.f.call(void 0, c.map(_chunk2TDEJLQ7js.c).join(" "),vt)})}catch (e2){r.drop()}a.apply(console,c)};return console[o]=u,()=>{console[o]===u&&(console[o]=a)}});return()=>i.forEach(o=>o())};var yt=/^[a-z][a-z0-9-]{0,31}$/,Tt=r=>{try{let e=new URL(r);if(e.host)return`${e.protocol}//${e.host}`}catch (e3){}let t=r.trim().toLowerCase().replace(/:.*$/,"");return yt.test(t)?t:null},$=r=>{let t=null,e=new Set;return _chunk2TDEJLQ7js.d.call(void 0, document,"securitypolicyviolation",n=>{var i;try{let o=r.pageViewId();o!==t&&(t=o,e=new Set);let s=n.effectiveDirective||n.violatedDirective,a=Tt((i=n.blockedURI)!=null?i:""),u=`${s}${a!=null?a:""}`;if(!s||e.has(u))return;e.add(u),r.record({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"cspViolation",pageViewId:o,occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now()),effectiveDirective:s,blockedUri:a,sourceFile:n.sourceFile||null,lineNumber:n.lineNumber||null,disposition:n.disposition==="report"?"report":"enforce"})}catch (e4){r.drop()}},!0)};var w=1e3,Et=3,wt='button,a,[role="button"],input[type="submit"]',R=class{constructor(t){this.host=t;this.last=null;this.burst=[];this.raged=!1;this.activity=0;this.watched=new Set;this.observer=null}start(){typeof MutationObserver!="undefined"&&(this.observer=new MutationObserver(()=>this.notifyActivity()));let t=[_chunk2TDEJLQ7js.d.call(void 0, window,"click",e=>{try{e.target instanceof Element&&this.click(e.target)}catch (e5){this.host.drop()}},!0),_chunk2TDEJLQ7js.d.call(void 0, window,"pagehide",()=>this.cancel())];return()=>{t.forEach(e=>e()),this.cancel(),this.observer=null}}notifyActivity(){this.activity+=1}notifyError(){let t=this.last;!t||t.errored||Date.now()-t.at>w||(t.errored=!0,this.settle(t),this.emit(t,"ERROR_CLICK"))}click(t){let e=Date.now(),n=this.last,o=n!==null&&n.element===t&&e-n.at<=w;o&&this.settle(n),this.burst=o?[...this.burst.filter(a=>e-a<=w),e]:[e],o||(this.raged=!1);let s={element:t,at:e,pageViewId:this.host.pageViewId(),route:this.host.resolveRoute(),activity:this.activity,errored:!1,timer:null};this.last=s,this.burst.length>=Et&&!this.raged&&(this.raged=!0,this.emit(s,"RAGE_CLICK")),!o&&t.closest(wt)&&this.watch(s)}watch(t){this.watched.size===0&&this.observer&&this.observer.observe(document,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),this.watched.add(t),t.timer=setTimeout(()=>{try{this.settle(t),t.activity===this.activity&&!t.errored&&this.emit(t,"DEAD_CLICK")}catch (e6){this.host.drop()}},w)}settle(t){var e;t.timer!==null&&(clearTimeout(t.timer),t.timer=null),this.watched.delete(t)&&this.watched.size===0&&((e=this.observer)==null||e.disconnect())}cancel(){this.watched.forEach(t=>this.settle(t)),this.last=null,this.burst=[],this.raged=!1}emit(t,e){this.host.record({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"frustration",pageViewId:t.pageViewId,occurredAt:_chunk2TDEJLQ7js.a.call(void 0, t.at),frustrationType:e,route:t.route,element:this.host.describe(t.element)})}};var Rt=50,It=1e3,bt=(r,t)=>{let e=typeof performance=="undefined"?NaN:performance.timeOrigin;return Number.isFinite(e)&&e>0&&Number.isFinite(r)?e+r:Date.now()-t},Ct=()=>{var t;if(typeof PerformanceObserver=="undefined")return null;let r=(t=PerformanceObserver.supportedEntryTypes)!=null?t:[];return r.includes("long-animation-frame")?"long-animation-frame":r.includes("longtask")?"longtask":null},I=class{constructor(t){this.host=t;this.page=null}start(){let t=Ct();if(!t)return()=>{};let e=new PerformanceObserver(n=>{try{n.getEntries().forEach(i=>this.add(i.duration,i.startTime))}catch (e7){this.host.drop()}});return e.observe({type:t,buffered:!0}),()=>e.disconnect()}annotate(t){var e;((e=this.page)==null?void 0:e.id)===t.id&&(t.longTaskCount=this.page.count,t.longTaskTotalMs=Math.round(this.page.totalMs))}add(t,e){var i;let n=this.host.pageViewId();!n||!(t>=Rt)||(((i=this.page)==null?void 0:i.id)!==n&&(this.page={id:n,count:0,totalMs:0}),this.page.count+=1,this.page.totalMs+=t,t>=It&&this.host.record({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"longTask",pageViewId:n,route:this.host.resolveRoute(),startedAt:_chunk2TDEJLQ7js.a.call(void 0, bt(e,t)),durationMs:Math.round(t)}))}};var Vt=64,z=20,O=r=>typeof r=="string"&&r.length>0&&r.length<=Vt,X=()=>{let r=typeof performance=="undefined"?NaN:performance.timeOrigin;return Number.isFinite(r)&&r>0&&r<=Date.now()?r:null},b=class{constructor(t){this.host=t;this.page=null;this.pending=[];this.durations=new Map}pageView(t){var o,s;if(((o=this.page)==null?void 0:o.id)===t.id)return;let e=this.page===null,n=(s=e?X():null)!=null?s:Date.parse(t.startedAt);this.page={id:t.id,origin:n,count:0};for(let[a,u]of this.durations)e&&u.pageViewId===null?u.pageViewId=t.id:this.durations.delete(a);let i=this.pending;this.pending=[],i.forEach(a=>this.send(a))}addTiming(t,e=Date.now()){if(!O(t)){this.host.drop();return}let n=this.page?this.page.origin:X();if(n===null){this.host.drop();return}this.send({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"timing",occurredAt:_chunk2TDEJLQ7js.a.call(void 0, e),name:t,kind:"TIMING",valueMs:Math.max(0,Math.round(e-n))})}startDuration(t,e,n=Date.now()){var o,s;if(!O(t)){this.host.drop();return}let i={startedAt:n,pageViewId:(s=(o=this.page)==null?void 0:o.id)!=null?s:null};if(e!==void 0){let a=_chunkTJIA62OAjs.a.call(void 0, {},e,this.host.drop);Object.keys(a).length>0&&(i.attributes=a)}this.durations.set(t,i)}stopDuration(t,e=Date.now()){let n=O(t)?this.durations.get(t):void 0;if(!n){this.host.drop();return}this.durations.delete(t),this.send({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"timing",occurredAt:_chunk2TDEJLQ7js.a.call(void 0, n.startedAt),name:t,kind:"DURATION",valueMs:Math.max(0,Math.round(e-n.startedAt)),...n.attributes?{attributes:n.attributes}:{}})}send(t){if(!this.page){this.pending.length<z?this.pending.push(t):this.host.drop();return}if(this.page.count>=z){this.host.drop();return}this.page.count+=1,this.host.record({...t,pageViewId:this.page.id})}};var _;var nt=-1,g=function(r){addEventListener("pageshow",(function(t){t.persisted&&(nt=t.timeStamp,r(t))}),!0)},x=function(){var r=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(r&&r.responseStart>0&&r.responseStart<performance.now())return r},M=function(){var r=x();return r&&r.activationStart||0},m=function(r,t){var e=x(),n="navigate";return nt>=0?n="back-forward-cache":e&&(document.prerendering||M()>0?n="prerender":document.wasDiscarded?n="restore":e.type&&(n=e.type.replace(/_/g,"-"))),{name:r,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},E=function(r,t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(r)){var n=new PerformanceObserver((function(i){Promise.resolve().then((function(){t(i.getEntries())}))}));return n.observe(Object.assign({type:r,buffered:!0},e||{})),n}}catch (e8){}},f=function(r,t,e,n){var i,o;return function(s){t.value>=0&&(s||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=(function(a,u){return a>u[1]?"poor":a>u[0]?"needs-improvement":"good"})(t.value,e),r(t))}},F=function(r){requestAnimationFrame((function(){return requestAnimationFrame((function(){return r()}))}))},A=function(r){document.addEventListener("visibilitychange",(function(){document.visibilityState==="hidden"&&r()}))},H=function(r){var t=!1;return function(){t||(r(),t=!0)}},v=-1,Y=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},S=function(r){document.visibilityState==="hidden"&&v>-1&&(v=r.type==="visibilitychange"?r.timeStamp:0,St())},J=function(){addEventListener("visibilitychange",S,!0),addEventListener("prerenderingchange",S,!0)},St=function(){removeEventListener("visibilitychange",S,!0),removeEventListener("prerenderingchange",S,!0)},it=function(){return v<0&&(v=Y(),J(),g((function(){setTimeout((function(){v=Y(),J()}),0)}))),{get firstHiddenTime(){return v}}},P=function(r){document.prerendering?addEventListener("prerenderingchange",(function(){return r()}),!0):r()},Q=[1800,3e3],G=function(r,t){t=t||{},P((function(){var e,n=it(),i=m("FCP"),o=E("paint",(function(s){s.forEach((function(a){a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(i.value=Math.max(a.startTime-M(),0),i.entries.push(a),e(!0)))}))}));o&&(e=f(r,i,Q,t.reportAllChanges),g((function(s){i=m("FCP"),e=f(r,i,Q,t.reportAllChanges),F((function(){i.value=performance.now()-s.timeStamp,e(!0)}))})))}))},Z=[.1,.25],ot=function(r,t){t=t||{},G(H((function(){var e,n=m("CLS",0),i=0,o=[],s=function(u){u.forEach((function(c){if(!c.hadRecentInput){var y=o[0],ht=o[o.length-1];i&&c.startTime-ht.startTime<1e3&&c.startTime-y.startTime<5e3?(i+=c.value,o.push(c)):(i=c.value,o=[c])}})),i>n.value&&(n.value=i,n.entries=o,e())},a=E("layout-shift",s);a&&(e=f(r,n,Z,t.reportAllChanges),A((function(){s(a.takeRecords()),e(!0)})),g((function(){i=0,n=m("CLS",0),e=f(r,n,Z,t.reportAllChanges),F((function(){return e()}))})),setTimeout(e,0))})))},st=0,N=1/0,C=0,Mt=function(r){r.forEach((function(t){t.interactionId&&(N=Math.min(N,t.interactionId),C=Math.max(C,t.interactionId),st=C?(C-N)/7+1:0)}))},at=function(){return _?st:performance.interactionCount||0},At=function(){"interactionCount"in performance||_||(_=E("event",Mt,{type:"event",buffered:!0,durationThreshold:0}))},p=[],V=new Map,ut=0,Pt=function(){var r=Math.min(p.length-1,Math.floor((at()-ut)/50));return p[r]},Lt=[],Dt=function(r){if(Lt.forEach((function(i){return i(r)})),r.interactionId||r.entryType==="first-input"){var t=p[p.length-1],e=V.get(r.interactionId);if(e||p.length<10||r.duration>t.latency){if(e)r.duration>e.latency?(e.entries=[r],e.latency=r.duration):r.duration===e.latency&&r.startTime===e.entries[0].startTime&&e.entries.push(r);else{var n={id:r.interactionId,latency:r.duration,entries:[r]};V.set(n.id,n),p.push(n)}p.sort((function(i,o){return o.latency-i.latency})),p.length>10&&p.splice(10).forEach((function(i){return V.delete(i.id)}))}}},ct=function(r){var t=self.requestIdleCallback||self.setTimeout,e=-1;return r=H(r),document.visibilityState==="hidden"?r():(e=t(r),A(r)),e},tt=[200,500],lt=function(r,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},P((function(){var e;At();var n,i=m("INP"),o=function(a){ct((function(){a.forEach(Dt);var u=Pt();u&&u.latency!==i.value&&(i.value=u.latency,i.entries=u.entries,n())}))},s=E("event",o,{durationThreshold:(e=t.durationThreshold)!==null&&e!==void 0?e:40});n=f(r,i,tt,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),A((function(){o(s.takeRecords()),n(!0)})),g((function(){ut=at(),p.length=0,V.clear(),i=m("INP"),n=f(r,i,tt,t.reportAllChanges)})))})))},et=[2500,4e3],k={},dt=function(r,t){t=t||{},P((function(){var e,n=it(),i=m("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach((function(c){c.startTime<n.firstHiddenTime&&(i.value=Math.max(c.startTime-M(),0),i.entries=[c],e())}))},s=E("largest-contentful-paint",o);if(s){e=f(r,i,et,t.reportAllChanges);var a=H((function(){k[i.id]||(o(s.takeRecords()),s.disconnect(),k[i.id]=!0,e(!0))}));["keydown","click"].forEach((function(u){addEventListener(u,(function(){return ct(a)}),{once:!0,capture:!0})})),A(a),g((function(u){i=m("LCP"),e=f(r,i,et,t.reportAllChanges),F((function(){i.value=performance.now()-u.timeStamp,k[i.id]=!0,e(!0)}))}))}}))},rt=[800,1800],Ot=function r(t){document.prerendering?P((function(){return r(t)})):document.readyState!=="complete"?addEventListener("load",(function(){return r(t)}),!0):setTimeout(t,0)},pt=function(r,t){t=t||{};var e=m("TTFB"),n=f(r,e,rt,t.reportAllChanges);Ot((function(){var i=x();i&&(e.value=Math.max(i.responseStart-M(),0),e.entries=[i],n(!0),g((function(){e=m("TTFB",0),(n=f(r,e,rt,t.reportAllChanges))(!0)})))}))};var Nt={LCP:"lcpMs",FCP:"fcpMs",TTFB:"ttfbMs"},mt=()=>({lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null}),kt=r=>Math.round(r*1e4)/1e4,L=class{constructor(t){this.host=t;this.initial=null;this.current=null;this.early=mt();this.stopped=!1;var e;this.layoutShifts=typeof PerformanceObserver!="undefined"&&((e=PerformanceObserver.supportedEntryTypes)!=null?e:[]).includes("layout-shift")}start(){let t=n=>{try{this.report(n)}catch (e9){this.host.drop()}},e={reportAllChanges:!0};dt(t,e),G(t,e),pt(t,e),lt(t,e),ot(t,e)}stop(){this.stopped=!0}pageView(t){var i;if(((i=this.current)==null?void 0:i.pageViewId)===t)return;let e=this.initial?mt():this.early;this.layoutShifts&&(e.cls=0);let n={pageViewId:t,values:e,dirty:Object.values(e).some(o=>o!==null)};this.initial||(this.initial=n),this.current=n}flush(){this.stopped||(this.send(this.initial),this.current!==this.initial&&this.send(this.current))}report(t){var i,o;if(this.stopped)return;let e=Nt[t.name];if(e){let s=t.navigationType==="back-forward-cache"?this.current:this.initial,a=s?s.values:this.early;a[e]=Math.round(t.value),s&&(s.dirty=!0);return}let n=this.current;n&&(t.name==="INP"?(n.values.inpMs=Math.max((i=n.values.inpMs)!=null?i:0,Math.round(t.value)),n.dirty=!0):t.name==="CLS"&&t.delta>0&&(n.values.cls=kt(((o=n.values.cls)!=null?o:0)+t.delta),n.dirty=!0))}send(t){!t||!t.dirty||(t.dirty=!1,this.host.record({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"vitals",pageViewId:t.pageViewId,...t.values}))}};var D=class{constructor(t){this.timings=new b(t),this.vitals=new L(t),this.longTasks=new I(t)}annotate(t){this.longTasks.annotate(t)}pageViewSent(t){this.timings.pageView(t),this.vitals.pageView(t.id),t.durationMs!==null&&this.vitals.flush()}hidden(){this.vitals.flush()}install(){this.vitals.start();let t=this.longTasks.start();return()=>{this.vitals.stop(),t()}}};var _t={IMG:"src",SCRIPT:"src",LINK:"href",AUDIO:"src",VIDEO:"src",SOURCE:"src",TRACK:"src",IFRAME:"src",EMBED:"src",INPUT:"src",OBJECT:"data"},xt=r=>{if(!(r instanceof Element))return null;let t=_t[r.tagName];if(!t)return null;let n=r.currentSrc||r.getAttribute(t),i=n?_chunkTJIA62OAjs.c.call(void 0, n):null;return i&&(i.protocol==="http:"||i.protocol==="https:")?i.href:null},ft=r=>_chunk2TDEJLQ7js.d.call(void 0, window,"error",t=>{try{let e=xt(t.target);if(e===null)return;let n=_chunkTJIA62OAjs.h.call(void 0, r,"RESOURCE","GET",e,Date.now(),null);n.outcome="NETWORK_ERROR",r.record(n)}catch (e10){r.drop()}},!0);var Ae=r=>{let{instrument:t}=r,e={pageViewId:t.pageViewId,resolveRoute:r.resolveRoute,record:s=>t.record(s),drop:t.drop,describe:r.describe},n=new D(e),i=new R(e),o=[n.install(),i.start(),ft(t),$(t),...r.captureConsole?[q(t)]:[]];return{perf:n,frustration:i,teardown:()=>o.reverse().forEach(s=>{try{s()}catch (e11){t.drop()}})}};exports.installDeferred = Ae;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGSWUATOHjs = require('./chunk-GSWUATOH.js');var _chunkLRYKS5XRjs = require('./chunk-LRYKS5XR.js');require('./chunk-UZZNGXXE.js');var L="abyss-rum-report-dialog",A={fr:{title:"Signaler un probl\xE8me",message:"Que s\u2019est-il pass\xE9 ?",email:"E-mail (facultatif)",cancel:"Annuler",send:"Envoyer",sending:"Envoi\u2026",sent:"Merci, votre signalement a \xE9t\xE9 envoy\xE9.",errors:{FEEDBACK_DISABLED:"Les signalements ne sont pas disponibles.",NO_SESSION:"Les signalements ne sont pas disponibles.",INVALID_MESSAGE:`D\xE9crivez le probl\xE8me en ${_chunkGSWUATOHjs.a} caract\xE8res au plus.`,INVALID_EMAIL:"Cette adresse e-mail n\u2019est pas valide.",LIMIT_REACHED:"Vous avez d\xE9j\xE0 envoy\xE9 plusieurs signalements.",DISCARDED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",REFUSED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",SEND_FAILED:"L\u2019envoi a \xE9chou\xE9. R\xE9essayez dans un instant."}},en:{title:"Report a problem",message:"What happened?",email:"E-mail (optional)",cancel:"Cancel",send:"Send",sending:"Sending\u2026",sent:"Thank you, your report was sent.",errors:{FEEDBACK_DISABLED:"Reports are not available.",NO_SESSION:"Reports are not available.",INVALID_MESSAGE:`Describe the problem in ${_chunkGSWUATOHjs.a} characters at most.`,INVALID_EMAIL:"This e-mail address is not valid.",LIMIT_REACHED:"You have already sent several reports.",DISCARDED:"The report could not be sent.",REFUSED:"The report could not be sent.",SEND_FAILED:"Sending failed. Try again in a moment."}}},R= exports.SENT_MESSAGE_MS =2e3,I=`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAYCUJAHDjs = require('./chunk-AYCUJAHD.js');var _chunkLRYKS5XRjs = require('./chunk-LRYKS5XR.js');require('./chunk-2TDEJLQ7.js');require('./chunk-KD6VO7IK.js');var L="abyss-rum-report-dialog",A={fr:{title:"Signaler un probl\xE8me",message:"Que s\u2019est-il pass\xE9 ?",email:"E-mail (facultatif)",cancel:"Annuler",send:"Envoyer",sending:"Envoi\u2026",sent:"Merci, votre signalement a \xE9t\xE9 envoy\xE9.",errors:{FEEDBACK_DISABLED:"Les signalements ne sont pas disponibles.",NO_SESSION:"Les signalements ne sont pas disponibles.",INVALID_MESSAGE:`D\xE9crivez le probl\xE8me en ${_chunkAYCUJAHDjs.a} caract\xE8res au plus.`,INVALID_EMAIL:"Cette adresse e-mail n\u2019est pas valide.",LIMIT_REACHED:"Vous avez d\xE9j\xE0 envoy\xE9 plusieurs signalements.",DISCARDED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",REFUSED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",SEND_FAILED:"L\u2019envoi a \xE9chou\xE9. R\xE9essayez dans un instant."}},en:{title:"Report a problem",message:"What happened?",email:"E-mail (optional)",cancel:"Cancel",send:"Send",sending:"Sending\u2026",sent:"Thank you, your report was sent.",errors:{FEEDBACK_DISABLED:"Reports are not available.",NO_SESSION:"Reports are not available.",INVALID_MESSAGE:`Describe the problem in ${_chunkAYCUJAHDjs.a} characters at most.`,INVALID_EMAIL:"This e-mail address is not valid.",LIMIT_REACHED:"You have already sent several reports.",DISCARDED:"The report could not be sent.",REFUSED:"The report could not be sent.",SEND_FAILED:"Sending failed. Try again in a moment."}}},R= exports.SENT_MESSAGE_MS =2e3,I=`
2
2
  :host{all:initial}
3
3
  .backdrop{position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(10,14,20,.55);font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#111827}
4
4
  .dialog{box-sizing:border-box;width:100%;max-width:440px;padding:20px;border-radius:12px;background:#fff;box-shadow:0 20px 50px rgba(0,0,0,.3)}
@@ -14,4 +14,4 @@ button{padding:8px 14px;border:1px solid #d1d5db;border-radius:8px;font:inherit;
14
14
  button.primary{border-color:#2563eb;background:#2563eb;color:#fff}
15
15
  button:disabled{opacity:.6;cursor:default}
16
16
  @media (prefers-color-scheme:dark){.dialog{background:#111827;color:#f3f4f6}textarea,input,button{background:#1f2937;border-color:#374151;color:#f3f4f6}button.primary{background:#3b82f6;border-color:#3b82f6}.status.error{color:#fca5a5}}
17
- `,T=o=>o==="fr"||o==="en"?o:/^en\b/i.test(document.documentElement.lang)?"en":"fr",e=(o,a={},...t)=>{let s=Object.assign(document.createElement(o),a);return t.forEach(p=>s.appendChild(p)),s},M= exports.openReportDialog =(o,a)=>{if(_chunkGSWUATOHjs.c.call(void 0, o)!==null||document.querySelector(L))return;let t=A[T(a.locale)],s=document.createElement(L),p=s.attachShadow({mode:"open"}),i=document.activeElement,S=typeof a.title=="string"&&a.title?a.title:t.title,d=e("textarea",{id:"message",required:!0,maxLength:_chunkGSWUATOHjs.a}),u=e("input",{id:"email",type:"email",autocomplete:"email",value:typeof a.email=="string"?a.email:""}),r=e("p",{className:"status"});r.setAttribute("role","status");let f=e("button",{type:"button",textContent:t.cancel}),b=e("button",{type:"submit",className:"primary",textContent:t.send}),l=e("form",{className:"dialog",noValidate:!0},e("h2",{id:"title",textContent:S}),e("label",{htmlFor:"message",textContent:t.message}),d,e("label",{htmlFor:"email",textContent:t.email}),u,r,e("div",{className:"actions"},f,b));l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.setAttribute("aria-labelledby","title");let g=e("div",{className:"backdrop"},l);p.append(e("style",{textContent:I}),g);let E=!1,c=()=>{var n;E||(E=!0,document.removeEventListener("keydown",x,!0),s.remove(),(n=i==null?void 0:i.focus)==null||n.call(i))},x=n=>{n.key==="Escape"&&c()},k=n=>{r.className="status error",r.textContent=t.errors[n]};f.addEventListener("click",c),g.addEventListener("click",n=>{n.target===g&&c()}),l.addEventListener("submit",n=>{n.preventDefault(),b.disabled=!0,r.className="status",r.textContent=t.sending,_chunkGSWUATOHjs.d.call(void 0, o,{message:d.value,email:u.value}).then(()=>{r.textContent=t.sent,d.disabled=!0,u.disabled=!0,setTimeout(c,R)},y=>{b.disabled=!1,k(y instanceof _chunkLRYKS5XRjs.b?y.code:"SEND_FAILED")})}),document.addEventListener("keydown",x,!0),document.body.appendChild(s),d.focus()};exports.REPORT_DIALOG_TAG = L; exports.SENT_MESSAGE_MS = R; exports.openReportDialog = M;
17
+ `,T=o=>o==="fr"||o==="en"?o:/^en\b/i.test(document.documentElement.lang)?"en":"fr",e=(o,a={},...t)=>{let s=Object.assign(document.createElement(o),a);return t.forEach(p=>s.appendChild(p)),s},M= exports.openReportDialog =(o,a)=>{if(_chunkAYCUJAHDjs.c.call(void 0, o)!==null||document.querySelector(L))return;let t=A[T(a.locale)],s=document.createElement(L),p=s.attachShadow({mode:"open"}),i=document.activeElement,S=typeof a.title=="string"&&a.title?a.title:t.title,d=e("textarea",{id:"message",required:!0,maxLength:_chunkAYCUJAHDjs.a}),u=e("input",{id:"email",type:"email",autocomplete:"email",value:typeof a.email=="string"?a.email:""}),r=e("p",{className:"status"});r.setAttribute("role","status");let f=e("button",{type:"button",textContent:t.cancel}),b=e("button",{type:"submit",className:"primary",textContent:t.send}),l=e("form",{className:"dialog",noValidate:!0},e("h2",{id:"title",textContent:S}),e("label",{htmlFor:"message",textContent:t.message}),d,e("label",{htmlFor:"email",textContent:t.email}),u,r,e("div",{className:"actions"},f,b));l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.setAttribute("aria-labelledby","title");let g=e("div",{className:"backdrop"},l);p.append(e("style",{textContent:I}),g);let E=!1,c=()=>{var n;E||(E=!0,document.removeEventListener("keydown",x,!0),s.remove(),(n=i==null?void 0:i.focus)==null||n.call(i))},x=n=>{n.key==="Escape"&&c()},k=n=>{r.className="status error",r.textContent=t.errors[n]};f.addEventListener("click",c),g.addEventListener("click",n=>{n.target===g&&c()}),l.addEventListener("submit",n=>{n.preventDefault(),b.disabled=!0,r.className="status",r.textContent=t.sending,_chunkAYCUJAHDjs.d.call(void 0, o,{message:d.value,email:u.value}).then(()=>{r.textContent=t.sent,d.disabled=!0,u.disabled=!0,setTimeout(c,R)},y=>{b.disabled=!1,k(y instanceof _chunkLRYKS5XRjs.b?y.code:"SEND_FAILED")})}),document.addEventListener("keydown",x,!0),document.body.appendChild(s),d.focus()};exports.REPORT_DIALOG_TAG = L; exports.SENT_MESSAGE_MS = R; exports.openReportDialog = M;
@@ -1,4 +1,4 @@
1
- import{a as m,c as h,d as v}from"./chunk-UKLKIMTU.mjs";import{b as D}from"./chunk-QEU2JJHJ.mjs";import"./chunk-AAXB6P4Z.mjs";var L="abyss-rum-report-dialog",A={fr:{title:"Signaler un probl\xE8me",message:"Que s\u2019est-il pass\xE9 ?",email:"E-mail (facultatif)",cancel:"Annuler",send:"Envoyer",sending:"Envoi\u2026",sent:"Merci, votre signalement a \xE9t\xE9 envoy\xE9.",errors:{FEEDBACK_DISABLED:"Les signalements ne sont pas disponibles.",NO_SESSION:"Les signalements ne sont pas disponibles.",INVALID_MESSAGE:`D\xE9crivez le probl\xE8me en ${m} caract\xE8res au plus.`,INVALID_EMAIL:"Cette adresse e-mail n\u2019est pas valide.",LIMIT_REACHED:"Vous avez d\xE9j\xE0 envoy\xE9 plusieurs signalements.",DISCARDED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",REFUSED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",SEND_FAILED:"L\u2019envoi a \xE9chou\xE9. R\xE9essayez dans un instant."}},en:{title:"Report a problem",message:"What happened?",email:"E-mail (optional)",cancel:"Cancel",send:"Send",sending:"Sending\u2026",sent:"Thank you, your report was sent.",errors:{FEEDBACK_DISABLED:"Reports are not available.",NO_SESSION:"Reports are not available.",INVALID_MESSAGE:`Describe the problem in ${m} characters at most.`,INVALID_EMAIL:"This e-mail address is not valid.",LIMIT_REACHED:"You have already sent several reports.",DISCARDED:"The report could not be sent.",REFUSED:"The report could not be sent.",SEND_FAILED:"Sending failed. Try again in a moment."}}},R=2e3,I=`
1
+ import{a as m,c as h,d as v}from"./chunk-TZMNAMPV.mjs";import{b as D}from"./chunk-QEU2JJHJ.mjs";import"./chunk-57O4BMUU.mjs";import"./chunk-5S3SDOLF.mjs";var L="abyss-rum-report-dialog",A={fr:{title:"Signaler un probl\xE8me",message:"Que s\u2019est-il pass\xE9 ?",email:"E-mail (facultatif)",cancel:"Annuler",send:"Envoyer",sending:"Envoi\u2026",sent:"Merci, votre signalement a \xE9t\xE9 envoy\xE9.",errors:{FEEDBACK_DISABLED:"Les signalements ne sont pas disponibles.",NO_SESSION:"Les signalements ne sont pas disponibles.",INVALID_MESSAGE:`D\xE9crivez le probl\xE8me en ${m} caract\xE8res au plus.`,INVALID_EMAIL:"Cette adresse e-mail n\u2019est pas valide.",LIMIT_REACHED:"Vous avez d\xE9j\xE0 envoy\xE9 plusieurs signalements.",DISCARDED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",REFUSED:"Le signalement n\u2019a pas pu \xEAtre envoy\xE9.",SEND_FAILED:"L\u2019envoi a \xE9chou\xE9. R\xE9essayez dans un instant."}},en:{title:"Report a problem",message:"What happened?",email:"E-mail (optional)",cancel:"Cancel",send:"Send",sending:"Sending\u2026",sent:"Thank you, your report was sent.",errors:{FEEDBACK_DISABLED:"Reports are not available.",NO_SESSION:"Reports are not available.",INVALID_MESSAGE:`Describe the problem in ${m} characters at most.`,INVALID_EMAIL:"This e-mail address is not valid.",LIMIT_REACHED:"You have already sent several reports.",DISCARDED:"The report could not be sent.",REFUSED:"The report could not be sent.",SEND_FAILED:"Sending failed. Try again in a moment."}}},R=2e3,I=`
2
2
  :host{all:initial}
3
3
  .backdrop{position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(10,14,20,.55);font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#111827}
4
4
  .dialog{box-sizing:border-box;width:100%;max-width:440px;padding:20px;border-radius:12px;background:#fff;box-shadow:0 20px 50px rgba(0,0,0,.3)}
package/dist/index.d.mts CHANGED
@@ -67,12 +67,24 @@ interface AbyssRumOptions {
67
67
  instrumentedOrigins?: string[];
68
68
  /** Route template of the application; its result is masked like any URL. */
69
69
  routeResolver?: (location: Location) => string;
70
- /** Read each time replay is considered: replay requires analytics consent. */
70
+ /**
71
+ * Read each time replay is considered, every 2 seconds and at each recorded change: replay
72
+ * requires analytics consent; once withdrawn, recording stops and what was not sent is discarded.
73
+ */
71
74
  consent?: () => {
72
75
  analytics: boolean;
73
76
  };
74
- /** Replay (lot G). */
77
+ /**
78
+ * Replay (§29, §36.3): elements whose text is recorded, added to the environment's list. Like
79
+ * `data-abyss-privacy="allow"`, they never unmask a form field. An invalid selector is ignored
80
+ * and counted in `droppedEvents`.
81
+ */
75
82
  unmaskSelectors?: string[];
83
+ /**
84
+ * Replay (§29): routes never recorded, matched against the route of the page (`routeResolver`,
85
+ * else `location.pathname`): a string matches the same route, a RegExp is searched in it.
86
+ */
87
+ replayExcludedRoutes?: (string | RegExp)[];
76
88
  /** Decides the session and its replay; it overrides the rates (§35.2). */
77
89
  sampler?: (ctx: RumSamplingContext) => RumSamplingDecision;
78
90
  /**
@@ -83,8 +95,8 @@ interface AbyssRumOptions {
83
95
  /** `console.error` and `console.warn` capture, on by default (§36.4). */
84
96
  captureConsole?: boolean;
85
97
  /**
86
- * First-party relay (`AbyssMonitorCore.rumProxy()`): configuration and batches go to
87
- * `proxyUrl` + `/rum/:applicationId/...` instead of `apiUrl` + `/api/rum/...` (§36.2).
98
+ * First-party relay (`AbyssMonitorCore.rumProxy()`): configuration, batches and replay chunks go
99
+ * to `proxyUrl` + `/rum/:applicationId/...` instead of `apiUrl` + `/api/rum/...` (§36.2).
88
100
  */
89
101
  proxyUrl?: string;
90
102
  /** Records the content of WebSocket and SSE messages (§38); off without it. */
package/dist/index.d.ts CHANGED
@@ -67,12 +67,24 @@ interface AbyssRumOptions {
67
67
  instrumentedOrigins?: string[];
68
68
  /** Route template of the application; its result is masked like any URL. */
69
69
  routeResolver?: (location: Location) => string;
70
- /** Read each time replay is considered: replay requires analytics consent. */
70
+ /**
71
+ * Read each time replay is considered, every 2 seconds and at each recorded change: replay
72
+ * requires analytics consent; once withdrawn, recording stops and what was not sent is discarded.
73
+ */
71
74
  consent?: () => {
72
75
  analytics: boolean;
73
76
  };
74
- /** Replay (lot G). */
77
+ /**
78
+ * Replay (§29, §36.3): elements whose text is recorded, added to the environment's list. Like
79
+ * `data-abyss-privacy="allow"`, they never unmask a form field. An invalid selector is ignored
80
+ * and counted in `droppedEvents`.
81
+ */
75
82
  unmaskSelectors?: string[];
83
+ /**
84
+ * Replay (§29): routes never recorded, matched against the route of the page (`routeResolver`,
85
+ * else `location.pathname`): a string matches the same route, a RegExp is searched in it.
86
+ */
87
+ replayExcludedRoutes?: (string | RegExp)[];
76
88
  /** Decides the session and its replay; it overrides the rates (§35.2). */
77
89
  sampler?: (ctx: RumSamplingContext) => RumSamplingDecision;
78
90
  /**
@@ -83,8 +95,8 @@ interface AbyssRumOptions {
83
95
  /** `console.error` and `console.warn` capture, on by default (§36.4). */
84
96
  captureConsole?: boolean;
85
97
  /**
86
- * First-party relay (`AbyssMonitorCore.rumProxy()`): configuration and batches go to
87
- * `proxyUrl` + `/rum/:applicationId/...` instead of `apiUrl` + `/api/rum/...` (§36.2).
98
+ * First-party relay (`AbyssMonitorCore.rumProxy()`): configuration, batches and replay chunks go
99
+ * to `proxyUrl` + `/rum/:applicationId/...` instead of `apiUrl` + `/api/rum/...` (§36.2).
88
100
  */
89
101
  proxyUrl?: string;
90
102
  /** Records the content of WebSocket and SSE messages (§38); off without it. */
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkLRYKS5XRjs = require('./chunk-LRYKS5XR.js');var _chunkIZ7REN7Ejs = require('./chunk-IZ7REN7E.js');var _chunkUZZNGXXEjs = require('./chunk-UZZNGXXE.js');var Se=t=>t===null?null:typeof t=="string"&&t.trim()!==""?t:void 0;var be=50,D=class{constructor(){this.session={};this.pageViewId=null;this.page={}}add(e,s,n){if(s==null)return n(),!1;let r=!1,o=()=>{r=!0,n()},i={[String(e)]:s};return this.session=_chunkIZ7REN7Ejs.a.call(void 0, this.session,i,o,be),r||(this.page=_chunkIZ7REN7Ejs.a.call(void 0, this.page,i,o,be)),!r}hasAny(){return Object.keys(this.session).length>0}annotate(e){e.id!==this.pageViewId&&(this.pageViewId!==null&&(this.page={}),this.pageViewId=e.id),Object.keys(this.page).length>0&&(e.featureFlags={...this.page})}};var Qe=64,we=(t,e,s,n)=>{if(typeof t!="string"||t.length===0||t.length>Qe)return n(),null;let r={id:_chunkUZZNGXXEjs.q.call(void 0, ),type:"action",pageViewId:s,occurredAt:_chunkUZZNGXXEjs.g.call(void 0, Date.now()),name:t};if(e!==void 0){let o=_chunkIZ7REN7Ejs.a.call(void 0, {},e,n);Object.keys(o).length>0&&(r.attributes=o)}return r};var ze=["id","type","sessionId"],Je=(t,e)=>t==null?e==null||["string","number","boolean"].includes(typeof e):Array.isArray(t)?Array.isArray(e):e!==null&&typeof e==typeof t,te=(t,e,s)=>{if(!e)return t;let n;try{n=e(JSON.parse(JSON.stringify(t)))}catch (e2){return s(),t}if(n===null)return null;if(!n||typeof n!="object"||Array.isArray(n))return s(),null;let r=t,o=n,i={};for(let a of Object.keys(r))if(ze.includes(a))i[a]=r[a];else if(Je(r[a],o[a]))o[a]!==void 0&&(i[a]=o[a]);else return s(),null;return i};var Ze=/^([a-z][a-z0-9+.-]*:)\/\//i,et=["url","blockedUri","sourceFile"],tt=["route","referrerRoute","entryPath"],se=t=>{let{host:e,path:s}=_chunkUZZNGXXEjs.b.call(void 0, t);if(e===null)return s;let n=Ze.exec(t.trim());return`${n?n[1].toLowerCase():"https:"}//${e}${s}`},x=t=>_chunkUZZNGXXEjs.b.call(void 0, t).path,ne=t=>{let e=t;for(let s of et)typeof e[s]=="string"&&(e[s]=se(e[s]));for(let s of tt)typeof e[s]=="string"&&(e[s]=x(e[s]));return t};var st=20,nt=256,rt='[data-testid],[aria-label],button,a,input,select,textarea,summary,[role="button"],[role="link"]',Ie=(t,e)=>{let s=t.getAttribute(e);return s===null?null:s.slice(0,nt)},re=t=>{var s;let e=(s=t.closest(rt))!=null?s:t;return{tag:e.tagName.toLowerCase().slice(0,64),testId:Ie(e,"data-testid"),ariaLabel:Ie(e,"aria-label")}},q=class{constructor(){this.items=[];this.lastPageViewId=null}observe(e){e.type==="pageView"&&e.id!==this.lastPageViewId?(this.lastPageViewId=e.id,this.add({kind:"NAVIGATION",route:x(e.route)})):e.type==="request"&&e.kind!=="WEBSOCKET"&&e.kind!=="SSE"&&this.add({kind:"REQUEST",method:e.method,url:se(e.url),status:e.status})}click(e){e instanceof Element&&this.add({kind:"CLICK",element:re(e)})}snapshot(){return this.items.map(e=>({...e}))}add(e){this.items.push({...e,occurredAt:_chunkUZZNGXXEjs.g.call(void 0, Date.now())}),this.items.length>st&&this.items.shift()}};var ot=/^\s*at\s|@\S+:\d+/,it=t=>{var e,s;return(s=(e=(t!=null?t:"").split(`
2
- `).find(n=>ot.test(n)))==null?void 0:e.trim())!=null?s:""},W=class{constructor(e){this.release=e;this.held=new Map}add(e){var r;let s=`${(r=e.pageViewId)!=null?r:""}${e.message}${it(e.stack)}`,n=this.held.get(s);if(n){n.event.repeat+=1;return}this.held.set(s,{event:e,timer:setTimeout(()=>this.releaseKey(s),1e4)})}flush(){[...this.held.keys()].forEach(e=>this.releaseKey(e))}clear(){this.held.forEach(e=>clearTimeout(e.timer)),this.held.clear()}releaseKey(e){let s=this.held.get(e);s&&(clearTimeout(s.timer),this.held.delete(e),this.release(s.event))}};var at=/^ResizeObserver loop/,ut=/^Script error\.?$/,dt=t=>{let e=t;return e&&typeof e=="object"&&typeof e.message=="string"?{name:typeof e.name=="string"&&e.name?e.name:"Error",message:e.message,stack:typeof e.stack=="string"?e.stack:null}:{name:"Error",message:_chunkUZZNGXXEjs.i.call(void 0, t),stack:null}},lt=t=>{if(!t||typeof t!="object")return;let e=Object.entries(t).filter(([,s])=>typeof s=="string");return e.length>0?Object.fromEntries(e):void 0},ct=t=>at.test(t.message)||ut.test(t.message)&&!t.stack,j=class{constructor(e){this.host=e;this.breadcrumbs=new q;this.pageViewId=null;this.dedup=new W(s=>e.record(s))}capture(e,s){let n=dt(e);if(ct(n)){this.host.drop();return}this.host.captured();let r=lt(s);this.dedup.add({id:_chunkUZZNGXXEjs.q.call(void 0, ),type:"error",pageViewId:this.host.pageViewId(),occurredAt:_chunkUZZNGXXEjs.g.call(void 0, Date.now()),route:this.host.resolveRoute(),...n,breadcrumbs:this.breadcrumbs.snapshot(),repeat:1,...r?{context:r}:{}})}observe(e){this.breadcrumbs.observe(e),e.type==="pageView"&&e.id!==this.pageViewId&&(this.pageViewId!==null&&this.dedup.flush(),this.pageViewId=e.id)}install(){let e=n=>()=>{try{n()}catch (e3){this.host.drop()}},s=[_chunkUZZNGXXEjs.j.call(void 0, window,"error",n=>{n.target instanceof Element||e(()=>{var r;return this.capture((r=n.error)!=null?r:n.message)})()}),_chunkUZZNGXXEjs.j.call(void 0, window,"unhandledrejection",n=>e(()=>this.capture(n.reason))()),_chunkUZZNGXXEjs.j.call(void 0, window,"click",n=>e(()=>this.breadcrumbs.click(n.target))(),!0),_chunkUZZNGXXEjs.j.call(void 0, window,"pagehide",e(()=>this.dedup.flush())),_chunkUZZNGXXEjs.j.call(void 0, document,"visibilitychange",e(()=>{document.visibilityState==="hidden"&&this.dedup.flush()}))];return()=>{s.forEach(n=>n()),this.dedup.clear()}}};var mt=123,ie=(t,e,s)=>{let n=_chunkIZ7REN7Ejs.c.call(void 0, String(s));if(!n)return null;let r=n.href,o=null;_chunkIZ7REN7Ejs.e.call(void 0, t,n)&&(o=_chunkUZZNGXXEjs.q.call(void 0, ),n.searchParams.set(_chunkUZZNGXXEjs.e,o),n.searchParams.set(_chunkUZZNGXXEjs.f,t.sessionId()));let i=Date.now(),a=_chunkIZ7REN7Ejs.h.call(void 0, t,e,"GET",r,i,o);Object.assign(a,{connectMs:null,messagesIn:0,messagesOut:0,bytesIn:0,bytesOut:0,droppedMessages:0});let p={event:a,startedAt:i,opened:!1,dirty:!0,done:!1};return t.trackConnection(p),{connection:p,nativeUrl:o===null?String(s):n.href}},ae=t=>{t.opened||(t.opened=!0,t.event.connectMs=Date.now()-t.startedAt,t.dirty=!0)},K=(t,e,s)=>{var r,o,i,a;let{event:n}=t;e==="in"?(n.messagesIn=((r=n.messagesIn)!=null?r:0)+1,n.bytesIn=((o=n.bytesIn)!=null?o:0)+_chunkUZZNGXXEjs.m.call(void 0, s)):(n.messagesOut=((i=n.messagesOut)!=null?i:0)+1,n.bytesOut=((a=n.bytesOut)!=null?a:0)+_chunkUZZNGXXEjs.m.call(void 0, s)),t.dirty=!0},X=(t,e)=>{t.done||(t.event.durationMs=Date.now()-t.startedAt,t.event.outcome=e,t.done=!0,t.dirty=!0)},ke=(t,e)=>({direction:t,data:e,at:Date.now(),eventName:null,eventId:null}),ht=(t,e,s,n)=>{if(s)return"ABORTED";if(t&&(e===1e3||e===1001||n&&e===1005))return"SUCCESS";let r=_chunkIZ7REN7Ejs.f.call(void 0, );return r==="OFFLINE"||!t?r:"HTTP_ERROR"},Ae=t=>{let e=window.WebSocket;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.send,r=s.close,o=new WeakMap,i=(u,d)=>{o.set(u,d),u.addEventListener("open",()=>ae(d)),u.addEventListener("message",c=>{K(d,"in",c.data),t.socketMessage(d,ke("IN",c.data))}),u.addEventListener("close",c=>{let h=o.get(u);d.event.closeCode=c.code,d.event.closeReason=c.reason?_chunkUZZNGXXEjs.l.call(void 0, c.reason,mt):null,X(d,ht(d.opened,c.code,(h==null?void 0:h.abortedByApp)===!0,(h==null?void 0:h.closedByApp)===!0)),t.socketClosed(d)})},a=new Proxy(e,{construct(u,d,c){let h=null;try{h=ie(t,"WEBSOCKET",d[0])}catch (e4){t.drop()}let y=h?[h.nativeUrl,...d.slice(1)]:d,m=Reflect.construct(u,y,c===a?u:c);return h&&i(m,h.connection),m}}),p=function(u){n.call(this,u);let d=o.get(this);d&&(K(d,"out",u),t.socketMessage(d,ke("OUT",u)))},l=function(u,d){let c=o.get(this);return c&&(c.abortedByApp=this.readyState===e.CONNECTING,c.closedByApp=!0),r.apply(this,arguments)};return window.WebSocket=a,s.send=p,s.close=l,()=>{window.WebSocket===a&&(window.WebSocket=e),s.send===p&&(s.send=n),s.close===l&&(s.close=r)}};var Te=t=>{let e=window,s=e.EventSource;if(typeof s!="function")return()=>{};let n=s.prototype,r=n.close,o=new WeakMap,i=(l,u)=>{o.set(l,u),u.event.reconnectCount=0,l.addEventListener("open",()=>ae(u)),l.addEventListener("message",d=>{K(u,"in",d.data),t.socketMessage(u,{direction:"IN",data:d.data,at:Date.now(),eventName:d.type,eventId:d.lastEventId||null})}),l.addEventListener("error",()=>{var c;if(l.readyState===s.CONNECTING){u.event.reconnectCount=((c=u.event.reconnectCount)!=null?c:0)+1,u.dirty=!0;return}let d=_chunkIZ7REN7Ejs.f.call(void 0, );X(u,u.opened&&d!=="OFFLINE"?"HTTP_ERROR":d),t.socketClosed(u)})},a=new Proxy(s,{construct(l,u,d){let c=null;try{c=ie(t,"SSE",u[0])}catch (e5){t.drop()}let h=c?[c.nativeUrl,...u.slice(1)]:u,y=Reflect.construct(l,h,d===a?l:d);return c&&i(y,c.connection),y}}),p=function(){r.call(this);let l=o.get(this);l&&(X(l,l.opened?"SUCCESS":"ABORTED"),t.socketClosed(l))};return e.EventSource=a,n.close=p,()=>{e.EventSource===a&&(e.EventSource=s),n.close===p&&(n.close=r)}};var ft=(t,e,s)=>{var u,d,c;let n=typeof Request!="undefined"&&e instanceof Request?e:null,r=_chunkIZ7REN7Ejs.c.call(void 0, n?n.url:String(e));if(!r)return null;let o=((d=(u=s==null?void 0:s.method)!=null?u:n==null?void 0:n.method)!=null?d:"GET").toUpperCase(),i=Date.now(),a=null,p=s;if(_chunkIZ7REN7Ejs.e.call(void 0, t,r)){a=_chunkUZZNGXXEjs.q.call(void 0, );let h=new Headers((c=s==null?void 0:s.headers)!=null?c:n==null?void 0:n.headers);h.set(_chunkUZZNGXXEjs.c,a),h.set(_chunkUZZNGXXEjs.d,t.sessionId()),p={...s,headers:h}}let l=_chunkIZ7REN7Ejs.h.call(void 0, t,"FETCH",o,r.href,i,a);return t.trackTiming(l.id,r.href,i),{event:l,init:p,startedAt:i}},gt=(t,e,s)=>{let{event:n}=e;if(n.durationMs=Date.now()-e.startedAt,n.status=s.status,n.outcome=_chunkIZ7REN7Ejs.g.call(void 0, s.status),n.instrumented||s.status<400){t.record(n);return}s.clone().text().then(r=>{n.responseBodyExcerpt=r.slice(0,_chunkIZ7REN7Ejs.b),t.record(n)},()=>t.record(n))},Oe=t=>{let e=window.fetch;if(typeof e!="function")return()=>{};let s=(n,r)=>{let o=null;try{o=ft(t,n,r)}catch (e6){t.drop()}let i=e.call(window,n,o?o.init:r);if(o){let a=o;i.then(p=>{try{gt(t,a,p)}catch (e7){t.drop()}},p=>{a.event.durationMs=Date.now()-a.startedAt,a.event.outcome=_chunkIZ7REN7Ejs.f.call(void 0, p),t.record(a.event)})}return i};return window.fetch=s,()=>{window.fetch===s&&(window.fetch=e)}};var Ce=t=>{let e=window.XMLHttpRequest;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.open,r=s.send,o=new WeakMap,i=function(l,u){try{o.set(this,{method:String(l).toUpperCase(),url:String(u)})}catch (e8){t.drop()}return n.apply(this,arguments)},a=(l,u,d)=>{let c=_chunkIZ7REN7Ejs.c.call(void 0, d);if(!c)return;let h=Date.now(),y=null;_chunkIZ7REN7Ejs.e.call(void 0, t,c)&&(y=_chunkUZZNGXXEjs.q.call(void 0, ),l.setRequestHeader(_chunkUZZNGXXEjs.c,y),l.setRequestHeader(_chunkUZZNGXXEjs.d,t.sessionId()));let m=_chunkIZ7REN7Ejs.h.call(void 0, t,"XHR",u,c.href,h,y);t.trackTiming(m.id,c.href,h);let E=null;l.addEventListener("error",()=>E=_chunkIZ7REN7Ejs.f.call(void 0, )),l.addEventListener("abort",()=>E="ABORTED"),l.addEventListener("timeout",()=>E="TIMEOUT"),l.addEventListener("loadend",()=>{m.durationMs=Date.now()-h,m.status=E===null&&l.status>0?l.status:null,m.outcome=m.status===null?E!=null?E:_chunkIZ7REN7Ejs.f.call(void 0, ):_chunkIZ7REN7Ejs.g.call(void 0, m.status),!m.instrumented&&m.status!==null&&m.status>=400&&(l.responseType===""||l.responseType==="text")&&(m.responseBodyExcerpt=l.responseText.slice(0,_chunkIZ7REN7Ejs.b)),t.record(m)})},p=function(l){let u=o.get(this);if(u)try{a(this,u.method,u.url)}catch (e9){t.drop()}return r.call(this,l)};return s.open=i,s.send=p,()=>{s.open===i&&(s.open=n),s.send===p&&(s.send=r)}};var V=class{constructor(e,s){this.max=e;this.drop=s;this.value=null;this.calls=null;this.failed=!1}get(){return this.value}hold(){!this.value&&!this.calls&&(this.calls=[])}run(e){if(this.value)try{e(this.value)}catch (e10){this.drop()}else this.calls&&this.calls.length<this.max?this.calls.push(e):(this.calls||this.failed)&&this.drop()}resolve(e){var n;let s=(n=this.calls)!=null?n:[];this.calls=null,this.value=e,s.forEach(r=>this.run(r))}fail(){var e;((e=this.calls)!=null?e:[]).forEach(()=>this.drop()),this.calls=null,this.failed=!0}close(){this.value=null,this.calls=null}};var vt={reload:"RELOAD",back_forward:"BACK_FORWARD"},De=()=>{try{return performance.getEntriesByType("navigation")[0]}catch (e11){return}},Me=t=>({dnsMs:t?_chunkUZZNGXXEjs.h.call(void 0, t.domainLookupStart,t.domainLookupEnd):null,tcpMs:t?_chunkUZZNGXXEjs.h.call(void 0, t.connectStart,t.connectEnd):null,tlsMs:t&&t.secureConnectionStart>0?_chunkUZZNGXXEjs.h.call(void 0, t.secureConnectionStart,t.connectEnd):null,requestMs:t?_chunkUZZNGXXEjs.h.call(void 0, t.requestStart,t.responseStart):null,responseMs:t?_chunkUZZNGXXEjs.h.call(void 0, t.responseStart,t.responseEnd):null,domProcessingMs:t?_chunkUZZNGXXEjs.h.call(void 0, t.responseEnd,t.domComplete):null,loadMs:t&&t.loadEventEnd>0?Math.round(t.loadEventEnd-t.startTime):null}),Pe=t=>{var h,y;let e=null,s=null,n=(m,E=null,Ye)=>{let pe=Date.now();return e={startedAt:pe,path:window.location.pathname,event:{id:_chunkUZZNGXXEjs.q.call(void 0, ),type:"pageView",route:t.resolveRoute(),referrerRoute:E,startedAt:_chunkUZZNGXXEjs.g.call(void 0, pe),durationMs:null,navigationType:m,lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null,dnsMs:null,tcpMs:null,tlsMs:null,requestMs:null,responseMs:null,domProcessingMs:null,loadMs:null,longTaskCount:0,longTaskTotalMs:0,...Ye}},t.record({...e.event}),e.event.id},r=()=>{e&&(e.event.durationMs=Date.now()-e.startedAt,t.record({...e.event}))},o=()=>{try{if(t.onNavigation(),e&&window.location.pathname!==e.path){let m=e.event.route;r(),n("SPA",m)}}catch (e12){t.drop()}},i=()=>{e&&e.event.id===s&&(Object.assign(e.event,Me(De())),t.record({...e.event}))},a=De(),p=document.readyState==="complete",l=(y=vt[(h=a==null?void 0:a.type)!=null?h:""])!=null?y:"NAVIGATE";s=n(l,null,p?Me(a):void 0);let u=[_chunkUZZNGXXEjs.j.call(void 0, window,"popstate",o)];if(!p){let m;u.push(_chunkUZZNGXXEjs.j.call(void 0, window,"load",()=>{m=setTimeout(i,0)}),()=>clearTimeout(m))}let d=window.history.pushState,c=function(...m){let E=d.apply(this,m);return o(),E};return window.history.pushState=c,u.push(()=>{window.history.pushState===c&&(window.history.pushState=d)}),{currentId:()=>{var m;return(m=e==null?void 0:e.event.id)!=null?m:null},start:m=>{n(m)},end:r,stop:()=>u.forEach(m=>m())}};var xe=t=>t.replace(/\/+$/,""),G=(t,e)=>`${t.proxyUrl?`${xe(t.proxyUrl)}/rum`:`${xe(t.apiUrl)}/api/rum`}/${encodeURIComponent(t.applicationId)}/${e}?token=${encodeURIComponent(t.token)}`;var Ve="abyss-rum-config",yt=600*1e3,_e=t=>typeof t=="number"&&t>=0&&t<=1?t:0,Fe=t=>{var n,r;let e=t;if(!e||typeof e.enabled!="boolean"||typeof e.sessionSampleRate!="number")return null;let s=(n=e.replay)!=null?n:{};return{enabled:e.enabled,sessionSampleRate:_e(e.sessionSampleRate),sessionQuotaExhausted:e.sessionQuotaExhausted===!0,country:typeof e.country=="string"?e.country:null,feedbackEnabled:e.feedbackEnabled===!0,replay:{enabled:s.enabled===!0,sampleRate:_e(s.sampleRate),unmaskSelectors:Array.isArray(s.unmaskSelectors)?s.unmaskSelectors.filter(o=>typeof o=="string"):[]},socketMessages:{enabled:((r=e.socketMessages)==null?void 0:r.enabled)===!0}}},Ne=(t,e)=>{let s=_chunkUZZNGXXEjs.n.call(void 0, Ve);if(!s||s.key!==t||typeof s.at!="number")return;let n=e-s.at;return n>=0&&n<yt?Fe(s.config):void 0},Le=async(t,e,s,n)=>{let r=null;try{let o=await e(t,{credentials:"omit"});r=o.ok?Fe(await o.json()):null}catch (e13){r=null}return _chunkUZZNGXXEjs.o.call(void 0, Ve,{key:s,at:n,config:r}),r};var Et=/iPad|Tablet|PlayBook|Silk|Android(?!.*Mobile)/i,St=/Mobi|iPhone|iPod|Android|Opera Mini|IEMobile/i,bt=[[/Edg(e|A|iOS)?\//,"Edge"],[/OPR\/|Opera/,"Opera"],[/SamsungBrowser\//,"Samsung Internet"],[/Firefox\/|FxiOS\//,"Firefox"],[/Chrome\/|CriOS\//,"Chrome"],[/Safari\//,"Safari"]],He=t=>Et.test(t)?"tablet":St.test(t)?"mobile":"desktop",Ue=t=>{var e,s;return(s=(e=bt.find(([n])=>n.test(t)))==null?void 0:e[1])!=null?s:"Other"},Be=(t,e,s,n)=>{if(!t)return s;try{let r=t({...e,attributes:{...e.attributes}});if(typeof(r==null?void 0:r.session)=="boolean"&&typeof r.replay=="boolean")return{session:r.session,replay:r.replay}}catch (e14){}return n(),s};var wt=200,It=(t,e,s)=>({session:t<e,replay:t<e*s}),qe=(t,e,s,n)=>{let r=It(t.random,t.sessionSampleRate,t.replaySampleRate),o=Be(e,t,r,n),i=o.session&&!s;return{session:i,replay:i&&o.replay}},kt=t=>t.type==="request"&&(t.kind==="FETCH"||t.kind==="XHR")&&t.outcome==="SUCCESS",$=class{constructor(e){this.onDrop=e;this.held=null;this.released=new Set;this.successes=new Map}accept(e,s){var r,o,i;if(s){if(kt(e)){let a=(r=e.pageViewId)!=null?r:"",p=((o=this.successes.get(a))!=null?o:0)+1;if(this.successes.set(a,p),p>wt)return this.onDrop(),[]}return[e]}if(e.type==="pageView")return this.released.has(e.id)?[e]:(this.held=e,[]);if(e.type!=="error")return[];let n=[];return e.pageViewId!==null&&!this.released.has(e.pageViewId)&&(this.released.add(e.pageViewId),((i=this.held)==null?void 0:i.id)===e.pageViewId&&(n.push(this.held),this.held=null)),n.push(e),n}reset(){this.held=null,this.released.clear(),this.successes.clear()}};var ue="abyss-rum-session",At=1800*1e3,Tt=14400*1e3,de=(t,e)=>e-t.lastActivityAt>=At||e-t.startedAt>=Tt,Ot=t=>typeof(t==null?void 0:t.session)=="boolean"&&typeof t.replay=="boolean",Ct=()=>{let t=_chunkUZZNGXXEjs.n.call(void 0, ue);return!t||!_chunkUZZNGXXEjs.a.call(void 0, t.id)||typeof t.startedAt!="number"||typeof t.lastActivityAt!="number"||typeof t.random!="number"?null:{id:t.id,startedAt:t.startedAt,lastActivityAt:t.lastActivityAt,random:t.random,decision:Ot(t.decision)?t.decision:null,entryPath:typeof t.entryPath=="string"?t.entryPath:null,cut:t.cut===!0}},M=t=>_chunkUZZNGXXEjs.o.call(void 0, ue,t),We=()=>_chunkUZZNGXXEjs.p.call(void 0, ue),le=t=>{let e={id:_chunkUZZNGXXEjs.q.call(void 0, ),startedAt:t,lastActivityAt:t,random:Math.random(),decision:null,entryPath:null,cut:!1};return M(e),e},je=t=>{let e=Ct();return e&&!de(e,t)?e:le(t)};var Ke=64*1024,Dt=60*1e3;var Y=class{constructor(e,s,n){this.url=e;this.fetchImpl=s;this.handlers=n;this.pausedUntil=0}isPaused(e){return e<this.pausedUntil}send(e,s,n){let r=JSON.stringify({...e,events:[]}).slice(0,-2),o=_chunkUZZNGXXEjs.k.call(void 0, r)+2,i=[],a=[],p=o;for(let l of s){let u=JSON.stringify(l),d=_chunkUZZNGXXEjs.k.call(void 0, u);if(o+d>Ke){this.handlers.onDrop(1);continue}let c=d+(i.length>0?1:0);p+c>Ke&&(this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId),i=[],a=[],p=o),p+=d+(i.length>0?1:0),i.push(u),a.push(l)}i.length>0&&this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId)}post(e,s,n,r){let o=i=>this.handlers.onResult(s,i,r);if(n&&this.beacon(e)){o("OK");return}this.fetchImpl(this.url,{method:"POST",body:e,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(i=>this.handle(i,o),()=>o("FAIL")).catch(()=>this.handlers.onDrop(1))}beacon(e){try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.url,e)}catch (e15){return!1}}async handle(e,s){if(e.status===429){this.pausedUntil=Date.now()+Dt,s("RETRY");return}if(e.status===401||e.status===403||e.status===404){s("CUT");return}if(!e.ok){s("FAIL");return}s("OK");let n=!1;try{n=(await e.json()).liveWatched===!0}catch (e16){}this.handlers.onLiveWatched(n)}};var Mt=5e3,Pt=50,Xe=200,xt=50,_t=100,Vt=200,Q=class{constructor(e,s){this.options=e;this.shared=s;this.config=null;this.ready=!1;this.stopped=!1;this.flushing=!1;this.pending=[];this.queue=[];this.teardowns=[];this.pageViews=null;this.lastPageViewId=null;this.deferred=new V(_t,()=>this.drop());this.sockets=new V(Vt,()=>this.drop());this.errors=new j({pageViewId:()=>this.pageViewId(),resolveRoute:()=>this.resolveRoute(),record:e=>this.record(e),drop:()=>this.drop(),captured:()=>{var s;let e=Date.now();(s=this.deferred.get())==null||s.frustration.notifyError(),this.sockets.run(n=>n.anomaly(e))}});this.connections=new Set;this.timings=new Map;this.sessionDirty=!0;this.closed=!1;this.liveWatched=!1;this.drop=()=>{this.shared.dropped+=1};this.pageViewId=()=>{var e,s;return(s=(e=this.pageViews)==null?void 0:e.currentId())!=null?s:null};var r;let n=window.fetch;this.nativeFetch=(o,i)=>n.call(window,o,i),this.instrumentedOrigins=((r=e.instrumentedOrigins)!=null?r:[]).map(o=>_chunkIZ7REN7Ejs.d.call(void 0, String(o))).filter(o=>o!==null),this.filter=new $(this.drop),this.transport=new Y(G(e,"batch"),this.nativeFetch,{onResult:(o,i,a)=>this.guard(()=>this.onResult(o,i,a)),onLiveWatched:o=>{this.liveWatched=o},onDrop:o=>{this.shared.dropped+=o}}),this.session=je(Date.now()),this.deferred.hold()}start(){if(this.session.cut){this.stopped=!0;return}let e=Date.now(),s=`${this.options.applicationId}:${this.options.token}`,n=Ne(s,e);if(n!==void 0){this.configure(n);return}Le(G(this.options,"config"),this.nativeFetch,s,e).then(r=>this.guard(()=>this.configure(r)),this.drop)}stop(){this.shutdown(),We()}captureError(e,s){this.errors.capture(e,s)}addAction(e,s){let n=we(e,s,this.pageViewId(),this.drop);n&&this.record(n)}addTiming(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.addTiming(e,s))}startDuration(e,s){let n=Date.now();this.deferred.run(r=>r.perf.timings.startDuration(e,s,n))}stopDuration(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.stopDuration(e,s))}sendFeedback(e){let s=this.feedbackState();return s!==null?Promise.reject(new (0, _chunkLRYKS5XRjs.b)(s)):this.feedback((n,r)=>n.sendFeedback(r,e))}showReportDialog(e){this.feedbackState()===null&&this.feedback((s,n)=>s.showReportDialog(n,e!=null?e:{})).catch(this.drop)}markDirty(){this.sessionDirty=!0}replayState(){var s,n,r,o;let e=!1;try{e=((n=(s=this.options).consent)==null?void 0:n.call(s).analytics)===!0}catch (e17){this.drop()}return{record:this.ready&&((r=this.session.decision)==null?void 0:r.replay)===!0&&((o=this.config)==null?void 0:o.replay.enabled)===!0&&e,liveWatched:this.liveWatched}}guard(e){try{e()}catch (e18){this.drop()}}load(e,s){e.catch(()=>{this.drop(),s()})}feedback(e){return Promise.resolve().then(() => _interopRequireWildcard(require("./send-67SJQRSY.js"))).then(s=>e(s,this.feedbackHost()),()=>{throw new (0, _chunkLRYKS5XRjs.b)("SEND_FAILED")})}feedbackState(){var e;return!this.ready||this.stopped?"NO_SESSION":((e=this.config)==null?void 0:e.feedbackEnabled)===!0?null:"FEEDBACK_DISABLED"}feedbackHost(){return{unavailable:()=>this.feedbackState(),sessionId:()=>this.session.id,sessionStartedAt:()=>this.session.startedAt,pageViewId:this.pageViewId,resolveRoute:()=>this.resolveRoute(),prepare:e=>{let s=te(e,this.options.beforeSend,this.drop);return s&&ne(s)},post:e=>(this.flush(!1),this.nativeFetch(G(this.options,"feedback"),{method:"POST",body:JSON.stringify({...this.header(),events:[e]}),keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(s=>s.status)),sent:e=>this.guard(()=>{var s,n;return(n=(s=this.options).onFeedbackSent)==null?void 0:n.call(s,e)})}}loadDeferred(e){this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./deferred-PTNDFC5D.js"))).then(({installDeferred:s})=>this.guard(()=>{if(this.stopped)return;let n=s({instrument:e,resolveRoute:()=>this.resolveRoute(),captureConsole:this.options.captureConsole!==!1,describe:re});this.teardowns.push(n.teardown),this.deferred.resolve(n)})),()=>this.deferred.fail())}loadSocketCapture(e){var n;let s=this.options.captureSocketMessages;!s||!e.socketMessages.enabled||((n=this.session.decision)==null?void 0:n.session)!==!0||(this.sockets.hold(),this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./socket-messages-WSFNWWG4.js"))).then(({SocketMessageCapture:r})=>this.guard(()=>{this.stopped||this.sockets.resolve(new r(s,{sessionId:()=>this.session.id,record:o=>this.record(o),drop:this.drop}))})),()=>this.sockets.fail()))}onPageView(e){var s,n;this.shared.featureFlags.annotate(e),(s=this.deferred.get())==null||s.perf.annotate(e),this.record(e),e.id!==this.lastPageViewId&&(this.lastPageViewId=e.id,(n=this.deferred.get())==null||n.frustration.notifyActivity()),this.deferred.run(r=>r.perf.pageViewSent(e))}configure(e){if(this.stopped)return;if(!e||!e.enabled){this.shutdown();return}this.config=e,this.session.decision||this.decide(),this.ready=!0,this.install(),this.loadSocketCapture(e);let s=this.pending;this.pending=[];let n=this.pageViewId();for(let r of s)(r.type==="error"||r.type==="action")&&r.pageViewId===null&&(r.pageViewId=n),this.record(r)}decide(){let e=this.config,s=navigator.userAgent;this.session.decision=qe({route:x(this.resolveRoute()),deviceType:He(s),browserFamily:Ue(s),country:e.country,attributes:{...this.shared.attributes},random:this.session.random,sessionSampleRate:e.sessionSampleRate,replaySampleRate:e.replay.sampleRate},this.options.sampler,e.sessionQuotaExhausted,this.drop),M(this.session)}install(){let e={instrumentedOrigins:this.instrumentedOrigins,sessionId:()=>this.session.id,pageViewId:this.pageViewId,record:r=>this.record(r),drop:this.drop,trackTiming:(r,o,i)=>{var a;this.timings.set(r,{url:o,startedAt:i}),(a=this.deferred.get())==null||a.frustration.notifyActivity()},trackConnection:r=>this.connections.add(r),socketMessage:(r,o)=>this.sockets.run(i=>i.message(r,o)),socketClosed:r=>{let o=Date.now();this.sockets.run(i=>i.closed(r,o))}};this.pageViews=Pe({resolveRoute:()=>this.resolveRoute(),record:r=>this.onPageView(r),onNavigation:()=>this.touch(),drop:this.drop});let s=setInterval(()=>this.guard(()=>this.flush(!1)),Mt),n=()=>this.guard(()=>this.touch());this.teardowns=[this.pageViews.stop,()=>clearInterval(s),Oe(e),Ce(e),Ae(e),Te(e),_chunkUZZNGXXEjs.j.call(void 0, window,"click",n,!0),_chunkUZZNGXXEjs.j.call(void 0, window,"keydown",n,!0),this.errors.install(),_chunkUZZNGXXEjs.j.call(void 0, window,"pagehide",()=>this.guard(()=>this.onPageHide())),_chunkUZZNGXXEjs.j.call(void 0, window,"pageshow",r=>this.guard(()=>{var o;r.persisted&&(this.closed=!1,this.sessionDirty=!0,(o=this.pageViews)==null||o.start("BACK_FORWARD"))})),_chunkUZZNGXXEjs.j.call(void 0, document,"visibilitychange",()=>this.guard(()=>{var r;document.visibilityState==="hidden"&&((r=this.deferred.get())==null||r.perf.hidden(),this.flush(!0))}))],this.loadDeferred(e)}shutdown(){this.stopped=!0,this.ready=!1;let e=this.teardowns;this.teardowns=[],e.reverse().forEach(s=>this.guard(s)),this.deferred.close(),this.sockets.close(),this.pending=[],this.queue=[],this.connections.clear(),this.timings.clear()}resolveRoute(){let{routeResolver:e}=this.options;if(e)try{return String(e(window.location))}catch (e19){this.drop()}return window.location.pathname}touch(){var s,n;if(!this.ready)return;let e=Date.now();if(!de(this.session,e)){this.session.lastActivityAt=e,M(this.session);return}(s=this.pageViews)==null||s.end(),this.flush(!1),this.shared.dropped+=this.queue.length,this.queue=[],this.session=le(e),this.decide(),this.filter.reset(),this.sessionDirty=!0,this.closed=!1,(n=this.pageViews)==null||n.start("SPA")}onPageHide(){var e;(e=this.pageViews)==null||e.end();for(let s of this.connections)s.done||(s.event.durationMs=Date.now()-s.startedAt,s.done=!0,s.dirty=!0);this.closed=!0,this.sessionDirty=!0,this.flush(!0)}record(e){var s,n;try{if(this.stopped)return;if(this.errors.observe(e),!this.ready){this.pending.length<xt?this.pending.push(e):this.drop();return}(s=this.sockets.get())==null||s.observe(e);let r=((n=this.session.decision)==null?void 0:n.session)===!0;if(!r&&e.type!=="error"&&e.type!=="pageView")return;let o=te(e,this.options.beforeSend,this.drop);if(!o)return;ne(o),o.type==="pageView"&&this.session.entryPath===null&&(this.session.entryPath=o.route,M(this.session));for(let i of this.filter.accept(o,r))this.enqueue(i)}catch (e20){this.drop()}}enqueue(e){if(this.queue.length>=Xe){this.drop();return}this.queue.push(e),this.queue.length>=Pt&&!this.flushing&&this.flush(!1)}flush(e){var s,n;if(!(!this.ready||this.flushing||this.transport.isPaused(Date.now()))){this.flushing=!0;try{for(let p of this.connections)p.dirty&&(p.dirty=!1,this.record({...p.event})),p.done&&this.connections.delete(p);let r=this.queue;this.queue=[],this.fillTimings(r);let o=((s=this.session.decision)==null?void 0:s.session)===!0;if(r.length===0&&!(o&&this.sessionDirty))return;let a=this.sessionDirty||this.shared.dropped>0?{id:this.session.id,type:"session",entryPath:(n=this.session.entryPath)!=null?n:"/",sampled:o,closed:this.closed,droppedEvents:this.shared.dropped}:null;this.shared.dropped=0,this.sessionDirty=!1,this.transport.send(this.header(),a?[a,...r]:r,e)}finally{this.flushing=!1}}}header(){let e={sessionId:this.session.id,sessionStartedAt:_chunkUZZNGXXEjs.g.call(void 0, this.session.startedAt)};return this.options.release&&(e.release=this.options.release),this.shared.actor!==void 0&&(e.actor=this.shared.actor),this.shared.attributesSet&&(e.attributes={...this.shared.attributes}),this.shared.featureFlags.hasAny()&&(e.featureFlags={...this.shared.featureFlags.session}),e}fillTimings(e){for(let s of e){let n=this.timings.get(s.id);n&&(this.timings.delete(s.id),Object.assign(s,_chunkIZ7REN7Ejs.i.call(void 0, n.url,n.startedAt)))}}onResult(e,s,n){if(s==="OK")return;if(s==="CUT"){this.session.cut=!0,M(this.session),this.shutdown();return}let r=e.filter(i=>i.type!=="session"),o=e.find(i=>i.type==="session");if(o&&(this.shared.dropped+=o.droppedEvents,this.sessionDirty=!0),s==="RETRY"&&n===this.session.id){let i=r.slice(0,Math.max(0,Xe-this.queue.length));this.shared.dropped+=r.length-i.length,this.queue=[...i,...this.queue];return}this.shared.dropped+=r.length}},Ge=null,f={actor:void 0,attributes:{},attributesSet:!1,dropped:0,featureFlags:new D},v=()=>Ge,ce=t=>{Ge=t};var $e=(s=>(s.ALL="ALL",s.ON_ANOMALY="ON_ANOMALY",s))($e||{});var S=t=>{try{t()}catch (e21){f.dropped+=1}},yn= exports.AbyssRum ={init(t){S(()=>{if(v()||!(t!=null&&t.token)||!t.applicationId||!t.apiUrl&&!t.proxyUrl||typeof window=="undefined"||typeof window.fetch!="function")return;let e=new Q(t,f);ce(e),e.start()})},setActor(t){S(()=>{var s;let e=Se(t);if(e===void 0){f.dropped+=1;return}f.actor=e,(s=v())==null||s.markDirty()})},setAttributes(t){S(()=>{var e;f.attributes=_chunkIZ7REN7Ejs.a.call(void 0, f.attributes,t,()=>{f.dropped+=1}),f.attributesSet=!0,(e=v())==null||e.markDirty()})},captureError(t,e){S(()=>{var s;return(s=v())==null?void 0:s.captureError(t,e)})},addAction(t,e){S(()=>{var s;return(s=v())==null?void 0:s.addAction(t,e)})},addFeatureFlagEvaluation(t,e){S(()=>{var s;f.featureFlags.add(t,e,()=>f.dropped+=1)&&((s=v())==null||s.markDirty())})},sendFeedback(t){var e,s;return(s=(e=v())==null?void 0:e.sendFeedback(t))!=null?s:Promise.reject(new (0, _chunkLRYKS5XRjs.b)("NO_SESSION"))},showReportDialog(t){S(()=>{var e;return(e=v())==null?void 0:e.showReportDialog(t)})},addTiming(t){S(()=>{var e;return(e=v())==null?void 0:e.addTiming(t)})},startDuration(t,e){S(()=>{var s;return(s=v())==null?void 0:s.startDuration(t,e)})},stopDuration(t){S(()=>{var e;return(e=v())==null?void 0:e.stopDuration(t)})},stop(){S(()=>{var t;(t=v())==null||t.stop(),ce(null),f.actor=void 0,f.attributes={},f.attributesSet=!1,f.dropped=0,f.featureFlags=new D})}};exports.AbyssRum = yn; exports.RumFeedbackError = _chunkLRYKS5XRjs.b; exports.RumFeedbackErrorCode = _chunkLRYKS5XRjs.a; exports.RumSocketCaptureMode = $e;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkLRYKS5XRjs = require('./chunk-LRYKS5XR.js');var _chunkTJIA62OAjs = require('./chunk-TJIA62OA.js');var _chunk2TDEJLQ7js = require('./chunk-2TDEJLQ7.js');var _chunkKD6VO7IKjs = require('./chunk-KD6VO7IK.js');var Se=t=>t===null?null:typeof t=="string"&&t.trim()!==""?t:void 0;var be=50,D=class{constructor(){this.session={};this.pageViewId=null;this.page={}}add(e,s,n){if(s==null)return n(),!1;let r=!1,o=()=>{r=!0,n()},i={[String(e)]:s};return this.session=_chunkTJIA62OAjs.a.call(void 0, this.session,i,o,be),r||(this.page=_chunkTJIA62OAjs.a.call(void 0, this.page,i,o,be)),!r}hasAny(){return Object.keys(this.session).length>0}annotate(e){e.id!==this.pageViewId&&(this.pageViewId!==null&&(this.page={}),this.pageViewId=e.id),Object.keys(this.page).length>0&&(e.featureFlags={...this.page})}};var ze=64,we=(t,e,s,n)=>{if(typeof t!="string"||t.length===0||t.length>ze)return n(),null;let r={id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"action",pageViewId:s,occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now()),name:t};if(e!==void 0){let o=_chunkTJIA62OAjs.a.call(void 0, {},e,n);Object.keys(o).length>0&&(r.attributes=o)}return r};var Je=["id","type","sessionId"],Ze=(t,e)=>t==null?e==null||["string","number","boolean"].includes(typeof e):Array.isArray(t)?Array.isArray(e):e!==null&&typeof e==typeof t,te=(t,e,s)=>{if(!e)return t;let n;try{n=e(JSON.parse(JSON.stringify(t)))}catch (e2){return s(),t}if(n===null)return null;if(!n||typeof n!="object"||Array.isArray(n))return s(),null;let r=t,o=n,i={};for(let a of Object.keys(r))if(Je.includes(a))i[a]=r[a];else if(Ze(r[a],o[a]))o[a]!==void 0&&(i[a]=o[a]);else return s(),null;return i};var et=/^([a-z][a-z0-9+.-]*:)\/\//i,tt=["url","blockedUri","sourceFile"],st=["route","referrerRoute","entryPath"],se=t=>{let{host:e,path:s}=_chunkKD6VO7IKjs.d.call(void 0, t);if(e===null)return s;let n=et.exec(t.trim());return`${n?n[1].toLowerCase():"https:"}//${e}${s}`},x=t=>_chunkKD6VO7IKjs.d.call(void 0, t).path,ne=t=>{let e=t;for(let s of tt)typeof e[s]=="string"&&(e[s]=se(e[s]));for(let s of st)typeof e[s]=="string"&&(e[s]=x(e[s]));return t};var nt=20,rt=256,ke='[data-abyss-privacy="hidden"]',ot=`${ke},[data-testid],[aria-label],button,a,input,select,textarea,summary,[role="button"],[role="link"]`,Ie=(t,e)=>{let s=t.getAttribute(e);return s===null?null:s.slice(0,rt)},re=t=>{var s,n;let e=(n=((s=t.closest(ke))!=null?s:t).closest(ot))!=null?n:t;return{tag:e.tagName.toLowerCase().slice(0,64),testId:Ie(e,"data-testid"),ariaLabel:Ie(e,"aria-label")}},q=class{constructor(){this.items=[];this.lastPageViewId=null}observe(e){e.type==="pageView"&&e.id!==this.lastPageViewId?(this.lastPageViewId=e.id,this.add({kind:"NAVIGATION",route:x(e.route)})):e.type==="request"&&e.kind!=="WEBSOCKET"&&e.kind!=="SSE"&&this.add({kind:"REQUEST",method:e.method,url:se(e.url),status:e.status})}click(e){e instanceof Element&&this.add({kind:"CLICK",element:re(e)})}snapshot(){return this.items.map(e=>({...e}))}add(e){this.items.push({...e,occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now())}),this.items.length>nt&&this.items.shift()}};var it=/^\s*at\s|@\S+:\d+/,at=t=>{var e,s;return(s=(e=(t!=null?t:"").split(`
2
+ `).find(n=>it.test(n)))==null?void 0:e.trim())!=null?s:""},W=class{constructor(e){this.release=e;this.held=new Map}add(e){var r;let s=`${(r=e.pageViewId)!=null?r:""}${e.message}${at(e.stack)}`,n=this.held.get(s);if(n){n.event.repeat+=1;return}this.held.set(s,{event:e,timer:setTimeout(()=>this.releaseKey(s),1e4)})}flush(){[...this.held.keys()].forEach(e=>this.releaseKey(e))}clear(){this.held.forEach(e=>clearTimeout(e.timer)),this.held.clear()}releaseKey(e){let s=this.held.get(e);s&&(clearTimeout(s.timer),this.held.delete(e),this.release(s.event))}};var ut=/^ResizeObserver loop/,dt=/^Script error\.?$/,lt=t=>{let e=t;return e&&typeof e=="object"&&typeof e.message=="string"?{name:typeof e.name=="string"&&e.name?e.name:"Error",message:e.message,stack:typeof e.stack=="string"?e.stack:null}:{name:"Error",message:_chunk2TDEJLQ7js.c.call(void 0, t),stack:null}},ct=t=>{if(!t||typeof t!="object")return;let e=Object.entries(t).filter(([,s])=>typeof s=="string");return e.length>0?Object.fromEntries(e):void 0},pt=t=>ut.test(t.message)||dt.test(t.message)&&!t.stack,j=class{constructor(e){this.host=e;this.breadcrumbs=new q;this.pageViewId=null;this.dedup=new W(s=>e.record(s))}capture(e,s){let n=lt(e);if(pt(n)){this.host.drop();return}this.host.captured();let r=ct(s);this.dedup.add({id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"error",pageViewId:this.host.pageViewId(),occurredAt:_chunk2TDEJLQ7js.a.call(void 0, Date.now()),route:this.host.resolveRoute(),...n,breadcrumbs:this.breadcrumbs.snapshot(),repeat:1,...r?{context:r}:{}})}observe(e){this.breadcrumbs.observe(e),e.type==="pageView"&&e.id!==this.pageViewId&&(this.pageViewId!==null&&this.dedup.flush(),this.pageViewId=e.id)}install(){let e=n=>()=>{try{n()}catch (e3){this.host.drop()}},s=[_chunk2TDEJLQ7js.d.call(void 0, window,"error",n=>{n.target instanceof Element||e(()=>{var r;return this.capture((r=n.error)!=null?r:n.message)})()}),_chunk2TDEJLQ7js.d.call(void 0, window,"unhandledrejection",n=>e(()=>this.capture(n.reason))()),_chunk2TDEJLQ7js.d.call(void 0, window,"click",n=>e(()=>this.breadcrumbs.click(n.target))(),!0),_chunk2TDEJLQ7js.d.call(void 0, window,"pagehide",e(()=>this.dedup.flush())),_chunk2TDEJLQ7js.d.call(void 0, document,"visibilitychange",e(()=>{document.visibilityState==="hidden"&&this.dedup.flush()}))];return()=>{s.forEach(n=>n()),this.dedup.clear()}}};var ht=123,ie=(t,e,s)=>{let n=_chunkTJIA62OAjs.c.call(void 0, String(s));if(!n)return null;let r=n.href,o=null;_chunkTJIA62OAjs.e.call(void 0, t,n)&&(o=_chunk2TDEJLQ7js.k.call(void 0, ),n.searchParams.set(_chunkKD6VO7IKjs.g,o),n.searchParams.set(_chunkKD6VO7IKjs.h,t.sessionId()));let i=Date.now(),a=_chunkTJIA62OAjs.h.call(void 0, t,e,"GET",r,i,o);Object.assign(a,{connectMs:null,messagesIn:0,messagesOut:0,bytesIn:0,bytesOut:0,droppedMessages:0});let p={event:a,startedAt:i,opened:!1,dirty:!0,done:!1};return t.trackConnection(p),{connection:p,nativeUrl:o===null?String(s):n.href}},ae=t=>{t.opened||(t.opened=!0,t.event.connectMs=Date.now()-t.startedAt,t.dirty=!0)},K=(t,e,s)=>{var r,o,i,a;let{event:n}=t;e==="in"?(n.messagesIn=((r=n.messagesIn)!=null?r:0)+1,n.bytesIn=((o=n.bytesIn)!=null?o:0)+_chunk2TDEJLQ7js.g.call(void 0, s)):(n.messagesOut=((i=n.messagesOut)!=null?i:0)+1,n.bytesOut=((a=n.bytesOut)!=null?a:0)+_chunk2TDEJLQ7js.g.call(void 0, s)),t.dirty=!0},X=(t,e)=>{t.done||(t.event.durationMs=Date.now()-t.startedAt,t.event.outcome=e,t.done=!0,t.dirty=!0)},Ae=(t,e)=>({direction:t,data:e,at:Date.now(),eventName:null,eventId:null}),ft=(t,e,s,n)=>{if(s)return"ABORTED";if(t&&(e===1e3||e===1001||n&&e===1005))return"SUCCESS";let r=_chunkTJIA62OAjs.f.call(void 0, );return r==="OFFLINE"||!t?r:"HTTP_ERROR"},Te=t=>{let e=window.WebSocket;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.send,r=s.close,o=new WeakMap,i=(u,d)=>{o.set(u,d),u.addEventListener("open",()=>ae(d)),u.addEventListener("message",c=>{K(d,"in",c.data),t.socketMessage(d,Ae("IN",c.data))}),u.addEventListener("close",c=>{let h=o.get(u);d.event.closeCode=c.code,d.event.closeReason=c.reason?_chunk2TDEJLQ7js.f.call(void 0, c.reason,ht):null,X(d,ft(d.opened,c.code,(h==null?void 0:h.abortedByApp)===!0,(h==null?void 0:h.closedByApp)===!0)),t.socketClosed(d)})},a=new Proxy(e,{construct(u,d,c){let h=null;try{h=ie(t,"WEBSOCKET",d[0])}catch (e4){t.drop()}let y=h?[h.nativeUrl,...d.slice(1)]:d,m=Reflect.construct(u,y,c===a?u:c);return h&&i(m,h.connection),m}}),p=function(u){n.call(this,u);let d=o.get(this);d&&(K(d,"out",u),t.socketMessage(d,Ae("OUT",u)))},l=function(u,d){let c=o.get(this);return c&&(c.abortedByApp=this.readyState===e.CONNECTING,c.closedByApp=!0),r.apply(this,arguments)};return window.WebSocket=a,s.send=p,s.close=l,()=>{window.WebSocket===a&&(window.WebSocket=e),s.send===p&&(s.send=n),s.close===l&&(s.close=r)}};var Oe=t=>{let e=window,s=e.EventSource;if(typeof s!="function")return()=>{};let n=s.prototype,r=n.close,o=new WeakMap,i=(l,u)=>{o.set(l,u),u.event.reconnectCount=0,l.addEventListener("open",()=>ae(u)),l.addEventListener("message",d=>{K(u,"in",d.data),t.socketMessage(u,{direction:"IN",data:d.data,at:Date.now(),eventName:d.type,eventId:d.lastEventId||null})}),l.addEventListener("error",()=>{var c;if(l.readyState===s.CONNECTING){u.event.reconnectCount=((c=u.event.reconnectCount)!=null?c:0)+1,u.dirty=!0;return}let d=_chunkTJIA62OAjs.f.call(void 0, );X(u,u.opened&&d!=="OFFLINE"?"HTTP_ERROR":d),t.socketClosed(u)})},a=new Proxy(s,{construct(l,u,d){let c=null;try{c=ie(t,"SSE",u[0])}catch (e5){t.drop()}let h=c?[c.nativeUrl,...u.slice(1)]:u,y=Reflect.construct(l,h,d===a?l:d);return c&&i(y,c.connection),y}}),p=function(){r.call(this);let l=o.get(this);l&&(X(l,l.opened?"SUCCESS":"ABORTED"),t.socketClosed(l))};return e.EventSource=a,n.close=p,()=>{e.EventSource===a&&(e.EventSource=s),n.close===p&&(n.close=r)}};var gt=(t,e,s)=>{var u,d,c;let n=typeof Request!="undefined"&&e instanceof Request?e:null,r=_chunkTJIA62OAjs.c.call(void 0, n?n.url:String(e));if(!r)return null;let o=((d=(u=s==null?void 0:s.method)!=null?u:n==null?void 0:n.method)!=null?d:"GET").toUpperCase(),i=Date.now(),a=null,p=s;if(_chunkTJIA62OAjs.e.call(void 0, t,r)){a=_chunk2TDEJLQ7js.k.call(void 0, );let h=new Headers((c=s==null?void 0:s.headers)!=null?c:n==null?void 0:n.headers);h.set(_chunkKD6VO7IKjs.e,a),h.set(_chunkKD6VO7IKjs.f,t.sessionId()),p={...s,headers:h}}let l=_chunkTJIA62OAjs.h.call(void 0, t,"FETCH",o,r.href,i,a);return t.trackTiming(l.id,r.href,i),{event:l,init:p,startedAt:i}},Rt=(t,e,s)=>{let{event:n}=e;if(n.durationMs=Date.now()-e.startedAt,n.status=s.status,n.outcome=_chunkTJIA62OAjs.g.call(void 0, s.status),n.instrumented||s.status<400){t.record(n);return}s.clone().text().then(r=>{n.responseBodyExcerpt=r.slice(0,_chunkTJIA62OAjs.b),t.record(n)},()=>t.record(n))},Ce=t=>{let e=window.fetch;if(typeof e!="function")return()=>{};let s=(n,r)=>{let o=null;try{o=gt(t,n,r)}catch (e6){t.drop()}let i=e.call(window,n,o?o.init:r);if(o){let a=o;i.then(p=>{try{Rt(t,a,p)}catch (e7){t.drop()}},p=>{a.event.durationMs=Date.now()-a.startedAt,a.event.outcome=_chunkTJIA62OAjs.f.call(void 0, p),t.record(a.event)})}return i};return window.fetch=s,()=>{window.fetch===s&&(window.fetch=e)}};var De=t=>{let e=window.XMLHttpRequest;if(typeof e!="function")return()=>{};let s=e.prototype,n=s.open,r=s.send,o=new WeakMap,i=function(l,u){try{o.set(this,{method:String(l).toUpperCase(),url:String(u)})}catch (e8){t.drop()}return n.apply(this,arguments)},a=(l,u,d)=>{let c=_chunkTJIA62OAjs.c.call(void 0, d);if(!c)return;let h=Date.now(),y=null;_chunkTJIA62OAjs.e.call(void 0, t,c)&&(y=_chunk2TDEJLQ7js.k.call(void 0, ),l.setRequestHeader(_chunkKD6VO7IKjs.e,y),l.setRequestHeader(_chunkKD6VO7IKjs.f,t.sessionId()));let m=_chunkTJIA62OAjs.h.call(void 0, t,"XHR",u,c.href,h,y);t.trackTiming(m.id,c.href,h);let E=null;l.addEventListener("error",()=>E=_chunkTJIA62OAjs.f.call(void 0, )),l.addEventListener("abort",()=>E="ABORTED"),l.addEventListener("timeout",()=>E="TIMEOUT"),l.addEventListener("loadend",()=>{m.durationMs=Date.now()-h,m.status=E===null&&l.status>0?l.status:null,m.outcome=m.status===null?E!=null?E:_chunkTJIA62OAjs.f.call(void 0, ):_chunkTJIA62OAjs.g.call(void 0, m.status),!m.instrumented&&m.status!==null&&m.status>=400&&(l.responseType===""||l.responseType==="text")&&(m.responseBodyExcerpt=l.responseText.slice(0,_chunkTJIA62OAjs.b)),t.record(m)})},p=function(l){let u=o.get(this);if(u)try{a(this,u.method,u.url)}catch (e9){t.drop()}return r.call(this,l)};return s.open=i,s.send=p,()=>{s.open===i&&(s.open=n),s.send===p&&(s.send=r)}};var V=class{constructor(e,s){this.max=e;this.drop=s;this.value=null;this.calls=null;this.failed=!1}get(){return this.value}hold(){!this.value&&!this.calls&&(this.calls=[])}run(e){if(this.value)try{e(this.value)}catch (e10){this.drop()}else this.calls&&this.calls.length<this.max?this.calls.push(e):(this.calls||this.failed)&&this.drop()}resolve(e){var n;let s=(n=this.calls)!=null?n:[];this.calls=null,this.value=e,s.forEach(r=>this.run(r))}fail(){var e;((e=this.calls)!=null?e:[]).forEach(()=>this.drop()),this.calls=null,this.failed=!0}close(){this.value=null,this.calls=null}};var yt={reload:"RELOAD",back_forward:"BACK_FORWARD"},Me=()=>{try{return performance.getEntriesByType("navigation")[0]}catch (e11){return}},Pe=t=>({dnsMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.domainLookupStart,t.domainLookupEnd):null,tcpMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.connectStart,t.connectEnd):null,tlsMs:t&&t.secureConnectionStart>0?_chunk2TDEJLQ7js.b.call(void 0, t.secureConnectionStart,t.connectEnd):null,requestMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.requestStart,t.responseStart):null,responseMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.responseStart,t.responseEnd):null,domProcessingMs:t?_chunk2TDEJLQ7js.b.call(void 0, t.responseEnd,t.domComplete):null,loadMs:t&&t.loadEventEnd>0?Math.round(t.loadEventEnd-t.startTime):null}),xe=t=>{var h,y;let e=null,s=null,n=(m,E=null,Qe)=>{let pe=Date.now();return e={startedAt:pe,path:window.location.pathname,event:{id:_chunk2TDEJLQ7js.k.call(void 0, ),type:"pageView",route:t.resolveRoute(),referrerRoute:E,startedAt:_chunk2TDEJLQ7js.a.call(void 0, pe),durationMs:null,navigationType:m,lcpMs:null,inpMs:null,cls:null,fcpMs:null,ttfbMs:null,dnsMs:null,tcpMs:null,tlsMs:null,requestMs:null,responseMs:null,domProcessingMs:null,loadMs:null,longTaskCount:0,longTaskTotalMs:0,...Qe}},t.record({...e.event}),e.event.id},r=()=>{e&&(e.event.durationMs=Date.now()-e.startedAt,t.record({...e.event}))},o=()=>{try{if(t.onNavigation(),e&&window.location.pathname!==e.path){let m=e.event.route;r(),n("SPA",m)}}catch (e12){t.drop()}},i=()=>{e&&e.event.id===s&&(Object.assign(e.event,Pe(Me())),t.record({...e.event}))},a=Me(),p=document.readyState==="complete",l=(y=yt[(h=a==null?void 0:a.type)!=null?h:""])!=null?y:"NAVIGATE";s=n(l,null,p?Pe(a):void 0);let u=[_chunk2TDEJLQ7js.d.call(void 0, window,"popstate",o)];if(!p){let m;u.push(_chunk2TDEJLQ7js.d.call(void 0, window,"load",()=>{m=setTimeout(i,0)}),()=>clearTimeout(m))}let d=window.history.pushState,c=function(...m){let E=d.apply(this,m);return o(),E};return window.history.pushState=c,u.push(()=>{window.history.pushState===c&&(window.history.pushState=d)}),{currentId:()=>{var m;return(m=e==null?void 0:e.event.id)!=null?m:null},start:m=>{n(m)},end:r,stop:()=>u.forEach(m=>m())}};var _e=t=>t.replace(/\/+$/,""),G=(t,e)=>`${t.proxyUrl?`${_e(t.proxyUrl)}/rum`:`${_e(t.apiUrl)}/api/rum`}/${encodeURIComponent(t.applicationId)}/${e}?token=${encodeURIComponent(t.token)}`;var Fe="abyss-rum-config",Et=600*1e3,Ve=t=>typeof t=="number"&&t>=0&&t<=1?t:0,Ne=t=>{var n,r;let e=t;if(!e||typeof e.enabled!="boolean"||typeof e.sessionSampleRate!="number")return null;let s=(n=e.replay)!=null?n:{};return{enabled:e.enabled,sessionSampleRate:Ve(e.sessionSampleRate),sessionQuotaExhausted:e.sessionQuotaExhausted===!0,country:typeof e.country=="string"?e.country:null,feedbackEnabled:e.feedbackEnabled===!0,replay:{enabled:s.enabled===!0,sampleRate:Ve(s.sampleRate),unmaskSelectors:Array.isArray(s.unmaskSelectors)?s.unmaskSelectors.filter(o=>typeof o=="string"):[],maxSessionBytes:s.maxSessionBytes,defaultPrivacy:s.defaultPrivacy},socketMessages:{enabled:((r=e.socketMessages)==null?void 0:r.enabled)===!0}}},Le=(t,e)=>{let s=_chunk2TDEJLQ7js.h.call(void 0, Fe);if(!s||s.key!==t||typeof s.at!="number")return;let n=e-s.at;return n>=0&&n<Et?Ne(s.config):void 0},He=async(t,e,s,n)=>{let r=null;try{let o=await e(t,{credentials:"omit"});r=o.ok?Ne(await o.json()):null}catch (e13){r=null}return _chunk2TDEJLQ7js.i.call(void 0, Fe,{key:s,at:n,config:r}),r};var St=/iPad|Tablet|PlayBook|Silk|Android(?!.*Mobile)/i,bt=/Mobi|iPhone|iPod|Android|Opera Mini|IEMobile/i,wt=[[/Edg(e|A|iOS)?\//,"Edge"],[/OPR\/|Opera/,"Opera"],[/SamsungBrowser\//,"Samsung Internet"],[/Firefox\/|FxiOS\//,"Firefox"],[/Chrome\/|CriOS\//,"Chrome"],[/Safari\//,"Safari"]],Ue=t=>St.test(t)?"tablet":bt.test(t)?"mobile":"desktop",Be=t=>{var e,s;return(s=(e=wt.find(([n])=>n.test(t)))==null?void 0:e[1])!=null?s:"Other"},qe=(t,e,s,n)=>{if(!t)return s;try{let r=t({...e,attributes:{...e.attributes}});if(typeof(r==null?void 0:r.session)=="boolean"&&typeof r.replay=="boolean")return{session:r.session,replay:r.replay}}catch (e14){}return n(),s};var It=200,kt=(t,e,s)=>({session:t<e,replay:t<e*s}),We=(t,e,s,n)=>{let r=kt(t.random,t.sessionSampleRate,t.replaySampleRate),o=qe(e,t,r,n),i=o.session&&!s;return{session:i,replay:i&&o.replay}},At=t=>t.type==="request"&&(t.kind==="FETCH"||t.kind==="XHR")&&t.outcome==="SUCCESS",$=class{constructor(e){this.onDrop=e;this.held=null;this.released=new Set;this.successes=new Map}accept(e,s){var r,o,i;if(s){if(At(e)){let a=(r=e.pageViewId)!=null?r:"",p=((o=this.successes.get(a))!=null?o:0)+1;if(this.successes.set(a,p),p>It)return this.onDrop(),[]}return[e]}if(e.type==="pageView")return this.released.has(e.id)?[e]:(this.held=e,[]);if(e.type!=="error")return[];let n=[];return e.pageViewId!==null&&!this.released.has(e.pageViewId)&&(this.released.add(e.pageViewId),((i=this.held)==null?void 0:i.id)===e.pageViewId&&(n.push(this.held),this.held=null)),n.push(e),n}reset(){this.held=null,this.released.clear(),this.successes.clear()}};var ue="abyss-rum-session",Tt=1800*1e3,Ot=14400*1e3,de=(t,e)=>e-t.lastActivityAt>=Tt||e-t.startedAt>=Ot,Ct=t=>typeof(t==null?void 0:t.session)=="boolean"&&typeof t.replay=="boolean",Dt=()=>{let t=_chunk2TDEJLQ7js.h.call(void 0, ue);return!t||!_chunkKD6VO7IKjs.c.call(void 0, t.id)||typeof t.startedAt!="number"||typeof t.lastActivityAt!="number"||typeof t.random!="number"?null:{id:t.id,startedAt:t.startedAt,lastActivityAt:t.lastActivityAt,random:t.random,decision:Ct(t.decision)?t.decision:null,entryPath:typeof t.entryPath=="string"?t.entryPath:null,cut:t.cut===!0}},M=t=>_chunk2TDEJLQ7js.i.call(void 0, ue,t),je=()=>_chunk2TDEJLQ7js.j.call(void 0, ue),le=t=>{let e={id:_chunk2TDEJLQ7js.k.call(void 0, ),startedAt:t,lastActivityAt:t,random:Math.random(),decision:null,entryPath:null,cut:!1};return M(e),e},Ke=t=>{let e=Dt();return e&&!de(e,t)?e:le(t)};var Xe=64*1024,Mt=60*1e3;var Y=class{constructor(e,s,n){this.url=e;this.fetchImpl=s;this.handlers=n;this.pausedUntil=0}isPaused(e){return e<this.pausedUntil}send(e,s,n){let r=JSON.stringify({...e,events:[]}).slice(0,-2),o=_chunk2TDEJLQ7js.e.call(void 0, r)+2,i=[],a=[],p=o;for(let l of s){let u=JSON.stringify(l),d=_chunk2TDEJLQ7js.e.call(void 0, u);if(o+d>Xe){this.handlers.onDrop(1);continue}let c=d+(i.length>0?1:0);p+c>Xe&&(this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId),i=[],a=[],p=o),p+=d+(i.length>0?1:0),i.push(u),a.push(l)}i.length>0&&this.post(`${r}${i.join(",")}]}`,a,n,e.sessionId)}post(e,s,n,r){let o=i=>this.handlers.onResult(s,i,r);if(n&&this.beacon(e)){o("OK");return}this.fetchImpl(this.url,{method:"POST",body:e,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(i=>this.handle(i,o),()=>o("FAIL")).catch(()=>this.handlers.onDrop(1))}beacon(e){try{return typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.url,e)}catch (e15){return!1}}async handle(e,s){if(e.status===429){this.pausedUntil=Date.now()+Mt,s("RETRY");return}if(e.status===401||e.status===403||e.status===404){s("CUT");return}if(!e.ok){s("FAIL");return}s("OK");let n=!1;try{n=(await e.json()).liveWatched===!0}catch (e16){}this.handlers.onLiveWatched(n)}};var Pt=5e3,xt=50,Ge=200,_t=50,Vt=100,Ft=200,Q=class{constructor(e,s){this.options=e;this.shared=s;this.config=null;this.ready=!1;this.stopped=!1;this.flushing=!1;this.pending=[];this.queue=[];this.teardowns=[];this.pageViews=null;this.lastPageViewId=null;this.deferred=new V(Vt,()=>this.drop());this.sockets=new V(Ft,()=>this.drop());this.errors=new j({pageViewId:()=>this.pageViewId(),resolveRoute:()=>this.resolveRoute(),record:e=>this.record(e),drop:()=>this.drop(),captured:()=>{var s;let e=Date.now();(s=this.deferred.get())==null||s.frustration.notifyError(),this.sockets.run(n=>n.anomaly(e))}});this.connections=new Set;this.timings=new Map;this.sessionDirty=!0;this.closed=!1;this.liveWatched=!1;this.drop=()=>{this.shared.dropped+=1};this.pageViewId=()=>{var e,s;return(s=(e=this.pageViews)==null?void 0:e.currentId())!=null?s:null};var r;let n=window.fetch;this.nativeFetch=(o,i)=>n.call(window,o,i),this.instrumentedOrigins=((r=e.instrumentedOrigins)!=null?r:[]).map(o=>_chunkTJIA62OAjs.d.call(void 0, String(o))).filter(o=>o!==null),this.filter=new $(this.drop),this.transport=new Y(G(e,"batch"),this.nativeFetch,{onResult:(o,i,a)=>this.guard(()=>this.onResult(o,i,a)),onLiveWatched:o=>{this.liveWatched=o},onDrop:o=>{this.shared.dropped+=o}}),this.session=Ke(Date.now()),this.deferred.hold()}start(){if(this.session.cut){this.stopped=!0;return}let e=Date.now(),s=`${this.options.applicationId}:${this.options.token}`,n=Le(s,e);if(n!==void 0){this.configure(n);return}He(G(this.options,"config"),this.nativeFetch,s,e).then(r=>this.guard(()=>this.configure(r)),this.drop)}stop(){this.shutdown(),je()}captureError(e,s){this.errors.capture(e,s)}addAction(e,s){let n=we(e,s,this.pageViewId(),this.drop);n&&this.record(n)}addTiming(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.addTiming(e,s))}startDuration(e,s){let n=Date.now();this.deferred.run(r=>r.perf.timings.startDuration(e,s,n))}stopDuration(e){let s=Date.now();this.deferred.run(n=>n.perf.timings.stopDuration(e,s))}sendFeedback(e){let s=this.feedbackState();return s!==null?Promise.reject(new (0, _chunkLRYKS5XRjs.b)(s)):this.feedback((n,r)=>n.sendFeedback(r,e))}showReportDialog(e){this.feedbackState()===null&&this.feedback((s,n)=>s.showReportDialog(n,e!=null?e:{})).catch(this.drop)}markDirty(){this.sessionDirty=!0}guard(e){try{e()}catch (e17){this.drop()}}load(e,s){e.catch(()=>{this.drop(),s()})}feedback(e){return Promise.resolve().then(() => _interopRequireWildcard(require("./send-HJMK5WE5.js"))).then(s=>e(s,this.feedbackHost()),()=>{throw new (0, _chunkLRYKS5XRjs.b)("SEND_FAILED")})}feedbackState(){var e;return!this.ready||this.stopped?"NO_SESSION":((e=this.config)==null?void 0:e.feedbackEnabled)===!0?null:"FEEDBACK_DISABLED"}feedbackHost(){return{unavailable:()=>this.feedbackState(),sessionId:()=>this.session.id,sessionStartedAt:()=>this.session.startedAt,pageViewId:this.pageViewId,resolveRoute:()=>this.resolveRoute(),prepare:e=>{let s=te(e,this.options.beforeSend,this.drop);return s&&ne(s)},post:e=>(this.flush(!1),this.nativeFetch(G(this.options,"feedback"),{method:"POST",body:JSON.stringify({...this.header(),events:[e]}),keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain;charset=UTF-8"}}).then(s=>s.status)),sent:e=>this.guard(()=>{var s,n;return(n=(s=this.options).onFeedbackSent)==null?void 0:n.call(s,e)})}}loadDeferred(e){this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./deferred-U3TO724B.js"))).then(({installDeferred:s})=>this.guard(()=>{if(this.stopped)return;let n=s({instrument:e,resolveRoute:()=>this.resolveRoute(),captureConsole:this.options.captureConsole!==!1,describe:re});this.teardowns.push(n.teardown),this.deferred.resolve(n)})),()=>this.deferred.fail())}loadReplay(){var e;!this.replaying&&((e=this.session.decision)!=null&&e.replay)&&this.config.replay.enabled&&(this.replaying=Promise.resolve().then(() => _interopRequireWildcard(require("./replay-MELY6N37.js"))).then(({recordReplay:s})=>s(this)).catch(this.drop))}loadSocketCapture(e){var n;let s=this.options.captureSocketMessages;!s||!e.socketMessages.enabled||((n=this.session.decision)==null?void 0:n.session)!==!0||(this.sockets.hold(),this.load(Promise.resolve().then(() => _interopRequireWildcard(require("./socket-messages-KEJ2WXMX.js"))).then(({SocketMessageCapture:r})=>this.guard(()=>{this.stopped||this.sockets.resolve(new r(s,{sessionId:()=>this.session.id,record:o=>this.record(o),drop:this.drop}))})),()=>this.sockets.fail()))}onPageView(e){var s,n;this.shared.featureFlags.annotate(e),(s=this.deferred.get())==null||s.perf.annotate(e),this.record(e),e.id!==this.lastPageViewId&&(this.lastPageViewId=e.id,(n=this.deferred.get())==null||n.frustration.notifyActivity()),this.deferred.run(r=>r.perf.pageViewSent(e))}configure(e){if(this.stopped)return;if(!e||!e.enabled){this.shutdown();return}this.config=e,this.session.decision||this.decide(),this.ready=!0,this.install(),this.loadSocketCapture(e),this.loadReplay();let s=this.pending;this.pending=[];let n=this.pageViewId();for(let r of s)(r.type==="error"||r.type==="action")&&r.pageViewId===null&&(r.pageViewId=n),this.record(r)}decide(){let e=this.config,s=navigator.userAgent;this.session.decision=We({route:x(this.resolveRoute()),deviceType:Ue(s),browserFamily:Be(s),country:e.country,attributes:{...this.shared.attributes},random:this.session.random,sessionSampleRate:e.sessionSampleRate,replaySampleRate:e.replay.sampleRate},this.options.sampler,e.sessionQuotaExhausted,this.drop),M(this.session)}install(){let e={instrumentedOrigins:this.instrumentedOrigins,sessionId:()=>this.session.id,pageViewId:this.pageViewId,record:r=>this.record(r),drop:this.drop,trackTiming:(r,o,i)=>{var a;this.timings.set(r,{url:o,startedAt:i}),(a=this.deferred.get())==null||a.frustration.notifyActivity()},trackConnection:r=>this.connections.add(r),socketMessage:(r,o)=>this.sockets.run(i=>i.message(r,o)),socketClosed:r=>{let o=Date.now();this.sockets.run(i=>i.closed(r,o))}};this.pageViews=xe({resolveRoute:()=>this.resolveRoute(),record:r=>this.onPageView(r),onNavigation:()=>this.touch(),drop:this.drop});let s=setInterval(()=>this.guard(()=>this.flush(!1)),Pt),n=()=>this.guard(()=>this.touch());this.teardowns=[this.pageViews.stop,()=>clearInterval(s),Ce(e),De(e),Te(e),Oe(e),_chunk2TDEJLQ7js.d.call(void 0, window,"click",n,!0),_chunk2TDEJLQ7js.d.call(void 0, window,"keydown",n,!0),this.errors.install(),_chunk2TDEJLQ7js.d.call(void 0, window,"pagehide",()=>this.guard(()=>this.onPageHide())),_chunk2TDEJLQ7js.d.call(void 0, window,"pageshow",r=>this.guard(()=>{var o;r.persisted&&(this.closed=!1,this.sessionDirty=!0,(o=this.pageViews)==null||o.start("BACK_FORWARD"))})),_chunk2TDEJLQ7js.d.call(void 0, document,"visibilitychange",()=>this.guard(()=>{var r;document.visibilityState==="hidden"&&((r=this.deferred.get())==null||r.perf.hidden(),this.flush(!0))}))],this.loadDeferred(e)}shutdown(){this.stopped=!0,this.ready=!1;let e=this.teardowns;this.teardowns=[],e.reverse().forEach(s=>this.guard(s)),this.deferred.close(),this.sockets.close(),this.pending=[],this.queue=[],this.connections.clear(),this.timings.clear()}resolveRoute(){let{routeResolver:e}=this.options;if(e)try{return String(e(window.location))}catch (e18){this.drop()}return window.location.pathname}touch(){var s,n;if(!this.ready)return;let e=Date.now();if(!de(this.session,e)){this.session.lastActivityAt=e,M(this.session);return}(s=this.pageViews)==null||s.end(),this.flush(!1),this.shared.dropped+=this.queue.length,this.queue=[],this.session=le(e),this.decide(),this.loadReplay(),this.filter.reset(),this.sessionDirty=!0,this.closed=!1,(n=this.pageViews)==null||n.start("SPA")}onPageHide(){var e;(e=this.pageViews)==null||e.end();for(let s of this.connections)s.done||(s.event.durationMs=Date.now()-s.startedAt,s.done=!0,s.dirty=!0);this.closed=!0,this.sessionDirty=!0,this.flush(!0)}record(e){var s,n;try{if(this.stopped)return;if(this.errors.observe(e),!this.ready){this.pending.length<_t?this.pending.push(e):this.drop();return}(s=this.sockets.get())==null||s.observe(e);let r=((n=this.session.decision)==null?void 0:n.session)===!0;if(!r&&e.type!=="error"&&e.type!=="pageView")return;let o=te(e,this.options.beforeSend,this.drop);if(!o)return;ne(o),o.type==="pageView"&&this.session.entryPath===null&&(this.session.entryPath=o.route,M(this.session));for(let i of this.filter.accept(o,r))this.enqueue(i)}catch (e19){this.drop()}}enqueue(e){if(this.queue.length>=Ge){this.drop();return}this.queue.push(e),this.queue.length>=xt&&!this.flushing&&this.flush(!1)}flush(e){var s,n;if(!(!this.ready||this.flushing||this.transport.isPaused(Date.now()))){this.flushing=!0;try{for(let p of this.connections)p.dirty&&(p.dirty=!1,this.record({...p.event})),p.done&&this.connections.delete(p);let r=this.queue;this.queue=[],this.fillTimings(r);let o=((s=this.session.decision)==null?void 0:s.session)===!0;if(r.length===0&&!(o&&this.sessionDirty))return;let a=this.sessionDirty||this.shared.dropped>0?{id:this.session.id,type:"session",entryPath:(n=this.session.entryPath)!=null?n:"/",sampled:o,closed:this.closed,droppedEvents:this.shared.dropped}:null;this.shared.dropped=0,this.sessionDirty=!1,this.transport.send(this.header(),a?[a,...r]:r,e)}finally{this.flushing=!1}}}header(){let e={sessionId:this.session.id,sessionStartedAt:_chunk2TDEJLQ7js.a.call(void 0, this.session.startedAt)};return this.options.release&&(e.release=this.options.release),this.shared.actor!==void 0&&(e.actor=this.shared.actor),this.shared.attributesSet&&(e.attributes={...this.shared.attributes}),this.shared.featureFlags.hasAny()&&(e.featureFlags={...this.shared.featureFlags.session}),e}fillTimings(e){for(let s of e){let n=this.timings.get(s.id);n&&(this.timings.delete(s.id),Object.assign(s,_chunkTJIA62OAjs.i.call(void 0, n.url,n.startedAt)))}}onResult(e,s,n){if(s==="OK")return;if(s==="CUT"){this.session.cut=!0,M(this.session),this.shutdown();return}let r=e.filter(i=>i.type!=="session"),o=e.find(i=>i.type==="session");if(o&&(this.shared.dropped+=o.droppedEvents,this.sessionDirty=!0),s==="RETRY"&&n===this.session.id){let i=r.slice(0,Math.max(0,Ge-this.queue.length));this.shared.dropped+=r.length-i.length,this.queue=[...i,...this.queue];return}this.shared.dropped+=r.length}},$e=null,f={actor:void 0,attributes:{},attributesSet:!1,dropped:0,featureFlags:new D},v=()=>$e,ce=t=>{$e=t};var Ye=(s=>(s.ALL="ALL",s.ON_ANOMALY="ON_ANOMALY",s))(Ye||{});var S=t=>{try{t()}catch (e20){f.dropped+=1}},En= exports.AbyssRum ={init(t){S(()=>{if(v()||!(t!=null&&t.token)||!t.applicationId||!t.apiUrl&&!t.proxyUrl||typeof window=="undefined"||typeof window.fetch!="function")return;let e=new Q(t,f);ce(e),e.start()})},setActor(t){S(()=>{var s;let e=Se(t);if(e===void 0){f.dropped+=1;return}f.actor=e,(s=v())==null||s.markDirty()})},setAttributes(t){S(()=>{var e;f.attributes=_chunkTJIA62OAjs.a.call(void 0, f.attributes,t,()=>{f.dropped+=1}),f.attributesSet=!0,(e=v())==null||e.markDirty()})},captureError(t,e){S(()=>{var s;return(s=v())==null?void 0:s.captureError(t,e)})},addAction(t,e){S(()=>{var s;return(s=v())==null?void 0:s.addAction(t,e)})},addFeatureFlagEvaluation(t,e){S(()=>{var s;f.featureFlags.add(t,e,()=>f.dropped+=1)&&((s=v())==null||s.markDirty())})},sendFeedback(t){var e,s;return(s=(e=v())==null?void 0:e.sendFeedback(t))!=null?s:Promise.reject(new (0, _chunkLRYKS5XRjs.b)("NO_SESSION"))},showReportDialog(t){S(()=>{var e;return(e=v())==null?void 0:e.showReportDialog(t)})},addTiming(t){S(()=>{var e;return(e=v())==null?void 0:e.addTiming(t)})},startDuration(t,e){S(()=>{var s;return(s=v())==null?void 0:s.startDuration(t,e)})},stopDuration(t){S(()=>{var e;return(e=v())==null?void 0:e.stopDuration(t)})},stop(){S(()=>{var t;(t=v())==null||t.stop(),ce(null),f.actor=void 0,f.attributes={},f.attributesSet=!1,f.dropped=0,f.featureFlags=new D})}};exports.AbyssRum = En; exports.RumFeedbackError = _chunkLRYKS5XRjs.b; exports.RumFeedbackErrorCode = _chunkLRYKS5XRjs.a; exports.RumSocketCaptureMode = Ye;