diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a887514..18b8566 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -29,6 +29,7 @@ jobs: tests.test_hotfolder \ tests.test_migrate \ tests.test_label \ + tests.test_observability \ tests.test_secrets -v sh -n infra/lock_dependencies.sh @@ -99,7 +100,7 @@ jobs: # the generator's geometry. The provider suites use a fake transport: they # prove the documented contract, not the integration. - name: Print-file geometry and provider adapters - run: $COMPOSE exec -T api python -m unittest tests.test_printfile tests.test_printpng tests.test_mercadopago tests.test_tiny tests.test_cnpj tests.test_payment_messages tests.test_jadlog tests.test_correios tests.test_quote_review tests.test_moves tests.test_large_files tests.test_grade_check tests.test_schema tests.test_customer_document tests.test_mail_html tests.test_layout_rules tests.test_proof_cut tests.test_proof_render tests.test_prumo tests.test_speed tests.test_printpng_validate tests.test_machine_log tests.test_machine_stats tests.test_label tests.test_worker_drain -v + run: $COMPOSE exec -T api python -m unittest tests.test_printfile tests.test_printpng tests.test_mercadopago tests.test_tiny tests.test_cnpj tests.test_payment_messages tests.test_jadlog tests.test_correios tests.test_quote_review tests.test_moves tests.test_large_files tests.test_grade_check tests.test_schema tests.test_customer_document tests.test_mail_html tests.test_layout_rules tests.test_proof_cut tests.test_proof_render tests.test_prumo tests.test_speed tests.test_printpng_validate tests.test_machine_log tests.test_machine_stats tests.test_label tests.test_observability tests.test_worker_drain -v - name: Runtime and retention regressions run: | diff --git a/app/api/health.py b/app/api/health.py index d31bd70..3ef97bc 100644 --- a/app/api/health.py +++ b/app/api/health.py @@ -63,6 +63,10 @@ def session(request: Request, response: Response): 'unit_cents': band['unit_cents']} for band in products[mode]['bands']]} for mode in catalog.MODES}, + # Public by design: the browser initialises Sentry with these; empty is off. + 'sentry_dsn_web': os.environ.get('SENTRY_DSN_WEB', '').strip(), + 'sentry_environment': os.environ.get('SENTRY_ENVIRONMENT') or ENVIRONMENT, + 'sentry_release': os.environ.get('IMAGE_TAG', ''), # Public by design: Mercado Pago's card form needs it in the browser. 'payment_public_key': os.environ.get('MP_PUBLIC_KEY', '') if payment.name == 'mercadopago' else '', # The delivery options the cart quotes, or none: pickup only. diff --git a/app/api/users.py b/app/api/users.py index e0c3b93..8a52e42 100644 --- a/app/api/users.py +++ b/app/api/users.py @@ -5,6 +5,7 @@ changes it in "Minha senha". The superadmin is the system's own account, set fro administrators manage everyone else. Nobody can remove, disable or demote themselves, so the last administrator cannot lock the team out by accident. """ +import os import re from decimal import Decimal from typing import Literal @@ -18,7 +19,7 @@ from ..core import db from ..core.auth import (CAPABILITIES, MACHINE_QUESTION, audit, can, may_move, may_reorder, password_hash, password_matches, signed_in) from ..core.models import StrictModel -from ..runtime import BACK, STATES, TRANSITIONS +from ..runtime import BACK, ENVIRONMENT, STATES, TRANSITIONS router = APIRouter() @@ -68,6 +69,10 @@ def me(request: Request): moves = [[a, b] for a, nexts in TRANSITIONS.items() for b in nexts if may_move(role, a, b)] moves += [[a, b] for a, b in BACK.items() if may_move(role, a, b, back=True)] return {'email': account['email'], 'name': account['name'], 'role': role, + # Public by design: the Kanban browser initialises Sentry with these. + 'sentry_dsn_web': os.environ.get('SENTRY_DSN_WEB', '').strip(), + 'sentry_environment': os.environ.get('SENTRY_ENVIRONMENT') or ENVIRONMENT, + 'sentry_release': os.environ.get('IMAGE_TAG', ''), # The machine this session is on, and whether to ask (item 12). 'machine': account['machine'], 'machine_question': MACHINE_QUESTION.get(role), 'machine_answered': account['machine_answered'], diff --git a/app/app.py b/app/app.py index 31e8b87..93d1c2b 100644 --- a/app/app.py +++ b/app/app.py @@ -10,11 +10,14 @@ from fastapi import FastAPI from fastapi.responses import JSONResponse from starlette.middleware.trustedhost import TrustedHostMiddleware +from . import observability from .core import db from .core.auth import audit, client_ip from .runtime import ALLOWED_HOSTS, ALLOWED_ORIGINS, storage from .api import artwork, customer, health, machine_log, operator, orders, payments, quotes, reviews, site_admin, site_videos, stamps, uploads, users +observability.init('api') + @asynccontextmanager async def lifespan(app): diff --git a/app/observability.py b/app/observability.py new file mode 100644 index 0000000..bc16dd7 --- /dev/null +++ b/app/observability.py @@ -0,0 +1,139 @@ +"""Sentry for the API and the worker, off until a DSN arrives (note Sentry). + +`init(component)` reads `SENTRY_DSN_API` and returns without importing the SDK +when it is empty, so local and CI runs carry no Sentry dependency or network +cost. When it is set, `scrub` keeps cookies, credentials, request bodies and +Brazilian personal data out of the events (LGPD). +""" +import os +import re +from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit + +EMAIL = re.compile(r'[^\s@]+@[^\s@]+\.[A-Za-z]{2,}') +# CPF (11 digits) or CNPJ (14), with or without punctuation. +DOCUMENT = re.compile(r'(?{ + window.dtfEnvironment=session.sentry_environment||session.environment; + window.dtfRelease=session.sentry_release||undefined; + window.dtfObservability?.start?.(session.sentry_dsn_web,'site'); window.dtfUploadMaxBytes=session.max_upload_bytes; const limit=document.getElementById('zLimite'); if(limit)limit.textContent='Até '+(session.max_upload_bytes/1073741824).toFixed(0)+' GB por arquivo.'; diff --git a/web/index.html b/web/index.html index c40bb6c..105b43f 100644 --- a/web/index.html +++ b/web/index.html @@ -641,6 +641,8 @@ h2 em{font-style:normal;color:var(--laranja)} @media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto}} + + diff --git a/web/kanban.html b/web/kanban.html index 49f90b2..a5bc674 100644 --- a/web/kanban.html +++ b/web/kanban.html @@ -297,4 +297,4 @@
- + diff --git a/web/kanban.js b/web/kanban.js index 94b2f91..468bcb0 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -230,7 +230,14 @@ function freightWeight(fr){ function downloadButton(text,fn,className){const b=button(text,fn,className);b.prepend(svgIcon(IC.download,'i m'));return b;} async function api(path,body){ const r=await fetch('/api/operator'+path,{headers:{'Content-Type':'application/json'},...(body===undefined?{}:{method:'POST',body:JSON.stringify(body)})}); - const d=await r.json();if(!r.ok){const error=new Error(typeof d.detail==='string'?d.detail:'Confira os campos ('+r.status+').');error.status=r.status;throw error;}return d; + const d=await r.json(); + if(!r.ok){ + const error=new Error(typeof d.detail==='string'?d.detail:'Confira os campos ('+r.status+').'); + error.status=r.status; + window.dtfObservability?.apiError?.(path,r.status,error.message,d.detail); + throw error; + } + return d; } function download(uid,orderId){return async()=>{ const result=await api('/uploads/'+uid+'/download'+(orderId?'?order_id='+encodeURIComponent(orderId):'')); @@ -636,7 +643,11 @@ let seenOrders=null, seenPending=null, unseen=0; async function load(quiet=false){ try{ const [loaded,me]=await Promise.all([api('/board'),api('/me')]); - board=absorb(loaded);ME=me;applyRole();paintMyMachine(); + board=absorb(loaded);ME=me; + window.dtfEnvironment=me.sentry_environment||me.environment; + window.dtfRelease=me.sentry_release||undefined; + window.dtfObservability?.start?.(me.sentry_dsn_web,'kanban'); + applyRole();paintMyMachine(); noticeNew(quiet); const known=new Set(board.orders.map(o=>o.id)); board.orders.push(...olderFinished.filter(o=>!known.has(o.id))); diff --git a/web/observability.js b/web/observability.js new file mode 100644 index 0000000..47fdc0a --- /dev/null +++ b/web/observability.js @@ -0,0 +1,120 @@ +/* Sentry for the Site and the Kanban, used only when the DSN arrives from the + API. It loads after web/vendor/sentry.min.js and never fetches anything + itself; DSNs are public by design, so an empty one leaves everything off. + + beforeSend follows the server (app/observability.py): no cookies, credential + headers, request bodies or signed/token query strings, and CPF/CNPJ and + e-mails replaced by [removido]. */ +(function () { + const EMAIL = /[^\s@]+@[^\s@]+\.[A-Za-z]{2,}/g; + const DOCUMENT = /(? String(value == null ? '' : value) + .replace(EMAIL, REDACTED).replace(DOCUMENT, REDACTED); + + function scrubQuery(query) { + if (!query) return query; + return String(query).split('&').filter(part => { + let key = part.split('=')[0] || ''; + try { key = decodeURIComponent(key.replace(/\+/g, ' ')); } catch (error) { /* keep the raw key */ } + return !SENSITIVE_PARAM.test(key); + }).join('&'); + } + + function scrubText(value) { + if (typeof value !== 'string') return value; + value = clean(value); + const at = value.indexOf('?'); + return at < 0 ? value : value.slice(0, at + 1) + scrubQuery(value.slice(at + 1)); + } + + function scrubUrl(url) { + if (typeof url !== 'string') return url; + const at = url.indexOf('?'); + return at < 0 ? url : url.slice(0, at + 1) + scrubQuery(url.slice(at + 1)); + } + + function scrubValue(value) { + if (typeof value === 'string') return scrubText(value); + if (Array.isArray(value)) return value.map(scrubValue); + if (value && typeof value === 'object') { + const out = {}; + for (const [key, item] of Object.entries(value)) out[key] = scrubValue(item); + return out; + } + return value; + } + + function scrubRequest(request) { + if (!request || typeof request !== 'object') return; + delete request.cookies; + delete request.data; + delete request.body; + if (request.headers && typeof request.headers === 'object') { + for (const key of Object.keys(request.headers)) { + if (SENSITIVE_HEADER.test(key)) delete request.headers[key]; + } + } + if (request.query_string) request.query_string = scrubQuery(request.query_string); + if (request.url) request.url = scrubUrl(request.url); + } + + function scrub(event) { + if (!event || typeof event !== 'object') return event; + scrubRequest(event.request); + if (typeof event.message === 'string') event.message = scrubText(event.message); + if (event.logentry && typeof event.logentry.message === 'string') + event.logentry.message = scrubText(event.logentry.message); + if (event.exception && Array.isArray(event.exception.values)) { + for (const value of event.exception.values) { + if (value && typeof value.value === 'string') value.value = scrubText(value.value); + } + } + let breadcrumbs = event.breadcrumbs; + if (breadcrumbs && !Array.isArray(breadcrumbs)) breadcrumbs = breadcrumbs.values; + if (Array.isArray(breadcrumbs)) { + for (const crumb of breadcrumbs) { + if (!crumb || typeof crumb !== 'object') continue; + if (typeof crumb.message === 'string') crumb.message = scrubText(crumb.message); + if (crumb.data) crumb.data = scrubValue(crumb.data); + } + } + if (event.extra) event.extra = scrubValue(event.extra); + if (event.user) event.user = scrubValue(event.user); + return event; + } + + function start(dsn, component) { + if (started || !dsn || typeof Sentry === 'undefined') return; + started = true; + app = component || ''; + const options = {dsn, sendDefaultPii: false, beforeSend: scrub}; + if (window.dtfEnvironment) options.environment = window.dtfEnvironment; + if (window.dtfRelease) options.release = window.dtfRelease; + try { + Sentry.init(options); + Sentry.setTag('app', app); + } catch (error) { + started = false; + } + } + + function apiError(path, status, message, detail) { + if (!started || status === 401 || typeof Sentry === 'undefined') return; + try { + const extra = {path, status, page: location.pathname}; + if (status === 422 && detail) extra.detail = detail; + Sentry.captureMessage(clean('API ' + status + ' ' + path + ': ' + (message || '')), + {level: 'error', tags: {app}, extra}); + } catch (error) { + // Reporting an error must never break the page. + } + } + + window.dtfObservability = {start, apiError, scrub}; +})(); diff --git a/web/vendor/LICENSE-sentry.txt b/web/vendor/LICENSE-sentry.txt new file mode 100644 index 0000000..9f2152e --- /dev/null +++ b/web/vendor/LICENSE-sentry.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Functional Software, Inc. dba Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/web/vendor/README.md b/web/vendor/README.md index 454f16b..6c84e7d 100644 --- a/web/vendor/README.md +++ b/web/vendor/README.md @@ -31,3 +31,10 @@ curl -s "https://api.cdnjs.com/libraries/pdf.js/?fields=sri" documented workaround is `isEvalSupported: false`; `web/index.html` already passes that, so the known path is closed. Upgrading is worthwhile but is an API change, not a file swap, and belongs with its own browser testing — see `ROADMAP.md` 2.7. + +## Sentry browser SDK 11.12.0 + +One line per vendored file: source, version, date and SHA-256. + +- `sentry.min.js` — https://browser.sentry-cdn.com/11.12.0/bundle.min.js — @sentry/browser 11.12.0 — 2026-11-11 — sha256 `388cdc69ba60b5a883097874ee8e5e010543990d60b5846d9dd1a4e736a49902` +- `LICENSE-sentry.txt` — https://registry.npmjs.org/@sentry/browser/-/browser-11.12.0.tgz (`package/LICENSE`) — @sentry/browser 11.12.0 — 2026-11-11 — sha256 `f3df0b92efcd9d8cc0de5a36c151569a12a647d65b851abbb696ef7b13dee10b` diff --git a/web/vendor/sentry.min.js b/web/vendor/sentry.min.js new file mode 100644 index 0000000..2950b17 --- /dev/null +++ b/web/vendor/sentry.min.js @@ -0,0 +1,3 @@ +/*! @sentry/browser 11.12.0 (8bebd29) | https://github.com/getsentry/sentry-javascript */ +var Sentry=function(t){t=window.Sentry||{};const n=globalThis,e="11.12.0";function r(){return o(n),n}function o(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||e,n[e]=n[e]||{}}function i(t,r,o=n){const i=o.__SENTRY__=o.__SENTRY__||{},s=i[e]=i[e]||{};return s[t]||(s[t]=r())}const s=["debug","info","warn","error","log","assert","trace"],c={};function u(t){if(!("console"in n))return t();const e=n.console,r={},o=Object.keys(c);o.forEach(t=>{const n=c[t];r[t]=e[t],e[t]=n});try{return t()}finally{o.forEach(t=>{e[t]=r[t]})}}const a="?",f=/\(error: (.*)\)/,l=/captureMessage|captureException/;function d(...t){const n=t.sort((t,n)=>t[0]-n[0]).map(t=>t[1]);return(t,e=0,r=0)=>{const o=[],i=t.split("\n");for(let t=e;t1024&&(e=e.slice(0,1024));const s=f.test(e)?e.replace(f,"$1"):e;if(!s.includes("Error: ")){for(const t of n){const n=t(s);if(n){o.push(n);break}}if(o.length>=50+r)break}}return function(t){if(!t.length)return[];const n=Array.from(t);/sentryWrapped/.test(p(n).function||"")&&n.pop();n.reverse(),l.test(p(n).function||"")&&(n.pop(),l.test(p(n).function||"")&&n.pop());return n.slice(0,50).map(t=>({...t,filename:t.filename||p(n).filename,function:t.function||a}))}(o.slice(r))}}function p(t){return t[t.length-1]||{}}const h="";function m(t){try{return t&&"function"==typeof t&&t.name||h}catch{return h}}function y(t){const n=t.exception;if(n){const t=[];try{return n.values.forEach(n=>{n.stacktrace.frames&&t.push(...n.stacktrace.frames)}),t}catch{return}}}const g={},v={};function b(t,n){return g[t]=g[t]||[],g[t].push(n),()=>{const e=g[t];if(e){const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}}function _(t,n){if(!v[t]){v[t]=!0;try{n()}catch(t){}}}function w(t,n){const e=t&&g[t];if(e)for(const t of e)try{t(n)}catch(t){}}let S=null;function E(){S=n.onerror,n.onerror=function(t,n,e,r,o){return w("error",{column:r,error:o,line:e,msg:t,url:n}),!!S&&S.apply(this,arguments)},n.onerror.__SENTRY_INSTRUMENTED__=!0}let $=null;function k(){$=n.onunhandledrejection,n.onunhandledrejection=function(t){return w("unhandledrejection",t),!$||$.apply(this,arguments)},n.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const x=Object.prototype.toString;function I(t){switch(x.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return D(t,Error)}}function j(t,n){return x.call(t)===`[object ${n}]`}function O(t){return j(t,"ErrorEvent")}function T(t){return j(t,"DOMError")}function R(t){return j(t,"String")}function C(t){return"object"==typeof t&&null!==t&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function A(t){return null===t||C(t)||"object"!=typeof t&&"function"!=typeof t}function N(t){return j(t,"Object")}function P(t){return"object"==typeof t&&null!==t}function L(t){return"undefined"!=typeof Event&&D(t,Event)}function M(t){return Boolean(t?.then&&"function"==typeof t.then)}function D(t,n){try{return t instanceof n}catch{return!1}}function F(t){return"undefined"!=typeof Request&&D(t,Request)}function U(t,n,e){if(!(n in t))return;const r=t[n];if("function"!=typeof r)return;const o=e(r);"function"==typeof o&&B(o,r);try{t[n]=o}catch{}}function q(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch{}}function B(t,n){try{const e=n.prototype||{};t.prototype=n.prototype=e,q(t,"__sentry_original__",n)}catch{}}function H(t){return t.__sentry_original__}function W(t){if(I(t))return{message:t.message,name:t.name,stack:t.stack,...z(t)};if(L(t)){const{type:n,target:e,currentTarget:r,detail:o}=t;return{type:n,target:e,currentTarget:r,...o?{detail:o}:{},...z(t)}}return t}function z(t){return P(t)?Object.fromEntries(Object.entries(t)):{}}let Y;function J(t){if(void 0!==Y)return Y?Y(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=n;return e in r&&"function"==typeof r[e]?(Y=r[e],Y(t)):(Y=null,t())}function G(){return J(()=>Math.random())}function X(){return J(()=>Date.now())}const K=Symbol.for("sentry.skipNormalization"),Q=Symbol.for("sentry.overrideNormalizationDepth");let V,Z;function tt(t,n=100,e=1/0){try{return rt("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${nt(t)})`}}}function nt(t){try{return String(t)}catch{return"unknown error"}}function et(t,n=3,e=102400){const r=tt(t,n);return o=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(o))>e?et(t,n-1,e):r;var o}function rt(t,n,e=1/0,r=1/0,o=function(){const t=new WeakSet;function n(n){return!!t.has(n)||(t.add(n),!1)}function e(n){t.delete(n)}return[n,e]}()){const[i,s]=o;if(null==n||["boolean","string"].includes(typeof n)||"number"==typeof n&&Number.isFinite(n))return n;const c=ot(t,n);if(!c.startsWith("[object "))return c;if(function(t){return Boolean(t[K])}(n))return n;const u=function(t){const n=t[Q];return"number"==typeof n?n:void 0}(n),a=void 0!==u?u:e;if(0===a)return c.replace("object ","");if(i(n))return"[Circular ~]";const f=n;if(f&&"function"==typeof f.toJSON)try{return rt("",f.toJSON(),a-1,r,o)}catch{}const l=Array.isArray(n)?[]:{};let d=0;const p=W(n);for(const t in p){if(!Object.prototype.hasOwnProperty.call(p,t))continue;if(d>=r){l[t]="[MaxProperties ~]";break}const n=p[t];l[t]=rt(t,n,a-1,r,o),d++}return s(n),l}function ot(t,n){try{if(V){const t=V(n);if(t)return t}if("undefined"!=typeof global&&n===global)return"[Global]";if("number"==typeof n&&!Number.isFinite(n))return`[${n}]`;if("function"==typeof n)return`[Function: ${m(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const t=function(t){const n=Object.getPrototypeOf(t);return n?.constructor?n.constructor.name:"null prototype"}(n);return`[object ${t}]`}catch(t){return`**non-serializable** (${nt(t)})`}}function it(t,n=0){return"string"!=typeof t||0===n||t.length<=n?t:`${t.slice(0,n)}...`}function st(t,n,e=!1){return!!R(t)&&(j(n,"RegExp")?n.test(t):R(n)?e?t===n:t.includes(n):"function"==typeof n&&n(t))}function ct(t,n=[],e=!1){for(const r of n)if(st(t,r,e))return!0;return!1}function ut(t=function(){const t=n;return t.crypto||t.msCrypto}()){try{if(t?.randomUUID)return J(()=>t.randomUUID()).replace(/-/g,"")}catch{}return Z||(Z="10000000100040008000100000000000"),Z.replace(/[018]/g,t=>(t^(16*G()&15)>>t/4).toString(16))}function at(t){return t.exception?.values?.[0]}function ft(t){const{message:n,event_id:e}=t;if(n)return n;const r=at(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||e||"":e||""}function lt(t,n,e){const r=t.exception=t.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=n||""),i.type||(i.type="Error")}function dt(t,n){const e=at(t);e&&pt(e,n)}function pt(t,n){const e=t.mechanism;t.mechanism={type:"generic",handled:!0,...e,...n},n&&"data"in n&&(t.mechanism.data={...e?.data,...n.data})}function ht(t){if(function(t){try{return t.__sentry_captured__}catch{}}(t))return!0;try{q(t,"__sentry_captured__",!0)}catch{}return!1}function mt(){return X()/1e3}let yt,gt=[];function vt(){return(yt??(yt=function(){const{performance:t}=n;if(!t?.now||!t.timeOrigin)return t?.now&&(gt=[{from:0,origin:X()-J(()=>t.now())}]),mt;let e=t.timeOrigin;gt=[{from:0,origin:e}];let r=!0,o=0;return()=>J(()=>{const n=t.now(),i=Date.now();return Math.abs(e+n-i)>1e3&&(e=i-n,r?gt=[{from:0,origin:e}]:(gt.push({from:o,origin:e}),gt.length>100&>.splice(1,1))),r=!1,o=n,(e+n)/1e3})}()))()}function bt(t){const n=vt(),e={sid:ut(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return{sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}(e)};return t&&_t(e,t),e}function _t(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||vt(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:ut()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}function wt(t,n,e=2){if(!n||"object"!=typeof n||e<=0)return n;if(t&&0===Object.keys(n).length)return t;const r={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=wt(r[t],n[t],e-1));return r}function St(){return ut()}function Et(){return ut().substring(16)}class $t{constructor(){this.t=!1,this.o=[],this.i=[],this.u=[],this.l=[],this.p={},this.h={},this.m={},this.v={},this._={},this.S={},q(this,"refs",{}),this.k={traceId:St(),sampleRand:G()}}clone(){const t=new $t;return t.u=[...this.u],t.h={...this.h},t.m={...this.m},t.v={...this.v},t._={...this._},this._.flags&&(t._.flags={values:[...this._.flags.values]}),t.p=this.p,t.I=this.I,t.j=this.j,t.O=this.O,t.T=this.T,t.i=[...this.i],t.l=[...this.l],t.S={...this.S},t.k={...this.k},t.R=this.R,t.C=this.C,t.A=this.A,t.refs={...this.refs},t}setClient(t){this.R=t}setLastEventId(t){this.C=t}getClient(){return this.R}lastEventId(){return this.C}addScopeListener(t){this.o.push(t)}addEventProcessor(t){return this.i.push(t),this}setUser(t){return this.p=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.j&&_t(this.j,{user:t}),this.N(),this}getUser(){return this.p}setConversationId(t){return this.A=t||void 0,this.N(),this}setTags(t){return this.h={...this.h,...t},this.N(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this.m={...this.m,...t},this.N(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this.m&&(delete this.m[t],this.N()),this}setExtras(t){return this.v={...this.v,...t},this.N(),this}setExtra(t,n){return this.v={...this.v,[t]:n},this.N(),this}setFingerprint(t){return this.T=t,this.N(),this}setLevel(t){return this.I=t,this.N(),this}setTransactionName(t){return this.O=t,this.N(),this}setContext(t,n){return null===n?delete this._[t]:this._[t]=n,this.N(),this}setSession(t){return t?this.j=t:delete this.j,this.N(),this}getSession(){return this.j}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,e=n instanceof $t?n.getScopeData():N(n)?t:void 0,{tags:r,attributes:o,extra:i,user:s,contexts:c,level:u,fingerprint:a=[],propagationContext:f,conversationId:l}=e||{};return this.h={...this.h,...r},this.m={...this.m,...o},this.v={...this.v,...i},this._={...this._,...c},s&&Object.keys(s).length&&(this.p=s),u&&(this.I=u),a.length&&(this.T=a),f&&(this.k=f),l&&(this.A=l),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:mt(),...t,message:t.message?it(t.message,2048):t.message};return this.u.push(r),this.u.length>e&&(this.u=this.u.slice(-e)),this.N(),this}getLastBreadcrumb(){return this.u[this.u.length-1]}clearBreadcrumbs(){return this.u=[],this.N(),this}addAttachment(t){return this.l.push(t),this}clearAttachments(){return this.l=[],this}getScopeData(){return{breadcrumbs:this.u,attachments:this.l,contexts:this._,tags:this.h,attributes:this.m,extra:this.v,user:this.p,level:this.I,fingerprint:this.T||[],eventProcessors:this.i,propagationContext:this.k,sdkProcessingMetadata:this.S,transactionName:this.O,conversationId:this.A}}setSDKProcessingMetadata(t){return this.S=wt(this.S,t,2),this}setPropagationContext(t){return this.k=t,this}getPropagationContext(){return this.k}captureException(t,n){const e=n?.event_id||ut();if(!this.R)return e;const r=new Error("Sentry syntheticException");return this.R.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e?.event_id||ut();if(!this.R)return r;const o=e?.syntheticException??new Error(t);return this.R.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=t.event_id||n?.event_id||ut();return this.R?(this.R.captureEvent(t,{...n,event_id:e},this),e):e}N(){this.t||(this.t=!0,this.o.forEach(t=>{t(this)}),this.t=!1)}}const kt="__SENTRY_SUPPRESS_TRACING__",xt=t=>t instanceof Promise&&!t[It],It=Symbol("chained PromiseLike"),jt=(t,n)=>{if(!n)return t;let e=!1;for(const r in t){if(r in n)continue;e=!0;const o=t[r];"function"==typeof o?Object.defineProperty(n,r,{value:(...n)=>o.apply(t,n),enumerable:!0,configurable:!0,writable:!0}):n[r]=o}return e&&Object.assign(n,{[It]:!0}),n};class Ot{constructor(t,n){let e,r;e=t||new $t,r=n||new $t,this.P=[{scope:e}],this.L=r}withScope(t){const n=this.M();let e;try{e=t(n)}catch(t){throw this.D(),t}return M(e)?((t,n,e)=>{const r=t.then(t=>(n(t),t),t=>{throw e(t),t});return xt(r)&&xt(t)?r:jt(t,r)})(e,()=>this.D(),()=>this.D()):(this.D(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.L}getStackTop(){return this.P[this.P.length-1]}M(){const t=this.getScope().clone();return this.P.push({client:this.getClient(),scope:t}),t}D(){return!(this.P.length<=1)&&!!this.P.pop()}}function Tt(){const t=o(r());return t.stack=t.stack||new Ot(i("defaultCurrentScope",()=>new $t),i("defaultIsolationScope",()=>new $t))}function Rt(t){return Tt().withScope(t)}function Ct(t,n){const e=Tt();return e.withScope(()=>(e.getStackTop().scope=t,n(t)))}function At(t){return Tt().withScope(()=>t(Tt().getIsolationScope()))}function Nt(t){return Rt(n=>{n.setSDKProcessingMetadata({[kt]:!0});const e=t();return n.setSDKProcessingMetadata({[kt]:void 0}),e})}function Pt(t){const n=o(t);return n.acs?n.acs:{suppressTracing:Nt,withIsolationScope:At,withScope:Rt,withSetScope:Ct,withSetIsolationScope:(t,n)=>At(n),getCurrentScope:()=>Tt().getScope(),getIsolationScope:()=>Tt().getIsolationScope()}}function Lt(t,n){const{value:e,unit:r}="object"==typeof(o=t)&&null!=o&&!Array.isArray(o)&&Object.keys(o).includes("value")?t:{value:t,unit:void 0};var o;const i=function(t){if(Array.isArray(t))return{value:t,type:"array"};const n="string"==typeof t?"string":"boolean"==typeof t?"boolean":"number"!=typeof t||Number.isNaN(t)?null:Number.isInteger(t)?"integer":"double";if(n)return{value:t,type:n}}(e),s=r&&"string"==typeof r?{unit:r}:{};if(i)return{...i,...s};if(!n||"skip-undefined"===n&&void 0===e)return;let c="";try{c=JSON.stringify(e)??""}catch{}return{value:c,type:"string",...s}}function Mt(t,n=!1){const e={};for(const[r,o]of Object.entries(t??{})){const t=Lt(o,n);t&&(e[r]=t)}return e}function Dt(){return o(r()).externalPropagationContextProvider?.()}function Ft(){return Pt(r()).getCurrentScope()}function Ut(){return Pt(r()).getIsolationScope()}function qt(){return i("globalScope",()=>new $t)}function Bt(...t){const n=Pt(r());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}function Ht(){return Ft().getClient()}function Wt(t){const n=Dt();if(n)return{trace_id:n.traceId,span_id:n.spanId};const e=t.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:i}=e,s={trace_id:r,span_id:i||Et()};return o&&(s.parent_span_id=o),s}const zt="culture.calendar",Yt="culture.locale",Jt="culture.timezone",Gt="sentry.exclusive_time",Xt="sentry.is_localhost",Kt="sentry.op",Qt="sentry.profile_id",Vt="sentry.segment.name.source",Zt="sentry.status.message",tn="url.full",nn="user_agent.original",en="sentry.sample_rate",rn="sentry.custom_span_name",on=["ok","deadline_exceeded","unauthenticated","permission_denied","not_found","resource_exhausted","invalid_argument","unimplemented","unavailable","internal_error","unknown_error","cancelled","already_exists","failed_precondition","aborted","out_of_range","data_loss"];function sn(t){if(t){if("object"==typeof t&&"deref"in t&&"function"==typeof t.deref)try{return t.deref()}catch{return}return t}}function cn(t){const n=t;return{scope:n._sentryScope,isolationScope:sn(n._sentryIsolationScope)}}const un="sentry-";function an(t){const n=function(t){if(!t||!R(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce((t,n)=>{const e=ln(n);return Object.entries(e).forEach(([n,e])=>{t[n]=e}),t},{});return ln(t)}(t);if(!n)return;const e=Object.entries(n).reduce((t,[n,e])=>{if(n.startsWith(un)){t[n.slice(7)]=e}return t},{});return Object.keys(e).length>0?e:void 0}function fn(t){if(!t)return;return function(t){if(0===Object.keys(t).length)return;return Object.entries(t).reduce((t,[n,e],r)=>{const o=`${encodeURIComponent(n)}=${encodeURIComponent(e)}`,i=0===r?o:`${t},${o}`;return i.length>8192?t:i},"")}(Object.entries(t).reduce((t,[n,e])=>(e&&(t[`${un}${n}`]=e),t),{}))}function ln(t){return t.split(",").map(t=>{const n=t.indexOf("=");if(-1===n)return[];return[t.slice(0,n),t.slice(n+1)].map(t=>{try{return decodeURIComponent(t.trim())}catch{return}})}).reduce((t,[n,e])=>(n&&e&&(t[n]=e),t),{})}const dn=/^o(\d+)\./,pn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function hn(t,n=!1){const{host:e,path:r,pass:o,port:i,projectId:s,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${i?`:${i}`:""}/${r?`${r}/`:r}${s}`}function mn(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function yn(t){const n=t.getOptions(),{host:e}=t.getDsn()||{};let r;return n.orgId?r=String(n.orgId):e&&(r=function(t){const n=t.match(dn);return n?.[1]}(e)),r}function gn(t){const n="string"==typeof t?function(t){const n=pn.exec(t);if(!n)return void u(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});const[e,r,o="",i="",s="",c=""]=n.slice(1);let a="",f=c;const l=f.split("/");if(l.length>1&&(a=l.slice(0,-1).join("/"),f=l.pop()),f){const t=f.match(/^\d+/);t&&(f=t[0])}return mn({host:i,pass:o,path:a,projectId:f,port:s,protocol:e,publicKey:r})}(t):mn(t);if(n)return n}function vn(t){if("boolean"==typeof t)return Number(t);const n="string"==typeof t?parseFloat(t):t;return"number"!=typeof n||isNaN(n)||n<0||n>1?void 0:n}const bn=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function _n(t,n){const e=function(t){if(!t)return;const n=t.match(bn);if(!n)return;let e;return"1"===n[3]?e=!0:"0"===n[3]&&(e=!1),{traceId:n[1],parentSampled:e,parentSpanId:n[2]}}(t),r=an(n);if(!e?.traceId)return{traceId:St(),sampleRand:G()};const o=function(t,n){const e=vn(n?.sample_rand);if(void 0!==e)return e;const r=vn(n?.sample_rate);return r&&void 0!==t?.parentSampled?t.parentSampled?G()*r:r+G()*(1-r):G()}(e,r);r&&(r.sample_rand=o.toString());const{traceId:i,parentSpanId:s,parentSampled:c}=e;return{traceId:i,parentSpanId:s,sampled:c,dsc:r||{},sampleRand:o}}function wn(t=St(),n=Et(),e){let r="";return void 0!==e&&(r=e?"-1":"-0"),`${t}-${n}${r}`}function Sn(t=St(),n=Et(),e){return`00-${t}-${n}-${e?"01":"00"}`}const En="span";function $n(t){const{spanId:n,traceId:e,isRemote:r}=t.spanContext(),o=r?n:Tn(t).parent_span_id,i=cn(t).scope;return{parent_span_id:o,span_id:r?i?.getPropagationContext().propagationSpanId||Et():n,trace_id:e}}function kn(t){const{traceId:n,spanId:e}=t.spanContext();return wn(n,e,Nn(t))}function xn(t){return t&&t.length>0?t.map(({context:{spanId:t,traceId:n,traceFlags:e,...r},attributes:o})=>({span_id:t,trace_id:n,sampled:1===e,attributes:o,...r})):void 0}function In(t){return t?.length?t.map(({context:{spanId:t,traceId:n,traceFlags:e},attributes:r})=>({span_id:t,trace_id:n,sampled:1===e,attributes:r})):void 0}function jn(t){return"number"==typeof t?On(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?On(t.getTime()):vt()}function On(t){return t>9999999999?t/1e3:t}function Tn(t){if(An(t))return t.getStaticSpanJSON();const{spanId:n,traceId:e}=t.spanContext();if(Cn(t)){const{attributes:r,startTime:o,name:i,endTime:s,status:c,links:u}=t;return{span_id:n,trace_id:e,data:r,description:i,parent_span_id:Rn(t),start_timestamp:jn(o),timestamp:jn(s)||void 0,status:Pn(c),op:r[Kt],origin:r["sentry.origin"],links:xn(u)}}return{span_id:n,trace_id:e,start_timestamp:0,status:"ok",data:{}}}function Rn(t){return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0}function Cn(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}function An(t){return"function"==typeof t.getSpanJSON}function Nn(t){const{traceFlags:n}=t.spanContext();return 1===n}function Pn(t){return t&&0!==t.code?1===t.code?"ok":t.message&&("ok"!==(n=t.message)&&on.includes(n))?t.message:"internal_error":"ok";var n}function Ln(t){return t&&1!==t.code&&0!==t.code&&"cancelled"!==t.message?"error":"ok"}function Mn(t,n){const e="error"===Ln(n)?n?.message:void 0;return{...e&&{[Zt]:e},...t}}const Dn="_sentryRootSpan",Fn=Un;function Un(t){return t[Dn]||t}function qn(t){return t===Un(t)}function Bn(t){const n=Pt(r());return n.getActiveSpan?n.getActiveSpan(t):function(t){return sn(t.refs[En])}(t||Ft())}function Hn(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const n=t||Ht()?.getOptions();return!(!n||null==n.tracesSampleRate&&!n.tracesSampler)}function Wn(t,n){if(!n?.length)return!1;for(const e of n){if(Jn(e)){if(t.description&&st(t.description,e))return!0;continue}const n=!!e.attributes&&Object.keys(e.attributes).length>0;if(!e.name&&!e.op&&!n)continue;const r=!e.name||t.description&&st(t.description,e.name),o=!e.op||t.op&&st(t.op,e.op),i=!e.attributes||Object.entries(e.attributes).every(([n,e])=>zn(t.attributes?.[n],e));if(r&&o&&i)return!0}return!1}function zn(t,n){return"string"==typeof t&&("string"==typeof n||n instanceof RegExp)?st(t,n):Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every((t,e)=>t===n[e]):t===n}function Yn(t,n){const e=n.parent_span_id,r=n.span_id;if(e)for(const n of t)n.parent_span_id===r&&(n.parent_span_id=e)}function Jn(t){return"string"==typeof t||t instanceof RegExp}const Gn=[];function Xn(t){const n=t.defaultIntegrations||[],e=t.integrations;let r;if(n.forEach(t=>{t.isDefaultInstance=!0}),Array.isArray(e))r=[...n,...e];else if("function"==typeof e){const t=e(n);r=Array.isArray(t)?t:[t]}else r=n;return function(t){const n={};return t.forEach(t=>{const{name:e}=t,r=n[e];r&&!r.isDefaultInstance&&t.isDefaultInstance||(n[e]=t)}),Object.values(n)}(r)}function Kn(t,n){for(const e of n)e?.afterAllSetup&&e.afterAllSetup(t)}function Qn(t,n,e){if(!e[n.name]){if(e[n.name]=n,Gn.includes(n.name)||"function"!=typeof n.setupOnce||(n.setupOnce(),Gn.push(n.name)),n.setup&&"function"==typeof n.setup&&n.setup(t),"function"==typeof n.preprocessEvent){const e=n.preprocessEvent.bind(n);t.on("preprocessEvent",(n,r)=>e(n,r,t))}if("function"==typeof n.processEvent){const e=n.processEvent.bind(n),r=Object.assign((n,r)=>e(n,r,t),{id:n.name});t.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(e=>{const r=n[e];"function"==typeof r&&t.on(e,e=>r.call(n,e,t))})}}const Vn="production",Zn=Symbol.for("sentry.nonRecordingSpan");function te(t){return!!t&&!0===t[Zn]}function ne(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o={environment:e.environment||Vn,release:e.release,public_key:r,trace_id:t,org_id:yn(n)};return n.emit("createDsc",o),o}function ee(t,n){if(Dt())return;const e=n.getPropagationContext();return e.dsc||ne(e.traceId,t)}function re(t){const n=Ht();if(!n)return{};const e=Fn(t),r=Tn(e),o=r.data,i=e.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[en]??o["sentry.previous_trace_sample_rate"];function c(t){return"number"!=typeof s&&"string"!=typeof s||(t.sample_rate=`${s}`),t}const u=e._frozenDsc;if(u)return c(u);const a=te(e),f=a&&"ignored"===e.dropReason;if(a&&(!Hn(n.getOptions())||f)){const t=cn(e).scope,r=t&&ee(n,t);if(r){const t={...r};return f&&(t.sampled="false"),c(t)}}const l=i?.get("sentry.dsc"),d=l&&an(l);if(d)return c(d);const p=ne(t.spanContext().traceId,n),h=o[Vt],m=r.description;return"url"!==h&&m&&(p.transaction=m),Hn()&&(p.sampled=String(Nn(e)),p.sample_rand=i?.get("sentry.sample_rand")??cn(e).scope?.getPropagationContext().sampleRand.toString()),c(p),n.emit("createDsc",p,e),p}function oe(t,n){const{fingerprint:e,breadcrumbs:r,sdkProcessingMetadata:o}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:i,level:s,transactionName:c}=n;Object.keys(e).length&&(t.extra={...e,...t.extra});Object.keys(r).length&&(t.tags={...r,...t.tags});Object.keys(o).length&&(t.user={...o,...t.user});Object.keys(i).length&&(t.contexts={...i,...t.contexts});s&&(t.level=s);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),function(t,n){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint.length||delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,r),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,o)}function ie(t,n){const{extra:e,tags:r,attributes:o,user:i,contexts:s,level:c,sdkProcessingMetadata:u,breadcrumbs:a,fingerprint:f,eventProcessors:l,attachments:d,propagationContext:p,transactionName:h}=n;se(t,"extra",e),se(t,"tags",r),se(t,"attributes",o),se(t,"user",i),se(t,"contexts",s),t.sdkProcessingMetadata=wt(t.sdkProcessingMetadata,u,2),c&&(t.level=c),h&&(t.transactionName=h),a.length&&(t.breadcrumbs=[...t.breadcrumbs,...a]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...p}}function se(t,n,e){t[n]=wt(t[n],e,1)}function ce(t,n){const e=qt().getScopeData();return t&&ie(e,t.getScopeData()),n&&ie(e,n.getScopeData()),e}function ue(t,n,e){let r;try{r=n()}catch(n){return ae(t,n,e)}return M(r)?r.then(void 0,n=>ae(t,n,e)):r}function ae(t,n,e){return e(n)}function fe(t,n){return ue("",()=>n(t),()=>t)||t}function le(t){const n={trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,name:t.description||"",start_timestamp:t.start_timestamp,end_timestamp:t.timestamp,status:t.status&&"ok"!==t.status&&"cancelled"!==t.status?"error":"ok",is_segment:!1,attributes:{...t.data},links:t.links};return e=n,{...e,end_timestamp:e.end_timestamp??e.start_timestamp,attributes:Mt(e.attributes),links:e.links?.map(t=>({...t,attributes:Mt(t.attributes)}))};var e}function de(t,n){const e=t.attributes??(t.attributes={});Object.entries(n).forEach(([t,n])=>{null==n||t in e||(e[t]=n)})}function pe(t,n=[]){return[t,n]}function he(t,n){const[e,r]=t;return[e,[...r,n]]}function me(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function ye(t){const e=o(n);return e.encodePolyfill?e.encodePolyfill(t):(new TextEncoder).encode(t)}function ge(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[ye(r),t]:r.push("string"==typeof t?ye(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch{t=JSON.stringify(tt(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce((t,n)=>t+n.length,0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}function ve(t){const n="string"==typeof t.data?ye(t.data):t.data;return[{type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},n]}const be={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",metric:"trace_metric"};function _e(t){return function(t){return t in be}(t)?be[t]:t}function we(t){if(!t?.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}function Se(t){return"replay_event"===t?"replay":t||"error"}function Ee(){return"undefined"!=typeof window&&!0}const $e=new WeakMap;function ke(t,n,e){const r=A(o=n.originalException)?void 0:o;var o;const i=r&&$e.get(r);if(!i)return;const s=t.contexts?.trace;(s?.trace_id??(e&&Wt(e).trace_id))===i.trace_id&&(t.contexts={...t.contexts,trace:{...s,...i}})}function xe(t,n){const e=Ie();return e.withActiveSpan?e.withActiveSpan(t,n):Bt(t=>(function(t){delete t.refs[En]}(t),n(t)))}function Ie(){return Pt(r())}function je(t,n,e,r){const o=we(e),i=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){if(!n)return t;const e=t.sdk||{};t.sdk={...e,name:e.name||n.name,version:e.version||n.version,integrations:[...t.sdk?.integrations||[],...n.integrations||[]],packages:[...t.sdk?.packages||[],...n.packages||[]],settings:t.sdk?.settings||n.settings?{...t.sdk?.settings,...n.settings}:void 0}}(t,e?.sdk);const s=function(t,n,e,r){const o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date(X()).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:hn(r)},...o&&{trace:o}}}(t,o,r,n);delete t.sdkProcessingMetadata;return pe(s,[[{type:i},t]])}const Oe="[Filtered]",Te=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"];function Re(t,n,e){if(!1===n)return!0;const r=t.toLowerCase();if(function(t,n){return n.some(n=>t.includes(n))}(r,Te))return!0;if(!0===n)return!1;const o=("deny"in n?n.deny:n.allow).some(t=>r.includes(t.toLowerCase()));return"deny"in n?o:!o}function Ce(t,n,e){if(!1===n)return{};const r={};for(const e of Object.keys(t))r[e]=Re(e,n)?Oe:t[e];return r}function Ae(t){return new Pe(n=>{n(t)})}function Ne(t){return new Pe((n,e)=>{e(t)})}class Pe{constructor(t){this.F=0,this.U=[],this.q(t)}then(t,n){return new Pe((e,r)=>{this.U.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.B()})}catch(t){return this.then(t=>t,t)}finally(t){return new Pe((n,e)=>{let r,o;return this.then(n=>{o=!1,r=n,t&&t()},n=>{o=!0,r=n,t&&t()}).then(()=>{o?e(r):n(r)})})}B(){if(0===this.F)return;const t=this.U.slice();this.U=[],t.forEach(t=>{t[0]||(1===this.F&&t[1](this.H),2===this.F&&t[2](this.H),t[0]=!0)})}q(t){const n=(t,n)=>{0===this.F&&(M(n)?n.then(e,r):(this.F=t,this.H=n,this.B()))},e=t=>{n(1,t)},r=t=>{n(2,t)};try{t(e,r)}catch(t){r(t)}}}function Le(t,n,e,r=0,o){try{const i=Me(n,e,t,r,o);return M(i)?i:Ae(i)}catch(t){return Ne(t)}}function Me(t,n,e,r,o){const i=e[r];if(!t||!i)return t;let s=!1;const c=ue("",()=>i({...t},n),()=>(s=!0,null));return M(c)?c.then(t=>t?Me(t,n,e,r+1,o):(o?.(s?"callback_error":"event_processor"),null)):c?Me(c,n,e,r+1,o):(o?.(s?"callback_error":"event_processor"),null)}let De,Fe,Ue,qe;function Be(t){return!0===t.data?.__sentry__}function He(t,e,r,o,i,s){const{normalizeDepth:c=3,normalizeMaxBreadth:u=1e3}=t,a={...e,event_id:e.event_id||r.event_id||ut(),timestamp:e.timestamp||mt()},f=r.integrations||t.integrations.map(t=>t.name);!function(t,n){const{environment:e,release:r,dist:o,maxValueLength:i}=n;t.environment=t.environment||e||Vn,!t.release&&r&&(t.release=r);!t.dist&&o&&(t.dist=o);const s=t.request;s?.url&&i&&(s.url=it(s.url,i));i&&t.exception?.values?.forEach(t=>{t.value&&(t.value=it(t.value,i))})}(a,t),function(t,n){n.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...n])}(a,f),i&&i.emit("applyFrameMetadata",e),void 0===e.type&&function(t,e){const r=function(t){const e=n._sentryDebugIds,r=n.W;if(!e&&!r)return{};const o=e?Object.keys(e):[],i=r?Object.keys(r):[];if(qe&&o.length===Fe&&i.length===Ue)return qe;Fe=o.length,Ue=i.length,qe={},De||(De={});const s=(n,e)=>{for(const r of n){const n=e[r],o=De?.[r];if(o&&qe&&n)qe[o[0]]=n,De&&(De[r]=[o[0],n]);else if(n){const e=t(r);for(let t=e.length-1;t>=0;t--){const o=e[t],i=o?.filename;if(i&&qe&&De){qe[i]=n,De[r]=[i,n];break}}}}};return e&&s(o,e),r&&s(i,r),qe}(e);t.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(t=>{t.filename&&(t.debug_id=r[t.filename])})})}(a,t.stackParser);const l=function(t,n){if(!n)return t;const e=t?t.clone():new $t;return e.update(n),e}(o,r.captureContext);r.mechanism&&function(t,n){const e=t.exception?.values,r=e?.find(t=>0===t.mechanism?.exception_id)??e?.[0];r&&pt(r,n)}(a,r.mechanism);const d=i?i.getEventProcessors():[],p=ce(s,l),h=[...r.attachments||[],...p.attachments];h.length&&(r.attachments=h),oe(a,p);const m=Bn(l);m&&function(t,n){t.contexts={trace:$n(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:re(n),...t.sdkProcessingMetadata};const e=Tn(Fn(n)).description;e&&!t.transaction&&"transaction"===t.type&&(t.transaction=e)}(a,m),ke(a,r,l);const y=[...d,...p.eventProcessors],g="transaction"===e.type,v=e.spans?.length||0;return(Be(r)?Ae(a):Le(y,a,r,0,t=>{i&&(i.recordDroppedEvent(t,Se(e.type)),g&&i.recordDroppedEvent(t,"span",1+v))})).then(t=>{if(!t)return null;if(g&&i){const n=v-(t.spans?.length||0);n>0&&i.recordDroppedEvent("event_processor","span",n)}return function(t){const n={};if(t.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(t=>{t.debug_id&&(t.abs_path?n[t.abs_path]=t.debug_id:t.filename&&(n[t.filename]=t.debug_id),delete t.debug_id)})}),0===Object.keys(n).length)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const e=t.debug_meta.images;Object.entries(n).forEach(([t,n])=>{e.push({type:"sourcemap",code_file:t,debug_id:n})})}(t),"number"==typeof c&&c>0?function(t,n,e){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(t=>({...t,...t.data&&{data:tt(t.data,n,e)}}))},...t.user&&{user:tt(t.user,n,e)},...t.contexts&&{contexts:tt(t.contexts,n,e)},...t.extra&&{extra:tt(t.extra,n,e)}};t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=tt(t.contexts.trace.data,n,e)));t.spans&&(r.spans=t.spans.map(t=>({...t,...t.data&&{data:tt(t.data,n,e)}})));t.contexts?.flags&&r.contexts&&(r.contexts.flags=tt(t.contexts.flags,3,e));return r}(t,c,u):t})}function We(t){if(t)return function(t){return t instanceof $t||"function"==typeof t}(t)||function(t){return Object.keys(t).some(t=>ze.includes(t))}(t)?{captureContext:t}:t}const ze=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function captureException(t,n){return Ft().captureException(t,We(n))}function Ye(t,n){return Ft().captureEvent(t,n)}function Je(){return Ut().lastEventId()}function Ge(){const t=Ht();return!1!==t?.getOptions().enabled&&!!t?.getTransport()}function Xe(t){const e=Ut(),{user:r}=ce(e,Ft());let o=n.navigator?.userAgent;if(o){o=Ce({"User-Agent":o},Ht()?.getDataCollectionOptions().httpHeaders.request??!0)["User-Agent"]}const i=bt({user:r,userAgent:o,...t}),s=e.getSession();return"ok"===s?.status&&_t(s,{status:"exited"}),Ke(),e.setSession(i),i}function Ke(){const t=Ut(),n=Ft().getSession()||t.getSession();n&&function(t){let n={};"ok"===t.status&&(n={status:"exited"}),_t(t,n)}(n),Qe(),t.setSession()}function Qe(){const t=Ut(),n=Ht(),e=t.getSession();e&&n&&n.captureSession(e)}function Ve(t=!1){t?Ke():Qe()}function Ze(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}function tr(t,n,e){return n||`${function(t){return`${Ze(t)}${t.projectId}/envelope/`}(t)}?${function(t,n){const e={sentry_version:"7"};return t.publicKey&&(e.sentry_key=t.publicKey),n&&(e.sentry_client=`${n.name}/${n.version}`),new URLSearchParams(e).toString()}(t,e)}`}function nr(t,n){if("transaction"!==t.type||!t.spans?.length||!t.sdkProcessingMetadata?.hasGenAiSpans||function(t){return"stream"===t.getOptions().traceLifecycle}(n))return;const e=[],r=[];for(const n of t.spans)n.op?.startsWith("gen_ai.")?e.push(le(n)):r.push(n);return 0!==e.length?(t.spans=r,function(t,n){const e=n.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:t.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,ingest_settings:Ee()?{infer_ip:e,infer_user_agent:e}:void 0,items:t}]}(e,n)):void 0}const er=Symbol.for("SentryBufferFullError");function rr(t=100){const n=new Set;function e(t){n.delete(t)}return{get $(){return Array.from(n)},add:function(r){if(!(n.sizee(o),()=>e(o)),o},drain:function(t){if(!n.size)return Ae(!0);const e=Promise.allSettled(Array.from(n)).then(()=>!0);if(!t)return e;const r=[e,new Promise(n=>{return"object"==typeof(e=setTimeout(()=>n(!1),t))&&"function"==typeof e.unref&&e.unref(),e;var e})];return Promise.race(r)}}}function or(t,{statusCode:n,headers:e},r=X()){const o={...t},i=e?.["x-sentry-rate-limits"],s=e?.["retry-after"];if(i)for(const t of i.trim().split(",")){const[n,e,,,i]=t.split(":",5),s=parseInt(n,10),c=1e3*(isNaN(s)?60:s);if(e)for(const t of e.split(";"))"metric_bucket"===t&&i&&!i.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else s?o.all=r+function(t,n=X()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?6e4:r-n}(s,r):429===n&&(o.all=r+6e4);return o}function ir(t,n,e=rr(t.bufferSize||64)){let r={};function o(n,[e,r],o){const i=_e(o);"transaction"===o&&t.recordDroppedEvent(n,"span",(r.spans?.length??0)+1),t.recordDroppedEvent(n,i,"number"==typeof e.item_count?e.item_count:1)}return{send:function(t){const i=[];if(me(t,(t,n)=>{!function(t,n,e=X()){return function(t,n){return t[n]||t.all||0}(t,n)>e}(r,_e(n))?i.push(t):o("ratelimit_backoff",t,n)}),0===i.length)return Promise.resolve({});const s=pe(t[0],i),c=t=>{(function(t,n){return me(t,(t,e)=>n.includes(e))})(s,["client_report"])||me(s,(n,e)=>{o(t,n,e)})};return e.add(()=>n({body:ge(s)}).then(t=>413===t.statusCode?(c("send_error"),t):(r=or(r,t),t),t=>{throw c("network_error"),t})).then(t=>t,t=>{if(t===er)return c("queue_overflow"),Promise.resolve({});throw t})},flush:t=>e.drain(t)}}const sr={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},mcp:{inputs:!0,outputs:!0},databaseQueryData:!0,queues:!0,stackFrameVariables:!0,frameContextLines:5};const cr=Symbol.for("SentryInternalError"),ur=Symbol.for("SentryDoNotSendEventError"),ar=Symbol.for("SentryClosedClient");function fr(t){return{message:t,[cr]:!0}}function lr(t){return{message:t,[ur]:!0}}function dr(t){return lr(`Discarding event because it's not included in the random sample (sampling rate = ${t})`)}class pr{constructor(t){if(this.Y={attachStacktrace:!0,...t,traceLifecycle:"static"===t.traceLifecycle?"static":"stream"},this._integrations={},this.J=0,this.G={},this.X={},this.i=[],this.K=rr(t.transportOptions?.bufferSize??64),this.V=function(t){const n=t.dataCollection??{};return{userInfo:n.userInfo??sr.userInfo,cookies:n.cookies??sr.cookies,httpHeaders:(e=n.httpHeaders,void 0===e?{...sr.httpHeaders}:"boolean"==typeof(r=e)||"allow"in r||"deny"in r?{request:e,response:e}:{request:e.request??sr.httpHeaders.request,response:e.response??sr.httpHeaders.response}),httpBodies:n.httpBodies??sr.httpBodies,urlQueryParams:n.urlQueryParams??sr.urlQueryParams,graphQL:{document:n.graphQL?.document??sr.graphQL.document,variables:n.graphQL?.variables??sr.graphQL.variables},genAI:{inputs:n.genAI?.inputs??sr.genAI.inputs,outputs:n.genAI?.outputs??sr.genAI.outputs},mcp:{inputs:n.mcp?.inputs??sr.mcp.inputs,outputs:n.mcp?.outputs??sr.mcp.outputs},databaseQueryData:n.databaseQueryData??sr.databaseQueryData,queues:n.queues??sr.queues,stackFrameVariables:n.stackFrameVariables??sr.stackFrameVariables,frameContextLines:n.frameContextLines??sr.frameContextLines};var e,r}(t),this.Z="crashed",this.tt=void 0===t.attachStacktrace,t.dsn&&(this.nt=gn(t.dsn)),this.nt){const n=tr(this.nt,t.tunnel,t._metadata?t._metadata.sdk:void 0);this.et=t.transport({tunnel:this.Y.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,e){const r=ut();if(ht(t))return r;const o={event_id:r,...n};return this.rt(()=>this.eventFromException(t,o).then(t=>this.ot(t,o,e)).then(t=>t),"error"),o.event_id}captureMessage(t,n,e,r){const o={event_id:ut(),...e},i=C(t)?t:String(t),s=A(t),c=s?this.eventFromMessage(i,n,o).then(t=>(t.exception&&this.tt&&(t.sdkProcessingMetadata={...t.sdkProcessingMetadata,hasDefaultSyntheticStacktrace:!0}),t)):this.eventFromException(t,o);return this.rt(()=>c.then(t=>this.ot(t,o,r)),s?"unknown":"error"),o.event_id}captureEvent(t,n,e){const r=ut();if(n?.originalException&&ht(n.originalException))return r;const o={event_id:r,...n},i=t.sdkProcessingMetadata||{},s=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=Se(t.type);return this.rt(()=>this.ot(t,o,s||e,c),u),o.event_id}captureSession(t){this.sendSession(t),_t(t,{init:!1})}getDsn(){return this.nt}getOptions(){return this.Y}getDataCollectionOptions(){return this.V}getSdkMetadata(){return this.Y._metadata}getTransport(){return this.et}async flush(t){const n=this.et;if(this.emit("flush"),!n)return!0;const e=await this.it(t),r=await n.flush(t);return e&&r}async close(t){Object.defineProperty(this,ar,{value:!0});const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this.i}addEventProcessor(t){this.i.push(t)}init(){var t;(this.st()||this.Y.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&(this.ct(),"stream"===(t=this.Y).traceLifecycle&&(t.beforeSendTransaction||t.ignoreTransactions?.length)&&u(()=>{console.warn("[Sentry] `beforeSendTransaction` and `ignoreTransactions` are ignored with `traceLifecycle: 'stream'` (enabled by default). Use `beforeSendSpan` and `ignoreSpans` instead, or set `traceLifecycle: 'static'`.")}))}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Qn(this,t,this._integrations),n||Kn(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);const e=nr(t,this);let r=je(t,this.nt,this.Y._metadata,this.Y.tunnel);if(!Be(n))for(const t of n.attachments||[])r=he(r,ve(t));e&&(r=he(r,e)),this.sendEnvelope(r).then(n=>this.emit("afterSendEvent",t,n))}sendSession(t){const{release:n,environment:e=Vn}=this.Y;if("aggregates"in t){const r=t.attrs||{};if(!r.release&&!n)return;r.release=r.release||n,r.environment=r.environment||e,t.attrs=r}else{if(!t.release&&!n)return;t.release=t.release||n,t.environment=t.environment||e}this.emit("beforeSendSession",t);const r=function(t,n,e,r){const o=we(e);return pe({sent_at:new Date(X()).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:hn(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(t,this.nt,this.Y._metadata,this.Y.tunnel);this.sendEnvelope(r)}recordDroppedEvent(t,n,e=1){if(this.Y.sendClientReports){const r=`${t}:${n}`;this.G[r]=(this.G[r]||0)+e}}on(t,n){const e=this.X[t]=this.X[t]||new Set,r=(...t)=>n(...t);return e.add(r),()=>{e.delete(r)}}emit(t,...n){const e=this.X[t];e&&e.forEach(t=>t(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this.st()&&this.et)try{const n=await this.et.send(t);return this.emit("afterEnvelope",t),n}catch(t){return{}}return{}}registerCleanup(t){}dispose(){}ct(){const{integrations:t}=this.Y;this._integrations=function(t,n){const e={};return n.forEach(n=>{n?.beforeSetup&&n.beforeSetup(t)}),n.forEach(n=>{n&&Qn(t,n,e)}),e}(this,t),Kn(this,t)}ut(t,n){let e="fatal"===n.level,r=!1;const o=n.exception?.values;if(o){r=!0,e=!1;for(const t of o)if(!1===t.mechanism?.handled){e=!0;break}}const i="ok"===t.status;(i&&0===t.errors||i&&e)&&(_t(t,{...e&&{status:this.Z},errors:t.errors||Number(r||e)}),this.captureSession(t))}async it(t){let n=0;for(;!t||nsetTimeout(t,1)),!this.J)return!0;n++}return!1}st(){return!1!==this.getOptions().enabled&&void 0!==this.et}ft(t,n,e,r){const o=this.getOptions(),i=this.getIntegrationNames();return!n.integrations&&i.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||r.setLastEventId(t.event_id||n.event_id),He(o,t,n,e,this,r).then(t=>{if(null===t)return t;this.emit("postprocessEvent",t,n),t.contexts={trace:{...t.contexts?.trace,...Wt(e)},...t.contexts};const r=ee(this,e);return t.sdkProcessingMetadata={dynamicSamplingContext:r,...t.sdkProcessingMetadata},t})}ot(t,n={},e=Ft(),r=Ut()){return this.lt(t,n,e,r).then(t=>t.event_id,t=>{})}lt(t,n,e,r){const o=this.getOptions(),{sampleRate:i}=o,s=mr(t),c=hr(t),u=`before send for type \`${t.type||"error"}\``;let a="before_send",f=0;const l=void 0===i?void 0:vn(i),d=c&&"number"==typeof l&&G()>l,p=Se(t.type);let h=0;const m=e.getSession()||r.getSession();return d&&"ok"!==m?.status?(this.recordDroppedEvent("sample_rate","error"),Ne(dr(i))):this.ft(t,n,e,r).then(t=>{if(null===t)throw lr("An event processor returned `null`, will not send event.");return h=t.spans?.length||0,Be(n)?t:function(t,n,e,r,o){const{beforeSend:i,ignoreSpans:s,beforeSendTransaction:c}=t,u=(a=t.beforeSendSpan,!!a&&"function"==typeof a&&"_static"in a&&!!a._static&&t.beforeSendSpan);var a;let f=n;if(hr(f)&&i){const t=f;return ue("",()=>i(t,e),()=>(r("callback_error"),null))}if(mr(f)){if(u||s){const t=function(t){const{trace_id:n,parent_span_id:e,span_id:r,status:o,origin:i,data:s,op:c,links:u}=t.contexts?.trace??{};return{data:s??{},description:t.transaction,op:c,parent_span_id:e,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o??"ok",timestamp:t.timestamp,trace_id:n??"",origin:i,links:u,profile_id:s?.[Qt],exclusive_time:s?.[Gt],measurements:t.measurements,is_segment:!0}}(f);if(s?.length&&Wn({description:t.description,op:t.op,attributes:t.data},s))return r("ignored"),null;if(u){const e=fe(t,u);f=wt(n,{type:"transaction",timestamp:(l=e).timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,links:l.links,data:{...l.data,...l.profile_id&&{[Qt]:l.profile_id},...l.exclusive_time&&{[Gt]:l.exclusive_time}}}},measurements:l.measurements})}if(f.spans){const t=[],n=f.spans;for(const e of n)s?.length&&Wn({description:e.description,op:e.op,attributes:e.data},s)?Yn(n,e):u?t.push(fe(e,u)):t.push(e);o(n.length-t.length),f.spans=t}}if(c)return ue("",()=>c(f,e),()=>(r("callback_error"),null))}var l;return f}(o,t,n,t=>{a=t},t=>{f=t})}).then(e=>{f&&this.recordDroppedEvent("ignored","span",f);if(!N(e)||null===e){if(this.recordDroppedEvent(a,p),s&&this.recordDroppedEvent(a,"span",1+h-f),null!==e)throw fr(`${u} must return \`null\` or a valid event.`);throw lr(`${"ignored"===a?"Transaction matched `ignoreSpans`":`${u} ${"callback_error"===a?"threw an error":"returned `null`"}`}, will not send event.`)}if(c&&m&&this.ut(m,e),d)throw this.recordDroppedEvent("sample_rate","error"),dr(i);if(s){const t=h-f-(e.spans?.length||0);t>0&&this.recordDroppedEvent("before_send","span",t)}const r=e.transaction_info;if(s&&r&&e.transaction!==t.transaction){const t="custom";e.transaction_info={...r,source:t}}return this.sendEvent(e,n),e}).then(null,t=>{if(P(n=t)&&ur in n||function(t){return P(t)&&cr in t}(t))throw t;var n;throw this.captureException(t,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:t}),fr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${t}`)})}rt(t,n){this.J++,this.K.add(t).then(t=>(this.J--,t),t=>(this.J--,t===er&&this.recordDroppedEvent("queue_overflow",n),t))}dt(){const t=this.G;return this.G={},Object.entries(t).map(([t,n])=>{const[e,r]=t.split(":");return{reason:e,category:r,quantity:n}})}ht(){const t=this.dt();if(0===t.length)return;if(!this.nt)return;const n=(e=t,pe((r=this.Y.tunnel&&hn(this.nt))?{dsn:r}:{},[[{type:"client_report"},{timestamp:mt(),discarded_events:e}]]));var e,r;this.sendEnvelope(n)}}function hr(t){return void 0===t.type}function mr(t){return"transaction"===t.type}function yr(t,n){!0===n.debug&&u(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")}),function(){const t=Ht();return t&&!function(t){return ar in t}(t)?t:void 0}()&&u(()=>{console.warn("[Sentry] `Sentry.init()` was called more than once. The new client replaces the active client, but the active client is not closed, so state from both can mix. Call `Sentry.init()` only once, or call `await Sentry.close()` before you call it again.")});Ft().update(n.initialScope);const e=new t(n);return gr(e),e.init(),e}function gr(t){Ft().setClient(t)}function vr(t,n){const e=t.indexOf("#"),r=-1===e?t.length:e,o=t.indexOf("?");if(-1===o||o>r)return t;const i=t.slice(0,o),s=t.slice(o+1,r),c=t.slice(r),u=function(t,n){if(t&&!1!==n)return t.split("&").map(t=>{const e=t.indexOf("="),r=-1===e?t:t.slice(0,e),o=new URLSearchParams(`${r}=`).keys().next().value;return void 0!==o&&Re(o,n)?`${r}=${Oe}`:t}).join("&")}(s,n);return u?`${i}?${u}${c}`:`${i}${c}`}function br(t,n){return void 0===t?void 0:vr(t,function(t){return(t??Ht())?.getDataCollectionOptions().urlQueryParams??!0}(n))}function _r(t){if(!t)return{};const n=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!n)return{};const e=n[6]||"",r=n[8]||"";return{host:n[4],path:n[5],protocol:n[2],search:e,hash:r,relative:n[5]+e+r}}function wr(t){const n=t?gn(t):Ht()?.getDsn();return n?`/${function(t){let n=2166136261;for(let e=0;e>>0}(hn(n)).toString(36)}`:void 0}function Sr(t){"aggregates"in t?void 0===t.attrs?.ip_address&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):void 0===t.ipAddress&&(t.ipAddress="{{auto}}")}const Er=100;function $r(t,n){const e=Ht(),r=Ut();if(!e)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=Er}=e.getOptions();if(i<=0)return;const s={timestamp:mt(),...t},c=o?ue("",()=>u(()=>o(s,n)),()=>null):s;null!==c&&(e.emit&&e.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,i))}const kr=new WeakMap,xr=()=>({name:"FunctionToString",setupOnce(){const t=Function.prototype.toString,n=Function.prototype.call.bind(t),e=Function.prototype.call.bind(Object.prototype.hasOwnProperty);try{Function.prototype.toString=function(){let t;try{kr.has(Ht())&&e(this,"__sentry_original__")&&(t=H(this))}catch{}return n(t??this)}}catch{}},setup(t){kr.set(t,!0)}}),Ir=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],jr=(t={})=>{let n;return{name:"EventFilters",setup(e){const r=e.getOptions();n=Or(t,r)},processEvent(e,r,o){if(!n){const e=o.getOptions();n=Or(t,e)}return function(t,n){if(t.type){if("transaction"===t.type&&function(t,n){if(!n?.length)return!1;const e=t.transaction;return!!e&&ct(e,n)}(t,n.ignoreTransactions))return!0}else{if(function(t,n){if(!n?.length)return!1;return function(t){const n=[];t.message&&n.push(t.message);try{const e=t.exception.values[t.exception.values.length-1];e?.value&&(n.push(e.value),e.type&&n.push(`${e.type}: ${e.value}`))}catch{}return n}(t).some(t=>ct(t,n))}(t,n.ignoreErrors))return!0;if(function(t){if(!t.exception?.values?.length)return!1;return!t.message&&!t.exception.values.some(t=>t.stacktrace||t.type&&"Error"!==t.type||t.value)}(t))return!0;if(function(t,n){if(!n?.length)return!1;const e=Tr(t);return!!e&&ct(e,n)}(t,n.denyUrls))return!0;if(!function(t,n){if(!n?.length)return!0;const e=Tr(t);return!e||ct(e,n)}(t,n.allowUrls))return!0}return!1}(e,n)?null:e}}};function Or(t={},n={}){return{allowUrls:[...t.allowUrls||[],...n.allowUrls||[]],denyUrls:[...t.denyUrls||[],...n.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...n.ignoreErrors||[],...t.disableErrorDefaults?[]:Ir],ignoreTransactions:[...t.ignoreTransactions||[],...n.ignoreTransactions||[]]}}function Tr(t){try{const n=[...t.exception?.values??[]].reverse().find(t=>void 0===t.mechanism?.parent_id&&t.stacktrace?.frames?.length),e=n?.stacktrace?.frames;return e?function(t=[]){for(let n=t.length-1;n>=0;n--){const e=t[n];if(e&&""!==e.filename&&"[native code]"!==e.filename)return e.filename||null}return null}(e):null}catch{return null}}function Rr(t,n,e,r,o,i){if(!o.exception?.values||!i||!I(i.originalException))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=Cr(t,n,r,i.originalException,e,o.exception.values,s,0))}function Cr(t,n,e,r,o,i,s,c){if(i.length>=e+1)return i;let u=[...i];if(I(r[o])){Nr(s,c,r);const i=t(n,r[o]),a=u.length;Pr(i,o,a,c),u=Cr(t,n,e,r[o],o,[i,...u],i,a)}return Ar(r)&&r.errors.forEach((i,a)=>{if(u.length{const a=r[i];if(u.length{let t;return{name:"Dedupe",processEvent(n){if(n.type)return n;try{if(function(t,n){if(!n)return!1;if(function(t,n){const e=t.message,r=n.message;if(!e&&!r)return!1;if(e&&!r||!e&&r)return!1;if(e!==r)return!1;if(!Hr(t,n))return!1;if(!Br(t,n))return!1;return!0}(t,n))return!0;if(function(t,n){const e=Wr(n),r=Wr(t);if(!e||!r)return!1;if(e.type!==r.type||e.value!==r.value)return!1;if(!Hr(t,n))return!1;if(!Br(t,n))return!1;return!0}(t,n))return!0;return!1}(n,t))return null}catch{}return t=n}}};function Br(t,n){const e=y(t),r=y(n);if(!e||!r)return!e&&!r;if(r.length!==e.length)return!1;for(let t=0;t{const n=new Set(t.levels||s);return{name:"Console",setup(e){const r=function(t){const n="console",e=b(n,t);return _(n,Fr),e}(({args:t,level:r})=>{Ht()===e&&n.has(r)&&function(t,n){const e={category:"console",data:{arguments:n,logger:"console"},level:Ur(t),message:Yr(n)};if("assert"===t){if(!1!==n[0])return;{const t=n.slice(1);e.message=t.length>0?`Assertion failed: ${Yr(t)}`:"Assertion failed",e.data.arguments=t}}$r(e,{input:n,level:t})}(r,t)});if(e.registerCleanup(r),t.filter){const n=function(t){for(const n of t)Mr.add(n);return()=>{for(const n of t)Mr.delete(n)}}(t.filter);e.registerCleanup(n)}}}};function Yr(t){return"util"in n&&"function"==typeof n.util.format?n.util.format(...t):function(t,n){if(!Array.isArray(t))return"";const e=[];for(let n=0;n({name:"ConversationId",setup(t){t.on("spanStart",t=>{const n=Ft().getScopeData(),e=Ut().getScopeData(),r=n.conversationId||e.conversationId;if(r){const{op:n,data:e,description:o}=Tn(t);if(!n?.startsWith("gen_ai.")&&!e["ai.operationId"]&&!o?.startsWith("ai."))return;t.setAttribute("gen_ai.conversation.id",r)}})}}),Gr=n;function Xr(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Kr(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in Gr))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(Xr(Gr.fetch))return!0;let t=!1;const n=Gr.document;if(n&&"function"==typeof n.createElement)try{const e=n.createElement("iframe");e.hidden=!0,n.head.appendChild(e),e.contentWindow?.fetch&&(t=Xr(e.contentWindow.fetch)),n.head.removeChild(e)}catch(t){}return t}function Qr(t){const e="fetch",r=b(e,t);return _(e,()=>function(){if(Ee()&&!Kr())return;U(n,"fetch",function(t){return new Proxy(t,{apply(t,e,r){const o=new Error,{method:i,url:s}=function(t){if(0===t.length)return{method:"GET",url:""};if(2===t.length){const[n,e]=t;return{url:Zr(n),method:Vr(e,"method")?String(e.method).toUpperCase():F(n)&&Vr(n,"method")?String(n.method).toUpperCase():"GET"}}const n=t[0];return{url:Zr(n),method:Vr(n,"method")?String(n.method).toUpperCase():"GET"}}(r),c={args:r,fetchData:{method:i,url:s},startTimestamp:1e3*vt(),virtualError:o,headers:to(r)};return w("fetch",{...c}),Reflect.apply(t,n,r).then(async t=>(w("fetch",{...c,endTimestamp:1e3*vt(),response:t}),t),t=>{w("fetch",{...c,endTimestamp:1e3*vt(),error:t}),I(t)&&void 0===t.stack&&(t.stack=o.stack,q(t,"framesToPop",1));const e=Ht(),r=e?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==r&&I(t)&&"TypeError"===t.name&&("Failed to fetch"===t.message||"Load failed"===t.message||"NetworkError when attempting to fetch resource."===t.message))try{const e=new URL(c.fetchData.url,n.location?.href).host;e&&("always"===r?t.message=`${t.message} (${e})`:q(t,"__sentry_fetch_url_host__",e))}catch{}throw t})}})})}()),r}function Vr(t,n){return P(t)&&!!t[n]}function Zr(t){return"string"==typeof t?t:t?Vr(t,"url")?t.url:t.toString?t.toString():"":""}function to(t){const[n,e]=t;try{if("object"==typeof e&&null!==e&&"headers"in e&&e.headers)return new Headers(e.headers);if(F(n))return new Headers(n.headers)}catch{}}function no(t){return void 0===t?void 0:t>=400&&t<500?"warning":t>=500?"error":void 0}const eo=()=>{},ro=["attachTo","createForm","createWidget","remove"],oo=Object.assign(t=>(u(()=>{console.warn("You are using feedbackIntegration() even though this bundle does not include feedback.")}),{name:"Feedback",...ro.reduce((t,n)=>(t[n]=eo,t),{})}),{_isShim:!0}),io=["start","stop","flush"];const so=t=>(u(()=>{console.warn("You are using browserTracingIntegration() even though this bundle does not include tracing.")}),{name:"BrowserTracing"}),co=()=>(u(()=>{console.warn("You are using elementTimingIntegration() even though this bundle does not include element timing.")}),{name:"ElementTiming"});function uo(t,n){}const ao={trace:uo,debug:uo,info:uo,warn:uo,error:uo,fatal:uo,fmt:function(t,...n){return""}},fo=t=>({name:"ConsoleLogs",setup:eo});function lo(t,n,e){}const po={count:lo,gauge:lo,distribution:lo},ho=()=>(u(()=>{console.warn("You are using spanStreamingIntegration() even though this bundle does not include tracing.")}),{name:"SpanStreaming"}),mo=()=>(u(()=>{console.warn("You are using fetchStreamPerformanceIntegration() even though this bundle does not include tracing.")}),{name:"FetchStreamPerformance"}),yo=n,go={};try{"undefined"!=typeof Node&&(go.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),"undefined"!=typeof Element&&(go.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,go.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,go.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,go.getAttribute=Element.prototype.getAttribute),"undefined"!=typeof HTMLElement&&(go.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function vo(t,n,e){const r=go[n];if(r)try{return r.call(t,e)}catch{}const o=t[n];return"function"==typeof o?o.call(t,e):o}function bo(t,n={}){if(!t)return"";try{let e=t;const r=5,o=[];let i=0,s=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,l=Array.isArray(n)?void 0:n.maskAttributeFn,d=!Array.isArray(n)&&n.maxStringLength||80;for(;e&&i++1&&s+o.length*u+a.length>=d));)o.push(a),s+=a.length,e=vo(e,"parentNode");return o.reverse().join(c)}catch{return""}}function _o(t,n,e){const r=[],o=vo(t,"tagName");if(!o)return"";if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement){const n=vo(t,"dataset");if(n){if(n.sentryComponent)return e?e("data-sentry-component",n.sentryComponent,t):n.sentryComponent;if(n.sentryElement)return e?e("data-sentry-element",n.sentryElement,t):n.sentryElement}}r.push(o.toLowerCase());const i=n?.length?n.filter(n=>vo(t,"getAttribute",n)).map(n=>[n,vo(t,"getAttribute",n)]):null;if(i?.length)i.forEach(([n,o])=>{r.push(`[${n}="${e&&o?e(n,o,t):o}"]`)});else{const n=vo(t,"id");n&&r.push(`#${e?e("id",n,t):n}`);const o=vo(t,"className");if(o&&R(o)){const n=(e?e("class",o,t):o).split(/\s+/);for(const t of n)r.push(`.${t}`)}}for(const n of["aria-label","type","name","title","alt"]){const o=vo(t,"getAttribute",n);o&&r.push(`[${n}="${e?e(n,o,t):o}"]`)}return r.join("")}const wo=t=>{const n=yo.requestIdleCallback||yo.setTimeout;if("hidden"===yo.document?.visibilityState)t();else{let i=!1;const s=()=>{i||(t(),i=!0)};e="visibilitychange",r=s,o={once:!0,capture:!0},yo.document&&yo.addEventListener(e,r,o),n(()=>{s(),function(t,n,e){yo.document&&yo.removeEventListener(t,n,e)}("visibilitychange",s,{capture:!0})})}var e,r,o};function So(){try{return yo.document?.location.href??""}catch{return""}}const Eo=new WeakMap;let $o,ko,xo,Io;function jo(t){return"boolean"==typeof t?t:!!t?.capture}function Oo(){if(!yo.document)return;const t=w.bind(null,"dom"),n=To(t,!0);yo.document.addEventListener("click",n,!1),yo.document.addEventListener("keypress",n,!1),["EventTarget","Node"].forEach(n=>{const e=yo,r=e[n]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(U(r,"addEventListener",function(n){return function(e,r,o){if(("click"===e||"keypress"==e)&&r)try{const i=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},s=i[e]=i[e]||{captureListeners:new WeakSet,bubbleListeners:new WeakSet,listenerCount:0},c=jo(o);if(!s.handler){const r=To(t);s.handler=r,s.capture=c,n.call(this,e,r,s.capture)}const u=s[c?"captureListeners":"bubbleListeners"];u.has(r)||("object"==typeof o&&(o?.once||o?.signal)?s.sticky=!0:(u.add(r),s.listenerCount++))}catch{}return n.call(this,e,r,o)}}),U(r,"removeEventListener",function(t){return function(n,e,r){if(("click"===n||"keypress"==n)&&e)try{const o=this.__sentry_instrumentation_handlers__||{},i=o[n];i?.[jo(r)?"captureListeners":"bubbleListeners"].delete(e)&&(--i.listenerCount||i.sticky||(t.call(this,n,i.handler,i.capture),i.handler=void 0,delete o[n]),0===Object.keys(o).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return t.call(this,n,e,r)}}))})}function To(t,n=!1){return e=>{if(!e||e._sentryCaptured)return;const r=function(t){try{return t.target}catch{return null}}(e);if(function(t,n){return"keypress"===t&&(!n?.tagName||"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable)}(e.type,r))return;q(e,"_sentryCaptured",!0),r&&!r._sentryId&&q(r,"_sentryId",ut());const o="keypress"===e.type?"input":e.type;if(!function(t){if(t.type!==ko)return!1;try{if(!t.target||t.target._sentryId!==xo)return!1}catch{}return!0}(e)){t({event:e,name:o,global:n}),ko=e.type,xo=r?r._sentryId:void 0}clearTimeout($o),$o=yo.setTimeout(()=>{xo=void 0,ko=void 0},1e3)}}function Ro(t){const n="history";b(n,t),_(n,Co)}function Co(){function t(t){return function(...n){const e=n.length>2?n[2]:void 0;if(e){const r=Io,o=function(t){try{return new URL(t,yo.location.origin).toString()}catch{return t}}(String(e));if(Io=o,r===o)return t.apply(this,n);w("history",{from:r,to:o})}return t.apply(this,n)}}yo.addEventListener("popstate",()=>{const t=yo.location.href,n=Io;if(Io=t,n===t)return;w("history",{from:n,to:t})}),"history"in yo&&yo.history&&(U(yo.history,"pushState",t),U(yo.history,"replaceState",t))}const Ao={};const No="__sentry_xhr_v3__";function Po(){if(!yo.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(t,n,e){let r=new Error;const o=1e3*vt(),i=R(e[0])?e[0].toUpperCase():void 0,s=function(t){if(R(t))return t;try{return t.toString()}catch{}return}(e[1]);if(!i||!s)return t.apply(n,e);n[No]={method:i,url:s,request_headers:{}},"POST"===i&&s.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const t=n[No];if(t&&4===n.readyState){try{t.status_code=n.status}catch{}w("xhr",{endTimestamp:1e3*vt(),startTimestamp:o,xhr:n,virtualError:r}),r=void 0,n.removeEventListener("readystatechange",c)}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply:(t,n,e)=>(c(),t.apply(n,e))}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(t,n,e){const[r,o]=e,i=n[No];return i&&R(r)&&R(o)&&(i.request_headers[r.toLowerCase()]=o),t.apply(n,e)}}),t.apply(n,e)}}),t.send=new Proxy(t.send,{apply(t,n,e){const r=n[No];if(!r)return t.apply(n,e);void 0!==e[0]&&(r.body=e[0]);return w("xhr",{startTimestamp:1e3*vt(),xhr:n}),t.apply(n,e)}})}const Lo=n;let Mo=0;const Do=[];function Fo(t){if(Mo>0)return!0;const n=t?Do.findIndex(n=>{return r=t,(e=n).msg===r.msg&&e.url===r.url&&e.line===r.line&&e.column===r.column;var e,r}):-1;return-1!==n&&(Do.splice(n,1),!0)}function Uo(t,e={}){if("function"!=typeof t)return t;try{if(Object.prototype.hasOwnProperty.call(t,"__sentry_wrapped__")){const n=t.__sentry_wrapped__;return"function"==typeof n?n:t}if(H(t))return t}catch{return t}const sentryWrapped=function(...r){n.yt=(n.yt||0)+1;try{const n=r.map(t=>Uo(t,e));return t.apply(this,n)}catch(t){throw Mo++,setTimeout(()=>{Mo--}),Bt(n=>{n.addEventProcessor(t=>(e.mechanism&&(lt(t,void 0),dt(t,e.mechanism)),t.extra={...t.extra,arguments:r},t)),captureException(t)}),t}finally{n.yt=(n.yt||0)-1}};try{for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(sentryWrapped[n]=t[n])}catch{}B(sentryWrapped,t),q(t,"__sentry_wrapped__",sentryWrapped);try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>t.name})}catch{}return sentryWrapped}function qo(t){const n=So(),{referrer:e}=Lo.document||{},{userAgent:r}=Lo.navigator||{};return{url:n,headers:{...e&&{Referer:br(e,t)},...r&&{"User-Agent":r}}}}function Bo(t,n){const e=zo(t,n),r={type:Go(n),value:Xo(n)};return e.length&&(r.stacktrace={frames:e}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Ho(t,n,e,r){const o=Ht(),i=o?.getOptions().normalizeDepth,s=(c=n,Object.values(c).find(I));var c;const u={__serialized__:et(n,i)};if(s)return{exception:{values:[Bo(t,s)]},extra:u};const a={exception:{values:[{type:L(n)?n.constructor.name:r?"UnhandledRejection":"Error",value:ti(n,{isUnhandledRejection:r})}]},extra:u};if(e){const n=zo(t,e);n.length&&(a.exception.values[0].stacktrace={frames:n})}return a}function Wo(t,n){return{exception:{values:[Bo(t,n)]}}}function zo(t,n){const e=n.stacktrace||n.stack||"",r=function(t){if(t&&Yo.test(t.message))return 1;return 0}(n),o=function(t){if("number"==typeof t.framesToPop)return t.framesToPop;return 0}(n);try{return t(e,r,o)}catch{}return[]}const Yo=/Minified React error #\d+;/i;function Jo(t){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&t instanceof WebAssembly.Exception}function Go(t){const n=t?.name;if(!n&&Jo(t)){return t.message&&Array.isArray(t.message)&&2==t.message.length?t.message[0]:"WebAssembly.Exception"}return n}function Xo(t){const n=t?.message;return Jo(t)?Array.isArray(t.message)&&2==t.message.length?t.message[1]:"wasm exception":n?n.error&&"string"==typeof n.error.message?Lr(n.error):Lr(t):"No error message"}function Ko(t,n,e,r){const o=Vo(t,n,e?.syntheticException||void 0,r);return dt(o),o.level="error",e?.event_id&&(o.event_id=e.event_id),Ae(o)}function Qo(t,n,e="info",r,o){const i=Zo(t,n,r?.syntheticException||void 0,o);return i.level=e,r?.event_id&&(i.event_id=r.event_id),Ae(i)}function Vo(t,n,e,r,o){let i;if(O(n)&&n.error){return Wo(t,n.error)}if(T(n)||j(n,"DOMException")){const o=n;if("stack"in n){i=Wo(t,n);const o=i.exception?.values?.[0];if(r&&e&&o&&!o.stacktrace){const n=zo(t,e);n.length&&(o.stacktrace={frames:n},dt(i,{synthetic:!0}))}}else{const n=o.name||(T(o)?"DOMError":"DOMException"),s=o.message?`${n}: ${o.message}`:n;i=Zo(t,s,e,r),lt(i,s)}return i}if(I(n))return Wo(t,n);if(N(n)||L(n)){return i=Ho(t,n,e,o),dt(i,{synthetic:!0}),i}const s=String(n);return i=Zo(t,s,e,r),lt(i,s),dt(i,{synthetic:!0}),i}function Zo(t,n,e,r){const o={};if(r&&e){const r=zo(t,e);r.length&&(o.exception={values:[{value:n,stacktrace:{frames:r}}]}),dt(o,{synthetic:!0})}if(C(n)){const{__sentry_template_string__:t,__sentry_template_values__:e}=n;return o.logentry={message:t,params:e},o}return o.message=n,o}function ti(t,{isUnhandledRejection:n}){const e=function(t){const n=Object.keys(W(t));return n.sort(),n[0]?n.join(", "):"[object has no keys]"}(t),r=n?"promise rejection":"exception";if(O(t))return`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``;if(L(t)){return`Event \`${function(t){try{const n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{}}(t)}\` (type=${t.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${e}`}class ni extends pr{constructor(t){const n=(r=t,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Lo.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...r});var r;!function(t,n,r=[n],o="npm"){const i=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${n}`,i.packages=r.map(t=>({name:`${o}:@sentry/${t}`,version:e})),i.version=e)}(n,"browser",["browser"],Lo.SENTRY_SDK_SOURCE||"cdn"),super(n),n.routeProvider&&function(t,n=Ht()){n&&Eo.set(n,t)}(n.routeProvider,this),this.Z="unhandled";const{userInfo:o}=this.getDataCollectionOptions();n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:o?"auto":"never",...n._metadata.sdk.settings});const{sendClientReports:i}=this.Y,s=()=>{vt()},c=[[Lo.document,"visibilitychange",()=>{s(),"hidden"===Lo.document.visibilityState&&(i&&this.ht(),queueMicrotask(()=>{this.flush()}))}],[Lo.document,"freeze",s],[Lo.document,"resume",s],[Lo,"pagehide",s],[Lo,"pageshow",s]];c.forEach(([t,n,e])=>t?.addEventListener?.(n,e)),this.on("close",()=>c.forEach(([t,n,e])=>t?.removeEventListener?.(n,e))),o&&this.on("beforeSendSession",Sr)}eventFromException(t,n){return Ko(this.Y.stackParser,t,n,this.Y.attachStacktrace)}eventFromMessage(t,n="info",e){return Qo(this.Y.stackParser,t,n,e,this.Y.attachStacktrace)}ft(t,n,e,r){return t.platform=t.platform||"javascript",super.ft(t,n,e,r)}}function ei(t,n=function(t){const n=Ao[t];if(n)return n;let e=yo[t];if(Xr(e))return Ao[t]=e.bind(yo);const r=yo.document;if(r&&"function"==typeof r.createElement)try{const n=r.createElement("iframe");n.hidden=!0,r.head.appendChild(n);const o=n.contentWindow;o?.[t]&&(e=o[t]),r.head.removeChild(n)}catch(t){}return e?Ao[t]=e.bind(yo):e}("fetch")){let e=0,r=0;return ir(t,async function(o){const i=o.body.length;e+=i,r++;const s={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:e<=6e4&&r<15,...t.fetchOptions};try{const e=await n(t.url,s);return{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}}catch(t){throw Ao["fetch"]=void 0,t}finally{e-=i,r--}},rr(t.bufferSize||40))}const ri={startProfiler:function(){const t=Ht();if(!t)return;t.getIntegrationByName("BrowserProfiling")&&t.emit("startUIProfiler")},stopProfiler:function(){const t=Ht();if(!t)return;t.getIntegrationByName("BrowserProfiling")&&t.emit("stopUIProfiler")}};function oi(t,n,e,r){const o={filename:t,function:""===n?a:n,in_app:!0};return void 0!==e&&(o.lineno=e),void 0!==r&&(o.colno=r),o}const ii=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,si=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ci=/\((\S*)(?::(\d+))(?::(\d+))\)/,ui=/at (.+?) ?\(data:(.+?),/,ai=[30,t=>{const n=t.match(ui);if(n)return{filename:``,function:n[1]};const e=ii.exec(t);if(e){const[,t,n,r]=e;return oi(t,a,+n,+r)}const r=si.exec(t);if(r){if(0===r[2]?.indexOf("eval")){const t=ci.exec(r[2]);t&&(r[2]=t[1],r[3]=t[2],r[4]=t[3])}const[t,n]=wi(r[1]||a,r[2]);return oi(n,t,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],fi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,li=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,di=[50,t=>{const n=fi.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){const t=li.exec(n[3]);t&&(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]="")}let t=n[3],e=n[1]||a;return[e,t]=wi(e,t),oi(t,e,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}}],pi=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,hi=[40,t=>{const n=pi.exec(t);return n?oi(n[2],n[1]||a,+n[3],n[4]?+n[4]:void 0):void 0}],mi=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,yi=[10,t=>{const n=mi.exec(t);return n?oi(n[2],n[3]||a,+n[1]):void 0}],gi=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,vi=[20,t=>{const n=gi.exec(t);return n?oi(n[5],n[3]||n[4]||a,+n[1],+n[2]):void 0}],bi=[ai,di],_i=d(...bi),wi=(t,n)=>{const e=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return e||r?[-1!==t.indexOf("@")?t.split("@")[0]:a,e?`safari-extension:${n}`:`safari-web-extension:${n}`]:[t,n]};const Si=1024,Ei=(t={})=>{const e={dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:"Breadcrumbs",setup(t){var r;e.dom&&(r=function(t,e){return function(r){if(Ht()!==t)return;let o,i,s="object"==typeof e?e.serializeAttribute:void 0,c="object"==typeof e&&"number"==typeof e.maxStringLength?e.maxStringLength:void 0;c&&c>Si&&(c=Si),"string"==typeof s&&(s=[s]);try{const t=r.event,e=function(t){return!!t&&!!t.target}(t)?t.target:t;o=bo(e,{keyAttrs:s,maxStringLength:c}),i=function(t,e=5){if(!n.HTMLElement)return null;let r=t;for(let t=0;t{const n={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:"BrowserApiErrors",setupOnce(){n.setTimeout&&U(Lo,"setTimeout",xi),n.setInterval&&U(Lo,"setInterval",xi),n.requestAnimationFrame&&U(Lo,"requestAnimationFrame",Ii),n.XMLHttpRequest&&"XMLHttpRequest"in Lo&&U(XMLHttpRequest.prototype,"send",ji);const t=n.eventTarget;if(t){(Array.isArray(t)?t:$i).forEach(t=>function(t,n){const e=Lo,r=e[t]?.prototype;if(!r?.hasOwnProperty?.("addEventListener"))return;U(r,"addEventListener",function(e){return function(r,o,i){try{"function"==typeof o.handleEvent&&(o.handleEvent=Uo(o.handleEvent,{mechanism:{data:{handler:m(o),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return n.unregisterOriginalCallbacks&&function(t,n,e){t&&"object"==typeof t&&"removeEventListener"in t&&"function"==typeof t.removeEventListener&&t.removeEventListener(n,e)}(this,r,o),e.apply(this,[r,Uo(o,{mechanism:{data:{handler:m(o),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),U(r,"removeEventListener",function(t){return function(n,e,r){try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){const o=e.__sentry_wrapped__;o&&t.call(this,n,o,r)}}catch{}return t.call(this,n,e,r)}})}(t,n))}}}};function xi(t){return function(...n){const e=n[0];return n[0]=Uo(e,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${m(t)}`}}),t.apply(this,n)}}function Ii(t){return function(n){return t.apply(this,[Uo(n,{mechanism:{data:{handler:m(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function ji(t){return function(...n){const e=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(t=>{t in e&&"function"==typeof e[t]&&U(e,t,function(n){const e={mechanism:{data:{handler:m(n)},handled:!1,type:`auto.browser.browserapierrors.xhr.${t}`}},r=H(n);return r&&(e.mechanism.data.handler=m(r)),Uo(n,e)})}),t.apply(this,n)}}const Oi=(t={})=>{const n=t.lifecycle??"page";return{name:"BrowserSession",setupOnce(){if(void 0===Lo.document)return;Xe({ignoreDuration:!0});let t=!1;wo(()=>{t||(Ve(),t=!0)});const e=Ut();let r=e.getUser();e.addScopeListener(n=>{const e=n.getUser();r?.id===e?.id&&r?.ip_address===e?.ip_address||(r=e,t&&Ve())}),"route"===n&&Ro(({from:n,to:e})=>{n!==e&&(Xe({ignoreDuration:!0}),Ve(),t=!0)})}}},Ti=()=>({name:"CultureContext",preprocessEvent(t){const n=Ri();n&&(t.contexts={...t.contexts,culture:{...n,...t.contexts?.culture}})},processSegmentSpan(t){const n=Ri();n&&de(t,{[Yt]:n.locale,[Jt]:n.timezone,[zt]:n.calendar})}});function Ri(){try{const t=Lo.Intl;if(!t)return;const n=t.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone,calendar:n.calendar}}catch{return}}const Ci=(t={})=>{const n={onerror:!0,onunhandledrejection:!0,...t};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){n.onerror&&function(t){!function(t){const n="error";b(n,t),_(n,E)}(n=>{const{stackParser:e,attachStacktrace:r}=Ai();if(Ht()!==t||Fo(n))return;const{msg:o,url:i,line:s,column:c,error:u}=n,f=function(t,n,e,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},c=s.stacktrace=s.stacktrace||{},u=c.frames=c.frames||[];0===u.length&&u.push({colno:r,lineno:e,filename:Ni(n)??So(),function:a,in_app:!0});return t}(Vo(e,u||o,void 0,r,!1),i,s,c);f.level="error",Ye(f,{originalException:u,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}(t),n.onunhandledrejection&&function(t){!function(t){const n="unhandledrejection";b(n,t),_(n,k)}(n=>{const{stackParser:e,attachStacktrace:r}=Ai();if(Ht()!==t||Fo())return;const o=function(t){if(A(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}(n),i=A(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Vo(e,o,void 0,r,!0);i.level="error",Ye(i,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}(t)}}};function Ai(){const t=Ht();return t?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ni(t){if(R(t)&&0!==t.length)return t.startsWith("data:")?`<${function(t,n=!0){if(t.startsWith("data:")){const e=t.match(/^data:([^;,]+)/),r=e?e[1]:"text/plain",o=t.includes(";base64,"),i=t.indexOf(",");let s="";if(n&&-1!==i){const n=t.slice(i+1);s=n.length>10?`${n.slice(0,10)}... [truncated]`:n}return`data:${r}${o?",base64":""}${s?`,${s}`:""}`}return t}(t,!1)}>`:t}const Pi=()=>({name:"HttpContext",preprocessEvent(t,n,e){if(!Lo.navigator&&!Lo.location&&!Lo.document)return;const{url:r,headers:o}=qo(e),i=e.getDataCollectionOptions().httpHeaders.request,s=Object.entries(t.request?.headers??{}).filter(([t])=>!(t in o)),c={...Ce(o,i),...Object.fromEntries(s)};t.request={url:br(r,e),...t.request,...Object.keys(c).length>0?{headers:c}:{headers:void 0}}},processSpan(t,n){if(!Lo.navigator&&!Lo.location&&!Lo.document)return;const e=qo(n),r=Ce(e.headers,n.getDataCollectionOptions().httpHeaders.request),o=r.Referer,{hostname:i,protocol:s}=Lo.location||{};de(t,{[nn]:r["User-Agent"],[Xt]:"file:"===s||"localhost"===i||"127.0.0.1"===i||"[::1]"===i||!!i?.endsWith(".localhost"),...t.is_segment&&{[tn]:"http.client"!==t.attributes?.[Kt]?br(e.url):void 0,"http.request.header.referer":o?[o]:void 0}})}}),Li=(t={})=>{const n=t.limit||5,e=t.key||"cause";return{name:"LinkedErrors",preprocessEvent(t,r,o){Rr(Bo,o.getOptions().stackParser,e,n,t,r)}}},Mi=/^HTML(\w*)Element$/;function Di(t){if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(function(t){if("undefined"==typeof Element)return!1;try{return t instanceof Element}catch{return!1}}(t)){const n=function(t){const n=Object.getPrototypeOf(t);return n?.constructor?n.constructor.name:"null prototype"}(t);if(Mi.test(n))return`[HTMLElement: ${bo(t)}]`}}function Fi(){return!!function(){if(void 0===Lo.window)return!1;const t=Lo;if(t.nw)return!1;const n=t.chrome||t.browser;if(!n?.runtime?.id)return!1;const e=So();return!(Lo===Lo.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(e))}()}function Ui(t){const{tunnel:n,dsn:e,transportOptions:r}=t;if(!n||"string"==typeof n)return{tunnel:n,transportOptions:r};const o=!0===n?{}:n,i=e&&gn(e),s=o.path??(i&&wr(i));if(!s)return{tunnel:void 0,transportOptions:r};return{tunnel:`${function(t){const n=(t?.startsWith("./")?t.slice(1):t??"").replace(/\/$/,"");return!n||n.startsWith("/")?n:`/${n}`}(o.basePath)}${s}${o.trailingSlash?"/":""}`,transportOptions:{...r,headers:{"Content-Type":"application/x-sentry-envelope",...r?.headers}}}}function qi(t){return[jr(),xr(),Jr(),ki(),Ei(),zr(),Ci(),Li(),qr(),Pi(),Ti(),Oi()]}const Bi=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","userTimingIntegration","interactionsIntegration","moduleMetadataIntegration"],Hi={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};const Wi=Lo;return t.BrowserClient=ni,t.SDK_VERSION=e,t.SEMANTIC_ATTRIBUTE_SENTRY_OP="sentry.op",t.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN="sentry.origin",t.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE=en,t.Scope=$t,t.WINDOW=Lo,t.addBreadcrumb=$r,t.addEventProcessor=function(t){Ut().addEventProcessor(t)},t.addIntegration=function(t){const n=Ht();n&&n.addIntegration(t)},t.breadcrumbsIntegration=Ei,t.browserApiErrorsIntegration=ki,t.browserSessionIntegration=Oi,t.browserTracingIntegration=so,t.captureEvent=Ye,t.captureException=captureException,t.captureFeedback=function(t,n={},e=Ft()){const{message:r,name:o,email:i,url:s,source:c,associatedEventId:u,tags:a}=t,f={contexts:{feedback:{contact_email:i,name:o,message:r,url:s,source:c,associated_event_id:u}},type:"feedback",level:"info",tags:a},l=e?.getClient()||Ht();return l&&l.emit("beforeSendFeedback",f,n),e.captureEvent(f,n)},t.captureMessage=function(t,n){const e="string"==typeof n?n:void 0,r="string"!=typeof n?{captureContext:n}:void 0;return Ft().captureMessage(t,e,r)},t.captureSession=Ve,t.chromeStackLineParser=ai,t.close=async function(t){const n=Ft(),e=n.getClient();if(e){const r=await e.close(t);return n.getClient()===e&&n.setClient(void 0),r}return Promise.resolve(!1)},t.consoleIntegration=zr,t.consoleLoggingIntegration=fo,t.continueTrace=(t,n)=>{const e=Pt(r());if(e.continueTrace)return e.continueTrace(t,n);const{sentryTrace:o,baggage:i}=t,s=Ht(),c=an(i);return s&&!function(t,n){const e=yn(t);return(!n||!e||n===e)&&(!t.getOptions().strictTraceContinuation||!(n&&!e||!n&&e))}(s,c?.org_id)?function(t){const n=Ie();if(n.startNewTrace)return n.startNewTrace(t);return xe(null,()=>Bt(n=>(n.setPropagationContext({traceId:St(),sampleRand:G()}),t())))}(n):Bt(t=>{const e=_n(o,i);return t.setPropagationContext(e),xe(null,n)})},t.createTransport=ir,t.createUserFeedbackEnvelope=function(t,{metadata:n,tunnel:e,dsn:r}){const o={event_id:t.event_id,sent_at:(new Date).toISOString(),...n?.sdk&&{sdk:{name:n.sdk.name,version:n.sdk.version}},...!!e&&!!r&&{dsn:hn(r)}},i=function(t){return[{type:"user_report"},t]}(t);return pe(o,[i])},t.dedupeIntegration=qr,t.defaultStackLineParsers=bi,t.defaultStackParser=_i,t.elementTimingIntegration=co,t.endSession=Ke,t.eventFiltersIntegration=jr,t.eventFromException=Ko,t.eventFromMessage=Qo,t.exceptionFromError=Bo,t.feedbackAsyncIntegration=oo,t.feedbackIntegration=oo,t.fetchStreamPerformanceIntegration=mo,t.flush=async function(t){const n=Ht();return n?n.flush(t):Promise.resolve(!1)},t.forceLoad=function(){},t.functionToStringIntegration=xr,t.geckoStackLineParser=di,t.getClient=Ht,t.getCurrentScope=Ft,t.getDefaultIntegrations=qi,t.getGlobalScope=qt,t.getIsolationScope=Ut,t.getTraceData=function(t={}){const n=t.client||Ht();if(!Ge()||!n)return{};const e=Pt(r());if(e.getTraceData)return e.getTraceData(t);const i=t.scope||Ft(),s=t.span||Bn(),c=te(s)&&!Hn(n.getOptions());if(!s&&void 0!==o(r()).externalPropagationContextProvider)return{};const u=s&&!c?kn(s):function(t){const{traceId:n,sampled:e,propagationSpanId:r}=t.getPropagationContext();return wn(n,r,e)}(i),a=fn(s?re(s):ee(n,i));if(!bn.test(u))return{};const f={"sentry-trace":u,baggage:a};return t.propagateTraceparent&&(f.traceparent=s&&!c?function(t){const{traceId:n,spanId:e}=t.spanContext();return Sn(n,e,Nn(t))}(s):function(t){const{traceId:n,sampled:e,propagationSpanId:r}=t.getPropagationContext();return Sn(n,r,e)}(i)),f},t.globalHandlersIntegration=Ci,t.httpContextIntegration=Pi,t.init=function(t={}){const n=!t.skipBrowserExtensionCheck&&Fi();let e=null==t.defaultIntegrations?qi():t.defaultIntegrations;const r=Xn({integrations:t.integrations,defaultIntegrations:e}),o={...t,...Ui(t),enabled:!n&&t.enabled,stackParser:(i=t.stackParser||_i,Array.isArray(i)?d(...i):i),integrations:r,transport:t.transport||ei};var i;return V=Di,yr(ni,o)},t.isEnabled=Ge,t.isInitialized=function(){return!!Ht()},t.lastEventId=Je,t.lazyLoadIntegration=async function(t,n){const r=Bi.includes(t)?function(t){return Hi[t]||t.replace("Integration","").toLowerCase()}(t):void 0,o=Wi.Sentry=Wi.Sentry||{};if(!r)throw new Error(`Cannot lazy load integration: ${t}`);const i=o[t];if("function"==typeof i&&!("_isShim"in i))return i;const s=function(t){const n=Ht(),r=n?.getOptions()?.cdnBaseUrl||"https://browser.sentry-cdn.com";return new URL(`/${e}/${t}.min.js`,r).toString()}(r),c=Lo.document.createElement("script");c.src=s,c.crossOrigin="anonymous",c.referrerPolicy="strict-origin",n&&c.setAttribute("nonce",n);const u=new Promise((t,n)=>{c.addEventListener("load",()=>t()),c.addEventListener("error",n)}),a=Lo.document.currentScript,f=Lo.document.body||Lo.document.head||a?.parentElement;if(!f)throw new Error(`Could not find parent element to insert lazy-loaded ${t} script`);f.appendChild(c);try{await u}catch{throw new Error(`Error when loading integration: ${t}`)}const l=o[t];if("function"!=typeof l)throw new Error(`Could not load integration: ${t}`);return l},t.linkedErrorsIntegration=Li,t.logger=ao,t.makeFetchTransport=ei,t.metrics=po,t.onLoad=function(t){t()},t.opera10StackLineParser=yi,t.opera11StackLineParser=vi,t.parameterize=function(t,...n){const e=t.map((n,e)=>n??t.raw[e]),r=new String(String.raw({raw:e},...n));return r.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),r.__sentry_template_values__=n,r},t.replayIntegration=function(t){return u(()=>{console.warn("You are using replayIntegration() even though this bundle does not include replay.")}),{name:"Replay",...io.reduce((t,n)=>(t[n]=eo,t),{})}},t.setAttribute=function(t,n){Ut().setAttribute(t,n)},t.setAttributes=function(t){Ut().setAttributes(t)},t.setContext=function(t,n){Ut().setContext(t,n)},t.setConversationId=function(t){Ut().setConversationId(t)},t.setCurrentClient=gr,t.setExtra=function(t,n){Ut().setExtra(t,n)},t.setExtras=function(t){Ut().setExtras(t)},t.setTag=function(t,n){Ut().setTag(t,n)},t.setTags=function(t){Ut().setTags(t)},t.setUser=function(t){Ut().setUser(t)},t.showReportDialog=function(t={}){const n=Lo.document,e=n?.head||n?.body;if(!e)return;const r=Ft(),o=Ht(),i=o?.getDsn();if(!i)return;const s={...t,user:{...r.getUser(),...t.user},eventId:t.eventId||Je()},{onLoad:c,onClose:u,onError:a}=s;if(!s.eventId)return void a?.(new Error("No event ID to show the report dialog for"));const f=Lo.document.createElement("script");if(f.async=!0,f.crossOrigin="anonymous",f.src=function(t,n){const e=gn(t);if(!e)return"";const r=`${Ze(e)}embed/error-page/`;let o=`dsn=${hn(e)}`;for(const t in n)if("dsn"!==t&&"onClose"!==t&&"onError"!==t)if("user"===t){const t=n.user;if(!t)continue;t.name&&(o+=`&name=${encodeURIComponent(t.name)}`),t.email&&(o+=`&email=${encodeURIComponent(t.email)}`)}else o+=`&${encodeURIComponent(t)}=${encodeURIComponent(n[t])}`;return`${r}?${o}`}(i,s),c&&(f.onload=c),a&&(f.onerror=()=>{a(new Error("Failed to load the report dialog script"))}),u){const t=n=>{if("__sentry_reportdialog_closed__"===n.data)try{u()}finally{Lo.removeEventListener("message",t)}};Lo.addEventListener("message",t),f.addEventListener("error",()=>{Lo.removeEventListener("message",t)})}e.appendChild(f)},t.spanStreamingIntegration=ho,t.spanToBaggageHeader=function(t){return fn(re(t))},t.spanToJSON=function(t){if(An(t))return t.getSpanJSON();const{spanId:n,traceId:e}=t.spanContext();if(Cn(t)){const{attributes:r,startTime:o,name:i,endTime:s,status:c,links:u}=t;return{name:i,span_id:n,trace_id:e,parent_span_id:Rn(t),start_timestamp:jn(o),end_timestamp:jn(s)||void 0,is_segment:qn(t),status:Ln(c),attributes:Mn(r,c),links:In(u)}}return{span_id:n,trace_id:e,start_timestamp:0,name:"",status:"ok",is_segment:qn(t),attributes:{}}},t.spanToStaticSpanJSON=Tn,t.spanToTraceHeader=kn,t.startSession=Xe,t.suppressTracing=function(t){const n=Ie();return n.suppressTracing?n.suppressTracing(t):Bt(n=>(n.setSDKProcessingMetadata({[kt]:!0}),t()))},t.uiProfiler=ri,t.updateSpanName=function(t,n){t.updateName(n),t.setAttributes({[rn]:n}),function(t,n){qn(t)&&t.setAttribute(Vt,n)}(t,"custom")},t.winjsStackLineParser=hi,t.withIsolationScope=function(...t){const n=Pt(r());if(2===t.length){const[e,r]=t;return e?n.withSetIsolationScope(e,r):n.withIsolationScope(r)}return n.withIsolationScope(t[0])},t.withScope=Bt,t.withStaticSpan=function(t){return q(t,"_static",!0),t},t.withStreamedSpan=function(t){return t},t}({}); +//# sourceMappingURL=bundle.min.js.map