@cmmd-center/forge 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +487 -41
- package/dist/bin.mjs +511 -65
- package/dist/client/assets/{CanvasPanel-BeSvnc85.js → CanvasPanel-Bk1rL0LG.js} +3 -3
- package/dist/client/assets/CompositeItem-D1GrQhpu.js +2 -0
- package/dist/client/assets/CompositeList-CEBk8sf_.js +2 -0
- package/dist/client/assets/DiffPanel-jC25MVg8.js +64 -0
- package/dist/client/assets/{DiffPanel.logic-CAb-hngG.js → DiffPanel.logic-DHo4jHZM.js} +6 -6
- package/dist/client/assets/{DiffWorkerPoolProvider-BbyQb-ye.js → DiffWorkerPoolProvider-r1DUfA1d.js} +10 -10
- package/dist/client/assets/Effect-CyyMOw4X.js +15 -0
- package/dist/client/assets/PullRequestCodePanel-BWuWxI6X.js +5 -0
- package/dist/client/assets/Schema-8EGdYSms.js +3 -0
- package/dist/client/assets/Stream-Bvl2Z6qI.js +2 -0
- package/dist/client/assets/ThemeEditorPanel-BOkxNR3t.js +2 -0
- package/dist/client/assets/Virtualizer-DOL71mrP.js +2 -0
- package/dist/client/assets/WorkerPoolContext-gI2-7Koc.js +2538 -0
- package/dist/client/assets/activeOrganizationId-CySrJzMX.js +2 -0
- package/dist/client/assets/atomRegistry-CzI2zp7d.js +3 -0
- package/dist/client/assets/{canvasStateStore-DYt9MgFu.js → canvasStateStore-dUmp5NFj.js} +2 -2
- package/dist/client/assets/chevron-left-BXpfeqsT.js +2 -0
- package/dist/client/assets/chevron-right-B103tjaJ.js +2 -0
- package/dist/client/assets/cmmdAuthRedirect-CHlAAdAc.js +3 -0
- package/dist/client/assets/cmmdEmbedMode-DhVvltxi.js +2 -0
- package/dist/client/assets/currentForgeWorkspaceStore-eKCBxKgv.js +2 -0
- package/dist/client/assets/dialog-BfhVD7Kq.js +2 -0
- package/dist/client/assets/getPseudoElementBounds-DBf0dPO9.js +2 -0
- package/dist/client/assets/index-BS4FABiE.js +301 -0
- package/dist/client/assets/minus-CbEeUDFT.js +2 -0
- package/dist/client/assets/popover-D8qvi5AD.js +2 -0
- package/dist/client/assets/{react-D4GEJ3ir.js → react-A0DLYjwn.js} +2 -2
- package/dist/client/assets/scroll-area-BDuz0PnB.js +2 -0
- package/dist/client/assets/sidebarV2CustomSnoozeDialog-pxOuwuY2.js +2 -0
- package/dist/client/assets/src-7C4X1Oy2.js +2 -0
- package/dist/client/assets/switch-BeaQwtm7.js +2 -0
- package/dist/client/assets/{themePalette-BWvBK22X.js → themePalette-D4rx0k29.js} +2 -2
- package/dist/client/assets/toggle--uJ9LmDV.js +2 -0
- package/dist/client/assets/toggle-group-6UcL78FY.js +2 -0
- package/dist/client/assets/tooltip-C_eHCky0.js +2 -0
- package/dist/client/assets/useOpenInteractionType-BFjAYgzR.js +2 -0
- package/dist/client/assets/{workspaceReadinessAtom-D6bgTvKb.js → workspaceReadinessAtom-BIm13kLJ.js} +2 -2
- package/dist/client/index.html +33 -31
- package/dist/forge-build.json +1 -1
- package/dist/{open-yHTUkd2Y.mjs → open-2-reBrpv.mjs} +3 -3
- package/package.json +1 -1
- package/dist/client/assets/CompositeItem-DTyKsv13.js +0 -2
- package/dist/client/assets/CompositeList-Bc8TYCyy.js +0 -2
- package/dist/client/assets/DiffPanel-3EEekk0W.js +0 -64
- package/dist/client/assets/PullRequestCodePanel--fricLiS.js +0 -5
- package/dist/client/assets/Stream-mUTFnSY9.js +0 -15
- package/dist/client/assets/ThemeEditorPanel-BCJuZ6ai.js +0 -2
- package/dist/client/assets/Virtualizer-DX75f7Mw.js +0 -2
- package/dist/client/assets/WorkerPoolContext-D_2lN-9Y.js +0 -1533
- package/dist/client/assets/atomRegistry-C1yW8tyM.js +0 -3
- package/dist/client/assets/chevron-left-1XbEOuXj.js +0 -2
- package/dist/client/assets/chevron-right-DAF000Jz.js +0 -2
- package/dist/client/assets/cmmdAuthRedirect-DRkKjx0G.js +0 -3
- package/dist/client/assets/cmmdForgeRuntimeListResource-Df9wlF4U.js +0 -1008
- package/dist/client/assets/currentForgeWorkspaceStore-CiCPSq18.js +0 -2
- package/dist/client/assets/dialog-C0bK23D8.js +0 -2
- package/dist/client/assets/getPseudoElementBounds-DJTX-eyW.js +0 -2
- package/dist/client/assets/index-BHReJBiJ.js +0 -301
- package/dist/client/assets/minus-_j91i8bf.js +0 -2
- package/dist/client/assets/popover-ClRgm7hB.js +0 -2
- package/dist/client/assets/scroll-area-BHqISEYq.js +0 -2
- package/dist/client/assets/sidebarV2CustomSnoozeDialog-lbAJoff_.js +0 -2
- package/dist/client/assets/src-B_wrKHuq.js +0 -3
- package/dist/client/assets/switch-BWQHMJkU.js +0 -2
- package/dist/client/assets/toggle-CORC1vE9.js +0 -2
- package/dist/client/assets/toggle-group-C9nAr6VB.js +0 -2
- package/dist/client/assets/tooltip-CrS-TEbN.js +0 -2
- package/dist/client/assets/useOpenInteractionType-KsRrk6uH.js +0 -2
- package/dist/client/assets/utils-xQJ3ak-X.js +0 -2
|
@@ -1,1008 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/currentForgeWorkspaceStore-CiCPSq18.js","assets/rolldown-runtime-hePW80VL.js","assets/Stream-mUTFnSY9.js","assets/cmmdAuthRedirect-DRkKjx0G.js","assets/atomRegistry-C1yW8tyM.js","assets/src-B_wrKHuq.js","assets/preload-helper-Czpn1I53.js","assets/transport-CgH8pQK3.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{Ha as n,Oa as r,Ua as i,Wa as a}from"./Stream-mUTFnSY9.js";import{Fn as o,H as s,In as c,J as l,Mn as u,Nt as d,On as f,Ot as p,Tn as m,a as h,bt as g,cn as _,er as v,gn as y,hn as b,i as x,jn as S,kn as C,pn as w,sn as T,v as ee,vn as E,vt as te,wt as ne,yn as re}from"./src-B_wrKHuq.js";import{A as ie,F as ae,L as oe,M as D,N as se,P as ce,a as le,c as ue,d as de,l as fe,n as pe,s as me,u as he}from"./cmmdAuthRedirect-DRkKjx0G.js";import{t as ge}from"./utils-xQJ3ak-X.js";import{t as _e}from"./preload-helper-Czpn1I53.js";import{t as ve}from"./react-D4GEJ3ir.js";import{n as O,t as ye}from"./transport-CgH8pQK3.js";import{t as be}from"./debouncer-BEV7Iuwb.js";var k=t(a(),1),xe=typeof window<`u`&&(window.desktopBridge!==void 0||window.nativeApi!==void 0);function Se(e){return{id:e.id??`ws:${e.label}`,label:e.label,source:e.source??`manual`,target:e.target}}function Ce(e){return e?.target.wsBaseUrl??null}function we(e){return e?.target.httpBaseUrl??null}function Te(e,t){return{...e,environmentId:t.environmentId,label:t.label}}function Ee(e){return e.cloudMode?`cmmd-cloud-runtime`:`local-web`}function eee(e){let t=Ee(e);return{topology:t,controlPlane:t!==`cmmd-cloud-runtime`,executionPlane:!0,workspaceProxy:!1}}function tee(e){let t=e.topology===`cmmd-cloud-runtime`;return{cmmd:!0,ownerBootstrapPromotion:e.topology!==`cloud-shell`&&!t,bearerBootstrap:!0,desktopBootstrap:e.topology===`desktop-local`,providerCredentialBroker:e.topology===`cmmd-control-plane`}}function De(e){let t=e.executionPlane;return{agents:t,browser:t,github:t,terminal:t,providerEgress:e.topology===`cmmd-control-plane`}}function Oe(e,t){return{localProjects:t.executionPlane,cloudProjects:e.cloudMode}}function ke(e){let t=e.capabilities,n=t.runtime??eee(t);return{repositoryIdentity:t.repositoryIdentity,pullRequests:t.pullRequests??!1,cloudMode:t.cloudMode,posthogPublicKey:t.posthogPublicKey,posthogHost:t.posthogHost,runtime:n,auth:t.auth??tee(n),tools:t.tools??De(n),projects:t.projects??Oe(t,n)}}function Ae(e){return e?ke(e).projects.cloudProjects:!1}function je(e){return e?ke(e).runtime.workspaceProxy??!1:!1}function Me(e,t){return{environmentId:e,projectId:t}}function Ne(e,t){return{environmentId:e,threadId:t}}var Pe=`scoped:v1:`;function Fe(e){let t=`projectId`in e?e.projectId:e.threadId;return t.includes(`:`)||e.environmentId.startsWith(Pe)?`${Pe}${encodeURIComponent(e.environmentId)}:${encodeURIComponent(t)}`:`${e.environmentId}:${t}`}function nee(e){return Fe(e)}function ree(e){return Fe(e)}function Ie(e){let t=e.slice(10),n=t.indexOf(`:`);if(n<=0||n>=t.length-1||t.indexOf(`:`,n+1)!==-1)return null;try{let e=decodeURIComponent(t.slice(0,n)),r=decodeURIComponent(t.slice(n+1));return e.length>0&&r.length>0?{environmentId:e,localId:r}:null}catch{return null}}function Le(e){if(e.startsWith(Pe))return Ie(e);let t=e.lastIndexOf(`:`);return t<=0||t>=e.length-1?null:{environmentId:e.slice(0,t),localId:e.slice(t+1)}}function Re(e){let t=Le(e);return t?{environmentId:t.environmentId,projectId:t.localId}:null}function ze(e){let t=Le(e);return t?{environmentId:t.environmentId,threadId:t.localId}:null}var Be=n();function Ve(e){return e.stageLabel.trim().toLowerCase()===`latest`?e.baseName:`${e.baseName} (${e.stageLabel})`}var He=`Forge`,Ue=``,We=Ue===`latest`||Ue===`nightly`?Ue:null,Ge=We===`nightly`?`Nightly`:We===`latest`?`Latest`:null,Ke=Ge??`Alpha`,qe=Ge?Ve({baseName:He,stageLabel:Ke}):He,iee=`0.14.0`,Je=ge(`forge-app-top-bar drag-region @container/header-actions relative z-20 w-full min-w-0 shrink-0 bg-background`,`grid grid-cols-[minmax(0,1fr)_minmax(0,auto)] items-center`),Ye=`flex h-full min-w-0 items-center gap-1 md:gap-1.5`,Xe=`flex h-touch min-w-0 max-w-full touch-manipulation items-center justify-center rounded-lg px-3 text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring md:h-7 md:px-2`,aee={width:`calc(100% - var(--forge-right-panel-reserved-width, 0px))`},Ze=`forge-app-shell flex w-full min-w-0 flex-row`,Qe=`forge-app-shell flex w-full min-w-0 flex-col`,$e=`flex min-h-0 min-w-0 flex-1 flex-col`,et=`relative flex h-[var(--forge-content-height)] min-h-0 min-w-0 flex-1 overflow-hidden`,tt=i();function nt(e){let t=(0,Be.c)(19),{showStageBadge:n,tone:r,variant:i}=e,a=n!==void 0&&n,o=r===void 0?`default`:r,s=(i===void 0?`default`:i)===`auth`,c=s?20:16,l=s?`h-5 w-5 shrink-0`:`h-4 w-4 shrink-0`,u;t[0]!==c||t[1]!==l?(u=(0,tt.jsx)(`img`,{className:l,src:`/forge-mark.svg`,width:c,height:c,alt:``,"aria-hidden":`true`}),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f=s?`text-[15px] sm:text-base`:`text-sm`,p=o===`on-dark`?`text-primary-foreground`:`text-foreground`,m;t[3]!==f||t[4]!==p?(m=ge(`truncate font-semibold tracking-tight`,f,p),t[3]=f,t[4]=p,t[5]=m):m=t[5];let h;t[6]===m?h=t[7]:(h=(0,tt.jsx)(`span`,{className:m,children:He}),t[6]=m,t[7]=h);let g=h,_=s?`rounded-full bg-muted/50 px-2 py-0.5 text-[9px] leading-none font-medium tracking-[0.14em] text-muted-foreground/70 uppercase [text-indent:0.14em]`:`rounded-full bg-muted/50 px-1.5 py-0.5 text-[8px] leading-none font-medium tracking-[0.18em] text-muted-foreground/60 uppercase [text-indent:0.18em]`,v;t[8]===_?v=t[9]:(v=(0,tt.jsx)(`span`,{className:_,children:Ke}),t[8]=_,t[9]=v);let y=v;if(a){let e;t[10]!==d||t[11]!==g?(e=(0,tt.jsxs)(`span`,{className:`flex items-center gap-2`,children:[d,g]}),t[10]=d,t[11]=g,t[12]=e):e=t[12];let n;return t[13]!==y||t[14]!==e?(n=(0,tt.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md`,"aria-label":qe,children:[e,y]}),t[13]=y,t[14]=e,t[15]=n):n=t[15],n}let b;return t[16]!==d||t[17]!==g?(b=(0,tt.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,"aria-label":qe,children:[d,g]}),t[16]=d,t[17]=g,t[18]=b):b=t[18],b}function rt(e){let t=(0,Be.c)(5),{className:n}=e,r;t[0]===n?r=t[1]:(r=ge(`pointer-events-none flex select-none items-center`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,tt.jsx)(nt,{}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,tt.jsx)(`div`,{className:r,children:i}),t[3]=r,t[4]=a),a}function it(){let e=new Map;return{clear:()=>e.clear(),getItem:t=>e.get(t)??null,key:t=>Array.from(e.keys()).at(t)??null,get length(){return e.size},removeItem:t=>e.delete(t),setItem:(t,n)=>e.set(t,n)}}var at=typeof window<`u`?window.localStorage:it(),ot=(e,t)=>m(u(e))(t),st=(e,t)=>S(u(e))(t),ct=(e,t)=>{let n=at.getItem(e);return n?ot(t,n):null},lt=(e,t,n)=>{let r=st(n,t);at.setItem(e,r)},ut=e=>{at.removeItem(e)},dt=`forge:local_storage_change`;function ft(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(dt,{detail:{key:e}}))}function pt(e,t,n){let[r,i]=(0,k.useState)(()=>{try{return ct(e,n)??t}catch(e){return console.error(`[LOCALSTORAGE] Error:`,e),t}}),a=(0,k.useCallback)(t=>{i(r=>{try{let i=typeof t==`function`?t(r):t;return i===null?ut(e):lt(e,i,n),queueMicrotask(()=>ft(e)),i}catch(e){return console.error(`[LOCALSTORAGE] Error:`,e),r}})},[e,n]),o=(0,k.useRef)(e);return(0,k.useEffect)(()=>{if(o.current!==e){o.current=e;try{let r=ct(e,n);i(r??t)}catch(e){console.error(`[LOCALSTORAGE] Error:`,e)}}},[e,t,n]),(0,k.useEffect)(()=>{let r=()=>{try{let r=ct(e,n);i(r??t)}catch(e){console.error(`[LOCALSTORAGE] Error:`,e)}},a=t=>{t.key===e&&r()},o=t=>{t.detail.key===e&&r()};return window.addEventListener(`storage`,a),window.addEventListener(dt,o),()=>{window.removeEventListener(`storage`,a),window.removeEventListener(dt,o)}},[e,t,n]),[r,a]}var mt=`cmmd-runtime:`;function ht(e){return`${mt}${e}`}var gt=`cmmd-cloud-project:`,_t=/^env_[0-9a-f]{32}$/,vt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,yt={shape:`local`,isCloud:!1,legacyRuntimeId:null},oee={shape:`cloud-project-placeholder`,isCloud:!0,legacyRuntimeId:null},see={shape:`durable-environment`,isCloud:!0,legacyRuntimeId:null};function bt(e){if(typeof e!=`string`)return yt;if(e.startsWith(`cmmd-runtime:`)){let t=e.slice(mt.length);return vt.test(t)?{shape:`legacy-runtime`,isCloud:!0,legacyRuntimeId:t}:yt}return e.startsWith(`cmmd-cloud-project:`)?oee:_t.test(e)?see:yt}var xt=`forge:client-settings:v1`,cee=`forge:saved-environment-registry:v1`,lee=re({environmentId:p,label:E,httpBaseUrl:E,wsBaseUrl:E,createdAt:E,lastConnectedAt:b(E),cmmdOrganizationId:c(E),cmmdProjectId:c(E),runtimeId:c(E),runtimeTicketExpiresAt:c(E),lastAuthenticatedPullRequestCapability:c(_),bearerToken:c(E)}),St=re({version:c(y),records:c(T(lee))});function Ct(){return typeof window<`u`}var uee={uiFontSize:14,codeFontSize:15},dee=[[`uiFontSize`,11,20],[`codeFontSize`,11,20]];function fee(e){return e.defaultThreadRuntime===`desktop-cloud-bridge`?{...e,defaultThreadRuntime:`cloud`}:null}function pee(e){if(typeof e.fontDefaultsVersion==`number`)return null;let t=Object.entries(uee).filter(([t,n])=>e[t]===n);if(t.length===0)return null;let n={...e};for(let[e]of t)delete n[e];return n}function mee(e){let t=dee.flatMap(([t,n,r])=>{let i=e[t];if(typeof i!=`number`||!Number.isFinite(i))return[];let a=Math.min(r,Math.max(n,Math.round(i)));return a===i?[]:[[t,a]]});if(t.length===0)return null;let n={...e};for(let[e,r]of t)n[e]=r;return n}function wt(e){if(!e||typeof e!=`object`)return e;let t=e,n=!1;for(let e of[fee,pee,mee]){let r=e(t);r!==null&&(t=r,n=!0)}return n?t:e}function hee(){if(!Ct())return null;try{let e=window.localStorage.getItem(xt);return e?C(ee)(wt(JSON.parse(e))):null}catch{return null}}function gee(e){Ct()&<(xt,e,ee)}function Tt(){if(!Ct())return{};try{return ct(`forge:saved-environment-registry:v1`,St)??{}}catch{return{}}}function Et(e){Ct()&<(cee,e,St)}function Dt(){return Tt().records??[]}function Ot(e){Et({version:1,records:e})}function kt(){return Dt().map(e=>s(e))}function At(e){let t=new Map(Dt().map(e=>[e.environmentId,e]));Ot(e.map(e=>{let n=bt(e.environmentId).legacyRuntimeId===null?t.get(e.environmentId)?.bearerToken:void 0;return n?{...s(e),bearerToken:n}:s(e)}))}function jt(e){return Dt().find(t=>t.environmentId===e)?.bearerToken??null}function Mt(e,t){let n=Tt(),r=n.records??[],i=!1;return Et({version:n.version??1,records:r.map(n=>n.environmentId===e?(i=!0,Object.assign(s(n),{bearerToken:t})):n)}),i}function Nt(e){let t=Tt();Et({version:t.version??1,records:(t.records??[]).map(t=>t.environmentId===e?s(t):t)})}var Pt=C(ee);function Ft(){return typeof window>`u`?void 0:window.desktopBridge}function It(e){let t=Ft(),n=t?.[e];return typeof n==`function`?n.bind(t):null}async function Lt(){let e=It(`getClientSettings`);if(e){let t=await e();return t?Pt(t):null}return hee()}async function Rt(e){let t=It(`setClientSettings`);if(t)return t(e);gee(e)}async function zt(){let e=It(`getSavedEnvironmentRegistry`);return e?e():kt()}async function Bt(e){let t=It(`setSavedEnvironmentRegistry`);if(t)return t(e);At(e)}async function Vt(e){let t=It(`getSavedEnvironmentSecret`);return t?t(e):jt(e)}async function Ht(e,t){let n=It(`setSavedEnvironmentSecret`);return n?n(e,t):Mt(e,t)}async function Ut(e){let t=It(`removeSavedEnvironmentSecret`);if(t)return t(e);Nt(e)}var Wt=`token`;function Gt(e){return new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash)}function Kt(e){let t=Gt(e).get(Wt)?.trim()??``;if(t.length>0)return t;let n=e.searchParams.get(Wt)?.trim()??``;return n.length>0?n:null}function qt(e){let t=new URL(e.toString()),n=Gt(t);return n.has(Wt)&&(n.delete(Wt),t.hash=n.toString()),t.searchParams.delete(Wt),t}function Jt(e,t){let n=new URL(e.toString());return n.searchParams.delete(Wt),n.hash=new URLSearchParams([[Wt,t]]).toString(),n}function Yt(e,t){let n=new URL(e);return n.pathname=`/login`,Jt(n,t).toString()}function Xt(e){return Jt(new URL(`/login`,window.location.href),e).toString()}var Zt=`host`;function Qt(e){let t=new URL(e),n=Kt(t),r=new URL(`forge:///pair`);return r.searchParams.set(Zt,t.origin),n&&r.searchParams.set(Wt,n),r.toString()}var $t=`/api/cmmd/auth-runtime`;function en(e){return O({method:`POST`,path:$t},e)}function tn(e){return O({method:`GET`,path:$t},e)}function nn(e){return O({method:`DELETE`,path:$t},e)}function rn(e){return O({method:`POST`,path:`${$t}/connect`},e)}function an(e,t){return O({method:`GET`,path:`/api/cmmd/billing`,...t?.organizationId===void 0?{}:{query:{orgId:t.organizationId}}},e)}function on(e,t){return O({method:`GET`,path:`/api/cmmd/billing/series`,query:{timeZone:t.timeZone}},e)}function sn(e,t){return O({method:`GET`,path:`/api/cmmd/bootstrap`,...t?.organizationId===void 0?{}:{query:{orgId:t.organizationId}}},e)}var cn=`/api/cmmd/providers/codex/credential`,ln=`/api/cmmd/providers/claude/credential`;function un(e){return O({method:`GET`,path:cn},e)}function dn(e){return O({method:`DELETE`,path:cn},e)}function fn(e){return O({method:`GET`,path:ln},e)}function pn(e){return O({method:`DELETE`,path:ln},e)}function mn(e,t){return O({method:`DELETE`,path:`/api/cmmd/providers/accounts/${encodeURIComponent(String(t))}`},e)}function hn(e,t,n){return`/api/cmmd/threads/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/disposition`}function gn(e,t,n,r,i){return O({method:`PUT`,path:hn(t,n,r),body:i},e)}function _n(e){return(t,n,r,i)=>gn(e,t,n,r,i)}function vn(e,t=``){return`/api/cmmd/thread-attachments/${encodeURIComponent(e)}${t}`}function yn(e){return{async listThreadAttachments(t){return O({method:`GET`,path:vn(t)},e)},async uploadThreadAttachment(t,n,r,i){let a=new FormData;return a.append(`file`,n),r!==void 0&&a.append(`attachmentId`,r),O({method:`POST`,path:vn(t),form:a,...i===void 0?{}:{signal:i}},e)},async getThreadAttachmentDownloadUrl(t,n){return O({method:`GET`,path:vn(t,`/${encodeURIComponent(n)}/download`)},e)},async deleteThreadAttachment(t,n){await O({method:`DELETE`,path:vn(t,`/${encodeURIComponent(n)}`)},e)}}}var bn=class extends Error{constructor(e){super(e),this.name=`CmmdApiAuthError`}},xn=class extends Error{status;constructor(e,t){super(e),this.name=`CmmdApiServerError`,this.status=t}};async function Sn(e){try{return await e}catch(e){throw e instanceof ye?e.kind===`auth`?new bn(e.message):new xn(e.message,e.status??502):e}}function Cn(e,t,n){return`/api/cmmd/threads/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/archive`}function wn(e,t,n,r,i){return O({method:`POST`,path:Cn(t,n,r),body:i},e)}function Tn(e){return(t,n,r,i)=>wn(e,t,n,r,i)}function En(e){return typeof e==`object`&&!!e&&`status`in e&&e.status===409}async function Dn(e){let t={action:e.action,...e.operationId===void 0?{}:{operationId:e.operationId},expectedRevision:e.expectedRevision,force:e.force};try{return await e.submit(t)}catch(n){if(!En(n))throw n;let r=await e.refresh();return e.submit({...t,expectedRevision:r.revision})}}function On(e){return{getForgeAccountPreferences:()=>O({method:`GET`,path:`/api/cmmd/account/preferences`},e),updateForgeAccountPreferences:t=>O({method:`PATCH`,path:`/api/cmmd/account/preferences`,body:t},e),getUserSettings:t=>O({method:`GET`,path:`/api/cmmd/user/settings/${t}`},e),putUserSettings:(t,n)=>O({method:`PUT`,path:`/api/cmmd/user/settings/${t}`,body:n},e)}}function kn(e,t,n){return O({method:`POST`,path:`/api/cmmd/forge-runtimes/${encodeURIComponent(t)}/rename`,body:{displayName:n}},e)}function An(e,t,n){return O({method:`POST`,path:`/api/cmmd/devices/${encodeURIComponent(String(t))}/rename`,body:{displayName:n}},e)}function jn(e,t){return O({method:`POST`,path:`/api/cmmd/devices/${encodeURIComponent(String(t))}/revoke`},e)}function Mn(e){return{...e?.projectId===void 0?{}:{projectId:String(e.projectId)},...e?.allWorkspaces===!0?{allWorkspaces:`true`}:{},...e?.organizationId===void 0?{}:{orgId:String(e.organizationId)}}}var Nn=`rt-demo`,Pn=`th-demo`,Fn=`example-project`,In=`example-conversation`,Ln=`2026-09-26T20:00:00.000Z`;function Rn(e,t){return e===Nn&&t===Pn}function zn(){return{runtime:{id:Nn,source:`forge-cloud`,runtimeKind:`cloud-vm`,displayName:`Example Forge Server`,status:`online`,endpointUrl:null,hostId:null,deviceId:null,workspaceRoot:null,githubRepoFullName:null,lastSeenAt:Ln,reachability:{status:`online`,lastReachableAt:Ln,source:`cloud-runtime`},metadata:null},inventoryStatus:`synced`,inventoryPublishedAt:Ln,projectCount:1,threadCount:1,projects:[{projectId:Fn,title:`Example project`,workspaceRoot:null,githubRepoFullName:null,branch:null,status:`active`,threadCount:1,lastActivityAt:Ln,metadata:null,publishedAt:Ln,updatedAt:Ln,threads:[{threadId:Pn,title:`Example thread (viewer check)`,status:`active`,model:null,provider:null,providerAccountId:null,branch:null,lastMessagePreview:null,lastActivityAt:Ln,kind:`master`,parentThreadId:null,workerRole:null,anchorKind:`scratch`,anchorCmmdId:null,archive:null,disposition:{manualDisposition:null,automaticDisposition:null,effectiveDisposition:null,revision:null,source:null},metadata:null,publishedAt:Ln,updatedAt:Ln}]}]}}function Bn(){return{conversationId:In,runtime:{id:Nn,source:`forge-cloud`,runtimeKind:`cloud-vm`,displayName:`Example Forge Server`,status:`online`,endpointUrl:null,deviceId:null,workspaceRoot:null,githubRepoFullName:null,lastSeenAt:Ln,metadata:null},project:{projectId:Fn,title:`Example project`,githubRepoFullName:null,branch:null},thread:{threadId:Pn,title:`Example thread (viewer check)`,status:`active`,model:null,provider:null,providerAccountId:null,branch:null,lastActivityAt:Ln,metadata:null},reachability:`online`,execution:{available:!0,reason:null},replication:null,events:[{sequence:1,eventId:`example-user-1`,kind:`user_message`,turnId:null,text:`This is an example chat thread for verifying the Forge embed viewer. It is not a live Work Session.`,status:null,occurredAt:`2026-09-26T19:58:00.000Z`},{sequence:2,eventId:`example-assistant-1`,kind:`assistant_message`,turnId:null,text:`Understood. You should see this reply in the iframe under CMMD /forge, with the composer still available below.`,status:null,occurredAt:`2026-09-26T19:59:00.000Z`},{sequence:3,eventId:`example-user-2`,kind:`user_message`,turnId:null,text:`Thanks. If these three turns render, the thread wire is working.`,status:null,occurredAt:Ln}]}}function Vn(e){return e.runtimes.some(e=>e.runtime.id===Nn)?{...e,runtimes:[...e.runtimes]}:{...e,runtimes:[...e.runtimes,zn()]}}function A(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():null}function _ee(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`boolean`?n:null}function Hn(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():typeof n==`number`&&Number.isFinite(n)?String(n):null}function Un(e){return{...e.limit===void 0?{}:{limit:e.limit},...e.cursor?{cursor:e.cursor}:{}}}var Wn=class extends Error{constructor(e){super(`CmmdApiClient.${e} is not implemented yet`),this.name=`CmmdApiNotImplementedError`}};function Gn(e,t){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let n=e[t];if(Array.isArray(n))return n}return[]}function Kn(e,t){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let n=e[t];if(Array.isArray(n))return n}return[]}function qn(e,t){let n={};return e?.organizationId&&(n.orgId=e.organizationId),t!==void 0&&(n.taskId=String(t)),Object.keys(n).length>0?n:void 0}function Jn(e){let t=`${A(e,`firstName`)??``} ${A(e,`lastName`)??``}`.trim()||A(e,`username`)||A(e,`email`)||`Unknown`;return{id:Hn(e,`userId`)??Hn(e,`id`)??t,name:t,email:A(e,`email`),role:A(e,`role`),avatarUrl:A(e,`profileImage`)??A(e,`avatar`)}}function vee(e){let t=Xn(e,`user`)??e;return Jn({...typeof t==`object`&&t?t:{},userId:Hn(e,`userId`)??Hn(t,`id`),role:A(e,`role`)})}function Yn(e){let t=A(e,`authorFirstName`)??``,n=A(e,`authorLastName`)??``,r=A(e,`status`),i=r===`at_risk`||r===`off_track`||r===`complete`?r:`on_track`;return{id:Hn(e,`id`)??``,status:i,body:A(e,`body`)??``,authorName:`${t} ${n}`.trim()||null,authorAvatarUrl:A(e,`authorProfileImage`)??null,createdAt:A(e,`createdAt`)??``,updatedAt:A(e,`updatedAt`)??A(e,`createdAt`)??``,canEdit:_ee(e,`canEdit`)??!1}}function yee(e,t,n){let r=Array.isArray(e.data)?e.data.map(Yn):[];return{updates:r,pagination:e.pagination??{page:t,limit:n,total:r.length,hasMore:!1}}}function Xn(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return n&&typeof n==`object`?n:null}var bee=[`avatarUrl`,`avatar_url`,`profileImage`,`profile_image`,`profileImageUrl`,`profile_image_url`,`image`,`imageUrl`,`image_url`,`picture`];function Zn(e,t){let n=Xn(e,t);if(!n)return null;for(let e of bee){let t=A(n,e);if(t)return t}return null}function Qn(e,t){let n=Xn(e,t);return n?Hn(n,`id`):null}function $n(e,t){return!!(e&&typeof e==`object`&&Object.hasOwn(e,t))}function xee(e){let t={...e,id:Hn(e,`id`)??e.id,title:e.title??A(e,`name`)??``},n=Hn(e,`workspaceId`)??Hn(e,`workspace_id`)??Qn(e,`workspace`)??e.workspaceId??null;return n!==null||$n(e,`workspaceId`)?{...t,workspaceId:n,startDate:e.startDate??A(e,`start_date`)??null,endDate:e.endDate??A(e,`end_date`)??null}:t}function er(e){let t=e.ownerAvatarUrl??A(e,`owner_avatar_url`)??A(e,`ownerProfileImage`)??A(e,`owner_profile_image`)??A(e,`ownerImage`)??A(e,`owner_image`)??A(e,`ownerImageUrl`)??A(e,`owner_image_url`)??A(e,`createdByAvatarUrl`)??A(e,`created_by_avatar_url`)??A(e,`createdByProfileImage`)??A(e,`created_by_profile_image`)??Zn(e,`owner`)??Zn(e,`createdBy`)??Zn(e,`created_by`)??null,n={...e,id:Hn(e,`id`)??e.id},r=Hn(e,`campaignId`)??Hn(e,`campaign_id`)??Qn(e,`campaign`)??e.campaignId??null;(r!==null||$n(e,`campaignId`))&&(n.campaignId=r);let i=e.campaignTitle??A(e,`campaignTitle`)??A(e,`campaign_title`)??A(Xn(e,`campaign`),`title`)??A(Xn(e,`campaign`),`name`)??null;(i!==null||$n(e,`campaignTitle`))&&(n.campaignTitle=i);let a=Hn(e,`workspaceId`)??Hn(e,`workspace_id`)??Qn(e,`workspace`)??e.workspaceId??null;(a!==null||$n(e,`workspaceId`))&&(n.workspaceId=a);let o=e.workspaceName??A(e,`workspace_name`)??A(Xn(e,`workspace`),`name`)??null;(o!==null||$n(e,`workspaceName`))&&(n.workspaceName=o);let s=A(e,`workspaceIconUrl`)??A(e,`workspace_icon_url`)??A(Xn(e,`workspace`),`iconUrl`)??null;(s!==null||$n(e,`workspaceIconUrl`))&&(n.workspaceIconUrl=s);let c=Hn(e,`ownerId`)??Hn(e,`owner_id`)??Qn(e,`owner`)??e.ownerId??null;(c!==null||$n(e,`ownerId`))&&(n.ownerId=c);let l=e.ownerName??A(e,`owner_name`)??A(Xn(e,`owner`),`name`)??null;(l!==null||$n(e,`ownerName`))&&(n.ownerName=l),(t!==null||$n(e,`ownerAvatarUrl`))&&(n.ownerAvatarUrl=t);let u=Hn(e,`teamId`)??Hn(e,`team_id`)??Qn(e,`team`)??e.teamId??null;(u!==null||$n(e,`teamId`))&&(n.teamId=u);let d=e.teamName??A(e,`team_name`)??A(Xn(e,`team`),`name`)??null;(d!==null||$n(e,`teamName`))&&(n.teamName=d);let f=e.startDate??A(e,`start_date`)??null;(f!==null||$n(e,`startDate`))&&(n.startDate=f);let p=e.targetEndDate??A(e,`target_end_date`)??null;return(p!==null||$n(e,`targetEndDate`))&&(n.targetEndDate=p),n}function tr(e){if(Array.isArray(e))return e;if(e&&typeof e==`object`){let t=e;if(Array.isArray(t.items))return t.items;if(Array.isArray(t.results))return t.results}return[]}function See(e){return tr(e).flatMap(e=>{let t=e,n=typeof t.id==`number`?t.id:null,r=typeof t.name==`string`?t.name:null;if(n===null||r===null)return[];let i=e=>typeof t[e]==`string`?t[e]:null;return[{id:n,name:r,startDate:i(`startDate`),endDate:i(`endDate`),status:i(`status`)}]})}function Cee(e){if(e&&typeof e==`object`){let t=e;if(t.project&&typeof t.project==`object`)return t.project}return e}function nr(e){if(e===null||e.trim()===``)return null;let t=Number(e);return Number.isSafeInteger(t)?t:e}var rr=class e{cfg;putThreadDisposition;listThreadAttachments;uploadThreadAttachment;getThreadAttachmentDownloadUrl;deleteThreadAttachment;postThreadArchive;getForgeAccountPreferences;updateForgeAccountPreferences;getUserSettings;putUserSettings;commentEditIdempotencyKeys=new Map;commentDeleteIdempotencyKeys=new Map;constructor(e={}){let t=e.forgeOrigin===void 0,n=e.forgeOrigin??`http://localhost:13773`;this.cfg={resolveUrl:t?ae:e=>`${n}${e}`,maxRetries:e.maxRetries??3,onAuthExpired:e.onAuthExpired??pe,...t?{resolveBearerToken:()=>ce()?.bearerToken??null}:{}},this.putThreadDisposition=_n(this.cfg);let r=yn(this.cfg);this.listThreadAttachments=r.listThreadAttachments,this.uploadThreadAttachment=r.uploadThreadAttachment,this.getThreadAttachmentDownloadUrl=r.getThreadAttachmentDownloadUrl,this.deleteThreadAttachment=r.deleteThreadAttachment,this.postThreadArchive=Tn(this.cfg);let i=On(this.cfg);this.getForgeAccountPreferences=i.getForgeAccountPreferences,this.updateForgeAccountPreferences=i.updateForgeAccountPreferences,this.getUserSettings=i.getUserSettings,this.putUserSettings=i.putUserSettings}async getTask(e){return Sn(O({method:`GET`,path:`/api/cmmd/tasks/${e}`},this.cfg))}async getForgeTaskDetail(e){return O({method:`GET`,path:`/api/cmmd/tasks/${e}`},this.cfg)}async searchTasks(e){let t={q:e.q};return e.status&&(t.status=e.status),e.limit!==void 0&&(t.limit=e.limit),e.projectId&&(t.projectId=e.projectId),(await Sn(O({method:`GET`,path:`/api/cmmd/tasks/search`,query:t},this.cfg))).tasks??[]}async getTaskComments(e){return(await Sn(O({method:`GET`,path:`/api/cmmd/tasks/${e}/comments`},this.cfg))).comments??[]}async listProjectTaskComments(e){return(await Sn(O({method:`GET`,path:`/api/cmmd/tasks/${e}/comments`},this.cfg))).comments??[]}async createProjectTaskComment(e,t){return(await Sn(O({method:`POST`,path:`/api/cmmd/tasks/comment`,body:{taskId:e,content:t.content}},this.cfg))).details}async updateProjectTaskComment(e,t,n){return(await Sn(O({method:`PATCH`,path:`/api/cmmd/tasks/${e}/comments/${encodeURIComponent(t)}`,body:n},this.cfg))).comment}async deleteProjectTaskComment(e,t,n){return Sn(O({method:`DELETE`,path:`/api/cmmd/tasks/${e}/comments/${encodeURIComponent(t)}`,body:n},this.cfg))}async getTaskAttachments(e){return Sn(O({method:`GET`,path:`/api/cmmd/tasks/${e}/attachments`},this.cfg))}async getProjectRepository(e){return Sn(O({method:`GET`,path:`/api/cmmd/projects/${e}/repository`},this.cfg))}async listProjectRepositories(e){return(await Sn(O({method:`GET`,path:`/api/cmmd/projects/${e}/repositories`},this.cfg))).repositories}async getWorkspaceMembers(e){return Sn(O({method:`GET`,path:`/api/cmmd/organizations/${e}/members`},this.cfg))}async getWebSocketToken(e){return O({method:`GET`,path:`/api/cmmd/ws-token`,...e?.signal===void 0?{}:{signal:e.signal}},this.cfg)}async getProjectComments(e,t){let n={};return t?.organizationId&&(n.organizationId=t.organizationId),(await O({method:`GET`,path:`/api/cmmd/projects/${e}/comments`,query:n},this.cfg))?.comments??[]}async getProjectLink(e){return O({method:`GET`,path:`/.well-known/forge/project-link`,query:{environmentId:e.environmentId,projectId:e.projectId,cwd:e.cwd}},this.cfg)}async listProjectLinks(){return O({method:`GET`,path:`/.well-known/forge/project-links`,suppressBearerToken:!0},this.cfg)}async listProjectContextLinks(e){let t={};e.environmentId&&(t.forgeEnvironmentId=e.environmentId),e.projectId&&(t.forgeProjectId=e.projectId),e.githubRepoFullName&&(t.githubRepoFullName=e.githubRepoFullName),e.cmmdOrganizationId&&(t.cmmdOrganizationId=e.cmmdOrganizationId);let n=await O({method:`GET`,path:`/.well-known/forge/cmmd/project-links`,query:t},this.cfg),r=f(l)(n);return r._tag===`Some`?r.value.links:[]}async listCmmdWorkspaces(){return tr(await O({method:`GET`,path:`/.well-known/forge/cmmd/workspaces`},this.cfg))}async listCmmdCampaigns(e){return See(await O({method:`GET`,path:`/.well-known/forge/cmmd/campaigns`,query:{workspaceId:e.workspaceId}},this.cfg))}async listCmmdProjects(e){return tr(await O({method:`GET`,path:`/.well-known/forge/cmmd/projects`,query:{campaignId:e.campaignId}},this.cfg))}async updateTask(e,t){let n={taskId:e};return t.title!==void 0&&(n.title=t.title),t.description!==void 0&&(n.description=t.description),t.status!==void 0&&(n.status=t.status),t.priority!==void 0&&(n.priority=t.priority),t.dueDate!==void 0&&(n.dueDate=t.dueDate),t.assigneeId!==void 0&&(n.assigneeId=t.assigneeId),t.labels!==void 0&&(n.labels=t.labels),Sn(O({method:`POST`,path:`/api/cmmd/tasks/update`,body:n},this.cfg))}async createComment(e){return Sn(O({method:`POST`,path:`/api/cmmd/tasks/comment`,body:{taskId:e.entityId,content:e.content}},this.cfg))}async updateComment(e,t,n){let r=`${e}:${t}:${n}`,i=this.commentEditIdempotencyKeys.get(r)??crypto.randomUUID();this.commentEditIdempotencyKeys.set(r,i);let a=await Sn(O({method:`PATCH`,path:`/api/cmmd/tasks/${e}/comments/${t}`,body:{content:n,idempotencyKey:i}},this.cfg));return this.commentEditIdempotencyKeys.delete(r),a}async deleteComment(e,t){let n=`${e}:${t}`,r=this.commentDeleteIdempotencyKeys.get(n)??crypto.randomUUID();this.commentDeleteIdempotencyKeys.set(n,r),await Sn(O({method:`DELETE`,path:`/api/cmmd/tasks/${e}/comments/${t}`,body:{idempotencyKey:r}},this.cfg)),this.commentDeleteIdempotencyKeys.delete(n)}async createProjectComment(e,t){let n=(await O({method:`POST`,path:`/api/cmmd/projects/${e}/comments`,body:{content:t.content,organizationId:t.organizationId??null}},this.cfg))?.comment;if(!n)throw new ye({kind:`server`,message:`CMMD did not return the created project comment.`});return n}async updateProject(e,t){let n={};for(let e of h){let r=t[e];r!==void 0&&(n[e]=x[e]===`nullableId`?nr(r):r)}await O({method:`PATCH`,path:`/api/cmmd/projects/${e}`,body:n},this.cfg)}async setProjectLink(e){await O({method:`POST`,path:`/.well-known/forge/project-link`,body:e},this.cfg)}async deleteProjectLink(e){await O({method:`DELETE`,path:`/.well-known/forge/project-link`,query:{environmentId:e.environmentId,projectId:e.projectId,cwd:e.cwd,...e.cmmdProjectId?{cmmdProjectId:e.cmmdProjectId}:{}}},this.cfg)}async createCmmdProject(e){return O({method:`POST`,path:`/.well-known/forge/cmmd/projects`,body:e},this.cfg)}async ensureGitHubProjectContext(e){return O({method:`POST`,path:`/.well-known/forge/cmmd/github-project-contexts/ensure`,body:e},this.cfg)}async createBrainDoc(e){return O({method:`POST`,path:`/api/cmmd/brain-docs`,body:e},this.cfg)}async uploadTaskAttachment(e,t){let n=new FormData;return n.append(`file`,t),Sn(O({method:`POST`,path:`/api/cmmd/tasks/${e}/attachments`,form:n},this.cfg))}async archiveTask(e){await O({method:`POST`,path:`/api/cmmd/tasks/${e}/archive`},this.cfg)}async unarchiveTask(e){await O({method:`POST`,path:`/api/cmmd/tasks/${e}/unarchive`},this.cfg)}async getProfile(){return O({method:`GET`,path:`/api/cmmd/profile`},this.cfg)}async getUsageSummary(e){return O({method:`GET`,path:`/api/cmmd/usage/summary`,query:{sinceDay:e.sinceDay,untilDay:e.untilDay,timeZone:e.timeZone,...e.resolution===`hour`?{resolution:e.resolution,sinceTime:e.sinceTime,untilTime:e.untilTime}:{}}},this.cfg)}getBilling(e){return an(this.cfg,e)}getBillingSeries(e){return on(this.cfg,e)}getBootstrap(e){return sn(this.cfg,e)}async getOrgProviderPolicy(){return O({method:`GET`,path:`/api/cmmd/org/provider-policy`},this.cfg)}async listSavedDataViews(e){return O({method:`GET`,path:`/api/cmmd/saved-views`,query:{surface:e.surface,projectId:e.projectId}},this.cfg)}async createSavedDataView(e){return O({method:`POST`,path:`/api/cmmd/saved-views`,body:e},this.cfg)}async importSavedDataView(e){return O({method:`POST`,path:`/api/cmmd/saved-views/import`,body:e},this.cfg)}async updateSavedDataView(e,t){return O({method:`PATCH`,path:`/api/cmmd/saved-views/${encodeURIComponent(e)}`,body:t},this.cfg)}async deleteSavedDataView(e,t){return O({method:`DELETE`,path:`/api/cmmd/saved-views/${encodeURIComponent(e)}`,query:t},this.cfg)}async getDeviceRegistry(e){return O({method:`GET`,path:`/api/cmmd/devices`,...e?.projectId===void 0?{}:{query:{projectId:String(e.projectId)}},...e?.signal===void 0?{}:{signal:e.signal}},this.cfg)}async registerDevice(e){return O({method:`POST`,path:`/api/cmmd/devices/register`,body:e},this.cfg)}async grantRuntimeAccess(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/access-grants`,body:t},this.cfg)}async revokeRuntimeAccess(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/access-grants/${encodeURIComponent(String(t))}/revoke`},this.cfg)}async issueRelayControlRoute(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/relay-routes`,body:t},this.cfg)}async issueRelayActionGrant(e,t){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/relay-action-grants`,body:t},this.cfg)}async getRuntimeInventory(e){let t=Mn(e);return Vn(await O({method:`GET`,path:`/api/cmmd/runtime-inventory`,...Object.keys(t).length>0?{query:t}:{}},this.cfg))}async getRuntimeDiagnostics(e){return O({method:`GET`,path:`/api/cmmd/runtime-diagnostics/v2/runtimes/${encodeURIComponent(e)}`},this.cfg)}async getCloudProjectLifecyclePreflight(e){return(await O({method:`GET`,path:`/api/cmmd/forge-cloud-projects/${encodeURIComponent(String(e))}/lifecycle-preflight`},this.cfg)).preflight}async replaceRuntimeInventory(e,t){return O({method:`PUT`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/inventory`,body:t},this.cfg)}static PROVIDER_ACCOUNTS_PATH=`/api/cmmd/providers/accounts`;static PROVIDER_USAGE_PATH=`/api/cmmd/providers/usage`;static PROVIDER_USAGE_REFRESH_PATH=`/api/cmmd/providers/usage/refresh`;provisionAuthRuntime(){return en(this.cfg)}getAuthRuntimeState(){return tn(this.cfg)}destroyAuthRuntime(){return nn(this.cfg)}connectAuthRuntime(){return rn(this.cfg)}getUserCodexCredential(){return un(this.cfg)}disconnectUserCodexCredential(){return dn(this.cfg)}getUserClaudeCredential(){return fn(this.cfg)}async getProviderAccounts(){return O({method:`GET`,path:e.PROVIDER_ACCOUNTS_PATH},this.cfg)}async removeLinkedProviderAccount(e){return mn(this.cfg,e)}async setProviderAccountDefault(t){return O({method:`PUT`,path:`${e.PROVIDER_ACCOUNTS_PATH}/default`,body:{provider:t.provider,provider_account_id:t.providerAccountId}},this.cfg)}async getProviderUsage(){return O({method:`GET`,path:e.PROVIDER_USAGE_PATH},this.cfg)}async refreshProviderUsage(t,n){return O({method:`POST`,path:e.PROVIDER_USAGE_REFRESH_PATH,body:{provider:t,providerAccountId:n}},this.cfg)}disconnectUserClaudeCredential(){return pn(this.cfg)}async getClaudeRuntimeReadiness(e){return O({method:`GET`,path:`/api/cmmd/providers/claude/runtime-readiness/${encodeURIComponent(e)}`},this.cfg)}async appendRuntimeThreadEvents(e,t,n){return O({method:`POST`,path:`/api/cmmd/devices/runtimes/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}/events`,body:n},this.cfg)}async getRuntimeThreadReplica(e,t){return Rn(e,t)?Bn():O({method:`GET`,path:`/api/cmmd/threads/${encodeURIComponent(e)}/${encodeURIComponent(t)}`},this.cfg)}renameCloudEnvironment(e,t){return kn(this.cfg,e,t)}renameDevice(e,t){return An(this.cfg,e,t)}revokeDevice(e){return jn(this.cfg,e)}static SIM_PATH=`/api/cmmd/sim-host`;static simScope(e){return e?.orgId===void 0?``:`?orgId=${encodeURIComponent(String(e.orgId))}`}async listSimHosts(t){return O({method:`GET`,path:`${e.SIM_PATH}/hosts${e.simScope(t)}`},this.cfg)}async getSimLease(t){let n=new URLSearchParams({forgeEnvironmentId:t.forgeEnvironmentId,threadId:t.threadId,...t.orgId===void 0?{}:{orgId:String(t.orgId)}});return O({method:`GET`,path:`${e.SIM_PATH}/leases?${n.toString()}`},this.cfg)}async claimSimLease(t){return O({method:`POST`,path:`${e.SIM_PATH}/leases${e.simScope(t)}`,body:{hostId:t.hostId,forgeEnvironmentId:t.forgeEnvironmentId,threadId:t.threadId,ttlMs:t.ttlMs}},this.cfg)}async renewSimLease(t){return O({method:`POST`,path:`${e.SIM_PATH}/leases/${encodeURIComponent(String(t.leaseId))}/renew${e.simScope(t)}`,body:{generation:t.generation,rowVersion:t.rowVersion,ttlMs:t.ttlMs}},this.cfg)}async releaseSimLease(t){await O({method:`POST`,path:`${e.SIM_PATH}/leases/${encodeURIComponent(String(t.leaseId))}/release${e.simScope(t)}`,body:{generation:t.generation,rowVersion:t.rowVersion}},this.cfg)}async listCampaigns(e){let t={};return e?.orgId&&(t.orgId=e.orgId),e?.allWorkspaces&&(t.allWorkspaces=`true`),Gn(await O({method:`GET`,path:`/api/cmmd/campaigns`,query:t,...e?.signal?{signal:e.signal}:{}},this.cfg),`campaigns`).map(xee)}async getCampaign(e){return O({method:`GET`,path:`/api/cmmd/campaigns/${e}`},this.cfg)}async createCampaign(e){return O({method:`POST`,path:`/api/cmmd/campaigns`,body:e},this.cfg)}async updateCampaign(e,t){return O({method:`PUT`,path:`/api/cmmd/campaigns/${e}`,body:t},this.cfg)}async deleteCampaign(e){await O({method:`DELETE`,path:`/api/cmmd/campaigns/${e}`},this.cfg)}async listProjects(e){let t={};return e?.campaignId&&(t.campaignId=e.campaignId),e?.orgId&&(t.orgId=e.orgId),e?.allWorkspaces&&(t.allWorkspaces=`true`),Gn(await O({method:`GET`,path:`/api/cmmd/projects`,query:t,...e?.signal?{signal:e.signal}:{}},this.cfg),`projects`).map(er)}async listTasks(e){let t={};return e?.projectId&&(t.projectId=e.projectId),e?.status&&(t.status=e.status),O({method:`GET`,path:`/api/cmmd/tasks`,query:t},this.cfg)}async getProject(e){return er(await O({method:`GET`,path:`/api/cmmd/projects/${e}`},this.cfg))}async getProjectMembers(e){let t=await O({method:`GET`,path:`/api/cmmd/projects/${e}/members`},this.cfg);return Array.isArray(t)?t.map(Jn):[]}async listWorkspaceMembers(){let e=await O({method:`GET`,path:`/api/cmmd/members`},this.cfg);return Array.isArray(e)?e.map(vee):[]}async addProjectMember(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/members`,body:t},this.cfg)}async listProjectAgentMembers(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/agent-members`},this.cfg)}async createProjectAgentMember(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members`,body:t},this.cfg)}async renameProjectAgentMember(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/agent-members/${t}`,body:n},this.cfg)}async retireProjectAgentMember(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members/${t}/retire`,body:n},this.cfg)}async updateProjectAgentMemberAvatar(e,t,n){return O({method:`PUT`,path:`/api/cmmd/projects/${e}/agent-members/${t}/avatar`,body:n},this.cfg)}async listProjectAgentMemberInstances(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/agent-members/${t}/instances`},this.cfg)}async previewProjectAgentMemberConsolidation(e){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members/consolidation/preview`},this.cfg)}async applyProjectAgentMemberConsolidation(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/agent-members/consolidation/apply`,body:t},this.cfg)}async setProjectTaskAssignment(e,t,n){return O({method:`PUT`,path:`/api/cmmd/projects/${e}/tasks/${t}/assignment`,body:n},this.cfg)}async getProjectUpdates(e,t){let n=t?.page??1,r=t?.limit??10;return yee(await O({method:`GET`,path:`/api/cmmd/projects/${e}/updates`,query:{page:n,limit:r},unwrapEnvelope:!1},this.cfg),n,r)}async createProjectUpdate(e,t){return Yn(await O({method:`POST`,path:`/api/cmmd/projects/${e}/updates`,body:t},this.cfg))}async updateProjectUpdate(e,t,n){return Yn(await O({method:`PATCH`,path:`/api/cmmd/projects/${e}/updates/${t}`,body:n},this.cfg))}async deleteProjectUpdate(e,t){await O({method:`DELETE`,path:`/api/cmmd/projects/${e}/updates/${t}`},this.cfg)}async listProjectMilestones(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/milestones`},this.cfg)}async createProjectMilestone(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/milestones`,body:t},this.cfg)}async updateProjectMilestone(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/milestones/${t}`,body:n},this.cfg)}async deleteProjectMilestone(e,t){await O({method:`DELETE`,path:`/api/cmmd/projects/${e}/milestones/${t}`},this.cfg)}async improveProjectContent(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/content/readability`,body:t},this.cfg)}async listProjectBoard(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/board`},this.cfg)}async createProjectTaskDraft(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts`,body:t},this.cfg)}async getProjectTaskDraft(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/task-drafts/${t}`},this.cfg)}async updateProjectTaskDraft(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/task-drafts/${t}`,body:n},this.cfg)}async previewProjectTaskDraft(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts/${t}/preview`,body:n},this.cfg)}async commitProjectTaskDraft(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts/${t}/commit`,body:n},this.cfg)}async discardProjectTaskDraft(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/task-drafts/${t}/discard`,body:n},this.cfg)}async getProjectTaskWorkflow(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/task-workflow`},this.cfg)}async updateProjectTaskWorkflow(e,t){return O({method:`PUT`,path:`/api/cmmd/projects/${e}/task-workflow`,body:t},this.cfg)}async getProjectLeadPlan(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/plan`},this.cfg)}async activateProjectLeadAutomaticStaffing(e){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/authority/activate`,body:{}},this.cfg)}async getProjectLeadReadiness(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/readiness`},this.cfg)}async getProjectLeadCapabilities(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/capabilities`},this.cfg)}async getProjectLeadSummary(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/summary`},this.cfg)}async getProjectLeadDetail(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/detail`},this.cfg)}async getProjectLeadBriefing(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/briefing`},this.cfg)}async decideProjectLeadApproval(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/approvals/${t}/decision`,body:n},this.cfg)}async listProjectLeadEvents(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/events`,...t?{query:{...t.afterEventId===void 0?{}:{afterEventId:String(t.afterEventId)},...t.latest===void 0?{}:{latest:String(t.latest)},...t.limit===void 0?{}:{limit:String(t.limit)}}}:{}},this.cfg)}async explainProjectLead(e){return O({method:`GET`,path:`/api/cmmd/projects/${e}/project-lead/explain`},this.cfg)}async pauseProjectLead(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/pause`,body:t},this.cfg)}async resumeProjectLead(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/resume`,body:t},this.cfg)}async reserveProjectLeadTask(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/tasks/${t}/reservations`,body:n},this.cfg)}async releaseProjectLeadReservation(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/reservations/${t}/release`,body:n},this.cfg)}async reconcileProjectLead(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/reconcile`,body:t},this.cfg)}async resolveProjectLeadAttention(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/project-lead/attention/${t}/resolve`,body:n},this.cfg)}async listCenterBoard(e){let t={};return e?.status&&(t.status=e.status),e?.workspaceId&&(t.workspaceId=String(e.workspaceId)),e?.campaignId&&(t.campaignId=String(e.campaignId)),e?.ownerId&&(t.ownerId=String(e.ownerId)),e?.includeArchived!==void 0&&(t.includeArchived=e.includeArchived),e?.q&&(t.q=e.q),O({method:`GET`,path:`/api/cmmd/work-items/board`,query:t},this.cfg)}async listForgeAutomationPresets(){return Kn(await O({method:`GET`,path:`/api/cmmd/automations/presets`},this.cfg),`presets`)}async listUserForgeAutomationRules(){return Kn(await O({method:`GET`,path:`/api/cmmd/automations/user/rules`},this.cfg),`rules`)}async createUserForgeAutomationRule(e){return O({method:`POST`,path:`/api/cmmd/automations/user/rules`,body:e},this.cfg)}async updateUserForgeAutomationRule(e,t){return O({method:`PATCH`,path:`/api/cmmd/automations/user/rules/${e}`,body:t},this.cfg)}async listUserForgeAutomationRuns(e){return Kn(await O({method:`GET`,path:`/api/cmmd/automations/user/rules/${e}/runs`},this.cfg),`runs`)}async startUserForgeAutomationRun(e,t){return O({method:`POST`,path:`/api/cmmd/automations/user/rules/${e}/runs`,body:t},this.cfg)}async listForgeAutomationRules(e,t){let n=qn(t);return Kn(await O({method:`GET`,path:`/api/cmmd/automations/projects/${e}/rules`,...n?{query:n}:{}},this.cfg),`rules`)}async createForgeAutomationRule(e,t,n){let r=qn(n);return O({method:`POST`,path:`/api/cmmd/automations/projects/${e}/rules`,body:t,...r?{query:r}:{}},this.cfg)}async updateForgeAutomationRule(e,t,n,r){let i=qn(r);return O({method:`PATCH`,path:`/api/cmmd/automations/projects/${e}/rules/${t}`,body:n,...i?{query:i}:{}},this.cfg)}async listForgeAutomationRuns(e,t){let n=qn(t,t?.taskId);return Kn(await O({method:`GET`,path:`/api/cmmd/automations/projects/${e}/runs`,...n?{query:n}:{}},this.cfg),`runs`)}async getForgeAutomationRun(e,t){let n=qn(t);return O({method:`GET`,path:`/api/cmmd/automations/runs/${e}`,...n?{query:n}:{}},this.cfg)}async startForgeAutomationRun(e,t,n,r){let i=qn(r);return O({method:`POST`,path:`/api/cmmd/automations/projects/${e}/tasks/${t}/runs`,body:n,...i?{query:i}:{}},this.cfg)}async retryForgeAutomationRun(e,t,n){let r=qn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/retry`,body:t,...r?{query:r}:{}},this.cfg)}async cancelForgeAutomationRun(e,t,n){let r=qn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/cancel`,body:t,...r?{query:r}:{}},this.cfg)}async approveForgeAutomationEscalation(e,t,n){let r=qn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/escalations/approve`,body:t,...r?{query:r}:{}},this.cfg)}async rejectForgeAutomationEscalation(e,t,n){let r=qn(n);return O({method:`POST`,path:`/api/cmmd/automations/runs/${e}/escalations/reject`,body:t,...r?{query:r}:{}},this.cfg)}async createProjectBoardTask(e,t){let n={title:t.title};return t.description!==void 0&&(n.description=t.description),t.priority!==void 0&&(n.priority=t.priority),t.status!==void 0&&(n.status=t.status),t.workflowStageId!==void 0&&(n.workflowStageId=t.workflowStageId),t.assignee!==void 0&&(n.assignee=t.assignee),t.dueDate!==void 0&&(n.dueDate=t.dueDate),t.workItemType!==void 0&&(n.workItemType=t.workItemType),t.parentTaskId!==void 0&&(n.parentTaskId=t.parentTaskId),t.milestoneId!==void 0&&(n.milestoneId=t.milestoneId),t.dependsOn!==void 0&&(n.dependsOn=t.dependsOn),O({method:`POST`,path:`/api/cmmd/projects/${e}/board`,body:n},this.cfg)}async createCenterBoardTask(e){let t={title:e.title,projectId:e.projectId};return e.description!==void 0&&(t.description=e.description),e.priority!==void 0&&(t.priority=e.priority),e.status!==void 0&&(t.status=e.status),e.assignee!==void 0&&(t.assignee=e.assignee),e.dueDate!==void 0&&(t.dueDate=e.dueDate),e.workItemType!==void 0&&(t.workItemType=e.workItemType),e.parentTaskId!==void 0&&(t.parentTaskId=e.parentTaskId),e.milestoneId!==void 0&&(t.milestoneId=e.milestoneId),e.dependsOn!==void 0&&(t.dependsOn=e.dependsOn),O({method:`POST`,path:`/api/cmmd/work-items/board`,body:t},this.cfg)}async submitFeedback(e){let t={type:e.type,title:e.title,source:e.source};return e.description!==void 0&&(t.description=e.description),e.priority!==void 0&&(t.priority=e.priority),e.senderName!==void 0&&(t.senderName=e.senderName),O({method:`POST`,path:`/api/cmmd/feedback`,body:t},this.cfg)}async updateProjectBoardTask(e,t,n){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/board/${t}`,body:n},this.cfg)}async updateCenterBoardTask(e,t){return O({method:`PATCH`,path:`/api/cmmd/work-items/board/${e}`,body:t},this.cfg)}async moveCenterBoardTask(e,t){let n={toStatus:t.toStatus};return t.beforeTaskId!==void 0&&(n.beforeTaskId=t.beforeTaskId),t.afterTaskId!==void 0&&(n.afterTaskId=t.afterTaskId),O({method:`PATCH`,path:`/api/cmmd/work-items/board/${e}/move`,body:n},this.cfg)}async moveProjectBoardTask(e,t,n){let r={toStatus:n.toStatus};return n.toStageId!==void 0&&(r.toStageId=n.toStageId),n.beforeTaskId!==void 0&&(r.beforeTaskId=n.beforeTaskId),n.afterTaskId!==void 0&&(r.afterTaskId=n.afterTaskId),O({method:`PATCH`,path:`/api/cmmd/projects/${e}/board/${t}/move`,body:r},this.cfg)}async archiveProjectBoardTask(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/board/${t}/archive`},this.cfg)}async unarchiveProjectBoardTask(e,t){return O({method:`POST`,path:`/api/cmmd/projects/${e}/board/${t}/unarchive`},this.cfg)}async updateProjectBoardTaskStatus(e,t,n,r){return O({method:`PATCH`,path:`/api/cmmd/projects/${e}/board/${t}/status`,body:{status:n,...r?{workflowStageId:r}:{}}},this.cfg)}async listTaskExecutionOptions(e,t){return O({method:`GET`,path:`/api/cmmd/projects/${e}/board/${t}/execution-options`},this.cfg)}async createTaskWorkSession(e,t,n){return O({method:`POST`,path:`/api/cmmd/projects/${e}/board/${t}/work-sessions`,body:n},this.cfg)}async listProjectWorkSessions(e,t={}){return O({method:`GET`,path:`/api/cmmd/projects/${e}/work-sessions`,query:t},this.cfg)}async getWorkSession(e){return O({method:`GET`,path:`/api/cmmd/work-sessions/${e}`},this.cfg)}async updateWorkSessionStatus(e,t){return O({method:`PATCH`,path:`/api/cmmd/work-sessions/${e}`,body:{status:t}},this.cfg)}async attachWorkSessionThread(e,t){return O({method:`POST`,path:`/api/cmmd/work-sessions/${e}/threads`,body:t},this.cfg)}async listTaskConversations(e,t={}){return O({method:`GET`,path:`/api/cmmd/tasks/${e}/conversations`,query:Un(t)},this.cfg)}async linkTaskConversation(e,t){return O({method:`POST`,path:`/api/cmmd/tasks/${e}/conversations`,body:t},this.cfg)}async getTaskHistory(e){return O({method:`GET`,path:`/api/cmmd/tasks/${e}/history`},this.cfg)}async upsertTaskPullRequest(e,t){return O({method:`PUT`,path:`/api/cmmd/tasks/${e}/pull-requests`,body:t},this.cfg)}postPullRequest(e,t){return O({method:`POST`,path:`/api/cmmd/pull-requests/${e}`,body:t},this.cfg)}async listPullRequests(e){return this.postPullRequest(`list`,e)}async getPullRequestListStats(e){return this.postPullRequest(`list-stats`,e)}async getPullRequestDetail(e){return this.postPullRequest(`detail`,e)}async getPullRequestActivity(e){return this.postPullRequest(`activity`,e)}async getPullRequestDiff(e){return this.postPullRequest(`diff`,e)}async getPullRequestDiffFileContents(e){return this.postPullRequest(`diff-file-contents`,e)}async getPullRequestThreadComments(e){return this.postPullRequest(`thread/comments`,e)}async getPullRequestReviewerCandidates(e){return this.postPullRequest(`reviewer-candidates`,e)}async runPullRequestAction(e){return this.postPullRequest(`action`,e)}async createPullRequestComment(e){return this.postPullRequest(`comment`,e)}async updatePullRequest(e){return this.postPullRequest(`update`,e)}async updatePullRequestComment(e){return this.postPullRequest(`comment/update`,e)}async submitPullRequestReview(e){return this.postPullRequest(`review`,e)}async replyToPullRequestThread(e){return this.postPullRequest(`thread/reply`,e)}async setPullRequestThreadResolution(e){return this.postPullRequest(`thread/resolution`,e)}async requestPullRequestReviewers(e){return this.postPullRequest(`reviewers`,e)}async setPullRequestReaction(e){return this.postPullRequest(`reaction`,e)}async getTaskConversation(e,t,n={}){return O({method:`GET`,path:`/api/cmmd/tasks/${e}/conversations/${encodeURIComponent(t)}`,query:Un(n)},this.cfg)}async createTask(e){return O({method:`POST`,path:`/api/cmmd/tasks`,body:e},this.cfg)}async createSubtask(e){throw new Wn(`createSubtask`)}async createBoardTask(e){throw new Wn(`createBoardTask`)}async createProject(e){let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=r);return e.campaignId!==void 0&&e.campaignId!==null&&(t.campaignId=nr(e.campaignId)),e.organizationId!==void 0&&e.organizationId!==null&&(t.organizationId=nr(e.organizationId)),Cee(await O({method:`POST`,path:`/api/cmmd/projects`,body:t},this.cfg))}async moveProject(e,t){let n={targetOrgId:nr(t.targetOrgId)};return t.campaignStrategy!==void 0&&(n.campaignStrategy=t.campaignStrategy),t.targetCampaignId!==void 0&&(n.targetCampaignId=nr(t.targetCampaignId)),t.dryRun!==void 0&&(n.dryRun=t.dryRun),O({method:`POST`,path:`/api/cmmd/projects/${e}/move`,body:n},this.cfg)}async uploadBrainDoc(e,t){throw new Wn(`uploadBrainDoc`)}};function wee(e){return new rr(e)}var Tee=new rr({onAuthExpired:pe});function ir(e={resolveUrl:ae}){let t=ce()?.bearerToken;return t?{...e,bearerToken:t}:e}var ar=new Set([`CMMD_AUTH_REQUIRED`,`CMMD_AUTH_EXPIRED`]);function or(e,t){return!e&&t===null?{}:{query:{...e?{fresh:1}:{},...t===null?{}:{orgId:t}}}}async function sr(e){let t=`/api/cmmd/work-intake`,{getCurrentForgeWorkspaceId:n}=await _e(async()=>{let{getCurrentForgeWorkspaceId:e}=await import(`./currentForgeWorkspaceStore-CiCPSq18.js`).then(e=>e.t);return{getCurrentForgeWorkspaceId:e}},__vite__mapDeps([0,1,2,3,4,5,6])),r=n(),i;try{i=await O({method:`GET`,path:t,allowRetry:!1,...or(e,r)},ir())}catch(e){throw e instanceof ye&&e.kind!==`auth`&&e.code!==null&&ar.has(e.code)?new ye({kind:`auth`,message:e.message,status:e.status??401,code:e.code}):e}if(!i)throw Error(`Invalid response from ${t}`);return i}async function cr(e={}){return sr(e.forceFresh===!0)}var j=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,M=globalThis,lr=`10.74.0`;function ur(){return dr(M),M}function dr(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.74.0`,t[lr]=t[`10.74.0`]||{}}function fr(e,t,n=M){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[lr]=r[`10.74.0`]||{};return i[e]||(i[e]=t())}var pr=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],mr=`Sentry Logger `,hr={};function gr(e){if(!(`console`in M))return e();let t=M.console,n={},r=Object.keys(hr);r.forEach(e=>{let r=hr[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function _r(){wr().enabled=!0}function vr(){wr().enabled=!1}function yr(){return wr().enabled}function br(...e){Cr(`log`,...e)}function xr(...e){Cr(`warn`,...e)}function Sr(...e){Cr(`error`,...e)}function Cr(e,...t){j&&yr()&&gr(()=>{M.console[e](`${mr}[${e}]:`,...t)})}function wr(){return j?fr(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var N={enable:_r,disable:vr,isEnabled:yr,log:br,warn:xr,error:Sr},Tr=50,Er=/\(error: (.*)\)/,Dr=/captureMessage|captureException/;function Or(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
3
|
-
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=Er.test(n)?n.replace(Er,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=Tr+r)break}}return Ar(i.slice(r))}}function kr(e){return Array.isArray(e)?Or(...e):e}function Ar(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(jr(t).function||``)&&t.pop(),t.reverse(),Dr.test(jr(t).function||``)&&(t.pop(),Dr.test(jr(t).function||``)&&t.pop()),t.slice(0,Tr).map(e=>({...e,filename:e.filename||jr(t).filename,function:e.function||`?`}))}function jr(e){return e[e.length-1]||{}}var Mr=`<anonymous>`;function Nr(e){try{return!e||typeof e!=`function`?Mr:e.name||Mr}catch{return Mr}}function Pr(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function Fr(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var Ir={},Lr={};function Rr(e,t){return Ir[e]=Ir[e]||[],Ir[e].push(t),()=>{let n=Ir[e];if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}function zr(e,t){if(!Lr[e]){Lr[e]=!0;try{t()}catch(t){j&&N.error(`Error while instrumenting ${e}`,t)}}}function Br(e,t){let n=e&&Ir[e];if(n)for(let r of n)try{r(t)}catch(t){j&&N.error(`Error while triggering instrumentation handler.
|
|
4
|
-
Type: ${e}
|
|
5
|
-
Name: ${Nr(r)}
|
|
6
|
-
Error:`,t)}}var Vr=null;function Hr(e){let t=`error`;Rr(t,e),zr(t,Ur)}function Ur(){Vr=M.onerror,M.onerror=function(e,t,n,r,i){return Br(`error`,{column:r,error:i,line:n,msg:e,url:t}),Vr?Vr.apply(this,arguments):!1},M.onerror.__SENTRY_INSTRUMENTED__=!0}var Wr=null;function Gr(e){let t=`unhandledrejection`;Rr(t,e),zr(t,Kr)}function Kr(){Wr=M.onunhandledrejection,M.onunhandledrejection=function(e){return Br(`unhandledrejection`,e),!Wr||Wr.apply(this,arguments)},M.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var qr=Object.prototype.toString;function Jr(e){switch(qr.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return si(e,Error)}}function Yr(e,t){return qr.call(e)===`[object ${t}]`}function Xr(e){return Yr(e,`ErrorEvent`)}function Zr(e){return Yr(e,`DOMError`)}function Qr(e){return Yr(e,`DOMException`)}function $r(e){return Yr(e,`String`)}function ei(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function ti(e){return e===null||ei(e)||typeof e!=`object`&&typeof e!=`function`}function ni(e){return Yr(e,`Object`)}function ri(e){return typeof e==`object`&&!!e}function ii(e){return typeof Event<`u`&&si(e,Event)}function ai(e){return Yr(e,`RegExp`)}function oi(e){return!!(e?.then&&typeof e.then==`function`)}function si(e,t){try{return e instanceof t}catch{return!1}}function ci(e){return typeof Request<`u`&&si(e,Request)}function li(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&di(i,r);try{e[t]=i}catch{j&&N.log(`Failed to replace method "${t}" in object`,e)}}function ui(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{j&&N.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function di(e,t){try{e.prototype=t.prototype=t.prototype||{},ui(e,`__sentry_original__`,t)}catch{}}function fi(e){return e.__sentry_original__}function pi(e){if(Jr(e))return{message:e.message,name:e.name,stack:e.stack,...mi(e)};if(ii(e)){let{type:t,target:n,currentTarget:r,detail:i}=e;return{type:t,target:n,currentTarget:r,...i?{detail:i}:{},...mi(e)}}return e}function mi(e){return ri(e)?Object.fromEntries(Object.entries(e)):{}}function hi(e){let t=Object.keys(pi(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var gi;function _i(e){if(gi!==void 0)return gi?gi(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=M;return t in n&&typeof n[t]==`function`?(gi=n[t],gi(e)):(gi=null,e())}function vi(){return _i(()=>Math.random())}function yi(){return _i(()=>Date.now())}var bi=Symbol.for(`sentry.skipNormalization`),xi=Symbol.for(`sentry.overrideNormalizationDepth`);function Si(e){ui(e,bi,!0)}function Ci(e,t){ui(e,xi,t)}function wi(e){return!!e[bi]}function Ti(e){let t=e[xi];return typeof t==`number`?t:void 0}var Ei;function Di(e){Ei=e}function Oi(e,t=100,n=1/0){try{return Ai(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function ki(e,t=3,n=102400){let r=Oi(e,t);return Pi(r)>n?ki(e,t-1,n):r}function Ai(e,t,n=1/0,r=1/0,i=Fi()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=ji(e,t);if(!s.startsWith(`[object `))return s;if(wi(t))return t;let c=Ti(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return Ai(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=pi(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=Ai(e,t,l-1,r,i),f++}return o(t),d}function ji(e,t){try{if(Ei){let e=Ei(t);if(e)return e}return typeof global<`u`&&t===global?`[Global]`:typeof t==`number`&&!Number.isFinite(t)?`[${t}]`:typeof t==`function`?`[Function: ${Nr(t)}]`:typeof t==`symbol`?`[${String(t)}]`:typeof t==`bigint`?`[BigInt: ${String(t)}]`:`[object ${Mi(t)}]`}catch(e){return`**non-serializable** (${e})`}}function Mi(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function Ni(e){return~-encodeURI(e).split(/%..|./).length}function Pi(e){return Ni(JSON.stringify(e))}function Fi(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function Ii(e,t=`[unserializable]`){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return typeof t==`function`?t(e):t}}function Li(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ri(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function zi(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];ti(r)?n.push(String(r)):r instanceof Error?n.push(r.message?`${r.name}: ${r.message}`:r.name):n.push(ji(void 0,r))}return n.join(t)}function Bi(e,t,n=!1){return $r(e)?ai(t)?t.test(e):$r(t)?n?e===t:e.includes(t):typeof t==`function`&&t(e):!1}function Vi(e,t=[],n=!1){for(let r of t)if(Bi(e,r,n))return!0;return!1}function Eee(){let e=M;return e.crypto||e.msCrypto}var Hi;function Dee(){return vi()*16}function Ui(e=Eee()){try{if(e?.randomUUID)return _i(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Hi||=`10000000100040008000100000000000`,Hi.replace(/[018]/g,e=>(e^(Dee()&15)>>e/4).toString(16))}function Wi(e){return e.exception?.values?.[0]}function Gi(e){let{message:t,event_id:n}=e;if(t)return t;let r=Wi(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Ki(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function qi(e,t){let n=Wi(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function Oee(e,t,n=5){if(t.lineno===void 0)return;let r=e.length,i=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,i-n),i).map(e=>Ri(e,0)),t.context_line=Ri(e[Math.min(r-1,i)],t.colno||0),t.post_context=e.slice(Math.min(i+1,r),i+1+n).map(e=>Ri(e,0))}function Ji(e){if(kee(e))return!0;try{ui(e,`__sentry_captured__`,!0)}catch{}return!1}function kee(e){try{return e.__sentry_captured__}catch{}}var Yi=1e3;function Xi(){return yi()/Yi}function Aee(){let{performance:e}=M;if(!e?.now||!e.timeOrigin)return Xi;let t=e.timeOrigin;return()=>(t+_i(()=>e.now()))/Yi}var jee;function Zi(){return(jee??=Aee())()}var Qi=null;function Mee(){let{performance:e}=M;if(!e?.now)return;let t=3e5,n=_i(()=>e.now()),r=yi(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function $i(){return Qi===null&&(Qi=Mee()),Qi}function Nee(e){let t=Zi(),n={sid:Ui(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>Fee(n)};return e&&ea(n,e),n}function ea(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Zi(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Ui()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Pee(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),ea(e,n)}function Fee(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function ta(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=ta(r[e],t[e],n-1));return r}function na(){return Ui()}function ra(){return Ui().substring(16)}function ia(e){try{let t=M.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function aa(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var oa=`_sentrySpan`;function sa(e,t){t?ui(e,oa,ia(t)):delete e[oa]}function ca(e){return aa(e[oa])}var Iee=100,la=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:na(),sampleRand:vi()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,sa(t,ca(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ea(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():ni(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,sa(this,void 0),this._attachments=[],this.setPropagationContext({traceId:na(),sampleRand:vi()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:Iee;if(n<=0)return this;let r={timestamp:Xi(),...e,message:e.message?Li(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ca(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ta(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||Ui();if(!this._client)return j&&N.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||Ui();if(!this._client)return j&&N.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||Ui();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(j&&N.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function Lee(){return fr(`defaultCurrentScope`,()=>new la)}function Ree(){return fr(`defaultIsolationScope`,()=>new la)}var ua=e=>e instanceof Promise&&!e[da],da=Symbol(`chained PromiseLike`),fa=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return ua(r)&&ua(e)?r:zee(e,r)},zee=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[da]:!0}),t},Bee=class{constructor(e,t){let n;n=e||new la;let r;r=t||new la,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return oi(n)?fa(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function pa(){let e=dr(ur());return e.stack=e.stack||new Bee(Lee(),Ree())}function Vee(e){return pa().withScope(e)}function ma(e,t){let n=pa();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function ha(e){return pa().withScope(()=>e(pa().getIsolationScope()))}function ga(){return{withIsolationScope:ha,withScope:Vee,withSetScope:ma,withSetIsolationScope:(e,t)=>ha(t),getCurrentScope:()=>pa().getScope(),getIsolationScope:()=>pa().getIsolationScope()}}function _a(e){let t=dr(e);return t.acs?t.acs:ga()}function va(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function ya(e,t){let{value:n,unit:r}=va(e)?e:{value:e,unit:void 0},i=Ca(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function ba(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=ya(i,t);e&&(n[r]=e)}return n}function xa(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let e=r.value;Array.isArray(e)?t+=Sa(e[0])*e.length:ti(e)?t+=Sa(e):t+=100}return t}function Sa(e){return typeof e==`string`?e.length*2:typeof e==`boolean`?4:typeof e==`number`?8:0}function Ca(e){if(Array.isArray(e))return{value:e,type:`array`};let t=typeof e==`string`?`string`:typeof e==`boolean`?`boolean`:typeof e==`number`&&!Number.isNaN(e)?Number.isInteger(e)?`integer`:`double`:null;if(t)return{value:e,type:t}}var wa;function Ta(){return wa?.()}function Ea(){return wa!==void 0}function P(){return _a(ur()).getCurrentScope()}function Da(){return _a(ur()).getIsolationScope()}function Oa(){return fr(`globalScope`,()=>new la)}function ka(...e){let t=_a(ur());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function Aa(...e){let t=_a(ur());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function F(){return P().getClient()}function ja(e){let t=Ta();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||ra()};return r&&(a.parent_span_id=r),a}var Ma=`sentry.source`,Na=`sentry.sample_rate`,Pa=`sentry.previous_trace_sample_rate`,Fa=`sentry.op`,I=`sentry.origin`,Ia=`sentry.idle_span_finish_reason`,La=`sentry.measurement_unit`,Ra=`sentry.measurement_value`,za=`sentry.release`,Ba=`sentry.environment`,Va=`sentry.sdk.integrations`,Ha=`user.id`,Ua=`user.email`,Wa=`user.ip_address`,Ga=`user.name`,Ka=`sentry.custom_span_name`,qa=`sentry.profile_id`,Ja=`sentry.exclusive_time`,Ya=`sentry.link.type`,Xa=`gen_ai.conversation.id`;function Za(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function Qa(e,t){e.setAttribute(`http.response.status_code`,t);let n=Za(t);n.message!==`unknown_error`&&e.setStatus(n)}var $a=`_sentryScope`,eo=`_sentryIsolationScope`,to=Symbol.for(`sentry.otelSourceInference`),no=Symbol.for(`sentry.otelSourceExplicitlySet`),ro=Symbol.for(`sentry.tracerProviderSpan`);function io(e,t,n){e&&(ui(e,eo,ia(n)),ui(e,$a,t))}function ao(e){let t=e;return{scope:t[$a],isolationScope:aa(t[eo])}}function oo(e){return e[to]===!0}function so(e){ui(e,no,!0)}function co(e){return e[ro]===!0}var lo=`sentry-`;function uo(e){let t=po(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function fo(e){if(e)return ho(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${lo}${t}`]=n),e),{}))}function po(e){if(!(!e||!$r(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=mo(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):mo(e)}function mo(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function ho(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(j&&N.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var go=/^o(\d+)\./,_o=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function vo(e){return e===`http`||e===`https`}function yo(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function bo(e){let t=_o.exec(e);if(!t){gr(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return xo({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function xo(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function So(e){if(!j)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>!e[t]&&(N.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?vo(r)?t&&isNaN(parseInt(t,10))?(N.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(N.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(N.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Co(e){return e.match(go)?.[1]}function wo(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Co(n)),r}function To(e){let t=typeof e==`string`?bo(e):xo(e);if(!(!t||!So(t)))return t}function Eo(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var Do=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function Oo(e){if(!e)return;let t=e.match(Do);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function ko(e,t){let n=Oo(e),r=uo(t);if(!n?.traceId)return{traceId:na(),sampleRand:vi()};let i=Mo(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function Ao(e=na(),t=ra(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function jo(e=na(),t=ra(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function Mo(e,t){let n=Eo(t?.sample_rand);if(n!==void 0)return n;let r=Eo(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?vi()*r:r+vi()*(1-r):vi()}function No(e,t){let n=wo(e);return t&&n&&t!==n?(N.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):e.getOptions().strictTraceContinuation&&(t&&!n||!t&&n)?(N.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}var Po=!1;function Fo(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=L(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function Io(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:L(e).parent_span_id,a=ao(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||ra():t,trace_id:n}}function Lo(e){let{traceId:t,spanId:n}=e.spanContext();return Ao(t,n,Jo(e))}function Ro(e){let{traceId:t,spanId:n}=e.spanContext();return jo(t,n,Jo(e))}function zo(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function Bo(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function Vo(e){return typeof e==`number`?Ho(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ho(e.getTime()):Zi()}function Ho(e){return e>9999999999?e/1e3:e}function L(e){if(qo(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Ko(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:Wo(e),start_timestamp:Vo(i),timestamp:Vo(o)||void 0,status:Yo(s),op:r[Fa],origin:r[I],links:zo(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Uo(e){if(qo(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Ko(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:Wo(e),start_timestamp:Vo(i),end_timestamp:Vo(o),is_segment:e===is(e),status:Xo(s),attributes:Zo(r,s),links:Bo(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===is(e)}}function Wo(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function Go(e){return{...e,attributes:ba(e.attributes),links:e.links?.map(e=>({...e,attributes:ba(e.attributes)}))}}function Ko(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function qo(e){return typeof e.getSpanJSON==`function`}function Jo(e){let{traceFlags:t}=e.spanContext();return t===1}function Yo(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function Xo(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}function Zo(e,t){let n=Xo(t)===`error`?t?.message:void 0;return{...n&&{"sentry.status.message":n},...e}}var Qo=`_sentryChildSpans`,$o=`_sentryRootSpan`;function es(e,t){let n=e[$o]||e;ui(t,$o,n),Jo(e)&&(!e.isRecording()&&!n.isRecording()||(e[Qo]?e[Qo].add(t):ui(e,Qo,new Set([t]))))}function ts(e,t){e[Qo]&&e[Qo].delete(t)}function ns(e){let t=new Set;function n(e){if(!t.has(e)&&Jo(e)){t.add(e);let r=e[Qo]?Array.from(e[Qo]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var rs=is;function is(e){return e[$o]||e}function as(){let e=_a(ur());return e.getActiveSpan?e.getActiveSpan():ca(P())}function os(){Po||=(gr(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function ss(e,t){e.updateName(t),e.setAttributes({[Ma]:`custom`,[Ka]:t})}var cs=!1;function ls(){if(cs)return;function e(){let e=as(),t=e&&rs(e);if(t){let e=`internal_error`;j&&N.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}cs=!0,Hr(e),Gr(e)}function us(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||F()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function ds(e){N.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function fs(e,t){if(!t?.length)return!1;for(let n of t){if(hs(n)){if(e.description&&Bi(e.description,n))return j&&ds(e),!0;continue}let t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;let r=!n.name||e.description&&Bi(e.description,n.name),i=!n.op||e.op&&Bi(e.op,n.op),a=!n.attributes||Object.entries(n.attributes).every(([t,n])=>ps(e.attributes?.[t],n));if(r&&i&&a)return j&&ds(e),!0}return!1}function ps(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?Bi(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function ms(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function hs(e){return typeof e==`string`||e instanceof RegExp}var gs=Symbol.for(`sentry.nonRecordingSpan`),_s=class{constructor(e={}){this._traceId=e.traceId||na(),this._spanId=e.spanId||ra(),this.dropReason=e.dropReason,ui(this,gs,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function vs(e){return!!e&&e[gs]===!0}var ys=`production`,bs=`_frozenDsc`;function xs(e,t){ui(e,bs,t)}function Ss(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:wo(t)};return t.emit(`createDsc`,i),i}function Cs(e,t){let n=t.getPropagationContext();return n.dsc||Ss(n.traceId,e)}function ws(e){let t=F();if(!t)return{};let n=rs(e),r=L(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[bs];if(c)return s(c);let l=vs(n),u=l&&n.dropReason===`ignored`;if(l&&(!us(t.getOptions())||u)){let e=ao(n).scope;if(e){let n={...Cs(t,e)};return u&&(n.sampled=`false`),s(n)}}let d=a?.get(`sentry.dsc`),f=d&&uo(d);if(f)return s(f);let p=Ss(e.spanContext().traceId,t),m=i[`sentry.source`]??i[`sentry.segment.name.source`],h=r.description;return m!==`url`&&h&&(p.transaction=h),us()&&(p.sampled=String(Jo(n)),p.sample_rand=a?.get(`sentry.sample_rand`)??ao(n).scope?.getPropagationContext().sampleRand.toString()),s(p),t.emit(`createDsc`,p,n),p}function Ts(e){return fo(ws(e))}function Es(e){return ui(e,`_streamed`,!0),e}function Ds(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}function Os(e,t=[]){return[e,t]}function ks(e,t){let[n,r]=e;return[n,[...r,t]]}function As(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function js(e,t){return As(e,(e,n)=>t.includes(n))}function Ms(e){let t=dr(M);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Ns(e){let t=dr(M);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function Ps(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[Ms(r),e]:r.push(typeof e==`string`?Ms(e):e)}for(let e of n){let[t,n]=e;if(i(`
|
|
7
|
-
${JSON.stringify(t)}
|
|
8
|
-
`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(Oi(n))}i(e)}}return typeof r==`string`?r:Fs(r)}function Fs(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Is(e){let t=typeof e==`string`?Ms(e):e;function n(e){let n=t.subarray(0,e);return t=t.subarray(e+1),n}function r(){let e=t.indexOf(10);return e<0&&(e=t.length),JSON.parse(Ns(n(e)))}let i=r(),a=[];for(;t.length;){let e=r(),t=typeof e.length==`number`?e.length:void 0;a.push([e,t?n(t):r()])}return[i,a]}function Ls(e){return[{type:`span`},e]}function Rs(e){let t=typeof e.data==`string`?Ms(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var zs={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`,trace_metric:`metric`};function Bs(e){return e in zs}function Vs(e){return Bs(e)?zs[e]:e}function Hs(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Us(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(yi()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:yo(r)},...i&&{trace:i}}}function Ws(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Gs(e,t,n,r){let i=Hs(n);return Os({sent_at:new Date(yi()).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:yo(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Ks(e,t,n,r){let i=Hs(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Ws(e,n?.sdk);let o=Us(e,i,r,t);return delete e.sdkProcessingMetadata,Os(o,[[{type:a},e]])}function qs(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=ws(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date(yi()).toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:yo(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=L(e);return!fs({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=L(e);return(Ds(s)?t:s(t))||(os(),t)}:L,f=[];for(let e of l){let t=d(e);t&&f.push(Ls(t))}return Os(o,f)}function Js(e){if(!j)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=L(e),{spanId:i}=e.spanContext(),a=Jo(e),o=rs(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=L(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}N.log(`${c}
|
|
9
|
-
${l.join(`
|
|
10
|
-
`)}`)}function Ys(e){if(!j)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=L(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${rs(e)===e?`root `:``}span "${t}" with ID ${r}`;N.log(i)}function Xs(e,t,n,r=as()){let i=r&&rs(r);i&&(j&&N.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Ra]:t,[La]:n}))}function Zs(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[La],i=n[Ra];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function Qs(){return dr(ur()).segmentSpanCaptureStrategy}function $s(e){return e.getOptions().traceLifecycle===`stream`}var ec=1e3,tc=class{constructor(e={}){this._traceId=e.traceId||na(),this._spanId=e.spanId||ra(),this._startTime=e.startTimestamp||Zi(),this._links=e.links,this._attributes={},this.setAttributes({[I]:`manual`,[Fa]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._frozen||(this._links?this._links.push(e):this._links=[e]),this}addLinks(e){return this._frozen||(this._links?this._links.push(...e):this._links=e),this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return this._frozen?this:(t===void 0?delete this._attributes[e]:this._attributes[e]=t,e===`sentry.source`&&t!==void 0&&oo(this)&&so(this),this)}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._frozen||(this._startTime=Vo(e))}setStatus(e){return this._frozen||(this._status=e),this}updateName(e){return this._frozen?this:(this._name=e,oo(this)||this.setAttribute(Ma,`custom`),this)}end(e){if(this._endTime){this._frozen=co(this);return}this._endTime=Vo(e),Ys(this),this._onSpanEnded(),this._frozen=co(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Fa],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Yo(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[I],profile_id:this._attributes[qa],exclusive_time:this._attributes[Ja],measurements:Zs(this._events),is_segment:this._isStandaloneSpan&&rs(this)===this||void 0,segment_id:this._isStandaloneSpan?rs(this).spanContext().spanId:void 0,links:zo(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===rs(this),status:Xo(this._status),attributes:Zo(this._attributes,this._status),links:Bo(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){if(this._frozen)return this;j&&N.log(`[Tracing] Adding an event to span:`,e);let r=nc(t)?t:n||Zi(),i=nc(t)?{}:t||{},a={name:e,time:Vo(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=F();e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this));let t=rs(this),n=this._isStandaloneSpan||this===t;if(this._isStandaloneSpan){this._sampled?Uee(qs([this],e)):(j&&N.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}if(!n){let e=Qs();if(e){let n=ao(this).scope||P();e.onChildSpanEnded(this,t,e=>this._convertSpanToTransaction(e),n)}return}if(e&&$s(e)){e.emit(`afterSegmentSpanEnd`,this);return}let r=ao(this).scope||P(),i=Qs();if(i)i.onSegmentSpanEnded(e=>this._convertSpanToTransaction(e),r);else{let e=this._convertSpanToTransaction();e&&r.captureEvent(e)}}_convertSpanToTransaction(e={}){if(!rc(L(this)))return;this._name||=(j&&N.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:t,isolationScope:n}=ao(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;e.onSpanCaptured?.(this);let i=[];for(let t of ns(this)){if(t===this||Hee(t)||e.isSpanAlreadyCaptured?.(t))continue;let n=L(t);rc(n)&&(e.onSpanCaptured?.(t),i.push(n))}let a=this._attributes[Ma];delete this._attributes[Ka];let o=!1;i.forEach(e=>{delete e.data[Ka],e.op?.startsWith(`gen_ai.`)&&(o=!0)});let s={contexts:{trace:Fo(this)},spans:i.length>ec?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,ec):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ws(this),hasGenAiSpans:o},request:r,...a&&{transaction_info:{source:a}}},c=Zs(this._events);return c&&Object.keys(c).length&&(j&&N.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(c,void 0,2)),s.measurements=c),s}};function nc(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function rc(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Hee(e){return e instanceof tc&&e.isStandaloneSpan()}function Uee(e){let t=F();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function ic(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return Wee(i,t,n,r)}function Wee(e,t,n,r){return oi(e)?fa(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}function Gee(e,t,n){if(!us(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=Eo(i);if(a===void 0)return j&&N.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return j&&N.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,a,r];let o=n<a;return o||j&&N.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var ac=`__SENTRY_SUPPRESS_TRACING__`;function oc(e,t){let n=gc();if(n.startSpan)return n.startSpan(e,t);let r=hc(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return ka(s,()=>yc(a)(()=>{let n=P(),o=vc(n,a),s=F(),c=e.onlyIfParent&&!o?pc(n,s):mc({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!bc(c)||!o)&&sa(n,c),ic(()=>t(c),()=>{let{status:e}=L(c);c.isRecording()&&(!e||e===`ok`)&&c.setStatus({code:2,message:`internal_error`})},()=>{c.end()})}))}function sc(e,t){let n=gc();if(n.startSpanManual)return n.startSpanManual(e,t);let r=hc(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return ka(s,()=>yc(a)(()=>{let n=P(),o=vc(n,a),s=e.onlyIfParent&&!o?pc(n,F()):mc({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!bc(s)||!o)&&sa(n,s),ic(()=>t(s,()=>s.end()),()=>{let{status:e}=L(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function cc(e){let t=gc();return t.startInactiveSpan?t.startInactiveSpan(e):Kee(e)}function Kee(e){let t=hc(e),{forceTransaction:n,parentSpan:r}=e;return(e.scope?t=>ka(e.scope,t):r===void 0?e=>e():e=>lc(r,e))(()=>{let i=P(),a=vc(i,r),o=F();return e.onlyIfParent&&!a?pc(i,o):mc({parentSpan:a,spanArguments:t,forceTransaction:n,scope:i})})}var qee=(e,t)=>{let n=_a(ur());if(n.continueTrace)return n.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,a=F(),o=uo(i);return a&&!No(a,o?.org_id)?fc(t):ka(e=>{let n=ko(r,i);return e.setPropagationContext(n),sa(e,void 0),t()})};function lc(e,t){let n=gc();return n.withActiveSpan?n.withActiveSpan(e,t):ka(n=>(sa(n,e||void 0),t(n)))}function uc(e){let t=gc();return t.suppressTracing?t.suppressTracing(e):ka(t=>{t.setSDKProcessingMetadata({[ac]:!0});let n=e();return t.setSDKProcessingMetadata({[ac]:void 0}),n})}function dc(e=P()){let t=gc();return t.isTracingSuppressed?t.isTracingSuppressed(e):e.getScopeData().sdkProcessingMetadata[ac]===!0}function fc(e){let t=gc();return t.startNewTrace?t.startNewTrace(e):ka(t=>(t.setPropagationContext({traceId:na(),sampleRand:vi()}),j&&N.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),lc(null,e)))}function pc(e,t){t?.recordDroppedEvent(`no_parent_span`,`span`);let n=new _s({traceId:e.getPropagationContext().traceId});return io(n,e,Da()),n}function mc({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){let i=Da();if(!us()){let t=r.getPropagationContext(),a=new _s({traceId:e?e.spanContext().traceId:t.traceId});return e&&!n&&es(e,a),io(a,r,i),a}let a=F();if(Yee(a,t)){dc(r)||a?.recordDroppedEvent(`ignored`,`span`);let t=new _s({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});return e&&!n&&es(e,t),io(t,r,i),t}let o;if(e&&!n)o=Jee(e,r,t,i),es(e,o);else if(e){let n=ws(e),{traceId:a,spanId:s}=e.spanContext(),c=Jo(e);o=_c({traceId:a,parentSpanId:s,...t},r,i,c),xs(o,n)}else{let{traceId:e,dsc:n,parentSpanId:a,sampled:s}=r.getPropagationContext();o=_c({traceId:e,parentSpanId:a,...t},r,i,s),n&&xs(o,n)}return Js(o),o}function hc(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=Vo(e.startTime),delete n.startTime,n}return t}function gc(){return _a(ur())}function _c(e,t,n,r){let i=F(),a=i?.getOptions()||{},{name:o=``}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};i?.emit(`beforeSampling`,s,{decision:!1});let c=s.parentSampled??r,l=s.spanAttributes,u=t.getPropagationContext(),d=dc(t),[f,p,m]=d?[!1]:Gee(a,{name:o,parentSampled:c,attributes:l,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Eo(u.dsc?.sample_rate)},u.sampleRand),h=new tc({...e,attributes:{[Ma]:`custom`,[Na]:p!==void 0&&m?p:void 0,...l},sampled:f});return!f&&i&&!d&&(j&&N.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),i.recordDroppedEvent(`sample_rate`,$s(i)?`span`:`transaction`)),io(h,t,n),i&&i.emit(`spanStart`,h),h}function Jee(e,t,n,r){let{spanId:i,traceId:a}=e.spanContext(),o=dc(t),s=!o&&Jo(e),c=s?new tc({...n,parentSpanId:i,traceId:a,sampled:s}):new _s({traceId:a});es(e,c),io(c,t,r);let l=F();return l?($s(l)&&vs(c)&&(vs(e)&&e.dropReason?(c.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,`span`)):o||(c.dropReason=`sample_rate`,l.recordDroppedEvent(`sample_rate`,`span`))),l.emit(`spanStart`,c),n.endTimestamp&&(l.emit(`spanEnd`,c),l.emit(`afterSpanEnd`,c)),c):c}function vc(e,t){if(t)return t;if(t===null)return;let n=ca(e);if(!n)return;let r=F();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?rs(n):n}function yc(e){return e===void 0?e=>e():t=>lc(e,t)}function Yee(e,t){let n=e?.getOptions().ignoreSpans;return!e||!$s(e)||!n?.length?!1:fs({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function bc(e){return vs(e)&&e.dropReason===`ignored`}var xc={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Xee=`heartbeatFailed`,Zee=`idleTimeout`,Qee=`finalTimeout`,$ee=`externalFinish`;function Sc(e,t={}){let n=new Map,r=!1,i,a,o=$ee,s=!t.disableAutoFinish,c=[],{idleTimeout:l=xc.idleTimeout,finalTimeout:u=xc.finalTimeout,childSpanTimeout:d=xc.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=t,m=F(),h=P();if(!m||!us()){let e=new _s({traceId:h.getPropagationContext().traceId});return io(e,h,Da()),e}let g=as(),_=ete(e);_.end=new Proxy(_.end,{apply(e,t,n){if(f&&f(_),vs(t))return;let[r,...i]=n,a=Vo(r||Zi()),o=ns(_).filter(e=>e!==_),s=L(_);if(!o.length||!p)return w(a),Reflect.apply(e,t,[a,...i]);let c=m.getOptions().ignoreSpans,l=o?.reduce((e,t)=>{let n=L(t);return!n.timestamp||c&&fs({description:n.description,op:n.op,attributes:n.data},c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),d=s.start_timestamp,h=Math.min(d?d+u/1e3:1/0,Math.max(d||-1/0,Math.min(a,l||1/0)));return w(h),Reflect.apply(e,t,[h,...i])}});function v(){i&&=(clearTimeout(i),void 0)}function y(){a&&=(clearTimeout(a),void 0)}function b(e){v(),i=setTimeout(()=>{!r&&n.size===0&&s&&(o=Zee,_.end(e))},l)}function x(e){y(),a=setTimeout(()=>{!r&&s&&(o=Xee,_.end(e))},d)}function S(e){v(),n.set(e,!0),x(Zi()+d/1e3)}function C(e){n.has(e)&&n.delete(e),n.size===0&&(b(Zi()+l/1e3),y())}function w(e){r=!0,n.clear(),c.forEach(e=>e()),sa(h,g);let t=L(_),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||_.setAttribute(Ia,o);let a=t.status;(!a||a===`unknown`)&&_.setStatus({code:1}),N.log(`[Tracing] Idle span "${t.op}" finished`);let s=ns(_).filter(e=>e!==_),d=0;s.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e),j&&N.log(`[Tracing] Cancelling span since span ended early`,JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=L(t),i=r<=e,a=(u+l)/1e3,o=n-r<=a;if(j){let e=JSON.stringify(t,void 0,2);i?o||N.log(`[Tracing] Discarding span since it finished after idle span final timeout`,e):N.log(`[Tracing] Discarding span since it happened after idle span was finished`,e)}(!o||!i)&&(ts(_,t),d++)}),d>0&&_.setAttribute(`sentry.idle_span_discarded_spans`,d)}return c.push(m.on(`spanStart`,e=>{r||e===_||L(e).timestamp||e instanceof tc&&e.isStandaloneSpan()||ns(_).includes(e)&&S(e.spanContext().spanId)})),c.push(m.on(`spanEnd`,e=>{r||C(e.spanContext().spanId)})),c.push(m.on(`idleSpanEnableAutoFinish`,e=>{e===_&&(s=!0,b(),n.size&&x())})),t.disableAutoFinish||b(),setTimeout(()=>{r||(_.setStatus({code:2,message:`deadline_exceeded`}),o=Qee,_.end())},u),_}function ete(e){let t=cc(e);return sa(P(),t),j&&N.log(`[Tracing] Started span is an idle span`),t}function tte(e,t,n){let r,i,a,o=n?.maxWait?Math.max(n.maxWait,t):0,s=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function u(){return i!==void 0||a!==void 0?c():r}function d(){return i&&clearTimeout(i),i=s(c,t),o&&a===void 0&&(a=s(c,o)),r}return d.cancel=l,d.flush=u,d}var nte=[`addListener`,`on`,`once`,`prependListener`,`prependOnceListener`,`addEventListener`],rte=[`removeListener`,`off`,`removeEventListener`],Cc=Symbol(`SentryScopeBoundListeners`),wc;function ite(e){return wc!==void 0&&(e===wc||e.listener===wc)}function ate(e,t=P()){let n=e;if(Dc(n))return e;Ec(n);for(let e of nte)typeof n[e]==`function`&&(n[e]=ste(n,n[e],t));for(let e of rte)typeof n[e]==`function`&&(n[e]=cte(n,n[e]));return typeof n.removeAllListeners==`function`&&(n.removeAllListeners=lte(n,n.removeAllListeners)),e}function ote(e,t){return function(...n){return ka(t,()=>e.apply(this,n))}}function Tc(e){return typeof e==`function`}function ste(e,t,n){return function(...r){let i=r[0],a=r[1],o=r.slice(2);if(!Tc(a)||ite(a))return t.apply(this,r);let s=Dc(e)||Ec(e),c=s.get(i);c||(c=new WeakMap,s.set(i,c));let l=c.get(a);l||(l=ote(a,n),c.set(a,l));let u=wc;wc=l;try{return t.call(this,i,l,...o)}finally{wc=u}}}function cte(e,t){return function(...n){let r=n[0],i=n[1],a=n.slice(2),o=Tc(i)?Dc(e)?.get(r)?.get(i):void 0;return o?t.call(this,r,o,...a):t.apply(this,n)}}function lte(e,t){return function(...n){let r=Dc(e);if(r)if(n.length===0)Ec(e);else{let e=n[0];r.delete(e)}return t.apply(this,n)}}function Ec(e){let t=new Map;return e[Cc]=t,t}function Dc(e){return e[Cc]}function ute(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;dte(e,t),r&&mte(e,r),hte(e,n),fte(e,i),pte(e,a)}function Oc(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;kc(e,`extra`,n),kc(e,`tags`,r),kc(e,`attributes`,i),kc(e,`user`,a),kc(e,`contexts`,o),e.sdkProcessingMetadata=ta(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function kc(e,t,n){e[t]=ta(e[t],n,1)}function Ac(e,t){let n=Oa().getScopeData();return e&&Oc(n,e.getScopeData()),t&&Oc(n,t.getScopeData()),n}function dte(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function fte(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function pte(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function mte(e,t){e.contexts={trace:Io(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ws(t),...e.sdkProcessingMetadata};let n=L(rs(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function hte(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function gte(e){let t={},{response:n,profile:r,cloud_resource:i,culture:a,state:o}=e;if(n&&(n.status_code!=null&&(t[`http.response.status_code`]=n.status_code),n.body_size!=null&&(t[`http.response.body.size`]=n.body_size)),r&&(r.profile_id&&(t[`sentry.profile_id`]=r.profile_id),r.profiler_id&&(t[`sentry.profiler_id`]=r.profiler_id)),i)for(let[e,n]of Object.entries(i))n!=null&&(t[e]=n);a&&(a.locale&&(t[`culture.locale`]=a.locale),a.timezone&&(t[`culture.timezone`]=a.timezone)),o?.state&&typeof o.state.type==`string`&&(t[`state.type`]=o.state.type);let s=e.angular;if(s){let e=s.version;(typeof e==`string`||typeof e==`number`)&&(t[`angular.version`]=e)}let c=e.react;if(c){let e=c.version;(typeof e==`string`||typeof e==`number`)&&(t[`react.version`]=e)}return t}var jc=`graphql.document`,Mc=`http.url`,_te=`params`,Nc=`sentry.sdk.name`,Pc=`sentry.sdk.version`,Fc=`sentry.segment.id`,Ic=`sentry.segment.name`,Lc=`sentry.trace_lifecycle`,Rc=`sentry.transaction`,zc=`url.full`,vte=`url.path`,yte=`url.path.parameter`,Bc=`url.template`,bte=`user_agent.original`;function xte(e,t){let n=Uo(e),r=is(e),i=Uo(r),{isolationScope:a,scope:o}=ao(e),s=Ac(a,o);Wc(n,i,t,s);let c=e.kind;t.emit(`preprocessSpan`,n,{spanKind:c}),n.is_segment&&(Vc(n,s),Uc(n,t),t.emit(`processSegmentSpan`,n)),t.emit(`processSpan`,n);let{beforeSendSpan:l}=t.getOptions(),u=l&&Ds(l)?Gc(n,l):n,d=u.attributes?.[Ma];return n.is_segment&&d&&Hc(u,{"sentry.segment.name.source":d}),{...Go(u),_segmentSpan:r}}function Vc(e,t){Hc(e,gte(t.contexts))}function Hc(e,t){let n=e.attributes??={};Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}function Uc(e,t){let n=t.getIntegrationNames();n.length&&Hc(e,{[Va]:n})}function Wc(e,t,n,r){let i=n.getSdkMetadata(),{release:a,environment:o}=n.getOptions();Hc(e,{[Lc]:`stream`,[Ic]:t.name,[Fc]:t.span_id,[Nc]:i?.sdk?.name,[Pc]:i?.sdk?.version,[za]:a,[Ba]:o||`production`,[Ha]:r.user?.id,[Ua]:r.user?.email,[Wa]:r.user?.ip_address,[Ga]:r.user?.username,...r.attributes})}function Gc(e,t){return t(e)||(os(),e)}var Kc=0,qc=1,Jc=2;function Yc(e){return new Zc(t=>{t(e)})}function Xc(e){return new Zc((t,n)=>{n(e)})}var Zc=class e{constructor(e){this._state=Kc,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===Kc)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===qc&&e[1](this._value),this._state===Jc&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===Kc){if(oi(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(qc,e)},r=e=>{t(Jc,e)};try{e(n,r)}catch(e){r(e)}}};function Qc(e,t,n,r=0){try{let i=$c(t,n,e,r);return oi(i)?i:Yc(i)}catch(e){return Xc(e)}}function $c(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return j&&a===null&&N.log(`Event processor "${i.id||`?`}" dropped event`),oi(a)?a.then(e=>$c(e,t,n,r+1)):$c(a,t,n,r+1)}var el,tl,nl,rl;function il(e){let t=M._sentryDebugIds,n=M._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(rl&&r.length===tl&&i.length===nl)return rl;tl=r.length,nl=i.length,rl={},el||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=el?.[r];if(i&&rl&&t)rl[i[0]]=t,el&&(el[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&rl&&el){rl[i]=t,el[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),rl}function al(e,t){let n=il(e);if(!n)return[];let r=[];for(let e of t){let t=Fr(e);t&&n[t]&&r.push({type:`sourcemap`,code_file:e,debug_id:n[t]})}return r}function ol(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Ui(),timestamp:t.timestamp||Xi()},l=n.integrations||e.integrations.map(e=>e.name);sl(c,e),ul(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&cl(c,e.stackParser);let u=fl(r,n.captureContext);n.mechanism&&qi(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Ac(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),ute(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Yc(c):Qc(m,c,n)).then(e=>(e&&ll(e),typeof o==`number`&&o>0?dl(e,o,s):e))}function sl(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=Li(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=Li(e.value,a)})}function cl(e,t){let n=il(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function ll(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function ul(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function dl(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Oi(e.data,t,n)}}))},...e.user&&{user:Oi(e.user,t,n)},...e.contexts&&{contexts:Oi(e.contexts,t,n)},...e.extra&&{extra:Oi(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Oi(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Oi(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Oi(e.contexts.flags,3,n)),r}function fl(e,t){if(!t)return e;let n=e?e.clone():new la;return n.update(t),n}function pl(e){if(e)return ml(e)||gl(e)?{captureContext:e}:e}function ml(e){return e instanceof la||typeof e==`function`}var hl=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function gl(e){return Object.keys(e).some(e=>hl.includes(e))}function _l(e,t){return P().captureException(e,pl(t))}function vl(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return P().captureMessage(e,n,r)}function yl(e,t){return P().captureEvent(e,t)}function bl(e,t){Da().setContext(e,t)}function xl(e){Da().setExtras(e)}function Sl(e,t){Da().setExtra(e,t)}function Cl(e){Da().setTags(e)}function wl(e,t){Da().setTag(e,t)}function Tl(e){Da().setAttributes(e)}function El(e,t){Da().setAttribute(e,t)}function Dl(e){Da().setUser(e)}function Ol(e){Da().setConversationId(e)}function kl(){return Da().lastEventId()}async function Al(e){let t=F();return t?t.flush(e):(j&&N.warn(`Cannot flush events. No client defined.`),Promise.resolve(!1))}async function jl(e){let t=F();return t?t.close(e):(j&&N.warn(`Cannot flush events and disable SDK. No client defined.`),Promise.resolve(!1))}function Ml(){return!!F()}function Nl(){let e=F();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Pl(e){Da().addEventProcessor(e)}function Fl(e){let t=Da(),{user:n}=Ac(t,P()),{userAgent:r}=M.navigator||{},i=Nee({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&ea(a,{status:`exited`}),Il(),t.setSession(i),i}function Il(){let e=Da(),t=P().getSession()||e.getSession();t&&Pee(t),Ll(),e.setSession()}function Ll(){let e=Da(),t=F(),n=e.getSession();n&&t&&t.captureSession(n)}function Rl(e=!1){if(e){Il();return}Ll()}function zl(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}function Bl(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function Vl(e){return`${Bl(e)}${e.projectId}/envelope/`}function Hl(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Ul(e,t,n){return t||`${Vl(e)}?${Hl(e,n)}`}function Wl(e,t){let n=To(e);if(!n)return``;let r=`${Bl(n)}embed/error-page/`,i=`dsn=${yo(n)}`;for(let e in t)if(e!==`dsn`&&e!==`onClose`)if(e===`user`){let e=t.user;if(!e)continue;e.name&&(i+=`&name=${encodeURIComponent(e.name)}`),e.email&&(i+=`&email=${encodeURIComponent(e.email)}`)}else i+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${r}?${i}`}var Gl=[];function Kl(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function ql(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return Kl(r)}function Jl(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Xl(e,t,n)}),n}function Yl(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Xl(e,t,n){if(n[t.name]){j&&N.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Gl.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),Gl.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}[`processSpan`,`processSegmentSpan`].forEach(n=>{let r=t[n];typeof r==`function`&&e.on(n,n=>r.call(t,n,e))}),j&&N.log(`Integration installed: ${t.name}`)}function Zl(e){let t=F();if(!t){j&&N.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Ql(e){return e}var $l=`sentry.timestamp.sequence`,eu=0,tu;function nu(e){let t=Math.floor(e*1e3);tu!==void 0&&t!==tu&&(eu=0);let n=eu;return eu++,tu=t,{key:$l,value:{value:n,type:`integer`}}}function ru(e,t){return t?ka(t,()=>{let n=as(),r=n?Io(n):ja(t);return[n?ws(n):Cs(e,t),r]}):[void 0,void 0]}var iu={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function au(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function ou(){return`npm`}function su(){return!au()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function cu(){return typeof window<`u`&&(!su()||lu())}function lu(){return M.process?.type===`renderer`}function uu(e,t){let n=t?`auto`:`never`;return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{version:2,...cu()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function du(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=yo(r)),Os(a,[uu(e,i)])}var fu=100;function pu(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function mu(e,t){let n=vu(),r=_u(e);r===void 0?n.set(e,[t]):r.length>=fu?(gu(e,r),n.set(e,[t])):n.set(e,[...r,t])}function hu(e,t=P(),n=mu){let r=t?.getClient()??F();if(!r){j&&N.warn(`No client available to capture log.`);return}let{release:i,environment:a,enableLogs:o=!0,beforeSendLog:s}=r.getOptions();if(!o){j&&N.warn(`logging option not enabled, log will not be captured.`);return}let[,c]=ru(r,t),l={...e.attributes},{user:{id:u,email:d,username:f},attributes:p={}}=Ac(Da(),t);pu(l,`user.id`,u,!1),pu(l,`user.email`,d,!1),pu(l,`user.name`,f,!1),pu(l,`sentry.release`,i),pu(l,`sentry.environment`,a);let{name:m,version:h}=r.getSdkMetadata()?.sdk??{};pu(l,`sentry.sdk.name`,m),pu(l,`sentry.sdk.version`,h);let g=r.getIntegrationByName(`Replay`),_=g?.getReplayId(!0);pu(l,`sentry.replay_id`,_),_&&g?.getRecordingMode()===`buffer`&&pu(l,`sentry._internal.replay_is_buffering`,!0);let v=e.message;if(ei(v)){let{__sentry_template_string__:e,__sentry_template_values__:t=[]}=v;t?.length&&(l[`sentry.message.template`]=e),t.forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=e})}pu(l,`sentry.trace.parent_span_id`,ca(t)?.spanContext().spanId);let y={...e,attributes:l};r.emit(`beforeCaptureLog`,y);let b=s?gr(()=>s(y)):y;if(!b){r.recordDroppedEvent(`before_send`,`log_item`,1),j&&N.warn(`beforeSendLog returned null, log will not be captured.`);return}let{level:x,message:S,attributes:C={},severityNumber:w}=b,T=Zi(),ee=nu(T);n(r,{timestamp:T,level:x,body:bu(String(S)),trace_id:c?.trace_id,severity_number:w??iu[x],attributes:yu({...ba(p),...ba(C,!0),[ee.key]:ee.value})}),r.emit(`afterCaptureLog`,b)}function gu(e,t){let n=t??_u(e)??[];if(n.length===0)return;let r=e.getOptions(),i=du(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);vu().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function _u(e){return vu().get(e)}function vu(){return fr(`clientToLogBufferMap`,()=>new WeakMap)}function yu(e){let t={};for(let[n,r]of Object.entries(e)){let e=bu(n);t[e]=r.type===`string`?{...r,value:bu(r.value)}:r}return t}function bu(e){let t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n==`function`&&typeof r==`function`?n.call(e)?e:r.call(e):e}function xu(e,t){let n=t?`auto`:`never`;return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{version:2,...cu()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function Su(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=yo(r)),Os(a,[xu(e,i)])}var Cu=1e3;function wu(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function Tu(e,t){let n=ju(),r=Au(e);r===void 0?n.set(e,[t]):r.length>=Cu?(ku(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Eu(e,t,n){let{release:r,environment:i}=t.getOptions(),a={...e.attributes};wu(a,`user.id`,n.id,!1),wu(a,`user.email`,n.email,!1),wu(a,`user.name`,n.username,!1),wu(a,`sentry.release`,r),wu(a,`sentry.environment`,i);let{name:o,version:s}=t.getSdkMetadata()?.sdk??{};wu(a,`sentry.sdk.name`,o),wu(a,`sentry.sdk.version`,s);let c=t.getIntegrationByName(`Replay`),l=c?.getReplayId(!0);return wu(a,`sentry.replay_id`,l),l&&c?.getRecordingMode()===`buffer`&&wu(a,`sentry._internal.replay_is_buffering`,!0),{...e,attributes:a}}function Du(e,t,n,r){let[,i]=ru(t,n),a=ca(n),o=a?a.spanContext().traceId:i?.trace_id,s=a?a.spanContext().spanId:void 0,c=Zi(),l=nu(c);return{timestamp:c,trace_id:o??``,span_id:s,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...ba(r),...ba(e.attributes,`skip-undefined`),[l.key]:l.value}}}function Ou(e,t){let n=t?.scope??P(),r=t?.captureSerializedMetric??Tu,i=n?.getClient()??F();if(!i){j&&N.warn(`No client available to capture metric.`);return}let{_experiments:a,enableMetrics:o,beforeSendMetric:s}=i.getOptions();if(!(o??a?.enableMetrics??!0)){j&&N.warn(`metrics option not enabled, metric will not be captured.`);return}let{user:c,attributes:l}=Ac(Da(),n),u=Eu(e,i,c);i.emit(`processMetric`,u);let d=s||a?.beforeSendMetric,f=d?d(u):u;if(!f){j&&N.log("`beforeSendMetric` returned `null`, will not send metric.");return}let p=Du(f,i,n,l);j&&N.log(`[Metric]`,p),r(i,p),i.emit(`afterCaptureMetric`,f)}function ku(e,t){let n=t??Au(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Su(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);ju().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function Au(e){return ju().get(e)}function ju(){return fr(`clientToMetricBufferMap`,()=>new WeakMap)}function Mu(e){return Go({trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||``,start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status===`ok`||e.status===`cancelled`?`ok`:`error`,is_segment:!1,attributes:{...e.data},links:e.links})}function Nu(e,t){if(e.type!==`transaction`||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||$s(t))return;let n=[],r=[];for(let t of e.spans)t.op?.startsWith(`gen_ai.`)?n.push(Mu(t)):r.push(t);if(n.length===0)return;e.spans=r;let i=t.getDataCollectionOptions().userInfo?`auto`:`never`;return[{type:`span`,item_count:n.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...cu()&&{ingest_settings:{infer_ip:i,infer_user_agent:i}},items:n}]}var Pu=Symbol.for(`SentryBufferFullError`);function Fu(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return Xc(Pu);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Yc(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>zl(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var Iu=6e4;function Lu(e,t=yi()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?Iu:r-t}function Ru(e,t){return e[t]||e.all||0}function zu(e,t,n=yi()){return Ru(e,t)>n}function Bu(e,{statusCode:t,headers:n},r=yi()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+Lu(o,r):t===429&&(i.all=r+6e4);return i}function Vu(e,t,n=Fu(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(As(i,(t,n)=>{let i=Vs(n);zu(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=Os(i[0],a),s=t=>{if(js(o,[`client_report`])){j&&N.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}As(o,(n,r)=>{e.recordDroppedEvent(t,Vs(r))})};return n.add(()=>t({body:Ps(o)}).then(e=>e.statusCode===413?(j&&N.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(j&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&N.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Bu(r,e),e),e=>{throw s(`network_error`),j&&N.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===Pu)return j&&N.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function Hu(e,t,n){let r=[{type:`client_report`},{timestamp:n||Xi(),discarded_events:e}];return Os(t?{dsn:t}:{},[r])}function Uu(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Wu(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[qa],exclusive_time:o?.[Ja],measurements:e.measurements,is_segment:!0}}function Gu(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var Ku=`[Filtered]`,qu=[`forwarded`,`-ip`,`remote-`,`via`,`-user`],Ju=[`auth`,`token`,`secret`,`session`,`password`,`passwd`,`pwd`,`key`,`jwt`,`bearer`,`sso`,`saml`,`csrf`,`xsrf`,`credentials`,`sid`,`identity`,`set-cookie`,`cookie`],Yu=[`.sid`,`sessid`,`remember`,`oidc`,`pkce`,`nonce`,`__secure-`,`__host-`,`awsalb`,`awselb`,`akamai`,`__stripe`,`cognito`,`firebase`,`supabase`,`sb-`,`mfa`,`2fa`];function Xu(e){return e===!0?{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},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:qu},httpHeaders:{request:{deny:qu},response:{deny:qu}},httpBodies:[],urlQueryParams:{deny:qu},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}var Zu={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},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function Qu(e){let t=e.dataCollection==null?Xu(e.sendDefaultPii):Zu,n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var $u=`Not capturing exception because it's already been captured.`,ed=`Discarded session because of missing or non-string release`,td=Symbol.for(`SentryInternalError`),nd=Symbol.for(`SentryDoNotSendEventError`),rd=5e3;function id(e){return{message:e,[td]:!0}}function ad(e){return{message:e,[nd]:!0}}function od(e){return ri(e)&&td in e}function sd(e){return ri(e)&&nd in e}function cd(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{if(a+=r(t),a>=8e5)i(e);else if(!s){let t=e.getOptions()._flushInterval??rd;t>0&&(s=!0,o=zl(setTimeout(()=>{i(e)},t)))}}),e.on(`flush`,()=>{i(e)})}var ld=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Fu(e.transportOptions?.bufferSize??64),this._dataCollection=Qu(e),e.dsn?this._dsn=To(e.dsn):j&&N.warn(`No DSN provided, client will not send events.`),this._dsn){let t=Ul(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs??!0,this._options.enableLogs&&cd(this,`afterCaptureLog`,`flushLogs`,gd,gu),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&cd(this,`afterCaptureMetric`,`flushMetrics`,hd,ku)}captureException(e,t,n){let r=Ui();if(Ji(e))return j&&N.log($u),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:Ui(),...n},a=ei(e)?e:String(e),o=ti(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=Ui();if(t?.originalException&&Ji(t.originalException))return j&&N.log($u),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=ud(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),ea(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(this.emit(`flush`),!t)return!0;let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Xl(this,e,this._integrations),t||Yl(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=Nu(e,this),r=Ks(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])r=ks(r,Rs(e));n&&(r=ks(r,n)),this.sendEnvelope(r).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=ys}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){j&&N.warn(ed);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){j&&N.warn(ed);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=Gs(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;j&&N.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return j&&N.error(`Error while sending envelope:`,e),{}}return j&&N.error(`Transport disabled`),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=Jl(this,e),Yl(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(ea(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=this.getIntegrationNames();return!t.integrations&&a.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),ol(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...ja(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Cs(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=P(),r=Da()){return j&&pd(e)&&N.log(`Captured error event \`${Uu(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{j&&(sd(e)?N.log(e.message):od(e)?N.warn(e.message):N.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=md(e),s=pd(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:Eo(a),u=ud(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),ad("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:dd(fd(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw ad(`${c} returned \`null\`, will not send event.`)}let d=n.getSession()||r.getSession();if(s&&d&&this._updateSessionFromEvent(d,i),s&&typeof l==`number`&&vi()>l)throw this.recordDroppedEvent(`sample_rate`,`error`),ad(`Discarding event because it's not included in the random sample (sampling rate = ${a})`);if(o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let f=i.transaction_info;return o&&f&&i.transaction!==e.transaction&&(i.transaction_info={...f,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw sd(e)||od(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),id(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
11
|
-
Reason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===Pu&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){j&&N.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){j&&N.log(`No outcomes to send`);return}if(!this._dsn){j&&N.log(`No dsn provided, will not send outcomes`);return}j&&N.log(`Sending outcomes:`,e);let t=Hu(e,this._options.tunnel&&yo(this._dsn));this.sendEnvelope(t)}};function ud(e){return e===`replay_event`?`replay`:e||`error`}function dd(e,t){let n=`${t} must return \`null\` or a valid event.`;if(oi(e))return e.then(e=>{if(!ni(e)&&e!==null)throw id(n);return e},e=>{throw id(`${t} rejected with ${e}`)});if(!ni(e)&&e!==null)throw id(n);return e}function fd(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!Ds(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(pd(c)&&i)return i(c,r);if(md(c)){if(s||o){let t=Wu(c);if(o?.length&&fs({description:t.description,op:t.op,attributes:t.data},o))return null;if(s){let e=s(t);e?c=ta(n,Gu(e)):os()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&fs({description:e.description,op:e.op,attributes:e.data},o)){ms(n,e);continue}if(s){let n=s(e);n?t.push(n):(os(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function pd(e){return e.type===void 0}function md(e){return e.type===`transaction`}function hd(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+_d(e.attributes)}function gd(e){let t=0;return e.message&&(t+=e.message.length*2),t+_d(e.attributes)}function _d(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*vd(e[0]):ti(e)?t+=vd(e):t+=100}),t}function vd(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function yd(e,t){t.debug===!0&&(j?N.enable():gr(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),P().update(t.initialScope);let n=new e(t);return bd(n),n.init(),n}function bd(e){P().setClient(e)}var xd=5e3,Sd=36e5;function Cd(e){function t(...e){j&&N.log(`[Offline]:`,...e)}return n=>{let r=e(n);if(!n.createStore)throw Error("No `createStore` function was provided");let i=n.createStore(n),a=xd,o;function s(e,t,r){return js(e,[`client_report`])?!1:!n.shouldStore||n.shouldStore(e,t,r)}function c(e){o&&clearTimeout(o),o=zl(setTimeout(async()=>{o=void 0;let e=await i.shift();e&&(t(`Attempting to send previously queued event`),e[0].sent_at=new Date(yi()).toISOString(),u(e,!0).catch(e=>{t(`Failed to retry sending`,e)}))},e))}function l(){o||(c(a),a=Math.min(a*2,Sd))}async function u(e,o=!1){if(!o&&js(e,[`replay_event`,`replay_recording`]))return await i.push(e),c(100),{};try{if(n.shouldSend&&await n.shouldSend(e)===!1)throw Error("Envelope not sent because `shouldSend` callback returned false");let t=await r.send(e),i=100;if(t){if(t.headers?.[`retry-after`])i=Lu(t.headers[`retry-after`]);else if(t.headers?.[`x-sentry-rate-limits`])i=6e4;else if((t.statusCode||0)>=400)return t}return c(i),a=xd,t}catch(n){if(await s(e,n,a))return o?await i.unshift(e):await i.push(e),l(),t(`Error sending. Event queued.`,n),{};throw n}}return n.flushAtStartup&&l(),{send:u,flush:e=>(e===void 0&&(a=xd,c(100)),r.flush(e))}}}var wd=`MULTIPLEXED_TRANSPORT_EXTRA_KEY`;function Td(e,t){let n;return As(e,(e,r)=>(t.includes(r)&&(n=Array.isArray(e)?e[1]:void 0),!!n)),n}function Ed(e,t){return n=>{let r=e(n);return{...r,send:async e=>{let n=Td(e,[`event`,`transaction`,`profile`,`replay_event`]);return n&&(n.release=t),r.send(e)}}}}function Dd(e,t){return Os(t?{...e[0],dsn:t}:e[0],e[1])}function Od(e,t){return n=>{let r=e(n),i=new Map,a=t||(e=>{let t=e.getEvent();return t?.extra?.MULTIPLEXED_TRANSPORT_EXTRA_KEY&&Array.isArray(t.extra.MULTIPLEXED_TRANSPORT_EXTRA_KEY)?t.extra.MULTIPLEXED_TRANSPORT_EXTRA_KEY:[]});function o(t,r){let a=r?`${t}:${r}`:t,o=i.get(a);if(!o){let s=bo(t);if(!s)return;let c=Ul(s,n.tunnel);o=r?Ed(e,r)({...n,url:c}):e({...n,url:c}),i.set(a,o)}return[t,o]}async function s(e){function t(t){return Td(e,t?.length?t:[`event`])}let n=a({envelope:e,getEvent:t}).map(e=>typeof e==`string`?o(e,void 0):o(e.dsn,e.release)).filter(e=>!!e),i=n.length?n:[[``,r]];return(await Promise.all(i.map(([t,n])=>n.send(Dd(e,t)))))[0]}async function c(e){let t=[...i.values(),r];return(await Promise.all(t.map(t=>t.flush(e)))).every(e=>e)}return{send:s,flush:c}}}function kd(e,t){return t.some(t=>e.includes(t))}function Ad(e,t,n){if(t===!1)return{};let r=n==null?Ju:[...Ju,...n],i={};if(t===!0){for(let t of Object.keys(e))i[t]=kd(t.toLowerCase(),r)?Ku:e[t];return i}if(`deny`in t){let n=t.deny.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let a=t.toLowerCase();i[t]=kd(a,r)||n.some(e=>a.includes(e))?Ku:e[t]}return i}let a=t.allow.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let n=t.toLowerCase();i[t]=kd(n,r)?Ku:a.some(e=>n.includes(e))?e[t]:Ku}return i}function jd(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}function Md(e,t){if(t===!1)return{};try{let n=jd(e);return Object.keys(n).length===0?{}:Ad(n,t,Yu)}catch{return Ku}}var Nd=`thismessage:/`;function Pd(e){return`isRelative`in e}function Fd(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?Nd:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function Id(e){if(Pd(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function Ld(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Rd(e){return e.split(/[?#]/,1)[0]}function zd(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function Bd(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return Hd(e,n)||Vd(e,r)}function Vd(e,t){return t?Wd(e)===Wd(t):!1}function Hd(e,t){let n=Fd(e);return!n||Pd(n)||!t?!1:Ud(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function Ud(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function Wd(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function Gd(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join(`\0`).replace(/%/g,`%%`).replace(/\0/g,`%s`),n.__sentry_template_values__=t,n}var Kd=Gd;function qd(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function Jd(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:lr})),i.version=lr)}function Yd(e={}){let t=e.client||F();if(!Nl()||!t)return{};let n=_a(ur());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||P(),i=e.span||as(),a=vs(i)&&!us(t.getOptions());if(!i&&Ea())return{};let o=i&&!a?Lo(i):Xd(r),s=fo(i?ws(i):Cs(t,r));if(!Do.test(o))return N.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let c={"sentry-trace":o,baggage:s};return e.propagateTraceparent&&(c.traceparent=i&&!a?Ro(i):Zd(r)),c}function Xd(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Ao(t,r,n)}function Zd(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return jo(t,r,n)}var Qd=100;function $d(e,t){let n=F(),r=Da();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Qd}=n.getOptions();if(a<=0)return;let o={timestamp:Xi(),...e},s=i?gr(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var ef=`FunctionToString`,tf=new WeakMap,nf=Ql((()=>({name:ef,setupOnce(){let e=Function.prototype.toString;try{Function.prototype.toString=function(...t){let n=fi(this),r;try{tf.has(F())&&n!==void 0&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){tf.set(e,!0)}}))),rf=[/^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$/],af=`EventFilters`,of=Ql((e={})=>{let t;return{name:af,setup(n){t=cf(e,n.getOptions())},processEvent(n,r,i){return t||=cf(e,i.getOptions()),lf(n,t)?null:n}}}),sf=Ql(((e={})=>({...of(e),name:`InboundFilters`})));function cf(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:rf],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function lf(e,t){if(!e.type){if(uf(e,t.ignoreErrors))return j&&N.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
-
Event: ${Gi(e)}`),!0;if(gf(e))return j&&N.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
-
Event: ${Gi(e)}`),!0;if(ff(e,t.denyUrls))return j&&N.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
-
Event: ${Gi(e)}.
|
|
15
|
-
Url: ${hf(e)}`),!0;if(!pf(e,t.allowUrls))return j&&N.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
-
Event: ${Gi(e)}.
|
|
17
|
-
Url: ${hf(e)}`),!0}else if(e.type===`transaction`&&df(e,t.ignoreTransactions))return j&&N.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
18
|
-
Event: ${Gi(e)}`),!0;return!1}function uf(e,t){return t?.length?Uu(e).some(e=>Vi(e,t)):!1}function df(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Vi(n,t):!1}function ff(e,t){if(!t?.length)return!1;let n=hf(e);return n?Vi(n,t):!1}function pf(e,t){if(!t?.length)return!0;let n=hf(e);return!n||Vi(n,t)}function mf(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function hf(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?mf(t):null}catch{return j&&N.error(`Cannot extract url for event ${Gi(e)}`),null}}function gf(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function _f(e,t,n,r,i,a){if(!i.exception?.values||!a||!Jr(a.originalException))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=vf(e,t,r,a.originalException,n,i.exception.values,o,0))}function vf(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Jr(r[i])){bf(o,s,r);let a=e(t,r[i]),l=c.length;xf(a,i,l,s),c=vf(e,t,n,r[i],i,[a,...c],a,l)}return yf(r)&&r.errors.forEach((a,l)=>{if(Jr(a)){bf(o,s,r);let u=e(t,a),d=c.length;xf(u,`errors[${l}]`,d,s),c=vf(e,t,n,a,i,[u,...c],u,d)}}),c}function yf(e){return Array.isArray(e.errors)}function bf(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...yf(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function xf(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function Sf(e){return Jr(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function Cf(e){return Sf(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var wf=new Map,Tf=new Set;function Ef(e){if(M._sentryModuleMetadata)for(let t of Object.keys(M._sentryModuleMetadata)){let n=M._sentryModuleMetadata[t];if(Tf.has(t))continue;Tf.add(t);let r=e(t);for(let e of r.reverse())if(e.filename){wf.set(e.filename,n);break}}}function Df(e,t){return Ef(e),wf.get(t)}function Of(e,t){t.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(t=>{if(!t.filename||t.module_metadata)return;let n=Df(e,t.filename);n&&(t.module_metadata=n)})})}function kf(e){e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{delete e.module_metadata})})}var Af=Ql(()=>({name:`ModuleMetadata`,setup(e){e.on(`beforeEnvelope`,e=>{As(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(kf(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;Of(n,t)})}})),jf=new Set([]);function Mf(e){let t=`console`,n=Rr(t,e);return zr(t,Pf),n}var Nf=new Set;function Pf(){`console`in M&&pr.forEach(function(e){Nf.has(e)||!(e in M.console)||(Nf.add(e),li(M.console,e,function(t){return hr[e]=t,function(...t){let n=t[0],r=hr[e],i=jf.size&&typeof n==`string`&&Vi(n,jf);i||Br(`console`,{args:t,level:e}),(!i||j&&N.isEnabled())&&r?.apply(M.console,t)}}))})}function Ff(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var If=`CaptureConsole`,Lf=Ql(((e={})=>{let t=e.levels||pr,n=e.handled??!0;return{name:If,setup(e){`console`in M&&Mf(({args:r,level:i})=>{F()!==e||!t.includes(i)||Rf(r,i,n)})}}}));function Rf(e,t,n){let r=Ff(t),i=Error(),a={level:Ff(t),extra:{arguments:e}};ka(o=>{if(o.addEventProcessor(e=>(e.logger=`console`,qi(e,{handled:n,type:`auto.core.capture_console`}),e)),t===`assert`){if(!e[0]){let t=`Assertion failed: ${zi(e.slice(1),` `)||`console.assert`}`;o.setExtra(`arguments`,e.slice(1)),o.captureMessage(t,r,{captureContext:a,syntheticException:i})}return}let s=e.find(e=>e instanceof Error);if(s){_l(s,a);return}let c=zi(e,` `);o.captureMessage(c,r,{captureContext:a,syntheticException:i})})}var zf=`Dedupe`,Bf=Ql((()=>{let e;return{name:zf,processEvent(t){if(t.type)return t;try{if(Vf(t,e))return j&&N.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function Vf(e,t){return t?!!(Hf(e,t)||Uf(e,t)):!1}function Hf(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Gf(e,t)||!Wf(e,t))}function Uf(e,t){let n=Kf(t),r=Kf(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Gf(e,t)||!Wf(e,t))}function Wf(e,t){let n=Pr(e),r=Pr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Gf(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Kf(e){return e.exception?.values?.[0]}var qf=`ExtraErrorData`,Jf=Ql(((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:qf,processEvent(e,r,i){let{maxValueLength:a}=i.getOptions();return Yf(e,r,t,n,a)}}}));function Yf(e,t={},n,r,i){if(!t.originalException||!Jr(t.originalException))return e;let a=t.originalException.name||t.originalException.constructor.name,o=Xf(t.originalException,r,i);if(o){let t={...e.contexts},r=Oi(o,n);return ni(r)&&(Si(r),t[a]=r),{...e,contexts:t}}return e}function Xf(e,t,n){try{let r=[`name`,`message`,`stack`,`line`,`column`,`fileName`,`lineNumber`,`columnNumber`,`toJSON`],i={};for(let t of Object.keys(e)){if(r.indexOf(t)!==-1)continue;let a=e[t];i[t]=Jr(a)||typeof a==`string`?n?Li(`${a}`,n):`${a}`:a}if(t&&e.cause!==void 0&&(i.cause=Jr(e.cause)?{[e.cause.name||e.cause.constructor.name]:Xf(e.cause,!1,n)}:e.cause),typeof e.toJSON==`function`){let t=e.toJSON();for(let e of Object.keys(t)){let n=t[e];i[e]=Jr(n)?n.toString():n}}return i}catch(e){j&&N.error(`Unable to extract extra data from the Error object:`,e)}return null}function Zf(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];r===`.`?e.splice(t,1):r===`..`?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;)e.unshift(`..`);return e}var Qf=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function $f(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Qf.exec(t);return n?n.slice(1):[]}function ep(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:`/`;i&&(t=`${i}/${t}`,n=i.charAt(0)===`/`)}return t=Zf(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`}function tp(e){let t=0;for(;t<e.length&&e[t]===``;t++);let n=e.length-1;for(;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}function np(e,t){e=ep(e).slice(1),t=ep(t).slice(1);let n=tp(e.split(`/`)),r=tp(t.split(`/`)),i=Math.min(n.length,r.length),a=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){a=e;break}let o=[];for(let e=a;e<n.length;e++)o.push(`..`);return o=o.concat(r.slice(a)),o.join(`/`)}function rp(e,t){let n=$f(e)[2]||``;return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var ip=`RewriteFrames`,ap=Ql((e={})=>{let t=e.root,n=e.prefix||`app:///`,r=`window`in M&&!!M.window,i=e.iteratee||op({isBrowser:r,root:t,prefix:n});function a(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>({...e,...e.stacktrace&&{stacktrace:o(e.stacktrace)}}))}}}catch{return e}}function o(e){return{...e,frames:e?.frames?.map(e=>i(e))}}return{name:ip,processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=a(t)),t}}});function op({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes(`\\`)&&!r.filename.includes(`/`),a=/^\//.test(r.filename);if(e){if(t){let e=r.filename;e.indexOf(t)===0&&(r.filename=e.replace(t,n))}}else if(i||a){let e=i?r.filename.replace(/^[a-zA-Z]:/,``).replace(/\\/g,`/`):r.filename;r.filename=`${n}${t?np(t,e):rp(e)}`}return r}}var sp=[`reauthenticate`,`signInAnonymously`,`signInWithOAuth`,`signInWithIdToken`,`signInWithOtp`,`signInWithPassword`,`signInWithSSO`,`signOut`,`signUp`,`verifyOtp`],cp=[`createUser`,`deleteUser`,`listUsers`,`getUserById`,`updateUserById`,`inviteUserByEmail`],lp={eq:`eq`,neq:`neq`,gt:`gt`,gte:`gte`,lt:`lt`,lte:`lte`,like:`like`,"like(all)":`likeAllOf`,"like(any)":`likeAnyOf`,ilike:`ilike`,"ilike(all)":`ilikeAllOf`,"ilike(any)":`ilikeAnyOf`,is:`is`,in:`in`,cs:`contains`,cd:`containedBy`,sr:`rangeGt`,nxl:`rangeGte`,sl:`rangeLt`,nxr:`rangeLte`,adj:`rangeAdjacent`,ov:`overlaps`,fts:``,plfts:`plain`,phfts:`phrase`,wfts:`websearch`,not:`not`},up=[`select`,`insert`,`upsert`,`update`,`delete`];function dp(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function fp(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function pp(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function mp(e,t){return pp(e,t)!==void 0}function hp(e,t){if(!e)return;if(typeof e.get==`function`)return e.get(t)??void 0;let n=e,r=t.toLowerCase(),i=Object.keys(n).find(e=>e.toLowerCase()===r);return i===void 0?void 0:n[i]}function gp(e,t={}){switch(e){case`GET`:return`select`;case`POST`:return hp(t,`Prefer`)?.includes(`resolution=`)?`upsert`:`insert`;case`PATCH`:return`update`;case`DELETE`:return`delete`;default:return`<unknown-op>`}}function _p(e,t){if(t===``||t===`*`)return`select(*)`;if(e===`select`)return`select(${t})`;if(e===`or`||e.endsWith(`.or`))return`${e}${t}`;let[n,...r]=t.split(`.`),i;return i=n?.startsWith(`fts`)?`textSearch`:n?.startsWith(`plfts`)?`textSearch[plain]`:n?.startsWith(`phfts`)?`textSearch[phrase]`:n?.startsWith(`wfts`)?`textSearch[websearch]`:n&&lp[n]||`filter`,`${i}(${e}, ${r.join(`.`)})`}function vp(e,t=!1){return new Proxy(e,{apply(n,r,i){return oc({name:`auth ${t?`(admin) `:``}${e.name}`,attributes:{[I]:`auto.db.supabase`,[Fa]:`db`,"db.system":`postgresql`,"db.operation":`auth.${t?`admin.`:``}${e.name}`}},e=>Reflect.apply(n,r,i).then(t=>(ri(t)&&`error`in t&&t.error?(e.setStatus({code:2}),_l(t.error,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}})):e.setStatus({code:1}),e.end(),t)).catch(t=>{throw e.setStatus({code:2}),e.end(),_l(t,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}}),t}).then(...i))}})}function yp(e){let t=e.auth;if(!(!t||fp(e.auth))){for(let n of sp){let r=t[n];r&&typeof e.auth[n]==`function`&&(e.auth[n]=vp(r))}for(let n of cp){let r=t.admin[n];r&&typeof e.auth.admin[n]==`function`&&(e.auth.admin[n]=vp(r,!0))}dp(e.auth)}}function bp(e,t){fp(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(e,n,r){let i=Reflect.apply(e,n,r),a=i.constructor;return Sp(a,t),i}}),dp(e.prototype.from))}function xp(e,t){fp(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,n,r){let i=up,a=n,o=gp(a.method,a.headers);if(!i.includes(o)||!a?.url?.pathname||typeof a.url.pathname!=`string`)return Reflect.apply(e,n,r);let s=a.url.pathname.split(`/`),c=s.length>0?s[s.length-1]:``,l=[];for(let[e,t]of a.url.searchParams.entries())l.push(_p(e,t));let u=Object.create(null);if(ni(a.body))for(let[e,t]of Object.entries(a.body))u[e]=t;let d=F(),f=t.sendOperationData??d?.getDataCollectionOptions().databaseQueryData===!0,p=pp(a.body,u),m=o===`select`?``:`${o}${mp(a.body,u)?`(...) `:``}`,h=f?l.join(` `):l.length>0?`[redacted]`:``,g=[m.trimEnd(),h].filter(Boolean).join(` `),_=g?`${g} from(${c})`:`from(${c})`,v={"db.table":c,"db.schema":a.schema,"db.url":a.url.origin,"db.sdk":hp(a.headers,`X-Client-Info`),"db.system":`postgresql`,"db.operation":o,[I]:`auto.db.supabase`,[Fa]:`db`};return l.length&&f&&(v[`db.query`]=l),p!==void 0&&f&&(v[`db.body`]=p),oc({name:_,attributes:v},t=>Reflect.apply(e,n,[]).then(e=>{if(t&&(e&&typeof e==`object`&&`status`in e&&Qa(t,e.status||500),t.end()),e?.error){let t=Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);let n={};l.length&&f&&(n.query=l),p!==void 0&&f&&(n.body=p),_l(t,e=>(e.addEventProcessor(e=>(qi(e,{handled:!1,type:`auto.db.supabase.postgres`}),e)),e.setContext(`supabase`,n),e))}let n={type:`supabase`,category:`db.${o}`,message:_},r={};return l.length&&f&&(r.query=l),p!==void 0&&f&&(r.body=p),Object.keys(r).length&&(n.data=r),$d(n),e},e=>{throw t&&(Qa(t,500),t.end()),e}).then(...r))}}),dp(e.prototype.then))}function Sp(e,t){for(let n of up)fp(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(e,r,i){let a=Reflect.apply(e,r,i),o=a.constructor;return j&&N.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),xp(o,t),a}}),dp(e.prototype[n]))}var Cp=(e,t={})=>{if(!e){j&&N.warn(`Supabase integration was not installed because no Supabase client was provided.`);return}bp(e.constructor===Function?e:e.constructor,t),yp(e)},wp=`Supabase`,Tp=((e,t)=>({setupOnce(){Cp(e,t)},name:wp})),Ep=Ql(e=>Tp(e.supabaseClient,{sendOperationData:e.sendOperationData})),Dp=10,Op=`ZodErrors`;function kp(e){return Jr(e)&&e.name===`ZodError`&&Array.isArray(e.issues)}function Ap(e){return{...e,path:`path`in e&&Array.isArray(e.path)?e.path.join(`.`):void 0,keys:`keys`in e?JSON.stringify(e.keys):void 0,unionErrors:`unionErrors`in e?JSON.stringify(e.unionErrors):void 0}}function jp(e){return e.map(e=>typeof e==`number`?`<array>`:e).join(`.`)}function Mp(e){let t=new Set;for(let n of e.issues){let e=jp(n.path);e.length>0&&t.add(e)}let n=Array.from(t);if(n.length===0){let t=`variable`;if(e.issues.length>0){let n=e.issues[0];n!==void 0&&`expected`in n&&typeof n.expected==`string`&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${Li(n.join(`, `),100)}`}function Np(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!kp(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(Ap);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:`zod_issues.json`,data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:Mp(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,e)}}}catch(e){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:`an exception was thrown while processing ZodError within applyZodErrorsToEvent()`,error:e instanceof Error?`${e.name}: ${e.message}
|
|
19
|
-
${e.stack}`:`unknown`}}}}}var Pp=Ql(((e={})=>{let t=e.limit??Dp;return{name:Op,processEvent(n,r){return Np(t,e.saveZodIssuesAsAttachment,n,r)}}})),Fp=Ql(e=>({name:`ThirdPartyErrorsFilter`,setup(e){e.on(`beforeEnvelope`,e=>{As(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(kf(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;Of(n,t)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(M._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata={...t.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(t){let n=e.ignoreSentryInternalFrames?t.sdkProcessingMetadata?.insideSentryWrapped===!0&&t.exception?.values?.length===1:!1,r=Lp(t,e.ignoreSentryInternalFrames,n);if(r&&r[e.behaviour===`drop-error-if-contains-third-party-frames`||e.behaviour===`apply-tag-if-contains-third-party-frames`?`some`:`every`](t=>!t.some(t=>e.filterKeys.includes(t)))){if(e.behaviour===`drop-error-if-contains-third-party-frames`||e.behaviour===`drop-error-if-exclusively-contains-third-party-frames`)return null;t.tags={...t.tags,third_party_code:!0}}return t}}));function Ip(e,t,n){if(t!==0)return!1;if(n&&Rp(e)||e.function===`sentryWrapped`)return!0;if(!e.context_line||!e.filename||!e.filename.includes(`sentry`)||!e.filename.includes(`helpers`)||!e.context_line.includes(Vp))return!1;if(e.pre_context){let t=e.pre_context.length;for(let n=0;n<t;n++)if(e.pre_context[n]?.includes(Bp))return!0}return!1}function Lp(e,t,n){let r=Pr(e);if(r)return r.filter((e,r)=>!e.filename||e.lineno==null&&e.colno==null&&e.instruction_addr==null?!1:!t||!Ip(e,r,!!n)).map(e=>e.module_metadata?Object.keys(e.module_metadata).filter(e=>e.startsWith(zp)).map(e=>e.slice(zp.length)):[])}function Rp(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}var zp=`_sentryBundlerPluginAppKey:`,Bp=`Attempt to invoke user-land function`,Vp=`fn.apply(this, wrappedArguments)`,Hp=`flag.evaluation.`;function Up(e){if(e.type)return e;let t=P().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e}function Wp(e,t,n=100){let r=P().getScopeData().contexts;r.flags||={values:[]};let i=r.flags.values;Gp(i,e,t,n)}function Gp(e,t,n,r){if(typeof n!=`boolean`)return;if(e.length>r){j&&N.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let i=e.findIndex(e=>e.flag===t);i!==-1&&e.splice(i,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function Kp(e,t,n=10){if(typeof t!=`boolean`)return;let r=as();if(!r)return;let i=L(r).data;if(`${Hp}${e}`in i){r.setAttribute(`${Hp}${e}`,t);return}Object.keys(i).filter(e=>e.startsWith(Hp)).length<n&&r.setAttribute(`${Hp}${e}`,t)}var qp=Ql(()=>({name:`FeatureFlags`,processEvent(e,t,n){return Up(e)},addFeatureFlag(e,t){Wp(e,t),Kp(e,t)}})),Jp=Ql(({growthbookClass:e})=>({name:`GrowthBook`,setupOnce(){let t=e.prototype;typeof t.isOn==`function`&&li(t,`isOn`,Yp),typeof t.getFeatureValue==`function`&&li(t,`getFeatureValue`,Yp)},processEvent(e,t,n){return Up(e)}}));function Yp(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`&&(Wp(n,r),Kp(n,r)),r}}var Xp=`ConversationId`,Zp=Ql((()=>({name:Xp,setup(e){e.on(`spanStart`,e=>{let t=P().getScopeData(),n=Da().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=L(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(Xa,r)}})}})));function Qp(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=us()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(tm(n,e),$p(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=F(),d=!!as(),f=d||!!u&&$s(u),p=s&&f?cc(am(o,a,c)):new _s,m=bc(p)&&d?void 0:p;if(s&&!f&&u?.recordDroppedEvent(`no_parent_span`,`span`),e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=em(t,n,us()&&f?m:void 0,l);r&&(e.args[1]=n,n.headers=r)}if(u){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit(`beforeOutgoingRequestSpan`,p,t)}return p}function $p(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function em(e,t,n,r){let i=Yd({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(ci(e)?e.headers:void 0);if(!c)return{"sentry-trace":a,...o&&{baggage:o},...s&&{traceparent:s}};if(rm(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?nm(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}if(im(c)){let e=[...c];e.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!e.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&typeof e[1]==`string`&&nm(e[1]));return o&&!t&&e.push([`baggage`,o]),e}{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>nm(e)):nm(n));o&&!l&&i.push(o);let u=Object.assign({},c,{"sentry-trace":e??a,...i.length>0&&{baggage:i.join(`,`)}});return r&&s&&!t&&(u.traceparent=s),u}}function tm(e,t){if(t.response){Qa(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function nm(e){return typeof e==`string`&&e.split(`,`).some(e=>e.trim().startsWith(lo))}function rm(e){return typeof Headers<`u`&&si(e,Headers)}function im(e){return Array.isArray(e)?e.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`):!1}function am(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${zd(e)}`,attributes:om(e,void 0,t,n)};let r=Fd(e);return{name:`${t} ${r?Id(r):e}`,attributes:om(e,r,t,n)}}function om(e,t,n,r){let i={url:zd(e),type:`fetch`,"http.method":n,[I]:r,[Fa]:`http.client`};return t&&(Pd(t)||(i[Mc]=zd(t.href),i[zc]=zd(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}function sm(e,t={},n=P()){let{message:r,name:i,email:a,url:o,source:s,associatedEventId:c,tags:l}=e,u={contexts:{feedback:{contact_email:a,name:i,message:r,url:o,source:s,associated_event_id:c}},type:`feedback`,level:`info`,tags:l},d=n?.getClient()||F();return d&&d.emit(`beforeSendFeedback`,u,t),n.captureEvent(u,t)}var cm=e({debug:()=>dm,error:()=>mm,fatal:()=>hm,fmt:()=>Kd,info:()=>fm,trace:()=>um,warn:()=>pm});function lm(e,t,n,r,i){hu({level:e,message:t,attributes:n,severityNumber:i},r)}function um(e,t,{scope:n}={}){lm(`trace`,e,t,n)}function dm(e,t,{scope:n}={}){lm(`debug`,e,t,n)}function fm(e,t,{scope:n}={}){lm(`info`,e,t,n)}function pm(e,t,{scope:n}={}){lm(`warn`,e,t,n)}function mm(e,t,{scope:n}={}){lm(`error`,e,t,n)}function hm(e,t,{scope:n}={}){lm(`fatal`,e,t,n)}function gm(e,t,n){return`util`in M&&typeof M.util.format==`function`?M.util.format(...e):_m(e,t,n)}function _m(e,t,n){return e.map(e=>ti(e)?String(e):JSON.stringify(Oi(e,t,n))).join(` `)}function vm(e){return/%[sdifocO]/.test(e)}function ym(e,t){let n={};return n[`sentry.message.template`]=`${e} ${Array(t.length).fill(`{}`).join(` `)}`,t.forEach((e,t)=>{n[`sentry.message.parameter.${t}`]=e}),n}var bm=`ConsoleLogs`,xm={[I]:`auto.log.console`},Sm=Ql(((e={})=>{let t=e.levels||pr;return{name:bm,setup(e){let{enableLogs:n,normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=e.getOptions();if(!n){j&&N.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=Mf(({args:n,level:a})=>{if(F()!==e||!t.includes(a))return;let o=n[0],s=n.slice(1);if(a===`assert`){o||hu({level:`error`,message:s.length>0?`Assertion failed: ${gm(s,r,i)}`:`Assertion failed`,attributes:xm});return}let c=a===`log`,l={...xm};if(ni(o)){Object.assign(l,Oi(o,r,i));let e=typeof n[1]==`string`?2:1;n.slice(e).forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=Oi(e,r,i)})}else if(s.length>0&&typeof o==`string`&&!vm(o)){let e=ym(o,s);for(let[t,n]of Object.entries(e))l[t]=t.startsWith(`sentry.message.parameter.`)?Oi(n,r,i):n}hu({level:c?`info`:a,message:gm(n,r,i),severityNumber:c?10:void 0,attributes:l})});e.registerCleanup(a)}}})),Cm=e({count:()=>Tm,distribution:()=>Dm,gauge:()=>Em});function wm(e,t,n,r){Ou({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function Tm(e,t=1,n){wm(`counter`,e,t,n)}function Em(e,t,n){wm(`gauge`,e,t,n)}function Dm(e,t,n){wm(`distribution`,e,t,n)}var Om=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function km(e={}){let t=new Set(e.levels??Om),n=e.client;return{log(e){let{type:r,level:i,message:a,args:o,tag:s,date:c,...l}=e,u=n||F();if(!u)return;let d=Mm(r,i);if(!t.has(d))return;let{normalizeDepth:f=3,normalizeMaxBreadth:p=1e3}=u.getOptions(),m={};for(let[e,t]of Object.entries(l))m[e]=Oi(t,f,p);m[`sentry.origin`]=`auto.log.consola`,s&&(m[`consola.tag`]=s),r&&(m[`consola.type`]=r),i!=null&&typeof i==`number`&&(m[`consola.level`]=i);let h=Pm(Nm(o,f,p),f,p);h?.attributes&&Object.assign(m,h.attributes),hu({level:d,message:h?.message||a||o&&gm(o,f,p)||``,attributes:m})}}}var Am={silent:`trace`,fatal:`fatal`,error:`error`,warn:`warn`,log:`info`,info:`info`,success:`info`,fail:`error`,ready:`info`,start:`info`,box:`info`,debug:`debug`,trace:`trace`,verbose:`debug`,critical:`fatal`,notice:`info`},jm={0:`fatal`,1:`warn`,2:`info`,3:`info`,4:`debug`,5:`trace`};function Mm(e,t){if(e===`verbose`)return`debug`;if(e===`silent`)return`trace`;if(e){let t=Am[e];if(t)return t}if(typeof t==`number`){let e=jm[t];if(e)return e}return`info`}function Nm(e,t,n){if(!e?.length)return{message:``};let r=gm(e,t,n),i=e[0];if(ni(i)){let t=typeof e[1]==`string`?2:1;return{message:r,attributes:i,messageParameters:e.slice(t)}}{let t=e.slice(1),n=t.length>0&&typeof i==`string`&&!vm(i);return{message:r,messageTemplate:n?i:void 0,messageParameters:n?t:void 0}}}function Pm(e,t,n){let{message:r,attributes:i,messageTemplate:a,messageParameters:o}=e,s={};if(a&&o){let e=ym(a,o);for(let[r,i]of Object.entries(e))s[r]=r.startsWith(`sentry.message.parameter.`)?Oi(i,t,n):i}else o&&o.length>0&&o.forEach((e,r)=>{s[`sentry.message.parameter.${r}`]=Oi(e,t,n)});return{message:r,attributes:{...Oi(i,t,n),...s}}}var Fm=`gen_ai.prompt`,Im=`gen_ai.system`,Lm=`gen_ai.request.model`,Rm=`gen_ai.request.stream`,zm=`gen_ai.request.temperature`,Bm=`gen_ai.request.max_tokens`,Vm=`gen_ai.request.frequency_penalty`,Hm=`gen_ai.request.presence_penalty`,Um=`gen_ai.request.top_p`,Wm=`gen_ai.request.top_k`,Gm=`gen_ai.request.encoding_format`,Km=`gen_ai.request.dimensions`,qm=`gen_ai.response.finish_reasons`,Jm=`gen_ai.response.model`,Ym=`gen_ai.response.id`,Ste=`gen_ai.response.stop_reason`,Xm=`gen_ai.usage.input_tokens`,Zm=`gen_ai.usage.output_tokens`,Qm=`gen_ai.usage.total_tokens`,$m=`gen_ai.operation.name`,eh=`sentry.sdk_meta.gen_ai.input.messages.original_length`,th=`gen_ai.input.messages`,nh=`gen_ai.system_instructions`,rh=`gen_ai.response.text`,ih=`gen_ai.request.available_tools`,Cte=`gen_ai.response.streaming`,ah=`gen_ai.response.tool_calls`,oh=`gen_ai.agent.name`,wte=`gen_ai.pipeline.name`,sh=`gen_ai.conversation.id`,Tte=`gen_ai.usage.cache_creation_input_tokens`,Ete=`gen_ai.usage.cache_read_input_tokens`,Dte=`gen_ai.invoke_agent`,ch=`gen_ai.embeddings.input`,lh=`gen_ai.embeddings`,uh=`gen_ai.execute_tool`,dh=`gen_ai.tool.name`,Ote=`gen_ai.tool.call.id`,kte=`gen_ai.tool.type`,fh=`gen_ai.tool.input`,ph=`gen_ai.tool.output`,Ate=`gen_ai.tool.description`;function mh(e){return!e||typeof e!=`object`?!1:Mte(e)||gh(e)||jte(e)||_h(e)||vh(e)||Nte(e)||Pte(e)||Fte(e)||Ite(e)||Lte(e)||Rte(e)||zte(e)}function jte(e){return`image_url`in e?typeof e.image_url==`string`?e.image_url.startsWith(`data:`):hh(e):!1}function hh(e){return`image_url`in e&&!!e.image_url&&typeof e.image_url==`object`&&`url`in e.image_url&&typeof e.image_url.url==`string`&&e.image_url.url.startsWith(`data:`)}function Mte(e){return`type`in e&&typeof e.type==`string`&&`source`in e&&mh(e.source)}function gh(e){return`inlineData`in e&&!!e.inlineData&&typeof e.inlineData==`object`&&`data`in e.inlineData&&typeof e.inlineData.data==`string`}function _h(e){return`type`in e&&e.type===`input_audio`&&`input_audio`in e&&!!e.input_audio&&typeof e.input_audio==`object`&&`data`in e.input_audio&&typeof e.input_audio.data==`string`}function vh(e){return`type`in e&&e.type===`file`&&`file`in e&&!!e.file&&typeof e.file==`object`&&`file_data`in e.file&&typeof e.file.file_data==`string`}function Nte(e){return`media_type`in e&&typeof e.media_type==`string`&&`data`in e}function Pte(e){return`type`in e&&e.type===`file`&&`mediaType`in e&&typeof e.mediaType==`string`&&`data`in e&&typeof e.data==`string`&&!e.data.startsWith(`http://`)&&!e.data.startsWith(`https://`)}function Fte(e){return`type`in e&&e.type===`image`&&`image`in e&&typeof e.image==`string`&&!e.image.startsWith(`http://`)&&!e.image.startsWith(`https://`)}function Ite(e){return`type`in e&&(e.type===`blob`||e.type===`base64`)}function Lte(e){return`b64_json`in e}function Rte(e){return`type`in e&&`result`in e&&e.type===`image_generation`}function zte(e){return`uri`in e&&typeof e.uri==`string`&&e.uri.startsWith(`data:`)}var yh=`[Blob substitute]`,Bte=[`image_url`,`data`,`content`,`b64_json`,`result`,`uri`,`image`];function bh(e){let t={...e};mh(t.source)&&(t.source=bh(t.source)),gh(e)&&(t.inlineData={...e.inlineData,data:yh}),hh(e)&&(t.image_url={...e.image_url,url:yh}),_h(e)&&(t.input_audio={...e.input_audio,data:yh}),vh(e)&&(t.file={...e.file,file_data:yh});for(let e of Bte)typeof t[e]==`string`&&(t[e]=yh);return t}var xh=2e4,Sh=e=>new TextEncoder().encode(e).length,Ch=e=>Sh(JSON.stringify(e));function wh(e,t){if(Sh(e)<=t)return e;let n=0,r=e.length,i=``;for(;n<=r;){let a=Math.floor((n+r)/2),o=e.slice(0,a);Sh(o)<=t?(i=o,n=a+1):r=a-1}return i}function Vte(e){return typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``}function Th(e,t){return typeof e==`string`?t:{...e,text:t}}function Hte(e){return typeof e==`object`&&!!e&&`content`in e&&typeof e.content==`string`}function Eh(e){return typeof e==`object`&&!!e&&`content`in e&&Array.isArray(e.content)}function Dh(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)&&e.parts.length>0}function Ute(e,t){let n=t-Ch({...e,content:``});if(n<=0)return[];let r=wh(e.content,n);return[{...e,content:r}]}function Wte(e){return`parts`in e&&Array.isArray(e.parts)?{key:`parts`,items:e.parts}:`content`in e&&Array.isArray(e.content)?{key:`content`,items:e.content}:{key:null,items:[]}}function Gte(e,t){let{key:n,items:r}=Wte(e);if(n===null||r.length===0)return[];let i=r.map(e=>Th(e,``)),a=t-Ch({...e,[n]:i});if(a<=0)return[];let o=[];for(let e of r){let t=Vte(e),n=Sh(t);if(n<=a)o.push(e),a-=n;else if(o.length===0){let n=wh(t,a);n&&o.push(Th(e,n));break}else break}return o.length<=0?[]:[{...e,[n]:o}]}function Kte(e,t){if(!e)return[];if(typeof e==`string`){let n=wh(e,t);return n?[n]:[]}return typeof e==`object`?Hte(e)?Ute(e,t):Eh(e)||Dh(e)?Gte(e,t):[]:[]}function Oh(e){return e.map(e=>{let t;return e&&typeof e==`object`&&(Eh(e)?t={...e,content:Oh(e.content)}:`content`in e&&mh(e.content)&&(t={...e,content:bh(e.content)}),Dh(e)&&(t={...t??e,parts:Oh(e.parts)}),mh(t)?t=bh(t):mh(e)&&(t=bh(e))),t??e})}function qte(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],i=Oh([r]),a=i[0];return Ch(a)<=n?i:Kte(a,n)}function Jte(e){return qte(e,xh)}function Yte(e){return wh(e,xh)}function kh(e){let t=F()?.getDataCollectionOptions().genAI;return{...e,recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1}}function Ah(e){if(e!==void 0)return e;let t=F();return!t||!$s(t)&&t.getOptions().streamGenAiSpans===!1}function jh(e,t){return e?`${e}.${t}`:t}function Xte(e,t,n,r,i){if(t!==void 0&&e.setAttributes({[Xm]:t}),n!==void 0&&e.setAttributes({[Zm]:n}),t!==void 0||n!==void 0||r!==void 0||i!==void 0){let a=(t??0)+(n??0)+(r??0)+(i??0);e.setAttributes({[Qm]:a})}}function Mh(e,t,n){if(!e.isRecording())return;let r={[Cte]:!0};t.responseId&&(r[Ym]=t.responseId),t.responseModel&&(r[Jm]=t.responseModel),t.promptTokens!==void 0&&(r[Xm]=t.promptTokens),t.completionTokens!==void 0&&(r[Zm]=t.completionTokens),t.totalTokens===void 0?(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[Qm]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)):r[Qm]=t.totalTokens,t.finishReasons.length&&(r[qm]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[rh]=t.responseTexts.join(``)),n&&t.toolCalls.length&&(r[ah]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function Nh(e){if(typeof e==`string`)return Yte(e);try{return JSON.stringify(Array.isArray(e)?Jte(e):e)}catch{return`[unserializable]`}}function Ph(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(e=>e&&typeof e==`object`&&`role`in e&&e.role===`system`);if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content==`string`?n.content:n.content===void 0?void 0:JSON.stringify(n.content);return r?{systemInstructions:JSON.stringify([{type:`text`,content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}}async function Zte(e,t){let[n,r]=await Promise.all([t,e]);return r&&typeof r==`object`&&`data`in r?{...r,data:n}:n}function Fh(e,t){return oi(e)?new Proxy(e,{get(e,n){let r=n in Promise.prototype||n===Symbol.toStringTag?t:e,i=Reflect.get(r,n);return n===`withResponse`&&typeof i==`function`?function(){return Zte(i.call(e),t)}:typeof i==`function`?i.bind(r):i}}):t}var Qte={"responses.create":{operation:`chat`},"chat.completions.create":{operation:`chat`},"embeddings.create":{operation:`embeddings`},"conversations.create":{operation:`chat`}},$te=[`response.created`,`response.in_progress`,`response.failed`,`response.completed`,`response.incomplete`,`response.queued`,`response.output_text.delta`,`response.output_item.added`,`response.function_call_arguments.delta`,`response.function_call_arguments.done`,`response.output_item.done`];function ene(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`response.`)}function tne(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`chat.completion.chunk`}function nne(e,t,n){if(!t||typeof t!=`object`)return;let r=t,i={};if(typeof r.id==`string`&&(i[Ym]=r.id),typeof r.model==`string`&&(i[Jm]=r.model),r.object===`conversation`&&typeof r.id==`string`&&(i[sh]=r.id),r.usage&&typeof r.usage==`object`){let e=r.usage,t=e.prompt_tokens??e.input_tokens;typeof t==`number`&&(i[Xm]=t);let n=e.completion_tokens??e.output_tokens;typeof n==`number`&&(i[Zm]=n),typeof e.total_tokens==`number`&&(i[Qm]=e.total_tokens)}if(Array.isArray(r.choices)){let e=r.choices,t=e.map(e=>e.finish_reason).filter(e=>typeof e==`string`);if(t.length>0&&(i[qm]=JSON.stringify(t)),n){let t=e.map(e=>e.message?.content||``);i[rh]=JSON.stringify(t);let n=e.map(e=>e.message?.tool_calls).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&(i[ah]=JSON.stringify(n))}}if(typeof r.status==`string`&&(i[`gen_ai.response.finish_reasons`]||(i[qm]=JSON.stringify([r.status]))),n&&(typeof r.output_text==`string`&&!i[`gen_ai.response.text`]&&(i[rh]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!i[`gen_ai.response.tool_calls`])){let e=r.output.filter(e=>e?.type===`function_call`);e.length>0&&(i[ah]=JSON.stringify(e))}e.setAttributes(i)}function rne(e){if(`conversation`in e&&typeof e.conversation==`string`)return e.conversation;if(`previous_response_id`in e&&typeof e.previous_response_id==`string`)return e.previous_response_id}function ine(e){let t={[Lm]:e.model??`unknown`};`temperature`in e&&(t[zm]=e.temperature),`top_p`in e&&(t[Um]=e.top_p),`frequency_penalty`in e&&(t[Vm]=e.frequency_penalty),`presence_penalty`in e&&(t[Hm]=e.presence_penalty),`stream`in e&&(t[Rm]=e.stream),`encoding_format`in e&&(t[Gm]=e.encoding_format),`dimensions`in e&&(t[Km]=e.dimensions);let n=rne(e);return n&&(t[sh]=n),t}function ane(e,t){for(let n of e){let e=n.index;if(!(e===void 0||!n.function))if(!(e in t.chatCompletionToolCalls))t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||``}};else{let r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}}}function one(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&ane(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function sne(e,t,n,r){if(!(e&&typeof e==`object`)){t.eventTypes.push(`unknown:non-object`);return}if(e instanceof Error){r.setStatus({code:2,message:`internal_error`}),_l(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream-response`}});return}if(!(`type`in e))return;let i=e;if(!$te.includes(i.type)){t.eventTypes.push(i.type);return}if(n&&(i.type===`response.output_item.done`&&`item`in i&&t.responsesApiToolCalls.push(i.item),i.type===`response.output_text.delta`&&`delta`in i&&i.delta)){t.responseTexts.push(i.delta);return}if(`response`in i){let{response:e}=i;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}async function*cne(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let i of e)tne(i)?one(i,r,n):ene(i)&&sne(i,r,n,t),yield i}finally{let e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];Mh(t,{...r,toolCalls:e},n)}}function lne(e){let t=Array.isArray(e.tools)?e.tools:[],n=e.web_search_options&&typeof e.web_search_options==`object`?[{type:`web_search_options`,...e.web_search_options}]:[],r=[...t,...n];if(r.length!==0)try{return JSON.stringify(r)}catch(e){j&&N.error(`Failed to serialize OpenAI tools:`,e);return}}function une(e,t){let n={[Im]:`openai`,[$m]:t,[I]:`auto.ai.openai`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0],r=lne(t);r&&(n[ih]=r),Object.assign(n,ine(t))}else n[Lm]=`unknown`;return n}function Ih(e,t,n,r){if(n===`embeddings`&&`input`in t){let n=t.input;if(n==null||typeof n==`string`&&n.length===0||Array.isArray(n)&&n.length===0)return;e.setAttribute(ch,typeof n==`string`?n:JSON.stringify(n));return}let i=`input`in t?t.input:`messages`in t?t.messages:void 0;if(!i||Array.isArray(i)&&i.length===0)return;let{systemInstructions:a,filteredMessages:o}=Ph(i);a&&e.setAttribute(nh,a),e.setAttribute(th,r?Nh(o):Ii(o)),Array.isArray(o)?e.setAttribute(eh,o.length):e.setAttribute(eh,1)}function dne(e,t,n,r,i){return function(...t){let a=n.operation||`unknown`,o=une(t,a),s=o[`gen_ai.request.model`]||`unknown`,c=t[0],l=c&&typeof c==`object`&&c.stream===!0,u={name:`${a} ${s}`,op:`gen_ai.${a}`,attributes:o};if(l){let n,o=sc(u,o=>(n=e.apply(r,t),i.recordInputs&&c&&Ih(o,c,a,Ah(i.enableTruncation)),(async()=>{try{return cne(await n,o,i.recordOutputs??!1)}catch(e){throw o.setStatus({code:2,message:`internal_error`}),o.end(),e}})()));return Fh(n,o)}let d,f=oc(u,n=>(d=e.apply(r,t),i.recordInputs&&c&&Ih(n,c,a,Ah(i.enableTruncation)),d.then(e=>(nne(n,e,i.recordOutputs),e))));return Fh(d,f)}}function Lh(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=jh(t,String(r)),o=Qte[a];return typeof i==`function`&&o?dne(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?Lh(i,a,n):i}})}function fne(e,t){return Lh(e,``,kh(t))}var Rh={"messages.create":{operation:`chat`},"messages.stream":{operation:`chat`,streaming:!0},"messages.countTokens":{operation:`chat`},"models.get":{operation:`models`},"completions.create":{operation:`chat`},"models.retrieve":{operation:`models`},"beta.messages.create":{operation:`chat`}};function pne(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:i}=Ph(t);r&&e.setAttributes({[nh]:r});let a=Array.isArray(i)?i.length:1;e.setAttributes({[th]:n?Nh(i):Ii(i),[eh]:a})}var mne={invalid_request_error:`invalid_argument`,authentication_error:`unauthenticated`,permission_error:`permission_denied`,not_found_error:`not_found`,request_too_large:`failed_precondition`,rate_limit_error:`resource_exhausted`,api_error:`internal_error`,overloaded_error:`unavailable`};function zh(e){return e&&mne[e]||`internal_error`}function hne(e,t){t.error&&(e.setStatus({code:2,message:zh(t.error.type)}),_l(t.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}))}function gne(e){let{system:t,messages:n,input:r}=e,i=typeof t==`string`?[{role:`system`,content:e.system}]:[],a=(Array.isArray(r)?r:r==null?void 0:[r])??(Array.isArray(n)?n:n==null?[]:[n]);return[...i,...a]}function _ne(e,t){return`type`in e&&typeof e.type==`string`&&e.type===`error`&&(t.setStatus({code:2,message:zh(e.error?.type)}),!0)}function vne(e,t){if(e.type===`message_delta`&&(e.usage&&typeof e.usage.output_tokens==`number`&&(t.completionTokens=e.usage.output_tokens),e.delta?.stop_reason&&t.finishReasons.push(e.delta.stop_reason)),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.usage&&(typeof n.usage.input_tokens==`number`&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens==`number`&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens==`number`&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function yne(e,t){e.type!==`content_block_start`||typeof e.index!=`number`||!e.content_block||(e.content_block.type===`tool_use`||e.content_block.type===`server_tool_use`)&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function bne(e,t,n){if(!(e.type!==`content_block_delta`||!e.delta)){if(typeof e.index==`number`&&`partial_json`in e.delta&&typeof e.delta.partial_json==`string`){let n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text==`string`&&t.responseTexts.push(e.delta.text)}}function xne(e,t){if(e.type!==`content_block_stop`||typeof e.index!=`number`)return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(``),i;try{i=r?JSON.parse(r):{}}catch{i={__unparsed:r}}t.toolCalls.push({type:`tool_use`,id:n.id,name:n.name,input:i}),delete t.activeToolBlocks[e.index]}function Bh(e,t,n,r){e&&typeof e==`object`&&(_ne(e,r)||(vne(e,t),yne(e,t),bne(e,t,n),xne(e,t)))}async function*Sne(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let i of e)Bh(i,r,n,t),yield i}finally{Mh(t,r,n)}}function Cne(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on(`streamEvent`,e=>{Bh(e,r,n,t)}),e.on(`message`,()=>{Mh(t,r,n)}),e.on(`error`,e=>{_l(e,{mechanism:{handled:!1,type:`auto.ai.anthropic.stream_error`}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end())}),e}var Vh=!1,Hh=new WeakSet;function wne(e,t,n){let r={[Im]:`anthropic`,[$m]:n,[I]:`auto.ai.anthropic`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0];t.tools&&Array.isArray(t.tools)&&(r[ih]=JSON.stringify(t.tools)),r[Lm]=t.model??`unknown`,`temperature`in t&&(r[zm]=t.temperature),`top_p`in t&&(r[Um]=t.top_p),`stream`in t&&(r[Rm]=t.stream),`top_k`in t&&(r[Wm]=t.top_k),`frequency_penalty`in t&&(r[Vm]=t.frequency_penalty),`max_tokens`in t&&(r[Bm]=t.max_tokens)}else r[Lm]=t===`models.retrieve`||t===`models.get`?e[0]:`unknown`;return r}function Uh(e,t,n){pne(e,gne(t),n),`prompt`in t&&e.setAttributes({[Fm]:JSON.stringify(t.prompt)})}function Tne(e,t){if(`content`in t&&Array.isArray(t.content)){e.setAttributes({[rh]:t.content.map(e=>e.text).filter(e=>!!e).join(``)});let n=[];for(let e of t.content)(e.type===`tool_use`||e.type===`server_tool_use`)&&n.push(e);n.length>0&&e.setAttributes({[ah]:JSON.stringify(n)})}`completion`in t&&e.setAttributes({[rh]:t.completion}),`input_tokens`in t&&e.setAttributes({[rh]:JSON.stringify(t.input_tokens)})}function Ene(e,t){`id`in t&&`model`in t&&(e.setAttributes({[Ym]:t.id,[Jm]:t.model}),`usage`in t&&t.usage&&Xte(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function Dne(e,t,n){if(!(!t||typeof t!=`object`)){if(`type`in t&&t.type===`error`){hne(e,t);return}n&&Tne(e,t),Ene(e,t)}}function Wh(e,t){throw t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end()),e}function One(e,t,n,r,i,a,o,s,c,l){let u={name:`${i} ${r[`gen_ai.request.model`]??`unknown`}`,op:`gen_ai.${i}`,attributes:r};if(c&&!l){let r,i=sc(u,i=>(r=e.apply(t,n),s.recordInputs&&o&&Uh(i,o,Ah(s.enableTruncation)),(async()=>{try{return Sne(await r,i,s.recordOutputs??!1)}catch(e){return Wh(e,i)}})()));return Fh(r,i)}return sc(u,r=>{try{s.recordInputs&&o&&Uh(r,o,Ah(s.enableTruncation)),Vh=!0;let i=e.apply(t,n);return Vh=!1,Cne(i,r,s.recordOutputs??!1)}catch(e){return Vh=!1,Wh(e,r)}})}function kne(e,t,n,r,i){return new Proxy(e,{apply(e,a,o){let s=a===void 0?r:a,c=n.streaming===!0;if(!c&&Vh)return e.apply(s,o);let l=n.operation||`unknown`,u=wne(o,t,l),d=u[`gen_ai.request.model`]??`unknown`,f=typeof o[0]==`object`?o[0]:void 0,p=!!f?.stream;if(p||c)return One(e,s,o,u,l,t,f,i,p,c);let m,h=oc({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:u},t=>(m=e.apply(s,o),i.recordInputs&&f&&Uh(t,f,Ah(i.enableTruncation)),m.then(e=>(Dne(t,e,i.recordOutputs),e))));return Fh(m,h)}})}function Ane(e,t){for(let n of Object.keys(Rh)){let r=n.split(`.`),i=r.pop(),a=e;for(let e of r)a=a?.[e];if(!a||typeof a[i]!=`function`)continue;let o=a[i];if(Hh.has(o))continue;let s=kne(o,n,Rh[n],a,t);Hh.add(s),a[i]=s}return e}function jne(e,t){return Ane(e,kh(t))}var Mne={"models.generateContent":{operation:`generate_content`},"models.generateContentStream":{operation:`generate_content`,streaming:!0},"models.embedContent":{operation:`embeddings`},"chats.create":{proxyResultPath:`chat`},"chat.sendMessage":{operation:`chat`},"chat.sendMessageStream":{operation:`chat`,streaming:!0}},Nne=`google_genai`;function Pne(e,t){let n=e?.promptFeedback;if(n?.blockReason){let e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:`internal_error`}),_l(`Content blocked: ${e}`,{mechanism:{handled:!1,type:`auto.ai.google_genai`}}),!0}return!1}function Fne(e,t){typeof e.responseId==`string`&&(t.responseId=e.responseId),typeof e.modelVersion==`string`&&(t.responseModel=e.modelVersion);let n=e.usageMetadata;n&&(typeof n.promptTokenCount==`number`&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount==`number`&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount==`number`&&(t.totalTokens=n.totalTokenCount))}function Ine(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:`function`,id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}function Lne(e,t,n,r){!e||Pne(e,r)||(Fne(e,t),Ine(e,t,n))}async function*Rne(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let i of e)Lne(i,r,n,t),yield i}finally{Mh(t,r,n)}}function Gh(e,t=`user`){return typeof e==`string`?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(e=>Gh(e,t)):typeof e!=`object`||!e?[]:`role`in e&&typeof e.role==`string`?[e]:`parts`in e?[{...e,role:t}]:[{role:t,content:e}]}function Kh(e,t){if(`model`in e&&typeof e.model==`string`)return e.model;if(t&&typeof t==`object`){let e=t;if(`model`in e&&typeof e.model==`string`)return e.model;if(`modelVersion`in e&&typeof e.modelVersion==`string`)return e.modelVersion}return`unknown`}function zne(e){let t={};return`temperature`in e&&typeof e.temperature==`number`&&(t[zm]=e.temperature),`topP`in e&&typeof e.topP==`number`&&(t[Um]=e.topP),`topK`in e&&typeof e.topK==`number`&&(t[Wm]=e.topK),`maxOutputTokens`in e&&typeof e.maxOutputTokens==`number`&&(t[Bm]=e.maxOutputTokens),`frequencyPenalty`in e&&typeof e.frequencyPenalty==`number`&&(t[Vm]=e.frequencyPenalty),`presencePenalty`in e&&typeof e.presencePenalty==`number`&&(t[Hm]=e.presencePenalty),t}function Bne(e,t,n){let r={[Im]:Nne,[$m]:e,[I]:`auto.ai.google_genai`};if(t){if(r[Lm]=Kh(t,n),`config`in t&&typeof t.config==`object`&&t.config){let e=t.config;if(Object.assign(r,zne(e)),`tools`in e&&Array.isArray(e.tools)){let t=e.tools.flatMap(e=>e.functionDeclarations);r[ih]=JSON.stringify(t)}}}else r[Lm]=Kh({},n);return r}function qh(e,t,n,r){if(n===`embeddings`){let n=t.contents;n!=null&&e.setAttribute(ch,typeof n==`string`?n:JSON.stringify(n));return}let i=[];if(`config`in t&&t.config&&typeof t.config==`object`&&`systemInstruction`in t.config&&t.config.systemInstruction&&i.push(...Gh(t.config.systemInstruction,`system`)),`history`in t&&i.push(...Gh(t.history,`user`)),`contents`in t&&i.push(...Gh(t.contents,`user`)),`message`in t&&i.push(...Gh(t.message,`user`)),Array.isArray(i)&&i.length){let{systemInstructions:t,filteredMessages:n}=Ph(i);t&&e.setAttribute(nh,t);let a=Array.isArray(n)?n.length:0;e.setAttributes({[eh]:a,[th]:r?Nh(n):Ii(n)})}}function Vne(e,t,n){if(!(!t||typeof t!=`object`)){if(t.modelVersion&&e.setAttribute(Jm,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata==`object`){let n=t.usageMetadata;typeof n.promptTokenCount==`number`&&e.setAttributes({[Xm]:n.promptTokenCount}),typeof n.candidatesTokenCount==`number`&&e.setAttributes({[Zm]:n.candidatesTokenCount}),typeof n.totalTokenCount==`number`&&e.setAttributes({[Qm]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let n=t.candidates.map(e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>typeof e.text==`string`?e.text:``).filter(e=>e.length>0).join(``):``).filter(e=>e.length>0);n.length>0&&e.setAttributes({[rh]:n.join(``)})}if(n&&t.functionCalls){let n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[ah]:JSON.stringify(n)})}}}function Hne(e,t,n,r,i){let a=n.operation===`embeddings`;return new Proxy(e,{apply(e,t,o){let s=n.operation||`unknown`,c=o[0],l=Bne(s,c,r),u=l[`gen_ai.request.model`]??`unknown`;return n.streaming?sc({name:`${s} ${u}`,op:`gen_ai.${s}`,attributes:l},async t=>{try{return i.recordInputs&&c&&qh(t,c,s,Ah(i.enableTruncation)),Rne(await e.apply(r,o),t,!!i.recordOutputs)}catch(e){throw t.setStatus({code:2,message:`internal_error`}),t.end(),e}}):oc({name:`${s} ${u}`,op:`gen_ai.${s}`,attributes:l},t=>(i.recordInputs&&c&&qh(t,c,s,Ah(i.enableTruncation)),ic(()=>e.apply(r,o),()=>{},()=>{},e=>{a||Vne(t,e,i.recordOutputs)})))}})}function Jh(e,t=``,n){return new Proxy(e,{get:(e,r,i)=>{let a=Reflect.get(e,r,i),o=jh(t,String(r)),s=Mne[o];if(typeof a==`function`&&s){let t=s.operation?Hne(a,o,s,e,n):a.bind(e);return s.proxyResultPath?function(...e){let r=t(...e);return r&&typeof r==`object`?Jh(r,s.proxyResultPath,n):r}:t}return typeof a==`function`?a.bind(e):a&&typeof a==`object`?Jh(a,o,n):a}})}function Une(e,t){return Jh(e,``,kh(t))}var Yh=`auto.ai.langchain`,Wne={human:`user`,ai:`assistant`,assistant:`assistant`,system:`system`,function:`function`,tool:`tool`},Xh=(e,t,n)=>{n!=null&&(e[t]=n)},Zh=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function Qh(e){if(Array.isArray(e))try{let t=e.map(e=>e&&typeof e==`object`&&mh(e)?bh(e):e);return JSON.stringify(t)}catch{return String(e)}return Ii(e,String)}function $h(e){let t=e.toLowerCase();return Wne[t]??t}function eg(e){return e.includes(`System`)?`system`:e.includes(`Human`)?`user`:e.includes(`AI`)||e.includes(`Assistant`)?`assistant`:e.includes(`Function`)?`function`:e.includes(`Tool`)?`tool`:`user`}function tg(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function ng(e){return e.map(e=>{let t=e._getType;if(typeof t==`function`)return{role:$h(t.call(e)),content:Qh(e.content)};if(e.lc===1&&e.kwargs){let t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:``;return{role:$h(typeof n==`string`?eg(n):`user`),content:Qh(e.kwargs?.content)}}if(e.type)return{role:$h(String(e.type).toLowerCase()),content:Qh(e.content)};if(e.role)return{role:$h(String(e.role)),content:Qh(e.content)};let n=e.constructor?.name;return n&&n!==`Object`?{role:$h(eg(n)),content:Qh(e.content)}:{role:`user`,content:Qh(e.content)}})}function Gne(e,t,n){let r={},i=`kwargs`in e?e.kwargs:void 0;Zh(r,zm,t?.temperature??n?.ls_temperature??i?.temperature),Zh(r,Bm,t?.max_tokens??n?.ls_max_tokens??i?.max_tokens),Zh(r,Um,t?.top_p??i?.top_p);let a=t?.frequency_penalty;Zh(r,Vm,a);let o=t?.presence_penalty;return Zh(r,Hm,o),t&&`stream`in t&&Xh(r,Rm,!!t.stream),r}function rg(e,t,n,r,i){return{[Im]:Ii(e??`langchain`,String),[$m]:`chat`,[Lm]:Ii(t,String),[I]:Yh,...Gne(n,r,i)}}function Kne(e,t,n,r,i,a){let o=a?.ls_provider,s=rg(o,i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){Xh(s,eh,t.length);let e=t.map(e=>({role:`user`,content:e}));Xh(s,th,r?Nh(e):Ii(e))}return s}function qne(e,t,n,r,i,a){let o=rg(a?.ls_provider??e.id?.[2],i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){let{systemInstructions:e,filteredMessages:n}=Ph(ng(t.flat()));e&&Xh(o,nh,e),Xh(o,eh,Array.isArray(n)?n.length:0),Xh(o,th,r?Nh(n):Ii(n))}return o}function Jne(e,t){let n=[],r=e.flat();for(let e of r){let t=e.message?.tool_calls;if(Array.isArray(t)&&t.length>0)n.push(...t);else{let t=e.message?.content;if(Array.isArray(t))for(let e of t){let t=e;t.type===`tool_use`&&n.push(t)}}}n.length>0&&Xh(t,ah,Ii(n,String))}function Yne(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)Zh(t,Xm,n.promptTokens),Zh(t,Zm,n.completionTokens),Zh(t,Qm,n.totalTokens);else if(r){Zh(t,Xm,r.input_tokens),Zh(t,Zm,r.output_tokens);let e=Number(r.input_tokens),n=Number(r.output_tokens),i=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);i>0&&Zh(t,Qm,i),r.cache_creation_input_tokens!==void 0&&Zh(t,Tte,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Zh(t,Ete,r.cache_read_input_tokens)}}function Xne(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let r=e.generations.flat().map(e=>e.generationInfo?.finish_reason?e.generationInfo.finish_reason:e.generation_info?.finish_reason?e.generation_info.finish_reason:null).filter(e=>typeof e==`string`);if(r.length>0&&Xh(n,qm,Ii(r,String)),Jne(e.generations,n),t){let t=e.generations.flat().map(e=>e.text??e.message?.content).filter(e=>typeof e==`string`);t.length>0&&Xh(n,rh,Ii(t,String))}}Yne(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&Xh(n,Jm,a);let o=r?.id??i?.id;o&&Xh(n,Ym,o);let s=r?.stop_reason??i?.response_metadata?.finish_reason;return s&&Xh(n,Ste,Ii(s,String)),n}function ig(e){let t={},n=e?.lc_agent_name;return typeof n==`string`&&(t[oh]=n),t}function Zne(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(e=>{let t=e.function;return{type:`function`,name:e.name??t?.name??``,description:e.description??t?.description}});return JSON.stringify(n)}function Qne(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.addHandler==`function`&&typeof t.copy==`function`}function $ne(e){return typeof e==`object`&&e?.name===`SentryCallbackHandler`}function ag(e){return e.some($ne)}function ere(e,t){if(!e)return[t];if(Qne(e)){if(ag(e.handlers??[]))return e;let n=e.copy();return n.addHandler(t,!0),n}let n=Array.isArray(e)?e:[e];return ag(n)?e:[...n,t]}function og(e={}){let{recordInputs:t,recordOutputs:n}=kh(e),r=Ah(e.enableTruncation),i=new Map,a=e=>{let t=i.get(e);t?.isRecording()&&(t.end(),i.delete(e))},o={lc_serializable:!1,lc_namespace:[`langchain_core`,`callbacks`,`sentry`],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:[`langchain_core`,`callbacks`,`sentry`],lc_kwargs:{},name:`SentryCallbackHandler`,ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(e,n,a,o,s,c,l,u){let d=tg(c),f=Kne(e,n,t,r,d,l),p=f[Lm],m=f[$m];sc({name:`${m} ${p}`,op:`gen_ai.chat`,attributes:{...ig(l),...f,[Fa]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleChatModelStart(e,n,a,o,s,c,l,u){let d=tg(c),f=qne(e,n,t,r,d,l),p=Zne(s);p&&(f[ih]=p);let m=f[Lm],h=f[$m];sc({name:`${h} ${m}`,op:`gen_ai.chat`,attributes:{...ig(l),...f,[Fa]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleLLMEnd(e,t,r,o,s){let c=i.get(t);if(c?.isRecording()){let r=Xne(e,n);r&&c.setAttributes(r),a(t)}},handleLLMError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},handleChainStart(e,n,r,a,o,s,c,l){if(s?.__sentry_langgraph__)return;let u=l||e.name||`unknown_chain`,d={[I]:`auto.ai.langchain`,"langchain.chain.name":u};t&&(d[`langchain.chain.inputs`]=JSON.stringify(n)),sc({name:`chain ${u}`,op:`gen_ai.invoke_agent`,attributes:{...d,[Fa]:`gen_ai.invoke_agent`}},e=>(i.set(r,e),e))},handleChainEnd(e,t){let r=i.get(t);r?.isRecording()&&(n&&r.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),a(t))},handleChainError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},handleToolStart(e,n,r,a,o,s,c){if(s?.__sentry_langgraph__)return;let l=c||e.name||`unknown_tool`,u={...ig(s),[I]:Yh,[$m]:`execute_tool`,[dh]:l};t&&(u[fh]=n),sc({name:`execute_tool ${l}`,op:`gen_ai.execute_tool`,attributes:{...u,[Fa]:`gen_ai.execute_tool`}},e=>(i.set(r,e),e))},handleToolEnd(e,t){let r=i.get(t);if(r?.isRecording()){if(n){let t=e,n=t&&typeof t==`object`&&`content`in t?t.content:e;r.setAttributes({[ph]:typeof n==`string`?n:JSON.stringify(n)})}a(t)}},handleToolError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t))},copy(){return o},toJSON(){return{lc:1,type:`not_implemented`,id:o.lc_id}},toJSONNotImplemented(){return{lc:1,type:`not_implemented`,id:o.lc_id}}};return o}function tre(e){let t=e.constructor?.name??``;return t.includes(`OpenAI`)?`openai`:t.includes(`Google`)?`google_genai`:t.includes(`Mistral`)?`mistralai`:t.includes(`Vertex`)?`google_vertexai`:t.includes(`Bedrock`)?`aws_bedrock`:t.includes(`Ollama`)?`ollama`:t.includes(`Cloudflare`)?`cloudflare`:t.includes(`Cohere`)?`cohere`:`langchain`}function nre(e){let t=e??{},n={[I]:Yh,[Fa]:lh,[$m]:`embeddings`,[Lm]:t.model??`unknown`};return n[Im]=tre(t),`dimensions`in t&&(n[Km]=t.dimensions),`encodingFormat`in t&&(n[Gm]=t.encodingFormat),n}function rre(e,t,n={}){let{recordInputs:r}=kh(n),i=nre(e),a=i[`gen_ai.request.model`]||`unknown`;return r&&t!=null&&(i[ch]=typeof t==`string`?t:JSON.stringify(t)),{name:`embeddings ${a}`,op:lh,attributes:i}}function sg(e,t={}){return new Proxy(e,{apply(e,n,r){return oc(rre(n,r[0],t),()=>Reflect.apply(e,n,r))}})}function ire(e,t){let n=e;return typeof n.embedQuery==`function`&&(n.embedQuery=sg(n.embedQuery,t)),typeof n.embedDocuments==`function`&&(n.embedDocuments=sg(n.embedDocuments,t)),e}var cg=`auto.ai.langgraph`;function are(e){let t=e[0];if(typeof t!=`object`||!t||!(`llm`in t)||!t.llm||typeof t.llm!=`object`)return null;let n=t.llm;return typeof n.modelName!=`string`&&typeof n.model!=`string`?null:n}function ore(e){let t=e[0];return typeof t==`object`&&t&&`name`in t&&typeof t.name==`string`?t.name:null}function sre(e,t,n){let r=`__sentry_tool_wrapped__`;for(let i of e){if(!i||typeof i!=`object`)continue;let e=i,a=e.invoke;if(typeof a!=`function`||Object.prototype.hasOwnProperty.call(e,r))continue;let o=typeof e.name==`string`?e.name:`unknown_tool`,s=typeof e.description==`string`?e.description:void 0;e.invoke=new Proxy(a,{apply(e,r,i){let a={[I]:cg,[Fa]:uh,[$m]:`execute_tool`,[dh]:o,[kte]:`function`},c=i[1]?.metadata?.lc_agent_name??n;typeof c==`string`&&(a[oh]=c),s&&(a[Ate]=s);let l=i[0];if(typeof l==`object`&&l&&(`id`in l&&typeof l.id==`string`&&(a[Ote]=l.id),t.recordInputs)){let e=`args`in l&&typeof l.args==`object`?l.args:l;try{a[fh]=JSON.stringify(e)}catch{}}return oc({op:uh,name:`execute_tool ${o}`,attributes:a},async n=>{try{let a=await Reflect.apply(e,r,i);if(t.recordOutputs)try{let e=a,t=e&&typeof e==`object`&&`content`in e?e.content:a;n.setAttribute(ph,typeof t==`string`?t:JSON.stringify(t))}catch{}return a}catch(e){throw n.setStatus({code:2,message:`internal_error`}),e}})}}),Object.defineProperty(e,r,{value:!0,enumerable:!1})}return e}function cre(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n==`object`){let e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}function lre(e){let t=e,n=0,r=0,i=0;if(t.usage_metadata&&typeof t.usage_metadata==`object`){let e=t.usage_metadata;return typeof e.input_tokens==`number`&&(n=e.input_tokens),typeof e.output_tokens==`number`&&(r=e.output_tokens),typeof e.total_tokens==`number`&&(i=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:i}}if(t.response_metadata&&typeof t.response_metadata==`object`){let e=t.response_metadata;if(e.tokenUsage&&typeof e.tokenUsage==`object`){let t=e.tokenUsage;typeof t.promptTokens==`number`&&(n=t.promptTokens),typeof t.completionTokens==`number`&&(r=t.completionTokens),typeof t.totalTokens==`number`&&(i=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:i}}function ure(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata==`object`){let t=n.response_metadata;t.model_name&&typeof t.model_name==`string`&&e.setAttribute(Jm,t.model_name),t.finish_reason&&typeof t.finish_reason==`string`&&e.setAttribute(qm,[t.finish_reason])}}function dre(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(e=>({name:e.lc_kwargs?.name,description:e.lc_kwargs?.description,schema:e.lc_kwargs?.schema}))}function fre(e,t,n){let r=n?.messages;if(!r||!Array.isArray(r))return;let i=t?.length??0,a=r.length>i?r.slice(i):[];if(a.length===0)return;let o=cre(a);o&&e.setAttribute(ah,JSON.stringify(o));let s=ng(a);e.setAttribute(rh,JSON.stringify(s));let c=0,l=0,u=0;for(let t of a){let n=lre(t);c+=n.inputTokens,l+=n.outputTokens,u+=n.totalTokens,ure(e,t)}c>0&&e.setAttribute(Xm,c),l>0&&e.setAttribute(Zm,l),u>0&&e.setAttribute(Qm,u)}var lg=!1,ug=`__sentry_patched__`;function pre(e){let t={[I]:cg,[Fa]:`gen_ai.create_agent`,[$m]:`create_agent`};return e&&(t[oh]=e),{op:`gen_ai.create_agent`,name:e?`create_agent ${e}`:`create_agent`,attributes:t}}function mre(e,t){if(Object.prototype.hasOwnProperty.call(e,ug))return e;let n=og(t),r=new Proxy(e,{apply(e,r,i){return lg?Reflect.apply(e,r,i):oc(pre(),a=>{try{let o=Reflect.apply(e,r,i),s=i.length>0?i[0]:{};s?.name&&typeof s.name==`string`&&(a.setAttribute(oh,s.name),a.updateName(`create_agent ${s.name}`));let c=o.invoke;return c&&typeof c==`function`&&(o.invoke=dg(c.bind(o),o,s,t,void 0,n)),o}catch(e){throw a.setStatus({code:2,message:`internal_error`}),e}})}});return Object.defineProperty(r,ug,{value:!0,enumerable:!1}),r}function dg(e,t,n,r,i,a){return new Proxy(e,{apply(e,o,s){let c=i?.modelName??i?.model;return oc({op:`gen_ai.invoke_agent`,name:`invoke_agent`,attributes:{[I]:cg,[Fa]:Dte,[$m]:`invoke_agent`}},async i=>{try{let l=n?.name;l&&typeof l==`string`&&(i.setAttribute(wte,l),i.setAttribute(oh,l),i.updateName(`invoke_agent ${l}`)),c&&i.setAttribute(Lm,c);let u=(s.length>1?s[1]:void 0)?.configurable?.thread_id;if(u&&typeof u==`string`&&i.setAttribute(sh,u),a){let e=s[1]??{};s[1]=e,e.metadata={...e.metadata??{},__sentry_langgraph__:!0,...typeof l==`string`?{lc_agent_name:l}:{}},e.callbacks=ere(e.callbacks,a)}let d=dre(t);d&&i.setAttribute(ih,JSON.stringify(d));let f=r.recordInputs,p=r.recordOutputs,m=s.length>0?s[0]?.messages??[]:[];if(m&&f){let{systemInstructions:e,filteredMessages:t}=Ph(ng(m));e&&i.setAttribute(nh,e);let n=Ah(r.enableTruncation),a=Array.isArray(t)?t.length:0;i.setAttributes({[th]:n?Nh(t):Ii(t),[eh]:a})}let h=await Reflect.apply(e,o,s);return p&&fre(i,m??null,h),h}catch(e){throw i.setStatus({code:2,message:`internal_error`}),e}})}})}function hre(e,t){if(Object.prototype.hasOwnProperty.call(e,ug))return e;let n=kh(t),r=og(n),i=new Proxy(e,{apply(e,t,i){let a=are(i),o=ore(i),s=i[0];s&&Array.isArray(s.tools)&&s.tools.length>0&&sre(s.tools,n,o??void 0),lg=!0;let c;try{c=Reflect.apply(e,t,i)}finally{lg=!1}let l=c.invoke;if(l&&typeof l==`function`){let e={};o&&(e.name=o),c.invoke=dg(l.bind(c),c,e,n,a,r)}return c}});return Object.defineProperty(i,ug,{value:!0,enumerable:!1}),i}function fg(e,t){return e.compile=mre(e.compile,kh(t)),e}var gre=fg;function _re(e,t,n){let r=n.getOptions(),i=n.getDsn(),a=r.tunnel,o=Hs(r._metadata),s={sent_at:new Date(yi()).toISOString(),...vre(t)&&{trace:t},...o&&{sdk:o},...!!a&&i&&{dsn:yo(i)}},c=n.getDataCollectionOptions().userInfo?`auto`:`never`;return Os(s,[[{type:`span`,item_count:e.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...cu()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}]])}function vre(e){return!!e.trace_id&&!!e.public_key}function yre(e){let t=156;if(t+=e.name.length*2,t+=xa(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,r=100+(n?xa(n):0);t+=r*e.links.length}return t}var pg=1e3,bre=5e6,mg=class{constructor(e,t){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:i}=t??{};this._maxSpanLimit=n&&n>0&&n<=pg?n:pg,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=i&&i>0?i:bre,this._client.on(`flush`,()=>{this.drain()}),this._client.on(`close`,()=>{this._traceBuckets.forEach(e=>{clearTimeout(e.timeout)}),this._traceBuckets.clear()})}add(e){let t=e.trace_id,n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:zl(setTimeout(()=>{this.flush(t)},this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=yre(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(j&&N.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,t)=>{this.flush(t)}))}flush(e){let t=this._traceBuckets.get(e);if(!t)return;if(!t.spans.size){this._removeTrace(e);return}let n=Array.from(t.spans),r=n[0]?._segmentSpan;if(!r){j&&N.warn(`No segment span reference found on span JSON, cannot compute DSC`),this._removeTrace(e);return}let i=ws(r),a=n.map(e=>{let{_segmentSpan:t,...n}=e;return n}),o=_re(a,i,this._client);j&&N.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(o).then(null,e=>{j&&N.error(`Error while sending streamed span envelope:`,e)}),this._removeTrace(e)}_removeTrace(e){let t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}};function hg(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var gg=M;function _g(){return`history`in gg&&!!gg.history}function vg(){if(!(`fetch`in gg))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function yg(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function bg(){if(typeof EdgeRuntime==`string`)return!0;if(!vg())return!1;if(yg(gg.fetch))return!0;let e=!1,t=gg.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=yg(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){j&&N.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function xg(){return`ReportingObserver`in gg}function Sg(e,t){let n=`fetch`,r=Rr(n,e);return zr(n,()=>wg(void 0,t)),r}function Cg(e){let t=`fetch-body-resolved`,n=Rr(t,e);return zr(t,()=>wg(Eg)),n}function wg(e,t=!1){t&&!bg()||li(M,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=kg(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:Zi()*1e3,virtualError:r,headers:Ag(n)};return e||Br(`fetch`,{...o}),t.apply(M,n).then(async t=>(e?e(t):Br(`fetch`,{...o,endTimestamp:Zi()*1e3,response:t}),t),e=>{Br(`fetch`,{...o,endTimestamp:Zi()*1e3,error:e}),Jr(e)&&e.stack===void 0&&(e.stack=r.stack,ui(e,`framesToPop`,1));let t=F()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&Jr(e)&&e.name===`TypeError`&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:ui(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function Tg(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function Eg(e){let t;try{t=e.clone()}catch{return}Tg(t,()=>{Br(`fetch-body-resolved`,{endTimestamp:Zi()*1e3,response:e})})}function Dg(e,t){return ri(e)&&!!e[t]}function Og(e){return typeof e==`string`?e:e?Dg(e,`url`)?e.url:e.toString?e.toString():``:``}function kg(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:Og(t),method:Dg(n,`method`)?String(n.method).toUpperCase():ci(t)&&Dg(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:Og(t),method:Dg(t,`method`)?String(t.method).toUpperCase():`GET`}}function Ag(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(ci(t))return new Headers(t.headers)}catch{}}var jg=M;function Mg(){try{return jg.document.location.href}catch{return``}}function Ng(e,t=5){if(!jg.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var Pg=M,Fg=Pg.document,Ig=Pg.navigator,Lg=`Report a Bug`,Rg=`Cancel`,zg=`Send Bug Report`,Bg=`Confirm`,Vg=`Report a Bug`,Hg=`your.email@example.org`,Ug=`Email`,Wg=`What's the bug? What did you expect?`,Gg=`Description`,Kg=`Your Name`,qg=`Name`,Jg=`Thank you for your report!`,Yg=`(required)`,Xg=`Add a screenshot`,Zg=`Remove screenshot`,Qg=`Highlight`,$g=`Hide`,e_=`Remove`,t_=`Unable to submit feedback with empty message`,n_=`No client setup, cannot send feedback.`,r_=`Unable to determine if Feedback was correctly sent.`,i_=`Unable to send feedback. This could be because this domain is not in your list of allowed domains.`,a_=`Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.`,o_=`widget`,s_=`api`,c_=5e3,l_={ERROR_EMPTY_MESSAGE:t_,ERROR_NO_CLIENT:n_,ERROR_TIMEOUT:r_,ERROR_FORBIDDEN:i_,ERROR_GENERIC:a_};function u_(e,t){return t?.[e]??l_[e]}function d_(e,t){return Error(u_(e,t))}var f_=(e,t={includeReplay:!0})=>{let n=t.errorMessages;if(!e.message)throw d_(`ERROR_EMPTY_MESSAGE`,n);let r=F();if(!r)throw d_(`ERROR_NO_CLIENT`,n);e.tags&&Object.keys(e.tags).length&&P().setTags(e.tags);let i=sm({source:s_,url:Mg(),...e},t);return new Promise((e,t)=>{let a=setTimeout(()=>{o(),t(u_(`ERROR_TIMEOUT`,n))},3e4),o=r.on(`afterSendEvent`,(r,s)=>{if(r.event_id===i)return clearTimeout(a),o(),s?.statusCode&&s.statusCode>=200&&s.statusCode<300?e(i):s?.statusCode===403?t(u_(`ERROR_FORBIDDEN`,n)):t(u_(`ERROR_GENERIC`,n))})})},p_=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function m_(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Ig.userAgent)||/Macintosh/i.test(Ig.userAgent)&&Ig.maxTouchPoints&&Ig.maxTouchPoints>1||!isSecureContext)}function h_(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function g_(e){let t=Fg.createElement(`style`);return t.textContent=`
|
|
20
|
-
.widget__actor {
|
|
21
|
-
position: fixed;
|
|
22
|
-
z-index: var(--z-index);
|
|
23
|
-
margin: var(--page-margin);
|
|
24
|
-
inset: var(--actor-inset);
|
|
25
|
-
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
gap: 8px;
|
|
29
|
-
padding: 16px;
|
|
30
|
-
|
|
31
|
-
font-family: inherit;
|
|
32
|
-
font-size: var(--font-size);
|
|
33
|
-
font-weight: 600;
|
|
34
|
-
line-height: 1.14em;
|
|
35
|
-
text-decoration: none;
|
|
36
|
-
|
|
37
|
-
background: var(--actor-background, var(--background));
|
|
38
|
-
border-radius: var(--actor-border-radius, 1.7em/50%);
|
|
39
|
-
border: var(--actor-border, var(--border));
|
|
40
|
-
box-shadow: var(--actor-box-shadow, var(--box-shadow));
|
|
41
|
-
color: var(--actor-color, var(--foreground));
|
|
42
|
-
fill: var(--actor-color, var(--foreground));
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
opacity: 1;
|
|
45
|
-
transition: transform 0.2s ease-in-out;
|
|
46
|
-
transform: translate(0, 0) scale(1);
|
|
47
|
-
}
|
|
48
|
-
.widget__actor[aria-hidden="true"] {
|
|
49
|
-
opacity: 0;
|
|
50
|
-
pointer-events: none;
|
|
51
|
-
visibility: hidden;
|
|
52
|
-
transform: translate(0, 16px) scale(0.98);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.widget__actor:hover {
|
|
56
|
-
background: var(--actor-hover-background, var(--background));
|
|
57
|
-
filter: var(--interactive-filter);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.widget__actor svg {
|
|
61
|
-
width: 1.14em;
|
|
62
|
-
height: 1.14em;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@media (max-width: 600px) {
|
|
66
|
-
.widget__actor span {
|
|
67
|
-
display: none;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
`,e&&t.setAttribute(`nonce`,e),t}function __(e,t){return Object.entries(t).forEach(([t,n])=>{e.setAttributeNS(null,t,n)}),e}var v_=20,y_=`http://www.w3.org/2000/svg`;function b_(){let e=e=>Pg.document.createElementNS(y_,e),t=__(e(`svg`),{width:`${v_}`,height:`${v_}`,viewBox:`0 0 ${v_} ${v_}`,fill:`var(--actor-color, var(--foreground))`}),n=__(e(`g`),{clipPath:`url(#clip0_57_80)`}),r=__(e(`path`),{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z`});t.appendChild(n).appendChild(r);let i=e(`defs`),a=__(e(`clipPath`),{id:`clip0_57_80`}),o=__(e(`rect`),{width:`${v_}`,height:`${v_}`,fill:`white`});return a.appendChild(o),i.appendChild(a),t.appendChild(i).appendChild(a).appendChild(o),t}function x_({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){let i=Fg.createElement(`button`);if(i.type=`button`,i.className=`widget__actor`,i.ariaHidden=`false`,i.ariaLabel=t||e||Lg,i.appendChild(b_()),e){let t=Fg.createElement(`span`);t.appendChild(Fg.createTextNode(e)),i.appendChild(t)}let a=g_(r);return{el:i,appendToDom(){n.appendChild(a),n.appendChild(i)},removeFromDom(){i.remove(),a.remove()},show(){i.ariaHidden=`false`},hide(){i.ariaHidden=`true`}}}var S_=`rgba(88, 74, 192, 1)`,C_={foreground:`#2b2233`,background:`#ffffff`,accentForeground:`white`,accentBackground:S_,successColor:`#268d75`,errorColor:`#df3338`,border:`1.5px solid rgba(41, 35, 47, 0.13)`,boxShadow:`0px 4px 24px 0px rgba(43, 34, 51, 0.12)`,outline:`1px auto var(--accent-background)`,interactiveFilter:`brightness(95%)`},w_={foreground:`#ebe6ef`,background:`#29232f`,accentForeground:`white`,accentBackground:S_,successColor:`#2da98c`,errorColor:`#f55459`,border:`1.5px solid rgba(235, 230, 239, 0.15)`,boxShadow:`0px 4px 24px 0px rgba(43, 34, 51, 0.12)`,outline:`1px auto var(--accent-background)`,interactiveFilter:`brightness(150%)`};function T_(e){return`
|
|
71
|
-
--foreground: ${e.foreground};
|
|
72
|
-
--background: ${e.background};
|
|
73
|
-
--accent-foreground: ${e.accentForeground};
|
|
74
|
-
--accent-background: ${e.accentBackground};
|
|
75
|
-
--success-color: ${e.successColor};
|
|
76
|
-
--error-color: ${e.errorColor};
|
|
77
|
-
--border: ${e.border};
|
|
78
|
-
--box-shadow: ${e.boxShadow};
|
|
79
|
-
--outline: ${e.outline};
|
|
80
|
-
--interactive-filter: ${e.interactiveFilter};
|
|
81
|
-
`}function E_({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){let i=Fg.createElement(`style`);return i.textContent=`
|
|
82
|
-
:host {
|
|
83
|
-
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
|
|
84
|
-
--font-size: 14px;
|
|
85
|
-
--z-index: 100000;
|
|
86
|
-
|
|
87
|
-
--page-margin: 16px;
|
|
88
|
-
--inset: auto 0 0 auto;
|
|
89
|
-
--actor-inset: var(--inset);
|
|
90
|
-
|
|
91
|
-
font-family: var(--font-family);
|
|
92
|
-
font-size: var(--font-size);
|
|
93
|
-
|
|
94
|
-
${e===`system`?``:`color-scheme: only ${e};`}
|
|
95
|
-
|
|
96
|
-
${T_(e===`dark`?{...w_,...t}:{...C_,...n})}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
${e===`system`?`
|
|
100
|
-
@media (prefers-color-scheme: dark) {
|
|
101
|
-
:host {
|
|
102
|
-
color-scheme: only dark;
|
|
103
|
-
|
|
104
|
-
${T_({...w_,...t})}
|
|
105
|
-
}
|
|
106
|
-
}`:``}
|
|
107
|
-
`,r&&i.setAttribute(`nonce`,r),i}var D_=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:r=`sentry-feedback`,autoInject:i=!0,showBranding:a=!0,isEmailRequired:o=!1,isNameRequired:s=!1,showEmail:c=!0,showName:l=!0,enableScreenshot:u=!0,useSentryUser:d={email:`email`,name:`username`},tags:f,styleNonce:p,scriptNonce:m,colorScheme:h=`system`,themeLight:g={},themeDark:_={},addScreenshotButtonLabel:v=Xg,cancelButtonLabel:y=Rg,confirmButtonLabel:b=Bg,emailLabel:x=Ug,emailPlaceholder:S=Hg,formTitle:C=Vg,isRequiredLabel:w=Yg,messageLabel:T=Gg,messagePlaceholder:ee=Wg,nameLabel:E=qg,namePlaceholder:te=Kg,removeScreenshotButtonLabel:ne=Zg,submitButtonLabel:re=zg,successMessageText:ie=Jg,triggerLabel:ae=Lg,triggerAriaLabel:oe=``,highlightToolText:D=Qg,hideToolText:se=$g,removeHighlightText:ce=e_,errorEmptyMessageText:le=t_,errorNoClientText:ue=n_,errorTimeoutText:de=r_,errorForbiddenText:fe=i_,errorGenericText:pe=a_,onFormOpen:me,onFormClose:he,onSubmitSuccess:ge,onSubmitError:_e,onFormSubmitted:ve}={})=>{let O={id:r,autoInject:i,showBranding:a,isEmailRequired:o,isNameRequired:s,showEmail:c,showName:l,enableScreenshot:u,useSentryUser:d,tags:f,styleNonce:p,scriptNonce:m,colorScheme:h,themeDark:_,themeLight:g,triggerLabel:ae,triggerAriaLabel:oe,cancelButtonLabel:y,submitButtonLabel:re,confirmButtonLabel:b,formTitle:C,emailLabel:x,emailPlaceholder:S,messageLabel:T,messagePlaceholder:ee,nameLabel:E,namePlaceholder:te,successMessageText:ie,isRequiredLabel:w,addScreenshotButtonLabel:v,removeScreenshotButtonLabel:ne,highlightToolText:D,hideToolText:se,removeHighlightText:ce,errorEmptyMessageText:le,errorNoClientText:ue,errorTimeoutText:de,errorForbiddenText:fe,errorGenericText:pe,onFormClose:he,onFormOpen:me,onSubmitError:_e,onSubmitSuccess:ge,onFormSubmitted:ve},ye=null,be=null,k=[],xe=e=>{if(!ye){let t=Fg.createElement(`div`);t.id=String(e.id),Fg.body.appendChild(t),ye=t.attachShadow({mode:`open`}),be=E_(e),ye.appendChild(be)}return ye},Se=async r=>{let i=r.enableScreenshot&&m_(),a,o;try{a=(t?t():await e(`feedbackModalIntegration`,m))(),Zl(a)}catch{throw p_&&N.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),Error(`[Feedback] Missing feedback modal integration!`)}try{let t=i?n?n():await e(`feedbackScreenshotIntegration`,m):void 0;t&&(o=t(),Zl(o))}catch{p_&&N.error(`[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.`)}let s={ERROR_EMPTY_MESSAGE:r.errorEmptyMessageText,ERROR_NO_CLIENT:r.errorNoClientText,ERROR_TIMEOUT:r.errorTimeoutText,ERROR_FORBIDDEN:r.errorForbiddenText,ERROR_GENERIC:r.errorGenericText},c=(e,t)=>f_(e,{includeReplay:!0,...t,errorMessages:s}),l=a.createDialog({options:{...r,onFormClose:()=>{l?.close(),r.onFormClose?.()},onFormSubmitted:()=>{l?.close(),r.onFormSubmitted?.()}},screenshotIntegration:o,sendFeedback:c,shadow:xe(r)});return l},Ce=(e,t={})=>{let n=h_(O,t),r=typeof e==`string`?Fg.querySelector(e):typeof e.addEventListener==`function`?e:null;if(!r)throw p_&&N.error(`[Feedback] Unable to attach to target element`),Error(`Unable to attach to target element`);let i=null,a=async()=>{i||=await Se({...n,onFormSubmitted:()=>{i?.removeFromDom(),n.onFormSubmitted?.()}}),i.appendToDom(),i.open()};r.addEventListener(`click`,a);let o=()=>{k=k.filter(e=>e!==o),i?.removeFromDom(),i=null,r.removeEventListener(`click`,a)};return k.push(o),o},we=(e={})=>{let t=h_(O,e),n=xe(t),r=x_({triggerLabel:t.triggerLabel,triggerAriaLabel:t.triggerAriaLabel,shadow:n,styleNonce:p});return Ce(r.el,{...t,onFormOpen(){r.hide()},onFormClose(){r.show()},onFormSubmitted(){r.show()}}),r};return{name:`Feedback`,setupOnce(){!cu()||!O.autoInject||(Fg.readyState===`loading`?Fg.addEventListener(`DOMContentLoaded`,()=>we().appendToDom()):we().appendToDom())},attachTo:Ce,createWidget(e={}){let t=we(h_(O,e));return t.appendToDom(),t},async createForm(e={}){return Se(h_(O,e))},setTheme(e){if(O.colorScheme=e,ye){let e=E_(O);be?ye.replaceChild(e,be):ye.prepend(e),be=e}},remove(){ye&&(ye.parentElement?.remove(),ye=null,be=null),k.forEach(e=>e()),k=[]}}});function O_(){return F()?.getIntegrationByName(`Feedback`)}var k_,A_,j_,M_,N_,P_,F_,I_={},L_=[],R_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,z_=Array.isArray;function B_(e,t){for(var n in t)e[n]=t[n];return e}function V_(e){var t=e.parentNode;t&&t.removeChild(e)}function H_(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?k_.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return U_(e,o,r,i,null)}function U_(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++j_,__i:-1,__u:0};return i==null&&A_.vnode!=null&&A_.vnode(a),a}function W_(e){return e.children}function G_(e,t){this.props=e,this.context=t}function K_(e,t){if(t==null)return e.__?K_(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?K_(e):null}function q_(e,t,n){var r,i=e.__v,a=i.__e,o=e.__P;if(o)return(r=B_({},i)).__v=i.__v+1,A_.vnode&&A_.vnode(r),av(o,r,i,e.__n,o.ownerSVGElement!==void 0,32&i.__u?[a]:null,t,a??K_(i),!!(32&i.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=a&&J_(r),r}function J_(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return J_(e)}}function Y_(e){(!e.__d&&(e.__d=!0)&&M_.push(e)&&!X_.__r++||N_!==A_.debounceRendering)&&((N_=A_.debounceRendering)||P_)(X_)}function X_(){var e,t,n,r=[],i=[];for(M_.sort(F_);e=M_.shift();)e.__d&&(n=M_.length,t=q_(e,r,i)||t,n===0||M_.length>n?(ov(r,t,i),i.length=r.length=0,t=void 0,M_.sort(F_)):t&&A_.__c&&A_.__c(t,L_));t&&ov(r,t,i),X_.__r=0}function Z_(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g=r&&r.__k||L_,_=t.length;for(n.__d=c,Q_(n,t,g),c=n.__d,d=0;d<_;d++)(p=n.__k[d])!=null&&typeof p!=`boolean`&&typeof p!=`function`&&(f=p.__i===-1?I_:g[p.__i]||I_,p.__i=d,av(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&cv(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),65536&p.__u||f.__k===p.__k?c=$_(p,c,e):typeof p.type==`function`&&p.__d!==void 0?c=p.__d:m&&(c=m.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=h}function Q_(e,t,n){var r,i,a,o,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)(i=e.__k[r]=(i=t[r])==null||typeof i==`boolean`||typeof i==`function`?null:typeof i==`string`||typeof i==`number`||typeof i==`bigint`||i.constructor==String?U_(null,i,null,null,i):z_(i)?U_(W_,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?U_(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)==null?(a=n[r])&&a.key==null&&a.__e&&(a.__e==e.__d&&(e.__d=K_(a)),lv(a,a,!1),n[r]=null,u--):(i.__=e,i.__b=e.__b+1,s=ev(i,n,o=r+d,u),i.__i=s,a=null,s!==-1&&(u--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!=`function`&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?u>c-o?d+=s-o:d--:d=s<o&&s==o-1?s-o:0,s!==r+d&&(i.__u|=65536)));if(u)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=K_(a)),lv(a,a))}function $_(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=$_(r[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType===8);return t}function ev(e,t,n,r){var i=e.key,a=e.type,o=n-1,s=n+1,c=t[n];if(c===null||c&&i==c.key&&a===c.type)return n;if(r>+(c!=null&&!(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return-1}function tv(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||R_.test(t)?n:n+`px`}function nv(e,t,n,r,i){var a;n:if(t===`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||tv(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||tv(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,`$1`)),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?iv:rv,a)):e.removeEventListener(t,a?iv:rv,a);else{if(i)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!==`width`&&t!==`height`&&t!==`href`&&t!==`list`&&t!==`form`&&t!==`tabIndex`&&t!==`download`&&t!==`rowSpan`&&t!==`colSpan`&&t!==`role`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!==`-`?e.removeAttribute(t):e.setAttribute(t,n))}}function rv(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(A_.event?A_.event(e):e)}}function iv(e){if(this.l)return this.l[e.type+!0](A_.event?A_.event(e):e)}function av(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=A_.__b)&&u(t);n:if(typeof T==`function`)try{if(_=t.props,v=(u=T.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(`prototype`in T&&T.prototype.render?t.__c=d=new T(_,y):(t.__c=d=new G_(_,y),d.constructor=T,d.render=uv),v&&v.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),d.__s??(d.__s=d.state),T.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=B_({},d.__s)),B_(d.__s,T.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)T.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(T.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,y),!d.__e&&(d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break n}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,y),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,h)})}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,x=A_.__r,S=0,`prototype`in T&&T.prototype.render){for(d.state=d.__s,d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=B_(B_({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(h=d.getSnapshotBeforeUpdate(p,m)),Z_(e,z_(w=u!=null&&u.type===W_&&u.key==null?u.props.children:u)?w:[w],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,c||a!=null?(t.__e=s,t.__u|=c?160:32,a[a.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),A_.__e(e,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=sv(n.__e,t,n,r,i,a,o,c,l);(u=A_.diffed)&&u(t)}function ov(e,t,n){for(var r=0;r<n.length;r++)cv(n[r],n[++r],n[++r]);A_.__c&&A_.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){A_.__e(e,t.__v)}})}function sv(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props,_=t.props,v=t.type;if(v===`svg`&&(i=!0),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName===v:p.nodeType===3)){e=p,a[l]=null;break}}if(e==null){if(v===null)return document.createTextNode(_);e=i?document.createElementNS(`http://www.w3.org/2000/svg`,v):document.createElement(v,_.is&&_),a=null,s=!1}if(v===null)g===_||s&&e.data===_||(e.data=_);else{if(a&&=k_.call(e.childNodes),g=n.props||I_,!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`children`||(l==`dangerouslySetInnerHTML`?d=p:l===`key`||l in _||nv(e,l,null,p,i));for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:l===`key`||s&&typeof p!=`function`||g[l]===p||nv(e,l,p,g[l],i);if(u)s||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),Z_(e,z_(f)?f:[f],t,n,r,i&&v!==`foreignObject`,a,o,a?a[0]:n.__k&&K_(n,0),s,c),a!=null)for(l=a.length;l--;)a[l]!=null&&V_(a[l]);s||(l=`value`,m!==void 0&&(m!==e[l]||v===`progress`&&!m||v===`option`&&m!==g[l])&&nv(e,l,m,g[l],!1),l=`checked`,h!==void 0&&h!==e[l]&&nv(e,l,h,g[l],!1))}return e}function cv(e,t,n){try{typeof e==`function`?e(t):e.current=t}catch(e){A_.__e(e,n)}}function lv(e,t,n){var r,i;if(A_.unmount&&A_.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||cv(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){A_.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&lv(r[i],t,n||typeof e.type!=`function`);n||e.__e==null||V_(e.__e),e.__=e.__e=e.__d=void 0}function uv(e,t,n){return this.constructor(e,n)}function dv(e,t,n){var r,i,a,o;A_.__&&A_.__(e,t),i=(r=!1)?null:t.__k,a=[],o=[],av(t,e=t.__k=H_(W_,null,[e]),i||I_,I_,t.ownerSVGElement!==void 0,i?null:t.firstChild?k_.call(t.childNodes):null,a,i?i.__e:t.firstChild,r,o),e.__d=void 0,ov(a,e,o)}k_=L_.slice,A_={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},j_=0,G_.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=B_({},this.state);typeof e==`function`&&(e=e(B_({},n),this.props)),e&&B_(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Y_(this))},G_.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Y_(this))},G_.prototype.render=W_,M_=[],P_=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,F_=function(e,t){return e.__v.__b-t.__v.__b},X_.__r=0;var fv,pv,mv,hv,gv=0,_v=[],vv=[],yv=A_,bv=yv.__b,xv=yv.__r,Sv=yv.diffed,Cv=yv.__c,wv=yv.unmount,Tv=yv.__;function Ev(e,t){yv.__h&&yv.__h(pv,e,gv||t),gv=0;var n=pv.__H||(pv.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:vv}),n.__[e]}function Dv(e){return gv=1,Ov(Gv,e)}function Ov(e,t,n){var r=Ev(fv++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Gv(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=pv,!pv.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&r.__c.props===e)&&(!a||a.call(this,e,t,n))};pv.u=!0;var a=pv.shouldComponentUpdate,o=pv.componentWillUpdate;pv.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},pv.shouldComponentUpdate=i}return r.__N||r.__}function kv(e,t){var n=Ev(fv++,3);!yv.__s&&Wv(n.__H,t)&&(n.__=e,n.i=t,pv.__H.__h.push(n))}function Av(e,t){var n=Ev(fv++,4);!yv.__s&&Wv(n.__H,t)&&(n.__=e,n.i=t,pv.__h.push(n))}function jv(e){return gv=5,Nv(function(){return{current:e}},[])}function Mv(e,t,n){gv=6,Av(function(){return typeof e==`function`?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function Nv(e,t){var n=Ev(fv++,7);return Wv(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Pv(e,t){return gv=8,Nv(function(){return e},t)}function Fv(e){var t=pv.context[e.__c],n=Ev(fv++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(pv)),t.props.value):e.__}function Iv(e,t){yv.useDebugValue&&yv.useDebugValue(t?t(e):e)}function Lv(e){var t=Ev(fv++,10),n=Dv();return t.__=e,pv.componentDidCatch||(pv.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function Rv(){var e=Ev(fv++,11);if(!e.__){for(var t=pv.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__=`P`+n[0]+`-`+n[1]++}return e.__}function zv(){for(var e;e=_v.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Hv),e.__H.__h.forEach(Uv),e.__H.__h=[]}catch(t){e.__H.__h=[],yv.__e(t,e.__v)}}yv.__b=function(e){pv=null,bv&&bv(e)},yv.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Tv&&Tv(e,t)},yv.__r=function(e){xv&&xv(e),fv=0;var t=(pv=e.__c).__H;t&&(mv===pv?(t.__h=[],pv.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=vv,e.__N=e.i=void 0})):(t.__h.forEach(Hv),t.__h.forEach(Uv),t.__h=[],fv=0)),mv=pv},yv.diffed=function(e){Sv&&Sv(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(_v.push(t)!==1&&hv===yv.requestAnimationFrame||((hv=yv.requestAnimationFrame)||Vv)(zv)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==vv&&(e.__=e.__V),e.i=void 0,e.__V=vv})),mv=pv=null},yv.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Hv),e.__h=e.__h.filter(function(e){return!e.__||Uv(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],yv.__e(n,e.__v)}}),Cv&&Cv(e,t)},yv.unmount=function(e){wv&&wv(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Hv(e)}catch(e){t=e}}),n.__H=void 0,t&&yv.__e(t,n.__v))};var Bv=typeof requestAnimationFrame==`function`;function Vv(e){var t,n=function(){clearTimeout(r),Bv&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Bv&&(t=requestAnimationFrame(n))}function Hv(e){var t=pv,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),pv=t}function Uv(e){var t=pv;e.__c=e.__(),pv=t}function Wv(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Gv(e,t){return typeof t==`function`?t(e):t}var Kv=Object.defineProperty({__proto__:null,useCallback:Pv,useContext:Fv,useDebugValue:Iv,useEffect:kv,useErrorBoundary:Lv,useId:Rv,useImperativeHandle:Mv,useLayoutEffect:Av,useMemo:Nv,useReducer:Ov,useRef:jv,useState:Dv},Symbol.toStringTag,{value:`Module`}),qv=`http://www.w3.org/2000/svg`;function Jv(){let e=e=>Fg.createElementNS(qv,e),t=__(e(`svg`),{width:`32`,height:`30`,viewBox:`0 0 72 66`,fill:`inherit`}),n=__(e(`path`),{transform:`translate(11, 11)`,d:`M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z`});return t.appendChild(n),t}function Yv({options:e}){let t=Nv(()=>({__html:Jv().outerHTML}),[]);return H_(`h2`,{class:`dialog__header`},H_(`span`,{class:`dialog__title`},e.formTitle),e.showBranding?H_(`a`,{class:`brand-link`,target:`_blank`,href:`https://sentry.io/welcome/`,title:`Powered by Sentry`,rel:`noopener noreferrer`,dangerouslySetInnerHTML:t}):null)}function Xv(e,t){let n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function Zv(e,t){let n=e.get(t);return typeof n==`string`?n.trim():``}function Qv({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:i,onSubmitSuccess:a,onSubmitError:o,showEmail:s,showName:c,screenshotInput:l}){let{tags:u,addScreenshotButtonLabel:d,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:m,emailPlaceholder:h,isEmailRequired:g,isNameRequired:_,messageLabel:v,messagePlaceholder:y,nameLabel:b,namePlaceholder:x,submitButtonLabel:S,isRequiredLabel:C}=e,[w,T]=Dv(!1),[ee,E]=Dv(null),[te,ne]=Dv(!1),re=l?.input,[ie,ae]=Dv(null),oe=Pv(e=>{ae(e),ne(!1)},[]),D=Pv(e=>{let t=Xv(e,{emailLabel:m,isEmailRequired:g,isNameRequired:_,messageLabel:v,nameLabel:b});return t.length>0?E(`Please enter in the following required fields: ${t.join(`, `)}`):E(null),t.length===0},[m,g,_,v,b]);return H_(`form`,{class:`form`,onSubmit:Pv(async e=>{T(!0);try{if(e.preventDefault(),!(e.target instanceof HTMLFormElement))return;let t=new FormData(e.target),n=await(l&&te?l.value():void 0),r={name:Zv(t,`name`),email:Zv(t,`email`),message:Zv(t,`message`),attachments:n?[n]:void 0};if(!D(r))return;try{a(r,await i({name:r.name,email:r.email,message:r.message,source:o_,tags:u},{attachments:r.attachments}))}catch(e){p_&&N.error(e);let t=e instanceof Error?e:Error(String(e));E(t.message),o(t)}}finally{T(!1)}},[l&&te,a,o])},re&&te?H_(re,{onError:oe}):null,H_(`fieldset`,{class:`form__right`,"data-sentry-feedback":!0,disabled:w},H_(`div`,{class:`form__top`},ee?H_(`div`,{class:`form__error-container`},ee):null,c?H_(`label`,{for:`name`,class:`form__label`},H_($v,{label:b,isRequiredLabel:C,isRequired:_}),H_(`input`,{class:`form__input`,defaultValue:n,id:`name`,name:`name`,placeholder:x,required:_,type:`text`})):H_(`input`,{"aria-hidden":!0,value:n,name:`name`,type:`hidden`}),s?H_(`label`,{for:`email`,class:`form__label`},H_($v,{label:m,isRequiredLabel:C,isRequired:g}),H_(`input`,{class:`form__input`,defaultValue:t,id:`email`,name:`email`,placeholder:h,required:g,type:`email`})):H_(`input`,{"aria-hidden":!0,value:t,name:`email`,type:`hidden`}),H_(`label`,{for:`message`,class:`form__label`},H_($v,{label:v,isRequiredLabel:C,isRequired:!0}),H_(`textarea`,{autoFocus:!0,class:`form__input form__input--textarea`,id:`message`,name:`message`,placeholder:y,required:!0,rows:5})),re?H_(`label`,{for:`screenshot`,class:`form__label`},H_(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:()=>{ae(null),ne(e=>!e)}},te?f:d),ie?H_(`div`,{class:`form__error-container`},ie.message):null):null),H_(`div`,{class:`btn-group`},H_(`button`,{class:`btn btn--primary`,disabled:w,type:`submit`},S),H_(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:r},p))))}function $v({label:e,isRequired:t,isRequiredLabel:n}){return H_(`span`,{class:`form__label__text`},e,t&&H_(`span`,{class:`form__label__text--required`},n))}var ey=16,ty=17,ny=`http://www.w3.org/2000/svg`;function ry(){let e=e=>Pg.document.createElementNS(ny,e),t=__(e(`svg`),{width:`${ey}`,height:`${ty}`,viewBox:`0 0 ${ey} ${ty}`,fill:`inherit`}),n=__(e(`g`),{clipPath:`url(#clip0_57_156)`}),r=__(e(`path`),{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z`}),i=__(e(`path`),{d:`M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z`});t.appendChild(n).append(i,r);let a=e(`defs`),o=__(e(`clipPath`),{id:`clip0_57_156`}),s=__(e(`rect`),{width:`${ey}`,height:`${ey}`,fill:`white`,transform:`translate(0 0.5)`});return o.appendChild(s),a.appendChild(o),t.appendChild(a).appendChild(o).appendChild(s),t}function iy({open:e,onFormSubmitted:t,...n}){let r=n.options,i=Nv(()=>({__html:ry().outerHTML}),[]),[a,o]=Dv(null),s=Pv(()=>{a&&(clearTimeout(a),o(null)),t()},[a]),c=Pv((e,r)=>{n.onSubmitSuccess(e,r),o(setTimeout(()=>{t(),o(null)},c_))},[t]);return H_(W_,null,a?H_(`div`,{class:`success__position`,onClick:s},H_(`div`,{class:`success__content`},r.successMessageText,H_(`span`,{class:`success__icon`,dangerouslySetInnerHTML:i}))):H_(`dialog`,{class:`dialog`,onClick:r.onFormClose,open:e},H_(`div`,{class:`dialog__position`},H_(`div`,{class:`dialog__content`,onClick:e=>{e.stopPropagation()}},H_(Yv,{options:r}),H_(Qv,{...n,onSubmitSuccess:c})))))}var ay=`
|
|
108
|
-
.dialog {
|
|
109
|
-
position: fixed;
|
|
110
|
-
z-index: var(--z-index);
|
|
111
|
-
margin: 0;
|
|
112
|
-
inset: 0;
|
|
113
|
-
|
|
114
|
-
display: flex;
|
|
115
|
-
align-items: center;
|
|
116
|
-
justify-content: center;
|
|
117
|
-
padding: 0;
|
|
118
|
-
height: 100vh;
|
|
119
|
-
width: 100vw;
|
|
120
|
-
|
|
121
|
-
color: var(--dialog-color, var(--foreground));
|
|
122
|
-
fill: var(--dialog-color, var(--foreground));
|
|
123
|
-
line-height: 1.75em;
|
|
124
|
-
|
|
125
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
126
|
-
border: none;
|
|
127
|
-
inset: 0;
|
|
128
|
-
opacity: 1;
|
|
129
|
-
transition: opacity 0.2s ease-in-out;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.dialog__position {
|
|
133
|
-
position: fixed;
|
|
134
|
-
z-index: var(--z-index);
|
|
135
|
-
inset: var(--dialog-inset);
|
|
136
|
-
padding: var(--page-margin);
|
|
137
|
-
display: flex;
|
|
138
|
-
max-height: calc(100vh - (2 * var(--page-margin)));
|
|
139
|
-
}
|
|
140
|
-
@media (max-width: 600px) {
|
|
141
|
-
.dialog__position {
|
|
142
|
-
inset: var(--page-margin);
|
|
143
|
-
padding: 0;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.dialog__position:has(.editor) {
|
|
148
|
-
inset: var(--page-margin);
|
|
149
|
-
padding: 0;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.dialog:not([open]) {
|
|
153
|
-
opacity: 0;
|
|
154
|
-
pointer-events: none;
|
|
155
|
-
visibility: hidden;
|
|
156
|
-
}
|
|
157
|
-
.dialog:not([open]) .dialog__content {
|
|
158
|
-
transform: translate(0, -16px) scale(0.98);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.dialog__content {
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: column;
|
|
164
|
-
gap: 16px;
|
|
165
|
-
padding: var(--dialog-padding, 24px);
|
|
166
|
-
max-width: 100%;
|
|
167
|
-
width: 100%;
|
|
168
|
-
max-height: 100%;
|
|
169
|
-
overflow: auto;
|
|
170
|
-
|
|
171
|
-
background: var(--dialog-background, var(--background));
|
|
172
|
-
border-radius: var(--dialog-border-radius, 20px);
|
|
173
|
-
border: var(--dialog-border, var(--border));
|
|
174
|
-
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
|
|
175
|
-
transform: translate(0, 0) scale(1);
|
|
176
|
-
transition: transform 0.2s ease-in-out;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
`,oy=`
|
|
180
|
-
.dialog__header {
|
|
181
|
-
display: flex;
|
|
182
|
-
gap: 4px;
|
|
183
|
-
justify-content: space-between;
|
|
184
|
-
font-weight: var(--dialog-header-weight, 600);
|
|
185
|
-
margin: 0;
|
|
186
|
-
}
|
|
187
|
-
.dialog__title {
|
|
188
|
-
align-self: center;
|
|
189
|
-
width: var(--form-width, 272px);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
@media (max-width: 600px) {
|
|
193
|
-
.dialog__title {
|
|
194
|
-
width: auto;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.dialog__position:has(.editor) .dialog__title {
|
|
199
|
-
width: auto;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
.brand-link {
|
|
204
|
-
display: inline-flex;
|
|
205
|
-
}
|
|
206
|
-
.brand-link:focus-visible {
|
|
207
|
-
outline: var(--outline);
|
|
208
|
-
}
|
|
209
|
-
`,sy=`
|
|
210
|
-
.form {
|
|
211
|
-
display: flex;
|
|
212
|
-
overflow: auto;
|
|
213
|
-
flex-direction: row;
|
|
214
|
-
gap: 16px;
|
|
215
|
-
flex: 1 0;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.form fieldset {
|
|
219
|
-
border: none;
|
|
220
|
-
margin: 0;
|
|
221
|
-
padding: 0;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.form__right {
|
|
225
|
-
flex: 0 0 auto;
|
|
226
|
-
display: flex;
|
|
227
|
-
overflow: auto;
|
|
228
|
-
flex-direction: column;
|
|
229
|
-
justify-content: space-between;
|
|
230
|
-
gap: 20px;
|
|
231
|
-
width: var(--form-width, 100%);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.dialog__position:has(.editor) .form__right {
|
|
235
|
-
width: var(--form-width, 272px);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.form__top {
|
|
239
|
-
display: flex;
|
|
240
|
-
flex-direction: column;
|
|
241
|
-
gap: 8px;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.form__error-container {
|
|
245
|
-
color: var(--error-color);
|
|
246
|
-
fill: var(--error-color);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.form__label {
|
|
250
|
-
display: flex;
|
|
251
|
-
flex-direction: column;
|
|
252
|
-
gap: 4px;
|
|
253
|
-
margin: 0px;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.form__label__text {
|
|
257
|
-
display: flex;
|
|
258
|
-
gap: 4px;
|
|
259
|
-
align-items: center;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.form__label__text--required {
|
|
263
|
-
font-size: 0.85em;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.form__input {
|
|
267
|
-
font-family: inherit;
|
|
268
|
-
line-height: inherit;
|
|
269
|
-
background: transparent;
|
|
270
|
-
box-sizing: border-box;
|
|
271
|
-
border: var(--input-border, var(--border));
|
|
272
|
-
border-radius: var(--input-border-radius, 6px);
|
|
273
|
-
color: var(--input-color, inherit);
|
|
274
|
-
fill: var(--input-color, inherit);
|
|
275
|
-
font-size: var(--input-font-size, inherit);
|
|
276
|
-
font-weight: var(--input-font-weight, 500);
|
|
277
|
-
padding: 6px 12px;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.form__input::placeholder {
|
|
281
|
-
opacity: 0.65;
|
|
282
|
-
color: var(--input-placeholder-color, inherit);
|
|
283
|
-
filter: var(--interactive-filter);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.form__input:focus-visible {
|
|
287
|
-
outline: var(--input-focus-outline, var(--outline));
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.form__input--textarea {
|
|
291
|
-
font-family: inherit;
|
|
292
|
-
resize: vertical;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.error {
|
|
296
|
-
color: var(--error-color);
|
|
297
|
-
fill: var(--error-color);
|
|
298
|
-
}
|
|
299
|
-
`,cy=`
|
|
300
|
-
.btn-group {
|
|
301
|
-
display: grid;
|
|
302
|
-
gap: 8px;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.btn {
|
|
306
|
-
line-height: inherit;
|
|
307
|
-
border: var(--button-border, var(--border));
|
|
308
|
-
border-radius: var(--button-border-radius, 6px);
|
|
309
|
-
cursor: pointer;
|
|
310
|
-
font-family: inherit;
|
|
311
|
-
font-size: var(--button-font-size, inherit);
|
|
312
|
-
font-weight: var(--button-font-weight, 600);
|
|
313
|
-
padding: var(--button-padding, 6px 16px);
|
|
314
|
-
}
|
|
315
|
-
.btn[disabled] {
|
|
316
|
-
opacity: 0.6;
|
|
317
|
-
pointer-events: none;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.btn--primary {
|
|
321
|
-
color: var(--button-primary-color, var(--accent-foreground));
|
|
322
|
-
fill: var(--button-primary-color, var(--accent-foreground));
|
|
323
|
-
background: var(--button-primary-background, var(--accent-background));
|
|
324
|
-
border: var(--button-primary-border, var(--border));
|
|
325
|
-
border-radius: var(--button-primary-border-radius, 6px);
|
|
326
|
-
font-weight: var(--button-primary-font-weight, 500);
|
|
327
|
-
}
|
|
328
|
-
.btn--primary:hover {
|
|
329
|
-
color: var(--button-primary-hover-color, var(--accent-foreground));
|
|
330
|
-
fill: var(--button-primary-hover-color, var(--accent-foreground));
|
|
331
|
-
background: var(--button-primary-hover-background, var(--accent-background));
|
|
332
|
-
filter: var(--interactive-filter);
|
|
333
|
-
}
|
|
334
|
-
.btn--primary:focus-visible {
|
|
335
|
-
background: var(--button-primary-hover-background, var(--accent-background));
|
|
336
|
-
filter: var(--interactive-filter);
|
|
337
|
-
outline: var(--button-primary-focus-outline, var(--outline));
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.btn--default {
|
|
341
|
-
color: var(--button-color, var(--foreground));
|
|
342
|
-
fill: var(--button-color, var(--foreground));
|
|
343
|
-
background: var(--button-background, var(--background));
|
|
344
|
-
border: var(--button-border, var(--border));
|
|
345
|
-
border-radius: var(--button-border-radius, 6px);
|
|
346
|
-
font-weight: var(--button-font-weight, 500);
|
|
347
|
-
}
|
|
348
|
-
.btn--default:hover {
|
|
349
|
-
color: var(--button-color, var(--foreground));
|
|
350
|
-
fill: var(--button-color, var(--foreground));
|
|
351
|
-
background: var(--button-hover-background, var(--background));
|
|
352
|
-
filter: var(--interactive-filter);
|
|
353
|
-
}
|
|
354
|
-
.btn--default:focus-visible {
|
|
355
|
-
background: var(--button-hover-background, var(--background));
|
|
356
|
-
filter: var(--interactive-filter);
|
|
357
|
-
outline: var(--button-focus-outline, var(--outline));
|
|
358
|
-
}
|
|
359
|
-
`,ly=`
|
|
360
|
-
.success__position {
|
|
361
|
-
position: fixed;
|
|
362
|
-
inset: var(--dialog-inset);
|
|
363
|
-
padding: var(--page-margin);
|
|
364
|
-
z-index: var(--z-index);
|
|
365
|
-
}
|
|
366
|
-
.success__content {
|
|
367
|
-
background: var(--success-background, var(--background));
|
|
368
|
-
border: var(--success-border, var(--border));
|
|
369
|
-
border-radius: var(--success-border-radius, 1.7em/50%);
|
|
370
|
-
box-shadow: var(--success-box-shadow, var(--box-shadow));
|
|
371
|
-
font-weight: var(--success-font-weight, 600);
|
|
372
|
-
color: var(--success-color);
|
|
373
|
-
fill: var(--success-color);
|
|
374
|
-
padding: 12px 24px;
|
|
375
|
-
line-height: 1.75em;
|
|
376
|
-
|
|
377
|
-
display: grid;
|
|
378
|
-
align-items: center;
|
|
379
|
-
grid-auto-flow: column;
|
|
380
|
-
gap: 6px;
|
|
381
|
-
cursor: default;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.success__icon {
|
|
385
|
-
display: flex;
|
|
386
|
-
}
|
|
387
|
-
`;function uy(e){let t=Fg.createElement(`style`);return t.textContent=`
|
|
388
|
-
:host {
|
|
389
|
-
--dialog-inset: var(--inset);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
${ay}
|
|
393
|
-
${oy}
|
|
394
|
-
${sy}
|
|
395
|
-
${cy}
|
|
396
|
-
${ly}
|
|
397
|
-
`,e&&t.setAttribute(`nonce`,e),t}function dy(){let e=P().getUser(),t=Da().getUser(),n=Oa().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}var fy=(()=>({name:`FeedbackModal`,setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{let i=r,a=e.useSentryUser,o=dy(),s=Fg.createElement(`div`),c=uy(e.styleNonce),l=``,u={get el(){return s},appendToDom(){!i.contains(c)&&!i.contains(s)&&(i.appendChild(c),i.appendChild(s))},removeFromDom(){s.remove(),c.remove(),Fg.body.style.overflow=l},open(){f(!0),e.onFormOpen?.(),F()?.emit(`openFeedbackWidget`),l=Fg.body.style.overflow,Fg.body.style.overflow=`hidden`},close(){f(!1),Fg.body.style.overflow=l}},d=t?.createInput({h:H_,hooks:Kv,dialog:u,options:e}),f=t=>{dv(H_(iy,{options:e,screenshotInput:d,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(a&&o?.[a.name]||``),defaultEmail:String(a&&o?.[a.email]||``),onFormClose:()=>{f(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(t,n)=>{f(!1),e.onSubmitSuccess?.(t,n)},onSubmitError:t=>{e.onSubmitError?.(t)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:t}),s)};return u}}));function py({h:e}){return function(){return e(`svg`,{"data-test-id":`icon-close`,viewBox:`0 0 16 16`,fill:`#2B2233`,height:`25px`,width:`25px`},e(`circle`,{r:`7`,cx:`8`,cy:`8`,fill:`white`}),e(`path`,{strokeWidth:`1.5`,d:`M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z`}),e(`path`,{strokeWidth:`1.5`,d:`M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z`}),e(`path`,{strokeWidth:`1.5`,d:`M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z`}))}}function my(e){let t=Fg.createElement(`style`),n=`#1A141F`,r=`#302735`;return t.textContent=`
|
|
398
|
-
.editor {
|
|
399
|
-
display: flex;
|
|
400
|
-
flex-grow: 1;
|
|
401
|
-
flex-direction: column;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.editor__image-container {
|
|
405
|
-
justify-items: center;
|
|
406
|
-
padding: 15px;
|
|
407
|
-
position: relative;
|
|
408
|
-
height: 100%;
|
|
409
|
-
border-radius: var(--menu-border-radius, 6px);
|
|
410
|
-
|
|
411
|
-
background-color: ${n};
|
|
412
|
-
background-image: repeating-linear-gradient(
|
|
413
|
-
-145deg,
|
|
414
|
-
transparent,
|
|
415
|
-
transparent 8px,
|
|
416
|
-
${n} 8px,
|
|
417
|
-
${n} 11px
|
|
418
|
-
),
|
|
419
|
-
repeating-linear-gradient(
|
|
420
|
-
-45deg,
|
|
421
|
-
transparent,
|
|
422
|
-
transparent 15px,
|
|
423
|
-
${r} 15px,
|
|
424
|
-
${r} 16px
|
|
425
|
-
);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.editor__canvas-container {
|
|
429
|
-
width: 100%;
|
|
430
|
-
height: 100%;
|
|
431
|
-
position: relative;
|
|
432
|
-
display: flex;
|
|
433
|
-
align-items: center;
|
|
434
|
-
justify-content: center;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
.editor__canvas-container > * {
|
|
438
|
-
object-fit: contain;
|
|
439
|
-
position: absolute;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
.editor__tool-container {
|
|
443
|
-
padding-top: 8px;
|
|
444
|
-
display: flex;
|
|
445
|
-
justify-content: center;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.editor__tool-bar {
|
|
449
|
-
display: flex;
|
|
450
|
-
gap: 8px;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.editor__tool {
|
|
454
|
-
display: flex;
|
|
455
|
-
padding: 8px 12px;
|
|
456
|
-
justify-content: center;
|
|
457
|
-
align-items: center;
|
|
458
|
-
border: var(--button-border, var(--border));
|
|
459
|
-
border-radius: var(--button-border-radius, 6px);
|
|
460
|
-
background: var(--button-background, var(--background));
|
|
461
|
-
color: var(--button-color, var(--foreground));
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
.editor__tool--active {
|
|
465
|
-
background: var(--button-primary-background, var(--accent-background));
|
|
466
|
-
color: var(--button-primary-color, var(--accent-foreground));
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
.editor__rect {
|
|
470
|
-
position: absolute;
|
|
471
|
-
z-index: 2;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.editor__rect button {
|
|
475
|
-
opacity: 0;
|
|
476
|
-
position: absolute;
|
|
477
|
-
top: -12px;
|
|
478
|
-
right: -12px;
|
|
479
|
-
cursor: pointer;
|
|
480
|
-
padding: 0;
|
|
481
|
-
z-index: 3;
|
|
482
|
-
border: none;
|
|
483
|
-
background: none;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.editor__rect:hover button {
|
|
487
|
-
opacity: 1;
|
|
488
|
-
}
|
|
489
|
-
`,e&&t.setAttribute(`nonce`,e),t}function hy({h:e}){return function({action:t,setAction:n,options:r}){return e(`div`,{class:`editor__tool-container`},e(`div`,{class:`editor__tool-bar`},e(`button`,{type:`button`,class:`editor__tool ${t===`highlight`?`editor__tool--active`:``}`,onClick:()=>{n(t===`highlight`?``:`highlight`)}},r.highlightToolText),e(`button`,{type:`button`,class:`editor__tool ${t===`hide`?`editor__tool--active`:``}`,onClick:()=>{n(t===`hide`?``:`hide`)}},r.hideToolText)))}}function gy({hooks:e}){function t(){let[t,n]=e.useState(Pg.devicePixelRatio??1);return e.useEffect(()=>{let e=()=>{n(Pg.devicePixelRatio)},t=matchMedia(`(resolution: ${Pg.devicePixelRatio}dppx)`);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},[]),t}return function({onBeforeScreenshot:n,onScreenshot:r,onAfterScreenshot:i,onError:a}){let o=t();e.useEffect(()=>{(async()=>{n();let e=await Ig.mediaDevices.getDisplayMedia({video:{width:Pg.innerWidth*o,height:Pg.innerHeight*o},audio:!1,monitorTypeSurfaces:`exclude`,preferCurrentTab:!0,selfBrowserSurface:`include`,surfaceSwitching:`exclude`}),t=Fg.createElement(`video`);await new Promise((n,i)=>{t.srcObject=e,t.onloadedmetadata=()=>{r(t,o),e.getTracks().forEach(e=>e.stop()),n()},t.play().catch(i)}),i()})().catch(a)},[])}}function _y(e,t,n){switch(e.type){case`highlight`:t.shadowColor=`rgba(0, 0, 0, 0.7)`,t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break;case`hide`:t.fillStyle=`rgb(0, 0, 0)`,t.fillRect(e.x,e.y,e.w,e.h)}}function vy(e,t,n){if(!e)return;let r=e.getContext(`2d`,t);r&&n(e,r)}function yy(e,t){vy(e,{alpha:!0},(e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)})}function by(e,t,n){vy(e,{alpha:!0},(e,r)=>{n.length&&(r.fillStyle=`rgba(0, 0, 0, 0.25)`,r.fillRect(0,0,e.width,e.height)),n.forEach(e=>{_y(e,r,t)})})}function xy({h:e,hooks:t,outputBuffer:n,dialog:r,options:i}){let a=gy({hooks:t}),o=hy({h:e}),s=py({h:e}),c={__html:my(i.styleNonce).innerText},l=r.el.style,u=({screenshot:r})=>{let[a,l]=t.useState(`highlight`),[u,d]=t.useState([]),f=t.useRef(null),p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),[g,_]=t.useState(1),v=t.useMemo(()=>{let e=Fg.getElementById(i.id);if(!e)return`white`;let t=getComputedStyle(e);return t.getPropertyValue(`--button-primary-background`)||t.getPropertyValue(`--accent-background`)},[i.id]);t.useLayoutEffect(()=>{let e=()=>{let t=f.current;t&&(vy(r.canvas,{alpha:!1},e=>{let n=Math.min(t.clientWidth/e.width,t.clientHeight/e.height);_(n)}),(t.clientHeight===0||t.clientWidth===0)&&setTimeout(e,0))};return e(),Pg.addEventListener(`resize`,e),()=>{Pg.removeEventListener(`resize`,e)}},[r]);let y=t.useCallback((e,t)=>{vy(e,{alpha:!0},(e,n)=>{n.scale(t,t),e.width=r.canvas.width,e.height=r.canvas.height})},[r]);t.useEffect(()=>{y(p.current,r.dpi),yy(p.current,r.canvas)},[r]),t.useEffect(()=>{y(m.current,r.dpi),vy(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),by(m.current,v,u)},[u,v]),t.useEffect(()=>{y(n,r.dpi),yy(n,r.canvas),vy(Fg.createElement(`canvas`),{alpha:!0},(e,t)=>{t.scale(r.dpi,r.dpi),e.width=r.canvas.width,e.height=r.canvas.height,by(e,v,u),yy(n,e)})},[u,r,v]);let b=e=>{if(!a||!h.current)return;let t=h.current.getBoundingClientRect(),n={type:a,x:e.offsetX/g,y:e.offsetY/g},r=(e,n)=>{let r=(n.clientX-t.x)/g,i=(n.clientY-t.y)/g;return{type:e.type,x:Math.min(e.x,r),y:Math.min(e.y,i),w:Math.abs(r-e.x),h:Math.abs(i-e.y)}},i=e=>{vy(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),by(m.current,v,[...u,r(n,e)])},o=e=>{let t=r(n,e);t.w*g>=1&&t.h*g>=1&&d(e=>[...e,t]),Fg.removeEventListener(`mousemove`,i),Fg.removeEventListener(`mouseup`,o)};Fg.addEventListener(`mousemove`,i),Fg.addEventListener(`mouseup`,o)},x=t.useCallback(e=>t=>{t.preventDefault(),t.stopPropagation(),d(t=>{let n=[...t];return n.splice(e,1),n})},[]),S={width:`${r.canvas.width*g}px`,height:`${r.canvas.height*g}px`},C=e=>{e.stopPropagation()};return e(`div`,{class:`editor`},e(`style`,{nonce:i.styleNonce,dangerouslySetInnerHTML:c}),e(`div`,{class:`editor__image-container`},e(`div`,{class:`editor__canvas-container`,ref:f},e(`canvas`,{ref:p,id:`background`,style:S}),e(`canvas`,{ref:m,id:`foreground`,style:S}),e(`div`,{ref:h,onMouseDown:b,style:S},u.map((t,n)=>e(`div`,{key:n,class:`editor__rect`,style:{top:`${t.y*g}px`,left:`${t.x*g}px`,width:`${t.w*g}px`,height:`${t.h*g}px`}},e(`button`,{"aria-label":i.removeHighlightText,onClick:x(n),onMouseDown:C,onMouseUp:C,type:`button`},e(s,null))))))),e(o,{options:i,action:a,setAction:l}))};return function({onError:r}){let[i,o]=t.useState();return a({onBeforeScreenshot:t.useCallback(()=>{l.display=`none`},[]),onScreenshot:t.useCallback((e,t)=>{vy(Fg.createElement(`canvas`),{alpha:!1},(n,r)=>{r.scale(t,t),n.width=e.videoWidth,n.height=e.videoHeight,r.drawImage(e,0,0,n.width,n.height),o({canvas:n,dpi:t})}),n.width=e.videoWidth,n.height=e.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{l.display=`block`},[]),onError:t.useCallback(e=>{l.display=`block`,r(e)},[])}),i?e(u,{screenshot:i}):e(`div`,null)}}var Sy=(()=>({name:`FeedbackScreenshot`,setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{let i=Fg.createElement(`canvas`);return{input:xy({h:e,hooks:t,outputBuffer:i,dialog:n,options:r}),value:async()=>{let e=await new Promise(e=>{i.toBlob(e,`image/png`)});if(e)return{data:new Uint8Array(await e.arrayBuffer()),filename:`screenshot.png`,contentType:`application/png`}}}}})),R=M,Cy=0;function wy(){return Cy>0}function Ty(){Cy++,setTimeout(()=>{Cy--})}function Ey(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,`__sentry_wrapped__`)){let t=e.__sentry_wrapped__;return typeof t==`function`?t:e}if(fi(e))return e}catch{return e}let r=function(...n){M._sentryWrappedDepth=(M._sentryWrappedDepth||0)+1;try{let r=n.map(e=>Ey(e,t));return e.apply(this,r)}catch(e){throw Ty(),ka(r=>{r.addEventProcessor(e=>(t.mechanism&&(Ki(e,void 0,void 0),qi(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),_l(e)}),e}finally{M._sentryWrappedDepth=(M._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}di(r,e),ui(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Dy(){let e=Mg(),{referrer:t}=R.document||{},{userAgent:n}=R.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}var Oy=[`replayIntegration`,`replayCanvasIntegration`,`feedbackIntegration`,`feedbackModalIntegration`,`feedbackScreenshotIntegration`,`captureConsoleIntegration`,`contextLinesIntegration`,`linkedErrorsIntegration`,`dedupeIntegration`,`extraErrorDataIntegration`,`graphqlClientIntegration`,`httpClientIntegration`,`reportingObserverIntegration`,`rewriteFramesIntegration`,`browserProfilingIntegration`,`moduleMetadataIntegration`,`instrumentAnthropicAiClient`,`instrumentOpenAiClient`,`instrumentGoogleGenAIClient`,`instrumentStateGraph`,`instrumentLangGraph`,`createLangChainCallbackHandler`,`instrumentLangChainEmbeddings`],ky={replayCanvasIntegration:`replay-canvas`,feedbackModalIntegration:`feedback-modal`,feedbackScreenshotIntegration:`feedback-screenshot`};function Ay(e){return ky[e]||e.replace(`Integration`,``).toLowerCase()}var jy=R;async function My(e,t){let n=Oy.includes(e)?Ay(e):void 0,r=jy.Sentry=jy.Sentry||{};if(!n)throw Error(`Cannot lazy load integration: ${e}`);let i=r[e];if(typeof i==`function`&&!(`_isShim`in i))return i;let a=Ny(n),o=R.document.createElement(`script`);o.src=a,o.crossOrigin=`anonymous`,o.referrerPolicy=`strict-origin`,t&&o.setAttribute(`nonce`,t);let s=new Promise((e,t)=>{o.addEventListener(`load`,()=>e()),o.addEventListener(`error`,t)}),c=R.document.currentScript,l=R.document.body||R.document.head||c?.parentElement;if(l)l.appendChild(o);else throw Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await s}catch{throw Error(`Error when loading integration: ${e}`)}let u=r[e];if(typeof u!=`function`)throw Error(`Could not load integration: ${e}`);return u}function Ny(e){let t=F()?.getOptions()?.cdnBaseUrl||`https://browser.sentry-cdn.com`;return new URL(`/${lr}/${e}.min.js`,t).toString()}var Py=D_({lazyLoadIntegration:My}),Fy=D_({getModalIntegration:()=>fy,getScreenshotIntegration:()=>Sy});function Iy(e,t){let n=zy(e,t),r={type:Wy(t),value:Gy(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function Ly(e,t,n,r){let i=F()?.getOptions().normalizeDepth,a=Qy(t),o={__serialized__:ki(t,i)};if(a)return{exception:{values:[Iy(e,a)]},extra:o};let s={exception:{values:[{type:ii(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:Xy(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=zy(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function Ry(e,t){return{exception:{values:[Iy(e,t)]}}}function zy(e,t){let n=t.stacktrace||t.stack||``,r=Vy(t),i=Hy(t);try{return e(n,r,i)}catch{}return[]}var By=/Minified React error #\d+;/i;function Vy(e){return e&&By.test(e.message)?1:0}function Hy(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function Uy(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0&&e instanceof WebAssembly.Exception}function Wy(e){let t=e?.name;return!t&&Uy(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function Gy(e){let t=e?.message;return Uy(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?Cf(t.error):Cf(e):`No error message`}function Ky(e,t,n,r){let i=Jy(e,t,n?.syntheticException||void 0,r);return qi(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),Yc(i)}function qy(e,t,n=`info`,r,i){let a=Yy(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),Yc(a)}function Jy(e,t,n,r,i){let a;if(Xr(t)&&t.error)return Ry(e,t.error);if(Zr(t)||Qr(t)){let i=t;if(`stack`in t){a=Ry(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=zy(e,n);t.length&&(i.stacktrace={frames:t},qi(a,{synthetic:!0}))}}else{let t=i.name||(Zr(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=Yy(e,o,n,r),Ki(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return Jr(t)?Ry(e,t):ni(t)||ii(t)?(a=Ly(e,t,n,i),qi(a,{synthetic:!0}),a):(a=Yy(e,t,n,r),Ki(a,`${t}`,void 0),qi(a,{synthetic:!0}),a)}function Yy(e,t,n,r){let i={};if(r&&n){let r=zy(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),qi(i,{synthetic:!0})}if(ei(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Xy(e,{isUnhandledRejection:t}){let n=hi(e),r=t?`promise rejection`:`exception`;return Xr(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ii(e)?`Event \`${Zy(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Zy(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Qy(e){return Object.values(e).find(Jr)}var $y=class extends ld{constructor(e){let t=eb(e);Jd(t,`browser`,[`browser`],R.SENTRY_SDK_SOURCE||ou()),super(t);let{userInfo:n}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:n?`auto`:`never`,...t._metadata.sdk.settings});let{sendClientReports:r}=this._options;R.document&&R.document.addEventListener(`visibilitychange`,()=>{R.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,qd)}eventFromException(e,t){return Ky(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return qy(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function eb(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:R.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var tb=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,z=M,nb=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,rb=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=nb(t.value,n),e(t)))}},ib=(e=!0)=>{let t=z.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},ab=()=>ib()?.activationStart??0;function ob(e,t,n){z.document&&z.addEventListener(e,t,n)}function sb(e,t,n){z.document&&z.removeEventListener(e,t,n)}var cb=-1,lb=new Set,ub=()=>z.document?.visibilityState===`hidden`&&!z.document?.prerendering?0:1/0,db=e=>{if(pb(e)&&cb>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of lb)e();isFinite(cb)||(cb=e.type===`visibilitychange`?e.timeStamp:0,sb(`prerenderingchange`,db,!0))}},fb=()=>{if(z.document&&cb<0){let e=ab();cb=(z.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??ub(),ob(`visibilitychange`,db,!0),ob(`pagehide`,db,!0),ob(`prerenderingchange`,db,!0)}return{get firstHiddenTime(){return cb},onHidden(e){lb.add(e)}}};function pb(e){return e.type===`pagehide`||z.document?.visibilityState===`hidden`}var mb=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+0xe8d4a51000}`,hb=(e,t=-1)=>{let n=ib(),r=`navigate`;return n&&(z.document?.prerendering||ab()>0?r=`prerender`:z.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:mb(),navigationType:r}},gb=new WeakMap;function _b(e,t){try{return gb.get(e)||gb.set(e,new t),gb.get(e)}catch{return new t}}var vb=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},yb=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},bb=e=>{let t=!1;return()=>{t||=(e(),!0)}},xb=e=>{z.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},Sb=[1800,3e3],Cb=(e,t={})=>{xb(()=>{let n=fb(),r=hb(`FCP`),i,a=yb(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-ab(),0),r.entries.push(t),i(!0)))});a&&(i=rb(e,r,Sb,t.reportAllChanges))})},wb=[.1,.25],Tb=(e,t={})=>{Cb(bb(()=>{let n=hb(`CLS`,0),r,i=fb(),a=_b(t,vb),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=yb(`layout-shift`,o);s&&(r=rb(e,n,wb,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),z?.setTimeout?.(r))}))},Eb=0,Db=1/0,Ob=0,kb=e=>{e.forEach(e=>{e.interactionId&&(Db=Math.min(Db,e.interactionId),Ob=Math.max(Ob,e.interactionId),Eb=Ob?(Ob-Db)/7+1:0)})},Ab,jb=()=>Ab?Eb:performance.interactionCount||0,Mb=()=>{`interactionCount`in performance||Ab||(Ab=yb(`event`,kb,{type:`event`,buffered:!0,durationThreshold:0}))},Nb=10,Pb=0,Fb=()=>jb()-Pb,Ib=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){Pb=jb(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(Fb()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<Nb||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>Nb){let e=this._longestInteractionList.splice(Nb);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},Lb=e=>{let t=z.requestIdleCallback||z.setTimeout;z.document?.visibilityState===`hidden`?e():(e=bb(e),ob(`visibilitychange`,e,{once:!0,capture:!0}),ob(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),sb(`visibilitychange`,e,{capture:!0}),sb(`pagehide`,e,{capture:!0})}))},Rb=[200,500],zb=40,Bb=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=fb();xb(()=>{Mb();let r=hb(`INP`),i,a=_b(t,Ib),o=e=>{Lb(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=yb(`event`,o,{durationThreshold:t.durationThreshold??zb});i=rb(e,r,Rb,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},Vb=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},Hb=[2500,4e3],Ub=(e,t={})=>{xb(()=>{let n=fb(),r=hb(`LCP`),i,a=_b(t,Vb),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-ab(),0),r.entries=[t],i())},s=yb(`largest-contentful-paint`,o);if(s){i=rb(e,r,Hb,t.reportAllChanges);let n=bb(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(Lb(n),sb(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])ob(e,a,{capture:!0})}})},Wb=[800,1800],Gb=e=>{z.document?.prerendering?xb(()=>Gb(e)):z.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Gb(e),!0)},Kb=(e,t={})=>{let n=hb(`TTFB`),r=rb(e,n,Wb,t.reportAllChanges);Gb(()=>{let e=ib();e&&(n.value=Math.max(e.responseStart-ab(),0),n.entries=[e],r(!0))})},qb={},Jb={},Yb,Xb,Zb,Qb;function $b(e,t=!1){return lx(`cls`,e,ax,Yb,t)}function ex(e,t=!1){return lx(`lcp`,e,ox,Xb,t)}function tx(e){return lx(`ttfb`,e,sx,Zb)}function nx(e){return lx(`inp`,e,cx,Qb)}function rx(e,t){return dx(e,t),Jb[e]||(ux(e),Jb[e]=!0),fx(e,t)}function ix(e,t){let n=qb[e];if(n?.length)for(let r of n)try{r(t)}catch(t){tb&&N.error(`Error while triggering instrumentation handler.
|
|
490
|
-
Type: ${e}
|
|
491
|
-
Name: ${Nr(r)}
|
|
492
|
-
Error:`,t)}}function ax(){return Tb(e=>{ix(`cls`,{metric:e}),Yb=e},{reportAllChanges:!0})}function ox(){return Ub(e=>{ix(`lcp`,{metric:e}),Xb=e},{reportAllChanges:!0})}function sx(){return Kb(e=>{ix(`ttfb`,{metric:e}),Zb=e})}function cx(){return Bb(e=>{ix(`inp`,{metric:e}),Qb=e})}function lx(e,t,n,r,i=!1){dx(e,t);let a;return Jb[e]||(a=n(),Jb[e]=!0),r&&t({metric:r}),fx(e,t,i?a:void 0)}function ux(e){let t={};e===`event`&&(t.durationThreshold=0),yb(e,t=>{ix(e,{entries:t})},t)}function dx(e,t){qb[e]=qb[e]||[],qb[e].push(t)}function fx(e,t,n){return()=>{n&&n();let r=qb[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function px(e){return`duration`in e}var mx=80,hx={};try{typeof Node<`u`&&(hx.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(hx.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,hx.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,hx.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,hx.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(hx.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function gx(e,t,n){let r=hx[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function _x(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||mx;for(;n&&i++<5&&(o=vx(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=gx(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function vx(e,t){let n=[],r=gx(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=gx(e,`dataset`);if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());let i=t?.length?t.filter(t=>gx(e,`getAttribute`,t)).map(t=>[t,gx(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=gx(e,`id`);t&&n.push(`#${t}`);let r=gx(e,`className`);if(r&&$r(r)){let e=r.split(/\s+/);for(let t of e)n.push(`.${t}`)}}for(let t of[`aria-label`,`type`,`name`,`title`,`alt`]){let r=gx(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var yx=e=>{let t=t=>{(t.type===`pagehide`||z.document?.visibilityState===`hidden`)&&e(t)};ob(`visibilitychange`,t,{capture:!0,once:!0}),ob(`pagehide`,t,{capture:!0,once:!0})};function bx(e){return typeof e==`number`&&isFinite(e)}function xx(e,t,n,{...r}){let i=L(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),lc(e,()=>{let e=cc({startTime:t,...r});return e&&e.end(n),e})}function Sx(e){let t=F();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=P(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return cc({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":z.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function Cx(){return z.addEventListener&&z.performance}function wx(e){return e/1e3}function Tx(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function Ex(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Dx(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n.spanContext().spanId,n),r=!0}yx(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e,o()})}function Ox(e){let t=0,n;if(!Ex(`layout-shift`))return;let r=$b(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);Dx(e,(e,i)=>{kx(t,n,i,e),r()})}function kx(e,t,n,r){tb&&N.log(`Sending CLS span (${e})`);let i=t?wx(($i()||0)+t.startTime):Zi(),a=P().getScopeData().transactionName,o=t?_x(t.sources[0]?.node):`Layout shift`,s={[I]:`auto.http.browser.cls`,[Fa]:`ui.webvital.cls`,[Ja]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=_x(e.node)});let c=Sx({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[La]:``,[Ra]:e}),c.end(i))}function Ax(e){return e!=null&&e>0&&e<=6e4}function jx(e){let t=0,n;if(!Ex(`largest-contentful-paint`))return;let r=ex(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!Ax(e.value)||(t=e.value,n=r)},!0);Dx(e,(e,i)=>{Mx(t,n,i,e),r()})}function Mx(e,t,n,r){if(!Ax(e))return;tb&&N.log(`Sending LCP span (${e})`);let i=wx(($i()||0)+(t?.startTime||0)),a=P().getScopeData().transactionName,o=t?_x(t.element):`Largest contentful paint`,s={[I]:`auto.http.browser.lcp`,[Fa]:`ui.webvital.lcp`,[Ja]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=_x(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=Sx({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[La]:`millisecond`,[Ra]:e}),c.end(i))}function Nx(e){return e&&(($i()||performance.timeOrigin)+e)/1e3}function Px(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=Tx(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return $i()||Cx()?.timeOrigin?Fx({...t,"http.request.redirect_start":Nx(e.redirectStart),"http.request.redirect_end":Nx(e.redirectEnd),"http.request.worker_start":Nx(e.workerStart),"http.request.fetch_start":Nx(e.fetchStart),"http.request.domain_lookup_start":Nx(e.domainLookupStart),"http.request.domain_lookup_end":Nx(e.domainLookupEnd),"http.request.connect_start":Nx(e.connectStart),"http.request.secure_connection_start":Nx(e.secureConnectionStart),"http.request.connection_end":Nx(e.connectEnd),"http.request.request_start":Nx(e.requestStart),"http.request.response_start":Nx(e.responseStart),"http.request.response_end":Nx(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function Fx(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var Ix=2147483647,Lx=0,Rx={},zx,Bx;function Vx({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=Cx();if(r&&$i()){r.mark&&z.performance.mark(`sentry-tracing-init`);let i=t?jx(n):t===!1?Kx():void 0,a=e?Ox(n):e===!1?Gx():void 0,o=qx(),s=Jx();return()=>{o(),s(),i?.(),a?.()}}return()=>void 0}function Hx(){rx(`longtask`,({entries:e})=>{let t=as();if(!t)return;let{op:n,start_timestamp:r}=L(t);for(let i of e){let e=wx($i()+i.startTime),a=wx(i.duration);n===`navigation`&&r&&e<r||xx(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[I]:`auto.ui.browser.metrics`}})}})}function Ux(){new PerformanceObserver(e=>{let t=as();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=wx($i()+n.startTime),{start_timestamp:r,op:i}=L(t);if(i===`navigation`&&r&&e<r)continue;let a=wx(n.duration),o={[I]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),xx(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function Wx(){rx(`event`,({entries:e})=>{let t=as();if(t){for(let n of e)if(n.name===`click`){let e=wx($i()+n.startTime),r=wx(n.duration),i={name:_x(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[I]:`auto.ui.browser.metrics`}},a=Ng(n.target);a&&(i.attributes[`ui.component_name`]=a),xx(t,e,e+r,i)}}})}function Gx(){return $b(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(Rx.cls={value:e.value,unit:``},Bx=t)},!0)}function Kx(){return ex(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Ax(e.value)||(Rx.lcp={value:e.value,unit:`millisecond`},zx=t)},!0)}function qx(){return tx(({metric:e})=>{e.entries[e.entries.length-1]&&(Rx.ttfb={value:e.value,unit:`millisecond`})})}function Jx(){return rx(`paint`,({entries:e})=>{let t=fb();for(let n of e){let e=n.startTime<t.firstHiddenTime;n.name===`first-paint`&&e&&(Rx.fp={value:n.startTime,unit:`millisecond`}),n.name===`first-contentful-paint`&&e&&(Rx.fcp={value:n.startTime,unit:`millisecond`})}})}function Yx(e,t){let n=Cx(),r=$i();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:i,ignorePerformanceApiSpans:a,ignoreResourceSpans:o}=t,s=wx(r),c=n.getEntries(),{op:l,start_timestamp:u}=L(e);c.slice(Lx).forEach(t=>{let n=wx(t.startTime),r=wx(Math.max(0,t.duration));if(!(l===`navigation`&&u&&s+n<u))switch(t.entryType){case`navigation`:tS(e,t,s);break;case`mark`:case`paint`:case`measure`:$x(e,t,n,r,s,a);break;case`resource`:aS(e,t,t.name,n,r,s,o)}}),Lx=Math.max(c.length-1,0),oS(e,i)}function Xx(e,t){let n=$i();if(!Cx()?.getEntries||!n){Zx();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:i,recordLcpOnPageloadSpan:a}=t,o=wx(n);if(L(e).op===`pageload`){if(lS(Rx),r){let t=(t,n,r)=>{let i=r??`browser.web_vital.${t}.value`;e.setAttribute(i,n),tb&&N.log(`Setting web vital attribute`,{[i]:n},`on pageload span`)};[`ttfb`,`fp`,`fcp`].forEach(e=>{Rx[e]&&t(e,Rx[e].value)}),Rx[`ttfb.requestTime`]&&t(`ttfb.requestTime`,Rx[`ttfb.requestTime`].value,`browser.web_vital.ttfb.request_time`)}else i||delete Rx.cls,a||delete Rx.lcp,Object.entries(Rx).forEach(([t,n])=>{Xs(t,n.value,n.unit,e)}),sS(e,t);e.setAttribute(r?`browser.performance.time_origin`:`performance.timeOrigin`,o),e.setAttribute(r?`browser.performance.navigation.activation_start`:`performance.activationStart`,ab())}Zx()}function Zx(){zx=void 0,Bx=void 0,Rx={}}function Qx(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components ⚛`}catch{return}}function $x(e,t,n,r,i,a){if(Qx(t)||[`mark`,`measure`].includes(t.entryType)&&Vi(t.name,a))return;let o=ib(!1),s=wx(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[I]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),eS(d,t),c<=u&&xx(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function eS(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&ti(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(ti(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function tS(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{nS(e,t,r,n)}),nS(e,t,`secureConnection`,n,`TLS/SSL`),nS(e,t,`fetch`,n,`cache`),nS(e,t,`domainLookup`,n,`DNS`),iS(e,t,n)}function nS(e,t,n,r,i=n){let a=t[rS(n)],o=t[`${n}Start`];!o||!a||xx(e,r+wx(o),r+wx(a),{op:`browser.${i}`,name:t.name,attributes:{[I]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function rS(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function iS(e,t,n){let r=n+wx(t.requestStart),i=n+wx(t.responseEnd),a=n+wx(t.responseStart);t.responseEnd&&(xx(e,r,i,{op:`browser.request`,name:t.name,attributes:{[I]:`auto.ui.browser.metrics`}}),xx(e,a,i,{op:`browser.response`,name:t.name,attributes:{[I]:`auto.ui.browser.metrics`}}))}function aS(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[I]:`auto.resource.browser.metrics`},l=Ld(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(z.location.origin),c[zc]=n,cS(t,c,[[`responseStatus`,`http.response.status_code`],[`transferSize`,`http.response_transfer_size`],[`encodedBodySize`,`http.response_content_length`],[`decodedBodySize`,`http.decoded_response_content_length`],[`renderBlockingStatus`,`resource.render_blocking_status`],[`deliveryType`,`http.response_delivery_type`]]);let u={...c,...Px(t)},d=a+r;xx(e,d,d+i,{name:n.replace(z.location.origin,``),op:s,attributes:u})}function oS(e,t){let n=z.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?`network.connection.effective_type`:`effectiveConnectionType`,r.effectiveType),r.type&&e.setAttribute(t?`network.connection.type`:`connectionType`,r.type),bx(r.rtt)&&(t?e.setAttribute(`network.connection.rtt`,r.rtt):L(e).op===`pageload`&&Xs(`connection.rtt`,r.rtt,`millisecond`))),bx(n.deviceMemory)&&(t?e.setAttribute(`device.memory.estimated_capacity`,n.deviceMemory):e.setAttribute(`deviceMemory`,`${n.deviceMemory} GB`)),bx(n.hardwareConcurrency)&&(t?e.setAttribute(`device.processor_count`,n.hardwareConcurrency):e.setAttribute(`hardwareConcurrency`,String(n.hardwareConcurrency)))}function sS(e,t){zx&&t.recordLcpOnPageloadSpan&&(zx.element&&e.setAttribute(`lcp.element`,_x(zx.element)),zx.id&&e.setAttribute(`lcp.id`,zx.id),zx.url&&e.setAttribute(`lcp.url`,zx.url.trim().slice(0,200)),zx.loadTime!=null&&e.setAttribute(`lcp.loadTime`,zx.loadTime),zx.renderTime!=null&&e.setAttribute(`lcp.renderTime`,zx.renderTime),e.setAttribute(`lcp.size`,zx.size)),Bx?.sources&&t.recordClsOnPageloadSpan&&Bx.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,_x(t.node)))}function cS(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<Ix||typeof i==`string`)&&(t[r]=i)})}function lS(e){let t=ib(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}var uS=`ElementTiming`,dS=Ql((()=>({name:uS,setup(){!Cx()||!$i()||rx(`element`,({entries:e})=>{for(let t of e){let e=t;if(!e.identifier)continue;let n=e.identifier,r=e.name,i=e.renderTime,a=e.loadTime,o={"sentry.origin":`auto.ui.browser.element_timing`,"ui.element.identifier":n};r&&(o[`ui.element.paint_type`]=r),e.id&&(o[`ui.element.id`]=e.id),e.element&&(o[`ui.element.type`]=e.element.tagName.toLowerCase()),e.url&&(o[`ui.element.url`]=e.url),e.naturalWidth&&(o[`ui.element.width`]=e.naturalWidth),e.naturalHeight&&(o[`ui.element.height`]=e.naturalHeight),i>0&&Dm(`ui.element.render_time`,i,{unit:`millisecond`,attributes:o}),a>0&&Dm(`ui.element.load_time`,a,{unit:`millisecond`,attributes:o})}})}}))),fS=[],pS=new Map,mS=new Map;function hS(){if(Cx()&&$i()){let e=_S();return()=>{e()}}return()=>void 0}var gS={click:`click`,pointerdown:`click`,pointerup:`click`,mousedown:`click`,mouseup:`click`,touchstart:`click`,touchend:`click`,mouseover:`hover`,mouseout:`hover`,mouseenter:`hover`,mouseleave:`hover`,pointerover:`hover`,pointerout:`hover`,pointerenter:`hover`,pointerleave:`hover`,dragstart:`drag`,dragend:`drag`,drag:`drag`,dragenter:`drag`,dragleave:`drag`,dragover:`drag`,drop:`drag`,keydown:`press`,keyup:`press`,keypress:`press`,input:`press`};function _S(){return nx(vS)}var vS=({metric:e})=>{if(e.value==null)return;let t=wx(e.value);if(t>60)return;let n=e.entries.find(t=>t.duration===e.value&&gS[t.name]);if(!n)return;let{interactionId:r}=n,i=gS[n.name],a=wx($i()+n.startTime),o=as(),s=o?rs(o):void 0,c=r==null?void 0:pS.get(r),l=c?.span||s,u=l?L(l).description:P().getScopeData().transactionName,d=Sx({name:c?.elementName||_x(n.target),transaction:u,attributes:{[I]:`auto.http.browser.inp`,[Fa]:`ui.interaction.${i}`,[Ja]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[La]:`millisecond`,[Ra]:e.value}),d.end(a+t))};function yS(e){return e==null?void 0:pS.get(e)}function bS(){let e=Object.keys(gS);cu()&&e.forEach(e=>{z.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=_x(t),r=Math.round(e.timeStamp);if(mS.set(r,n),mS.size>50){let e=mS.keys().next().value;e!==void 0&&mS.delete(e)}}function n(e){let t=Math.round(e.startTime),n=mS.get(t);if(!n)for(let e=-5;e<=5;e++){let r=mS.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=as(),r=t&&rs(t);e.forEach(e=>{if(!px(e))return;let t=e.interactionId;if(t==null||pS.has(t))return;let i=e.target?_x(e.target):n(e);if(fS.length>10){let e=fS.shift();pS.delete(e)}fS.push(t),pS.set(t,{span:r,elementName:i})})};rx(`event`,r),rx(`first-input`,r)}function xS(e){let{name:t,op:n,origin:r,metricName:i,value:a,attributes:o,parentSpan:s,reportEvent:c,startTime:l,endTime:u}=e,d=P().getScopeData().transactionName,f={[I]:r,[Fa]:n,[Ja]:0,[`browser.web_vital.${i}.value`]:a,[Rc]:d,[Ic]:d,"user_agent.original":z.navigator?.userAgent,...o};s&&Uo(s).attributes?.[`sentry.op`]===`pageload`&&(f[`sentry.pageload.span_id`]=s.spanContext().spanId),c&&(f[`browser.web_vital.${i}.report_event`]=c);let p=cc({name:t,attributes:f,startTime:l,parentSpan:s});p&&p.end(u??l)}function SS(e){let t=0,n;if(!Ex(`largest-contentful-paint`))return;let r=ex(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!Ax(e.value)||(t=e.value,n=r)},!0);Dx(e,(e,i,a)=>{CS(t,n,a,e),r()})}function CS(e,t,n,r){if(!Ax(e))return;tb&&N.log(`Sending LCP span (${e})`);let i=$i()||0,a=wx(i),o=wx(i+(t?.startTime||0)),s=t?_x(t.element):`Largest contentful paint`,c={};t?.element&&(c[`browser.web_vital.lcp.element`]=_x(t.element)),t?.id&&(c[`browser.web_vital.lcp.id`]=t.id),t?.url&&(c[`browser.web_vital.lcp.url`]=t.url),t?.loadTime!=null&&(c[`browser.web_vital.lcp.load_time`]=t.loadTime),t?.renderTime!=null&&(c[`browser.web_vital.lcp.render_time`]=t.renderTime),t?.size!=null&&(c[`browser.web_vital.lcp.size`]=t.size),xS({name:s,op:`ui.webvital.lcp`,origin:`auto.http.browser.lcp`,metricName:`lcp`,value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:a,endTime:o})}function wS(e){let t=0,n;if(!Ex(`layout-shift`))return;let r=$b(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);Dx(e,(e,i,a)=>{TS(t,n,a,e),r()})}function TS(e,t,n,r){tb&&N.log(`Sending CLS span (${e})`);let i=t?wx(($i()||0)+t.startTime):Zi(),a=t?_x(t.sources[0]?.node):`Layout shift`,o={};t?.sources&&t.sources.forEach((e,t)=>{o[`browser.web_vital.cls.source.${t+1}`]=_x(e.node)}),xS({name:a,op:`ui.webvital.cls`,origin:`auto.http.browser.cls`,metricName:`cls`,value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:i})}function ES(){!Cx()||!$i()||nx(({metric:e})=>{if(e.value==null||wx(e.value)>60)return;let t=e.entries.find(t=>t.duration===e.value&&gS[t.name]);t&&DS(e.value,t)})}function DS(e,t){tb&&N.log(`Sending INP span (${e})`);let n=wx($i()+t.startTime),r=wx(e),i=gS[t.name],a=yS(t.interactionId),o=as(),s=o?rs(o):void 0,c=a?.span||s,l=c?Uo(c).name:P().getScopeData().transactionName;xS({name:a?.elementName||_x(t.target),op:`ui.interaction.${i}`,origin:`auto.http.browser.inp`,metricName:`inp`,value:e,attributes:{[Ja]:t.duration,[Rc]:l,[Ic]:l},startTime:n,endTime:n+r,parentSpan:c})}var OS=1e3,kS,AS,jS;function MS(e){Rr(`dom`,e),zr(`dom`,NS)}function NS(){if(!z.document)return;let e=Br.bind(null,`dom`),t=IS(e,!0);z.document.addEventListener(`click`,t,!1),z.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=z[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(li(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=IS(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),li(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function PS(e){if(e.type!==AS)return!1;try{if(!e.target||e.target._sentryId!==jS)return!1}catch{}return!0}function FS(e,t){return e===`keypress`?!t?.tagName||!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!1}function IS(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=LS(n);if(FS(n.type,r))return;ui(n,`_sentryCaptured`,!0),r&&!r._sentryId&&ui(r,`_sentryId`,Ui());let i=n.type===`keypress`?`input`:n.type;PS(n)||(e({event:n,name:i,global:t}),AS=n.type,jS=r?r._sentryId:void 0),clearTimeout(kS),kS=z.setTimeout(()=>{jS=void 0,AS=void 0},OS)}}function LS(e){try{return e.target}catch{return null}}var RS;function zS(e){let t=`history`;Rr(t,e),zr(t,BS)}function BS(){if(z.addEventListener(`popstate`,()=>{let e=z.location.href,t=RS;RS=e,t!==e&&Br(`history`,{from:t,to:e})}),!_g())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=RS,i=VS(String(n));if(RS=i,r===i)return e.apply(this,t);Br(`history`,{from:r,to:i})}return e.apply(this,t)}}li(z.history,`pushState`,e),li(z.history,`replaceState`,e)}function VS(e){try{return new URL(e,z.location.origin).toString()}catch{return e}}var HS={};function US(e){let t=HS[e];if(t)return t;let n=z[e];if(yg(n))return HS[e]=n.bind(z);let r=z.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){tb&&N.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(HS[e]=n.bind(z))}function WS(e){HS[e]=void 0}function GS(...e){return US(`setTimeout`)(...e)}var KS=`__sentry_xhr_v3__`;function qS(e){Rr(`xhr`,e),zr(`xhr`,JS)}function JS(){if(!z.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=Zi()*1e3,a=$r(n[0])?n[0].toUpperCase():void 0,o=YS(n[1]);if(!a||!o)return e.apply(t,n);t[KS]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[KS];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}Br(`xhr`,{endTimestamp:Zi()*1e3,startTimestamp:i,xhr:t,virtualError:r}),t.removeEventListener(`readystatechange`,s)}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[KS];return a&&$r(r)&&$r(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[KS];return r?(n[0]!==void 0&&(r.body=n[0]),Br(`xhr`,{startTimestamp:Zi()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function YS(e){if($r(e))return e;try{return e.toString()}catch{}}var XS=Symbol.for(`sentry__originalRequestBody`);function ZS(e){return new URLSearchParams(e).toString()}function QS(e,t=N){try{if(typeof e==`string`)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[ZS(e)];if(!e)return[void 0]}catch(n){return tb&&t.error(n,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return tb&&t.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function $S(e=[]){if(e.length>=2&&e[1]&&typeof e[1]==`object`&&`body`in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){let t=e[0][XS];return t===void 0?void 0:t}}function eC(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return tb&&N.error(t,`Failed to get xhr response headers`,e),{}}return t?t.split(`\r
|
|
493
|
-
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}function tC(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}function nC(e){try{return new URL(e,z.location.origin).toString()}catch{return e}}var rC=40;function iC(e,t=US(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw WS(`fetch`),e}finally{n-=a,r--}}return Vu(e,i,Fu(e.bufferSize||rC))}var B=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function aC(){let e=F();if(!e){B&&N.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){B&&N.warn(`BrowserProfiling integration is not available`);return}e.emit(`startUIProfiler`)}function oC(){let e=F();if(!e){B&&N.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){B&&N.warn(`ProfilingIntegration is not available`);return}e.emit(`stopUIProfiler`)}var sC={startProfiler:aC,stopProfiler:oC},cC=10,lC=20,uC=30,dC=40,fC=50;function pC(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var mC=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,hC=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gC=/\((\S*)(?::(\d+))(?::(\d+))\)/,_C=/at (.+?) ?\(data:(.+?),/,vC=[uC,e=>{let t=e.match(_C);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=mC.exec(e);if(n){let[,e,t,r]=n;return pC(e,`?`,+t,+r)}let r=hC.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=gC.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=AC(r[1]||`?`,r[2]);return pC(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],yC=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bC=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,xC=[fC,e=>{let t=yC.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=bC.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=AC(n,e),pC(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],SC=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,CC=[dC,e=>{let t=SC.exec(e);return t?pC(t[2],t[1]||`?`,+t[3],t[4]?+t[4]:void 0):void 0}],wC=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,TC=[cC,e=>{let t=wC.exec(e);return t?pC(t[2],t[3]||`?`,+t[1]):void 0}],EC=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,DC=[lC,e=>{let t=EC.exec(e);return t?pC(t[5],t[3]||t[4]||`?`,+t[1],+t[2]):void 0}],OC=[vC,xC],kC=Or(...OC),AC=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function jC(e,{metadata:t,tunnel:n,dsn:r}){return Os({event_id:e.event_id,sent_at:new Date().toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:yo(r)}},[MC(e)])}function MC(e){return[{type:`user_report`},e]}var NC=1024,PC=`Breadcrumbs`,FC=Ql(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:PC,setup(e){t.console&&Mf(RC(e)),t.dom&&MS(LC(e,t.dom)),t.xhr&&qS(zC(e)),t.fetch&&Sg(BC(e)),t.history&&zS(VC(e)),t.sentry&&e.on(`beforeSendEvent`,IC(e))}}}));function IC(e){return function(t){F()===e&&$d({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:Gi(t)},{event:t})}}function LC(e,t){return function(n){if(F()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>NC&&(B&&N.warn(`\`dom.maxStringLength\` cannot exceed ${NC}, but a value of ${o} was configured. Sentry will use ${NC} instead.`),o=NC),typeof a==`string`&&(a=[a]);try{let e=n.event,t=HC(e)?e.target:e;r=_x(t,{keyAttrs:a,maxStringLength:o}),i=Ng(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),$d(s,{event:n.event,name:n.name,global:n.global})}}function RC(e){return function(t){if(F()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:Ff(t.level),message:zi(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${zi(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;$d(n,{input:t.args,level:t.level})}}function zC(e){return function(t){if(F()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[KS];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:hg(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),$d(d,u)}}function BC(e){return function(t){if(F()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),$d(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:hg(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),$d(s,o)}}}function VC(e){return function(t){if(F()!==e)return;let n=t.from,r=t.to,i=Ld(R.location.href),a=n?Ld(n):void 0,o=Ld(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),$d({category:`navigation`,data:{from:n,to:r}})}}function HC(e){return!!e&&!!e.target}var UC=`EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload`.split(`,`),WC=`BrowserApiErrors`,GC=Ql(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:WC,setupOnce(){t.setTimeout&&li(R,`setTimeout`,KC),t.setInterval&&li(R,`setInterval`,KC),t.requestAnimationFrame&&li(R,`requestAnimationFrame`,qC),t.XMLHttpRequest&&`XMLHttpRequest`in R&&li(XMLHttpRequest.prototype,`send`,JC);let e=t.eventTarget;e&&(Array.isArray(e)?e:UC).forEach(e=>YC(e,t))}}}));function KC(e){return function(...t){let n=t[0];return t[0]=Ey(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Nr(e)}`}}),e.apply(this,t)}}function qC(e){return function(t){return e.apply(this,[Ey(t,{mechanism:{data:{handler:Nr(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function JC(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&li(n,e,function(t){let n={mechanism:{data:{handler:Nr(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=fi(t);return r&&(n.mechanism.data.handler=Nr(r)),Ey(t,n)})}),e.apply(this,t)}}function YC(e,t){let n=R[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(li(n,`addEventListener`,function(n){return function(r,i,a){try{XC(i)&&(i.handleEvent=Ey(i.handleEvent,{mechanism:{data:{handler:Nr(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&ZC(this,r,i),n.apply(this,[r,Ey(i,{mechanism:{data:{handler:Nr(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),li(n,`removeEventListener`,function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,`__sentry_wrapped__`)){let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}}catch{}return e.call(this,t,n,r)}}))}function XC(e){return typeof e.handleEvent==`function`}function ZC(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var QC=Ql((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(R.document===void 0){B&&N.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Fl({ignoreDuration:!0});let e=!1;Lb(()=>{e||=(Rl(),!0)});let n=Da(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&Rl())}),t===`route`&&zS(({from:t,to:n})=>{t!==n&&(Fl({ignoreDuration:!0}),Rl(),e=!0)})}}}),$C=`CultureContext`,ew=Ql((()=>({name:$C,preprocessEvent(e){let t=tw();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=tw();t&&Hc(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function tw(){try{let e=R.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var nw=`GlobalHandlers`,rw=Ql(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:nw,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(iw(e),lw(`onerror`)),t.onunhandledrejection&&(aw(e),lw(`onunhandledrejection`))}}}));function iw(e){Hr(t=>{let{stackParser:n,attachStacktrace:r}=uw();if(F()!==e||wy())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=cw(Jy(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,yl(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function aw(e){Gr(t=>{let{stackParser:n,attachStacktrace:r}=uw();if(F()!==e||wy())return;let i=ow(t),a=ti(i)?sw(i):Jy(n,i,void 0,r,!0);a.level=`error`,yl(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function ow(e){if(ti(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function sw(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function cw(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:dw(t)??Mg(),function:`?`,in_app:!0}),e}function lw(e){B&&N.log(`Global Handler attached: ${e}`)}function uw(){return F()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function dw(e){if(!(!$r(e)||e.length===0))return e.startsWith(`data:`)?`<${zd(e,!1)}>`:e}var fw=Ql(()=>({name:`HttpContext`,preprocessEvent(e){if(!R.navigator&&!R.location&&!R.document)return;let t=Dy(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSpan(e){if(!R.navigator&&!R.location&&!R.document)return;let t=Dy();Hc(e,{[bte]:t.headers[`User-Agent`],...e.is_segment&&{"url.full":e.attributes?.[`sentry.op`]===`http.client`?void 0:t.url,"http.request.header.referer":t.headers.Referer}})}})),pw=`cause`,mw=5,hw=`LinkedErrors`,gw=Ql(((e={})=>{let t=e.limit||mw,n=e.key||pw;return{name:hw,preprocessEvent(e,r,i){_f(Iy,i.getOptions().stackParser,n,t,e,r)}}})),_w=/^HTML(\w*)Element$/;function vw(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(tC(e)){let t=yw(e);if(_w.test(t))return`[HTMLElement: ${_x(e)}]`}}function yw(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function bw(){return xw()?(B&&gr(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function xw(){if(R.window===void 0)return!1;let e=R;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=Mg();return!(R===R.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function Sw(e){return[sf(),nf(),Zp(),GC(),FC(),rw(),gw(),Bf(),fw(),ew(),QC()]}function Cw(e={}){let t=!e.skipBrowserExtensionCheck&&bw(),n=e.defaultIntegrations==null?Sw():e.defaultIntegrations,r={...e,enabled:!t&&e.enabled,stackParser:kr(e.stackParser||kC),integrations:ql({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||iC};return Di(vw),yd($y,r)}function ww(){}function Tw(e){e()}function Ew(e={}){let t=R.document,n=t?.head||t?.body;if(!n){B&&N.error(`[showReportDialog] Global document not defined`);return}let r=P(),i=F()?.getDsn();if(!i){B&&N.error(`[showReportDialog] DSN not configured`);return}let a={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||kl()},o=R.document.createElement(`script`);o.async=!0,o.crossOrigin=`anonymous`,o.src=Wl(i,a);let{onLoad:s,onClose:c}=a;if(s&&(o.onload=s),c){let e=t=>{if(t.data===`__sentry_reportdialog_closed__`)try{c()}finally{R.removeEventListener(`message`,e)}};R.addEventListener(`message`,e)}n.appendChild(o)}var Dw=M,Ow=`ReportingObserver`,kw=new WeakMap,Aw=Ql(((e={})=>{let t=e.types||[`crash`,`deprecation`,`intervention`];function n(e){if(kw.has(F()))for(let t of e)ka(e=>{e.setExtra(`url`,t.url);let n=`ReportingObserver [${t.type}]`,r=`No details available`;if(t.body){let n={};for(let e in t.body)n[e]=t.body[e];if(e.setExtra(`body`,n),t.type===`crash`){let e=t.body;r=[e.crashId||``,e.reason||``].join(` `).trim()||r}else r=t.body.message||r}vl(`${n}: ${r}`)})}return{name:Ow,setupOnce(){xg()&&new Dw.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(e){kw.set(e,!0)}}})),jw=`HttpClient`,Mw=Ql(((e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:jw,setup(e){Bw(e,t),Vw(e,t)}}}));function Nw(e,t,n,r,i){if(Hw(e,n.status,n.url)){let e=Ww(t,r),a,o,s,c,l=Gw();if(l.requestHeaders!==!1&&(a=Ad(Iw(e.headers),l.requestHeaders)),l.responseHeaders!==!1&&(o=Ad(Iw(n.headers),l.responseHeaders)),l.cookies!==!1){let t=e.headers.get(`Cookie`)||void 0;if(t){let e=Md(t,l.cookies);typeof e==`object`&&(s=e)}let r=n.headers.get(`Set-Cookie`)||void 0;if(r){let e=Md(r,l.cookies);typeof e==`object`&&(c=e)}}yl(Uw({url:e.url,method:e.method,status:n.status,requestHeaders:a,responseHeaders:o,requestCookies:s,responseCookies:c,error:i,type:`fetch`}))}}function Pw(e,t,n,r,i){if(Hw(e,t.status,t.responseURL)){let e,a,o,s=Gw();if(s.cookies!==!1)try{let e=t.getResponseHeader(`Set-Cookie`)||t.getResponseHeader(`set-cookie`)||void 0;if(e){let t=Md(e,s.cookies);typeof t==`object`&&(a=t)}}catch{}if(s.responseHeaders!==!1)try{o=Ad(Lw(t),s.responseHeaders)}catch{}s.requestHeaders!==!1&&(e=Ad(r,s.requestHeaders)),yl(Uw({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:o,responseCookies:a,error:i,type:`xhr`}))}}function Fw(e){if(e){let t=e[`Content-Length`]||e[`content-length`];if(t)return parseInt(t,10)}}function Iw(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}function Lw(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
|
|
494
|
-
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return n&&r&&(e[n]=r),e},{}):{}}function Rw(e,t){return e.some(e=>typeof e==`string`?t.includes(e):e.test(t))}function zw(e,t){return e.some(e=>typeof e==`number`?e===t:t>=e[0]&&t<=e[1])}function Bw(e,t){bg()&&Sg(n=>{if(F()!==e)return;let{response:r,args:i,error:a,virtualError:o}=n,[s,c]=i;r&&Nw(t,s,r,c,a||o)},!1)}function Vw(e,t){`XMLHttpRequest`in M&&qS(n=>{if(F()!==e)return;let{error:r,virtualError:i}=n,a=n.xhr,o=a[KS];if(!o)return;let{method:s,request_headers:c}=o;try{Pw(t,a,s,c,r||i)}catch(e){B&&N.warn(`Error while extracting response event form XHR response`,e)}})}function Hw(e,t,n){return zw(e.failedRequestStatusCodes,t)&&Rw(e.failedRequestTargets,n)&&!Bd(n,F())}function Uw(e){let t=F(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,i=`HTTP Client Error with status code: ${e.status}`,a={message:i,exception:{values:[{type:`Error`,value:i,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:Fw(e.responseHeaders)}}};return qi(a,{type:`auto.http.client.${e.type}`,handled:!1}),a}function Ww(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function Gw(){let e=F();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};let t=e.getOptions();if(t.dataCollection==null){let e=!!t.sendDefaultPii;return{cookies:e,requestHeaders:e,responseHeaders:e}}let{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}var Kw=M,qw=7,Jw=`ContextLines`,Yw=Ql(((e={})=>({name:Jw,processEvent(t,n,r){return Xw(t,e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??qw)}})));function Xw(e,t){let n=Kw.document,r=Kw.location&&Rd(Kw.location.href);if(!n||!r)return e;let i=e.exception?.values;if(!i?.length)return e;let a=n.documentElement.innerHTML;if(!a)return e;let o=[`<!DOCTYPE html>`,`<html>`,...a.split(`
|
|
495
|
-
`),`</html>`];return i.forEach(e=>{let n=e.stacktrace;n?.frames&&(n.frames=n.frames.map(e=>Zw(e,o,r,t)))}),e}function Zw(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||Oee(t,e,r),e}var Qw=`GraphQLClient`,$w=(e=>({name:Qw,setup(t){eT(t,e),tT(t,e)}}));function eT(e,t){e.on(`beforeOutgoingRequestSpan`,(n,r)=>{let i=L(n).data||{};if(i[`sentry.op`]!==`http.client`)return;let a=i[`url.full`]||i[`http.url`]||i.url,o=i[`http.request.method`]||i[`http.method`];if(!$r(a)||!$r(o))return;let{endpoints:s}=t,c=Vi(a,s),l=rT(r);if(c&&l){let t=sT(l);if(t){let r=nT(t);n.updateName(`${o} ${a} (${r})`),aT(t)&&e.getDataCollectionOptions().graphQL.document===!0&&n.setAttribute(jc,t.query),oT(t)&&(n.setAttribute(`graphql.persisted_query.hash.sha256`,t.extensions.persistedQuery.sha256Hash),n.setAttribute(`graphql.persisted_query.version`,t.extensions.persistedQuery.version))}}})}function tT(e,t){e.on(`beforeOutgoingRequestBreadcrumb`,(n,r)=>{let{category:i,type:a,data:o}=n;if(a===`http`&&(i===`fetch`||i===`xhr`)){let n=o?.url,{endpoints:i}=t,a=Vi(n,i),s=rT(r);if(a&&o&&s){let t=sT(s);!o.graphql&&t&&(o[`graphql.operation`]=nT(t),aT(t)&&e.getDataCollectionOptions().graphQL.document===!0&&(o[jc]=t.query),oT(t)&&(o[`graphql.persisted_query.hash.sha256`]=t.extensions.persistedQuery.sha256Hash,o[`graphql.persisted_query.version`]=t.extensions.persistedQuery.version))}}})}function nT(e){if(oT(e))return`persisted ${e.operationName}`;if(aT(e)){let{query:t,operationName:n}=e,{operationName:r=n,operationType:i}=iT(t);return r?`${i} ${r}`:`${i}`}return`unknown`}function rT(e){let t=`xhr`in e,n;if(t){let t=e.xhr[KS];n=t&&QS(t.body)[0]}else n=QS($S(e.input))[0];return n}function iT(e){let t=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=e.match(t);if(r)return{operationType:r[1],operationName:r[2]};let i=e.match(n);return i?{operationType:i[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function aT(e){return ri(e)&&typeof e.query==`string`}function oT(e){return ri(e)&&typeof e.operationName==`string`&&ri(e.extensions)&&ri(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash==`string`&&typeof e.extensions.persistedQuery.version==`number`}function sT(e){try{let t=JSON.parse(e);return aT(t)||oT(t)?t:void 0}catch{return}}var cT=Ql($w),lT=Ql((e={})=>{let t=[`script`];function n(r,i,a=0){if(!r)return;let o=`shadowRoot`in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let r of o){if(!(r instanceof HTMLElement))continue;let o=Ng(r,1)||void 0,s=r.tagName.toLowerCase();if(t.includes(s))continue;let c=e.onElement?.({element:r,componentName:o,tagName:s,depth:a})||{};if(c===`skip`)continue;if(c===`children`){n(r,i,a+1);continue}let{x:l,y:u,width:d,height:f}=r.getBoundingClientRect(),p={identifier:r.id||void 0,type:o||s,visible:!0,alpha:1,height:f,width:d,x:l,y:u,...c};p.children=[],n(r,p.children,a+1),i.push(p)}}return{name:`ViewHierarchy`,processEvent:(t,r)=>{if(t.type!==void 0||e.shouldAttach?.(t,r)===!1)return t;let i={rendering_system:`DOM`,positioning:`absolute`,windows:[]};n(e.rootElement?.()||R.document.body,i.windows);let a={filename:`view-hierarchy.json`,attachmentType:`event.view_hierarchy`,contentType:`application/json`,data:JSON.stringify(i)};return r.attachments=r.attachments||[],r.attachments.push(a),t}}}),uT=M,dT=`sentryReplaySession`,fT=`replay_event`,pT=`Unable to send Replay`,mT=3e5,hT=9e5,gT=5e3,_T=5500,vT=6e4,yT=5e3,bT=3,xT=15e4,ST=5e3,CT=3e3,wT=300,TT=2e7,ET=4999,DT=5e4,OT=36e5,kT=Object.defineProperty,AT=(e,t,n)=>t in e?kT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jT=(e,t,n)=>AT(e,typeof t==`symbol`?t:t+``,n),MT=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(MT||{});function NT(e){return e.nodeType===e.ELEMENT_NODE}function PT(e){return e?.host?.shadowRoot===e}function FT(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function IT(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),e}function LT(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function RT(e){try{let t=e.rules||e.cssRules;return t?IT(Array.from(t,BT).join(``)):null}catch{return null}}function zT(e){let t=``;for(let n=0;n<e.style.length;n++){let r=e.style,i=r[n],a=r.getPropertyPriority(i);t+=`${i}:${r.getPropertyValue(i)}${a?` !important`:``};`}return`${e.selectorText} { ${t} }`}function BT(e){let t;if(HT(e))try{t=RT(e.styleSheet)||LT(e)}catch{}else if(UT(e)){let t=e.cssText,n=e.selectorText.includes(`:`),r=typeof e.style.all==`string`&&e.style.all;if(r&&(t=zT(e)),n&&(t=VT(t)),n||r)return t}return t||e.cssText}function VT(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function HT(e){return`styleSheet`in e}function UT(e){return`selectorText`in e}var WT=class{constructor(){jT(this,`idNodeMap`,new Map),jT(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function GT(){return new WT}function KT({maskInputOptions:e,tagName:t,type:n}){return t===`OPTION`&&(t=`SELECT`),!!(e[t.toLowerCase()]||n&&e[n]||n===`password`||t===`INPUT`&&!n&&e.text)}function qT({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||``;return e?(r&&(i=r(i,t)),`*`.repeat(i.length)):i}function JT(e){return e.toLowerCase()}function YT(e){return e.toUpperCase()}var XT=`__rrweb_original__`;function ZT(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=XT in i?i[XT]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function QT(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?JT(t):null}function $T(e,t,n){return t===`INPUT`&&(n===`radio`||n===`checkbox`)?e.getAttribute(`value`)||``:e.value}function eE(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}var tE={};function nE(e){let t=tE[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return tE[e]=r.bind(window)}function rE(...e){return nE(`setTimeout`)(...e)}function iE(...e){return nE(`clearTimeout`)(...e)}function aE(e){try{return e.contentDocument}catch{}}function oE(e){try{return e.contentWindow}catch{}}var sE=1,cE=RegExp(`[^a-z0-9-_:]`),lE=-2;function uE(){return sE++}function dE(e){if(e instanceof HTMLFormElement)return`form`;let t=JT(e.tagName);return cE.test(t)?`div`:t}function fE(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var pE,mE,hE=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,gE=/^(?:[a-z+]+:)?\/\//i,_E=/^www\..*/i,vE=/^(data:)([^,]*),(.*)/i;function yE(e,t){if(!e||t.size===0)return e;try{let n=e.split(`;`),r=[];for(let e of n){if(e=e.trim(),!e)continue;let n=e.indexOf(`:`);if(n===-1){r.push(e);continue}let i=e.slice(0,n).trim();t.has(i)||r.push(e)}return r.join(`; `)+(r.length>0&&e.endsWith(`;`)?`;`:``)}catch(t){return console.warn(`Error filtering CSS properties:`,t),e}}function bE(e,t){return(e||``).replace(hE,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(gE.test(s)||_E.test(s)||vE.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${fE(t)+s}${c})`;let l=t.split(`/`),u=s.split(`/`);l.pop();for(let e of u)if(e===`.`)continue;else e===`..`?l.pop():l.push(e);return`url(${c}${l.join(`/`)}${c})`})}var xE=/^[^ \t\n\r\u000c]+/,SE=/^[, \t\n\r\u000c]+/;function CE(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(SE),!(n>=t.length);){let a=r(xE);if(a.slice(-1)===`,`)a=TE(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=TE(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}if(o)e===`)`&&(o=!1);else{if(e===`,`){n+=1,i.push((a+r).trim());break}e===`(`&&(o=!0)}r+=e,n+=1}}}return i.join(`, `)}var wE=new WeakMap;function TE(e,t){return!t||t.trim()===``?t:DE(e,t)}function EE(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function DE(e,t){let n=wE.get(e);if(n||(n=e.createElement(`a`),wE.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function OE(e,t,n,r,i,a,o){if(!r)return r;if(n===`src`||n===`href`&&(t!==`use`||r[0]!==`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&(t===`table`||t===`td`||t===`th`))return TE(e,r);if(n===`srcset`)return CE(e,r);if(n===`style`){let t=bE(r,DE(e));return o&&o.size>0&&(t=yE(t,o)),t}return t===`object`&&n===`data`?TE(e,r):typeof a==`function`?a(n,r,i):r}function kE(e,t,n){return(e===`video`||e===`audio`)&&t===`autoplay`}function AE(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function jE(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function ME(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:ME(e.parentNode,t,n,r+1)}function NE(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(jE(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function PE(e,t,n,r,i,a){try{let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName===`INPUT`){let e=o.getAttribute(`autocomplete`);if([`current-password`,`new-password`,`cc-number`,`cc-exp`,`cc-exp-month`,`cc-exp-year`,`cc-csc`].includes(e))return!0}let s=-1,c=-1;if(a){if(c=ME(o,NE(r,i)),c<0)return!0;s=ME(o,NE(t,n),c>=0?c:1/0)}else{if(s=ME(o,NE(t,n)),s<0)return!1;c=ME(o,NE(r,i),s>=0?s:1/0)}return s>=0?c>=0?s<=c:!0:c>=0?!1:!!a}catch{}return!!a}function FE(e,t,n){let r=oE(e);if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=rE(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{iE(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return rE(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function IE(e,t,n){let r=!1,i;try{i=e.sheet}catch{i=null}if(i)return;let a=rE(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{iE(a),r=!0,t()})}function LE(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:h,maskInputFn:g,dataURLOptions:_={},inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x=!1,ignoreCSSAttributes:S}=t,C=RE(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:MT.Document,childNodes:[]}:{type:MT.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:MT.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return BE(e,{doc:n,blockClass:i,blockSelector:a,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:_,inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x,rootId:C,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:S});case e.TEXT_NODE:return zE(e,{doc:n,maskAllText:s,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:h,maskInputOptions:m,maskInputFn:g,rootId:C});case e.CDATA_SECTION_NODE:return{type:MT.CDATA,textContent:``,rootId:C};case e.COMMENT_NODE:return{type:MT.Comment,textContent:e.textContent||``,rootId:C};default:return!1}}function RE(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function zE(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:a,unmaskTextSelector:o,maskTextFn:s,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,f=e.textContent,p=d===`STYLE`||void 0,m=d===`SCRIPT`||void 0,h=d===`TEXTAREA`||void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=RT(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}f=bE(f,DE(t.doc))}m&&(f=`SCRIPT_PLACEHOLDER`);let g=PE(e,r,a,i,o,n);return!p&&!m&&!h&&f&&g&&(f=s?s(f,e.parentElement):f.replace(/[\S]/g,`*`)),h&&f&&(c.textarea||g)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,`*`)),d===`OPTION`&&f&&(f=qT({isMasked:PE(e,r,a,i,o,KT({type:null,tagName:d,maskInputOptions:c})),element:e,value:f,maskInputFn:l})),{type:MT.Text,textContent:f||``,isStyle:p,rootId:u}}function BE(e,t){let{doc:n,blockClass:r,blockSelector:i,unblockSelector:a,inlineStylesheet:o,maskInputOptions:s={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:h,maskTextClass:g,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:y,ignoreCSSAttributes:b}=t,x=AE(e,r,i,a),S=dE(e),C={},w=e.attributes.length;for(let t=0;t<w;t++){let r=e.attributes[t];r.name&&!kE(S,r.name,r.value)&&(C[r.name]=OE(n,S,JT(r.name),r.value,e,c,b))}if(S===`link`&&o){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=RT(t)),r&&(C.rel=null,C.href=null,C.crossorigin=null,C._cssText=bE(r,t.href))}if(S===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){let t=RT(e.sheet);t&&(C._cssText=bE(t,DE(n)))}if(S===`input`||S===`textarea`||S===`select`||S===`option`){let t=e,n=QT(t),r=$T(t,YT(S),n),i=t.checked;if(n!==`submit`&&n!==`button`&&r){let e=PE(t,g,v,_,y,KT({type:n,tagName:YT(S),maskInputOptions:s}));C.value=qT({isMasked:e,element:t,value:r,maskInputFn:l})}i&&(C.checked=i)}if(S===`option`&&(e.selected&&!s.select?C.selected=!0:delete C.selected),S===`canvas`&&f){if(e.__context===`2d`)ZT(e)||(C.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!(`__context`in e)){let t=e.toDataURL(u.type,u.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(u.type,u.quality)&&(C.rr_dataURL=t)}}if(S===`img`&&d){pE||(pE=n.createElement(`canvas`),mE=pE.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{pE.width=t.naturalWidth,pE.height=t.naturalHeight,mE.drawImage(t,0,0),C.rr_dataURL=pE.toDataURL(u.type,u.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?C.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if((S===`audio`||S===`video`)&&(C.rr_mediaState=e.paused?`paused`:`played`,C.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),x){let{width:t,height:n}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${n}px`}}S===`iframe`&&!p(C.src)&&(!x&&!aE(e)&&(C.rr_src=C.src),delete C.src);let T;try{customElements.get(S)&&(T=!0)}catch{}return{type:MT.Element,tagName:S,attributes:C,childNodes:[],isSVG:EE(e)||void 0,needBlock:x,rootId:h,isCustom:T}}function VE(e){return e==null?``:e.toLowerCase()}function HE(e,t){return!!(t.comment&&e.type===MT.Comment||e.type===MT.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`||e.attributes.rel===`modulepreload`)||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&eE(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(VE(e.attributes.name).match(/^msapplication-tile(image|color)$/)||VE(e.attributes.name)===`application-name`||VE(e.attributes.rel)===`icon`||VE(e.attributes.rel)===`apple-touch-icon`||VE(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&VE(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(VE(e.attributes.property).match(/^(og|twitter|fb):/)||VE(e.attributes.name).match(/^(og|twitter):/)||VE(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(VE(e.attributes.name)===`robots`||VE(e.attributes.name)===`googlebot`||VE(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(VE(e.attributes.name)===`author`||VE(e.attributes.name)===`generator`||VE(e.attributes.name)===`framework`||VE(e.attributes.name)===`publisher`||VE(e.attributes.name)===`progid`||VE(e.attributes.property).match(/^article:/)||VE(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(VE(e.attributes.name)===`google-site-verification`||VE(e.attributes.name)===`yandex-verification`||VE(e.attributes.name)===`csrf-token`||VE(e.attributes.name)===`p:domain_verify`||VE(e.attributes.name)===`verify-v1`||VE(e.attributes.name)===`verification`||VE(e.attributes.name)===`shopify-checkout-api-token`))))}function UE(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:x=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w=5e3,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:te=()=>!1,newlyAddedElement:ne=!1,ignoreCSSAttributes:re}=t,{preserveWhiteSpace:ie=!0}=t,ae=LE(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:x,keepIframeSrcFn:te,newlyAddedElement:ne,ignoreCSSAttributes:re});if(!ae)return console.warn(e,`not serialized`),null;let oe;oe=r.hasNode(e)?r.getId(e):HE(ae,v)||!ie&&ae.type===MT.Text&&!ae.isStyle&&!ae.textContent.trim().length?lE:uE();let D=Object.assign(ae,{id:oe});if(r.add(e,D),oe===lE)return null;S&&S(e);let se=!f;if(D.type===MT.Element){se&&=!D.needBlock;let t=e.shadowRoot;t&&FT(t)&&(D.isShadowHost=!0)}if((D.type===MT.Document||D.type===MT.Element)&&se){v.headWhitespace&&D.type===MT.Element&&D.tagName===`head`&&(ie=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re},ne=e.childNodes?Array.from(e.childNodes):[];for(let e of ne){let n=UE(e,t);n&&D.childNodes.push(n)}if(NT(e)&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=UE(n,t);r&&(FT(e.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}if(e.parentNode&&PT(e.parentNode)&&FT(e.parentNode)&&(D.isShadow=!0),D.type===MT.Element&&D.tagName===`iframe`&&!D.needBlock&&FE(e,()=>{let t=aE(e);if(t&&C){let n=UE(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});n&&C(e,n)}},w),D.type===MT.Element&&D.tagName===`img`&&!e.complete&&D.needBlock){let t=e,n=()=>{if(t.isConnected&&!t.complete&&T)try{let e=t.getBoundingClientRect();e.width>0&&e.height>0&&T(t,D,e)}catch{}t.removeEventListener(`load`,n)};t.isConnected&&t.addEventListener(`load`,n)}return D.type===MT.Element&&D.tagName===`link`&&typeof D.attributes.rel==`string`&&(D.attributes.rel===`stylesheet`||D.attributes.rel===`preload`&&typeof D.attributes.href==`string`&&eE(D.attributes.href)===`css`)&&IE(e,()=>{if(ee){let t=UE(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});t&&ee(e,t)}},E),D.type===MT.Element&&delete D.needBlock,D}function WE(e,t){let{mirror:n=new WT,blockClass:r=`rr-block`,blockSelector:i=null,unblockSelector:a=null,maskAllText:o=!1,maskTextClass:s=`rr-mask`,unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOM:v=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:te=new Set([])}=t||{};return UE(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:s,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:y,inlineImages:f,recordCanvas:p,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E,newlyAddedElement:!1,ignoreCSSAttributes:te})}function GE(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var KE=`Please stop import mirror directly. Instead of that,\r
|
|
496
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
497
|
-
or you can use record.mirror to access the mirror instance during recording.`,qE={map:{},getId(){return console.error(KE),-1},getNode(){return console.error(KE),null},removeNodeFromMap(){console.error(KE)},has(){return console.error(KE),!1},reset(){console.error(KE)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(qE=new Proxy(qE,{get(e,t,n){return t===`map`&&console.error(KE),Reflect.get(e,t,n)}}));function JE(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(bD(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=yD(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function YE(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){yD(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>YE(e,t,a||{},!0)}function XE(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var ZE=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ZE=()=>new Date().getTime());function QE(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function $E(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function eD(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function tD(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function nD(e,t,n,r,i){if(!e)return!1;let a=tD(e);if(!a)return!1;let o=NE(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=ME(a,o),c=-1;return s<0?!1:(r&&(c=ME(a,NE(null,r))),s>-1&&c<0||s<c)}function rD(e,t){return t.getId(e)!==-1}function iD(e,t){return t.getId(e)===lE}function aD(e,t){if(PT(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:!e.parentNode||aD(e.parentNode,t):!0}function oD(e){return!!e.changedTouches}function sD(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError(`1 argument is required`);do if(this===t)return!0;while(t&&=t.parentNode);return!1})}function cD(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function lD(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function uD(e){return!!e?.shadowRoot}var dD=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function fD(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function pD(e){let t=e,n;for(;n=fD(t);)t=n;return t}function mD(e){let t=e.ownerDocument;if(!t)return!1;let n=pD(e);return t.contains(n)}function hD(e){let t=e.ownerDocument;return t?t.contains(e)||mD(e):!1}var gD={};function _D(e){let t=gD[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return gD[e]=r.bind(window)}function vD(...e){return _D(`requestAnimationFrame`)(...e)}function yD(...e){return _D(`setTimeout`)(...e)}function bD(...e){return _D(`clearTimeout`)(...e)}var xD=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(xD||{}),V=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(V||{}),SD=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(SD||{}),CD=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(CD||{}),wD=(e=>(e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`,e[e.RateChange=4]=`RateChange`,e))(wD||{}),TD;function ED(e){TD=e}function DD(){TD=void 0}for(var OD=e=>TD?((...t)=>{try{return e(...t)}catch(e){if(TD&&TD(e)===!0)return()=>{};throw e}}):e,kD=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,AD=typeof Uint8Array>`u`?[]:new Uint8Array(256),jD=0;jD<kD.length;jD++)AD[kD.charCodeAt(jD)]=jD;var MD=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function ND(e){try{return e.contentDocument}catch{}}function PD(e){try{return e.contentWindow}catch{}}var FD=class{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet>`u`||typeof CSSStyleSheet.prototype.replaceSync!=`function`)return null;try{let t=new CSSStyleSheet;t.replaceSync(`x { ${e} }`);let n=t.cssRules[0];return!n||n.type!==CSSRule.STYLE_RULE?null:n.style}catch{return null}}parseWithDetachedElement(e){let t=this.getUnattachedDoc().createElement(`span`);return t.setAttribute(`style`,e),t.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function ID(e){return`__ln`in e}var LD=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ID(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&ID(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},RD=(e,t)=>`${e}@${t}`,zD=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new LD,r=e=>{let t=e,n=lE;for(;n===lE;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!hD(i))return;let a=PT(i.parentNode)?this.mirror.getId(fD(i)):this.mirror.getId(i.parentNode),o=r(i);if(a===-1||o===-1)return n.addNode(i);let s=UE(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{cD(e,this.mirror)&&!nD(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),lD(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),uD(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{if(nD(e,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(e,t);let n=PD(e);n&&this.canvasManager.addWindow(n),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});s&&(e.push({parentId:a,nextId:o,node:s}),t.add(s.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)VD(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(let e of this.addedSet)!UD(this.droppedSet,e)&&!VD(this.removes,e,this.mirror)||UD(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(a.value.parentNode),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(r(n.value)===-1)continue;if(t!==-1){e=n;break}{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(this.mirror.getId(r)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!iD(e.target,this.mirror))switch(e.type){case`characterData`:{let t=e.target.textContent;!nD(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:PE(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,tD(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let n=QT(t),i=t.tagName;r=$T(t,i,n);let a=KT({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=qT({isMasked:PE(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a),element:t,value:r,maskInputFn:this.maskInputFn})}if(nD(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!ND(t))n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!kE(t.tagName,n)&&(i.attributes[n]=OE(this.doc,JT(t.tagName),JT(n),r,t,this.maskAttributeFn),n===`style`)){let n=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==(n?.getPropertyValue(e)||``)||a!==(n?.getPropertyPriority(e)||``)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}if(n)for(let e of Array.from(n))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}break}case`childList`:if(nD(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=PT(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);nD(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||iD(t,this.mirror)||!rD(t,this.mirror)||(this.addedSet.has(t)?(BD(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||aD(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[RD(n,r)]?BD(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:PT(e.target)&&FT(e.target)?!0:void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(iD(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[RD(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);nD(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(e=>this.genAdds(e)),uD(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){`mutationCb.blockClass.blockSelector.unblockSelector.maskAllText.maskTextClass.unmaskTextClass.maskTextSelector.unmaskTextSelector.inlineStylesheet.maskInputOptions.maskAttributeFn.maskTextFn.maskInputFn.keepIframeSrcFn.recordCanvas.inlineImages.slimDOMOptions.dataURLOptions.doc.mirror.iframeManager.stylesheetManager.shadowDomManager.canvasManager.processedNodeManager.ignoreCSSAttributes`.split(`.`).forEach(t=>{this[t]=e[t]}),this.styleDeclarationParser=new FD(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function BD(e,t){e.delete(t),t.childNodes?.forEach(t=>BD(e,t))}function VD(e,t,n){return e.length!==0&&HD(e,t,n)}function HD(e,t,n){let r=t.parentNode;for(;r;){let t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}function UD(e,t){return e.size!==0&&WD(e,t)}function WD(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:WD(e,n):!1}var GD=[];function KD(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function qD(e,t){let n=new zD;GD.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=window?.Zone?.__symbol__?.(`MutationObserver`);i&&window[i]&&(r=window[i]);let a=new r(OD(t=>{e.onMutation&&e.onMutation(t)===!1||n.processMutations.bind(n)(t)}));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function JD({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=JE(OD(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=OD(JE(OD(e=>{let t=KD(e),{clientX:n,clientY:i}=oD(e)?e.changedTouches[0]:e;s||=ZE(),o.push({x:n,y:i,id:r.getId(t),timeOffset:ZE()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?V.Drag:e instanceof MouseEvent?V.MouseMove:V.TouchMove)}),i,{trailing:!1})),u=[GE(`mousemove`,l,n),GE(`touchmove`,l,n),GE(`drag`,l,n)];return OD(()=>{u.forEach(e=>e())})}function YD({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],l=null,u=t=>o=>{let s=KD(o);if(nD(s,r,i,a,!0))return;let c=null,u=t;if(`pointerType`in o){switch(o.pointerType){case`mouse`:c=CD.Mouse;break;case`touch`:c=CD.Touch;break;case`pen`:c=CD.Pen}c===CD.Touch?SD[t]===SD.MouseDown?u=`TouchStart`:SD[t]===SD.MouseUp&&(u=`TouchEnd`):CD.Pen}else oD(o)&&(c=CD.Touch);c===null?SD[t]===SD.Click&&(c=l,l=null):(l=c,(u.startsWith(`Touch`)&&c===CD.Touch||u.startsWith(`Mouse`)&&c===CD.Mouse)&&(c=null));let d=oD(o)?o.changedTouches[0]:o;if(!d)return;let f=n.getId(s),{clientX:p,clientY:m}=d;OD(e)({type:SD[u],id:f,x:p,y:m,...c!==null&&{pointerType:c}})};return Object.keys(SD).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&s[e]!==!1).forEach(e=>{let n=JT(e),r=u(e);if(window.PointerEvent)switch(SD[e]){case SD.MouseDown:case SD.MouseUp:n=n.replace(`mouse`,`pointer`);break;case SD.TouchStart:case SD.TouchEnd:return}c.push(GE(n,r,t))}),OD(()=>{c.forEach(e=>e())})}function XD({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){return GE(`scroll`,OD(JE(OD(o=>{let s=KD(o);if(!s||nD(s,r,i,a,!0))return;let c=n.getId(s);if(s===t&&t.defaultView){let n=QE(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function ZD({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return GE(`resize`,OD(JE(OD(()=>{let t=$E(),i=eD();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var QD=[`INPUT`,`TEXTAREA`,`SELECT`],$D=new WeakMap;function eO({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:h}){function g(e){let n=KD(e),u=e.isTrusted,g=n&&YT(n.tagName);if(g===`OPTION`&&(n=n.parentElement),!n||!g||QD.indexOf(g)<0||nD(n,r,i,a,!0))return;let v=n;if(v.classList.contains(o)||s&&v.matches(s))return;let y=QT(n),b=$T(v,g,y),x=!1,S=KT({maskInputOptions:c,tagName:g,type:y}),C=PE(n,f,m,p,h,S);(y===`radio`||y===`checkbox`)&&(x=n.checked),b=qT({isMasked:C,element:n,value:b,maskInputFn:l}),_(n,d?{text:b,isChecked:x,userTriggered:u}:{text:b,isChecked:x});let w=n.name;y===`radio`&&w&&x&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(e=>{if(e!==n){let t=qT({isMasked:C,element:e,value:$T(e,g,y),maskInputFn:l});_(e,d?{text:t,isChecked:!x,userTriggered:!1}:{text:t,isChecked:!x})}})}function _(t,r){let i=$D.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){$D.set(t,r);let i=n.getId(t);OD(e)({...r,id:i})}}let v=(u.input===`last`?[`change`]:[`input`,`change`]).map(e=>GE(e,OD(g),t)),y=t.defaultView;if(!y)return()=>{v.forEach(e=>e())};let b=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,`value`),x=[[y.HTMLInputElement.prototype,`value`],[y.HTMLInputElement.prototype,`checked`],[y.HTMLSelectElement.prototype,`value`],[y.HTMLTextAreaElement.prototype,`value`],[y.HTMLSelectElement.prototype,`selectedIndex`],[y.HTMLOptionElement.prototype,`selected`]];return b&&b.set&&v.push(...x.map(e=>YE(e[0],e[1],{set(){OD(g)({target:this,isTrusted:!1})}},!1,y))),OD(()=>{v.forEach(e=>e())})}function tO(e){let t=[];function n(e,t){if(dO(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||dO(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||dO(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||dO(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function nO(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function rO({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:OD((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=nO(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:OD((r,i,a)=>{let[o]=a,{id:s,styleId:c}=nO(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:OD((r,i,a)=>{let[o]=a,{id:s,styleId:c}=nO(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:OD((r,i,a)=>{let[o]=a,{id:s,styleId:c}=nO(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};fO(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(fO(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),fO(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),fO(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:OD((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=nO(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...tO(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:OD((r,i,a)=>{let[o]=a,{id:s,styleId:c}=nO(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...tO(i),o]}]}),r.apply(i,a)})})}),OD(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function iO({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(n.host);let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),OD(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function aO({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:OD((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=nO(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:tO(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:OD((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=nO(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:tO(a.parentRule)}),i.apply(a,s)})}),OD(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function oO({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:a,doc:o}){let s=OD(o=>JE(OD(a=>{let s=KD(a);if(!s||nD(s,t,n,r,!0))return;let{currentTime:c,volume:l,muted:u,playbackRate:d}=s;e({type:o,id:i.getId(s),currentTime:c,volume:l,muted:u,playbackRate:d})}),a.media||500)),c=[GE(`play`,s(wD.Play),o),GE(`pause`,s(wD.Pause),o),GE(`seeked`,s(wD.Seeked),o),GE(`volumechange`,s(wD.VolumeChange),o),GE(`ratechange`,s(wD.RateChange),o)];return OD(()=>{c.forEach(e=>e())})}function sO({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=XE(t.fonts,`add`,function(t){return function(n){return yD(OD(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),OD(()=>{r.forEach(e=>e())})}function cO(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,selectionCb:o}=e,s=!0,c=OD(()=>{let e=t.getSelection();if(!e||s&&e?.isCollapsed)return;s=e.isCollapsed||!1;let c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=e.getRangeAt(t);nD(o,r,i,a,!0)||nD(l,r,i,a,!0)||c.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:c})});return c(),GE(`selectionchange`,c)}function lO({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:XE(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{}return e.apply(this,[n,r,i])}})}function uO(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=qD(e,e.doc));let i=JD(e),a=YD(e),o=XD(e),s=ZD(e,{win:n}),c=eO(e),l=oO(e),u=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(u=rO(e,{win:n}),d=iO(e,e.doc),f=aO(e,{win:n}),e.collectFonts&&(p=sO(e)));let m=cO(e),h=lO(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,n,t.options));return OD(()=>{GD.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(e=>e())})}function dO(e){return window[e]!==void 0}function fO(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}var pO=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},mO=class{constructor(){this.crossOriginIframeMirror=new pO(uE),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},hO=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new pO(uE),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new pO(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);let t=PD(e);t&&this.crossOriginIframeMap.set(t,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&PD(e)?.addEventListener(`message`,this.handleMessage.bind(this)),this.loadListener?.(e);let n=ND(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case xD.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:xD.IncrementalSnapshot,data:{source:V.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case xD.Meta:case xD.Load:case xD.DomContentLoaded:return!1;case xD.Plugin:return t;case xD.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case xD.IncrementalSnapshot:switch(t.data.source){case V.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case V.Drag:case V.TouchMove:case V.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case V.ViewportResize:return!1;case V.MediaInteraction:case V.MouseInteraction:case V.Scroll:case V.CanvasMutation:case V.Input:return this.replaceIds(t.data,e,[`id`]),t;case V.StyleSheetRule:case V.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case V.Font:return t;case V.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case V.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(t[i]=Array.isArray(t[i])?e.getIds(n,t[i]):e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==MT.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},gO=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},_O=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!FT(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let n=qD({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(XD({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),yD(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(iO({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let t=ND(e),n=PD(e);!t||!n||this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(XE(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&hD(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},vO=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new dD,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:BT(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},yO=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,vD(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},bO,xO;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var SO=GT();function CO(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,unblockSelector:o=null,ignoreClass:s=`rr-ignore`,ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u=`rr-mask`,unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:h,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,maxCanvasSize:x=null,packFn:S,sampling:C={},dataURLOptions:w={},mousemoveWait:T,recordDOM:ee=!0,recordCanvas:E=!1,recordCrossOriginIframes:te=!1,recordAfter:ne=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:re=!1,collectFonts:ie=!1,inlineImages:ae=!1,plugins:oe,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:se=new Set([]),errorHandler:ce,onMutation:le,getCanvasManager:ue}=e;ED(ce);let de=!te||window.parent===window,fe=!1;if(!de)try{window.parent.document&&(fe=!1)}catch{fe=!0}if(de&&!t)throw Error(`emit function is required`);if(!de&&!fe)return()=>{};T!==void 0&&C.mousemove===void 0&&(C.mousemove=T),SO.reset();let pe=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g===void 0?{}:g,me=_===!0||_===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_===`all`,headMetaDescKeywords:_===`all`}:_||{};sD();let he,ge=0,_e=e=>{for(let t of oe||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!fe&&(e=S(e)),e};bO=(e,i)=>{let a=e;if(a.timestamp=ZE(),GD[0]?.isFrozen()&&a.type!==xD.FullSnapshot&&(a.type!==xD.IncrementalSnapshot||a.data.source!==V.Mutation)&&GD.forEach(e=>e.unfreeze()),de)t?.(_e(a),i);else if(fe){let e={type:`rrweb`,event:_e(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===xD.FullSnapshot)he=a,ge=0;else if(a.type===xD.IncrementalSnapshot){if(a.data.source===V.Mutation&&a.data.isAttachIframe)return;ge++;let e=r&&ge>=r,t=n&&he&&a.timestamp-he.timestamp>n;(e||t)&&we(!0)}};let ve=e=>{bO({type:xD.IncrementalSnapshot,data:{source:V.Mutation,...e}})},O=e=>bO({type:xD.IncrementalSnapshot,data:{source:V.Scroll,...e}}),ye=e=>bO({type:xD.IncrementalSnapshot,data:{source:V.CanvasMutation,...e}}),be=new vO({mutationCb:ve,adoptedStyleSheetCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.AdoptedStyleSheet,...e}})}),k=typeof __RRWEB_EXCLUDE_IFRAME__==`boolean`&&__RRWEB_EXCLUDE_IFRAME__?new mO:new hO({mirror:SO,mutationCb:ve,stylesheetManager:be,recordCrossOriginIframes:te,wrappedEmit:bO});for(let e of oe||[])e.getMirror&&e.getMirror({nodeMirror:SO,crossOriginIframeMirror:k.crossOriginIframeMirror,crossOriginIframeStyleMirror:k.crossOriginIframeStyleMirror});let xe=new yO,Se=TO(ue,{mirror:SO,win:window,mutationCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.CanvasMutation,...e}}),recordCanvas:E,blockClass:i,blockSelector:a,unblockSelector:o,maxCanvasSize:x,sampling:C.canvas,dataURLOptions:w,errorHandler:ce}),Ce=typeof __RRWEB_EXCLUDE_SHADOW_DOM__==`boolean`&&__RRWEB_EXCLUDE_SHADOW_DOM__?new gO:new _O({mutationCb:ve,scrollCb:O,bypassOptions:{onMutation:le,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:pe,dataURLOptions:w,maskAttributeFn:v,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:ae,sampling:C,slimDOMOptions:me,iframeManager:k,stylesheetManager:be,canvasManager:Se,keepIframeSrcFn:D,processedNodeManager:xe,ignoreCSSAttributes:se},mirror:SO}),we=(e=!1)=>{if(!ee)return;bO({type:xD.Meta,data:{href:window.location.href,width:eD(),height:$E()}},e),be.reset(),Ce.init(),GD.forEach(e=>e.lock());let t=WE(document,{mirror:SO,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:pe,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,slimDOM:me,dataURLOptions:w,recordCanvas:E,inlineImages:ae,onSerialize:e=>{cD(e,SO)&&k.addIframe(e),lD(e,SO)&&be.trackLinkElement(e),uD(e)&&Ce.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{k.attachIframe(e,t);let n=PD(e);n&&Se.addWindow(n),Ce.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{be.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{ve({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:se});if(!t)return console.warn(`Failed to snapshot the document`);bO({type:xD.FullSnapshot,data:{node:t,initialOffset:QE(window)}}),GD.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,SO.getId(document))};xO=we;try{let e=[],t=e=>OD(uO)({onMutation:le,mutationCb:ve,mousemoveCb:(e,t)=>bO({type:xD.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.MouseInteraction,...e}}),scrollCb:O,viewportResizeCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.ViewportResize,...e}}),inputCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.Input,...e}}),mediaInteractionCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.MediaInteraction,...e}}),styleSheetRuleCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.StyleSheetRule,...e}}),styleDeclarationCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.StyleDeclaration,...e}}),canvasMutationCb:ye,fontCb:e=>bO({type:xD.IncrementalSnapshot,data:{source:V.Font,...e}}),selectionCb:e=>{bO({type:xD.IncrementalSnapshot,data:{source:V.Selection,...e}})},customElementCb:e=>{bO({type:xD.IncrementalSnapshot,data:{source:V.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:pe,inlineStylesheet:m,sampling:C,recordDOM:ee,recordCanvas:E,inlineImages:ae,userTriggeredOnInput:re,collectFonts:ie,doc:e,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,keepIframeSrcFn:D,blockSelector:a,unblockSelector:o,slimDOMOptions:me,dataURLOptions:w,mirror:SO,iframeManager:k,stylesheetManager:be,shadowDomManager:Ce,processedNodeManager:xe,canvasManager:Se,ignoreCSSAttributes:se,plugins:oe?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>bO({type:xD.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});k.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{we(),e.push(t(document))};return document.readyState===`interactive`||document.readyState===`complete`?n():(e.push(GE(`DOMContentLoaded`,()=>{bO({type:xD.DomContentLoaded,data:{}}),ne===`DOMContentLoaded`&&n()})),e.push(GE(`load`,()=>{bO({type:xD.Load,data:{}}),ne===`load`&&n()},window))),()=>{e.forEach(e=>e()),xe.destroy(),xO=void 0,DD()}}catch(e){console.warn(e)}}function wO(e){if(!xO)throw Error(`please take full snapshot after start recording`);xO(e)}CO.mirror=SO,CO.takeFullSnapshot=wO;function TO(e,t){try{return e?e(t):new MD}catch{return console.warn(`Unable to initialize CanvasManager`),new MD}}var EO;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(EO||={});var DO=3,OO=5;function kO(e){return e>9999999999?e:e*1e3}function AO(e){return e>9999999999?e/1e3:e}function jO(e,t){t.category!==`sentry.transaction`&&([`ui.click`,`ui.input`].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:xD.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:`breadcrumb`,payload:Oi(t,10,1e3)}}),t.category===`console`)))}var xre=`button,a`;function MO(e){return e.closest(xre)||e}function NO(e){let t=PO(e);return!t||!(t instanceof Element)?t:MO(t)}function PO(e){return Sre(e)?e.target:e}function Sre(e){return ri(e)&&`target`in e}var FO;function Cre(e){return FO||(FO=[],wre()),FO.push(e),()=>{let t=FO?FO.indexOf(e):-1;t>-1&&FO.splice(t,1)}}function wre(){li(uT,`open`,function(e){return function(...t){if(FO)try{FO.forEach(e=>e())}catch{}return e.apply(uT,t)}})}var Tre=new Set([V.Mutation,V.StyleSheetRule,V.StyleDeclaration,V.AdoptedStyleSheet,V.CanvasMutation,V.Selection,V.MediaInteraction]);function Ere(e,t,n){e.handleClick(t,n)}var Dre=class{constructor(e,t,n=jO){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){let e=Cre(()=>{this._lastMutation=IO()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(kre(t,this._ignoreSelector)||!Are(e))return;let n={timestamp:AO(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=AO(e)}registerScroll(e=Date.now()){this._lastScroll=AO(e)}registerClick(e){let t=MO(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=IO();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(let t of e){let e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:a,clickBreadcrumb:o}=e;if(i){let n=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,r=n<this._timeout*1e3?`mutation`:`timeout`,i={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.slowClickDetected`,data:{...o.data,url:uT.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:a||1}};this._addBreadcrumbEvent(t,i);return}if(a>1){let e={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.multiClick`,data:{...o.data,url:uT.location.href,route:t.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=GS(()=>this._checkClicks(),1e3)}},Ore=[`A`,`BUTTON`,`INPUT`];function kre(e,t){return!!(!Ore.includes(e.tagName)||e.tagName===`INPUT`&&![`submit`,`button`].includes(e.getAttribute(`type`)||``)||e.tagName===`A`&&(e.hasAttribute(`download`)||e.hasAttribute(`target`)&&e.getAttribute(`target`)!==`_self`)||t&&e.matches(t))}function Are(e){return!!(e.data&&typeof e.data.nodeId==`number`&&e.timestamp)}function IO(){return Date.now()/1e3}function jre(e,t){try{if(!Mre(t))return;let{source:n}=t.data;if(Tre.has(n)&&e.registerMutation(t.timestamp),n===V.Scroll&&e.registerScroll(t.timestamp),Nre(t)){let{type:n,id:r}=t.data,i=CO.mirror.getNode(r);i instanceof HTMLElement&&n===SD.Click&&e.registerClick(i)}}catch{}}function Mre(e){return e.type===DO}function Nre(e){return e.data.source===V.MouseInteraction}function LO(e){return{timestamp:Date.now()/1e3,type:`default`,...e}}var RO=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(RO||{}),Pre=new Set([`id`,`class`,`aria-label`,`role`,`name`,`alt`,`title`,`data-test-id`,`data-testid`,`disabled`,`aria-disabled`,`data-sentry-component`]);function Fre(e){let t={};!e[`data-sentry-component`]&&e[`data-sentry-element`]&&(e[`data-sentry-component`]=e[`data-sentry-element`]);for(let n in e)if(Pre.has(n)){let r=n;(n===`data-testid`||n===`data-test-id`)&&(r=`testId`),t[r]=e[n]}return t}var Ire=e=>t=>{if(!e.isEnabled())return;let n=Lre(t);if(!n)return;let r=t.name===`click`,i=r?t.event:void 0;r&&e.clickDetector&&i?.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&Ere(e.clickDetector,n,NO(t.event)),jO(e,n)};function zO(e,t){let n=CO.mirror.getId(e),r=n&&CO.mirror.getNode(n),i=r&&CO.mirror.getMeta(r),a=i&&zre(i)?i:null;return{message:t,data:a?{nodeId:n,node:{id:n,tagName:a.tagName,textContent:Array.from(a.childNodes).map(e=>e.type===RO.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(``),attributes:Fre(a.attributes)}}:{}}}function Lre(e){let{target:t,message:n}=Rre(e);return LO({category:`ui.${e.name}`,...zO(t,n)})}function Rre(e){let t=e.name===`click`,n,r=null;try{r=t?NO(e.event):PO(e.event),n=_x(r,{maxStringLength:200})||`<unknown>`}catch{n=`<unknown>`}return{target:r,message:n}}function zre(e){return e.type===RO.Element}function Bre(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=Vre(t);n&&jO(e,n)}function Vre(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a,target:o}=e;if(!o||Hre(o)||!a)return null;let s=t||r||i,c=a.length===1;if(!s&&c)return null;let l=_x(o,{maxStringLength:200})||`<unknown>`;return LO({category:`ui.keyDown`,message:l,data:{...zO(o,l).data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a}})}function Hre(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable}var Ure={resource:Jre,paint:Kre,navigation:qre};function BO(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function Wre(e){return e.map(Gre).filter(Boolean)}function Gre(e){let t=Ure[e.entryType];return t?t(e):null}function VO(e){return(($i()||uT.performance.timeOrigin)+e)/1e3}function Kre(e){let{duration:t,entryType:n,name:r,startTime:i}=e,a=VO(i);return{type:n,name:r,start:a,end:a+t,data:void 0}}function qre(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:a,encodedBodySize:o,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:m,type:h}=e;return i===0?null:{type:`${t}.${h}`,start:VO(p),end:VO(a),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:l,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:a,redirectCount:f}}}function Jre(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:a,decodedBodySize:o,encodedBodySize:s,responseStatus:c,transferSize:l}=e;return[`fetch`,`xmlhttprequest`].includes(n)?null:{type:`${t}.${n}`,start:VO(a),end:VO(i),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:s}}}function Yre(e){let t=e.entries[e.entries.length-1];return HO(e,`largest-contentful-paint`,t?.element?[t.element]:void 0)}function Xre(e){return e.sources!==void 0}function Zre(e){let t=[],n=[];for(let r of e.entries)if(Xre(r)){let e=[];for(let t of r.sources)if(t.node){n.push(t.node);let r=CO.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return HO(e,`cumulative-layout-shift`,n,t)}function Qre(e){let t=e.entries[e.entries.length-1];return HO(e,`interaction-to-next-paint`,t?.target?[t.target]:void 0)}function HO(e,t,n,r){let i=e.value,a=e.rating,o=VO(i);return{type:`web-vital`,name:t,start:o,end:o,data:{value:i,size:i,rating:a,nodeIds:n?n.map(e=>CO.mirror.getId(e)):void 0,attributions:r}}}function $re(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];return[`navigation`,`paint`,`resource`].forEach(e=>{r.push(rx(e,n))}),r.push(ex(BO(Yre,e)),$b(BO(Zre,e)),nx(BO(Qre,e))),()=>{r.forEach(e=>e())}}var H=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,eie=`var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;function tie(){let e=new Blob([eie],{type:`text/javascript`});return URL.createObjectURL(e)}var UO=[`log`,`warn`,`error`],WO=`[Replay] `;function GO(e,t=`info`){$d({category:`console`,data:{logger:`replay`},level:t,message:`${WO}${e}`},{level:t})}function nie(){let e=!1,t=!1,n={exception:()=>void 0,infoTick:()=>void 0,setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return H?(UO.forEach(e=>{n[e]=(...n)=>{N[e](WO,...n),t&&GO(n.join(``),Ff(e))}}),n.exception=(r,...i)=>{i.length&&n.error&&n.error(...i),N.error(WO,r),e?_l(r,{mechanism:{handled:!0,type:`auto.function.replay.debug`}}):t&&GO(r,`error`)},n.infoTick=(...e)=>{N.log(WO,...e),t&&setTimeout(()=>GO(e[0]),0)}):UO.forEach(e=>{n[e]=()=>void 0}),n}var U=nie(),KO=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${TT}.`)}},qO=class extends Error{constructor(){super(`Worker destroyed`)}},JO=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return`sync`}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>TT)throw new KO;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:t}of this.events)(e===null||t<e)&&(e=t);return e===null?e:kO(e)}},rie=class{constructor(e){this._onMessage=({data:e})=>{let t=e;if(typeof t.id!=`number`)return;let n=this._pending.get(t.id);if(!(!n||n.method!==t.method)){if(this._pending.delete(t.id),!t.success){H&&U.error(`Error in compression worker: `,t.response),n.reject(Error(`Error in compression worker`));return}n.resolve(t.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener(`message`,this._onMessage)}ensureReady(){return this._ensureReadyPromise||=new Promise((e,t)=>{this._worker.addEventListener(`message`,({data:n})=>{n.success?e():(H&&U.warn(`Received worker message with unsuccessful status`,n),t(Error(`Received worker message with unsuccessful status`)))},{once:!0}),this._worker.addEventListener(`error`,e=>{H&&U.warn(`Failed to load Replay compression worker`,e),t(Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.message:`Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load.`}`))},{once:!0})}),this._ensureReadyPromise}destroy(){H&&U.log(`Destroying compression worker`),this._worker.removeEventListener(`message`,this._onMessage),this._pending.forEach(e=>e.reject(new qO)),this._pending.clear(),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{this._pending.set(n,{method:e,resolve:r,reject:i});try{this._worker.postMessage({id:n,method:e,arg:t})}catch(e){this._pending.delete(n),i(e)}})}_getAndIncrementId(){return this._id++}},iie=class{constructor(e){this._worker=new rie(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return`worker`}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=kO(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>TT?Promise.reject(new KO):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage(`clear`).then(null,e=>{H&&U.exception(e,`Sending "clear" message to worker failed`,e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage(`addEvent`,e)}async _finishRequest(){let e=await this._worker.postMessage(`finish`);return this._earliestTimestamp=null,this._totalSize=0,e}},aie=class{constructor(e){this._fallback=new JO,this._compression=new iie(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){H&&U.exception(e,`Failed to load the compression worker, falling back to simple buffer`);return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(let t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){if(e instanceof qO)return;H&&U.exception(e,`Failed to add events when switching buffers.`)}}};function oie({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=sie(t);if(e)return e}return H&&U.log(`Using simple buffer`),new JO}function sie(e){try{let t=e||cie();return t?(H&&U.log(`Using compression worker${e?` from ${e}`:``}`),new aie(new Worker(t))):void 0}catch(e){H&&U.exception(e,`Failed to create compression worker`)}}function cie(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>`u`||!__SENTRY_EXCLUDE_REPLAY_WORKER__?tie():``}function YO(){try{return`sessionStorage`in uT&&!!uT.sessionStorage}catch{return!1}}function lie(e){uie(),e.session=void 0}function uie(){if(YO())try{uT.sessionStorage.removeItem(dT)}catch{}}function XO(e){return e!==void 0&&Math.random()<e}function ZO(e){if(YO())try{uT.sessionStorage.setItem(dT,JSON.stringify(e))}catch{}}function QO(e){let t=Date.now();return{id:e.id||Ui(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function die(e,t){return XO(e)?`session`:t?`buffer`:!1}function $O({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=QO({sampled:die(e,t),previousSessionId:r});return n&&ZO(i),i}function fie(){if(!YO())return null;try{let e=uT.sessionStorage.getItem(dT);if(!e)return null;let t=JSON.parse(e);return H&&U.infoTick(`Loading existing session`),QO(t)}catch{return null}}function ek(e,t,n=+new Date){return e===null||t===void 0||t<0||t!==0&&e+t<=n}function pie(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return ek(e.started,t,r)||ek(e.lastActivity,n,r)}function tk(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!pie(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled===`buffer`&&e.segmentId===0)}function nk({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let i=r.stickySession&&fie();return i?tk(i,{sessionIdleExpire:e,maxReplayDuration:t})?(H&&U.infoTick(`Session in sessionStorage is expired, creating new one...`),$O(r,{previousSessionId:i.id})):i:(H&&U.infoTick(`Creating new session`),$O(r,{previousSessionId:n}))}function mie(e){return e.type===xD.Custom}function rk(e,t,n){return ak(e,t)?(ik(e,t,n),!0):!1}function hie(e,t,n){return ak(e,t)?ik(e,t,n):Promise.resolve(null)}async function ik(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let i=e.recordingMode===`buffer`;try{n&&i&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let a=gie(t,e.getOptions().beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(t){if(!e.isEnabled())return e.handleException(t),null;let n=t&&t instanceof KO,a=n?`eventBufferOverflow`:`eventBufferError`,o=F();if(o){let e=n?`buffer_overflow`:`internal_sdk_error`;o.recordDroppedEvent(e,`replay`)}if(n&&i)return r.clear(),r.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:a})}}function ak(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=kO(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(H&&U.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function gie(e,t){try{if(typeof t==`function`&&mie(e))return t(e)}catch(e){return H&&U.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}var ok=100;function sk(e,t,n){let r=e.getContext();t&&r.traceIds.size<ok&&r.traceIds.add(t),n&&r.segmentNames.size<ok&&r.segmentNames.add(n)}function _ie(e){return t=>{e.isEnabled()&&sk(e,t.trace_id,t.name||void 0)}}function ck(e){return!e.type}function lk(e){return e.type===`transaction`}function vie(e){return e.type===`replay_event`}function uk(e){return e.type===`feedback`}function yie(e){return(t,n)=>{if(!e.isEnabled()||!ck(t)&&!lk(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(lk(t)){bie(e,t);return}xie(e,t)}}}function bie(e,t){sk(e,t.contexts?.trace?.trace_id,t.transaction)}function xie(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!==`buffer`||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r==`function`&&!r(t)||GS(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})}function Sie(e){return t=>{!e.isEnabled()||!ck(t)||Cie(e,t)}}function Cie(e,t){let n=t.exception?.values?.[0]?.value;typeof n==`string`&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&jO(e,LO({category:`replay.hydrate-error`,data:{url:Mg()}}))}function wie(e){let t=F();t&&t.on(`beforeAddBreadcrumb`,t=>Tie(e,t))}function Tie(e,t){if(!e.isEnabled()||!dk(t))return;let n=Eie(t);n&&jO(e,n)}function Eie(e){return!dk(e)||[`fetch`,`xhr`,`sentry.event`,`sentry.transaction`].includes(e.category)||e.category.startsWith(`ui.`)?null:e.category===`console`?Die(e):LO(e)}function Die(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return LO(e);let n=!1,r=t.map(e=>{if(!e)return e;if(typeof e==`string`)return e.length>ST?(n=!0,`${e.slice(0,ST)}\u2026`):e;if(typeof e==`object`)try{let t=Oi(e,7);return JSON.stringify(t).length>ST?(n=!0,`${JSON.stringify(t,null,2).slice(0,ST)}\u2026`):t}catch{}return e});return LO({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:[`CONSOLE_ARG_TRUNCATED`]}}:{}}})}function dk(e){return!!e.category}function Oie(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function fk(){let e=P().getPropagationContext().dsc;e&&delete e.replay_id;let t=as();if(t){let e=ws(t);delete e.replay_id}}function pk(e){let t=P().getPropagationContext().dsc;t&&(t.replay_id=e);let n=as();if(n){let t=ws(n);t.replay_id=e}}function kie(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:xD.Custom,timestamp:t.timestamp*1e3,data:{tag:`breadcrumb`,payload:{timestamp:t.timestamp,type:`default`,category:`sentry.feedback`,data:{feedbackId:t.event_id}}}}),!1))}function Aie(e,t){return e.recordingMode!==`buffer`||t.message===pT||!t.exception||t.type?!1:XO(e.getOptions().errorSampleRate)}function jie(e){return Object.assign((t,n)=>{if(e.session&&tk(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&fk(),!e.isEnabled()||e.isPaused())return t;if(vie(t))return delete t.breadcrumbs,t;if(!ck(t)&&!lk(t)&&!uk(t))return t;if(!e.checkAndHandleExpiredSession())return fk(),t;if(uk(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),kie(e,t),t;if(Oie(t,n)&&!e.getOptions()._experiments.captureExceptions)return H&&U.log(`Ignoring error from rrweb internals`,t),null;let r=Aie(e,t);if((r||e.recordingMode===`session`)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&e.recordingMode===`buffer`&&e.session?.sampled===`buffer`){let t=e.session;t.dirty=!0,e.getOptions().stickySession&&ZO(t)}return t},{id:`Replay`})}function mk(e,t){return t.map(({type:t,start:n,end:r,name:i,data:a})=>{let o=e.throttledAddEvent({type:xD.Custom,timestamp:n,data:{tag:`performanceSpan`,payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:a}}});return typeof o==`string`?Promise.resolve(null):o})}function Mie(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:`navigation.push`,start:r,end:r,name:n,data:{previous:t}}}function Nie(e){return t=>{if(!e.isEnabled())return;let n=Mie(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(mk(e,[n]),!1)))}}function Pie(e,t){return H&&e.getOptions()._experiments.traceInternals?!1:Bd(t,F())}function hk(e,t){e.isEnabled()&&t!==null&&(Pie(e,t.name)||e.addUpdate(()=>(mk(e,[t]),!0)))}function gk(e){if(!e)return;let t=new TextEncoder;try{if(typeof e==`string`)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=ZS(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function _k(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function vk(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta};return n.warnings=[...n.warnings||[],t],e._meta=n,e}function yk(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:a,statusCode:o,request:s,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:{method:a,statusCode:o,request:s,response:c}}}function bk(e){return{headers:{},size:e,_meta:{warnings:[`URL_SKIPPED`]}}}function xk(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:a}=Fie(n);return r.body=i,a?.length&&(r._meta={warnings:a}),r}function Sk(e,t){return Object.entries(e).reduce((n,[r,i])=>{let a=r.toLowerCase();return t.includes(a)&&e[r]&&(n[a]=i),n},{})}function Fie(e){if(!e||typeof e!=`string`)return{body:e};let t=e.length>xT,n=Iie(e);if(t){let t=e.slice(0,xT);return n?{body:t,warnings:[`MAYBE_JSON_TRUNCATED`]}:{body:`${t}\u2026`,warnings:[`TEXT_TRUNCATED`]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function Iie(e){let t=e[0],n=e[e.length-1];return t===`[`&&n===`]`||t===`{`&&n===`}`}function Ck(e,t){return Vi(Lie(e),t)}function Lie(e,t=uT.document.baseURI){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(uT.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith(`/`)&&r.endsWith(`/`)?r.slice(0,-1):r}async function Rie(e,t,n){try{let r=yk(`resource.fetch`,await Bie(e,t,n));hk(n.replay,r)}catch(e){H&&U.exception(e,`Failed to capture fetch breadcrumb`)}}function zie(e,t){let{input:n,response:r}=t,i=gk(n?$S(n):void 0),a=r?_k(r.headers.get(`content-length`)):void 0;i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}async function Bie(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r}=t,{url:o,method:s,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=Ck(o,n.networkDetailAllowUrls)&&!Ck(o,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:a,url:o,method:s,statusCode:c,request:d?Vie(n,t.input,l):bk(l),response:await Hie(d,n,t.response,u)}}function Vie({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?Gie(n,t):{};if(!e)return xk(i,r,void 0);let[a,o]=QS($S(n),U),s=xk(i,r,a);return o?vk(s,o):s}async function Hie(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&i!==void 0)return bk(i);let a=r?wk(r.headers,n):{};if(!r||!t&&i!==void 0)return xk(a,i,void 0);let[o,s]=await Wie(r),c=Uie(o,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:a});return s?vk(c,s):c}function Uie(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:i}){try{let a=e?.length&&n===void 0?gk(e):n;return r?t?xk(i,a,e):xk(i,a,void 0):bk(a)}catch(e){return H&&U.exception(e,`Failed to serialize response body`),xk(i,n,void 0)}}async function Wie(e){let t=Kie(e);if(!t)return[void 0,`BODY_PARSE_ERROR`];try{return[await qie(t)]}catch(e){return e instanceof Error&&e.message.indexOf(`Timeout`)>-1?(H&&U.warn(`Parsing text body from response timed out`),[void 0,`BODY_PARSE_TIMEOUT`]):(H&&U.exception(e,`Failed to get text body from response`),[void 0,`BODY_PARSE_ERROR`])}}function wk(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function Gie(e,t){return e.length===1&&typeof e[0]!=`string`?Tk(e[0],t):e.length===2?Tk(e[1],t):{}}function Tk(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?wk(n,t):Array.isArray(n)?{}:Sk(n,t):{}}function Kie(e){try{return e.clone()}catch(e){H&&U.exception(e,`Failed to clone response body`)}}function qie(e){return new Promise((t,n)=>{let r=GS(()=>n(Error(`Timeout while trying to read response body`)),500);Jie(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}async function Jie(e){return await e.text()}async function Yie(e,t,n){try{let r=yk(`resource.xhr`,Zie(e,t,n));hk(n.replay,r)}catch(e){H&&U.exception(e,`Failed to capture xhr breadcrumb`)}}function Xie(e,t){let{xhr:n,input:r}=t;if(!n)return;let i=gk(r),a=n.getResponseHeader(`content-length`)?_k(n.getResponseHeader(`content-length`)):eae(n.response,n.responseType);i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}function Zie(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r,input:o,xhr:s}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:f}=e.data;if(!c)return null;if(!s||!Ck(c,n.networkDetailAllowUrls)||Ck(c,n.networkDetailDenyUrls))return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:bk(d),response:bk(f)};let p=s[KS],m=p?Sk(p.request_headers,n.networkRequestHeaders):{},h=Sk(eC(s),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?QS(o,U):[void 0],[v,y]=n.networkCaptureBodies?Qie(s):[void 0],b=xk(m,d,g),x=xk(h,f,v);return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:_?vk(b,_):b,response:y?vk(x,y):x}}function Qie(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return $ie(e.response,e.responseType)}catch(e){t.push(e)}return H&&U.warn(`Failed to get xhr response body`,...t),[void 0]}function $ie(e,t){try{if(typeof e==`string`)return[e];if(e instanceof Document)return[e.body.outerHTML];if(t===`json`&&ri(e))return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return H&&U.exception(t,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return H&&U.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function eae(e,t){try{return gk(t===`json`&&ri(e)?JSON.stringify(e):e)}catch{return}}function tae(e){let t=F();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o}=e.getOptions(),s={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o};t&&t.on(`beforeAddBreadcrumb`,(e,t)=>nae(s,e,t))}catch{}}function nae(e,t,n){if(t.data)try{rae(t)&&aae(n)&&(Xie(t,n),Yie(t,n,e)),iae(t)&&oae(n)&&(zie(t,n),Rie(t,n,e))}catch(e){H&&U.exception(e,`Error when enriching network breadcrumb`)}}function rae(e){return e.category===`xhr`}function iae(e){return e.category===`fetch`}function aae(e){return e?.xhr}function oae(e){return e?.input!==void 0}function sae(e){let t=F();MS(Ire(e)),zS(Nie(e)),wie(e),tae(e),Pl(jie(e)),t&&(t.on(`beforeSendEvent`,Sie(e)),t.on(`afterSendEvent`,yie(e)),t.on(`createDsc`,t=>{let n=e.getSessionId();n&&e.isEnabled()&&e.recordingMode===`session`&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on(`processSegmentSpan`,_ie(e)),t.on(`spanStart`,t=>{e.lastActiveSpan=t}),t.on(`spanEnd`,t=>{e.lastActiveSpan=t}),t.on(`beforeSendFeedback`,async(t,n)=>{let r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&(t.contexts.feedback.source===`api`&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on(`openFeedbackWidget`,async()=>{await e.sendBufferedReplayOrFlush()}))}async function cae(e){try{return Promise.all(mk(e,[lae(uT.performance.memory)]))}catch{return[]}}function lae(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:`memory`,name:`memory`,start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function uae(e,t,n){return tte(e,t,{...n,setTimeoutImpl:GS})}var Ek=M.navigator;function dae(){return/iPhone|iPad|iPod/i.test(Ek?.userAgent??``)||/Macintosh/i.test(Ek?.userAgent??``)&&Ek?.maxTouchPoints&&Ek?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function fae(e){let t=!1;return(n,r)=>{try{if(!e.checkAndHandleExpiredSession()){H&&U.warn(`Received replay event after session expired.`);return}let i=r||!t;t=!0,pae(n),e.clickDetector&&jre(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode===`buffer`&&i&&e.setInitialState(),!rk(e,n,i))return!0;if(!i)return!1;let t=e.session;if(hae(e,i),e.recordingMode===`buffer`&&t&&e.eventBuffer&&!t.dirty){let n=e.eventBuffer.getEarliestTimestamp();n&&(H&&U.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&ZO(t))}return t?.previousSessionId||e.recordingMode===`session`&&e.flush(),!0})}catch(t){e.handleException(t)}}}function pae(e){let t=e.data;if(!(e.type!==xD.IncrementalSnapshot||!t||typeof t!=`object`||!(`source`in t)||t.source!==V.Mutation||!(`attributes`in t)||!Array.isArray(t.attributes)))for(let e of t.attributes){let t=CO.mirror.getNode(e.id),n=t&&CO.mirror.getMeta(t);if(n?.type===RO.Element)for(let[t,r]of Object.entries(e.attributes))r===null?delete n.attributes[t]:n.attributes[t]=r}}function mae(e){let t=e.getOptions();return{type:xD.Custom,timestamp:Date.now(),data:{tag:`options`,payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type===`worker`:!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function hae(e,t){!t||e.session?.segmentId!==0||rk(e,mae(e),!1)}function gae(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function _ae(e,t,n,r){return Os(Us(e,Hs(e),r,n),[[{type:`replay_event`},e],[{type:`replay_recording`,length:typeof t==`string`?new TextEncoder().encode(t).length:t.length},t]])}function vae({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
498
|
-
`;if(typeof e==`string`)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}async function yae({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:typeof e._integrations==`object`&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit(`preprocessEvent`,r,i);let a=await ol(e.getOptions(),r,i,t,e,Da());if(!a)return null;e.emit(`postprocessEvent`,a,i),a.platform=a.platform||`javascript`;let{name:o,version:s,settings:c}=e.getSdkMetadata()?.sdk||{};return a.sdk={...a.sdk,name:o||`sentry.javascript.unknown`,version:s||`0.0.0`,settings:c},a}async function bae({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:a}){let o=vae({recordingData:e,headers:{segment_id:n}}),{urls:s,errorIds:c,traceIds:l,segmentNames:u,initialTimestamp:d}=r,f=F(),p=P(),m=f?.getTransport(),h=f?.getDsn();if(!f||!m||!h||!a.sampled)return Promise.resolve({});let g=await yae({scope:p,client:f,replayId:t,event:{type:fT,replay_start_timestamp:d/1e3,timestamp:i/1e3,error_ids:c,trace_ids:l,segment_names:u,urls:s,replay_id:t,segment_id:n,replay_type:a.sampled}});if(!g)return f.recordDroppedEvent(`event_processor`,`replay`),H&&U.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;let _=_ae(g,o,h,f.getOptions().tunnel),v;try{v=await m.send(_)}catch(e){let t=Error(pT);try{t.cause=e}catch{}throw t}let y=Bu({},v);if(zu(y,`replay`))throw new Ok(y);if(typeof v.statusCode==`number`&&(v.statusCode<200||v.statusCode>=300))throw new Dk(v.statusCode);return v}var Dk=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},Ok=class extends Error{constructor(e){super(`Rate limit hit`),this.rateLimits=e}},kk=class extends Error{constructor(){super(`Session is too long, not sending replay`)}};async function Ak(e,t={count:0,interval:yT}){let{recordingData:n,onError:r}=e;if(n.length)try{return await bae(e),!0}catch(n){if(n instanceof Dk||n instanceof Ok)throw n;if(bl(`Replays`,{_retryCount:t.count}),r&&r(n),t.count>=bT){let e=Error(`${pT} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{GS(async()=>{try{await Ak(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}var jk=`__THROTTLED`,xae=`__SKIPPED`;function Sae(e,t,n){let r=new Map,i=e=>{let t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})},a=()=>[...r.values()].reduce((e,t)=>e+t,0),o=!1;return(...n)=>{let s=Math.floor(Date.now()/1e3);if(i(s),a()>=t){let e=o;return o=!0,e?xae:jk}o=!1;let c=r.get(s)||0;return r.set(s,c+1),e(...n)}}var Cae=class{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode=`session`,this.timeouts={sessionIdlePause:mT,sessionIdleExpire:hT},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:``},this._recordingOptions=t,this._options=e,this._debouncedFlush=uae(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Sae((e,t)=>hie(this,e,t),300,5);let{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(CT,n),timeout:n,scrollTimeout:wT,ignoreSelector:r?r.join(`,`):``}:void 0;if(i&&(this.clickDetector=new Dre(this,i)),H){let t=e._experiments;U.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{uT.document.visibilityState===`visible`?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let e=LO({category:`ui.blur`});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{let e=LO({category:`ui.focus`});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{Bre(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){H&&U.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;if(this._requiresManualStart=r,!r){if(this._initializeSessionForSampling(e),!this.session){H&&U.exception(Error(`Unable to initialize and create session`));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled===`buffer`&&this.session.segmentId===0?`buffer`:`session`,H&&U.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode===`session`){H&&U.log(`Recording is already in progress`);return}if(this._isEnabled&&this.recordingMode===`buffer`){H&&U.log("Buffering is in progress, call `flush()` to save the replay");return}H&&U.infoTick(`Starting replay in session mode`),this._updateUserActivity();let e=nk({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode=`session`,this._initializeRecording()}startBuffering(){if(this._isEnabled){H&&U.log("Buffering is in progress, call `flush()` to save the replay");return}H&&U.infoTick(`Starting replay in buffer mode`);let e=nk({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode=`buffer`,this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=CO({...this._recordingOptions,...this.recordingMode===`buffer`?{checkoutEveryNms:vT}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:fae(this),...dae(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&=(this._stopRecording(),void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode=`buffer`;let n=t??`manual`;F()?.emit(`replayEnd`,{sessionId:this.session?.id,reason:n});try{H&&U.log(`Stopping Replay triggered by ${n}`),fk(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,lie(this)}catch(e){this.handleException(e)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),H&&U.log(`Pausing replay`))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),H&&U.log(`Resuming replay`))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode===`session`)return this.flushImmediate();let t=Date.now();H&&U.log(`Converting buffer to session`),await this.flushImmediate();let n=this.stopRecording();!e||!n||this.recordingMode!==`session`&&(this.recordingMode=`session`,this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession(),pk(this.session.id)),this.startRecording())}addUpdate(e){let t=e();this.recordingMode===`buffer`||!this._isEnabled||t!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode===`buffer`?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&ek(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled===`session`){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${uT.location.pathname}${uT.location.hash}${uT.location.search}`,t=`${uT.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===jk){let e=LO({category:`replay.throttled`});this.addUpdate(()=>!rk(this,{type:OO,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastActiveSpan||as(),t=e&&rs(e),n=(t&&L(t).data||{})[Ma];if(!(!t||!n||![`route`,`custom`].includes(n)))return L(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=oie({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&F()?.emit(`replayStart`,{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode===`session`&&this.session&&pk(this.session.id)}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0,n=nk({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;let e=this.session;return!tk(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:`sessionExpired`}),this.initializeSampling(e.id))}_addListeners(){try{uT.document.addEventListener(`visibilitychange`,this._handleVisibilityChange),uT.addEventListener(`blur`,this._handleWindowBlur),uT.addEventListener(`focus`,this._handleWindowFocus),uT.addEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||=(sae(this),!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=$re(this)}_removeListeners(){try{uT.document.removeEventListener(`visibilitychange`,this._handleVisibilityChange),uT.removeEventListener(`blur`,this._handleWindowBlur),uT.removeEventListener(`focus`,this._handleWindowFocus),uT.removeEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(this.session){if(tk(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){fk();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){H&&U.log(`Document has become active, but session has expired`);return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:xD.Custom,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e}})})}_addPerformanceEntries(){let e=Wre(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(mk(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){H&&U.error(`No session or eventBuffer found to flush.`);return}if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await cae(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new kk;let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession(),await Ak({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:`sendError`});let t=F();if(t){let n;n=e instanceof Ok?`ratelimit_backoff`:e instanceof kk?`invalid`:`send_error`,t.recordDroppedEvent(n,`replay`)}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){H&&U.error(`Attempting to finish replay event after session expired.`);return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){H&&U.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?`short`:`long`}, not sending replay.`),r&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&H&&U.log(`Flushing initial segment without checkout.`);let o=!!this._flushLock;this._flushLock||=this._runFlush();try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,o&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&ZO(this.session)}_onMutationHandler(e){let{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{let n=gae(e.target),r=t.join(`,`);return n?.matches(r)}))return!1;let n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=r&&n>r;if(n>i||a){let e=LO({category:`replay.mutations`,data:{count:n,limit:a}});this._createCustomBreadcrumb(e)}return!a||(this.stop({reason:`mutationLimit`,forceFlush:this.recordingMode===`session`}),!1)}};function Mk(e,t){return[...e,...t].join(`,`)}function wae({mask:e,unmask:t,block:n,unblock:r,ignore:i}){return{maskTextSelector:Mk(e,[`.sentry-mask`,`[data-sentry-mask]`]),unmaskTextSelector:Mk(t,[]),blockSelector:Mk(n,[`.sentry-block`,`[data-sentry-block]`,`base`,`iframe[srcdoc]:not([src])`]),unblockSelector:Mk(r,[]),ignoreSelector:Mk(i,[`.sentry-ignore`,`[data-sentry-ignore]`,`input[type="file"]`])}}function Tae({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:a}){if(i.unmaskTextSelector&&e.matches(i.unmaskTextSelector))return a;let o=n.includes(t),s=r&&t===`value`&&e.tagName===`INPUT`&&[`submit`,`button`].includes(e.getAttribute(`type`)||``);return o||s?a.replace(/[\S]/g,`*`):a}var Nk=`img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]`,Eae=[`content-length`,`content-type`,`accept`],Dae=Symbol.for(`sentry__originalRequestBody`),Pk=!1,Fk=!1;function Oae(){if(typeof Request>`u`||Fk)return;let e=Request;try{let t=function(t,n){let r=new e(t,n);return n?.body!=null&&(r[Dae]=n.body),r};t.prototype=e.prototype,M.Request=t,Fk=!0}catch{}}var Ik=(e=>new kae(e)),kae=class{constructor({flushMinDelay:e=gT,flushMaxDelay:t=_T,minReplayDuration:n=ET,maxReplayDuration:r=OT,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:s={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:f=1e4,slowClickTimeout:p=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:h=[],networkDetailDenyUrls:g=[],networkCaptureBodies:_=!0,networkRequestHeaders:v=[],networkResponseHeaders:y=[],mask:b=[],maskAttributes:x=[`title`,`placeholder`,`aria-label`],unmask:S=[],block:C=[],unblock:w=[],ignore:T=[],maskFn:ee,beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re=!1}={}){this.name=`Replay`;let ie=wae({mask:b,unmask:S,block:C,unblock:w,ignore:T});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:ee,maskInputFn:ee,maskAttributeFn:(e,t,n)=>Tae({maskAttributes:x,maskAllText:c,privacyOptions:ie,key:e,value:t,el:n}),...ie,slimDOMOptions:`all`,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!s.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,DT),maxReplayDuration:Math.min(r,OT),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:f,slowClickTimeout:p,slowClickIgnoreSelectors:m,networkDetailAllowUrls:h,networkDetailDenyUrls:g,networkCaptureBodies:_,networkRequestHeaders:Lk(v),networkResponseHeaders:Lk(y),beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re,_experiments:s},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Nk}`:Nk,this._recordingOptions.ignoreCSSAttributes=new Set([`background-image`])),this._isInitialized&&cu())throw Error(`Multiple Sentry Session Replay instances are not supported`);this._isInitialized=!0}get _isInitialized(){return Pk}set _isInitialized(e){Pk=e}afterAllSetup(e){!cu()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&Oae(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(e){return this._replay?this._replay.stop({forceFlush:e?.flush??this._replay.recordingMode===`session`,reason:`manual`}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){let t=this.getReplayId(!0);t&&(Hc(e,{"sentry.replay_id":t}),this.getRecordingMode()===`buffer`&&Hc(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let t=Aae(this._initialOptions,e);this._replay=new Cae({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let t=e.getIntegrationByName(`ReplayCanvas`);if(!t)return;this._replay._canvas=t.getOptions()}catch{}}};function Aae(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},i=Eo(n.replaysSessionSampleRate),a=Eo(n.replaysOnErrorSampleRate);return i==null&&a==null&&gr(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),i!=null&&(r.sessionSampleRate=i),a!=null&&(r.errorSampleRate=a),r}function Lk(e){return[...Eae,...e.map(e=>e.toLowerCase())]}function jae(){return F()?.getIntegrationByName(`Replay`)}var Mae=Object.defineProperty,Nae=(e,t,n)=>t in e?Mae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rk=(e,t,n)=>Nae(e,typeof t==`symbol`?t:t+``,n),Pae=class{constructor(){Rk(this,`idNodeMap`,new Map),Rk(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Fae(){return new Pae}function Iae(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function zk(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:zk(e.parentNode,t,n,r+1)}function Bk(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(Iae(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var Vk=`Please stop import mirror directly. Instead of that,\r
|
|
499
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
500
|
-
or you can use record.mirror to access the mirror instance during recording.`,Hk={map:{},getId(){return console.error(Vk),-1},getNode(){return console.error(Vk),null},removeNodeFromMap(){console.error(Vk)},has(){return console.error(Vk),!1},reset(){console.error(Vk)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Hk=new Proxy(Hk,{get(e,t,n){return t===`map`&&console.error(Vk),Reflect.get(e,t,n)}}));function Uk(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){Yk(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Uk(e,t,a||{},!0)}function Wk(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function Lae(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Gk(e,t,n,r,i){if(!e)return!1;let a=Lae(e);if(!a)return!1;let o=Bk(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=zk(a,o),c=-1;return s<0?!1:(r&&(c=zk(a,Bk(null,r))),s>-1&&c<0||s<c)}var Kk={};function qk(e){let t=Kk[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return Kk[e]=r.bind(window)}function Jk(...e){return qk(`requestAnimationFrame`)(...e)}function Yk(...e){return qk(`setTimeout`)(...e)}var Xk=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(Xk||{}),Zk;function Rae(e){Zk=e}for(var Qk=e=>Zk?((...t)=>{try{return e(...t)}catch(e){if(Zk&&Zk(e)===!0)return()=>{};throw e}}):e,$k=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,zae=typeof Uint8Array>`u`?[]:new Uint8Array(256),eA=0;eA<$k.length;eA++)zae[$k.charCodeAt(eA)]=eA;var Bae=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=$k[t[n]>>2],i+=$k[(t[n]&3)<<4|t[n+1]>>4],i+=$k[(t[n+1]&15)<<2|t[n+2]>>6],i+=$k[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},tA=new Map;function Vae(e,t){let n=tA.get(e);return n||(n=new Map,tA.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var nA=(e,t,n)=>{if(!e||!(aA(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=Vae(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function rA(e,t,n){if(e instanceof Array)return e.map(e=>rA(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:Bae(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[rA(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:`HTMLImageElement`,src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[rA(e.data,t,n),e.width,e.height]}:aA(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:nA(e,t,n)}:e}var iA=(e,t,n)=>e.map(e=>rA(e,t,n)),aA=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function Hae(e,t,n,r,i){let a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!=`function`)continue;let o=Wk(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...o){return Gk(this.canvas,n,r,i,!0)||Yk(()=>{let n=iA(o,t,this);e(this.canvas,{type:Xk[`2D`],property:s,args:n})},0),a.apply(this,o)}});a.push(o)}catch{let n=Uk(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:Xk[`2D`],property:s,args:[t],setter:!0})}});a.push(n)}return()=>{a.forEach(e=>e())}}function Uae(e){return e===`experimental-webgl`?`webgl`:e}function oA(e,t,n,r,i){let a=[];try{let o=Wk(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(a,...o){if(!Gk(this,t,n,r,!0)){let e=Uae(a);if(`__context`in this||(this.__context=e),i&&[`webgl`,`webgl2`].includes(e))if(o[0]&&typeof o[0]==`object`){let e=o[0];e.preserveDrawingBuffer||=!0}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a,...o])}});a.push(o)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{a.forEach(e=>e())}}function sA(e,t,n,r,i,a,o,s){let c=[],l=Object.getOwnPropertyNames(e);for(let o of l)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(o))try{if(typeof e[o]!=`function`)continue;let l=Wk(e,o,function(e){return function(...c){let l=e.apply(this,c);if(nA(l,s,this),`tagName`in this.canvas&&!Gk(this.canvas,r,i,a,!0)){let e=iA(c,s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});c.push(l)}catch{let r=Uk(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(r)}return c}function Wae(e,t,n,r,i,a){let o=[];return o.push(...sA(t.WebGLRenderingContext.prototype,Xk.WebGL,e,n,r,i,a,t)),t.WebGL2RenderingContext!==void 0&&o.push(...sA(t.WebGL2RenderingContext.prototype,Xk.WebGL2,e,n,r,i,a,t)),()=>{o.forEach(e=>e())}}var Gae=`for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};`;function Kae(){let e=new Blob([Gae]);return URL.createObjectURL(e)}var qae=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};let{enableManualSnapshot:t,sampling:n=`all`,win:r,recordCanvas:i,errorHandler:a}=e;e.sampling=n,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,a&&Rae(a),(i&&typeof n==`number`||t)&&(this.worker=this.initFPSWorker()),this.addWindow(r),!t&&Qk(()=>{i&&n===`all`&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof n==`number`&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(e){let{sampling:t=`all`,blockClass:n,blockSelector:r,unblockSelector:i,recordCanvas:a,enableManualSnapshot:o}=this.options;if(!this.windowsSet.has(e)){if(o){this.windowsSet.add(e),this.windows.push(new WeakRef(e));return}Qk(()=>{if(a&&t===`all`&&this.initCanvasMutationObserver(e,n,r,i),a&&typeof t==`number`){let t=oA(e,n,r,i,!0);this.restoreHandlers.push(()=>{t()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,t){if(t?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,e);return}Jk(t=>this.takeSnapshot(t,!0,e))}initFPSWorker(){let e=new Worker(Kae());return e.onmessage=e=>{let t=e.data,{id:n}=t;if(this.snapshotInProgressMap.set(n,!1),!(`base64`in t))return;let{base64:r,type:i,width:a,height:o}=t;this.mutationCb({id:n,type:Xk[`2D`],commands:[{property:`clearRect`,args:[0,0,a,o]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:r}],type:i}]},0,0,a,o]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;let t=n=>{this.takeSnapshot(n,!1),e=Jk(t)};e=Jk(t),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,t,n,r){let i=oA(e,t,n,r,!1),a=Hae(this.processMutation.bind(this),e,t,n,r),o=Wae(this.processMutation.bind(this),e,t,n,r,this.mirror);this.restoreHandlers.push(()=>{i(),a(),o()})}getCanvasElements(e,t,n){let r=[],i=i=>{i.querySelectorAll(`canvas`).forEach(i=>{Gk(i,e,t,n,!0)||r.push(i)})};for(let e of this.windows){let t=e.deref(),n;try{n=t&&t.document}catch{}n&&i(n)}for(let e of this.shadowDoms){let t=e.deref();t&&i(t)}return r}takeSnapshot(e,t,n){let{sampling:r,blockClass:i,blockSelector:a,unblockSelector:o,dataURLOptions:s,maxCanvasSize:c}=this.options,l=1e3/(r===`all`?2:r||2);return this.lastSnapshotTime&&e-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=e,(n?[n]:this.getCanvasElements(i,a,o)).forEach(e=>{let n=this.mirror.getId(e);if(!(!this.mirror.hasNode(e)||!e.width||!e.height||this.snapshotInProgressMap.get(n))){if(this.snapshotInProgressMap.set(n,!0),!t&&[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}createImageBitmap(e).then(t=>{this.worker?.postMessage({id:n,bitmap:t,width:e.width,height:e.height,dataURLOptions:s,maxCanvasSize:c},[t])}).catch(e=>{Qk(()=>{throw this.snapshotInProgressMap.delete(n),e})()})}}),!0)}startPendingCanvasMutationFlusher(){Jk(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,Jk(e)};Jk(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),Jk(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}};try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}Fae();var Jae;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Jae||={});var cA={low:{sampling:{canvas:1},dataURLOptions:{type:`image/webp`,quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:`image/webp`,quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:`image/webp`,quality:.5}}},Yae=`ReplayCanvas`,lA=1280,Xae=Ql(((e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||`medium`,enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,lA):lA,n?Math.min(n,lA):lA]},i,a,o=new Promise(e=>a=e);return{name:Yae,getOptions(){let{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{let r=new qae({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{typeof e==`object`&&(e.__rrweb__=!0)}catch{}}});return i=r,a(r),r},...cA[e]||cA.medium}},async snapshot(e,t){(i||await o).snapshot(e,t)}}}));function Zae(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function uA(e){try{return new URL(e,R.location.origin).href}catch{return}}function Qae(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function dA(e){try{return new Headers(e)}catch{return}}var fA={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function pA(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:o,onRequestSpanStart:s,onRequestSpanEnd:c}={...fA,...t},l=typeof i==`function`?i:e=>!0,u=e=>eoe(e,o),d={},f=e.getOptions().propagateTraceparent;n&&Sg(t=>{let n=Qp(t,l,u,d,{propagateTraceparent:f,onRequestSpanEnd:c});if(n){let r=uA(t.fetchData.url),i=r?Ld(r).host:void 0,o=r?zd(r):void 0;n.setAttributes({[Mc]:o,[zc]:o,"server.address":i}),a&&mA(n,e),s?.(n,{headers:t.headers})}}),r&&qS(t=>{let n=toe(t,l,u,d,f,c);n&&(a&&mA(n,e),s?.(n,{headers:dA(t.xhr.__sentry_xhr_v3__?.request_headers)}))})}var $ae=300;function mA(e,t){let{url:n}=L(e).data;if(!n||typeof n!=`string`)return;let r=()=>void setTimeout(i);if($s(t)){let t=e.end.bind(e);e.end=e=>{let n=e??Zi(),a=!1,o=()=>{a||(a=!0,setTimeout(i),t(n),clearTimeout(s))};r=o;let s=setTimeout(o,$ae)}}let i=rx(`resource`,({entries:t})=>{t.forEach(t=>{Qae(t)&&t.name.endsWith(n)&&(e.setAttributes(Px(t)),r())})})}function eoe(e,t){let n=Mg();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?Vi(r.toString(),t)||a&&Vi(r.pathname,t):a}{let n=!!e.match(/^\/(?!\/)/);return t?Vi(e,t):n}}function toe(e,t,n,r,i,a){let o=e.xhr,s=o?.[KS];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=us()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(Qa(n,s.status_code),n.end(),a?.(n,{headers:dA(eC(o)),error:e.error})),delete r[t]);return}let d=uA(c),f=Ld(d||c),p=d?zd(d):void 0,m=zd(Rd(c)),h=F(),g=!!as(),_=g||!!h&&$s(h),v=u&&_?cc({name:`${l} ${m}`,attributes:{url:zd(c),type:`xhr`,"http.method":l,"http.url":p,[zc]:p,"server.address":f?.host,[I]:`auto.http.browser`,[Fa]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new _s,y=bc(v)&&g?void 0:v;return u&&!_&&h?.recordDroppedEvent(`no_parent_span`,`span`),o.__sentry_xhr_span_id__=v.spanContext().spanId,r[o.__sentry_xhr_span_id__]=v,n(c)&&noe(o,us()&&_?y:void 0,i),h&&h.emit(`beforeOutgoingRequestSpan`,v,e),v}function noe(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=Yd({span:t,propagateTraceparent:n});r&&roe(e,r,i,a)}function roe(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.[`sentry-trace`]||!e.setRequestHeader))try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!Zae(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}var hA=new WeakMap,gA=new WeakMap,ioe=9e4,aoe=[`text/event-stream`,`application/x-ndjson`,`application/stream+json`],_A=Ql(()=>({name:`FetchStreamPerformance`,setup(){Cg(e=>{if(e.response){let t=hA.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=gA.get(e.response);n&&clearTimeout(n)}}}),Sg(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get(`content-type`)||``;if(e.response.headers?.get(`content-length`)||!aoe.some(e=>t.startsWith(e)))return;let n=e.fetchData?.url||``,r=e.fetchData?.method||`GET`,i=Fd(n),a=cc({name:`${r} ${n.startsWith(`data:`)?zd(n):i?Id(i):n}`,startTime:e.endTimestamp,attributes:{url:zd(n),"http.method":r,type:`fetch`,[Fa]:`http.client.stream`,[I]:`auto.http.browser.stream`}});hA.set(e.response,a);let o=setTimeout(()=>{a.isRecording()&&a.end()},ioe);gA.set(e.response,o)}})}})),ooe=`WebVitals`,vA=Ql((e={})=>{let t=new Set(e.ignore??[]);return{name:ooe,setup(n){let r=$s(n),{enableStandaloneClsSpans:i,enableStandaloneLcpSpans:a}=e._experiments??{},o=r||t.has(`cls`)?void 0:i||!1,s=r||t.has(`lcp`)?void 0:a||!1,c=Vx({recordClsStandaloneSpans:o,recordLcpStandaloneSpans:s,client:n}),l=new WeakSet;n.on(`afterStartPageLoadSpan`,e=>{l.add(e)}),n.on(`spanEnd`,e=>{l.delete(e)&&(c(),Xx(e,{recordClsOnPageloadSpan:o===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(t.has(`lcp`)||SS(n),t.has(`cls`)||wS(n),t.has(`inp`)||ES()):t.has(`inp`)||hS()},afterAllSetup(){t.has(`inp`)||bS()}}});function soe(){R.document?R.document.addEventListener(`visibilitychange`,()=>{let e=as();if(!e)return;let t=rs(e);if(R.document.hidden&&t){let e=`cancelled`,{op:n,status:r}=L(t);B&&N.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}}):B&&N.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var yA=`sentry_previous_trace`,coe=`sentry.previous_trace`;function loe(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?foe():void 0;e.on(`spanStart`,e=>{if(rs(e)!==e)return;let t=P().getPropagationContext();i=uoe(i,e,t),r&&doe(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=P(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(bA(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=bA(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[Pa]:i.sampleRate}})}function uoe(e,t,n){let r=L(t);function i(){try{let e=Number(r.data?.[`sentry.sample_rate`]??n.dsc?.sample_rate);return Number.isNaN(e)?0:e}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(B&&N.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Ya]:`previous_trace`}}),t.setAttribute(coe,`${o.traceId}-${o.spanId}-${+!!bA(o)}`)),a)}function doe(e){try{R.sessionStorage.setItem(yA,JSON.stringify(e))}catch(e){B&&N.warn(`Could not store previous trace in sessionStorage`,e)}}function foe(){try{let e=R.sessionStorage?.getItem(yA);return JSON.parse(e)}catch{return}}function bA(e){return e.traceFlags===1}var poe=`BrowserTracing`,moe=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function xA(){let e=R.navigator;return e?.userAgent?moe.test(e.userAgent):!1}var hoe={...xc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...fA},SA=((e={})=>{`enableElementTiming`in e&&gr(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=R.document,{enableInp:r,enableLongTask:i,enableLongAnimationFrame:a,_experiments:{enableInteractions:o,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:u,finalTimeout:d,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,instrumentPageLoad:x,instrumentNavigation:S,detectRedirects:C,linkPreviousTrace:w,consistentTraceSampling:T,enableReportPageLoaded:ee,onRequestSpanStart:E,onRequestSpanEnd:te}={...hoe,...e},ne=xA(),re,ie;function ae(e,r,i=!0,a){let o=r.op===`pageload`,s=r.name,c=l?l(r):r,p=Fd(a||Mg()),m={...p?.pathname&&{"url.path":p.pathname},...p&&!Pd(p)&&{"url.full":p.href},...c.attributes};if(s!==c.name&&(m[Ma]=`custom`),c.attributes=m,!i){let e=Xi();cc({...c,startTime:e}).end(e);return}t.name=c.name,t.source=m[Ma];let h=Sc(c,{idleTimeout:u,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:o,beforeSpanEnd:t=>{Yx(t,{ignoreResourceSpans:y,ignorePerformanceApiSpans:b,spanStreamingEnabled:$s(e)}),kA(e,void 0);let n=P(),r=n.getPropagationContext();n.setPropagationContext({...r,traceId:h.spanContext().traceId,sampled:Jo(h),dsc:ws(t)}),o&&(ie=void 0)},trimIdleSpanEndTimestamp:!ee});o&&ee&&(ie=h),kA(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&(e.emit(`idleSpanEnableAutoFinish`,h),n.removeEventListener(`readystatechange`,g))}o&&!ee&&n&&(n.addEventListener(`readystatechange`,g),g())}return{name:poe,setup(e){if(ne){B&&N.log(`[Tracing] Skipping browserTracingIntegration setup for bot user agent.`);return}if(ls(),a&&M.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?Ux():i&&Hx(),o&&Wx(),C&&n){let e=()=>{re=Zi()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function t(){let t=OA(e);t&&!L(t).timestamp&&(B&&N.log(`[Tracing] Finishing current active span with op: ${L(t).op}`),t.setAttribute(Ia,`cancelled`),t.end())}e.on(`startNavigationSpan`,(n,r)=>{if(F()!==e)return;if(r?.isRedirect){B&&N.warn(`[Tracing] Detected redirect, navigation span will not be the root span, but a child span.`),ae(e,{op:`navigation.redirect`,...n},!1,r.url);return}re=void 0,t();let i=P();i.setPropagationContext({traceId:na(),sampleRand:Math.random(),propagationSpanId:us()?void 0:ra()}),i.setSDKProcessingMetadata({normalizedRequest:void 0}),ae(e,{op:`navigation`,...n,parentSpan:null,forceTransaction:!0},!0,r?.url)}),e.on(`startPageLoadSpan`,(n,r={})=>{if(F()!==e)return;t();let i=ko(r.sentryTrace||TA(`sentry-trace`)||EA(`sentry-trace`),r.baggage||TA(`baggage`)||EA(`baggage`)),a=P();a.setPropagationContext(i),us()||(a.getPropagationContext().propagationSpanId=ra()),a.setSDKProcessingMetadata({normalizedRequest:Dy()}),ae(e,{op:`pageload`,...n})}),e.on(`endPageloadSpan`,()=>{ee&&ie&&(ie.setAttribute(Ia,`reportPageLoaded`),ie.end())})},afterAllSetup(e){if(ne)return;e.addIntegration&&!e.getIntegrationByName?.(`WebVitals`)&&e.addIntegration(vA({ignore:r?[]:[`inp`],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c}}));let n=Mg();if(w!==`off`&&loe(e,{linkPreviousTrace:w,consistentTraceSampling:T}),R.location){if(x){let t=$i();CA(e,{name:R.location.pathname,startTime:t?t/1e3:void 0,attributes:{[Ma]:`url`,[I]:`auto.pageload.browser`}})}S&&zS(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=Fd(t),a=OA(e),o=a&&C&&_oe(a,re);wA(e,{name:i?.pathname||R.location.pathname,attributes:{[Ma]:`url`,[I]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}p&&soe(),o&&goe(e,u,d,f,t),pA(e,{traceFetch:m,traceXHR:h,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:E,onRequestSpanEnd:te}),g&&e.addIntegration(_A())}}});function CA(e,t,n){e.emit(`startPageLoadSpan`,t,n),P().setTransactionName(t.name);let r=OA(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function wA(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i,url:r}),e.emit(`startNavigationSpan`,t,{isRedirect:i,url:r});let a=P();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...Dy(),url:r}}),OA(e)}function TA(e){return(R.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function EA(e){return(R.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function goe(e,t,n,r,i){let a=R.document,o;a&&addEventListener(`click`,()=>{let a=`ui.action.click`,s=OA(e);if(s){let e=L(s).op;if([`navigation`,`pageload`].includes(e)){B&&N.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&=(o.setAttribute(Ia,`interactionInterrupted`),o.end(),void 0),!i.name){B&&N.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Sc({name:i.name,op:a,attributes:{[Ma]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})},{capture:!0})}var DA=`_sentry_idleSpan`;function OA(e){return e[DA]}function kA(e,t){ui(e,DA,t)}var AA=1.5;function _oe(e,t){let n=L(e),r=Xi();return!(r-n.start_timestamp>AA||t&&r-t<=AA)}function voe(e=F()){e?.emit(`endPageloadSpan`)}function yoe(e){let t=as();if(t===e)return;let n=P();e.end=new Proxy(e.end,{apply(e,r,i){return sa(n,t),Reflect.apply(e,r,i)}}),sa(n,e)}var boe=Ql(()=>({name:`SpanStreaming`,beforeSetup(e){let t=e.getOptions();t.traceLifecycle||=(B&&N.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),`stream`)},setup(e){let t=`SpanStreaming integration requires`,n=`Falling back to static trace lifecycle.`,r=e.getOptions();if(!$s(e)){r.traceLifecycle=`static`,B&&N.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let i=r.beforeSendSpan;if(i&&!Ds(i)){r.traceLifecycle=`static`,B&&N.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let a=new mg(e);e.on(`afterSpanEnd`,t=>{Jo(t)&&a.add(xte(t,e))}),e.on(`afterSegmentSpanEnd`,e=>{let t=e.spanContext().traceId;setTimeout(()=>{a.flush(t)},500)})}}));function jA(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function xoe(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=jA(n);return e=>r.then(n=>e(n.transaction(t,`readwrite`).objectStore(t)))}function MA(e){return jA(e.getAllKeys())}function Soe(e,t,n){return e(e=>MA(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.max(...r,0)+1),jA(e.transaction)}))}function Coe(e,t,n){return e(e=>MA(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.min(...r,0)-1),jA(e.transaction)}))}function woe(e){return e(e=>MA(e).then(t=>{let n=t[0];if(n!=null)return jA(e.get(n)).then(t=>(e.delete(n),jA(e.transaction).then(()=>t)))}))}function Toe(e){let t;function n(){return t??=xoe(e.dbName||`sentry-offline`,e.storeName||`queue`),t}return{push:async t=>{try{let r=Ps(t);await Soe(n(),r,e.maxQueueSize||30)}catch{}},unshift:async t=>{try{let r=Ps(t);await Coe(n(),r,e.maxQueueSize||30)}catch{}},shift:async()=>{try{let e=await woe(n());if(e)return Is(e)}catch{}}}}function Eoe(e){return t=>{let n=e({...t,createStore:Toe});return R.addEventListener(`online`,async e=>{await n.flush()}),n}}function Doe(e=iC){return Eoe(Cd(e))}var NA=1e6,Ooe=`window`in M&&M.window===M&&typeof importScripts>`u`,PA=`0`,FA=Ooe?`main`:`worker`,IA=R.navigator,LA=``,RA=``,zA=``,BA=IA?.userAgent||``,VA=``,koe=IA?.language||IA?.languages?.[0]||``;function Aoe(e){return typeof e==`object`&&!!e&&`getHighEntropyValues`in e}var HA=IA?.userAgentData;Aoe(HA)&&HA.getHighEntropyValues([`architecture`,`model`,`platform`,`platformVersion`,`fullVersionList`]).then(e=>{if(LA=e.platform||``,zA=e.architecture||``,VA=e.model||``,RA=e.platformVersion||``,e.fullVersionList?.length){let t=e.fullVersionList[e.fullVersionList.length-1];BA=`${t.brand} ${t.version}`}}).catch(e=>void 0);function joe(e){return!(`thread_metadata`in e)}function Moe(e){return joe(e)?Roe(e):e}function Noe(e){let t=e.contexts?.trace?.trace_id;return typeof t==`string`&&t.length!==32&&B&&N.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t==`string`?t:``}function Poe(e,t,n,r){if(r.type!==`transaction`)throw TypeError(`Profiling events may only be attached to transactions, this should never occur.`);if(n==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let i=Noe(r),a=Moe(n),o=t||(typeof r.start_timestamp==`number`?r.start_timestamp*1e3:Zi()*1e3),s=typeof r.timestamp==`number`?r.timestamp*1e3:Zi()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:`javascript`,version:`1`,release:r.release||``,environment:r.environment||`production`,runtime:{name:`javascript`,version:R.navigator.userAgent},os:{name:LA,version:RA,build_number:BA},device:{locale:koe,model:VA,manufacturer:BA,architecture:zA,is_emulator:!1},debug_meta:{images:WA(n.resources)},profile:a,transactions:[{name:r.transaction||``,id:r.event_id||Ui(),trace_id:i,active_thread_id:PA,relative_start_ns:`0`,relative_end_ns:((s-o)*1e6).toFixed(0)}]}}function Foe(e,t,n){if(e==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);let r=Loe(e),i=t.getOptions(),a=t.getSdkMetadata?.()?.sdk;return{chunk_id:Ui(),client_sdk:{name:a?.name??`sentry.javascript.browser`,version:a?.version??`0.0.0`},profiler_id:n||Ui(),platform:`javascript`,version:`2`,release:i.release??``,environment:i.environment??`production`,debug_meta:{images:WA(e.resources)},profile:r}}function Ioe(e){try{if(!e||typeof e!=`object`)return{reason:`chunk is not an object`};let t=e=>typeof e==`string`&&/^[a-f0-9]{32}$/.test(e);if(!t(e.profiler_id))return{reason:`missing or invalid profiler_id`};if(!t(e.chunk_id))return{reason:`missing or invalid chunk_id`};if(!e.client_sdk)return{reason:`missing client_sdk metadata`};let n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:`profile has no frames`}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:`profile has no stacks`}:!Array.isArray(n.samples)||!n.samples.length?{reason:`profile has no samples`}:{valid:!0}:{reason:`missing profile data`}}catch(e){return{reason:`unknown validation error: ${e}`}}}function Loe(e){let t=[];for(let n=0;n<e.frames.length;n++){let r=e.frames[n];r&&(t[n]={function:r.name,abs_path:typeof r.resourceId==`number`?e.resources[r.resourceId]:void 0,lineno:r.line,colno:r.column})}let n=[];for(let t=0;t<e.stacks.length;t++){let r=e.stacks[t];if(!r)continue;let i=[],a=r;for(;a;)i.push(a.frameId),a=a.parentId===void 0?void 0:e.stacks[a.parentId];n[t]=i}let r=$i(),i=typeof performance.timeOrigin==`number`?performance.timeOrigin:r||0,a=i-(r||i),o=[];for(let t=0;t<e.samples.length;t++){let n=e.samples[t];if(!n)continue;let r=(i+(n.timestamp-a))/1e3;o[t]={stack_id:n.stackId??0,thread_id:PA,timestamp:r}}return{frames:t,stacks:n,samples:o,thread_metadata:{[PA]:{name:FA}}}}function UA(e){return L(e).op===`pageload`}function Roe(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[PA]:{name:FA}}},i=e.samples[0];if(!i)return r;let a=i.timestamp,o=$i(),s=typeof performance.timeOrigin==`number`?performance.timeOrigin:o||0,c=s-(o||s);return e.samples.forEach((i,o)=>{if(i.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[o]={elapsed_since_start_ns:((i.timestamp+c-a)*NA).toFixed(0),stack_id:t,thread_id:PA};return}let s=e.stacks[i.stackId],l=[];for(;s;){l.push(s.frameId);let t=e.frames[s.frameId];t&&r.frames[s.frameId]===void 0&&(r.frames[s.frameId]={function:t.name,abs_path:typeof t.resourceId==`number`?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),s=s.parentId===void 0?void 0:e.stacks[s.parentId]}let u={elapsed_since_start_ns:((i.timestamp+c-a)*NA).toFixed(0),stack_id:n,thread_id:PA};r.stacks[n]=l,r.samples[o]=u,n++}),r}function zoe(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:`profile`},n]);return e}function Boe(e){let t=[];return As(e,(e,n)=>{if(n===`transaction`)for(let n=1;n<e.length;n++)e[n]?.contexts?.profile?.profile_id&&t.push(e[n])}),t}function WA(e){let t=F()?.getOptions()?.stackParser;return t?al(t,e):[]}function GA(e){return typeof e!=`number`&&typeof e!=`boolean`||typeof e==`number`&&isNaN(e)?(B&&N.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(B&&N.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function Voe(e){return e.samples.length<2?(B&&N.log(`[Profiling] Discarding profile because it contains less than 2 samples`),!1):e.frames.length?!0:(B&&N.log(`[Profiling] Discarding profile because it contains no frames`),!1)}var KA=!1,qA=3e4;function Hoe(e){return typeof e==`function`}function JA(){let e=R.Profiler;if(!Hoe(e)){B&&N.log(`[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.`);return}let t=Math.floor(qA/10);try{return new e({sampleInterval:10,maxBufferSize:t})}catch{B&&(N.log(`[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.`),N.log(`[Profiling] Disabling profiling for current user session.`)),KA=!0}}function YA(e){if(KA)return B&&N.log(`[Profiling] Profiling has been disabled for the duration of the current user session.`),!1;if(!e.isRecording())return B&&N.log(`[Profiling] Discarding profile because root span was not sampled.`),!1;let t=F()?.getOptions();if(!t)return B&&N.log(`[Profiling] Profiling disabled, no options found.`),!1;let n=t.profilesSampleRate;return GA(n)?n?n===!0||Math.random()<n||(B&&N.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(n)})`),!1):(B&&N.log(`[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0`),!1):(B&&N.warn(`[Profiling] Discarding profile because of invalid sample rate.`),!1)}function Uoe(e){if(KA)return B&&N.log(`[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started.`),!1;if(e.profileLifecycle!==`trace`&&e.profileLifecycle!==`manual`)return B&&N.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let t=e.profileSessionSampleRate;return GA(t)?t?Math.random()<=t:(B&&N.log(`[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0`),!1):(B&&N.warn(`[Profiling] Discarding profile because of invalid profileSessionSampleRate.`),!1)}function XA(e){return e.profilesSampleRate!==void 0}function Woe(e,t,n,r){return Voe(n)?Poe(e,t,n,r):null}var ZA=new Map;function Goe(){return ZA.size}function Koe(e){let t=ZA.get(e);return t&&ZA.delete(e),t}function qoe(e,t){if(ZA.set(e,t),ZA.size>30){let e=ZA.keys().next().value;e!==void 0&&ZA.delete(e)}}var QA=new WeakSet;function $A(e){e.setAttribute(`thread.id`,PA),e.setAttribute(`thread.name`,FA)}function ej(e){let t;UA(e)&&(t=Zi()*1e3);let n=JA();if(!n)return;B&&N.log(`[Profiling] started profiling span: ${L(e).description}`);let r=Ui(),i=null;P().setContext(`profile`,{profile_id:r,start_timestamp:t}),QA.add(e),$A(e);async function a(){if(e&&n){if(i){B&&N.log(`[Profiling] profile for:`,L(e).description,`already exists, returning early`);return}return n.stop().then(t=>{if(o&&=(R.clearTimeout(o),void 0),B&&N.log(`[Profiling] stopped profiling of span: ${L(e).description}`),!t){B&&N.log(`[Profiling] profiler returned null profile for: ${L(e).description}`,`this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started`);return}i=t,qoe(r,t)}).catch(e=>{B&&N.log(`[Profiling] error while stopping profiler:`,e)})}}let o=R.setTimeout(()=>{B&&N.log(`[Profiling] max profile duration elapsed, stopping profiling for:`,L(e).description),a()},qA),s=e.end.bind(e);function c(){return e?(a().then(()=>{s()},()=>{s()}),e):s()}e.end=c}var Joe=6e4,Yoe=3e5,Xoe=class{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(e){let t=e.getOptions().profileLifecycle,n=Uoe(e.getOptions());B&&N.log(`[Profiling] Initializing profiler (lifecycle='${t}').`),n||B&&N.log(`[Profiling] Session not sampled. Skipping lifecycle profiler initialization.`),this._profilerId=Ui(),this._client=e,this._sessionSampled=n,this._lifecycleMode=t,t===`trace`&&this._setupTraceLifecycleListeners(e),e.on(`spanStart`,e=>{this._isRunning&&$A(e)})}start(){if(this._lifecycleMode===`trace`){B&&N.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){B&&N.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){B&&N.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode===`trace`){B&&N.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){B&&N.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(e){if(this._lifecycleMode!==`trace`||!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(B&&N.log(`[Profiling] Detected already active root span during setup. Active root spans now:`,n),this._beginProfiling()),this._isRunning&&$A(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,B&&N.log(`[Profiling] Started profiling with profiler ID:`,this._profilerId),Oa().setContext(`profile`,{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){B&&N.log(`[Profiling] Failed to start JS Profiler; stopping.`),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&=(clearTimeout(this._chunkTimer),void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{B&&N.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),this._lifecycleMode===`manual`&&Oa().setContext(`profile`,{}))}_setupTraceLifecycleListeners(e){e.on(`spanStart`,e=>{if(!this._sessionSampled){B&&N.log(`[Profiling] Span not profiled because of negative sampling decision for user session.`);return}if(e!==rs(e))return;if(!e.isRecording()){B&&N.log(`[Profiling] Discarding profile because root span was not sampled.`);return}let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(B&&N.log(`[Profiling] Root span ${t} started. Profiling active while there are active root spans (count=${n}).`),this._beginProfiling())}),e.on(`spanEnd`,e=>{if(!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||!this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.delete(t);let n=this._activeRootSpanIds.size;B&&N.log(`[Profiling] Root span with ID ${t} ended. Will continue profiling for as long as there are active root spans (currently: ${n}).`),n===0&&(this._collectCurrentChunk().catch(e=>{B&&N.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",e)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,Oa().setContext(`profile`,{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);let t=setTimeout(()=>this._onRootSpanTimeout(e),Yoe);this._rootSpanTimeouts.set(e,t)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=JA();if(!e){B&&N.log(`[Profiling] Failed to start JS Profiler.`);return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{B&&N.error(`[Profiling] Failed to collect current profile chunk during periodic chunking:`,e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},Joe))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(B&&N.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let e=this._profiler;if(this._profiler=void 0,e)try{let t=Foe(await e.stop(),this._client,this._profilerId),n=Ioe(t);if(`reason`in n){B&&N.log(`[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):`,n.reason);return}this._sendProfileChunk(t),B&&N.log(`[Profiling] Collected browser profile chunk.`)}catch(e){B&&N.log(`[Profiling] Error while stopping JS Profiler for chunk:`,e)}}_sendProfileChunk(e){let t=this._client,n=Hs(t.getSdkMetadata?.()),r=t.getDsn(),i=t.getOptions().tunnel,a=Os({event_id:Ui(),sent_at:new Date().toISOString(),...n&&{sdk:n},...!!i&&r&&{dsn:yo(r)}},[[{type:`profile_chunk`,platform:`javascript`},e]]);t.sendEnvelope(a).then(null,e=>{B&&N.error(`Error while sending profile chunk envelope:`,e)})}},Zoe=`BrowserProfiling`,Qoe=Ql((()=>({name:Zoe,setup(e){let t=e.getOptions(),n=new Xoe;if(!XA(t)&&!t.profileLifecycle&&(t.profileLifecycle=`manual`),XA(t)&&!t.profilesSampleRate){B&&N.log(`[Profiling] Profiling disabled, no profiling options found.`);return}let r=as(),i=r&&rs(r);if(XA(t)&&t.profileSessionSampleRate!==void 0&&B&&N.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),XA(t))i&&UA(i)&&YA(i)&&ej(i),e.on(`spanStart`,e=>{let t=rs(e);e===t?YA(e)&&ej(e):QA.has(t)&&$A(e)}),e.on(`beforeEnvelope`,e=>{if(!Goe())return;let t=Boe(e);if(!t.length)return;let n=[];for(let e of t){let t=e?.contexts,r=t?.profile?.profile_id,i=t?.profile?.start_timestamp;if(typeof r!=`string`){B&&N.log(`[Profiling] cannot find profile for a span without a profile context`);continue}if(!r){B&&N.log(`[Profiling] cannot find profile for a span without a profile context`);continue}t?.profile&&delete t.profile;let a=Koe(r);if(!a){B&&N.log(`[Profiling] Could not retrieve profile for span: ${r}`);continue}let o=Woe(r,i,a,e);o&&n.push(o)}zoe(e,n)});else{let r=t.profileLifecycle;if(e.on(`startUIProfiler`,()=>n.start()),e.on(`stopUIProfiler`,()=>n.stop()),r===`manual`)n.initialize(e);else if(r===`trace`){if(!us(t)){B&&N.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),i&&n.notifyRootSpanActive(i),R.setTimeout(()=>{let e=as(),t=e&&rs(e);t&&n.notifyRootSpanActive(t)},0)}}}}))),$oe=`SpotlightBrowser`,ese=[{op:`ui.interaction.click`,name:`#sentry-spotlight`}],tse=((e={})=>{let t=e.sidecarUrl||`http://localhost:8969/stream`;return{name:$oe,setup:()=>{B&&N.log(`Using Sidecar URL`,t)},beforeSetup(e){let t=e.getOptions();t.ignoreSpans=[...t.ignoreSpans||[],...ese]},afterAllSetup:e=>{nse(e,t)}}});function nse(e,t){let n=US(`fetch`),r=0;e.on(`beforeEnvelope`,e=>{if(r>3){N.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:`,r);return}n(t,{method:`POST`,body:Ps(e),headers:{"Content-Type":`application/x-sentry-envelope`},mode:`cors`}).then(e=>{e.status>=200&&e.status<400&&(r=0)},e=>{r++,N.error(`Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/`,e)})})}var rse=Ql(tse),ise=Ql(()=>({name:`LaunchDarkly`,processEvent(e,t,n){return Up(e)}}));function ase(){return{name:`sentry-flag-auditor`,type:`flag-used`,synchronous:!0,method:(e,t,n)=>{Wp(e,t.value),Kp(e,t.value)}}}var ose=Ql(()=>({name:`OpenFeature`,processEvent(e,t,n){return Up(e)}})),sse=class{after(e,t){Wp(t.flagKey,t.value),Kp(t.flagKey,t.value)}error(e,t,n){Wp(e.flagKey,e.defaultValue),Kp(e.flagKey,e.defaultValue)}},cse=Ql(({featureFlagClientClass:e})=>({name:`Unleash`,setupOnce(){let t=e.prototype;li(t,`isEnabled`,lse)},processEvent(e,t,n){return Up(e)}}));function lse(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`?(Wp(n,r),Kp(n,r)):B&&N.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var use=(({growthbookClass:e})=>Jp({growthbookClass:e})),dse=Ql(({featureFlagClient:e})=>({name:`Statsig`,setup(t){e.on(`gate_evaluation`,e=>{Wp(e.gate.name,e.gate.value),Kp(e.gate.name,e.gate.value)})},processEvent(e,t,n){return Up(e)}}));async function fse(){let e=F();if(!e)return`no-client-active`;if(!e.getDsn())return`no-dsn-configured`;let t=e.getOptions().tunnel||`https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7`;try{await uc(()=>fetch(t,{body:`{}`,method:`POST`,mode:`cors`,credentials:`omit`}))}catch{return`sentry-unreachable`}}var pse=`WebWorker`,mse=Ql(({worker:e})=>({name:pse,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(e=>tj(e))},addWorker:e=>tj(e)}));function tj(e){e.addEventListener(`message`,e=>{if(_se(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(B&&N.log(`Sentry debugId web worker message received`,e.data),R._sentryDebugIds={...e.data._sentryDebugIds,...R._sentryDebugIds}),e.data._sentryModuleMetadata&&(B&&N.log(`Sentry module metadata web worker message received`,e.data),R._sentryModuleMetadata={...e.data._sentryModuleMetadata,...R._sentryModuleMetadata}),e.data._sentryWasmImages){B&&N.log(`Sentry WASM images web worker message received`,e.data);let t=R._sentryWasmImages||[],n=e.data._sentryWasmImages.filter(e=>ni(e)&&typeof e.code_file==`string`&&!t.some(t=>t.code_file===e.code_file));R._sentryWasmImages=[...t,...n]}e.data._sentryWorkerError&&(B&&N.log(`Sentry worker rejection message received`,e.data._sentryWorkerError),hse(e.data._sentryWorkerError))}})}function hse(e){let t=F();if(!t)return;let n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,i=e.reason,a=ti(i)?sw(i):Jy(n,i,void 0,r,!0);a.level=`error`,e.filename&&(a.contexts={...a.contexts,worker:{filename:e.filename}}),yl(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.web_worker.onunhandledrejection`}}),B&&N.log(`Captured worker unhandled rejection`,i)}function gse({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener(`unhandledrejection`,t=>{let n={reason:ow(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:n}),B&&N.log(`[Sentry Worker] Forwarding unhandled rejection to parent`,n)}),B&&N.log(`[Sentry Worker] Registered worker with unhandled rejection handling`)}function _se(e){if(!ni(e)||e._sentryMessage!==!0)return!1;let t=`_sentryDebugIds`in e,n=`_sentryModuleMetadata`in e,r=`_sentryWorkerError`in e,i=`_sentryWasmImages`in e;return!(!t&&!n&&!r&&!i||t&&!(ni(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(ni(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!ni(e._sentryWorkerError)||i&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(e=>ni(e)&&typeof e.code_file==`string`)))}function vse(e){return ni(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function nj(e){let t={...e};Jd(t,`react`),bl(`react`,{version:k.version});let n=Cw(t);return Di(yse),n}function yse(e){return vse(e)?`[SyntheticEvent]`:vw(e)}function bse(e){let t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function xse(e,t){let n=new WeakSet;function r(e,t){if(!n.has(e)){if(e.cause)return n.add(e),r(e.cause,t);e.cause=t}}r(e,t)}function rj(e,{componentStack:t},n){if(bse(k.version)&&Jr(e)&&t){let n=Error(e.message);n.name=`React ErrorBoundary ${e.name}`,n.stack=t,xse(e,n)}return _l(e,n)}function Sse(e){return(t,n)=>{let r=!!e,i=rj(t,n,{mechanism:{handled:r,type:`auto.function.react.error_handler`}});r&&e(t,n,i)}}var ij=`ui.react.render`,Cse=`ui.react.update`,aj=`ui.react.mount`,wse={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Tse={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ese={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},oj={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Dse=Symbol.for(`react.forward_ref`),sj=Symbol.for(`react.memo`);function Ose(e){return typeof e==`object`&&!!e&&e.$$typeof===sj}var cj={};cj[Dse]=Ese,cj[sj]=oj;function lj(e){if(Ose(e))return oj;let t=e.$$typeof;return t&&cj[t]||wse}var kse=Object.defineProperty.bind(Object),Ase=Object.getOwnPropertyNames.bind(Object),uj=Object.getOwnPropertySymbols?.bind(Object),dj=Object.getOwnPropertyDescriptor.bind(Object),jse=Object.getPrototypeOf.bind(Object),fj=Object.prototype;function pj(e,t,n){if(typeof t!=`string`){if(fj){let n=jse(t);n&&n!==fj&&pj(e,n)}let n=Ase(t);uj&&(n=n.concat(uj(t)));let r=lj(e),i=lj(t);for(let a of n)if(!Tse[a]&&!i?.[a]&&!r?.[a]&&!dj(e,a)){let n=dj(t,a);if(n)try{kse(e,a,n)}catch{}}}return e}var mj=class extends k.Component{constructor(e){super(e);let{name:t,disabled:n=!1}=this.props;n||(this._mountSpan=cc({name:`<${t}>`,onlyIfParent:!0,op:aj,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":t}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:e,includeUpdates:t=!0}){if(t&&this._mountSpan&&e!==this.props.updateProps){let t=Object.keys(e).filter(t=>e[t]!==this.props.updateProps[t]);if(t.length>0){let e=Zi();this._updateSpan=lc(this._mountSpan,()=>cc({name:`<${this.props.name}>`,onlyIfParent:!0,op:Cse,startTime:e,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":this.props.name,"ui.react.changed_props":t}}))}}return!0}componentDidUpdate(){this._updateSpan&&=(this._updateSpan.end(),void 0)}componentWillUnmount(){let e=Zi(),{name:t,includeRender:n=!0}=this.props;if(this._mountSpan&&n){let n=L(this._mountSpan).timestamp;lc(this._mountSpan,()=>{let r=cc({onlyIfParent:!0,name:`<${t}>`,op:ij,startTime:n,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":t}});r&&r.end(e)})}}render(){return this.props.children}};Object.assign(mj,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function Mse(e,t){let n=t?.name||e.displayName||e.name||`unknown`,r=r=>k.createElement(mj,{...t,name:n,updateProps:r},k.createElement(e,{...r}));return r.displayName=`profiler(${n})`,pj(r,e),r}function Nse(e,t={disabled:!1,hasRenderSpan:!0}){let[n]=k.useState(()=>{if(!t?.disabled)return cc({name:`<${e}>`,onlyIfParent:!0,op:aj,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":e}})});k.useEffect(()=>(n&&n.end(),()=>{if(n&&t.hasRenderSpan){let t=L(n).timestamp,r=Zi(),i=cc({name:`<${e}>`,onlyIfParent:!0,op:ij,startTime:t,attributes:{[I]:`auto.ui.react.profiler`,"ui.component_name":e}});i&&i.end(r)}}),[])}var hj=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,gj={componentStack:null,error:null,eventId:null},_j=class extends k.Component{constructor(e){super(e),this.state=gj,this._openFallbackReportDialog=!0;let t=F();t&&e.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=t.on(`afterSendEvent`,t=>{!t.type&&this._lastEventId&&t.event_id===this._lastEventId&&Ew({...e.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(e,t){let{componentStack:n}=t,{beforeCapture:r,onError:i,showDialog:a,dialogOptions:o}=this.props;ka(s=>{r&&r(s,e,n);let c=rj(e,t,{mechanism:{handled:this.props.handled==null?!!this.props.fallback:this.props.handled,type:`auto.function.react.error_boundary`}});i&&i(e,n,c),a&&(this._lastEventId=c,this._openFallbackReportDialog&&Ew({...o,eventId:c})),this.setState({error:e,componentStack:n,eventId:c})})}componentDidMount(){let{onMount:e}=this.props;e&&e()}componentWillUnmount(){let{error:e,componentStack:t,eventId:n}=this.state,{onUnmount:r}=this.props;r&&(this.state===gj?r(null,null,null):r(e,t,n)),this._cleanupHook&&=(this._cleanupHook(),void 0)}resetErrorBoundary(){let{onReset:e}=this.props,{error:t,componentStack:n,eventId:r}=this.state;e&&e(t,n,r),this.setState(gj)}render(){let{fallback:e,children:t}=this.props,n=this.state;if(n.componentStack===null)return typeof t==`function`?t():t;let r=typeof e==`function`?k.createElement(e,{error:n.error,componentStack:n.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:n.eventId}):e;return k.isValidElement(r)?r:(e&&hj&&N.warn(`fallback did not produce a valid ReactElement`),null)}};function Pse(e,t){let n=e.displayName||e.name||`unknown`,r=k.memo(n=>k.createElement(_j,{...t},k.createElement(e,{...n})));return r.displayName=`errorBoundary(${n})`,pj(r,e),r}var Fse=`redux.action`,Ise=`info`,Lse={attachReduxState:!0,actionTransformer:e=>e,stateTransformer:e=>e||null};function Rse(e){let t={...Lse,...e};return e=>(n,r)=>{t.attachReduxState&&Oa().addEventProcessor((e,t)=>{try{e.type===void 0&&e.contexts.state.state.type===`redux`&&(t.attachments=[...t.attachments||[],{filename:`redux_state.json`,data:JSON.stringify(e.contexts.state.state.value)}])}catch{}return e});function i(e){return(n,r)=>{let i=e(n,r),a=P(),o=t.actionTransformer(r);o!=null&&$d({category:Fse,data:o,type:Ise});let s=t.stateTransformer(i);if(s!=null){let e=F()?.getOptions()?.normalizeDepth||3,t={state:{type:`redux`,value:s}};Ci(t,3+e),a.setContext(`state`,t)}else a.setContext(`state`,null);let{configureScopeWithState:c}=t;return typeof c==`function`&&c(a,i),i}}let a=e(i(n),r);return a.replaceReducer=new Proxy(a.replaceReducer,{apply:function(e,t,n){e.apply(t,[i(n[0])])}}),a}}function zse(e){let t=SA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:i,instrumentPageLoad:a=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(e){t.afterAllSetup(e),a&&R.location&&vj(r,R.location,i,(t,n=`url`)=>{CA(e,{name:t,attributes:{[Fa]:`pageload`,[I]:`auto.pageload.react.reactrouter_v3`,[Ma]:n,...n===`route`&&{"url.template":t}}})}),o&&n.listen&&n.listen(t=>{(t.action===`PUSH`||t.action===`POP`)&&vj(r,t,i,(t,n=`url`)=>{wA(e,{name:t,attributes:{[Fa]:`navigation`,[I]:`auto.navigation.react.reactrouter_v3`,[Ma]:n,...n===`route`&&{"url.template":t}}})})})}}}function vj(e,t,n,r){let i=t.pathname;n({location:t,routes:e},(e,t,n)=>{if(e||!n)return r(i);let a=Bse(n.routes||[]);return a.length===0||a===`/*`?r(i):(i=a,r(i,`route`))})}function Bse(e){if(!Array.isArray(e)||e.length===0)return``;let t=e.filter(e=>!!e.path),n=-1;for(let e=t.length-1;e>=0;e--)if(t[e].path?.startsWith(`/`)){n=e;break}return t.slice(n).reduce((e,{path:t})=>`${e}${e===`/`||e===``?t:`/${t}`}`,``)}function Vse(e,t={}){let n=e,r=SA({...t,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:i=!0,instrumentNavigation:a=!0}=t;return{...r,afterAllSetup(e){r.afterAllSetup(e);let t=(e,t)=>{let r=n.matchRoutes(e,t,{preload:!1,throwOnError:!1}),i=r[r.length-1];return i?.routeId===`__root__`?void 0:i},o=(e,t,r,i)=>{e.updateName(t?t.routeId:i),e.setAttribute(Ma,t?`route`:`url`),e.setAttributes({...t&&{"url.template":t.routeId},...Hse(n,r),...bj(t)})},s=R.location;if(i&&s){let r=n.state?.location,i=r?t(r.pathname,r.search):t(s.pathname,n.options.parseSearch(s.search)),a=CA(e,{name:i?i.routeId:s.pathname,attributes:{[Fa]:`pageload`,[I]:`auto.pageload.react.tanstack_router`,[Ma]:i?`route`:`url`,...i&&{"url.template":i.routeId},...bj(i)}}),c=n.subscribe(`onResolved`,e=>{if(c(),!a)return;let{toLocation:n}=e,r=t(n.pathname,n.search);o(a,r,n,n.pathname)})}if(a){let r;n.subscribe(`onBeforeLoad`,i=>{let{toLocation:a,fromLocation:s}=i;if(!s||a.state===s.state)return;let c=t(a.pathname,a.search),l=R.location?.pathname||a.pathname;if(r){o(r,c,a,l);return}r=wA(e,{name:c?c.routeId:l,attributes:{[Fa]:`navigation`,[I]:`auto.navigation.react.tanstack_router`,[Ma]:c?`route`:`url`,...c&&{"url.template":c.routeId},...bj(c)}},{url:yj(n,a)})}),n.subscribe(`onResolved`,e=>{let n=r;if(r=void 0,!n)return;let{toLocation:i}=e,a=t(i.pathname,i.search);a&&o(n,a,i,R.location?.pathname||i.pathname)})}}}}function yj(e,t){let n=e.options.stringifySearch?.(t.search)??``;return nC(`${t.pathname}${n&&n!==`?`?n:``}`)}function Hse(e,t){let n=yj(e,t);return{[vte]:t.pathname,[zc]:n}}function bj(e){if(!e)return{};let t={};return Object.entries(e.params).forEach(([e,n])=>{t[`url.path.params.${e}`]=n,t[`${yte}.${e}`]=n,t[`${_te}.${e}`]=n}),t}function Use(e){let t=SA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:i,instrumentPageLoad:a=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(e){t.afterAllSetup(e),xj(e,a,o,n,`reactrouter_v4`,r,i)}}}function Wse(e){let t=SA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:i,instrumentPageLoad:a=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(e){t.afterAllSetup(e),xj(e,a,o,n,`reactrouter_v5`,r,i)}}}function xj(e,t,n,r,i,a=[],o){function s(){if(r.location)return r.location.pathname;if(R.location)return R.location.pathname}function c(e){if(a.length===0||!o)return[e,`url`];let t=Sj(a,e,o);for(let e of t)if(e.match.isExact)return[e.match.path,`route`];return[e,`url`]}if(t){let t=s();if(t){let[n,r]=c(t);CA(e,{name:n,attributes:{[Fa]:`pageload`,[I]:`auto.pageload.react.${i}`,[Ma]:r,...r===`route`&&{"url.template":n}}})}}n&&r.listen&&r.listen((t,n)=>{if(n&&(n===`PUSH`||n===`POP`)){let[n,r]=c(t.pathname);wA(e,{name:n,attributes:{[Fa]:`navigation`,[I]:`auto.navigation.react.${i}`,[Ma]:r,...r===`route`&&{"url.template":n}}})}})}function Sj(e,t,n,r=[]){return e.some(e=>{let i=e.path?n(t,e):r.length?r[r.length-1].match:Gse(t);return i&&(r.push({route:e,match:i}),e.routes&&Sj(e.routes,t,n,r)),!!i}),r}function Gse(e){return{path:`/`,url:`/`,params:{},isExact:e===`/`}}function Kse(e){let t=e.displayName||e.name,n=t=>{if(t?.computedMatch?.isExact){let e=t.computedMatch.path,n=qse();P().setTransactionName(e),n&&(n.updateName(e),n.setAttributes({[Ma]:`route`,[Bc]:e}))}return k.createElement(e,{...t})};return n.displayName=`sentryRoute(${t})`,pj(n,e),n}function qse(){let e=as(),t=e&&rs(e);if(!t)return;let n=L(t).op;return n===`navigation`||n===`pageload`?t:void 0}function Cj(e,t){if(!t||t===`/`||!e.toLowerCase().startsWith(t.toLowerCase()))return e;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?e:e.slice(n)||`/`}var wj=new WeakMap;function Jse(e,t,n){if(!e||!t?.length)return null;let r=n?Cj(e,n):e,i=wj.get(t);i||(i=ece(t),wj.set(t,i),hj&&N.log(`[React Router] Sorted route manifest by specificity:`,i.length,`patterns`));for(let e of i)if(Yse(r,e))return hj&&N.log(`[React Router] Matched pathname`,r,`to pattern`,e),e;return hj&&N.log(`[React Router] No manifest match found for pathname:`,r),null}function Yse(e,t){if(t===`/`)return e===`/`||e===``;let n=Ej(e),r=Ej(t);if(r.length>0&&r[r.length-1]===`*`){let e=r.slice(0,-1);if(n.length<e.length)return!1;for(let[t,r]of e.entries())if(!Tj(n[t],r))return!1;return!0}if(n.length!==r.length)return!1;for(let[e,t]of r.entries())if(!Tj(n[e],t))return!1;return!0}function Tj(e,t){return e===void 0||t===void 0?!1:Dj.test(t)?!0:e===t}function Ej(e){return e.split(`/`).filter(Boolean)}var Dj=/^:[\w-]+$/,Xse=10,Zse=3,Qse=1,$se=-2;function Oj(e){let t=e.split(`/`),n=t.length;t.includes(`*`)&&(n+=$se);for(let e of t)if(e===`*`)continue;else Dj.test(e)?n+=Zse:n+=e===``?Qse:Xse;return n}function ece(e){return[...e].sort((e,t)=>{let n=Oj(e);return Oj(t)-n})}var kj,Aj=!1,jj=[],tce=10;function nce(e,t){let n={};return jj.length>=tce&&(hj&&N.warn(`[React Router] Navigation context stack overflow - removing oldest context`),jj.shift()),jj.push({token:n,targetPath:e,span:t}),n}function rce(e){jj[jj.length-1]?.token===e&&jj.pop()}function Mj(){let e=jj.length;return e>0?jj[e-1]??null:null}function ice(e,t=!1){kj=e,Aj=t}function ace(e){return Pj(e.route.path||``)}function Nj(e){return e.params[`*`]||``}function Pj(e){return e[e.length-1]===`*`?e.slice(0,-1):e}function Fj(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function Ij(e){return e.endsWith(`*`)}function Lj(e){return e.includes(`/*`)||e.endsWith(`*`)}function Rj(e,t){return Ij(e)&&!!t.route.children?.length||!1}function zj(e){return!!(!e.children&&e.element&&e.path?.endsWith(`/*`))}function oce(e,t,n){let r=e&&e.length>0?e:Aj?Cj(t,n):t,i=r.slice(-2)===`/*`?r.slice(0,-2):r;return i.length>1&&i[i.length-1]===`/`&&(i=i.slice(0,-1)),[i,`route`]}function Bj(e){return e.split(/\\?\//).filter(e=>e.length>0&&e!==`,`).length}function Vj(e){return e[0]===`/`?e:`/${e}`}function Hj(e,t){let n=kj(e,t);if(!n||n.length===0)return``;for(let r of n)if(r.route.path&&r.route.path!==`*`){let n=ace(r),i=Cj(t.pathname,Vj(r.pathnameBase));return t.pathname===i?Fj(i):Fj(Fj(n||``)+Vj(Hj(e.filter(e=>e!==r.route),{pathname:i})))}return``}function sce(e,t,n){let r=t.filter(zj);if(!r.length)return;let i=kj(r,e),a=i?.[i.length-1];if(!a||!Nj(a))return;let o=Fj(Pj(a.route.path||``));if(!o)return;let s=Vj(o),c=o.split(`/`)[0],l=c?.startsWith(`:`)&&n?.split(`/`).includes(c);if(n===s||n?.startsWith(`${s}/`)||l)return;let u=Cj(e.pathname,Vj(a.pathnameBase))||`/`,d=Hj(t.filter(e=>e!==a.route),{pathname:u});return d?Vj(`${o}${Vj(d)}`):void 0}function cce(e,t){let n=kj(t,e);if(n){for(let e of n)if(zj(e.route)&&Nj(e))return!0}return!1}function Uj(e,t){return Aj?Cj(e.pathname,t):e.pathname||``}function lce(e,t,n,r=``){if(!e||e.length===0)return[Aj?Cj(t.pathname,r):t.pathname,`url`];if(!n)return[Uj(t,r),`url`];let i=``;for(let e of n){let n=e.route;if(!n)continue;if(n.index)return oce(i,e.pathname,r);let a=n.path;if(!a||Rj(a,e))continue;let o=a[0]===`/`||i[i.length-1]===`/`?a:`/${a}`;if(i=Fj(i)+Vj(o),Fj(t.pathname)===Fj(r+e.pathname))return Bj(i)!==Bj(e.pathname)&&!Ij(i)?[(Aj?``:r)+o,`route`]:(Rj(i,e)&&(i=i.slice(0,-1)),[(Aj?``:r)+i,`route`])}return[Uj(t,r),`url`]}function Wj(e,t,n,r,i=``,a,o){if(o&&a&&a.length>0){let t=Jse(e.pathname,a,i);if(t)return[(Aj?``:i)+t,`route`]}let s,c=`url`,l=cce(e,n);l&&(s=Vj(Hj(n,e)),c=`route`),(!l||!s)&&([s,c]=lce(t,e,r,i));let u=sce(e,n,s);return u?[u,`route`]:[s||e.pathname,c]}function Gj(){let e=as(),t=e?rs(e):void 0;if(!t)return;let n=L(t).op;return n===`navigation`||n===`pageload`?t:void 0}function uce(){let e=Mj();if(e)return e.targetPath?{pathname:e.targetPath,search:``,hash:``,state:null,key:`default`}:null;if(R!==void 0)try{let e=R.location;if(e)return{pathname:e.pathname,search:e.search||``,hash:e.hash||``,state:null,key:`default`}}catch{hj&&N.warn(`[React Router] Could not access window.location`)}return null}function dce(){let e=Mj();return e?e.span:Gj()}function fce(e,t,n,r){let i=new Proxy(e,{apply(e,i,a){let o=uce(),s=dce(),c=e.apply(i,a);return pce(c,t,n,r,o,s),c}});return ui(i,`__sentry_proxied__`,!0),i}function pce(e,t,n,r,i,a){oi(e)?e.then(e=>{Array.isArray(e)&&r(e,t,i??void 0,a)}).catch(e=>{hj&&N.warn(`Error resolving async handler '${n}' for route`,t,e)}):Array.isArray(e)&&r(e,t,i??void 0,a)}function Kj(e,t){if(e.handle&&typeof e.handle==`object`)for(let n of Object.keys(e.handle)){let r=e.handle[n];typeof r==`function`&&!r.__sentry_proxied__&&(e.handle[n]=fce(r,e,n,t))}if(Array.isArray(e.children))for(let n of e.children)Kj(n,t)}var qj,Jj,Yj,Xj,Zj,Qj=!1,$j=3e3,eM,tM=``,nM=new WeakSet,rM=R?.document?k.useLayoutEffect:k.useEffect,iM=new WeakMap,aM=new Set,oM=new WeakMap,sM=new WeakMap;function cM(e){return R?.requestAnimationFrame?R.requestAnimationFrame(e):setTimeout(e,0)}function lM(e){R?.cancelAnimationFrame?R.cancelAnimationFrame(e):clearTimeout(e)}function uM(e){return`${e.pathname}${e.search||``}${e.hash||``}`}function dM(e){return e.includes(`:`)||e.includes(`*`)}function fM(e,t,n,r){if(!e)return{skip:!1,shouldUpdate:!1};if(e.locationKey===t&&(e.isPlaceholder||!r)){let t=!!e.routeName&&Lj(e.routeName),r=Lj(n),i=!!e.routeName&&dM(e.routeName),a=dM(n),o=t&&!r,s=!i&&a,c=n!==e.routeName&&n.length>(e.routeName?.length||0)&&!r;return{skip:!0,shouldUpdate:!!(e.routeName&&(o||s||c))}}return{skip:!1,shouldUpdate:!1}}function pM(e,t){let n=t.children||[],r=e.filter(e=>!n.some(t=>t===e||e.path&&t.path===e.path||e.id&&t.id===e.id));r.length>0&&(t.children=[...n,...r])}function mM(e,t){let n=oM.get(e);n||(n=new Set,oM.set(e,n)),n.add(t),t.finally(()=>{let n=oM.get(e);n&&n.delete(t)})}function hM(e){mM(e,new Promise(t=>{sM.set(e,t)}))}function gM(e){let t=sM.get(e);t&&(t(),sM.delete(e),e.__sentry_may_have_lazy_routes__&&=!1)}function _M(e,t,n=null,r){e.forEach(e=>{aM.add(e),Qj&&Kj(e,_M)}),t&&pM(e,t);let i=r??Gj();if(i){let e=L(i);if(e.timestamp){hj&&N.warn(`[React Router] Lazy handler resolved after span ended - skipping update`);return}let t=e.op,a=n;if(!a&&!r&&R!==void 0){let e=R.location;e?.pathname&&(a={pathname:e.pathname})}a&&(t===`pageload`?kM({activeRootSpan:i,location:{pathname:a.pathname},routes:Array.from(aM),allRoutes:Array.from(aM)}):t===`navigation`&&vM(i,a,Array.from(aM),!1,Zj))}}function vM(e,t,n,r=!1,i){let a=L(e),o=a.description,s=e?.__sentry_navigation_name_set__,c=o&&Lj(o);if((!s||r||c)&&!a.timestamp){let[r,l]=Wj(t,n,n,i(n,t)||[],tM,eM,Qj),u=a.data?.[Ma];r&&(!o||!s&&(u!==`route`||l===`route`)||u!==`route`&&l===`route`||u===`route`&&l===`route`&&c)&&(e.updateName(r),e.setAttribute(Ma,l),l===`route`&&e.setAttribute(Bc,r),!Lj(r)&&l===`route`&&ui(e,`__sentry_navigation_name_set__`,!0))}}function yM(e,t,n,r,i){let a=!1,o=!!i&&L(i).op===`pageload`,s=!1,c=null,l=null;e.subscribe(e=>{if(!a){let t=Gj();t&&L(t).op===`pageload`?o=!0:o&&(e.historyAction===`POP`&&!s?s=!0:a=!0)}if(e.historyAction===`PUSH`||e.historyAction===`POP`&&a){let i=uM(e.location),a=()=>{l!==i&&(l=i,c=null,TM({location:e.location,routes:t,navigationType:e.historyAction,version:n,basename:r,allRoutes:Array.from(aM)}))};e.navigation.state===`idle`?(c!==null&&(lM(c),c=null),a()):(l!==i&&(l=null),c!==null&&lM(c),c=cM(a))}})}function bM(e,t){return!qj||!Jj||!Yj||!Zj?(hj&&N.warn(`reactRouter${t?`V${t}`:``}Instrumentation was unable to wrap the \`createRouter\` function because of one or more missing parameters.`),e):function(n,r){if(EM(n),Qj)for(let e of n)Kj(e,_M);let i=Gj();r&&`patchRoutesOnNavigation`in r&&typeof r.patchRoutesOnNavigation==`function`&&i&&(ui(i,`__sentry_may_have_lazy_routes__`,!0),hM(i));let a=e(n,wM(r,!1,i)),o=r?.basename;return a.state.historyAction===`POP`&&i&&kM({activeRootSpan:i,location:a.state.location,routes:n,basename:o,allRoutes:Array.from(aM)}),tM=o||``,yM(a,n,t,o,i),a}}function xM(e,t){return!qj||!Jj||!Yj||!Zj?(hj&&N.warn(`reactRouter${t?`V${t}`:``}Instrumentation was unable to wrap the \`createMemoryRouter\` function because of one or more missing parameters.`),e):function(n,r){if(EM(n),Qj)for(let e of n)Kj(e,_M);let i=Gj();r&&`patchRoutesOnNavigation`in r&&typeof r.patchRoutesOnNavigation==`function`&&i&&(ui(i,`__sentry_may_have_lazy_routes__`,!0),hM(i));let a=e(n,wM(r,!0,i)),o=r?.basename,s,c=r?.initialEntries,l=r?.initialIndex,u=c?.length===1,d=l!==void 0&&c?.[l];s=u?c[0]:d?c[l]:void 0;let f=s?typeof s==`string`?{pathname:s}:s:a.state.location,p=Gj();return a.state.historyAction===`POP`&&p&&kM({activeRootSpan:p,location:f,routes:n,basename:o,allRoutes:Array.from(aM)}),tM=o||``,yM(a,n,t,o,p),a}}function SM(e,t){let n=SA({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:i,useNavigationType:a,createRoutesFromChildren:o,matchRoutes:s,stripBasename:c,enableAsyncRouteHandlers:l=!1,instrumentPageLoad:u=!0,instrumentNavigation:d=!0,lazyRouteTimeout:f,lazyRouteManifest:p}=e;return{...n,setup(t){n.setup(t);let u=e.finalTimeout??3e4,d=(e.idleTimeout??1e3)*3,m=f??d;m===1/0?($j=u,hj&&N.log(`[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:`,u,`ms to prevent indefinite hangs`)):Number.isNaN(m)?(hj&&N.warn(`[React Router] lazyRouteTimeout must be a number, falling back to default:`,d),$j=d):m<0?(hj&&N.warn(`[React Router] lazyRouteTimeout must be non-negative or Infinity, got:`,m,`falling back to:`,d),$j=d):$j=m,qj=r,Jj=i,Yj=a,Zj=s,Xj=o,Qj=l,eM=p,ice(s,c||!1)},afterAllSetup(e){n.afterAllSetup(e);let r=R.location?.pathname;u&&r&&CA(e,{name:r,attributes:{[Ma]:`url`,[Fa]:`pageload`,[I]:`auto.pageload.react.reactrouter${t?`_v${t}`:``}`}}),d&&nM.add(e)}}}function CM(e,t){if(!qj||!Jj||!Yj||!Zj)return hj&&N.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),e;let n=n=>{let r=k.useRef(!0),{routes:i,locationArg:a}=n,o=e(i,a),s=Jj(),c=Yj(),l=typeof a==`string`||a?.pathname?a:s;return rM(()=>{let e=EM(i);return()=>DM(e)}),rM(()=>{let e=typeof l==`string`?{pathname:l}:l;r.current?(kM({activeRootSpan:Gj(),location:e,routes:i,allRoutes:Array.from(aM)}),r.current=!1):TM({location:e,routes:i,navigationType:c,version:t,allRoutes:Array.from(aM)})},[c,l]),o};return(e,t)=>k.createElement(n,{routes:e,locationArg:t})}function wM(e,t=!1,n){if(!e||!(`patchRoutesOnNavigation`in e)||typeof e.patchRoutesOnNavigation!=`function`)return e||{};let r=e.patchRoutesOnNavigation;return{...e,patchRoutesOnNavigation:async e=>{let i=e?.path,a=Gj()??n;if(!t){let t=e?.patch,n=e?.matches;t&&(e.patch=(e,r)=>{if(EM(r),n&&n.length>0){let t=n[n.length-1]?.route;if(t){let n=Array.from(aM).find(n=>{let r=n.id!==void 0&&n.id===e,i=n===t,a=n.path!==void 0&&t.path!==void 0&&n.path===t.path;return r||i||a});n&&pM(r,n)}}let o=a?L(a):void 0;return i&&a&&o&&!o.timestamp&&o.op===`navigation`&&vM(a,{pathname:i,search:``,hash:``,state:null,key:`default`},Array.from(aM),!0,Zj),t(e,r)})}let o=(async()=>{let t=nce(i,a),n;try{n=await r(e)}finally{rce(t),a&&gM(a)}let o=a?L(a):void 0;if(a&&o&&!o.timestamp&&o.op===`navigation`){let e=i;e&&vM(a,{pathname:e,search:``,hash:``,state:null,key:`default`},Array.from(aM),!1,Zj)}return n})();return a&&mM(a,o),o}}}function TM(e){let{location:t,routes:n,navigationType:r,version:i,matches:a,basename:o,allRoutes:s}=e,c=Array.isArray(a)?a:Zj(s||n,t,o),l=F();if(!l||!nM.has(l))return;let u=Gj();if(!(u&&L(u).op===`pageload`&&r===`POP`)&&(r===`PUSH`||r===`POP`)&&c){let[e,r]=Wj(t,s||n,s||n,c,o,eM,Qj),a=uM(t),u=iM.get(l),{skip:d,shouldUpdate:f}=fM(u,a,e,u&&!u.isPlaceholder?!!L(u.span).timestamp:!1);if(d){if(f&&u){let t=u.routeName;u.isPlaceholder?(u.routeName=e,hj&&N.log(`[Tracing] Updated placeholder navigation name from "${t}" to "${e}" (will apply to real span)`)):(u.span.updateName(e),u.span.setAttribute(Ma,r),r===`route`&&u.span.setAttribute(Bc,e),ui(u.span,`__sentry_navigation_name_set__`,!0),u.routeName=e,hj&&N.log(`[Tracing] Updated navigation span name from "${t}" to "${e}"`))}else hj&&N.log(`[Tracing] Skipping duplicate navigation for location: ${a}`);return}let p={span:{end:()=>{}},routeName:e,pathname:t.pathname,locationKey:a,isPlaceholder:!0};iM.set(l,p);let m;try{m=wA(l,{name:p.routeName,attributes:{[Ma]:r,[Fa]:`navigation`,[I]:`auto.navigation.react.reactrouter${i?`_v${i}`:``}`,...r===`route`&&{"url.template":p.routeName}}})}catch(e){throw iM.delete(l),e}m?(iM.set(l,{span:m,routeName:p.routeName,pathname:t.pathname,locationKey:a}),MM(m,t,n,o,`navigation`)):iM.delete(l)}}function EM(e){let t=[];return e.forEach(e=>{OM(e).forEach(e=>{aM.add(e),t.push(e)})}),t}function DM(e){e.forEach(e=>{aM.delete(e)})}function OM(e,t=new Set){return t.has(e)||(t.add(e),e.children&&!e.index&&e.children.forEach(e=>{OM(e,t).forEach(e=>{t.add(e)})})),t}function kM({activeRootSpan:e,location:t,routes:n,matches:r,basename:i,allRoutes:a}){let o=Array.isArray(r)?r:Zj(a||n,t,i);if(o){let[r,s]=Wj(t,a||n,a||n,o,i,eM,Qj);P().setTransactionName(r||`/`),e&&(e.updateName(r),e.setAttribute(Ma,s),s===`route`&&e.setAttribute(Bc,r),MM(e,t,n,i,`pageload`))}else e&&MM(e,t,n,i,`pageload`)}function AM(e,t,n,r,i=!1){return n?!!(!e&&i||e&&Lj(e)&&r===`route`&&!Lj(n)||t!==`route`&&r===`route`):!1}function jM(e,t,n,r,i,a,o,s){try{let c=t.data?.[Ma];if(c===`route`&&n&&!Lj(n))return;let l=Array.from(s),u=l.length>0?l:i,d=Zj(u,r,a);if(!d)return;let[f,p]=Wj(r,u,u,d,a,eM,Qj),m=AM(n,c,f,p,!0),h=o===`pageload`||!t.timestamp;m&&h&&(e.updateName(f),e.setAttribute(Ma,p),p===`route`&&e.setAttribute(Bc,f))}catch(e){hj&&N.warn(`Error updating span details before ending: ${e}`)}}function MM(e,t,n,r,i){let a=`__sentry_${i}_end_patched__`;if(e?.[a]||!e.end)return;let o=e.end.bind(e),s=!1;e.end=function(...a){if(s)return;s=!0;let c=a.length>0?a[0]:Date.now()/1e3,l=L(e),u=l.description,d=l.data?.[Ma],f=()=>{let t=F();if(t&&i===`navigation`){let n=iM.get(t);n&&n.span===e&&iM.delete(t)}},p=oM.get(e),m=e.__sentry_may_have_lazy_routes__;if((p&&p.size>0||m)&&u&&(Lj(u)||d!==`route`)){if($j===0){jM(e,l,u,t,n,r,i,aM),f(),o(c);return}let a=new Promise(e=>setTimeout(e,$j)),s;if(p&&p.size>0){let e=Promise.allSettled(p).then(()=>{});s=$j===1/0?e:Promise.race([e,a])}else s=a;s.then(()=>{let a=L(e);jM(e,a,a.description,t,n,r,i,aM),f(),o(c)}).catch(()=>{f(),o(c)});return}jM(e,l,u,t,n,r,i,aM),f(),o(c)},ui(e,a,!0)}function NM(e,t){if(!qj||!Jj||!Yj||!Xj||!Zj)return hj&&N.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
|
|
501
|
-
useEffect: ${qj}. useLocation: ${Jj}. useNavigationType: ${Yj}.
|
|
502
|
-
createRoutesFromChildren: ${Xj}. matchRoutes: ${Zj}.`),e;let n=n=>{let r=k.useRef(!0),i=Jj(),a=Yj(),o=Xj(n.children);return rM(()=>{let e=EM(o);return()=>DM(e)}),rM(()=>{r.current?(kM({activeRootSpan:Gj(),location:i,routes:o,allRoutes:Array.from(aM)}),r.current=!1):TM({location:i,routes:o,navigationType:a,version:t,allRoutes:Array.from(aM)})},[i,a]),k.createElement(e,{...n})};return pj(n,e),n}function PM(e){return SM(e,`6`)}function FM(e){return CM(e,`6`)}function IM(e){return bM(e,`6`)}function LM(e){return xM(e,`6`)}function RM(e){return NM(e,`6`)}function zM(e){return SM(e,`7`)}function BM(e){return NM(e,`7`)}function VM(e){return bM(e,`7`)}function HM(e){return xM(e,`7`)}function UM(e){return CM(e,`7`)}function WM(e){return SM(e,``)}function GM(e){return NM(e,``)}function KM(e){return bM(e,``)}function qM(e){return xM(e,``)}function JM(e){return CM(e,``)}var YM=e({BrowserClient:()=>$y,ErrorBoundary:()=>_j,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>wd,OpenFeatureIntegrationHook:()=>sse,Profiler:()=>mj,SDK_VERSION:()=>lr,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>Fa,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>I,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>Na,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>Ma,Scope:()=>la,WINDOW:()=>R,addBreadcrumb:()=>$d,addEventProcessor:()=>Pl,addIntegration:()=>Zl,bindScopeToEmitter:()=>ate,breadcrumbsIntegration:()=>FC,browserApiErrorsIntegration:()=>GC,browserProfilingIntegration:()=>Qoe,browserSessionIntegration:()=>QC,browserTracingIntegration:()=>SA,buildLaunchDarklyFlagUsedHandler:()=>ase,captureConsoleIntegration:()=>Lf,captureEvent:()=>yl,captureException:()=>_l,captureFeedback:()=>sm,captureMessage:()=>vl,captureReactException:()=>rj,captureSession:()=>Rl,chromeStackLineParser:()=>vC,close:()=>jl,consoleLoggingIntegration:()=>Sm,contextLinesIntegration:()=>Yw,continueTrace:()=>qee,createConsolaReporter:()=>km,createLangChainCallbackHandler:()=>og,createReduxEnhancer:()=>Rse,createTransport:()=>Vu,createUserFeedbackEnvelope:()=>jC,cultureContextIntegration:()=>ew,dedupeIntegration:()=>Bf,defaultRequestInstrumentationOptions:()=>fA,defaultStackLineParsers:()=>OC,defaultStackParser:()=>kC,diagnoseSdkConnectivity:()=>fse,elementTimingIntegration:()=>dS,endSession:()=>Il,eventFiltersIntegration:()=>of,eventFromException:()=>Ky,eventFromMessage:()=>qy,exceptionFromError:()=>Iy,extraErrorDataIntegration:()=>Jf,featureFlagsIntegration:()=>qp,feedbackAsyncIntegration:()=>Py,feedbackIntegration:()=>Fy,feedbackSyncIntegration:()=>Fy,fetchStreamPerformanceIntegration:()=>_A,flush:()=>Al,forceLoad:()=>ww,functionToStringIntegration:()=>nf,geckoStackLineParser:()=>xC,getAbsoluteUrl:()=>nC,getActiveSpan:()=>as,getClient:()=>F,getCurrentScope:()=>P,getDefaultIntegrations:()=>Sw,getFeedback:()=>O_,getGlobalScope:()=>Oa,getIsolationScope:()=>Da,getReplay:()=>jae,getRootSpan:()=>rs,getSpanDescendants:()=>ns,getSpanStatusFromHttpCode:()=>Za,getTraceData:()=>Yd,globalHandlersIntegration:()=>rw,graphqlClientIntegration:()=>cT,growthbookIntegration:()=>use,httpClientIntegration:()=>Mw,httpContextIntegration:()=>fw,inboundFiltersIntegration:()=>sf,init:()=>nj,instrumentAnthropicAiClient:()=>jne,instrumentCreateReactAgent:()=>hre,instrumentGoogleGenAIClient:()=>Une,instrumentLangChainEmbeddings:()=>ire,instrumentLangGraph:()=>gre,instrumentOpenAiClient:()=>fne,instrumentOutgoingRequests:()=>pA,instrumentStateGraph:()=>fg,instrumentSupabaseClient:()=>Cp,isBotUserAgent:()=>xA,isEnabled:()=>Nl,isInitialized:()=>Ml,lastEventId:()=>kl,launchDarklyIntegration:()=>ise,lazyLoadIntegration:()=>My,linkedErrorsIntegration:()=>gw,logger:()=>cm,makeBrowserOfflineTransport:()=>Doe,makeFetchTransport:()=>iC,makeMultiplexedTransport:()=>Od,metrics:()=>Cm,moduleMetadataIntegration:()=>Af,normalizeStringifyValue:()=>vw,onLoad:()=>Tw,openFeatureIntegration:()=>ose,opera10StackLineParser:()=>TC,opera11StackLineParser:()=>DC,parameterize:()=>Gd,reactErrorHandler:()=>Sse,reactRouterBrowserTracingIntegration:()=>WM,reactRouterV3BrowserTracingIntegration:()=>zse,reactRouterV4BrowserTracingIntegration:()=>Use,reactRouterV5BrowserTracingIntegration:()=>Wse,reactRouterV6BrowserTracingIntegration:()=>PM,reactRouterV7BrowserTracingIntegration:()=>zM,registerSpanErrorInstrumentation:()=>ls,registerWebWorker:()=>gse,replayCanvasIntegration:()=>Xae,replayIntegration:()=>Ik,reportPageLoaded:()=>voe,reportingObserverIntegration:()=>Aw,rewriteFramesIntegration:()=>ap,sendFeedback:()=>f_,setActiveSpanInBrowser:()=>yoe,setAttribute:()=>El,setAttributes:()=>Tl,setContext:()=>bl,setConversationId:()=>Ol,setCurrentClient:()=>bd,setExtra:()=>Sl,setExtras:()=>xl,setHttpStatus:()=>Qa,setMeasurement:()=>Xs,setTag:()=>wl,setTags:()=>Cl,setUser:()=>Dl,showReportDialog:()=>Ew,spanStreamingIntegration:()=>boe,spanToBaggageHeader:()=>Ts,spanToJSON:()=>L,spanToTraceHeader:()=>Lo,spotlightBrowserIntegration:()=>rse,startBrowserTracingNavigationSpan:()=>wA,startBrowserTracingPageLoadSpan:()=>CA,startInactiveSpan:()=>cc,startNewTrace:()=>fc,startSession:()=>Fl,startSpan:()=>oc,startSpanManual:()=>sc,statsigIntegration:()=>dse,supabaseIntegration:()=>Ep,suppressTracing:()=>uc,tanstackRouterBrowserTracingIntegration:()=>Vse,thirdPartyErrorFilterIntegration:()=>Fp,uiProfiler:()=>sC,unleashIntegration:()=>cse,updateSpanName:()=>ss,useProfiler:()=>Nse,viewHierarchyIntegration:()=>lT,webVitalsIntegration:()=>vA,webWorkerIntegration:()=>mse,winjsStackLineParser:()=>CC,withActiveSpan:()=>lc,withErrorBoundary:()=>Pse,withIsolationScope:()=>Aa,withProfiler:()=>Mse,withScope:()=>ka,withSentryReactRouterV6Routing:()=>RM,withSentryReactRouterV7Routing:()=>BM,withSentryRouting:()=>Kse,withStreamedSpan:()=>Es,wrapCreateBrowserRouter:()=>KM,wrapCreateBrowserRouterV6:()=>IM,wrapCreateBrowserRouterV7:()=>VM,wrapCreateMemoryRouter:()=>qM,wrapCreateMemoryRouterV6:()=>LM,wrapCreateMemoryRouterV7:()=>HM,wrapReactRouterRouting:()=>GM,wrapUseRoutes:()=>JM,wrapUseRoutesV6:()=>FM,wrapUseRoutesV7:()=>UM,zodErrorsIntegration:()=>Pp}),W=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,G=globalThis,XM=`10.67.0`;function ZM(){return QM(G),G}function QM(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.67.0`,t[XM]=t[`10.67.0`]||{}}function $M(e,t,n=G){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[XM]=r[`10.67.0`]||{};return i[e]||(i[e]=t())}var eN=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],tN=`Sentry Logger `,nN={};function rN(e){if(!(`console`in G))return e();let t=G.console,n={},r=Object.keys(nN);r.forEach(e=>{let r=nN[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function iN(){dN().enabled=!0}function aN(){dN().enabled=!1}function oN(){return dN().enabled}function sN(...e){uN(`log`,...e)}function cN(...e){uN(`warn`,...e)}function lN(...e){uN(`error`,...e)}function uN(e,...t){W&&oN()&&rN(()=>{G.console[e](`${tN}[${e}]:`,...t)})}function dN(){return W?$M(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var K={enable:iN,disable:aN,isEnabled:oN,log:sN,warn:cN,error:lN},fN=50,pN=/\(error: (.*)\)/,mN=/captureMessage|captureException/;function hN(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
503
|
-
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=pN.test(n)?n.replace(pN,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=fN+r)break}}return _N(i.slice(r))}}function gN(e){return Array.isArray(e)?hN(...e):e}function _N(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(vN(t).function||``)&&t.pop(),t.reverse(),mN.test(vN(t).function||``)&&(t.pop(),mN.test(vN(t).function||``)&&t.pop()),t.slice(0,fN).map(e=>({...e,filename:e.filename||vN(t).filename,function:e.function||`?`}))}function vN(e){return e[e.length-1]||{}}var yN=`<anonymous>`;function bN(e){try{return!e||typeof e!=`function`?yN:e.name||yN}catch{return yN}}function xN(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function SN(e){let t=e?.startsWith(`file://`)?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var CN={},wN={};function TN(e,t){return CN[e]=CN[e]||[],CN[e].push(t),()=>{let n=CN[e];if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}function EN(e,t){if(!wN[e]){wN[e]=!0;try{t()}catch(t){W&&K.error(`Error while instrumenting ${e}`,t)}}}function DN(e,t){let n=e&&CN[e];if(n)for(let r of n)try{r(t)}catch(t){W&&K.error(`Error while triggering instrumentation handler.
|
|
504
|
-
Type: ${e}
|
|
505
|
-
Name: ${bN(r)}
|
|
506
|
-
Error:`,t)}}var ON=null;function kN(e){let t=`error`;TN(t,e),EN(t,AN)}function AN(){ON=G.onerror,G.onerror=function(e,t,n,r,i){return DN(`error`,{column:r,error:i,line:n,msg:e,url:t}),ON?ON.apply(this,arguments):!1},G.onerror.__SENTRY_INSTRUMENTED__=!0}var jN=null;function MN(e){let t=`unhandledrejection`;TN(t,e),EN(t,NN)}function NN(){jN=G.onunhandledrejection,G.onunhandledrejection=function(e){return DN(`unhandledrejection`,e),!jN||jN.apply(this,arguments)},G.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var PN=Object.prototype.toString;function FN(e){switch(PN.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return JN(e,Error)}}function IN(e,t){return PN.call(e)===`[object ${t}]`}function LN(e){return IN(e,`ErrorEvent`)}function RN(e){return IN(e,`DOMError`)}function zN(e){return IN(e,`DOMException`)}function BN(e){return IN(e,`String`)}function VN(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function HN(e){return e===null||VN(e)||typeof e!=`object`&&typeof e!=`function`}function UN(e){return IN(e,`Object`)}function WN(e){return typeof e==`object`&&!!e}function GN(e){return typeof Event<`u`&&JN(e,Event)}function KN(e){return IN(e,`RegExp`)}function qN(e){return!!(e?.then&&typeof e.then==`function`)}function JN(e,t){try{return e instanceof t}catch{return!1}}function YN(e){return typeof Request<`u`&&JN(e,Request)}function XN(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&QN(i,r);try{e[t]=i}catch{W&&K.log(`Failed to replace method "${t}" in object`,e)}}function ZN(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{W&&K.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function QN(e,t){try{e.prototype=t.prototype=t.prototype||{},ZN(e,`__sentry_original__`,t)}catch{}}function $N(e){return e.__sentry_original__}function eP(e){if(FN(e))return{message:e.message,name:e.name,stack:e.stack,...tP(e)};if(GN(e)){let{type:t,target:n,currentTarget:r,detail:i}=e;return{type:t,target:n,currentTarget:r,...i?{detail:i}:{},...tP(e)}}return e}function tP(e){return WN(e)?Object.fromEntries(Object.entries(e)):{}}function nP(e){let t=Object.keys(eP(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var rP;function iP(e){if(rP!==void 0)return rP?rP(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=G;return t in n&&typeof n[t]==`function`?(rP=n[t],rP(e)):(rP=null,e())}function aP(){return iP(()=>Math.random())}function oP(){return iP(()=>Date.now())}var sP=Symbol.for(`sentry.skipNormalization`),cP=Symbol.for(`sentry.overrideNormalizationDepth`);function lP(e){ZN(e,sP,!0)}function uP(e){return!!e[sP]}function dP(e){let t=e[cP];return typeof t==`number`?t:void 0}var fP;function pP(e){fP=e}function mP(e,t=100,n=1/0){try{return gP(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function hP(e,t=3,n=102400){let r=mP(e,t);return bP(r)>n?hP(e,t-1,n):r}function gP(e,t,n=1/0,r=1/0,i=xP()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=_P(e,t);if(!s.startsWith(`[object `))return s;if(uP(t))return t;let c=dP(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return gP(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=eP(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=gP(e,t,l-1,r,i),f++}return o(t),d}function _P(e,t){try{if(fP){let e=fP(t);if(e)return e}return typeof global<`u`&&t===global?`[Global]`:typeof t==`number`&&!Number.isFinite(t)?`[${t}]`:typeof t==`function`?`[Function: ${bN(t)}]`:typeof t==`symbol`?`[${String(t)}]`:typeof t==`bigint`?`[BigInt: ${String(t)}]`:`[object ${vP(t)}]`}catch(e){return`**non-serializable** (${e})`}}function vP(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function yP(e){return~-encodeURI(e).split(/%..|./).length}function bP(e){return yP(JSON.stringify(e))}function xP(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function SP(e,t=`[unserializable]`){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return typeof t==`function`?t(e):t}}function CP(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function wP(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let a=Math.min(i+140,r);return a>r-5&&(a=r),a===r&&(i=Math.max(a-140,0)),n=n.slice(i,a),i>0&&(n=`'{snip} ${n}`),a<r&&(n+=` {snip}`),n}function TP(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];HN(r)?n.push(String(r)):r instanceof Error?n.push(r.message?`${r.name}: ${r.message}`:r.name):n.push(_P(void 0,r))}return n.join(t)}function EP(e,t,n=!1){return BN(e)?KN(t)?t.test(e):BN(t)?n?e===t:e.includes(t):typeof t==`function`&&t(e):!1}function DP(e,t=[],n=!1){for(let r of t)if(EP(e,r,n))return!0;return!1}function OP(){let e=G;return e.crypto||e.msCrypto}var kP;function AP(){return aP()*16}function jP(e=OP()){try{if(e?.randomUUID)return iP(()=>e.randomUUID()).replace(/-/g,``)}catch{}return kP||=`10000000100040008000100000000000`,kP.replace(/[018]/g,e=>(e^(AP()&15)>>e/4).toString(16))}function MP(e){return e.exception?.values?.[0]}function NP(e){let{message:t,event_id:n}=e;if(t)return t;let r=MP(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function PP(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function FP(e,t){let n=MP(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function IP(e,t,n=5){if(t.lineno===void 0)return;let r=e.length,i=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,i-n),i).map(e=>wP(e,0)),t.context_line=wP(e[Math.min(r-1,i)],t.colno||0),t.post_context=e.slice(Math.min(i+1,r),i+1+n).map(e=>wP(e,0))}function LP(e){if(RP(e))return!0;try{ZN(e,`__sentry_captured__`,!0)}catch{}return!1}function RP(e){try{return e.__sentry_captured__}catch{}}var zP=1e3;function BP(){return oP()/zP}function VP(){let{performance:e}=G;if(!e?.now||!e.timeOrigin)return BP;let t=e.timeOrigin;return()=>(t+iP(()=>e.now()))/zP}var HP;function UP(){return(HP??=VP())()}var WP=null;function GP(){let{performance:e}=G;if(!e?.now)return;let t=3e5,n=iP(()=>e.now()),r=oP(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function KP(){return WP===null&&(WP=GP()),WP}function qP(e){let t=UP(),n={sid:jP(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>XP(n)};return e&&JP(n,e),n}function JP(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||UP(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:jP()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function YP(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),JP(e,n)}function XP(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function ZP(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=ZP(r[e],t[e],n-1));return r}function QP(){return jP()}function $P(){return jP().substring(16)}function eF(e){try{let t=G.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function tF(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var nF=`_sentrySpan`;function rF(e,t){t?ZN(e,nF,eF(t)):delete e[nF]}function iF(e){return tF(e[nF])}var aF=100,oF=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:QP(),sampleRand:aP()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,rF(t,iF(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&JP(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():UN(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,rF(this,void 0),this._attachments=[],this.setPropagationContext({traceId:QP(),sampleRand:aP()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:aF;if(n<=0)return this;let r={timestamp:BP(),...e,message:e.message?CP(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:iF(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ZP(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||jP();if(!this._client)return W&&K.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||jP();if(!this._client)return W&&K.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||jP();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(W&&K.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function sF(){return $M(`defaultCurrentScope`,()=>new oF)}function cF(){return $M(`defaultIsolationScope`,()=>new oF)}var lF=e=>e instanceof Promise&&!e[uF],uF=Symbol(`chained PromiseLike`),dF=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return lF(r)&&lF(e)?r:fF(e,r)},fF=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[uF]:!0}),t},pF=class{constructor(e,t){let n;n=e||new oF;let r;r=t||new oF,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return qN(n)?dF(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function mF(){let e=QM(ZM());return e.stack=e.stack||new pF(sF(),cF())}function hF(e){return mF().withScope(e)}function gF(e,t){let n=mF();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function _F(e){return mF().withScope(()=>e(mF().getIsolationScope()))}function vF(){return{withIsolationScope:_F,withScope:hF,withSetScope:gF,withSetIsolationScope:(e,t)=>_F(t),getCurrentScope:()=>mF().getScope(),getIsolationScope:()=>mF().getIsolationScope()}}function yF(e){let t=QM(e);return t.acs?t.acs:vF()}function bF(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function xF(e,t){let{value:n,unit:r}=bF(e)?e:{value:e,unit:void 0},i=TF(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function SF(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=xF(i,t);e&&(n[r]=e)}return n}function CF(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let e=r.value;Array.isArray(e)?t+=wF(e[0])*e.length:HN(e)?t+=wF(e):t+=100}return t}function wF(e){return typeof e==`string`?e.length*2:typeof e==`boolean`?4:typeof e==`number`?8:0}function TF(e){if(Array.isArray(e))return{value:e,type:`array`};let t=typeof e==`string`?`string`:typeof e==`boolean`?`boolean`:typeof e==`number`&&!Number.isNaN(e)?Number.isInteger(e)?`integer`:`double`:null;if(t)return{value:e,type:t}}var EF;function DF(){return EF?.()}function OF(){return EF!==void 0}function q(){return yF(ZM()).getCurrentScope()}function kF(){return yF(ZM()).getIsolationScope()}function AF(){return $M(`globalScope`,()=>new oF)}function jF(...e){let t=yF(ZM());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function MF(...e){let t=yF(ZM());if(e.length===2){let[n,r]=e;return n?t.withSetIsolationScope(n,r):t.withIsolationScope(r)}return t.withIsolationScope(e[0])}function J(){return q().getClient()}function NF(e){let t=DF();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||$P()};return r&&(a.parent_span_id=r),a}var PF=`sentry.source`,FF=`sentry.sample_rate`,IF=`sentry.previous_trace_sample_rate`,LF=`sentry.op`,RF=`sentry.origin`,zF=`sentry.idle_span_finish_reason`,BF=`sentry.measurement_unit`,VF=`sentry.measurement_value`,HF=`sentry.release`,UF=`sentry.environment`,WF=`sentry.sdk.integrations`,GF=`user.id`,KF=`user.email`,qF=`user.ip_address`,JF=`user.name`,YF=`sentry.custom_span_name`,XF=`sentry.profile_id`,ZF=`sentry.exclusive_time`,QF=`url.full`,$F=`sentry.link.type`,eI=`gen_ai.conversation.id`;function tI(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function nI(e,t){e.setAttribute(`http.response.status_code`,t);let n=tI(t);n.message!==`unknown_error`&&e.setStatus(n)}var rI=`_sentryScope`,iI=`_sentryIsolationScope`,aI=Symbol.for(`sentry.otelSourceInference`),oI=Symbol.for(`sentry.otelSourceExplicitlySet`),sI=Symbol.for(`sentry.tracerProviderSpan`);function cI(e,t,n){e&&(ZN(e,iI,eF(n)),ZN(e,rI,t))}function lI(e){let t=e;return{scope:t[rI],isolationScope:tF(t[iI])}}function uI(e){return e[aI]===!0}function dI(e){ZN(e,oI,!0)}function fI(e){return e[sI]===!0}var pI=`sentry-`;function mI(e){let t=gI(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function hI(e){if(e)return vI(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${pI}${t}`]=n),e),{}))}function gI(e){if(!(!e||!BN(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=_I(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):_I(e)}function _I(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function vI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(W&&K.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var yI=/^o(\d+)\./,bI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function xI(e){return e===`http`||e===`https`}function SI(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function CI(e){let t=bI.exec(e);if(!t){rN(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return wI({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function wI(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function TI(e){if(!W)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>!e[t]&&(K.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?xI(r)?t&&isNaN(parseInt(t,10))?(K.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(K.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(K.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function EI(e){return e.match(yI)?.[1]}function DI(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=EI(n)),r}function OI(e){let t=typeof e==`string`?CI(e):wI(e);if(!(!t||!TI(t)))return t}function kI(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var AI=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function jI(e){if(!e)return;let t=e.match(AI);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function MI(e,t){let n=jI(e),r=mI(t);if(!n?.traceId)return{traceId:QP(),sampleRand:aP()};let i=FI(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function NI(e=QP(),t=$P(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function PI(e=QP(),t=$P(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function FI(e,t){let n=kI(t?.sample_rand);if(n!==void 0)return n;let r=kI(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?aP()*r:r+aP()*(1-r):aP()}function II(e,t){let n=DI(e);return t&&n&&t!==n?(K.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):e.getOptions().strictTraceContinuation&&(t&&!n||!t&&n)?(K.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}var LI=!1;function RI(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=KI(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function zI(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:KI(e).parent_span_id,a=lI(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||$P():t,trace_id:n}}function BI(e){let{traceId:t,spanId:n}=e.spanContext();return NI(t,n,QI(e))}function VI(e){let{traceId:t,spanId:n}=e.spanContext();return PI(t,n,QI(e))}function HI(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function UI(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function WI(e){return typeof e==`number`?GI(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?GI(e.getTime()):UP()}function GI(e){return e>9999999999?e/1e3:e}function KI(e){if(ZI(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(XI(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:JI(e),start_timestamp:WI(i),timestamp:WI(o)||void 0,status:$I(s),op:r[LF],origin:r[RF],links:HI(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function qI(e){if(ZI(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(XI(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{name:a,span_id:t,trace_id:n,parent_span_id:JI(e),start_timestamp:WI(i),end_timestamp:WI(o),is_segment:e===cL(e),status:eL(s),attributes:tL(r,s),links:UI(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:``,end_timestamp:0,status:`ok`,is_segment:e===cL(e)}}function JI(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function YI(e){return{...e,attributes:SF(e.attributes),links:e.links?.map(e=>({...e,attributes:SF(e.attributes)}))}}function XI(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function ZI(e){return typeof e.getSpanJSON==`function`}function QI(e){let{traceFlags:t}=e.spanContext();return t===1}function $I(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function eL(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}function tL(e,t){let n=eL(t)===`error`?t?.message:void 0;return{...n&&{"sentry.status.message":n},...e}}var nL=`_sentryChildSpans`,rL=`_sentryRootSpan`;function iL(e,t){ZN(t,rL,e[rL]||e),e[nL]?e[nL].add(t):ZN(e,nL,new Set([t]))}function aL(e,t){e[nL]&&e[nL].delete(t)}function oL(e){let t=new Set;function n(e){if(!t.has(e)&&QI(e)){t.add(e);let r=e[nL]?Array.from(e[nL]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var sL=cL;function cL(e){return e[rL]||e}function lL(){let e=yF(ZM());return e.getActiveSpan?e.getActiveSpan():iF(q())}function uL(){LI||=(rN(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function dL(e,t){e.updateName(t),e.setAttributes({[PF]:`custom`,[YF]:t})}var fL=!1;function pL(){if(fL)return;function e(){let e=lL(),t=e&&sL(e);if(t){let e=`internal_error`;W&&K.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}fL=!0,kN(e),MN(e)}function mL(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||J()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function hL(e){K.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function gL(e,t){if(!t?.length)return!1;for(let n of t){if(yL(n)){if(e.description&&EP(e.description,n))return W&&hL(e),!0;continue}let t=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!t)continue;let r=!n.name||e.description&&EP(e.description,n.name),i=!n.op||e.op&&EP(e.op,n.op),a=!n.attributes||Object.entries(n.attributes).every(([t,n])=>_L(e.attributes?.[t],n));if(r&&i&&a)return W&&hL(e),!0}return!1}function _L(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?EP(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function vL(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function yL(e){return typeof e==`string`||e instanceof RegExp}var bL=Symbol.for(`sentry.nonRecordingSpan`),xL=class{constructor(e={}){this._traceId=e.traceId||QP(),this._spanId=e.spanId||$P(),this.dropReason=e.dropReason,ZN(this,bL,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function SL(e){return!!e&&e[bL]===!0}var CL=`production`,wL=`_frozenDsc`;function TL(e,t){ZN(e,wL,t)}function EL(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:DI(t)};return t.emit(`createDsc`,i),i}function DL(e,t){let n=t.getPropagationContext();return n.dsc||EL(n.traceId,e)}function OL(e){let t=J();if(!t)return{};let n=sL(e),r=KI(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[wL];if(c)return s(c);let l=SL(n),u=l&&n.dropReason===`ignored`;if(l&&(!mL(t.getOptions())||u)){let e=lI(n).scope;if(e){let n={...DL(t,e)};return u&&(n.sampled=`false`),s(n)}}let d=a?.get(`sentry.dsc`),f=d&&mI(d);if(f)return s(f);let p=EL(e.spanContext().traceId,t),m=i[`sentry.source`]??i[`sentry.segment.name.source`],h=r.description;return m!==`url`&&h&&(p.transaction=h),mL()&&(p.sampled=String(QI(n)),p.sample_rand=a?.get(`sentry.sample_rand`)??lI(n).scope?.getPropagationContext().sampleRand.toString()),s(p),t.emit(`createDsc`,p,n),p}function kL(e){return hI(OL(e))}function AL(e){return ZN(e,`_streamed`,!0),e}function jL(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}function ML(e,t=[]){return[e,t]}function NL(e,t){let[n,r]=e;return[n,[...r,t]]}function PL(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function FL(e,t){return PL(e,(e,n)=>t.includes(n))}function IL(e){let t=QM(G);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function LL(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[IL(r),e]:r.push(typeof e==`string`?IL(e):e)}for(let e of n){let[t,n]=e;if(i(`
|
|
507
|
-
${JSON.stringify(t)}
|
|
508
|
-
`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(mP(n))}i(e)}}return typeof r==`string`?r:RL(r)}function RL(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function zL(e){return[{type:`span`},e]}function BL(e){let t=typeof e.data==`string`?IL(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var VL={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`,trace_metric:`metric`};function HL(e){return e in VL}function UL(e){return HL(e)?VL[e]:e}function WL(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function GL(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(oP()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:SI(r)},...i&&{trace:i}}}function KL(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function qL(e,t,n,r){let i=WL(n);return ML({sent_at:new Date(oP()).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:SI(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function JL(e,t,n,r){let i=WL(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;KL(e,n?.sdk);let o=GL(e,i,r,t);return delete e.sdkProcessingMetadata,ML(o,[[{type:a},e]])}function YL(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=OL(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date(oP()).toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:SI(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=KI(e);return!gL({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=KI(e);return(jL(s)?t:s(t))||(uL(),t)}:KI,f=[];for(let e of l){let t=d(e);t&&f.push(zL(t))}return ML(o,f)}function XL(e){if(!W)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=KI(e),{spanId:i}=e.spanContext(),a=QI(e),o=sL(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=KI(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}K.log(`${c}
|
|
509
|
-
${l.join(`
|
|
510
|
-
`)}`)}function ZL(e){if(!W)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=KI(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${sL(e)===e?`root `:``}span "${t}" with ID ${r}`;K.log(i)}function QL(e,t,n,r=lL()){let i=r&&sL(r);i&&(W&&K.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[VF]:t,[BF]:n}))}function $L(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[BF],i=n[VF];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function eR(){return QM(ZM()).segmentSpanCaptureStrategy}function tR(e){return e.getOptions().traceLifecycle===`stream`}var nR=1e3,rR=class{constructor(e={}){this._traceId=e.traceId||QP(),this._spanId=e.spanId||$P(),this._startTime=e.startTimestamp||UP(),this._links=e.links,this._attributes={},this.setAttributes({[RF]:`manual`,[LF]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._frozen||(this._links?this._links.push(e):this._links=[e]),this}addLinks(e){return this._frozen||(this._links?this._links.push(...e):this._links=e),this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return this._frozen?this:(t===void 0?delete this._attributes[e]:this._attributes[e]=t,e===`sentry.source`&&t!==void 0&&uI(this)&&dI(this),this)}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._frozen||(this._startTime=WI(e))}setStatus(e){return this._frozen||(this._status=e),this}updateName(e){return this._frozen?this:(this._name=e,uI(this)||this.setAttribute(PF,`custom`),this)}end(e){if(this._endTime){this._frozen=fI(this);return}this._endTime=WI(e),ZL(this),this._onSpanEnded(),this._frozen=fI(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[LF],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:$I(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[RF],profile_id:this._attributes[XF],exclusive_time:this._attributes[ZF],measurements:$L(this._events),is_segment:this._isStandaloneSpan&&sL(this)===this||void 0,segment_id:this._isStandaloneSpan?sL(this).spanContext().spanId:void 0,links:HI(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===sL(this),status:eL(this._status),attributes:tL(this._attributes,this._status),links:UI(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){if(this._frozen)return this;W&&K.log(`[Tracing] Adding an event to span:`,e);let r=iR(t)?t:n||UP(),i=iR(t)?{}:t||{},a={name:e,time:WI(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=J();e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this));let t=sL(this),n=this._isStandaloneSpan||this===t;if(this._isStandaloneSpan){this._sampled?sR(YL([this],e)):(W&&K.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}if(!n){let e=eR();if(e){let n=lI(this).scope||q();e.onChildSpanEnded(this,t,e=>this._convertSpanToTransaction(e),n)}return}if(e&&tR(e)){e.emit(`afterSegmentSpanEnd`,this);return}let r=lI(this).scope||q(),i=eR();if(i)i.onSegmentSpanEnded(e=>this._convertSpanToTransaction(e),r);else{let e=this._convertSpanToTransaction();e&&r.captureEvent(e)}}_convertSpanToTransaction(e={}){if(!aR(KI(this)))return;this._name||=(W&&K.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:t,isolationScope:n}=lI(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;e.onSpanCaptured?.(this);let i=[];for(let t of oL(this)){if(t===this||oR(t)||e.isSpanAlreadyCaptured?.(t))continue;let n=KI(t);aR(n)&&(e.onSpanCaptured?.(t),i.push(n))}let a=this._attributes[PF];delete this._attributes[YF];let o=!1;i.forEach(e=>{delete e.data[YF],e.op?.startsWith(`gen_ai.`)&&(o=!0)});let s={contexts:{trace:RI(this)},spans:i.length>nR?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,nR):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:OL(this),hasGenAiSpans:o},request:r,...a&&{transaction_info:{source:a}}},c=$L(this._events);return c&&Object.keys(c).length&&(W&&K.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(c,void 0,2)),s.measurements=c),s}};function iR(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function aR(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function oR(e){return e instanceof rR&&e.isStandaloneSpan()}function sR(e){let t=J();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function cR(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return lR(i,t,n,r)}function lR(e,t,n,r){return qN(e)?dF(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}function uR(e,t,n){if(!mL(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=kI(i);if(a===void 0)return W&&K.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return W&&K.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,a,r];let o=n<a;return o||W&&K.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var dR=`__SENTRY_SUPPRESS_TRACING__`;function fR(e,t){let n=wR();if(n.startSpan)return n.startSpan(e,t);let r=CR(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return jF(s,()=>OR(a)(()=>{let n=q(),o=DR(n,a),s=J(),c=e.onlyIfParent&&!o?xR(n,s):SR({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!AR(c)||!o)&&rF(n,c),cR(()=>t(c),()=>{let{status:e}=KI(c);c.isRecording()&&(!e||e===`ok`)&&c.setStatus({code:2,message:`internal_error`})},()=>{c.end()})}))}function pR(e,t){let n=wR();if(n.startSpanManual)return n.startSpanManual(e,t);let r=CR(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return jF(s,()=>OR(a)(()=>{let n=q(),o=DR(n,a),s=e.onlyIfParent&&!o?xR(n,J()):SR({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return(!AR(s)||!o)&&rF(n,s),cR(()=>t(s,()=>s.end()),()=>{let{status:e}=KI(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})})}))}function mR(e){let t=wR();return t.startInactiveSpan?t.startInactiveSpan(e):hR(e)}function hR(e){let t=CR(e),{forceTransaction:n,parentSpan:r}=e;return(e.scope?t=>jF(e.scope,t):r===void 0?e=>e():e=>_R(r,e))(()=>{let i=q(),a=DR(i,r),o=J();return e.onlyIfParent&&!a?xR(i,o):SR({parentSpan:a,spanArguments:t,forceTransaction:n,scope:i})})}var gR=(e,t)=>{let n=yF(ZM());if(n.continueTrace)return n.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,a=J(),o=mI(i);return a&&!II(a,o?.org_id)?bR(t):jF(e=>{let n=MI(r,i);return e.setPropagationContext(n),rF(e,void 0),t()})};function _R(e,t){let n=wR();return n.withActiveSpan?n.withActiveSpan(e,t):jF(n=>(rF(n,e||void 0),t(n)))}function vR(e){let t=wR();return t.suppressTracing?t.suppressTracing(e):jF(t=>{t.setSDKProcessingMetadata({[dR]:!0});let n=e();return t.setSDKProcessingMetadata({[dR]:void 0}),n})}function yR(e=q()){let t=wR();return t.isTracingSuppressed?t.isTracingSuppressed(e):e.getScopeData().sdkProcessingMetadata[dR]===!0}function bR(e){let t=wR();return t.startNewTrace?t.startNewTrace(e):jF(t=>(t.setPropagationContext({traceId:QP(),sampleRand:aP()}),W&&K.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),_R(null,e)))}function xR(e,t){t?.recordDroppedEvent(`no_parent_span`,`span`);let n=new xL({traceId:e.getPropagationContext().traceId});return cI(n,e,kF()),n}function SR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){let i=kF();if(!mL()){let t={...i.getPropagationContext(),...r.getPropagationContext()},a=new xL({traceId:e?e.spanContext().traceId:t.traceId});return e&&!n&&iL(e,a),cI(a,r,i),a}let a=J();if(kR(a,t)){yR(r)||a?.recordDroppedEvent(`ignored`,`span`);let t=new xL({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});return e&&!n&&iL(e,t),cI(t,r,i),t}let o;if(e&&!n)o=ER(e,r,t,i),iL(e,o);else if(e){let n=OL(e),{traceId:a,spanId:s}=e.spanContext(),c=QI(e);o=TR({traceId:a,parentSpanId:s,...t},r,i,c),TL(o,n)}else{let{traceId:e,dsc:n,parentSpanId:a,sampled:s}={...i.getPropagationContext(),...r.getPropagationContext()};o=TR({traceId:e,parentSpanId:a,...t},r,i,s),n&&TL(o,n)}return XL(o),o}function CR(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=WI(e.startTime),delete n.startTime,n}return t}function wR(){return yF(ZM())}function TR(e,t,n,r){let i=J(),a=i?.getOptions()||{},{name:o=``}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};i?.emit(`beforeSampling`,s,{decision:!1});let c=s.parentSampled??r,l=s.spanAttributes,u=t.getPropagationContext(),d=yR(t),[f,p,m]=d?[!1]:uR(a,{name:o,parentSampled:c,attributes:l,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:kI(u.dsc?.sample_rate)},u.sampleRand),h=new rR({...e,attributes:{[PF]:`custom`,[FF]:p!==void 0&&m?p:void 0,...l},sampled:f});return!f&&i&&!d&&(W&&K.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),i.recordDroppedEvent(`sample_rate`,tR(i)?`span`:`transaction`)),cI(h,t,n),i&&i.emit(`spanStart`,h),h}function ER(e,t,n,r){let{spanId:i,traceId:a}=e.spanContext(),o=yR(t),s=!o&&QI(e),c=s?new rR({...n,parentSpanId:i,traceId:a,sampled:s}):new xL({traceId:a});iL(e,c),cI(c,t,r);let l=J();return l?(tR(l)&&SL(c)&&(SL(e)&&e.dropReason?(c.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,`span`)):o||(c.dropReason=`sample_rate`,l.recordDroppedEvent(`sample_rate`,`span`))),l.emit(`spanStart`,c),n.endTimestamp&&(l.emit(`spanEnd`,c),l.emit(`afterSpanEnd`,c)),c):c}function DR(e,t){if(t)return t;if(t===null)return;let n=iF(e);if(!n)return;let r=J();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?sL(n):n}function OR(e){return e===void 0?e=>e():t=>_R(e,t)}function kR(e,t){let n=e?.getOptions().ignoreSpans;return!e||!tR(e)||!n?.length?!1:gL({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function AR(e){return SL(e)&&e.dropReason===`ignored`}var jR={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},MR=`heartbeatFailed`,NR=`idleTimeout`,PR=`finalTimeout`,FR=`externalFinish`;function IR(e,t={}){let n=new Map,r=!1,i,a=FR,o=!t.disableAutoFinish,s=[],{idleTimeout:c=jR.idleTimeout,finalTimeout:l=jR.finalTimeout,childSpanTimeout:u=jR.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:f=!0}=t,p=J(),m=q();if(!p||!mL()){let e=new xL({traceId:m.getPropagationContext().traceId});return cI(e,m,kF()),e}let h=lL(),g=LR(e);g.end=new Proxy(g.end,{apply(e,t,n){if(d&&d(g),SL(t))return;let[r,...i]=n,a=WI(r||UP()),o=oL(g).filter(e=>e!==g),s=KI(g);if(!o.length||!f)return S(a),Reflect.apply(e,t,[a,...i]);let c=p.getOptions().ignoreSpans,u=o?.reduce((e,t)=>{let n=KI(t);return!n.timestamp||c&&gL({description:n.description,op:n.op,attributes:n.data},c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),m=s.start_timestamp,h=Math.min(m?m+l/1e3:1/0,Math.max(m||-1/0,Math.min(a,u||1/0)));return S(h),Reflect.apply(e,t,[h,...i])}});function _(){i&&=(clearTimeout(i),void 0)}function v(e){_(),i=setTimeout(()=>{!r&&n.size===0&&o&&(a=NR,g.end(e))},c)}function y(e){i=setTimeout(()=>{!r&&o&&(a=MR,g.end(e))},u)}function b(e){_(),n.set(e,!0),y(UP()+u/1e3)}function x(e){n.has(e)&&n.delete(e),n.size===0&&v(UP()+c/1e3)}function S(e){r=!0,n.clear(),s.forEach(e=>e()),rF(m,h);let t=KI(g),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||g.setAttribute(zF,a);let o=t.status;(!o||o===`unknown`)&&g.setStatus({code:1}),K.log(`[Tracing] Idle span "${t.op}" finished`);let u=oL(g).filter(e=>e!==g),d=0;u.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e),W&&K.log(`[Tracing] Cancelling span since span ended early`,JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=KI(t),i=r<=e,a=(l+c)/1e3,o=n-r<=a;if(W){let e=JSON.stringify(t,void 0,2);i?o||K.log(`[Tracing] Discarding span since it finished after idle span final timeout`,e):K.log(`[Tracing] Discarding span since it happened after idle span was finished`,e)}(!o||!i)&&(aL(g,t),d++)}),d>0&&g.setAttribute(`sentry.idle_span_discarded_spans`,d)}return s.push(p.on(`spanStart`,e=>{r||e===g||KI(e).timestamp||e instanceof rR&&e.isStandaloneSpan()||oL(g).includes(e)&&b(e.spanContext().spanId)})),s.push(p.on(`spanEnd`,e=>{r||x(e.spanContext().spanId)})),s.push(p.on(`idleSpanEnableAutoFinish`,e=>{e===g&&(o=!0,v(),n.size&&y())})),t.disableAutoFinish||v(),setTimeout(()=>{r||(g.setStatus({code:2,message:`deadline_exceeded`}),a=PR,g.end())},l),g}function LR(e){let t=mR(e);return rF(q(),t),W&&K.log(`[Tracing] Started span is an idle span`),t}function RR(e,t,n){let r,i,a,o=n?.maxWait?Math.max(n.maxWait,t):0,s=n?.setTimeoutImpl||setTimeout;function c(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),a!==void 0&&clearTimeout(a),i=a=void 0}function u(){return i!==void 0||a!==void 0?c():r}function d(){return i&&clearTimeout(i),i=s(c,t),o&&a===void 0&&(a=s(c,o)),r}return d.cancel=l,d.flush=u,d}var zR=[`addListener`,`on`,`once`,`prependListener`,`prependOnceListener`,`addEventListener`],BR=[`removeListener`,`off`,`removeEventListener`],VR=Symbol(`SentryScopeBoundListeners`),HR;function UR(e){return HR!==void 0&&(e===HR||e.listener===HR)}function WR(e,t=q()){let n=e;if(ZR(n))return e;XR(n);for(let e of zR)typeof n[e]==`function`&&(n[e]=qR(n,n[e],t));for(let e of BR)typeof n[e]==`function`&&(n[e]=JR(n,n[e]));return typeof n.removeAllListeners==`function`&&(n.removeAllListeners=YR(n,n.removeAllListeners)),e}function GR(e,t){return function(...n){return jF(t,()=>e.apply(this,n))}}function KR(e){return typeof e==`function`}function qR(e,t,n){return function(...r){let i=r[0],a=r[1],o=r.slice(2);if(!KR(a)||UR(a))return t.apply(this,r);let s=ZR(e)||XR(e),c=s.get(i);c||(c=new WeakMap,s.set(i,c));let l=c.get(a);l||(l=GR(a,n),c.set(a,l));let u=HR;HR=l;try{return t.call(this,i,l,...o)}finally{HR=u}}}function JR(e,t){return function(...n){let r=n[0],i=n[1],a=n.slice(2),o=KR(i)?ZR(e)?.get(r)?.get(i):void 0;return o?t.call(this,r,o,...a):t.apply(this,n)}}function YR(e,t){return function(...n){let r=ZR(e);if(r)if(n.length===0)XR(e);else{let e=n[0];r.delete(e)}return t.apply(this,n)}}function XR(e){let t=new Map;return e[VR]=t,t}function ZR(e){return e[VR]}function QR(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;nz(e,t),r&&az(e,r),oz(e,n),rz(e,i),iz(e,a)}function $R(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;ez(e,`extra`,n),ez(e,`tags`,r),ez(e,`attributes`,i),ez(e,`user`,a),ez(e,`contexts`,o),e.sdkProcessingMetadata=ZP(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function ez(e,t,n){e[t]=ZP(e[t],n,1)}function tz(e,t){let n=AF().getScopeData();return e&&$R(n,e.getScopeData()),t&&$R(n,t.getScopeData()),n}function nz(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function rz(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function iz(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function az(e,t){e.contexts={trace:zI(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:OL(t),...e.sdkProcessingMetadata};let n=KI(sL(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function oz(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function sz(e){let t={},{response:n,profile:r,cloud_resource:i,culture:a,state:o}=e;if(n&&(n.status_code!=null&&(t[`http.response.status_code`]=n.status_code),n.body_size!=null&&(t[`http.response.body.size`]=n.body_size)),r&&(r.profile_id&&(t[`sentry.profile_id`]=r.profile_id),r.profiler_id&&(t[`sentry.profiler_id`]=r.profiler_id)),i)for(let[e,n]of Object.entries(i))n!=null&&(t[e]=n);a&&(a.locale&&(t[`culture.locale`]=a.locale),a.timezone&&(t[`culture.timezone`]=a.timezone)),o?.state&&typeof o.state.type==`string`&&(t[`state.type`]=o.state.type);let s=e.angular;if(s){let e=s.version;(typeof e==`string`||typeof e==`number`)&&(t[`angular.version`]=e)}let c=e.react;if(c){let e=c.version;(typeof e==`string`||typeof e==`number`)&&(t[`react.version`]=e)}return t}function cz(e,t){let n=qI(e),r=cL(e),i=qI(r),{isolationScope:a,scope:o}=lI(e),s=tz(a,o);fz(n,i,t,s);let c=e.kind;t.emit(`preprocessSpan`,n,{spanKind:c}),n.is_segment&&(lz(n,s),dz(n,t),t.emit(`processSegmentSpan`,n)),t.emit(`processSpan`,n);let{beforeSendSpan:l}=t.getOptions(),u=l&&jL(l)?pz(n,l):n,d=u.attributes?.[PF];return n.is_segment&&d&&uz(u,{"sentry.segment.name.source":d}),{...YI(u),_segmentSpan:r}}function lz(e,t){uz(e,sz(t.contexts))}function uz(e,t){let n=e.attributes??={};Object.entries(t).forEach(([e,t])=>{t!=null&&!(e in n)&&(n[e]=t)})}function dz(e,t){let n=t.getIntegrationNames();n.length&&uz(e,{[WF]:n})}function fz(e,t,n,r){let i=n.getSdkMetadata(),{release:a,environment:o}=n.getOptions();uz(e,{[Lc]:`stream`,[Ic]:t.name,[Fc]:t.span_id,[Nc]:i?.sdk?.name,[Pc]:i?.sdk?.version,[HF]:a,[UF]:o||`production`,[GF]:r.user?.id,[KF]:r.user?.email,[qF]:r.user?.ip_address,[JF]:r.user?.username,...r.attributes})}function pz(e,t){return t(e)||(uL(),e)}var mz=0,hz=1,gz=2;function _z(e){return new yz(t=>{t(e)})}function vz(e){return new yz((t,n)=>{n(e)})}var yz=class e{constructor(e){this._state=mz,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===mz)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===hz&&e[1](this._value),this._state===gz&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===mz){if(qN(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(hz,e)},r=e=>{t(gz,e)};try{e(n,r)}catch(e){r(e)}}};function bz(e,t,n,r=0){try{let i=xz(t,n,e,r);return qN(i)?i:_z(i)}catch(e){return vz(e)}}function xz(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return W&&a===null&&K.log(`Event processor "${i.id||`?`}" dropped event`),qN(a)?a.then(e=>xz(e,t,n,r+1)):xz(a,t,n,r+1)}var Sz,Cz,wz,Tz;function Ez(e){let t=G._sentryDebugIds,n=G._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Tz&&r.length===Cz&&i.length===wz)return Tz;Cz=r.length,wz=i.length,Tz={},Sz||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=Sz?.[r];if(i&&Tz&&t)Tz[i[0]]=t,Sz&&(Sz[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&Tz&&Sz){Tz[i]=t,Sz[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Tz}function Dz(e,t){let n=Ez(e);if(!n)return[];let r=[];for(let e of t){let t=SN(e);t&&n[t]&&r.push({type:`sourcemap`,code_file:e,debug_id:n[t]})}return r}function Oz(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||jP(),timestamp:t.timestamp||BP()},l=n.integrations||e.integrations.map(e=>e.name);kz(c,e),Mz(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Az(c,e.stackParser);let u=Pz(r,n.captureContext);n.mechanism&&FP(c,n.mechanism);let d=i?i.getEventProcessors():[],f=tz(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),QR(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?_z(c):bz(m,c,n)).then(e=>(e&&jz(e),typeof o==`number`&&o>0?Nz(e,o,s):e))}function kz(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=CP(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=CP(e.value,a)})}function Az(e,t){let n=Ez(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function jz(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Mz(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Nz(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:mP(e.data,t,n)}}))},...e.user&&{user:mP(e.user,t,n)},...e.contexts&&{contexts:mP(e.contexts,t,n)},...e.extra&&{extra:mP(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=mP(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:mP(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=mP(e.contexts.flags,3,n)),r}function Pz(e,t){if(!t)return e;let n=e?e.clone():new oF;return n.update(t),n}function Fz(e){if(e)return Iz(e)||Rz(e)?{captureContext:e}:e}function Iz(e){return e instanceof oF||typeof e==`function`}var Lz=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Rz(e){return Object.keys(e).some(e=>Lz.includes(e))}function zz(e,t){return q().captureException(e,Fz(t))}function Bz(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return q().captureMessage(e,n,r)}function Vz(e,t){return q().captureEvent(e,t)}function Hz(e,t){kF().setContext(e,t)}function Uz(e){kF().setExtras(e)}function Wz(e,t){kF().setExtra(e,t)}function Gz(e){kF().setTags(e)}function Kz(e,t){kF().setTag(e,t)}function qz(e){kF().setAttributes(e)}function Jz(e,t){kF().setAttribute(e,t)}function Yz(e){kF().setUser(e)}function Xz(e){kF().setConversationId(e)}function Zz(){return kF().lastEventId()}function Qz(){return!!J()}function $z(){let e=J();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function eB(e){kF().addEventProcessor(e)}function tB(e){let t=kF(),{user:n}=tz(t,q()),{userAgent:r}=G.navigator||{},i=qP({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&JP(a,{status:`exited`}),nB(),t.setSession(i),i}function nB(){let e=kF(),t=q().getSession()||e.getSession();t&&YP(t),rB(),e.setSession()}function rB(){let e=kF(),t=J(),n=e.getSession();n&&t&&t.captureSession(n)}function iB(e=!1){if(e){nB();return}rB()}function aB(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}function oB(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function sB(e){return`${oB(e)}${e.projectId}/envelope/`}function cB(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function lB(e,t,n){return t||`${sB(e)}?${cB(e,n)}`}function uB(e,t){let n=OI(e);if(!n)return``;let r=`${oB(n)}embed/error-page/`,i=`dsn=${SI(n)}`;for(let e in t)if(e!==`dsn`&&e!==`onClose`)if(e===`user`){let e=t.user;if(!e)continue;e.name&&(i+=`&name=${encodeURIComponent(e.name)}`),e.email&&(i+=`&email=${encodeURIComponent(e.email)}`)}else i+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${r}?${i}`}var dB=[];function fB(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function pB(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return fB(r)}function mB(e,t){let n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&gB(e,t,n)}),n}function hB(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function gB(e,t,n){if(n[t.name]){W&&K.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!dB.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),dB.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}[`processSpan`,`processSegmentSpan`].forEach(n=>{let r=t[n];typeof r==`function`&&e.on(n,n=>r.call(t,n,e))}),W&&K.log(`Integration installed: ${t.name}`)}function _B(e){let t=J();if(!t){W&&K.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function vB(e){return e}var yB=`sentry.timestamp.sequence`,bB=0,xB;function SB(e){let t=Math.floor(e*1e3);xB!==void 0&&t!==xB&&(bB=0);let n=bB;return bB++,xB=t,{key:yB,value:{value:n,type:`integer`}}}function CB(e,t){return t?jF(t,()=>{let n=lL(),r=n?zI(n):NF(t);return[n?OL(n):DL(e,t),r]}):[void 0,void 0]}var wB={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function TB(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function EB(){return`npm`}function DB(){return!TB()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function OB(){return typeof window<`u`&&(!DB()||kB())}function kB(){return G.process?.type===`renderer`}function AB(e,t){let n=t?`auto`:`never`;return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{version:2,...OB()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function jB(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=SI(r)),ML(a,[AB(e,i)])}var MB=100;function NB(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function PB(e,t){let n=RB(),r=LB(e);r===void 0?n.set(e,[t]):r.length>=MB?(IB(e,r),n.set(e,[t])):n.set(e,[...r,t])}function FB(e,t=q(),n=PB){let r=t?.getClient()??J();if(!r){W&&K.warn(`No client available to capture log.`);return}let{release:i,environment:a,enableLogs:o=!1,beforeSendLog:s}=r.getOptions();if(!o){W&&K.warn(`logging option not enabled, log will not be captured.`);return}let[,c]=CB(r,t),l={...e.attributes},{user:{id:u,email:d,username:f},attributes:p={}}=tz(kF(),t);NB(l,`user.id`,u,!1),NB(l,`user.email`,d,!1),NB(l,`user.name`,f,!1),NB(l,`sentry.release`,i),NB(l,`sentry.environment`,a);let{name:m,version:h}=r.getSdkMetadata()?.sdk??{};NB(l,`sentry.sdk.name`,m),NB(l,`sentry.sdk.version`,h);let g=r.getIntegrationByName(`Replay`),_=g?.getReplayId(!0);NB(l,`sentry.replay_id`,_),_&&g?.getRecordingMode()===`buffer`&&NB(l,`sentry._internal.replay_is_buffering`,!0);let v=e.message;if(VN(v)){let{__sentry_template_string__:e,__sentry_template_values__:t=[]}=v;t?.length&&(l[`sentry.message.template`]=e),t.forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=e})}NB(l,`sentry.trace.parent_span_id`,iF(t)?.spanContext().spanId);let y={...e,attributes:l};r.emit(`beforeCaptureLog`,y);let b=s?rN(()=>s(y)):y;if(!b){r.recordDroppedEvent(`before_send`,`log_item`,1),W&&K.warn(`beforeSendLog returned null, log will not be captured.`);return}let{level:x,message:S,attributes:C={},severityNumber:w}=b,T=UP(),ee=SB(T);n(r,{timestamp:T,level:x,body:BB(String(S)),trace_id:c?.trace_id,severity_number:w??wB[x],attributes:zB({...SF(p),...SF(C,!0),[ee.key]:ee.value})}),r.emit(`afterCaptureLog`,b)}function IB(e,t){let n=t??LB(e)??[];if(n.length===0)return;let r=e.getOptions(),i=jB(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);RB().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function LB(e){return RB().get(e)}function RB(){return $M(`clientToLogBufferMap`,()=>new WeakMap)}function zB(e){let t={};for(let[n,r]of Object.entries(e)){let e=BB(n);t[e]=r.type===`string`?{...r,value:BB(r.value)}:r}return t}function BB(e){let t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n==`function`&&typeof r==`function`?n.call(e)?e:r.call(e):e}function VB(e,t){let n=t?`auto`:`never`;return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{version:2,...OB()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function HB(e,t,n,r,i){let a={};return t?.sdk&&(a.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(a.dsn=SI(r)),ML(a,[VB(e,i)])}var UB=1e3;function WB(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function GB(e,t){let n=ZB(),r=XB(e);r===void 0?n.set(e,[t]):r.length>=UB?(YB(e,r),n.set(e,[t])):n.set(e,[...r,t])}function KB(e,t,n){let{release:r,environment:i}=t.getOptions(),a={...e.attributes};WB(a,`user.id`,n.id,!1),WB(a,`user.email`,n.email,!1),WB(a,`user.name`,n.username,!1),WB(a,`sentry.release`,r),WB(a,`sentry.environment`,i);let{name:o,version:s}=t.getSdkMetadata()?.sdk??{};WB(a,`sentry.sdk.name`,o),WB(a,`sentry.sdk.version`,s);let c=t.getIntegrationByName(`Replay`),l=c?.getReplayId(!0);return WB(a,`sentry.replay_id`,l),l&&c?.getRecordingMode()===`buffer`&&WB(a,`sentry._internal.replay_is_buffering`,!0),{...e,attributes:a}}function qB(e,t,n,r){let[,i]=CB(t,n),a=iF(n),o=a?a.spanContext().traceId:i?.trace_id,s=a?a.spanContext().spanId:void 0,c=UP(),l=SB(c);return{timestamp:c,trace_id:o??``,span_id:s,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...SF(r),...SF(e.attributes,`skip-undefined`),[l.key]:l.value}}}function JB(e,t){let n=t?.scope??q(),r=t?.captureSerializedMetric??GB,i=n?.getClient()??J();if(!i){W&&K.warn(`No client available to capture metric.`);return}let{_experiments:a,enableMetrics:o,beforeSendMetric:s}=i.getOptions();if(!(o??a?.enableMetrics??!0)){W&&K.warn(`metrics option not enabled, metric will not be captured.`);return}let{user:c,attributes:l}=tz(kF(),n),u=KB(e,i,c);i.emit(`processMetric`,u);let d=s||a?.beforeSendMetric,f=d?d(u):u;if(!f){W&&K.log("`beforeSendMetric` returned `null`, will not send metric.");return}let p=qB(f,i,n,l);W&&K.log(`[Metric]`,p),r(i,p),i.emit(`afterCaptureMetric`,f)}function YB(e,t){let n=t??XB(e)??[];if(n.length===0)return;let r=e.getOptions(),i=HB(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);ZB().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function XB(e){return ZB().get(e)}function ZB(){return $M(`clientToMetricBufferMap`,()=>new WeakMap)}function QB(e){return YI({trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||``,start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status===`ok`||e.status===`cancelled`?`ok`:`error`,is_segment:!1,attributes:{...e.data},links:e.links})}function $B(e,t){if(e.type!==`transaction`||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||tR(t))return;let n=[],r=[];for(let t of e.spans)t.op?.startsWith(`gen_ai.`)?n.push(QB(t)):r.push(t);if(n.length===0)return;e.spans=r;let i=t.getDataCollectionOptions().userInfo?`auto`:`never`;return[{type:`span`,item_count:n.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...OB()&&{ingest_settings:{infer_ip:i,infer_user_agent:i}},items:n}]}var eV=Symbol.for(`SentryBufferFullError`);function tV(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return vz(eV);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return _z(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>aB(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var nV=6e4;function rV(e,t=oP()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?nV:r-t}function iV(e,t){return e[t]||e.all||0}function aV(e,t,n=oP()){return iV(e,t)>n}function oV(e,{statusCode:t,headers:n},r=oP()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+rV(o,r):t===429&&(i.all=r+6e4);return i}function sV(e,t,n=tV(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(PL(i,(t,n)=>{let i=UL(n);aV(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=ML(i[0],a),s=t=>{if(FL(o,[`client_report`])){W&&K.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}PL(o,(n,r)=>{e.recordDroppedEvent(t,UL(r))})};return n.add(()=>t({body:LL(o)}).then(e=>e.statusCode===413?(W&&K.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(W&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&K.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=oV(r,e),e),e=>{throw s(`network_error`),W&&K.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===eV)return W&&K.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function cV(e,t,n){let r=[{type:`client_report`},{timestamp:n||BP(),discarded_events:e}];return ML(t?{dsn:t}:{},[r])}function lV(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function uV(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[XF],exclusive_time:o?.[ZF],measurements:e.measurements,is_segment:!0}}function dV(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var fV=`[Filtered]`,pV=[`forwarded`,`-ip`,`remote-`,`via`,`-user`],mV=[`auth`,`token`,`secret`,`session`,`password`,`passwd`,`pwd`,`key`,`jwt`,`bearer`,`sso`,`saml`,`csrf`,`xsrf`,`credentials`,`sid`,`identity`,`set-cookie`,`cookie`],hV=[`.sid`,`sessid`,`remember`,`oidc`,`pkce`,`nonce`,`__secure-`,`__host-`,`awsalb`,`awselb`,`akamai`,`__stripe`,`cognito`,`firebase`,`supabase`,`sb-`,`mfa`,`2fa`];function gV(e){return e===!0?{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},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:pV},httpHeaders:{request:{deny:pV},response:{deny:pV}},httpBodies:[],urlQueryParams:{deny:pV},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}var _V={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},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function vV(e){let t=e.dataCollection==null?gV(e.sendDefaultPii):_V,n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:n.httpHeaders?.request??t.httpHeaders.request,response:n.httpHeaders?.response??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var yV=`Not capturing exception because it's already been captured.`,bV=`Discarded session because of missing or non-string release`,xV=Symbol.for(`SentryInternalError`),SV=Symbol.for(`SentryDoNotSendEventError`),CV=5e3;function wV(e){return{message:e,[xV]:!0}}function TV(e){return{message:e,[SV]:!0}}function EV(e){return WN(e)&&xV in e}function DV(e){return WN(e)&&SV in e}function OV(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{if(a+=r(t),a>=8e5)i(e);else if(!s){let t=e.getOptions()._flushInterval??CV;t>0&&(s=!0,o=aB(setTimeout(()=>{i(e)},t)))}}),e.on(`flush`,()=>{i(e)})}var kV=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=tV(e.transportOptions?.bufferSize??64),this._dataCollection=vV(e),e.dsn?this._dsn=OI(e.dsn):W&&K.warn(`No DSN provided, client will not send events.`),this._dsn){let t=lB(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&OV(this,`afterCaptureLog`,`flushLogs`,IV,IB),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&OV(this,`afterCaptureMetric`,`flushMetrics`,FV,YB)}captureException(e,t,n){let r=jP();if(LP(e))return W&&K.log(yV),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:jP(),...n},a=VN(e)?e:String(e),o=HN(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=jP();if(t?.originalException&&LP(t.originalException))return W&&K.log(yV),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=AV(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),JP(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(this.emit(`flush`),!t)return!0;let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){let t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),gB(this,e,this._integrations),t||hB(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=$B(e,this),r=JL(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])r=NL(r,BL(e));n&&(r=NL(r,n)),this.sendEnvelope(r).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=CL}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){W&&K.warn(bV);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){W&&K.warn(bV);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=qL(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;W&&K.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return W&&K.error(`Error while sending envelope:`,e),{}}return W&&K.error(`Transport disabled`),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=mB(this,e),hB(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(JP(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=this.getIntegrationNames();return!t.integrations&&a.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Oz(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...NF(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:DL(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=q(),r=kF()){return W&&NV(e)&&K.log(`Captured error event \`${lV(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{W&&(DV(e)?K.log(e.message):EV(e)?K.warn(e.message):K.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=PV(e),s=NV(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:kI(a);if(s&&typeof l==`number`&&aP()>l)return this.recordDroppedEvent(`sample_rate`,`error`),vz(TV(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=AV(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),TV("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:jV(MV(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw TV(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw DV(e)||EV(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),wV(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
511
|
-
Reason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===eV&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){W&&K.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){W&&K.log(`No outcomes to send`);return}if(!this._dsn){W&&K.log(`No dsn provided, will not send outcomes`);return}W&&K.log(`Sending outcomes:`,e);let t=cV(e,this._options.tunnel&&SI(this._dsn));this.sendEnvelope(t)}};function AV(e){return e===`replay_event`?`replay`:e||`error`}function jV(e,t){let n=`${t} must return \`null\` or a valid event.`;if(qN(e))return e.then(e=>{if(!UN(e)&&e!==null)throw wV(n);return e},e=>{throw wV(`${t} rejected with ${e}`)});if(!UN(e)&&e!==null)throw wV(n);return e}function MV(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,ignoreSpans:o}=t,s=!jL(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(NV(c)&&i)return i(c,r);if(PV(c)){if(s||o){let t=uV(c);if(o?.length&&gL({description:t.description,op:t.op,attributes:t.data},o))return null;if(s){let e=s(t);e?c=ZP(n,dV(e)):uL()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(o?.length&&gL({description:e.description,op:e.op,attributes:e.data},o)){vL(n,e);continue}if(s){let n=s(e);n?t.push(n):(uL(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function NV(e){return e.type===void 0}function PV(e){return e.type===`transaction`}function FV(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+LV(e.attributes)}function IV(e){let t=0;return e.message&&(t+=e.message.length*2),t+LV(e.attributes)}function LV(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*RV(e[0]):HN(e)?t+=RV(e):t+=100}),t}function RV(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function zV(e,t){t.debug===!0&&(W?K.enable():rN(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),q().update(t.initialScope);let n=new e(t);return BV(n),n.init(),n}function BV(e){q().setClient(e)}var VV=`MULTIPLEXED_TRANSPORT_EXTRA_KEY`;function HV(e,t){return t.some(t=>e.includes(t))}function UV(e,t,n){if(t===!1)return{};let r=n==null?mV:[...mV,...n],i={};if(t===!0){for(let t of Object.keys(e))i[t]=HV(t.toLowerCase(),r)?fV:e[t];return i}if(`deny`in t){let n=t.deny.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let a=t.toLowerCase();i[t]=HV(a,r)||n.some(e=>a.includes(e))?fV:e[t]}return i}let a=t.allow.map(e=>e.toLowerCase());for(let t of Object.keys(e)){let n=t.toLowerCase();i[t]=HV(n,r)?fV:a.some(e=>n.includes(e))?e[t]:fV}return i}function WV(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf(`=`,n);if(r===-1)break;let i=e.indexOf(`;`,n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(`;`,r-1)+1;continue}let a=e.slice(n,r).trim();if(t[a]===void 0){let n=e.slice(r+1,i).trim();n.charCodeAt(0)===34&&(n=n.slice(1,-1));try{t[a]=n.indexOf(`%`)===-1?n:decodeURIComponent(n)}catch{t[a]=n}}n=i+1}return t}function GV(e,t){if(t===!1)return{};try{let n=WV(e);return Object.keys(n).length===0?{}:UV(n,t,hV)}catch{return fV}}var KV=`thismessage:/`;function qV(e){return`isRelative`in e}function JV(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?KV:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function YV(e){if(qV(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function XV(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function ZV(e){return e.split(/[?#]/,1)[0]}function QV(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function $V(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return tH(e,n)||eH(e,r)}function eH(e,t){return t?rH(e)===rH(t):!1}function tH(e,t){let n=JV(e);return!n||qV(n)||!t?!1:nH(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function nH(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function rH(e){return e[e.length-1]===`/`?e.slice(0,-1):e}function iH(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join(`\0`).replace(/%/g,`%%`).replace(/\0/g,`%s`),n.__sentry_template_values__=t,n}var aH=iH;function oH(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function sH(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:XM})),i.version=XM)}function cH(e={}){let t=e.client||J();if(!$z()||!t)return{};let n=yF(ZM());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||q(),i=e.span||lL(),a=SL(i)&&!mL(t.getOptions());if(!i&&OF())return{};let o=i&&!a?BI(i):lH(r),s=hI(i?OL(i):DL(t,r));if(!AI.test(o))return K.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let c={"sentry-trace":o,baggage:s};return e.propagateTraceparent&&(c.traceparent=i&&!a?VI(i):uH(r)),c}function lH(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return NI(t,r,n)}function uH(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return PI(t,r,n)}var dH=100;function fH(e,t){let n=J(),r=kF();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=dH}=n.getOptions();if(a<=0)return;let o={timestamp:BP(),...e},s=i?rN(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var pH=`FunctionToString`,mH=new WeakMap,hH=vB((()=>({name:pH,setupOnce(){let e=Function.prototype.toString;try{Function.prototype.toString=new Proxy(e,{apply(e,t,n){let r=$N(t),i=t;try{mH.has(J())&&r&&(i=r)}catch{}return Reflect.apply(e,i,n)}})}catch{}},setup(e){mH.set(e,!0)}}))),gH=[/^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$/],_H=`EventFilters`,vH=vB((e={})=>{let t;return{name:_H,setup(n){t=bH(e,n.getOptions())},processEvent(n,r,i){return t||=bH(e,i.getOptions()),xH(n,t)?null:n}}}),yH=vB(((e={})=>({...vH(e),name:`InboundFilters`})));function bH(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:gH],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function xH(e,t){if(!e.type){if(SH(e,t.ignoreErrors))return W&&K.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
512
|
-
Event: ${NP(e)}`),!0;if(OH(e))return W&&K.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
513
|
-
Event: ${NP(e)}`),!0;if(wH(e,t.denyUrls))return W&&K.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
514
|
-
Event: ${NP(e)}.
|
|
515
|
-
Url: ${DH(e)}`),!0;if(!TH(e,t.allowUrls))return W&&K.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
516
|
-
Event: ${NP(e)}.
|
|
517
|
-
Url: ${DH(e)}`),!0}else if(e.type===`transaction`&&CH(e,t.ignoreTransactions))return W&&K.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
518
|
-
Event: ${NP(e)}`),!0;return!1}function SH(e,t){return t?.length?lV(e).some(e=>DP(e,t)):!1}function CH(e,t){if(!t?.length)return!1;let n=e.transaction;return n?DP(n,t):!1}function wH(e,t){if(!t?.length)return!1;let n=DH(e);return n?DP(n,t):!1}function TH(e,t){if(!t?.length)return!0;let n=DH(e);return!n||DP(n,t)}function EH(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function DH(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?EH(t):null}catch{return W&&K.error(`Cannot extract url for event ${NP(e)}`),null}}function OH(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function kH(e,t,n,r,i,a){if(!i.exception?.values||!a||!JN(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=AH(e,t,r,a.originalException,n,i.exception.values,o,0))}function AH(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(JN(r[i],Error)){MH(o,s,r);let a=e(t,r[i]),l=c.length;NH(a,i,l,s),c=AH(e,t,n,r[i],i,[a,...c],a,l)}return jH(r)&&r.errors.forEach((a,l)=>{if(JN(a,Error)){MH(o,s,r);let u=e(t,a),d=c.length;NH(u,`errors[${l}]`,d,s),c=AH(e,t,n,a,i,[u,...c],u,d)}}),c}function jH(e){return Array.isArray(e.errors)}function MH(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...jH(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function NH(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function PH(e){return FN(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function FH(e){return PH(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}var IH=new Map,LH=new Set;function RH(e){if(G._sentryModuleMetadata)for(let t of Object.keys(G._sentryModuleMetadata)){let n=G._sentryModuleMetadata[t];if(LH.has(t))continue;LH.add(t);let r=e(t);for(let e of r.reverse())if(e.filename){IH.set(e.filename,n);break}}}function zH(e,t){return RH(e),IH.get(t)}function BH(e,t){t.exception?.values?.forEach(t=>{t.stacktrace?.frames?.forEach(t=>{if(!t.filename||t.module_metadata)return;let n=zH(e,t.filename);n&&(t.module_metadata=n)})})}function VH(e){e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{delete e.module_metadata})})}var HH=vB(()=>({name:`ModuleMetadata`,setup(e){e.on(`beforeEnvelope`,e=>{PL(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(VH(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;BH(n,t)})}})),UH=new Set([]);function WH(e){let t=`console`,n=TN(t,e);return EN(t,KH),n}var GH=new Set;function KH(){`console`in G&&eN.forEach(function(e){GH.has(e)||!(e in G.console)||(GH.add(e),XN(G.console,e,function(t){return nN[e]=t,function(...t){let n=t[0],r=nN[e],i=UH.size&&typeof n==`string`&&DP(n,UH);i||DN(`console`,{args:t,level:e}),(!i||W&&K.isEnabled())&&r?.apply(G.console,t)}}))})}function qH(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var JH=`CaptureConsole`,YH=vB(((e={})=>{let t=e.levels||eN,n=e.handled??!0;return{name:JH,setup(e){`console`in G&&WH(({args:r,level:i})=>{J()!==e||!t.includes(i)||XH(r,i,n)})}}}));function XH(e,t,n){let r=qH(t),i=Error(),a={level:qH(t),extra:{arguments:e}};jF(o=>{if(o.addEventProcessor(e=>(e.logger=`console`,FP(e,{handled:n,type:`auto.core.capture_console`}),e)),t===`assert`){if(!e[0]){let t=`Assertion failed: ${TP(e.slice(1),` `)||`console.assert`}`;o.setExtra(`arguments`,e.slice(1)),o.captureMessage(t,r,{captureContext:a,syntheticException:i})}return}let s=e.find(e=>e instanceof Error);if(s){zz(s,a);return}let c=TP(e,` `);o.captureMessage(c,r,{captureContext:a,syntheticException:i})})}var ZH=`Dedupe`,QH=vB((()=>{let e;return{name:ZH,processEvent(t){if(t.type)return t;try{if($H(t,e))return W&&K.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function $H(e,t){return t?!!(eU(e,t)||tU(e,t)):!1}function eU(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!rU(e,t)||!nU(e,t))}function tU(e,t){let n=iU(t),r=iU(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!rU(e,t)||!nU(e,t))}function nU(e,t){let n=xN(e),r=xN(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function rU(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function iU(e){return e.exception?.values?.[0]}var aU=`ExtraErrorData`,oU=vB(((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:aU,processEvent(e,r,i){let{maxValueLength:a}=i.getOptions();return sU(e,r,t,n,a)}}}));function sU(e,t={},n,r,i){if(!t.originalException||!FN(t.originalException))return e;let a=t.originalException.name||t.originalException.constructor.name,o=cU(t.originalException,r,i);if(o){let t={...e.contexts},r=mP(o,n);return UN(r)&&(lP(r),t[a]=r),{...e,contexts:t}}return e}function cU(e,t,n){try{let r=[`name`,`message`,`stack`,`line`,`column`,`fileName`,`lineNumber`,`columnNumber`,`toJSON`],i={};for(let t of Object.keys(e)){if(r.indexOf(t)!==-1)continue;let a=e[t];i[t]=FN(a)||typeof a==`string`?n?CP(`${a}`,n):`${a}`:a}if(t&&e.cause!==void 0&&(i.cause=FN(e.cause)?{[e.cause.name||e.cause.constructor.name]:cU(e.cause,!1,n)}:e.cause),typeof e.toJSON==`function`){let t=e.toJSON();for(let e of Object.keys(t)){let n=t[e];i[e]=FN(n)?n.toString():n}}return i}catch(e){W&&K.error(`Unable to extract extra data from the Error object:`,e)}return null}function lU(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];r===`.`?e.splice(t,1):r===`..`?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;)e.unshift(`..`);return e}var uU=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function dU(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=uU.exec(t);return n?n.slice(1):[]}function fU(...e){let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:`/`;i&&(t=`${i}/${t}`,n=i.charAt(0)===`/`)}return t=lU(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`}function pU(e){let t=0;for(;t<e.length&&e[t]===``;t++);let n=e.length-1;for(;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}function mU(e,t){e=fU(e).slice(1),t=fU(t).slice(1);let n=pU(e.split(`/`)),r=pU(t.split(`/`)),i=Math.min(n.length,r.length),a=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){a=e;break}let o=[];for(let e=a;e<n.length;e++)o.push(`..`);return o=o.concat(r.slice(a)),o.join(`/`)}function hU(e,t){let n=dU(e)[2]||``;return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var gU=`RewriteFrames`,_U=vB((e={})=>{let t=e.root,n=e.prefix||`app:///`,r=`window`in G&&!!G.window,i=e.iteratee||vU({isBrowser:r,root:t,prefix:n});function a(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>({...e,...e.stacktrace&&{stacktrace:o(e.stacktrace)}}))}}}catch{return e}}function o(e){return{...e,frames:e?.frames?.map(e=>i(e))}}return{name:gU,processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=a(t)),t}}});function vU({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes(`\\`)&&!r.filename.includes(`/`),a=/^\//.test(r.filename);if(e){if(t){let e=r.filename;e.indexOf(t)===0&&(r.filename=e.replace(t,n))}}else if(i||a){let e=i?r.filename.replace(/^[a-zA-Z]:/,``).replace(/\\/g,`/`):r.filename;r.filename=`${n}${t?mU(t,e):hU(e)}`}return r}}var yU=[`reauthenticate`,`signInAnonymously`,`signInWithOAuth`,`signInWithIdToken`,`signInWithOtp`,`signInWithPassword`,`signInWithSSO`,`signOut`,`signUp`,`verifyOtp`],bU=[`createUser`,`deleteUser`,`listUsers`,`getUserById`,`updateUserById`,`inviteUserByEmail`],xU={eq:`eq`,neq:`neq`,gt:`gt`,gte:`gte`,lt:`lt`,lte:`lte`,like:`like`,"like(all)":`likeAllOf`,"like(any)":`likeAnyOf`,ilike:`ilike`,"ilike(all)":`ilikeAllOf`,"ilike(any)":`ilikeAnyOf`,is:`is`,in:`in`,cs:`contains`,cd:`containedBy`,sr:`rangeGt`,nxl:`rangeGte`,sl:`rangeLt`,nxr:`rangeLte`,adj:`rangeAdjacent`,ov:`overlaps`,fts:``,plfts:`plain`,phfts:`phrase`,wfts:`websearch`,not:`not`},SU=[`select`,`insert`,`upsert`,`update`,`delete`];function CU(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function wU(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function TU(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function EU(e,t){return TU(e,t)!==void 0}function DU(e,t={}){switch(e){case`GET`:return`select`;case`POST`:return t.Prefer?.includes(`resolution=`)?`upsert`:`insert`;case`PATCH`:return`update`;case`DELETE`:return`delete`;default:return`<unknown-op>`}}function OU(e,t){if(t===``||t===`*`)return`select(*)`;if(e===`select`)return`select(${t})`;if(e===`or`||e.endsWith(`.or`))return`${e}${t}`;let[n,...r]=t.split(`.`),i;return i=n?.startsWith(`fts`)?`textSearch`:n?.startsWith(`plfts`)?`textSearch[plain]`:n?.startsWith(`phfts`)?`textSearch[phrase]`:n?.startsWith(`wfts`)?`textSearch[websearch]`:n&&xU[n]||`filter`,`${i}(${e}, ${r.join(`.`)})`}function kU(e,t=!1){return new Proxy(e,{apply(n,r,i){return fR({name:`auth ${t?`(admin) `:``}${e.name}`,attributes:{[RF]:`auto.db.supabase`,[LF]:`db`,"db.system":`postgresql`,"db.operation":`auth.${t?`admin.`:``}${e.name}`}},e=>Reflect.apply(n,r,i).then(t=>(WN(t)&&`error`in t&&t.error?(e.setStatus({code:2}),zz(t.error,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}})):e.setStatus({code:1}),e.end(),t)).catch(t=>{throw e.setStatus({code:2}),e.end(),zz(t,{mechanism:{handled:!1,type:`auto.db.supabase.auth`}}),t}).then(...i))}})}function AU(e){let t=e.auth;if(!(!t||wU(e.auth))){for(let n of yU){let r=t[n];r&&typeof e.auth[n]==`function`&&(e.auth[n]=kU(r))}for(let n of bU){let r=t.admin[n];r&&typeof e.auth.admin[n]==`function`&&(e.auth.admin[n]=kU(r,!0))}CU(e.auth)}}function jU(e,t){wU(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(e,n,r){let i=Reflect.apply(e,n,r),a=i.constructor;return NU(a,t),i}}),CU(e.prototype.from))}function MU(e,t){wU(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,n,r){let i=SU,a=n,o=DU(a.method,a.headers);if(!i.includes(o)||!a?.url?.pathname||typeof a.url.pathname!=`string`)return Reflect.apply(e,n,r);let s=a.url.pathname.split(`/`),c=s.length>0?s[s.length-1]:``,l=[];for(let[e,t]of a.url.searchParams.entries())l.push(OU(e,t));let u=Object.create(null);if(UN(a.body))for(let[e,t]of Object.entries(a.body))u[e]=t;let d=J(),f=t.sendOperationData??d?.getDataCollectionOptions().databaseQueryData===!0,p=TU(a.body,u),m=o===`select`?``:`${o}${EU(a.body,u)?`(...) `:``}`,h=f?l.join(` `):l.length>0?`[redacted]`:``,g=[m.trimEnd(),h].filter(Boolean).join(` `),_=g?`${g} from(${c})`:`from(${c})`,v={"db.table":c,"db.schema":a.schema,"db.url":a.url.origin,"db.sdk":a.headers[`X-Client-Info`],"db.system":`postgresql`,"db.operation":o,[RF]:`auto.db.supabase`,[LF]:`db`};return l.length&&f&&(v[`db.query`]=l),p!==void 0&&f&&(v[`db.body`]=p),fR({name:_,attributes:v},t=>Reflect.apply(e,n,[]).then(e=>{if(t&&(e&&typeof e==`object`&&`status`in e&&nI(t,e.status||500),t.end()),e?.error){let t=Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);let n={};l.length&&f&&(n.query=l),p!==void 0&&f&&(n.body=p),zz(t,e=>(e.addEventProcessor(e=>(FP(e,{handled:!1,type:`auto.db.supabase.postgres`}),e)),e.setContext(`supabase`,n),e))}let n={type:`supabase`,category:`db.${o}`,message:_},r={};return l.length&&f&&(r.query=l),p!==void 0&&f&&(r.body=p),Object.keys(r).length&&(n.data=r),fH(n),e},e=>{throw t&&(nI(t,500),t.end()),e}).then(...r))}}),CU(e.prototype.then))}function NU(e,t){for(let n of SU)wU(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(e,r,i){let a=Reflect.apply(e,r,i),o=a.constructor;return W&&K.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),MU(o,t),a}}),CU(e.prototype[n]))}var PU=(e,t={})=>{if(!e){W&&K.warn(`Supabase integration was not installed because no Supabase client was provided.`);return}jU(e.constructor===Function?e:e.constructor,t),AU(e)},FU=`Supabase`,IU=((e,t)=>({setupOnce(){PU(e,t)},name:FU})),LU=vB(e=>IU(e.supabaseClient,{sendOperationData:e.sendOperationData})),RU=10,zU=`ZodErrors`;function BU(e){return FN(e)&&e.name===`ZodError`&&Array.isArray(e.issues)}function VU(e){return{...e,path:`path`in e&&Array.isArray(e.path)?e.path.join(`.`):void 0,keys:`keys`in e?JSON.stringify(e.keys):void 0,unionErrors:`unionErrors`in e?JSON.stringify(e.unionErrors):void 0}}function HU(e){return e.map(e=>typeof e==`number`?`<array>`:e).join(`.`)}function UU(e){let t=new Set;for(let n of e.issues){let e=HU(n.path);e.length>0&&t.add(e)}let n=Array.from(t);if(n.length===0){let t=`variable`;if(e.issues.length>0){let n=e.issues[0];n!==void 0&&`expected`in n&&typeof n.expected==`string`&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${CP(n.join(`, `),100)}`}function WU(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!BU(r.originalException)||r.originalException.issues.length===0)return n;try{let i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(VU);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:`zod_issues.json`,data:JSON.stringify({issues:i})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:UU(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,e)}}}catch(e){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:`an exception was thrown while processing ZodError within applyZodErrorsToEvent()`,error:e instanceof Error?`${e.name}: ${e.message}
|
|
519
|
-
${e.stack}`:`unknown`}}}}}var GU=vB(((e={})=>{let t=e.limit??RU;return{name:zU,processEvent(n,r){return WU(t,e.saveZodIssuesAsAttachment,n,r)}}})),KU=vB(e=>({name:`ThirdPartyErrorsFilter`,setup(e){e.on(`beforeEnvelope`,e=>{PL(e,(e,t)=>{if(t===`event`){let t=Array.isArray(e)?e[1]:void 0;t&&(VH(t),e[1]=t)}})}),e.on(`applyFrameMetadata`,t=>{if(t.type)return;let n=e.getOptions().stackParser;BH(n,t)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(G._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata={...t.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(t){let n=e.ignoreSentryInternalFrames?t.sdkProcessingMetadata?.insideSentryWrapped===!0&&t.exception?.values?.length===1:!1,r=JU(t,e.ignoreSentryInternalFrames,n);if(r&&r[e.behaviour===`drop-error-if-contains-third-party-frames`||e.behaviour===`apply-tag-if-contains-third-party-frames`?`some`:`every`](t=>!t.some(t=>e.filterKeys.includes(t)))){if(e.behaviour===`drop-error-if-contains-third-party-frames`||e.behaviour===`drop-error-if-exclusively-contains-third-party-frames`)return null;t.tags={...t.tags,third_party_code:!0}}return t}}));function qU(e,t,n){if(t!==0)return!1;if(n&&YU(e)||e.function===`sentryWrapped`)return!0;if(!e.context_line||!e.filename||!e.filename.includes(`sentry`)||!e.filename.includes(`helpers`)||!e.context_line.includes(QU))return!1;if(e.pre_context){let t=e.pre_context.length;for(let n=0;n<t;n++)if(e.pre_context[n]?.includes(ZU))return!0}return!1}function JU(e,t,n){let r=xN(e);if(r)return r.filter((e,r)=>!e.filename||e.lineno==null&&e.colno==null&&e.instruction_addr==null?!1:!t||!qU(e,r,!!n)).map(e=>e.module_metadata?Object.keys(e.module_metadata).filter(e=>e.startsWith(XU)).map(e=>e.slice(XU.length)):[])}function YU(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}var XU=`_sentryBundlerPluginAppKey:`,ZU=`Attempt to invoke user-land function`,QU=`fn.apply(this, wrappedArguments)`,$U=`flag.evaluation.`;function eW(e){if(e.type)return e;let t=q().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e}function tW(e,t,n=100){let r=q().getScopeData().contexts;r.flags||={values:[]};let i=r.flags.values;nW(i,e,t,n)}function nW(e,t,n,r){if(typeof n!=`boolean`)return;if(e.length>r){W&&K.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let i=e.findIndex(e=>e.flag===t);i!==-1&&e.splice(i,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function rW(e,t,n=10){if(typeof t!=`boolean`)return;let r=lL();if(!r)return;let i=KI(r).data;if(`${$U}${e}`in i){r.setAttribute(`${$U}${e}`,t);return}Object.keys(i).filter(e=>e.startsWith($U)).length<n&&r.setAttribute(`${$U}${e}`,t)}var iW=vB(()=>({name:`FeatureFlags`,processEvent(e,t,n){return eW(e)},addFeatureFlag(e,t){tW(e,t),rW(e,t)}})),aW=vB(({growthbookClass:e})=>({name:`GrowthBook`,setupOnce(){let t=e.prototype;typeof t.isOn==`function`&&XN(t,`isOn`,oW),typeof t.getFeatureValue==`function`&&XN(t,`getFeatureValue`,oW)},processEvent(e,t,n){return eW(e)}}));function oW(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`&&(tW(n,r),rW(n,r)),r}}var sW=`ConversationId`,cW=vB((()=>({name:sW,setup(e){e.on(`spanStart`,e=>{let t=q().getScopeData(),n=kF().getScopeData(),r=t.conversationId||n.conversationId;if(r){let{op:t,data:n,description:i}=KI(e);if(!t?.startsWith(`gen_ai.`)&&!n[`ai.operationId`]&&!i?.startsWith(`ai.`))return;e.setAttribute(eI,r)}})}})));function lW(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=mL()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(fW(n,e),uW(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=J(),d=!!lL(),f=d||!!u&&tR(u),p=s&&f?mR(gW(o,a,c)):new xL,m=AR(p)&&d?void 0:p;if(s&&!f&&u?.recordDroppedEvent(`no_parent_span`,`span`),e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=dW(t,n,mL()&&f?m:void 0,l);r&&(e.args[1]=n,n.headers=r)}if(u){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};u.emit(`beforeOutgoingRequestSpan`,p,t)}return p}function uW(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function dW(e,t,n,r){let i=cH({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(YN(e)?e.headers:void 0);if(!c)return{...i};if(mW(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?pW(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}if(hW(c)){let e=[...c];e.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!e.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&typeof e[1]==`string`&&pW(e[1]));return o&&!t&&e.push([`baggage`,o]),e}{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>pW(e)):pW(n));o&&!l&&i.push(o);let u=Object.assign({},c,{"sentry-trace":e??a,baggage:i.length>0?i.join(`,`):void 0});return r&&s&&!t&&(u.traceparent=s),u}}function fW(e,t){if(t.response){nI(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function pW(e){return typeof e==`string`&&e.split(`,`).some(e=>e.trim().startsWith(pI))}function mW(e){return typeof Headers<`u`&&JN(e,Headers)}function hW(e){return Array.isArray(e)?e.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`string`):!1}function gW(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${QV(e)}`,attributes:_W(e,void 0,t,n)};let r=JV(e);return{name:`${t} ${r?YV(r):e}`,attributes:_W(e,r,t,n)}}function _W(e,t,n,r){let i={url:QV(e),type:`fetch`,"http.method":n,[RF]:r,[LF]:`http.client`};return t&&(qV(t)||(i[`http.url`]=QV(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}function vW(e,t={},n=q()){let{message:r,name:i,email:a,url:o,source:s,associatedEventId:c,tags:l}=e,u={contexts:{feedback:{contact_email:a,name:i,message:r,url:o,source:s,associated_event_id:c}},type:`feedback`,level:`info`,tags:l},d=n?.getClient()||J();return d&&d.emit(`beforeSendFeedback`,u,t),n.captureEvent(u,t)}function yW(e,t,n){return`util`in G&&typeof G.util.format==`function`?G.util.format(...e):bW(e,t,n)}function bW(e,t,n){return e.map(e=>HN(e)?String(e):JSON.stringify(mP(e,t,n))).join(` `)}function xW(e){return/%[sdifocO]/.test(e)}function SW(e,t){let n={};return n[`sentry.message.template`]=`${e} ${Array(t.length).fill(`{}`).join(` `)}`,t.forEach((e,t)=>{n[`sentry.message.parameter.${t}`]=e}),n}var CW=`ConsoleLogs`,wW={[RF]:`auto.log.console`},TW=vB(((e={})=>{let t=e.levels||eN;return{name:CW,setup(e){let{enableLogs:n,normalizeDepth:r=3,normalizeMaxBreadth:i=1e3}=e.getOptions();if(!n){W&&K.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let a=WH(({args:n,level:a})=>{if(J()!==e||!t.includes(a))return;let o=n[0],s=n.slice(1);if(a===`assert`){o||FB({level:`error`,message:s.length>0?`Assertion failed: ${yW(s,r,i)}`:`Assertion failed`,attributes:wW});return}let c=a===`log`,l={...wW};if(UN(o)){Object.assign(l,mP(o,r,i));let e=typeof n[1]==`string`?2:1;n.slice(e).forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=mP(e,r,i)})}else if(s.length>0&&typeof o==`string`&&!xW(o)){let e=SW(o,s);for(let[t,n]of Object.entries(e))l[t]=t.startsWith(`sentry.message.parameter.`)?mP(n,r,i):n}FB({level:c?`info`:a,message:yW(n,r,i),severityNumber:c?10:void 0,attributes:l})});e.registerCleanup(a)}}}));function EW(e,t,n,r){JB({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function DW(e,t,n){EW(`distribution`,e,t,n)}var OW=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`];function kW(e={}){let t=new Set(e.levels??OW),n=e.client;return{log(e){let{type:r,level:i,message:a,args:o,tag:s,date:c,...l}=e,u=n||J();if(!u)return;let d=MW(r,i);if(!t.has(d))return;let{normalizeDepth:f=3,normalizeMaxBreadth:p=1e3}=u.getOptions(),m={};for(let[e,t]of Object.entries(l))m[e]=mP(t,f,p);m[`sentry.origin`]=`auto.log.consola`,s&&(m[`consola.tag`]=s),r&&(m[`consola.type`]=r),i!=null&&typeof i==`number`&&(m[`consola.level`]=i);let h=PW(NW(o,f,p),f,p);h?.attributes&&Object.assign(m,h.attributes),FB({level:d,message:h?.message||a||o&&yW(o,f,p)||``,attributes:m})}}}var AW={silent:`trace`,fatal:`fatal`,error:`error`,warn:`warn`,log:`info`,info:`info`,success:`info`,fail:`error`,ready:`info`,start:`info`,box:`info`,debug:`debug`,trace:`trace`,verbose:`debug`,critical:`fatal`,notice:`info`},jW={0:`fatal`,1:`warn`,2:`info`,3:`info`,4:`debug`,5:`trace`};function MW(e,t){if(e===`verbose`)return`debug`;if(e===`silent`)return`trace`;if(e){let t=AW[e];if(t)return t}if(typeof t==`number`){let e=jW[t];if(e)return e}return`info`}function NW(e,t,n){if(!e?.length)return{message:``};let r=yW(e,t,n),i=e[0];if(UN(i)){let t=typeof e[1]==`string`?2:1;return{message:r,attributes:i,messageParameters:e.slice(t)}}{let t=e.slice(1),n=t.length>0&&typeof i==`string`&&!xW(i);return{message:r,messageTemplate:n?i:void 0,messageParameters:n?t:void 0}}}function PW(e,t,n){let{message:r,attributes:i,messageTemplate:a,messageParameters:o}=e,s={};if(a&&o){let e=SW(a,o);for(let[r,i]of Object.entries(e))s[r]=r.startsWith(`sentry.message.parameter.`)?mP(i,t,n):i}else o&&o.length>0&&o.forEach((e,r)=>{s[`sentry.message.parameter.${r}`]=mP(e,t,n)});return{message:r,attributes:{...mP(i,t,n),...s}}}var FW=`gen_ai.prompt`,IW=`gen_ai.system`,LW=`gen_ai.request.model`,RW=`gen_ai.request.stream`,zW=`gen_ai.request.temperature`,BW=`gen_ai.request.max_tokens`,VW=`gen_ai.request.frequency_penalty`,HW=`gen_ai.request.presence_penalty`,UW=`gen_ai.request.top_p`,WW=`gen_ai.request.top_k`,GW=`gen_ai.request.encoding_format`,KW=`gen_ai.request.dimensions`,qW=`gen_ai.response.finish_reasons`,JW=`gen_ai.response.model`,YW=`gen_ai.response.id`,XW=`gen_ai.response.stop_reason`,ZW=`gen_ai.usage.input_tokens`,QW=`gen_ai.usage.output_tokens`,$W=`gen_ai.usage.total_tokens`,eG=`gen_ai.operation.name`,tG=`sentry.sdk_meta.gen_ai.input.messages.original_length`,nG=`gen_ai.input.messages`,rG=`gen_ai.system_instructions`,iG=`gen_ai.response.text`,aG=`gen_ai.request.available_tools`,oG=`gen_ai.response.streaming`,sG=`gen_ai.response.tool_calls`,cG=`gen_ai.agent.name`,lG=`gen_ai.pipeline.name`,uG=`gen_ai.conversation.id`,dG=`gen_ai.usage.cache_creation_input_tokens`,fG=`gen_ai.usage.cache_read_input_tokens`,pG=`gen_ai.invoke_agent`,mG=`gen_ai.embeddings.input`,hG=`gen_ai.embeddings`,gG=`gen_ai.execute_tool`,_G=`gen_ai.tool.name`,vG=`gen_ai.tool.call.id`,yG=`gen_ai.tool.type`,bG=`gen_ai.tool.input`,xG=`gen_ai.tool.output`,SG=`gen_ai.tool.description`;function CG(e){return!e||typeof e!=`object`?!1:EG(e)||DG(e)||wG(e)||OG(e)||kG(e)||AG(e)||jG(e)||MG(e)||NG(e)||PG(e)||FG(e)||IG(e)}function wG(e){return`image_url`in e?typeof e.image_url==`string`?e.image_url.startsWith(`data:`):TG(e):!1}function TG(e){return`image_url`in e&&!!e.image_url&&typeof e.image_url==`object`&&`url`in e.image_url&&typeof e.image_url.url==`string`&&e.image_url.url.startsWith(`data:`)}function EG(e){return`type`in e&&typeof e.type==`string`&&`source`in e&&CG(e.source)}function DG(e){return`inlineData`in e&&!!e.inlineData&&typeof e.inlineData==`object`&&`data`in e.inlineData&&typeof e.inlineData.data==`string`}function OG(e){return`type`in e&&e.type===`input_audio`&&`input_audio`in e&&!!e.input_audio&&typeof e.input_audio==`object`&&`data`in e.input_audio&&typeof e.input_audio.data==`string`}function kG(e){return`type`in e&&e.type===`file`&&`file`in e&&!!e.file&&typeof e.file==`object`&&`file_data`in e.file&&typeof e.file.file_data==`string`}function AG(e){return`media_type`in e&&typeof e.media_type==`string`&&`data`in e}function jG(e){return`type`in e&&e.type===`file`&&`mediaType`in e&&typeof e.mediaType==`string`&&`data`in e&&typeof e.data==`string`&&!e.data.startsWith(`http://`)&&!e.data.startsWith(`https://`)}function MG(e){return`type`in e&&e.type===`image`&&`image`in e&&typeof e.image==`string`&&!e.image.startsWith(`http://`)&&!e.image.startsWith(`https://`)}function NG(e){return`type`in e&&(e.type===`blob`||e.type===`base64`)}function PG(e){return`b64_json`in e}function FG(e){return`type`in e&&`result`in e&&e.type===`image_generation`}function IG(e){return`uri`in e&&typeof e.uri==`string`&&e.uri.startsWith(`data:`)}var LG=`[Blob substitute]`,RG=[`image_url`,`data`,`content`,`b64_json`,`result`,`uri`,`image`];function zG(e){let t={...e};CG(t.source)&&(t.source=zG(t.source)),DG(e)&&(t.inlineData={...e.inlineData,data:LG}),TG(e)&&(t.image_url={...e.image_url,url:LG}),OG(e)&&(t.input_audio={...e.input_audio,data:LG}),kG(e)&&(t.file={...e.file,file_data:LG});for(let e of RG)typeof t[e]==`string`&&(t[e]=LG);return t}var BG=2e4,VG=e=>new TextEncoder().encode(e).length,HG=e=>VG(JSON.stringify(e));function UG(e,t){if(VG(e)<=t)return e;let n=0,r=e.length,i=``;for(;n<=r;){let a=Math.floor((n+r)/2),o=e.slice(0,a);VG(o)<=t?(i=o,n=a+1):r=a-1}return i}function WG(e){return typeof e==`string`?e:`text`in e&&typeof e.text==`string`?e.text:``}function GG(e,t){return typeof e==`string`?t:{...e,text:t}}function KG(e){return typeof e==`object`&&!!e&&`content`in e&&typeof e.content==`string`}function qG(e){return typeof e==`object`&&!!e&&`content`in e&&Array.isArray(e.content)}function JG(e){return typeof e==`object`&&!!e&&`parts`in e&&Array.isArray(e.parts)&&e.parts.length>0}function YG(e,t){let n=t-HG({...e,content:``});if(n<=0)return[];let r=UG(e.content,n);return[{...e,content:r}]}function XG(e){return`parts`in e&&Array.isArray(e.parts)?{key:`parts`,items:e.parts}:`content`in e&&Array.isArray(e.content)?{key:`content`,items:e.content}:{key:null,items:[]}}function ZG(e,t){let{key:n,items:r}=XG(e);if(n===null||r.length===0)return[];let i=r.map(e=>GG(e,``)),a=t-HG({...e,[n]:i});if(a<=0)return[];let o=[];for(let e of r){let t=WG(e),n=VG(t);if(n<=a)o.push(e),a-=n;else if(o.length===0){let n=UG(t,a);n&&o.push(GG(e,n));break}else break}return o.length<=0?[]:[{...e,[n]:o}]}function QG(e,t){if(!e)return[];if(typeof e==`string`){let n=UG(e,t);return n?[n]:[]}return typeof e==`object`?KG(e)?YG(e,t):qG(e)||JG(e)?ZG(e,t):[]:[]}function $G(e){return e.map(e=>{let t;return e&&typeof e==`object`&&(qG(e)?t={...e,content:$G(e.content)}:`content`in e&&CG(e.content)&&(t={...e,content:zG(e.content)}),JG(e)&&(t={...t??e,parts:$G(e.parts)}),CG(t)?t=zG(t):CG(e)&&(t=zG(e))),t??e})}function eK(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],i=$G([r]),a=i[0];return HG(a)<=n?i:QG(a,n)}function tK(e){return eK(e,BG)}function nK(e){return UG(e,BG)}function rK(e){let t=J()?.getDataCollectionOptions().genAI;return{...e,recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1}}function iK(e){if(e!==void 0)return e;let t=J();return!t||!tR(t)&&t.getOptions().streamGenAiSpans===!1}function aK(e,t){return e?`${e}.${t}`:t}function oK(e,t,n,r,i){if(t!==void 0&&e.setAttributes({[ZW]:t}),n!==void 0&&e.setAttributes({[QW]:n}),t!==void 0||n!==void 0||r!==void 0||i!==void 0){let a=(t??0)+(n??0)+(r??0)+(i??0);e.setAttributes({[$W]:a})}}function sK(e,t,n){if(!e.isRecording())return;let r={[oG]:!0};t.responseId&&(r[YW]=t.responseId),t.responseModel&&(r[JW]=t.responseModel),t.promptTokens!==void 0&&(r[ZW]=t.promptTokens),t.completionTokens!==void 0&&(r[QW]=t.completionTokens),t.totalTokens===void 0?(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[$W]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)):r[$W]=t.totalTokens,t.finishReasons.length&&(r[qW]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[iG]=t.responseTexts.join(``)),n&&t.toolCalls.length&&(r[sG]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function cK(e){if(typeof e==`string`)return nK(e);try{return JSON.stringify(Array.isArray(e)?tK(e):e)}catch{return`[unserializable]`}}function lK(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(e=>e&&typeof e==`object`&&`role`in e&&e.role===`system`);if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content==`string`?n.content:n.content===void 0?void 0:JSON.stringify(n.content);return r?{systemInstructions:JSON.stringify([{type:`text`,content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}}async function uK(e,t,n){let r=e.catch(e=>{throw zz(e,{mechanism:{handled:!1,type:n}}),e}),i=await t,a=await r;return a&&typeof a==`object`&&`data`in a?{...a,data:i}:i}function dK(e,t,n){return qN(e)?new Proxy(e,{get(e,r){let i=r in Promise.prototype||r===Symbol.toStringTag?t:e,a=Reflect.get(i,r);return r===`withResponse`&&typeof a==`function`?function(){return uK(a.call(e),t,n)}:typeof a==`function`?a.bind(i):a}}):t}var fK={"responses.create":{operation:`chat`},"chat.completions.create":{operation:`chat`},"embeddings.create":{operation:`embeddings`},"conversations.create":{operation:`chat`}},pK=[`response.created`,`response.in_progress`,`response.failed`,`response.completed`,`response.incomplete`,`response.queued`,`response.output_text.delta`,`response.output_item.added`,`response.function_call_arguments.delta`,`response.function_call_arguments.done`,`response.output_item.done`];function mK(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`response.`)}function hK(e){return typeof e==`object`&&!!e&&`object`in e&&e.object===`chat.completion.chunk`}function gK(e,t,n){if(!t||typeof t!=`object`)return;let r=t,i={};if(typeof r.id==`string`&&(i[YW]=r.id),typeof r.model==`string`&&(i[JW]=r.model),r.object===`conversation`&&typeof r.id==`string`&&(i[uG]=r.id),r.usage&&typeof r.usage==`object`){let e=r.usage,t=e.prompt_tokens??e.input_tokens;typeof t==`number`&&(i[ZW]=t);let n=e.completion_tokens??e.output_tokens;typeof n==`number`&&(i[QW]=n),typeof e.total_tokens==`number`&&(i[$W]=e.total_tokens)}if(Array.isArray(r.choices)){let e=r.choices,t=e.map(e=>e.finish_reason).filter(e=>typeof e==`string`);if(t.length>0&&(i[qW]=JSON.stringify(t)),n){let t=e.map(e=>e.message?.content||``);i[iG]=JSON.stringify(t);let n=e.map(e=>e.message?.tool_calls).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&(i[sG]=JSON.stringify(n))}}if(typeof r.status==`string`&&(i[`gen_ai.response.finish_reasons`]||(i[qW]=JSON.stringify([r.status]))),n&&(typeof r.output_text==`string`&&!i[`gen_ai.response.text`]&&(i[iG]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!i[`gen_ai.response.tool_calls`])){let e=r.output.filter(e=>e?.type===`function_call`);e.length>0&&(i[sG]=JSON.stringify(e))}e.setAttributes(i)}function _K(e){if(`conversation`in e&&typeof e.conversation==`string`)return e.conversation;if(`previous_response_id`in e&&typeof e.previous_response_id==`string`)return e.previous_response_id}function vK(e){let t={[LW]:e.model??`unknown`};`temperature`in e&&(t[zW]=e.temperature),`top_p`in e&&(t[UW]=e.top_p),`frequency_penalty`in e&&(t[VW]=e.frequency_penalty),`presence_penalty`in e&&(t[HW]=e.presence_penalty),`stream`in e&&(t[RW]=e.stream),`encoding_format`in e&&(t[GW]=e.encoding_format),`dimensions`in e&&(t[KW]=e.dimensions);let n=_K(e);return n&&(t[uG]=n),t}function yK(e,t){for(let n of e){let e=n.index;if(!(e===void 0||!n.function))if(!(e in t.chatCompletionToolCalls))t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||``}};else{let r=t.chatCompletionToolCalls[e];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}}}function bK(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&yK(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function xK(e,t,n,r){if(!(e&&typeof e==`object`)){t.eventTypes.push(`unknown:non-object`);return}if(e instanceof Error){r.setStatus({code:2,message:`internal_error`}),zz(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream-response`}});return}if(!(`type`in e))return;let i=e;if(!pK.includes(i.type)){t.eventTypes.push(i.type);return}if(n&&(i.type===`response.output_item.done`&&`item`in i&&t.responsesApiToolCalls.push(i.item),i.type===`response.output_text.delta`&&`delta`in i&&i.delta)){t.responseTexts.push(i.delta);return}if(`response`in i){let{response:e}=i;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}async function*SK(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let i of e)hK(i)?bK(i,r,n):mK(i)&&xK(i,r,n,t),yield i}finally{let e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];sK(t,{...r,toolCalls:e},n)}}function CK(e){let t=Array.isArray(e.tools)?e.tools:[],n=e.web_search_options&&typeof e.web_search_options==`object`?[{type:`web_search_options`,...e.web_search_options}]:[],r=[...t,...n];if(r.length!==0)try{return JSON.stringify(r)}catch(e){W&&K.error(`Failed to serialize OpenAI tools:`,e);return}}function wK(e,t){let n={[IW]:`openai`,[eG]:t,[RF]:`auto.ai.openai`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0],r=CK(t);r&&(n[aG]=r),Object.assign(n,vK(t))}else n[LW]=`unknown`;return n}function TK(e,t,n,r){if(n===`embeddings`&&`input`in t){let n=t.input;if(n==null||typeof n==`string`&&n.length===0||Array.isArray(n)&&n.length===0)return;e.setAttribute(mG,typeof n==`string`?n:JSON.stringify(n));return}let i=`input`in t?t.input:`messages`in t?t.messages:void 0;if(!i||Array.isArray(i)&&i.length===0)return;let{systemInstructions:a,filteredMessages:o}=lK(i);a&&e.setAttribute(rG,a),e.setAttribute(nG,r?cK(o):SP(o)),Array.isArray(o)?e.setAttribute(tG,o.length):e.setAttribute(tG,1)}function EK(e,t,n,r,i){return function(...a){let o=n.operation||`unknown`,s=wK(a,o),c=s[`gen_ai.request.model`]||`unknown`,l=a[0],u=l&&typeof l==`object`&&l.stream===!0,d={name:`${o} ${c}`,op:`gen_ai.${o}`,attributes:s};if(u){let n,s=pR(d,s=>(n=e.apply(r,a),i.recordInputs&&l&&TK(s,l,o,iK(i.enableTruncation)),(async()=>{try{return SK(await n,s,i.recordOutputs??!1)}catch(e){throw s.setStatus({code:2,message:`internal_error`}),zz(e,{mechanism:{handled:!1,type:`auto.ai.openai.stream`,data:{function:t}}}),s.end(),e}})()));return dK(n,s,`auto.ai.openai`)}let f,p=fR(d,n=>(f=e.apply(r,a),i.recordInputs&&l&&TK(n,l,o,iK(i.enableTruncation)),f.then(e=>(gK(n,e,i.recordOutputs),e),e=>{throw zz(e,{mechanism:{handled:!1,type:`auto.ai.openai`,data:{function:t}}}),e})));return dK(f,p,`auto.ai.openai`)}}function DK(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=aK(t,String(r)),o=fK[a];return typeof i==`function`&&o?EK(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?DK(i,a,n):i}})}function OK(e,t){return DK(e,``,rK(t))}var kK={"messages.create":{operation:`chat`},"messages.stream":{operation:`chat`,streaming:!0},"messages.countTokens":{operation:`chat`},"models.get":{operation:`models`},"completions.create":{operation:`chat`},"models.retrieve":{operation:`models`},"beta.messages.create":{operation:`chat`}};function AK(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:i}=lK(t);r&&e.setAttributes({[rG]:r});let a=Array.isArray(i)?i.length:1;e.setAttributes({[nG]:n?cK(i):SP(i),[tG]:a})}var jK={invalid_request_error:`invalid_argument`,authentication_error:`unauthenticated`,permission_error:`permission_denied`,not_found_error:`not_found`,request_too_large:`failed_precondition`,rate_limit_error:`resource_exhausted`,api_error:`internal_error`,overloaded_error:`unavailable`};function MK(e){return e&&jK[e]||`internal_error`}function NK(e,t){t.error&&(e.setStatus({code:2,message:MK(t.error.type)}),zz(t.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}))}function PK(e){let{system:t,messages:n,input:r}=e,i=typeof t==`string`?[{role:`system`,content:e.system}]:[],a=(Array.isArray(r)?r:r==null?void 0:[r])??(Array.isArray(n)?n:n==null?[]:[n]);return[...i,...a]}function FK(e,t){return`type`in e&&typeof e.type==`string`&&e.type===`error`&&(t.setStatus({code:2,message:MK(e.error?.type)}),zz(e.error,{mechanism:{handled:!1,type:`auto.ai.anthropic.anthropic_error`}}),!0)}function IK(e,t){if(e.type===`message_delta`&&(e.usage&&typeof e.usage.output_tokens==`number`&&(t.completionTokens=e.usage.output_tokens),e.delta?.stop_reason&&t.finishReasons.push(e.delta.stop_reason)),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.usage&&(typeof n.usage.input_tokens==`number`&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens==`number`&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens==`number`&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function LK(e,t){e.type!==`content_block_start`||typeof e.index!=`number`||!e.content_block||(e.content_block.type===`tool_use`||e.content_block.type===`server_tool_use`)&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function RK(e,t,n){if(!(e.type!==`content_block_delta`||!e.delta)){if(typeof e.index==`number`&&`partial_json`in e.delta&&typeof e.delta.partial_json==`string`){let n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text==`string`&&t.responseTexts.push(e.delta.text)}}function zK(e,t){if(e.type!==`content_block_stop`||typeof e.index!=`number`)return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(``),i;try{i=r?JSON.parse(r):{}}catch{i={__unparsed:r}}t.toolCalls.push({type:`tool_use`,id:n.id,name:n.name,input:i}),delete t.activeToolBlocks[e.index]}function BK(e,t,n,r){e&&typeof e==`object`&&(FK(e,r)||(IK(e,t),LK(e,t),RK(e,t,n),zK(e,t)))}async function*VK(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let i of e)BK(i,r,n,t),yield i}finally{sK(t,r,n)}}function HK(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:``,responseModel:``,promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on(`streamEvent`,e=>{BK(e,r,n,t)}),e.on(`message`,()=>{sK(t,r,n)}),e.on(`error`,e=>{zz(e,{mechanism:{handled:!1,type:`auto.ai.anthropic.stream_error`}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end())}),e}function UK(e,t,n){let r={[IW]:`anthropic`,[eG]:n,[RF]:`auto.ai.anthropic`};if(e.length>0&&typeof e[0]==`object`&&e[0]!==null){let t=e[0];t.tools&&Array.isArray(t.tools)&&(r[aG]=JSON.stringify(t.tools)),r[LW]=t.model??`unknown`,`temperature`in t&&(r[zW]=t.temperature),`top_p`in t&&(r[UW]=t.top_p),`stream`in t&&(r[RW]=t.stream),`top_k`in t&&(r[WW]=t.top_k),`frequency_penalty`in t&&(r[VW]=t.frequency_penalty),`max_tokens`in t&&(r[BW]=t.max_tokens)}else r[LW]=t===`models.retrieve`||t===`models.get`?e[0]:`unknown`;return r}function WK(e,t,n){AK(e,PK(t),n),`prompt`in t&&e.setAttributes({[FW]:JSON.stringify(t.prompt)})}function GK(e,t){if(`content`in t&&Array.isArray(t.content)){e.setAttributes({[iG]:t.content.map(e=>e.text).filter(e=>!!e).join(``)});let n=[];for(let e of t.content)(e.type===`tool_use`||e.type===`server_tool_use`)&&n.push(e);n.length>0&&e.setAttributes({[sG]:JSON.stringify(n)})}`completion`in t&&e.setAttributes({[iG]:t.completion}),`input_tokens`in t&&e.setAttributes({[iG]:JSON.stringify(t.input_tokens)})}function KK(e,t){`id`in t&&`model`in t&&(e.setAttributes({[YW]:t.id,[JW]:t.model}),`usage`in t&&t.usage&&oK(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function qK(e,t,n){if(!(!t||typeof t!=`object`)){if(`type`in t&&t.type===`error`){NK(e,t);return}n&&GK(e,t),KK(e,t)}}function JK(e,t,n){throw zz(e,{mechanism:{handled:!1,type:`auto.ai.anthropic`,data:{function:n}}}),t.isRecording()&&(t.setStatus({code:2,message:`internal_error`}),t.end()),e}function YK(e,t,n,r,i,a,o,s,c,l,u){let d={name:`${a} ${i[`gen_ai.request.model`]??`unknown`}`,op:`gen_ai.${a}`,attributes:i};if(l&&!u){let t,i=pR(d,i=>(t=e.apply(n,r),c.recordInputs&&s&&WK(i,s,iK(c.enableTruncation)),(async()=>{try{return VK(await t,i,c.recordOutputs??!1)}catch(e){return JK(e,i,o)}})()));return dK(t,i,`auto.ai.anthropic`)}return pR(d,e=>{try{return c.recordInputs&&s&&WK(e,s,iK(c.enableTruncation)),HK(t.apply(n,r),e,c.recordOutputs??!1)}catch(t){return JK(t,e,o)}})}function XK(e,t,n,r,i){return new Proxy(e,{apply(a,o,s){let c=n.operation||`unknown`,l=UK(s,t,c),u=l[`gen_ai.request.model`]??`unknown`,d=typeof s[0]==`object`?s[0]:void 0,f=!!d?.stream,p=n.streaming===!0;if(f||p)return YK(e,a,r,s,l,c,t,d,i,f,p);let m,h=fR({name:`${c} ${u}`,op:`gen_ai.${c}`,attributes:l},e=>(m=a.apply(r,s),i.recordInputs&&d&&WK(e,d,iK(i.enableTruncation)),m.then(t=>(qK(e,t,i.recordOutputs),t),e=>{throw zz(e,{mechanism:{handled:!1,type:`auto.ai.anthropic`,data:{function:t}}}),e})));return dK(m,h,`auto.ai.anthropic`)}})}function ZK(e,t=``,n){return new Proxy(e,{get(e,r){let i=e[r],a=aK(t,String(r)),o=kK[a];return typeof i==`function`&&o?XK(i,a,o,e,n):typeof i==`function`?i.bind(e):i&&typeof i==`object`?ZK(i,a,n):i}})}function QK(e,t){return ZK(e,``,rK(t))}var $K={"models.generateContent":{operation:`generate_content`},"models.generateContentStream":{operation:`generate_content`,streaming:!0},"models.embedContent":{operation:`embeddings`},"chats.create":{proxyResultPath:`chat`},"chat.sendMessage":{operation:`chat`},"chat.sendMessageStream":{operation:`chat`,streaming:!0}},eq=`google_genai`;function tq(e,t){let n=e?.promptFeedback;if(n?.blockReason){let e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:`internal_error`}),zz(`Content blocked: ${e}`,{mechanism:{handled:!1,type:`auto.ai.google_genai`}}),!0}return!1}function nq(e,t){typeof e.responseId==`string`&&(t.responseId=e.responseId),typeof e.modelVersion==`string`&&(t.responseModel=e.modelVersion);let n=e.usageMetadata;n&&(typeof n.promptTokenCount==`number`&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount==`number`&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount==`number`&&(t.totalTokens=n.totalTokenCount))}function rq(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let e of r?.content?.parts??[])n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:`function`,id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}function iq(e,t,n,r){!e||tq(e,r)||(nq(e,t),rq(e,t,n))}async function*aq(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let i of e)iq(i,r,n,t),yield i}finally{sK(t,r,n)}}function oq(e,t=`user`){return typeof e==`string`?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(e=>oq(e,t)):typeof e!=`object`||!e?[]:`role`in e&&typeof e.role==`string`?[e]:`parts`in e?[{...e,role:t}]:[{role:t,content:e}]}function sq(e,t){if(`model`in e&&typeof e.model==`string`)return e.model;if(t&&typeof t==`object`){let e=t;if(`model`in e&&typeof e.model==`string`)return e.model;if(`modelVersion`in e&&typeof e.modelVersion==`string`)return e.modelVersion}return`unknown`}function cq(e){let t={};return`temperature`in e&&typeof e.temperature==`number`&&(t[zW]=e.temperature),`topP`in e&&typeof e.topP==`number`&&(t[UW]=e.topP),`topK`in e&&typeof e.topK==`number`&&(t[WW]=e.topK),`maxOutputTokens`in e&&typeof e.maxOutputTokens==`number`&&(t[BW]=e.maxOutputTokens),`frequencyPenalty`in e&&typeof e.frequencyPenalty==`number`&&(t[VW]=e.frequencyPenalty),`presencePenalty`in e&&typeof e.presencePenalty==`number`&&(t[HW]=e.presencePenalty),t}function lq(e,t,n){let r={[IW]:eq,[eG]:e,[RF]:`auto.ai.google_genai`};if(t){if(r[LW]=sq(t,n),`config`in t&&typeof t.config==`object`&&t.config){let e=t.config;if(Object.assign(r,cq(e)),`tools`in e&&Array.isArray(e.tools)){let t=e.tools.flatMap(e=>e.functionDeclarations);r[aG]=JSON.stringify(t)}}}else r[LW]=sq({},n);return r}function uq(e,t,n,r){if(n===`embeddings`){let n=t.contents;n!=null&&e.setAttribute(mG,typeof n==`string`?n:JSON.stringify(n));return}let i=[];if(`config`in t&&t.config&&typeof t.config==`object`&&`systemInstruction`in t.config&&t.config.systemInstruction&&i.push(...oq(t.config.systemInstruction,`system`)),`history`in t&&i.push(...oq(t.history,`user`)),`contents`in t&&i.push(...oq(t.contents,`user`)),`message`in t&&i.push(...oq(t.message,`user`)),Array.isArray(i)&&i.length){let{systemInstructions:t,filteredMessages:n}=lK(i);t&&e.setAttribute(rG,t);let a=Array.isArray(n)?n.length:0;e.setAttributes({[tG]:a,[nG]:r?cK(n):SP(n)})}}function dq(e,t,n){if(!(!t||typeof t!=`object`)){if(t.modelVersion&&e.setAttribute(JW,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata==`object`){let n=t.usageMetadata;typeof n.promptTokenCount==`number`&&e.setAttributes({[ZW]:n.promptTokenCount}),typeof n.candidatesTokenCount==`number`&&e.setAttributes({[QW]:n.candidatesTokenCount}),typeof n.totalTokenCount==`number`&&e.setAttributes({[$W]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let n=t.candidates.map(e=>e.content?.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>typeof e.text==`string`?e.text:``).filter(e=>e.length>0).join(``):``).filter(e=>e.length>0);n.length>0&&e.setAttributes({[iG]:n.join(``)})}if(n&&t.functionCalls){let n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[sG]:JSON.stringify(n)})}}}function fq(e,t,n,r,i){let a=n.operation===`embeddings`;return new Proxy(e,{apply(e,o,s){let c=n.operation||`unknown`,l=s[0],u=lq(c,l,r),d=u[`gen_ai.request.model`]??`unknown`;return n.streaming?pR({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},async n=>{try{return i.recordInputs&&l&&uq(n,l,c,iK(i.enableTruncation)),aq(await e.apply(r,s),n,!!i.recordOutputs)}catch(e){throw n.setStatus({code:2,message:`internal_error`}),zz(e,{mechanism:{handled:!1,type:`auto.ai.google_genai`,data:{function:t}}}),n.end(),e}}):fR({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},n=>(i.recordInputs&&l&&uq(n,l,c,iK(i.enableTruncation)),cR(()=>e.apply(r,s),e=>{zz(e,{mechanism:{handled:!1,type:`auto.ai.google_genai`,data:{function:t}}})},()=>{},e=>{a||dq(n,e,i.recordOutputs)})))}})}function pq(e,t=``,n){return new Proxy(e,{get:(e,r,i)=>{let a=Reflect.get(e,r,i),o=aK(t,String(r)),s=$K[o];if(typeof a==`function`&&s){let t=s.operation?fq(a,o,s,e,n):a.bind(e);return s.proxyResultPath?function(...e){let r=t(...e);return r&&typeof r==`object`?pq(r,s.proxyResultPath,n):r}:t}return typeof a==`function`?a.bind(e):a&&typeof a==`object`?pq(a,o,n):a}})}function mq(e,t){return pq(e,``,rK(t))}var hq=`auto.ai.langchain`,gq={human:`user`,ai:`assistant`,assistant:`assistant`,system:`system`,function:`function`,tool:`tool`},_q=(e,t,n)=>{n!=null&&(e[t]=n)},vq=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function yq(e){if(Array.isArray(e))try{let t=e.map(e=>e&&typeof e==`object`&&CG(e)?zG(e):e);return JSON.stringify(t)}catch{return String(e)}return SP(e,String)}function bq(e){let t=e.toLowerCase();return gq[t]??t}function xq(e){return e.includes(`System`)?`system`:e.includes(`Human`)?`user`:e.includes(`AI`)||e.includes(`Assistant`)?`assistant`:e.includes(`Function`)?`function`:e.includes(`Tool`)?`tool`:`user`}function Sq(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Cq(e){return e.map(e=>{let t=e._getType;if(typeof t==`function`)return{role:bq(t.call(e)),content:yq(e.content)};if(e.lc===1&&e.kwargs){let t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:``;return{role:bq(typeof n==`string`?xq(n):`user`),content:yq(e.kwargs?.content)}}if(e.type)return{role:bq(String(e.type).toLowerCase()),content:yq(e.content)};if(e.role)return{role:bq(String(e.role)),content:yq(e.content)};let n=e.constructor?.name;return n&&n!==`Object`?{role:bq(xq(n)),content:yq(e.content)}:{role:`user`,content:yq(e.content)}})}function wq(e,t,n){let r={},i=`kwargs`in e?e.kwargs:void 0;vq(r,zW,t?.temperature??n?.ls_temperature??i?.temperature),vq(r,BW,t?.max_tokens??n?.ls_max_tokens??i?.max_tokens),vq(r,UW,t?.top_p??i?.top_p);let a=t?.frequency_penalty;vq(r,VW,a);let o=t?.presence_penalty;return vq(r,HW,o),t&&`stream`in t&&_q(r,RW,!!t.stream),r}function Tq(e,t,n,r,i){return{[IW]:SP(e??`langchain`,String),[eG]:`chat`,[LW]:SP(t,String),[RF]:hq,...wq(n,r,i)}}function Eq(e,t,n,r,i,a){let o=a?.ls_provider,s=Tq(o,i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){_q(s,tG,t.length);let e=t.map(e=>({role:`user`,content:e}));_q(s,nG,r?cK(e):SP(e))}return s}function Dq(e,t,n,r,i,a){let o=Tq(a?.ls_provider??e.id?.[2],i?.model??a?.ls_model_name??`unknown`,e,i,a);if(n&&Array.isArray(t)&&t.length>0){let{systemInstructions:e,filteredMessages:n}=lK(Cq(t.flat()));e&&_q(o,rG,e),_q(o,tG,Array.isArray(n)?n.length:0),_q(o,nG,r?cK(n):SP(n))}return o}function Oq(e,t){let n=[],r=e.flat();for(let e of r){let t=e.message?.tool_calls;if(Array.isArray(t)&&t.length>0)n.push(...t);else{let t=e.message?.content;if(Array.isArray(t))for(let e of t){let t=e;t.type===`tool_use`&&n.push(t)}}}n.length>0&&_q(t,sG,SP(n,String))}function kq(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)vq(t,ZW,n.promptTokens),vq(t,QW,n.completionTokens),vq(t,$W,n.totalTokens);else if(r){vq(t,ZW,r.input_tokens),vq(t,QW,r.output_tokens);let e=Number(r.input_tokens),n=Number(r.output_tokens),i=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);i>0&&vq(t,$W,i),r.cache_creation_input_tokens!==void 0&&vq(t,dG,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&vq(t,fG,r.cache_read_input_tokens)}}function Aq(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let r=e.generations.flat().map(e=>e.generationInfo?.finish_reason?e.generationInfo.finish_reason:e.generation_info?.finish_reason?e.generation_info.finish_reason:null).filter(e=>typeof e==`string`);if(r.length>0&&_q(n,qW,SP(r,String)),Oq(e.generations,n),t){let t=e.generations.flat().map(e=>e.text??e.message?.content).filter(e=>typeof e==`string`);t.length>0&&_q(n,iG,SP(t,String))}}kq(e.llmOutput,n);let r=e.llmOutput,i=e.generations?.[0]?.[0]?.message,a=r?.model_name??r?.model??i?.response_metadata?.model_name;a&&_q(n,JW,a);let o=r?.id??i?.id;o&&_q(n,YW,o);let s=r?.stop_reason??i?.response_metadata?.finish_reason;return s&&_q(n,XW,SP(s,String)),n}function jq(e){let t={},n=e?.lc_agent_name;return typeof n==`string`&&(t[cG]=n),t}function Mq(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(e=>{let t=e.function;return{type:`function`,name:e.name??t?.name??``,description:e.description??t?.description}});return JSON.stringify(n)}function Nq(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.addHandler==`function`&&typeof t.copy==`function`}function Pq(e){return typeof e==`object`&&e?.name===`SentryCallbackHandler`}function Fq(e){return e.some(Pq)}function Iq(e,t){if(!e)return[t];if(Nq(e)){if(Fq(e.handlers??[]))return e;let n=e.copy();return n.addHandler(t,!0),n}let n=Array.isArray(e)?e:[e];return Fq(n)?e:[...n,t]}function Lq(e={}){let{recordInputs:t,recordOutputs:n}=rK(e),r=iK(e.enableTruncation),i=new Map,a=e=>{let t=i.get(e);t?.isRecording()&&(t.end(),i.delete(e))},o={lc_serializable:!1,lc_namespace:[`langchain_core`,`callbacks`,`sentry`],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:[`langchain_core`,`callbacks`,`sentry`],lc_kwargs:{},name:`SentryCallbackHandler`,ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(e,n,a,o,s,c,l,u){let d=Sq(c),f=Eq(e,n,t,r,d,l),p=f[LW],m=f[eG];pR({name:`${m} ${p}`,op:`gen_ai.chat`,attributes:{...jq(l),...f,[LF]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleChatModelStart(e,n,a,o,s,c,l,u){let d=Sq(c),f=Dq(e,n,t,r,d,l),p=Mq(s);p&&(f[aG]=p);let m=f[LW],h=f[eG];pR({name:`${h} ${m}`,op:`gen_ai.chat`,attributes:{...jq(l),...f,[LF]:`gen_ai.chat`}},e=>(i.set(a,e),e))},handleLLMEnd(e,t,r,o,s){let c=i.get(t);if(c?.isRecording()){let r=Aq(e,n);r&&c.setAttributes(r),a(t)}},handleLLMError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),zz(e,{mechanism:{handled:!1,type:`${hq}.llm_error_handler`}})},handleChainStart(e,n,r,a,o,s,c,l){if(s?.__sentry_langgraph__)return;let u=l||e.name||`unknown_chain`,d={[RF]:`auto.ai.langchain`,"langchain.chain.name":u};t&&(d[`langchain.chain.inputs`]=JSON.stringify(n)),pR({name:`chain ${u}`,op:`gen_ai.invoke_agent`,attributes:{...d,[LF]:`gen_ai.invoke_agent`}},e=>(i.set(r,e),e))},handleChainEnd(e,t){let r=i.get(t);r?.isRecording()&&(n&&r.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),a(t))},handleChainError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),zz(e,{mechanism:{handled:!1,type:`${hq}.chain_error_handler`}})},handleToolStart(e,n,r,a,o,s,c){if(s?.__sentry_langgraph__)return;let l=c||e.name||`unknown_tool`,u={...jq(s),[RF]:hq,[eG]:`execute_tool`,[_G]:l};t&&(u[bG]=n),pR({name:`execute_tool ${l}`,op:`gen_ai.execute_tool`,attributes:{...u,[LF]:`gen_ai.execute_tool`}},e=>(i.set(r,e),e))},handleToolEnd(e,t){let r=i.get(t);if(r?.isRecording()){if(n){let t=e,n=t&&typeof t==`object`&&`content`in t?t.content:e;r.setAttributes({[xG]:typeof n==`string`?n:JSON.stringify(n)})}a(t)}},handleToolError(e,t){let n=i.get(t);n?.isRecording()&&(n.setStatus({code:2,message:`internal_error`}),a(t)),zz(e,{mechanism:{handled:!1,type:`${hq}.tool_error_handler`}})},copy(){return o},toJSON(){return{lc:1,type:`not_implemented`,id:o.lc_id}},toJSONNotImplemented(){return{lc:1,type:`not_implemented`,id:o.lc_id}}};return o}function Rq(e){let t=e.constructor?.name??``;return t.includes(`OpenAI`)?`openai`:t.includes(`Google`)?`google_genai`:t.includes(`Mistral`)?`mistralai`:t.includes(`Vertex`)?`google_vertexai`:t.includes(`Bedrock`)?`aws_bedrock`:t.includes(`Ollama`)?`ollama`:t.includes(`Cloudflare`)?`cloudflare`:t.includes(`Cohere`)?`cohere`:`langchain`}function zq(e){let t=e??{},n={[RF]:hq,[LF]:hG,[eG]:`embeddings`,[LW]:t.model??`unknown`};return n[IW]=Rq(t),`dimensions`in t&&(n[KW]=t.dimensions),`encodingFormat`in t&&(n[GW]=t.encodingFormat),n}function Bq(e,t,n={}){let{recordInputs:r}=rK(n),i=zq(e),a=i[`gen_ai.request.model`]||`unknown`;return r&&t!=null&&(i[mG]=typeof t==`string`?t:JSON.stringify(t)),{name:`embeddings ${a}`,op:hG,attributes:i}}function Vq(e,t={}){return new Proxy(e,{apply(e,n,r){return fR(Bq(n,r[0],t),()=>Reflect.apply(e,n,r).then(void 0,e=>{throw zz(e,{mechanism:{handled:!1,type:`auto.ai.langchain`}}),e}))}})}function Hq(e,t){let n=e;return typeof n.embedQuery==`function`&&(n.embedQuery=Vq(n.embedQuery,t)),typeof n.embedDocuments==`function`&&(n.embedDocuments=Vq(n.embedDocuments,t)),e}var Uq=`auto.ai.langgraph`;function Wq(e){let t=e[0];if(typeof t!=`object`||!t||!(`llm`in t)||!t.llm||typeof t.llm!=`object`)return null;let n=t.llm;return typeof n.modelName!=`string`&&typeof n.model!=`string`?null:n}function Gq(e){let t=e[0];return typeof t==`object`&&t&&`name`in t&&typeof t.name==`string`?t.name:null}function Kq(e,t,n){let r=`__sentry_tool_wrapped__`;for(let i of e){if(!i||typeof i!=`object`)continue;let e=i,a=e.invoke;if(typeof a!=`function`||Object.prototype.hasOwnProperty.call(e,r))continue;let o=typeof e.name==`string`?e.name:`unknown_tool`,s=typeof e.description==`string`?e.description:void 0;e.invoke=new Proxy(a,{apply(e,r,i){let a={[RF]:Uq,[LF]:gG,[eG]:`execute_tool`,[_G]:o,[yG]:`function`},c=i[1]?.metadata?.lc_agent_name??n;typeof c==`string`&&(a[cG]=c),s&&(a[SG]=s);let l=i[0];if(typeof l==`object`&&l&&(`id`in l&&typeof l.id==`string`&&(a[vG]=l.id),t.recordInputs)){let e=`args`in l&&typeof l.args==`object`?l.args:l;try{a[bG]=JSON.stringify(e)}catch{}}return fR({op:gG,name:`execute_tool ${o}`,attributes:a},async n=>{try{let a=await Reflect.apply(e,r,i);if(t.recordOutputs)try{let e=a,t=e&&typeof e==`object`&&`content`in e?e.content:a;n.setAttribute(xG,typeof t==`string`?t:JSON.stringify(t))}catch{}return a}catch(e){throw n.setStatus({code:2,message:`internal_error`}),zz(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}}),Object.defineProperty(e,r,{value:!0,enumerable:!1})}return e}function qq(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n==`object`){let e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}function Jq(e){let t=e,n=0,r=0,i=0;if(t.usage_metadata&&typeof t.usage_metadata==`object`){let e=t.usage_metadata;return typeof e.input_tokens==`number`&&(n=e.input_tokens),typeof e.output_tokens==`number`&&(r=e.output_tokens),typeof e.total_tokens==`number`&&(i=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:i}}if(t.response_metadata&&typeof t.response_metadata==`object`){let e=t.response_metadata;if(e.tokenUsage&&typeof e.tokenUsage==`object`){let t=e.tokenUsage;typeof t.promptTokens==`number`&&(n=t.promptTokens),typeof t.completionTokens==`number`&&(r=t.completionTokens),typeof t.totalTokens==`number`&&(i=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:i}}function Yq(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata==`object`){let t=n.response_metadata;t.model_name&&typeof t.model_name==`string`&&e.setAttribute(JW,t.model_name),t.finish_reason&&typeof t.finish_reason==`string`&&e.setAttribute(qW,[t.finish_reason])}}function Xq(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(e=>({name:e.lc_kwargs?.name,description:e.lc_kwargs?.description,schema:e.lc_kwargs?.schema}))}function Zq(e,t,n){let r=n?.messages;if(!r||!Array.isArray(r))return;let i=t?.length??0,a=r.length>i?r.slice(i):[];if(a.length===0)return;let o=qq(a);o&&e.setAttribute(sG,JSON.stringify(o));let s=Cq(a);e.setAttribute(iG,JSON.stringify(s));let c=0,l=0,u=0;for(let t of a){let n=Jq(t);c+=n.inputTokens,l+=n.outputTokens,u+=n.totalTokens,Yq(e,t)}c>0&&e.setAttribute(ZW,c),l>0&&e.setAttribute(QW,l),u>0&&e.setAttribute($W,u)}var Qq=!1,$q=`__sentry_patched__`;function eJ(e){let t={[RF]:Uq,[LF]:`gen_ai.create_agent`,[eG]:`create_agent`};return e&&(t[cG]=e),{op:`gen_ai.create_agent`,name:e?`create_agent ${e}`:`create_agent`,attributes:t}}function tJ(e,t){if(Object.prototype.hasOwnProperty.call(e,$q))return e;let n=Lq(t),r=new Proxy(e,{apply(e,r,i){return Qq?Reflect.apply(e,r,i):fR(eJ(),a=>{try{let o=Reflect.apply(e,r,i),s=i.length>0?i[0]:{};s?.name&&typeof s.name==`string`&&(a.setAttribute(cG,s.name),a.updateName(`create_agent ${s.name}`));let c=o.invoke;return c&&typeof c==`function`&&(o.invoke=nJ(c.bind(o),o,s,t,void 0,n)),o}catch(e){throw a.setStatus({code:2,message:`internal_error`}),zz(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}});return Object.defineProperty(r,$q,{value:!0,enumerable:!1}),r}function nJ(e,t,n,r,i,a){return new Proxy(e,{apply(e,o,s){let c=i?.modelName??i?.model;return fR({op:`gen_ai.invoke_agent`,name:`invoke_agent`,attributes:{[RF]:Uq,[LF]:pG,[eG]:`invoke_agent`}},async i=>{try{let l=n?.name;l&&typeof l==`string`&&(i.setAttribute(lG,l),i.setAttribute(cG,l),i.updateName(`invoke_agent ${l}`)),c&&i.setAttribute(LW,c);let u=(s.length>1?s[1]:void 0)?.configurable?.thread_id;if(u&&typeof u==`string`&&i.setAttribute(uG,u),a){let e=s[1]??{};s[1]=e,e.metadata={...e.metadata??{},__sentry_langgraph__:!0,...typeof l==`string`?{lc_agent_name:l}:{}},e.callbacks=Iq(e.callbacks,a)}let d=Xq(t);d&&i.setAttribute(aG,JSON.stringify(d));let f=r.recordInputs,p=r.recordOutputs,m=s.length>0?s[0]?.messages??[]:[];if(m&&f){let{systemInstructions:e,filteredMessages:t}=lK(Cq(m));e&&i.setAttribute(rG,e);let n=iK(r.enableTruncation),a=Array.isArray(t)?t.length:0;i.setAttributes({[nG]:n?cK(t):SP(t),[tG]:a})}let h=await Reflect.apply(e,o,s);return p&&Zq(i,m??null,h),h}catch(e){throw i.setStatus({code:2,message:`internal_error`}),zz(e,{mechanism:{handled:!1,type:`auto.ai.langgraph.error`}}),e}})}})}function rJ(e,t){if(Object.prototype.hasOwnProperty.call(e,$q))return e;let n=rK(t),r=Lq(n),i=new Proxy(e,{apply(e,t,i){let a=Wq(i),o=Gq(i),s=i[0];s&&Array.isArray(s.tools)&&s.tools.length>0&&Kq(s.tools,n,o??void 0),Qq=!0;let c;try{c=Reflect.apply(e,t,i)}finally{Qq=!1}let l=c.invoke;if(l&&typeof l==`function`){let e={};o&&(e.name=o),c.invoke=nJ(l.bind(c),c,e,n,a,r)}return c}});return Object.defineProperty(i,$q,{value:!0,enumerable:!1}),i}function iJ(e,t){return e.compile=tJ(e.compile,rK(t)),e}function aJ(e,t,n){let r=n.getOptions(),i=n.getDsn(),a=r.tunnel,o=WL(r._metadata),s={sent_at:new Date(oP()).toISOString(),...oJ(t)&&{trace:t},...o&&{sdk:o},...!!a&&i&&{dsn:SI(i)}},c=n.getDataCollectionOptions().userInfo?`auto`:`never`;return ML(s,[[{type:`span`,item_count:e.length,content_type:`application/vnd.sentry.items.span.v2+json`},{version:2,...OB()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}]])}function oJ(e){return!!e.trace_id&&!!e.public_key}function sJ(e){let t=156;if(t+=e.name.length*2,t+=CF(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,r=100+(n?CF(n):0);t+=r*e.links.length}return t}var cJ=1e3,lJ=5e6,uJ=class{constructor(e,t){this._traceBuckets=new Map,this._client=e;let{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:i}=t??{};this._maxSpanLimit=n&&n>0&&n<=cJ?n:cJ,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=i&&i>0?i:lJ,this._client.on(`flush`,()=>{this.drain()}),this._client.on(`close`,()=>{this._traceBuckets.forEach(e=>{clearTimeout(e.timeout)}),this._traceBuckets.clear()})}add(e){let t=e.trace_id,n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:aB(setTimeout(()=>{this.flush(t)},this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=sJ(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(W&&K.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,t)=>{this.flush(t)}))}flush(e){let t=this._traceBuckets.get(e);if(!t)return;if(!t.spans.size){this._removeTrace(e);return}let n=Array.from(t.spans),r=n[0]?._segmentSpan;if(!r){W&&K.warn(`No segment span reference found on span JSON, cannot compute DSC`),this._removeTrace(e);return}let i=OL(r),a=n.map(e=>{let{_segmentSpan:t,...n}=e;return n}),o=aJ(a,i,this._client);W&&K.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(o).then(null,e=>{W&&K.error(`Error while sending streamed span envelope:`,e)}),this._removeTrace(e)}_removeTrace(e){let t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}};function dJ(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var fJ=G;function pJ(){return`history`in fJ&&!!fJ.history}function mJ(){if(!(`fetch`in fJ))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function hJ(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function gJ(){if(typeof EdgeRuntime==`string`)return!0;if(!mJ())return!1;if(hJ(fJ.fetch))return!0;let e=!1,t=fJ.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=hJ(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){W&&K.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function _J(){return`ReportingObserver`in fJ}function vJ(e,t){let n=`fetch`,r=TN(n,e);return EN(n,()=>bJ(void 0,t)),r}function yJ(e){let t=`fetch-body-resolved`,n=TN(t,e);return EN(t,()=>bJ(SJ)),n}function bJ(e,t=!1){t&&!gJ()||XN(G,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=TJ(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:UP()*1e3,virtualError:r,headers:EJ(n)};return e||DN(`fetch`,{...o}),t.apply(G,n).then(async t=>(e?e(t):DN(`fetch`,{...o,endTimestamp:UP()*1e3,response:t}),t),e=>{DN(`fetch`,{...o,endTimestamp:UP()*1e3,error:e}),FN(e)&&e.stack===void 0&&(e.stack=r.stack,ZN(e,`framesToPop`,1));let t=J()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:ZN(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function xJ(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function SJ(e){let t;try{t=e.clone()}catch{return}xJ(t,()=>{DN(`fetch-body-resolved`,{endTimestamp:UP()*1e3,response:e})})}function CJ(e,t){return WN(e)&&!!e[t]}function wJ(e){return typeof e==`string`?e:e?CJ(e,`url`)?e.url:e.toString?e.toString():``:``}function TJ(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:wJ(t),method:CJ(n,`method`)?String(n.method).toUpperCase():YN(t)&&CJ(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:wJ(t),method:CJ(t,`method`)?String(t.method).toUpperCase():`GET`}}function EJ(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(YN(t))return new Headers(t.headers)}catch{}}function DJ(e,t=!1){return!(t||e&&!e.startsWith(`/`)&&!e.match(/^[A-Z]:/)&&!e.startsWith(`.`)&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes(`node_modules/`)}function OJ(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return i=>{let a=i.match(r);if(a)return{filename:`<data:${a[2]}>`,function:a[1]};let o=i.match(n);if(o){let t,n,r,i,a;if(o[1]){r=o[1];let e=r.lastIndexOf(`.`);if(r[e-1]===`.`&&e--,e>0){t=r.slice(0,e),n=r.slice(e+1);let i=t.indexOf(`.Module`);i>0&&(r=r.slice(i+1),t=t.slice(0,i))}i=void 0}n&&(i=t,a=n),n===`<anonymous>`&&(a=void 0,r=void 0),r===void 0&&(a||=`?`,r=i?`${i}.${a}`:a);let s=SN(o[2]),c=o[5]===`native`;!s&&o[5]&&!c&&(s=o[5]);let l=s?jJ(s):void 0;return{filename:l??s,module:l&&e?.(l),function:r,lineno:AJ(o[3]),colno:AJ(o[4]),in_app:DJ(s||``,c)}}if(i.match(t))return{filename:i}}}function kJ(e){return[90,OJ(e)]}function AJ(e){return parseInt(e||``,10)||void 0}function jJ(e){try{return decodeURI(e)}catch{return}}var MJ=G;function NJ(){try{return MJ.document.location.href}catch{return``}}function PJ(e,t=5){if(!MJ.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}var FJ;(function(e){e[e.Classic=1]=`Classic`,e[e.Protocol=2]=`Protocol`,e[e.Both=3]=`Both`})(FJ||={});function IJ(e){return{createUrl:t=>`${e}://${t}/sentry_key`,urlMatches:function(e,t){return e.startsWith(this.createUrl(t))},createKey:t=>`${e}.${t}`,namespace:e}}var LJ=`sentry-electron-renderer-id`;function RJ(e){let t=IJ(e);if(window.__SENTRY_IPC__?.[t.namespace])return window.__SENTRY_IPC__[t.namespace];{K.log(`IPC was not configured in preload script, falling back to custom protocol and fetch`);let e=window.__SENTRY_RENDERER_ID__=jP(),n={[LJ]:e};return{sendRendererStart:()=>{fetch(t.createUrl(`start`),{method:`POST`,body:``,headers:n}).catch(()=>{console.error(`Sentry SDK failed to establish connection with the Electron main process.
|
|
520
|
-
- Ensure you have initialized the SDK in the main process
|
|
521
|
-
- If your renderers use custom sessions, be sure to set 'getSessions' in the main process options
|
|
522
|
-
- If you are bundling your main process code and using Electron < v5, you'll need to manually configure a preload script`)})},sendScope:e=>{fetch(t.createUrl(`scope`),{method:`POST`,body:e,headers:n}).catch(()=>{})},sendEnvelope:e=>{let r=typeof e==`string`?e:e.buffer instanceof ArrayBuffer?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):Uint8Array.from(e).buffer;fetch(t.createUrl(`envelope`),{method:`POST`,body:r,headers:n}).catch(()=>{})},sendStatus:e=>{fetch(t.createUrl(`status`),{method:`POST`,body:JSON.stringify({status:e}),headers:n}).catch(()=>{})},sendStructuredLog:e=>{fetch(t.createUrl(`structured-log`),{method:`POST`,body:JSON.stringify(e),headers:n}).catch(()=>{})},sendMetric:e=>{fetch(t.createUrl(`metric`),{method:`POST`,body:JSON.stringify(e),headers:n}).catch(()=>{})}}}}var zJ;function BJ(e=J()){if(!e)throw Error(`Could not find client, make sure to call Sentry.init before getIPC`);zJ||=new WeakMap;let t=zJ.get(e);if(t)return t;let n=e.getOptions().ipcNamespace,r=RJ(n);return zJ.set(e,r),r.sendRendererStart(),r}var VJ=e({debug:()=>WJ,error:()=>qJ,fatal:()=>JJ,fmt:()=>aH,info:()=>GJ,trace:()=>UJ,warn:()=>KJ});function HJ(e,t,n,r){let i=J();FB({level:e,message:t,attributes:n,severityNumber:r},q(),(e,t)=>BJ(i).sendStructuredLog(t))}function UJ(e,t){HJ(`trace`,e,t)}function WJ(e,t){HJ(`debug`,e,t)}function GJ(e,t){HJ(`info`,e,t)}function KJ(e,t){HJ(`warn`,e,t)}function qJ(e,t){HJ(`error`,e,t)}function JJ(e,t){HJ(`fatal`,e,t)}var YJ=e({count:()=>ZJ,distribution:()=>$J,gauge:()=>QJ});function XJ(e,t,n,r){let i=J();JB({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope??q(),captureSerializedMetric:(e,t)=>BJ(i).sendMetric(t)})}function ZJ(e,t=1,n){XJ(`counter`,e,t,n)}function QJ(e,t,n){XJ(`gauge`,e,t,n)}function $J(e,t,n){XJ(`distribution`,e,t,n)}var eY=G,tY=eY.document,nY=eY.navigator,rY=`Report a Bug`,iY=`Cancel`,aY=`Send Bug Report`,oY=`Confirm`,sY=`Report a Bug`,cY=`your.email@example.org`,lY=`Email`,uY=`What's the bug? What did you expect?`,dY=`Description`,fY=`Your Name`,pY=`Name`,mY=`Thank you for your report!`,hY=`(required)`,gY=`Add a screenshot`,_Y=`Remove screenshot`,vY=`Highlight`,yY=`Hide`,bY=`Remove`,xY=`Unable to submit feedback with empty message`,SY=`No client setup, cannot send feedback.`,CY=`Unable to determine if Feedback was correctly sent.`,wY=`Unable to send feedback. This could be because this domain is not in your list of allowed domains.`,TY=`Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.`,EY=`widget`,DY=`api`,OY=5e3,kY={ERROR_EMPTY_MESSAGE:xY,ERROR_NO_CLIENT:SY,ERROR_TIMEOUT:CY,ERROR_FORBIDDEN:wY,ERROR_GENERIC:TY};function AY(e,t){return t?.[e]??kY[e]}function jY(e,t){return Error(AY(e,t))}var MY=(e,t={includeReplay:!0})=>{let n=t.errorMessages;if(!e.message)throw jY(`ERROR_EMPTY_MESSAGE`,n);let r=J();if(!r)throw jY(`ERROR_NO_CLIENT`,n);e.tags&&Object.keys(e.tags).length&&q().setTags(e.tags);let i=vW({source:DY,url:NJ(),...e},t);return new Promise((e,t)=>{let a=setTimeout(()=>{o(),t(AY(`ERROR_TIMEOUT`,n))},3e4),o=r.on(`afterSendEvent`,(r,s)=>{if(r.event_id===i)return clearTimeout(a),o(),s?.statusCode&&s.statusCode>=200&&s.statusCode<300?e(i):s?.statusCode===403?t(AY(`ERROR_FORBIDDEN`,n)):t(AY(`ERROR_GENERIC`,n))})})},NY=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function PY(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(nY.userAgent)||/Macintosh/i.test(nY.userAgent)&&nY.maxTouchPoints&&nY.maxTouchPoints>1||!isSecureContext)}function FY(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function IY(e){let t=tY.createElement(`style`);return t.textContent=`
|
|
523
|
-
.widget__actor {
|
|
524
|
-
position: fixed;
|
|
525
|
-
z-index: var(--z-index);
|
|
526
|
-
margin: var(--page-margin);
|
|
527
|
-
inset: var(--actor-inset);
|
|
528
|
-
|
|
529
|
-
display: flex;
|
|
530
|
-
align-items: center;
|
|
531
|
-
gap: 8px;
|
|
532
|
-
padding: 16px;
|
|
533
|
-
|
|
534
|
-
font-family: inherit;
|
|
535
|
-
font-size: var(--font-size);
|
|
536
|
-
font-weight: 600;
|
|
537
|
-
line-height: 1.14em;
|
|
538
|
-
text-decoration: none;
|
|
539
|
-
|
|
540
|
-
background: var(--actor-background, var(--background));
|
|
541
|
-
border-radius: var(--actor-border-radius, 1.7em/50%);
|
|
542
|
-
border: var(--actor-border, var(--border));
|
|
543
|
-
box-shadow: var(--actor-box-shadow, var(--box-shadow));
|
|
544
|
-
color: var(--actor-color, var(--foreground));
|
|
545
|
-
fill: var(--actor-color, var(--foreground));
|
|
546
|
-
cursor: pointer;
|
|
547
|
-
opacity: 1;
|
|
548
|
-
transition: transform 0.2s ease-in-out;
|
|
549
|
-
transform: translate(0, 0) scale(1);
|
|
550
|
-
}
|
|
551
|
-
.widget__actor[aria-hidden="true"] {
|
|
552
|
-
opacity: 0;
|
|
553
|
-
pointer-events: none;
|
|
554
|
-
visibility: hidden;
|
|
555
|
-
transform: translate(0, 16px) scale(0.98);
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
.widget__actor:hover {
|
|
559
|
-
background: var(--actor-hover-background, var(--background));
|
|
560
|
-
filter: var(--interactive-filter);
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
.widget__actor svg {
|
|
564
|
-
width: 1.14em;
|
|
565
|
-
height: 1.14em;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
@media (max-width: 600px) {
|
|
569
|
-
.widget__actor span {
|
|
570
|
-
display: none;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
`,e&&t.setAttribute(`nonce`,e),t}function LY(e,t){return Object.entries(t).forEach(([t,n])=>{e.setAttributeNS(null,t,n)}),e}var RY=20,zY=`http://www.w3.org/2000/svg`;function BY(){let e=e=>eY.document.createElementNS(zY,e),t=LY(e(`svg`),{width:`${RY}`,height:`${RY}`,viewBox:`0 0 ${RY} ${RY}`,fill:`var(--actor-color, var(--foreground))`}),n=LY(e(`g`),{clipPath:`url(#clip0_57_80)`}),r=LY(e(`path`),{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z`});t.appendChild(n).appendChild(r);let i=e(`defs`),a=LY(e(`clipPath`),{id:`clip0_57_80`}),o=LY(e(`rect`),{width:`${RY}`,height:`${RY}`,fill:`white`});return a.appendChild(o),i.appendChild(a),t.appendChild(i).appendChild(a).appendChild(o),t}function VY({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){let i=tY.createElement(`button`);if(i.type=`button`,i.className=`widget__actor`,i.ariaHidden=`false`,i.ariaLabel=t||e||rY,i.appendChild(BY()),e){let t=tY.createElement(`span`);t.appendChild(tY.createTextNode(e)),i.appendChild(t)}let a=IY(r);return{el:i,appendToDom(){n.appendChild(a),n.appendChild(i)},removeFromDom(){i.remove(),a.remove()},show(){i.ariaHidden=`false`},hide(){i.ariaHidden=`true`}}}var HY=`rgba(88, 74, 192, 1)`,UY={foreground:`#2b2233`,background:`#ffffff`,accentForeground:`white`,accentBackground:HY,successColor:`#268d75`,errorColor:`#df3338`,border:`1.5px solid rgba(41, 35, 47, 0.13)`,boxShadow:`0px 4px 24px 0px rgba(43, 34, 51, 0.12)`,outline:`1px auto var(--accent-background)`,interactiveFilter:`brightness(95%)`},WY={foreground:`#ebe6ef`,background:`#29232f`,accentForeground:`white`,accentBackground:HY,successColor:`#2da98c`,errorColor:`#f55459`,border:`1.5px solid rgba(235, 230, 239, 0.15)`,boxShadow:`0px 4px 24px 0px rgba(43, 34, 51, 0.12)`,outline:`1px auto var(--accent-background)`,interactiveFilter:`brightness(150%)`};function GY(e){return`
|
|
574
|
-
--foreground: ${e.foreground};
|
|
575
|
-
--background: ${e.background};
|
|
576
|
-
--accent-foreground: ${e.accentForeground};
|
|
577
|
-
--accent-background: ${e.accentBackground};
|
|
578
|
-
--success-color: ${e.successColor};
|
|
579
|
-
--error-color: ${e.errorColor};
|
|
580
|
-
--border: ${e.border};
|
|
581
|
-
--box-shadow: ${e.boxShadow};
|
|
582
|
-
--outline: ${e.outline};
|
|
583
|
-
--interactive-filter: ${e.interactiveFilter};
|
|
584
|
-
`}function KY({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){let i=tY.createElement(`style`);return i.textContent=`
|
|
585
|
-
:host {
|
|
586
|
-
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
|
|
587
|
-
--font-size: 14px;
|
|
588
|
-
--z-index: 100000;
|
|
589
|
-
|
|
590
|
-
--page-margin: 16px;
|
|
591
|
-
--inset: auto 0 0 auto;
|
|
592
|
-
--actor-inset: var(--inset);
|
|
593
|
-
|
|
594
|
-
font-family: var(--font-family);
|
|
595
|
-
font-size: var(--font-size);
|
|
596
|
-
|
|
597
|
-
${e===`system`?``:`color-scheme: only ${e};`}
|
|
598
|
-
|
|
599
|
-
${GY(e===`dark`?{...WY,...t}:{...UY,...n})}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
${e===`system`?`
|
|
603
|
-
@media (prefers-color-scheme: dark) {
|
|
604
|
-
:host {
|
|
605
|
-
color-scheme: only dark;
|
|
606
|
-
|
|
607
|
-
${GY({...WY,...t})}
|
|
608
|
-
}
|
|
609
|
-
}`:``}
|
|
610
|
-
`,r&&i.setAttribute(`nonce`,r),i}var qY=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:r=`sentry-feedback`,autoInject:i=!0,showBranding:a=!0,isEmailRequired:o=!1,isNameRequired:s=!1,showEmail:c=!0,showName:l=!0,enableScreenshot:u=!0,useSentryUser:d={email:`email`,name:`username`},tags:f,styleNonce:p,scriptNonce:m,colorScheme:h=`system`,themeLight:g={},themeDark:_={},addScreenshotButtonLabel:v=gY,cancelButtonLabel:y=iY,confirmButtonLabel:b=oY,emailLabel:x=lY,emailPlaceholder:S=cY,formTitle:C=sY,isRequiredLabel:w=hY,messageLabel:T=dY,messagePlaceholder:ee=uY,nameLabel:E=pY,namePlaceholder:te=fY,removeScreenshotButtonLabel:ne=_Y,submitButtonLabel:re=aY,successMessageText:ie=mY,triggerLabel:ae=rY,triggerAriaLabel:oe=``,highlightToolText:D=vY,hideToolText:se=yY,removeHighlightText:ce=bY,errorEmptyMessageText:le=xY,errorNoClientText:ue=SY,errorTimeoutText:de=CY,errorForbiddenText:fe=wY,errorGenericText:pe=TY,onFormOpen:me,onFormClose:he,onSubmitSuccess:ge,onSubmitError:_e,onFormSubmitted:ve}={})=>{let O={id:r,autoInject:i,showBranding:a,isEmailRequired:o,isNameRequired:s,showEmail:c,showName:l,enableScreenshot:u,useSentryUser:d,tags:f,styleNonce:p,scriptNonce:m,colorScheme:h,themeDark:_,themeLight:g,triggerLabel:ae,triggerAriaLabel:oe,cancelButtonLabel:y,submitButtonLabel:re,confirmButtonLabel:b,formTitle:C,emailLabel:x,emailPlaceholder:S,messageLabel:T,messagePlaceholder:ee,nameLabel:E,namePlaceholder:te,successMessageText:ie,isRequiredLabel:w,addScreenshotButtonLabel:v,removeScreenshotButtonLabel:ne,highlightToolText:D,hideToolText:se,removeHighlightText:ce,errorEmptyMessageText:le,errorNoClientText:ue,errorTimeoutText:de,errorForbiddenText:fe,errorGenericText:pe,onFormClose:he,onFormOpen:me,onSubmitError:_e,onSubmitSuccess:ge,onFormSubmitted:ve},ye=null,be=null,k=[],xe=e=>{if(!ye){let t=tY.createElement(`div`);t.id=String(e.id),tY.body.appendChild(t),ye=t.attachShadow({mode:`open`}),be=KY(e),ye.appendChild(be)}return ye},Se=async r=>{let i=r.enableScreenshot&&PY(),a,o;try{a=(t?t():await e(`feedbackModalIntegration`,m))(),_B(a)}catch{throw NY&&K.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),Error(`[Feedback] Missing feedback modal integration!`)}try{let t=i?n?n():await e(`feedbackScreenshotIntegration`,m):void 0;t&&(o=t(),_B(o))}catch{NY&&K.error(`[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.`)}let s={ERROR_EMPTY_MESSAGE:r.errorEmptyMessageText,ERROR_NO_CLIENT:r.errorNoClientText,ERROR_TIMEOUT:r.errorTimeoutText,ERROR_FORBIDDEN:r.errorForbiddenText,ERROR_GENERIC:r.errorGenericText},c=(e,t)=>MY(e,{includeReplay:!0,...t,errorMessages:s}),l=a.createDialog({options:{...r,onFormClose:()=>{l?.close(),r.onFormClose?.()},onFormSubmitted:()=>{l?.close(),r.onFormSubmitted?.()}},screenshotIntegration:o,sendFeedback:c,shadow:xe(r)});return l},Ce=(e,t={})=>{let n=FY(O,t),r=typeof e==`string`?tY.querySelector(e):typeof e.addEventListener==`function`?e:null;if(!r)throw NY&&K.error(`[Feedback] Unable to attach to target element`),Error(`Unable to attach to target element`);let i=null,a=async()=>{i||=await Se({...n,onFormSubmitted:()=>{i?.removeFromDom(),n.onFormSubmitted?.()}}),i.appendToDom(),i.open()};r.addEventListener(`click`,a);let o=()=>{k=k.filter(e=>e!==o),i?.removeFromDom(),i=null,r.removeEventListener(`click`,a)};return k.push(o),o},we=(e={})=>{let t=FY(O,e),n=xe(t),r=VY({triggerLabel:t.triggerLabel,triggerAriaLabel:t.triggerAriaLabel,shadow:n,styleNonce:p});return Ce(r.el,{...t,onFormOpen(){r.hide()},onFormClose(){r.show()},onFormSubmitted(){r.show()}}),r};return{name:`Feedback`,setupOnce(){!OB()||!O.autoInject||(tY.readyState===`loading`?tY.addEventListener(`DOMContentLoaded`,()=>we().appendToDom()):we().appendToDom())},attachTo:Ce,createWidget(e={}){let t=we(FY(O,e));return t.appendToDom(),t},async createForm(e={}){return Se(FY(O,e))},setTheme(e){if(O.colorScheme=e,ye){let e=KY(O);be?ye.replaceChild(e,be):ye.prepend(e),be=e}},remove(){ye&&(ye.parentElement?.remove(),ye=null,be=null),k.forEach(e=>e()),k=[]}}});function JY(){return J()?.getIntegrationByName(`Feedback`)}var YY,XY,ZY,QY,$Y,eX,tX,nX={},rX=[],iX=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,aX=Array.isArray;function oX(e,t){for(var n in t)e[n]=t[n];return e}function sX(e){var t=e.parentNode;t&&t.removeChild(e)}function cX(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?YY.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return lX(e,o,r,i,null)}function lX(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++ZY,__i:-1,__u:0};return i==null&&XY.vnode!=null&&XY.vnode(a),a}function uX(e){return e.children}function dX(e,t){this.props=e,this.context=t}function fX(e,t){if(t==null)return e.__?fX(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?fX(e):null}function pX(e,t,n){var r,i=e.__v,a=i.__e,o=e.__P;if(o)return(r=oX({},i)).__v=i.__v+1,XY.vnode&&XY.vnode(r),TX(o,r,i,e.__n,o.ownerSVGElement!==void 0,32&i.__u?[a]:null,t,a??fX(i),!!(32&i.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=a&&mX(r),r}function mX(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return mX(e)}}function hX(e){(!e.__d&&(e.__d=!0)&&QY.push(e)&&!gX.__r++||$Y!==XY.debounceRendering)&&(($Y=XY.debounceRendering)||eX)(gX)}function gX(){var e,t,n,r=[],i=[];for(QY.sort(tX);e=QY.shift();)e.__d&&(n=QY.length,t=pX(e,r,i)||t,n===0||QY.length>n?(EX(r,t,i),i.length=r.length=0,t=void 0,QY.sort(tX)):t&&XY.__c&&XY.__c(t,rX));t&&EX(r,t,i),gX.__r=0}function _X(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g=r&&r.__k||rX,_=t.length;for(n.__d=c,vX(n,t,g),c=n.__d,d=0;d<_;d++)(p=n.__k[d])!=null&&typeof p!=`boolean`&&typeof p!=`function`&&(f=p.__i===-1?nX:g[p.__i]||nX,p.__i=d,TX(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&OX(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),65536&p.__u||f.__k===p.__k?c=yX(p,c,e):typeof p.type==`function`&&p.__d!==void 0?c=p.__d:m&&(c=m.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=h}function vX(e,t,n){var r,i,a,o,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)(i=e.__k[r]=(i=t[r])==null||typeof i==`boolean`||typeof i==`function`?null:typeof i==`string`||typeof i==`number`||typeof i==`bigint`||i.constructor==String?lX(null,i,null,null,i):aX(i)?lX(uX,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?lX(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)==null?(a=n[r])&&a.key==null&&a.__e&&(a.__e==e.__d&&(e.__d=fX(a)),kX(a,a,!1),n[r]=null,u--):(i.__=e,i.__b=e.__b+1,s=bX(i,n,o=r+d,u),i.__i=s,a=null,s!==-1&&(u--,(a=n[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!=`function`&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?u>c-o?d+=s-o:d--:d=s<o&&s==o-1?s-o:0,s!==r+d&&(i.__u|=65536)));if(u)for(r=0;r<l;r++)(a=n[r])!=null&&!(131072&a.__u)&&(a.__e==e.__d&&(e.__d=fX(a)),kX(a,a))}function yX(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=yX(r[i],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType===8);return t}function bX(e,t,n,r){var i=e.key,a=e.type,o=n-1,s=n+1,c=t[n];if(c===null||c&&i==c.key&&a===c.type)return n;if(r>+(c!=null&&!(131072&c.__u)))for(;o>=0||s<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&a===c.type)return o;o--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&i==c.key&&a===c.type)return s;s++}}return-1}function xX(e,t,n){t[0]===`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||iX.test(t)?n:n+`px`}function SX(e,t,n,r,i){var a;n:if(t===`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||xX(e.style,t,``);if(n)for(t in n)r&&n[t]===r[t]||xX(e.style,t,n[t])}else if(t[0]===`o`&&t[1]===`n`)a=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,`$1`)),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,a?wX:CX,a)):e.removeEventListener(t,a?wX:CX,a);else{if(i)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!==`width`&&t!==`height`&&t!==`href`&&t!==`list`&&t!==`form`&&t!==`tabIndex`&&t!==`download`&&t!==`rowSpan`&&t!==`colSpan`&&t!==`role`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!==`-`?e.removeAttribute(t):e.setAttribute(t,n))}}function CX(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(XY.event?XY.event(e):e)}}function wX(e){if(this.l)return this.l[e.type+!0](XY.event?XY.event(e):e)}function TX(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=XY.__b)&&u(t);n:if(typeof T==`function`)try{if(_=t.props,v=(u=T.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(`prototype`in T&&T.prototype.render?t.__c=d=new T(_,y):(t.__c=d=new dX(_,y),d.constructor=T,d.render=AX),v&&v.sub(d),d.props=_,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),d.__s??(d.__s=d.state),T.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=oX({},d.__s)),oX(d.__s,T.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)T.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(T.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,y),!d.__e&&(d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break n}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,y),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,h)})}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,x=XY.__r,S=0,`prototype`in T&&T.prototype.render){for(d.state=d.__s,d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do d.__d=!1,x&&x(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=oX(oX({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(h=d.getSnapshotBeforeUpdate(p,m)),_X(e,aX(w=u!=null&&u.type===uX&&u.key==null?u.props.children:u)?w:[w],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,c||a!=null?(t.__e=s,t.__u|=c?160:32,a[a.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),XY.__e(e,t,n)}else a==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=DX(n.__e,t,n,r,i,a,o,c,l);(u=XY.diffed)&&u(t)}function EX(e,t,n){for(var r=0;r<n.length;r++)OX(n[r],n[++r],n[++r]);XY.__c&&XY.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){XY.__e(e,t.__v)}})}function DX(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props,_=t.props,v=t.type;if(v===`svg`&&(i=!0),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName===v:p.nodeType===3)){e=p,a[l]=null;break}}if(e==null){if(v===null)return document.createTextNode(_);e=i?document.createElementNS(`http://www.w3.org/2000/svg`,v):document.createElement(v,_.is&&_),a=null,s=!1}if(v===null)g===_||s&&e.data===_||(e.data=_);else{if(a&&=YY.call(e.childNodes),g=n.props||nX,!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`children`||(l==`dangerouslySetInnerHTML`?d=p:l===`key`||l in _||SX(e,l,null,p,i));for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:l===`key`||s&&typeof p!=`function`||g[l]===p||SX(e,l,p,g[l],i);if(u)s||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),_X(e,aX(f)?f:[f],t,n,r,i&&v!==`foreignObject`,a,o,a?a[0]:n.__k&&fX(n,0),s,c),a!=null)for(l=a.length;l--;)a[l]!=null&&sX(a[l]);s||(l=`value`,m!==void 0&&(m!==e[l]||v===`progress`&&!m||v===`option`&&m!==g[l])&&SX(e,l,m,g[l],!1),l=`checked`,h!==void 0&&h!==e[l]&&SX(e,l,h,g[l],!1))}return e}function OX(e,t,n){try{typeof e==`function`?e(t):e.current=t}catch(e){XY.__e(e,n)}}function kX(e,t,n){var r,i;if(XY.unmount&&XY.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||OX(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){XY.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&kX(r[i],t,n||typeof e.type!=`function`);n||e.__e==null||sX(e.__e),e.__=e.__e=e.__d=void 0}function AX(e,t,n){return this.constructor(e,n)}function jX(e,t,n){var r,i,a,o;XY.__&&XY.__(e,t),i=(r=!1)?null:t.__k,a=[],o=[],TX(t,e=t.__k=cX(uX,null,[e]),i||nX,nX,t.ownerSVGElement!==void 0,i?null:t.firstChild?YY.call(t.childNodes):null,a,i?i.__e:t.firstChild,r,o),e.__d=void 0,EX(a,e,o)}YY=rX.slice,XY={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},ZY=0,dX.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=oX({},this.state);typeof e==`function`&&(e=e(oX({},n),this.props)),e&&oX(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),hX(this))},dX.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),hX(this))},dX.prototype.render=uX,QY=[],eX=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,tX=function(e,t){return e.__v.__b-t.__v.__b},gX.__r=0;var MX,NX,PX,FX,IX=0,LX=[],RX=[],zX=XY,BX=zX.__b,VX=zX.__r,HX=zX.diffed,UX=zX.__c,WX=zX.unmount,GX=zX.__;function KX(e,t){zX.__h&&zX.__h(NX,e,IX||t),IX=0;var n=NX.__H||(NX.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:RX}),n.__[e]}function qX(e){return IX=1,JX(dZ,e)}function JX(e,t,n){var r=KX(MX++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):dZ(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=NX,!NX.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=!1;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&r.__c.props===e)&&(!a||a.call(this,e,t,n))};NX.u=!0;var a=NX.shouldComponentUpdate,o=NX.componentWillUpdate;NX.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},NX.shouldComponentUpdate=i}return r.__N||r.__}function YX(e,t){var n=KX(MX++,3);!zX.__s&&uZ(n.__H,t)&&(n.__=e,n.i=t,NX.__H.__h.push(n))}function XX(e,t){var n=KX(MX++,4);!zX.__s&&uZ(n.__H,t)&&(n.__=e,n.i=t,NX.__h.push(n))}function ZX(e){return IX=5,$X(function(){return{current:e}},[])}function QX(e,t,n){IX=6,XX(function(){return typeof e==`function`?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function $X(e,t){var n=KX(MX++,7);return uZ(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function eZ(e,t){return IX=8,$X(function(){return e},t)}function tZ(e){var t=NX.context[e.__c],n=KX(MX++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(NX)),t.props.value):e.__}function nZ(e,t){zX.useDebugValue&&zX.useDebugValue(t?t(e):e)}function rZ(e){var t=KX(MX++,10),n=qX();return t.__=e,NX.componentDidCatch||(NX.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function iZ(){var e=KX(MX++,11);if(!e.__){for(var t=NX.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__=`P`+n[0]+`-`+n[1]++}return e.__}function aZ(){for(var e;e=LX.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(cZ),e.__H.__h.forEach(lZ),e.__H.__h=[]}catch(t){e.__H.__h=[],zX.__e(t,e.__v)}}zX.__b=function(e){NX=null,BX&&BX(e)},zX.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),GX&&GX(e,t)},zX.__r=function(e){VX&&VX(e),MX=0;var t=(NX=e.__c).__H;t&&(PX===NX?(t.__h=[],NX.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=RX,e.__N=e.i=void 0})):(t.__h.forEach(cZ),t.__h.forEach(lZ),t.__h=[],MX=0)),PX=NX},zX.diffed=function(e){HX&&HX(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(LX.push(t)!==1&&FX===zX.requestAnimationFrame||((FX=zX.requestAnimationFrame)||sZ)(aZ)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==RX&&(e.__=e.__V),e.i=void 0,e.__V=RX})),PX=NX=null},zX.__c=function(e,t){t.some(function(e){try{e.__h.forEach(cZ),e.__h=e.__h.filter(function(e){return!e.__||lZ(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],zX.__e(n,e.__v)}}),UX&&UX(e,t)},zX.unmount=function(e){WX&&WX(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{cZ(e)}catch(e){t=e}}),n.__H=void 0,t&&zX.__e(t,n.__v))};var oZ=typeof requestAnimationFrame==`function`;function sZ(e){var t,n=function(){clearTimeout(r),oZ&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);oZ&&(t=requestAnimationFrame(n))}function cZ(e){var t=NX,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),NX=t}function lZ(e){var t=NX;e.__c=e.__(),NX=t}function uZ(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function dZ(e,t){return typeof t==`function`?t(e):t}var fZ=Object.defineProperty({__proto__:null,useCallback:eZ,useContext:tZ,useDebugValue:nZ,useEffect:YX,useErrorBoundary:rZ,useId:iZ,useImperativeHandle:QX,useLayoutEffect:XX,useMemo:$X,useReducer:JX,useRef:ZX,useState:qX},Symbol.toStringTag,{value:`Module`}),pZ=`http://www.w3.org/2000/svg`;function mZ(){let e=e=>tY.createElementNS(pZ,e),t=LY(e(`svg`),{width:`32`,height:`30`,viewBox:`0 0 72 66`,fill:`inherit`}),n=LY(e(`path`),{transform:`translate(11, 11)`,d:`M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z`});return t.appendChild(n),t}function hZ({options:e}){let t=$X(()=>({__html:mZ().outerHTML}),[]);return cX(`h2`,{class:`dialog__header`},cX(`span`,{class:`dialog__title`},e.formTitle),e.showBranding?cX(`a`,{class:`brand-link`,target:`_blank`,href:`https://sentry.io/welcome/`,title:`Powered by Sentry`,rel:`noopener noreferrer`,dangerouslySetInnerHTML:t}):null)}function gZ(e,t){let n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function _Z(e,t){let n=e.get(t);return typeof n==`string`?n.trim():``}function vZ({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:i,onSubmitSuccess:a,onSubmitError:o,showEmail:s,showName:c,screenshotInput:l}){let{tags:u,addScreenshotButtonLabel:d,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:m,emailPlaceholder:h,isEmailRequired:g,isNameRequired:_,messageLabel:v,messagePlaceholder:y,nameLabel:b,namePlaceholder:x,submitButtonLabel:S,isRequiredLabel:C}=e,[w,T]=qX(!1),[ee,E]=qX(null),[te,ne]=qX(!1),re=l?.input,[ie,ae]=qX(null),oe=eZ(e=>{ae(e),ne(!1)},[]),D=eZ(e=>{let t=gZ(e,{emailLabel:m,isEmailRequired:g,isNameRequired:_,messageLabel:v,nameLabel:b});return t.length>0?E(`Please enter in the following required fields: ${t.join(`, `)}`):E(null),t.length===0},[m,g,_,v,b]);return cX(`form`,{class:`form`,onSubmit:eZ(async e=>{T(!0);try{if(e.preventDefault(),!(e.target instanceof HTMLFormElement))return;let t=new FormData(e.target),n=await(l&&te?l.value():void 0),r={name:_Z(t,`name`),email:_Z(t,`email`),message:_Z(t,`message`),attachments:n?[n]:void 0};if(!D(r))return;try{a(r,await i({name:r.name,email:r.email,message:r.message,source:EY,tags:u},{attachments:r.attachments}))}catch(e){NY&&K.error(e);let t=e instanceof Error?e:Error(String(e));E(t.message),o(t)}}finally{T(!1)}},[l&&te,a,o])},re&&te?cX(re,{onError:oe}):null,cX(`fieldset`,{class:`form__right`,"data-sentry-feedback":!0,disabled:w},cX(`div`,{class:`form__top`},ee?cX(`div`,{class:`form__error-container`},ee):null,c?cX(`label`,{for:`name`,class:`form__label`},cX(yZ,{label:b,isRequiredLabel:C,isRequired:_}),cX(`input`,{class:`form__input`,defaultValue:n,id:`name`,name:`name`,placeholder:x,required:_,type:`text`})):cX(`input`,{"aria-hidden":!0,value:n,name:`name`,type:`hidden`}),s?cX(`label`,{for:`email`,class:`form__label`},cX(yZ,{label:m,isRequiredLabel:C,isRequired:g}),cX(`input`,{class:`form__input`,defaultValue:t,id:`email`,name:`email`,placeholder:h,required:g,type:`email`})):cX(`input`,{"aria-hidden":!0,value:t,name:`email`,type:`hidden`}),cX(`label`,{for:`message`,class:`form__label`},cX(yZ,{label:v,isRequiredLabel:C,isRequired:!0}),cX(`textarea`,{autoFocus:!0,class:`form__input form__input--textarea`,id:`message`,name:`message`,placeholder:y,required:!0,rows:5})),re?cX(`label`,{for:`screenshot`,class:`form__label`},cX(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:()=>{ae(null),ne(e=>!e)}},te?f:d),ie?cX(`div`,{class:`form__error-container`},ie.message):null):null),cX(`div`,{class:`btn-group`},cX(`button`,{class:`btn btn--primary`,disabled:w,type:`submit`},S),cX(`button`,{class:`btn btn--default`,disabled:w,type:`button`,onClick:r},p))))}function yZ({label:e,isRequired:t,isRequiredLabel:n}){return cX(`span`,{class:`form__label__text`},e,t&&cX(`span`,{class:`form__label__text--required`},n))}var bZ=16,xZ=17,SZ=`http://www.w3.org/2000/svg`;function CZ(){let e=e=>eY.document.createElementNS(SZ,e),t=LY(e(`svg`),{width:`${bZ}`,height:`${xZ}`,viewBox:`0 0 ${bZ} ${xZ}`,fill:`inherit`}),n=LY(e(`g`),{clipPath:`url(#clip0_57_156)`}),r=LY(e(`path`),{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z`}),i=LY(e(`path`),{d:`M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z`});t.appendChild(n).append(i,r);let a=e(`defs`),o=LY(e(`clipPath`),{id:`clip0_57_156`}),s=LY(e(`rect`),{width:`${bZ}`,height:`${bZ}`,fill:`white`,transform:`translate(0 0.5)`});return o.appendChild(s),a.appendChild(o),t.appendChild(a).appendChild(o).appendChild(s),t}function wZ({open:e,onFormSubmitted:t,...n}){let r=n.options,i=$X(()=>({__html:CZ().outerHTML}),[]),[a,o]=qX(null),s=eZ(()=>{a&&(clearTimeout(a),o(null)),t()},[a]),c=eZ((e,r)=>{n.onSubmitSuccess(e,r),o(setTimeout(()=>{t(),o(null)},OY))},[t]);return cX(uX,null,a?cX(`div`,{class:`success__position`,onClick:s},cX(`div`,{class:`success__content`},r.successMessageText,cX(`span`,{class:`success__icon`,dangerouslySetInnerHTML:i}))):cX(`dialog`,{class:`dialog`,onClick:r.onFormClose,open:e},cX(`div`,{class:`dialog__position`},cX(`div`,{class:`dialog__content`,onClick:e=>{e.stopPropagation()}},cX(hZ,{options:r}),cX(vZ,{...n,onSubmitSuccess:c})))))}var TZ=`
|
|
611
|
-
.dialog {
|
|
612
|
-
position: fixed;
|
|
613
|
-
z-index: var(--z-index);
|
|
614
|
-
margin: 0;
|
|
615
|
-
inset: 0;
|
|
616
|
-
|
|
617
|
-
display: flex;
|
|
618
|
-
align-items: center;
|
|
619
|
-
justify-content: center;
|
|
620
|
-
padding: 0;
|
|
621
|
-
height: 100vh;
|
|
622
|
-
width: 100vw;
|
|
623
|
-
|
|
624
|
-
color: var(--dialog-color, var(--foreground));
|
|
625
|
-
fill: var(--dialog-color, var(--foreground));
|
|
626
|
-
line-height: 1.75em;
|
|
627
|
-
|
|
628
|
-
background-color: rgba(0, 0, 0, 0.05);
|
|
629
|
-
border: none;
|
|
630
|
-
inset: 0;
|
|
631
|
-
opacity: 1;
|
|
632
|
-
transition: opacity 0.2s ease-in-out;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
.dialog__position {
|
|
636
|
-
position: fixed;
|
|
637
|
-
z-index: var(--z-index);
|
|
638
|
-
inset: var(--dialog-inset);
|
|
639
|
-
padding: var(--page-margin);
|
|
640
|
-
display: flex;
|
|
641
|
-
max-height: calc(100vh - (2 * var(--page-margin)));
|
|
642
|
-
}
|
|
643
|
-
@media (max-width: 600px) {
|
|
644
|
-
.dialog__position {
|
|
645
|
-
inset: var(--page-margin);
|
|
646
|
-
padding: 0;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
.dialog__position:has(.editor) {
|
|
651
|
-
inset: var(--page-margin);
|
|
652
|
-
padding: 0;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
.dialog:not([open]) {
|
|
656
|
-
opacity: 0;
|
|
657
|
-
pointer-events: none;
|
|
658
|
-
visibility: hidden;
|
|
659
|
-
}
|
|
660
|
-
.dialog:not([open]) .dialog__content {
|
|
661
|
-
transform: translate(0, -16px) scale(0.98);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
.dialog__content {
|
|
665
|
-
display: flex;
|
|
666
|
-
flex-direction: column;
|
|
667
|
-
gap: 16px;
|
|
668
|
-
padding: var(--dialog-padding, 24px);
|
|
669
|
-
max-width: 100%;
|
|
670
|
-
width: 100%;
|
|
671
|
-
max-height: 100%;
|
|
672
|
-
overflow: auto;
|
|
673
|
-
|
|
674
|
-
background: var(--dialog-background, var(--background));
|
|
675
|
-
border-radius: var(--dialog-border-radius, 20px);
|
|
676
|
-
border: var(--dialog-border, var(--border));
|
|
677
|
-
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
|
|
678
|
-
transform: translate(0, 0) scale(1);
|
|
679
|
-
transition: transform 0.2s ease-in-out;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
`,EZ=`
|
|
683
|
-
.dialog__header {
|
|
684
|
-
display: flex;
|
|
685
|
-
gap: 4px;
|
|
686
|
-
justify-content: space-between;
|
|
687
|
-
font-weight: var(--dialog-header-weight, 600);
|
|
688
|
-
margin: 0;
|
|
689
|
-
}
|
|
690
|
-
.dialog__title {
|
|
691
|
-
align-self: center;
|
|
692
|
-
width: var(--form-width, 272px);
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
@media (max-width: 600px) {
|
|
696
|
-
.dialog__title {
|
|
697
|
-
width: auto;
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
.dialog__position:has(.editor) .dialog__title {
|
|
702
|
-
width: auto;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
.brand-link {
|
|
707
|
-
display: inline-flex;
|
|
708
|
-
}
|
|
709
|
-
.brand-link:focus-visible {
|
|
710
|
-
outline: var(--outline);
|
|
711
|
-
}
|
|
712
|
-
`,DZ=`
|
|
713
|
-
.form {
|
|
714
|
-
display: flex;
|
|
715
|
-
overflow: auto;
|
|
716
|
-
flex-direction: row;
|
|
717
|
-
gap: 16px;
|
|
718
|
-
flex: 1 0;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
.form fieldset {
|
|
722
|
-
border: none;
|
|
723
|
-
margin: 0;
|
|
724
|
-
padding: 0;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
.form__right {
|
|
728
|
-
flex: 0 0 auto;
|
|
729
|
-
display: flex;
|
|
730
|
-
overflow: auto;
|
|
731
|
-
flex-direction: column;
|
|
732
|
-
justify-content: space-between;
|
|
733
|
-
gap: 20px;
|
|
734
|
-
width: var(--form-width, 100%);
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
.dialog__position:has(.editor) .form__right {
|
|
738
|
-
width: var(--form-width, 272px);
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
.form__top {
|
|
742
|
-
display: flex;
|
|
743
|
-
flex-direction: column;
|
|
744
|
-
gap: 8px;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
.form__error-container {
|
|
748
|
-
color: var(--error-color);
|
|
749
|
-
fill: var(--error-color);
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
.form__label {
|
|
753
|
-
display: flex;
|
|
754
|
-
flex-direction: column;
|
|
755
|
-
gap: 4px;
|
|
756
|
-
margin: 0px;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
.form__label__text {
|
|
760
|
-
display: flex;
|
|
761
|
-
gap: 4px;
|
|
762
|
-
align-items: center;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
.form__label__text--required {
|
|
766
|
-
font-size: 0.85em;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
.form__input {
|
|
770
|
-
font-family: inherit;
|
|
771
|
-
line-height: inherit;
|
|
772
|
-
background: transparent;
|
|
773
|
-
box-sizing: border-box;
|
|
774
|
-
border: var(--input-border, var(--border));
|
|
775
|
-
border-radius: var(--input-border-radius, 6px);
|
|
776
|
-
color: var(--input-color, inherit);
|
|
777
|
-
fill: var(--input-color, inherit);
|
|
778
|
-
font-size: var(--input-font-size, inherit);
|
|
779
|
-
font-weight: var(--input-font-weight, 500);
|
|
780
|
-
padding: 6px 12px;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
.form__input::placeholder {
|
|
784
|
-
opacity: 0.65;
|
|
785
|
-
color: var(--input-placeholder-color, inherit);
|
|
786
|
-
filter: var(--interactive-filter);
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
.form__input:focus-visible {
|
|
790
|
-
outline: var(--input-focus-outline, var(--outline));
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
.form__input--textarea {
|
|
794
|
-
font-family: inherit;
|
|
795
|
-
resize: vertical;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
.error {
|
|
799
|
-
color: var(--error-color);
|
|
800
|
-
fill: var(--error-color);
|
|
801
|
-
}
|
|
802
|
-
`,OZ=`
|
|
803
|
-
.btn-group {
|
|
804
|
-
display: grid;
|
|
805
|
-
gap: 8px;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
.btn {
|
|
809
|
-
line-height: inherit;
|
|
810
|
-
border: var(--button-border, var(--border));
|
|
811
|
-
border-radius: var(--button-border-radius, 6px);
|
|
812
|
-
cursor: pointer;
|
|
813
|
-
font-family: inherit;
|
|
814
|
-
font-size: var(--button-font-size, inherit);
|
|
815
|
-
font-weight: var(--button-font-weight, 600);
|
|
816
|
-
padding: var(--button-padding, 6px 16px);
|
|
817
|
-
}
|
|
818
|
-
.btn[disabled] {
|
|
819
|
-
opacity: 0.6;
|
|
820
|
-
pointer-events: none;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
.btn--primary {
|
|
824
|
-
color: var(--button-primary-color, var(--accent-foreground));
|
|
825
|
-
fill: var(--button-primary-color, var(--accent-foreground));
|
|
826
|
-
background: var(--button-primary-background, var(--accent-background));
|
|
827
|
-
border: var(--button-primary-border, var(--border));
|
|
828
|
-
border-radius: var(--button-primary-border-radius, 6px);
|
|
829
|
-
font-weight: var(--button-primary-font-weight, 500);
|
|
830
|
-
}
|
|
831
|
-
.btn--primary:hover {
|
|
832
|
-
color: var(--button-primary-hover-color, var(--accent-foreground));
|
|
833
|
-
fill: var(--button-primary-hover-color, var(--accent-foreground));
|
|
834
|
-
background: var(--button-primary-hover-background, var(--accent-background));
|
|
835
|
-
filter: var(--interactive-filter);
|
|
836
|
-
}
|
|
837
|
-
.btn--primary:focus-visible {
|
|
838
|
-
background: var(--button-primary-hover-background, var(--accent-background));
|
|
839
|
-
filter: var(--interactive-filter);
|
|
840
|
-
outline: var(--button-primary-focus-outline, var(--outline));
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
.btn--default {
|
|
844
|
-
color: var(--button-color, var(--foreground));
|
|
845
|
-
fill: var(--button-color, var(--foreground));
|
|
846
|
-
background: var(--button-background, var(--background));
|
|
847
|
-
border: var(--button-border, var(--border));
|
|
848
|
-
border-radius: var(--button-border-radius, 6px);
|
|
849
|
-
font-weight: var(--button-font-weight, 500);
|
|
850
|
-
}
|
|
851
|
-
.btn--default:hover {
|
|
852
|
-
color: var(--button-color, var(--foreground));
|
|
853
|
-
fill: var(--button-color, var(--foreground));
|
|
854
|
-
background: var(--button-hover-background, var(--background));
|
|
855
|
-
filter: var(--interactive-filter);
|
|
856
|
-
}
|
|
857
|
-
.btn--default:focus-visible {
|
|
858
|
-
background: var(--button-hover-background, var(--background));
|
|
859
|
-
filter: var(--interactive-filter);
|
|
860
|
-
outline: var(--button-focus-outline, var(--outline));
|
|
861
|
-
}
|
|
862
|
-
`,kZ=`
|
|
863
|
-
.success__position {
|
|
864
|
-
position: fixed;
|
|
865
|
-
inset: var(--dialog-inset);
|
|
866
|
-
padding: var(--page-margin);
|
|
867
|
-
z-index: var(--z-index);
|
|
868
|
-
}
|
|
869
|
-
.success__content {
|
|
870
|
-
background: var(--success-background, var(--background));
|
|
871
|
-
border: var(--success-border, var(--border));
|
|
872
|
-
border-radius: var(--success-border-radius, 1.7em/50%);
|
|
873
|
-
box-shadow: var(--success-box-shadow, var(--box-shadow));
|
|
874
|
-
font-weight: var(--success-font-weight, 600);
|
|
875
|
-
color: var(--success-color);
|
|
876
|
-
fill: var(--success-color);
|
|
877
|
-
padding: 12px 24px;
|
|
878
|
-
line-height: 1.75em;
|
|
879
|
-
|
|
880
|
-
display: grid;
|
|
881
|
-
align-items: center;
|
|
882
|
-
grid-auto-flow: column;
|
|
883
|
-
gap: 6px;
|
|
884
|
-
cursor: default;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
.success__icon {
|
|
888
|
-
display: flex;
|
|
889
|
-
}
|
|
890
|
-
`;function AZ(e){let t=tY.createElement(`style`);return t.textContent=`
|
|
891
|
-
:host {
|
|
892
|
-
--dialog-inset: var(--inset);
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
${TZ}
|
|
896
|
-
${EZ}
|
|
897
|
-
${DZ}
|
|
898
|
-
${OZ}
|
|
899
|
-
${kZ}
|
|
900
|
-
`,e&&t.setAttribute(`nonce`,e),t}function jZ(){let e=q().getUser(),t=kF().getUser(),n=AF().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}var MZ=(()=>({name:`FeedbackModal`,setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{let i=r,a=e.useSentryUser,o=jZ(),s=tY.createElement(`div`),c=AZ(e.styleNonce),l=``,u={get el(){return s},appendToDom(){!i.contains(c)&&!i.contains(s)&&(i.appendChild(c),i.appendChild(s))},removeFromDom(){s.remove(),c.remove(),tY.body.style.overflow=l},open(){f(!0),e.onFormOpen?.(),J()?.emit(`openFeedbackWidget`),l=tY.body.style.overflow,tY.body.style.overflow=`hidden`},close(){f(!1),tY.body.style.overflow=l}},d=t?.createInput({h:cX,hooks:fZ,dialog:u,options:e}),f=t=>{jX(cX(wZ,{options:e,screenshotInput:d,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(a&&o?.[a.name]||``),defaultEmail:String(a&&o?.[a.email]||``),onFormClose:()=>{f(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(t,n)=>{f(!1),e.onSubmitSuccess?.(t,n)},onSubmitError:t=>{e.onSubmitError?.(t)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:t}),s)};return u}}));function NZ({h:e}){return function(){return e(`svg`,{"data-test-id":`icon-close`,viewBox:`0 0 16 16`,fill:`#2B2233`,height:`25px`,width:`25px`},e(`circle`,{r:`7`,cx:`8`,cy:`8`,fill:`white`}),e(`path`,{strokeWidth:`1.5`,d:`M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z`}),e(`path`,{strokeWidth:`1.5`,d:`M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z`}),e(`path`,{strokeWidth:`1.5`,d:`M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z`}))}}function PZ(e){let t=tY.createElement(`style`),n=`#1A141F`,r=`#302735`;return t.textContent=`
|
|
901
|
-
.editor {
|
|
902
|
-
display: flex;
|
|
903
|
-
flex-grow: 1;
|
|
904
|
-
flex-direction: column;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
.editor__image-container {
|
|
908
|
-
justify-items: center;
|
|
909
|
-
padding: 15px;
|
|
910
|
-
position: relative;
|
|
911
|
-
height: 100%;
|
|
912
|
-
border-radius: var(--menu-border-radius, 6px);
|
|
913
|
-
|
|
914
|
-
background-color: ${n};
|
|
915
|
-
background-image: repeating-linear-gradient(
|
|
916
|
-
-145deg,
|
|
917
|
-
transparent,
|
|
918
|
-
transparent 8px,
|
|
919
|
-
${n} 8px,
|
|
920
|
-
${n} 11px
|
|
921
|
-
),
|
|
922
|
-
repeating-linear-gradient(
|
|
923
|
-
-45deg,
|
|
924
|
-
transparent,
|
|
925
|
-
transparent 15px,
|
|
926
|
-
${r} 15px,
|
|
927
|
-
${r} 16px
|
|
928
|
-
);
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
.editor__canvas-container {
|
|
932
|
-
width: 100%;
|
|
933
|
-
height: 100%;
|
|
934
|
-
position: relative;
|
|
935
|
-
display: flex;
|
|
936
|
-
align-items: center;
|
|
937
|
-
justify-content: center;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
.editor__canvas-container > * {
|
|
941
|
-
object-fit: contain;
|
|
942
|
-
position: absolute;
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
.editor__tool-container {
|
|
946
|
-
padding-top: 8px;
|
|
947
|
-
display: flex;
|
|
948
|
-
justify-content: center;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
.editor__tool-bar {
|
|
952
|
-
display: flex;
|
|
953
|
-
gap: 8px;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
.editor__tool {
|
|
957
|
-
display: flex;
|
|
958
|
-
padding: 8px 12px;
|
|
959
|
-
justify-content: center;
|
|
960
|
-
align-items: center;
|
|
961
|
-
border: var(--button-border, var(--border));
|
|
962
|
-
border-radius: var(--button-border-radius, 6px);
|
|
963
|
-
background: var(--button-background, var(--background));
|
|
964
|
-
color: var(--button-color, var(--foreground));
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
.editor__tool--active {
|
|
968
|
-
background: var(--button-primary-background, var(--accent-background));
|
|
969
|
-
color: var(--button-primary-color, var(--accent-foreground));
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
.editor__rect {
|
|
973
|
-
position: absolute;
|
|
974
|
-
z-index: 2;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
.editor__rect button {
|
|
978
|
-
opacity: 0;
|
|
979
|
-
position: absolute;
|
|
980
|
-
top: -12px;
|
|
981
|
-
right: -12px;
|
|
982
|
-
cursor: pointer;
|
|
983
|
-
padding: 0;
|
|
984
|
-
z-index: 3;
|
|
985
|
-
border: none;
|
|
986
|
-
background: none;
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
.editor__rect:hover button {
|
|
990
|
-
opacity: 1;
|
|
991
|
-
}
|
|
992
|
-
`,e&&t.setAttribute(`nonce`,e),t}function FZ({h:e}){return function({action:t,setAction:n,options:r}){return e(`div`,{class:`editor__tool-container`},e(`div`,{class:`editor__tool-bar`},e(`button`,{type:`button`,class:`editor__tool ${t===`highlight`?`editor__tool--active`:``}`,onClick:()=>{n(t===`highlight`?``:`highlight`)}},r.highlightToolText),e(`button`,{type:`button`,class:`editor__tool ${t===`hide`?`editor__tool--active`:``}`,onClick:()=>{n(t===`hide`?``:`hide`)}},r.hideToolText)))}}function IZ({hooks:e}){function t(){let[t,n]=e.useState(eY.devicePixelRatio??1);return e.useEffect(()=>{let e=()=>{n(eY.devicePixelRatio)},t=matchMedia(`(resolution: ${eY.devicePixelRatio}dppx)`);return t.addEventListener(`change`,e),()=>{t.removeEventListener(`change`,e)}},[]),t}return function({onBeforeScreenshot:n,onScreenshot:r,onAfterScreenshot:i,onError:a}){let o=t();e.useEffect(()=>{(async()=>{n();let e=await nY.mediaDevices.getDisplayMedia({video:{width:eY.innerWidth*o,height:eY.innerHeight*o},audio:!1,monitorTypeSurfaces:`exclude`,preferCurrentTab:!0,selfBrowserSurface:`include`,surfaceSwitching:`exclude`}),t=tY.createElement(`video`);await new Promise((n,i)=>{t.srcObject=e,t.onloadedmetadata=()=>{r(t,o),e.getTracks().forEach(e=>e.stop()),n()},t.play().catch(i)}),i()})().catch(a)},[])}}function LZ(e,t,n){switch(e.type){case`highlight`:t.shadowColor=`rgba(0, 0, 0, 0.7)`,t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break;case`hide`:t.fillStyle=`rgb(0, 0, 0)`,t.fillRect(e.x,e.y,e.w,e.h)}}function RZ(e,t,n){if(!e)return;let r=e.getContext(`2d`,t);r&&n(e,r)}function zZ(e,t){RZ(e,{alpha:!0},(e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)})}function BZ(e,t,n){RZ(e,{alpha:!0},(e,r)=>{n.length&&(r.fillStyle=`rgba(0, 0, 0, 0.25)`,r.fillRect(0,0,e.width,e.height)),n.forEach(e=>{LZ(e,r,t)})})}function VZ({h:e,hooks:t,outputBuffer:n,dialog:r,options:i}){let a=IZ({hooks:t}),o=FZ({h:e}),s=NZ({h:e}),c={__html:PZ(i.styleNonce).innerText},l=r.el.style,u=({screenshot:r})=>{let[a,l]=t.useState(`highlight`),[u,d]=t.useState([]),f=t.useRef(null),p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),[g,_]=t.useState(1),v=t.useMemo(()=>{let e=tY.getElementById(i.id);if(!e)return`white`;let t=getComputedStyle(e);return t.getPropertyValue(`--button-primary-background`)||t.getPropertyValue(`--accent-background`)},[i.id]);t.useLayoutEffect(()=>{let e=()=>{let t=f.current;t&&(RZ(r.canvas,{alpha:!1},e=>{let n=Math.min(t.clientWidth/e.width,t.clientHeight/e.height);_(n)}),(t.clientHeight===0||t.clientWidth===0)&&setTimeout(e,0))};return e(),eY.addEventListener(`resize`,e),()=>{eY.removeEventListener(`resize`,e)}},[r]);let y=t.useCallback((e,t)=>{RZ(e,{alpha:!0},(e,n)=>{n.scale(t,t),e.width=r.canvas.width,e.height=r.canvas.height})},[r]);t.useEffect(()=>{y(p.current,r.dpi),zZ(p.current,r.canvas)},[r]),t.useEffect(()=>{y(m.current,r.dpi),RZ(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),BZ(m.current,v,u)},[u,v]),t.useEffect(()=>{y(n,r.dpi),zZ(n,r.canvas),RZ(tY.createElement(`canvas`),{alpha:!0},(e,t)=>{t.scale(r.dpi,r.dpi),e.width=r.canvas.width,e.height=r.canvas.height,BZ(e,v,u),zZ(n,e)})},[u,r,v]);let b=e=>{if(!a||!h.current)return;let t=h.current.getBoundingClientRect(),n={type:a,x:e.offsetX/g,y:e.offsetY/g},r=(e,n)=>{let r=(n.clientX-t.x)/g,i=(n.clientY-t.y)/g;return{type:e.type,x:Math.min(e.x,r),y:Math.min(e.y,i),w:Math.abs(r-e.x),h:Math.abs(i-e.y)}},i=e=>{RZ(m.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),BZ(m.current,v,[...u,r(n,e)])},o=e=>{let t=r(n,e);t.w*g>=1&&t.h*g>=1&&d(e=>[...e,t]),tY.removeEventListener(`mousemove`,i),tY.removeEventListener(`mouseup`,o)};tY.addEventListener(`mousemove`,i),tY.addEventListener(`mouseup`,o)},x=t.useCallback(e=>t=>{t.preventDefault(),t.stopPropagation(),d(t=>{let n=[...t];return n.splice(e,1),n})},[]),S={width:`${r.canvas.width*g}px`,height:`${r.canvas.height*g}px`},C=e=>{e.stopPropagation()};return e(`div`,{class:`editor`},e(`style`,{nonce:i.styleNonce,dangerouslySetInnerHTML:c}),e(`div`,{class:`editor__image-container`},e(`div`,{class:`editor__canvas-container`,ref:f},e(`canvas`,{ref:p,id:`background`,style:S}),e(`canvas`,{ref:m,id:`foreground`,style:S}),e(`div`,{ref:h,onMouseDown:b,style:S},u.map((t,n)=>e(`div`,{key:n,class:`editor__rect`,style:{top:`${t.y*g}px`,left:`${t.x*g}px`,width:`${t.w*g}px`,height:`${t.h*g}px`}},e(`button`,{"aria-label":i.removeHighlightText,onClick:x(n),onMouseDown:C,onMouseUp:C,type:`button`},e(s,null))))))),e(o,{options:i,action:a,setAction:l}))};return function({onError:r}){let[i,o]=t.useState();return a({onBeforeScreenshot:t.useCallback(()=>{l.display=`none`},[]),onScreenshot:t.useCallback((e,t)=>{RZ(tY.createElement(`canvas`),{alpha:!1},(n,r)=>{r.scale(t,t),n.width=e.videoWidth,n.height=e.videoHeight,r.drawImage(e,0,0,n.width,n.height),o({canvas:n,dpi:t})}),n.width=e.videoWidth,n.height=e.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{l.display=`block`},[]),onError:t.useCallback(e=>{l.display=`block`,r(e)},[])}),i?e(u,{screenshot:i}):e(`div`,null)}}var HZ=(()=>({name:`FeedbackScreenshot`,setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{let i=tY.createElement(`canvas`);return{input:VZ({h:e,hooks:t,outputBuffer:i,dialog:n,options:r}),value:async()=>{let e=await new Promise(e=>{i.toBlob(e,`image/png`)});if(e)return{data:new Uint8Array(await e.arrayBuffer()),filename:`screenshot.png`,contentType:`application/png`}}}}})),Y=G,UZ=0;function WZ(){return UZ>0}function GZ(){UZ++,setTimeout(()=>{UZ--})}function KZ(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,`__sentry_wrapped__`)){let t=e.__sentry_wrapped__;return typeof t==`function`?t:e}if($N(e))return e}catch{return e}let r=function(...n){G._sentryWrappedDepth=(G._sentryWrappedDepth||0)+1;try{let r=n.map(e=>KZ(e,t));return e.apply(this,r)}catch(e){throw GZ(),jF(r=>{r.addEventProcessor(e=>(t.mechanism&&(PP(e,void 0,void 0),FP(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),zz(e)}),e}finally{G._sentryWrappedDepth=(G._sentryWrappedDepth||0)-1}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}QN(r,e),ZN(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function qZ(){let e=NJ(),{referrer:t}=Y.document||{},{userAgent:n}=Y.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}var JZ=[`replayIntegration`,`replayCanvasIntegration`,`feedbackIntegration`,`feedbackModalIntegration`,`feedbackScreenshotIntegration`,`captureConsoleIntegration`,`contextLinesIntegration`,`linkedErrorsIntegration`,`dedupeIntegration`,`extraErrorDataIntegration`,`graphqlClientIntegration`,`httpClientIntegration`,`reportingObserverIntegration`,`rewriteFramesIntegration`,`browserProfilingIntegration`,`moduleMetadataIntegration`,`instrumentAnthropicAiClient`,`instrumentOpenAiClient`,`instrumentGoogleGenAIClient`,`instrumentLangGraph`,`createLangChainCallbackHandler`,`instrumentLangChainEmbeddings`],YZ={replayCanvasIntegration:`replay-canvas`,feedbackModalIntegration:`feedback-modal`,feedbackScreenshotIntegration:`feedback-screenshot`};function XZ(e){return YZ[e]||e.replace(`Integration`,``).toLowerCase()}var ZZ=Y;async function QZ(e,t){let n=JZ.includes(e)?XZ(e):void 0,r=ZZ.Sentry=ZZ.Sentry||{};if(!n)throw Error(`Cannot lazy load integration: ${e}`);let i=r[e];if(typeof i==`function`&&!(`_isShim`in i))return i;let a=$Z(n),o=Y.document.createElement(`script`);o.src=a,o.crossOrigin=`anonymous`,o.referrerPolicy=`strict-origin`,t&&o.setAttribute(`nonce`,t);let s=new Promise((e,t)=>{o.addEventListener(`load`,()=>e()),o.addEventListener(`error`,t)}),c=Y.document.currentScript,l=Y.document.body||Y.document.head||c?.parentElement;if(l)l.appendChild(o);else throw Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await s}catch{throw Error(`Error when loading integration: ${e}`)}let u=r[e];if(typeof u!=`function`)throw Error(`Could not load integration: ${e}`);return u}function $Z(e){let t=J()?.getOptions()?.cdnBaseUrl||`https://browser.sentry-cdn.com`;return new URL(`/${XM}/${e}.min.js`,t).toString()}var eQ=qY({lazyLoadIntegration:QZ}),tQ=qY({getModalIntegration:()=>MZ,getScreenshotIntegration:()=>HZ});function nQ(e,t){let n=aQ(e,t),r={type:uQ(t),value:dQ(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function rQ(e,t,n,r){let i=J()?.getOptions().normalizeDepth,a=vQ(t),o={__serialized__:hP(t,i)};if(a)return{exception:{values:[nQ(e,a)]},extra:o};let s={exception:{values:[{type:GN(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:gQ(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=aQ(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function iQ(e,t){return{exception:{values:[nQ(e,t)]}}}function aQ(e,t){let n=t.stacktrace||t.stack||``,r=sQ(t),i=cQ(t);try{return e(n,r,i)}catch{}return[]}var oQ=/Minified React error #\d+;/i;function sQ(e){return e&&oQ.test(e.message)?1:0}function cQ(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function lQ(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0&&e instanceof WebAssembly.Exception}function uQ(e){let t=e?.name;return!t&&lQ(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function dQ(e){let t=e?.message;return lQ(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?FH(t.error):FH(e):`No error message`}function fQ(e,t,n,r){let i=mQ(e,t,n?.syntheticException||void 0,r);return FP(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),_z(i)}function pQ(e,t,n=`info`,r,i){let a=hQ(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),_z(a)}function mQ(e,t,n,r,i){let a;if(LN(t)&&t.error)return iQ(e,t.error);if(RN(t)||zN(t)){let i=t;if(`stack`in t){a=iQ(e,t);let i=a.exception?.values?.[0];if(r&&n&&i&&!i.stacktrace){let t=aQ(e,n);t.length&&(i.stacktrace={frames:t},FP(a,{synthetic:!0}))}}else{let t=i.name||(RN(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=hQ(e,o,n,r),PP(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return FN(t)?iQ(e,t):UN(t)||GN(t)?(a=rQ(e,t,n,i),FP(a,{synthetic:!0}),a):(a=hQ(e,t,n,r),PP(a,`${t}`,void 0),FP(a,{synthetic:!0}),a)}function hQ(e,t,n,r){let i={};if(r&&n){let r=aQ(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),FP(i,{synthetic:!0})}if(VN(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function gQ(e,{isUnhandledRejection:t}){let n=nP(e),r=t?`promise rejection`:`exception`;return LN(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:GN(e)?`Event \`${_Q(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function _Q(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function vQ(e){return Object.values(e).find(e=>e instanceof Error)}var yQ=class extends kV{constructor(e){let t=bQ(e);sH(t,`browser`,[`browser`],Y.SENTRY_SDK_SOURCE||EB()),super(t);let{userInfo:n}=this.getDataCollectionOptions();t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:n?`auto`:`never`,...t._metadata.sdk.settings});let{sendClientReports:r}=this._options;Y.document&&Y.document.addEventListener(`visibilitychange`,()=>{Y.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),n&&this.on(`beforeSendSession`,oH)}eventFromException(e,t){return fQ(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return pQ(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function bQ(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:Y.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var xQ=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,SQ=G,CQ=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,wQ=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=CQ(t.value,n),e(t)))}},TQ=(e=!0)=>{let t=SQ.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},EQ=()=>TQ()?.activationStart??0;function DQ(e,t,n){SQ.document&&SQ.addEventListener(e,t,n)}function OQ(e,t,n){SQ.document&&SQ.removeEventListener(e,t,n)}var kQ=-1,AQ=new Set,jQ=()=>SQ.document?.visibilityState===`hidden`&&!SQ.document?.prerendering?0:1/0,MQ=e=>{if(PQ(e)&&kQ>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of AQ)e();isFinite(kQ)||(kQ=e.type===`visibilitychange`?e.timeStamp:0,OQ(`prerenderingchange`,MQ,!0))}},NQ=()=>{if(SQ.document&&kQ<0){let e=EQ();kQ=(SQ.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??jQ(),DQ(`visibilitychange`,MQ,!0),DQ(`pagehide`,MQ,!0),DQ(`prerenderingchange`,MQ,!0)}return{get firstHiddenTime(){return kQ},onHidden(e){AQ.add(e)}}};function PQ(e){return e.type===`pagehide`||SQ.document?.visibilityState===`hidden`}var FQ=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+0xe8d4a51000}`,IQ=(e,t=-1)=>{let n=TQ(),r=`navigate`;return n&&(SQ.document?.prerendering||EQ()>0?r=`prerender`:SQ.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:FQ(),navigationType:r}},LQ=new WeakMap;function RQ(e,t){try{return LQ.get(e)||LQ.set(e,new t),LQ.get(e)}catch{return new t}}var zQ=class{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},BQ=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},VQ=e=>{let t=!1;return()=>{t||=(e(),!0)}},HQ=e=>{SQ.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},UQ=[1800,3e3],WQ=(e,t={})=>{HQ(()=>{let n=NQ(),r=IQ(`FCP`),i,a=BQ(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-EQ(),0),r.entries.push(t),i(!0)))});a&&(i=wQ(e,r,UQ,t.reportAllChanges))})},GQ=[.1,.25],KQ=(e,t={})=>{WQ(VQ(()=>{let n=IQ(`CLS`,0),r,i=NQ(),a=RQ(t,zQ),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=BQ(`layout-shift`,o);s&&(r=wQ(e,n,GQ,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),SQ?.setTimeout?.(r))}))},qQ=0,JQ=1/0,YQ=0,XQ=e=>{e.forEach(e=>{e.interactionId&&(JQ=Math.min(JQ,e.interactionId),YQ=Math.max(YQ,e.interactionId),qQ=YQ?(YQ-JQ)/7+1:0)})},ZQ,QQ=()=>ZQ?qQ:performance.interactionCount||0,$Q=()=>{`interactionCount`in performance||ZQ||(ZQ=BQ(`event`,XQ,{type:`event`,buffered:!0,durationThreshold:0}))},e$=10,t$=0,n$=()=>QQ()-t$,r$=class{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){t$=QQ(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(n$()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<e$||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>e$){let e=this._longestInteractionList.splice(e$);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},i$=e=>{let t=SQ.requestIdleCallback||SQ.setTimeout;SQ.document?.visibilityState===`hidden`?e():(e=VQ(e),DQ(`visibilitychange`,e,{once:!0,capture:!0}),DQ(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),OQ(`visibilitychange`,e,{capture:!0}),OQ(`pagehide`,e,{capture:!0})}))},a$=[200,500],o$=40,s$=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=NQ();HQ(()=>{$Q();let r=IQ(`INP`),i,a=RQ(t,r$),o=e=>{i$(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=BQ(`event`,o,{durationThreshold:t.durationThreshold??o$});i=wQ(e,r,a$,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},c$=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},l$=[2500,4e3],u$=(e,t={})=>{HQ(()=>{let n=NQ(),r=IQ(`LCP`),i,a=RQ(t,c$),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-EQ(),0),r.entries=[t],i())},s=BQ(`largest-contentful-paint`,o);if(s){i=wQ(e,r,l$,t.reportAllChanges);let n=VQ(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(i$(n),OQ(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])DQ(e,a,{capture:!0})}})},d$=[800,1800],f$=e=>{SQ.document?.prerendering?HQ(()=>f$(e)):SQ.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>f$(e),!0)},p$=(e,t={})=>{let n=IQ(`TTFB`),r=wQ(e,n,d$,t.reportAllChanges);f$(()=>{let e=TQ();e&&(n.value=Math.max(e.responseStart-EQ(),0),n.entries=[e],r(!0))})},m$={},h$={},g$,_$,v$,y$;function b$(e,t=!1){return A$(`cls`,e,E$,g$,t)}function x$(e,t=!1){return A$(`lcp`,e,D$,_$,t)}function S$(e){return A$(`ttfb`,e,O$,v$)}function C$(e){return A$(`inp`,e,k$,y$)}function w$(e,t){return M$(e,t),h$[e]||(j$(e),h$[e]=!0),N$(e,t)}function T$(e,t){let n=m$[e];if(n?.length)for(let r of n)try{r(t)}catch(t){xQ&&K.error(`Error while triggering instrumentation handler.
|
|
993
|
-
Type: ${e}
|
|
994
|
-
Name: ${bN(r)}
|
|
995
|
-
Error:`,t)}}function E$(){return KQ(e=>{T$(`cls`,{metric:e}),g$=e},{reportAllChanges:!0})}function D$(){return u$(e=>{T$(`lcp`,{metric:e}),_$=e},{reportAllChanges:!0})}function O$(){return p$(e=>{T$(`ttfb`,{metric:e}),v$=e})}function k$(){return s$(e=>{T$(`inp`,{metric:e}),y$=e})}function A$(e,t,n,r,i=!1){M$(e,t);let a;return h$[e]||(a=n(),h$[e]=!0),r&&t({metric:r}),N$(e,t,i?a:void 0)}function j$(e){let t={};e===`event`&&(t.durationThreshold=0),BQ(e,t=>{T$(e,{entries:t})},t)}function M$(e,t){m$[e]=m$[e]||[],m$[e].push(t)}function N$(e,t,n){return()=>{n&&n();let r=m$[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function P$(e){return`duration`in e}var F$=80,I$={};try{typeof Node<`u`&&(I$.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,`parentNode`).get),typeof Element<`u`&&(I$.tagName=Object.getOwnPropertyDescriptor(Element.prototype,`tagName`).get,I$.id=Object.getOwnPropertyDescriptor(Element.prototype,`id`).get,I$.className=Object.getOwnPropertyDescriptor(Element.prototype,`className`).get,I$.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<`u`&&(I$.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,`dataset`).get)}catch{}function L$(e,t,n){let r=I$[t];if(r)try{return r.call(e,n)}catch{}let i=e[t];return typeof i==`function`?i.call(e,n):i}function R$(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||F$;for(;n&&i++<5&&(o=z$(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=L$(n,`parentNode`);return r.reverse().join(` > `)}catch{return`<unknown>`}}function z$(e,t){let n=[],r=L$(e,`tagName`);if(!r)return``;if(typeof HTMLElement<`u`&&e instanceof HTMLElement){let t=L$(e,`dataset`);if(t){if(t.sentryComponent)return t.sentryComponent;if(t.sentryElement)return t.sentryElement}}n.push(r.toLowerCase());let i=t?.length?t.filter(t=>L$(e,`getAttribute`,t)).map(t=>[t,L$(e,`getAttribute`,t)]):null;if(i?.length)i.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{let t=L$(e,`id`);t&&n.push(`#${t}`);let r=L$(e,`className`);if(r&&BN(r)){let e=r.split(/\s+/);for(let t of e)n.push(`.${t}`)}}for(let t of[`aria-label`,`type`,`name`,`title`,`alt`]){let r=L$(e,`getAttribute`,t);r&&n.push(`[${t}="${r}"]`)}return n.join(``)}var B$=e=>{let t=t=>{(t.type===`pagehide`||SQ.document?.visibilityState===`hidden`)&&e(t)};DQ(`visibilitychange`,t,{capture:!0,once:!0}),DQ(`pagehide`,t,{capture:!0,once:!0})};function V$(e){return typeof e==`number`&&isFinite(e)}function H$(e,t,n,{...r}){let i=KI(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),_R(e,()=>{let e=mR({startTime:t,...r});return e&&e.end(n),e})}function U$(e){let t=J();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=q(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return mR({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":SQ.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function W$(){return SQ.addEventListener&&SQ.performance}function G$(e){return e/1e3}function K$(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function q$(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function J$(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n.spanContext().spanId,n),r=!0}B$(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e,o()})}function Y$(e){let t=0,n;if(!q$(`layout-shift`))return;let r=b$(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);J$(e,(e,i)=>{X$(t,n,i,e),r()})}function X$(e,t,n,r){xQ&&K.log(`Sending CLS span (${e})`);let i=t?G$((KP()||0)+t.startTime):UP(),a=q().getScopeData().transactionName,o=t?R$(t.sources[0]?.node):`Layout shift`,s={[RF]:`auto.http.browser.cls`,[LF]:`ui.webvital.cls`,[ZF]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=R$(e.node)});let c=U$({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[BF]:``,[VF]:e}),c.end(i))}function Z$(e){return e!=null&&e>0&&e<=6e4}function Q$(e){let t=0,n;if(!q$(`largest-contentful-paint`))return;let r=x$(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!Z$(e.value)||(t=e.value,n=r)},!0);J$(e,(e,i)=>{$$(t,n,i,e),r()})}function $$(e,t,n,r){if(!Z$(e))return;xQ&&K.log(`Sending LCP span (${e})`);let i=G$((KP()||0)+(t?.startTime||0)),a=q().getScopeData().transactionName,o=t?R$(t.element):`Largest contentful paint`,s={[RF]:`auto.http.browser.lcp`,[LF]:`ui.webvital.lcp`,[ZF]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=R$(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=U$({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[BF]:`millisecond`,[VF]:e}),c.end(i))}function e1(e){return e&&((KP()||performance.timeOrigin)+e)/1e3}function t1(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=K$(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return KP()||W$()?.timeOrigin?n1({...t,"http.request.redirect_start":e1(e.redirectStart),"http.request.redirect_end":e1(e.redirectEnd),"http.request.worker_start":e1(e.workerStart),"http.request.fetch_start":e1(e.fetchStart),"http.request.domain_lookup_start":e1(e.domainLookupStart),"http.request.domain_lookup_end":e1(e.domainLookupEnd),"http.request.connect_start":e1(e.connectStart),"http.request.secure_connection_start":e1(e.secureConnectionStart),"http.request.connection_end":e1(e.connectEnd),"http.request.request_start":e1(e.requestStart),"http.request.response_start":e1(e.responseStart),"http.request.response_end":e1(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function n1(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var r1=2147483647,i1=0,a1={},o1,s1;function c1({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=W$();if(r&&KP()){r.mark&&SQ.performance.mark(`sentry-tracing-init`);let i=t?Q$(n):t===!1?p1():void 0,a=e?Y$(n):e===!1?f1():void 0,o=m1(),s=h1();return()=>{o(),s(),i?.(),a?.()}}return()=>void 0}function l1(){w$(`longtask`,({entries:e})=>{let t=lL();if(!t)return;let{op:n,start_timestamp:r}=KI(t);for(let i of e){let e=G$(KP()+i.startTime),a=G$(i.duration);n===`navigation`&&r&&e<r||H$(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[RF]:`auto.ui.browser.metrics`}})}})}function u1(){new PerformanceObserver(e=>{let t=lL();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=G$(KP()+n.startTime),{start_timestamp:r,op:i}=KI(t);if(i===`navigation`&&r&&e<r)continue;let a=G$(n.duration),o={[RF]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),H$(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function d1(){w$(`event`,({entries:e})=>{let t=lL();if(t){for(let n of e)if(n.name===`click`){let e=G$(KP()+n.startTime),r=G$(n.duration),i={name:R$(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[RF]:`auto.ui.browser.metrics`}},a=PJ(n.target);a&&(i.attributes[`ui.component_name`]=a),H$(t,e,e+r,i)}}})}function f1(){return b$(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(a1.cls={value:e.value,unit:``},s1=t)},!0)}function p1(){return x$(({metric:e})=>{let t=e.entries[e.entries.length-1];!t||!Z$(e.value)||(a1.lcp={value:e.value,unit:`millisecond`},o1=t)},!0)}function m1(){return S$(({metric:e})=>{e.entries[e.entries.length-1]&&(a1.ttfb={value:e.value,unit:`millisecond`})})}function h1(){return w$(`paint`,({entries:e})=>{let t=NQ();for(let n of e){let e=n.startTime<t.firstHiddenTime;n.name===`first-paint`&&e&&(a1.fp={value:n.startTime,unit:`millisecond`}),n.name===`first-contentful-paint`&&e&&(a1.fcp={value:n.startTime,unit:`millisecond`})}})}function g1(e,t){let n=W$(),r=KP();if(!n?.getEntries||!r)return;let{spanStreamingEnabled:i,ignorePerformanceApiSpans:a,ignoreResourceSpans:o}=t,s=G$(r),c=n.getEntries(),{op:l,start_timestamp:u}=KI(e);c.slice(i1).forEach(t=>{let n=G$(t.startTime),r=G$(Math.max(0,t.duration));if(!(l===`navigation`&&u&&s+n<u))switch(t.entryType){case`navigation`:S1(e,t,s);break;case`mark`:case`paint`:case`measure`:b1(e,t,n,r,s,a);break;case`resource`:E1(e,t,t.name,n,r,s,o)}}),i1=Math.max(c.length-1,0),D1(e,i)}function _1(e,t){let n=KP();if(!W$()?.getEntries||!n){v1();return}let{spanStreamingEnabled:r,recordClsOnPageloadSpan:i,recordLcpOnPageloadSpan:a}=t,o=G$(n);if(KI(e).op===`pageload`){if(A1(a1),r){let t=(t,n,r)=>{let i=r??`browser.web_vital.${t}.value`;e.setAttribute(i,n),xQ&&K.log(`Setting web vital attribute`,{[i]:n},`on pageload span`)};[`ttfb`,`fp`,`fcp`].forEach(e=>{a1[e]&&t(e,a1[e].value)}),a1[`ttfb.requestTime`]&&t(`ttfb.requestTime`,a1[`ttfb.requestTime`].value,`browser.web_vital.ttfb.request_time`)}else i||delete a1.cls,a||delete a1.lcp,Object.entries(a1).forEach(([t,n])=>{QL(t,n.value,n.unit,e)}),O1(e,t);e.setAttribute(r?`browser.performance.time_origin`:`performance.timeOrigin`,o),e.setAttribute(r?`browser.performance.navigation.activation_start`:`performance.activationStart`,EQ())}v1()}function v1(){o1=void 0,s1=void 0,a1={}}function y1(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components ⚛`}catch{return}}function b1(e,t,n,r,i,a){if(y1(t)||[`mark`,`measure`].includes(t.entryType)&&DP(t.name,a))return;let o=TQ(!1),s=G$(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[RF]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),x1(d,t),c<=u&&H$(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function x1(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&HN(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(HN(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function S1(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{C1(e,t,r,n)}),C1(e,t,`secureConnection`,n,`TLS/SSL`),C1(e,t,`fetch`,n,`cache`),C1(e,t,`domainLookup`,n,`DNS`),T1(e,t,n)}function C1(e,t,n,r,i=n){let a=t[w1(n)],o=t[`${n}Start`];!o||!a||H$(e,r+G$(o),r+G$(a),{op:`browser.${i}`,name:t.name,attributes:{[RF]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function w1(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function T1(e,t,n){let r=n+G$(t.requestStart),i=n+G$(t.responseEnd),a=n+G$(t.responseStart);t.responseEnd&&(H$(e,r,i,{op:`browser.request`,name:t.name,attributes:{[RF]:`auto.ui.browser.metrics`}}),H$(e,a,i,{op:`browser.response`,name:t.name,attributes:{[RF]:`auto.ui.browser.metrics`}}))}function E1(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[RF]:`auto.resource.browser.metrics`},l=XV(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(SQ.location.origin),c[QF]=n,k1(t,c,[[`responseStatus`,`http.response.status_code`],[`transferSize`,`http.response_transfer_size`],[`encodedBodySize`,`http.response_content_length`],[`decodedBodySize`,`http.decoded_response_content_length`],[`renderBlockingStatus`,`resource.render_blocking_status`],[`deliveryType`,`http.response_delivery_type`]]);let u={...c,...t1(t)},d=a+r;H$(e,d,d+i,{name:n.replace(SQ.location.origin,``),op:s,attributes:u})}function D1(e,t){let n=SQ.navigator;if(!n)return;let r=n.connection;r&&(r.effectiveType&&e.setAttribute(t?`network.connection.effective_type`:`effectiveConnectionType`,r.effectiveType),r.type&&e.setAttribute(t?`network.connection.type`:`connectionType`,r.type),V$(r.rtt)&&(t?e.setAttribute(`network.connection.rtt`,r.rtt):KI(e).op===`pageload`&&QL(`connection.rtt`,r.rtt,`millisecond`))),V$(n.deviceMemory)&&(t?e.setAttribute(`device.memory.estimated_capacity`,n.deviceMemory):e.setAttribute(`deviceMemory`,`${n.deviceMemory} GB`)),V$(n.hardwareConcurrency)&&(t?e.setAttribute(`device.processor_count`,n.hardwareConcurrency):e.setAttribute(`hardwareConcurrency`,String(n.hardwareConcurrency)))}function O1(e,t){o1&&t.recordLcpOnPageloadSpan&&(o1.element&&e.setAttribute(`lcp.element`,R$(o1.element)),o1.id&&e.setAttribute(`lcp.id`,o1.id),o1.url&&e.setAttribute(`lcp.url`,o1.url.trim().slice(0,200)),o1.loadTime!=null&&e.setAttribute(`lcp.loadTime`,o1.loadTime),o1.renderTime!=null&&e.setAttribute(`lcp.renderTime`,o1.renderTime),e.setAttribute(`lcp.size`,o1.size)),s1?.sources&&t.recordClsOnPageloadSpan&&s1.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,R$(t.node)))}function k1(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<r1||typeof i==`string`)&&(t[r]=i)})}function A1(e){let t=TQ(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}var j1=`ElementTiming`,M1=vB((()=>({name:j1,setup(){!W$()||!KP()||w$(`element`,({entries:e})=>{for(let t of e){let e=t;if(!e.identifier)continue;let n=e.identifier,r=e.name,i=e.renderTime,a=e.loadTime,o={"sentry.origin":`auto.ui.browser.element_timing`,"ui.element.identifier":n};r&&(o[`ui.element.paint_type`]=r),e.id&&(o[`ui.element.id`]=e.id),e.element&&(o[`ui.element.type`]=e.element.tagName.toLowerCase()),e.url&&(o[`ui.element.url`]=e.url),e.naturalWidth&&(o[`ui.element.width`]=e.naturalWidth),e.naturalHeight&&(o[`ui.element.height`]=e.naturalHeight),i>0&&DW(`ui.element.render_time`,i,{unit:`millisecond`,attributes:o}),a>0&&DW(`ui.element.load_time`,a,{unit:`millisecond`,attributes:o})}})}}))),N1=[],P1=new Map,F1=new Map;function I1(){if(W$()&&KP()){let e=R1();return()=>{e()}}return()=>void 0}var L1={click:`click`,pointerdown:`click`,pointerup:`click`,mousedown:`click`,mouseup:`click`,touchstart:`click`,touchend:`click`,mouseover:`hover`,mouseout:`hover`,mouseenter:`hover`,mouseleave:`hover`,pointerover:`hover`,pointerout:`hover`,pointerenter:`hover`,pointerleave:`hover`,dragstart:`drag`,dragend:`drag`,drag:`drag`,dragenter:`drag`,dragleave:`drag`,dragover:`drag`,drop:`drag`,keydown:`press`,keyup:`press`,keypress:`press`,input:`press`};function R1(){return C$(z1)}var z1=({metric:e})=>{if(e.value==null)return;let t=G$(e.value);if(t>60)return;let n=e.entries.find(t=>t.duration===e.value&&L1[t.name]);if(!n)return;let{interactionId:r}=n,i=L1[n.name],a=G$(KP()+n.startTime),o=lL(),s=o?sL(o):void 0,c=r==null?void 0:P1.get(r),l=c?.span||s,u=l?KI(l).description:q().getScopeData().transactionName,d=U$({name:c?.elementName||R$(n.target),transaction:u,attributes:{[RF]:`auto.http.browser.inp`,[LF]:`ui.interaction.${i}`,[ZF]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[BF]:`millisecond`,[VF]:e.value}),d.end(a+t))};function B1(e){return e==null?void 0:P1.get(e)}function V1(){let e=Object.keys(L1);OB()&&e.forEach(e=>{SQ.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=R$(t),r=Math.round(e.timeStamp);if(F1.set(r,n),F1.size>50){let e=F1.keys().next().value;e!==void 0&&F1.delete(e)}}function n(e){let t=Math.round(e.startTime),n=F1.get(t);if(!n)for(let e=-5;e<=5;e++){let r=F1.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=lL(),r=t&&sL(t);e.forEach(e=>{if(!P$(e))return;let t=e.interactionId;if(t==null||P1.has(t))return;let i=e.target?R$(e.target):n(e);if(N1.length>10){let e=N1.shift();P1.delete(e)}N1.push(t),P1.set(t,{span:r,elementName:i})})};w$(`event`,r),w$(`first-input`,r)}function H1(e){let{name:t,op:n,origin:r,metricName:i,value:a,attributes:o,parentSpan:s,reportEvent:c,startTime:l,endTime:u}=e,d=q().getScopeData().transactionName,f={[RF]:r,[LF]:n,[ZF]:0,[`browser.web_vital.${i}.value`]:a,[Rc]:d,[Ic]:d,"user_agent.original":SQ.navigator?.userAgent,...o};s&&qI(s).attributes?.[`sentry.op`]===`pageload`&&(f[`sentry.pageload.span_id`]=s.spanContext().spanId),c&&(f[`browser.web_vital.${i}.report_event`]=c);let p=mR({name:t,attributes:f,startTime:l,parentSpan:s});p&&p.end(u??l)}function U1(e){let t=0,n;if(!q$(`largest-contentful-paint`))return;let r=x$(({metric:e})=>{let r=e.entries[e.entries.length-1];!r||!Z$(e.value)||(t=e.value,n=r)},!0);J$(e,(e,i,a)=>{W1(t,n,a,e),r()})}function W1(e,t,n,r){if(!Z$(e))return;xQ&&K.log(`Sending LCP span (${e})`);let i=KP()||0,a=G$(i),o=G$(i+(t?.startTime||0)),s=t?R$(t.element):`Largest contentful paint`,c={};t?.element&&(c[`browser.web_vital.lcp.element`]=R$(t.element)),t?.id&&(c[`browser.web_vital.lcp.id`]=t.id),t?.url&&(c[`browser.web_vital.lcp.url`]=t.url),t?.loadTime!=null&&(c[`browser.web_vital.lcp.load_time`]=t.loadTime),t?.renderTime!=null&&(c[`browser.web_vital.lcp.render_time`]=t.renderTime),t?.size!=null&&(c[`browser.web_vital.lcp.size`]=t.size),H1({name:s,op:`ui.webvital.lcp`,origin:`auto.http.browser.lcp`,metricName:`lcp`,value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:a,endTime:o})}function G1(e){let t=0,n;if(!q$(`layout-shift`))return;let r=b$(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);J$(e,(e,i,a)=>{K1(t,n,a,e),r()})}function K1(e,t,n,r){xQ&&K.log(`Sending CLS span (${e})`);let i=t?G$((KP()||0)+t.startTime):UP(),a=t?R$(t.sources[0]?.node):`Layout shift`,o={};t?.sources&&t.sources.forEach((e,t)=>{o[`browser.web_vital.cls.source.${t+1}`]=R$(e.node)}),H1({name:a,op:`ui.webvital.cls`,origin:`auto.http.browser.cls`,metricName:`cls`,value:e,attributes:o,parentSpan:n,reportEvent:r,startTime:i})}function q1(){!W$()||!KP()||C$(({metric:e})=>{if(e.value==null||G$(e.value)>60)return;let t=e.entries.find(t=>t.duration===e.value&&L1[t.name]);t&&J1(e.value,t)})}function J1(e,t){xQ&&K.log(`Sending INP span (${e})`);let n=G$(KP()+t.startTime),r=G$(e),i=L1[t.name],a=B1(t.interactionId),o=lL(),s=o?sL(o):void 0,c=a?.span||s,l=c?qI(c).name:q().getScopeData().transactionName;H1({name:a?.elementName||R$(t.target),op:`ui.interaction.${i}`,origin:`auto.http.browser.inp`,metricName:`inp`,value:e,attributes:{[ZF]:t.duration,[Rc]:l,[Ic]:l},startTime:n,endTime:n+r,parentSpan:c})}var Y1=1e3,X1,Z1,Q1;function $1(e){TN(`dom`,e),EN(`dom`,e0)}function e0(){if(!SQ.document)return;let e=DN.bind(null,`dom`),t=r0(e,!0);SQ.document.addEventListener(`click`,t,!1),SQ.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=SQ[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(XN(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=r0(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),XN(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function t0(e){if(e.type!==Z1)return!1;try{if(!e.target||e.target._sentryId!==Q1)return!1}catch{}return!0}function n0(e,t){return e===`keypress`?!t?.tagName||!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!1}function r0(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=i0(n);if(n0(n.type,r))return;ZN(n,`_sentryCaptured`,!0),r&&!r._sentryId&&ZN(r,`_sentryId`,jP());let i=n.type===`keypress`?`input`:n.type;t0(n)||(e({event:n,name:i,global:t}),Z1=n.type,Q1=r?r._sentryId:void 0),clearTimeout(X1),X1=SQ.setTimeout(()=>{Q1=void 0,Z1=void 0},Y1)}}function i0(e){try{return e.target}catch{return null}}var a0;function o0(e){let t=`history`;TN(t,e),EN(t,s0)}function s0(){if(SQ.addEventListener(`popstate`,()=>{let e=SQ.location.href,t=a0;a0=e,t!==e&&DN(`history`,{from:t,to:e})}),!pJ())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=a0,i=c0(String(n));if(a0=i,r===i)return e.apply(this,t);DN(`history`,{from:r,to:i})}return e.apply(this,t)}}XN(SQ.history,`pushState`,e),XN(SQ.history,`replaceState`,e)}function c0(e){try{return new URL(e,SQ.location.origin).toString()}catch{return e}}var l0={};function u0(e){let t=l0[e];if(t)return t;let n=SQ[e];if(hJ(n))return l0[e]=n.bind(SQ);let r=SQ.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){xQ&&K.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(l0[e]=n.bind(SQ))}function d0(e){l0[e]=void 0}function f0(...e){return u0(`setTimeout`)(...e)}var p0=`__sentry_xhr_v3__`;function m0(e){TN(`xhr`,e),EN(`xhr`,h0)}function h0(){if(!SQ.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=UP()*1e3,a=BN(n[0])?n[0].toUpperCase():void 0,o=g0(n[1]);if(!a||!o)return e.apply(t,n);t[p0]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[p0];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}DN(`xhr`,{endTimestamp:UP()*1e3,startTimestamp:i,xhr:t,virtualError:r}),t.removeEventListener(`readystatechange`,s)}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[p0];return a&&BN(r)&&BN(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[p0];return r?(n[0]!==void 0&&(r.body=n[0]),DN(`xhr`,{startTimestamp:UP()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function g0(e){if(BN(e))return e;try{return e.toString()}catch{}}var _0=Symbol.for(`sentry__originalRequestBody`);function v0(e){return new URLSearchParams(e).toString()}function y0(e,t=K){try{if(typeof e==`string`)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[v0(e)];if(!e)return[void 0]}catch(n){return xQ&&t.error(n,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return xQ&&t.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function b0(e=[]){if(e.length>=2&&e[1]&&typeof e[1]==`object`&&`body`in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){let t=e[0][_0];return t===void 0?void 0:t}}function x0(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return xQ&&K.error(t,`Failed to get xhr response headers`,e),{}}return t?t.split(`\r
|
|
996
|
-
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}function S0(e){if(typeof Element>`u`)return!1;try{return e instanceof Element}catch{return!1}}function C0(e){try{return new URL(e,SQ.location.origin).toString()}catch{return e}}var w0=40;function T0(e,t=u0(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw d0(`fetch`),e}finally{n-=a,r--}}return sV(e,i,tV(e.bufferSize||w0))}var X=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function E0(){let e=J();if(!e){X&&K.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){X&&K.warn(`BrowserProfiling integration is not available`);return}e.emit(`startUIProfiler`)}function D0(){let e=J();if(!e){X&&K.warn(`No Sentry client available, profiling is not started`);return}if(!e.getIntegrationByName(`BrowserProfiling`)){X&&K.warn(`ProfilingIntegration is not available`);return}e.emit(`stopUIProfiler`)}var O0={startProfiler:E0,stopProfiler:D0},k0=30,A0=50;function j0(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var M0=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,N0=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,P0=/\((\S*)(?::(\d+))(?::(\d+))\)/,F0=/at (.+?) ?\(data:(.+?),/,I0=[k0,e=>{let t=e.match(F0);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=M0.exec(e);if(n){let[,e,t,r]=n;return j0(e,`?`,+t,+r)}let r=N0.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=P0.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=B0(r[1]||`?`,r[2]);return j0(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],L0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,R0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,z0=hN(I0,[A0,e=>{let t=L0.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=R0.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=B0(n,e),j0(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),B0=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function V0(e,{metadata:t,tunnel:n,dsn:r}){return ML({event_id:e.event_id,sent_at:new Date().toISOString(),...t?.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:SI(r)}},[H0(e)])}function H0(e){return[{type:`user_report`},e]}var U0=1024,mce=`Breadcrumbs`,W0=vB(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:mce,setup(e){t.console&&WH(_ce(e)),t.dom&&$1(gce(e,t.dom)),t.xhr&&m0(vce(e)),t.fetch&&vJ(yce(e)),t.history&&o0(bce(e)),t.sentry&&e.on(`beforeSendEvent`,hce(e))}}}));function hce(e){return function(t){J()===e&&fH({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:NP(t)},{event:t})}}function gce(e,t){return function(n){if(J()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>U0&&(X&&K.warn(`\`dom.maxStringLength\` cannot exceed ${U0}, but a value of ${o} was configured. Sentry will use ${U0} instead.`),o=U0),typeof a==`string`&&(a=[a]);try{let e=n.event,t=xce(e)?e.target:e;r=R$(t,{keyAttrs:a,maxStringLength:o}),i=PJ(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),fH(s,{event:n.event,name:n.name,global:n.global})}}function _ce(e){return function(t){if(J()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:qH(t.level),message:TP(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${TP(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;fH(n,{input:t.args,level:t.level})}}function vce(e){return function(t){if(J()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[p0];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:dJ(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),fH(d,u)}}function yce(e){return function(t){if(J()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),fH(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:dJ(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),fH(s,o)}}}function bce(e){return function(t){if(J()!==e)return;let n=t.from,r=t.to,i=XV(Y.location.href),a=n?XV(n):void 0,o=XV(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),fH({category:`navigation`,data:{from:n,to:r}})}}function xce(e){return!!e&&!!e.target}var Sce=`EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload`.split(`,`),Cce=`BrowserApiErrors`,G0=vB(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Cce,setupOnce(){t.setTimeout&&XN(Y,`setTimeout`,K0),t.setInterval&&XN(Y,`setInterval`,K0),t.requestAnimationFrame&&XN(Y,`requestAnimationFrame`,wce),t.XMLHttpRequest&&`XMLHttpRequest`in Y&&XN(XMLHttpRequest.prototype,`send`,Tce);let e=t.eventTarget;e&&(Array.isArray(e)?e:Sce).forEach(e=>Ece(e,t))}}}));function K0(e){return function(...t){let n=t[0];return t[0]=KZ(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${bN(e)}`}}),e.apply(this,t)}}function wce(e){return function(t){return e.apply(this,[KZ(t,{mechanism:{data:{handler:bN(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function Tce(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&XN(n,e,function(t){let n={mechanism:{data:{handler:bN(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=$N(t);return r&&(n.mechanism.data.handler=bN(r)),KZ(t,n)})}),e.apply(this,t)}}function Ece(e,t){let n=Y[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(XN(n,`addEventListener`,function(n){return function(r,i,a){try{Dce(i)&&(i.handleEvent=KZ(i.handleEvent,{mechanism:{data:{handler:bN(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&Oce(this,r,i),n.apply(this,[r,KZ(i,{mechanism:{data:{handler:bN(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),XN(n,`removeEventListener`,function(e){return function(t,n,r){try{if(Object.prototype.hasOwnProperty.call(n,`__sentry_wrapped__`)){let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}}catch{}return e.call(this,t,n,r)}}))}function Dce(e){return typeof e.handleEvent==`function`}function Oce(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var q0=vB((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(Y.document===void 0){X&&K.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}tB({ignoreDuration:!0});let e=!1;i$(()=>{e||=(iB(),!0)});let n=kF(),r=n.getUser();n.addScopeListener(t=>{let n=t.getUser();(r?.id!==n?.id||r?.ip_address!==n?.ip_address)&&(r=n,e&&iB())}),t===`route`&&o0(({from:t,to:n})=>{t!==n&&(tB({ignoreDuration:!0}),iB(),e=!0)})}}}),kce=`CultureContext`,Ace=vB((()=>({name:kce,preprocessEvent(e){let t=J0();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){let t=J0();t&&uz(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})));function J0(){try{let e=Y.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var jce=`GlobalHandlers`,Y0=vB(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:jce,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(Mce(e),Q0(`onerror`)),t.onunhandledrejection&&(Nce(e),Q0(`onunhandledrejection`))}}}));function Mce(e){kN(t=>{let{stackParser:n,attachStacktrace:r}=$0();if(J()!==e||WZ())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=Pce(mQ(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,Vz(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function Nce(e){MN(t=>{let{stackParser:n,attachStacktrace:r}=$0();if(J()!==e||WZ())return;let i=X0(t),a=HN(i)?Z0(i):mQ(n,i,void 0,r,!0);a.level=`error`,Vz(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function X0(e){if(HN(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function Z0(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Pce(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:Fce(t)??NJ(),function:`?`,in_app:!0}),e}function Q0(e){X&&K.log(`Global Handler attached: ${e}`)}function $0(){return J()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Fce(e){if(!(!BN(e)||e.length===0))return e.startsWith(`data:`)?`<${QV(e,!1)}>`:e}var e2=vB(()=>({name:`HttpContext`,preprocessEvent(e){if(!Y.navigator&&!Y.location&&!Y.document)return;let t=qZ(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){let t=e.attributes?.[LF];if(!Y.navigator&&!Y.location&&!Y.document)return;let n=qZ();uz(e,{"url.full":t===`http.client`?void 0:n.url,"http.request.header.user_agent":n.headers[`User-Agent`],"http.request.header.referer":n.headers.Referer})}})),Ice=`cause`,Lce=5,Rce=`LinkedErrors`,t2=vB(((e={})=>{let t=e.limit||Lce,n=e.key||Ice;return{name:Rce,preprocessEvent(e,r,i){kH(nQ,i.getOptions().stackParser,n,t,e,r)}}})),zce=/^HTML(\w*)Element$/;function n2(e){if(typeof window<`u`&&e===window)return`[Window]`;if(typeof document<`u`&&e===document)return`[Document]`;if(S0(e)){let t=Bce(e);if(zce.test(t))return`[HTMLElement: ${R$(e)}]`}}function Bce(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function Vce(){return Hce()?(X&&rN(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function Hce(){if(Y.window===void 0)return!1;let e=Y;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=NJ();return!(Y===Y.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function r2(e){return[yH(),hH(),cW(),G0(),W0(),Y0(),t2(),QH(),e2(),Ace(),q0()]}function Uce(e={}){let t=!e.skipBrowserExtensionCheck&&Vce(),n=e.defaultIntegrations==null?r2():e.defaultIntegrations,r={...e,enabled:!t&&e.enabled,stackParser:gN(e.stackParser||z0),integrations:pB({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||T0};return pP(n2),zV(yQ,r)}function Wce(){}function Gce(e){e()}function i2(e={}){let t=Y.document,n=t?.head||t?.body;if(!n){X&&K.error(`[showReportDialog] Global document not defined`);return}let r=q(),i=J()?.getDsn();if(!i){X&&K.error(`[showReportDialog] DSN not configured`);return}let a={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||Zz()},o=Y.document.createElement(`script`);o.async=!0,o.crossOrigin=`anonymous`,o.src=uB(i,a);let{onLoad:s,onClose:c}=a;if(s&&(o.onload=s),c){let e=t=>{if(t.data===`__sentry_reportdialog_closed__`)try{c()}finally{Y.removeEventListener(`message`,e)}};Y.addEventListener(`message`,e)}n.appendChild(o)}var Kce=G,qce=`ReportingObserver`,a2=new WeakMap,Jce=vB(((e={})=>{let t=e.types||[`crash`,`deprecation`,`intervention`];function n(e){if(a2.has(J()))for(let t of e)jF(e=>{e.setExtra(`url`,t.url);let n=`ReportingObserver [${t.type}]`,r=`No details available`;if(t.body){let n={};for(let e in t.body)n[e]=t.body[e];if(e.setExtra(`body`,n),t.type===`crash`){let e=t.body;r=[e.crashId||``,e.reason||``].join(` `).trim()||r}else r=t.body.message||r}Bz(`${n}: ${r}`)})}return{name:qce,setupOnce(){_J()&&new Kce.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(e){a2.set(e,!0)}}})),Yce=`HttpClient`,Xce=vB(((e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:Yce,setup(e){rle(e,t),ile(e,t)}}}));function Zce(e,t,n,r,i){if(s2(e,n.status,n.url)){let e=ale(t,r),a,o,s,c,l=l2();if(l.requestHeaders!==!1&&(a=UV(o2(e.headers),l.requestHeaders)),l.responseHeaders!==!1&&(o=UV(o2(n.headers),l.responseHeaders)),l.cookies!==!1){let t=e.headers.get(`Cookie`)||void 0;if(t){let e=GV(t,l.cookies);typeof e==`object`&&(s=e)}let r=n.headers.get(`Set-Cookie`)||void 0;if(r){let e=GV(r,l.cookies);typeof e==`object`&&(c=e)}}Vz(c2({url:e.url,method:e.method,status:n.status,requestHeaders:a,responseHeaders:o,requestCookies:s,responseCookies:c,error:i,type:`fetch`}))}}function Qce(e,t,n,r,i){if(s2(e,t.status,t.responseURL)){let e,a,o,s=l2();if(s.cookies!==!1)try{let e=t.getResponseHeader(`Set-Cookie`)||t.getResponseHeader(`set-cookie`)||void 0;if(e){let t=GV(e,s.cookies);typeof t==`object`&&(a=t)}}catch{}if(s.responseHeaders!==!1)try{o=UV(ele(t),s.responseHeaders)}catch{}s.requestHeaders!==!1&&(e=UV(r,s.requestHeaders)),Vz(c2({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:o,responseCookies:a,error:i,type:`xhr`}))}}function $ce(e){if(e){let t=e[`Content-Length`]||e[`content-length`];if(t)return parseInt(t,10)}}function o2(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}function ele(e){let t=e.getAllResponseHeaders();return t?t.split(`\r
|
|
997
|
-
`).reduce((e,t)=>{let[n,r]=t.split(`: `);return n&&r&&(e[n]=r),e},{}):{}}function tle(e,t){return e.some(e=>typeof e==`string`?t.includes(e):e.test(t))}function nle(e,t){return e.some(e=>typeof e==`number`?e===t:t>=e[0]&&t<=e[1])}function rle(e,t){gJ()&&vJ(n=>{if(J()!==e)return;let{response:r,args:i,error:a,virtualError:o}=n,[s,c]=i;r&&Zce(t,s,r,c,a||o)},!1)}function ile(e,t){`XMLHttpRequest`in G&&m0(n=>{if(J()!==e)return;let{error:r,virtualError:i}=n,a=n.xhr,o=a[p0];if(!o)return;let{method:s,request_headers:c}=o;try{Qce(t,a,s,c,r||i)}catch(e){X&&K.warn(`Error while extracting response event form XHR response`,e)}})}function s2(e,t,n){return nle(e.failedRequestStatusCodes,t)&&tle(e.failedRequestTargets,n)&&!$V(n,J())}function c2(e){let t=J(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,i=`HTTP Client Error with status code: ${e.status}`,a={message:i,exception:{values:[{type:`Error`,value:i,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:$ce(e.responseHeaders)}}};return FP(a,{type:`auto.http.client.${e.type}`,handled:!1}),a}function ale(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function l2(){let e=J();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};let t=e.getOptions();if(t.dataCollection==null){let e=!!t.sendDefaultPii;return{cookies:e,requestHeaders:e,responseHeaders:e}}let{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}var u2=G,ole=7,sle=`ContextLines`,cle=vB(((e={})=>({name:sle,processEvent(t,n,r){return lle(t,e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??ole)}})));function lle(e,t){let n=u2.document,r=u2.location&&ZV(u2.location.href);if(!n||!r)return e;let i=e.exception?.values;if(!i?.length)return e;let a=n.documentElement.innerHTML;if(!a)return e;let o=[`<!DOCTYPE html>`,`<html>`,...a.split(`
|
|
998
|
-
`),`</html>`];return i.forEach(e=>{let n=e.stacktrace;n?.frames&&(n.frames=n.frames.map(e=>ule(e,o,r,t)))}),e}function ule(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||IP(t,e,r),e}var dle=`GraphQLClient`,fle=(e=>({name:dle,setup(t){ple(t,e),mle(t,e)}}));function ple(e,t){e.on(`beforeOutgoingRequestSpan`,(n,r)=>{let i=KI(n).data||{};if(i[`sentry.op`]!==`http.client`)return;let a=i[`url.full`]||i[`http.url`]||i.url,o=i[`http.request.method`]||i[`http.method`];if(!BN(a)||!BN(o))return;let{endpoints:s}=t,c=DP(a,s),l=f2(r);if(c&&l){let t=h2(l);if(t){let r=d2(t);n.updateName(`${o} ${a} (${r})`),p2(t)&&e.getDataCollectionOptions().graphQL.document===!0&&n.setAttribute(jc,t.query),m2(t)&&(n.setAttribute(`graphql.persisted_query.hash.sha256`,t.extensions.persistedQuery.sha256Hash),n.setAttribute(`graphql.persisted_query.version`,t.extensions.persistedQuery.version))}}})}function mle(e,t){e.on(`beforeOutgoingRequestBreadcrumb`,(n,r)=>{let{category:i,type:a,data:o}=n;if(a===`http`&&(i===`fetch`||i===`xhr`)){let n=o?.url,{endpoints:i}=t,a=DP(n,i),s=f2(r);if(a&&o&&s){let t=h2(s);!o.graphql&&t&&(o[`graphql.operation`]=d2(t),p2(t)&&e.getDataCollectionOptions().graphQL.document===!0&&(o[jc]=t.query),m2(t)&&(o[`graphql.persisted_query.hash.sha256`]=t.extensions.persistedQuery.sha256Hash,o[`graphql.persisted_query.version`]=t.extensions.persistedQuery.version))}}})}function d2(e){if(m2(e))return`persisted ${e.operationName}`;if(p2(e)){let{query:t,operationName:n}=e,{operationName:r=n,operationType:i}=hle(t);return r?`${i} ${r}`:`${i}`}return`unknown`}function f2(e){let t=`xhr`in e,n;if(t){let t=e.xhr[p0];n=t&&y0(t.body)[0]}else n=y0(b0(e.input))[0];return n}function hle(e){let t=/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/,n=/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/,r=e.match(t);if(r)return{operationType:r[1],operationName:r[2]};let i=e.match(n);return i?{operationType:i[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function p2(e){return WN(e)&&typeof e.query==`string`}function m2(e){return WN(e)&&typeof e.operationName==`string`&&WN(e.extensions)&&WN(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash==`string`&&typeof e.extensions.persistedQuery.version==`number`}function h2(e){try{let t=JSON.parse(e);return p2(t)||m2(t)?t:void 0}catch{return}}var gle=vB(fle),_le=vB((e={})=>{let t=[`script`];function n(r,i,a=0){if(!r)return;let o=`shadowRoot`in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(let r of o){if(!(r instanceof HTMLElement))continue;let o=PJ(r,1)||void 0,s=r.tagName.toLowerCase();if(t.includes(s))continue;let c=e.onElement?.({element:r,componentName:o,tagName:s,depth:a})||{};if(c===`skip`)continue;if(c===`children`){n(r,i,a+1);continue}let{x:l,y:u,width:d,height:f}=r.getBoundingClientRect(),p={identifier:r.id||void 0,type:o||s,visible:!0,alpha:1,height:f,width:d,x:l,y:u,...c};p.children=[],n(r,p.children,a+1),i.push(p)}}return{name:`ViewHierarchy`,processEvent:(t,r)=>{if(t.type!==void 0||e.shouldAttach?.(t,r)===!1)return t;let i={rendering_system:`DOM`,positioning:`absolute`,windows:[]};n(e.rootElement?.()||Y.document.body,i.windows);let a={filename:`view-hierarchy.json`,attachmentType:`event.view_hierarchy`,contentType:`application/json`,data:JSON.stringify(i)};return r.attachments=r.attachments||[],r.attachments.push(a),t}}}),g2=G,_2=`sentryReplaySession`,vle=`replay_event`,v2=`Unable to send Replay`,yle=3e5,ble=9e5,xle=5e3,Sle=5500,Cle=6e4,wle=5e3,Tle=3,y2=15e4,b2=5e3,Ele=3e3,Dle=300,x2=2e7,Ole=4999,kle=5e4,S2=36e5,Ale=Object.defineProperty,jle=(e,t,n)=>t in e?Ale(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C2=(e,t,n)=>jle(e,typeof t==`symbol`?t:t+``,n),w2=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(w2||{});function Mle(e){return e.nodeType===e.ELEMENT_NODE}function T2(e){return e?.host?.shadowRoot===e}function E2(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function Nle(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),e}function Ple(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function D2(e){try{let t=e.rules||e.cssRules;return t?Nle(Array.from(t,O2).join(``)):null}catch{return null}}function Fle(e){let t=``;for(let n=0;n<e.style.length;n++){let r=e.style,i=r[n],a=r.getPropertyPriority(i);t+=`${i}:${r.getPropertyValue(i)}${a?` !important`:``};`}return`${e.selectorText} { ${t} }`}function O2(e){let t;if(Lle(e))try{t=D2(e.styleSheet)||Ple(e)}catch{}else if(Rle(e)){let t=e.cssText,n=e.selectorText.includes(`:`),r=typeof e.style.all==`string`&&e.style.all;if(r&&(t=Fle(e)),n&&(t=Ile(t)),n||r)return t}return t||e.cssText}function Ile(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function Lle(e){return`styleSheet`in e}function Rle(e){return`selectorText`in e}var k2=class{constructor(){C2(this,`idNodeMap`,new Map),C2(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function zle(){return new k2}function A2({maskInputOptions:e,tagName:t,type:n}){return t===`OPTION`&&(t=`SELECT`),!!(e[t.toLowerCase()]||n&&e[n]||n===`password`||t===`INPUT`&&!n&&e.text)}function j2({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||``;return e?(r&&(i=r(i,t)),`*`.repeat(i.length)):i}function M2(e){return e.toLowerCase()}function N2(e){return e.toUpperCase()}var P2=`__rrweb_original__`;function Ble(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=P2 in i?i[P2]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function F2(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?M2(t):null}function I2(e,t,n){return t===`INPUT`&&(n===`radio`||n===`checkbox`)?e.getAttribute(`value`)||``:e.value}function L2(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}var R2={};function z2(e){let t=R2[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return R2[e]=r.bind(window)}function B2(...e){return z2(`setTimeout`)(...e)}function V2(...e){return z2(`clearTimeout`)(...e)}function H2(e){try{return e.contentDocument}catch{}}function Vle(e){try{return e.contentWindow}catch{}}var Hle=1,Ule=RegExp(`[^a-z0-9-_:]`),U2=-2;function W2(){return Hle++}function Wle(e){if(e instanceof HTMLFormElement)return`form`;let t=M2(e.tagName);return Ule.test(t)?`div`:t}function Gle(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var G2,K2,Kle=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,qle=/^(?:[a-z+]+:)?\/\//i,Jle=/^www\..*/i,Yle=/^(data:)([^,]*),(.*)/i;function Xle(e,t){if(!e||t.size===0)return e;try{let n=e.split(`;`),r=[];for(let e of n){if(e=e.trim(),!e)continue;let n=e.indexOf(`:`);if(n===-1){r.push(e);continue}let i=e.slice(0,n).trim();t.has(i)||r.push(e)}return r.join(`; `)+(r.length>0&&e.endsWith(`;`)?`;`:``)}catch(t){return console.warn(`Error filtering CSS properties:`,t),e}}function q2(e,t){return(e||``).replace(Kle,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(qle.test(s)||Jle.test(s)||Yle.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${Gle(t)+s}${c})`;let l=t.split(`/`),u=s.split(`/`);l.pop();for(let e of u)if(e===`.`)continue;else e===`..`?l.pop():l.push(e);return`url(${c}${l.join(`/`)}${c})`})}var Zle=/^[^ \t\n\r\u000c]+/,Qle=/^[, \t\n\r\u000c]+/;function $le(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(Qle),!(n>=t.length);){let a=r(Zle);if(a.slice(-1)===`,`)a=Y2(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=Y2(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}if(o)e===`)`&&(o=!1);else{if(e===`,`){n+=1,i.push((a+r).trim());break}e===`(`&&(o=!0)}r+=e,n+=1}}}return i.join(`, `)}var J2=new WeakMap;function Y2(e,t){return!t||t.trim()===``?t:X2(e,t)}function eue(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function X2(e,t){let n=J2.get(e);if(n||(n=e.createElement(`a`),J2.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function Z2(e,t,n,r,i,a,o){if(!r)return r;if(n===`src`||n===`href`&&(t!==`use`||r[0]!==`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&(t===`table`||t===`td`||t===`th`))return Y2(e,r);if(n===`srcset`)return $le(e,r);if(n===`style`){let t=q2(r,X2(e));return o&&o.size>0&&(t=Xle(t,o)),t}return t===`object`&&n===`data`?Y2(e,r):typeof a==`function`?a(n,r,i):r}function Q2(e,t,n){return(e===`video`||e===`audio`)&&t===`autoplay`}function tue(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function nue(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function $2(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:$2(e.parentNode,t,n,r+1)}function e4(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(nue(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function t4(e,t,n,r,i,a){try{let o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName===`INPUT`){let e=o.getAttribute(`autocomplete`);if([`current-password`,`new-password`,`cc-number`,`cc-exp`,`cc-exp-month`,`cc-exp-year`,`cc-csc`].includes(e))return!0}let s=-1,c=-1;if(a){if(c=$2(o,e4(r,i)),c<0)return!0;s=$2(o,e4(t,n),c>=0?c:1/0)}else{if(s=$2(o,e4(t,n)),s<0)return!1;c=$2(o,e4(r,i),s>=0?s:1/0)}return s>=0?c>=0?s<=c:!0:c>=0?!1:!!a}catch{}return!!a}function rue(e,t,n){let r=Vle(e);if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=B2(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{V2(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return B2(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function iue(e,t,n){let r=!1,i;try{i=e.sheet}catch{i=null}if(i)return;let a=B2(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{V2(a),r=!0,t()})}function aue(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:m={},maskTextFn:h,maskInputFn:g,dataURLOptions:_={},inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x=!1,ignoreCSSAttributes:S}=t,C=oue(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:w2.Document,childNodes:[]}:{type:w2.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:w2.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return cue(e,{doc:n,blockClass:i,blockSelector:a,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:m,maskInputFn:g,dataURLOptions:_,inlineImages:v,recordCanvas:y,keepIframeSrcFn:b,newlyAddedElement:x,rootId:C,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,ignoreCSSAttributes:S});case e.TEXT_NODE:return sue(e,{doc:n,maskAllText:s,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:f,maskTextFn:h,maskInputOptions:m,maskInputFn:g,rootId:C});case e.CDATA_SECTION_NODE:return{type:w2.CDATA,textContent:``,rootId:C};case e.COMMENT_NODE:return{type:w2.Comment,textContent:e.textContent||``,rootId:C};default:return!1}}function oue(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function sue(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:a,unmaskTextSelector:o,maskTextFn:s,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName,f=e.textContent,p=d===`STYLE`||void 0,m=d===`SCRIPT`||void 0,h=d===`TEXTAREA`||void 0;if(p&&f){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(f=D2(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}f=q2(f,X2(t.doc))}m&&(f=`SCRIPT_PLACEHOLDER`);let g=t4(e,r,a,i,o,n);return!p&&!m&&!h&&f&&g&&(f=s?s(f,e.parentElement):f.replace(/[\S]/g,`*`)),h&&f&&(c.textarea||g)&&(f=l?l(f,e.parentNode):f.replace(/[\S]/g,`*`)),d===`OPTION`&&f&&(f=j2({isMasked:t4(e,r,a,i,o,A2({type:null,tagName:d,maskInputOptions:c})),element:e,value:f,maskInputFn:l})),{type:w2.Text,textContent:f||``,isStyle:p,rootId:u}}function cue(e,t){let{doc:n,blockClass:r,blockSelector:i,unblockSelector:a,inlineStylesheet:o,maskInputOptions:s={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:h,maskTextClass:g,unmaskTextClass:_,maskTextSelector:v,unmaskTextSelector:y,ignoreCSSAttributes:b}=t,x=tue(e,r,i,a),S=Wle(e),C={},w=e.attributes.length;for(let t=0;t<w;t++){let r=e.attributes[t];r.name&&!Q2(S,r.name,r.value)&&(C[r.name]=Z2(n,S,M2(r.name),r.value,e,c,b))}if(S===`link`&&o){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=D2(t)),r&&(C.rel=null,C.href=null,C.crossorigin=null,C._cssText=q2(r,t.href))}if(S===`style`&&e.sheet&&!(e.innerText||e.textContent||``).trim().length){let t=D2(e.sheet);t&&(C._cssText=q2(t,X2(n)))}if(S===`input`||S===`textarea`||S===`select`||S===`option`){let t=e,n=F2(t),r=I2(t,N2(S),n),i=t.checked;if(n!==`submit`&&n!==`button`&&r){let e=t4(t,g,v,_,y,A2({type:n,tagName:N2(S),maskInputOptions:s}));C.value=j2({isMasked:e,element:t,value:r,maskInputFn:l})}i&&(C.checked=i)}if(S===`option`&&(e.selected&&!s.select?C.selected=!0:delete C.selected),S===`canvas`&&f){if(e.__context===`2d`)Ble(e)||(C.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!(`__context`in e)){let t=e.toDataURL(u.type,u.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(u.type,u.quality)&&(C.rr_dataURL=t)}}if(S===`img`&&d){G2||(G2=n.createElement(`canvas`),K2=G2.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{G2.width=t.naturalWidth,G2.height=t.naturalHeight,K2.drawImage(t,0,0),C.rr_dataURL=G2.toDataURL(u.type,u.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?C.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if((S===`audio`||S===`video`)&&(C.rr_mediaState=e.paused?`paused`:`played`,C.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop)),x){let{width:t,height:n}=e.getBoundingClientRect();C={class:C.class,rr_width:`${t}px`,rr_height:`${n}px`}}S===`iframe`&&!p(C.src)&&(!x&&!H2(e)&&(C.rr_src=C.src),delete C.src);let T;try{customElements.get(S)&&(T=!0)}catch{}return{type:w2.Element,tagName:S,attributes:C,childNodes:[],isSVG:eue(e)||void 0,needBlock:x,rootId:h,isCustom:T}}function n4(e){return e==null?``:e.toLowerCase()}function lue(e,t){return!!(t.comment&&e.type===w2.Comment||e.type===w2.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`||e.attributes.rel===`modulepreload`)||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&L2(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(n4(e.attributes.name).match(/^msapplication-tile(image|color)$/)||n4(e.attributes.name)===`application-name`||n4(e.attributes.rel)===`icon`||n4(e.attributes.rel)===`apple-touch-icon`||n4(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&n4(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(n4(e.attributes.property).match(/^(og|twitter|fb):/)||n4(e.attributes.name).match(/^(og|twitter):/)||n4(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(n4(e.attributes.name)===`robots`||n4(e.attributes.name)===`googlebot`||n4(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(n4(e.attributes.name)===`author`||n4(e.attributes.name)===`generator`||n4(e.attributes.name)===`framework`||n4(e.attributes.name)===`publisher`||n4(e.attributes.name)===`progid`||n4(e.attributes.property).match(/^article:/)||n4(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(n4(e.attributes.name)===`google-site-verification`||n4(e.attributes.name)===`yandex-verification`||n4(e.attributes.name)===`csrf-token`||n4(e.attributes.name)===`p:domain_verify`||n4(e.attributes.name)===`verify-v1`||n4(e.attributes.name)===`verification`||n4(e.attributes.name)===`shopify-checkout-api-token`))))}function r4(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:m={},maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y={},inlineImages:b=!1,recordCanvas:x=!1,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w=5e3,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:te=()=>!1,newlyAddedElement:ne=!1,ignoreCSSAttributes:re}=t,{preserveWhiteSpace:ie=!0}=t,ae=aue(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,dataURLOptions:y,inlineImages:b,recordCanvas:x,keepIframeSrcFn:te,newlyAddedElement:ne,ignoreCSSAttributes:re});if(!ae)return console.warn(e,`not serialized`),null;let oe;oe=r.hasNode(e)?r.getId(e):lue(ae,v)||!ie&&ae.type===w2.Text&&!ae.isStyle&&!ae.textContent.trim().length?U2:W2();let D=Object.assign(ae,{id:oe});if(r.add(e,D),oe===U2)return null;S&&S(e);let se=!f;if(D.type===w2.Element){se&&=!D.needBlock;let t=e.shadowRoot;t&&E2(t)&&(D.isShadowHost=!0)}if((D.type===w2.Document||D.type===w2.Element)&&se){v.headWhitespace&&D.type===w2.Element&&D.tagName===`head`&&(ie=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,maskAllText:s,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:f,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onBlockedImageLoad:T,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re},ne=e.childNodes?Array.from(e.childNodes):[];for(let e of ne){let n=r4(e,t);n&&D.childNodes.push(n)}if(Mle(e)&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=r4(n,t);r&&(E2(e.shadowRoot)&&(r.isShadow=!0),D.childNodes.push(r))}}if(e.parentNode&&T2(e.parentNode)&&E2(e.parentNode)&&(D.isShadow=!0),D.type===w2.Element&&D.tagName===`iframe`&&!D.needBlock&&rue(e,()=>{let t=H2(e);if(t&&C){let n=r4(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});n&&C(e,n)}},w),D.type===w2.Element&&D.tagName===`img`&&!e.complete&&D.needBlock){let t=e,n=()=>{if(t.isConnected&&!t.complete&&T)try{let e=t.getBoundingClientRect();e.width>0&&e.height>0&&T(t,D,e)}catch{}t.removeEventListener(`load`,n)};t.isConnected&&t.addEventListener(`load`,n)}return D.type===w2.Element&&D.tagName===`link`&&typeof D.attributes.rel==`string`&&(D.attributes.rel===`stylesheet`||D.attributes.rel===`preload`&&typeof D.attributes.href==`string`&&L2(D.attributes.href)===`css`)&&iue(e,()=>{if(ee){let t=r4(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:s,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v,dataURLOptions:y,inlineImages:b,recordCanvas:x,preserveWhiteSpace:ie,onSerialize:S,onIframeLoad:C,iframeLoadTimeout:w,onStylesheetLoad:ee,stylesheetLoadTimeout:E,keepIframeSrcFn:te,ignoreCSSAttributes:re});t&&ee(e,t)}},E),D.type===w2.Element&&delete D.needBlock,D}function uue(e,t){let{mirror:n=new k2,blockClass:r=`rr-block`,blockSelector:i=null,unblockSelector:a=null,maskAllText:o=!1,maskTextClass:s=`rr-mask`,unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:m=!1,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOM:v=!1,dataURLOptions:y,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:te=new Set([])}=t||{};return r4(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,maskAllText:o,maskTextClass:s,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:m===!1?{}:m,maskAttributeFn:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:v===!0||v===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:v===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:v===!1?{}:v,dataURLOptions:y,inlineImages:f,recordCanvas:p,preserveWhiteSpace:b,onSerialize:x,onIframeLoad:S,iframeLoadTimeout:C,onBlockedImageLoad:w,onStylesheetLoad:T,stylesheetLoadTimeout:ee,keepIframeSrcFn:E,newlyAddedElement:!1,ignoreCSSAttributes:te})}function i4(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var a4=`Please stop import mirror directly. Instead of that,\r
|
|
999
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
1000
|
-
or you can use record.mirror to access the mirror instance during recording.`,o4={map:{},getId(){return console.error(a4),-1},getNode(){return console.error(a4),null},removeNodeFromMap(){console.error(a4)},has(){return console.error(a4),!1},reset(){console.error(a4)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(o4=new Proxy(o4,{get(e,t,n){return t===`map`&&console.error(a4),Reflect.get(e,t,n)}}));function s4(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(_ue(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=E4(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function c4(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){E4(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>c4(e,t,a||{},!0)}function l4(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var u4=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(u4=()=>new Date().getTime());function d4(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function f4(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function p4(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function m4(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function h4(e,t,n,r,i){if(!e)return!1;let a=m4(e);if(!a)return!1;let o=e4(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=$2(a,o),c=-1;return s<0?!1:(r&&(c=$2(a,e4(null,r))),s>-1&&c<0||s<c)}function due(e,t){return t.getId(e)!==-1}function g4(e,t){return t.getId(e)===U2}function _4(e,t){if(T2(e))return!1;let n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:!e.parentNode||_4(e.parentNode,t):!0}function v4(e){return!!e.changedTouches}function fue(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError(`1 argument is required`);do if(this===t)return!0;while(t&&=t.parentNode);return!1})}function y4(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function b4(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function x4(e){return!!e?.shadowRoot}var pue=class{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function S4(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function mue(e){let t=e,n;for(;n=S4(t);)t=n;return t}function hue(e){let t=e.ownerDocument;if(!t)return!1;let n=mue(e);return t.contains(n)}function C4(e){let t=e.ownerDocument;return t?t.contains(e)||hue(e):!1}var w4={};function T4(e){let t=w4[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return w4[e]=r.bind(window)}function gue(...e){return T4(`requestAnimationFrame`)(...e)}function E4(...e){return T4(`setTimeout`)(...e)}function _ue(...e){return T4(`clearTimeout`)(...e)}var D4=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(D4||{}),Z=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(Z||{}),O4=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(O4||{}),k4=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(k4||{}),A4=(e=>(e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`,e[e.RateChange=4]=`RateChange`,e))(A4||{}),j4;function vue(e){j4=e}function yue(){j4=void 0}for(var M4=e=>j4?((...t)=>{try{return e(...t)}catch(e){if(j4&&j4(e)===!0)return()=>{};throw e}}):e,N4=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,bue=typeof Uint8Array>`u`?[]:new Uint8Array(256),P4=0;P4<N4.length;P4++)bue[N4.charCodeAt(P4)]=P4;var F4=class{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}};function I4(e){try{return e.contentDocument}catch{}}function L4(e){try{return e.contentWindow}catch{}}var xue=class{constructor(e){this.doc=e,this.unattachedDoc=null}parse(e){return this.parseWithConstructableStylesheet(e)||this.parseWithDetachedElement(e)}parseWithConstructableStylesheet(e){if(typeof CSSStyleSheet>`u`||typeof CSSStyleSheet.prototype.replaceSync!=`function`)return null;try{let t=new CSSStyleSheet;t.replaceSync(`x { ${e} }`);let n=t.cssRules[0];return!n||n.type!==CSSRule.STYLE_RULE?null:n.style}catch{return null}}parseWithDetachedElement(e){let t=this.getUnattachedDoc().createElement(`span`);return t.setAttribute(`style`,e),t.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}};function R4(e){return`__ln`in e}var Sue=class{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&R4(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&R4(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},z4=(e,t)=>`${e}@${t}`,Cue=class{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new Sue,r=e=>{let t=e,n=U2;for(;n===U2;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!C4(i))return;let a=T2(i.parentNode)?this.mirror.getId(S4(i)):this.mirror.getId(i.parentNode),o=r(i);if(a===-1||o===-1)return n.addNode(i);let s=r4(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{y4(e,this.mirror)&&!h4(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),b4(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),x4(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{if(h4(e,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(e,t);let n=L4(e);n&&this.canvasManager.addWindow(n),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});s&&(e.push({parentId:a,nextId:o,node:s}),t.add(s.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)V4(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(let e of this.addedSet)!H4(this.droppedSet,e)&&!V4(this.removes,e,this.mirror)||H4(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(a.value.parentNode),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(r(n.value)===-1)continue;if(t!==-1){e=n;break}{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(this.mirror.getId(r)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!g4(e.target,this.mirror))switch(e.type){case`characterData`:{let t=e.target.textContent;!h4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:t4(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,m4(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let n=F2(t),i=t.tagName;r=I2(t,i,n);let a=A2({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=j2({isMasked:t4(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a),element:t,value:r,maskInputFn:this.maskInputFn})}if(h4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!I4(t))n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!Q2(t.tagName,n)&&(i.attributes[n]=Z2(this.doc,M2(t.tagName),M2(n),r,t,this.maskAttributeFn),n===`style`)){let n=e.oldValue?this.styleDeclarationParser.parse(e.oldValue):null;for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==(n?.getPropertyValue(e)||``)||a!==(n?.getPropertyPriority(e)||``)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}if(n)for(let e of Array.from(n))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}break}case`childList`:if(h4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=T2(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);h4(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||g4(t,this.mirror)||!due(t,this.mirror)||(this.addedSet.has(t)?(B4(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||_4(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[z4(n,r)]?B4(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:T2(e.target)&&E2(e.target)?!0:void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(g4(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[z4(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);h4(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(e=>this.genAdds(e)),x4(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){`mutationCb.blockClass.blockSelector.unblockSelector.maskAllText.maskTextClass.unmaskTextClass.maskTextSelector.unmaskTextSelector.inlineStylesheet.maskInputOptions.maskAttributeFn.maskTextFn.maskInputFn.keepIframeSrcFn.recordCanvas.inlineImages.slimDOMOptions.dataURLOptions.doc.mirror.iframeManager.stylesheetManager.shadowDomManager.canvasManager.processedNodeManager.ignoreCSSAttributes`.split(`.`).forEach(t=>{this[t]=e[t]}),this.styleDeclarationParser=new xue(this.doc)}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function B4(e,t){e.delete(t),t.childNodes?.forEach(t=>B4(e,t))}function V4(e,t,n){return e.length!==0&&wue(e,t,n)}function wue(e,t,n){let r=t.parentNode;for(;r;){let t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}function H4(e,t){return e.size!==0&&U4(e,t)}function U4(e,t){let{parentNode:n}=t;return n?e.has(n)?!0:U4(e,n):!1}var W4=[];function G4(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function K4(e,t){let n=new Cue;W4.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=window?.Zone?.__symbol__?.(`MutationObserver`);i&&window[i]&&(r=window[i]);let a=new r(M4(t=>{e.onMutation&&e.onMutation(t)===!1||n.processMutations.bind(n)(t)}));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Tue({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=s4(M4(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=M4(s4(M4(e=>{let t=G4(e),{clientX:n,clientY:i}=v4(e)?e.changedTouches[0]:e;s||=u4(),o.push({x:n,y:i,id:r.getId(t),timeOffset:u4()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?Z.Drag:e instanceof MouseEvent?Z.MouseMove:Z.TouchMove)}),i,{trailing:!1})),u=[i4(`mousemove`,l,n),i4(`touchmove`,l,n),i4(`drag`,l,n)];return M4(()=>{u.forEach(e=>e())})}function Eue({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){if(o.mouseInteraction===!1)return()=>{};let s=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,c=[],l=null,u=t=>o=>{let s=G4(o);if(h4(s,r,i,a,!0))return;let c=null,u=t;if(`pointerType`in o){switch(o.pointerType){case`mouse`:c=k4.Mouse;break;case`touch`:c=k4.Touch;break;case`pen`:c=k4.Pen}c===k4.Touch?O4[t]===O4.MouseDown?u=`TouchStart`:O4[t]===O4.MouseUp&&(u=`TouchEnd`):k4.Pen}else v4(o)&&(c=k4.Touch);c===null?O4[t]===O4.Click&&(c=l,l=null):(l=c,(u.startsWith(`Touch`)&&c===k4.Touch||u.startsWith(`Mouse`)&&c===k4.Mouse)&&(c=null));let d=v4(o)?o.changedTouches[0]:o;if(!d)return;let f=n.getId(s),{clientX:p,clientY:m}=d;M4(e)({type:O4[u],id:f,x:p,y:m,...c!==null&&{pointerType:c}})};return Object.keys(O4).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&s[e]!==!1).forEach(e=>{let n=M2(e),r=u(e);if(window.PointerEvent)switch(O4[e]){case O4.MouseDown:case O4.MouseUp:n=n.replace(`mouse`,`pointer`);break;case O4.TouchStart:case O4.TouchEnd:return}c.push(i4(n,r,t))}),M4(()=>{c.forEach(e=>e())})}function q4({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,sampling:o}){return i4(`scroll`,M4(s4(M4(o=>{let s=G4(o);if(!s||h4(s,r,i,a,!0))return;let c=n.getId(s);if(s===t&&t.defaultView){let n=d4(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),o.scroll||100)),t)}function Due({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return i4(`resize`,M4(s4(M4(()=>{let t=f4(),i=p4();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var Oue=[`INPUT`,`TEXTAREA`,`SELECT`],J4=new WeakMap;function kue({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,ignoreClass:o,ignoreSelector:s,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:h}){function g(e){let n=G4(e),u=e.isTrusted,g=n&&N2(n.tagName);if(g===`OPTION`&&(n=n.parentElement),!n||!g||Oue.indexOf(g)<0||h4(n,r,i,a,!0))return;let v=n;if(v.classList.contains(o)||s&&v.matches(s))return;let y=F2(n),b=I2(v,g,y),x=!1,S=A2({maskInputOptions:c,tagName:g,type:y}),C=t4(n,f,m,p,h,S);(y===`radio`||y===`checkbox`)&&(x=n.checked),b=j2({isMasked:C,element:n,value:b,maskInputFn:l}),_(n,d?{text:b,isChecked:x,userTriggered:u}:{text:b,isChecked:x});let w=n.name;y===`radio`&&w&&x&&t.querySelectorAll(`input[type="radio"][name="${w}"]`).forEach(e=>{if(e!==n){let t=j2({isMasked:C,element:e,value:I2(e,g,y),maskInputFn:l});_(e,d?{text:t,isChecked:!x,userTriggered:!1}:{text:t,isChecked:!x})}})}function _(t,r){let i=J4.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){J4.set(t,r);let i=n.getId(t);M4(e)({...r,id:i})}}let v=(u.input===`last`?[`change`]:[`input`,`change`]).map(e=>i4(e,M4(g),t)),y=t.defaultView;if(!y)return()=>{v.forEach(e=>e())};let b=y.Object.getOwnPropertyDescriptor(y.HTMLInputElement.prototype,`value`),x=[[y.HTMLInputElement.prototype,`value`],[y.HTMLInputElement.prototype,`checked`],[y.HTMLSelectElement.prototype,`value`],[y.HTMLTextAreaElement.prototype,`value`],[y.HTMLSelectElement.prototype,`selectedIndex`],[y.HTMLOptionElement.prototype,`selected`]];return b&&b.set&&v.push(...x.map(e=>c4(e[0],e[1],{set(){M4(g)({target:this,isTrusted:!1})}},!1,y))),M4(()=>{v.forEach(e=>e())})}function Y4(e){let t=[];function n(e,t){if(Q4(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||Q4(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||Q4(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||Q4(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function X4(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Aue({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:M4((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=X4(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:M4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X4(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:M4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X4(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:M4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X4(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};$4(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:($4(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),$4(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),$4(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:M4((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=X4(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...Y4(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:M4((r,i,a)=>{let[o]=a,{id:s,styleId:c}=X4(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...Y4(i),o]}]}),r.apply(i,a)})})}),M4(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function Z4({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(n.host);let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),M4(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function jue({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:M4((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=X4(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:Y4(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:M4((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=X4(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:Y4(a.parentRule)}),i.apply(a,s)})}),M4(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Mue({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:a,doc:o}){let s=M4(o=>s4(M4(a=>{let s=G4(a);if(!s||h4(s,t,n,r,!0))return;let{currentTime:c,volume:l,muted:u,playbackRate:d}=s;e({type:o,id:i.getId(s),currentTime:c,volume:l,muted:u,playbackRate:d})}),a.media||500)),c=[i4(`play`,s(A4.Play),o),i4(`pause`,s(A4.Pause),o),i4(`seeked`,s(A4.Seeked),o),i4(`volumechange`,s(A4.VolumeChange),o),i4(`ratechange`,s(A4.RateChange),o)];return M4(()=>{c.forEach(e=>e())})}function Nue({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=l4(t.fonts,`add`,function(t){return function(n){return E4(M4(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),M4(()=>{r.forEach(e=>e())})}function Pue(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:a,selectionCb:o}=e,s=!0,c=M4(()=>{let e=t.getSelection();if(!e||s&&e?.isCollapsed)return;s=e.isCollapsed||!1;let c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:o,startOffset:s,endContainer:l,endOffset:u}=e.getRangeAt(t);h4(o,r,i,a,!0)||h4(l,r,i,a,!0)||c.push({start:n.getId(o),startOffset:s,end:n.getId(l),endOffset:u})}o({ranges:c})});return c(),i4(`selectionchange`,c)}function Fue({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:l4(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{}return e.apply(this,[n,r,i])}})}function Iue(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=K4(e,e.doc));let i=Tue(e),a=Eue(e),o=q4(e),s=Due(e,{win:n}),c=kue(e),l=Mue(e),u=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(u=Aue(e,{win:n}),d=Z4(e,e.doc),f=jue(e,{win:n}),e.collectFonts&&(p=Nue(e)));let m=Pue(e),h=Fue(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,n,t.options));return M4(()=>{W4.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(e=>e())})}function Q4(e){return window[e]!==void 0}function $4(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}var e3=class{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Lue=class{constructor(){this.crossOriginIframeMirror=new e3(W2),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}},Rue=class{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new e3(W2),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new e3(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0);let t=L4(e);t&&this.crossOriginIframeMap.set(t,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&L4(e)?.addEventListener(`message`,this.handleMessage.bind(this)),this.loadListener?.(e);let n=I4(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case D4.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:D4.IncrementalSnapshot,data:{source:Z.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case D4.Meta:case D4.Load:case D4.DomContentLoaded:return!1;case D4.Plugin:return t;case D4.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case D4.IncrementalSnapshot:switch(t.data.source){case Z.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Z.Drag:case Z.TouchMove:case Z.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Z.ViewportResize:return!1;case Z.MediaInteraction:case Z.MouseInteraction:case Z.Scroll:case Z.CanvasMutation:case Z.Input:return this.replaceIds(t.data,e,[`id`]),t;case Z.StyleSheetRule:case Z.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case Z.Font:return t;case Z.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case Z.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(t[i]=Array.isArray(t[i])?e.getIds(n,t[i]):e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==w2.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},zue=class{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}},Bue=class{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!E2(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let n=K4({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(q4({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),E4(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(Z4({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){let t=I4(e),n=L4(e);!t||!n||this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(l4(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&C4(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}},Vue=class{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new pue,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:O2(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Hue=class{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,gue(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},t3,n3;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var r3=zle();function i3(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,unblockSelector:o=null,ignoreClass:s=`rr-ignore`,ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u=`rr-mask`,unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:h,maskInputOptions:g,slimDOMOptions:_,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,maxCanvasSize:x=null,packFn:S,sampling:C={},dataURLOptions:w={},mousemoveWait:T,recordDOM:ee=!0,recordCanvas:E=!1,recordCrossOriginIframes:te=!1,recordAfter:ne=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:re=!1,collectFonts:ie=!1,inlineImages:ae=!1,plugins:oe,keepIframeSrcFn:D=()=>!1,ignoreCSSAttributes:se=new Set([]),errorHandler:ce,onMutation:le,getCanvasManager:ue}=e;vue(ce);let de=!te||window.parent===window,fe=!1;if(!de)try{window.parent.document&&(fe=!1)}catch{fe=!0}if(de&&!t)throw Error(`emit function is required`);if(!de&&!fe)return()=>{};T!==void 0&&C.mousemove===void 0&&(C.mousemove=T),r3.reset();let pe=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:g===void 0?{}:g,me=_===!0||_===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:_===`all`,headMetaDescKeywords:_===`all`}:_||{};fue();let he,ge=0,_e=e=>{for(let t of oe||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!fe&&(e=S(e)),e};t3=(e,i)=>{let a=e;if(a.timestamp=u4(),W4[0]?.isFrozen()&&a.type!==D4.FullSnapshot&&(a.type!==D4.IncrementalSnapshot||a.data.source!==Z.Mutation)&&W4.forEach(e=>e.unfreeze()),de)t?.(_e(a),i);else if(fe){let e={type:`rrweb`,event:_e(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===D4.FullSnapshot)he=a,ge=0;else if(a.type===D4.IncrementalSnapshot){if(a.data.source===Z.Mutation&&a.data.isAttachIframe)return;ge++;let e=r&&ge>=r,t=n&&he&&a.timestamp-he.timestamp>n;(e||t)&&we(!0)}};let ve=e=>{t3({type:D4.IncrementalSnapshot,data:{source:Z.Mutation,...e}})},O=e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.Scroll,...e}}),ye=e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.CanvasMutation,...e}}),be=new Vue({mutationCb:ve,adoptedStyleSheetCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.AdoptedStyleSheet,...e}})}),k=typeof __RRWEB_EXCLUDE_IFRAME__==`boolean`&&__RRWEB_EXCLUDE_IFRAME__?new Lue:new Rue({mirror:r3,mutationCb:ve,stylesheetManager:be,recordCrossOriginIframes:te,wrappedEmit:t3});for(let e of oe||[])e.getMirror&&e.getMirror({nodeMirror:r3,crossOriginIframeMirror:k.crossOriginIframeMirror,crossOriginIframeStyleMirror:k.crossOriginIframeStyleMirror});let xe=new Hue,Se=Wue(ue,{mirror:r3,win:window,mutationCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.CanvasMutation,...e}}),recordCanvas:E,blockClass:i,blockSelector:a,unblockSelector:o,maxCanvasSize:x,sampling:C.canvas,dataURLOptions:w,errorHandler:ce}),Ce=typeof __RRWEB_EXCLUDE_SHADOW_DOM__==`boolean`&&__RRWEB_EXCLUDE_SHADOW_DOM__?new zue:new Bue({mutationCb:ve,scrollCb:O,bypassOptions:{onMutation:le,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:pe,dataURLOptions:w,maskAttributeFn:v,maskTextFn:b,maskInputFn:y,recordCanvas:E,inlineImages:ae,sampling:C,slimDOMOptions:me,iframeManager:k,stylesheetManager:be,canvasManager:Se,keepIframeSrcFn:D,processedNodeManager:xe,ignoreCSSAttributes:se},mirror:r3}),we=(e=!1)=>{if(!ee)return;t3({type:D4.Meta,data:{href:window.location.href,width:p4(),height:f4()}},e),be.reset(),Ce.init(),W4.forEach(e=>e.lock());let t=uue(document,{mirror:r3,blockClass:i,blockSelector:a,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:pe,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,slimDOM:me,dataURLOptions:w,recordCanvas:E,inlineImages:ae,onSerialize:e=>{y4(e,r3)&&k.addIframe(e),b4(e,r3)&&be.trackLinkElement(e),x4(e)&&Ce.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{k.attachIframe(e,t);let n=L4(e);n&&Se.addWindow(n),Ce.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{be.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{ve({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:D,ignoreCSSAttributes:se});if(!t)return console.warn(`Failed to snapshot the document`);t3({type:D4.FullSnapshot,data:{node:t,initialOffset:d4(window)}}),W4.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&be.adoptStyleSheets(document.adoptedStyleSheets,r3.getId(document))};n3=we;try{let e=[],t=e=>M4(Iue)({onMutation:le,mutationCb:ve,mousemoveCb:(e,t)=>t3({type:D4.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.MouseInteraction,...e}}),scrollCb:O,viewportResizeCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.ViewportResize,...e}}),inputCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.Input,...e}}),mediaInteractionCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.MediaInteraction,...e}}),styleSheetRuleCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.StyleSheetRule,...e}}),styleDeclarationCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.StyleDeclaration,...e}}),canvasMutationCb:ye,fontCb:e=>t3({type:D4.IncrementalSnapshot,data:{source:Z.Font,...e}}),selectionCb:e=>{t3({type:D4.IncrementalSnapshot,data:{source:Z.Selection,...e}})},customElementCb:e=>{t3({type:D4.IncrementalSnapshot,data:{source:Z.CustomElement,...e}})},blockClass:i,ignoreClass:s,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:pe,inlineStylesheet:m,sampling:C,recordDOM:ee,recordCanvas:E,inlineImages:ae,userTriggeredOnInput:re,collectFonts:ie,doc:e,maskAttributeFn:v,maskInputFn:y,maskTextFn:b,keepIframeSrcFn:D,blockSelector:a,unblockSelector:o,slimDOMOptions:me,dataURLOptions:w,mirror:r3,iframeManager:k,stylesheetManager:be,shadowDomManager:Ce,processedNodeManager:xe,canvasManager:Se,ignoreCSSAttributes:se,plugins:oe?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>t3({type:D4.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});k.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{we(),e.push(t(document))};return document.readyState===`interactive`||document.readyState===`complete`?n():(e.push(i4(`DOMContentLoaded`,()=>{t3({type:D4.DomContentLoaded,data:{}}),ne===`DOMContentLoaded`&&n()})),e.push(i4(`load`,()=>{t3({type:D4.Load,data:{}}),ne===`load`&&n()},window))),()=>{e.forEach(e=>e()),xe.destroy(),n3=void 0,yue()}}catch(e){console.warn(e)}}function Uue(e){if(!n3)throw Error(`please take full snapshot after start recording`);n3(e)}i3.mirror=r3,i3.takeFullSnapshot=Uue;function Wue(e,t){try{return e?e(t):new F4}catch{return console.warn(`Unable to initialize CanvasManager`),new F4}}var Gue;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Gue||={});var Kue=3,que=5;function a3(e){return e>9999999999?e:e*1e3}function o3(e){return e>9999999999?e/1e3:e}function s3(e,t){t.category!==`sentry.transaction`&&([`ui.click`,`ui.input`].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:D4.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:`breadcrumb`,payload:mP(t,10,1e3)}}),t.category===`console`)))}var Jue=`button,a`;function c3(e){return e.closest(Jue)||e}function l3(e){let t=u3(e);return!t||!(t instanceof Element)?t:c3(t)}function u3(e){return Yue(e)?e.target:e}function Yue(e){return WN(e)&&`target`in e}var d3;function Xue(e){return d3||(d3=[],Zue()),d3.push(e),()=>{let t=d3?d3.indexOf(e):-1;t>-1&&d3.splice(t,1)}}function Zue(){XN(g2,`open`,function(e){return function(...t){if(d3)try{d3.forEach(e=>e())}catch{}return e.apply(g2,t)}})}var Que=new Set([Z.Mutation,Z.StyleSheetRule,Z.StyleDeclaration,Z.AdoptedStyleSheet,Z.CanvasMutation,Z.Selection,Z.MediaInteraction]);function $ue(e,t,n){e.handleClick(t,n)}var ede=class{constructor(e,t,n=s3){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){let e=Xue(()=>{this._lastMutation=f3()});this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(nde(t,this._ignoreSelector)||!rde(e))return;let n={timestamp:o3(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=o3(e)}registerScroll(e=Date.now()){this._lastScroll=o3(e)}registerClick(e){let t=c3(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=f3();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(let t of e){let e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:a,clickBreadcrumb:o}=e;if(i){let n=Math.min(e.mutationAfter||this._timeout,this._timeout)*1e3,r=n<this._timeout*1e3?`mutation`:`timeout`,i={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.slowClickDetected`,data:{...o.data,url:g2.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:a||1}};this._addBreadcrumbEvent(t,i);return}if(a>1){let e={type:`default`,message:o.message,timestamp:o.timestamp,category:`ui.multiClick`,data:{...o.data,url:g2.location.href,route:t.getCurrentRoute(),clickCount:a,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=f0(()=>this._checkClicks(),1e3)}},tde=[`A`,`BUTTON`,`INPUT`];function nde(e,t){return!!(!tde.includes(e.tagName)||e.tagName===`INPUT`&&![`submit`,`button`].includes(e.getAttribute(`type`)||``)||e.tagName===`A`&&(e.hasAttribute(`download`)||e.hasAttribute(`target`)&&e.getAttribute(`target`)!==`_self`)||t&&e.matches(t))}function rde(e){return!!(e.data&&typeof e.data.nodeId==`number`&&e.timestamp)}function f3(){return Date.now()/1e3}function ide(e,t){try{if(!ade(t))return;let{source:n}=t.data;if(Que.has(n)&&e.registerMutation(t.timestamp),n===Z.Scroll&&e.registerScroll(t.timestamp),ode(t)){let{type:n,id:r}=t.data,i=i3.mirror.getNode(r);i instanceof HTMLElement&&n===O4.Click&&e.registerClick(i)}}catch{}}function ade(e){return e.type===Kue}function ode(e){return e.data.source===Z.MouseInteraction}function p3(e){return{timestamp:Date.now()/1e3,type:`default`,...e}}var m3=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(m3||{}),sde=new Set([`id`,`class`,`aria-label`,`role`,`name`,`alt`,`title`,`data-test-id`,`data-testid`,`disabled`,`aria-disabled`,`data-sentry-component`]);function cde(e){let t={};!e[`data-sentry-component`]&&e[`data-sentry-element`]&&(e[`data-sentry-component`]=e[`data-sentry-element`]);for(let n in e)if(sde.has(n)){let r=n;(n===`data-testid`||n===`data-test-id`)&&(r=`testId`),t[r]=e[n]}return t}var lde=e=>t=>{if(!e.isEnabled())return;let n=ude(t);if(!n)return;let r=t.name===`click`,i=r?t.event:void 0;r&&e.clickDetector&&i?.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&$ue(e.clickDetector,n,l3(t.event)),s3(e,n)};function h3(e,t){let n=i3.mirror.getId(e),r=n&&i3.mirror.getNode(n),i=r&&i3.mirror.getMeta(r),a=i&&fde(i)?i:null;return{message:t,data:a?{nodeId:n,node:{id:n,tagName:a.tagName,textContent:Array.from(a.childNodes).map(e=>e.type===m3.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(``),attributes:cde(a.attributes)}}:{}}}function ude(e){let{target:t,message:n}=dde(e);return p3({category:`ui.${e.name}`,...h3(t,n)})}function dde(e){let t=e.name===`click`,n,r=null;try{r=t?l3(e.event):u3(e.event),n=R$(r,{maxStringLength:200})||`<unknown>`}catch{n=`<unknown>`}return{target:r,message:n}}function fde(e){return e.type===m3.Element}function pde(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=mde(t);n&&s3(e,n)}function mde(e){let{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a,target:o}=e;if(!o||hde(o)||!a)return null;let s=t||r||i,c=a.length===1;if(!s&&c)return null;let l=R$(o,{maxStringLength:200})||`<unknown>`;return p3({category:`ui.keyDown`,message:l,data:{...h3(o,l).data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:a}})}function hde(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable}var gde={resource:xde,paint:yde,navigation:bde};function g3(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function _de(e){return e.map(vde).filter(Boolean)}function vde(e){let t=gde[e.entryType];return t?t(e):null}function _3(e){return((KP()||g2.performance.timeOrigin)+e)/1e3}function yde(e){let{duration:t,entryType:n,name:r,startTime:i}=e,a=_3(i);return{type:n,name:r,start:a,end:a+t,data:void 0}}function bde(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:a,encodedBodySize:o,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:f,startTime:p,transferSize:m,type:h}=e;return i===0?null:{type:`${t}.${h}`,start:_3(p),end:_3(a),name:n,data:{size:m,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:l,domContentLoadedEventStart:s,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:a,redirectCount:f}}}function xde(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:a,decodedBodySize:o,encodedBodySize:s,responseStatus:c,transferSize:l}=e;return[`fetch`,`xmlhttprequest`].includes(n)?null:{type:`${t}.${n}`,start:_3(a),end:_3(i),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:s}}}function Sde(e){let t=e.entries[e.entries.length-1];return v3(e,`largest-contentful-paint`,t?.element?[t.element]:void 0)}function Cde(e){return e.sources!==void 0}function wde(e){let t=[],n=[];for(let r of e.entries)if(Cde(r)){let e=[];for(let t of r.sources)if(t.node){n.push(t.node);let r=i3.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return v3(e,`cumulative-layout-shift`,n,t)}function Tde(e){let t=e.entries[e.entries.length-1];return v3(e,`interaction-to-next-paint`,t?.target?[t.target]:void 0)}function v3(e,t,n,r){let i=e.value,a=e.rating,o=_3(i);return{type:`web-vital`,name:t,start:o,end:o,data:{value:i,size:i,rating:a,nodeIds:n?n.map(e=>i3.mirror.getId(e)):void 0,attributions:r}}}function Ede(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];return[`navigation`,`paint`,`resource`].forEach(e=>{r.push(w$(e,n))}),r.push(x$(g3(Sde,e)),b$(g3(wde,e)),C$(g3(Tde,e))),()=>{r.forEach(e=>e())}}var Q=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Dde=`var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;function Ode(){let e=new Blob([Dde]);return URL.createObjectURL(e)}var y3=[`log`,`warn`,`error`],b3=`[Replay] `;function x3(e,t=`info`){fH({category:`console`,data:{logger:`replay`},level:t,message:`${b3}${e}`},{level:t})}function kde(){let e=!1,t=!1,n={exception:()=>void 0,infoTick:()=>void 0,setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};return Q?(y3.forEach(e=>{n[e]=(...n)=>{K[e](b3,...n),t&&x3(n.join(``),qH(e))}}),n.exception=(r,...i)=>{i.length&&n.error&&n.error(...i),K.error(b3,r),e?zz(r,{mechanism:{handled:!0,type:`auto.function.replay.debug`}}):t&&x3(r,`error`)},n.infoTick=(...e)=>{K.log(b3,...e),t&&setTimeout(()=>x3(e[0]),0)}):y3.forEach(e=>{n[e]=()=>void 0}),n}var $=kde(),S3=class extends Error{constructor(){super(`Event buffer exceeded maximum size of ${x2}.`)}},C3=class{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return`sync`}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>x2)throw new S3;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(let{timestamp:t}of this.events)(e===null||t<e)&&(e=t);return e===null?e:a3(e)}},Ade=class{constructor(e){this._onMessage=({data:e})=>{let t=e;if(typeof t.id!=`number`)return;let n=this._pending.get(t.id);if(!(!n||n.method!==t.method)){if(this._pending.delete(t.id),!t.success){Q&&$.error(`Error in compression worker: `,t.response),n.reject(Error(`Error in compression worker`));return}n.resolve(t.response)}},this._worker=e,this._id=0,this._pending=new Map,this._worker.addEventListener(`message`,this._onMessage)}ensureReady(){return this._ensureReadyPromise||=new Promise((e,t)=>{this._worker.addEventListener(`message`,({data:n})=>{n.success?e():(Q&&$.warn(`Received worker message with unsuccessful status`,n),t(Error(`Received worker message with unsuccessful status`)))},{once:!0}),this._worker.addEventListener(`error`,e=>{Q&&$.warn(`Failed to load Replay compression worker`,e),t(Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.message:`Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load.`}`))},{once:!0})}),this._ensureReadyPromise}destroy(){Q&&$.log(`Destroying compression worker`),this._worker.removeEventListener(`message`,this._onMessage),this._pending.forEach(e=>e.reject(Error(`Worker destroyed`))),this._pending.clear(),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{this._pending.set(n,{method:e,resolve:r,reject:i});try{this._worker.postMessage({id:n,method:e,arg:t})}catch(e){this._pending.delete(n),i(e)}})}_getAndIncrementId(){return this._id++}},jde=class{constructor(e){this._worker=new Ade(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return`worker`}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=a3(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>x2?Promise.reject(new S3):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage(`clear`).then(null,e=>{Q&&$.exception(e,`Sending "clear" message to worker failed`,e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage(`addEvent`,e)}async _finishRequest(){let e=await this._worker.postMessage(`finish`);return this._earliestTimestamp=null,this._totalSize=0,e}},Mde=class{constructor(e){this._fallback=new C3,this._compression=new jde(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){Q&&$.exception(e,`Failed to load the compression worker, falling back to simple buffer`);return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(let t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){Q&&$.exception(e,`Failed to add events when switching buffers.`)}}};function Nde({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=Pde(t);if(e)return e}return Q&&$.log(`Using simple buffer`),new C3}function Pde(e){try{let t=e||Fde();return t?(Q&&$.log(`Using compression worker${e?` from ${e}`:``}`),new Mde(new Worker(t))):void 0}catch(e){Q&&$.exception(e,`Failed to create compression worker`)}}function Fde(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>`u`||!__SENTRY_EXCLUDE_REPLAY_WORKER__?Ode():``}function w3(){try{return`sessionStorage`in g2&&!!g2.sessionStorage}catch{return!1}}function Ide(e){Lde(),e.session=void 0}function Lde(){if(w3())try{g2.sessionStorage.removeItem(_2)}catch{}}function T3(e){return e!==void 0&&Math.random()<e}function E3(e){if(w3())try{g2.sessionStorage.setItem(_2,JSON.stringify(e))}catch{}}function D3(e){let t=Date.now();return{id:e.id||jP(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function Rde(e,t){return T3(e)?`session`:t?`buffer`:!1}function O3({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=D3({sampled:Rde(e,t),previousSessionId:r});return n&&E3(i),i}function zde(){if(!w3())return null;try{let e=g2.sessionStorage.getItem(_2);if(!e)return null;let t=JSON.parse(e);return Q&&$.infoTick(`Loading existing session`),D3(t)}catch{return null}}function k3(e,t,n=+new Date){return e===null||t===void 0||t<0||t!==0&&e+t<=n}function Bde(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return k3(e.started,t,r)||k3(e.lastActivity,n,r)}function A3(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!Bde(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled===`buffer`&&e.segmentId===0)}function j3({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let i=r.stickySession&&zde();return i?A3(i,{sessionIdleExpire:e,maxReplayDuration:t})?(Q&&$.infoTick(`Session in sessionStorage is expired, creating new one...`),O3(r,{previousSessionId:i.id})):i:(Q&&$.infoTick(`Creating new session`),O3(r,{previousSessionId:n}))}function Vde(e){return e.type===D4.Custom}function M3(e,t,n){return P3(e,t)?(N3(e,t,n),!0):!1}function Hde(e,t,n){return P3(e,t)?N3(e,t,n):Promise.resolve(null)}async function N3(e,t,n){let{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;let i=e.recordingMode===`buffer`;try{n&&i&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);let a=Ude(t,e.getOptions().beforeAddRecordingEvent);return a?await r.addEvent(a):void 0}catch(t){if(!e.isEnabled())return e.handleException(t),null;let n=t&&t instanceof S3,a=n?`eventBufferOverflow`:`eventBufferError`,o=J();if(o){let e=n?`buffer_overflow`:`internal_sdk_error`;o.recordDroppedEvent(e,`replay`)}if(n&&i)return r.clear(),r.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:a})}}function P3(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=a3(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(Q&&$.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function Ude(e,t){try{if(typeof t==`function`&&Vde(e))return t(e)}catch(e){return Q&&$.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}var F3=100;function I3(e,t,n){let r=e.getContext();t&&r.traceIds.size<F3&&r.traceIds.add(t),n&&r.segmentNames.size<F3&&r.segmentNames.add(n)}function Wde(e){return t=>{e.isEnabled()&&I3(e,t.trace_id,t.name||void 0)}}function L3(e){return!e.type}function R3(e){return e.type===`transaction`}function Gde(e){return e.type===`replay_event`}function z3(e){return e.type===`feedback`}function Kde(e){return(t,n)=>{if(!e.isEnabled()||!L3(t)&&!R3(t))return;let r=n.statusCode;if(!(!r||r<200||r>=300)){if(R3(t)){qde(e,t);return}Jde(e,t)}}}function qde(e,t){I3(e,t.contexts?.trace?.trace_id,t.transaction)}function Jde(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!==`buffer`||!t.tags?.replayId)return;let{beforeErrorSampling:r}=e.getOptions();typeof r==`function`&&!r(t)||f0(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})}function Yde(e){return t=>{!e.isEnabled()||!L3(t)||Xde(e,t)}}function Xde(e,t){let n=t.exception?.values?.[0]?.value;typeof n==`string`&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&s3(e,p3({category:`replay.hydrate-error`,data:{url:NJ()}}))}function Zde(e){let t=J();t&&t.on(`beforeAddBreadcrumb`,t=>Qde(e,t))}function Qde(e,t){if(!e.isEnabled()||!B3(t))return;let n=$de(t);n&&s3(e,n)}function $de(e){return!B3(e)||[`fetch`,`xhr`,`sentry.event`,`sentry.transaction`].includes(e.category)||e.category.startsWith(`ui.`)?null:e.category===`console`?efe(e):p3(e)}function efe(e){let t=e.data?.arguments;if(!Array.isArray(t)||t.length===0)return p3(e);let n=!1,r=t.map(e=>{if(!e)return e;if(typeof e==`string`)return e.length>b2?(n=!0,`${e.slice(0,b2)}\u2026`):e;if(typeof e==`object`)try{let t=mP(e,7);return JSON.stringify(t).length>b2?(n=!0,`${JSON.stringify(t,null,2).slice(0,b2)}\u2026`):t}catch{}return e});return p3({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:[`CONSOLE_ARG_TRUNCATED`]}}:{}}})}function B3(e){return!!e.category}function tfe(e,t){return e.type||!e.exception?.values?.length?!1:!!t.originalException?.__rrweb__}function V3(){let e=q().getPropagationContext().dsc;e&&delete e.replay_id;let t=lL();if(t){let e=OL(t);delete e.replay_id}}function H3(e){let t=q().getPropagationContext().dsc;t&&(t.replay_id=e);let n=lL();if(n){let t=OL(n);t.replay_id=e}}function nfe(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:D4.Custom,timestamp:t.timestamp*1e3,data:{tag:`breadcrumb`,payload:{timestamp:t.timestamp,type:`default`,category:`sentry.feedback`,data:{feedbackId:t.event_id}}}}),!1))}function rfe(e,t){return e.recordingMode!==`buffer`||t.message===v2||!t.exception||t.type?!1:T3(e.getOptions().errorSampleRate)}function ife(e){return Object.assign((t,n)=>{if(e.session&&A3(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&V3(),!e.isEnabled()||e.isPaused())return t;if(Gde(t))return delete t.breadcrumbs,t;if(!L3(t)&&!R3(t)&&!z3(t))return t;if(!e.checkAndHandleExpiredSession())return V3(),t;if(z3(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),nfe(e,t),t;if(tfe(t,n)&&!e.getOptions()._experiments.captureExceptions)return Q&&$.log(`Ignoring error from rrweb internals`,t),null;let r=rfe(e,t);if((r||e.recordingMode===`session`)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&e.recordingMode===`buffer`&&e.session?.sampled===`buffer`){let t=e.session;t.dirty=!0,e.getOptions().stickySession&&E3(t)}return t},{id:`Replay`})}function U3(e,t){return t.map(({type:t,start:n,end:r,name:i,data:a})=>{let o=e.throttledAddEvent({type:D4.Custom,timestamp:n,data:{tag:`performanceSpan`,payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:a}}});return typeof o==`string`?Promise.resolve(null):o})}function afe(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:`navigation.push`,start:r,end:r,name:n,data:{previous:t}}}function ofe(e){return t=>{if(!e.isEnabled())return;let n=afe(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(U3(e,[n]),!1)))}}function sfe(e,t){return Q&&e.getOptions()._experiments.traceInternals?!1:$V(t,J())}function W3(e,t){e.isEnabled()&&t!==null&&(sfe(e,t.name)||e.addUpdate(()=>(U3(e,[t]),!0)))}function G3(e){if(!e)return;let t=new TextEncoder;try{if(typeof e==`string`)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=v0(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function K3(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function q3(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta};return n.warnings=[...n.warnings||[],t],e._meta=n,e}function J3(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:a,statusCode:o,request:s,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:{method:a,statusCode:o,request:s,response:c}}}function Y3(e){return{headers:{},size:e,_meta:{warnings:[`URL_SKIPPED`]}}}function X3(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:a}=cfe(n);return r.body=i,a?.length&&(r._meta={warnings:a}),r}function Z3(e,t){return Object.entries(e).reduce((n,[r,i])=>{let a=r.toLowerCase();return t.includes(a)&&e[r]&&(n[a]=i),n},{})}function cfe(e){if(!e||typeof e!=`string`)return{body:e};let t=e.length>y2,n=lfe(e);if(t){let t=e.slice(0,y2);return n?{body:t,warnings:[`MAYBE_JSON_TRUNCATED`]}:{body:`${t}\u2026`,warnings:[`TEXT_TRUNCATED`]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function lfe(e){let t=e[0],n=e[e.length-1];return t===`[`&&n===`]`||t===`{`&&n===`}`}function Q3(e,t){return DP(ufe(e),t)}function ufe(e,t=g2.document.baseURI){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(g2.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith(`/`)&&r.endsWith(`/`)?r.slice(0,-1):r}async function dfe(e,t,n){try{let r=J3(`resource.fetch`,await pfe(e,t,n));W3(n.replay,r)}catch(e){Q&&$.exception(e,`Failed to capture fetch breadcrumb`)}}function ffe(e,t){let{input:n,response:r}=t,i=G3(n?b0(n):void 0),a=r?K3(r.headers.get(`content-length`)):void 0;i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}async function pfe(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r}=t,{url:o,method:s,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=Q3(o,n.networkDetailAllowUrls)&&!Q3(o,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:a,url:o,method:s,statusCode:c,request:d?mfe(n,t.input,l):Y3(l),response:await hfe(d,n,t.response,u)}}function mfe({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?vfe(n,t):{};if(!e)return X3(i,r,void 0);let[a,o]=y0(b0(n),$),s=X3(i,r,a);return o?q3(s,o):s}async function hfe(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&i!==void 0)return Y3(i);let a=r?$3(r.headers,n):{};if(!r||!t&&i!==void 0)return X3(a,i,void 0);let[o,s]=await _fe(r),c=gfe(o,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:a});return s?q3(c,s):c}function gfe(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:i}){try{let a=e?.length&&n===void 0?G3(e):n;return r?t?X3(i,a,e):X3(i,a,void 0):Y3(a)}catch(e){return Q&&$.exception(e,`Failed to serialize response body`),X3(i,n,void 0)}}async function _fe(e){let t=yfe(e);if(!t)return[void 0,`BODY_PARSE_ERROR`];try{return[await bfe(t)]}catch(e){return e instanceof Error&&e.message.indexOf(`Timeout`)>-1?(Q&&$.warn(`Parsing text body from response timed out`),[void 0,`BODY_PARSE_TIMEOUT`]):(Q&&$.exception(e,`Failed to get text body from response`),[void 0,`BODY_PARSE_ERROR`])}}function $3(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function vfe(e,t){return e.length===1&&typeof e[0]!=`string`?e6(e[0],t):e.length===2?e6(e[1],t):{}}function e6(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?$3(n,t):Array.isArray(n)?{}:Z3(n,t):{}}function yfe(e){try{return e.clone()}catch(e){Q&&$.exception(e,`Failed to clone response body`)}}function bfe(e){return new Promise((t,n)=>{let r=f0(()=>n(Error(`Timeout while trying to read response body`)),500);xfe(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}async function xfe(e){return await e.text()}async function Sfe(e,t,n){try{let r=J3(`resource.xhr`,wfe(e,t,n));W3(n.replay,r)}catch(e){Q&&$.exception(e,`Failed to capture xhr breadcrumb`)}}function Cfe(e,t){let{xhr:n,input:r}=t;if(!n)return;let i=G3(r),a=n.getResponseHeader(`content-length`)?K3(n.getResponseHeader(`content-length`)):Dfe(n.response,n.responseType);i!==void 0&&(e.data.request_body_size=i),a!==void 0&&(e.data.response_body_size=a)}function wfe(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:a=r,input:o,xhr:s}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:f}=e.data;if(!c)return null;if(!s||!Q3(c,n.networkDetailAllowUrls)||Q3(c,n.networkDetailDenyUrls))return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:Y3(d),response:Y3(f)};let p=s[p0],m=p?Z3(p.request_headers,n.networkRequestHeaders):{},h=Z3(x0(s),n.networkResponseHeaders),[g,_]=n.networkCaptureBodies?y0(o,$):[void 0],[v,y]=n.networkCaptureBodies?Tfe(s):[void 0],b=X3(m,d,g),x=X3(h,f,v);return{startTimestamp:i,endTimestamp:a,url:c,method:l,statusCode:u,request:_?q3(b,_):b,response:y?q3(x,y):x}}function Tfe(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return Efe(e.response,e.responseType)}catch(e){t.push(e)}return Q&&$.warn(`Failed to get xhr response body`,...t),[void 0]}function Efe(e,t){try{if(typeof e==`string`)return[e];if(e instanceof Document)return[e.body.outerHTML];if(t===`json`&&WN(e))return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return Q&&$.exception(t,`Failed to serialize body`,e),[void 0,`BODY_PARSE_ERROR`]}return Q&&$.log(`Skipping network body because of body type`,e),[void 0,`UNPARSEABLE_BODY_TYPE`]}function Dfe(e,t){try{return G3(t===`json`&&WN(e)?JSON.stringify(e):e)}catch{return}}function Ofe(e){let t=J();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o}=e.getOptions(),s={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:a,networkResponseHeaders:o};t&&t.on(`beforeAddBreadcrumb`,(e,t)=>kfe(s,e,t))}catch{}}function kfe(e,t,n){if(t.data)try{Afe(t)&&Mfe(n)&&(Cfe(t,n),Sfe(t,n,e)),jfe(t)&&Nfe(n)&&(ffe(t,n),dfe(t,n,e))}catch(e){Q&&$.exception(e,`Error when enriching network breadcrumb`)}}function Afe(e){return e.category===`xhr`}function jfe(e){return e.category===`fetch`}function Mfe(e){return e?.xhr}function Nfe(e){return e?.input!==void 0}function Pfe(e){let t=J();$1(lde(e)),o0(ofe(e)),Zde(e),Ofe(e),eB(ife(e)),t&&(t.on(`beforeSendEvent`,Yde(e)),t.on(`afterSendEvent`,Kde(e)),t.on(`createDsc`,t=>{let n=e.getSessionId();n&&e.isEnabled()&&e.recordingMode===`session`&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on(`processSegmentSpan`,Wde(e)),t.on(`spanStart`,t=>{e.lastActiveSpan=t}),t.on(`spanEnd`,t=>{e.lastActiveSpan=t}),t.on(`beforeSendFeedback`,async(t,n)=>{let r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&(t.contexts.feedback.source===`api`&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on(`openFeedbackWidget`,async()=>{await e.sendBufferedReplayOrFlush()}))}async function Ffe(e){try{return Promise.all(U3(e,[Ife(g2.performance.memory)]))}catch{return[]}}function Ife(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:`memory`,name:`memory`,start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Lfe(e,t,n){return RR(e,t,{...n,setTimeoutImpl:f0})}var t6=G.navigator;function Rfe(){return/iPhone|iPad|iPod/i.test(t6?.userAgent??``)||/Macintosh/i.test(t6?.userAgent??``)&&t6?.maxTouchPoints&&t6?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{}}function zfe(e){let t=!1;return(n,r)=>{try{if(!e.checkAndHandleExpiredSession()){Q&&$.warn(`Received replay event after session expired.`);return}let i=r||!t;t=!0,Bfe(n),e.clickDetector&&ide(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode===`buffer`&&i&&e.setInitialState(),!M3(e,n,i))return!0;if(!i)return!1;let t=e.session;if(Hfe(e,i),e.recordingMode===`buffer`&&t&&e.eventBuffer&&!t.dirty){let n=e.eventBuffer.getEarliestTimestamp();n&&(Q&&$.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&E3(t))}return t?.previousSessionId||e.recordingMode===`session`&&e.flush(),!0})}catch(t){e.handleException(t)}}}function Bfe(e){let t=e.data;if(!(e.type!==D4.IncrementalSnapshot||!t||typeof t!=`object`||!(`source`in t)||t.source!==Z.Mutation||!(`attributes`in t)||!Array.isArray(t.attributes)))for(let e of t.attributes){let t=i3.mirror.getNode(e.id),n=t&&i3.mirror.getMeta(t);if(n?.type===m3.Element)for(let[t,r]of Object.entries(e.attributes))r===null?delete n.attributes[t]:n.attributes[t]=r}}function Vfe(e){let t=e.getOptions();return{type:D4.Custom,timestamp:Date.now(),data:{tag:`options`,payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type===`worker`:!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Hfe(e,t){!t||e.session?.segmentId!==0||M3(e,Vfe(e),!1)}function Ufe(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Wfe(e,t,n,r){return ML(GL(e,WL(e),r,n),[[{type:`replay_event`},e],[{type:`replay_recording`,length:typeof t==`string`?new TextEncoder().encode(t).length:t.length},t]])}function Gfe({recordingData:e,headers:t}){let n,r=`${JSON.stringify(t)}
|
|
1001
|
-
`;if(typeof e==`string`)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}async function Kfe({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:typeof e._integrations==`object`&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0};e.emit(`preprocessEvent`,r,i);let a=await Oz(e.getOptions(),r,i,t,e,kF());if(!a)return null;e.emit(`postprocessEvent`,a,i),a.platform=a.platform||`javascript`;let{name:o,version:s,settings:c}=e.getSdkMetadata()?.sdk||{};return a.sdk={...a.sdk,name:o||`sentry.javascript.unknown`,version:s||`0.0.0`,settings:c},a}async function qfe({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:a}){let o=Gfe({recordingData:e,headers:{segment_id:n}}),{urls:s,errorIds:c,traceIds:l,segmentNames:u,initialTimestamp:d}=r,f=J(),p=q(),m=f?.getTransport(),h=f?.getDsn();if(!f||!m||!h||!a.sampled)return Promise.resolve({});let g=await Kfe({scope:p,client:f,replayId:t,event:{type:vle,replay_start_timestamp:d/1e3,timestamp:i/1e3,error_ids:c,trace_ids:l,segment_names:u,urls:s,replay_id:t,segment_id:n,replay_type:a.sampled}});if(!g)return f.recordDroppedEvent(`event_processor`,`replay`),Q&&$.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;let _=Wfe(g,o,h,f.getOptions().tunnel),v;try{v=await m.send(_)}catch(e){let t=Error(v2);try{t.cause=e}catch{}throw t}let y=oV({},v);if(aV(y,`replay`))throw new r6(y);if(typeof v.statusCode==`number`&&(v.statusCode<200||v.statusCode>=300))throw new n6(v.statusCode);return v}var n6=class extends Error{constructor(e){super(`Transport returned status code ${e}`)}},r6=class extends Error{constructor(e){super(`Rate limit hit`),this.rateLimits=e}},i6=class extends Error{constructor(){super(`Session is too long, not sending replay`)}};async function a6(e,t={count:0,interval:wle}){let{recordingData:n,onError:r}=e;if(n.length)try{return await qfe(e),!0}catch(n){if(n instanceof n6||n instanceof r6)throw n;if(Hz(`Replays`,{_retryCount:t.count}),r&&r(n),t.count>=Tle){let e=Error(`${v2} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{f0(async()=>{try{await a6(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}var o6=`__THROTTLED`,Jfe=`__SKIPPED`;function Yfe(e,t,n){let r=new Map,i=e=>{let t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})},a=()=>[...r.values()].reduce((e,t)=>e+t,0),o=!1;return(...n)=>{let s=Math.floor(Date.now()/1e3);if(i(s),a()>=t){let e=o;return o=!0,e?Jfe:o6}o=!1;let c=r.get(s)||0;return r.set(s,c+1),e(...n)}}var Xfe=class{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode=`session`,this.timeouts={sessionIdlePause:yle,sessionIdleExpire:ble},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,segmentNames:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:``},this._recordingOptions=t,this._options=e,this._debouncedFlush=Lfe(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=Yfe((e,t)=>Hde(this,e,t),300,5);let{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(Ele,n),timeout:n,scrollTimeout:Dle,ignoreSelector:r?r.join(`,`):``}:void 0;if(i&&(this.clickDetector=new ede(this,i)),Q){let t=e._experiments;$.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{g2.document.visibilityState===`visible`?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{let e=p3({category:`ui.blur`});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{let e=p3({category:`ui.focus`});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{pde(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){Q&&$.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;if(this._requiresManualStart=r,!r){if(this._initializeSessionForSampling(e),!this.session){Q&&$.exception(Error(`Unable to initialize and create session`));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled===`buffer`&&this.session.segmentId===0?`buffer`:`session`,Q&&$.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode===`session`){Q&&$.log(`Recording is already in progress`);return}if(this._isEnabled&&this.recordingMode===`buffer`){Q&&$.log("Buffering is in progress, call `flush()` to save the replay");return}Q&&$.infoTick(`Starting replay in session mode`),this._updateUserActivity();let e=j3({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode=`session`,this._initializeRecording()}startBuffering(){if(this._isEnabled){Q&&$.log("Buffering is in progress, call `flush()` to save the replay");return}Q&&$.infoTick(`Starting replay in buffer mode`);let e=j3({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode=`buffer`,this._initializeRecording()}startRecording(){try{let e=this._canvas;this._stopRecording=i3({...this._recordingOptions,...this.recordingMode===`buffer`?{checkoutEveryNms:Cle}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:zfe(this),...Rfe(),onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&=(this._stopRecording(),void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode=`buffer`;let n=t??`manual`;J()?.emit(`replayEnd`,{sessionId:this.session?.id,reason:n});try{Q&&$.log(`Stopping Replay triggered by ${n}`),V3(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,Ide(this)}catch(e){this.handleException(e)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Q&&$.log(`Pausing replay`))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),Q&&$.log(`Resuming replay`))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if(this.recordingMode===`session`)return this.flushImmediate();let t=Date.now();Q&&$.log(`Converting buffer to session`),await this.flushImmediate();let n=this.stopRecording();!e||!n||this.recordingMode!==`session`&&(this.recordingMode=`session`,this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession(),H3(this.session.id)),this.startRecording())}addUpdate(e){let t=e();this.recordingMode===`buffer`||!this._isEnabled||t!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode===`buffer`?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!(e&&this.session?.sampled===!1))return this.session?.id}checkAndHandleExpiredSession(){if(this._lastActivity&&k3(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session?.sampled===`session`){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${g2.location.pathname}${g2.location.hash}${g2.location.search}`,t=`${g2.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===o6){let e=p3({category:`replay.throttled`});this.addUpdate(()=>!M3(this,{type:que,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastActiveSpan||lL(),t=e&&sL(e),n=(t&&KI(t).data||{})[PF];if(!(!t||!n||![`route`,`custom`].includes(n)))return KI(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=Nde({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&J()?.emit(`replayStart`,{sessionId:this.session.id,recordingMode:this.recordingMode}),this.startRecording(),this.recordingMode===`session`&&this.session&&H3(this.session.id)}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0,n=j3({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;let e=this.session;return!A3(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:`sessionExpired`}),this.initializeSampling(e.id))}_addListeners(){try{g2.document.addEventListener(`visibilitychange`,this._handleVisibilityChange),g2.addEventListener(`blur`,this._handleWindowBlur),g2.addEventListener(`focus`,this._handleWindowFocus),g2.addEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||=(Pfe(this),!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=Ede(this)}_removeListeners(){try{g2.document.removeEventListener(`visibilitychange`,this._handleVisibilityChange),g2.removeEventListener(`blur`,this._handleWindowBlur),g2.removeEventListener(`focus`,this._handleWindowFocus),g2.removeEventListener(`keydown`,this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){if(this.session){if(A3(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){V3();return}e&&this._createCustomBreadcrumb(e),this.conditionalFlush()}}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){Q&&$.log(`Document has become active, but session has expired`);return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:D4.Custom,timestamp:e.timestamp||0,data:{tag:`breadcrumb`,payload:e}})})}_addPerformanceEntries(){let e=_de(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(U3(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.segmentNames.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),segmentNames:Array.from(this._context.segmentNames),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){Q&&$.error(`No session or eventBuffer found to flush.`);return}if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await Ffe(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new i6;let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession(),await a6({replayId:e,recordingData:await this.eventBuffer.finish(),segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:`sendError`});let t=J();if(t){let n;n=e instanceof r6?`ratelimit_backoff`:e instanceof i6?`invalid`:`send_error`,t.recordDroppedEvent(n,`replay`)}}}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){Q&&$.error(`Attempting to finish replay event after session expired.`);return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){Q&&$.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?`short`:`long`}, not sending replay.`),r&&this._debouncedFlush();return}let a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&Q&&$.log(`Flushing initial segment without checkout.`);let o=!!this._flushLock;this._flushLock||=this._runFlush();try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,o&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&E3(this.session)}_onMutationHandler(e){let{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{let n=Ufe(e.target),r=t.join(`,`);return n?.matches(r)}))return!1;let n=e.length,r=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,a=r&&n>r;if(n>i||a){let e=p3({category:`replay.mutations`,data:{count:n,limit:a}});this._createCustomBreadcrumb(e)}return!a||(this.stop({reason:`mutationLimit`,forceFlush:this.recordingMode===`session`}),!1)}};function s6(e,t){return[...e,...t].join(`,`)}function Zfe({mask:e,unmask:t,block:n,unblock:r,ignore:i}){return{maskTextSelector:s6(e,[`.sentry-mask`,`[data-sentry-mask]`]),unmaskTextSelector:s6(t,[]),blockSelector:s6(n,[`.sentry-block`,`[data-sentry-block]`,`base`,`iframe[srcdoc]:not([src])`]),unblockSelector:s6(r,[]),ignoreSelector:s6(i,[`.sentry-ignore`,`[data-sentry-ignore]`,`input[type="file"]`])}}function Qfe({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:a}){if(i.unmaskTextSelector&&e.matches(i.unmaskTextSelector))return a;let o=n.includes(t),s=r&&t===`value`&&e.tagName===`INPUT`&&[`submit`,`button`].includes(e.getAttribute(`type`)||``);return o||s?a.replace(/[\S]/g,`*`):a}var c6=`img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]`,$fe=[`content-length`,`content-type`,`accept`],epe=Symbol.for(`sentry__originalRequestBody`),l6=!1,u6=!1;function tpe(){if(typeof Request>`u`||u6)return;let e=Request;try{let t=function(t,n){let r=new e(t,n);return n?.body!=null&&(r[epe]=n.body),r};t.prototype=e.prototype,G.Request=t,u6=!0}catch{}}var d6=(e=>new npe(e)),npe=class{constructor({flushMinDelay:e=xle,flushMaxDelay:t=Sle,minReplayDuration:n=Ole,maxReplayDuration:r=S2,stickySession:i=!0,useCompression:a=!0,workerUrl:o,_experiments:s={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:f=1e4,slowClickTimeout:p=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:h=[],networkDetailDenyUrls:g=[],networkCaptureBodies:_=!0,networkRequestHeaders:v=[],networkResponseHeaders:y=[],mask:b=[],maskAttributes:x=[`title`,`placeholder`,`aria-label`],unmask:S=[],block:C=[],unblock:w=[],ignore:T=[],maskFn:ee,beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re=!1}={}){this.name=`Replay`;let ie=Zfe({mask:b,unmask:S,block:C,unblock:w,ignore:T});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:ee,maskInputFn:ee,maskAttributeFn:(e,t,n)=>Qfe({maskAttributes:x,maskAllText:c,privacyOptions:ie,key:e,value:t,el:n}),...ie,slimDOMOptions:`all`,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!s.recordCrossOriginIframes},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,kle),maxReplayDuration:Math.min(r,S2),stickySession:i,useCompression:a,workerUrl:o,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:f,slowClickTimeout:p,slowClickIgnoreSelectors:m,networkDetailAllowUrls:h,networkDetailDenyUrls:g,networkCaptureBodies:_,networkRequestHeaders:f6(v),networkResponseHeaders:f6(y),beforeAddRecordingEvent:E,beforeErrorSampling:te,onError:ne,attachRawBodyFromRequest:re,_experiments:s},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${c6}`:c6,this._recordingOptions.ignoreCSSAttributes=new Set([`background-image`])),this._isInitialized&&OB())throw Error(`Multiple Sentry Session Replay instances are not supported`);this._isInitialized=!0}get _isInitialized(){return l6}set _isInitialized(e){l6=e}afterAllSetup(e){!OB()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&tpe(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(e){return this._replay?this._replay.stop({forceFlush:e?.flush??this._replay.recordingMode===`session`,reason:`manual`}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}processSpan(e){let t=this.getReplayId(!0);t&&(uz(e,{"sentry.replay_id":t}),this.getRecordingMode()===`buffer`&&uz(e,{"sentry._internal.replay_is_buffering":!0}))}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let t=rpe(this._initialOptions,e);this._replay=new Xfe({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let t=e.getIntegrationByName(`ReplayCanvas`);if(!t)return;this._replay._canvas=t.getOptions()}catch{}}};function rpe(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},i=kI(n.replaysSessionSampleRate),a=kI(n.replaysOnErrorSampleRate);return i==null&&a==null&&rN(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),i!=null&&(r.sessionSampleRate=i),a!=null&&(r.errorSampleRate=a),r}function f6(e){return[...$fe,...e.map(e=>e.toLowerCase())]}function ipe(){return J()?.getIntegrationByName(`Replay`)}var ape=Object.defineProperty,ope=(e,t,n)=>t in e?ape(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p6=(e,t,n)=>ope(e,typeof t==`symbol`?t:t+``,n),spe=class{constructor(){p6(this,`idNodeMap`,new Map),p6(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function cpe(){return new spe}function lpe(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}function m6(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:m6(e.parentNode,t,n,r+1)}function h6(e,t){return n=>{let r=n;if(r===null)return!1;try{if(e){if(typeof e==`string`){if(r.matches(`.${e}`))return!0}else if(lpe(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}var g6=`Please stop import mirror directly. Instead of that,\r
|
|
1002
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
1003
|
-
or you can use record.mirror to access the mirror instance during recording.`,_6={map:{},getId(){return console.error(g6),-1},getNode(){return console.error(g6),null},removeNodeFromMap(){console.error(g6)},has(){return console.error(g6),!1},reset(){console.error(g6)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(_6=new Proxy(_6,{get(e,t,n){return t===`map`&&console.error(g6),Reflect.get(e,t,n)}}));function v6(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){w6(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>v6(e,t,a||{},!0)}function y6(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function upe(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function b6(e,t,n,r,i){if(!e)return!1;let a=upe(e);if(!a)return!1;let o=h6(t,n);if(!i){let e=r&&a.matches(r);return o(a)&&!e}let s=m6(a,o),c=-1;return s<0?!1:(r&&(c=m6(a,h6(null,r))),s>-1&&c<0||s<c)}var x6={};function S6(e){let t=x6[e];if(t)return t;let n=window.document,r=window[e];if(n&&typeof n.createElement==`function`)try{let t=n.createElement(`iframe`);t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch{}return x6[e]=r.bind(window)}function C6(...e){return S6(`requestAnimationFrame`)(...e)}function w6(...e){return S6(`setTimeout`)(...e)}var T6=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(T6||{}),E6;function dpe(e){E6=e}for(var D6=e=>E6?((...t)=>{try{return e(...t)}catch(e){if(E6&&E6(e)===!0)return()=>{};throw e}}):e,O6=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,fpe=typeof Uint8Array>`u`?[]:new Uint8Array(256),k6=0;k6<O6.length;k6++)fpe[O6.charCodeAt(k6)]=k6;var ppe=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=O6[t[n]>>2],i+=O6[(t[n]&3)<<4|t[n+1]>>4],i+=O6[(t[n+1]&15)<<2|t[n+2]>>6],i+=O6[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},A6=new Map;function mpe(e,t){let n=A6.get(e);return n||(n=new Map,A6.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var j6=(e,t,n)=>{if(!e||!(P6(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=mpe(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function M6(e,t,n){if(e instanceof Array)return e.map(e=>M6(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:ppe(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[M6(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:`HTMLImageElement`,src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[M6(e.data,t,n),e.width,e.height]}:P6(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:j6(e,t,n)}:e}var N6=(e,t,n)=>e.map(e=>M6(e,t,n)),P6=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function hpe(e,t,n,r,i){let a=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let s of o)try{if(typeof t.CanvasRenderingContext2D.prototype[s]!=`function`)continue;let o=y6(t.CanvasRenderingContext2D.prototype,s,function(a){return function(...o){return b6(this.canvas,n,r,i,!0)||w6(()=>{let n=N6(o,t,this);e(this.canvas,{type:T6[`2D`],property:s,args:n})},0),a.apply(this,o)}});a.push(o)}catch{let n=v6(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:T6[`2D`],property:s,args:[t],setter:!0})}});a.push(n)}return()=>{a.forEach(e=>e())}}function gpe(e){return e===`experimental-webgl`?`webgl`:e}function F6(e,t,n,r,i){let a=[];try{let o=y6(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(a,...o){if(!b6(this,t,n,r,!0)){let e=gpe(a);if(`__context`in this||(this.__context=e),i&&[`webgl`,`webgl2`].includes(e))if(o[0]&&typeof o[0]==`object`){let e=o[0];e.preserveDrawingBuffer||=!0}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a,...o])}});a.push(o)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{a.forEach(e=>e())}}function I6(e,t,n,r,i,a,o,s){let c=[],l=Object.getOwnPropertyNames(e);for(let o of l)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(o))try{if(typeof e[o]!=`function`)continue;let l=y6(e,o,function(e){return function(...c){let l=e.apply(this,c);if(j6(l,s,this),`tagName`in this.canvas&&!b6(this.canvas,r,i,a,!0)){let e=N6(c,s,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});c.push(l)}catch{let r=v6(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(r)}return c}function _pe(e,t,n,r,i,a){let o=[];return o.push(...I6(t.WebGLRenderingContext.prototype,T6.WebGL,e,n,r,i,a,t)),t.WebGL2RenderingContext!==void 0&&o.push(...I6(t.WebGL2RenderingContext.prototype,T6.WebGL2,e,n,r,i,a,t)),()=>{o.forEach(e=>e())}}var vpe=`for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};`;function ype(){let e=new Blob([vpe]);return URL.createObjectURL(e)}var bpe=class{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};let{enableManualSnapshot:t,sampling:n=`all`,win:r,recordCanvas:i,errorHandler:a}=e;e.sampling=n,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,a&&dpe(a),(i&&typeof n==`number`||t)&&(this.worker=this.initFPSWorker()),this.addWindow(r),!t&&D6(()=>{i&&n===`all`&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),i&&typeof n==`number`&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(e){let{sampling:t=`all`,blockClass:n,blockSelector:r,unblockSelector:i,recordCanvas:a,enableManualSnapshot:o}=this.options;if(!this.windowsSet.has(e)){if(o){this.windowsSet.add(e),this.windows.push(new WeakRef(e));return}D6(()=>{if(a&&t===`all`&&this.initCanvasMutationObserver(e,n,r,i),a&&typeof t==`number`){let t=F6(e,n,r,i,!0);this.restoreHandlers.push(()=>{t()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,t){if(t?.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,e);return}C6(t=>this.takeSnapshot(t,!0,e))}initFPSWorker(){let e=new Worker(ype());return e.onmessage=e=>{let t=e.data,{id:n}=t;if(this.snapshotInProgressMap.set(n,!1),!(`base64`in t))return;let{base64:r,type:i,width:a,height:o}=t;this.mutationCb({id:n,type:T6[`2D`],commands:[{property:`clearRect`,args:[0,0,a,o]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:r}],type:i}]},0,0,a,o]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;let t=n=>{this.takeSnapshot(n,!1),e=C6(t)};e=C6(t),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,t,n,r){let i=F6(e,t,n,r,!1),a=hpe(this.processMutation.bind(this),e,t,n,r),o=_pe(this.processMutation.bind(this),e,t,n,r,this.mirror);this.restoreHandlers.push(()=>{i(),a(),o()})}getCanvasElements(e,t,n){let r=[],i=i=>{i.querySelectorAll(`canvas`).forEach(i=>{b6(i,e,t,n,!0)||r.push(i)})};for(let e of this.windows){let t=e.deref(),n;try{n=t&&t.document}catch{}n&&i(n)}for(let e of this.shadowDoms){let t=e.deref();t&&i(t)}return r}takeSnapshot(e,t,n){let{sampling:r,blockClass:i,blockSelector:a,unblockSelector:o,dataURLOptions:s,maxCanvasSize:c}=this.options,l=1e3/(r===`all`?2:r||2);return this.lastSnapshotTime&&e-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=e,(n?[n]:this.getCanvasElements(i,a,o)).forEach(e=>{let n=this.mirror.getId(e);if(!(!this.mirror.hasNode(e)||!e.width||!e.height||this.snapshotInProgressMap.get(n))){if(this.snapshotInProgressMap.set(n,!0),!t&&[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}createImageBitmap(e).then(t=>{this.worker?.postMessage({id:n,bitmap:t,width:e.width,height:e.height,dataURLOptions:s,maxCanvasSize:c},[t])}).catch(e=>{D6(()=>{throw this.snapshotInProgressMap.delete(n),e})()})}}),!0)}startPendingCanvasMutationFlusher(){C6(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,C6(e)};C6(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),C6(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}};try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}cpe();var xpe;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(xpe||={});var L6={low:{sampling:{canvas:1},dataURLOptions:{type:`image/webp`,quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:`image/webp`,quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:`image/webp`,quality:.5}}},Spe=`ReplayCanvas`,R6=1280,Cpe=vB(((e={})=>{let[t,n]=e.maxCanvasSize||[],r={quality:e.quality||`medium`,enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,R6):R6,n?Math.min(n,R6):R6]},i,a,o=new Promise(e=>a=e);return{name:Spe,getOptions(){let{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{let r=new bpe({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{typeof e==`object`&&(e.__rrweb__=!0)}catch{}}});return i=r,a(r),r},...L6[e]||L6.medium}},async snapshot(e,t){(i||await o).snapshot(e,t)}}}));function wpe(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function z6(e){try{return new URL(e,Y.location.origin).href}catch{return}}function Tpe(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function B6(e){try{return new Headers(e)}catch{return}}var V6={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function H6(e,t){let{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:i,enableHTTPTimings:a,tracePropagationTargets:o,onRequestSpanStart:s,onRequestSpanEnd:c}={...V6,...t},l=typeof i==`function`?i:e=>!0,u=e=>Dpe(e,o),d={},f=e.getOptions().propagateTraceparent;n&&vJ(t=>{let n=lW(t,l,u,d,{propagateTraceparent:f,onRequestSpanEnd:c});if(n){let r=z6(t.fetchData.url),i=r?XV(r).host:void 0,o=r?QV(r):void 0;n.setAttributes({"http.url":o,"url.full":o,"server.address":i}),a&&U6(n,e),s?.(n,{headers:t.headers})}}),r&&m0(t=>{let n=Ope(t,l,u,d,f,c);n&&(a&&U6(n,e),s?.(n,{headers:B6(t.xhr.__sentry_xhr_v3__?.request_headers)}))})}var Epe=300;function U6(e,t){let{url:n}=KI(e).data;if(!n||typeof n!=`string`)return;let r=()=>void setTimeout(i);if(tR(t)){let t=e.end.bind(e);e.end=e=>{let n=e??UP(),a=!1,o=()=>{a||(a=!0,setTimeout(i),t(n),clearTimeout(s))};r=o;let s=setTimeout(o,Epe)}}let i=w$(`resource`,({entries:t})=>{t.forEach(t=>{Tpe(t)&&t.name.endsWith(n)&&(e.setAttributes(t1(t)),r())})})}function Dpe(e,t){let n=NJ();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?DP(r.toString(),t)||a&&DP(r.pathname,t):a}{let n=!!e.match(/^\/(?!\/)/);return t?DP(e,t):n}}function Ope(e,t,n,r,i,a){let o=e.xhr,s=o?.[p0];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=mL()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(nI(n,s.status_code),n.end(),a?.(n,{headers:B6(x0(o)),error:e.error})),delete r[t]);return}let d=z6(c),f=XV(d||c),p=d?QV(d):void 0,m=QV(ZV(c)),h=J(),g=!!lL(),_=g||!!h&&tR(h),v=u&&_?mR({name:`${l} ${m}`,attributes:{url:QV(c),type:`xhr`,"http.method":l,"http.url":p,"url.full":p,"server.address":f?.host,[RF]:`auto.http.browser`,[LF]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new xL,y=AR(v)&&g?void 0:v;return u&&!_&&h?.recordDroppedEvent(`no_parent_span`,`span`),o.__sentry_xhr_span_id__=v.spanContext().spanId,r[o.__sentry_xhr_span_id__]=v,n(c)&&kpe(o,mL()&&_?y:void 0,i),h&&h.emit(`beforeOutgoingRequestSpan`,v,e),v}function kpe(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=cH({span:t,propagateTraceparent:n});r&&Ape(e,r,i,a)}function Ape(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.[`sentry-trace`]||!e.setRequestHeader))try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!wpe(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}var W6=new WeakMap,G6=new WeakMap,jpe=9e4,Mpe=[`text/event-stream`,`application/x-ndjson`,`application/stream+json`],K6=vB(()=>({name:`FetchStreamPerformance`,setup(){yJ(e=>{if(e.response){let t=W6.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);let n=G6.get(e.response);n&&clearTimeout(n)}}}),vJ(e=>{if(e.endTimestamp&&e.response){let t=e.response.headers?.get(`content-type`)||``;if(e.response.headers?.get(`content-length`)||!Mpe.some(e=>t.startsWith(e)))return;let n=e.fetchData?.url||``,r=e.fetchData?.method||`GET`,i=JV(n),a=mR({name:`${r} ${n.startsWith(`data:`)?QV(n):i?YV(i):n}`,startTime:e.endTimestamp,attributes:{url:QV(n),"http.method":r,type:`fetch`,[LF]:`http.client.stream`,[RF]:`auto.http.browser.stream`}});W6.set(e.response,a);let o=setTimeout(()=>{a.isRecording()&&a.end()},jpe);G6.set(e.response,o)}})}})),Npe=`WebVitals`,q6=vB((e={})=>{let t=new Set(e.ignore??[]);return{name:Npe,setup(n){let r=tR(n),{enableStandaloneClsSpans:i,enableStandaloneLcpSpans:a}=e._experiments??{},o=r||t.has(`cls`)?void 0:i||!1,s=r||t.has(`lcp`)?void 0:a||!1,c=c1({recordClsStandaloneSpans:o,recordLcpStandaloneSpans:s,client:n}),l=new WeakSet;n.on(`afterStartPageLoadSpan`,e=>{l.add(e)}),n.on(`spanEnd`,e=>{l.delete(e)&&(c(),_1(e,{recordClsOnPageloadSpan:o===!1,recordLcpOnPageloadSpan:s===!1,spanStreamingEnabled:r}))}),r?(t.has(`lcp`)||U1(n),t.has(`cls`)||G1(n),t.has(`inp`)||q1()):t.has(`inp`)||I1()},afterAllSetup(){t.has(`inp`)||V1()}}});function Ppe(){Y.document?Y.document.addEventListener(`visibilitychange`,()=>{let e=lL();if(!e)return;let t=sL(e);if(Y.document.hidden&&t){let e=`cancelled`,{op:n,status:r}=KI(t);X&&K.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}}):X&&K.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var J6=`sentry_previous_trace`,Fpe=`sentry.previous_trace`;function Ipe(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?zpe():void 0;e.on(`spanStart`,e=>{if(sL(e)!==e)return;let t=q().getPropagationContext();i=Lpe(i,e,t),r&&Rpe(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=q(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(Y6(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=Y6(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[IF]:i.sampleRate}})}function Lpe(e,t,n){let r=KI(t);function i(){try{let e=Number(r.data?.[`sentry.sample_rate`]??n.dsc?.sample_rate);return Number.isNaN(e)?0:e}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(X&&K.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[$F]:`previous_trace`}}),t.setAttribute(Fpe,`${o.traceId}-${o.spanId}-${+!!Y6(o)}`)),a)}function Rpe(e){try{Y.sessionStorage.setItem(J6,JSON.stringify(e))}catch(e){X&&K.warn(`Could not store previous trace in sessionStorage`,e)}}function zpe(){try{let e=Y.sessionStorage?.getItem(J6);return JSON.parse(e)}catch{return}}function Y6(e){return e.traceFlags===1}var Bpe=`BrowserTracing`,Vpe=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function X6(){let e=Y.navigator;return e?.userAgent?Vpe.test(e.userAgent):!1}var Hpe={...jR,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...V6},Z6=((e={})=>{`enableElementTiming`in e&&rN(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=Y.document,{enableInp:r,enableLongTask:i,enableLongAnimationFrame:a,_experiments:{enableInteractions:o,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:u,finalTimeout:d,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:m,traceXHR:h,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:_,enableHTTPTimings:v,ignoreResourceSpans:y,ignorePerformanceApiSpans:b,instrumentPageLoad:x,instrumentNavigation:S,detectRedirects:C,linkPreviousTrace:w,consistentTraceSampling:T,enableReportPageLoaded:ee,onRequestSpanStart:E,onRequestSpanEnd:te}={...Hpe,...e},ne=X6(),re,ie;function ae(e,r,i=!0,a){let o=r.op===`pageload`,s=r.name,c=l?l(r):r,p=JV(a||NJ()),m={...p?.pathname&&{"url.path":p.pathname},...p&&!qV(p)&&{"url.full":p.href},...c.attributes};if(s!==c.name&&(m[PF]=`custom`),c.attributes=m,!i){let e=BP();mR({...c,startTime:e}).end(e);return}t.name=c.name,t.source=m[PF];let h=IR(c,{idleTimeout:u,finalTimeout:d,childSpanTimeout:f,disableAutoFinish:o,beforeSpanEnd:t=>{g1(t,{ignoreResourceSpans:y,ignorePerformanceApiSpans:b,spanStreamingEnabled:tR(e)}),i8(e,void 0);let n=q(),r=n.getPropagationContext();n.setPropagationContext({...r,traceId:h.spanContext().traceId,sampled:QI(h),dsc:OL(t)}),o&&(ie=void 0)},trimIdleSpanEndTimestamp:!ee});o&&ee&&(ie=h),i8(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&(e.emit(`idleSpanEnableAutoFinish`,h),n.removeEventListener(`readystatechange`,g))}o&&!ee&&n&&(n.addEventListener(`readystatechange`,g),g())}return{name:Bpe,setup(e){if(ne){X&&K.log(`[Tracing] Skipping browserTracingIntegration setup for bot user agent.`);return}if(pL(),a&&G.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?u1():i&&l1(),o&&d1(),C&&n){let e=()=>{re=UP()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function t(){let t=r8(e);t&&!KI(t).timestamp&&(X&&K.log(`[Tracing] Finishing current active span with op: ${KI(t).op}`),t.setAttribute(zF,`cancelled`),t.end())}e.on(`startNavigationSpan`,(n,r)=>{if(J()!==e)return;if(r?.isRedirect){X&&K.warn(`[Tracing] Detected redirect, navigation span will not be the root span, but a child span.`),ae(e,{op:`navigation.redirect`,...n},!1,r.url);return}re=void 0,t(),kF().setPropagationContext({traceId:QP(),sampleRand:Math.random(),propagationSpanId:mL()?void 0:$P()});let i=q();i.setPropagationContext({traceId:QP(),sampleRand:Math.random(),propagationSpanId:mL()?void 0:$P()}),i.setSDKProcessingMetadata({normalizedRequest:void 0}),ae(e,{op:`navigation`,...n,parentSpan:null,forceTransaction:!0},!0,r?.url)}),e.on(`startPageLoadSpan`,(n,r={})=>{if(J()!==e)return;t();let i=MI(r.sentryTrace||e8(`sentry-trace`)||t8(`sentry-trace`),r.baggage||e8(`baggage`)||t8(`baggage`)),a=q();a.setPropagationContext(i),mL()||(a.getPropagationContext().propagationSpanId=$P()),a.setSDKProcessingMetadata({normalizedRequest:qZ()}),ae(e,{op:`pageload`,...n})}),e.on(`endPageloadSpan`,()=>{ee&&ie&&(ie.setAttribute(zF,`reportPageLoaded`),ie.end())})},afterAllSetup(e){if(ne)return;e.addIntegration&&!e.getIntegrationByName?.(`WebVitals`)&&e.addIntegration(q6({ignore:r?[]:[`inp`],_experiments:{enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c}}));let n=NJ();if(w!==`off`&&Ipe(e,{linkPreviousTrace:w,consistentTraceSampling:T}),Y.location){if(x){let t=KP();Q6(e,{name:Y.location.pathname,startTime:t?t/1e3:void 0,attributes:{[PF]:`url`,[RF]:`auto.pageload.browser`}})}S&&o0(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=JV(t),a=r8(e),o=a&&C&&Wpe(a,re);$6(e,{name:i?.pathname||Y.location.pathname,attributes:{[PF]:`url`,[RF]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}p&&Ppe(),o&&Upe(e,u,d,f,t),H6(e,{traceFetch:m,traceXHR:h,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:_,enableHTTPTimings:v,onRequestSpanStart:E,onRequestSpanEnd:te}),g&&e.addIntegration(K6())}}});function Q6(e,t,n){e.emit(`startPageLoadSpan`,t,n),q().setTransactionName(t.name);let r=r8(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function $6(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i,url:r}),e.emit(`startNavigationSpan`,t,{isRedirect:i,url:r});let a=q();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...qZ(),url:r}}),r8(e)}function e8(e){return(Y.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function t8(e){return(Y.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function Upe(e,t,n,r,i){let a=Y.document,o;a&&addEventListener(`click`,()=>{let a=`ui.action.click`,s=r8(e);if(s){let e=KI(s).op;if([`navigation`,`pageload`].includes(e)){X&&K.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&=(o.setAttribute(zF,`interactionInterrupted`),o.end(),void 0),!i.name){X&&K.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=IR({name:i.name,op:a,attributes:{[PF]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})},{capture:!0})}var n8=`_sentry_idleSpan`;function r8(e){return e[n8]}function i8(e,t){ZN(e,n8,t)}var a8=1.5;function Wpe(e,t){let n=KI(e),r=BP();return!(r-n.start_timestamp>a8||t&&r-t<=a8)}function Gpe(e=J()){e?.emit(`endPageloadSpan`)}function Kpe(e){let t=lL();if(t===e)return;let n=q();e.end=new Proxy(e.end,{apply(e,r,i){return rF(n,t),Reflect.apply(e,r,i)}}),rF(n,e)}var qpe=vB(()=>({name:`SpanStreaming`,beforeSetup(e){let t=e.getOptions();t.traceLifecycle||=(X&&K.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),`stream`)},setup(e){let t=`SpanStreaming integration requires`,n=`Falling back to static trace lifecycle.`,r=e.getOptions();if(!tR(e)){r.traceLifecycle=`static`,X&&K.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let i=r.beforeSendSpan;if(i&&!jL(i)){r.traceLifecycle=`static`,X&&K.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let a=new uJ(e);e.on(`afterSpanEnd`,t=>{QI(t)&&a.add(cz(t,e))}),e.on(`afterSegmentSpanEnd`,e=>{let t=e.spanContext().traceId;setTimeout(()=>{a.flush(t)},500)})}})),o8=1e6,Jpe=`window`in G&&G.window===G&&typeof importScripts>`u`,s8=`0`,c8=Jpe?`main`:`worker`,l8=Y.navigator,u8=``,d8=``,f8=``,p8=l8?.userAgent||``,m8=``,Ype=l8?.language||l8?.languages?.[0]||``;function Xpe(e){return typeof e==`object`&&!!e&&`getHighEntropyValues`in e}var h8=l8?.userAgentData;Xpe(h8)&&h8.getHighEntropyValues([`architecture`,`model`,`platform`,`platformVersion`,`fullVersionList`]).then(e=>{if(u8=e.platform||``,f8=e.architecture||``,m8=e.model||``,d8=e.platformVersion||``,e.fullVersionList?.length){let t=e.fullVersionList[e.fullVersionList.length-1];p8=`${t.brand} ${t.version}`}}).catch(e=>void 0);function Zpe(e){return!(`thread_metadata`in e)}function Qpe(e){return Zpe(e)?ime(e):e}function $pe(e){let t=e.contexts?.trace?.trace_id;return typeof t==`string`&&t.length!==32&&X&&K.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t==`string`?t:``}function eme(e,t,n,r){if(r.type!==`transaction`)throw TypeError(`Profiling events may only be attached to transactions, this should never occur.`);if(n==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);let i=$pe(r),a=Qpe(n),o=t||(typeof r.start_timestamp==`number`?r.start_timestamp*1e3:UP()*1e3),s=typeof r.timestamp==`number`?r.timestamp*1e3:UP()*1e3;return{event_id:e,timestamp:new Date(o).toISOString(),platform:`javascript`,version:`1`,release:r.release||``,environment:r.environment||`production`,runtime:{name:`javascript`,version:Y.navigator.userAgent},os:{name:u8,version:d8,build_number:p8},device:{locale:Ype,model:m8,manufacturer:p8,architecture:f8,is_emulator:!1},debug_meta:{images:_8(n.resources)},profile:a,transactions:[{name:r.transaction||``,id:r.event_id||jP(),trace_id:i,active_thread_id:s8,relative_start_ns:`0`,relative_end_ns:((s-o)*1e6).toFixed(0)}]}}function tme(e,t,n){if(e==null)throw TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);let r=rme(e),i=t.getOptions(),a=t.getSdkMetadata?.()?.sdk;return{chunk_id:jP(),client_sdk:{name:a?.name??`sentry.javascript.browser`,version:a?.version??`0.0.0`},profiler_id:n||jP(),platform:`javascript`,version:`2`,release:i.release??``,environment:i.environment??`production`,debug_meta:{images:_8(e.resources)},profile:r}}function nme(e){try{if(!e||typeof e!=`object`)return{reason:`chunk is not an object`};let t=e=>typeof e==`string`&&/^[a-f0-9]{32}$/.test(e);if(!t(e.profiler_id))return{reason:`missing or invalid profiler_id`};if(!t(e.chunk_id))return{reason:`missing or invalid chunk_id`};if(!e.client_sdk)return{reason:`missing client_sdk metadata`};let n=e.profile;return n?!Array.isArray(n.frames)||!n.frames.length?{reason:`profile has no frames`}:!Array.isArray(n.stacks)||!n.stacks.length?{reason:`profile has no stacks`}:!Array.isArray(n.samples)||!n.samples.length?{reason:`profile has no samples`}:{valid:!0}:{reason:`missing profile data`}}catch(e){return{reason:`unknown validation error: ${e}`}}}function rme(e){let t=[];for(let n=0;n<e.frames.length;n++){let r=e.frames[n];r&&(t[n]={function:r.name,abs_path:typeof r.resourceId==`number`?e.resources[r.resourceId]:void 0,lineno:r.line,colno:r.column})}let n=[];for(let t=0;t<e.stacks.length;t++){let r=e.stacks[t];if(!r)continue;let i=[],a=r;for(;a;)i.push(a.frameId),a=a.parentId===void 0?void 0:e.stacks[a.parentId];n[t]=i}let r=KP(),i=typeof performance.timeOrigin==`number`?performance.timeOrigin:r||0,a=i-(r||i),o=[];for(let t=0;t<e.samples.length;t++){let n=e.samples[t];if(!n)continue;let r=(i+(n.timestamp-a))/1e3;o[t]={stack_id:n.stackId??0,thread_id:s8,timestamp:r}}return{frames:t,stacks:n,samples:o,thread_metadata:{[s8]:{name:c8}}}}function g8(e){return KI(e).op===`pageload`}function ime(e){let t,n=0,r={samples:[],stacks:[],frames:[],thread_metadata:{[s8]:{name:c8}}},i=e.samples[0];if(!i)return r;let a=i.timestamp,o=KP(),s=typeof performance.timeOrigin==`number`?performance.timeOrigin:o||0,c=s-(o||s);return e.samples.forEach((i,o)=>{if(i.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[o]={elapsed_since_start_ns:((i.timestamp+c-a)*o8).toFixed(0),stack_id:t,thread_id:s8};return}let s=e.stacks[i.stackId],l=[];for(;s;){l.push(s.frameId);let t=e.frames[s.frameId];t&&r.frames[s.frameId]===void 0&&(r.frames[s.frameId]={function:t.name,abs_path:typeof t.resourceId==`number`?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),s=s.parentId===void 0?void 0:e.stacks[s.parentId]}let u={elapsed_since_start_ns:((i.timestamp+c-a)*o8).toFixed(0),stack_id:n,thread_id:s8};r.stacks[n]=l,r.samples[o]=u,n++}),r}function ame(e,t){if(!t.length)return e;for(let n of t)e[1].push([{type:`profile`},n]);return e}function ome(e){let t=[];return PL(e,(e,n)=>{if(n===`transaction`)for(let n=1;n<e.length;n++)e[n]?.contexts?.profile?.profile_id&&t.push(e[n])}),t}function _8(e){let t=J()?.getOptions()?.stackParser;return t?Dz(t,e):[]}function v8(e){return typeof e!=`number`&&typeof e!=`boolean`||typeof e==`number`&&isNaN(e)?(X&&K.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(X&&K.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function sme(e){return e.samples.length<2?(X&&K.log(`[Profiling] Discarding profile because it contains less than 2 samples`),!1):e.frames.length?!0:(X&&K.log(`[Profiling] Discarding profile because it contains no frames`),!1)}var y8=!1,b8=3e4;function cme(e){return typeof e==`function`}function x8(){let e=Y.Profiler;if(!cme(e)){X&&K.log(`[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.`);return}let t=Math.floor(b8/10);try{return new e({sampleInterval:10,maxBufferSize:t})}catch{X&&(K.log(`[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.`),K.log(`[Profiling] Disabling profiling for current user session.`)),y8=!0}}function S8(e){if(y8)return X&&K.log(`[Profiling] Profiling has been disabled for the duration of the current user session.`),!1;if(!e.isRecording())return X&&K.log(`[Profiling] Discarding profile because root span was not sampled.`),!1;let t=J()?.getOptions();if(!t)return X&&K.log(`[Profiling] Profiling disabled, no options found.`),!1;let n=t.profilesSampleRate;return v8(n)?n?n===!0||Math.random()<n||(X&&K.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(n)})`),!1):(X&&K.log(`[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0`),!1):(X&&K.warn(`[Profiling] Discarding profile because of invalid sample rate.`),!1)}function lme(e){if(y8)return X&&K.log(`[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started.`),!1;if(e.profileLifecycle!==`trace`&&e.profileLifecycle!==`manual`)return X&&K.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;let t=e.profileSessionSampleRate;return v8(t)?t?Math.random()<=t:(X&&K.log(`[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0`),!1):(X&&K.warn(`[Profiling] Discarding profile because of invalid profileSessionSampleRate.`),!1)}function C8(e){return e.profilesSampleRate!==void 0}function ume(e,t,n,r){return sme(n)?eme(e,t,n,r):null}var w8=new Map;function dme(){return w8.size}function fme(e){let t=w8.get(e);return t&&w8.delete(e),t}function pme(e,t){if(w8.set(e,t),w8.size>30){let e=w8.keys().next().value;e!==void 0&&w8.delete(e)}}var T8=new WeakSet;function E8(e){e.setAttribute(`thread.id`,s8),e.setAttribute(`thread.name`,c8)}function D8(e){let t;g8(e)&&(t=UP()*1e3);let n=x8();if(!n)return;X&&K.log(`[Profiling] started profiling span: ${KI(e).description}`);let r=jP(),i=null;q().setContext(`profile`,{profile_id:r,start_timestamp:t}),T8.add(e),E8(e);async function a(){if(e&&n){if(i){X&&K.log(`[Profiling] profile for:`,KI(e).description,`already exists, returning early`);return}return n.stop().then(t=>{if(o&&=(Y.clearTimeout(o),void 0),X&&K.log(`[Profiling] stopped profiling of span: ${KI(e).description}`),!t){X&&K.log(`[Profiling] profiler returned null profile for: ${KI(e).description}`,`this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started`);return}i=t,pme(r,t)}).catch(e=>{X&&K.log(`[Profiling] error while stopping profiler:`,e)})}}let o=Y.setTimeout(()=>{X&&K.log(`[Profiling] max profile duration elapsed, stopping profiling for:`,KI(e).description),a()},b8),s=e.end.bind(e);function c(){return e?(a().then(()=>{s()},()=>{s()}),e):s()}e.end=c}var mme=6e4,hme=3e5,gme=class{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(e){let t=e.getOptions().profileLifecycle,n=lme(e.getOptions());X&&K.log(`[Profiling] Initializing profiler (lifecycle='${t}').`),n||X&&K.log(`[Profiling] Session not sampled. Skipping lifecycle profiler initialization.`),this._profilerId=jP(),this._client=e,this._sessionSampled=n,this._lifecycleMode=t,t===`trace`&&this._setupTraceLifecycleListeners(e),e.on(`spanStart`,e=>{this._isRunning&&E8(e)})}start(){if(this._lifecycleMode===`trace`){X&&K.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){X&&K.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){X&&K.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode===`trace`){X&&K.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){X&&K.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(e){if(this._lifecycleMode!==`trace`||!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(X&&K.log(`[Profiling] Detected already active root span during setup. Active root spans now:`,n),this._beginProfiling()),this._isRunning&&E8(e)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,X&&K.log(`[Profiling] Started profiling with profiler ID:`,this._profilerId),AF().setContext(`profile`,{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){X&&K.log(`[Profiling] Failed to start JS Profiler; stopping.`),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&=(clearTimeout(this._chunkTimer),void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{X&&K.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),this._lifecycleMode===`manual`&&AF().setContext(`profile`,{}))}_setupTraceLifecycleListeners(e){e.on(`spanStart`,e=>{if(!this._sessionSampled){X&&K.log(`[Profiling] Span not profiled because of negative sampling decision for user session.`);return}if(e!==sL(e))return;if(!e.isRecording()){X&&K.log(`[Profiling] Discarding profile because root span was not sampled.`);return}let t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);let n=this._activeRootSpanIds.size;n===1&&(X&&K.log(`[Profiling] Root span ${t} started. Profiling active while there are active root spans (count=${n}).`),this._beginProfiling())}),e.on(`spanEnd`,e=>{if(!this._sessionSampled)return;let t=e.spanContext().spanId;if(!t||!this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.delete(t);let n=this._activeRootSpanIds.size;X&&K.log(`[Profiling] Root span with ID ${t} ended. Will continue profiling for as long as there are active root spans (currently: ${n}).`),n===0&&(this._collectCurrentChunk().catch(e=>{X&&K.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",e)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,AF().setContext(`profile`,{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);let t=setTimeout(()=>this._onRootSpanTimeout(e),hme);this._rootSpanTimeouts.set(e,t)}_startProfilerInstance(){if(this._profiler?.stopped===!1)return;let e=x8();if(!e){X&&K.log(`[Profiling] Failed to start JS Profiler.`);return}this._profiler=e}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{X&&K.error(`[Profiling] Failed to collect current profile chunk during periodic chunking:`,e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},mme))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(X&&K.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){let e=this._profiler;if(this._profiler=void 0,e)try{let t=tme(await e.stop(),this._client,this._profilerId),n=nme(t);if(`reason`in n){X&&K.log(`[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):`,n.reason);return}this._sendProfileChunk(t),X&&K.log(`[Profiling] Collected browser profile chunk.`)}catch(e){X&&K.log(`[Profiling] Error while stopping JS Profiler for chunk:`,e)}}_sendProfileChunk(e){let t=this._client,n=WL(t.getSdkMetadata?.()),r=t.getDsn(),i=t.getOptions().tunnel,a=ML({event_id:jP(),sent_at:new Date().toISOString(),...n&&{sdk:n},...!!i&&r&&{dsn:SI(r)}},[[{type:`profile_chunk`,platform:`javascript`},e]]);t.sendEnvelope(a).then(null,e=>{X&&K.error(`Error while sending profile chunk envelope:`,e)})}},_me=`BrowserProfiling`,vme=vB((()=>({name:_me,setup(e){let t=e.getOptions(),n=new gme;if(!C8(t)&&!t.profileLifecycle&&(t.profileLifecycle=`manual`),C8(t)&&!t.profilesSampleRate){X&&K.log(`[Profiling] Profiling disabled, no profiling options found.`);return}let r=lL(),i=r&&sL(r);if(C8(t)&&t.profileSessionSampleRate!==void 0&&X&&K.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),C8(t))i&&g8(i)&&S8(i)&&D8(i),e.on(`spanStart`,e=>{let t=sL(e);e===t?S8(e)&&D8(e):T8.has(t)&&E8(e)}),e.on(`beforeEnvelope`,e=>{if(!dme())return;let t=ome(e);if(!t.length)return;let n=[];for(let e of t){let t=e?.contexts,r=t?.profile?.profile_id,i=t?.profile?.start_timestamp;if(typeof r!=`string`){X&&K.log(`[Profiling] cannot find profile for a span without a profile context`);continue}if(!r){X&&K.log(`[Profiling] cannot find profile for a span without a profile context`);continue}t?.profile&&delete t.profile;let a=fme(r);if(!a){X&&K.log(`[Profiling] Could not retrieve profile for span: ${r}`);continue}let o=ume(r,i,a,e);o&&n.push(o)}ame(e,n)});else{let r=t.profileLifecycle;if(e.on(`startUIProfiler`,()=>n.start()),e.on(`stopUIProfiler`,()=>n.stop()),r===`manual`)n.initialize(e);else if(r===`trace`){if(!mL(t)){X&&K.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),i&&n.notifyRootSpanActive(i),Y.setTimeout(()=>{let e=lL(),t=e&&sL(e);t&&n.notifyRootSpanActive(t)},0)}}}}))),yme=`SpotlightBrowser`,bme=[{op:`ui.interaction.click`,name:`#sentry-spotlight`}],xme=((e={})=>{let t=e.sidecarUrl||`http://localhost:8969/stream`;return{name:yme,setup:()=>{X&&K.log(`Using Sidecar URL`,t)},beforeSetup(e){let t=e.getOptions();t.ignoreSpans=[...t.ignoreSpans||[],...bme]},afterAllSetup:e=>{Sme(e,t)}}});function Sme(e,t){let n=u0(`fetch`),r=0;e.on(`beforeEnvelope`,e=>{if(r>3){K.warn(`[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:`,r);return}n(t,{method:`POST`,body:LL(e),headers:{"Content-Type":`application/x-sentry-envelope`},mode:`cors`}).then(e=>{e.status>=200&&e.status<400&&(r=0)},e=>{r++,K.error(`Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/`,e)})})}var Cme=vB(xme),wme=vB(()=>({name:`LaunchDarkly`,processEvent(e,t,n){return eW(e)}}));function Tme(){return{name:`sentry-flag-auditor`,type:`flag-used`,synchronous:!0,method:(e,t,n)=>{tW(e,t.value),rW(e,t.value)}}}var Eme=vB(()=>({name:`OpenFeature`,processEvent(e,t,n){return eW(e)}})),Dme=class{after(e,t){tW(t.flagKey,t.value),rW(t.flagKey,t.value)}error(e,t,n){tW(e.flagKey,e.defaultValue),rW(e.flagKey,e.defaultValue)}},Ome=vB(({featureFlagClientClass:e})=>({name:`Unleash`,setupOnce(){let t=e.prototype;XN(t,`isEnabled`,kme)},processEvent(e,t,n){return eW(e)}}));function kme(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n==`string`&&typeof r==`boolean`?(tW(n,r),rW(n,r)):X&&K.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}var Ame=(({growthbookClass:e})=>aW({growthbookClass:e})),jme=vB(({featureFlagClient:e})=>({name:`Statsig`,setup(t){e.on(`gate_evaluation`,e=>{tW(e.gate.name,e.gate.value),rW(e.gate.name,e.gate.value)})},processEvent(e,t,n){return eW(e)}})),Mme=`WebWorker`,Nme=vB(({worker:e})=>({name:Mme,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(e=>O8(e))},addWorker:e=>O8(e)}));function O8(e){e.addEventListener(`message`,e=>{if(Ime(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(X&&K.log(`Sentry debugId web worker message received`,e.data),Y._sentryDebugIds={...e.data._sentryDebugIds,...Y._sentryDebugIds}),e.data._sentryModuleMetadata&&(X&&K.log(`Sentry module metadata web worker message received`,e.data),Y._sentryModuleMetadata={...e.data._sentryModuleMetadata,...Y._sentryModuleMetadata}),e.data._sentryWasmImages){X&&K.log(`Sentry WASM images web worker message received`,e.data);let t=Y._sentryWasmImages||[],n=e.data._sentryWasmImages.filter(e=>UN(e)&&typeof e.code_file==`string`&&!t.some(t=>t.code_file===e.code_file));Y._sentryWasmImages=[...t,...n]}e.data._sentryWorkerError&&(X&&K.log(`Sentry worker rejection message received`,e.data._sentryWorkerError),Pme(e.data._sentryWorkerError))}})}function Pme(e){let t=J();if(!t)return;let n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,i=e.reason,a=HN(i)?Z0(i):mQ(n,i,void 0,r,!0);a.level=`error`,e.filename&&(a.contexts={...a.contexts,worker:{filename:e.filename}}),Vz(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.web_worker.onunhandledrejection`}}),X&&K.log(`Captured worker unhandled rejection`,i)}function Fme({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener(`unhandledrejection`,t=>{let n={reason:X0(t),filename:e.location?.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:n}),X&&K.log(`[Sentry Worker] Forwarding unhandled rejection to parent`,n)}),X&&K.log(`[Sentry Worker] Registered worker with unhandled rejection handling`)}function Ime(e){if(!UN(e)||e._sentryMessage!==!0)return!1;let t=`_sentryDebugIds`in e,n=`_sentryModuleMetadata`in e,r=`_sentryWorkerError`in e,i=`_sentryWasmImages`in e;return!(!t&&!n&&!r&&!i||t&&!(UN(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(UN(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!UN(e._sentryWorkerError)||i&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(e=>UN(e)&&typeof e.code_file==`string`)))}var Lme=50,[,Rme]=I0,[,zme]=kJ(),k8=(e,t=0)=>{let n=[];for(let r of e.split(`
|
|
1004
|
-
`).slice(t)){let e=Rme(r),t=zme(r);if(e&&t?.in_app!==!1?n.push(e):t&&(t.module===void 0&&delete t.module,n.push(t)),n.length>=Lme)break}return _N(n)},Bme=vB(e=>{let t=e?.threshold??1e3,n=e?.pollInterval||t/2;return{name:`EventLoopBlockRenderer`,setup(r){let i={pollInterval:n,anrThreshold:t,captureStackTrace:!0,...e},a=BJ(r);a.sendStatus({status:document.visibilityState,config:i}),setInterval(()=>{a.sendStatus({status:`alive`,config:i})},i.pollInterval)}}});function A8(){let e=AF().getScopeData(),t=kF().getScopeData(),n=q().getScopeData();return $R(e,t),$R(e,n),e.eventProcessors=[],e}function Vme(e){kF().addScopeListener(t=>{e(A8(),t)}),q().addScopeListener(t=>{e(A8(),t)}),AF().addScopeListener(t=>{e(A8(),t)})}var j8=vB(()=>({name:`ScopeToMain`,setup(e){let t=BJ(e);Vme((e,n)=>{t.sendScope(JSON.stringify(mP(e,20,2e3))),n.clearBreadcrumbs(),n.clearAttachments()})}}));function M8(e){let t;return sV(e,async e=>(t||=BJ(),t.sendEnvelope(e.body),{statusCode:200}))}function N8(e){return[...r2(e).filter(e=>e.name!==`BrowserSession`&&e.name!==`CultureContext`),j8()]}function P8(e={},t=Uce){if(window?.__SENTRY__RENDERER_INIT__){K.warn(`The browser SDK has already been initialized.
|
|
1005
|
-
If init has been called in the preload and contextIsolation is disabled, is not required to call init in the renderer`);return}window.__SENTRY__RENDERER_INIT__=!0,e.sendClientReports=!1,e.defaultIntegrations===void 0&&(e.defaultIntegrations=N8(e)),e.stackParser===void 0&&(e.stackParser=k8),e.ipcNamespace===void 0&&(e.ipcNamespace=`sentry-ipc`),e.dsn===void 0&&(e.dsn=`https://12345@dummy.dsn/12345`),e.transport===void 0&&(e.transport=M8),delete e.initialScope,t(e)}var F8=e({BrowserClient:()=>yQ,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>VV,OpenFeatureIntegrationHook:()=>Dme,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>LF,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>RF,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>FF,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>PF,Scope:()=>oF,addBreadcrumb:()=>fH,addEventProcessor:()=>eB,addIntegration:()=>_B,bindScopeToEmitter:()=>WR,breadcrumbsIntegration:()=>W0,browserApiErrorsIntegration:()=>G0,browserProfilingIntegration:()=>vme,browserSessionIntegration:()=>q0,browserTracingIntegration:()=>Z6,buildLaunchDarklyFlagUsedHandler:()=>Tme,captureConsoleIntegration:()=>YH,captureEvent:()=>Vz,captureException:()=>zz,captureFeedback:()=>vW,captureMessage:()=>Bz,captureSession:()=>iB,chromeStackLineParser:()=>I0,consoleLoggingIntegration:()=>TW,contextLinesIntegration:()=>cle,continueTrace:()=>gR,createConsolaReporter:()=>kW,createLangChainCallbackHandler:()=>Lq,createTransport:()=>sV,createUserFeedbackEnvelope:()=>V0,dedupeIntegration:()=>QH,defaultRequestInstrumentationOptions:()=>V6,defaultStackParser:()=>k8,elementTimingIntegration:()=>M1,endSession:()=>nB,eventFiltersIntegration:()=>vH,eventFromException:()=>fQ,eventFromMessage:()=>pQ,eventLoopBlockIntegration:()=>Bme,exceptionFromError:()=>nQ,extraErrorDataIntegration:()=>oU,featureFlagsIntegration:()=>iW,feedbackAsyncIntegration:()=>eQ,feedbackIntegration:()=>tQ,feedbackSyncIntegration:()=>tQ,fetchStreamPerformanceIntegration:()=>K6,forceLoad:()=>Wce,functionToStringIntegration:()=>hH,getAbsoluteUrl:()=>C0,getActiveSpan:()=>lL,getClient:()=>J,getCurrentScope:()=>q,getDefaultIntegrations:()=>N8,getFeedback:()=>JY,getGlobalScope:()=>AF,getIsolationScope:()=>kF,getReplay:()=>ipe,getRootSpan:()=>sL,getSpanDescendants:()=>oL,getSpanStatusFromHttpCode:()=>tI,getTraceData:()=>cH,globalHandlersIntegration:()=>Y0,graphqlClientIntegration:()=>gle,growthbookIntegration:()=>Ame,httpClientIntegration:()=>Xce,httpContextIntegration:()=>e2,inboundFiltersIntegration:()=>yH,init:()=>P8,instrumentAnthropicAiClient:()=>QK,instrumentCreateReactAgent:()=>rJ,instrumentGoogleGenAIClient:()=>mq,instrumentLangChainEmbeddings:()=>Hq,instrumentLangGraph:()=>iJ,instrumentOpenAiClient:()=>OK,instrumentOutgoingRequests:()=>H6,instrumentSupabaseClient:()=>PU,isBotUserAgent:()=>X6,isEnabled:()=>$z,isInitialized:()=>Qz,lastEventId:()=>Zz,launchDarklyIntegration:()=>wme,linkedErrorsIntegration:()=>t2,logger:()=>VJ,makeRendererTransport:()=>M8,metrics:()=>YJ,moduleMetadataIntegration:()=>HH,normalizeStringifyValue:()=>n2,onLoad:()=>Gce,openFeatureIntegration:()=>Eme,parameterize:()=>iH,registerSpanErrorInstrumentation:()=>pL,registerWebWorker:()=>Fme,replayCanvasIntegration:()=>Cpe,replayIntegration:()=>d6,reportPageLoaded:()=>Gpe,reportingObserverIntegration:()=>Jce,rewriteFramesIntegration:()=>_U,scopeToMainIntegration:()=>j8,sendFeedback:()=>MY,setActiveSpanInBrowser:()=>Kpe,setAttribute:()=>Jz,setAttributes:()=>qz,setContext:()=>Hz,setConversationId:()=>Xz,setCurrentClient:()=>BV,setExtra:()=>Wz,setExtras:()=>Uz,setHttpStatus:()=>nI,setMeasurement:()=>QL,setTag:()=>Kz,setTags:()=>Gz,setUser:()=>Yz,showReportDialog:()=>i2,spanStreamingIntegration:()=>qpe,spanToBaggageHeader:()=>kL,spanToJSON:()=>KI,spanToTraceHeader:()=>BI,spotlightBrowserIntegration:()=>Cme,startBrowserTracingNavigationSpan:()=>$6,startBrowserTracingPageLoadSpan:()=>Q6,startInactiveSpan:()=>mR,startNewTrace:()=>bR,startSession:()=>tB,startSpan:()=>fR,startSpanManual:()=>pR,statsigIntegration:()=>jme,supabaseIntegration:()=>LU,suppressTracing:()=>vR,thirdPartyErrorFilterIntegration:()=>KU,uiProfiler:()=>O0,unleashIntegration:()=>Ome,updateSpanName:()=>dL,viewHierarchyIntegration:()=>_le,webVitalsIntegration:()=>q6,webWorkerIntegration:()=>Nme,withActiveSpan:()=>_R,withIsolationScope:()=>MF,withScope:()=>jF,withStreamedSpan:()=>AL,zodErrorsIntegration:()=>GU}),Hme=100,Ume=5,Wme=[`ResizeObserver loop completed with undelivered notifications.`,`ResizeObserver loop limit exceeded`,`AbortError`,`The user aborted a request.`,`Network request failed`,`NetworkError when attempting to fetch resource.`,`Failed to fetch`,`ChunkLoadError`,`Loading chunk`,`Loading CSS chunk`,`Non-Error promise rejection captured with value: Object Not Found Matching Id`];function I8(e){if(e)for(let t of Object.keys(e))/token|secret|password|api[_-]?key/i.test(t)&&(e[t]=`[redacted]`)}function Gme(e){e.request?.url&&(e.request.url=e.request.url.replace(/([?&](?:code|token|access_token|state)=)[^&]+/gi,`$1[redacted]`)),I8(e.extra),I8(e.tags)}function Kme(e){let t=R8(e.version)??`0.0.0`,n=R8(e.commitHash);return n?`${e.appName}@${t}+${n}`:`${e.appName}@${t}`}function L8(e,t){for(let n of t){let t=R8(e[n]);if(t)return t}}function qme(e){return z8(e.enabled)??e.defaultEnabled??!1}function Jme(e){let t=R8(e.dsn);return!t||qme(e)===!1?null:{dsn:t,environment:R8(e.environment)??R8(e.defaultEnvironment)??`production`,release:R8(e.release)??R8(e.defaultRelease)??void 0,debug:z8(e.debug)??e.defaultDebug??!1,tracesSampleRate:V8(e.tracesSampleRate,e.defaultTracesSampleRate??.1),profilesSampleRate:B8(e.profilesSampleRate,e.defaultProfilesSampleRate),replaysSessionSampleRate:B8(e.replaysSessionSampleRate,e.defaultReplaysSessionSampleRate),replaysOnErrorSampleRate:B8(e.replaysOnErrorSampleRate,e.defaultReplaysOnErrorSampleRate),attachStacktrace:!0,maxBreadcrumbs:Hme,normalizeDepth:Ume,tags:Yme(e)}}function Yme(e){let t={app:e.appName,runtime:e.runtime};for(let[n,r]of Object.entries(e.tags??{})){let e=R8(r);e&&(t[n]=e)}return t}function R8(e){if(e==null)return null;let t=e.trim();return t.length>0?t:null}function z8(e){if(typeof e==`boolean`)return e;let t=R8(e);if(t){if(t===`1`||t.toLowerCase()===`true`)return!0;if(t===`0`||t.toLowerCase()===`false`)return!1}}function B8(e,t){if(t!==void 0||e!==void 0)return V8(e,t??0)}function V8(e,t){let n=Xme(e);return n===null||n<0||n>1?t:n}function Xme(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;let t=R8(e);if(!t)return null;let n=Number.parseFloat(t);return Number.isFinite(n)?n:null}function Zme(e){let t=(0,Be.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=ge(Qe,`bg-background text-foreground`),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=ge(Ye,`pl-1 md:pl-2.5`),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,tt.jsx)(rt,{}),t[2]=i):i=t[2];let a;t[3]===e.onGoToNewChat?a=t[4]:(a=(0,tt.jsx)(`div`,{className:r,children:(0,tt.jsx)(`button`,{type:`button`,"aria-label":`Go to new chat`,onClick:e.onGoToNewChat,className:`${Xe} hover:bg-accent/70`,children:i})}),t[3]=e.onGoToNewChat,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,tt.jsx)(`div`,{}),t[5]=o):o=t[5];let s;t[6]===a?s=t[7]:(s=(0,tt.jsxs)(`header`,{className:Je,children:[a,o]}),t[6]=a,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,tt.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-4`,children:(0,tt.jsxs)(`div`,{className:`max-w-md rounded-xl border border-border bg-card p-6 text-center shadow-lg`,children:[(0,tt.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Something went wrong.`}),(0,tt.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Forge hit an unexpected error and reported it.`}),(0,tt.jsx)(`button`,{className:`mt-4 inline-flex rounded-md border border-border px-3 py-2 text-sm font-medium hover:bg-accent`,onClick:Qme,type:`button`,children:`Reload app`})]})}),t[8]=c):c=t[8];let l;return t[9]===s?l=t[10]:(l=(0,tt.jsxs)(`div`,{className:n,children:[s,c]}),t[9]=s,t[10]=l),l}function Qme(){return window.location.reload()}var $me=[/\bDeepSeek\b/i,/\bKimi\b/i,/\bMoonshot\b/i,/\bdeepseek[-._a-z0-9]*\b/i,/\bkimi[-._a-z0-9]*\b/i,/\bmoonshot[-._a-z0-9]*\b/i,/\bAPEX_API_KEY\b/,/\bDEEPSEEK_API_KEY\b/,/\bKIMI_API_KEY\b/,/\bOPENAI_API_KEY\b/,/\bANTHROPIC_API_KEY\b/,/\bCURSOR_API_KEY\b/,/\bOPENCODE_API_KEY\b/,/\bforge_proxy_[A-Za-z0-9._-]+\b/,/\bProviderValidationError\b/,/\/forge-server\/node_modules\//,/https?:\/\/[^\s'"<>)]*\/api\/provider-egress\/[^\s'"<>)]*/i,/https?:\/\/[^\s'"<>)]*(?:apex|deepseek|moonshot|kimi)[^\s'"<>)]*/i],ehe=`CMMD is temporarily unavailable. Check the workspace AI connection and retry.`,H8=`Claude could not get a Workspace egress token from CMMD for this turn. Refusing rather than falling back to the personal login.`,the=H8.toLowerCase();function U8(e){if(!e)return!1;let t=e.toLowerCase();return/\b(rate[\s-]?limit|too\s+many\s+requests|usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/.test(t)||/\b429\b/.test(t)}function nhe(e){return/\bbound to provider account\b/.test(e)&&/\bcannot use provider account\b/.test(e)?`Forge could not switch this conversation to the selected AI account. Retry the account switch.`:/\bforge_runtime_repairing\b/.test(e)||/\bthis turn was interrupted because the environment is being repaired\b/.test(e)?`This turn was interrupted because the environment is being repaired. Retry after the repair finishes.`:/\bforge_runtime_stopped\b/.test(e)||/\bthis turn was interrupted because the environment was stopped\b/.test(e)?`This turn was interrupted because the environment was stopped. Start the environment and retry.`:null}function rhe(e){if(!e)return null;let t=e.toLowerCase();if(t.includes(the))return H8;let n=nhe(t);return n===null?/\bforge_provider_model_not_allowed\b/.test(t)||/\bnot\s+scoped\s+to\s+the\s+requested\s+model\b/.test(t)?`The workspace AI credential does not cover the model this turn asked for. Retry, or pick that model for the thread.`:/\bmodel\b[\s\S]*\b(not\s+(found|available|supported)|does\s+not\s+exist|unsupported|invalid|unknown)\b/.test(t)||/\b(unsupported|unknown|invalid)\b[\s\S]*\bmodel\b/.test(t)||/\b(model_not_found|invalid_model|model_not_supported)\b/.test(t)?`The selected model isn't available right now. Pick a different model and retry.`:U8(t)?`The AI service is rate-limited or out of quota. Wait a moment and retry.`:/_credential_reconnect_required\b/.test(t)?`The workspace AI credential needs to be reconnected. Reconnect it in Settings > Providers, then retry.`:/\b(unauthorized|forbidden|authentication\s+(failed|error|required)|invalid\s+api\s+key|expired\s+(token|credential))\b/.test(t)||/\b40[13]\b/.test(t)?`Workspace AI authentication failed. Reconnect the workspace and retry.`:/\b(timed?\s*out|timeout|overloaded|service\s+unavailable)\b/.test(t)||/\b50[234]\b/.test(t)?`The AI service is temporarily overloaded. Retry in a moment.`:null:n}function ihe(e){return e?$me.some(t=>t.test(e)):!1}function W8(e,t={}){if(e==null)return null;let n=e.trim();return n.length===0?null:ihe(n)?rhe(n)??t.fallback??`CMMD is temporarily unavailable. Check the workspace AI connection and retry.`:n}var ahe=[/\bSocketCloseError\b/i,/\bSocketOpenError\b/i,/\bSocketReadError\b/i,/\bRpcClientDefect:\s*Unknown socket error\b/i,/Unable to connect to the Forge server WebSocket\./i,/\bping timeout\b/i];function G8(e){if(typeof e!=`string`)return!1;let t=e.trim();return t.length!==0&&ahe.some(e=>e.test(t))}function K8(e){return G8(e)?null:W8(e,{fallback:ehe})}var ohe=[/^Transport disposed$/,/WebSocket RPC request timed out after \d+ms\./],she=`Lost the connection to this Environment. Your message was not sent.`;function che(e){return e instanceof Error?G8(e.message)||ohe.some(t=>t.test(e.message.trim()))?she:e.message:`Failed to send message.`}var q8=`forge-web`,J8=[`VITE_SENTRY_ENVIRONMENT`,`MODE`],Y8=[`VITE_SENTRY_RELEASE`],lhe=[`VITE_SENTRY_DSN`],uhe=[`VITE_SENTRY_DEBUG`],dhe=[`VITE_SENTRY_ENABLED`],fhe=[`VITE_SENTRY_TRACES_SAMPLE_RATE`],phe=[`VITE_SENTRY_PROFILES_SAMPLE_RATE`],mhe=[`VITE_SENTRY_REPLAYS_SESSION_SAMPLE_RATE`],hhe=[`VITE_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE`],ghe=[`VITE_SENTRY_COMMIT_SHA`,`VITE_COMMIT_SHA`],X8=!1,Z8={autoInject:!1,colorScheme:`system`,formTitle:`Report a Bug`,themeLight:{accentBackground:`oklch(0.52 0.19 48)`,accentForeground:`#ffffff`,background:`#ffffff`,boxShadow:`0 24px 80px rgba(0, 0, 0, 0.18)`,foreground:`#262626`,outline:`1px solid oklch(0.52 0.19 48)`},themeDark:{accentBackground:`oklch(0.62 0.2 47)`,accentForeground:`#ffffff`,background:`#171717`,boxShadow:`0 24px 80px rgba(0, 0, 0, 0.45)`,foreground:`#f5f5f5`,outline:`1px solid oklch(0.62 0.2 47)`}};function _he(e){let t=e.exception&&typeof e.exception==`object`&&`values`in e.exception&&Array.isArray(e.exception.values)?e.exception.values:[];return[typeof e.title==`string`?e.title:void 0,...t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e;return[typeof t.type==`string`?t.type:void 0,typeof t.value==`string`?t.value:void 0]})]}function vhe(e){return(e.exception&&typeof e.exception==`object`&&`values`in e.exception&&Array.isArray(e.exception.values)?e.exception.values:[]).some(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.value!=`string`||!/All fibers interrupted without error/i.test(t.value)?!1:t.stacktrace?.frames?.some(e=>{let t=typeof e.filename==`string`?e.filename:``,n=typeof e.function==`string`?e.function:``;return t.includes(`src/rpc/wsTransport.ts`)&&n===`WsTransport.request`})})}function yhe(e){return _he(e).some(G8)||vhe(e)}function bhe(){let e=new URL(window.location.href);xe?e.hash=`/new`:(e.pathname=`/new`,e.search=``,e.hash=``),window.location.assign(e.toString())}function xhe(){let e=xe?`electron-renderer`:`browser`,t={APP_VERSION:`0.14.0`,BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_INLINE_CSS_ENABLED:`false`,VITE_COMMIT_SHA:``,VITE_HOSTED_APP_CHANNEL:``,VITE_HTTP_URL:``,VITE_SENTRY_COMMIT_SHA:`c541d41e992712a7ab25a9ae28ee5e3815e77426`,VITE_SENTRY_DEBUG:``,VITE_SENTRY_DSN:``,VITE_SENTRY_ENABLED:``,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_PROFILES_SAMPLE_RATE:``,VITE_SENTRY_RELEASE:`forge-web@0.14.0+c541d41e992712a7ab25a9ae28ee5e3815e77426`,VITE_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE:``,VITE_SENTRY_REPLAYS_SESSION_SAMPLE_RATE:``,VITE_SENTRY_TRACES_SAMPLE_RATE:``,VITE_WS_URL:``},n=L8(t,[...Y8])??Kme({appName:q8,version:`0.14.0`,commitHash:L8(t,[...ghe])});return Jme({appName:q8,runtime:e,defaultEnvironment:L8(t,[...J8])??`development`,defaultRelease:n,defaultEnabled:!0,defaultTracesSampleRate:0,defaultReplaysSessionSampleRate:0,defaultReplaysOnErrorSampleRate:0,enabled:L8(t,[...dhe]),dsn:L8(t,[...lhe]),environment:L8(t,[...J8]),release:L8(t,[...Y8]),debug:L8(t,[...uhe]),tracesSampleRate:L8(t,[...fhe]),profilesSampleRate:L8(t,[...phe]),replaysSessionSampleRate:L8(t,[...mhe]),replaysOnErrorSampleRate:L8(t,[...hhe]),tags:{platform:xe?`desktop`:`web`}})}function Q8(e){return Gme(e),yhe(e)?null:e}function She(e){return{...e.replaysOnErrorSampleRate===void 0?{}:{replaysOnErrorSampleRate:e.replaysOnErrorSampleRate},...e.replaysSessionSampleRate===void 0?{}:{replaysSessionSampleRate:e.replaysSessionSampleRate}}}function $8(e){return{attachStacktrace:e.attachStacktrace,debug:e.debug,dsn:e.dsn,environment:e.environment,ignoreErrors:[...Wme],initialScope:{tags:e.tags},maxBreadcrumbs:e.maxBreadcrumbs,normalizeDepth:e.normalizeDepth,sendDefaultPii:!1,tracesSampleRate:e.tracesSampleRate,...e.release===void 0?{}:{release:e.release},...She(e)}}function Che(e){let t=[];e.tracesSampleRate>0&&t.push(Z6()),((e.replaysSessionSampleRate??0)>0||(e.replaysOnErrorSampleRate??0)>0)&&t.push(d6());let n=tQ(Z8);t.push(n);try{P8({...$8(e),beforeSend:e=>Q8(e),integrations:t})}catch{return null}return X8=!0,F8}function whe(e){let t=[];e.tracesSampleRate>0&&t.push(SA()),((e.replaysSessionSampleRate??0)>0||(e.replaysOnErrorSampleRate??0)>0)&&t.push(Ik());let n=Fy(Z8);t.push(n);try{nj({...$8(e),beforeSend:e=>Q8(e),integrations:t})}catch{return null}return X8=!0,YM}function e5(){if(X8)return xe?F8:YM;let e=xhe();return e?xe?Che(e):whe(e):null}function t5(e){if(e5()){if(xe){Yz(e);return}Dl(e)}}function n5(e,t,n){if(!e5())return;let r=The(e);if(xe){jF(e=>{t&&e.setTags(t);let i=zz(r);n?.showReportDialog&&i2({eventId:i})});return}ka(e=>{t&&e.setTags(t);let i=_l(r);n?.showReportDialog&&Ew({eventId:i})})}function The(e){if(e instanceof Error)return e;if(typeof e==`string`&&e.trim().length>0)return Error(e);try{return Error(JSON.stringify(e))}catch{return Error(`Unknown non-Error exception`)}}var Ehe=class extends k.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){n5(e,{origin:`react-boundary`},{showReportDialog:!0})}render(){return this.state.hasError?(0,tt.jsx)(Zme,{onGoToNewChat:bhe}):this.props.children}},r5=!1,i5=!1,a5=null,o5=null,s5=null,c5=!1,l5=new Set;function Dhe(e){if(r5||i5)return;if(!e.publicKey||!e.host){i5=!0;return}if(a5)return;if(typeof window>`u`||typeof location>`u`){i5=!0;return}let t=e.publicKey,n=e.host;a5=_e(async()=>{let{default:e}=await import(`./module-CPO4cjSm.js`);return{default:e}},[]).then(({default:e})=>{o5=e,e.init(t,{api_host:n,person_profiles:`identified_only`,capture_pageview:!1,capture_pageleave:!1,autocapture:!1,disable_session_recording:!0,loaded:()=>{r5=!0,s5&&u5(s5),d5(),l5.forEach(e=>e())}})}).catch(()=>{i5=!0,o5=null})}function u5(e){if(s5=e,!r5||!o5)return;let t={};e.email!==void 0&&(t.email=e.email),e.displayName!==void 0&&(t.name=e.displayName),o5.identify(e.cmmdUserId,t)}function Ohe(e){return!r5||!o5?!1:o5.isFeatureEnabled(e)===!0}function d5(){!o5||c5||(c5=!0,o5.onFeatureFlags(()=>{l5.forEach(e=>e())}))}function khe(e){return l5.add(e),r5&&o5&&(d5(),e()),()=>{l5.delete(e)}}var f5=class extends v(`BootstrapHttpError`){},p5=e=>r(e,`BootstrapHttpError`);function m5(e){return typeof e!=`object`||!e?!1:!!(p5(e)&&e.status===401||e instanceof Error&&e.name===`RemoteEnvironmentAuthHttpError`&&`status`in e&&e.status===401||e instanceof ye&&e.kind===`auth`)}function Ahe(e){let t=e.replace(/\s+/g,` `).trim();return t.length===0?`<empty response>`:t.slice(0,120)}async function h5(e,t){let n=await e.text();try{return JSON.parse(n)}catch{throw new f5({message:`${t} returned a non-JSON response (${Ahe(n)}). Ensure the Forge server is running and this route is proxied correctly.`,status:e.status})}}function g5(e){let t=e.start().then(n=>e.getSlot()===t?(e.onSettled(n),n):e.retry(),n=>{if(e.getSlot()!==t)return e.retry();throw n}).finally(()=>{e.getSlot()===t&&e.setSlot(null)});return e.setSlot(t),t}function jhe(e){if(!e.authenticated||!e.role)throw Error(`Authenticated session is required.`);let t=Mhe(e.cmmdIdentity??null);return t?{displayName:t,email:e.cmmdIdentity?.email??null,avatarUrl:e.cmmdIdentity?.avatarUrl??null,role:e.role,verified:!0,source:`cmmd-identity`}:{displayName:`CMMD identity unavailable`,email:null,avatarUrl:null,role:e.role,verified:!1,source:`fallback`}}function Mhe(e){return e&&([e.firstName,e.lastName].map(e=>e?.trim()??``).filter(e=>e.length>0).join(` `)||e.username.trim()||e.email.trim())||null}var _5=null;function Nhe(){if(_5)return _5;let e=new URL(`/api/auth/session`,window.location.origin).toString(),t=fetch(e,{credentials:`include`}).then(async t=>{if(!t.ok)throw new f5({message:`Failed to load current app auth session state (${t.status}).`,status:t.status});return h5(t,e)}).then(jhe).finally(()=>{_5===t&&(_5=null)});return _5=t,t}var v5=null,y5=null,b5=null,x5=null,S5=new Set,C5=`cmmd-forge.loggedOutLocalBootstrapCredentials.v1`;function Phe(e){let t=`${e.firstName??``} ${e.lastName??``}`.trim();t5({id:e.id,email:e.email,...t.length>0?{username:t}:{}}),u5({cmmdUserId:e.id,...e.email?{email:e.email}:{},...t.length>0?{displayName:t}:{}})}function w5(){if(typeof window>`u`||b5)return;let e=window.desktopBridge?.desktopAuth?.onStateChange;e&&(b5=e(e=>{v5=null,y5=null,x5=null,e.sessionLifecycle.status!==`ready`&&t5(null),(e.sessionLifecycle.status===`expired`||e.sessionLifecycle.status===`signed-out`&&e.sessionLifecycle.reason===`refresh-revoked`)&&ue().catch(e=>{n5(e,{route:`desktop-auth-session-expired`})})}))}function Fhe(){return Kt(new URL(window.location.href))}function T5(){let e=new URL(window.location.href),t=qt(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}async function Ihe(){return N5(async()=>{let e=ae(`/api/auth/session`),t=async()=>{let t=await fetch(e,se({credentials:`include`}));if(!t.ok)throw new f5({message:`Failed to load server auth session state (${t.status}).`,status:t.status});return h5(t,e)},n=await t();return!n.authenticated&&n.auth.sessionMethods.length===1&&n.auth.sessionMethods[0]===`proxy-asserted`&&typeof window<`u`&&!window.desktopBridge&&e.startsWith(`https://`)&&await fe()?t():n})}async function Lhe(e){return N5(async()=>{let t={credential:e},n=ae(`/api/auth/bootstrap`),r=await fetch(n,se({body:JSON.stringify(t),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!r.ok)throw new f5({message:await r.text()||`Failed to bootstrap auth session (${r.status}).`,status:r.status});return h5(r,n)})}function E5(e){return new URL(e,window.location.origin).toString()}function D5(e){let t=(e?.primaryMode===`cloud`?null:e)?.bootstrapToken?.trim();return t&&t.length>0?t:null}function O5(){return typeof window>`u`?null:D5(window.desktopBridge?.getLocalEnvironmentBootstrap?.()??null)}function Rhe(){return typeof window>`u`?!1:me()===`session-expired`}function k5(){if(typeof window>`u`)return new Set;try{let e=window.sessionStorage.getItem(C5),t=e?JSON.parse(e):[];return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function A5(e){if(!(typeof window>`u`))try{if(e.size===0){window.sessionStorage.removeItem(C5);return}window.sessionStorage.setItem(C5,JSON.stringify([...e]))}catch{}}function zhe(){let e=O5();if(!e)return;let t=new Set(k5());t.add(e),A5(t)}function Bhe(e){return k5().has(e)}function j5(){let e=O5();if(!e){A5(new Set);return}let t=new Set(k5());t.delete(e),A5(t)}async function M5(){let e=E5(`/api/auth/session`),t=await fetch(e,{credentials:`include`});return t.ok?h5(t,e):null}async function Vhe(e){if(typeof window>`u`)return;let t=D5(e);if(!t||Rhe()||S5.has(t)||Bhe(t))return;if((await M5().catch(()=>null))?.authenticated){S5.add(t);return}let n=E5(`/api/auth/bootstrap`),r=await fetch(n,{body:JSON.stringify({credential:t}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`});if(!r.ok){if(r.status===401)return;throw new f5({message:await r.text()||`Failed to bootstrap local web owner session (${r.status}).`,status:r.status})}await h5(r,n),S5.add(t)}async function Hhe(){let e=await Ihe();if(e.authenticated)return e;let t=ce();if(t?.source!==`desktop-managed`||!t.bearerToken)return e;let n=await M5().catch(()=>null);return n?.authenticated?n:e}var Uhe=new Set([404,502,503,504]),Whe=15e3,Ghe=500;function Khe(e){ce()?.source===`paired-bearer`&&m5(e)&&ie(`http`)}async function N5(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(Khe(e),!Jhe(e))throw e;if(Date.now()-t>=Whe)throw n5(e,{route:`bootstrap-retry-exhausted`}),e;await qhe(Ghe)}}function qhe(e){return new Promise(t=>{setTimeout(t,e)})}function Jhe(e){return p5(e)?Uhe.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}function Yhe(e,t){return e.sessionLifecycle.status===`ready`?e.sessionLifecycle.principalId!==t.id||e.cmmd.identity?.id!==t.id?`desktop-principal-mismatch`:null:`desktop-session-required`}async function Xhe(e){if(typeof window>`u`||!window.desktopBridge)return null;let t=window.desktopBridge.desktopAuth?.getState;if(!t)return`desktop-state-unavailable`;try{return Yhe(await t(),e)}catch(e){return n5(e,{route:`desktop-auth-gate-state`}),`desktop-state-unavailable`}}async function Zhe(e,t){return t5(null),de(t),await D().catch(e=>{n5(e,{route:`desktop-auth-gate-logout`})}),{status:`requires-auth`,auth:e.auth,errorMessage:he(t)??`Forge Desktop requires CMMD authentication.`}}async function Qhe(){let e=await Hhe();if(e.authenticated){if(e.cmmdIdentity){let t=await Xhe(e.cmmdIdentity);return t?(le(),Zhe(e,t)):(le(),Phe(e.cmmdIdentity),{status:`authenticated`})}return{status:`requires-auth`,auth:e.auth}}return{status:`requires-auth`,auth:e.auth}}async function $he(e){let t=e.trim();if(!t)throw Error(`Enter a pairing token to continue.`);y5=null,j5(),await Lhe(t),v5=null,T5()}function P5(){j5(),y5=null,v5=null}async function F5(e,t,n){let r=e.trim();if(!r)throw Error(`CMMD (Command) OAuth did not return an access token.`);let i=n?.refreshToken?.trim(),a=n?.mcpToken?.trim(),o=ae(`/api/auth/bootstrap/command`),s=await fetch(o,se({body:JSON.stringify({accessToken:r,...i?{refreshToken:i}:{},...a?{mcpToken:a}:{},...t===void 0?{}:{user:t}}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!s.ok)throw new f5({message:await s.text()||`Failed to bootstrap with CMMD OAuth token (${s.status}).`,status:s.status});await h5(s,o),P5()}async function ege(){let e=ae(`/api/auth/ws-token`),t=await fetch(e,se({credentials:`include`,method:`POST`}));if(!t.ok)throw new f5({message:await t.text()||`Failed to issue websocket token (${t.status}).`,status:t.status});return h5(t,e)}async function tge(e){let t=await ege(),n=new URL(e,window.location.origin);return n.searchParams.set(`wsToken`,t.token),n.toString()}async function I5(e,t){try{return await O({method:`POST`,path:e,body:t,allowRetry:!1},ir())}catch(e){throw e instanceof ye&&e.kind!==`auth`&&e.code!==null&&ar.has(e.code)?new ye({kind:`auth`,message:e.message,status:e.status??401,code:e.code}):e}}async function nge(e){try{return await I5(`/api/cmmd/tasks/update`,e)}catch(t){if(t instanceof ye&&(t.kind===`auth`||t.kind===`permission`))throw t;if(t instanceof ye||t instanceof Error)return I5(`/api/command/tasks/update`,e);throw t}}async function rge(){typeof window>`u`||await window.desktopBridge?.desktopAuth?.logoutCloud?.()}async function ige(){let e=await Promise.allSettled([D(),rge()]);t5(null),zhe(),v5=null,y5=null;let t=e.find(e=>e.status===`rejected`);if(t)throw t.reason}async function L5(){return w5(),y5?.status===`authenticated`?(le(),y5):v5||g5({start:R5,getSlot:()=>v5,setSlot:e=>{v5=e},onSettled:e=>{e.status===`authenticated`&&(y5=e)},retry:L5})}async function R5(){return oe().then(e=>Vhe(e)).then(()=>Qhe())}function z5(){return w5(),x5||(v5=null,y5=null,g5({start:R5,getSlot:()=>x5,setSlot:e=>{x5=e},onSettled:e=>{e.status===`authenticated`&&(y5=e,le())},retry:z5}))}function age(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/u,``)}function oge(e){let t=age(e).replace(/-/g,`+`).replace(/_/g,`/`);return`-----BEGIN PUBLIC KEY-----\n${((t+`=`.repeat((4-t.length%4)%4)).match(/.{1,64}/gu)??[]).join(`
|
|
1006
|
-
`)}\n-----END PUBLIC KEY-----\n`}function B5(e){return{publicKeyPem:oge(e.publicKeySpkiDer),async sign(t){let n=await crypto.subtle.sign(`Ed25519`,e.privateKey,new TextEncoder().encode(t));return new Uint8Array(n)}}}var sge=`cmmd-session-pop`,V5=`keys`,H5=`device-key`;function cge(){return!1}var U5=class extends Error{constructor(e){super(`CMMD session key storage is unavailable (${e}). Session binding is enabled, so login cannot continue without a bound key: allow site data and IndexedDB for this origin, then retry.`),this.name=`CmmdSessionPopKeyStorageError`}};function lge(e){return e===void 0?typeof indexedDB>`u`?null:indexedDB:e}function W5(e){return new Promise((t,n)=>{e.addEventListener(`success`,()=>t(e.result),{once:!0}),e.addEventListener(`error`,()=>n(e.error),{once:!0})})}function uge(e){return new Promise((t,n)=>{e.addEventListener(`complete`,()=>t(),{once:!0}),e.addEventListener(`abort`,()=>n(e.error??new DOMException(`The transaction aborted.`,`AbortError`)),{once:!0}),e.addEventListener(`error`,()=>n(e.error??new DOMException(`The transaction failed.`,`UnknownError`)),{once:!0})})}function dge(e){return new Promise((t,n)=>{let r=e.open(sge,1);r.addEventListener(`upgradeneeded`,()=>{r.result.objectStoreNames.contains(V5)||r.result.createObjectStore(V5)}),r.addEventListener(`success`,()=>t(r.result),{once:!0}),r.addEventListener(`error`,()=>n(r.error),{once:!0})})}function G5(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.privateKey instanceof CryptoKey&&t.publicKeySpkiDer instanceof Uint8Array}async function fge(e){let t=await W5(e.transaction(V5,`readonly`).objectStore(V5).get(H5));return G5(t)?{privateKey:t.privateKey,publicKeySpkiDer:t.publicKeySpkiDer}:null}async function pge(e,t){let n=e.transaction(V5,`readwrite`),r=n.objectStore(V5),i=uge(n);i.catch(()=>void 0);let a=await W5(r.get(H5));return G5(a)?{privateKey:a.privateKey,publicKeySpkiDer:a.publicKeySpkiDer}:(await W5(r.add(t,H5)),await i,t)}var K5=null;async function mge(e={}){return cge()?(K5??=hge(e).finally(()=>{K5=null}),K5):null}async function hge(e){let t=lge(e.indexedDB),n=e.subtle??crypto.subtle;if(!t)throw new U5(`IndexedDB is not available in this context`);let r;try{r=await dge(t)}catch{throw new U5(`the key database could not be opened`)}try{let e=await fge(r);if(e)return B5({privateKey:e.privateKey,publicKeySpkiDer:e.publicKeySpkiDer});let t=await n.generateKey({name:`Ed25519`},!1,[`sign`]),i={privateKey:t.privateKey,publicKeySpkiDer:new Uint8Array(await n.exportKey(`spki`,t.publicKey))};return B5(await pge(r,i))}catch(e){throw e instanceof U5?e:new U5(`the session key could not be generated or persisted`)}}function q5(e={}){return mge(e).then(e=>e?.publicKeyPem??null)}async function gge(e,t={}){let n=e.email.trim();if(!n||!e.password)throw Error(`Enter your CMMD email and password.`);let r=await(t.resolvePopPublicKey??q5)(),i=ae(`/api/auth/cmmd-password/token`),a=await fetch(i,se({body:JSON.stringify({email:n,password:e.password,...r?{pop_public_key:r}:{}}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!a.ok)throw new f5({message:await a.text()||`CMMD login failed (${a.status}).`,status:a.status});let o=await h5(a,i);if(o.authenticated===!0)return P5(),{serverEstablishedSession:!0};if(typeof o.access_token!=`string`||o.access_token.trim().length===0)throw Error(`CMMD login did not return an access token.`);return await F5(o.access_token,o.user,{refreshToken:typeof o.refresh_token==`string`?o.refresh_token:void 0,mcpToken:typeof o.mcp_token==`string`?o.mcp_token:void 0}),{serverEstablishedSession:!1}}async function J5(e,t){return await e.text()||t}async function _ge(e,t){let n=e?.trim(),r={...n?{label:n}:{},...t?{role:t}:{}},i=ae(`/api/auth/pairing-token`),a=await fetch(i,se({body:JSON.stringify(r),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!a.ok)throw Error(await J5(a,`Failed to create pairing credential (${a.status}).`));return h5(a,i)}async function vge(){let e=ae(`/api/auth/clients`),t=await fetch(e,se({credentials:`include`}));if(!t.ok)throw Error(await J5(t,`Failed to load paired clients (${t.status}).`));return h5(t,e)}async function yge(e){let t=ae(`/api/auth/pairing-links/revoke`),n=await fetch(t,se({body:JSON.stringify({id:e}),credentials:`include`,headers:{"content-type":`application/json`},method:`POST`}));if(!n.ok)throw Error(await J5(n,`Failed to revoke the pairing link (${n.status}).`));return(await h5(n,t)).revoked}var bge=`/.well-known/forge/environment`,Y5=ve()(e=>({descriptor:null,setDescriptor:t=>e({descriptor:t}),reset:()=>e({descriptor:null})})),X5=null;function xge(e){let t=Z5();return t?Te(Se({id:t.environmentId,label:t.label,source:e.source,target:e.target}),t):null}async function Sge(){return N5(async()=>{await oe();let e=ce()?.bearerToken,t=ae(bge),n=e?await fetch(t,{headers:{Authorization:`Bearer ${e}`}}):await fetch(t);if(!n.ok)throw new f5({message:`Failed to load server environment descriptor (${n.status}).`,status:n.status});let r=await h5(n,t);return Q5(r),r})}function Z5(){return Y5.getState().descriptor}function Cge(){return Y5(wge)}function wge(e){return e.descriptor?.environmentId??null}function Tge(){return Y5(Ege)}function Ege(e){return e.descriptor}function Dge(){return Y5(Oge)}function Oge(e){return e.descriptor?.deviceRuntimeId??null}function kge(){return Z5()?.deviceRuntimeId??null}function Age(){return Y5(jge)}function jge(e){return Ae(e.descriptor)}function Mge(){return Y5(Nge)}function Nge(e){return je(e.descriptor)}function Q5(e){Y5.getState().setDescriptor(e)}function Pge(e,t){return t?.primaryMode!==`cloud`||e.environmentId===t.environmentId}function $5(){let e=ce();return e?xge({source:e.source,target:e.target}):null}function Fge(){return Ige()}async function Ige(){let e=await oe(),t=Z5();if(t&&Pge(t,e))return Promise.resolve(t);if(t&&Q5(null),X5)return X5;let n=Sge();return X5=n,n.finally(()=>{X5===n&&(X5=null)})}var e7=class e{#e;constructor(e){this.#e=e}static namedByCatalog(t){return new e(t.projectId)}get registrationProjectId(){return this.#e}asConfirmationIdentity(){return{registrationProjectId:this.#e}}};function t7(e){return{match:t=>t.present({target:e})}}function n7(){return{match:e=>e.provablyAbsent()}}function Lge(e){return{match:t=>t.unprovable(e)}}var Rge=class e{#e;#t;capacity;constructor(e,t,n){this.#e=e,this.#t=t,this.capacity=n}static fromValidatedBody(t,n,r){return new e(t,n,r)}listRowsForDisplay(){return this.#e}listEnvironmentsForDisplay(){return this.#t}locate(e){if(e.registrationProjectId!==void 0){let t=this.#e.find(t=>t.projectId===e.registrationProjectId);return t===void 0?n7():t7(e7.namedByCatalog(t))}if(e.runtimeId!==void 0||e.cmmdEnvironmentId!==void 0){let t=this.#e.find(t=>t.runtime!=null&&(e.runtimeId!==void 0&&t.runtime.runtimeId===e.runtimeId||e.cmmdEnvironmentId!==void 0&&t.runtime.environmentId===e.cmmdEnvironmentId));if(t)return t7(e7.namedByCatalog(t))}if(this.#e.length===0)return n7();let t=e.runtimeId??e.cmmdEnvironmentId;return Lge(t===void 0?`no identity this catalog can be matched on`:`the catalog holds ${String(this.#e.length)} row(s) that ${t} cannot be ruled out against`)}};function r7(e){let t=e,n=t&&typeof t==`object`&&`data`in t&&t.data?t.data:t,r=n?.projects;if(!Array.isArray(r))throw Error("Forge Cloud returned a project catalog this version cannot read (no `projects` list).");let i=n?.environments;if(!Array.isArray(i))throw Error("Forge Cloud returned an Environment catalog this version cannot read (invalid `environments` list).");if(!r.every(zge))throw Error(`Forge Cloud returned a project catalog this version cannot read (invalid project entry).`);if(!i.every(Bge))throw Error(`Forge Cloud returned an Environment catalog this version cannot read (invalid Environment entry).`);return Rge.fromValidatedBody(r,i,n?.capacity??null)}function zge(e){return!a7(e)||typeof e.organizationId!=`number`||typeof e.projectId!=`number`?!1:e.runtime===void 0||e.runtime===null||i7(e.runtime)}function Bge(e){return a7(e)&&typeof e.organizationId==`number`&&typeof e.userId==`number`&&i7(e.runtime)}function i7(e){return a7(e)&&typeof e.runtimeId==`string`&&typeof e.status==`string`}function a7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Vge(e,t){let n=new URL(e);return n.pathname=t,n.search=``,n.hash=``,n.toString()}function o7(e){return e.accessToken??e.resolveAccessToken?.()}function s7(e,t,n=t=>Vge(e.cmmdHttpBaseUrl,t)){return O({method:t.method,path:t.path,...t.body===void 0?{}:{body:t.body},...t.signal===void 0?{}:{signal:t.signal}},{resolveUrl:n,resolveBearerToken:()=>o7(e)})}function Hge(e,t){return s7(e,{method:`GET`,path:`/api/forge/context/cloud-projects/${encodeURIComponent(String(t.projectId))}/removal-preview`,...t.signal===void 0?{}:{signal:t.signal}},e.cloudProjectRemovalPreviewUrl?()=>e.cloudProjectRemovalPreviewUrl(t.projectId):void 0).then(e=>e.preview)}function Uge(e,t){return s7(e,{method:`POST`,path:`/api/forge/context/cloud-projects/${encodeURIComponent(String(t.projectId))}/removal`,body:{idempotencyKey:t.idempotencyKey,deletePlanningProject:t.deletePlanningProject,...t.deleteCheckoutFiles===void 0?{}:{deleteCheckoutFiles:t.deleteCheckoutFiles},...t.previewToken===void 0?{}:{previewToken:t.previewToken},...t.forceDirty===void 0?{}:{forceDirty:t.forceDirty}},...t.signal===void 0?{}:{signal:t.signal}},e.cloudProjectRemovalUrl?()=>e.cloudProjectRemovalUrl(t.projectId):void 0).then(e=>e.operation)}function c7(e,t=``){return`/api/forge/context/runtimes/${encodeURIComponent(e)}${t}`}async function Wge(e){if(e.ok)return;let{CmmdApiError:t}=await _e(async()=>{let{CmmdApiError:e}=await import(`./transport-CgH8pQK3.js`).then(e=>e.r);return{CmmdApiError:e}},__vite__mapDeps([7,1]));if(e.status===401||e.status===403){let n=null;try{let t=await e.json();n=typeof t?.code==`string`?t.code:null}catch{}throw new t({kind:`auth`,message:`CMMD authentication required. Sign in again to continue.`,status:e.status,code:n})}throw new t({kind:e.status>=500?`server`:`client`,message:`forge-cloud-projects proxy error (${e.status})`,status:e.status})}var l7=class{config;constructor(e){this.config=e}async ensureRuntime(e){return(await s7(this.config,{method:`POST`,path:`/api/forge/context/runtimes/ensure`,body:{...e.projectId===void 0?{}:{projectId:e.projectId},...e.organizationId===void 0?{}:{organizationId:e.organizationId},...e.githubRepoFullName===void 0?{}:{githubRepoFullName:e.githubRepoFullName},...e.workspaceRoot===void 0?{}:{workspaceRoot:e.workspaceRoot}},...e.signal===void 0?{}:{signal:e.signal}},this.config.ensureUrl?()=>this.config.ensureUrl:void 0)).runtime}async connectRuntime(e){return s7(this.config,{method:`POST`,path:c7(e.runtimeId,`/connect`),...e.organizationId===void 0?{}:{body:{organizationId:e.organizationId}},...e.signal===void 0?{}:{signal:e.signal}})}async getRuntime(e){return(await s7(this.config,{method:`GET`,path:c7(e.runtimeId),...e.signal===void 0?{}:{signal:e.signal}})).runtime}async destroyRuntime(e){return(await s7(this.config,{method:`POST`,path:c7(e.runtimeId,`/destroy`),body:{purgeVolume:e.purgeVolume??!1,...e.force===!0?{force:!0}:{},...e.reason===void 0?{}:{reason:e.reason},...e.organizationId===void 0?{}:{organizationId:e.organizationId}},...e.signal===void 0?{}:{signal:e.signal}},this.config.destroyUrl?()=>this.config.destroyUrl(e.runtimeId):void 0)).runtime}async runRuntimeLifecycleAction(e){return(await s7(this.config,{method:`POST`,path:c7(e.runtimeId,`/${e.action}`),body:e.organizationId===void 0?{}:{organizationId:e.organizationId},...e.signal===void 0?{}:{signal:e.signal}},this.config.lifecycleUrl?()=>this.config.lifecycleUrl(e.runtimeId,e.action):void 0)).runtime}async updateRuntimeCommit(e){return(await s7(this.config,{method:`POST`,path:c7(e.runtimeId,`/update-commit`),body:e.organizationId===void 0?{}:{organizationId:e.organizationId},...e.signal===void 0?{}:{signal:e.signal}},this.config.updateCommitUrl?()=>this.config.updateCommitUrl(e.runtimeId):void 0)).operation}async getRuntimeCommitUpdateOperation(e){return(await s7(this.config,{method:`GET`,path:c7(e.runtimeId,`/update-commit/${encodeURIComponent(String(e.operationId))}`),...e.signal===void 0?{}:{signal:e.signal}},this.config.updateCommitOperationUrl?()=>this.config.updateCommitOperationUrl(e.runtimeId,e.operationId):void 0)).operation}async listCloudProjects(e){if(this.config.listUrl){let t=o7(this.config),n=await fetch(this.config.listUrl,{method:`GET`,headers:{Accept:`application/json`,...t?{Authorization:`Bearer ${t}`}:{}},credentials:t?`omit`:`include`,cache:`no-store`,...e?.signal===void 0?{}:{signal:e.signal}});return await Wge(n),r7(await n.json())}return r7(await s7(this.config,{method:`GET`,path:`/api/forge/context/cloud-projects`,...e?.signal===void 0?{}:{signal:e.signal}}))}async previewCloudProjectRemoval(e){return Hge(this.config,e)}async requestCloudProjectRemoval(e){return Uge(this.config,e)}async getCloudProjectRemoval(e){return(await s7(this.config,{method:`GET`,path:`/api/forge/context/cloud-projects/removals/${encodeURIComponent(e.operationId)}`,...e.signal===void 0?{}:{signal:e.signal}},this.config.cloudProjectRemovalReceiptUrl?()=>this.config.cloudProjectRemovalReceiptUrl(e.operationId):void 0)).operation}},u7=`/api/attachments/upload/`;function Gge(e){if(!e.relativeUrl.startsWith(u7))throw Error(`Attachment upload URL did not use the expected upload route.`);let t=e.relativeUrl.slice(24);if(!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(t))throw Error(`Attachment upload URL did not contain a valid signed token.`);if(e.relativeUrl.includes(`?`)||e.relativeUrl.includes(`#`))throw Error(`Attachment upload URL must not include a query or fragment.`);let n=new URL(e.httpBaseUrl),r=n.pathname.endsWith(`/`)?n.pathname.slice(0,-1):n.pathname,i=`${r}${u7}`,a=new URL(`${r}${e.relativeUrl}`,n);if(a.origin!==n.origin||!a.pathname.startsWith(i))throw Error(`Attachment upload URL resolved outside the selected environment.`);return a.toString()}var d7=!1,f7=null;function p7(e){return Object.values(e)}function m7(e){return e.map(e=>s(e))}function h7(e){try{Bt(m7(p7(e))).catch(e=>{console.error(`[SAVED_ENVIRONMENTS] persist failed`,e)})}catch(e){console.error(`[SAVED_ENVIRONMENTS] persist failed`,e)}}function Kge(e){let t=g7.getState().byId,n=Object.fromEntries(e.map(e=>[e.environmentId,e]));g7.setState({byId:{...n,...t}})}async function qge(){if(d7)return;if(f7)return f7;let e=(async()=>{try{Kge(await zt())}catch(e){console.error(`[SAVED_ENVIRONMENTS] hydrate failed`,e)}finally{d7=!0,g7.setState({hydrated:!0})}})().finally(()=>{f7===e&&(f7=null)});return f7=e,f7}var g7=ve()(e=>({byId:{},hydrated:d7,upsert:t=>e(e=>{let n={...e.byId,[t.environmentId]:t};return h7(n),{byId:n}}),remove:t=>e(e=>{let{[t]:n,...r}=e.byId;return h7(r),{byId:r}}),markConnected:(t,n)=>e(e=>{let r=e.byId[t];if(!r)return e;let i={...e.byId,[t]:{...r,lastConnectedAt:n}};return h7(i),{byId:i}}),reset:()=>{h7({}),e({byId:{}})}}));function _7(){return d7}function Jge(){return _7()?Promise.resolve():qge()}function v7(){return Object.values(g7.getState().byId).toSorted((e,t)=>e.label.localeCompare(t.label))}function Yge(){return v7().filter(e=>e.lastAuthenticatedPullRequestCapability===!0)}function y7(e){return g7.getState().byId[e]??null}function b7(e){let t=$5();return t?.environmentId===e?we(t):y7(e)?.httpBaseUrl??null}function x7(e){let t=b7(e.environmentId)??(typeof window<`u`?window.location.origin:null);if(!t)throw Error(`Unable to resolve HTTP base URL for environment ${e.environmentId}.`);let n=new URL(t);return n.pathname=`${n.pathname.endsWith(`/`)?n.pathname.slice(0,-1):n.pathname}${e.pathname.startsWith(`/`)?e.pathname:`/${e.pathname}`}`,e.searchParams&&(n.search=new URLSearchParams(e.searchParams).toString()),n.toString()}function S7(e){if(!b7(e))throw Error(`Unable to resolve HTTP base URL for environment ${e}.`)}function Xge(e){return S7(e.environmentId),Gge({httpBaseUrl:b7(e.environmentId),relativeUrl:e.relativeUrl})}async function Zge(e){await Bt(m7(p7({...g7.getState().byId,[e.environmentId]:e})))}async function Qge(e,t){let{[e]:n,...r}=g7.getState().byId,i={...r,[t.environmentId]:t};await Bt(m7(p7(i))),g7.setState({byId:i})}async function $ge(e){return Vt(e)}async function e_e(e,t){return Ht(e,t)}async function t_e(e){await Ut(e)}function n_e(e,t){return e.reasoningEffortLevels.some(e=>e.value===t)}function C7(e){return e.reasoningEffortLevels.find(e=>e.isDefault)?.value??null}function w7(e,t){let n=C7(e),r=typeof t==`string`?t.trim():null;return r&&!e.promptInjectedEffortLevels.includes(r)&&n_e(e,r)?r:n??void 0}function T7(e,t){return e.contextWindowOptions.some(e=>e.value===t)}function E7(e){return e.contextWindowOptions.find(e=>e.isDefault)?.value??null}function r_e(e,t){let n=E7(e);return t&&T7(e,t)?t:n??void 0}function i_e(e,t){let n=w7(e,t?.reasoningEffort),r=e.supportsFastMode?t?.fastMode:void 0,i={...n?{reasoningEffort:n}:{},...r===void 0?{}:{fastMode:r}};return Object.keys(i).length>0?i:void 0}function a_e(e,t){let n=w7(e,t?.effort),r=e.supportsThinkingToggle?t?.thinking:void 0,i=e.supportsFastMode?t?.fastMode:void 0,a=r_e(e,t?.contextWindow),o={...r===void 0?{}:{thinking:r},...n?{effort:n}:{},...i===void 0?{}:{fastMode:i},...a===void 0?{}:{contextWindow:a}};return Object.keys(o).length>0?o:void 0}function o_e(e){return typeof e==`string`&&/\bultrathink\b/i.test(e)}function D7(e,t=`codex`){if(typeof e!=`string`)return null;let n=e.trim();if(!n)return null;let r=g[t],i=Object.prototype.hasOwnProperty.call(r,n)?r[n]:void 0;return typeof i==`string`?i:n}function s_e(e,t,n){if(typeof t!=`string`)return null;let r=t.trim();if(!r)return null;let i=n.find(e=>e.slug===r);if(i)return i.slug;let a=n.find(e=>e.name.toLowerCase()===r.toLowerCase());if(a)return a.slug;let o=D7(r,e),s=n.find(e=>e.slug===o);return s?s.slug:null}var c_e=[`codex`,`claudeAgent`];function O7(e,t){return c_e.filter(e=>e!==t).some(t=>ne(t,e)!==void 0)}function l_e(e,t){let n=D7(e,t);return!n||O7(n,t)?te[t]:n}function k7(e,t){return l_e(t,e)}function u_e(e){return typeof e==`string`&&e.trim()||null}function d_e(e,t){let n=e.trim();return!n||t!==`ultrathink`||n.startsWith(`Ultrathink:`)?n:`Ultrathink:\n${n}`}function A7(e,t){return{id:e.id,environmentId:t,name:e.title,cwd:e.workspaceRoot,repositoryIdentity:e.repositoryIdentity??null,availability:e.availability,defaultThreadEnvMode:e.defaultThreadEnvMode??null,cmmdRegistration:e.cmmdRegistration??null,defaultModelSelection:e.defaultModelSelection?j7(e.defaultModelSelection):null,createdAt:e.createdAt,updatedAt:e.updatedAt,scripts:M7(e.scripts)}}function j7(e){return{...e,model:k7(e.provider,e.model)}}function M7(e){return e.map(e=>({...e}))}function f_e(e,t){return{...e,...t.title===void 0?{}:{name:t.title},...t.workspaceRoot===void 0?{}:{cwd:t.workspaceRoot},...t.repositoryIdentity===void 0?{}:{repositoryIdentity:t.repositoryIdentity??null},...t.defaultThreadEnvMode===void 0?{}:{defaultThreadEnvMode:t.defaultThreadEnvMode},...t.cmmdRegistration===void 0?{}:{cmmdRegistration:t.cmmdRegistration},...t.defaultModelSelection===void 0?{}:{defaultModelSelection:t.defaultModelSelection?j7(t.defaultModelSelection):null},...t.scripts===void 0?{}:{scripts:M7(t.scripts)},updatedAt:t.updatedAt}}function N7(e){let t=K8(e.lastError);return{provider:m_e(e.providerName),status:p_e(e.status),orchestrationStatus:e.status,activeTurnId:e.activeTurnId??void 0,createdAt:e.updatedAt,updatedAt:e.updatedAt,...t?{lastError:t}:{}}}function P7(e,t){let n=t.attachments?.map(t=>{let n=x7({environmentId:e,pathname:h_e(t.id)});return t.type===`image`?{...t,previewUrl:n}:{...t,downloadUrl:n}});return{id:t.id,role:t.role,text:t.text,turnId:t.turnId,createdAt:t.createdAt,streaming:t.streaming,...t.streaming?{}:{completedAt:t.updatedAt},...n&&n.length>0?{attachments:n}:{}}}function F7(e){return{id:e.id,turnId:e.turnId,planMarkdown:e.planMarkdown,implementedAt:e.implementedAt,implementationThreadId:e.implementationThreadId,createdAt:e.createdAt,updatedAt:e.updatedAt}}function I7(e){return{turnId:e.turnId,completedAt:e.completedAt,status:e.status,assistantMessageId:e.assistantMessageId??void 0,checkpointTurnCount:e.checkpointTurnCount,checkpointRef:e.checkpointRef,files:e.files.map(e=>({...e}))}}function p_e(e){switch(e){case`starting`:return`connecting`;case`running`:return`running`;case`error`:return`error`;case`ready`:case`interrupted`:return`ready`;case`idle`:case`stopped`:return`closed`}}function m_e(e){return e===`codex`||e===`claudeAgent`||e===`ollama`||e===`cmmd`||e===`apex`?e:`codex`}function h_e(e){return`/attachments/${encodeURIComponent(e)}`}var g_e=[],__e=[],v_e=[],y_e=[],b_e={},x_e={},S_e={},C_e={},w_e=[],L7=new WeakMap,R7=new WeakMap;function z7(e,t,n){if(!e||e.length===0||!t)return n;let r=L7.get(e),i=r?.get(t);if(i)return i;let a=e.flatMap(e=>{let n=t[e];return n?[n]:[]}),o=r??new WeakMap;return o.set(t,a),r||L7.set(e,o),a}function T_e(e,t){return z7(e.messageIdsByThreadId[t],e.messageByThreadId[t]??b_e,g_e)}function E_e(e,t){return z7(e.activityIdsByThreadId[t],e.activityByThreadId[t]??x_e,__e)}function D_e(e,t){return z7(e.proposedPlanIdsByThreadId[t],e.proposedPlanByThreadId[t]??S_e,v_e)}function O_e(e,t){return z7(e.turnDiffIdsByThreadId[t],e.turnDiffSummaryByThreadId[t]??C_e,y_e)}function B7(e,t){let n=e.threadShellById[t];if(!n)return;let r=e.threadSessionById[t]??null,i=e.threadTurnStateById[t],a=e.threadRateLimitStatusById[t]??w_e,o=T_e(e,t),s=E_e(e,t),c=D_e(e,t),l=O_e(e,t),u=R7.get(n);if(u&&u.session===r&&u.turnState===i&&u.rateLimitStatus===a&&u.messages===o&&u.activities===s&&u.proposedPlans===c&&u.turnDiffSummaries===l)return u.thread;let d={...n,session:r,latestTurn:i?.latestTurn??null,pendingSourceProposedPlan:i?.pendingSourceProposedPlan,rateLimitStatus:a,messages:o,activities:s,proposedPlans:c,turnDiffSummaries:l};return R7.set(n,{session:r,turnState:i,rateLimitStatus:a,messages:o,activities:s,proposedPlans:c,turnDiffSummaries:l,thread:d}),d}function k_e(e,t){let n=t.providerAccountId??null,r=e=>e.provider===t.provider&&(e.providerAccountId??null)===n,i=e.find(r),a={status:t.status,usedPercent:t.usedPercent,resetsAt:t.resetsAt},o={provider:t.provider,providerAccountId:n,fiveHour:t.window===`five_hour`?a:i?.fiveHour??null,sevenDay:t.window===`seven_day`?a:i?.sevenDay??null};return[...e.filter(e=>!r(e)),o]}function V7(e){return{settledAt:e.settledAt??null,settledOverride:e.settledOverride??null}}var H7={projectIds:[],projectById:{},threadIds:[],threadIdsByProjectId:{},threadShellById:{},threadSessionById:{},threadTurnStateById:{},threadRateLimitStatusById:{},messageIdsByThreadId:{},messageByThreadId:{},activityIdsByThreadId:{},activityByThreadId:{},proposedPlanIdsByThreadId:{},proposedPlanByThreadId:{},turnDiffIdsByThreadId:{},turnDiffSummaryByThreadId:{},sidebarThreadSummaryById:{},threadSubscriptionErrorById:{},bootstrapComplete:!1},A_e={activeEnvironmentId:null,environmentStateById:{}},U7=[],W7=[];function G7(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function K7(e,t){return{id:e.id,environmentId:t,codexThreadId:null,projectId:e.projectId,title:e.title,modelSelection:j7(e.modelSelection),runtimeMode:e.runtimeMode,interactionMode:e.interactionMode,session:e.session?N7(e.session):null,messages:e.messages.map(e=>P7(t,e)),proposedPlans:e.proposedPlans.map(F7),error:K8(e.session?.lastError),createdAt:e.createdAt,archivedAt:e.archivedAt,...V7(e),updatedAt:e.updatedAt,latestTurn:e.latestTurn,pendingSourceProposedPlan:e.latestTurn?.sourceProposedPlan,branch:e.branch,worktreePath:e.worktreePath,turnDiffSummaries:e.checkpoints.map(I7),activities:e.activities.map(e=>({...e})),anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null,pendingAutoCreatePrompt:e.pendingAutoCreatePrompt??null,rateLimitStatus:e.rateLimitStatus??[]}}function q7(e,t){let n={id:e.id,environmentId:t,codexThreadId:null,projectId:e.projectId,title:e.title,modelSelection:j7(e.modelSelection),runtimeMode:e.runtimeMode,interactionMode:e.interactionMode,error:K8(e.session?.lastError),createdAt:e.createdAt,archivedAt:e.archivedAt,...V7(e),updatedAt:e.updatedAt,branch:e.branch,worktreePath:e.worktreePath,anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null},r=e.session?N7(e.session):null;return{shell:n,session:r,turnState:{latestTurn:e.latestTurn,pendingSourceProposedPlan:e.latestTurn?.sourceProposedPlan},summary:{id:e.id,modelSelection:n.modelSelection,environmentId:t,projectId:e.projectId,title:e.title,interactionMode:e.interactionMode,session:r,createdAt:e.createdAt,archivedAt:e.archivedAt,...V7(e),updatedAt:e.updatedAt,latestTurn:e.latestTurn,branch:e.branch,worktreePath:e.worktreePath,latestUserMessageAt:e.latestUserMessageAt,hasPendingApprovals:e.hasPendingApprovals,hasPendingUserInput:e.hasPendingUserInput,hasActionableProposedPlan:e.hasActionableProposedPlan,anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null}}}function j_e(e){return{id:e.id,environmentId:e.environmentId,codexThreadId:e.codexThreadId,projectId:e.projectId,title:e.title,modelSelection:e.modelSelection,runtimeMode:e.runtimeMode,interactionMode:e.interactionMode,error:e.error,createdAt:e.createdAt,archivedAt:e.archivedAt,settledAt:e.settledAt,settledOverride:e.settledOverride,updatedAt:e.updatedAt,branch:e.branch,worktreePath:e.worktreePath,anchorKind:e.anchorKind,anchorCmmdId:e.anchorCmmdId,linkedPullRequest:e.linkedPullRequest??null,kind:e.kind,parentThreadId:e.parentThreadId,status:e.status,workerRole:e.workerRole??null,goal:e.goal??null,titleRegeneration:e.titleRegeneration??null}}function M_e(e){return{latestTurn:e.latestTurn,...e.pendingSourceProposedPlan?{pendingSourceProposedPlan:e.pendingSourceProposedPlan}:{}}}function J7(e,t){return e===t?!0:e===void 0||t===void 0?!1:e.threadId===t.threadId&&e.planId===t.planId}function Y7(e,t){return e===t?!0:e==null||t==null?!1:e.turnId===t.turnId&&e.state===t.state&&e.requestedAt===t.requestedAt&&e.startedAt===t.startedAt&&e.completedAt===t.completedAt&&e.assistantMessageId===t.assistantMessageId&&J7(e.sourceProposedPlan,t.sourceProposedPlan)}function X7(e,t){return e===t?!0:e==null||t==null?!1:e.provider===t.provider&&e.status===t.status&&e.orchestrationStatus===t.orchestrationStatus&&e.activeTurnId===t.activeTurnId&&e.createdAt===t.createdAt&&e.updatedAt===t.updatedAt&&e.lastError===t.lastError}function Z7(e,t){return e===t?!0:e==null||t==null?!1:e.projectId===t.projectId&&e.projectRepositoryId===t.projectRepositoryId&&e.provider===t.provider&&e.host===t.host&&e.repository===t.repository&&e.number===t.number&&e.url===t.url}function Q7(e,t){return e!==void 0&&e.id===t.id&&e.environmentId===t.environmentId&&e.projectId===t.projectId&&e.title===t.title&&$7(e.titleRegeneration,t.titleRegeneration)&&e.interactionMode===t.interactionMode&&X7(e.session,t.session)&&e.createdAt===t.createdAt&&e.archivedAt===t.archivedAt&&e.settledAt===t.settledAt&&e.settledOverride===t.settledOverride&&e.updatedAt===t.updatedAt&&Y7(e.latestTurn,t.latestTurn)&&e.branch===t.branch&&e.worktreePath===t.worktreePath&&e.latestUserMessageAt===t.latestUserMessageAt&&e.hasPendingApprovals===t.hasPendingApprovals&&e.hasPendingUserInput===t.hasPendingUserInput&&e.hasActionableProposedPlan===t.hasActionableProposedPlan&&e.anchorKind===t.anchorKind&&e.anchorCmmdId===t.anchorCmmdId&&Z7(e.linkedPullRequest,t.linkedPullRequest)&&e.kind===t.kind&&e.parentThreadId===t.parentThreadId&&e.status===t.status}function $7(e,t){return e===t?!0:e==null||t==null?!1:e.requestId===t.requestId&&e.startedAt===t.startedAt}function e9(e,t){return e!==void 0&&e.id===t.id&&e.environmentId===t.environmentId&&e.codexThreadId===t.codexThreadId&&e.projectId===t.projectId&&e.title===t.title&&e.modelSelection===t.modelSelection&&e.runtimeMode===t.runtimeMode&&e.interactionMode===t.interactionMode&&e.error===t.error&&e.createdAt===t.createdAt&&e.archivedAt===t.archivedAt&&e.settledAt===t.settledAt&&e.settledOverride===t.settledOverride&&e.updatedAt===t.updatedAt&&e.branch===t.branch&&e.worktreePath===t.worktreePath&&e.anchorKind===t.anchorKind&&e.anchorCmmdId===t.anchorCmmdId&&Z7(e.linkedPullRequest,t.linkedPullRequest)&&e.kind===t.kind&&e.parentThreadId===t.parentThreadId&&e.status===t.status&&e.goal===t.goal&&$7(e.titleRegeneration,t.titleRegeneration)}function t9(e,t){return e!==void 0&&Y7(e.latestTurn,t.latestTurn)&&J7(e.pendingSourceProposedPlan,t.pendingSourceProposedPlan)}function N_e(e,t){return e.includes(t)?[...e]:[...e,t]}function n9(e,t){return e.filter(e=>e!==t)}function P_e(e){return{ids:e.messages.map(e=>e.id),byId:Object.fromEntries(e.messages.map(e=>[e.id,e]))}}function F_e(e){return{ids:e.activities.map(e=>e.id),byId:Object.fromEntries(e.activities.map(e=>[e.id,e]))}}function I_e(e){return{ids:e.proposedPlans.map(e=>e.id),byId:Object.fromEntries(e.proposedPlans.map(e=>[e.id,e]))}}function L_e(e){return{ids:e.turnDiffSummaries.map(e=>e.turnId),byId:Object.fromEntries(e.turnDiffSummaries.map(e=>[e.turnId,e]))}}function R_e(e){return e.projectIds.flatMap(t=>{let n=e.projectById[t];return n?[n]:[]})}function r9(e){return e.threadIds.flatMap(t=>{let n=B7(e,t);return n?[n]:[]})}function i9(e,t,n,r){let i=e;if(e.threadIds.includes(t)||(i={...i,threadIds:[...i.threadIds,t]}),r!==n){let e=i.threadIdsByProjectId;if(r){let n=e[r]??U7,i=n9(n,t);if(i.length===0){let{[r]:t,...n}=e;e=n}else G7(n,i)||(e={...e,[r]:i})}let a=e[n]??U7,o=N_e(a,t);G7(a,o)||(e={...e,[n]:o}),e!==i.threadIdsByProjectId&&(i={...i,threadIdsByProjectId:e})}return i}function a9(e,t,n){let r=j_e(t),i=M_e(t),a=e.threadShellById[t.id],o=e.threadTurnStateById[t.id],s=i9(e,t.id,t.projectId,n?.projectId);e9(a,r)||(s={...s,threadShellById:{...s.threadShellById,[t.id]:r}});let c=e.sidebarThreadSummaryById[t.id];if(c!==void 0){let e={...c,title:t.title,modelSelection:t.modelSelection,interactionMode:t.interactionMode,session:t.session,createdAt:t.createdAt,archivedAt:t.archivedAt,settledAt:t.settledAt,settledOverride:t.settledOverride,updatedAt:t.updatedAt,latestTurn:t.latestTurn,branch:t.branch,worktreePath:t.worktreePath,anchorKind:t.anchorKind,anchorCmmdId:t.anchorCmmdId,linkedPullRequest:t.linkedPullRequest??null,goal:t.goal,titleRegeneration:t.titleRegeneration??null,kind:t.kind,parentThreadId:t.parentThreadId,status:t.status,workerRole:t.workerRole};Q7(c,e)||(s={...s,sidebarThreadSummaryById:{...s.sidebarThreadSummaryById,[t.id]:e}})}if(X7(n?.session??null,t.session)||(s={...s,threadSessionById:{...s.threadSessionById,[t.id]:t.session}}),(n?.rateLimitStatus??W7)!==(t.rateLimitStatus??W7)&&(s={...s,threadRateLimitStatusById:{...s.threadRateLimitStatusById,[t.id]:t.rateLimitStatus??W7}}),t9(o,i)||(s={...s,threadTurnStateById:{...s.threadTurnStateById,[t.id]:i}}),n?.messages!==t.messages){let e=P_e(t);s={...s,messageIdsByThreadId:{...s.messageIdsByThreadId,[t.id]:e.ids},messageByThreadId:{...s.messageByThreadId,[t.id]:e.byId}}}if(n?.activities!==t.activities){let e=F_e(t);s={...s,activityIdsByThreadId:{...s.activityIdsByThreadId,[t.id]:e.ids},activityByThreadId:{...s.activityByThreadId,[t.id]:e.byId}}}if(n?.proposedPlans!==t.proposedPlans){let e=I_e(t);s={...s,proposedPlanIdsByThreadId:{...s.proposedPlanIdsByThreadId,[t.id]:e.ids},proposedPlanByThreadId:{...s.proposedPlanByThreadId,[t.id]:e.byId}}}if(n?.turnDiffSummaries!==t.turnDiffSummaries){let e=L_e(t);s={...s,turnDiffIdsByThreadId:{...s.turnDiffIdsByThreadId,[t.id]:e.ids},turnDiffSummaryByThreadId:{...s.turnDiffSummaryByThreadId,[t.id]:e.byId}}}return s}function o9(e,t){let n=e.threadShellById[t.shell.id],r=i9(e,t.shell.id,t.shell.projectId,n?.projectId);return e9(n,t.shell)||(r={...r,threadShellById:{...r.threadShellById,[t.shell.id]:t.shell}}),X7(e.threadSessionById[t.shell.id]??null,t.session)||(r={...r,threadSessionById:{...r.threadSessionById,[t.shell.id]:t.session}}),t9(e.threadTurnStateById[t.shell.id],t.turnState)||(r={...r,threadTurnStateById:{...r.threadTurnStateById,[t.shell.id]:t.turnState}}),Q7(e.sidebarThreadSummaryById[t.shell.id],t.summary)||(r={...r,sidebarThreadSummaryById:{...r.sidebarThreadSummaryById,[t.shell.id]:t.summary}}),r}function s9(e,t){return Object.fromEntries(Object.entries(e).flatMap(([e,n])=>t.has(e)?[[e,n]]:[]))}function c9(e,t){let n=e.threadShellById[t],r=e.sidebarThreadSummaryById[t],i=n?.projectId??r?.projectId;if(!i)return e;let a=n9(e.threadIds,t),o=n9(e.threadIdsByProjectId[i]??U7,t),s=o.length===0?(()=>{let{[i]:t,...n}=e.threadIdsByProjectId;return n})():{...e.threadIdsByProjectId,[i]:o},{[t]:c,...l}=e.threadShellById,{[t]:u,...d}=e.threadSessionById,{[t]:f,...p}=e.threadTurnStateById,{[t]:m,...h}=e.messageIdsByThreadId,{[t]:g,..._}=e.messageByThreadId,{[t]:v,...y}=e.activityIdsByThreadId,{[t]:b,...x}=e.activityByThreadId,{[t]:S,...C}=e.proposedPlanIdsByThreadId,{[t]:w,...T}=e.proposedPlanByThreadId,{[t]:ee,...E}=e.turnDiffIdsByThreadId,{[t]:te,...ne}=e.turnDiffSummaryByThreadId,{[t]:re,...ie}=e.sidebarThreadSummaryById;return{...e,threadIds:a,threadIdsByProjectId:s,threadShellById:l,threadSessionById:d,threadTurnStateById:p,messageIdsByThreadId:h,messageByThreadId:_,activityIdsByThreadId:y,activityByThreadId:x,proposedPlanIdsByThreadId:C,proposedPlanByThreadId:T,turnDiffIdsByThreadId:E,turnDiffSummaryByThreadId:ne,sidebarThreadSummaryById:ie}}function z_e(e,t){let n=new Set(e.threadIdsByProjectId[t]??U7);for(let[r,i]of Object.entries(e.threadShellById))i.projectId===t&&n.add(r);for(let[r,i]of Object.entries(e.sidebarThreadSummaryById))i.projectId===t&&n.add(r);return[...n]}function l9(e,t){let n=z_e(e,t);if(!e.projectById[t]&&n.length===0&&!e.projectIds.includes(t))return e;let r=e;for(let e of n)r=c9(r,e);let{[t]:i,...a}=r.projectById;return{...r,projectById:a,projectIds:n9(r.projectIds,t)}}function u9(e){return e===`error`?`error`:e===`missing`?`interrupted`:`completed`}function B_e(e,t){if(e.sequence!==void 0&&t.sequence!==void 0){if(e.sequence!==t.sequence)return e.sequence-t.sequence}else if(e.sequence!==void 0)return 1;else if(t.sequence!==void 0)return-1;return e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)}function d9(e){let t=e.previous?.turnId===e.turnId?e.previous.sourceProposedPlan:e.sourceProposedPlan;return{turnId:e.turnId,state:e.state,requestedAt:e.requestedAt,startedAt:e.startedAt,completedAt:e.completedAt,assistantMessageId:e.assistantMessageId,...t?{sourceProposedPlan:t}:{}}}function V_e(e,t,n){let r=!1,i=e.map(e=>e.turnId!==t||e.assistantMessageId===n?e:(r=!0,{...e,assistantMessageId:n??void 0}));return r?i:[...e]}function H_e(e,t,n){let r=new Set;for(let n of e){if(n.role===`system`){r.add(n.id);continue}n.turnId!==void 0&&n.turnId!==null&&t.has(n.turnId)&&r.add(n.id)}let i=e.filter(e=>e.role===`user`&&r.has(e.id)).length,a=Math.max(0,n-i);if(a>0){let n=e.filter(e=>e.role===`user`&&!r.has(e.id)&&(e.turnId===void 0||e.turnId===null||t.has(e.turnId))).toSorted((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)).slice(0,a);for(let e of n)r.add(e.id)}let o=e.filter(e=>e.role===`assistant`&&r.has(e.id)).length,s=Math.max(0,n-o);if(s>0){let n=e.filter(e=>e.role===`assistant`&&!r.has(e.id)&&(e.turnId===void 0||e.turnId===null||t.has(e.turnId))).toSorted((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)).slice(0,s);for(let e of n)r.add(e.id)}return e.filter(e=>r.has(e.id))}function U_e(e,t){return e.filter(e=>e.turnId===null||t.has(e.turnId))}function W_e(e,t){return e.filter(e=>e.turnId===null||t.has(e.turnId))}function f9(e,t,n){let r=B7(e,t);if(!r)return e;let i=n(r);return i===r?e:a9(e,i,r)}function p9(e,t,n,r){let i=f9(e,t,e=>({...e,...r,updatedAt:n})),a=i.sidebarThreadSummaryById[t];return!a||Object.keys(r).every(e=>a[e]===r[e])?i:{...i,sidebarThreadSummaryById:{...i.sidebarThreadSummaryById,[t]:{...a,...r}}}}function G_e(e){return{projectIds:e.map(e=>e.id),projectById:Object.fromEntries(e.map(e=>[e.id,e]))}}function m9(e,t){return e.environmentStateById[t]??H7}function h9(e,t,n){let r=e.environmentStateById[t]===n?e.environmentStateById:{...e.environmentStateById,[t]:n};return r===e.environmentStateById?e:{...e,environmentStateById:r}}function K_e(e,t,n){let r=t.projects.map(e=>A7(e,n)),i=new Set(t.threads.map(e=>e.id)),a={...e,...G_e(r),threadIds:[],threadIdsByProjectId:{},threadShellById:{},threadSessionById:{},threadTurnStateById:{},threadRateLimitStatusById:s9(e.threadRateLimitStatusById,i),sidebarThreadSummaryById:{},messageIdsByThreadId:s9(e.messageIdsByThreadId,i),messageByThreadId:s9(e.messageByThreadId,i),activityIdsByThreadId:s9(e.activityIdsByThreadId,i),activityByThreadId:s9(e.activityByThreadId,i),proposedPlanIdsByThreadId:s9(e.proposedPlanIdsByThreadId,i),proposedPlanByThreadId:s9(e.proposedPlanByThreadId,i),turnDiffIdsByThreadId:s9(e.turnDiffIdsByThreadId,i),turnDiffSummaryByThreadId:s9(e.turnDiffSummaryByThreadId,i),bootstrapComplete:!0};for(let e of t.threads)a=o9(a,q7(e,n));return a}function q_e(e,t,n){return h9(e,n,K_e(m9(e,n),t,n))}function J_e(e,t,n){let r=m9(e,n),i=B7(r,t.id);return h9(e,n,a9(r,K7(t,n),i))}function Y_e(e,t,n,r){let i=m9(e,t);return h9(e,t,{...i,threadSubscriptionErrorById:{...i.threadSubscriptionErrorById,[n]:r}})}function X_e(e,t,n){let r=m9(e,t);if(!(n in r.threadSubscriptionErrorById))return e;let{[n]:i,...a}=r.threadSubscriptionErrorById;return h9(e,t,{...r,threadSubscriptionErrorById:a})}function g9(e,t,n){switch(t.type){case`project.created`:{let r=A7({id:t.payload.projectId,title:t.payload.title,workspaceRoot:t.payload.workspaceRoot,repositoryIdentity:t.payload.repositoryIdentity??null,defaultModelSelection:t.payload.defaultModelSelection,defaultThreadEnvMode:t.payload.defaultThreadEnvMode??null,cmmdRegistration:t.payload.cmmdRegistration??null,scripts:t.payload.scripts,createdAt:t.payload.createdAt,updatedAt:t.payload.updatedAt,deletedAt:null},n),i=e.projectIds.find(n=>n===t.payload.projectId||e.projectById[n]?.cwd===t.payload.workspaceRoot)??null,a=e.projectById,o=e.projectIds;if(i!==null&&i!==r.id){let{[i]:t,...n}=e.projectById;a={...n,[r.id]:r},o=e.projectIds.map(e=>e===i?r.id:e)}else a={...e.projectById,[r.id]:r},o=i===null&&!e.projectIds.includes(r.id)?[...e.projectIds,r.id]:e.projectIds;return{...e,projectById:a,projectIds:o}}case`project.meta-updated`:{let n=e.projectById[t.payload.projectId];if(!n)return e;let r=f_e(n,t.payload);return{...e,projectById:{...e.projectById,[t.payload.projectId]:r}}}case`project.deleted`:return l9(e,t.payload.projectId);case`thread.created`:{let r=B7(e,t.payload.threadId);return a9(e,K7({id:t.payload.threadId,projectId:t.payload.projectId,title:t.payload.title,modelSelection:t.payload.modelSelection,runtimeMode:t.payload.runtimeMode,interactionMode:t.payload.interactionMode,branch:t.payload.branch,worktreePath:t.payload.worktreePath,latestTurn:null,createdAt:t.payload.createdAt,updatedAt:t.payload.updatedAt,archivedAt:null,deletedAt:null,messages:[],proposedPlans:[],activities:[],checkpoints:[],session:null,anchorKind:t.payload.anchorKind,anchorCmmdId:t.payload.anchorCmmdId,kind:t.payload.kind,parentThreadId:t.payload.parentThreadId,status:t.payload.status,workerRole:t.payload.workerRole,goal:t.payload.goal??null,titleRegeneration:null,pendingAutoCreatePrompt:null},n),r)}case`thread.deleted`:return c9(e,t.payload.threadId);case`thread.archived`:return p9(e,t.payload.threadId,t.payload.updatedAt,{archivedAt:t.payload.archivedAt});case`thread.unarchived`:return p9(e,t.payload.threadId,t.payload.updatedAt,{archivedAt:null});case`thread.settled`:return p9(e,t.payload.threadId,t.payload.updatedAt,{settledAt:t.payload.settledAt,settledOverride:t.payload.settledOverride});case`thread.unsettled`:return p9(e,t.payload.threadId,t.payload.updatedAt,{settledAt:null,settledOverride:`active`});case`thread.meta-updated`:return f9(e,t.payload.threadId,e=>({...e,...t.payload.title===void 0?{}:{title:t.payload.title},...t.payload.modelSelection===void 0?{}:{modelSelection:j7(t.payload.modelSelection)},...t.payload.branch===void 0?{}:{branch:t.payload.branch},...t.payload.worktreePath===void 0?{}:{worktreePath:t.payload.worktreePath},...t.payload.anchorKind===void 0?{}:{anchorKind:t.payload.anchorKind},...t.payload.anchorCmmdId===void 0?{}:{anchorCmmdId:t.payload.anchorCmmdId},...t.payload.status===void 0?{}:{status:t.payload.status},...t.payload.parentThreadId===void 0?{}:{parentThreadId:t.payload.parentThreadId},...t.payload.goal===void 0?{}:{goal:t.payload.goal},...t.payload.linkedPullRequest===void 0?{}:{linkedPullRequest:t.payload.linkedPullRequest},...t.payload.titleRegeneration===void 0?{}:{titleRegeneration:t.payload.titleRegeneration},updatedAt:t.payload.updatedAt}));case`thread.runtime-mode-set`:return f9(e,t.payload.threadId,e=>({...e,runtimeMode:t.payload.runtimeMode,updatedAt:t.payload.updatedAt}));case`thread.interaction-mode-set`:return f9(e,t.payload.threadId,e=>({...e,interactionMode:t.payload.interactionMode,updatedAt:t.payload.updatedAt}));case`thread.turn-start-requested`:return f9(e,t.payload.threadId,e=>({...e,...t.payload.modelSelection===void 0?{}:{modelSelection:j7(t.payload.modelSelection)},runtimeMode:t.payload.runtimeMode,interactionMode:t.payload.interactionMode,pendingSourceProposedPlan:t.payload.sourceProposedPlan,latestTurn:d9({previous:e.latestTurn,turnId:d.make(t.payload.messageId),state:`running`,requestedAt:t.payload.createdAt,startedAt:t.payload.createdAt,completedAt:null,assistantMessageId:null,sourceProposedPlan:t.payload.sourceProposedPlan}),updatedAt:t.occurredAt}));case`thread.turn-interrupt-requested`:return t.payload.turnId===void 0?e:f9(e,t.payload.threadId,e=>{let n=e.latestTurn;return n===null||n.turnId!==t.payload.turnId?e:{...e,latestTurn:d9({previous:n,turnId:t.payload.turnId,state:`interrupted`,requestedAt:n.requestedAt,startedAt:n.startedAt??t.payload.createdAt,completedAt:n.completedAt??t.payload.createdAt,assistantMessageId:n.assistantMessageId}),updatedAt:t.occurredAt}});case`thread.message-sent`:return f9(e,t.payload.threadId,e=>{let n=P7(e.environmentId,{id:t.payload.messageId,role:t.payload.role,text:t.payload.text,...t.payload.attachments===void 0?{}:{attachments:t.payload.attachments},turnId:t.payload.turnId,streaming:t.payload.streaming,createdAt:t.payload.createdAt,updatedAt:t.payload.updatedAt}),r=(e.messages.find(e=>e.id===n.id)?e.messages.map(e=>e.id===n.id?{...e,text:n.streaming?`${e.text}${n.text}`:n.text.length>0?n.text:e.text,streaming:n.streaming,...n.turnId===void 0?{}:{turnId:n.turnId},...n.streaming?e.completedAt===void 0?{}:{completedAt:e.completedAt}:n.completedAt===void 0?{}:{completedAt:n.completedAt},...n.attachments===void 0?{}:{attachments:n.attachments}}:e):[...e.messages,n]).slice(-2e3),i=t.payload.role===`assistant`&&t.payload.turnId!==null?V_e(e.turnDiffSummaries,t.payload.turnId,t.payload.messageId):e.turnDiffSummaries,a=t.payload.role===`assistant`&&t.payload.turnId!==null&&(e.latestTurn===null||e.latestTurn.turnId===t.payload.turnId)?d9({previous:e.latestTurn,turnId:t.payload.turnId,state:t.payload.streaming?`running`:e.latestTurn?.state===`interrupted`?`interrupted`:e.latestTurn?.state===`error`?`error`:`completed`,requestedAt:e.latestTurn?.turnId===t.payload.turnId?e.latestTurn.requestedAt:t.payload.createdAt,startedAt:e.latestTurn?.turnId===t.payload.turnId?e.latestTurn.startedAt??t.payload.createdAt:t.payload.createdAt,sourceProposedPlan:e.pendingSourceProposedPlan,completedAt:t.payload.streaming?e.latestTurn?.turnId===t.payload.turnId?e.latestTurn.completedAt??null:null:t.payload.updatedAt,assistantMessageId:t.payload.messageId}):e.latestTurn;return{...e,messages:r,turnDiffSummaries:i,latestTurn:a,updatedAt:t.occurredAt}});case`thread.session-set`:return f9(e,t.payload.threadId,e=>({...e,session:N7(t.payload.session),error:K8(t.payload.session.lastError),latestTurn:t.payload.session.status===`running`&&t.payload.session.activeTurnId!==null?d9({previous:e.latestTurn,turnId:t.payload.session.activeTurnId,state:`running`,requestedAt:e.latestTurn?.turnId===t.payload.session.activeTurnId?e.latestTurn.requestedAt:t.payload.session.updatedAt,startedAt:e.latestTurn?.turnId===t.payload.session.activeTurnId?e.latestTurn.startedAt??t.payload.session.updatedAt:t.payload.session.updatedAt,completedAt:null,assistantMessageId:e.latestTurn?.turnId===t.payload.session.activeTurnId?e.latestTurn.assistantMessageId:null,sourceProposedPlan:e.pendingSourceProposedPlan}):e.latestTurn,updatedAt:t.occurredAt}));case`thread.session-stop-requested`:return f9(e,t.payload.threadId,e=>e.session===null?e:{...e,session:{...e.session,status:`closed`,orchestrationStatus:`stopped`,activeTurnId:void 0,updatedAt:t.payload.createdAt},updatedAt:t.occurredAt});case`thread.proposed-plan-upserted`:return f9(e,t.payload.threadId,e=>{let n=F7(t.payload.proposedPlan),r=[...e.proposedPlans.filter(e=>e.id!==n.id),n].toSorted((e,t)=>e.createdAt.localeCompare(t.createdAt)||e.id.localeCompare(t.id)).slice(-200);return{...e,proposedPlans:r,updatedAt:t.occurredAt}});case`thread.turn-diff-completed`:return f9(e,t.payload.threadId,e=>{let n=I7({turnId:t.payload.turnId,checkpointTurnCount:t.payload.checkpointTurnCount,checkpointRef:t.payload.checkpointRef,status:t.payload.status,files:t.payload.files,assistantMessageId:t.payload.assistantMessageId,completedAt:t.payload.completedAt}),r=e.turnDiffSummaries.find(e=>e.turnId===n.turnId);if(r&&r.status!==`missing`&&n.status===`missing`)return e;let i=[...e.turnDiffSummaries.filter(e=>e.turnId!==n.turnId),n].toSorted((e,t)=>(e.checkpointTurnCount??2**53-1)-(t.checkpointTurnCount??2**53-1)).slice(-500),a=e.latestTurn===null||e.latestTurn.turnId===t.payload.turnId?d9({previous:e.latestTurn,turnId:t.payload.turnId,state:u9(t.payload.status),requestedAt:e.latestTurn?.requestedAt??t.payload.completedAt,startedAt:e.latestTurn?.startedAt??t.payload.completedAt,completedAt:t.payload.completedAt,assistantMessageId:t.payload.assistantMessageId,sourceProposedPlan:e.pendingSourceProposedPlan}):e.latestTurn;return{...e,turnDiffSummaries:i,latestTurn:a,updatedAt:t.occurredAt}});case`thread.reverted`:return f9(e,t.payload.threadId,e=>{let n=e.turnDiffSummaries.filter(e=>e.checkpointTurnCount!==void 0&&e.checkpointTurnCount<=t.payload.turnCount).toSorted((e,t)=>(e.checkpointTurnCount??2**53-1)-(t.checkpointTurnCount??2**53-1)).slice(-500),r=new Set(n.map(e=>e.turnId)),i=H_e(e.messages,r,t.payload.turnCount).slice(-2e3),a=W_e(e.proposedPlans,r).slice(-200),o=U_e(e.activities,r),s=n.at(-1)??null;return{...e,turnDiffSummaries:n,messages:i,proposedPlans:a,activities:o,pendingSourceProposedPlan:void 0,latestTurn:s===null?null:{turnId:s.turnId,state:u9(s.status??`ready`),requestedAt:s.completedAt,startedAt:s.completedAt,completedAt:s.completedAt,assistantMessageId:s.assistantMessageId??null},updatedAt:t.occurredAt}});case`thread.activity-appended`:return f9(e,t.payload.threadId,e=>{let n=[...e.activities.filter(e=>e.id!==t.payload.activity.id),{...t.payload.activity}].toSorted(B_e).slice(-500);return{...e,activities:n,updatedAt:t.occurredAt}});case`thread.rate-limit-set`:return f9(e,t.payload.threadId,e=>({...e,rateLimitStatus:k_e(e.rateLimitStatus??[],t.payload),updatedAt:t.occurredAt}));case`thread.worker-spawned`:return f9(e,t.payload.workerThreadId,e=>({...e,kind:`worker`,parentThreadId:t.payload.masterThreadId,branch:t.payload.branch,worktreePath:t.payload.worktreePath,workerRole:t.payload.workerRole??e.workerRole??null,updatedAt:t.occurredAt}));case`thread.approval-response-requested`:case`thread.user-input-response-requested`:return e}return e}function Z_e(e,t,n){switch(t.kind){case`project-upserted`:{let r=A7(t.project,n),i=e.projectIds.find(n=>n===t.project.id||e.projectById[n]?.cwd===t.project.workspaceRoot)??null,a=e.projectById,o=e.projectIds;if(i!==null&&i!==r.id){let{[i]:t,...n}=e.projectById;a={...n,[r.id]:r},o=e.projectIds.map(e=>e===i?r.id:e)}else a={...e.projectById,[r.id]:r},o=i===null&&!e.projectIds.includes(r.id)?[...e.projectIds,r.id]:e.projectIds;return{...e,projectById:a,projectIds:o}}case`project-removed`:return l9(e,t.projectId);case`thread-upserted`:return o9(e,q7(t.thread,n));case`thread-removed`:return c9(e,t.threadId)}}function Q_e(e,t,n){if(t.length===0)return e;let r=m9(e,n);return h9(e,n,t.reduce((e,t)=>g9(e,t,n),r))}function _9(e){return Object.entries(e.environmentStateById)}function v9(e,t){return t?m9(e,t):H7}function $_e(e,t){return r9(v9(e,t))}function eve(e){return _9(e).flatMap(([,e])=>R_e(e))}function tve(e){return _9(e).flatMap(([,e])=>r9(e))}function nve(e){return _9(e).flatMap(([,e])=>y9(e).flatMap(t=>{let n=e.threadShellById[t];return n?[n]:[]}))}function y9(e){let t=[],n=new Set,r=e=>{n.has(e)||(n.add(e),t.push(e))};for(let t of e.threadIds)r(t);for(let t of Object.keys(e.threadShellById))r(t);for(let t of Object.keys(e.sidebarThreadSummaryById))r(t);return t}function b9(e,t,n){let r=t.sidebarThreadSummaryById[n];if(r)return r.environmentId===e?r:{...r,environmentId:e};let i=t.threadShellById[n];return i?{id:i.id,environmentId:e,projectId:i.projectId,title:i.title,modelSelection:i.modelSelection,interactionMode:i.interactionMode,session:t.threadSessionById[n]??null,createdAt:i.createdAt,archivedAt:i.archivedAt,settledAt:i.settledAt,settledOverride:i.settledOverride,updatedAt:i.updatedAt,latestTurn:t.threadTurnStateById[n]?.latestTurn??null,branch:i.branch,worktreePath:i.worktreePath,latestUserMessageAt:null,hasPendingApprovals:!1,hasPendingUserInput:!1,hasActionableProposedPlan:!1,anchorKind:i.anchorKind,anchorCmmdId:i.anchorCmmdId,goal:i.goal,titleRegeneration:i.titleRegeneration,kind:i.kind,parentThreadId:i.parentThreadId,workerRole:i.workerRole,status:i.status}:null}function rve(e){return _9(e).flatMap(([e,t])=>y9(t).flatMap(n=>{let r=b9(e,t,n);return r?[r]:[]}))}function x9(e,t){if(!t)return[];let n=v9(e,t.environmentId),r=n.threadIdsByProjectId[t.projectId]??U7;return(r.length>0?r:y9(n)).flatMap(e=>{let r=b9(t.environmentId,n,e);return!r||r.projectId!==t.projectId?[]:[r]})}function ive(e,t){return t.length===0?[]:t.length===1?x9(e,t[0]):t.flatMap(t=>x9(e,t))}function ave(e){return e.activeEnvironmentId===null?Object.values(e.environmentStateById).some(e=>e.bootstrapComplete):v9(e,e.activeEnvironmentId).bootstrapComplete}function ove(e,t){return t?v9(e,t.environmentId).projectById[t.projectId]:void 0}function sve(e,t){return t?B7(v9(e,t.environmentId),t.threadId):void 0}function cve(e,t){return t?v9(e,t.environmentId).threadShellById[t.threadId]!==void 0:!1}function lve(e,t){return t?b9(t.environmentId,v9(e,t.environmentId),t.threadId)??void 0:void 0}function uve(e,t,n){if(e.activeEnvironmentId===null)return e;let r=f9(m9(e,e.activeEnvironmentId),t,e=>e.error===n?e:{...e,error:n});return h9(e,e.activeEnvironmentId,r)}function dve(e,t,n){return h9(e,n,g9(m9(e,n),t,n))}function fve(e,t,n){return h9(e,n,Z_e(m9(e,n),t,n))}function pve(e,t){return e.activeEnvironmentId===t?e:{...e,activeEnvironmentId:t}}function mve(e,t,n,r){let i=f9(m9(e,t.environmentId),t.threadId,e=>{if(e.branch===n&&e.worktreePath===r)return e;let t=e.worktreePath!==r;return{...e,branch:n,worktreePath:r,...t?{session:null}:{}}});return h9(e,t.environmentId,i)}var S9=ve(e=>({...A_e,setActiveEnvironmentId:t=>e(e=>pve(e,t)),syncServerShellSnapshot:(t,n)=>e(e=>q_e(e,t,n)),syncServerThreadDetail:(t,n)=>e(e=>J_e(e,t,n)),setThreadSubscriptionError:(t,n,r)=>e(e=>Y_e(e,t,n,r)),clearThreadSubscriptionError:(t,n)=>e(e=>X_e(e,t,n)),applyOrchestrationEvent:(t,n)=>e(e=>dve(e,t,n)),applyOrchestrationEvents:(t,n)=>e(e=>Q_e(e,t,n)),applyShellEvent:(t,n)=>e(e=>fve(e,t,n)),setError:(t,n)=>e(e=>uve(e,t,n)),setThreadBranch:(t,n,r)=>e(e=>mve(e,t,n,r))}));function C9(){let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)}}}function hve(e){return e!=null&&typeof e.getItem==`function`&&typeof e.setItem==`function`&&typeof e.removeItem==`function`}function w9(e){return hve(e)?e:C9()}var T9=C9();function E9(){return globalThis.localStorage||globalThis.window?.localStorage}var D9={getItem:e=>{try{let t=E9()?.getItem(e);if(t!==void 0)return t}catch{}return T9.getItem(e)},setItem:(e,t)=>{try{let n=E9();if(n){n.setItem(e,t);return}}catch{}T9.setItem(e,t)},removeItem:e=>{try{let t=E9();if(t){t.removeItem(e);return}}catch{}T9.removeItem(e)}};function gve(e){let t=D9.getItem(e);return typeof t==`string`?t:null}function _ve(e,t){D9.setItem(e,t)}function vve(e){D9.removeItem(e)}function yve(e,t=300){let n=w9(e),r=new be((e,t)=>{n.setItem(e,t)},{wait:t});return{getItem:e=>n.getItem(e),setItem:(e,t)=>{r.maybeExecute(e,t)},removeItem:e=>{r.cancel(),n.removeItem(e)},flush:()=>{r.flush()}}}function bve(e){switch(e){case`running`:return`green`;case`provisioning`:case`starting`:return`amber-pulse`;case`registered`:return`idle`;case`stopped`:case`suspended`:case`draining`:return`grey`;case`destroyed`:return`idle`;case`error`:return`red-pulse`;default:return`grey`}}function O9(e){let t=e.githubRepoFullName;return t?t.split(`/`)[1]??t:xve(e.projectName)}function xve(e){let t=e.trim().toLowerCase().replaceAll(`'`,``).replaceAll(`"`,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t.length>0?t:`project`}function k9(e){if(!e)return null;let t=e.trim().replace(/\/+$/,``);return t.length>0?t:null}function A9(e){let t=k9(e??void 0);return t&&j9(t).length>1?t:null}function j9(e){return e.split(`/`).flatMap(e=>e.split(`\\`)).filter(e=>e.length>0)}function M9(e){return e?j9(e).at(-1)??null:null}function Sve(e){let t=e.rows.length>0;return(e.isLoading||e.startupPhase===`auth-refreshing`)&&!t?{kind:`loading`}:e.error&&!t?{kind:`error-no-rows`,message:e.error}:e.error&&t?{kind:`stale-rows`,message:e.error}:t?{kind:`rows`}:{kind:`empty`}}function Cve(e,t){if(!t)return!1;let n=e.repositoryIdentity?.canonicalKey;return n!==void 0&&!n.toLowerCase().endsWith(`/${t.toLowerCase()}`)}function wve(e,t){return e?e.cmmdOrganizationId===t.cmmdOrganizationId&&e.cmmdProjectId===t.cmmdProjectId:!1}function Tve(e,t){let n=e.filter(e=>!e.cmmdRegistration),r=A9(t.workspaceRoot),i=r?n.filter(e=>k9(e.cwd)===r):[];if(i.length>0)return i;let a=O9(t).toLowerCase();return n.filter(e=>M9(e.cwd)?.toLowerCase()===a)}function N9(e,t,n){let r=e[t];if(!r)return null;let i=r.projectIds.flatMap(e=>{let t=r.projectById[e];return!t||Cve(t,n.githubRepoFullName)?[]:[t]}),a=i.filter(e=>wve(e.cmmdRegistration,n)),o=a.length>0?a:Tve(i,n),s=o.length===1?o[0]:void 0;return s?{environmentId:t,projectId:s.id}:null}function Eve(e){return{cmmdOrganizationId:e.cmmdOrganizationId,cmmdProjectId:e.cmmdProjectId,githubRepoFullName:e.githubRepoFullName,projectName:e.projectName,workspaceRoot:e.workspaceRoot}}function Dve(e,t){let n=e.cmmdEnvironmentId??e.environmentId;if(e.runtimeId===null||n===null)return null;let r=N9(t,p.make(n),Eve(e));return r?Me(r.environmentId,r.projectId):null}function Ove(e,t){return e===t?!0:e===null||t===null?!1:e.environmentId===t.environmentId&&e.projectId===t.projectId}function kve(e,t){let n=!1,r=e.map(e=>{let r=Dve(e,t);return Ove(r,e.resolvedRef)?e:(n=!0,{...e,resolvedRef:r})});return n?r:e}var P9=`registered`,Ave={destroyed:`destroyed`,superseded:`destroyed`,error:`error`,failed:`error`,draining:`draining`,recycling:`draining`,stopped:`stopped`,suspended:`suspended`,provisioning:`provisioning`,created:`provisioning`,starting:`starting`,restarting:`starting`};function F9(e,t){let n=Ave[e];if(n!==void 0)return n;if(e!==`running`)return`stopped`;if(t)switch(t){case`app_ready`:case`server_ready`:case`ready`:case`supervisor_up`:return`running`;case`starting`:case`image_pulling`:case`waiting_state`:return`starting`;case`error`:return`error`;default:return`running`}return`running`}function jve(e){return e===`destroyed`}function Mve(e){switch(e){case`running`:case`starting`:case`provisioning`:return!0;case`suspended`:return!0;case`registered`:case`stopped`:case`draining`:case`error`:case`destroyed`:return!1;default:return!1}}function Nve(e){let t=e.shortName?.trim();if(t)return t;if(e.projectName)return e.projectName;if(e.githubRepoFullName){let t=e.githubRepoFullName.split(`/`),n=t[t.length-1];if(n)return n}return`project ${e.cmmdProjectId}`}var I9={state:`unknown`,label:`Unknown`,detail:`Current Environment availability has not been observed.`,tone:`muted`,automaticWakeAllowed:!1,shellConnected:!1,shellMayEstablishReady:!1};function L9(e,t,n,r,i,a,o=!1){return{state:e,label:t,detail:n,tone:r,automaticWakeAllowed:i,shellConnected:a,shellMayEstablishReady:o}}function Pve(e,t){return e.ownerIntent===`paused`?L9(`paused`,`Paused`,`Resume before live work can wake this Environment.`,`warning`,!1,t):e.ownerIntent===`deleting`?L9(`deleting`,`Deleting`,`This Environment is being removed.`,`muted`,!1,t):null}function Fve(e,t){return e.executionAdmission.state===`allowed`?null:L9(`unavailable`,`Unavailable`,`This Environment is not accepting live work while it drains.`,`warning`,!1,t)}function R9(e,t=!1){if(e==null)return I9;let n=Pve(e,t);if(n!==null)return n;if(e.ownerIntent!==`active`)return I9;let r=Fve(e,t);if(r!==null)return r;let{provider:i,guestReadiness:a,activeWork:o}=e;return i.observedAt===null||i.failure!==null||i.state===`absent`||i.state===`unknown`?L9(`unknown`,`Unknown`,`Current provider availability has not been observed.`,`muted`,e.automaticWakeAllowed,t):i.state===`sleeping`?L9(`sleeping`,`Sleeping`,`Live work wakes this Environment automatically.`,`muted`,e.automaticWakeAllowed,t):a.observedAt===null||a.failure!==null||a.state===`unknown`?L9(`unknown`,`Unknown`,`Current guest readiness has not been observed.`,`muted`,e.automaticWakeAllowed,t):a.state===`starting`?L9(`starting`,`Starting`,`Preparing live execution.`,`warning`,e.automaticWakeAllowed,t):a.state===`degraded`?L9(`degraded`,`Degraded`,`A required service needs attention.`,`warning`,e.automaticWakeAllowed,t):a.state===`failed`?L9(`needs-attention`,`Needs attention`,`The readiness check failed.`,`destructive`,e.automaticWakeAllowed,t):t?L9(`ready`,`Ready`,null,`success`,e.automaticWakeAllowed,!0):o.state===`active`?L9(`ready`,`Ready`,null,`success`,e.automaticWakeAllowed,t):L9(`unknown`,`Unknown`,`No current execution proof is available.`,`muted`,e.automaticWakeAllowed,t,!0)}function Ive(e,t){return!t||!e.shellMayEstablishReady?e:L9(`ready`,`Ready`,null,`success`,e.automaticWakeAllowed,!0)}function z9(e){return e?F9(e.status,e.readinessPhase??void 0):P9}function Lve(e){return e.runtime?.githubRepoFullName??e.githubRepoFullName??null}function Rve(e,t){return{cmmdOrganizationId:e.organizationId,cmmdProjectId:e.projectId,projectName:Nve({shortName:e.shortName??null,projectName:e.projectName??null,githubRepoFullName:t,cmmdProjectId:e.projectId}),githubRepoFullName:t,iconUrl:e.iconUrl??null,icon:e.icon??null}}function zve(e){return e?{runtimeId:e.runtimeId,workspaceRoot:e.workspaceRoot??null,status:z9(e),desiredState:B9(e.desiredState),environmentId:ht(e.runtimeId),cmmdEnvironmentId:e.environmentId??null,...e.maintenance===void 0?{}:{maintenance:e.maintenance}}:{runtimeId:null,workspaceRoot:null,status:P9,desiredState:null,environmentId:null,cmmdEnvironmentId:null}}function B9(e){return e===`running`||e===`stopped`||e===`destroyed`?e:null}function Bve(e){return{...Rve(e,Lve(e)),registeredAt:e.registeredAt??null,...zve(e.runtime),removal:e.removal??null,resolvedRef:null}}function Vve(e){return e.map(Bve)}function Hve(e){return e.map(e=>({runtimeId:e.runtime.runtimeId,cmmdOrganizationId:e.organizationId,cmmdUserId:e.userId,displayName:e.displayName??null,userFirstName:e.userFirstName??null,environmentId:ht(e.runtime.runtimeId),cmmdEnvironmentId:e.runtime.environmentId??null,status:z9(e.runtime),desiredState:B9(e.runtime.desiredState),...e.runtime.maintenance===void 0?{}:{maintenance:e.runtime.maintenance},lifecycle:R9(e.lifecycle)}))}var V9=`forge:cmmd-cloud-project-catalog:v5`,Uve=re({runtimeId:b(E),cmmdOrganizationId:y,cmmdProjectId:y,cmmdEnvironmentId:b(E),registeredAt:o(b(E)),projectName:E,githubRepoFullName:b(E),workspaceRoot:b(E),iconUrl:o(b(E)),icon:o(b(E)),status:E,desiredState:o(b(E)),environmentId:b(E),removal:o(b(re({operationId:E,deletePlanningProject:_,status:w([`pending`,`running`,`retryable`]),phase:w([`destroy_runtime`,`purge_execution_state`,`delete_planning_project`,`unregister`,`complete`]),lastErrorCode:b(E),lastErrorMessage:b(E),updatedAt:E})))}),H9=re({rows:T(Uve),environments:T(re({runtimeId:E,cmmdOrganizationId:y,cmmdUserId:y,displayName:o(b(E)),userFirstName:o(b(E)),environmentId:E,cmmdEnvironmentId:b(E),status:E,desiredState:b(E)})),fetchedAt:E});function Wve(){ut(V9)}function Gve(){try{let e=ct(V9,H9);return e?{rows:e.rows.map(e=>({runtimeId:e.runtimeId,cmmdOrganizationId:e.cmmdOrganizationId,cmmdProjectId:e.cmmdProjectId,registeredAt:e.registeredAt??null,projectName:e.projectName,githubRepoFullName:e.githubRepoFullName,workspaceRoot:e.workspaceRoot,iconUrl:e.iconUrl??null,icon:e.icon??null,status:e.runtimeId===null?P9:F9(e.status),desiredState:B9(e.desiredState),environmentId:e.runtimeId===null?null:ht(e.runtimeId),cmmdEnvironmentId:e.cmmdEnvironmentId,resolvedRef:null,removal:e.removal??null})),environments:e.environments.map(e=>({runtimeId:e.runtimeId,cmmdOrganizationId:e.cmmdOrganizationId,cmmdUserId:e.cmmdUserId,displayName:e.displayName??null,userFirstName:e.userFirstName??null,cmmdEnvironmentId:e.cmmdEnvironmentId,status:F9(e.status),desiredState:B9(e.desiredState),environmentId:ht(e.runtimeId)})),fetchedAt:e.fetchedAt}:null}catch{return null}}function Kve(e,t,n){try{lt(V9,{rows:e.map(e=>({runtimeId:e.runtimeId,cmmdOrganizationId:e.cmmdOrganizationId,cmmdProjectId:e.cmmdProjectId,cmmdEnvironmentId:e.cmmdEnvironmentId,registeredAt:e.registeredAt,projectName:e.projectName,githubRepoFullName:e.githubRepoFullName,workspaceRoot:e.workspaceRoot,iconUrl:e.iconUrl,icon:e.icon,status:e.status,environmentId:e.environmentId,removal:e.removal})),environments:t,fetchedAt:n},H9)}catch{}}var U9=1e3;function qve(e){return e.reconnectPhase===`idle`?`hidden`:e.reconnectPhase===`exhausted`?`actionable`:!e.hasConnected||!e.stableConnectionSeen?`startup-pending`:`actionable`}function W9(e){let t=e.maxAttempts??2,n=e.retryDelayMs??1e3;return e.failedAttempt<t?{kind:`retry`,delayMs:n,nextAttempt:e.failedAttempt+1}:{kind:`terminal`,attempt:e.failedAttempt}}var Jve=`auth-required`,Yve=`cloud-projects`;async function Xve(e,t,n){let r=null,i=new l7(e).listCloudProjects({signal:t.signal}).then(e=>({kind:`catalog`,catalog:e})).catch(e=>({kind:`failed`,error:e})),a=new Promise(e=>{r=setTimeout(()=>{t.abort(),e({kind:`timed-out`})},n)});try{return await Promise.race([i,a])}finally{r!==null&&clearTimeout(r)}}function Zve(e){let t=e.accessToken??e.resolveAccessToken?.(),n={Accept:`text/event-stream`};return t&&(n.Authorization=`Bearer ${t}`),n}function Qve(e,t){let n=new URL(e);return n.pathname=t,n.search=``,n.hash=``,n.toString()}async function G9(e){return(e.status===401||e.status===403)&&(await nye(e)||e.status===401)?`auth-required`:e.status===404||e.status===405||!e.ok||!e.body?`fallback`:e.body.getReader()}async function $ve({reader:e,signal:t,onAuthRequired:n,onCatalog:r}){let i=new TextDecoder,a=``;try{for(;!t.aborted;){let{done:o,value:s}=await e.read();if(t.aborted||o)return;let c=eye(a,i.decode(s,{stream:!0}));if(a=c.buffer,c.messages.some(e=>tye(e,n,r)))return}}finally{e.releaseLock()}}function eye(e,t){let n=`${e}${t}`.split(/\n\n/);return{buffer:n.pop()??``,messages:n}}function tye(e,t,n){let r=iye(e);if(r.name===Jve)return t(),!0;let i=r.name===Yve?rye(r.data):null;return i&&n(i),!1}async function nye(e){try{let t=await e.clone().json();return typeof t?.code==`string`&&t.code===`CMMD_AUTH_REQUIRED`}catch{return!1}}function rye(e){try{return r7(JSON.parse(e))}catch{return null}}function iye(e){let t=``,n=``;for(let r of e.split(`
|
|
1007
|
-
`))r.startsWith(`event: `)&&(t=r.slice(7).trim()),r.startsWith(`data: `)&&(n=r.slice(6).trim());return{name:t,data:n}}var aye=`/api/cmmd/forge-cloud-projects`,oye=`/api/cmmd/forge-cloud-projects/events`,sye=15e3,K9=3e4,cye=2e3,lye=3e4,uye=200;function q9(e){return e!==null&&clearTimeout(e),null}function dye({config:e,onEvent:t}){let n=!1,r=!1,i=!1,a=!1,o=!1,s=0,c=null,l=0,u=null,d=null,f=0,p=null,m=null,h=null,g=null;function _(){p=q9(p),g=q9(g)}function v(){f+=1,d?.controller.abort(),d=null}function y(e,t){return d?.controller===e&&d.generation===t&&f===t}function b(e){return u===e}function x(){v(),u?.abort(),u=null,_(),h=q9(h)}function S(){return!r&&!a}function C(e){t({kind:`catalog`,catalog:e,fetchedAt:new Date().toISOString()})}function w(e){a||r||(a=!0,c=null,x(),t({kind:`auth-required`,message:e}))}function T(e,n){if(r||a)return;s+=1,c=n;let i=W9({failedAttempt:s,retryDelayMs:U9});if(i.kind===`terminal`){w(e);return}u?.abort(),u=null,g=q9(g),t({kind:`auth-refreshing`}),o=!0,h=q9(h),h=setTimeout(()=>{h=null,o=!1,he()},i.delayMs)}async function ee(){if(!S())return!1;let n=new AbortController,r=++f;d={controller:n,generation:r},t({kind:`loading`});try{return E(await Xve(e,n,sye),n,r)}finally{y(n,r)&&(d=null)}}function E(e,t,n){return!S()||!y(t,n)?!1:e.kind===`catalog`?te(e.catalog):e.kind===`timed-out`?ne():re(e.error)}function te(e){return c!==`sse`&&(s=0,c=null),o=!1,C(e),!0}function ne(){return t({kind:`failed`,message:`Cloud connection refresh timed out. Showing last known connections.`}),!a}function re(e){let n=e instanceof Error?e.message:`Failed to load cloud projects`;return m5(e)||fye(e)||/authentication required/i.test(n)?T(n,`list`):t({kind:`failed`,message:n}),!a}function ie(){S()&&(p=q9(p),p=setTimeout(async()=>{await ee(),S()&&ie()},K9))}function ae(){!S()||o||(i?ie():se(l))}function oe(e){l=e+1;let t=Math.min(cye*2**e,lye);g=q9(g),g=setTimeout(()=>{g=null,se(l)},t)}function D(e){s=0,c=null,l=0,C(e)}async function se(t){if(!S()||u!==null)return;u=new AbortController;let n=u,r=e.eventsUrl??Qve(e.cmmdHttpBaseUrl,`/api/forge/context/runtimes/events`),i=e.eventsUrl?{Accept:`text/event-stream`}:Zve(e);try{await ce(await fetch(r,{headers:i,signal:n.signal,credentials:`include`}),n,t)}catch{pe(n)}}async function ce(e,t,n){if(!le(t))return;let r=await G9(e);if(le(t)){if(typeof r==`string`){fe(r);return}await $ve({reader:r,signal:t.signal,onAuthRequired:()=>ue(t),onCatalog:e=>de(t,e)}),me(t,n)}}function le(e){return S()&&b(e)}function ue(e){le(e)&&T(`CMMD authentication required. Sign in again to continue.`,`sse`)}function de(e,t){le(e)&&D(t)}function fe(e){if(u=null,e===`auth-required`){T(`CMMD authentication required. Sign in again to continue.`,`sse`);return}i=!0,ie()}function pe(e){e.signal.aborted||!le(e)||(u=null,i=!0,ie())}function me(e,t){e.signal.aborted||!le(e)||(u=null,oe(t))}function he(){return ee().then(e=>{e&&S()&&ae()})}return{initialize(){n||r||(n=!0,he())},refresh(){r||(v(),m=q9(m),m=setTimeout(()=>{m=null,a=!1,o=!1,s=0,c=null,x(),he()},uye))},teardown(){r=!0,m=q9(m),x()}}}function fye(e){return typeof e==`object`&&!!e&&`kind`in e&&e.kind===`auth`}var J9={connected:!1,isLoading:!1,error:null,rows:[],environments:[],fetchedAt:null,stale:!1,startupPhase:`idle`,capacity:null};function pye({config:e}){let t=Gve(),n=t?{...J9,isLoading:!0,rows:t.rows,environments:t.environments,fetchedAt:t.fetchedAt,stale:!0}:J9,r=new Set;function i(e){n=e;for(let e of r)e()}function a(e){switch(e.kind){case`loading`:i({...n,isLoading:!0,error:null});return;case`catalog`:{let t=Vve(e.catalog.listRowsForDisplay()),n=Hve(e.catalog.listEnvironmentsForDisplay());Kve(t,n,e.fetchedAt),i({connected:!0,isLoading:!1,error:null,rows:t,environments:n,fetchedAt:e.fetchedAt,stale:!1,startupPhase:`idle`,capacity:e.catalog.capacity});return}case`failed`:i({...n,connected:!1,isLoading:!1,error:e.message,stale:n.rows.length>0,startupPhase:`idle`});return;case`auth-refreshing`:i({...n,connected:!1,isLoading:!0,error:null,stale:n.rows.length>0,startupPhase:`auth-refreshing`});return;case`auth-required`:i({...n,connected:!1,isLoading:!1,error:e.message,stale:n.rows.length>0,startupPhase:`idle`}),ie(`cmmd-runtimes`);return}}let o=dye({config:e,onEvent:a});return{subscribe(e){return r.add(e),()=>r.delete(e)},read(){return n},initialize(){o.initialize()},refresh(){o.refresh()},_teardown(){o.teardown()},_setState(e){i(e)}}}var Y9=null;function X9(e){return typeof window<`u`&&window.location?.href?new URL(e,window.location.href).toString():new URL(e,`http://localhost`).toString()}function Z9(){return{cmmdHttpBaseUrl:`https://cmmd.ai`,resolveAccessToken:()=>null,listUrl:aye,eventsUrl:oye,destroyUrl:e=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/destroy`),lifecycleUrl:(e,t)=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/${t}`),updateCommitUrl:e=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/update-commit`),updateCommitOperationUrl:(e,t)=>X9(`/api/cmmd/forge-runtimes/${encodeURIComponent(e)}/update-commit/${encodeURIComponent(String(t))}`),ensureUrl:X9(`/api/cmmd/forge-runtimes/ensure`)}}function Q9(){return Y9===null&&(Y9=pye({config:Z9()})),Y9}function mye(){Q9().refresh()}function hye(e){return Q9().subscribe(e)}function $9(){return Q9().read()}function gye(e){let t=(0,Be.c)(9),n=e?.enabled??!0,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{n&&Q9().initialize()},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,k.useEffect)(r,i);let a=(0,k.useSyncExternalStore)(hye,$9,$9),o=S9(_ye),s,c;t[3]!==o||t[4]!==a.rows?(c=kve(a.rows,o),t[3]=o,t[4]=a.rows,t[5]=c):c=t[5],s=c;let l=s,u;return t[6]!==l||t[7]!==a?(u=l===a.rows?a:{...a,rows:l},t[6]=l,t[7]=a,t[8]=u):u=t[8],u}function _ye(e){return e.environmentStateById}export{w7 as $,K8 as $t,v9 as A,et as An,yge as At,tve as B,ze as Bn,$he as Bt,yve as C,ut as Cn,Tge as Ct,w9 as D,nt as Dn,Q5 as Dt,vve as E,rt as En,Mge as Et,x9 as F,aee as Fn,Fhe as Ft,O7 as G,ke as Gn,Dhe as Gt,S9 as H,Ne as Hn,nge as Ht,ive as I,qe as In,z5 as It,T7 as J,xe as Jn,Ehe as Jt,E7 as K,Se as Kn,Ohe as Kt,sve as L,iee as Ln,L5 as Lt,eve as M,Je as Mn,q5 as Mt,lve as N,Ye as Nn,j5 as Nt,_ve as O,Qe as On,_ge as Ot,rve as P,Xe as Pn,ige as Pt,D7 as Q,G8 as Qt,cve as R,We as Rn,tge as Rt,D9 as S,ct as Sn,Age as St,gve as T,pt as Tn,Cge as Tt,B7 as U,nee as Un,Nhe as Ut,$_e as V,Me as Vn,F5 as Vt,d_e as W,ree as Wn,m5 as Wt,a_e as X,e5 as Xt,o_e as Y,n5 as Yt,i_e as Z,che as Zt,M9 as _,wt as _n,l7 as _t,G9 as a,Dn as an,_7 as at,Sve as b,mt as bn,kge as bt,qve as c,Qt as cn,Zge as ct,Ive as d,Vt as dn,Qge as dt,U8 as en,k7 as et,Mve as f,Ut as fn,Xge as ft,O9 as g,xt as gn,e_e as gt,N9 as h,Ht as hn,Jge as ht,gye as i,wee as in,y7 as it,ove as j,Ze as jn,gge as jt,ave as k,$e as kn,vge as kt,Wve as l,Lt as ln,$ge as lt,F9 as m,Bt as mn,g7 as mt,mye as n,cr as nn,u_e as nt,U9 as o,Xt as on,Yge as ot,jve as p,Rt as pn,x7 as pt,C7 as q,Ce as qn,khe as qt,Z9 as r,Tee as rn,S7 as rt,W9 as s,Yt as sn,v7 as st,$9 as t,W8 as tn,s_e as tt,R9 as u,zt as un,t_e as ut,A9 as v,gt as vn,$5 as vt,C9 as w,lt as wn,Dge as wt,bve as x,ht as xn,Fge as xt,k9 as y,bt as yn,Z5 as yt,nve as z,Re as zn,T5 as zt};
|
|
1008
|
-
//# sourceMappingURL=cmmdForgeRuntimeListResource-Df9wlF4U.js.map
|