import{r as xe}from"./vendor-react-BwKDLVNL.js";/*! Capacitor: https://capacitorjs.com/ - MIT License */const Rb=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},r=(s,i)=>{n.platforms.set(s,i)},o=s=>{n.platforms.has(s)&&(n.currentPlatform=n.platforms.get(s))};return n.addPlatform=r,n.setPlatform=o,n},Ab=e=>e.CapacitorPlatforms=Rb(e),lh=Ab(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});lh.addPlatform;lh.setPlatform;var Pr;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Pr||(Pr={}));class La extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const Cb=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},Nb=e=>{var t,n,r,o,s;const i=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},c=a.Plugins=a.Plugins||{},u=e.CapacitorPlatforms,d=()=>i!==null?i.name:Cb(e),l=((t=u==null?void 0:u.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||d,f=()=>l()!=="web",p=((n=u==null?void 0:u.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||f,h=b=>{const I=E.get(b);return!!(I!=null&&I.platforms.has(l())||y(b))},m=((r=u==null?void 0:u.currentPlatform)===null||r===void 0?void 0:r.isPluginAvailable)||h,g=b=>{var I;return(I=a.PluginHeaders)===null||I===void 0?void 0:I.find(B=>B.name===b)},y=((o=u==null?void 0:u.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||g,S=b=>e.console.error(b),k=(b,I,B)=>Promise.reject(`${B} does not have an implementation of "${I}".`),E=new Map,x=(b,I={})=>{const B=E.get(b);if(B)return console.warn(`Capacitor plugin "${b}" already registered. Cannot register plugins twice.`),B.proxy;const v=l(),P=y(b);let R;const L=async()=>(!R&&v in I?R=typeof I[v]=="function"?R=await I[v]():R=I[v]:i!==null&&!R&&"web"in I&&(R=typeof I.web=="function"?R=await I.web():R=I.web),R),$=(T,W)=>{var z,ne;if(P){const ie=P==null?void 0:P.methods.find(de=>W===de.name);if(ie)return ie.rtype==="promise"?de=>a.nativePromise(b,W.toString(),de):(de,Be)=>a.nativeCallback(b,W.toString(),de,Be);if(T)return(z=T[W])===null||z===void 0?void 0:z.bind(T)}else{if(T)return(ne=T[W])===null||ne===void 0?void 0:ne.bind(T);throw new La(`"${b}" plugin is not implemented on ${v}`,Pr.Unimplemented)}},J=T=>{let W;const z=(...ne)=>{const ie=L().then(de=>{const Be=$(de,T);if(Be){const Xe=Be(...ne);return W=Xe==null?void 0:Xe.remove,Xe}else throw new La(`"${b}.${T}()" is not implemented on ${v}`,Pr.Unimplemented)});return T==="addListener"&&(ie.remove=async()=>W()),ie};return z.toString=()=>`${T.toString()}() { [capacitor code] }`,Object.defineProperty(z,"name",{value:T,writable:!1,configurable:!1}),z},te=J("addListener"),F=J("removeListener"),O=(T,W)=>{const z=te({eventName:T},W),ne=async()=>{const de=await z;F({eventName:T,callbackId:de},W)},ie=new Promise(de=>z.then(()=>de({remove:ne})));return ie.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await ne()},ie},Q=new Proxy({},{get(T,W){switch(W){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return P?O:te;case"removeListener":return F;default:return J(W)}}});return c[b]=Q,E.set(b,{name:b,proxy:Q,platforms:new Set([...Object.keys(I),...P?[v]:[]])}),Q},w=((s=u==null?void 0:u.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||x;return a.convertFileSrc||(a.convertFileSrc=b=>b),a.getPlatform=l,a.handleError=S,a.isNativePlatform=p,a.isPluginAvailable=m,a.pluginMethodNoop=k,a.registerPlugin=w,a.Exception=La,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},xb=e=>e.Capacitor=Nb(e),Jt=xb(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),fu=Jt.registerPlugin;Jt.Plugins;class dh{constructor(t){this.listeners={},this.retainedEventArguments={},this.windowListeners={},t&&(console.warn(`Capacitor WebPlugin "${t.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=t)}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const s=this.windowListeners[t];s&&!s.registered&&this.addWindowListener(s),r&&this.sendRetainedArgumentsForEvent(t);const i=async()=>this.removeListener(t,n);return Promise.resolve({remove:i})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const o=this.listeners[t];if(!o){if(r){let s=this.retainedEventArguments[t];s||(s=[]),s.push(n),this.retainedEventArguments[t]=s}return}o.forEach(s=>s(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new Jt.Exception(t,Pr.Unimplemented)}unavailable(t="not available"){return new Jt.Exception(t,Pr.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const o=r.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const nd=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),rd=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Mb extends dh{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[o,s]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=rd(o).trim(),s=rd(s).trim(),n[o]=s}),n}async setCookie(t){try{const n=nd(t.key),r=nd(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,s=(t.path||"/").replace("path=",""),i=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${o}; path=${s}; ${i};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}fu("CapacitorCookies",{web:()=>new Mb});const Ob=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const o=r.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},r.onerror=o=>n(o),r.readAsDataURL(e)}),Pb=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,s,i)=>(o[s]=e[t[i]],o),{})},Lb=(e,t=!0)=>e?Object.entries(e).reduce((r,o)=>{const[s,i]=o;let a,c;return Array.isArray(i)?(c="",i.forEach(u=>{a=t?encodeURIComponent(u):u,c+=`${s}=${a}&`}),c.slice(0,-1)):(a=t?encodeURIComponent(i):i,c=`${s}=${a}`),`${r}&${c}`},"").substr(1):null,Db=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=Pb(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[i,a]of Object.entries(e.data||{}))s.set(i,a);n.body=s.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const s=new FormData;if(e.data instanceof FormData)e.data.forEach((a,c)=>{s.append(c,a)});else for(const a of Object.keys(e.data))s.append(a,e.data[a]);n.body=s;const i=new Headers(n.headers);i.delete("content-type"),n.headers=i}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class Fb extends dh{async request(t){const n=Db(t,t.webFetchExtra),r=Lb(t.params,t.shouldEncodeUrlParams),o=r?`${t.url}?${r}`:t.url,s=await fetch(o,n),i=s.headers.get("content-type")||"";let{responseType:a="text"}=s.ok?t:{};i.includes("application/json")&&(a="json");let c,u;switch(a){case"arraybuffer":case"blob":u=await s.blob(),c=await Ob(u);break;case"json":c=await s.json();break;case"document":case"text":default:c=await s.text()}const d={};return s.headers.forEach((l,f)=>{d[f]=l}),{data:c,headers:d,status:s.status,url:s.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}fu("CapacitorHttp",{web:()=>new Fb});const M=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,H=globalThis,mt="10.60.0";function Ft(){return qo(H),H}function qo(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||mt,t[mt]=t[mt]||{}}function Zr(e,t,n=H){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[mt]=r[mt]||{};return o[e]||(o[e]=t())}const pu=["debug","info","warn","error","log","assert","trace"],$b="Sentry Logger ",ai={};function $t(e){if(!("console"in H))return e();const t=H.console,n={},r=Object.keys(ai);r.forEach(o=>{const s=ai[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Bb(){mu().enabled=!0}function Ub(){mu().enabled=!1}function fh(){return mu().enabled}function Hb(...e){hu("log",...e)}function Wb(...e){hu("warn",...e)}function jb(...e){hu("error",...e)}function hu(e,...t){M&&fh()&&$t(()=>{H.console[e](`${$b}[${e}]:`,...t)})}function mu(){return M?Zr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const _={enable:Bb,disable:Ub,isEnabled:fh,log:Hb,warn:Wb,error:jb},ph=50,Mt="?",od=/\(error: (.*)\)/,sd=/captureMessage|captureException/;function hh(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],i=n.split(`
`);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));const u=od.test(c)?c.replace(od,"$1"):c;if(!u.includes("Error: ")){for(const d of t){const l=d(u);if(l){s.push(l);break}}if(s.length>=ph+o)break}}return qb(s.slice(o))}}function zb(e){return Array.isArray(e)?hh(...e):e}function qb(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Ts(t).function||"")&&t.pop(),t.reverse(),sd.test(Ts(t).function||"")&&(t.pop(),sd.test(Ts(t).function||"")&&t.pop()),t.slice(0,ph).map(n=>({...n,filename:n.filename||Ts(t).filename,function:n.function||Mt}))}function Ts(e){return e[e.length-1]||{}}const Da="<anonymous>";function Xt(e){try{return!e||typeof e!="function"?Da:e.name||Da}catch{return Da}}function gc(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Gb(e){let t=e!=null&&e.startsWith("file://")?e.slice(7):e;return t!=null&&t.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}const _o={},id={};function Tn(e,t){return _o[e]=_o[e]||[],_o[e].push(t),()=>{const n=_o[e];if(n){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function In(e,t){if(!id[e]){id[e]=!0;try{t()}catch(n){M&&_.error(`Error while instrumenting ${e}`,n)}}}function at(e,t){const n=e&&_o[e];if(n)for(const r of n)try{r(t)}catch(o){M&&_.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${Xt(r)}
Error:`,o)}}let Fa=null;function mh(e){const t="error";Tn(t,e),In(t,Vb)}function Vb(){Fa=H.onerror,H.onerror=function(e,t,n,r,o){return at("error",{column:r,error:o,line:n,msg:e,url:t}),Fa?Fa.apply(this,arguments):!1},H.onerror.__SENTRY_INSTRUMENTED__=!0}let $a=null;function gh(e){const t="unhandledrejection";Tn(t,e),In(t,Yb)}function Yb(){$a=H.onunhandledrejection,H.onunhandledrejection=function(e){return at("unhandledrejection",e),$a?$a.apply(this,arguments):!0},H.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const _h=Object.prototype.toString;function Rt(e){switch(_h.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Yn(e,Error)}}function eo(e,t){return _h.call(e)===`[object ${t}]`}function yh(e){return eo(e,"ErrorEvent")}function ad(e){return eo(e,"DOMError")}function Kb(e){return eo(e,"DOMException")}function gt(e){return eo(e,"String")}function Wi(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ot(e){return e===null||Wi(e)||typeof e!="object"&&typeof e!="function"}function je(e){return eo(e,"Object")}function ji(e){return typeof Event<"u"&&Yn(e,Event)}function Jb(e){return eo(e,"RegExp")}function wn(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Yn(e,t){try{return e instanceof t}catch{return!1}}function gu(e){return typeof Request<"u"&&Yn(e,Request)}function De(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&bh(o,r);try{e[t]=o}catch{M&&_.log(`Failed to replace method "${t}" in object`,e)}}function we(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{M&&_.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function bh(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,we(e,"__sentry_original__",t)}catch{}}function zi(e){return e.__sentry_original__}function Sh(e){if(Rt(e))return{message:e.message,name:e.name,stack:e.stack,...cd(e)};if(ji(e)){const{type:t,target:n,currentTarget:r,detail:o}=e;return{type:t,target:n,currentTarget:r,...o?{detail:o}:{},...cd(e)}}return e}function cd(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Xb(e){const t=Object.keys(Sh(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let fr;function Go(e){if(fr!==void 0)return fr?fr(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=H;return t in n&&typeof n[t]=="function"?(fr=n[t],fr(e)):(fr=null,e())}function Vt(){return Go(()=>Math.random())}function Bt(){return Go(()=>Date.now())}const vh=Symbol.for("sentry.skipNormalization"),Eh=Symbol.for("sentry.overrideNormalizationDepth");function Qb(e){we(e,vh,!0)}function Zb(e,t){we(e,Eh,t)}function eS(e){return!!e[vh]}function tS(e){const t=e[Eh];return typeof t=="number"?t:void 0}let _c;function Th(e){_c=e}function Ae(e,t=100,n=1/0){try{return yc("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ih(e,t=3,n=100*1024){const r=Ae(e,t);return oS(r)>n?Ih(e,t-1,n):r}function yc(e,t,n=1/0,r=1/0,o=sS()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=wh(e,t);if(!a.startsWith("[object "))return a;if(eS(t))return t;const c=tS(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const d=t;if(d&&typeof d.toJSON=="function")try{const h=d.toJSON();return yc("",h,u-1,r,o)}catch{}const l=Array.isArray(t)?[]:{};let f=0;const p=Sh(t);for(const h in p){if(!Object.prototype.hasOwnProperty.call(p,h))continue;if(f>=r){l[h]="[MaxProperties ~]";break}const m=p[h];l[h]=yc(h,m,u-1,r,o),f++}return i(t),l}function wh(e,t){try{if(_c){const r=_c(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Xt(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${nS(t)}]`}catch(n){return`**non-serializable** (${n})`}}function nS(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function rS(e){return~-encodeURI(e).split(/%..|./).length}function oS(e){return rS(JSON.stringify(e))}function sS(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function No(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ba(e,t){let n=e;const r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function ci(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];Ot(o)?n.push(String(o)):o instanceof Error?n.push(o.message?`${o.name}: ${o.message}`:o.name):n.push(wh(void 0,o))}return n.join(t)}function Eo(e,t,n=!1){return gt(e)?Jb(t)?t.test(e):gt(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function ct(e,t=[],n=!1){for(const r of t)if(Eo(e,r,n))return!0;return!1}function iS(){const e=H;return e.crypto||e.msCrypto}let Ua;function aS(){return Vt()*16}function Me(e=iS()){try{if(e!=null&&e.randomUUID)return Go(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Ua||(Ua="10000000100040008000"+1e11),Ua.replace(/[018]/g,t=>(t^(aS()&15)>>t/4).toString(16))}function kh(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Ln(e){const{message:t,event_id:n}=e;if(t)return t;const r=kh(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function bc(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function At(e,t){const n=kh(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o==null?void 0:o.data,...t.data};n.mechanism.data=s}}function cS(e,t,n=5){if(t.lineno===void 0)return;const r=e.length,o=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,o-n),o).map(i=>Ba(i,0));const s=Math.min(r-1,o);t.context_line=Ba(e[s],t.colno||0),t.post_context=e.slice(Math.min(o+1,r),o+1+n).map(i=>Ba(i,0))}function ud(e){if(uS(e))return!0;try{we(e,"__sentry_captured__",!0)}catch{}return!1}function uS(e){try{return e.__sentry_captured__}catch{}}const Rh=1e3;function rr(){return Bt()/Rh}function lS(){const{performance:e}=H;if(!(e!=null&&e.now)||!e.timeOrigin)return rr;const t=e.timeOrigin;return()=>(t+Go(()=>e.now()))/Rh}let ld;function ye(){return(ld??(ld=lS()))()}let Ha=null;function dS(){var i;const{performance:e}=H;if(!(e!=null&&e.now))return;const t=3e5,n=Go(()=>e.now()),r=Bt(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;const s=(i=e.timing)==null?void 0:i.navigationStart;return typeof s=="number"&&Math.abs(s+n-r)<t?s:r-n}function Ce(){return Ha===null&&(Ha=dS()),Ha}function fS(e){const t=ye(),n={sid:Me(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>hS(n)};return e&&Lr(n,e),n}function Lr(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||ye(),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:Me()),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{const n=e.timestamp-e.started;e.duration=n>=0?n: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 pS(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Lr(e,n)}function hS(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 Vo(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Vo(r[o],t[o],n-1));return r}function Pt(){return Me()}function Yt(){return Me().substring(16)}function Ah(e){try{const t=H.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Ch(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}const Sc="_sentrySpan";function Lt(e,t){t?we(e,Sc,Ah(t)):delete e[Sc]}function Dr(e){return Ch(e[Sc])}const mS=100;class bt{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:Pt(),sampleRand:Vt()}}clone(){const t=new bt;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,Lt(t,Dr(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Lr(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof bt?n.getScopeData():je(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:d=[],propagationContext:l,conversationId:f}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),d.length&&(this._fingerprint=d),l&&(this._propagationContext=l),f&&(this._conversationId=f),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,Lt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Pt(),sampleRand:Vt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var s;const r=typeof n=="number"?n:mS;if(r<=0)return this;const o={timestamp:rr(),...t,message:t.message?No(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(s=this._client)==null||s.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),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:Dr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Vo(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||Me();if(!this._client)return M&&_.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=(r==null?void 0:r.event_id)||Me();if(!this._client)return M&&_.warn("No client configured on scope - will not capture message!"),o;const s=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||Me();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(M&&_.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function gS(){return Zr("defaultCurrentScope",()=>new bt)}function _S(){return Zr("defaultIsolationScope",()=>new bt)}const dd=e=>e instanceof Promise&&!e[Nh],Nh=Symbol("chained PromiseLike"),xh=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return dd(r)&&dd(e)?r:yS(e,r)},yS=(e,t)=>{if(!t)return e;let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Nh]:!0}),t};class bS{constructor(t,n){let r;t?r=t:r=new bt;let o;n?o=n:o=new bt,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return wn(r)?xh(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Fr(){const e=Ft(),t=qo(e);return t.stack=t.stack||new bS(gS(),_S())}function SS(e){return Fr().withScope(e)}function vS(e,t){const n=Fr();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function fd(e){return Fr().withScope(()=>e(Fr().getIsolationScope()))}function ES(){return{withIsolationScope:fd,withScope:SS,withSetScope:vS,withSetIsolationScope:(e,t)=>fd(t),getCurrentScope:()=>Fr().getScope(),getIsolationScope:()=>Fr().getIsolationScope()}}function kn(e){const t=qo(e);return t.acs?t.acs:ES()}function TS(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function IS(e,t){const{value:n,unit:r}=TS(e)?e:{value:e,unit:void 0},o=wS(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...s}}function $r(e,t=!1){const n={};for(const[r,o]of Object.entries(e??{})){const s=IS(o,t);s&&(n[r]=s)}return n}function pd(e){var n;if(!e)return 0;let t=0;for(const[r,o]of Object.entries(e)){t+=r.length*2,t+=o.type.length*2,t+=(((n=o.unit)==null?void 0:n.length)??0)*2;const s=o.value;Array.isArray(s)?t+=hd(s[0])*s.length:Ot(s)?t+=hd(s):t+=100}return t}function hd(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function wS(e){if(Array.isArray(e))return{value:e,type:"array"};const 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}}function j(){const e=Ft();return kn(e).getCurrentScope()}function he(){const e=Ft();return kn(e).getIsolationScope()}function Ct(){return Zr("globalScope",()=>new bt)}function Ge(...e){const t=Ft(),n=kn(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function kS(...e){const t=Ft(),n=kn(t);if(e.length===2){const[r,o]=e;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(e[0])}function N(){return j().getClient()}function Mh(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Yt()};return r&&(s.parent_span_id=r),s}const ue="sentry.source",qi="sentry.sample_rate",Oh="sentry.previous_trace_sample_rate",ce="sentry.op",Y="sentry.origin",xo="sentry.idle_span_finish_reason",Yo="sentry.measurement_unit",Ko="sentry.measurement_value",RS="sentry.release",AS="sentry.environment",CS="sentry.segment.name",NS="sentry.segment.id",xS="sentry.sdk.name",MS="sentry.sdk.version",OS="sentry.sdk.integrations",PS="user.id",LS="user.email",DS="user.ip_address",FS="user.name",vc="sentry.custom_span_name",_u="sentry.profile_id",Rn="sentry.exclusive_time",$S="http.request.method",BS="url.full",US="sentry.link.type",HS="gen_ai.conversation.id",Ph=0,Jo=1,re=2;function Lh(e){if(e<400&&e>=100)return{code:Jo};if(e>=400&&e<500)switch(e){case 401:return{code:re,message:"unauthenticated"};case 403:return{code:re,message:"permission_denied"};case 404:return{code:re,message:"not_found"};case 409:return{code:re,message:"already_exists"};case 413:return{code:re,message:"failed_precondition"};case 429:return{code:re,message:"resource_exhausted"};case 499:return{code:re,message:"cancelled"};default:return{code:re,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:re,message:"unimplemented"};case 503:return{code:re,message:"unavailable"};case 504:return{code:re,message:"deadline_exceeded"};default:return{code:re,message:"internal_error"}}return{code:re,message:"internal_error"}}function Mo(e,t){e.setAttribute("http.response.status_code",t);const n=Lh(t);n.message!=="unknown_error"&&e.setStatus(n)}const Dh="_sentryScope",Fh="_sentryIsolationScope",WS=Symbol.for("sentry.otelSourceInference");function Br(e,t,n){e&&(we(e,Fh,Ah(n)),we(e,Dh,t))}function Ur(e){const t=e;return{scope:t[Dh],isolationScope:Ch(t[Fh])}}function jS(e){return e[WS]===!0}const ui="sentry-",zS=8192;function yu(e){const t=qS(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(ui)){const i=o.slice(ui.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function $h(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${ui}${r}`]=o),n),{});return GS(t)}function qS(e){if(!(!e||!gt(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=md(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):md(e)}function md(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function GS(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${t},${s}`;return i.length>zS?(M&&_.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const VS=/^o(\d+)\./,YS=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function KS(e){return e==="http"||e==="https"}function Ut(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function Bh(e){const t=YS.exec(e);if(!t){$t(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Uh({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Uh(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function JS(e){if(!M)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(_.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?KS(r)?t&&isNaN(parseInt(t,10))?(_.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(_.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(_.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function XS(e){const t=e.match(VS);return t==null?void 0:t[1]}function Hh(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=XS(n)),r}function Wh(e){const t=typeof e=="string"?Bh(e):Uh(e);if(!(!t||!JS(t)))return t}function Kn(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const jh=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function QS(e){if(!e)return;const t=e.match(jh);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 zh(e,t){const n=QS(e),r=yu(t);if(!(n!=null&&n.traceId))return{traceId:Pt(),sampleRand:Vt()};const o=ZS(n,r);r&&(r.sample_rand=o.toString());const{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function qh(e=Pt(),t=Yt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Gh(e=Pt(),t=Yt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function ZS(e,t){const n=Kn(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Kn(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?Vt()*r:r+Vt()*(1-r):Vt()}function ev(e,t){const n=Hh(e);return t&&n&&t!==n?(_.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):(e.getOptions().strictTraceContinuation||!1)&&(t&&!n||!t&&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}const Vh=0,Gi=1;let gd=!1;function tv(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=U(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function Yh(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:U(e).parent_span_id,s=Ur(e).scope,i=r?(s==null?void 0:s.getPropagationContext().propagationSpanId)||Yt():t;return{parent_span_id:o,span_id:i,trace_id:n}}function Kh(e){const{traceId:t,spanId:n}=e.spanContext(),r=Ht(e);return qh(t,n,r)}function nv(e){const{traceId:t,spanId:n}=e.spanContext(),r=Ht(e);return Gh(t,n,r)}function Jh(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Gi,attributes:s,...o}))}function Xh(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Gi,attributes:o}))}function Kt(e){return typeof e=="number"?_d(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?_d(e.getTime()):ye()}function _d(e){return e>9999999999?e/1e3:e}function U(e){if(tm(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(em(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:Qh(e),start_timestamp:Kt(o),timestamp:Kt(i)||void 0,status:nm(a),op:r[ce],origin:r[Y],links:Jh(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function li(e){if(tm(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(em(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:n,parent_span_id:Qh(e),start_timestamp:Kt(o),end_timestamp:Kt(i),is_segment:e===fi(e),status:rm(a),attributes:r,links:Xh(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===fi(e)}}function Qh(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function Zh(e){var t;return{...e,attributes:$r(e.attributes),links:(t=e.links)==null?void 0:t.map(n=>({...n,attributes:$r(n.attributes)}))}}function em(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function tm(e){return typeof e.getSpanJSON=="function"}function Ht(e){const{traceFlags:t}=e.spanContext();return t===Gi}function nm(e){if(!(!e||e.code===Ph))return e.code===Jo?"ok":e.message||"internal_error"}function rm(e){return!e||e.code===Jo||e.code===Ph||e.message==="cancelled"?"ok":"error"}const jn="_sentryChildSpans",Ec="_sentryRootSpan";function di(e,t){const n=e[Ec]||e;we(t,Ec,n),e[jn]?e[jn].add(t):we(e,jn,new Set([t]))}function rv(e,t){e[jn]&&e[jn].delete(t)}function To(e){const t=new Set;function n(r){if(!t.has(r)&&Ht(r)){t.add(r);const o=r[jn]?Array.from(r[jn]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const Ee=fi;function fi(e){return e[Ec]||e}function Te(){const e=Ft(),t=kn(e);return t.getActiveSpan?t.getActiveSpan():Dr(j())}function pi(){gd||($t(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),gd=!0)}function ov(e,t){e.updateName(t),e.setAttributes({[ue]:"custom",[vc]:t})}let yd=!1;function bu(){if(yd)return;function e(){const t=Te(),n=t&&Ee(t);if(n){const r="internal_error";M&&_.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:re,message:r})}}yd=!0,mh(e),gh(e)}function Je(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=N())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function bd(e){_.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Oo(e,t){if(!(t!=null&&t.length))return!1;for(const n of t){if(av(n)){if(e.description&&Eo(e.description,n))return M&&bd(e),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const o=n.name?e.description&&Eo(e.description,n.name):!0,s=n.op?e.op&&Eo(e.op,n.op):!0,i=n.attributes?Object.entries(n.attributes).every(([a,c])=>{var u;return sv((u=e.attributes)==null?void 0:u[a],c)}):!0;if(o&&s&&i)return M&&bd(e),!0}return!1}function sv(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?Eo(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function iv(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function av(e){return typeof e=="string"||e instanceof RegExp}const om=Symbol.for("sentry.nonRecordingSpan");class Jn{constructor(t={}){this._traceId=t.traceId||Pt(),this._spanId=t.spanId||Yt(),this.dropReason=t.dropReason,we(this,om,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Vh}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Hr(e){return!!e&&e[om]===!0}const Xo="production",sm="_frozenDsc";function Sd(e,t){we(e,sm,t)}function im(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Xo,release:n.release,public_key:r,trace_id:e,org_id:Hh(t)};return t.emit("createDsc",o),o}function Vi(e,t){const n=t.getPropagationContext();return n.dsc||im(n.traceId,e)}function vt(e){var h;const t=N();if(!t)return{};const n=Ee(e),r=U(n),o=r.data,s=n.spanContext().traceState,i=(s==null?void 0:s.get("sentry.sample_rate"))??o[qi]??o[Oh];function a(m){return(typeof i=="number"||typeof i=="string")&&(m.sample_rate=`${i}`),m}const c=n[sm];if(c)return a(c);if(Hr(n)&&!Je(t.getOptions())){const m=Ur(n).scope;if(m)return a({...Vi(t,m)})}const u=s==null?void 0:s.get("sentry.dsc"),d=u&&yu(u);if(d)return a(d);const l=im(e.spanContext().traceId,t),f=o[ue]??o["sentry.span.source"],p=r.description;return f!=="url"&&p&&(l.transaction=p),Je()&&(l.sampled=String(Ht(n)),l.sample_rand=(s==null?void 0:s.get("sentry.sample_rand"))??((h=Ur(n).scope)==null?void 0:h.getPropagationContext().sampleRand.toString())),a(l),t.emit("createDsc",l,n),l}function cv(e){const t=vt(e);return $h(t)}function uv(e){return we(e,"_streamed",!0),e}function Yi(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function dt(e,t=[]){return[e,t]}function vd(e,t){const[n,r]=e;return[n,[...r,t]]}function Xn(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function Tc(e,t){return Xn(e,(n,r)=>t.includes(r))}function hi(e){const t=qo(H);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function lv(e){const t=qo(H);return t.decodePolyfill?t.decodePolyfill(e):new TextDecoder().decode(e)}function mi(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[hi(r),s]:r.push(typeof s=="string"?hi(s):s)}for(const s of n){const[i,a]=s;if(o(`
${JSON.stringify(i)}
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(Ae(a))}o(c)}}return typeof r=="string"?r:dv(r)}function dv(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function fv(e){let t=typeof e=="string"?hi(e):e;function n(i){const a=t.subarray(0,i);return t=t.subarray(i+1),a}function r(){let i=t.indexOf(10);return i<0&&(i=t.length),JSON.parse(lv(n(i)))}const o=r(),s=[];for(;t.length;){const i=r(),a=typeof i.length=="number"?i.length:void 0;s.push([i,a?n(a):r()])}return[o,s]}function pv(e){return[{type:"span"},e]}function hv(e){const t=typeof e.data=="string"?hi(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const am={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 mv(e){return e in am}function Ed(e){return mv(e)?am[e]:e}function Qo(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function cm(e,t,n,r){var s;const o=(s=e.sdkProcessingMetadata)==null?void 0:s.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(Bt()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Ut(r)},...o&&{trace:o}}}function gv(e,t){var r,o,s,i;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((o=e.sdk)==null?void 0:o.packages)||[],...t.packages||[]],settings:(s=e.sdk)!=null&&s.settings||t.settings?{...(i=e.sdk)==null?void 0:i.settings,...t.settings}:void 0},e}function _v(e,t,n,r){const o=Qo(n),s={sent_at:new Date(Bt()).toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Ut(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return dt(s,[i])}function yv(e,t,n,r){const o=Qo(n),s=e.type&&e.type!=="replay_event"?e.type:"event";gv(e,n==null?void 0:n.sdk);const i=cm(e,o,r,t);return delete e.sdkProcessingMetadata,dt(i,[[{type:s},e]])}function bv(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=vt(e[0]),o=t==null?void 0:t.getDsn(),s=t==null?void 0:t.getOptions().tunnel,i={sent_at:new Date(Bt()).toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:Ut(o)}},{beforeSendSpan:a,ignoreSpans:c}=(t==null?void 0:t.getOptions())||{},u=c!=null&&c.length?e.filter(p=>{const h=U(p);return!Oo({description:h.description,op:h.op,attributes:h.data},c)}):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=a?p=>{const h=U(p),m=Yi(a)?h:a(h);return m||(pi(),h)}:U,f=[];for(const p of u){const h=l(p);h&&f.push(pv(h))}return dt(i,f)}function Sv(e){if(!M)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=U(e),{spanId:o}=e.spanContext(),s=Ht(e),i=Ee(e),a=i===e,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){const{op:d,description:l}=U(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}_.log(`${c}
${u.join(`
`)}`)}function vv(e){if(!M)return;const{description:t="< unknown name >",op:n="< unknown op >"}=U(e),{spanId:r}=e.spanContext(),s=Ee(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;_.log(i)}function Ki(e,t,n,r=Te()){const o=r&&Ee(r);o&&(M&&_.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[Ko]:t,[Yo]:n}))}function Td(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[Yo],s=r[Ko];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function ft(e){return e.getOptions().traceLifecycle==="stream"}const Id=1e3;class Ji{constructor(t={}){this._traceId=t.traceId||Pt(),this._spanId=t.spanId||Yt(),this._startTime=t.startTimestamp||ye(),this._links=t.links,this._attributes={},this.setAttributes({[Y]:"manual",[ce]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Gi:Vh}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Kt(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,jS(this)||this.setAttribute(ue,"custom"),this}end(t){this._endTime||(this._endTime=Kt(t),vv(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ce],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:nm(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Y],profile_id:this._attributes[_u],exclusive_time:this._attributes[Rn],measurements:Td(this._events),is_segment:this._isStandaloneSpan&&Ee(this)===this||void 0,segment_id:this._isStandaloneSpan?Ee(this).spanContext().spanId:void 0,links:Jh(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===Ee(this),status:rm(this._status),attributes:this._attributes,links:Xh(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){M&&_.log("[Tracing] Adding an event to span:",t);const o=wd(n)?n:r||ye(),s=wd(n)?{}:n||{},i={name:t,time:Kt(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=N();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Ee(this)))return;if(this._isStandaloneSpan){this._sampled?Tv(bv([this],t)):(M&&_.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&ft(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(Ur(this).scope||j()).captureEvent(r)}_convertSpanToTransaction(){var l;if(!kd(U(this)))return;this._name||(M&&_.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=Ur(this),r=(l=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:l.normalizedRequest;if(this._sampled!==!0)return;const s=To(this).filter(f=>f!==this&&!Ev(f)).map(f=>U(f)).filter(kd),i=this._attributes[ue];delete this._attributes[vc];let a=!1;s.forEach(f=>{var p;delete f.data[vc],(p=f.op)!=null&&p.startsWith("gen_ai.")&&(a=!0)});const c={contexts:{trace:tv(this)},spans:s.length>Id?s.sort((f,p)=>f.start_timestamp-p.start_timestamp).slice(0,Id):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:vt(this),hasGenAiSpans:a},request:r,...i&&{transaction_info:{source:i}}},u=Td(this._events);return u&&Object.keys(u).length&&(M&&_.log("[Measurements] Adding measurements to transaction event",JSON.stringify(u,void 0,2)),c.measurements=u),c}}function wd(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function kd(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Ev(e){return e instanceof Ji&&e.isStandaloneSpan()}function Tv(e){const t=N();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function Su(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return Iv(o,t,n,r)}function Iv(e,t,n,r){return wn(e)?xh(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function wv(e,t,n){if(!Je(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);const s=Kn(o);if(s===void 0)return M&&_.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(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return M&&_.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,s,r];const i=n<s;return i||M&&_.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const Ic="__SENTRY_SUPPRESS_TRACING__";function Et(e,t){const n=to();if(n.startSpan)return n.startSpan(e,t);const r=Iu(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return Ge(a,()=>lm(s)(()=>{const u=j(),d=wu(u,s),l=N(),p=e.onlyIfParent&&!d?Eu(u,l):Tu({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!dm(p)||!d)&&Lt(u,p),Su(()=>t(p),()=>{const{status:h}=U(p);p.isRecording()&&(!h||h==="ok")&&p.setStatus({code:re,message:"internal_error"})},()=>{p.end()})}))}function wt(e,t){const n=to();if(n.startSpanManual)return n.startSpanManual(e,t);const r=Iu(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return Ge(a,()=>lm(s)(()=>{const u=j(),d=wu(u,s),f=e.onlyIfParent&&!d?Eu(u,N()):Tu({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!dm(f)||!d)&&Lt(u,f),Su(()=>t(f,()=>f.end()),()=>{const{status:p}=U(f);f.isRecording()&&(!p||p==="ok")&&f.setStatus({code:re,message:"internal_error"})})}))}function qe(e){const t=to();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=Iu(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>Ge(e.scope,i):o!==void 0?i=>gn(o,i):i=>i())(()=>{const i=j(),a=wu(i,o),c=N();return e.onlyIfParent&&!a?Eu(i,c):Tu({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}const kv=(e,t)=>{const n=Ft(),r=kn(n);if(r.continueTrace)return r.continueTrace(e,t);const{sentryTrace:o,baggage:s}=e,i=N(),a=yu(s);return i&&!ev(i,a==null?void 0:a.org_id)?um(t):Ge(c=>{const u=zh(o,s);return c.setPropagationContext(u),Lt(c,void 0),t()})};function gn(e,t){const n=to();return n.withActiveSpan?n.withActiveSpan(e,t):Ge(r=>(Lt(r,e||void 0),t(r)))}function vu(e){const t=to();return t.suppressTracing?t.suppressTracing(e):Ge(n=>{n.setSDKProcessingMetadata({[Ic]:!0});const r=e();return n.setSDKProcessingMetadata({[Ic]:void 0}),r})}function um(e){const t=to();return t.startNewTrace?t.startNewTrace(e):Ge(n=>(n.setPropagationContext({traceId:Pt(),sampleRand:Vt()}),M&&_.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),gn(null,e)))}function Eu(e,t){t==null||t.recordDroppedEvent("no_parent_span","span");const n=new Jn({traceId:e.getPropagationContext().traceId});return Br(n,e,he()),n}function Tu({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){const o=he();if(!Je()){const a={...o.getPropagationContext(),...r.getPropagationContext()},c=e?e.spanContext().traceId:a.traceId,u=new Jn({traceId:c});return e&&!n&&di(e,u),Br(u,r,o),u}const s=N();if(Av(s,t)){ku(r)||s==null||s.recordDroppedEvent("ignored","span");const a=new Jn({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});return Br(a,r,o),a}let i;if(e&&!n)i=Rv(e,r,t,o),di(e,i);else if(e){const a=vt(e),{traceId:c,spanId:u}=e.spanContext(),d=Ht(e);i=Rd({traceId:c,parentSpanId:u,...t},r,o,d),Sd(i,a)}else{const{traceId:a,dsc:c,parentSpanId:u,sampled:d}={...o.getPropagationContext(),...r.getPropagationContext()};i=Rd({traceId:a,parentSpanId:u,...t},r,o,d),c&&Sd(i,c)}return Sv(i),i}function Iu(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Kt(e.startTime),delete r.startTime,r}return n}function to(){const e=Ft();return kn(e)}function Rd(e,t,n,r){var g;const o=N(),s=(o==null?void 0:o.getOptions())||{},{name:i=""}=e,a={spanAttributes:{...e.attributes},spanName:i,parentSampled:r};o==null||o.emit("beforeSampling",a,{decision:!1});const c=a.parentSampled??r,u=a.spanAttributes,d=t.getPropagationContext(),l=ku(t),[f,p,h]=l?[!1]:wv(s,{name:i,parentSampled:c,attributes:u,parentSampleRate:Kn((g=d.dsc)==null?void 0:g.sample_rate)},d.sampleRand),m=new Ji({...e,attributes:{[ue]:"custom",[qi]:p!==void 0&&h?p:void 0,...u},sampled:f});return!f&&o&&!l&&(M&&_.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),o.recordDroppedEvent("sample_rate",ft(o)?"span":"transaction")),Br(m,t,n),o&&o.emit("spanStart",m),m}function Rv(e,t,n,r){const{spanId:o,traceId:s}=e.spanContext(),i=ku(t),a=i?!1:Ht(e),c=a?new Ji({...n,parentSpanId:o,traceId:s,sampled:a}):new Jn({traceId:s});di(e,c),Br(c,t,r);const u=N();return u&&(ft(u)&&Hr(c)&&(Hr(e)&&e.dropReason?(c.dropReason=e.dropReason,u.recordDroppedEvent(e.dropReason,"span")):i||(c.dropReason="sample_rate",u.recordDroppedEvent("sample_rate","span"))),u.emit("spanStart",c),n.endTimestamp&&(u.emit("spanEnd",c),u.emit("afterSpanEnd",c))),c}function wu(e,t){if(t)return t;if(t===null)return;const n=Dr(e);if(!n)return;const r=N();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Ee(n):n}function lm(e){return e!==void 0?t=>gn(e,t):t=>t()}function Av(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!ft(e)||!(n!=null&&n.length)?!1:Oo({description:t.name||"",op:((r=t.attributes)==null?void 0:r[ce])||t.op,attributes:t.attributes},n)}function dm(e){return Hr(e)&&e.dropReason==="ignored"}function ku(e){return e.getScopeData().sdkProcessingMetadata[Ic]===!0}const Ws={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Cv="heartbeatFailed",Nv="idleTimeout",xv="finalTimeout",Mv="externalFinish";function Ru(e,t={}){const n=new Map;let r=!1,o,s=Mv,i=!t.disableAutoFinish;const a=[],{idleTimeout:c=Ws.idleTimeout,finalTimeout:u=Ws.finalTimeout,childSpanTimeout:d=Ws.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=N(),h=j();if(!p||!Je()){const b=new Jn({traceId:h.getPropagationContext().traceId});return Br(b,h,he()),b}const m=Te(),g=Ov(e);g.end=new Proxy(g.end,{apply(b,I,B){if(l&&l(g),Hr(I))return;const[v,...P]=B,R=v||ye(),L=Kt(R),$=To(g).filter(T=>T!==g),J=U(g);if(!$.length||!f)return w(L),Reflect.apply(b,I,[L,...P]);const te=p.getOptions().ignoreSpans,F=$==null?void 0:$.reduce((T,W)=>{const z=U(W);return!z.timestamp||te&&Oo({description:z.description,op:z.op,attributes:z.data},te)?T:T?Math.max(T,z.timestamp):z.timestamp},void 0),O=J.start_timestamp,Q=Math.min(O?O+u/1e3:1/0,Math.max(O||-1/0,Math.min(L,F||1/0)));return w(Q),Reflect.apply(b,I,[Q,...P])}});function y(){o&&(clearTimeout(o),o=void 0)}function S(b){y(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=Nv,g.end(b))},c)}function k(b){o=setTimeout(()=>{!r&&i&&(s=Cv,g.end(b))},d)}function E(b){y(),n.set(b,!0);const I=ye();k(I+d/1e3)}function x(b){if(n.has(b)&&n.delete(b),n.size===0){const I=ye();S(I+c/1e3)}}function w(b){r=!0,n.clear(),a.forEach($=>$()),Lt(h,m);const I=U(g),{start_timestamp:B}=I;if(!B)return;I.data[xo]||g.setAttribute(xo,s);const P=I.status;(!P||P==="unknown")&&g.setStatus({code:Jo}),_.log(`[Tracing] Idle span "${I.op}" finished`);const R=To(g).filter($=>$!==g);let L=0;R.forEach($=>{$.isRecording()&&($.setStatus({code:re,message:"cancelled"}),$.end(b),M&&_.log("[Tracing] Cancelling span since span ended early",JSON.stringify($,void 0,2)));const J=U($),{timestamp:te=0,start_timestamp:F=0}=J,O=F<=b,Q=(u+c)/1e3,T=te-F<=Q;if(M){const W=JSON.stringify($,void 0,2);O?T||_.log("[Tracing] Discarding span since it finished after idle span final timeout",W):_.log("[Tracing] Discarding span since it happened after idle span was finished",W)}(!T||!O)&&(rv(g,$),L++)}),L>0&&g.setAttribute("sentry.idle_span_discarded_spans",L)}return a.push(p.on("spanStart",b=>{if(r||b===g||U(b).timestamp||b instanceof Ji&&b.isStandaloneSpan())return;To(g).includes(b)&&E(b.spanContext().spanId)})),a.push(p.on("spanEnd",b=>{r||x(b.spanContext().spanId)})),a.push(p.on("idleSpanEnableAutoFinish",b=>{b===g&&(i=!0,S(),n.size&&k())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(g.setStatus({code:re,message:"deadline_exceeded"}),s=xv,g.end())},u),g}function Ov(e){const t=qe(e);return Lt(j(),t),M&&_.log("[Tracing] Started span is an idle span"),t}const Pv=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],Lv=["removeListener","off","removeEventListener"],fm=Symbol("SentryScopeBoundListeners");let Ar;function Dv(e){return Ar!==void 0&&(e===Ar||e.listener===Ar)}function Fv(e,t=j()){const n=e;if(Xi(n))return e;Au(n);for(const r of Pv)typeof n[r]=="function"&&(n[r]=Bv(n,n[r],t));for(const r of Lv)typeof n[r]=="function"&&(n[r]=Uv(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=Hv(n,n.removeAllListeners)),e}function $v(e,t){return function(...n){return Ge(t,()=>e.apply(this,n))}}function pm(e){return typeof e=="function"}function Bv(e,t,n){return function(...r){const o=r[0],s=r[1],i=r.slice(2);if(!pm(s)||Dv(s))return t.apply(this,r);const a=Xi(e)||Au(e);let c=a.get(o);c||(c=new WeakMap,a.set(o,c));let u=c.get(s);u||(u=$v(s,n),c.set(s,u));const d=Ar;Ar=u;try{return t.call(this,o,u,...i)}finally{Ar=d}}}function Uv(e,t){return function(...n){var a,c;const r=n[0],o=n[1],s=n.slice(2),i=pm(o)?(c=(a=Xi(e))==null?void 0:a.get(r))==null?void 0:c.get(o):void 0;return i?t.call(this,r,i,...s):t.apply(this,n)}}function Hv(e,t){return function(...n){const r=Xi(e);if(r)if(n.length===0)Au(e);else{const o=n[0];r.delete(o)}return t.apply(this,n)}}function Au(e){const t=new Map;return e[fm]=t,t}function Xi(e){return e[fm]}function Wv(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;jv(e,t),r&&Gv(e,r),Vv(e,n),zv(e,o),qv(e,s)}function Ad(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:f,propagationContext:p,transactionName:h,span:m}=t;po(e,"extra",n),po(e,"tags",r),po(e,"attributes",o),po(e,"user",s),po(e,"contexts",i),e.sdkProcessingMetadata=Vo(e.sdkProcessingMetadata,c,2),a&&(e.level=a),h&&(e.transactionName=h),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function po(e,t,n){e[t]=Vo(e[t],n,1)}function Zo(e,t){const n=Ct().getScopeData();return e&&Ad(n,e.getScopeData()),t&&Ad(n,t.getScopeData()),n}function jv(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function zv(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function qv(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Gv(e,t){e.contexts={trace:Yh(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:vt(t),...e.sdkProcessingMetadata};const n=Ee(t),r=U(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Vv(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 Yv(e){const t={},{response:n,profile:r,cloud_resource:o,culture:s,state:i}=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)),o)for(const[u,d]of Object.entries(o))d!=null&&(t[u]=d);s&&(s.locale&&(t["culture.locale"]=s.locale),s.timezone&&(t["culture.timezone"]=s.timezone)),i!=null&&i.state&&typeof i.state.type=="string"&&(t["state.type"]=i.state.type);const a=e.angular;if(a){const u=a.version;(typeof u=="string"||typeof u=="number")&&(t["angular.version"]=u)}const c=e.react;if(c){const u=c.version;(typeof u=="string"||typeof u=="number")&&(t["react.version"]=u)}return t}function Kv(e,t){var f;const n=li(e),r=fi(e),o=li(r),{isolationScope:s,scope:i}=Ur(e),a=Zo(s,i);Qv(n,o,t,a);const c=e.kind;t.emit("preprocessSpan",n,{spanKind:c}),n.is_segment&&(Jv(n,a),Xv(n,t),t.emit("processSegmentSpan",n)),t.emit("processSpan",n);const{beforeSendSpan:u}=t.getOptions(),d=u&&Yi(u)?Zv(n,u):n,l=(f=d.attributes)==null?void 0:f[ue];return l&&_n(d,{"sentry.span.source":l}),{...Zh(d),_segmentSpan:r}}function Jv(e,t){const n=Yv(t.contexts);_n(e,n)}function _n(e,t){const n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function Xv(e,t){const n=t.getIntegrationNames();n.length&&_n(e,{[OS]:n})}function Qv(e,t,n,r){var a,c,u,d,l,f;const o=n.getSdkMetadata(),{release:s,environment:i}=n.getOptions();_n(e,{[RS]:s,[AS]:i||Xo,[CS]:t.name,[NS]:t.span_id,[xS]:(a=o==null?void 0:o.sdk)==null?void 0:a.name,[MS]:(c=o==null?void 0:o.sdk)==null?void 0:c.version,[PS]:(u=r.user)==null?void 0:u.id,[LS]:(d=r.user)==null?void 0:d.email,[DS]:(l=r.user)==null?void 0:l.ip_address,[FS]:(f=r.user)==null?void 0:f.username,...r.attributes})}function Zv(e,t){const n=t(e);return n||(pi(),e)}const Wa=0,Cd=1,Nd=2;function es(e){return new Po(t=>{t(e)})}function Cu(e){return new Po((t,n)=>{n(e)})}class Po{constructor(t){this._state=Wa,this._handlers=[],this._runExecutor(t)}then(t,n){return new Po((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Po((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Wa)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Cd&&n[1](this._value),this._state===Nd&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===Wa){if(wn(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(Cd,s)},o=s=>{n(Nd,s)};try{t(r,o)}catch(s){o(s)}}}function eE(e,t,n,r=0){try{const o=wc(t,n,e,r);return wn(o)?o:es(o)}catch(o){return Cu(o)}}function wc(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return M&&s===null&&_.log(`Event processor "${o.id||"?"}" dropped event`),wn(s)?s.then(i=>wc(i,t,n,r+1)):wc(s,t,n,r+1)}let jt,xd,Md,en;function hm(e){const t=H._sentryDebugIds,n=H._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(en&&r.length===xd&&o.length===Md)return en;xd=r.length,Md=o.length,en={},jt||(jt={});const s=(i,a)=>{for(const c of i){const u=a[c],d=jt==null?void 0:jt[c];if(d&&en&&u)en[d[0]]=u,jt&&(jt[c]=[d[0],u]);else if(u){const l=e(c);for(let f=l.length-1;f>=0;f--){const p=l[f],h=p==null?void 0:p.filename;if(h&&en&&jt){en[h]=u,jt[c]=[h,u];break}}}}};return t&&s(r,t),n&&s(o,n),en}function tE(e,t){const n=hm(e);if(!n)return[];const r=[];for(const o of t){const s=Gb(o);s&&n[s]&&r.push({type:"sourcemap",code_file:o,debug_id:n[s]})}return r}function mm(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Me(),timestamp:t.timestamp||rr()},u=n.integrations||e.integrations.map(y=>y.name);nE(c,e),sE(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&rE(c,e.stackParser);const d=aE(r,n.captureContext);n.mechanism&&At(c,n.mechanism);const l=o?o.getEventProcessors():[],f=Zo(s,d),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Wv(c,f);const h=[...l,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?es(c):eE(h,c,n)).then(y=>(y&&oE(y),typeof i=="number"&&i>0?iE(y,i,a):y))}function nE(e,t){var a,c;const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Xo,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i!=null&&i.url&&s&&(i.url=No(i.url,s)),s&&((c=(a=e.exception)==null?void 0:a.values)==null||c.forEach(u=>{u.value&&(u.value=No(u.value,s))}))}function rE(e,t){var r,o;const n=hm(t);(o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.filename&&(c.debug_id=n[c.filename])})})}function oE(e){var r,o;const t={};if((o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.debug_id&&(c.abs_path?t[c.abs_path]=c.debug_id:c.filename&&(t[c.filename]=c.debug_id),delete c.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function sE(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function iE(e,t,n){var o,s;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Ae(i.data,t,n)}}))},...e.user&&{user:Ae(e.user,t,n)},...e.contexts&&{contexts:Ae(e.contexts,t,n)},...e.extra&&{extra:Ae(e.extra,t,n)}};return(o=e.contexts)!=null&&o.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ae(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:Ae(i.data,t,n)}}))),(s=e.contexts)!=null&&s.flags&&r.contexts&&(r.contexts.flags=Ae(e.contexts.flags,3,n)),r}function aE(e,t){if(!t)return e;const n=e?e.clone():new bt;return n.update(t),n}function cE(e){if(e)return uE(e)?{captureContext:e}:dE(e)?{captureContext:e}:e}function uE(e){return e instanceof bt||typeof e=="function"}const lE=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function dE(e){return Object.keys(e).some(t=>lE.includes(t))}function pe(e,t){return j().captureException(e,cE(t))}function Nu(e,t){const n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return j().captureMessage(e,n,r)}function or(e,t){return j().captureEvent(e,t)}function Qi(e,t){he().setContext(e,t)}function gm(e){he().setExtras(e)}function _m(e,t){he().setExtra(e,t)}function ym(e){he().setTags(e)}function bm(e,t){he().setTag(e,t)}function Sm(e){he().setUser(e)}function fE(e){he().setConversationId(e)}function vm(){return he().lastEventId()}async function Em(e){const t=N();return t?t.flush(e):(M&&_.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function pE(e){const t=N();return t?t.close(e):(M&&_.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function hE(){return!!N()}function Tm(){const e=N();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function xu(e){he().addEventProcessor(e)}function kc(e){const t=he(),{user:n}=Zo(t,j()),{userAgent:r}=H.navigator||{},o=fS({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return(s==null?void 0:s.status)==="ok"&&Lr(s,{status:"exited"}),Mu(),t.setSession(o),o}function Mu(){const e=he(),n=j().getSession()||e.getSession();n&&pS(n),Im(),e.setSession()}function Im(){const e=he(),t=N(),n=e.getSession();n&&t&&t.captureSession(n)}function js(e=!1){if(e){Mu();return}Im()}const mE="7";function wm(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function gE(e){return`${wm(e)}${e.projectId}/envelope/`}function _E(e,t){const n={sentry_version:mE};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function km(e,t,n){return t||`${gE(e)}?${_E(e,n)}`}function yE(e,t){const n=Wh(e);if(!n)return"";const r=`${wm(n)}embed/error-page/`;let o=`dsn=${Ut(n)}`;for(const s in t)if(s!=="dsn"&&s!=="onClose")if(s==="user"){const i=t.user;if(!i)continue;i.name&&(o+=`&name=${encodeURIComponent(i.name)}`),i.email&&(o+=`&email=${encodeURIComponent(i.email)}`)}else o+=`&${encodeURIComponent(s)}=${encodeURIComponent(t[s])}`;return`${r}?${o}`}const Od=[];function bE(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function SE(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return bE(r)}function vE(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Rm(e,r,n)}),n}function Pd(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Rm(e,t,n){if(n[t.name]){M&&_.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Od.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Od.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{const o=t[r];typeof o=="function"&&e.on(r,s=>o.call(t,s,e))}),M&&_.log(`Integration installed: ${t.name}`)}function Rc(e){const t=N();if(!t){M&&_.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}const EE="sentry.timestamp.sequence";let ja=0,za;function Am(e){const t=Math.floor(e*1e3);za!==void 0&&t!==za&&(ja=0);const n=ja;return ja++,za=t,{key:EE,value:{value:n,type:"integer"}}}function Cm(e,t){return t?Ge(t,()=>{const n=Te(),r=n?Yh(n):Mh(t);return[n?vt(n):Vi(e,t),r]}):[void 0,void 0]}const TE={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function IE(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function wE(){/*! __SENTRY_SDK_SOURCE__ */return"npm"}function kE(){return!IE()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function yn(){return typeof window<"u"&&(!kE()||RE())}function RE(){const e=H.process;return(e==null?void 0:e.type)==="renderer"}function AE(e,t){const n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...yn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function CE(e,t,n,r,o){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Ut(r)),dt(s,[AE(e,o)])}const NE=100;function Tt(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function xE(e,t){const n=Ou(),r=Nm(e);r===void 0?n.set(e,[t]):r.length>=NE?(_i(e,r),n.set(e,[t])):n.set(e,[...r,t])}function gi(e,t=j(),n=xE){var L;const r=(t==null?void 0:t.getClient())??N();if(!r){M&&_.warn("No client available to capture log.");return}const{release:o,environment:s,enableLogs:i=!1,beforeSendLog:a}=r.getOptions();if(!i){M&&_.warn("logging option not enabled, log will not be captured.");return}const[,c]=Cm(r,t),u={...e.attributes},{user:{id:d,email:l,username:f},attributes:p={}}=Zo(he(),t);Tt(u,"user.id",d,!1),Tt(u,"user.email",l,!1),Tt(u,"user.name",f,!1),Tt(u,"sentry.release",o),Tt(u,"sentry.environment",s);const{name:h,version:m}=((L=r.getSdkMetadata())==null?void 0:L.sdk)??{};Tt(u,"sentry.sdk.name",h),Tt(u,"sentry.sdk.version",m);const g=r.getIntegrationByName("Replay"),y=g==null?void 0:g.getReplayId(!0);Tt(u,"sentry.replay_id",y),y&&(g==null?void 0:g.getRecordingMode())==="buffer"&&Tt(u,"sentry._internal.replay_is_buffering",!0);const S=e.message;if(Wi(S)){const{__sentry_template_string__:$,__sentry_template_values__:J=[]}=S;J!=null&&J.length&&(u["sentry.message.template"]=$),J.forEach((te,F)=>{u[`sentry.message.parameter.${F}`]=te})}const k=Dr(t);Tt(u,"sentry.trace.parent_span_id",k==null?void 0:k.spanContext().spanId);const E={...e,attributes:u};r.emit("beforeCaptureLog",E);const x=a?$t(()=>a(E)):E;if(!x){r.recordDroppedEvent("before_send","log_item",1),M&&_.warn("beforeSendLog returned null, log will not be captured.");return}const{level:w,message:b,attributes:I={},severityNumber:B}=x,v=ye(),P=Am(v),R={timestamp:v,level:w,body:Ac(String(b)),trace_id:c==null?void 0:c.trace_id,severity_number:B??TE[w],attributes:ME({...$r(p),...$r(I,!0),[P.key]:P.value})};n(r,R),r.emit("afterCaptureLog",x)}function _i(e,t){const n=t??Nm(e)??[];if(n.length===0)return;const r=e.getOptions(),o=CE(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Ou().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Nm(e){return Ou().get(e)}function Ou(){return Zr("clientToLogBufferMap",()=>new WeakMap)}function ME(e){const t={};for(const[n,r]of Object.entries(e)){const o=Ac(n);r.type==="string"?t[o]={...r,value:Ac(r.value)}:t[o]=r}return t}function Ac(e){const 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 OE(e,t){const n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...yn()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function PE(e,t,n,r,o){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Ut(r)),dt(s,[OE(e,o)])}const LE=1e3;function zt(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function DE(e,t){const n=Lu(),r=xm(e);r===void 0?n.set(e,[t]):r.length>=LE?(Pu(e,r),n.set(e,[t])):n.set(e,[...r,t])}function FE(e,t,n){var d;const{release:r,environment:o}=t.getOptions(),s={...e.attributes};zt(s,"user.id",n.id,!1),zt(s,"user.email",n.email,!1),zt(s,"user.name",n.username,!1),zt(s,"sentry.release",r),zt(s,"sentry.environment",o);const{name:i,version:a}=((d=t.getSdkMetadata())==null?void 0:d.sdk)??{};zt(s,"sentry.sdk.name",i),zt(s,"sentry.sdk.version",a);const c=t.getIntegrationByName("Replay"),u=c==null?void 0:c.getReplayId(!0);return zt(s,"sentry.replay_id",u),u&&(c==null?void 0:c.getRecordingMode())==="buffer"&&zt(s,"sentry._internal.replay_is_buffering",!0),{...e,attributes:s}}function $E(e,t,n,r){const[,o]=Cm(t,n),s=Dr(n),i=s?s.spanContext().traceId:o==null?void 0:o.trace_id,a=s?s.spanContext().spanId:void 0,c=ye(),u=Am(c);return{timestamp:c,trace_id:i??"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...$r(r),...$r(e.attributes,"skip-undefined"),[u.key]:u.value}}}function BE(e,t){const n=(t==null?void 0:t.scope)??j(),r=(t==null?void 0:t.captureSerializedMetric)??DE,o=(n==null?void 0:n.getClient())??N();if(!o){M&&_.warn("No client available to capture metric.");return}const{_experiments:s,enableMetrics:i,beforeSendMetric:a}=o.getOptions();if(!(i??(s==null?void 0:s.enableMetrics)??!0)){M&&_.warn("metrics option not enabled, metric will not be captured.");return}const{user:u,attributes:d}=Zo(he(),n),l=FE(e,o,u);o.emit("processMetric",l);const f=a||(s==null?void 0:s.beforeSendMetric),p=f?f(l):l;if(!p){M&&_.log("`beforeSendMetric` returned `null`, will not send metric.");return}const h=$E(p,o,n,d);M&&_.log("[Metric]",h),r(o,h),o.emit("afterCaptureMetric",p)}function Pu(e,t){const n=t??xm(e)??[];if(n.length===0)return;const r=e.getOptions(),o=PE(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Lu().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function xm(e){return Lu().get(e)}function Lu(){return Zr("clientToMetricBufferMap",()=>new WeakMap)}function UE(e){const t={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};return Zh(t)}function HE(e,t){var s,i,a;if(e.type!=="transaction"||!((s=e.spans)!=null&&s.length)||!((i=e.sdkProcessingMetadata)!=null&&i.hasGenAiSpans)||!t.getOptions().streamGenAiSpans||ft(t))return;const n=[],r=[];for(const c of e.spans)(a=c.op)!=null&&a.startsWith("gen_ai.")?n.push(UE(c)):r.push(c);if(n.length===0)return;e.spans=r;const o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...yn()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:n}]}function Zi(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Du=Symbol.for("SentryBufferFullError");function ea(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return Cu(Du);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return es(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const c=[a,new Promise(u=>Zi(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}const WE=60*1e3;function Mm(e,t=Bt()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?WE:r-t}function jE(e,t){return e[t]||e.all||0}function Om(e,t,n=Bt()){return jE(e,t)>n}function Pm(e,{statusCode:t,headers:n},r=Bt()){const o={...e},s=n==null?void 0:n["x-sentry-rate-limits"],i=n==null?void 0:n["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,u,,,d]=a.split(":",5),l=parseInt(c,10),f=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[p]=r+f):o[p]=r+f}else i?o.all=r+Mm(i,r):t===429&&(o.all=r+60*1e3);return o}const Lm=64;function Dm(e,t,n=ea(e.bufferSize||Lm)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(Xn(i,(l,f)=>{const p=Ed(f);Om(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):a.push(l)}),a.length===0)return Promise.resolve({});const c=dt(i[0],a),u=l=>{if(Tc(c,["client_report"])){M&&_.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}Xn(c,(f,p)=>{e.recordDroppedEvent(l,Ed(p))})},d=()=>t({body:mi(c)}).then(l=>l.statusCode===413?(M&&_.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(M&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&_.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Pm(r,l),l),l=>{throw u("network_error"),M&&_.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Du)return M&&_.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:s,flush:o}}function zE(e,t,n){const r=[{type:"client_report"},{timestamp:rr(),discarded_events:e}];return dt(t?{dsn:t}:{},[r])}function Fm(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function qE(e){var c;const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=((c=e.contexts)==null?void 0:c.trace)??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i==null?void 0:i[_u],exclusive_time:i==null?void 0:i[Rn],measurements:e.measurements,is_segment:!0}}function GE(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&&{[_u]:e.profile_id},...e.exclusive_time&&{[Rn]:e.exclusive_time}}}},measurements:e.measurements}}const yo="[Filtered]",Is=["forwarded","-ip","remote-","via","-user"],Ld=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],VE=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function YE(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:Is},httpHeaders:{request:{deny:Is},response:{deny:Is}},httpBodies:[],queryParams:{deny:Is},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}const KE={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function JE(e){var r,o,s,i;const t=e.dataCollection!=null?KE:YE(e.sendDefaultPii),n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:{request:((r=n.httpHeaders)==null?void 0:r.request)??t.httpHeaders.request,response:((o=n.httpHeaders)==null?void 0:o.response)??t.httpHeaders.response},httpBodies:n.httpBodies??t.httpBodies,queryParams:n.queryParams??t.queryParams,genAI:{inputs:((s=n.genAI)==null?void 0:s.inputs)??t.genAI.inputs,outputs:((i=n.genAI)==null?void 0:i.outputs)??t.genAI.outputs},stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}const Dd="Not capturing exception because it's already been captured.",Fd="Discarded session because of missing or non-string release",$m=Symbol.for("SentryInternalError"),Bm=Symbol.for("SentryDoNotSendEventError"),XE=5e3;function zs(e){return{message:e,[$m]:!0}}function qa(e){return{message:e,[Bm]:!0}}function $d(e){return!!e&&typeof e=="object"&&$m in e}function Bd(e){return!!e&&typeof e=="object"&&Bm in e}function Ud(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{if(s+=r(c),s>=8e5)o(e);else if(!a){const u=e.getOptions()._flushInterval??XE;u>0&&(a=!0,i=Zi(setTimeout(()=>{o(e)},u)))}}),e.on("flush",()=>{o(e)})}class QE{constructor(t){var r,o,s;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ea(((r=t.transportOptions)==null?void 0:r.bufferSize)??Lm),this._dataCollection=JE(t),t.dsn?this._dsn=Wh(t.dsn):M&&_.warn("No DSN provided, client will not send events."),this._dsn){const i=km(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:i})}this._options.enableLogs=this._options.enableLogs??((o=this._options._experiments)==null?void 0:o.enableLogs),this._options.enableLogs&&Ud(this,"afterCaptureLog","flushLogs",nT,_i),(this._options.enableMetrics??((s=this._options._experiments)==null?void 0:s.enableMetrics)??!0)&&Ud(this,"afterCaptureMetric","flushMetrics",tT,Pu)}captureException(t,n,r){const o=Me();if(ud(t))return M&&_.log(Dd),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:Me(),...r},i=Wi(t)?t:String(t),a=Ot(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=Me();if(n!=null&&n.originalException&&ud(n.originalException))return M&&_.log(Dd),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=Hd(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),Lr(t,{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(t){const n=this._transport;if(this.emit("flush"),!n)return!0;const r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){_i(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Rm(this,t,this._integrations),n||Pd(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);const r=HE(t,this);let o=yv(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])o=vd(o,hv(s));r&&(o=vd(o,r)),this.sendEnvelope(o).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=Xo}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){M&&_.warn(Fd);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){M&&_.warn(Fd);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=_v(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;M&&_.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return M&&_.error("Error while sending envelope:",n),{}}return M&&_.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=vE(this,t),Pd(this,t)}_updateSessionFromEvent(t,n){var c,u;let r=n.level==="fatal",o=!1;const s=(c=n.exception)==null?void 0:c.values;if(s){o=!0,r=!1;for(const d of s)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(Lr(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),i=this.getIntegrationNames();return!n.integrations&&i.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),mm(s,t,n,r,this,o).then(a=>{var u;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(u=a.contexts)==null?void 0:u.trace,...Mh(r)},...a.contexts};const c=Vi(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=j(),o=he()){return M&&Cc(t)&&_.log(`Captured error event \`${Fm(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{M&&(Bd(s)?_.log(s.message):$d(s)?_.warn(s.message):_.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=Um(t),c=Cc(t),d=`before send for type \`${t.type||"error"}\``,l=typeof i>"u"?void 0:Kn(i);if(c&&typeof l=="number"&&Vt()>l)return this.recordDroppedEvent("sample_rate","error"),Cu(qa(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const f=Hd(t.type);return this._prepareEvent(t,n,r,o).then(p=>{var g;if(p===null)throw this.recordDroppedEvent("event_processor",f),qa("An event processor returned `null`, will not send event.");if(((g=n.data)==null?void 0:g.__sentry__)===!0)return p;const m=eT(this,s,p,n);return ZE(m,d)}).then(p=>{var g;if(p===null){if(this.recordDroppedEvent("before_send",f),a){const S=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",S)}throw qa(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||o.getSession();if(c&&h&&this._updateSessionFromEvent(h,p),a){const y=((g=p.sdkProcessingMetadata)==null?void 0:g.spanCountBeforeProcessing)||0,S=p.spans?p.spans.length:0,k=y-S;k>0&&this.recordDroppedEvent("before_send","span",k)}const m=p.transaction_info;if(a&&m&&p.transaction!==t.transaction){const y="custom";p.transaction_info={...m,source:y}}return this.sendEvent(p,n),p}).then(null,p=>{throw Bd(p)||$d(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),zs(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Du&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){M&&_.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){M&&_.log("No outcomes to send");return}if(!this._dsn){M&&_.log("No dsn provided, will not send outcomes");return}M&&_.log("Sending outcomes:",t);const n=zE(t,this._options.tunnel&&Ut(this._dsn));this.sendEnvelope(n)}}function Hd(e){return e==="replay_event"?"replay":e||"error"}function ZE(e,t){const n=`${t} must return \`null\` or a valid event.`;if(wn(e))return e.then(r=>{if(!je(r)&&r!==null)throw zs(n);return r},r=>{throw zs(`${t} rejected with ${r}`)});if(!je(e)&&e!==null)throw zs(n);return e}function eT(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Yi(t.beforeSendSpan)&&t.beforeSendSpan;let c=n;if(Cc(c)&&o)return o(c,r);if(Um(c)){if(a||i){const u=qE(c);if(i!=null&&i.length&&Oo({description:u.description,op:u.op,attributes:u.data},i))return null;if(a){const d=a(u);d?c=Vo(n,GE(d)):pi()}if(c.spans){const d=[],l=c.spans;for(const p of l){if(i!=null&&i.length&&Oo({description:p.description,op:p.op,attributes:p.data},i)){iv(l,p);continue}if(a){const h=a(p);h?d.push(h):(pi(),d.push(p))}else d.push(p)}const f=c.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),c.spans=d}}if(s){if(c.spans){const u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(c,r)}}return c}function Cc(e){return e.type===void 0}function Um(e){return e.type==="transaction"}function tT(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Hm(e.attributes)}function nT(e){let t=0;return e.message&&(t+=e.message.length*2),t+Hm(e.attributes)}function Hm(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Wd(n[0]):Ot(n)?t+=Wd(n):t+=100}),t}function Wd(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function rT(e,t){t.debug===!0&&(M?_.enable():$t(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),j().update(t.initialScope);const r=new e(t);return Fu(r),r.init(),r}function Fu(e){j().setClient(e)}const Ga=100,Va=5e3,oT=36e5;function sT(e){function t(...n){M&&_.log("[Offline]:",...n)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const o=n.createStore(n);let s=Va,i;function a(l,f,p){return Tc(l,["client_report"])?!1:n.shouldStore?n.shouldStore(l,f,p):!0}function c(l){i&&clearTimeout(i),i=Zi(setTimeout(async()=>{i=void 0;const f=await o.shift();f&&(t("Attempting to send previously queued event"),f[0].sent_at=new Date(Bt()).toISOString(),d(f,!0).catch(p=>{t("Failed to retry sending",p)}))},l))}function u(){i||(c(s),s=Math.min(s*2,oT))}async function d(l,f=!1){var p,h;if(!f&&Tc(l,["replay_event","replay_recording"]))return await o.push(l),c(Ga),{};try{if(n.shouldSend&&await n.shouldSend(l)===!1)throw new Error("Envelope not sent because `shouldSend` callback returned false");const m=await r.send(l);let g=Ga;if(m){if((p=m.headers)!=null&&p["retry-after"])g=Mm(m.headers["retry-after"]);else if((h=m.headers)!=null&&h["x-sentry-rate-limits"])g=6e4;else if((m.statusCode||0)>=400)return m}return c(g),s=Va,m}catch(m){if(await a(l,m,s))return f?await o.unshift(l):await o.push(l),u(),t("Error sending. Event queued.",m),{};throw m}}return n.flushAtStartup&&u(),{send:d,flush:l=>(l===void 0&&(s=Va,c(Ga)),r.flush(l))}}}const qs="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function Wm(e,t){let n;return Xn(e,(r,o)=>(t.includes(o)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function iT(e,t){return n=>{const r=e(n);return{...r,send:async o=>{const s=Wm(o,["event","transaction","profile","replay_event"]);return s&&(s.release=t),r.send(o)}}}}function aT(e,t){return dt(t?{...e[0],dsn:t}:e[0],e[1])}function cT(e,t){return n=>{const r=e(n),o=new Map,s=t||(u=>{var l;const d=u.getEvent();return(l=d==null?void 0:d.extra)!=null&&l[qs]&&Array.isArray(d.extra[qs])?d.extra[qs]:[]});function i(u,d){const l=d?`${u}:${d}`:u;let f=o.get(l);if(!f){const p=Bh(u);if(!p)return;const h=km(p,n.tunnel);f=d?iT(e,d)({...n,url:h}):e({...n,url:h}),o.set(l,f)}return[u,f]}async function a(u){function d(h){const m=h!=null&&h.length?h:["event"];return Wm(u,m)}const l=s({envelope:u,getEvent:d}).map(h=>typeof h=="string"?i(h,void 0):i(h.dsn,h.release)).filter(h=>!!h),f=l.length?l:[["",r]];return(await Promise.all(f.map(([h,m])=>m.send(aT(u,h)))))[0]}async function c(u){const d=[...o.values(),r];return(await Promise.all(d.map(f=>f.flush(u)))).every(f=>f)}return{send:a,flush:c}}}function Ya(e,t){return t.some(n=>e.includes(n))}function Lo(e,t,n){if(t===!1)return{};const r=n!=null?[...Ld,...n]:Ld,o={};if(t===!0){for(const i of Object.keys(e))o[i]=Ya(i.toLowerCase(),r)?yo:e[i];return o}if("deny"in t){const i=t.deny.map(a=>a.toLowerCase());for(const a of Object.keys(e)){const c=a.toLowerCase(),u=Ya(c,r)||i.some(d=>c.includes(d));o[a]=u?yo:e[a]}return o}const s=t.allow.map(i=>i.toLowerCase());for(const i of Object.keys(e)){const a=i.toLowerCase();if(Ya(a,r))o[i]=yo;else{const c=s.some(u=>a.includes(u));o[i]=c?e[i]:yo}}return o}function uT(e){const t={};let n=0;for(;n<e.length;){const r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}const s=e.slice(n,r).trim();if(t[s]===void 0){let i=e.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{t[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{t[s]=i}}n=o+1}return t}function Nc(e,t){if(t===!1)return{};try{const n=uT(e);return Object.keys(n).length===0?{}:Lo(n,t,VE)}catch{return yo}}const lT="thismessage:/";function $u(e){return"isRelative"in e}function ta(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?lT:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function jm(e){if($u(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function zn(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const 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 zm(e){return e.split(/[?#]/,1)[0]}function Nt(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&s!==-1){const a=e.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}function qm(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return fT(e,n)||dT(e,r)}function dT(e,t){return t?jd(e)===jd(t):!1}function fT(e,t){const n=ta(e);return!n||$u(n)||!t?!1:pT(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function pT(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function jd(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Gm(e,...t){const 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}const hT=Gm;function mT(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Vm(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:mt})),o.version=mt)}function Bu(e={}){const t=e.client||N();if(!Tm()||!t)return{};const n=Ft(),r=kn(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||j(),s=e.span||Te(),i=Hr(s)&&!Je(t.getOptions()),a=s&&!i?Kh(s):gT(o),c=s?vt(s):Vi(t,o),u=$h(c);if(!jh.test(a))return _.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const l={"sentry-trace":a,baggage:u};return e.propagateTraceparent&&(l.traceparent=s&&!i?nv(s):_T(o)),l}function gT(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return qh(t,r,n)}function _T(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Gh(t,r,n)}function yT(e,t,n){let r,o,s;const i=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,a=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function c(){return u(),r=e(),r}function u(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function d(){return o!==void 0||s!==void 0?c():r}function l(){return o&&clearTimeout(o),o=a(c,t),i&&s===void 0&&(s=a(c,i)),r}return l.cancel=u,l.flush=d,l}const bT=100;function ut(e,t){const n=N(),r=he();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=bT}=n.getOptions();if(s<=0)return;const a={timestamp:rr(),...e},c=o?$t(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,s))}let zd;const ST="FunctionToString",qd=new WeakMap,vT=(()=>({name:ST,setupOnce(){zd=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=zi(this),n=qd.has(N())&&t!==void 0?t:this;return zd.apply(n,e)}}catch{}},setup(e){qd.set(e,!0)}})),Uu=vT,ET=[/^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$/],TT="EventFilters",Hu=(e={})=>{let t;return{name:TT,setup(n){const r=n.getOptions();t=Gd(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=Gd(e,s)}return IT(n,t)?null:n}}},Ym=((e={})=>({...Hu(e),name:"InboundFilters"}));function Gd(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:ET],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function IT(e,t){if(e.type){if(e.type==="transaction"&&kT(e,t.ignoreTransactions))return M&&_.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${Ln(e)}`),!0}else{if(wT(e,t.ignoreErrors))return M&&_.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${Ln(e)}`),!0;if(NT(e))return M&&_.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${Ln(e)}`),!0;if(RT(e,t.denyUrls))return M&&_.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${Ln(e)}.
Url: ${yi(e)}`),!0;if(!AT(e,t.allowUrls))return M&&_.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${Ln(e)}.
Url: ${yi(e)}`),!0}return!1}function wT(e,t){return t!=null&&t.length?Fm(e).some(n=>ct(n,t)):!1}function kT(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?ct(n,t):!1}function RT(e,t){if(!(t!=null&&t.length))return!1;const n=yi(e);return n?ct(n,t):!1}function AT(e,t){if(!(t!=null&&t.length))return!0;const n=yi(e);return n?ct(n,t):!0}function CT(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function yi(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(s=>{var i,a,c;return((i=s.mechanism)==null?void 0:i.parent_id)===void 0&&((c=(a=s.stacktrace)==null?void 0:a.frames)==null?void 0:c.length)}),o=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return o?CT(o):null}catch{return M&&_.error(`Cannot extract url for event ${Ln(e)}`),null}}function NT(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function Km(e,t,n,r,o,s){var a;if(!((a=o.exception)!=null&&a.values)||!s||!Yn(s.originalException,Error))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=xc(e,t,r,s.originalException,n,o.exception.values,i,0))}function xc(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Yn(r[o],Error)){Vd(i,a,r);const u=e(t,r[o]),d=c.length;Yd(u,o,d,a),c=xc(e,t,n,r[o],o,[u,...c],u,d)}return Jm(r)&&r.errors.forEach((u,d)=>{if(Yn(u,Error)){Vd(i,a,r);const l=e(t,u),f=c.length;Yd(l,`errors[${d}]`,f,a),c=xc(e,t,n,u,o,[l,...c],l,f)}}),c}function Jm(e){return Array.isArray(e.errors)}function Vd(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Jm(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Yd(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function xT(e,t){return e(t.stack||"",1)}function MT(e){return Rt(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Mc(e){return MT(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function OT(e,t){const n={type:t.name||t.constructor.name,value:Mc(t)},r=xT(e,t);return r.length&&(n.stacktrace={frames:r}),n}const PT="cause",LT=5,DT="LinkedErrors",FT=((e={})=>{const t=e.limit||LT,n=e.key||PT;return{name:DT,preprocessEvent(r,o,s){const i=s.getOptions();Km(OT,i.stackParser,n,t,r,o)}}}),$T=FT,Xm=new Map,Kd=new Set;function BT(e){if(H._sentryModuleMetadata)for(const t of Object.keys(H._sentryModuleMetadata)){const n=H._sentryModuleMetadata[t];if(Kd.has(t))continue;Kd.add(t);const r=e(t);for(const o of r.reverse())if(o.filename){Xm.set(o.filename,n);break}}}function UT(e,t){return BT(e),Xm.get(t)}function Qm(e,t){var n,r;(r=(n=t.exception)==null?void 0:n.values)==null||r.forEach(o=>{var s,i;(i=(s=o.stacktrace)==null?void 0:s.frames)==null||i.forEach(a=>{if(!a.filename||a.module_metadata)return;const c=UT(e,a.filename);c&&(a.module_metadata=c)})})}function Zm(e){var t,n;(n=(t=e.exception)==null?void 0:t.values)==null||n.forEach(r=>{var o,s;(s=(o=r.stacktrace)==null?void 0:o.frames)==null||s.forEach(i=>{delete i.module_metadata})})}const HT=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",t=>{Xn(t,(n,r)=>{if(r==="event"){const o=Array.isArray(n)?n[1]:void 0;o&&(Zm(o),n[1]=o)}})}),e.on("applyFrameMetadata",t=>{if(t.type)return;const n=e.getOptions().stackParser;Qm(n,t)})}}),Jd=new Set([]);function Wu(e){const t="console",n=Tn(t,e);return In(t,WT),n}function WT(){"console"in H&&pu.forEach(function(e){e in H.console&&De(H.console,e,function(t){return ai[e]=t,function(...n){const r=n[0],o=ai[e],s=Jd.size&&typeof r=="string"&&ct(r,Jd);s||at("console",{args:n,level:e}),(!s||M&&_.isEnabled())&&(o==null||o.apply(H.console,n))}})})}function Do(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const jT="CaptureConsole",zT=((e={})=>{const t=e.levels||pu,n=e.handled??!0;return{name:jT,setup(r){"console"in H&&Wu(({args:o,level:s})=>{N()!==r||!t.includes(s)||GT(o,s,n)})}}}),qT=zT;function GT(e,t,n){const r=Do(t),o=new Error,s={level:Do(t),extra:{arguments:e}};Ge(i=>{if(i.addEventProcessor(u=>(u.logger="console",At(u,{handled:n,type:"auto.core.capture_console"}),u)),t==="assert"){if(!e[0]){const u=`Assertion failed: ${ci(e.slice(1)," ")||"console.assert"}`;i.setExtra("arguments",e.slice(1)),i.captureMessage(u,r,{captureContext:s,syntheticException:o})}return}const a=e.find(u=>u instanceof Error);if(a){pe(a,s);return}const c=ci(e," ");i.captureMessage(c,r,{captureContext:s,syntheticException:o})})}const VT="Dedupe",YT=(()=>{let e;return{name:VT,processEvent(t){if(t.type)return t;try{if(KT(t,e))return M&&_.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),ju=YT;function KT(e,t){return t?!!(JT(e,t)||XT(e,t)):!1}function JT(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!tg(e,t)||!eg(e,t))}function XT(e,t){const n=Xd(t),r=Xd(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!tg(e,t)||!eg(e,t))}function eg(e,t){let n=gc(e),r=gc(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const s=r[o],i=n[o];if(s.filename!==i.filename||s.lineno!==i.lineno||s.colno!==i.colno||s.function!==i.function)return!1}return!0}function tg(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 Xd(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const QT="ExtraErrorData",ZT=((e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:QT,processEvent(r,o,s){const{maxValueLength:i}=s.getOptions();return t0(r,o,t,n,i)}}}),e0=ZT;function t0(e,t={},n,r,o){if(!t.originalException||!Rt(t.originalException))return e;const s=t.originalException.name||t.originalException.constructor.name,i=ng(t.originalException,r,o);if(i){const a={...e.contexts},c=Ae(i,n);return je(c)&&(Qb(c),a[s]=c),{...e,contexts:a}}return e}function ng(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],o={};for(const s of Object.keys(e)){if(r.indexOf(s)!==-1)continue;const i=e[s];o[s]=Rt(i)||typeof i=="string"?n?No(`${i}`,n):`${i}`:i}if(t&&e.cause!==void 0)if(Rt(e.cause)){const s=e.cause.name||e.cause.constructor.name;o.cause={[s]:ng(e.cause,!1,n)}}else o.cause=e.cause;if(typeof e.toJSON=="function"){const s=e.toJSON();for(const i of Object.keys(s)){const a=s[i];o[i]=Rt(a)?a.toString():a}}return o}catch(r){M&&_.error("Unable to extract extra data from the Error object:",r)}return null}function n0(e,t){let n=0;for(let r=e.length-1;r>=0;r--){const o=e[r];o==="."?e.splice(r,1):o===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}const r0=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function o0(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=r0.exec(t);return n?n.slice(1):[]}function Qd(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const o=r>=0?e[r]:"/";o&&(t=`${o}/${t}`,n=o.charAt(0)==="/")}return t=n0(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Zd(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 s0(e,t){e=Qd(e).slice(1),t=Qd(t).slice(1);const n=Zd(e.split("/")),r=Zd(t.split("/")),o=Math.min(n.length,r.length);let s=o;for(let a=0;a<o;a++)if(n[a]!==r[a]){s=a;break}let i=[];for(let a=s;a<n.length;a++)i.push("..");return i=i.concat(r.slice(s)),i.join("/")}function i0(e,t){return o0(e)[2]||""}const a0="RewriteFrames",rg=(e={})=>{const t=e.root,n=e.prefix||"app:///",r="window"in H&&!!H.window,o=e.iteratee||c0({isBrowser:r,root:t,prefix:n});function s(a){try{return{...a,exception:{...a.exception,values:a.exception.values.map(c=>({...c,...c.stacktrace&&{stacktrace:i(c.stacktrace)}}))}}}catch{return a}}function i(a){var c;return{...a,frames:(c=a==null?void 0:a.frames)==null?void 0:c.map(u=>o(u))}}return{name:a0,processEvent(a){let c=a;return a.exception&&Array.isArray(a.exception.values)&&(c=s(c)),c}}};function c0({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;const o=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),s=/^\//.test(r.filename);if(e){if(t){const i=r.filename;i.indexOf(t)===0&&(r.filename=i.replace(t,n))}}else if(o||s){const i=o?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?s0(t,i):i0(i);r.filename=`${n}${a}`}return r}}const u0=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],l0=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],d0={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"},og=["select","insert","upsert","update","delete"];function na(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function ra(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function sg(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function f0(e,t){return sg(e,t)!==void 0}function p0(e,t={}){var n;switch(e){case"GET":return"select";case"POST":return(n=t.Prefer)!=null&&n.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function h0(e,t){if(t===""||t==="*")return"select(*)";if(e==="select")return`select(${t})`;if(e==="or"||e.endsWith(".or"))return`${e}${t}`;const[n,...r]=t.split(".");let o;return n!=null&&n.startsWith("fts")?o="textSearch":n!=null&&n.startsWith("plfts")?o="textSearch[plain]":n!=null&&n.startsWith("phfts")?o="textSearch[phrase]":n!=null&&n.startsWith("wfts")?o="textSearch[websearch]":o=n&&d0[n]||"filter",`${o}(${e}, ${r.join(".")})`}function ef(e,t=!1){return new Proxy(e,{apply(n,r,o){return Et({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[Y]:"auto.db.supabase",[ce]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},s=>Reflect.apply(n,r,o).then(i=>(i&&typeof i=="object"&&"error"in i&&i.error?(s.setStatus({code:re}),pe(i.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):s.setStatus({code:Jo}),s.end(),i)).catch(i=>{throw s.setStatus({code:re}),s.end(),pe(i,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),i}).then(...o))}})}function m0(e){const t=e.auth;if(!(!t||ra(e.auth))){for(const n of u0){const r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=ef(r))}for(const n of l0){const r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=ef(r,!0))}na(e.auth)}}function g0(e,t){ra(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(n,r,o){const s=Reflect.apply(n,r,o),i=s.constructor;return y0(i,t),s}}),na(e.prototype.from))}function _0(e,t){ra(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(n,r,o){var E;const s=og,i=r,a=p0(i.method,i.headers);if(!s.includes(a)||!((E=i==null?void 0:i.url)!=null&&E.pathname)||typeof i.url.pathname!="string")return Reflect.apply(n,r,o);const c=i.url.pathname.split("/"),u=c.length>0?c[c.length-1]:"",d=[];for(const[x,w]of i.url.searchParams.entries())d.push(h0(x,w));const l=Object.create(null);if(je(i.body))for(const[x,w]of Object.entries(i.body))l[x]=w;const f=N(),p=t.sendOperationData??(f==null?void 0:f.getDataCollectionOptions().userInfo)===!0,h=sg(i.body,l),m=a==="select"?"":`${a}${f0(i.body,l)?"(...) ":""}`,g=p?d.join(" "):d.length>0?"[redacted]":"",y=[m.trimEnd(),g].filter(Boolean).join(" "),S=y?`${y} from(${u})`:`from(${u})`,k={"db.table":u,"db.schema":i.schema,"db.url":i.url.origin,"db.sdk":i.headers["X-Client-Info"],"db.system":"postgresql","db.operation":a,[Y]:"auto.db.supabase",[ce]:"db"};return d.length&&p&&(k["db.query"]=d),h!==void 0&&p&&(k["db.body"]=h),Et({name:S,attributes:k},x=>Reflect.apply(n,r,[]).then(w=>{if(x&&(w&&typeof w=="object"&&"status"in w&&Mo(x,w.status||500),x.end()),w!=null&&w.error){const B=new Error(w.error.message);w.error.code&&(B.code=w.error.code),w.error.details&&(B.details=w.error.details);const v={};d.length&&p&&(v.query=d),h!==void 0&&p&&(v.body=h),pe(B,P=>(P.addEventProcessor(R=>(At(R,{handled:!1,type:"auto.db.supabase.postgres"}),R)),P.setContext("supabase",v),P))}const b={type:"supabase",category:`db.${a}`,message:S},I={};return d.length&&p&&(I.query=d),h!==void 0&&p&&(I.body=h),Object.keys(I).length&&(b.data=I),ut(b),w},w=>{throw x&&(Mo(x,500),x.end()),w}).then(...o))}}),na(e.prototype.then))}function y0(e,t){for(const n of og)ra(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(r,o,s){const i=Reflect.apply(r,o,s),a=i.constructor;return M&&_.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),_0(a,t),i}}),na(e.prototype[n]))}const ig=(e,t={})=>{if(!e){M&&_.warn("Supabase integration was not installed because no Supabase client was provided.");return}const n=e.constructor===Function?e:e.constructor;g0(n,t),m0(e)},b0="Supabase",S0=((e,t)=>({setupOnce(){ig(e,t)},name:b0})),v0=e=>S0(e.supabaseClient,{sendOperationData:e.sendOperationData}),E0=10,T0="ZodErrors";function I0(e){return Rt(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function w0(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 k0(e){return e.map(t=>typeof t=="number"?"<array>":t).join(".")}function R0(e){const t=new Set;for(const r of e.issues){const o=k0(r.path);o.length>0&&t.add(o)}const n=Array.from(t);if(n.length===0){let r="variable";if(e.issues.length>0){const o=e.issues[0];o!==void 0&&"expected"in o&&typeof o.expected=="string"&&(r=o.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${No(n.join(", "),100)}`}function A0(e,t=!1,n,r){var o;if(!((o=n.exception)!=null&&o.values)||!r.originalException||!I0(r.originalException)||r.originalException.issues.length===0)return n;try{const i=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(w0);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:R0(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":i.slice(0,e)}}}catch(s){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:s instanceof Error?`${s.name}: ${s.message}
${s.stack}`:"unknown"}}}}}const C0=((e={})=>{const t=e.limit??E0;return{name:T0,processEvent(n,r){return A0(t,e.saveZodIssuesAsAttachment,n,r)}}}),N0=C0,x0=e=>({name:"ThirdPartyErrorsFilter",setup(t){t.on("beforeEnvelope",n=>{Xn(n,(r,o)=>{if(o==="event"){const s=Array.isArray(r)?r[1]:void 0;s&&(Zm(s),r[1]=s)}})}),t.on("applyFrameMetadata",n=>{if(n.type)return;const r=t.getOptions().stackParser;Qm(r,n)})},preprocessEvent(t){e.ignoreSentryInternalFrames&&(H._sentryWrappedDepth??0)>0&&(t.sdkProcessingMetadata={...t.sdkProcessingMetadata,insideSentryWrapped:!0})},processEvent(t){var o,s,i;const n=e.ignoreSentryInternalFrames?((o=t.sdkProcessingMetadata)==null?void 0:o.insideSentryWrapped)===!0&&((i=(s=t.exception)==null?void 0:s.values)==null?void 0:i.length)===1:!1,r=O0(t,e.ignoreSentryInternalFrames,n);if(r){const a=e.behaviour==="drop-error-if-contains-third-party-frames"||e.behaviour==="apply-tag-if-contains-third-party-frames"?"some":"every";if(r[a](u=>!u.some(d=>e.filterKeys.includes(d)))){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 M0(e,t,n){var r;if(t!==0)return!1;if(n&&P0(e)||e.function==="sentryWrapped")return!0;if(!e.context_line||!e.filename||!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(D0))return!1;if(e.pre_context){const o=e.pre_context.length;for(let s=0;s<o;s++)if((r=e.pre_context[s])!=null&&r.includes(L0))return!0}return!1}function O0(e,t,n){const r=gc(e);if(r)return r.filter((o,s)=>!o.filename||o.lineno==null&&o.colno==null&&o.instruction_addr==null?!1:!t||!M0(o,s,!!n)).map(o=>o.module_metadata?Object.keys(o.module_metadata).filter(s=>s.startsWith(tf)).map(s=>s.slice(tf.length)):[])}function P0(e){return!e.context_line&&!e.pre_context&&!!e.function&&e.function.length<=2}const tf="_sentryBundlerPluginAppKey:",L0="Attempt to invoke user-land function",D0="fn.apply(this, wrappedArguments)",F0=100,$0=10,ws="flag.evaluation.";function no(e){if(e.type)return e;const n=j().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function Qn(e,t,n=F0){const r=j().getScopeData().contexts;r.flags||(r.flags={values:[]});const o=r.flags.values;B0(o,e,t,n)}function B0(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){M&&_.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}const o=e.findIndex(s=>s.flag===t);o!==-1&&e.splice(o,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function Zn(e,t,n=$0){if(typeof t!="boolean")return;const r=Te();if(!r)return;const o=U(r).data;if(`${ws}${e}`in o){r.setAttribute(`${ws}${e}`,t);return}Object.keys(o).filter(i=>i.startsWith(ws)).length<n&&r.setAttribute(`${ws}${e}`,t)}const U0=()=>({name:"FeatureFlags",processEvent(e,t,n){return no(e)},addFeatureFlag(e,t){Qn(e,t),Zn(e,t)}}),H0=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){const t=e.prototype;typeof t.isOn=="function"&&De(t,"isOn",nf),typeof t.getFeatureValue=="function"&&De(t,"getFeatureValue",nf)},processEvent(t,n,r){return no(t)}});function nf(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(Qn(n,r),Zn(n,r)),r}}const W0="ConversationId",j0=(()=>({name:W0,setup(e){e.on("spanStart",t=>{const n=j().getScopeData(),r=he().getScopeData(),o=n.conversationId||r.conversationId;if(o){const{op:s,data:i,description:a}=U(t);if(!(s!=null&&s.startsWith("gen_ai."))&&!i["ai.operationId"]&&!(a!=null&&a.startsWith("ai.")))return;t.setAttribute(HS,o)}})}})),z0=j0;function q0(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=Je()&&t(i);if(e.endTimestamp){const h=e.fetchData.__span;if(!h)return;const m=r[h];m&&(a&&(Y0(m,e),G0(m,e,o)),delete r[h]);return}const{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},d=N(),f=!!Te()||!!d&&ft(d),p=a&&f?qe(X0(i,s,c)):new Jn;if(a&&!f&&(d==null||d.recordDroppedEvent("no_parent_span","span")),e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){const h=e.args[0],m={...e.args[1]||{}},g=V0(h,m,Je()&&f?p:void 0,u);g&&(e.args[1]=m,m.headers=g)}if(d){const h={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};d.emit("beforeOutgoingRequestSpan",p,h)}return p}function G0(e,t,n){var o;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(o=t.response)==null?void 0:o.headers,error:t.error})}function V0(e,t,n,r){const o=Bu({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const c=t.headers||(gu(e)?e.headers:void 0);if(c)if(K0(c)){const u=new Headers(c);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),i){const d=u.get("baggage");d?ks(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(J0(c)){const u=[...c];u.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&a&&!u.find(l=>l[0]==="traceparent")&&u.push(["traceparent",a]);const d=c.find(l=>l[0]==="baggage"&&typeof l[1]=="string"&&ks(l[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in c?c["sentry-trace"]:void 0,d="traceparent"in c?c.traceparent:void 0,l="baggage"in c?c.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(m=>ks(m)):ks(l));i&&!p&&f.push(i);const h=Object.assign({},c,{"sentry-trace":u??s,baggage:f.length>0?f.join(","):void 0});return r&&a&&!d&&(h.traceparent=a),h}else return{...o}}function Y0(e,t){var n,r;if(t.response){Mo(e,t.response.status);const o=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(o){const s=parseInt(o);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:re,message:"internal_error"});e.end()}function ks(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(ui))}function K0(e){return typeof Headers<"u"&&Yn(e,Headers)}function J0(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function X0(e,t,n){if(e.startsWith("data:")){const s=Nt(e);return{name:`${t} ${s}`,attributes:rf(e,void 0,t,n)}}const r=ta(e),o=r?jm(r):e;return{name:`${t} ${o}`,attributes:rf(e,r,t,n)}}function rf(e,t,n,r){const o={url:Nt(e),type:"fetch","http.method":n,[Y]:r,[ce]:"http.client"};return t&&($u(t)||(o["http.url"]=Nt(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function ag(e,t={},n=j()){const{message:r,name:o,email:s,url:i,source:a,associatedEventId:c,tags:u}=e,d={contexts:{feedback:{contact_email:s,name:o,message:r,url:i,source:a,associated_event_id:c}},type:"feedback",level:"info",tags:u},l=(n==null?void 0:n.getClient())||N();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function ro(e,t,n,r,o){gi({level:e,message:t,attributes:n,severityNumber:o},r)}function Q0(e,t,{scope:n}={}){ro("trace",e,t,n)}function Z0(e,t,{scope:n}={}){ro("debug",e,t,n)}function eI(e,t,{scope:n}={}){ro("info",e,t,n)}function tI(e,t,{scope:n}={}){ro("warn",e,t,n)}function nI(e,t,{scope:n}={}){ro("error",e,t,n)}function rI(e,t,{scope:n}={}){ro("fatal",e,t,n)}const cg=Object.freeze(Object.defineProperty({__proto__:null,debug:Z0,error:nI,fatal:rI,fmt:hT,info:eI,trace:Q0,warn:tI},Symbol.toStringTag,{value:"Module"}));function bi(e,t,n){return"util"in H&&typeof H.util.format=="function"?H.util.format(...e):oI(e,t,n)}function oI(e,t,n){return e.map(r=>Ot(r)?String(r):JSON.stringify(Ae(r,t,n))).join(" ")}function ug(e){return/%[sdifocO]/.test(e)}function lg(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((o,s)=>{n[`sentry.message.parameter.${s}`]=o}),n}const sI="ConsoleLogs",of={[Y]:"auto.log.console"},iI=((e={})=>{const t=e.levels||pu;return{name:sI,setup(n){const{enableLogs:r,normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=n.getOptions();if(!r){M&&_.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}const i=Wu(({args:a,level:c})=>{if(N()!==n||!t.includes(c))return;const u=a[0],d=a.slice(1);if(c==="assert"){if(!u){const p=d.length>0?`Assertion failed: ${bi(d,o,s)}`:"Assertion failed";gi({level:"error",message:p,attributes:of})}return}const l=c==="log",f={...of};if(je(u)){Object.assign(f,Ae(u,o,s));const p=typeof a[1]=="string"?2:1;a.slice(p).forEach((m,g)=>{f[`sentry.message.parameter.${g}`]=Ae(m,o,s)})}else if(d.length>0&&typeof u=="string"&&!ug(u)){const h=lg(u,d);for(const[m,g]of Object.entries(h))f[m]=m.startsWith("sentry.message.parameter.")?Ae(g,o,s):g}gi({level:l?"info":c,message:bi(a,o,s),severityNumber:l?10:void 0,attributes:f})});n.registerCleanup(i)}}}),aI=iI;function zu(e,t,n,r){BE({type:e,name:t,value:n,unit:r==null?void 0:r.unit,attributes:r==null?void 0:r.attributes},{scope:r==null?void 0:r.scope})}function cI(e,t=1,n){zu("counter",e,t,n)}function uI(e,t,n){zu("gauge",e,t,n)}function Oc(e,t,n){zu("distribution",e,t,n)}const dg=Object.freeze(Object.defineProperty({__proto__:null,count:cI,distribution:Oc,gauge:uI},Symbol.toStringTag,{value:"Module"})),lI=["trace","debug","info","warn","error","fatal"];function dI(e={}){const t=new Set(e.levels??lI),n=e.client;return{log(r){const{type:o,level:s,message:i,args:a,tag:c,date:u,...d}=r,l=n||N();if(!l)return;const f=hI(o,s);if(!t.has(f))return;const{normalizeDepth:p=3,normalizeMaxBreadth:h=1e3}=l.getOptions(),m={};for(const[y,S]of Object.entries(d))m[y]=Ae(S,p,h);m["sentry.origin"]="auto.log.consola",c&&(m["consola.tag"]=c),o&&(m["consola.type"]=o),s!=null&&typeof s=="number"&&(m["consola.level"]=s);const g=gI(mI(a,p,h),p,h);g!=null&&g.attributes&&Object.assign(m,g.attributes),gi({level:f,message:(g==null?void 0:g.message)||i||a&&bi(a,p,h)||"",attributes:m})}}}const fI={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"},pI={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function hI(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){const n=fI[e];if(n)return n}if(typeof t=="number"){const n=pI[t];if(n)return n}return"info"}function mI(e,t,n){if(!(e!=null&&e.length))return{message:""};const r=bi(e,t,n),o=e[0];if(je(o)){const s=typeof e[1]=="string"?2:1,i=e.slice(s);return{message:r,attributes:o,messageParameters:i}}else{const s=e.slice(1),i=s.length>0&&typeof o=="string"&&!ug(o);return{message:r,messageTemplate:i?o:void 0,messageParameters:i?s:void 0}}}function gI(e,t,n){const{message:r,attributes:o,messageTemplate:s,messageParameters:i}=e,a={};if(s&&i){const c=lg(s,i);for(const[u,d]of Object.entries(c))a[u]=u.startsWith("sentry.message.parameter.")?Ae(d,t,n):d}else i&&i.length>0&&i.forEach((c,u)=>{a[`sentry.message.parameter.${u}`]=Ae(c,t,n)});return{message:r,attributes:{...Ae(o,t,n),...a}}}const _I="gen_ai.prompt",ts="gen_ai.system",$e="gen_ai.request.model",qu="gen_ai.request.stream",oa="gen_ai.request.temperature",Gu="gen_ai.request.max_tokens",sa="gen_ai.request.frequency_penalty",Vu="gen_ai.request.presence_penalty",ia="gen_ai.request.top_p",fg="gen_ai.request.top_k",pg="gen_ai.request.encoding_format",hg="gen_ai.request.dimensions",Cr="gen_ai.response.finish_reasons",oo="gen_ai.response.model",aa="gen_ai.response.id",yI="gen_ai.response.stop_reason",er="gen_ai.usage.input_tokens",tr="gen_ai.usage.output_tokens",bn="gen_ai.usage.total_tokens",_t="gen_ai.operation.name",nr="sentry.sdk_meta.gen_ai.input.messages.original_length",so="gen_ai.input.messages",ns="gen_ai.system_instructions",xt="gen_ai.response.text",rs="gen_ai.request.available_tools",bI="gen_ai.response.streaming",ln="gen_ai.response.tool_calls",ca="gen_ai.agent.name",SI="gen_ai.pipeline.name",Yu="gen_ai.conversation.id",vI="gen_ai.usage.cache_creation_input_tokens",EI="gen_ai.usage.cache_read_input_tokens",TI="gen_ai.invoke_agent",Ku="gen_ai.embeddings.input",mg="gen_ai.embeddings",sf="gen_ai.execute_tool",gg="gen_ai.tool.name",II="gen_ai.tool.call.id",wI="gen_ai.tool.type",_g="gen_ai.tool.input",yg="gen_ai.tool.output",kI="gen_ai.tool.description";function Nr(e){return!e||typeof e!="object"?!1:AI(e)||Sg(e)||RI(e)||vg(e)||Eg(e)||CI(e)||NI(e)||xI(e)||MI(e)||OI(e)||PI(e)||LI(e)}function RI(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):bg(e):!1}function bg(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 AI(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&Nr(e.source)}function Sg(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function vg(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 Eg(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 CI(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function NI(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 xI(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function MI(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function OI(e){return"b64_json"in e}function PI(e){return"type"in e&&"result"in e&&e.type==="image_generation"}function LI(e){return"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}const ho="[Blob substitute]",DI=["image_url","data","content","b64_json","result","uri","image"];function Io(e){const t={...e};Nr(t.source)&&(t.source=Io(t.source)),Sg(e)&&(t.inlineData={...e.inlineData,data:ho}),bg(e)&&(t.image_url={...e.image_url,url:ho}),vg(e)&&(t.input_audio={...e.input_audio,data:ho}),Eg(e)&&(t.file={...e.file,file_data:ho});for(const n of DI)typeof t[n]=="string"&&(t[n]=ho);return t}const Tg=2e4,Si=e=>new TextEncoder().encode(e).length,Ju=e=>Si(JSON.stringify(e));function ua(e,t){if(Si(e)<=t)return e;let n=0,r=e.length,o="";for(;n<=r;){const s=Math.floor((n+r)/2),i=e.slice(0,s);Si(i)<=t?(o=i,n=s+1):r=s-1}return o}function FI(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function af(e,t){return typeof e=="string"?t:{...e,text:t}}function $I(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function Ig(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function wg(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function BI(e,t){const n={...e,content:""},r=Ju(n),o=t-r;if(o<=0)return[];const s=ua(e.content,o);return[{...e,content:s}]}function UI(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 HI(e,t){const{key:n,items:r}=UI(e);if(n===null||r.length===0)return[];const o=r.map(c=>af(c,"")),s=Ju({...e,[n]:o});let i=t-s;if(i<=0)return[];const a=[];for(const c of r){const u=FI(c),d=Si(u);if(d<=i)a.push(c),i-=d;else if(a.length===0){const l=ua(u,i);l&&a.push(af(c,l));break}else break}return a.length<=0?[]:[{...e,[n]:a}]}function WI(e,t){if(!e)return[];if(typeof e=="string"){const n=ua(e,t);return n?[n]:[]}return typeof e!="object"?[]:$I(e)?BI(e,t):Ig(e)||wg(e)?HI(e,t):[]}function Pc(e){return e.map(n=>{let r;return n&&typeof n=="object"&&(Ig(n)?r={...n,content:Pc(n.content)}:"content"in n&&Nr(n.content)&&(r={...n,content:Io(n.content)}),wg(n)&&(r={...r??n,parts:Pc(n.parts)}),Nr(r)?r=Io(r):Nr(n)&&(r=Io(n))),r??n})}function jI(e,t){if(!Array.isArray(e)||e.length===0)return e;const n=t-2,r=e[e.length-1],o=Pc([r]),s=o[0];return Ju(s)<=n?o:WI(s,n)}function zI(e){return jI(e,Tg)}function qI(e){return ua(e,Tg)}function sr(e){var n;const t=(n=N())==null?void 0:n.getDataCollectionOptions().genAI;return{...e,recordInputs:(e==null?void 0:e.recordInputs)??(t==null?void 0:t.inputs)??!1,recordOutputs:(e==null?void 0:e.recordOutputs)??(t==null?void 0:t.outputs)??!1}}function Qt(e){if(e!==void 0)return e;const t=N();return t?!ft(t)&&!t.getOptions().streamGenAiSpans:!0}function Xu(e,t){return e?`${e}.${t}`:t}function GI(e,t,n,r,o){if(t!==void 0&&e.setAttributes({[er]:t}),n!==void 0&&e.setAttributes({[tr]:n}),t!==void 0||n!==void 0||r!==void 0||o!==void 0){const s=(t??0)+(n??0)+(r??0)+(o??0);e.setAttributes({[bn]:s})}}function la(e,t,n){if(!e.isRecording())return;const r={[bI]:!0};t.responseId&&(r[aa]=t.responseId),t.responseModel&&(r[oo]=t.responseModel),t.promptTokens!==void 0&&(r[er]=t.promptTokens),t.completionTokens!==void 0&&(r[tr]=t.completionTokens),t.totalTokens!==void 0?r[bn]=t.totalTokens:(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[bn]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(r[Cr]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[xt]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[ln]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function io(e){return typeof e=="string"?e:JSON.stringify(e)}function ao(e){if(typeof e=="string")return qI(e);if(Array.isArray(e)){const t=zI(e);return JSON.stringify(t)}return JSON.stringify(e)}function os(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};const t=e.findIndex(i=>i&&typeof i=="object"&&"role"in i&&i.role==="system");if(t===-1)return{systemInstructions:void 0,filteredMessages:e};const n=e[t],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:e};const o=JSON.stringify([{type:"text",content:r}]),s=[...e.slice(0,t),...e.slice(t+1)];return{systemInstructions:o,filteredMessages:s}}async function VI(e,t,n){const r=e.catch(i=>{throw pe(i,{mechanism:{handled:!1,type:n}}),i}),o=await t,s=await r;return s&&typeof s=="object"&&"data"in s?{...s,data:o}:o}function vi(e,t,n){return wn(e)?new Proxy(e,{get(r,o){const i=o in Promise.prototype||o===Symbol.toStringTag?t:r,a=Reflect.get(i,o);return o==="withResponse"&&typeof a=="function"?function(){const u=a.call(r);return VI(u,t,n)}:typeof a=="function"?a.bind(i):a}}):t}const YI={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},KI=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],JI=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...KI];function XI(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function QI(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function ZI(e,t,n){if(!t||typeof t!="object")return;const r=t,o={};if(typeof r.id=="string"&&(o[aa]=r.id),typeof r.model=="string"&&(o[oo]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(o[Yu]=r.id),r.usage&&typeof r.usage=="object"){const s=r.usage,i=s.prompt_tokens??s.input_tokens;typeof i=="number"&&(o[er]=i);const a=s.completion_tokens??s.output_tokens;typeof a=="number"&&(o[tr]=a),typeof s.total_tokens=="number"&&(o[bn]=s.total_tokens)}if(Array.isArray(r.choices)){const s=r.choices,i=s.map(a=>a.finish_reason).filter(a=>typeof a=="string");if(i.length>0&&(o[Cr]=JSON.stringify(i)),n){const a=s.map(u=>{const d=u.message;return(d==null?void 0:d.content)||""});o[xt]=JSON.stringify(a);const c=s.map(u=>{const d=u.message;return d==null?void 0:d.tool_calls}).filter(u=>Array.isArray(u)&&u.length>0).flat();c.length>0&&(o[ln]=JSON.stringify(c))}}if(typeof r.status=="string"&&(o[Cr]||(o[Cr]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!o[xt]&&(o[xt]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!o[ln])){const s=r.output.filter(i=>(i==null?void 0:i.type)==="function_call");s.length>0&&(o[ln]=JSON.stringify(s))}e.setAttributes(o)}function ew(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 tw(e){const t={[$e]:e.model??"unknown"};"temperature"in e&&(t[oa]=e.temperature),"top_p"in e&&(t[ia]=e.top_p),"frequency_penalty"in e&&(t[sa]=e.frequency_penalty),"presence_penalty"in e&&(t[Vu]=e.presence_penalty),"stream"in e&&(t[qu]=e.stream),"encoding_format"in e&&(t[pg]=e.encoding_format),"dimensions"in e&&(t[hg]=e.dimensions);const n=ew(e);return n&&(t[Yu]=n),t}function nw(e,t){for(const n of e){const r=n.index;if(!(r===void 0||!n.function))if(!(r in t.chatCompletionToolCalls))t.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{const o=t.chatCompletionToolCalls[r];n.function.arguments&&(o!=null&&o.function)&&(o.function.arguments+=n.function.arguments)}}}function rw(e,t,n){var r,o;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(const s of e.choices??[])n&&((r=s.delta)!=null&&r.content&&t.responseTexts.push(s.delta.content),(o=s.delta)!=null&&o.tool_calls&&nw(s.delta.tool_calls,t)),s.finish_reason&&t.finishReasons.push(s.finish_reason)}function ow(e,t,n,r){if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){r.setStatus({code:re,message:"internal_error"}),pe(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;const o=e;if(!JI.includes(o.type)){t.eventTypes.push(o.type);return}if(n&&(o.type==="response.output_item.done"&&"item"in o&&t.responsesApiToolCalls.push(o.item),o.type==="response.output_text.delta"&&"delta"in o&&o.delta)){t.responseTexts.push(o.delta);return}if("response"in o){const{response:s}=o;t.responseId=s.id??t.responseId,t.responseModel=s.model??t.responseModel,s.usage&&(t.promptTokens=s.usage.input_tokens,t.completionTokens=s.usage.output_tokens,t.totalTokens=s.usage.total_tokens),s.status&&t.finishReasons.push(s.status),n&&s.output_text&&t.responseTexts.push(s.output_text)}}async function*sw(e,t,n){const r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(const o of e)QI(o)?rw(o,r,n):XI(o)&&ow(o,r,n,t),yield o}finally{const o=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];la(t,{...r,toolCalls:o},n)}}function iw(e){const t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[{type:"web_search_options",...e.web_search_options}]:[],o=[...t,...r];if(o.length!==0)try{return JSON.stringify(o)}catch(s){M&&_.error("Failed to serialize OpenAI tools:",s);return}}function aw(e,t){const n={[ts]:"openai",[_t]:t,[Y]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const r=e[0],o=iw(r);o&&(n[rs]=o),Object.assign(n,tw(r))}else n[$e]="unknown";return n}function cf(e,t,n,r){if(n==="embeddings"&&"input"in t){const a=t.input;if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;e.setAttribute(Ku,typeof a=="string"?a:JSON.stringify(a));return}const o="input"in t?t.input:"messages"in t?t.messages:void 0;if(!o||Array.isArray(o)&&o.length===0)return;const{systemInstructions:s,filteredMessages:i}=os(o);s&&e.setAttribute(ns,s),e.setAttribute(so,r?ao(i):io(i)),Array.isArray(i)?e.setAttribute(nr,i.length):e.setAttribute(nr,1)}function cw(e,t,n,r,o){return function(...i){const a=n.operation||"unknown",c=aw(i,a),u=c[$e]||"unknown",d=i[0],l=d&&typeof d=="object"&&d.stream===!0,f={name:`${a} ${u}`,op:`gen_ai.${a}`,attributes:c};if(l){let m;const g=wt(f,y=>(m=e.apply(r,i),o.recordInputs&&d&&cf(y,d,a,Qt(o.enableTruncation)),(async()=>{try{const S=await m;return sw(S,y,o.recordOutputs??!1)}catch(S){throw y.setStatus({code:re,message:"internal_error"}),pe(S,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),y.end(),S}})()));return vi(m,g,"auto.ai.openai")}let p;const h=Et(f,m=>(p=e.apply(r,i),o.recordInputs&&d&&cf(m,d,a,Qt(o.enableTruncation)),p.then(g=>(ZI(m,g,o.recordOutputs),g),g=>{throw pe(g,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),g})));return vi(p,h,"auto.ai.openai")}}function kg(e,t="",n){return new Proxy(e,{get(r,o){const s=r[o],i=Xu(t,String(o)),a=YI[i];return typeof s=="function"&&a?cw(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?kg(s,i,n):s}})}function uw(e,t){return kg(e,"",sr(t))}const lw={"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 dw(e,t,n){if(Array.isArray(t)&&t.length===0)return;const{systemInstructions:r,filteredMessages:o}=os(t);r&&e.setAttributes({[ns]:r});const s=Array.isArray(o)?o.length:1;e.setAttributes({[so]:n?ao(o):io(o),[nr]:s})}const fw={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 Rg(e){return e&&fw[e]||"internal_error"}function pw(e,t){t.error&&(e.setStatus({code:re,message:Rg(t.error.type)}),pe(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function hw(e){const{system:t,messages:n,input:r}=e,o=typeof t=="string"?[{role:"system",content:e.system}]:[],s=Array.isArray(r)?r:r!=null?[r]:void 0,i=Array.isArray(n)?n:n!=null?[n]:[],a=s??i;return[...o,...a]}function mw(e,t){var n;return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:re,message:Rg((n=e.error)==null?void 0:n.type)}),pe(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function gw(e,t){if(e.type==="message_delta"&&e.usage&&"output_tokens"in e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),e.message){const n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),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 _w(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 yw(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"){const r=t.activeToolBlocks[e.index];r&&r.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text=="string"&&t.responseTexts.push(e.delta.text)}}function bw(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;const n=t.activeToolBlocks[e.index];if(!n)return;const r=n.inputJsonParts.join("");let o;try{o=r?JSON.parse(r):{}}catch{o={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:o}),delete t.activeToolBlocks[e.index]}function Ag(e,t,n,r){!(e&&typeof e=="object")||mw(e,r)||(gw(e,t),_w(e,t),yw(e,t,n),bw(e,t))}async function*Sw(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(const o of e)Ag(o,r,n,t),yield o}finally{la(t,r,n)}}function vw(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",o=>{Ag(o,r,n,t)}),e.on("message",()=>{la(t,r,n)}),e.on("error",o=>{pe(o,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:re,message:"internal_error"}),t.end())}),e}function Ew(e,t,n){const r={[ts]:"anthropic",[_t]:n,[Y]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){const o=e[0];o.tools&&Array.isArray(o.tools)&&(r[rs]=JSON.stringify(o.tools)),r[$e]=o.model??"unknown","temperature"in o&&(r[oa]=o.temperature),"top_p"in o&&(r[ia]=o.top_p),"stream"in o&&(r[qu]=o.stream),"top_k"in o&&(r[fg]=o.top_k),"frequency_penalty"in o&&(r[sa]=o.frequency_penalty),"max_tokens"in o&&(r[Gu]=o.max_tokens)}else t==="models.retrieve"||t==="models.get"?r[$e]=e[0]:r[$e]="unknown";return r}function Lc(e,t,n){const r=hw(t);dw(e,r,n),"prompt"in t&&e.setAttributes({[_I]:JSON.stringify(t.prompt)})}function Tw(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[xt]:t.content.map(r=>r.text).filter(r=>!!r).join("")});const n=[];for(const r of t.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&e.setAttributes({[ln]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[xt]:t.completion}),"input_tokens"in t&&e.setAttributes({[xt]:JSON.stringify(t.input_tokens)})}function Iw(e,t){"id"in t&&"model"in t&&(e.setAttributes({[aa]:t.id,[oo]:t.model}),"usage"in t&&t.usage&&GI(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function ww(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){pw(e,t);return}n&&Tw(e,t),Iw(e,t)}}function uf(e,t,n){throw pe(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:re,message:"internal_error"}),t.end()),e}function kw(e,t,n,r,o,s,i,a,c,u,d){const l=o[$e]??"unknown",f={name:`${s} ${l}`,op:`gen_ai.${s}`,attributes:o};if(u&&!d){let p;const h=wt(f,m=>(p=e.apply(n,r),c.recordInputs&&a&&Lc(m,a,Qt(c.enableTruncation)),(async()=>{try{const g=await p;return Sw(g,m,c.recordOutputs??!1)}catch(g){return uf(g,m,i)}})()));return vi(p,h,"auto.ai.anthropic")}else return wt(f,p=>{try{c.recordInputs&&a&&Lc(p,a,Qt(c.enableTruncation));const h=t.apply(n,r);return vw(h,p,c.recordOutputs??!1)}catch(h){return uf(h,p,i)}})}function Rw(e,t,n,r,o){return new Proxy(e,{apply(s,i,a){const c=n.operation||"unknown",u=Ew(a,t,c),d=u[$e]??"unknown",l=typeof a[0]=="object"?a[0]:void 0,f=!!(l!=null&&l.stream),p=n.streaming===!0;if(f||p)return kw(e,s,r,a,u,c,t,l,o,f,p);let h;const m=Et({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},g=>(h=s.apply(r,a),o.recordInputs&&l&&Lc(g,l,Qt(o.enableTruncation)),h.then(y=>(ww(g,y,o.recordOutputs),y),y=>{throw pe(y,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),y})));return vi(h,m,"auto.ai.anthropic")}})}function Cg(e,t="",n){return new Proxy(e,{get(r,o){const s=r[o],i=Xu(t,String(o)),a=lw[i];return typeof s=="function"&&a?Rw(s,i,a,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?Cg(s,i,n):s}})}function Aw(e,t){return Cg(e,"",sr(t))}const Cw={"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}},Nw="google_genai";function xw(e,t){const n=e==null?void 0:e.promptFeedback;if(n!=null&&n.blockReason){const r=n.blockReasonMessage??n.blockReason;return t.setStatus({code:re,message:"internal_error"}),pe(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function Mw(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);const 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 Ow(e,t,n){var r;Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(const o of e.candidates??[]){o!=null&&o.finishReason&&!t.finishReasons.includes(o.finishReason)&&t.finishReasons.push(o.finishReason);for(const s of((r=o==null?void 0:o.content)==null?void 0:r.parts)??[])n&&s.text&&t.responseTexts.push(s.text),s.functionCall&&t.toolCalls.push({type:"function",id:s.functionCall.id,name:s.functionCall.name,arguments:s.functionCall.args})}}function Pw(e,t,n,r){!e||xw(e,r)||(Mw(e,t),Ow(e,t,n))}async function*Lw(e,t,n){const r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(const o of e)Pw(o,r,n,t),yield o}finally{la(t,r,n)}}function bo(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>bo(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[{...e,role:t}]:[{role:t,content:e}]}function lf(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){const n=t;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function Dw(e){const t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[oa]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[ia]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[fg]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[Gu]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[sa]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[Vu]=e.presencePenalty),t}function Fw(e,t,n){const r={[ts]:Nw,[_t]:e,[Y]:"auto.ai.google_genai"};if(t){if(r[$e]=lf(t,n),"config"in t&&typeof t.config=="object"&&t.config){const o=t.config;if(Object.assign(r,Dw(o)),"tools"in o&&Array.isArray(o.tools)){const s=o.tools.flatMap(i=>i.functionDeclarations);r[rs]=JSON.stringify(s)}}}else r[$e]=lf({},n);return r}function df(e,t,n,r){if(n){const s=t.contents;s!=null&&e.setAttribute(Ku,typeof s=="string"?s:JSON.stringify(s));return}const o=[];if("config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&o.push(...bo(t.config.systemInstruction,"system")),"history"in t&&o.push(...bo(t.history,"user")),"contents"in t&&o.push(...bo(t.contents,"user")),"message"in t&&o.push(...bo(t.message,"user")),Array.isArray(o)&&o.length){const{systemInstructions:s,filteredMessages:i}=os(o);s&&e.setAttribute(ns,s);const a=Array.isArray(i)?i.length:0;e.setAttributes({[nr]:a,[so]:r?ao(i):io(i)})}}function $w(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(oo,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){const r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[er]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[tr]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&e.setAttributes({[bn]:r.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){const r=t.candidates.map(o=>{var s;return(s=o.content)!=null&&s.parts&&Array.isArray(o.content.parts)?o.content.parts.map(i=>typeof i.text=="string"?i.text:"").filter(i=>i.length>0).join(""):""}).filter(o=>o.length>0);r.length>0&&e.setAttributes({[xt]:r.join("")})}if(n&&t.functionCalls){const r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[ln]:JSON.stringify(r)})}}}function Bw(e,t,n,r,o){const s=n.operation==="embeddings";return new Proxy(e,{apply(i,a,c){const u=n.operation||"unknown",d=c[0],l=Fw(u,d,r),f=l[$e]??"unknown";return n.streaming?wt({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:l},async p=>{try{o.recordInputs&&d&&df(p,d,s,Qt(o.enableTruncation));const h=await i.apply(r,c);return Lw(h,p,!!o.recordOutputs)}catch(h){throw p.setStatus({code:re,message:"internal_error"}),pe(h,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),p.end(),h}}):Et({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:l},p=>(o.recordInputs&&d&&df(p,d,s,Qt(o.enableTruncation)),Su(()=>i.apply(r,c),h=>{pe(h,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},h=>{s||$w(p,h,o.recordOutputs)})))}})}function Dc(e,t="",n){return new Proxy(e,{get:(r,o,s)=>{const i=Reflect.get(r,o,s),a=Xu(t,String(o)),c=Cw[a];if(typeof i=="function"&&c){const u=c.operation?Bw(i,a,c,r,n):i.bind(r);return c.proxyResultPath?function(...d){const l=u(...d);return l&&typeof l=="object"?Dc(l,c.proxyResultPath,n):l}:u}return typeof i=="function"?i.bind(r):i&&typeof i=="object"?Dc(i,a,n):i}})}function Uw(e,t){return Dc(e,"",sr(t))}const vr="auto.ai.langchain",Hw={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"},it=(e,t,n)=>{n!=null&&(e[t]=n)},Ze=(e,t,n)=>{const r=Number(n);Number.isNaN(r)||(e[t]=r)};function qn(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function pr(e){if(Array.isArray(e))try{const t=e.map(n=>n&&typeof n=="object"&&Nr(n)?Io(n):n);return JSON.stringify(t)}catch{return String(e)}return qn(e)}function mo(e){const t=e.toLowerCase();return Hw[t]??t}function ff(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 pf(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function Qu(e){return e.map(t=>{var o,s;const n=t._getType;if(typeof n=="function"){const i=n.call(t);return{role:mo(i),content:pr(t.content)}}if(t.lc===1&&t.kwargs){const i=t.id,a=Array.isArray(i)&&i.length>0?i[i.length-1]:"",c=typeof a=="string"?ff(a):"user";return{role:mo(c),content:pr((o=t.kwargs)==null?void 0:o.content)}}if(t.type){const i=String(t.type).toLowerCase();return{role:mo(i),content:pr(t.content)}}if(t.role)return{role:mo(String(t.role)),content:pr(t.content)};const r=(s=t.constructor)==null?void 0:s.name;return r&&r!=="Object"?{role:mo(ff(r)),content:pr(t.content)}:{role:"user",content:pr(t.content)}})}function Ww(e,t,n){const r={},o="kwargs"in e?e.kwargs:void 0,s=(t==null?void 0:t.temperature)??(n==null?void 0:n.ls_temperature)??(o==null?void 0:o.temperature);Ze(r,oa,s);const i=(t==null?void 0:t.max_tokens)??(n==null?void 0:n.ls_max_tokens)??(o==null?void 0:o.max_tokens);Ze(r,Gu,i);const a=(t==null?void 0:t.top_p)??(o==null?void 0:o.top_p);Ze(r,ia,a);const c=t==null?void 0:t.frequency_penalty;Ze(r,sa,c);const u=t==null?void 0:t.presence_penalty;return Ze(r,Vu,u),t&&"stream"in t&&it(r,qu,!!t.stream),r}function Ng(e,t,n,r,o){return{[ts]:qn(e??"langchain"),[_t]:"chat",[$e]:qn(t),[Y]:vr,...Ww(n,r,o)}}function jw(e,t,n,r,o,s){const i=s==null?void 0:s.ls_provider,a=(o==null?void 0:o.model)??(s==null?void 0:s.ls_model_name)??"unknown",c=Ng(i,a,e,o,s);if(n&&Array.isArray(t)&&t.length>0){it(c,nr,t.length);const u=t.map(d=>({role:"user",content:d}));it(c,so,r?ao(u):io(u))}return c}function zw(e,t,n,r,o,s){var u;const i=(s==null?void 0:s.ls_provider)??((u=e.id)==null?void 0:u[2]),a=(o==null?void 0:o.model)??(s==null?void 0:s.ls_model_name)??"unknown",c=Ng(i,a,e,o,s);if(n&&Array.isArray(t)&&t.length>0){const d=Qu(t.flat()),{systemInstructions:l,filteredMessages:f}=os(d);l&&it(c,ns,l);const p=Array.isArray(f)?f.length:0;it(c,nr,p),it(c,so,r?ao(f):io(f))}return c}function qw(e,t){var o;const n=[],r=e.flat();for(const s of r){const i=s.message,a=i==null?void 0:i.tool_calls;if(Array.isArray(a)&&a.length>0)n.push(...a);else{const c=(o=s.message)==null?void 0:o.content;if(Array.isArray(c))for(const u of c){const d=u;d.type==="tool_use"&&n.push(d)}}}n.length>0&&it(t,ln,qn(n))}function Gw(e,t){if(!e)return;const n=e.tokenUsage,r=e.usage;if(n)Ze(t,er,n.promptTokens),Ze(t,tr,n.completionTokens),Ze(t,bn,n.totalTokens);else if(r){Ze(t,er,r.input_tokens),Ze(t,tr,r.output_tokens);const o=Number(r.input_tokens),s=Number(r.output_tokens),i=(Number.isNaN(o)?0:o)+(Number.isNaN(s)?0:s);i>0&&Ze(t,bn,i),r.cache_creation_input_tokens!==void 0&&Ze(t,vI,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&Ze(t,EI,r.cache_read_input_tokens)}}function Vw(e,t){var u,d,l,f;if(!e)return;const n={};if(Array.isArray(e.generations)){const p=e.generations.flat().map(h=>{var m,g;return(m=h.generationInfo)!=null&&m.finish_reason?h.generationInfo.finish_reason:(g=h.generation_info)!=null&&g.finish_reason?h.generation_info.finish_reason:null}).filter(h=>typeof h=="string");if(p.length>0&&it(n,Cr,qn(p)),qw(e.generations,n),t){const h=e.generations.flat().map(m=>{var g;return m.text??((g=m.message)==null?void 0:g.content)}).filter(m=>typeof m=="string");h.length>0&&it(n,xt,qn(h))}}Gw(e.llmOutput,n);const r=e.llmOutput,o=(d=(u=e.generations)==null?void 0:u[0])==null?void 0:d[0],s=o==null?void 0:o.message,i=(r==null?void 0:r.model_name)??(r==null?void 0:r.model)??((l=s==null?void 0:s.response_metadata)==null?void 0:l.model_name);i&&it(n,oo,i);const a=(r==null?void 0:r.id)??(s==null?void 0:s.id);a&&it(n,aa,a);const c=(r==null?void 0:r.stop_reason)??((f=s==null?void 0:s.response_metadata)==null?void 0:f.finish_reason);return c&&it(n,yI,qn(c)),n}function Ka(e){const t={},n=e==null?void 0:e.lc_agent_name;return typeof n=="string"&&(t[ca]=n),t}function Yw(e){var r,o;const t=((r=e==null?void 0:e.invocation_params)==null?void 0:r.tools)??((o=e==null?void 0:e.options)==null?void 0:o.tools);if(!Array.isArray(t)||t.length===0)return;const n=t.map(s=>{const i=s.function;return{type:"function",name:s.name??(i==null?void 0:i.name)??"",description:s.description??(i==null?void 0:i.description)}});return JSON.stringify(n)}function Kw(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.addHandler=="function"&&typeof t.copy=="function"}function Jw(e){return typeof e=="object"&&(e==null?void 0:e.name)==="SentryCallbackHandler"}function hf(e){return e.some(Jw)}function Xw(e,t){if(!e)return[t];if(Kw(e)){if(hf(e.handlers??[]))return e;const r=e.copy();return r.addHandler(t,!0),r}const n=Array.isArray(e)?e:[e];return hf(n)?e:[...n,t]}function Zu(e={}){const{recordInputs:t,recordOutputs:n}=sr(e),r=Qt(e.enableTruncation),o=new Map,s=a=>{const c=o.get(a);c!=null&&c.isRecording()&&(c.end(),o.delete(a))},i={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(a,c,u,d,l,f,p,h){const m=pf(f),g=jw(a,c,t,r,m,p),y=g[$e],S=g[_t];wt({name:`${S} ${y}`,op:"gen_ai.chat",attributes:{...Ka(p),...g,[ce]:"gen_ai.chat"}},k=>(o.set(u,k),k))},handleChatModelStart(a,c,u,d,l,f,p,h){const m=pf(f),g=zw(a,c,t,r,m,p),y=Yw(l);y&&(g[rs]=y);const S=g[$e],k=g[_t];wt({name:`${k} ${S}`,op:"gen_ai.chat",attributes:{...Ka(p),...g,[ce]:"gen_ai.chat"}},E=>(o.set(u,E),E))},handleLLMEnd(a,c,u,d,l){const f=o.get(c);if(f!=null&&f.isRecording()){const p=Vw(a,n);p&&f.setAttributes(p),s(c)}},handleLLMError(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(u.setStatus({code:re,message:"internal_error"}),s(c)),pe(a,{mechanism:{handled:!1,type:`${vr}.llm_error_handler`}})},handleChainStart(a,c,u,d,l,f,p,h){if(f!=null&&f.__sentry_langgraph__)return;const m=h||a.name||"unknown_chain",g={[Y]:"auto.ai.langchain","langchain.chain.name":m};t&&(g["langchain.chain.inputs"]=JSON.stringify(c)),wt({name:`chain ${m}`,op:"gen_ai.invoke_agent",attributes:{...g,[ce]:"gen_ai.invoke_agent"}},y=>(o.set(u,y),y))},handleChainEnd(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(n&&u.setAttributes({"langchain.chain.outputs":JSON.stringify(a)}),s(c))},handleChainError(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(u.setStatus({code:re,message:"internal_error"}),s(c)),pe(a,{mechanism:{handled:!1,type:`${vr}.chain_error_handler`}})},handleToolStart(a,c,u,d,l,f,p){if(f!=null&&f.__sentry_langgraph__)return;const h=p||a.name||"unknown_tool",m={...Ka(f),[Y]:vr,[_t]:"execute_tool",[gg]:h};t&&(m[_g]=c),wt({name:`execute_tool ${h}`,op:"gen_ai.execute_tool",attributes:{...m,[ce]:"gen_ai.execute_tool"}},g=>(o.set(u,g),g))},handleToolEnd(a,c){const u=o.get(c);if(u!=null&&u.isRecording()){if(n){const d=a,l=d&&typeof d=="object"&&"content"in d?d.content:a;u.setAttributes({[yg]:typeof l=="string"?l:JSON.stringify(l)})}s(c)}},handleToolError(a,c){const u=o.get(c);u!=null&&u.isRecording()&&(u.setStatus({code:re,message:"internal_error"}),s(c)),pe(a,{mechanism:{handled:!1,type:`${vr}.tool_error_handler`}})},copy(){return i},toJSON(){return{lc:1,type:"not_implemented",id:i.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:i.lc_id}}};return i}const el="auto.ai.langgraph";function Qw(e){const t=e[0];if(typeof t!="object"||!t||!("llm"in t)||!t.llm||typeof t.llm!="object")return null;const n=t.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function Zw(e){const t=e[0];return typeof t=="object"&&t&&"name"in t&&typeof t.name=="string"?t.name:null}function ek(e,t,n){const r="__sentry_tool_wrapped__";for(const o of e){if(!o||typeof o!="object")continue;const s=o,i=s.invoke;if(typeof i!="function"||Object.prototype.hasOwnProperty.call(s,r))continue;const a=typeof s.name=="string"?s.name:"unknown_tool",c=typeof s.description=="string"?s.description:void 0,u=new Proxy(i,{apply(d,l,f){var y;const p={[Y]:el,[ce]:sf,[_t]:"execute_tool",[gg]:a,[wI]:"function"},h=f[1],m=((y=h==null?void 0:h.metadata)==null?void 0:y.lc_agent_name)??n;typeof m=="string"&&(p[ca]=m),c&&(p[kI]=c);const g=f[0];if(typeof g=="object"&&g&&("id"in g&&typeof g.id=="string"&&(p[II]=g.id),t.recordInputs)){const S="args"in g&&typeof g.args=="object"?g.args:g;try{p[_g]=JSON.stringify(S)}catch{}}return Et({op:sf,name:`execute_tool ${a}`,attributes:p},async S=>{try{const k=await Reflect.apply(d,l,f);if(t.recordOutputs)try{const E=k,x=E&&typeof E=="object"&&"content"in E?E.content:k;S.setAttribute(yg,typeof x=="string"?x:JSON.stringify(x))}catch{}return k}catch(k){throw S.setStatus({code:re,message:"internal_error"}),pe(k,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),k}})}});s.invoke=u,Object.defineProperty(s,r,{value:!0,enumerable:!1})}return e}function tk(e){if(!e||e.length===0)return null;const t=[];for(const n of e)if(n&&typeof n=="object"){const r=n.tool_calls;r&&Array.isArray(r)&&t.push(...r)}return t.length>0?t:null}function nk(e){const t=e;let n=0,r=0,o=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){const s=t.usage_metadata;return typeof s.input_tokens=="number"&&(n=s.input_tokens),typeof s.output_tokens=="number"&&(r=s.output_tokens),typeof s.total_tokens=="number"&&(o=s.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:o}}if(t.response_metadata&&typeof t.response_metadata=="object"){const s=t.response_metadata;if(s.tokenUsage&&typeof s.tokenUsage=="object"){const i=s.tokenUsage;typeof i.promptTokens=="number"&&(n=i.promptTokens),typeof i.completionTokens=="number"&&(r=i.completionTokens),typeof i.totalTokens=="number"&&(o=i.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:o}}function rk(e,t){const n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){const r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&e.setAttribute(oo,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(Cr,[r.finish_reason])}}function ok(e){var n,r,o,s,i,a,c,u;if(!((s=(o=(r=(n=e.builder)==null?void 0:n.nodes)==null?void 0:r.tools)==null?void 0:o.runnable)!=null&&s.tools))return null;const t=(u=(c=(a=(i=e.builder)==null?void 0:i.nodes)==null?void 0:a.tools)==null?void 0:c.runnable)==null?void 0:u.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(d=>{var l,f,p;return{name:(l=d.lc_kwargs)==null?void 0:l.name,description:(f=d.lc_kwargs)==null?void 0:f.description,schema:(p=d.lc_kwargs)==null?void 0:p.schema}})}function sk(e,t,n){const r=n,o=r==null?void 0:r.messages;if(!o||!Array.isArray(o))return;const s=(t==null?void 0:t.length)??0,i=o.length>s?o.slice(s):[];if(i.length===0)return;const a=tk(i);a&&e.setAttribute(ln,JSON.stringify(a));const c=Qu(i);e.setAttribute(xt,JSON.stringify(c));let u=0,d=0,l=0;for(const f of i){const p=nk(f);u+=p.inputTokens,d+=p.outputTokens,l+=p.totalTokens,rk(e,f)}u>0&&e.setAttribute(er,u),d>0&&e.setAttribute(tr,d),l>0&&e.setAttribute(bn,l)}let Fc=!1;const Ei="__sentry_patched__";function ik(e,t){if(Object.prototype.hasOwnProperty.call(e,Ei))return e;const n=Zu(t),r=new Proxy(e,{apply(o,s,i){return Fc?Reflect.apply(o,s,i):Et({op:"gen_ai.create_agent",name:"create_agent",attributes:{[Y]:el,[ce]:"gen_ai.create_agent",[_t]:"create_agent"}},a=>{try{const c=Reflect.apply(o,s,i),u=i.length>0?i[0]:{};u!=null&&u.name&&typeof u.name=="string"&&(a.setAttribute(ca,u.name),a.updateName(`create_agent ${u.name}`));const d=c.invoke;return d&&typeof d=="function"&&(c.invoke=xg(d.bind(c),c,u,t,void 0,n)),c}catch(c){throw a.setStatus({code:re,message:"internal_error"}),pe(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}});return Object.defineProperty(r,Ei,{value:!0,enumerable:!1}),r}function xg(e,t,n,r,o,s){return new Proxy(e,{apply(i,a,c){const u=(o==null?void 0:o.modelName)??(o==null?void 0:o.model);return Et({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[Y]:el,[ce]:TI,[_t]:"invoke_agent"}},async d=>{var l;try{const f=n==null?void 0:n.name;f&&typeof f=="string"&&(d.setAttribute(SI,f),d.setAttribute(ca,f),d.updateName(`invoke_agent ${f}`)),u&&d.setAttribute($e,u);const p=c.length>1?c[1]:void 0,h=p==null?void 0:p.configurable,m=h==null?void 0:h.thread_id;if(m&&typeof m=="string"&&d.setAttribute(Yu,m),s){const x=c[1]??{};c[1]=x;const w=x.metadata??{};x.metadata={...w,__sentry_langgraph__:!0,...typeof f=="string"?{lc_agent_name:f}:{}},x.callbacks=Xw(x.callbacks,s)}const g=ok(t);g&&d.setAttribute(rs,JSON.stringify(g));const y=r.recordInputs,S=r.recordOutputs,k=c.length>0?((l=c[0])==null?void 0:l.messages)??[]:[];if(k&&y){const x=Qu(k),{systemInstructions:w,filteredMessages:b}=os(x);w&&d.setAttribute(ns,w);const I=Qt(r.enableTruncation),B=Array.isArray(b)?b.length:0;d.setAttributes({[so]:I?ao(b):io(b),[nr]:B})}const E=await Reflect.apply(i,a,c);return S&&sk(d,k??null,E),E}catch(f){throw d.setStatus({code:re,message:"internal_error"}),pe(f,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),f}})}})}function ak(e,t){if(Object.prototype.hasOwnProperty.call(e,Ei))return e;const n=sr(t),r=Zu(n),o=new Proxy(e,{apply(s,i,a){const c=Qw(a),u=Zw(a),d=a[0];d&&Array.isArray(d.tools)&&d.tools.length>0&&ek(d.tools,n,u??void 0),Fc=!0;let l;try{l=Reflect.apply(s,i,a)}finally{Fc=!1}const f=l.invoke;if(f&&typeof f=="function"){const p={};u&&(p.name=u),l.invoke=xg(f.bind(l),l,p,n,c,r)}return l}});return Object.defineProperty(o,Ei,{value:!0,enumerable:!1}),o}function ck(e,t){return e.compile=ik(e.compile,sr(t)),e}function uk(e,t,n){const r=n.getOptions(),o=n.getDsn(),s=r.tunnel,i=Qo(r._metadata),a={sent_at:new Date(Bt()).toISOString(),...lk(t)&&{trace:t},...i&&{sdk:i},...!!s&&o&&{dsn:Ut(o)}},c=n.getDataCollectionOptions().userInfo?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...yn()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return dt(a,[u])}function lk(e){return!!e.trace_id&&!!e.public_key}function dk(e){let t=156;if(t+=e.name.length*2,t+=pd(e.attributes),e.links&&e.links.length>0){const n=e.links[0],r=n==null?void 0:n.attributes,o=100+(r?pd(r):0);t+=o*e.links.length}return t}const mf=1e3,fk=5e6;class pk{constructor(t,n){this._traceBuckets=new Map,this._client=t;const{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:s}=n??{};this._maxSpanLimit=r&&r>0&&r<=mf?r:mf,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:fk,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){const n=t.trace_id;let r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:Zi(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=dk(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(M&&_.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){var c;const n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}const r=Array.from(n.spans),o=(c=r[0])==null?void 0:c._segmentSpan;if(!o){M&&_.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}const s=vt(o),i=r.map(u=>{const{_segmentSpan:d,...l}=u;return l}),a=uk(i,s,this._client);M&&_.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,u=>{M&&_.error("Error while sending streamed span envelope:",u)}),this._removeTrace(t)}_removeTrace(t){const n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}}function Mg(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Wr=H;function hk(){return"history"in Wr&&!!Wr.history}function mk(){if(!("fetch"in Wr))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function $c(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Og(){var n;if(typeof EdgeRuntime=="string")return!0;if(!mk())return!1;if($c(Wr.fetch))return!0;let e=!1;const t=Wr.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=$c(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){M&&_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function gk(){return"ReportingObserver"in Wr}function da(e,t){const n="fetch",r=Tn(n,e);return In(n,()=>Pg(void 0,t)),r}function _k(e){const t="fetch-body-resolved",n=Tn(t,e);return In(t,()=>Pg(bk)),n}function Pg(e,t=!1){t&&!Og()||De(H,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=Sk(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:ye()*1e3,virtualError:o,headers:vk(r)};return e||at("fetch",{...a}),n.apply(H,r).then(async c=>(e?e(c):at("fetch",{...a,endTimestamp:ye()*1e3,response:c}),c),c=>{at("fetch",{...a,endTimestamp:ye()*1e3,error:c}),Rt(c)&&c.stack===void 0&&(c.stack=o.stack,we(c,"framesToPop",1));const u=N(),d=(u==null?void 0:u.getOptions().enhanceFetchErrorMessages)??"always";if(d!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(a.fetchData.url).host;d==="always"?c.message=`${c.message} (${p})`:we(c,"__sentry_fetch_url_host__",p)}catch{}throw c})}})}async function yk(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=await r.read();clearTimeout(i),a&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(i)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function bk(e){let t;try{t=e.clone()}catch{return}yk(t,()=>{at("fetch-body-resolved",{endTimestamp:ye()*1e3,response:e})})}function Gs(e,t){return!!e&&typeof e=="object"&&!!e[t]}function gf(e){return typeof e=="string"?e:e?Gs(e,"url")?e.url:e.toString?e.toString():"":""}function Sk(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:gf(n),method:Gs(r,"method")?String(r.method).toUpperCase():gu(n)&&Gs(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:gf(t),method:Gs(t,"method")?String(t.method).toUpperCase():"GET"}}function vk(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(gu(t))return new Headers(t.headers)}catch{}}const Lg=H;function ir(){try{return Lg.document.location.href}catch{return""}}function tl(e,t=5){if(!Lg.HTMLElement)return null;let n=e;for(let r=0;r<t;r++){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}function Ek(e){var n;const t=((n=e.constructor)==null?void 0:n.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 Tk(e){const t=e??{},n={[Y]:vr,[ce]:mg,[_t]:"embeddings",[$e]:t.model??"unknown"};return n[ts]=Ek(t),"dimensions"in t&&(n[hg]=t.dimensions),"encodingFormat"in t&&(n[pg]=t.encodingFormat),n}function _f(e,t={}){const{recordInputs:n}=sr(t);return new Proxy(e,{apply(r,o,s){const i=Tk(o),a=i[$e]||"unknown";if(n){const c=s[0];c!=null&&(i[Ku]=typeof c=="string"?c:JSON.stringify(c))}return Et({name:`embeddings ${a}`,op:mg,attributes:i},()=>Reflect.apply(r,o,s).then(void 0,c=>{throw pe(c,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),c}))}})}function Ik(e,t){const n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=_f(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=_f(n.embedDocuments,t)),e}const ht=H,me=ht.document,So=ht.navigator,Dg="Report a Bug",wk="Cancel",kk="Send Bug Report",Rk="Confirm",Ak="Report a Bug",Ck="your.email@example.org",Nk="Email",xk="What's the bug? What did you expect?",Mk="Description",Ok="Your Name",Pk="Name",Lk="Thank you for your report!",Dk="(required)",Fk="Add a screenshot",$k="Remove screenshot",Bk="Highlight",Uk="Hide",Hk="Remove",Fg="Unable to submit feedback with empty message",$g="No client setup, cannot send feedback.",Bg="Unable to determine if Feedback was correctly sent.",Ug="Unable to send feedback. This could be because this domain is not in your list of allowed domains.",Hg="Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.",Wk="widget",jk="api",zk=5e3,qk={ERROR_EMPTY_MESSAGE:Fg,ERROR_NO_CLIENT:$g,ERROR_TIMEOUT:Bg,ERROR_FORBIDDEN:Ug,ERROR_GENERIC:Hg};function Vs(e,t){return(t==null?void 0:t[e])??qk[e]}function yf(e,t){return new Error(Vs(e,t))}const Wg=(e,t={includeReplay:!0})=>{const n=t.errorMessages;if(!e.message)throw yf("ERROR_EMPTY_MESSAGE",n);const r=N();if(!r)throw yf("ERROR_NO_CLIENT",n);e.tags&&Object.keys(e.tags).length&&j().setTags(e.tags);const o=ag({source:jk,url:ir(),...e},t);return new Promise((s,i)=>{const a=setTimeout(()=>{c(),i(Vs("ERROR_TIMEOUT",n))},3e4),c=r.on("afterSendEvent",(u,d)=>{if(u.event_id===o)return clearTimeout(a),c(),d!=null&&d.statusCode&&d.statusCode>=200&&d.statusCode<300?s(o):(d==null?void 0:d.statusCode)===403?i(Vs("ERROR_FORBIDDEN",n)):i(Vs("ERROR_GENERIC",n))})})},Ys=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Gk(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(So.userAgent)||/Macintosh/i.test(So.userAgent)&&So.maxTouchPoints&&So.maxTouchPoints>1||!isSecureContext)}function Rs(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{var n,r;(n=t.onFormOpen)==null||n.call(t),(r=e.onFormOpen)==null||r.call(e)},onFormClose:()=>{var n,r;(n=t.onFormClose)==null||n.call(t),(r=e.onFormClose)==null||r.call(e)},onSubmitSuccess:(n,r)=>{var o,s;(o=t.onSubmitSuccess)==null||o.call(t,n,r),(s=e.onSubmitSuccess)==null||s.call(e,n,r)},onSubmitError:n=>{var r,o;(r=t.onSubmitError)==null||r.call(t,n),(o=e.onSubmitError)==null||o.call(e,n)},onFormSubmitted:()=>{var n,r;(n=t.onFormSubmitted)==null||n.call(t),(r=e.onFormSubmitted)==null||r.call(e)},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function Vk(e){const t=me.createElement("style");return t.textContent=`
.widget__actor {
position: fixed;
z-index: var(--z-index);
margin: var(--page-margin);
inset: var(--actor-inset);
display: flex;
align-items: center;
gap: 8px;
padding: 16px;
font-family: inherit;
font-size: var(--font-size);
font-weight: 600;
line-height: 1.14em;
text-decoration: none;
background: var(--actor-background, var(--background));
border-radius: var(--actor-border-radius, 1.7em/50%);
border: var(--actor-border, var(--border));
box-shadow: var(--actor-box-shadow, var(--box-shadow));
color: var(--actor-color, var(--foreground));
fill: var(--actor-color, var(--foreground));
cursor: pointer;
opacity: 1;
transition: transform 0.2s ease-in-out;
transform: translate(0, 0) scale(1);
}
.widget__actor[aria-hidden="true"] {
opacity: 0;
pointer-events: none;
visibility: hidden;
transform: translate(0, 16px) scale(0.98);
}
.widget__actor:hover {
background: var(--actor-hover-background, var(--background));
filter: var(--interactive-filter);
}
.widget__actor svg {
width: 1.14em;
height: 1.14em;
}
@media (max-width: 600px) {
.widget__actor span {
display: none;
}
}
`,e&&t.setAttribute("nonce",e),t}function tt(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const hr=20,Yk="http://www.w3.org/2000/svg";function Kk(){const e=a=>ht.document.createElementNS(Yk,a),t=tt(e("svg"),{width:`${hr}`,height:`${hr}`,viewBox:`0 0 ${hr} ${hr}`,fill:"var(--actor-color, var(--foreground))"}),n=tt(e("g"),{clipPath:"url(#clip0_57_80)"}),r=tt(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);const o=e("defs"),s=tt(e("clipPath"),{id:"clip0_57_80"}),i=tt(e("rect"),{width:`${hr}`,height:`${hr}`,fill:"white"});return s.appendChild(i),o.appendChild(s),t.appendChild(o).appendChild(s).appendChild(i),t}function Jk({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const o=me.createElement("button");if(o.type="button",o.className="widget__actor",o.ariaHidden="false",o.ariaLabel=t||e||Dg,o.appendChild(Kk()),e){const i=me.createElement("span");i.appendChild(me.createTextNode(e)),o.appendChild(i)}const s=Vk(r);return{el:o,appendToDom(){n.appendChild(s),n.appendChild(o)},removeFromDom(){o.remove(),s.remove()},show(){o.ariaHidden="false"},hide(){o.ariaHidden="true"}}}const jg="rgba(88, 74, 192, 1)",Xk={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:jg,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%)"},bf={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:jg,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 Sf(e){return`
--foreground: ${e.foreground};
--background: ${e.background};
--accent-foreground: ${e.accentForeground};
--accent-background: ${e.accentBackground};
--success-color: ${e.successColor};
--error-color: ${e.errorColor};
--border: ${e.border};
--box-shadow: ${e.boxShadow};
--outline: ${e.outline};
--interactive-filter: ${e.interactiveFilter};
`}function vf({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const o=me.createElement("style");return o.textContent=`
:host {
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
--font-size: 14px;
--z-index: 100000;
--page-margin: 16px;
--inset: auto 0 0 auto;
--actor-inset: var(--inset);
font-family: var(--font-family);
font-size: var(--font-size);
${e!=="system"?`color-scheme: only ${e};`:""}
${Sf(e==="dark"?{...bf,...t}:{...Xk,...n})}
}
${e==="system"?`
@media (prefers-color-scheme: dark) {
:host {
color-scheme: only dark;
${Sf({...bf,...t})}
}
}`:""}
`,r&&o.setAttribute("nonce",r),o}const zg=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>(({id:o="sentry-feedback",autoInject:s=!0,showBranding:i=!0,isEmailRequired:a=!1,isNameRequired:c=!1,showEmail:u=!0,showName:d=!0,enableScreenshot:l=!0,useSentryUser:f={email:"email",name:"username"},tags:p,styleNonce:h,scriptNonce:m,colorScheme:g="system",themeLight:y={},themeDark:S={},addScreenshotButtonLabel:k=Fk,cancelButtonLabel:E=wk,confirmButtonLabel:x=Rk,emailLabel:w=Nk,emailPlaceholder:b=Ck,formTitle:I=Ak,isRequiredLabel:B=Dk,messageLabel:v=Mk,messagePlaceholder:P=xk,nameLabel:R=Pk,namePlaceholder:L=Ok,removeScreenshotButtonLabel:$=$k,submitButtonLabel:J=kk,successMessageText:te=Lk,triggerLabel:F=Dg,triggerAriaLabel:O="",highlightToolText:Q=Bk,hideToolText:T=Uk,removeHighlightText:W=Hk,errorEmptyMessageText:z=Fg,errorNoClientText:ne=$g,errorTimeoutText:ie=Bg,errorForbiddenText:de=Ug,errorGenericText:Be=Hg,onFormOpen:Xe,onFormClose:Cn,onSubmitSuccess:vs,onSubmitError:Nn,onFormSubmitted:Es}={})=>{const Wt={id:o,autoInject:s,showBranding:i,isEmailRequired:a,isNameRequired:c,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:f,tags:p,styleNonce:h,scriptNonce:m,colorScheme:g,themeDark:S,themeLight:y,triggerLabel:F,triggerAriaLabel:O,cancelButtonLabel:E,submitButtonLabel:J,confirmButtonLabel:x,formTitle:I,emailLabel:w,emailPlaceholder:b,messageLabel:v,messagePlaceholder:P,nameLabel:R,namePlaceholder:L,successMessageText:te,isRequiredLabel:B,addScreenshotButtonLabel:k,removeScreenshotButtonLabel:$,highlightToolText:Q,hideToolText:T,removeHighlightText:W,errorEmptyMessageText:z,errorNoClientText:ne,errorTimeoutText:ie,errorForbiddenText:de,errorGenericText:Be,onFormClose:Cn,onFormOpen:Xe,onSubmitError:Nn,onSubmitSuccess:vs,onFormSubmitted:Es};let nt=null,Ve=null,Qe=[];const lr=D=>{if(!nt){const ae=me.createElement("div");ae.id=String(D.id),me.body.appendChild(ae),nt=ae.attachShadow({mode:"open"}),Ve=vf(D),nt.appendChild(Ve)}return nt},dr=async D=>{const ae=D.enableScreenshot&&Gk();let X,fe;try{X=(t?t():await e("feedbackModalIntegration",m))(),Rc(X)}catch{throw Ys&&_.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const Ue=ae?n?n():await e("feedbackScreenshotIntegration",m):void 0;Ue&&(fe=Ue(),Rc(fe))}catch{Ys&&_.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const le={ERROR_EMPTY_MESSAGE:D.errorEmptyMessageText,ERROR_NO_CLIENT:D.errorNoClientText,ERROR_TIMEOUT:D.errorTimeoutText,ERROR_FORBIDDEN:D.errorForbiddenText,ERROR_GENERIC:D.errorGenericText},oe=(Ue,kb)=>Wg(Ue,{includeReplay:!0,...kb,errorMessages:le}),He=X.createDialog({options:{...D,onFormClose:()=>{var Ue;He==null||He.close(),(Ue=D.onFormClose)==null||Ue.call(D)},onFormSubmitted:()=>{var Ue;He==null||He.close(),(Ue=D.onFormSubmitted)==null||Ue.call(D)}},screenshotIntegration:fe,sendFeedback:oe,shadow:lr(D)});return He},xn=(D,ae={})=>{const X=Rs(Wt,ae),fe=typeof D=="string"?me.querySelector(D):typeof D.addEventListener=="function"?D:null;if(!fe)throw Ys&&_.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let le=null;const oe=async()=>{le||(le=await dr({...X,onFormSubmitted:()=>{var Ue;le==null||le.removeFromDom(),(Ue=X.onFormSubmitted)==null||Ue.call(X)}})),le.appendToDom(),le.open()};fe.addEventListener("click",oe);const He=()=>{Qe=Qe.filter(Ue=>Ue!==He),le==null||le.removeFromDom(),le=null,fe.removeEventListener("click",oe)};return Qe.push(He),He},Mn=(D={})=>{const ae=Rs(Wt,D),X=lr(ae),fe=Jk({triggerLabel:ae.triggerLabel,triggerAriaLabel:ae.triggerAriaLabel,shadow:X,styleNonce:h});return xn(fe.el,{...ae,onFormOpen(){fe.hide()},onFormClose(){fe.show()},onFormSubmitted(){fe.show()}}),fe};return{name:"Feedback",setupOnce(){!yn()||!Wt.autoInject||(me.readyState==="loading"?me.addEventListener("DOMContentLoaded",()=>Mn().appendToDom()):Mn().appendToDom())},attachTo:xn,createWidget(D={}){const ae=Mn(Rs(Wt,D));return ae.appendToDom(),ae},async createForm(D={}){return dr(Rs(Wt,D))},setTheme(D){if(Wt.colorScheme=D,nt){const ae=vf(Wt);Ve?nt.replaceChild(ae,Ve):nt.prepend(ae),Ve=ae}},remove(){var D;nt&&((D=nt.parentElement)==null||D.remove(),nt=null,Ve=null),Qe.forEach(ae=>ae()),Qe=[]}}});function Qk(){const e=N();return e==null?void 0:e.getIntegrationByName("Feedback")}var fa,_e,qg,Dn,Ef,Gg,Bc,Fo={},nl=[],Zk=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rl=Array.isArray;function un(e,t){for(var n in t)e[n]=t[n];return e}function Vg(e){var t=e.parentNode;t&&t.removeChild(e)}function ee(e,t,n){var r,o,s,i={};for(s in t)s=="key"?r=t[s]:s=="ref"?o=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?fa.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)i[s]===void 0&&(i[s]=e.defaultProps[s]);return Ks(e,i,r,o,null)}function Ks(e,t,n,r,o){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++qg,__i:-1,__u:0};return o==null&&_e.vnode!=null&&_e.vnode(s),s}function ss(e){return e.children}function Js(e,t){this.props=e,this.context=t}function jr(e,t){if(t==null)return e.__?jr(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"?jr(e):null}function eR(e,t,n){var r,o=e.__v,s=o.__e,i=e.__P;if(i)return(r=un({},o)).__v=o.__v+1,_e.vnode&&_e.vnode(r),ol(i,r,o,e.__n,i.ownerSVGElement!==void 0,32&o.__u?[s]:null,t,s??jr(o),!!(32&o.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=s&&Yg(r),r}function Yg(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 Yg(e)}}function Tf(e){(!e.__d&&(e.__d=!0)&&Dn.push(e)&&!Ti.__r++||Ef!==_e.debounceRendering)&&((Ef=_e.debounceRendering)||Gg)(Ti)}function Ti(){var e,t,n,r=[],o=[];for(Dn.sort(Bc);e=Dn.shift();)e.__d&&(n=Dn.length,t=eR(e,r,o)||t,n===0||Dn.length>n?(Uc(r,t,o),o.length=r.length=0,t=void 0,Dn.sort(Bc)):t&&_e.__c&&_e.__c(t,nl));t&&Uc(r,t,o),Ti.__r=0}function Kg(e,t,n,r,o,s,i,a,c,u,d){var l,f,p,h,m,g=r&&r.__k||nl,y=t.length;for(n.__d=c,tR(n,t,g),c=n.__d,l=0;l<y;l++)(p=n.__k[l])!=null&&typeof p!="boolean"&&typeof p!="function"&&(f=p.__i===-1?Fo:g[p.__i]||Fo,p.__i=l,ol(e,p,f,o,s,i,a,c,u,d),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&sl(f.ref,null,p),d.push(p.ref,p.__c||h,p)),m==null&&h!=null&&(m=h),65536&p.__u||f.__k===p.__k?c=Jg(p,c,e):typeof p.type=="function"&&p.__d!==void 0?c=p.__d:h&&(c=h.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=m}function tR(e,t,n){var r,o,s,i,a,c=t.length,u=n.length,d=u,l=0;for(e.__k=[],r=0;r<c;r++)(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ks(null,o,null,null,o):rl(o)?Ks(ss,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ks(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,a=nR(o,n,i=r+l,d),o.__i=a,s=null,a!==-1&&(d--,(s=n[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&l--,typeof o.type!="function"&&(o.__u|=65536)):a!==i&&(a===i+1?l++:a>i?d>c-i?l+=a-i:l--:l=a<i&&a==i-1?a-i:0,a!==r+l&&(o.__u|=65536))):(s=n[r])&&s.key==null&&s.__e&&(s.__e==e.__d&&(e.__d=jr(s)),Hc(s,s,!1),n[r]=null,d--);if(d)for(r=0;r<u;r++)(s=n[r])!=null&&(131072&s.__u)==0&&(s.__e==e.__d&&(e.__d=jr(s)),Hc(s,s))}function Jg(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Jg(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function nR(e,t,n,r){var o=e.key,s=e.type,i=n-1,a=n+1,c=t[n];if(c===null||c&&o==c.key&&s===c.type)return n;if(r>(c!=null&&(131072&c.__u)==0?1:0))for(;i>=0||a<t.length;){if(i>=0){if((c=t[i])&&(131072&c.__u)==0&&o==c.key&&s===c.type)return i;i--}if(a<t.length){if((c=t[a])&&(131072&c.__u)==0&&o==c.key&&s===c.type)return a;a++}}return-1}function If(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Zk.test(t)?n:n+"px"}function As(e,t,n,r,o){var s;e: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||If(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||If(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,s?kf:wf,s)):e.removeEventListener(t,s?kf:wf,s);else{if(o)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 e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function wf(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(_e.event?_e.event(e):e)}}function kf(e){if(this.l)return this.l[e.type+!0](_e.event?_e.event(e):e)}function ol(e,t,n,r,o,s,i,a,c,u){var d,l,f,p,h,m,g,y,S,k,E,x,w,b,I,B=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),s=[a=t.__e=n.__e]),(d=_e.__b)&&d(t);e:if(typeof B=="function")try{if(y=t.props,S=(d=B.contextType)&&r[d.__c],k=d?S?S.props.value:d.__:r,n.__c?g=(l=t.__c=n.__c).__=l.__E:("prototype"in B&&B.prototype.render?t.__c=l=new B(y,k):(t.__c=l=new Js(y,k),l.constructor=B,l.render=oR),S&&S.sub(l),l.props=y,l.state||(l.state={}),l.context=k,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),B.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=un({},l.__s)),un(l.__s,B.getDerivedStateFromProps(y,l.__s))),p=l.props,h=l.state,l.__v=t,f)B.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(B.getDerivedStateFromProps==null&&y!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(y,k),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(y,l.__s,k)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=y,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(v){v&&(v.__=t)}),E=0;E<l._sb.length;E++)l.__h.push(l._sb[E]);l._sb=[],l.__h.length&&i.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(y,l.__s,k),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,h,m)})}if(l.context=k,l.props=y,l.__P=e,l.__e=!1,x=_e.__r,w=0,"prototype"in B&&B.prototype.render){for(l.state=l.__s,l.__d=!1,x&&x(t),d=l.render(l.props,l.state,l.context),b=0;b<l._sb.length;b++)l.__h.push(l._sb[b]);l._sb=[]}else do l.__d=!1,x&&x(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++w<25);l.state=l.__s,l.getChildContext!=null&&(r=un(un({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(m=l.getSnapshotBeforeUpdate(p,h)),Kg(e,rl(I=d!=null&&d.type===ss&&d.key==null?d.props.children:d)?I:[I],t,n,r,o,s,i,a,c,u),l.base=t.__e,t.__u&=-161,l.__h.length&&i.push(l),g&&(l.__E=l.__=null)}catch(v){t.__v=null,c||s!=null?(t.__e=a,t.__u|=c?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),_e.__e(v,t,n)}else s==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=rR(n.__e,t,n,r,o,s,i,c,u);(d=_e.diffed)&&d(t)}function Uc(e,t,n){for(var r=0;r<n.length;r++)sl(n[r],n[++r],n[++r]);_e.__c&&_e.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){_e.__e(s,o.__v)}})}function rR(e,t,n,r,o,s,i,a,c){var u,d,l,f,p,h,m,g=n.props,y=t.props,S=t.type;if(S==="svg"&&(o=!0),s!=null){for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!S&&(S?p.localName===S:p.nodeType===3)){e=p,s[u]=null;break}}if(e==null){if(S===null)return document.createTextNode(y);e=o?document.createElementNS("http://www.w3.org/2000/svg",S):document.createElement(S,y.is&&y),s=null,a=!1}if(S===null)g===y||a&&e.data===y||(e.data=y);else{if(s=s&&fa.call(e.childNodes),g=n.props||Fo,!a&&s!=null)for(g={},u=0;u<e.attributes.length;u++)g[(p=e.attributes[u]).name]=p.value;for(u in g)p=g[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=p:u==="key"||u in y||As(e,u,null,p,o));for(u in y)p=y[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?h=p:u=="checked"?m=p:u==="key"||a&&typeof p!="function"||g[u]===p||As(e,u,p,g[u],o);if(d)a||l&&(d.__html===l.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(l&&(e.innerHTML=""),Kg(e,rl(f)?f:[f],t,n,r,o&&S!=="foreignObject",s,i,s?s[0]:n.__k&&jr(n,0),a,c),s!=null)for(u=s.length;u--;)s[u]!=null&&Vg(s[u]);a||(u="value",h!==void 0&&(h!==e[u]||S==="progress"&&!h||S==="option"&&h!==g[u])&&As(e,u,h,g[u],!1),u="checked",m!==void 0&&m!==e[u]&&As(e,u,m,g[u],!1))}return e}function sl(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){_e.__e(r,n)}}function Hc(e,t,n){var r,o;if(_e.unmount&&_e.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||sl(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){_e.__e(s,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Hc(r[o],t,n||typeof e.type!="function");n||e.__e==null||Vg(e.__e),e.__=e.__e=e.__d=void 0}function oR(e,t,n){return this.constructor(e,n)}function sR(e,t,n){var r,o,s,i;_e.__&&_e.__(e,t),o=(r=!1)?null:t.__k,s=[],i=[],ol(t,e=t.__k=ee(ss,null,[e]),o||Fo,Fo,t.ownerSVGElement!==void 0,o?null:t.firstChild?fa.call(t.childNodes):null,s,o?o.__e:t.firstChild,r,i),e.__d=void 0,Uc(s,e,i)}fa=nl.slice,_e={__e:function(e,t,n,r){for(var o,s,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(a){e=a}throw e}},qg=0,Js.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=un({},this.state),typeof e=="function"&&(e=e(un({},n),this.props)),e&&un(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Tf(this))},Js.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Tf(this))},Js.prototype.render=ss,Dn=[],Gg=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Bc=function(e,t){return e.__v.__b-t.__v.__b},Ti.__r=0;var Zt,ge,Ja,Rf,zr=0,Xg=[],Xs=[],ke=_e,Af=ke.__b,Cf=ke.__r,Nf=ke.diffed,xf=ke.__c,Mf=ke.unmount,Of=ke.__;function ar(e,t){ke.__h&&ke.__h(ge,e,zr||t),zr=0;var n=ge.__H||(ge.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Xs}),n.__[e]}function $n(e){return zr=1,Qg(e_,e)}function Qg(e,t,n){var r=ar(Zt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):e_(void 0,t),function(a){var c=r.__N?r.__N[0]:r.__[0],u=r.t(c,a);c!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ge,!ge.u)){var o=function(a,c,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!s||s.call(this,a,c,u);var l=!1;return d.forEach(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===a)&&(!s||s.call(this,a,c,u))};ge.u=!0;var s=ge.shouldComponentUpdate,i=ge.componentWillUpdate;ge.componentWillUpdate=function(a,c,u){if(this.__e){var d=s;s=void 0,o(a,c,u),s=d}i&&i.call(this,a,c,u)},ge.shouldComponentUpdate=o}return r.__N||r.__}function iR(e,t){var n=ar(Zt++,3);!ke.__s&&il(n.__H,t)&&(n.__=e,n.i=t,ge.__H.__h.push(n))}function Zg(e,t){var n=ar(Zt++,4);!ke.__s&&il(n.__H,t)&&(n.__=e,n.i=t,ge.__h.push(n))}function aR(e){return zr=5,is(function(){return{current:e}},[])}function cR(e,t,n){zr=6,Zg(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 is(e,t){var n=ar(Zt++,7);return il(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function xr(e,t){return zr=8,is(function(){return e},t)}function uR(e){var t=ge.context[e.__c],n=ar(Zt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(ge)),t.props.value):e.__}function lR(e,t){ke.useDebugValue&&ke.useDebugValue(t?t(e):e)}function dR(e){var t=ar(Zt++,10),n=$n();return t.__=e,ge.componentDidCatch||(ge.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function fR(){var e=ar(Zt++,11);if(!e.__){for(var t=ge.__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 pR(){for(var e;e=Xg.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Qs),e.__H.__h.forEach(Wc),e.__H.__h=[]}catch(t){e.__H.__h=[],ke.__e(t,e.__v)}}ke.__b=function(e){ge=null,Af&&Af(e)},ke.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Of&&Of(e,t)},ke.__r=function(e){Cf&&Cf(e),Zt=0;var t=(ge=e.__c).__H;t&&(Ja===ge?(t.__h=[],ge.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Xs,n.__N=n.i=void 0})):(t.__h.forEach(Qs),t.__h.forEach(Wc),t.__h=[],Zt=0)),Ja=ge},ke.diffed=function(e){Nf&&Nf(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Xg.push(t)!==1&&Rf===ke.requestAnimationFrame||((Rf=ke.requestAnimationFrame)||hR)(pR)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Xs&&(n.__=n.__V),n.i=void 0,n.__V=Xs})),Ja=ge=null},ke.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Qs),n.__h=n.__h.filter(function(r){return!r.__||Wc(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ke.__e(r,n.__v)}}),xf&&xf(e,t)},ke.unmount=function(e){Mf&&Mf(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Qs(r)}catch(o){t=o}}),n.__H=void 0,t&&ke.__e(t,n.__v))};var Pf=typeof requestAnimationFrame=="function";function hR(e){var t,n=function(){clearTimeout(r),Pf&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Pf&&(t=requestAnimationFrame(n))}function Qs(e){var t=ge,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ge=t}function Wc(e){var t=ge;e.__c=e.__(),ge=t}function il(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function e_(e,t){return typeof t=="function"?t(e):t}const mR=Object.defineProperty({__proto__:null,useCallback:xr,useContext:uR,useDebugValue:lR,useEffect:iR,useErrorBoundary:dR,useId:fR,useImperativeHandle:cR,useLayoutEffect:Zg,useMemo:is,useReducer:Qg,useRef:aR,useState:$n},Symbol.toStringTag,{value:"Module"}),gR="http://www.w3.org/2000/svg";function _R(){const e=r=>me.createElementNS(gR,r),t=tt(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=tt(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 yR({options:e}){const t=is(()=>({__html:_R().outerHTML}),[]);return ee("h2",{class:"dialog__header"},ee("span",{class:"dialog__title"},e.formTitle),e.showBranding?ee("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function bR(e,t){const 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 Xa(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function SR({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:o,onSubmitSuccess:s,onSubmitError:i,showEmail:a,showName:c,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:h,emailPlaceholder:m,isEmailRequired:g,isNameRequired:y,messageLabel:S,messagePlaceholder:k,nameLabel:E,namePlaceholder:x,submitButtonLabel:w,isRequiredLabel:b}=e,[I,B]=$n(!1),[v,P]=$n(null),[R,L]=$n(!1),$=u==null?void 0:u.input,[J,te]=$n(null),F=xr(T=>{te(T),L(!1)},[]),O=xr(T=>{const W=bR(T,{emailLabel:h,isEmailRequired:g,isNameRequired:y,messageLabel:S,nameLabel:E});return W.length>0?P(`Please enter in the following required fields: ${W.join(", ")}`):P(null),W.length===0},[h,g,y,S,E]),Q=xr(async T=>{B(!0);try{if(T.preventDefault(),!(T.target instanceof HTMLFormElement))return;const W=new FormData(T.target),z=await(u&&R?u.value():void 0),ne={name:Xa(W,"name"),email:Xa(W,"email"),message:Xa(W,"message"),attachments:z?[z]:void 0};if(!O(ne))return;try{const ie=await o({name:ne.name,email:ne.email,message:ne.message,source:Wk,tags:d},{attachments:ne.attachments});s(ne,ie)}catch(ie){Ys&&_.error(ie);const de=ie instanceof Error?ie:new Error(String(ie));P(de.message),i(de)}}finally{B(!1)}},[u&&R,s,i]);return ee("form",{class:"form",onSubmit:Q},$&&R?ee($,{onError:F}):null,ee("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:I},ee("div",{class:"form__top"},v?ee("div",{class:"form__error-container"},v):null,c?ee("label",{for:"name",class:"form__label"},ee(Qa,{label:E,isRequiredLabel:b,isRequired:y}),ee("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:x,required:y,type:"text"})):ee("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?ee("label",{for:"email",class:"form__label"},ee(Qa,{label:h,isRequiredLabel:b,isRequired:g}),ee("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:g,type:"email"})):ee("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),ee("label",{for:"message",class:"form__label"},ee(Qa,{label:S,isRequiredLabel:b,isRequired:!0}),ee("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:k,required:!0,rows:5})),$?ee("label",{for:"screenshot",class:"form__label"},ee("button",{class:"btn btn--default",disabled:I,type:"button",onClick:()=>{te(null),L(T=>!T)}},R?f:l),J?ee("div",{class:"form__error-container"},J.message):null):null),ee("div",{class:"btn-group"},ee("button",{class:"btn btn--primary",disabled:I,type:"submit"},w),ee("button",{class:"btn btn--default",disabled:I,type:"button",onClick:r},p))))}function Qa({label:e,isRequired:t,isRequiredLabel:n}){return ee("span",{class:"form__label__text"},e,t&&ee("span",{class:"form__label__text--required"},n))}const Cs=16,Lf=17,vR="http://www.w3.org/2000/svg";function ER(){const e=c=>ht.document.createElementNS(vR,c),t=tt(e("svg"),{width:`${Cs}`,height:`${Lf}`,viewBox:`0 0 ${Cs} ${Lf}`,fill:"inherit"}),n=tt(e("g"),{clipPath:"url(#clip0_57_156)"}),r=tt(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"}),o=tt(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(o,r);const s=e("defs"),i=tt(e("clipPath"),{id:"clip0_57_156"}),a=tt(e("rect"),{width:`${Cs}`,height:`${Cs}`,fill:"white",transform:"translate(0 0.5)"});return i.appendChild(a),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(a),t}function TR({open:e,onFormSubmitted:t,...n}){const r=n.options,o=is(()=>({__html:ER().outerHTML}),[]),[s,i]=$n(null),a=xr(()=>{s&&(clearTimeout(s),i(null)),t()},[s]),c=xr((u,d)=>{n.onSubmitSuccess(u,d),i(setTimeout(()=>{t(),i(null)},zk))},[t]);return ee(ss,null,s?ee("div",{class:"success__position",onClick:a},ee("div",{class:"success__content"},r.successMessageText,ee("span",{class:"success__icon",dangerouslySetInnerHTML:o}))):ee("dialog",{class:"dialog",onClick:r.onFormClose,open:e},ee("div",{class:"dialog__position"},ee("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},ee(yR,{options:r}),ee(SR,{...n,onSubmitSuccess:c})))))}const IR=`
.dialog {
position: fixed;
z-index: var(--z-index);
margin: 0;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
height: 100vh;
width: 100vw;
color: var(--dialog-color, var(--foreground));
fill: var(--dialog-color, var(--foreground));
line-height: 1.75em;
background-color: rgba(0, 0, 0, 0.05);
border: none;
inset: 0;
opacity: 1;
transition: opacity 0.2s ease-in-out;
}
.dialog__position {
position: fixed;
z-index: var(--z-index);
inset: var(--dialog-inset);
padding: var(--page-margin);
display: flex;
max-height: calc(100vh - (2 * var(--page-margin)));
}
@media (max-width: 600px) {
.dialog__position {
inset: var(--page-margin);
padding: 0;
}
}
.dialog__position:has(.editor) {
inset: var(--page-margin);
padding: 0;
}
.dialog:not([open]) {
opacity: 0;
pointer-events: none;
visibility: hidden;
}
.dialog:not([open]) .dialog__content {
transform: translate(0, -16px) scale(0.98);
}
.dialog__content {
display: flex;
flex-direction: column;
gap: 16px;
padding: var(--dialog-padding, 24px);
max-width: 100%;
width: 100%;
max-height: 100%;
overflow: auto;
background: var(--dialog-background, var(--background));
border-radius: var(--dialog-border-radius, 20px);
border: var(--dialog-border, var(--border));
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
transform: translate(0, 0) scale(1);
transition: transform 0.2s ease-in-out;
}
`,wR=`
.dialog__header {
display: flex;
gap: 4px;
justify-content: space-between;
font-weight: var(--dialog-header-weight, 600);
margin: 0;
}
.dialog__title {
align-self: center;
width: var(--form-width, 272px);
}
@media (max-width: 600px) {
.dialog__title {
width: auto;
}
}
.dialog__position:has(.editor) .dialog__title {
width: auto;
}
.brand-link {
display: inline-flex;
}
.brand-link:focus-visible {
outline: var(--outline);
}
`,kR=`
.form {
display: flex;
overflow: auto;
flex-direction: row;
gap: 16px;
flex: 1 0;
}
.form fieldset {
border: none;
margin: 0;
padding: 0;
}
.form__right {
flex: 0 0 auto;
display: flex;
overflow: auto;
flex-direction: column;
justify-content: space-between;
gap: 20px;
width: var(--form-width, 100%);
}
.dialog__position:has(.editor) .form__right {
width: var(--form-width, 272px);
}
.form__top {
display: flex;
flex-direction: column;
gap: 8px;
}
.form__error-container {
color: var(--error-color);
fill: var(--error-color);
}
.form__label {
display: flex;
flex-direction: column;
gap: 4px;
margin: 0px;
}
.form__label__text {
display: flex;
gap: 4px;
align-items: center;
}
.form__label__text--required {
font-size: 0.85em;
}
.form__input {
font-family: inherit;
line-height: inherit;
background: transparent;
box-sizing: border-box;
border: var(--input-border, var(--border));
border-radius: var(--input-border-radius, 6px);
color: var(--input-color, inherit);
fill: var(--input-color, inherit);
font-size: var(--input-font-size, inherit);
font-weight: var(--input-font-weight, 500);
padding: 6px 12px;
}
.form__input::placeholder {
opacity: 0.65;
color: var(--input-placeholder-color, inherit);
filter: var(--interactive-filter);
}
.form__input:focus-visible {
outline: var(--input-focus-outline, var(--outline));
}
.form__input--textarea {
font-family: inherit;
resize: vertical;
}
.error {
color: var(--error-color);
fill: var(--error-color);
}
`,RR=`
.btn-group {
display: grid;
gap: 8px;
}
.btn {
line-height: inherit;
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
cursor: pointer;
font-family: inherit;
font-size: var(--button-font-size, inherit);
font-weight: var(--button-font-weight, 600);
padding: var(--button-padding, 6px 16px);
}
.btn[disabled] {
opacity: 0.6;
pointer-events: none;
}
.btn--primary {
color: var(--button-primary-color, var(--accent-foreground));
fill: var(--button-primary-color, var(--accent-foreground));
background: var(--button-primary-background, var(--accent-background));
border: var(--button-primary-border, var(--border));
border-radius: var(--button-primary-border-radius, 6px);
font-weight: var(--button-primary-font-weight, 500);
}
.btn--primary:hover {
color: var(--button-primary-hover-color, var(--accent-foreground));
fill: var(--button-primary-hover-color, var(--accent-foreground));
background: var(--button-primary-hover-background, var(--accent-background));
filter: var(--interactive-filter);
}
.btn--primary:focus-visible {
background: var(--button-primary-hover-background, var(--accent-background));
filter: var(--interactive-filter);
outline: var(--button-primary-focus-outline, var(--outline));
}
.btn--default {
color: var(--button-color, var(--foreground));
fill: var(--button-color, var(--foreground));
background: var(--button-background, var(--background));
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
font-weight: var(--button-font-weight, 500);
}
.btn--default:hover {
color: var(--button-color, var(--foreground));
fill: var(--button-color, var(--foreground));
background: var(--button-hover-background, var(--background));
filter: var(--interactive-filter);
}
.btn--default:focus-visible {
background: var(--button-hover-background, var(--background));
filter: var(--interactive-filter);
outline: var(--button-focus-outline, var(--outline));
}
`,AR=`
.success__position {
position: fixed;
inset: var(--dialog-inset);
padding: var(--page-margin);
z-index: var(--z-index);
}
.success__content {
background: var(--success-background, var(--background));
border: var(--success-border, var(--border));
border-radius: var(--success-border-radius, 1.7em/50%);
box-shadow: var(--success-box-shadow, var(--box-shadow));
font-weight: var(--success-font-weight, 600);
color: var(--success-color);
fill: var(--success-color);
padding: 12px 24px;
line-height: 1.75em;
display: grid;
align-items: center;
grid-auto-flow: column;
gap: 6px;
cursor: default;
}
.success__icon {
display: flex;
}
`;function CR(e){const t=me.createElement("style");return t.textContent=`
:host {
--dialog-inset: var(--inset);
}
${IR}
${wR}
${kR}
${RR}
${AR}
`,e&&t.setAttribute("nonce",e),t}function NR(){const e=j().getUser(),t=he().getUser(),n=Ct().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const xR=(()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const o=r,s=e.useSentryUser,i=NR(),a=me.createElement("div"),c=CR(e.styleNonce);let u="";const d={get el(){return a},appendToDom(){!o.contains(c)&&!o.contains(a)&&(o.appendChild(c),o.appendChild(a))},removeFromDom(){a.remove(),c.remove(),me.body.style.overflow=u},open(){var p,h;f(!0),(p=e.onFormOpen)==null||p.call(e),(h=N())==null||h.emit("openFeedbackWidget"),u=me.body.style.overflow,me.body.style.overflow="hidden"},close(){f(!1),me.body.style.overflow=u}},l=t==null?void 0:t.createInput({h:ee,hooks:mR,dialog:d,options:e}),f=p=>{sR(ee(TR,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(s&&(i==null?void 0:i[s.name])||""),defaultEmail:String(s&&(i==null?void 0:i[s.email])||""),onFormClose:()=>{var h;f(!1),(h=e.onFormClose)==null||h.call(e)},onSubmit:n,onSubmitSuccess:(h,m)=>{var g;f(!1),(g=e.onSubmitSuccess)==null||g.call(e,h,m)},onSubmitError:h=>{var m;(m=e.onSubmitError)==null||m.call(e,h)},onFormSubmitted:()=>{var h;(h=e.onFormSubmitted)==null||h.call(e)},open:p}),a)};return d}}));function MR({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 OR(e){const t=me.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`
.editor {
display: flex;
flex-grow: 1;
flex-direction: column;
}
.editor__image-container {
justify-items: center;
padding: 15px;
position: relative;
height: 100%;
border-radius: var(--menu-border-radius, 6px);
background-color: ${n};
background-image: repeating-linear-gradient(
-145deg,
transparent,
transparent 8px,
${n} 8px,
${n} 11px
),
repeating-linear-gradient(
-45deg,
transparent,
transparent 15px,
${r} 15px,
${r} 16px
);
}
.editor__canvas-container {
width: 100%;
height: 100%;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.editor__canvas-container > * {
object-fit: contain;
position: absolute;
}
.editor__tool-container {
padding-top: 8px;
display: flex;
justify-content: center;
}
.editor__tool-bar {
display: flex;
gap: 8px;
}
.editor__tool {
display: flex;
padding: 8px 12px;
justify-content: center;
align-items: center;
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
background: var(--button-background, var(--background));
color: var(--button-color, var(--foreground));
}
.editor__tool--active {
background: var(--button-primary-background, var(--accent-background));
color: var(--button-primary-color, var(--accent-foreground));
}
.editor__rect {
position: absolute;
z-index: 2;
}
.editor__rect button {
opacity: 0;
position: absolute;
top: -12px;
right: -12px;
cursor: pointer;
padding: 0;
z-index: 3;
border: none;
background: none;
}
.editor__rect:hover button {
opacity: 1;
}
`,e&&t.setAttribute("nonce",e),t}function PR({h:e}){return function({action:n,setAction:r,options:o}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},o.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},o.hideToolText)))}}function LR({hooks:e}){function t(){const[n,r]=e.useState(ht.devicePixelRatio??1);return e.useEffect(()=>{const o=()=>{r(ht.devicePixelRatio)},s=matchMedia(`(resolution: ${ht.devicePixelRatio}dppx)`);return s.addEventListener("change",o),()=>{s.removeEventListener("change",o)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:o,onAfterScreenshot:s,onError:i}){const a=t();e.useEffect(()=>{(async()=>{r();const u=await So.mediaDevices.getDisplayMedia({video:{width:ht.innerWidth*a,height:ht.innerHeight*a},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=me.createElement("video");await new Promise((l,f)=>{d.srcObject=u,d.onloadedmetadata=()=>{o(d,a),u.getTracks().forEach(p=>p.stop()),l()},d.play().catch(f)}),s()})().catch(i)},[])}}function DR(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);break}}function sn(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function Za(e,t){sn(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function ec(e,t,n){sn(e,{alpha:!0},(r,o)=>{n.length&&(o.fillStyle="rgba(0, 0, 0, 0.25)",o.fillRect(0,0,r.width,r.height)),n.forEach(s=>{DR(s,o,t)})})}function FR({h:e,hooks:t,outputBuffer:n,dialog:r,options:o}){const s=LR({hooks:t}),i=PR({h:e}),a=MR({h:e}),c={__html:OR(o.styleNonce).innerText},u=r.el.style,d=({screenshot:l})=>{const[f,p]=t.useState("highlight"),[h,m]=t.useState([]),g=t.useRef(null),y=t.useRef(null),S=t.useRef(null),k=t.useRef(null),[E,x]=t.useState(1),w=t.useMemo(()=>{const R=me.getElementById(o.id);if(!R)return"white";const L=getComputedStyle(R);return L.getPropertyValue("--button-primary-background")||L.getPropertyValue("--accent-background")},[o.id]);t.useLayoutEffect(()=>{const R=()=>{const L=g.current;L&&(sn(l.canvas,{alpha:!1},$=>{const J=Math.min(L.clientWidth/$.width,L.clientHeight/$.height);x(J)}),(L.clientHeight===0||L.clientWidth===0)&&setTimeout(R,0))};return R(),ht.addEventListener("resize",R),()=>{ht.removeEventListener("resize",R)}},[l]);const b=t.useCallback((R,L)=>{sn(R,{alpha:!0},($,J)=>{J.scale(L,L),$.width=l.canvas.width,$.height=l.canvas.height})},[l]);t.useEffect(()=>{b(y.current,l.dpi),Za(y.current,l.canvas)},[l]),t.useEffect(()=>{b(S.current,l.dpi),sn(S.current,{alpha:!0},(R,L)=>{L.clearRect(0,0,R.width,R.height)}),ec(S.current,w,h)},[h,w]),t.useEffect(()=>{b(n,l.dpi),Za(n,l.canvas),sn(me.createElement("canvas"),{alpha:!0},(R,L)=>{L.scale(l.dpi,l.dpi),R.width=l.canvas.width,R.height=l.canvas.height,ec(R,w,h),Za(n,R)})},[h,l,w]);const I=R=>{if(!f||!k.current)return;const L=k.current.getBoundingClientRect(),$={type:f,x:R.offsetX/E,y:R.offsetY/E},J=(O,Q)=>{const T=(Q.clientX-L.x)/E,W=(Q.clientY-L.y)/E;return{type:O.type,x:Math.min(O.x,T),y:Math.min(O.y,W),w:Math.abs(T-O.x),h:Math.abs(W-O.y)}},te=O=>{sn(S.current,{alpha:!0},(Q,T)=>{T.clearRect(0,0,Q.width,Q.height)}),ec(S.current,w,[...h,J($,O)])},F=O=>{const Q=J($,O);Q.w*E>=1&&Q.h*E>=1&&m(T=>[...T,Q]),me.removeEventListener("mousemove",te),me.removeEventListener("mouseup",F)};me.addEventListener("mousemove",te),me.addEventListener("mouseup",F)},B=t.useCallback(R=>L=>{L.preventDefault(),L.stopPropagation(),m($=>{const J=[...$];return J.splice(R,1),J})},[]),v={width:`${l.canvas.width*E}px`,height:`${l.canvas.height*E}px`},P=R=>{R.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:o.styleNonce,dangerouslySetInnerHTML:c}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:g},e("canvas",{ref:y,id:"background",style:v}),e("canvas",{ref:S,id:"foreground",style:v}),e("div",{ref:k,onMouseDown:I,style:v},h.map((R,L)=>e("div",{key:L,class:"editor__rect",style:{top:`${R.y*E}px`,left:`${R.x*E}px`,width:`${R.w*E}px`,height:`${R.h*E}px`}},e("button",{"aria-label":o.removeHighlightText,onClick:B(L),onMouseDown:P,onMouseUp:P,type:"button"},e(a,null))))))),e(i,{options:o,action:f,setAction:p}))};return function({onError:f}){const[p,h]=t.useState();return s({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((m,g)=>{sn(me.createElement("canvas"),{alpha:!1},(y,S)=>{S.scale(g,g),y.width=m.videoWidth,y.height=m.videoHeight,S.drawImage(m,0,0,y.width,y.height),h({canvas:y,dpi:g})}),n.width=m.videoWidth,n.height=m.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(m=>{u.display="block",f(m)},[])}),p?e(d,{screenshot:p}):e("div",null)}}const $R=(()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const o=me.createElement("canvas");return{input:FR({h:e,hooks:t,outputBuffer:o,dialog:n,options:r}),value:async()=>{const s=await new Promise(i=>{o.toBlob(i,"image/png")});if(s)return{data:new Uint8Array(await s.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}})),A=H;let jc=0;function t_(){return jc>0}function BR(){jc++,setTimeout(()=>{jc--})}function qr(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{if(Object.prototype.hasOwnProperty.call(e,"__sentry_wrapped__")){const s=e.__sentry_wrapped__;return typeof s=="function"?s:e}if(zi(e))return e}catch{return e}const r=function(...o){H._sentryWrappedDepth=(H._sentryWrappedDepth||0)+1;try{const s=o.map(i=>qr(i,t));return e.apply(this,s)}catch(s){throw BR(),Ge(i=>{i.addEventProcessor(a=>(t.mechanism&&(bc(a,void 0),At(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),pe(s)}),s}finally{H._sentryWrappedDepth=(H._sentryWrappedDepth||0)-1}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}bh(r,e),we(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Ii(){const e=ir(),{referrer:t}=A.document||{},{userAgent:n}=A.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const UR=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],HR={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"};function WR(e){return HR[e]||e.replace("Integration","").toLowerCase()}const Df=A;async function n_(e,t){const n=UR.includes(e)?WR(e):void 0,r=Df.Sentry=Df.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);const o=r[e];if(typeof o=="function"&&!("_isShim"in o))return o;const s=jR(n),i=A.document.createElement("script");i.src=s,i.crossOrigin="anonymous",i.referrerPolicy="strict-origin",t&&i.setAttribute("nonce",t);const a=new Promise((l,f)=>{i.addEventListener("load",()=>l()),i.addEventListener("error",f)}),c=A.document.currentScript,u=A.document.body||A.document.head||(c==null?void 0:c.parentElement);if(u)u.appendChild(i);else throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);try{await a}catch{throw new Error(`Error when loading integration: ${e}`)}const d=r[e];if(typeof d!="function")throw new Error(`Could not load integration: ${e}`);return d}function jR(e){var r;const t=N(),n=((r=t==null?void 0:t.getOptions())==null?void 0:r.cdnBaseUrl)||"https://browser.sentry-cdn.com";return new URL(`/${mt}/${e}.min.js`,n).toString()}const zR=zg({lazyLoadIntegration:n_}),Ff=zg({getModalIntegration:()=>xR,getScreenshotIntegration:()=>$R});function pa(e,t){const n=ha(e,t),r={type:KR(t),value:JR(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function qR(e,t,n,r){const o=N(),s=o==null?void 0:o.getOptions().normalizeDepth,i=ZR(t),a={__serialized__:Ih(t,s)};if(i)return{exception:{values:[pa(e,i)]},extra:a};const c={exception:{values:[{type:ji(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:XR(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=ha(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function tc(e,t){return{exception:{values:[pa(e,t)]}}}function ha(e,t){const n=t.stacktrace||t.stack||"",r=VR(t),o=YR(t);try{return e(n,r,o)}catch{}return[]}const GR=/Minified React error #\d+;/i;function VR(e){return e&&GR.test(e.message)?1:0}function YR(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function r_(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function KR(e){const t=e==null?void 0:e.name;return!t&&r_(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function JR(e){const t=e==null?void 0:e.message;return r_(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Mc(t.error):Mc(e):"No error message"}function o_(e,t,n,r){const o=(n==null?void 0:n.syntheticException)||void 0,s=ma(e,t,o,r);return At(s),s.level="error",n!=null&&n.event_id&&(s.event_id=n.event_id),es(s)}function s_(e,t,n="info",r,o){const s=(r==null?void 0:r.syntheticException)||void 0,i=zc(e,t,s,o);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),es(i)}function ma(e,t,n,r,o){var i,a;let s;if(yh(t)&&t.error)return tc(e,t.error);if(ad(t)||Kb(t)){const c=t;if("stack"in t){s=tc(e,t);const u=(a=(i=s.exception)==null?void 0:i.values)==null?void 0:a[0];if(r&&n&&u&&!u.stacktrace){const d=ha(e,n);d.length&&(u.stacktrace={frames:d},At(s,{synthetic:!0}))}}else{const u=c.name||(ad(c)?"DOMError":"DOMException"),d=c.message?`${u}: ${c.message}`:u;s=zc(e,d,n,r),bc(s,d)}return"code"in c&&(s.tags={...s.tags,"DOMException.code":`${c.code}`}),s}return Rt(t)?tc(e,t):je(t)||ji(t)?(s=qR(e,t,n,o),At(s,{synthetic:!0}),s):(s=zc(e,t,n,r),bc(s,`${t}`),At(s,{synthetic:!0}),s)}function zc(e,t,n,r){const o={};if(r&&n){const s=ha(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),At(o,{synthetic:!0})}if(Wi(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return o.logentry={message:s,params:i},o}return o.message=t,o}function XR(e,{isUnhandledRejection:t}){const n=Xb(e),r=t?"promise rejection":"exception";return yh(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ji(e)?`Event \`${QR(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function QR(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ZR(e){return Object.values(e).find(t=>t instanceof Error)}class i_ extends QE{constructor(t){var d;const n=eA(t),r=A.SENTRY_SDK_SOURCE||wE();Vm(n,"browser",["browser"],r),super(n);const{userInfo:o}=this.getDataCollectionOptions();(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:o?"auto":"never",...n._metadata.sdk.settings});const{sendClientReports:s,enableLogs:i,_experiments:a,enableMetrics:c}=this._options,u=c??(a==null?void 0:a.enableMetrics)??!0;A.document&&(s||i||u)&&A.document.addEventListener("visibilitychange",()=>{A.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&_i(this),u&&Pu(this))}),o&&this.on("beforeSendSession",mT)}eventFromException(t,n){return o_(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return s_(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function eA(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=A.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const St=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,V=H,tA=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",as=(e,t,n,r)=>{let o,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(o??0),(s||o===void 0)&&(o=t.value,t.delta=s,t.rating=tA(t.value,n),e(t)))}},cs=(e=!0)=>{var n,r;const t=(r=(n=V.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},co=()=>{const e=cs();return(e==null?void 0:e.activationStart)??0};function dn(e,t,n){V.document&&V.addEventListener(e,t,n)}function wi(e,t,n){V.document&&V.removeEventListener(e,t,n)}let Mr=-1;const a_=new Set,nA=()=>{var e,t;return((e=V.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=V.document)!=null&&t.prerendering)?0:1/0},Zs=e=>{if(rA(e)&&Mr>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of a_)t();isFinite(Mr)||(Mr=e.type==="visibilitychange"?e.timeStamp:0,wi("prerenderingchange",Zs,!0))}},us=()=>{var e;if(V.document&&Mr<0){const t=co();Mr=(V.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??nA(),dn("visibilitychange",Zs,!0),dn("pagehide",Zs,!0),dn("prerenderingchange",Zs,!0)}return{get firstHiddenTime(){return Mr},onHidden(t){a_.add(t)}}};function rA(e){var t;return e.type==="pagehide"||((t=V.document)==null?void 0:t.visibilityState)==="hidden"}const oA=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ls=(e,t=-1)=>{var s,i;const n=cs();let r="navigate";return n&&((s=V.document)!=null&&s.prerendering||co()>0?r="prerender":(i=V.document)!=null&&i.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:oA(),navigationType:r}},nc=new WeakMap;function al(e,t){try{return nc.get(e)||nc.set(e,new t),nc.get(e)}catch{return new t}}class sA{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(t){var o;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(o=this._onAfterProcessingUnexpectedShift)==null||o.call(this,t)}}const uo=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},cl=e=>{let t=!1;return()=>{t||(e(),t=!0)}},ga=e=>{var t;(t=V.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},iA=[1800,3e3],aA=(e,t={})=>{ga(()=>{const n=us(),r=ls("FCP");let o;const i=uo("paint",a=>{for(const c of a)c.name==="first-contentful-paint"&&(i.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-co(),0),r.entries.push(c),o(!0)))});i&&(o=as(e,r,iA,t.reportAllChanges))})},cA=[.1,.25],uA=(e,t={})=>{aA(cl(()=>{var c;const n=ls("CLS",0);let r;const o=us(),s=al(t,sA),i=u=>{for(const d of u)s._processEntry(d);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=uo("layout-shift",i);a&&(r=as(e,n,cA,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),(c=V==null?void 0:V.setTimeout)==null||c.call(V,r))}))};let c_=0,rc=1/0,Ns=0;const lA=e=>{e.forEach(t=>{t.interactionId&&(rc=Math.min(rc,t.interactionId),Ns=Math.max(Ns,t.interactionId),c_=Ns?(Ns-rc)/7+1:0)})};let qc;const u_=()=>qc?c_:performance.interactionCount||0,dA=()=>{"interactionCount"in performance||qc||(qc=uo("event",lA,{type:"event",buffered:!0,durationThreshold:0}))},oc=10;let l_=0;const fA=()=>u_()-l_;class pA{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){l_=u_(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(fA()/50));return this._longestInteractionList[t]}_processEntry(t){var o,s;if((o=this._onBeforeProcessingEntry)==null||o.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<oc||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>oc){const i=this._longestInteractionList.splice(oc);for(const a of i)this._longestInteractionMap.delete(a.id)}(s=this._onAfterProcessingINPCandidate)==null||s.call(this,r)}}}const d_=e=>{var n;const t=V.requestIdleCallback||V.setTimeout;((n=V.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=cl(e),dn("visibilitychange",e,{once:!0,capture:!0}),dn("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),wi("visibilitychange",e,{capture:!0}),wi("pagehide",e,{capture:!0})}))},hA=[200,500],mA=40,gA=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=us();ga(()=>{dA();const r=ls("INP");let o;const s=al(t,pA),i=c=>{d_(()=>{for(const d of c)s._processEntry(d);const u=s._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=uo("event",i,{durationThreshold:t.durationThreshold??mA});o=as(e,r,hA,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class _A{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const yA=[2500,4e3],bA=(e,t={})=>{ga(()=>{const n=us(),r=ls("LCP");let o;const s=al(t,_A),i=c=>{t.reportAllChanges||(c=c.slice(-1));for(const u of c)s._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-co(),0),r.entries=[u],o())},a=uo("largest-contentful-paint",i);if(a){o=as(e,r,yA,t.reportAllChanges);const c=cl(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),u=d=>{d.isTrusted&&(d_(c),wi(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])dn(d,u,{capture:!0})}})},SA=[800,1800],Gc=e=>{var t,n;(t=V.document)!=null&&t.prerendering?ga(()=>Gc(e)):((n=V.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>Gc(e),!0):setTimeout(e)},vA=(e,t={})=>{const n=ls("TTFB"),r=as(e,n,SA,t.reportAllChanges);Gc(()=>{const o=cs();o&&(n.value=Math.max(o.responseStart-co(),0),n.entries=[o],r(!0))})},wo={},ki={};let f_,p_,h_,m_;function _a(e,t=!1){return ba("cls",e,TA,f_,t)}function ya(e,t=!1){return ba("lcp",e,IA,p_,t)}function EA(e){return ba("ttfb",e,wA,h_)}function ul(e){return ba("inp",e,kA,m_)}function Sn(e,t){return g_(e,t),ki[e]||(RA(e),ki[e]=!0),__(e,t)}function ds(e,t){const n=wo[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(o){St&&_.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${Xt(r)}
Error:`,o)}}function TA(){return uA(e=>{ds("cls",{metric:e}),f_=e},{reportAllChanges:!0})}function IA(){return bA(e=>{ds("lcp",{metric:e}),p_=e},{reportAllChanges:!0})}function wA(){return vA(e=>{ds("ttfb",{metric:e}),h_=e})}function kA(){return gA(e=>{ds("inp",{metric:e}),m_=e})}function ba(e,t,n,r,o=!1){g_(e,t);let s;return ki[e]||(s=n(),ki[e]=!0),r&&t({metric:r}),__(e,t,o?s:void 0)}function RA(e){const t={};e==="event"&&(t.durationThreshold=0),uo(e,n=>{ds(e,{entries:n})},t)}function g_(e,t){wo[e]=wo[e]||[],wo[e].push(t)}function __(e,t,n){return()=>{n&&n();const r=wo[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function AA(e){return"duration"in e}const CA=80,Pn={};try{typeof Node<"u"&&(Pn.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(Pn.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,Pn.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,Pn.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,Pn.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(Pn.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function rn(e,t,n){const r=Pn[t];if(r)try{return r.call(e,n)}catch{}const o=e[t];return typeof o=="function"?o.call(e,n):o}function Pe(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||CA;for(;n&&s++<r&&(u=NA(n,d),!(u==="html"||s>1&&i+o.length*c+u.length>=l));)o.push(u),i+=u.length,n=rn(n,"parentNode");return o.reverse().join(a)}catch{return"<unknown>"}}function NA(e,t){const n=[],r=rn(e,"tagName");if(!r)return"";if(typeof HTMLElement<"u"&&e instanceof HTMLElement){const s=rn(e,"dataset");if(s){if(s.sentryComponent)return s.sentryComponent;if(s.sentryElement)return s.sentryElement}}n.push(r.toLowerCase());const o=t!=null&&t.length?t.filter(s=>rn(e,"getAttribute",s)).map(s=>[s,rn(e,"getAttribute",s)]):null;if(o!=null&&o.length)o.forEach(s=>{n.push(`[${s[0]}="${s[1]}"]`)});else{const s=rn(e,"id");s&&n.push(`#${s}`);const i=rn(e,"className");if(i&>(i)){const a=i.split(/\s+/);for(const c of a)n.push(`.${c}`)}}for(const s of["aria-label","type","name","title","alt"]){const i=rn(e,"getAttribute",s);i&&n.push(`[${s}="${i}"]`)}return n.join("")}const xA=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=V.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};dn("visibilitychange",t,{capture:!0,once:!0}),dn("pagehide",t,{capture:!0,once:!0})};function sc(e){return typeof e=="number"&&isFinite(e)}function vn(e,t,n,{...r}){const o=U(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),gn(e,()=>{const s=qe({startTime:t,...r});return s&&s.end(n),s})}function ll(e){var g;const t=N();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a}=t.getOptions(),{userInfo:c}=t.getDataCollectionOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=j(),f=l.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=l.getScopeData().contexts.profile.profile_id}catch{}const m={release:i,environment:a,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(g=V.navigator)==null?void 0:g.userAgent,"client.address":c?"{{auto}}":void 0,...o};return qe({name:n,attributes:m,startTime:s,experimental:{standalone:!0}})}function cr(){return V.addEventListener&&V.performance}function ve(e){return e/1e3}function MA(e){let t="unknown",n="unknown",r="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function Sa(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function va(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n.spanContext().spanId,n),r=!0}xA(()=>{o("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,c)=>{c!=null&&c.isRedirect||(o("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",a=>{n=a,i()})}function OA(e){let t=0,n;if(!Sa("layout-shift"))return;const r=_a(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);va(e,(o,s)=>{PA(t,n,s,o),r()})}function PA(e,t,n,r){var u;St&&_.log(`Sending CLS span (${e})`);const o=t?ve((Ce()||0)+t.startTime):ye(),s=j().getScopeData().transactionName,i=t?Pe((u=t.sources[0])==null?void 0:u.node):"Layout shift",a={[Y]:"auto.http.browser.cls",[ce]:"ui.webvital.cls",[Rn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{a[`cls.source.${l+1}`]=Pe(d.node)});const c=ll({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("cls",{[Yo]:"",[Ko]:e}),c.end(o))}const LA=6e4;function fs(e){return e!=null&&e>0&&e<=LA}function DA(e){let t=0,n;if(!Sa("largest-contentful-paint"))return;const r=ya(({metric:o})=>{const s=o.entries[o.entries.length-1];!s||!fs(o.value)||(t=o.value,n=s)},!0);va(e,(o,s)=>{FA(t,n,s,o),r()})}function FA(e,t,n,r){if(!fs(e))return;St&&_.log(`Sending LCP span (${e})`);const o=ve((Ce()||0)+((t==null?void 0:t.startTime)||0)),s=j().getScopeData().transactionName,i=t?Pe(t.element):"Largest contentful paint",a={[Y]:"auto.http.browser.lcp",[ce]:"ui.webvital.lcp",[Rn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Pe(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const c=ll({name:i,transaction:s,attributes:a,startTime:o});c&&(c.addEvent("lcp",{[Yo]:"millisecond",[Ko]:e}),c.end(o))}function rt(e){return e&&((Ce()||performance.timeOrigin)+e)/1e3}function y_(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:o}=MA(e.nextHopProtocol);t["network.protocol.version"]=o,t["network.protocol.name"]=r}return Ce()||(n=cr())!=null&&n.timeOrigin?$A({...t,"http.request.redirect_start":rt(e.redirectStart),"http.request.redirect_end":rt(e.redirectEnd),"http.request.worker_start":rt(e.workerStart),"http.request.fetch_start":rt(e.fetchStart),"http.request.domain_lookup_start":rt(e.domainLookupStart),"http.request.domain_lookup_end":rt(e.domainLookupEnd),"http.request.connect_start":rt(e.connectStart),"http.request.secure_connection_start":rt(e.secureConnectionStart),"http.request.connection_end":rt(e.connectEnd),"http.request.request_start":rt(e.requestStart),"http.request.response_start":rt(e.responseStart),"http.request.response_end":rt(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function $A(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const BA=2147483647;let $f=0,Ke={},Ye,Er;function UA({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=cr();if(r&&Ce()){r.mark&&V.performance.mark("sentry-tracing-init");const o=t?DA(n):t===!1?qA():void 0,s=e?OA(n):e===!1?zA():void 0,i=GA(),a=VA();return()=>{i(),a(),o==null||o(),s==null||s()}}return()=>{}}function HA(){Sn("longtask",({entries:e})=>{const t=Te();if(!t)return;const{op:n,start_timestamp:r}=U(t);for(const o of e){const s=ve(Ce()+o.startTime),i=ve(o.duration);n==="navigation"&&r&&s<r||vn(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Y]:"auto.ui.browser.metrics"}})}})}function WA(){new PerformanceObserver(t=>{const n=Te();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=ve(Ce()+r.startTime),{start_timestamp:s,op:i}=U(n);if(i==="navigation"&&s&&o<s)continue;const a=ve(r.duration),c={[Y]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;c["browser.script.invoker"]=d,c["browser.script.invoker_type"]=l,f&&(c["code.filepath"]=f),p&&(c["code.function"]=p),h!==-1&&(c["browser.script.source_char_position"]=h),vn(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function jA(){Sn("event",({entries:e})=>{const t=Te();if(t){for(const n of e)if(n.name==="click"){const r=ve(Ce()+n.startTime),o=ve(n.duration),s={name:Pe(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Y]:"auto.ui.browser.metrics"}},i=tl(n.target);i&&(s.attributes["ui.component_name"]=i),vn(t,r,r+o,s)}}})}function zA(){return _a(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ke.cls={value:e.value,unit:""},Er=t)},!0)}function qA(){return ya(({metric:e})=>{const t=e.entries[e.entries.length-1];!t||!fs(e.value)||(Ke.lcp={value:e.value,unit:"millisecond"},Ye=t)},!0)}function GA(){return EA(({metric:e})=>{e.entries[e.entries.length-1]&&(Ke.ttfb={value:e.value,unit:"millisecond"})})}function VA(){return Sn("paint",({entries:e})=>{const t=us();for(const n of e){const r=n.startTime<t.firstHiddenTime;n.name==="first-paint"&&r&&(Ke.fp={value:n.startTime,unit:"millisecond"}),n.name==="first-contentful-paint"&&r&&(Ke.fcp={value:n.startTime,unit:"millisecond"})}})}function YA(e,t){const n=cr(),r=Ce();if(!(n!=null&&n.getEntries)||!r)return;const{spanStreamingEnabled:o,ignorePerformanceApiSpans:s,ignoreResourceSpans:i}=t,a=ve(r),c=n.getEntries(),{op:u,start_timestamp:d}=U(e);c.slice($f).forEach(l=>{const f=ve(l.startTime),p=ve(Math.max(0,l.duration));if(!(u==="navigation"&&d&&a+f<d))switch(l.entryType){case"navigation":{ZA(e,l,a);break}case"mark":case"paint":case"measure":{XA(e,l,f,p,a,s);break}case"resource":{nC(e,l,l.name,f,p,a,i);break}}}),$f=Math.max(c.length-1,0),rC(e,o)}function KA(e,t){var a;const n=Ce();if(!((a=cr())!=null&&a.getEntries)||!n){Bf();return}const{spanStreamingEnabled:r,recordClsOnPageloadSpan:o,recordLcpOnPageloadSpan:s}=t,i=ve(n);if(U(e).op==="pageload"){if(iC(Ke),r){const c=(u,d,l)=>{const f=l??`browser.web_vital.${u}.value`;e.setAttribute(f,d),St&&_.log("Setting web vital attribute",{[f]:d},"on pageload span")};["ttfb","fp","fcp"].forEach(u=>{Ke[u]&&c(u,Ke[u].value)}),Ke["ttfb.requestTime"]&&c("ttfb.requestTime",Ke["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else o||delete Ke.cls,s||delete Ke.lcp,Object.entries(Ke).forEach(([c,u])=>{Ki(c,u.value,u.unit,e)}),oC(e,t);e.setAttribute(r?"browser.performance.time_origin":"performance.timeOrigin",i),e.setAttribute(r?"browser.performance.navigation.activation_start":"performance.activationStart",co())}Bf()}function Bf(){Ye=void 0,Er=void 0,Ke={}}function JA(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components вљ›"}catch{return}}function XA(e,t,n,r,o,s){if(JA(t)||["mark","measure"].includes(t.entryType)&&ct(t.name,s))return;const i=cs(!1),a=ve(i?i.requestStart:0),c=o+Math.max(n,a),u=o+n,d=u+r,l={[Y]:"auto.resource.browser.metrics"};c!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=c),QA(l,t),c<=d&&vn(e,c,d,{name:t.name,op:t.entryType,attributes:l})}function QA(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&Ot(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(Ot(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function ZA(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{xs(e,t,r,n)}),xs(e,t,"secureConnection",n,"TLS/SSL"),xs(e,t,"fetch",n,"cache"),xs(e,t,"domainLookup",n,"DNS"),tC(e,t,n)}function xs(e,t,n,r,o=n){const s=eC(n),i=t[s],a=t[`${n}Start`];!a||!i||vn(e,r+ve(a),r+ve(i),{op:`browser.${o}`,name:t.name,attributes:{[Y]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function eC(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function tC(e,t,n){const r=n+ve(t.requestStart),o=n+ve(t.responseEnd),s=n+ve(t.responseStart);t.responseEnd&&(vn(e,r,o,{op:"browser.request",name:t.name,attributes:{[Y]:"auto.ui.browser.metrics"}}),vn(e,s,o,{op:"browser.response",name:t.name,attributes:{[Y]:"auto.ui.browser.metrics"}}))}function nC(e,t,n,r,o,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i!=null&&i.includes(a))return;const c={[Y]:"auto.resource.browser.metrics"},u=zn(n);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=n.includes(V.location.origin),sC(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"]]);const d={...c,...y_(t)},l=s+r,f=l+o;vn(e,l,f,{name:n.replace(V.location.origin,""),op:a,attributes:d})}function rC(e,t){const n=V.navigator;if(!n)return;const 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),sc(r.rtt)&&(t?e.setAttribute("network.connection.rtt",r.rtt):U(e).op==="pageload"&&Ki("connection.rtt",r.rtt,"millisecond"))),sc(n.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",n.deviceMemory):e.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),sc(n.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",n.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function oC(e,t){Ye&&t.recordLcpOnPageloadSpan&&(Ye.element&&e.setAttribute("lcp.element",Pe(Ye.element)),Ye.id&&e.setAttribute("lcp.id",Ye.id),Ye.url&&e.setAttribute("lcp.url",Ye.url.trim().slice(0,200)),Ye.loadTime!=null&&e.setAttribute("lcp.loadTime",Ye.loadTime),Ye.renderTime!=null&&e.setAttribute("lcp.renderTime",Ye.renderTime),e.setAttribute("lcp.size",Ye.size)),Er!=null&&Er.sources&&t.recordClsOnPageloadSpan&&Er.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Pe(n.node)))}function sC(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<BA||typeof s=="string")&&(t[o]=s)})}function iC(e){const t=cs(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const aC="ElementTiming",cC=(()=>({name:aC,setup(){!cr()||!Ce()||Sn("element",({entries:t})=>{for(const n of t){const r=n;if(!r.identifier)continue;const o=r.identifier,s=r.name,i=r.renderTime,a=r.loadTime,c={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":o};s&&(c["ui.element.paint_type"]=s),r.id&&(c["ui.element.id"]=r.id),r.element&&(c["ui.element.type"]=r.element.tagName.toLowerCase()),r.url&&(c["ui.element.url"]=r.url),r.naturalWidth&&(c["ui.element.width"]=r.naturalWidth),r.naturalHeight&&(c["ui.element.height"]=r.naturalHeight),i>0&&Oc("ui.element.render_time",i,{unit:"millisecond",attributes:c}),a>0&&Oc("ui.element.load_time",a,{unit:"millisecond",attributes:c})}})}})),uC=cC,ic=[],ko=new Map,mr=new Map,b_=60;function lC(){if(cr()&&Ce()){const t=dC();return()=>{t()}}return()=>{}}const $o={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 dC(){return ul(fC)}const fC=({metric:e})=>{if(e.value==null)return;const t=ve(e.value);if(t>b_)return;const n=e.entries.find(h=>h.duration===e.value&&$o[h.name]);if(!n)return;const{interactionId:r}=n,o=$o[n.name],s=ve(Ce()+n.startTime),i=Te(),a=i?Ee(i):void 0,c=r!=null?ko.get(r):void 0,u=(c==null?void 0:c.span)||a,d=u?U(u).description:j().getScopeData().transactionName,l=(c==null?void 0:c.elementName)||Pe(n.target),f={[Y]:"auto.http.browser.inp",[ce]:`ui.interaction.${o}`,[Rn]:n.duration},p=ll({name:l,transaction:d,attributes:f,startTime:s});p&&(p.addEvent("inp",{[Yo]:"millisecond",[Ko]:e.value}),p.end(s+t))};function pC(e){return e!=null?ko.get(e):void 0}function hC(){const e=Object.keys($o);yn()&&e.forEach(o=>{V.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=Pe(s),a=Math.round(o.timeStamp);if(mr.set(a,i),mr.size>50){const c=mr.keys().next().value;c!==void 0&&mr.delete(c)}}function n(o){const s=Math.round(o.startTime);let i=mr.get(s);if(!i)for(let a=-5;a<=5;a++){const c=mr.get(s+a);if(c){i=c;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=Te(),i=s&&Ee(s);o.forEach(a=>{if(!AA(a))return;const c=a.interactionId;if(c==null||ko.has(c))return;const u=a.target?Pe(a.target):n(a);if(ic.length>10){const d=ic.shift();ko.delete(d)}ic.push(c),ko.set(c,{span:i,elementName:u})})};Sn("event",r),Sn("first-input",r)}function dl(e){var h,m;const{name:t,op:n,origin:r,metricName:o,value:s,attributes:i,parentSpan:a,reportEvent:c,startTime:u,endTime:d}=e,l=j().getScopeData().transactionName,f={[Y]:r,[ce]:n,[Rn]:0,[`browser.web_vital.${o}.value`]:s,"sentry.transaction":l,"user_agent.original":(h=V.navigator)==null?void 0:h.userAgent,...i};a&&((m=li(a).attributes)==null?void 0:m[ce])==="pageload"&&(f["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(f[`browser.web_vital.${o}.report_event`]=c);const p=qe({name:t,attributes:f,startTime:u,parentSpan:a});p&&p.end(d??u)}function mC(e){let t=0,n;if(!Sa("largest-contentful-paint"))return;const r=ya(({metric:o})=>{const s=o.entries[o.entries.length-1];!s||!fs(o.value)||(t=o.value,n=s)},!0);va(e,(o,s,i)=>{gC(t,n,i,o),r()})}function gC(e,t,n,r){if(!fs(e))return;St&&_.log(`Sending LCP span (${e})`);const o=Ce()||0,s=ve(o),i=ve(o+((t==null?void 0:t.startTime)||0)),a=t?Pe(t.element):"Largest contentful paint",c={};t!=null&&t.element&&(c["browser.web_vital.lcp.element"]=Pe(t.element)),t!=null&&t.id&&(c["browser.web_vital.lcp.id"]=t.id),t!=null&&t.url&&(c["browser.web_vital.lcp.url"]=t.url),(t==null?void 0:t.loadTime)!=null&&(c["browser.web_vital.lcp.load_time"]=t.loadTime),(t==null?void 0:t.renderTime)!=null&&(c["browser.web_vital.lcp.render_time"]=t.renderTime),(t==null?void 0:t.size)!=null&&(c["browser.web_vital.lcp.size"]=t.size),dl({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:c,parentSpan:n,reportEvent:r,startTime:s,endTime:i})}function _C(e){let t=0,n;if(!Sa("layout-shift"))return;const r=_a(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);va(e,(o,s,i)=>{yC(t,n,i,o),r()})}function yC(e,t,n,r){var a;St&&_.log(`Sending CLS span (${e})`);const o=t?ve((Ce()||0)+t.startTime):ye(),s=t?Pe((a=t.sources[0])==null?void 0:a.node):"Layout shift",i={};t!=null&&t.sources&&t.sources.forEach((c,u)=>{i[`browser.web_vital.cls.source.${u+1}`]=Pe(c.node)}),dl({name:s,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:i,parentSpan:n,reportEvent:r,startTime:o})}function bC(){if(!cr()||!Ce())return;ul(({metric:n})=>{if(n.value==null||ve(n.value)>b_)return;const o=n.entries.find(s=>s.duration===n.value&&$o[s.name]);o&&SC(n.value,o)})}function SC(e,t){St&&_.log(`Sending INP span (${e})`);const n=ve(Ce()+t.startTime),r=ve(e),o=$o[t.name],s=pC(t.interactionId),i=Te(),a=i?Ee(i):void 0,c=(s==null?void 0:s.span)||a,u=c?li(c).name:j().getScopeData().transactionName,d=(s==null?void 0:s.elementName)||Pe(t.target);dl({name:d,op:`ui.interaction.${o}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[Rn]:t.duration,"sentry.transaction":u},startTime:n,endTime:n+r,parentSpan:c})}const vC=1e3;let Uf,Vc,Yc;function S_(e){Tn("dom",e),In("dom",EC)}function EC(){if(!V.document)return;const e=at.bind(null,"dom"),t=Hf(e,!0);V.document.addEventListener("click",t,!1),V.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var s,i;const o=(s=V[n])==null?void 0:s.prototype;(i=o==null?void 0:o.hasOwnProperty)!=null&&i.call(o,"addEventListener")&&(De(o,"addEventListener",function(a){return function(c,u,d){if(c==="click"||c=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[c]=l[c]||{refCount:0};if(!f.handler){const p=Hf(e);f.handler=p,a.call(this,c,p,d)}f.refCount++}catch{}return a.call(this,c,u,d)}}),De(o,"removeEventListener",function(a){return function(c,u,d){if(c==="click"||c=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[c];f&&(f.refCount--,f.refCount<=0&&(a.call(this,c,f.handler,d),f.handler=void 0,delete l[c]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,c,u,d)}}))})}function TC(e){if(e.type!==Vc)return!1;try{if(!e.target||e.target._sentryId!==Yc)return!1}catch{}return!0}function IC(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Hf(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=wC(n);if(IC(n.type,r))return;we(n,"_sentryCaptured",!0),r&&!r._sentryId&&we(r,"_sentryId",Me());const o=n.type==="keypress"?"input":n.type;TC(n)||(e({event:n,name:o,global:t}),Vc=n.type,Yc=r?r._sentryId:void 0),clearTimeout(Uf),Uf=V.setTimeout(()=>{Yc=void 0,Vc=void 0},vC)}}function wC(e){try{return e.target}catch{return null}}let Ms;function Ea(e){const t="history";Tn(t,e),In(t,kC)}function kC(){if(V.addEventListener("popstate",()=>{const t=V.location.href,n=Ms;if(Ms=t,n===t)return;at("history",{from:n,to:t})}),!hk())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=Ms,s=RC(String(r));if(Ms=s,o===s)return t.apply(this,n);at("history",{from:o,to:s})}return t.apply(this,n)}}De(V.history,"pushState",e),De(V.history,"replaceState",e)}function RC(e){try{return new URL(e,V.location.origin).toString()}catch{return e}}const ei={};function fl(e){const t=ei[e];if(t)return t;let n=V[e];if($c(n))return ei[e]=n.bind(V);const r=V.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s!=null&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){St&&_.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(ei[e]=n.bind(V))}function AC(e){ei[e]=void 0}function ps(...e){return fl("setTimeout")(...e)}const Gt="__sentry_xhr_v3__";function pl(e){Tn("xhr",e),In("xhr",CC)}function CC(){if(!V.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=ye()*1e3,i=gt(r[0])?r[0].toUpperCase():void 0,a=NC(r[1]);if(!i||!a)return t.apply(n,r);n[Gt]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const u=n[Gt];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:ye()*1e3,startTimestamp:s,xhr:n,virtualError:o};at("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return c(),u.apply(d,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[Gt];return h&>(f)&>(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[Gt];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:ye()*1e3,xhr:n};return at("xhr",s),t.apply(n,r)}})}function NC(e){if(gt(e))return e;try{return e.toString()}catch{}}const xC=Symbol.for("sentry__originalRequestBody");function v_(e){return new URLSearchParams(e).toString()}function Ri(e,t=_){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[v_(e)];if(!e)return[void 0]}catch(n){return St&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return St&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function hl(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){const n=e[0][xC];return n!==void 0?n:void 0}}function E_(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return St&&_.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
`).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}function MC(e){if(typeof Element>"u")return!1;try{return e instanceof Element}catch{return!1}}const OC=40;function ml(e,t=fl("fetch")){let n=0,r=0;async function o(s){const i=s.body.length;n+=i,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw AC("fetch"),c}finally{n-=i,r--}}return Dm(e,o,ea(e.bufferSize||OC))}const C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function PC(){const e=N();if(!e){C&&_.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){C&&_.warn("BrowserProfiling integration is not available");return}e.emit("startUIProfiler")}function LC(){const e=N();if(!e){C&&_.warn("No Sentry client available, profiling is not started");return}if(!e.getIntegrationByName("BrowserProfiling")){C&&_.warn("ProfilingIntegration is not available");return}e.emit("stopUIProfiler")}const DC={startProfiler:PC,stopProfiler:LC},FC=10,$C=20,BC=30,UC=40,HC=50;function Gr(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?Mt:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const WC=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,jC=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zC=/\((\S*)(?::(\d+))(?::(\d+))\)/,qC=/at (.+?) ?\(data:(.+?),/,GC=e=>{var o;const t=e.match(qC);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=WC.exec(e);if(n){const[,s,i,a]=n;return Gr(s,Mt,+i,+a)}const r=jC.exec(e);if(r){if(((o=r[2])==null?void 0:o.indexOf("eval"))===0){const c=zC.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,a]=R_(r[1]||Mt,r[2]);return Gr(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},T_=[BC,GC],VC=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,YC=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,KC=e=>{const t=VC.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=YC.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||Mt;return[o,r]=R_(o,r),Gr(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},I_=[HC,KC],JC=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,XC=e=>{const t=JC.exec(e);return t?Gr(t[2],t[1]||Mt,+t[3],t[4]?+t[4]:void 0):void 0},QC=[UC,XC],ZC=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,e1=e=>{const t=ZC.exec(e);return t?Gr(t[2],t[3]||Mt,+t[1]):void 0},t1=[FC,e1],n1=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,r1=e=>{const t=n1.exec(e);return t?Gr(t[5],t[3]||t[4]||Mt,+t[1],+t[2]):void 0},o1=[$C,r1],w_=[T_,I_],k_=hh(...w_),R_=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Mt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};function s1(e,{metadata:t,tunnel:n,dsn:r}){const o={event_id:e.event_id,sent_at:new Date().toISOString(),...(t==null?void 0:t.sdk)&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Ut(r)}},s=i1(e);return dt(o,[s])}function i1(e){return[{type:"user_report"},e]}const Os=1024,a1="Breadcrumbs",c1=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:a1,setup(n){t.console&&Wu(d1(n)),t.dom&&S_(l1(n,t.dom)),t.xhr&&pl(f1(n)),t.fetch&&da(p1(n)),t.history&&Ea(h1(n)),t.sentry&&n.on("beforeSendEvent",u1(n))}}}),gl=c1;function u1(e){return function(n){N()===e&&ut({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Ln(n)},{event:n})}}function l1(e,t){return function(r){if(N()!==e)return;let o,s,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Os&&(C&&_.warn(`\`dom.maxStringLength\` cannot exceed ${Os}, but a value of ${a} was configured. Sentry will use ${Os} instead.`),a=Os),typeof i=="string"&&(i=[i]);try{const u=r.event,d=m1(u)?u.target:u;o=Pe(d,{keyAttrs:i,maxStringLength:a}),s=tl(d)}catch{o="<unknown>"}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};s&&(c.data={"ui.component_name":s}),ut(c,{event:r.event,name:r.name,global:r.global})}}function d1(e){return function(n){if(N()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Do(n.level),message:ci(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${ci(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ut(r,{input:n.args,level:n.level})}}function f1(e){return function(n){if(N()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[Gt];if(!r||!o||!s)return;const{method:i,url:a,status_code:c,body:u}=s,d={method:i,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f={category:"xhr",data:d,type:"http",level:Mg(c)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),ut(f,l)}}function p1(e){return function(n){if(N()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),ut(i,s)}else{const s=n.response,i={...n.fetchData,status_code:s==null?void 0:s.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:o},c={category:"fetch",data:i,type:"http",level:Mg(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),ut(c,a)}}}function h1(e){return function(n){if(N()!==e)return;let r=n.from,o=n.to;const s=zn(A.location.href);let i=r?zn(r):void 0;const a=zn(o);i!=null&&i.path||(i=s),s.protocol===a.protocol&&s.host===a.host&&(o=a.relative),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),ut({category:"navigation",data:{from:r,to:o}})}}function m1(e){return!!e&&!!e.target}const g1="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(","),_1="BrowserApiErrors",y1=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:_1,setupOnce(){t.setTimeout&&De(A,"setTimeout",Wf),t.setInterval&&De(A,"setInterval",Wf),t.requestAnimationFrame&&De(A,"requestAnimationFrame",b1),t.XMLHttpRequest&&"XMLHttpRequest"in A&&De(XMLHttpRequest.prototype,"send",S1);const n=t.eventTarget;n&&(Array.isArray(n)?n:g1).forEach(o=>v1(o,t))}}}),_l=y1;function Wf(e){return function(...t){const n=t[0];return t[0]=qr(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Xt(e)}`}}),e.apply(this,t)}}function b1(e){return function(t){return e.apply(this,[qr(t,{mechanism:{data:{handler:Xt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function S1(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&De(n,o,function(s){const i={mechanism:{data:{handler:Xt(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=zi(s);return a&&(i.mechanism.data.handler=Xt(a)),qr(s,i)})}),e.apply(this,t)}}function v1(e,t){var o,s;const r=(o=A[e])==null?void 0:o.prototype;(s=r==null?void 0:r.hasOwnProperty)!=null&&s.call(r,"addEventListener")&&(De(r,"addEventListener",function(i){return function(a,c,u){try{E1(c)&&(c.handleEvent=qr(c.handleEvent,{mechanism:{data:{handler:Xt(c),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&T1(this,a,c),i.apply(this,[a,qr(c,{mechanism:{data:{handler:Xt(c),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),De(r,"removeEventListener",function(i){return function(a,c,u){try{if(Object.prototype.hasOwnProperty.call(c,"__sentry_wrapped__")){const d=c.__sentry_wrapped__;d&&i.call(this,a,d,u)}}catch{}return i.call(this,a,c,u)}}))}function E1(e){return typeof e.handleEvent=="function"}function T1(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const yl=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof A.document>"u"){C&&_.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}kc({ignoreDuration:!0}),js();const n=he();let r=n.getUser();n.addScopeListener(o=>{const s=o.getUser();((r==null?void 0:r.id)!==(s==null?void 0:s.id)||(r==null?void 0:r.ip_address)!==(s==null?void 0:s.ip_address))&&(js(),r=s)}),t==="route"&&Ea(({from:o,to:s})=>{o!==s&&(kc({ignoreDuration:!0}),js())})}}},I1="CultureContext",w1=(()=>({name:I1,preprocessEvent(e){var n;const t=jf();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})},processSegmentSpan(e){const t=jf();t&&_n(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),A_=w1;function jf(){try{const e=A.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const k1="GlobalHandlers",R1=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:k1,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(A1(n),zf("onerror")),t.onunhandledrejection&&(C1(n),zf("onunhandledrejection"))}}}),bl=R1;function A1(e){mh(t=>{const{stackParser:n,attachStacktrace:r}=x_();if(N()!==e||t_())return;const{msg:o,url:s,line:i,column:a,error:c}=t,u=N1(ma(n,c||o,void 0,r,!1),s,i,a);u.level="error",or(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function C1(e){gh(t=>{const{stackParser:n,attachStacktrace:r}=x_();if(N()!==e||t_())return;const o=C_(t),s=Ot(o)?N_(o):ma(n,o,void 0,r,!0);s.level="error",or(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function C_(e){if(Ot(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 N_(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function N1(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:x1(t)??ir(),function:Mt,in_app:!0}),e}function zf(e){C&&_.log(`Global Handler attached: ${e}`)}function x_(){const e=N();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function x1(e){if(!(!gt(e)||e.length===0))return e.startsWith("data:")?`<${Nt(e,!1)}>`:e}const Sl=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!A.navigator&&!A.location&&!A.document)return;const t=Ii(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}},processSegmentSpan(e){var r;const t=(r=e.attributes)==null?void 0:r[ce];if(!A.navigator&&!A.location&&!A.document)return;const n=Ii();_n(e,{"url.full":t!=="http.client"?n.url:void 0,"http.request.header.user_agent":n.headers["User-Agent"],"http.request.header.referer":n.headers.Referer})}}),M1="cause",O1=5,P1="LinkedErrors",L1=((e={})=>{const t=e.limit||O1,n=e.key||M1;return{name:P1,preprocessEvent(r,o,s){const i=s.getOptions();Km(pa,i.stackParser,n,t,r,o)}}}),M_=L1,D1=/^HTML(\w*)Element$/;function vl(e){if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(MC(e)){const t=F1(e);if(D1.test(t))return`[HTMLElement: ${Pe(e)}]`}}function F1(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function $1(){return B1()?(C&&$t(()=>{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 B1(){var o;if(typeof A.window>"u")return!1;const e=A;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((o=t==null?void 0:t.runtime)!=null&&o.id))return!1;const n=ir();return!(A===A.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function O_(e){return[Ym(),Uu(),z0(),_l(),gl(),bl(),M_(),ju(),Sl(),A_(),yl()]}function P_(e={}){const t=!e.skipBrowserExtensionCheck&&$1();let n=e.defaultIntegrations==null?O_():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:zb(e.stackParser||k_),integrations:SE({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||ml};return Th(vl),rT(i_,r)}function U1(){}function H1(e){e()}function Kc(e={}){const t=A.document,n=(t==null?void 0:t.head)||(t==null?void 0:t.body);if(!n){C&&_.error("[showReportDialog] Global document not defined");return}const r=j(),o=N(),s=o==null?void 0:o.getDsn();if(!s){C&&_.error("[showReportDialog] DSN not configured");return}const i={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||vm()},a=A.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=yE(s,i);const{onLoad:c,onClose:u}=i;if(c&&(a.onload=c),u){const d=l=>{if(l.data==="__sentry_reportdialog_closed__")try{u()}finally{A.removeEventListener("message",d)}};A.addEventListener("message",d)}n.appendChild(a)}const W1=H,j1="ReportingObserver",qf=new WeakMap,z1=((e={})=>{const t=e.types||["crash","deprecation","intervention"];function n(r){if(qf.has(N()))for(const o of r)Ge(s=>{s.setExtra("url",o.url);const i=`ReportingObserver [${o.type}]`;let a="No details available";if(o.body){const c={};for(const u in o.body)c[u]=o.body[u];if(s.setExtra("body",c),o.type==="crash"){const u=o.body;a=[u.crashId||"",u.reason||""].join(" ").trim()||a}else a=o.body.message||a}Nu(`${i}: ${a}`)})}return{name:j1,setupOnce(){if(!gk())return;new W1.ReportingObserver(n,{buffered:!0,types:t}).observe()},setup(r){qf.set(r,!0)}}}),q1=z1,G1="HttpClient",V1=((e={})=>{const t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:G1,setup(n){tN(n,t),nN(n,t)}}}),Y1=V1;function K1(e,t,n,r,o){if(L_(e,n.status,n.url)){const s=rN(t,r);let i,a,c,u;const d=F_();if(d.requestHeaders!==!1&&(i=Lo(Gf(s.headers),d.requestHeaders)),d.responseHeaders!==!1&&(a=Lo(Gf(n.headers),d.responseHeaders)),d.cookies!==!1){const f=s.headers.get("Cookie")||void 0;if(f){const h=Nc(f,d.cookies);typeof h=="object"&&(c=h)}const p=n.headers.get("Set-Cookie")||void 0;if(p){const h=Nc(p,d.cookies);typeof h=="object"&&(u=h)}}const l=D_({url:s.url,method:s.method,status:n.status,requestHeaders:i,responseHeaders:a,requestCookies:c,responseCookies:u,error:o,type:"fetch"});or(l)}}function J1(e,t,n,r,o){if(L_(e,t.status,t.responseURL)){let s,i,a;const c=F_();if(c.cookies!==!1)try{const d=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;if(d){const l=Nc(d,c.cookies);typeof l=="object"&&(i=l)}}catch{}if(c.responseHeaders!==!1)try{a=Lo(Q1(t),c.responseHeaders)}catch{}c.requestHeaders!==!1&&(s=Lo(r,c.requestHeaders));const u=D_({url:t.responseURL,method:n,status:t.status,requestHeaders:s,responseHeaders:a,responseCookies:i,error:o,type:"xhr"});or(u)}}function X1(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function Gf(e){const t={};return e.forEach((n,r)=>{t[r]=n}),t}function Q1(e){const t=e.getAllResponseHeaders();return t?t.split(`\r
`).reduce((n,r)=>{const[o,s]=r.split(": ");return o&&s&&(n[o]=s),n},{}):{}}function Z1(e,t){return e.some(n=>typeof n=="string"?t.includes(n):n.test(t))}function eN(e,t){return e.some(n=>typeof n=="number"?n===t:t>=n[0]&&t<=n[1])}function tN(e,t){Og()&&da(n=>{if(N()!==e)return;const{response:r,args:o,error:s,virtualError:i}=n,[a,c]=o;r&&K1(t,a,r,c,s||i)},!1)}function nN(e,t){"XMLHttpRequest"in H&&pl(n=>{if(N()!==e)return;const{error:r,virtualError:o}=n,s=n.xhr,i=s[Gt];if(!i)return;const{method:a,request_headers:c}=i;try{J1(t,s,a,c,r||o)}catch(u){C&&_.warn("Error while extracting response event form XHR response",u)}})}function L_(e,t,n){return eN(e.failedRequestStatusCodes,t)&&Z1(e.failedRequestTargets,n)&&!qm(n,N())}function D_(e){const t=N(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,o=`HTTP Client Error with status code: ${e.status}`,s={message:o,exception:{values:[{type:"Error",value:o,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:X1(e.responseHeaders)}}};return At(s,{type:`auto.http.client.${e.type}`,handled:!1}),s}function rN(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}function F_(){const e=N();if(!e)return{cookies:!1,requestHeaders:!1,responseHeaders:!1};const t=e.getOptions();if(t.dataCollection==null){const o=!!t.sendDefaultPii;return{cookies:o,requestHeaders:o,responseHeaders:o}}const{cookies:n,httpHeaders:r}=e.getDataCollectionOptions();return{cookies:n,requestHeaders:r.request,responseHeaders:r.response}}const ac=H,oN=7,sN="ContextLines",iN=((e={})=>({name:sN,processEvent(t,n,r){const o=e.frameContextLines??(r==null?void 0:r.getDataCollectionOptions().frameContextLines)??oN;return cN(t,o)}})),aN=iN;function cN(e,t){var a;const n=ac.document,r=ac.location&&zm(ac.location.href);if(!n||!r)return e;const o=(a=e.exception)==null?void 0:a.values;if(!(o!=null&&o.length))return e;const s=n.documentElement.innerHTML;if(!s)return e;const i=["<!DOCTYPE html>","<html>",...s.split(`
`),"</html>"];return o.forEach(c=>{const u=c.stacktrace;u!=null&&u.frames&&(u.frames=u.frames.map(d=>uN(d,i,r,t)))}),e}function uN(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||cS(t,e,r),e}const lN="GraphQLClient",dN=(e=>({name:lN,setup(t){fN(t,e),pN(t,e)}}));function fN(e,t){e.on("beforeOutgoingRequestSpan",(n,r)=>{const s=U(n).data||{};if(!(s[ce]==="http.client"))return;const c=s[BS]||s["http.url"]||s.url,u=s[$S]||s["http.method"];if(!gt(c)||!gt(u))return;const{endpoints:d}=t,l=ct(c,d),f=B_(r);if(l&&f){const p=U_(f);if(p){const h=$_(p);n.updateName(`${u} ${c} (${h})`),Ta(p)&&n.setAttribute("graphql.document",p.query),Ia(p)&&(n.setAttribute("graphql.persisted_query.hash.sha256",p.extensions.persistedQuery.sha256Hash),n.setAttribute("graphql.persisted_query.version",p.extensions.persistedQuery.version))}}})}function pN(e,t){e.on("beforeOutgoingRequestBreadcrumb",(n,r)=>{const{category:o,type:s,data:i}=n;if(s==="http"&&(o==="fetch"||o==="xhr")){const d=i==null?void 0:i.url,{endpoints:l}=t,f=ct(d,l),p=B_(r);if(f&&i&&p){const h=U_(p);if(!i.graphql&&h){const m=$_(h);i["graphql.operation"]=m,Ta(h)&&(i["graphql.document"]=h.query),Ia(h)&&(i["graphql.persisted_query.hash.sha256"]=h.extensions.persistedQuery.sha256Hash,i["graphql.persisted_query.version"]=h.extensions.persistedQuery.version)}}}})}function $_(e){if(Ia(e))return`persisted ${e.operationName}`;if(Ta(e)){const{query:t,operationName:n}=e,{operationName:r=n,operationType:o}=hN(t);return r?`${o} ${r}`:`${o}`}return"unknown"}function B_(e){const t="xhr"in e;let n;if(t){const r=e.xhr[Gt];n=r&&Ri(r.body)[0]}else{const r=hl(e.input);n=Ri(r)[0]}return n}function hN(e){const 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]};const o=e.match(n);return o?{operationType:o[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}function ti(e){return typeof e=="object"&&e!==null}function Ta(e){return ti(e)&&typeof e.query=="string"}function Ia(e){return ti(e)&&typeof e.operationName=="string"&&ti(e.extensions)&&ti(e.extensions.persistedQuery)&&typeof e.extensions.persistedQuery.sha256Hash=="string"&&typeof e.extensions.persistedQuery.version=="number"}function U_(e){try{const t=JSON.parse(e);return Ta(t)||Ia(t)?t:void 0}catch{return}}const mN=dN,gN=(e={})=>{const t=["script"];function n(r,o,s=0){var a;if(!r)return;const i="shadowRoot"in r&&r.shadowRoot?r.shadowRoot.children:r.children;for(const c of i){if(!(c instanceof HTMLElement))continue;const u=tl(c,1)||void 0,d=c.tagName.toLowerCase();if(t.includes(d))continue;const l=((a=e.onElement)==null?void 0:a.call(e,{element:c,componentName:u,tagName:d,depth:s}))||{};if(l==="skip")continue;if(l==="children"){n(c,o,s+1);continue}const{x:f,y:p,width:h,height:m}=c.getBoundingClientRect(),g={identifier:c.id||void 0,type:u||d,visible:!0,alpha:1,height:m,width:h,x:f,y:p,...l},y=[];g.children=y,n(c,g.children,s+1),o.push(g)}}return{name:"ViewHierarchy",processEvent:(r,o)=>{var a,c;if(r.type!==void 0||((a=e.shouldAttach)==null?void 0:a.call(e,r,o))===!1)return r;const s={rendering_system:"DOM",positioning:"absolute",windows:[]};n(((c=e.rootElement)==null?void 0:c.call(e))||A.document.body,s.windows);const i={filename:"view-hierarchy.json",attachmentType:"event.view_hierarchy",contentType:"application/json",data:JSON.stringify(s)};return o.attachments=o.attachments||[],o.attachments.push(i),r}}},Se=H,El="sentryReplaySession",_N="replay_event",Tl="Unable to send Replay",yN=3e5,bN=9e5,SN=5e3,vN=5500,EN=6e4,TN=5e3,IN=3,Vf=15e4,Ps=5e3,wN=3e3,kN=300,Il=2e7,RN=4999,AN=5e4,Yf=36e5;var CN=Object.defineProperty,NN=(e,t,n)=>t in e?CN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kf=(e,t,n)=>NN(e,typeof t!="symbol"?t+"":t,n),Ne=(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))(Ne||{});function xN(e){return e.nodeType===e.ELEMENT_NODE}function Ro(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function Ao(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function MN(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 ON(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const 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 Ai(e){try{const t=e.rules||e.cssRules;return t?MN(Array.from(t,H_).join("")):null}catch{return null}}function PN(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,o=r[n],s=r.getPropertyPriority(o);t+=`${o}:${r.getPropertyValue(o)}${s?" !important":""};`}return`${e.selectorText} { ${t} }`}function H_(e){let t;if(DN(e))try{t=Ai(e.styleSheet)||ON(e)}catch{}else if(FN(e)){let n=e.cssText;const r=e.selectorText.includes(":"),o=typeof e.style.all=="string"&&e.style.all;if(o&&(n=PN(e)),r&&(n=LN(n)),r||o)return n}return t||e.cssText}function LN(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function DN(e){return"styleSheet"in e}function FN(e){return"selectorText"in e}let W_=class{constructor(){Kf(this,"idNodeMap",new Map),Kf(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function $N(){return new W_}function wa({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 Bo({isMasked:e,element:t,value:n,maskInputFn:r}){let o=n||"";return e?(r&&(o=r(o,t)),"*".repeat(o.length)):o}function Vr(e){return e.toLowerCase()}function Jc(e){return e.toUpperCase()}const Jf="__rrweb_original__";function BN(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let o=0;o<e.height;o+=n){const s=t.getImageData,i=Jf in s?s[Jf]:s;if(new Uint32Array(i.call(t,r,o,Math.min(n,e.width-r),Math.min(n,e.height-o)).data.buffer).some(c=>c!==0))return!1}return!0}function wl(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Vr(t):null}function Ci(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function j_(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,o=n.pathname.match(r);return(o==null?void 0:o[1])??null}const Xf={};function z_(e){const t=Xf[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return Xf[e]=r.bind(window)}function Xc(...e){return z_("setTimeout")(...e)}function q_(...e){return z_("clearTimeout")(...e)}function G_(e){try{return e.contentDocument}catch{}}function UN(e){try{return e.contentWindow}catch{}}let HN=1;const WN=new RegExp("[^a-z0-9-_:]"),Uo=-2;function kl(){return HN++}function jN(e){if(e instanceof HTMLFormElement)return"form";const t=Vr(e.tagName);return WN.test(t)?"div":t}function zN(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let gr,Qf;const qN=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,GN=/^(?:[a-z+]+:)?\/\//i,VN=/^www\..*/i,YN=/^(data:)([^,]*),(.*)/i;function KN(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let o of n){if(o=o.trim(),!o)continue;const s=o.indexOf(":");if(s===-1){r.push(o);continue}const i=o.slice(0,s).trim();t.has(i)||r.push(o)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function Ni(e,t){return(e||"").replace(qN,(n,r,o,s,i,a)=>{const c=o||i||a,u=r||s||"";if(!c)return n;if(GN.test(c)||VN.test(c))return`url(${u}${c}${u})`;if(YN.test(c))return`url(${u}${c}${u})`;if(c[0]==="/")return`url(${u}${zN(t)+c}${u})`;const d=t.split("/"),l=c.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const JN=/^[^ \t\n\r\u000c]+/,XN=/^[, \t\n\r\u000c]+/;function QN(e,t){if(t.trim()==="")return t;let n=0;function r(s){let i;const a=s.exec(t.substring(n));return a?(i=a[0],n+=i.length,i):""}const o=[];for(;r(XN),!(n>=t.length);){let s=r(JN);if(s.slice(-1)===",")s=Tr(e,s.substring(0,s.length-1)),o.push(s);else{let i="";s=Tr(e,s);let a=!1;for(;;){const c=t.charAt(n);if(c===""){o.push((s+i).trim());break}else if(a)c===")"&&(a=!1);else if(c===","){n+=1,o.push((s+i).trim());break}else c==="("&&(a=!0);i+=c,n+=1}}}return o.join(", ")}const Zf=new WeakMap;function Tr(e,t){return!t||t.trim()===""?t:ka(e,t)}function ZN(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ka(e,t){let n=Zf.get(e);if(n||(n=e.createElement("a"),Zf.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function V_(e,t,n,r,o,s,i){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return Tr(e,r);if(n==="xlink:href"&&r[0]!=="#")return Tr(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return Tr(e,r);if(n==="srcset")return QN(e,r);if(n==="style"){let a=Ni(r,ka(e));return i&&i.size>0&&(a=KN(a,i)),a}else if(t==="object"&&n==="data")return Tr(e,r);return typeof s=="function"?s(n,r,o):r}function Y_(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function ex(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 o=e.classList.length;o--;){const s=e.classList[o];if(t.test(s))return!0}if(n)return e.matches(n)}catch{}return!1}function tx(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Bn(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Bn(e.parentNode,t,n,r+1)}function Ir(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(tx(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function Yr(e,t,n,r,o,s){try{const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(i===null)return!1;if(i.tagName==="INPUT"){const u=i.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let a=-1,c=-1;if(s){if(c=Bn(i,Ir(r,o)),c<0)return!0;a=Bn(i,Ir(t,n),c>=0?c:1/0)}else{if(a=Bn(i,Ir(t,n)),a<0)return!1;c=Bn(i,Ir(r,o),a>=0?a:1/0)}return a>=0?c>=0?a<=c:!0:c>=0?!1:!!s}catch{}return!!s}function nx(e,t,n){const r=UN(e);if(!r)return;let o=!1,s;try{s=r.document.readyState}catch{return}if(s!=="complete"){const a=Xc(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{q_(a),o=!0,t()});return}const i="about:blank";if(r.location.href!==i||e.src===i||e.src==="")return Xc(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function rx(e,t,n){let r=!1,o;try{o=e.sheet}catch{o=null}if(o)return;const s=Xc(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{q_(s),r=!0,t()})}function ox(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:g,dataURLOptions:y={},inlineImages:S,recordCanvas:k,keepIframeSrcFn:E,newlyAddedElement:x=!1,ignoreCSSAttributes:w}=t,b=sx(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:Ne.Document,childNodes:[],compatMode:e.compatMode}:{type:Ne.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ne.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return ax(e,{doc:n,blockClass:o,blockSelector:s,unblockSelector:i,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:h,maskInputFn:g,dataURLOptions:y,inlineImages:S,recordCanvas:k,keepIframeSrcFn:E,newlyAddedElement:x,rootId:b,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:w});case e.TEXT_NODE:return ix(e,{doc:n,maskAllText:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:g,rootId:b});case e.CDATA_SECTION_NODE:return{type:Ne.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:Ne.Comment,textContent:e.textContent||"",rootId:b};default:return!1}}function sx(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function ix(e,t){var y;const{maskAllText:n,maskTextClass:r,unmaskTextClass:o,maskTextSelector:s,unmaskTextSelector:i,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,m=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(y=e.parentNode.sheet)!=null&&y.cssRules&&(f=Ai(e.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,e)}f=Ni(f,ka(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const g=Yr(e,r,s,o,i,n);if(!p&&!h&&!m&&f&&g&&(f=a?a(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(c.textarea||g)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const S=wa({type:null,tagName:l,maskInputOptions:c});f=Bo({isMasked:Yr(e,r,s,o,i,S),element:e,value:f,maskInputFn:u})}return{type:Ne.Text,textContent:f||"",isStyle:p,rootId:d}}function ax(e,t){const{doc:n,blockClass:r,blockSelector:o,unblockSelector:s,inlineStylesheet:i,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:g,unmaskTextClass:y,maskTextSelector:S,unmaskTextSelector:k,ignoreCSSAttributes:E}=t,x=ex(e,r,o,s),w=jN(e);let b={};const I=e.attributes.length;for(let v=0;v<I;v++){const P=e.attributes[v];P.name&&!Y_(w,P.name,P.value)&&(b[P.name]=V_(n,w,Vr(P.name),P.value,e,c,E))}if(w==="link"&&i){const v=Array.from(n.styleSheets).find(R=>R.href===e.href);let P=null;v&&(P=Ai(v)),P&&(b.rel=null,b.href=null,b.crossorigin=null,b._cssText=Ni(P,v.href))}if(w==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const v=Ai(e.sheet);v&&(b._cssText=Ni(v,ka(n)))}if(w==="input"||w==="textarea"||w==="select"||w==="option"){const v=e,P=wl(v),R=Ci(v,Jc(w),P),L=v.checked;if(P!=="submit"&&P!=="button"&&R){const $=Yr(v,g,S,y,k,wa({type:P,tagName:Jc(w),maskInputOptions:a}));b.value=Bo({isMasked:$,element:v,value:R,maskInputFn:u})}L&&(b.checked=L)}if(w==="option"&&(e.selected&&!a.select?b.selected=!0:delete b.selected),w==="canvas"&&f){if(e.__context==="2d")BN(e)||(b.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const v=e.toDataURL(d.type,d.quality),P=n.createElement("canvas");P.width=e.width,P.height=e.height;const R=P.toDataURL(d.type,d.quality);v!==R&&(b.rr_dataURL=v)}}if(w==="img"&&l){gr||(gr=n.createElement("canvas"),Qf=gr.getContext("2d"));const v=e,P=v.currentSrc||v.getAttribute("src")||"<unknown-src>",R=v.crossOrigin,L=()=>{v.removeEventListener("load",L);try{gr.width=v.naturalWidth,gr.height=v.naturalHeight,Qf.drawImage(v,0,0),b.rr_dataURL=gr.toDataURL(d.type,d.quality)}catch($){if(v.crossOrigin!=="anonymous"){v.crossOrigin="anonymous",v.complete&&v.naturalWidth!==0?L():v.addEventListener("load",L);return}else console.warn(`Cannot inline img src=${P}! Error: ${$}`)}v.crossOrigin==="anonymous"&&(R?b.crossOrigin=R:v.removeAttribute("crossorigin"))};v.complete&&v.naturalWidth!==0?L():v.addEventListener("load",L)}if((w==="audio"||w==="video")&&(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop)),x){const{width:v,height:P}=e.getBoundingClientRect();b={class:b.class,rr_width:`${v}px`,rr_height:`${P}px`}}w==="iframe"&&!p(b.src)&&(!x&&!G_(e)&&(b.rr_src=b.src),delete b.src);let B;try{customElements.get(w)&&(B=!0)}catch{}return{type:Ne.Element,tagName:w,attributes:b,childNodes:[],isSVG:ZN(e)||void 0,needBlock:x,rootId:m,isCustom:B}}function be(e){return e==null?"":e.toLowerCase()}function cx(e,t){if(t.comment&&e.type===Ne.Comment)return!0;if(e.type===Ne.Element){if(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"&&j_(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(be(e.attributes.name).match(/^msapplication-tile(image|color)$/)||be(e.attributes.name)==="application-name"||be(e.attributes.rel)==="icon"||be(e.attributes.rel)==="apple-touch-icon"||be(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&be(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(be(e.attributes.property).match(/^(og|twitter|fb):/)||be(e.attributes.name).match(/^(og|twitter):/)||be(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(be(e.attributes.name)==="robots"||be(e.attributes.name)==="googlebot"||be(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(be(e.attributes.name)==="author"||be(e.attributes.name)==="generator"||be(e.attributes.name)==="framework"||be(e.attributes.name)==="publisher"||be(e.attributes.name)==="progid"||be(e.attributes.property).match(/^article:/)||be(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(be(e.attributes.name)==="google-site-verification"||be(e.attributes.name)==="yandex-verification"||be(e.attributes.name)==="csrf-token"||be(e.attributes.name)==="p:domain_verify"||be(e.attributes.name)==="verify-v1"||be(e.attributes.name)==="verification"||be(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function wr(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k={},inlineImages:E=!1,recordCanvas:x=!1,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:I=5e3,onBlockedImageLoad:B,onStylesheetLoad:v,stylesheetLoadTimeout:P=5e3,keepIframeSrcFn:R=()=>!1,newlyAddedElement:L=!1,ignoreCSSAttributes:$}=t;let{preserveWhiteSpace:J=!0}=t;const te=ox(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,dataURLOptions:k,inlineImages:E,recordCanvas:x,keepIframeSrcFn:R,newlyAddedElement:L,ignoreCSSAttributes:$});if(!te)return console.warn(e,"not serialized"),null;let F;r.hasNode(e)?F=r.getId(e):cx(te,S)||!J&&te.type===Ne.Text&&!te.isStyle&&!te.textContent.trim().length?F=Uo:F=kl();const O=Object.assign(te,{id:F});if(r.add(e,O),F===Uo)return null;w&&w(e);let Q=!f;if(O.type===Ne.Element){Q=Q&&!O.needBlock;const T=e.shadowRoot;T&&Ao(T)&&(O.isShadowHost=!0)}if((O.type===Ne.Document||O.type===Ne.Element)&&Q){S.headWhitespace&&O.type===Ne.Element&&O.tagName==="head"&&(J=!1);const T={doc:n,mirror:r,blockClass:o,blockSelector:s,maskAllText:a,unblockSelector:i,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k,inlineImages:E,recordCanvas:x,preserveWhiteSpace:J,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:I,onBlockedImageLoad:B,onStylesheetLoad:v,stylesheetLoadTimeout:P,keepIframeSrcFn:R,ignoreCSSAttributes:$},W=e.childNodes?Array.from(e.childNodes):[];for(const z of W){const ne=wr(z,T);ne&&O.childNodes.push(ne)}if(xN(e)&&e.shadowRoot)for(const z of Array.from(e.shadowRoot.childNodes)){const ne=wr(z,T);ne&&(Ao(e.shadowRoot)&&(ne.isShadow=!0),O.childNodes.push(ne))}}if(e.parentNode&&Ro(e.parentNode)&&Ao(e.parentNode)&&(O.isShadow=!0),O.type===Ne.Element&&O.tagName==="iframe"&&!O.needBlock&&nx(e,()=>{const T=G_(e);if(T&&b){const W=wr(T,{doc:T,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k,inlineImages:E,recordCanvas:x,preserveWhiteSpace:J,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:I,onStylesheetLoad:v,stylesheetLoadTimeout:P,keepIframeSrcFn:R,ignoreCSSAttributes:$});W&&b(e,W)}},I),O.type===Ne.Element&&O.tagName==="img"&&!e.complete&&O.needBlock){const T=e,W=()=>{if(T.isConnected&&!T.complete&&B)try{const z=T.getBoundingClientRect();z.width>0&&z.height>0&&B(T,O,z)}catch{}T.removeEventListener("load",W)};T.isConnected&&T.addEventListener("load",W)}return O.type===Ne.Element&&O.tagName==="link"&&typeof O.attributes.rel=="string"&&(O.attributes.rel==="stylesheet"||O.attributes.rel==="preload"&&typeof O.attributes.href=="string"&&j_(O.attributes.href)==="css")&&rx(e,()=>{if(v){const T=wr(e,{doc:n,mirror:r,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:S,dataURLOptions:k,inlineImages:E,recordCanvas:x,preserveWhiteSpace:J,onSerialize:w,onIframeLoad:b,iframeLoadTimeout:I,onStylesheetLoad:v,stylesheetLoadTimeout:P,keepIframeSrcFn:R,ignoreCSSAttributes:$});T&&v(e,T)}},P),O.type===Ne.Element&&delete O.needBlock,O}function ux(e,t){const{mirror:n=new W_,blockClass:r="rr-block",blockSelector:o=null,unblockSelector:s=null,maskAllText:i=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOM:S=!1,dataURLOptions:k,preserveWhiteSpace:E,onSerialize:x,onIframeLoad:w,iframeLoadTimeout:b,onBlockedImageLoad:I,onStylesheetLoad:B,stylesheetLoadTimeout:v,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:R=new Set([])}=t||{};return wr(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,maskAllText:i,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions: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}:h===!1?{}:h,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:k,inlineImages:f,recordCanvas:p,preserveWhiteSpace:E,onSerialize:x,onIframeLoad:w,iframeLoadTimeout:b,onBlockedImageLoad:I,onStylesheetLoad:B,stylesheetLoadTimeout:v,keepIframeSrcFn:P,newlyAddedElement:!1,ignoreCSSAttributes:R})}function ze(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const yr=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let ep={map:{},getId(){return console.error(yr),-1},getNode(){return console.error(yr),null},removeNodeFromMap(){console.error(yr)},has(){return console.error(yr),!1},reset(){console.error(yr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ep=new Proxy(ep,{get(e,t,n){return t==="map"&&console.error(yr),Reflect.get(e,t,n)}}));function Ho(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();!o&&n.leading===!1&&(o=i);const a=t-(i-o),c=this;a<=0||a>t?(r&&(gx(r),r=null),o=i,e.apply(c,s)):!r&&n.trailing!==!1&&(r=Ra(()=>{o=n.leading===!1?0:Date.now(),r=null,e.apply(c,s)},a))}}function K_(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){Ra(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>K_(e,t,s||{},!0)}function Rl(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}let xi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(xi=()=>new Date().getTime());function J_(e){var n,r,o,s,i,a;const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(t==null?void 0:t.documentElement.scrollLeft)||((r=(n=t==null?void 0:t.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((o=t==null?void 0:t.body)==null?void 0:o.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((i=(s=t==null?void 0:t.body)==null?void 0:s.parentElement)==null?void 0:i.scrollTop)||((a=t==null?void 0:t.body)==null?void 0:a.scrollTop)||0}}function X_(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Q_(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Z_(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function et(e,t,n,r,o){if(!e)return!1;const s=Z_(e);if(!s)return!1;const i=Ir(t,n);if(!o){const u=r&&s.matches(r);return i(s)&&!u}const a=Bn(s,i);let c=-1;return a<0?!1:(r&&(c=Bn(s,Ir(null,r))),a>-1&&c<0?!0:a<c)}function lx(e,t){return t.getId(e)!==-1}function cc(e,t){return t.getId(e)===Uo}function ey(e,t){if(Ro(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?ey(e.parentNode,t):!0:!0}function Qc(e){return!!e.changedTouches}function dx(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=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function ty(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function ny(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Zc(e){return!!(e!=null&&e.shadowRoot)}class fx{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ry(e){var n,r;let t=null;return((r=(n=e.getRootNode)==null?void 0:n.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function px(e){let t=e,n;for(;n=ry(t);)t=n;return t}function hx(e){const t=e.ownerDocument;if(!t)return!1;const n=px(e);return t.contains(n)}function oy(e){const t=e.ownerDocument;return t?t.contains(e)||hx(e):!1}const tp={};function Al(e){const t=tp[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return tp[e]=r.bind(window)}function mx(...e){return Al("requestAnimationFrame")(...e)}function Ra(...e){return Al("setTimeout")(...e)}function gx(...e){return Al("clearTimeout")(...e)}var Z=(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))(Z||{}),K=(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))(K||{}),We=(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))(We||{}),qt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qt||{}),br=(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))(br||{});let Co;function _x(e){Co=e}function yx(){Co=void 0}const se=e=>Co?((...n)=>{try{return e(...n)}catch(r){if(Co&&Co(r)===!0)return()=>{};throw r}}):e;var np="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bx=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Ls=0;Ls<np.length;Ls++)bx[np.charCodeAt(Ls)]=Ls;class rp{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}function Cl(e){try{return e.contentDocument}catch{}}function Wo(e){try{return e.contentWindow}catch{}}class Sx{constructor(t){this.doc=t,this.unattachedDoc=null}parse(t){return this.parseWithConstructableStylesheet(t)||this.parseWithDetachedElement(t)}parseWithConstructableStylesheet(t){if(typeof CSSStyleSheet>"u"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;try{const n=new CSSStyleSheet;n.replaceSync(`x { ${t} }`);const r=n.cssRules[0];return!r||r.type!==CSSRule.STYLE_RULE?null:r.style}catch{return null}}parseWithDetachedElement(t){const n=this.getUnattachedDoc().createElement("span");return n.setAttribute("style",t),n.style}getUnattachedDoc(){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}return this.unattachedDoc}}function op(e){return"__ln"in e}class vx{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&op(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&op(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const sp=(e,t)=>`${e}@${t}`;class Ex{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=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new vx,o=c=>{let u=c,d=Uo;for(;d===Uo;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},s=c=>{if(!c.parentNode||!oy(c))return;const u=Ro(c.parentNode)?this.mirror.getId(ry(c)):this.mirror.getId(c.parentNode),d=o(c);if(u===-1||d===-1)return r.addNode(c);const l=wr(c,{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:f=>{ty(f,this.mirror)&&!et(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),ny(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Zc(c)&&this.shadowDomManager.addShadowRoot(c.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{if(et(f,this.blockClass,this.blockSelector,this.unblockSelector,!1))return;this.iframeManager.attachIframe(f,p);const h=Wo(f);h&&this.canvasManager.addWindow(h),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:m})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${m}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)ip(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!ap(this.droppedSet,c)&&!ip(this.removes,c,this.mirror)||ap(this.movedSet,c)?s(c):this.droppedSet.add(c);let i=null;for(;r.length;){let c=null;if(i){const u=this.mirror.getId(i.value.parentNode),d=o(i.value);u!==-1&&d!==-1&&(c=i)}if(!c){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(l!==-1){c=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){c=d;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}i=c.previous,r.removeNode(c.value),s(c.value)}const a={texts:this.texts.map(c=>({id:this.mirror.getId(c.node),value:c.value})).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:u}=c;if(typeof u.style=="string"){const d=JSON.stringify(c.styleDiff),l=JSON.stringify(c._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:u}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:t};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))},this.processMutation=t=>{if(!cc(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!et(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:Yr(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Z_(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,o=t.target.getAttribute(r);if(r==="value"){const i=wl(n),a=n.tagName;o=Ci(n,a,i);const c=wa({maskInputOptions:this.maskInputOptions,tagName:a,type:i}),u=Yr(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,c);o=Bo({isMasked:u,element:n,value:o,maskInputFn:this.maskInputFn})}if(et(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||o===t.oldValue)return;let s=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(o))if(!Cl(n))r="rr_src";else return;if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Y_(n.tagName,r)&&(s.attributes[r]=V_(this.doc,Vr(n.tagName),Vr(r),o,n,this.maskAttributeFn),r==="style")){const i=t.oldValue?this.styleDeclarationParser.parse(t.oldValue):null;for(const a of Array.from(n.style)){const c=n.style.getPropertyValue(a),u=n.style.getPropertyPriority(a);c!==((i==null?void 0:i.getPropertyValue(a))||"")||u!==((i==null?void 0:i.getPropertyPriority(a))||"")?u===""?s.styleDiff[a]=c:s.styleDiff[a]=[c,u]:s._unchangedStyles[a]=[c,u]}if(i)for(const a of Array.from(i))n.style.getPropertyValue(a)===""&&(s.styleDiff[a]=!1)}break}case"childList":{if(et(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),o=Ro(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);et(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||cc(n,this.mirror)||!lx(n,this.mirror)||(this.addedSet.has(n)?(eu(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||ey(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[sp(r,o)]?eu(this.movedSet,n):this.removes.push({parentId:o,id:r,isShadow:Ro(t.target)&&Ao(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(cc(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[sp(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);et(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Zc(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["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"].forEach(n=>{this[n]=t[n]}),this.styleDeclarationParser=new Sx(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 eu(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>eu(e,r))}function ip(e,t,n){return e.length===0?!1:Tx(e,t,n)}function Tx(e,t,n){let r=t.parentNode;for(;r;){const o=n.getId(r);if(e.some(s=>s.id===o))return!0;r=r.parentNode}return!1}function ap(e,t){return e.size===0?!1:sy(e,t)}function sy(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:sy(e,n):!1}const kr=[];function hs(e){try{if("composedPath"in e){const 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 iy(e,t){var i,a;const n=new Ex;kr.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const o=(a=(i=window==null?void 0:window.Zone)==null?void 0:i.__symbol__)==null?void 0:a.call(i,"MutationObserver");o&&window[o]&&(r=window[o]);const s=new r(se(c=>{e.onMutation&&e.onMutation(c)===!1||n.processMutations.bind(n)(c)}));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ix({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,s=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let i=[],a;const c=Ho(se(l=>{const f=Date.now()-a;e(i.map(p=>(p.timeOffset-=f,p)),l),i=[],a=null}),s),u=se(Ho(se(l=>{const f=hs(l),{clientX:p,clientY:h}=Qc(l)?l.changedTouches[0]:l;a||(a=xi()),i.push({x:p,y:h,id:r.getId(f),timeOffset:xi()-a}),c(typeof DragEvent<"u"&&l instanceof DragEvent?K.Drag:l instanceof MouseEvent?K.MouseMove:K.TouchMove)}),o,{trailing:!1})),d=[ze("mousemove",u,n),ze("touchmove",u,n),ze("drag",u,n)];return se(()=>{d.forEach(l=>l())})}function wx({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){if(i.mouseInteraction===!1)return()=>{};const a=i.mouseInteraction===!0||i.mouseInteraction===void 0?{}:i.mouseInteraction,c=[];let u=null;const d=l=>f=>{const p=hs(f);if(et(p,r,o,s,!0))return;let h=null,m=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=qt.Mouse;break;case"touch":h=qt.Touch;break;case"pen":h=qt.Pen;break}h===qt.Touch?We[l]===We.MouseDown?m="TouchStart":We[l]===We.MouseUp&&(m="TouchEnd"):qt.Pen}else Qc(f)&&(h=qt.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===qt.Touch||m.startsWith("Mouse")&&h===qt.Mouse)&&(h=null)):We[l]===We.Click&&(h=u,u=null);const g=Qc(f)?f.changedTouches[0]:f;if(!g)return;const y=n.getId(p),{clientX:S,clientY:k}=g;se(e)({type:We[m],id:y,x:S,y:k,...h!==null&&{pointerType:h}})};return Object.keys(We).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&a[l]!==!1).forEach(l=>{let f=Vr(l);const p=d(l);if(window.PointerEvent)switch(We[l]){case We.MouseDown:case We.MouseUp:f=f.replace("mouse","pointer");break;case We.TouchStart:case We.TouchEnd:return}c.push(ze(f,p,t))}),se(()=>{c.forEach(l=>l())})}function ay({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,sampling:i}){const a=se(Ho(se(c=>{const u=hs(c);if(!u||et(u,r,o,s,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=J_(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),i.scroll||100));return ze("scroll",a,t)}function kx({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const o=se(Ho(se(()=>{const s=X_(),i=Q_();(n!==s||r!==i)&&(e({width:Number(i),height:Number(s)}),n=s,r=i)}),200));return ze("resize",o,t)}const Rx=["INPUT","TEXTAREA","SELECT"],cp=new WeakMap;function Ax({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,ignoreClass:i,ignoreSelector:a,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function g(b){let I=hs(b);const B=b.isTrusted,v=I&&Jc(I.tagName);if(v==="OPTION"&&(I=I.parentElement),!I||!v||Rx.indexOf(v)<0||et(I,r,o,s,!0))return;const P=I;if(P.classList.contains(i)||a&&P.matches(a))return;const R=wl(I);let L=Ci(P,v,R),$=!1;const J=wa({maskInputOptions:c,tagName:v,type:R}),te=Yr(I,f,h,p,m,J);(R==="radio"||R==="checkbox")&&($=I.checked),L=Bo({isMasked:te,element:I,value:L,maskInputFn:u}),y(I,l?{text:L,isChecked:$,userTriggered:B}:{text:L,isChecked:$});const F=I.name;R==="radio"&&F&&$&&t.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(O=>{if(O!==I){const Q=Bo({isMasked:te,element:O,value:Ci(O,v,R),maskInputFn:u});y(O,l?{text:Q,isChecked:!$,userTriggered:!1}:{text:Q,isChecked:!$})}})}function y(b,I){const B=cp.get(b);if(!B||B.text!==I.text||B.isChecked!==I.isChecked){cp.set(b,I);const v=n.getId(b);se(e)({...I,id:v})}}const k=(d.input==="last"?["change"]:["input","change"]).map(b=>ze(b,se(g),t)),E=t.defaultView;if(!E)return()=>{k.forEach(b=>b())};const x=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),w=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return x&&x.set&&k.push(...w.map(b=>K_(b[0],b[1],{set(){se(g)({target:this,isTrusted:!1})}},!1,E))),se(()=>{k.forEach(b=>b())})}function Mi(e){const t=[];function n(r,o){if(Ds("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ds("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ds("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ds("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const i=Array.from(r.parentRule.cssRules).indexOf(r);o.unshift(i)}else if(r.parentStyleSheet){const i=Array.from(r.parentStyleSheet.cssRules).indexOf(r);o.unshift(i)}return o}return n(e,t)}function an(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Cx({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:se((d,l,f)=>{const[p,h]=f,{id:m,styleId:g}=an(l,t,n.styleMirror);return(m&&m!==-1||g&&g!==-1)&&e({id:m,styleId:g,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const s=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:se((d,l,f)=>{const[p]=f,{id:h,styleId:m}=an(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),d.apply(l,f)})});let i;r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:se((d,l,f)=>{const[p]=f,{id:h,styleId:m}=an(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),d.apply(l,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:se((d,l,f)=>{const[p]=f,{id:h,styleId:m}=an(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),d.apply(l,f)})}));const c={};Fs("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Fs("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Fs("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Fs("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(c).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:se((f,p,h)=>{const[m,g]=h,{id:y,styleId:S}=an(p.parentStyleSheet,t,n.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,adds:[{rule:m,index:[...Mi(p),g||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:se((f,p,h)=>{const[m]=h,{id:g,styleId:y}=an(p.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||y&&y!==-1)&&e({id:g,styleId:y,removes:[{index:[...Mi(p),m]}]}),f.apply(p,h)})})}),se(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function cy({mirror:e,stylesheetManager:t},n){var i,a,c;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const o=n.nodeName==="#document"?(i=n.defaultView)==null?void 0:i.Document:(c=(a=n.ownerDocument)==null?void 0:a.defaultView)==null?void 0:c.ShadowRoot,s=o!=null&&o.prototype?Object.getOwnPropertyDescriptor(o==null?void 0:o.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!o||!s?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var u;return(u=s.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=s.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return d}}),se(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Nx({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:se((a,c,u)=>{var m;const[d,l,f]=u;if(n.has(d))return s.apply(c,[d,l,f]);const{id:p,styleId:h}=an((m=c.parentRule)==null?void 0:m.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:Mi(c.parentRule)}),a.apply(c,u)})});const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:se((a,c,u)=>{var p;const[d]=u;if(n.has(d))return i.apply(c,[d]);const{id:l,styleId:f}=an((p=c.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:Mi(c.parentRule)}),a.apply(c,u)})}),se(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i})}function xx({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:o,sampling:s,doc:i}){const a=se(u=>Ho(se(d=>{const l=hs(d);if(!l||et(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=l;e({type:u,id:o.getId(l),currentTime:f,volume:p,muted:h,playbackRate:m})}),s.media||500)),c=[ze("play",a(br.Play),i),ze("pause",a(br.Pause),i),ze("seeked",a(br.Seeked),i),ze("volumechange",a(br.VolumeChange),i),ze("ratechange",a(br.RateChange),i)];return se(()=>{c.forEach(u=>u())})}function Mx({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(c,u,d){const l=new s(c,u,d);return o.set(l,{family:c,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const i=Rl(t.fonts,"add",function(a){return function(c){return Ra(se(()=>{const u=o.get(c);u&&(e(u),o.delete(c))}),0),a.apply(this,[c])}});return r.push(()=>{n.FontFace=s}),r.push(i),se(()=>{r.forEach(a=>a())})}function Ox(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,unblockSelector:s,selectionCb:i}=e;let a=!0;const c=se(()=>{const u=t.getSelection();if(!u||a&&(u!=null&&u.isCollapsed))return;a=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:m,endContainer:g,endOffset:y}=p;et(h,r,o,s,!0)||et(g,r,o,s,!0)||d.push({start:n.getId(h),startOffset:m,end:n.getId(g),endOffset:y})}i({ranges:d})});return c(),ze("selectionchange",c)}function Px({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:Rl(n.customElements,"define",function(o){return function(s,i,a){try{t({define:{name:s}})}catch{}return o.apply(this,[s,i,a])}})}function Lx(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=iy(e,e.doc));const o=Ix(e),s=wx(e),i=ay(e),a=kx(e,{win:n}),c=Ax(e),u=xx(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=Cx(e,{win:n}),l=cy(e,e.doc),f=Nx(e,{win:n}),e.collectFonts&&(p=Mx(e)));const h=Ox(e),m=Px(e),g=[];for(const y of e.plugins)g.push(y.observer(y.callback,n,y.options));return se(()=>{kr.forEach(y=>y.reset()),r==null||r.disconnect(),o(),s(),i(),a(),c(),u(),d(),l(),f(),p(),h(),m(),g.forEach(y=>y())})}function Ds(e){return typeof window[e]<"u"}function Fs(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class tu{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,o){const s=r||this.getIdToRemoteIdMap(t),i=o||this.getRemoteIdToIdMap(t);let a=s.get(n);return a||(a=this.generateIdFn(),s.set(n,a),i.set(a,n)),a}getIds(t,n){const r=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return n.map(s=>this.getId(t,s,r,o))}getRemoteId(t,n,r){const o=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const s=o.get(n);return s||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(o=>this.getRemoteId(t,o,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class Dx{constructor(){this.crossOriginIframeMirror=new tu(kl),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Fx{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new tu(kl),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tu(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0);const n=Wo(t);n&&this.crossOriginIframeMap.set(n,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var o,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((o=Wo(t))==null||o.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t);const r=Cl(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const o=this.crossOriginIframeMap.get(t.source);if(!o)return;const s=this.transformCrossOriginEvent(o,n.data.event);s&&this.wrappedEmit(s,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case Z.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const o=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(n.data.node,o),{timestamp:n.timestamp,type:Z.IncrementalSnapshot,data:{source:K.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Z.Meta:case Z.Load:case Z.DomContentLoaded:return!1;case Z.Plugin:return n;case Z.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case Z.IncrementalSnapshot:switch(n.data.source){case K.Mutation:return n.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);const s=this.crossOriginIframeRootIdMap.get(t);s&&this.patchRootIdOnNode(o.node,s)}),n.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),n.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),n.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case K.Drag:case K.TouchMove:case K.MouseMove:return n.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),n;case K.ViewportResize:return!1;case K.MediaInteraction:case K.MouseInteraction:case K.Scroll:case K.CanvasMutation:case K.Input:return this.replaceIds(n.data,t,["id"]),n;case K.StyleSheetRule:case K.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case K.Font:return n;case K.Selection:return n.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),n;case K.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),n}}return!1}replace(t,n,r,o){for(const s of o)!Array.isArray(n[s])&&typeof n[s]!="number"||(Array.isArray(n[s])?n[s]=t.getIds(r,n[s]):n[s]=t.getId(r,n[s]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==Ne.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class $x{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Bx{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!Ao(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=iy({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(ay({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Ra(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(cy({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=Cl(t),r=Wo(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(Rl(t.prototype,"attachShadow",function(o){return function(s){const i=o.call(this,s);return this.shadowRoot&&oy(this)&&r.addShadowRoot(this.shadowRoot,n),i}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class Ux{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new fx,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},o=[];for(const s of t){let i;this.styleMirror.has(s)?i=this.styleMirror.getId(s):(i=this.styleMirror.add(s),o.push({styleId:i,rules:Array.from(s.rules||CSSRule,(a,c)=>({rule:H_(a),index:c}))})),r.styleIds.push(i)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Hx{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(o=>o!==n)}add(t,n){this.active||(this.active=!0,mx(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let Re,Oi;var ih;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ih=e.contentWindow)==null?void 0:ih.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const pt=$N();function yt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:i=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:S,maskInputFn:k,maskTextFn:E,maxCanvasSize:x=null,packFn:w,sampling:b={},dataURLOptions:I={},mousemoveWait:B,recordDOM:v=!0,recordCanvas:P=!1,recordCrossOriginIframes:R=!1,recordAfter:L=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:$=!1,collectFonts:J=!1,inlineImages:te=!1,plugins:F,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:Q=new Set([]),errorHandler:T,onMutation:W,getCanvasManager:z}=e;_x(T);const ne=R?window.parent===window:!0;let ie=!1;if(!ne)try{window.parent.document&&(ie=!1)}catch{ie=!0}if(ne&&!t)throw new Error("emit function is required");if(!ne&&!ie)return()=>{};B!==void 0&&b.mousemove===void 0&&(b.mousemove=B),pt.reset();const de=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,radio:!0,checkbox:!0}:g!==void 0?g:{},Be=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};dx();let Xe,Cn=0;const vs=D=>{for(const ae of F||[])ae.eventProcessor&&(D=ae.eventProcessor(D));return w&&!ie&&(D=w(D)),D};Re=(D,ae)=>{var fe;const X=D;if(X.timestamp=xi(),(fe=kr[0])!=null&&fe.isFrozen()&&X.type!==Z.FullSnapshot&&!(X.type===Z.IncrementalSnapshot&&X.data.source===K.Mutation)&&kr.forEach(le=>le.unfreeze()),ne)t==null||t(vs(X),ae);else if(ie){const le={type:"rrweb",event:vs(X),origin:window.location.origin,isCheckout:ae};window.parent.postMessage(le,"*")}if(X.type===Z.FullSnapshot)Xe=X,Cn=0;else if(X.type===Z.IncrementalSnapshot){if(X.data.source===K.Mutation&&X.data.isAttachIframe)return;Cn++;const le=r&&Cn>=r,oe=n&&Xe&&X.timestamp-Xe.timestamp>n;(le||oe)&&Mn(!0)}};const Nn=D=>{Re({type:Z.IncrementalSnapshot,data:{source:K.Mutation,...D}})},Es=D=>Re({type:Z.IncrementalSnapshot,data:{source:K.Scroll,...D}}),Wt=D=>Re({type:Z.IncrementalSnapshot,data:{source:K.CanvasMutation,...D}}),nt=D=>Re({type:Z.IncrementalSnapshot,data:{source:K.AdoptedStyleSheet,...D}}),Ve=new Ux({mutationCb:Nn,adoptedStyleSheetCb:nt}),Qe=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new Dx:new Fx({mirror:pt,mutationCb:Nn,stylesheetManager:Ve,recordCrossOriginIframes:R,wrappedEmit:Re});for(const D of F||[])D.getMirror&&D.getMirror({nodeMirror:pt,crossOriginIframeMirror:Qe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Qe.crossOriginIframeStyleMirror});const lr=new Hx,dr=jx(z,{mirror:pt,win:window,mutationCb:D=>Re({type:Z.IncrementalSnapshot,data:{source:K.CanvasMutation,...D}}),recordCanvas:P,blockClass:o,blockSelector:s,unblockSelector:i,maxCanvasSize:x,sampling:b.canvas,dataURLOptions:I,errorHandler:T}),xn=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new $x:new Bx({mutationCb:Nn,scrollCb:Es,bypassOptions:{onMutation:W,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:de,dataURLOptions:I,maskAttributeFn:S,maskTextFn:E,maskInputFn:k,recordCanvas:P,inlineImages:te,sampling:b,slimDOMOptions:Be,iframeManager:Qe,stylesheetManager:Ve,canvasManager:dr,keepIframeSrcFn:O,processedNodeManager:lr,ignoreCSSAttributes:Q},mirror:pt}),Mn=(D=!1)=>{if(!v)return;Re({type:Z.Meta,data:{href:window.location.href,width:Q_(),height:X_()}},D),Ve.reset(),xn.init(),kr.forEach(X=>X.lock());const ae=ux(document,{mirror:pt,blockClass:o,blockSelector:s,unblockSelector:i,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:de,maskAttributeFn:S,maskInputFn:k,maskTextFn:E,slimDOM:Be,dataURLOptions:I,recordCanvas:P,inlineImages:te,onSerialize:X=>{ty(X,pt)&&Qe.addIframe(X),ny(X,pt)&&Ve.trackLinkElement(X),Zc(X)&&xn.addShadowRoot(X.shadowRoot,document)},onIframeLoad:(X,fe)=>{Qe.attachIframe(X,fe);const le=Wo(X);le&&dr.addWindow(le),xn.observeAttachShadow(X)},onStylesheetLoad:(X,fe)=>{Ve.attachLinkElement(X,fe)},onBlockedImageLoad:(X,fe,{width:le,height:oe})=>{Nn({adds:[],removes:[],texts:[],attributes:[{id:fe.id,attributes:{style:{width:`${le}px`,height:`${oe}px`}}}]})},keepIframeSrcFn:O,ignoreCSSAttributes:Q});if(!ae)return console.warn("Failed to snapshot the document");Re({type:Z.FullSnapshot,data:{node:ae,initialOffset:J_(window)}}),kr.forEach(X=>X.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ve.adoptStyleSheets(document.adoptedStyleSheets,pt.getId(document))};Oi=Mn;try{const D=[],ae=fe=>{var le;return se(Lx)({onMutation:W,mutationCb:Nn,mousemoveCb:(oe,He)=>Re({type:Z.IncrementalSnapshot,data:{source:He,positions:oe}}),mouseInteractionCb:oe=>Re({type:Z.IncrementalSnapshot,data:{source:K.MouseInteraction,...oe}}),scrollCb:Es,viewportResizeCb:oe=>Re({type:Z.IncrementalSnapshot,data:{source:K.ViewportResize,...oe}}),inputCb:oe=>Re({type:Z.IncrementalSnapshot,data:{source:K.Input,...oe}}),mediaInteractionCb:oe=>Re({type:Z.IncrementalSnapshot,data:{source:K.MediaInteraction,...oe}}),styleSheetRuleCb:oe=>Re({type:Z.IncrementalSnapshot,data:{source:K.StyleSheetRule,...oe}}),styleDeclarationCb:oe=>Re({type:Z.IncrementalSnapshot,data:{source:K.StyleDeclaration,...oe}}),canvasMutationCb:Wt,fontCb:oe=>Re({type:Z.IncrementalSnapshot,data:{source:K.Font,...oe}}),selectionCb:oe=>{Re({type:Z.IncrementalSnapshot,data:{source:K.Selection,...oe}})},customElementCb:oe=>{Re({type:Z.IncrementalSnapshot,data:{source:K.CustomElement,...oe}})},blockClass:o,ignoreClass:a,ignoreSelector:c,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:de,inlineStylesheet:h,sampling:b,recordDOM:v,recordCanvas:P,inlineImages:te,userTriggeredOnInput:$,collectFonts:J,doc:fe,maskAttributeFn:S,maskInputFn:k,maskTextFn:E,keepIframeSrcFn:O,blockSelector:s,unblockSelector:i,slimDOMOptions:Be,dataURLOptions:I,mirror:pt,iframeManager:Qe,stylesheetManager:Ve,shadowDomManager:xn,processedNodeManager:lr,canvasManager:dr,ignoreCSSAttributes:Q,plugins:((le=F==null?void 0:F.filter(oe=>oe.observer))==null?void 0:le.map(oe=>({observer:oe.observer,options:oe.options,callback:He=>Re({type:Z.Plugin,data:{plugin:oe.name,payload:He}})})))||[]},{})};Qe.addLoadListener(fe=>{try{D.push(ae(fe.contentDocument))}catch(le){console.warn(le)}});const X=()=>{Mn(),D.push(ae(document))};return document.readyState==="interactive"||document.readyState==="complete"?X():(D.push(ze("DOMContentLoaded",()=>{Re({type:Z.DomContentLoaded,data:{}}),L==="DOMContentLoaded"&&X()})),D.push(ze("load",()=>{Re({type:Z.Load,data:{}}),L==="load"&&X()},window))),()=>{D.forEach(fe=>fe()),lr.destroy(),Oi=void 0,yx()}}catch(D){console.warn(D)}}function Wx(e){if(!Oi)throw new Error("please take full snapshot after start recording");Oi(e)}yt.mirror=pt;yt.takeFullSnapshot=Wx;function jx(e,t){try{return e?e(t):new rp}catch{return console.warn("Unable to initialize CanvasManager"),new rp}}var up;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(up||(up={}));const zx=3,qx=5;function Nl(e){return e>9999999999?e:e*1e3}function uc(e){return e>9999999999?e/1e3:e}function ms(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:Z.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Ae(t,10,1e3)}}),t.category==="console")))}const Gx="button,a";function uy(e){return e.closest(Gx)||e}function ly(e){const t=dy(e);return!t||!(t instanceof Element)?t:uy(t)}function dy(e){return Vx(e)?e.target:e}function Vx(e){return typeof e=="object"&&!!e&&"target"in e}let cn;function Yx(e){return cn||(cn=[],Kx()),cn.push(e),()=>{const t=cn?cn.indexOf(e):-1;t>-1&&cn.splice(t,1)}}function Kx(){De(Se,"open",function(e){return function(...t){if(cn)try{cn.forEach(n=>n())}catch{}return e.apply(Se,t)}})}const Jx=new Set([K.Mutation,K.StyleSheetRule,K.StyleDeclaration,K.AdoptedStyleSheet,K.CanvasMutation,K.Selection,K.MediaInteraction]);function Xx(e,t,n){e.handleClick(t,n)}class Qx{constructor(t,n,r=ms){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=Yx(()=>{this._lastMutation=lp()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(eM(n,this._ignoreSelector)||!tM(t))return;const r={timestamp:uc(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(o=>o.node===r.node&&Math.abs(o.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=uc(t)}registerScroll(t=Date.now()){this._lastScroll=uc(t)}registerClick(t){const n=uy(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=lp();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const o=this._clicks.indexOf(r);o>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(o,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,o=t.mutationAfter&&t.mutationAfter<=this._threshold,s=!r&&!o,{clickCount:i,clickBreadcrumb:a}=t;if(s){const c=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=c<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.slowClickDetected",data:{...a.data,url:Se.location.href,route:n.getCurrentRoute(),timeAfterClickMs:c,endReason:u,clickCount:i||1}};this._addBreadcrumbEvent(n,d);return}if(i>1){const c={type:"default",message:a.message,timestamp:a.timestamp,category:"ui.multiClick",data:{...a.data,url:Se.location.href,route:n.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(n,c)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=ps(()=>this._checkClicks(),1e3)}}const Zx=["A","BUTTON","INPUT"];function eM(e,t){return!!(!Zx.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 tM(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function lp(){return Date.now()/1e3}function nM(e,t){try{if(!rM(t))return;const{source:n}=t.data;if(Jx.has(n)&&e.registerMutation(t.timestamp),n===K.Scroll&&e.registerScroll(t.timestamp),oM(t)){const{type:r,id:o}=t.data,s=yt.mirror.getNode(o);s instanceof HTMLElement&&r===We.Click&&e.registerClick(s)}}catch{}}function rM(e){return e.type===zx}function oM(e){return e.data.source===K.MouseInteraction}function kt(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Aa=(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))(Aa||{});const sM=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function iM(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(sM.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const aM=e=>t=>{if(!e.isEnabled())return;const n=cM(t);if(!n)return;const r=t.name==="click",o=r?t.event:void 0;r&&e.clickDetector&&(o!=null&&o.target)&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.shiftKey&&Xx(e.clickDetector,n,ly(t.event)),ms(e,n)};function fy(e,t){const n=yt.mirror.getId(e),r=n&&yt.mirror.getNode(n),o=r&&yt.mirror.getMeta(r),s=o&&lM(o)?o:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map(i=>i.type===Aa.Text&&i.textContent).filter(Boolean).map(i=>i.trim()).join(""),attributes:iM(s.attributes)}}:{}}}function cM(e){const{target:t,message:n}=uM(e);return kt({category:`ui.${e.name}`,...fy(t,n)})}function uM(e){const t=e.name==="click";let n,r=null;try{r=t?ly(e.event):dy(e.event),n=Pe(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function lM(e){return e.type===Aa.Element}function dM(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=fM(t);n&&ms(e,n)}function fM(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s,target:i}=e;if(!i||pM(i)||!s)return null;const a=t||r||o,c=s.length===1;if(!a&&c)return null;const u=Pe(i,{maxStringLength:200})||"<unknown>",d=fy(i,u);return kt({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:o,key:s}})}function pM(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const hM={resource:bM,paint:_M,navigation:yM};function lc(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function mM(e){return e.map(gM).filter(Boolean)}function gM(e){const t=hM[e.entryType];return t?t(e):null}function Kr(e){return((Ce()||Se.performance.timeOrigin)+e)/1e3}function _M(e){const{duration:t,entryType:n,name:r,startTime:o}=e,s=Kr(o);return{type:n,name:r,start:s,end:s+t,data:void 0}}function yM(e){const{entryType:t,name:n,decodedBodySize:r,duration:o,domComplete:s,encodedBodySize:i,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return o===0?null:{type:`${t}.${m}`,start:Kr(p),end:Kr(s),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:i,duration:o,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:d,loadEventEnd:l,domComplete:s,redirectCount:f}}}function bM(e){const{entryType:t,initiatorType:n,name:r,responseEnd:o,startTime:s,decodedBodySize:i,encodedBodySize:a,responseStatus:c,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Kr(s),end:Kr(o),name:r,data:{size:u,statusCode:c,decodedBodySize:i,encodedBodySize:a}}}function SM(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return xl(e,"largest-contentful-paint",n)}function vM(e){return e.sources!==void 0}function EM(e){const t=[],n=[];for(const r of e.entries)if(vM(r)){const o=[];for(const s of r.sources)if(s.node){n.push(s.node);const i=yt.mirror.getId(s.node);i&&o.push(i)}t.push({value:r.value,nodeIds:o.length?o:void 0})}return xl(e,"cumulative-layout-shift",n,t)}function TM(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return xl(e,"interaction-to-next-paint",n)}function xl(e,t,n,r){const o=e.value,s=e.rating,i=Kr(o);return{type:"web-vital",name:t,start:i,end:i,data:{value:o,size:o,rating:s,nodeIds:n?n.map(a=>yt.mirror.getId(a)):void 0,attributions:r}}}function IM(e){function t(o){e.performanceEntries.includes(o)||e.performanceEntries.push(o)}function n({entries:o}){o.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(o=>{r.push(Sn(o,n))}),r.push(ya(lc(SM,e)),_a(lc(EM,e)),ul(lc(TM,e))),()=>{r.forEach(o=>o())}}const q=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,wM='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 kM(){const e=new Blob([wM]);return URL.createObjectURL(e)}const dp=["log","warn","error"],ni="[Replay] ";function dc(e,t="info"){ut({category:"console",data:{logger:"replay"},level:t,message:`${ni}${e}`},{level:t})}function RM(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return q?(dp.forEach(r=>{n[r]=(...o)=>{_[r](ni,...o),t&&dc(o.join(""),Do(r))}}),n.exception=(r,...o)=>{o.length&&n.error&&n.error(...o),_.error(ni,r),e?pe(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&dc(r,"error")},n.infoTick=(...r)=>{_.log(ni,...r),t&&setTimeout(()=>dc(r[0]),0)}):dp.forEach(r=>{n[r]=()=>{}}),n}const G=RM();class Ml extends Error{constructor(){super(`Event buffer exceeded maximum size of ${Il}.`)}}class py{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(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>Il)throw new Ml;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(const{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:Nl(t)}}class AM{constructor(t){this._onMessage=({data:n})=>{const r=n;if(typeof r.id!="number")return;const o=this._pending.get(r.id);if(!(!o||o.method!==r.method)){if(this._pending.delete(r.id),!r.success){q&&G.error("Error in compression worker: ",r.response),o.reject(new Error("Error in compression worker"));return}o.resolve(r.response)}},this._worker=t,this._id=0,this._pending=new Map,this._worker.addEventListener("message",this._onMessage)}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(q&&G.warn("Received worker message with unsuccessful status",r),n(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",r=>{q&&G.warn("Failed to load Replay compression worker",r),n(new Error(`Failed to load Replay compression worker: ${r instanceof ErrorEvent&&r.message?r.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&&G.log("Destroying compression worker"),this._worker.removeEventListener("message",this._onMessage),this._pending.forEach(t=>t.reject(new Error("Worker destroyed"))),this._pending.clear(),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((o,s)=>{this._pending.set(r,{method:t,resolve:o,reject:s});try{this._worker.postMessage({id:r,method:t,arg:n})}catch(i){this._pending.delete(r),s(i)}})}_getAndIncrementId(){return this._id++}}class CM{constructor(t){this._worker=new AM(t),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(t){const n=Nl(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>Il?Promise.reject(new Ml):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{q&&G.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class NM{constructor(t){this._fallback=new py,this._compression=new CM(t),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(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){q&&G.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,o=[];for(const s of t)o.push(this._compression.addEvent(s));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(o),this._fallback.clear()}catch(s){q&&G.exception(s,"Failed to add events when switching buffers.")}}}function xM({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=MM(t);if(n)return n}return q&&G.log("Using simple buffer"),new py}function MM(e){try{const t=e||OM();if(!t)return;q&&G.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new NM(n)}catch(t){q&&G.exception(t,"Failed to create compression worker")}}function OM(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?kM():""}function Ol(){try{return"sessionStorage"in Se&&!!Se.sessionStorage}catch{return!1}}function PM(e){LM(),e.session=void 0}function LM(){if(Ol())try{Se.sessionStorage.removeItem(El)}catch{}}function hy(e){return e===void 0?!1:Math.random()<e}function Ca(e){if(Ol())try{Se.sessionStorage.setItem(El,JSON.stringify(e))}catch{}}function my(e){const t=Date.now(),n=e.id||Me(),r=e.started||t,o=e.lastActivity||t,s=e.segmentId||0,i=e.sampled,a=e.previousSessionId,c=e.dirty||!1;return{id:n,started:r,lastActivity:o,segmentId:s,sampled:i,previousSessionId:a,dirty:c}}function DM(e,t){return hy(e)?"session":t?"buffer":!1}function fp({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const o=DM(e,t),s=my({sampled:o,previousSessionId:r});return n&&Ca(s),s}function FM(){if(!Ol())return null;try{const e=Se.sessionStorage.getItem(El);if(!e)return null;const t=JSON.parse(e);return q&&G.infoTick("Loading existing session"),my(t)}catch{return null}}function nu(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function $M(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return nu(e.started,t,r)||nu(e.lastActivity,n,r)}function Pi(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!$M(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function fc({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const o=r.stickySession&&FM();return o?Pi(o,{sessionIdleExpire:e,maxReplayDuration:t})?(q&&G.infoTick("Session in sessionStorage is expired, creating new one..."),fp(r,{previousSessionId:o.id})):o:(q&&G.infoTick("Creating new session"),fp(r,{previousSessionId:n}))}function BM(e){return e.type===Z.Custom}function Pl(e,t,n){return _y(e,t)?(gy(e,t,n),!0):!1}function UM(e,t,n){return _y(e,t)?gy(e,t,n):Promise.resolve(null)}async function gy(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const o=e.recordingMode==="buffer";try{n&&o&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const s=e.getOptions(),i=HM(t,s.beforeAddRecordingEvent);return i?await r.addEvent(i):void 0}catch(s){const i=s&&s instanceof Ml,a=i?"eventBufferOverflow":"eventBufferError",c=N();if(c){const u=i?"buffer_overflow":"internal_sdk_error";c.recordDroppedEvent(u,"replay")}if(i&&o)return r.clear(),r.waitForCheckout=!0,null;e.handleException(s),await e.stop({reason:a})}}function _y(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Nl(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(q&&G.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function HM(e,t){try{if(typeof t=="function"&&BM(e))return t(e)}catch(n){return q&&G.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function Ll(e){return!e.type}function ru(e){return e.type==="transaction"}function WM(e){return e.type==="replay_event"}function pp(e){return e.type==="feedback"}function jM(e){return(t,n)=>{if(!e.isEnabled()||!Ll(t)&&!ru(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(ru(t)){zM(e,t);return}qM(e,t)}}}function zM(e,t){var r,o;const n=e.getContext();(o=(r=t.contexts)==null?void 0:r.trace)!=null&&o.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function qM(e,t){var o;const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!((o=t.tags)!=null&&o.replayId))return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||ps(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(s){e.handleException(s)}})}function GM(e){return t=>{!e.isEnabled()||!Ll(t)||VM(e,t)}}function VM(e,t){var r,o,s;const n=(s=(o=(r=t.exception)==null?void 0:r.values)==null?void 0:o[0])==null?void 0:s.value;if(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))){const i=kt({category:"replay.hydrate-error",data:{url:ir()}});ms(e,i)}}function YM(e){const t=N();t&&t.on("beforeAddBreadcrumb",n=>KM(e,n))}function KM(e,t){if(!e.isEnabled()||!yy(t))return;const n=JM(t);n&&ms(e,n)}function JM(e){return!yy(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?XM(e):kt(e)}function XM(e){var o;const t=(o=e.data)==null?void 0:o.arguments;if(!Array.isArray(t)||t.length===0)return kt(e);let n=!1;const r=t.map(s=>{if(!s)return s;if(typeof s=="string")return s.length>Ps?(n=!0,`${s.slice(0,Ps)}…`):s;if(typeof s=="object")try{const i=Ae(s,7);return JSON.stringify(i).length>Ps?(n=!0,`${JSON.stringify(i,null,2).slice(0,Ps)}…`):i}catch{}return s});return kt({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function yy(e){return!!e.category}function QM(e,t){var n,r,o;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((o=t.originalException)!=null&&o.__rrweb__)}function Li(){const e=j().getPropagationContext().dsc;e&&delete e.replay_id;const t=Te();if(t){const n=vt(t);delete n.replay_id}}function hp(e){const t=j().getPropagationContext().dsc;t&&(t.replay_id=e);const n=Te();if(n){const r=vt(n);r.replay_id=e}}function ZM(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:Z.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function eO(e,t){return e.recordingMode!=="buffer"||t.message===Tl||!t.exception||t.type?!1:hy(e.getOptions().errorSampleRate)}function tO(e){return Object.assign((t,n)=>{var i;if(e.session&&Pi(e.session,{maxReplayDuration:e.getOptions().maxReplayDuration,sessionIdleExpire:e.timeouts.sessionIdleExpire})&&Li(),!e.isEnabled()||e.isPaused())return t;if(WM(t))return delete t.breadcrumbs,t;if(!Ll(t)&&!ru(t)&&!pp(t))return t;if(!e.checkAndHandleExpiredSession())return Li(),t;if(pp(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),ZM(e,t),t;if(QM(t,n)&&!e.getOptions()._experiments.captureExceptions)return q&&G.log("Ignoring error from rrweb internals",t),null;const o=eO(e,t);if((o||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),o&&e.recordingMode==="buffer"&&((i=e.session)==null?void 0:i.sampled)==="buffer"){const a=e.session;a.dirty=!0,e.getOptions().stickySession&&Ca(a)}return t},{id:"Replay"})}function Na(e,t){return t.map(({type:n,start:r,end:o,name:s,data:i})=>{const a=e.throttledAddEvent({type:Z.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:o,data:i}}});return typeof a=="string"?Promise.resolve(null):a})}function nO(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function rO(e){return t=>{if(!e.isEnabled())return;const n=nO(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Na(e,[n]),!1)))}}function oO(e,t){return q&&e.getOptions()._experiments.traceInternals?!1:qm(t,N())}function by(e,t){e.isEnabled()&&t!==null&&(oO(e,t.name)||e.addUpdate(()=>(Na(e,[t]),!0)))}function xa(e){if(!e)return;const 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){const n=v_(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function Sy(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Di(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function vy(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:o,method:s,statusCode:i,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:o,data:{method:s,statusCode:i,request:a,response:c}}}function jo(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function fn(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:o,warnings:s}=sO(n);return r.body=o,s!=null&&s.length&&(r._meta={warnings:s}),r}function ou(e,t){return Object.entries(e).reduce((n,[r,o])=>{const s=r.toLowerCase();return t.includes(s)&&e[r]&&(n[s]=o),n},{})}function sO(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Vf,n=iO(e);if(t){const r=e.slice(0,Vf);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function iO(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function Fi(e,t){const n=aO(e);return ct(n,t)}function aO(e,t=Se.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Se.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function cO(e,t,n){try{const r=await lO(e,t,n),o=vy("resource.fetch",r);by(n.replay,o)}catch(r){q&&G.exception(r,"Failed to capture fetch breadcrumb")}}function uO(e,t){const{input:n,response:r}=t,o=n?hl(n):void 0,s=xa(o),i=r?Sy(r.headers.get("content-length")):void 0;s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}async function lO(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r}=t,{url:i,method:a,status_code:c=0,request_body_size:u,response_body_size:d}=e.data,l=Fi(i,n.networkDetailAllowUrls)&&!Fi(i,n.networkDetailDenyUrls),f=l?dO(n,t.input,u):jo(u),p=await fO(l,n,t.response,d);return{startTimestamp:o,endTimestamp:s,url:i,method:a,statusCode:c,request:f,response:p}}function dO({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const o=n?mO(n,t):{};if(!e)return fn(o,r,void 0);const s=hl(n),[i,a]=Ri(s,G),c=fn(o,r,i);return a?Di(c,a):c}async function fO(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,o){if(!e&&o!==void 0)return jo(o);const s=r?Ey(r.headers,n):{};if(!r||!t&&o!==void 0)return fn(s,o,void 0);const[i,a]=await hO(r),c=pO(i,{networkCaptureBodies:t,responseBodySize:o,captureDetails:e,headers:s});return a?Di(c,a):c}function pO(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:o}){try{const s=e!=null&&e.length&&n===void 0?xa(e):n;return r?t?fn(o,s,e):fn(o,s,void 0):jo(s)}catch(s){return q&&G.exception(s,"Failed to serialize response body"),fn(o,n,void 0)}}async function hO(e){const t=gO(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await _O(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(q&&G.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(q&&G.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function Ey(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function mO(e,t){return e.length===1&&typeof e[0]!="string"?mp(e[0],t):e.length===2?mp(e[1],t):{}}function mp(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?Ey(n,t):Array.isArray(n)?{}:ou(n,t):{}}function gO(e){try{return e.clone()}catch(t){q&&G.exception(t,"Failed to clone response body")}}function _O(e){return new Promise((t,n)=>{const r=ps(()=>n(new Error("Timeout while trying to read response body")),500);yO(e).then(o=>t(o),o=>n(o)).finally(()=>clearTimeout(r))})}async function yO(e){return await e.text()}async function bO(e,t,n){try{const r=vO(e,t,n),o=vy("resource.xhr",r);by(n.replay,o)}catch(r){q&&G.exception(r,"Failed to capture xhr breadcrumb")}}function SO(e,t){const{xhr:n,input:r}=t;if(!n)return;const o=xa(r),s=n.getResponseHeader("content-length")?Sy(n.getResponseHeader("content-length")):IO(n.response,n.responseType);o!==void 0&&(e.data.request_body_size=o),s!==void 0&&(e.data.response_body_size=s)}function vO(e,t,n){const r=Date.now(),{startTimestamp:o=r,endTimestamp:s=r,input:i,xhr:a}=t,{url:c,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!c)return null;if(!a||!Fi(c,n.networkDetailAllowUrls)||Fi(c,n.networkDetailDenyUrls)){const w=jo(l),b=jo(f);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:w,response:b}}const p=a[Gt],h=p?ou(p.request_headers,n.networkRequestHeaders):{},m=ou(E_(a),n.networkResponseHeaders),[g,y]=n.networkCaptureBodies?Ri(i,G):[void 0],[S,k]=n.networkCaptureBodies?EO(a):[void 0],E=fn(h,l,g),x=fn(m,f,S);return{startTimestamp:o,endTimestamp:s,url:c,method:u,statusCode:d,request:y?Di(E,y):E,response:k?Di(x,k):x}}function EO(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return TO(e.response,e.responseType)}catch(n){t.push(n)}return q&&G.warn("Failed to get xhr response body",...t),[void 0]}function TO(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return q&&G.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return q&&G.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function IO(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return xa(n)}catch{return}}function wO(e){const t=N();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:o,networkRequestHeaders:s,networkResponseHeaders:i};t&&t.on("beforeAddBreadcrumb",(c,u)=>kO(a,c,u))}catch{}}function kO(e,t,n){if(t.data)try{RO(t)&&CO(n)&&(SO(t,n),bO(t,n,e)),AO(t)&&NO(n)&&(uO(t,n),cO(t,n,e))}catch(r){q&&G.exception(r,"Error when enriching network breadcrumb")}}function RO(e){return e.category==="xhr"}function AO(e){return e.category==="fetch"}function CO(e){return e==null?void 0:e.xhr}function NO(e){return(e==null?void 0:e.input)!==void 0}function xO(e){const t=N();S_(aM(e)),Ea(rO(e)),YM(e),wO(e);const n=tO(e);xu(n),t&&(t.on("beforeSendEvent",GM(e)),t.on("afterSendEvent",jM(e)),t.on("createDsc",r=>{const o=e.getSessionId();o&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=o)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,o)=>{var i;const s=e.getSessionId();o!=null&&o.includeReplay&&e.isEnabled()&&s&&((i=r.contexts)!=null&&i.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=s)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function MO(e){try{return Promise.all(Na(e,[OO(Se.performance.memory)]))}catch{return[]}}function OO(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,o=Date.now()/1e3;return{type:"memory",name:"memory",start:o,end:o,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function PO(e,t,n){return yT(e,t,{...n,setTimeoutImpl:ps})}const ot=H.navigator;function LO(){return/iPhone|iPad|iPod/i.test((ot==null?void 0:ot.userAgent)??"")||/Macintosh/i.test((ot==null?void 0:ot.userAgent)??"")&&(ot!=null&&ot.maxTouchPoints)&&(ot==null?void 0:ot.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function DO(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){q&&G.warn("Received replay event after session expired.");return}const o=r||!t;t=!0,FO(n),e.clickDetector&&nM(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&o&&e.setInitialState(),!Pl(e,n,o))return!0;if(!o)return!1;const s=e.session;if(BO(e,o),e.recordingMode==="buffer"&&s&&e.eventBuffer&&!s.dirty){const i=e.eventBuffer.getEarliestTimestamp();i&&(q&&G.log(`Updating session start time to earliest event in buffer to ${new Date(i)}`),s.started=i,e.getOptions().stickySession&&Ca(s))}return s!=null&&s.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function FO(e){const t=e.data;if(!(e.type!==Z.IncrementalSnapshot||!t||typeof t!="object"||!("source"in t)||t.source!==K.Mutation||!("attributes"in t)||!Array.isArray(t.attributes)))for(const n of t.attributes){const r=yt.mirror.getNode(n.id),o=r&&yt.mirror.getMeta(r);if((o==null?void 0:o.type)===Aa.Element)for(const[s,i]of Object.entries(n.attributes))i===null?delete o.attributes[s]:o.attributes[s]=i}}function $O(e){const t=e.getOptions();return{type:Z.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 BO(e,t){var n;!t||((n=e.session)==null?void 0:n.segmentId)!==0||Pl(e,$O(e),!1)}function UO(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function HO(e,t,n,r){return dt(cm(e,Qo(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function WO({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
`;if(typeof e=="string")n=`${r}${e}`;else{const s=new TextEncoder().encode(r);n=new Uint8Array(s.length+e.length),n.set(s),n.set(e,s.length)}return n}async function jO({client:e,scope:t,replayId:n,event:r}){const o=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,s={event_id:n,integrations:o};e.emit("preprocessEvent",r,s);const i=await mm(e.getOptions(),r,s,t,e,he());if(!i)return null;e.emit("postprocessEvent",i,s),i.platform=i.platform||"javascript";const a=e.getSdkMetadata(),{name:c,version:u,settings:d}=(a==null?void 0:a.sdk)||{};return i.sdk={...i.sdk,name:c||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},i}async function zO({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:o,session:s}){const i=WO({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:u,initialTimestamp:d}=r,l=N(),f=j(),p=l==null?void 0:l.getTransport(),h=l==null?void 0:l.getDsn();if(!l||!p||!h||!s.sampled)return Promise.resolve({});const m={type:_N,replay_start_timestamp:d/1e3,timestamp:o/1e3,error_ids:c,trace_ids:u,urls:a,replay_id:t,segment_id:n,replay_type:s.sampled},g=await jO({scope:f,client:l,replayId:t,event:m});if(!g)return l.recordDroppedEvent("event_processor","replay"),q&&G.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;const y=HO(g,i,h,l.getOptions().tunnel);let S;try{S=await p.send(y)}catch(E){const x=new Error(Tl);try{x.cause=E}catch{}throw x}const k=Pm({},S);if(Om(k,"replay"))throw new Dl(k);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new Ty(S.statusCode);return S}class Ty extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Dl extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class gp extends Error{constructor(){super("Session is too long, not sending replay")}}async function Iy(e,t={count:0,interval:TN}){const{recordingData:n,onError:r}=e;if(n.length)try{return await zO(e),!0}catch(o){if(o instanceof Ty||o instanceof Dl)throw o;if(Qi("Replays",{_retryCount:t.count}),r&&r(o),t.count>=IN){const s=new Error(`${Tl} - max retries exceeded`);try{s.cause=o}catch{}throw s}return t.interval*=++t.count,new Promise((s,i)=>{ps(async()=>{try{await Iy(e,t),s(!0)}catch(a){i(a)}},t.interval)})}}const wy="__THROTTLED",qO="__SKIPPED";function GO(e,t,n){const r=new Map,o=a=>{const c=a-n;r.forEach((u,d)=>{d<c&&r.delete(d)})},s=()=>[...r.values()].reduce((a,c)=>a+c,0);let i=!1;return(...a)=>{const c=Math.floor(Date.now()/1e3);if(o(c),s()>=t){const d=i;return i=!0,d?qO:wy}i=!1;const u=r.get(c)||0;return r.set(c,u+1),e(...a)}}class VO{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:yN,sessionIdleExpire:bN},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=PO(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=GO((i,a)=>UM(this,i,a),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:o}=this.getOptions(),s=r?{threshold:Math.min(wN,r),timeout:r,scrollTimeout:kN,ignoreSelector:o?o.join(","):""}:void 0;if(s&&(this.clickDetector=new Qx(this,s)),q){const i=t._experiments;G.setConfig({captureExceptions:!!i.captureExceptions,traceInternals:!!i.traceInternals})}this._handleVisibilityChange=()=>{Se.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const i=kt({category:"ui.blur"});this._doChangeToBackgroundTasks(i)},this._handleWindowFocus=()=>{const i=kt({category:"ui.focus"});this._doChangeToForegroundTasks(i)},this._handleKeyboardEvent=i=>{dM(this,i)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){q&&G.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,o=n<=0&&r<=0;if(this._requiresManualStart=o,!o){if(this._initializeSessionForSampling(t),!this.session){q&&G.exception(new 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&&G.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){q&&G.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){q&&G.log("Buffering is in progress, call `flush()` to save the replay");return}q&&G.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=fc({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){q&&G.log("Buffering is in progress, call `flush()` to save the replay");return}q&&G.infoTick("Starting replay in buffer mode");const t=fc({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=yt({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:EN}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:DO(this),...LO(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){var o,s,i;if(!this._isEnabled)return;this._isEnabled=!1,this.recordingMode="buffer";const r=n??"manual";(s=N())==null||s.emit("replayEnd",{sessionId:(o=this.session)==null?void 0:o.id,reason:r});try{q&&G.log(`Stopping Replay triggered by ${r}`),Li(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(i=this.eventBuffer)==null||i.destroy(),this.eventBuffer=null,PM(this)}catch(a){this.handleException(a)}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),q&&G.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),q&&G.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();q&&G.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession(),hp(this.session.id)),this.startRecording())}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!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(t){var n,r;if(!(t&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}checkAndHandleExpiredSession(){var t;if(this._lastActivity&&nu(this._lastActivity,this.timeouts.sessionIdlePause)&&((t=this.session)==null?void 0:t.sampled)==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${Se.location.pathname}${Se.location.hash}${Se.location.search}`,n=`${Se.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===wy){const o=kt({category:"replay.throttled"});this.addUpdate(()=>!Pl(this,{type:qx,timestamp:o.timestamp||0,data:{tag:"breadcrumb",payload:o,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||Te(),n=t&&Ee(t),o=(n&&U(n).data||{})[ue];if(!(!n||!o||!["route","custom"].includes(o)))return U(n).description}_initializeRecording(){var t;this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=xM({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.session&&((t=N())==null||t.emit("replayStart",{sessionId:this.session.id,recordingMode:this.recordingMode})),this.startRecording(),this.recordingMode==="session"&&this.session&&hp(this.session.id)}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=fc({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return Pi(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"sessionExpired"}),this.initializeSampling(t.id))}_addListeners(){try{Se.document.addEventListener("visibilitychange",this._handleVisibilityChange),Se.addEventListener("blur",this._handleWindowBlur),Se.addEventListener("focus",this._handleWindowFocus),Se.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(xO(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=IM(this)}_removeListeners(){try{Se.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Se.removeEventListener("blur",this._handleWindowBlur),Se.removeEventListener("focus",this._handleWindowFocus),Se.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){if(!this.session)return;if(Pi(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})){Li();return}t&&this._createCustomBreadcrumb(t),this.conditionalFlush()}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){q&&G.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:Z.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=mM(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(Na(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){var n;const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){q&&G.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(await MO(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new gp;const o=this._popEventContext(),s=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await Iy({replayId:t,recordingData:i,segmentId:s,eventContext:o,session:this.session,timestamp:r,onError:a=>this.handleException(a)})}catch(r){this.handleException(r),this.stop({reason:"sendError"});const o=N();if(o){let s;r instanceof Dl?s="ratelimit_backoff":r instanceof gp?s="invalid":s="send_error",o.recordDroppedEvent(s,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){q&&G.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;const n=this.session.started,o=Date.now()-n;this._debouncedFlush.cancel();const s=o<this._options.minReplayDuration,i=o>this._options.maxReplayDuration+5e3;if(s||i){q&&G.log(`Session duration (${Math.floor(o/1e3)}s) is too ${s?"short":"long"}, not sending replay.`),s&&this._debouncedFlush();return}const a=this.eventBuffer;a&&this.session.segmentId===0&&!a.hasCheckout&&q&&G.log("Flushing initial segment without checkout.");const c=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,c&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&Ca(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(a=>{const c=UO(a.target),u=n.join(",");return c==null?void 0:c.matches(u)}))return!1;const r=t.length,o=this._options.mutationLimit,s=this._options.mutationBreadcrumbLimit,i=o&&r>o;if(r>s||i){const a=kt({category:"replay.mutations",data:{count:r,limit:i}});this._createCustomBreadcrumb(a)}return i?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function go(e,t){return[...e,...t].join(",")}function YO({mask:e,unmask:t,block:n,unblock:r,ignore:o}){const s=["base","iframe[srcdoc]:not([src])"],i=go(e,[".sentry-mask","[data-sentry-mask]"]),a=go(t,[]);return{maskTextSelector:i,unmaskTextSelector:a,blockSelector:go(n,[".sentry-block","[data-sentry-block]",...s]),unblockSelector:go(r,[]),ignoreSelector:go(o,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function KO({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:o,value:s}){if(o.unmaskTextSelector&&e.matches(o.unmaskTextSelector))return s;const i=n.includes(t),a=r&&t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"");return i||a?s.replace(/[\S]/g,"*"):s}const _p='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',JO=["content-length","content-type","accept"],XO=Symbol.for("sentry__originalRequestBody");let yp=!1,bp=!1;function QO(){if(typeof Request>"u"||bp)return;const e=Request;try{const t=function(n,r){const o=new e(n,r);return(r==null?void 0:r.body)!=null&&(o[XO]=r.body),o};t.prototype=e.prototype,H.Request=t,bp=!0}catch{}}const ZO=(e=>new eP(e));class eP{constructor({flushMinDelay:t=SN,flushMaxDelay:n=vN,minReplayDuration:r=RN,maxReplayDuration:o=Yf,stickySession:s=!0,useCompression:i=!0,workerUrl:a,_experiments:c={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:y=[],networkCaptureBodies:S=!0,networkRequestHeaders:k=[],networkResponseHeaders:E=[],mask:x=[],maskAttributes:w=["title","placeholder","aria-label"],unmask:b=[],block:I=[],unblock:B=[],ignore:v=[],maskFn:P,beforeAddRecordingEvent:R,beforeErrorSampling:L,onError:$,attachRawBodyFromRequest:J=!1}={}){this.name="Replay";const te=YO({mask:x,unmask:b,block:I,unblock:B,ignore:v});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:P,maskInputFn:P,maskAttributeFn:(F,O,Q)=>KO({maskAttributes:w,maskAllText:u,privacyOptions:te,key:F,value:O,el:Q}),...te,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:F=>{try{F.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!c.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,AN),maxReplayDuration:Math.min(o,Yf),stickySession:s,useCompression:i,workerUrl:a,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:g,networkDetailDenyUrls:y,networkCaptureBodies:S,networkRequestHeaders:Sp(k),networkResponseHeaders:Sp(E),beforeAddRecordingEvent:R,beforeErrorSampling:L,onError:$,attachRawBodyFromRequest:J,_experiments:c},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${_p}`:_p,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&yn())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return yp}set _isInitialized(t){yp=t}afterAllSetup(t){!yn()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&QO(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session",reason:"manual"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){var n;if((n=this._replay)!=null&&n.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){var t;if((t=this._replay)!=null&&t.isEnabled())return this._replay.recordingMode}processSpan(t){const n=this.getReplayId(!0);n&&(_n(t,{"sentry.replay_id":n}),this.getRecordingMode()==="buffer"&&_n(t,{"sentry._internal.replay_is_buffering":!0}))}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=tP(this._initialOptions,t);this._replay=new VO({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function tP(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},o=Kn(n.replaysSessionSampleRate),s=Kn(n.replaysOnErrorSampleRate);return o==null&&s==null&&$t(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),o!=null&&(r.sessionSampleRate=o),s!=null&&(r.errorSampleRate=s),r}function Sp(e){return[...JO,...e.map(t=>t.toLowerCase())]}function nP(){const e=N();return e==null?void 0:e.getIntegrationByName("Replay")}var rP=Object.defineProperty,oP=(e,t,n)=>t in e?rP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vp=(e,t,n)=>oP(e,typeof t!="symbol"?t+"":t,n);class sP{constructor(){vp(this,"idNodeMap",new Map),vp(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(n,o)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function iP(){return new sP}function aP(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function su(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:su(e.parentNode,t,n,r+1)}function Ep(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(aP(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}const Sr=`Please stop import mirror directly. Instead of that,\r
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
or you can use record.mirror to access the mirror instance during recording.`;let Tp={map:{},getId(){return console.error(Sr),-1},getNode(){return console.error(Sr),null},removeNodeFromMap(){console.error(Sr)},has(){return console.error(Sr),!1},reset(){console.error(Sr)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Tp=new Proxy(Tp,{get(e,t,n){return t==="map"&&console.error(Sr),Reflect.get(e,t,n)}}));function Fl(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(i){Ry(()=>{n.set.call(this,i)},0),s&&s.set&&s.set.call(this,i)}}),()=>Fl(e,t,s||{},!0)}function $l(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}Date.now().toString();function cP(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Ma(e,t,n,r,o){if(!e)return!1;const s=cP(e);if(!s)return!1;const i=Ep(t,n),a=su(s,i);let c=-1;return a<0?!1:(r&&(c=su(s,Ep(null,r))),a>-1&&c<0?!0:a<c)}const Ip={};function ky(e){const t=Ip[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);const s=o.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(o)}catch{}return Ip[e]=r.bind(window)}function On(...e){return ky("requestAnimationFrame")(...e)}function Ry(...e){return ky("setTimeout")(...e)}var Jr=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Jr||{});let ri;function uP(e){ri=e}const pc=e=>ri?((...n)=>{try{return e(...n)}catch(r){if(ri&&ri(r)===!0)return()=>{};throw r}}):e;var Rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lP=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var $s=0;$s<Rr.length;$s++)lP[Rr.charCodeAt($s)]=$s;var dP=function(e){var t=new Uint8Array(e),n,r=t.length,o="";for(n=0;n<r;n+=3)o+=Rr[t[n]>>2],o+=Rr[(t[n]&3)<<4|t[n+1]>>4],o+=Rr[(t[n+1]&15)<<2|t[n+2]>>6],o+=Rr[t[n+2]&63];return r%3===2?o=o.substring(0,o.length-1)+"=":r%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const wp=new Map;function fP(e,t){let n=wp.get(e);return n||(n=new Map,wp.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}const Ay=(e,t,n)=>{if(!e||!(Ny(e,t)||typeof e=="object"))return;const r=e.constructor.name,o=fP(n,r);let s=o.indexOf(e);return s===-1&&(s=o.length,o.push(e)),s};function oi(e,t,n){if(e instanceof Array)return e.map(r=>oi(r,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){const r=e.constructor.name,o=dP(e);return{rr_type:r,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[oi(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const r=e.constructor.name,{src:o}=e;return{rr_type:r,src:o}}else if(e instanceof HTMLCanvasElement){const r="HTMLImageElement",o=e.toDataURL();return{rr_type:r,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[oi(e.data,t,n),e.width,e.height]};if(Ny(e,t)||typeof e=="object"){const r=e.constructor.name,o=Ay(e,t,n);return{rr_type:r,index:o}}}}return e}const Cy=(e,t,n)=>e.map(r=>oi(r,t,n)),Ny=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function pP(e,t,n,r,o){const s=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if(typeof t.CanvasRenderingContext2D.prototype[a]!="function")continue;const c=$l(t.CanvasRenderingContext2D.prototype,a,function(u){return function(...d){return Ma(this.canvas,n,r,o,!0)||Ry(()=>{const l=Cy(d,t,this);e(this.canvas,{type:Jr["2D"],property:a,args:l})},0),u.apply(this,d)}});s.push(c)}catch{const c=Fl(t.CanvasRenderingContext2D.prototype,a,{set(u){e(this.canvas,{type:Jr["2D"],property:a,args:[u],setter:!0})}});s.push(c)}return()=>{s.forEach(a=>a())}}function hP(e){return e==="experimental-webgl"?"webgl":e}function kp(e,t,n,r,o){const s=[];try{const i=$l(e.HTMLCanvasElement.prototype,"getContext",function(a){return function(c,...u){if(!Ma(this,t,n,r,!0)){const d=hP(c);if("__context"in this||(this.__context=d),o&&["webgl","webgl2"].includes(d))if(u[0]&&typeof u[0]=="object"){const l=u[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else u.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[c,...u])}});s.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(i=>i())}}function Rp(e,t,n,r,o,s,i,a){const c=[],u=Object.getOwnPropertyNames(e);for(const d of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(d))try{if(typeof e[d]!="function")continue;const l=$l(e,d,function(f){return function(...p){const h=f.apply(this,p);if(Ay(h,a,this),"tagName"in this.canvas&&!Ma(this.canvas,r,o,s,!0)){const m=Cy(p,a,this),g={type:t,property:d,args:m};n(this.canvas,g)}return h}});c.push(l)}catch{const l=Fl(e,d,{set(f){n(this.canvas,{type:t,property:d,args:[f],setter:!0})}});c.push(l)}return c}function mP(e,t,n,r,o,s){const i=[];return i.push(...Rp(t.WebGLRenderingContext.prototype,Jr.WebGL,e,n,r,o,s,t)),typeof t.WebGL2RenderingContext<"u"&&i.push(...Rp(t.WebGL2RenderingContext.prototype,Jr.WebGL2,e,n,r,o,s,t)),()=>{i.forEach(a=>a())}}const gP='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 _P(){const e=new Blob([gP]);return URL.createObjectURL(e)}class yP{constructor(t){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=(a,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(c)};const{enableManualSnapshot:n,sampling:r="all",win:o,recordCanvas:s,errorHandler:i}=t;t.sampling=r,this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.options=t,i&&uP(i),(s&&typeof r=="number"||n)&&(this.worker=this.initFPSWorker()),this.addWindow(o),!n&&pc(()=>{s&&r==="all"&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&typeof r=="number"&&this.initCanvasFPSObserver()})()}reset(){var t;this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(n=>{try{n()}catch{}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,(t=this.worker)==null||t.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(t){const{sampling:n="all",blockClass:r,blockSelector:o,unblockSelector:s,recordCanvas:i,enableManualSnapshot:a}=this.options;if(!this.windowsSet.has(t)){if(a){this.windowsSet.add(t),this.windows.push(new WeakRef(t));return}pc(()=>{if(i&&n==="all"&&this.initCanvasMutationObserver(t,r,o,s),i&&typeof n=="number"){const c=kp(t,r,o,s,!0);this.restoreHandlers.push(()=>{c()})}})(),this.windowsSet.add(t),this.windows.push(new WeakRef(t))}}addShadowRoot(t){this.shadowDoms.add(new WeakRef(t))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(t,n){if(n!=null&&n.skipRequestAnimationFrame){this.takeSnapshot(performance.now(),!0,t);return}On(r=>this.takeSnapshot(r,!0,t))}initFPSWorker(){const t=new Worker(_P());return t.onmessage=n=>{const r=n.data,{id:o}=r;if(this.snapshotInProgressMap.set(o,!1),!("base64"in r))return;const{base64:s,type:i,width:a,height:c}=r;this.mutationCb({id:o,type:Jr["2D"],commands:[{property:"clearRect",args:[0,0,a,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:i}]},0,0,a,c]}]})},t}initCanvasFPSObserver(){let t;if(!this.windows.length&&!this.shadowDoms.size)return;const n=r=>{this.takeSnapshot(r,!1),t=On(n)};t=On(n),this.restoreHandlers.push(()=>{t&&cancelAnimationFrame(t)})}initCanvasMutationObserver(t,n,r,o){const s=kp(t,n,r,o,!1),i=pP(this.processMutation.bind(this),t,n,r,o),a=mP(this.processMutation.bind(this),t,n,r,o,this.mirror);this.restoreHandlers.push(()=>{s(),i(),a()})}getCanvasElements(t,n,r){const o=[],s=i=>{i.querySelectorAll("canvas").forEach(a=>{Ma(a,t,n,r)||o.push(a)})};for(const i of this.windows){const a=i.deref();let c;try{c=a&&a.document}catch{}c&&s(c)}for(const i of this.shadowDoms){const a=i.deref();a&&s(a)}return o}takeSnapshot(t,n,r){const{sampling:o,blockClass:s,blockSelector:i,unblockSelector:a,dataURLOptions:c,maxCanvasSize:u}=this.options,l=1e3/(o==="all"?2:o||2);return this.lastSnapshotTime&&t-this.lastSnapshotTime<l?!1:(this.lastSnapshotTime=t,(r?[r]:this.getCanvasElements(s,i,a)).forEach(h=>{var g;const m=this.mirror.getId(h);if(!(!this.mirror.hasNode(h)||!h.width||!h.height||this.snapshotInProgressMap.get(m))){if(this.snapshotInProgressMap.set(m,!0),!n&&["webgl","webgl2"].includes(h.__context)){const y=h.getContext(h.__context);((g=y==null?void 0:y.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}createImageBitmap(h).then(y=>{var S;(S=this.worker)==null||S.postMessage({id:m,bitmap:y,width:h.width,height:h.height,dataURLOptions:c,maxCanvasSize:u},[y])}).catch(y=>{pc(()=>{throw this.snapshotInProgressMap.delete(m),y})()})}}),!0)}startPendingCanvasMutationFlusher(){On(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=n=>{this.rafStamps.latestId=n,On(t)};On(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),On(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(t);if(!r||n===-1)return;const o=r.map(i=>{const{type:a,...c}=i;return c}),{type:s}=r[0];this.mutationCb({id:n,type:s,commands:o}),this.pendingCanvasMutations.delete(t)}}var ah;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((ah=e.contentWindow)==null?void 0:ah.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}iP();var Ap;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ap||(Ap={}));const Cp={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}}},bP="ReplayCanvas",Bs=1280,SP=((e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,Bs):Bs,n?Math.min(n,Bs):Bs]};let o,s;const i=new Promise(a=>s=a);return{name:bP,getOptions(){const{quality:a,enableManualSnapshot:c,maxCanvasSize:u}=r;return{enableManualSnapshot:c,recordCanvas:!0,getCanvasManager:d=>{const l=new yP({...d,enableManualSnapshot:c,maxCanvasSize:u,errorHandler:f=>{try{typeof f=="object"&&(f.__rrweb__=!0)}catch{}}});return o=l,s(l),l},...Cp[a]||Cp.medium}},async snapshot(a,c){(o||await i).snapshot(a,c)}}}),vP=SP;function EP(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function xy(e){try{return new URL(e,A.location.origin).href}catch{return}}function TP(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function My(e){try{return new Headers(e)}catch{return}}const Bl={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Oy(e,t){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:s,tracePropagationTargets:i,onRequestSpanStart:a,onRequestSpanEnd:c}={...Bl,...t},u=typeof o=="function"?o:p=>!0,d=p=>wP(p,i),l={},f=e.getOptions().propagateTraceparent;n&&da(p=>{const h=q0(p,u,d,l,{propagateTraceparent:f,onRequestSpanEnd:c});if(h){const m=xy(p.fetchData.url),g=m?zn(m).host:void 0,y=m?Nt(m):void 0;h.setAttributes({"http.url":y,"url.full":y,"server.address":g}),s&&Np(h,e),a==null||a(h,{headers:p.headers})}}),r&&pl(p=>{var m;const h=kP(p,u,d,l,f,c);h&&(s&&Np(h,e),a==null||a(h,{headers:My((m=p.xhr.__sentry_xhr_v3__)==null?void 0:m.request_headers)}))})}const IP=300;function Np(e,t){const{url:n}=U(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(ft(t)){const s=e.end.bind(e);e.end=i=>{const a=i??ye();let c=!1;const u=()=>{c||(c=!0,setTimeout(o),s(a),clearTimeout(d))};r=u;const d=setTimeout(u,IP)}}const o=Sn("resource",({entries:s})=>{s.forEach(i=>{TP(i)&&i.name.endsWith(n)&&(e.setAttributes(y_(i)),r())})})}function wP(e,t){const n=ir();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}const s=r.origin===o;return t?ct(r.toString(),t)||s&&ct(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?ct(e,t):r}}function kP(e,t,n,r,o,s){const i=e.xhr,a=i==null?void 0:i[Gt];if(!i||i.__sentry_own_request__||!a)return;const{url:c,method:u}=a,d=Je()&&t(c);if(e.endTimestamp){const k=i.__sentry_xhr_span_id__;if(!k)return;const E=r[k];E&&(d&&a.status_code!==void 0&&(Mo(E,a.status_code),E.end(),s==null||s(E,{headers:My(E_(i)),error:e.error})),delete r[k]);return}const l=xy(c),f=zn(l||c),p=l?Nt(l):void 0,h=Nt(zm(c)),m=N(),y=!!Te()||!!m&&ft(m),S=d&&y?qe({name:`${u} ${h}`,attributes:{url:Nt(c),type:"xhr","http.method":u,"http.url":p,"url.full":p,"server.address":f==null?void 0:f.host,[Y]:"auto.http.browser",[ce]:"http.client",...(f==null?void 0:f.search)&&{"http.query":f==null?void 0:f.search},...(f==null?void 0:f.hash)&&{"http.fragment":f==null?void 0:f.hash}}}):new Jn;return d&&!y&&(m==null||m.recordDroppedEvent("no_parent_span","span")),i.__sentry_xhr_span_id__=S.spanContext().spanId,r[i.__sentry_xhr_span_id__]=S,n(c)&&RP(i,Je()&&y?S:void 0,o),m&&m.emit("beforeOutgoingRequestSpan",S,e),S}function RP(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=Bu({span:t,propagateTraceparent:n});r&&AP(e,r,o,s)}function AP(e,t,n,r){var s;const o=(s=e.__sentry_xhr_v3__)==null?void 0:s.request_headers;if(!(o!=null&&o["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(o!=null&&o.traceparent)&&e.setRequestHeader("traceparent",r),n){const i=o==null?void 0:o.baggage;(!i||!EP(i))&&e.setRequestHeader("baggage",n)}}catch{}}const xp=new WeakMap,Mp=new WeakMap,CP=9e4,NP=["text/event-stream","application/x-ndjson","application/stream+json"],Py=()=>({name:"FetchStreamPerformance",setup(){_k(e=>{if(e.response){const t=xp.get(e.response);if(t&&e.endTimestamp){t.end(e.endTimestamp);const n=Mp.get(e.response);n&&clearTimeout(n)}}}),da(e=>{var t,n,r,o;if(e.endTimestamp&&e.response){const s=((t=e.response.headers)==null?void 0:t.get("content-type"))||"";if((n=e.response.headers)!=null&&n.get("content-length")||!NP.some(f=>s.startsWith(f)))return;const i=((r=e.fetchData)==null?void 0:r.url)||"",a=((o=e.fetchData)==null?void 0:o.method)||"GET",c=ta(i),u=i.startsWith("data:")?Nt(i):c?jm(c):i,d=qe({name:`${a} ${u}`,startTime:e.endTimestamp,attributes:{url:Nt(i),"http.method":a,type:"fetch",[ce]:"http.client.stream",[Y]:"auto.http.browser.stream"}});xp.set(e.response,d);const l=setTimeout(()=>{d.isRecording()&&d.end()},CP);Mp.set(e.response,l)}})}}),Ly="WebVitals",Dy=(e={})=>{const t=new Set(e.ignore??[]);return{name:Ly,setup(n){const r=ft(n),{enableStandaloneClsSpans:o,enableStandaloneLcpSpans:s}=e._experiments??{},i=r||t.has("cls")?void 0:o||!1,a=r||t.has("lcp")?void 0:s||!1,c=UA({recordClsStandaloneSpans:i,recordLcpStandaloneSpans:a,client:n}),u=new WeakSet;n.on("afterStartPageLoadSpan",d=>{u.add(d)}),n.on("spanEnd",d=>{u.delete(d)&&(c(),KA(d,{recordClsOnPageloadSpan:i===!1,recordLcpOnPageloadSpan:a===!1,spanStreamingEnabled:r}))}),r?(t.has("lcp")||mC(n),t.has("cls")||_C(n),t.has("inp")||bC()):t.has("inp")||lC()},afterAllSetup(){t.has("inp")||hC()}}};function xP(){A.document?A.document.addEventListener("visibilitychange",()=>{const e=Te();if(!e)return;const t=Ee(e);if(A.document.hidden&&t){const n="cancelled",{op:r,status:o}=U(t);C&&_.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:re,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):C&&_.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const MP=3600,Fy="sentry_previous_trace",OP="sentry.previous_trace";function PP(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?FP():void 0;e.on("spanStart",i=>{if(Ee(i)!==i)return;const a=j().getPropagationContext();o=LP(o,i,a),r&&DP(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=j(),c=a.getPropagationContext();if(s&&c.parentSpanId){s=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(o.sampleRate),sampled:String(iu(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=iu(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[Oh]:o.sampleRate}})}function LP(e,t,n){const r=U(t);function o(){var a,c;try{const u=Number(((a=r.data)==null?void 0:a[qi])??((c=n.dsc)==null?void 0:c.sample_rate));return Number.isNaN(u)?0:u}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=MP&&(C&&_.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[US]:"previous_trace"}}),t.setAttribute(OP,`${i.traceId}-${i.spanId}-${iu(i)?1:0}`)),s)}function DP(e){try{A.sessionStorage.setItem(Fy,JSON.stringify(e))}catch(t){C&&_.warn("Could not store previous trace in sessionStorage",t)}}function FP(){var e;try{const t=(e=A.sessionStorage)==null?void 0:e.getItem(Fy);return JSON.parse(t)}catch{return}}function iu(e){return e.traceFlags===1}const $P="BrowserTracing",BP=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function $y(){const e=A.navigator;return e!=null&&e.userAgent?BP.test(e.userAgent):!1}const UP={...Ws,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Bl},ur=((e={})=>{"enableElementTiming"in e&&$t(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=A.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:u,idleTimeout:d,finalTimeout:l,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:h,traceXHR:m,trackFetchStreamPerformance:g,shouldCreateSpanForRequest:y,enableHTTPTimings:S,ignoreResourceSpans:k,ignorePerformanceApiSpans:E,instrumentPageLoad:x,instrumentNavigation:w,detectRedirects:b,linkPreviousTrace:I,consistentTraceSampling:B,enableReportPageLoaded:v,onRequestSpanStart:P,onRequestSpanEnd:R}={...UP,...e},L=$y();let $,J;function te(F,O,Q=!0){const T=O.op==="pageload",W=O.name,z=u?u(O):O,ne=z.attributes||{};if(W!==z.name&&(ne[ue]="custom",z.attributes=ne),!Q){const Be=rr();qe({...z,startTime:Be}).end(Be);return}t.name=z.name,t.source=ne[ue];const ie=Ru(z,{idleTimeout:d,finalTimeout:l,childSpanTimeout:f,disableAutoFinish:T,beforeSpanEnd:Be=>{YA(Be,{ignoreResourceSpans:k,ignorePerformanceApiSpans:E,spanStreamingEnabled:ft(F)}),Lp(F,void 0);const Xe=j(),Cn=Xe.getPropagationContext();Xe.setPropagationContext({...Cn,traceId:ie.spanContext().traceId,sampled:Ht(ie),dsc:vt(Be)}),T&&(J=void 0)},trimIdleSpanEndTimestamp:!v});T&&v&&(J=ie),Lp(F,ie);function de(){n&&["interactive","complete"].includes(n.readyState)&&(F.emit("idleSpanEnableAutoFinish",ie),n.removeEventListener("readystatechange",de))}T&&!v&&n&&(n.addEventListener("readystatechange",de),de())}return{name:$P,setup(F){var Q;if(L){C&&_.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(bu(),s&&H.PerformanceObserver&&((Q=PerformanceObserver.supportedEntryTypes)!=null&&Q.includes("long-animation-frame"))?WA():o&&HA(),i&&jA(),b&&n){const T=()=>{$=ye()};addEventListener("click",T,{capture:!0}),addEventListener("keydown",T,{capture:!0,passive:!0})}function O(){const T=zo(F);T&&!U(T).timestamp&&(C&&_.log(`[Tracing] Finishing current active span with op: ${U(T).op}`),T.setAttribute(xo,"cancelled"),T.end())}F.on("startNavigationSpan",(T,W)=>{if(N()!==F)return;if(W!=null&&W.isRedirect){C&&_.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),te(F,{op:"navigation.redirect",...T},!1);return}$=void 0,O(),he().setPropagationContext({traceId:Pt(),sampleRand:Math.random(),propagationSpanId:Je()?void 0:Yt()});const z=j();z.setPropagationContext({traceId:Pt(),sampleRand:Math.random(),propagationSpanId:Je()?void 0:Yt()}),z.setSDKProcessingMetadata({normalizedRequest:void 0}),te(F,{op:"navigation",...T,parentSpan:null,forceTransaction:!0})}),F.on("startPageLoadSpan",(T,W={})=>{if(N()!==F)return;O();const z=W.sentryTrace||Op("sentry-trace")||Pp("sentry-trace"),ne=W.baggage||Op("baggage")||Pp("baggage"),ie=zh(z,ne),de=j();de.setPropagationContext(ie),Je()||(de.getPropagationContext().propagationSpanId=Yt()),de.setSDKProcessingMetadata({normalizedRequest:Ii()}),te(F,{op:"pageload",...T})}),F.on("endPageloadSpan",()=>{v&&J&&(J.setAttribute(xo,"reportPageLoaded"),J.end())})},afterAllSetup(F){var Q;if(L)return;F.addIntegration&&!((Q=F.getIntegrationByName)!=null&&Q.call(F,Ly))&&F.addIntegration(Dy({ignore:r?[]:["inp"],_experiments:{enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c}}));let O=ir();if(I!=="off"&&PP(F,{linkPreviousTrace:I,consistentTraceSampling:B}),A.location){if(x){const T=Ce();lo(F,{name:A.location.pathname,startTime:T?T/1e3:void 0,attributes:{[ue]:"url",[Y]:"auto.pageload.browser"}})}w&&Ea(({to:T,from:W})=>{if(W===void 0&&(O==null?void 0:O.indexOf(T))!==-1){O=void 0;return}O=void 0;const z=ta(T),ne=zo(F),ie=ne&&b&&WP(ne,$);fo(F,{name:(z==null?void 0:z.pathname)||A.location.pathname,attributes:{[ue]:"url",[Y]:"auto.navigation.browser"}},{url:T,isRedirect:ie})})}p&&xP(),i&&HP(F,d,l,f,t),Oy(F,{traceFetch:h,traceXHR:m,tracePropagationTargets:F.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:y,enableHTTPTimings:S,onRequestSpanStart:P,onRequestSpanEnd:R}),g&&F.addIntegration(Py())}}});function lo(e,t,n){e.emit("startPageLoadSpan",t,n),j().setTransactionName(t.name);const r=zo(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function fo(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const s=j();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...Ii(),url:r}}),zo(e)}function Op(e){const t=A.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function Pp(e){var r,o,s;const t=(o=(r=A.performance)==null?void 0:r.getEntriesByType)==null?void 0:o.call(r,"navigation")[0],n=(s=t==null?void 0:t.serverTiming)==null?void 0:s.find(i=>i.name===e);return n==null?void 0:n.description}function HP(e,t,n,r,o){const s=A.document;let i;const a=()=>{const c="ui.action.click",u=zo(e);if(u){const d=U(u).op;if(["navigation","pageload"].includes(d)){C&&_.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(xo,"interactionInterrupted"),i.end(),i=void 0),!o.name){C&&_.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}i=Ru({name:o.name,op:c,attributes:{[ue]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const By="_sentry_idleSpan";function zo(e){return e[By]}function Lp(e,t){we(e,By,t)}const Dp=1.5;function WP(e,t){const n=U(e),r=rr(),o=n.start_timestamp;return!(r-o>Dp||t&&r-t<=Dp)}function jP(e=N()){e==null||e.emit("endPageloadSpan")}function zP(e){const t=Te();if(t===e)return;const n=j();e.end=new Proxy(e.end,{apply(r,o,s){return Lt(n,t),Reflect.apply(r,o,s)}}),Lt(n,e)}const qP=()=>({name:"SpanStreaming",beforeSetup(e){const t=e.getOptions();t.traceLifecycle||(C&&_.log('[SpanStreaming] setting `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){const t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!ft(e)){r.traceLifecycle="static",C&&_.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}const o=r.beforeSendSpan;if(o&&!Yi(o)){r.traceLifecycle="static",C&&_.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}const s=new pk(e);e.on("afterSpanEnd",i=>{Ht(i)&&s.add(Kv(i,e))}),e.on("afterSegmentSpanEnd",i=>{const a=i.spanContext().traceId;setTimeout(()=>{s.flush(a)},500)})}});function Xr(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function GP(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Xr(n);return o=>r.then(s=>o(s.transaction(t,"readwrite").objectStore(t)))}function Ul(e){return Xr(e.getAllKeys())}function VP(e,t,n){return e(r=>Ul(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.max(...o,0)+1),Xr(r.transaction)}))}function YP(e,t,n){return e(r=>Ul(r).then(o=>{if(!(o.length>=n))return r.put(t,Math.min(...o,0)-1),Xr(r.transaction)}))}function KP(e){return e(t=>Ul(t).then(n=>{const r=n[0];if(r!=null)return Xr(t.get(r)).then(o=>(t.delete(r),Xr(t.transaction).then(()=>o)))}))}function JP(e){let t;function n(){return t==null&&(t=GP(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async r=>{try{const o=mi(r);await VP(n(),o,e.maxQueueSize||30)}catch{}},unshift:async r=>{try{const o=mi(r);await YP(n(),o,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const r=await KP(n());if(r)return fv(r)}catch{}}}}function XP(e){return t=>{const n=e({...t,createStore:JP});return A.addEventListener("online",async r=>{await n.flush()}),n}}function QP(e=ml){return XP(sT(e))}const Fp=1e6,ZP="window"in H&&H.window===H&&typeof importScripts>"u",Gn=String(0),Hl=ZP?"main":"worker",st=A.navigator;let Uy="",Hy="",Wy="",au=(st==null?void 0:st.userAgent)||"",jy="";var ch;const eL=(st==null?void 0:st.language)||((ch=st==null?void 0:st.languages)==null?void 0:ch[0])||"";function tL(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const $p=st==null?void 0:st.userAgentData;tL($p)&&$p.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{var t;if(Uy=e.platform||"",Wy=e.architecture||"",jy=e.model||"",Hy=e.platformVersion||"",(t=e.fullVersionList)!=null&&t.length){const n=e.fullVersionList[e.fullVersionList.length-1];au=`${n.brand} ${n.version}`}}).catch(e=>{});function nL(e){return!("thread_metadata"in e)}function rL(e){return nL(e)?uL(e):e}function oL(e){var n,r;const t=(r=(n=e.contexts)==null?void 0:n.trace)==null?void 0:r.trace_id;return typeof t=="string"&&t.length!==32&&C&&_.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function sL(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const o=oL(r),s=rL(n),i=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:ye()*1e3),a=typeof r.timestamp=="number"?r.timestamp*1e3:ye()*1e3;return{event_id:e,timestamp:new Date(i).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Xo,runtime:{name:"javascript",version:A.navigator.userAgent},os:{name:Uy,version:Hy,build_number:au},device:{locale:eL,model:jy,manufacturer:au,architecture:Wy,is_emulator:!1},debug_meta:{images:qy(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||Me(),trace_id:o,active_thread_id:Gn,relative_start_ns:"0",relative_end_ns:((a-i)*1e6).toFixed(0)}]}}function iL(e,t,n){var i,a;if(e==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const r=cL(e),o=t.getOptions(),s=(a=(i=t.getSdkMetadata)==null?void 0:i.call(t))==null?void 0:a.sdk;return{chunk_id:Me(),client_sdk:{name:(s==null?void 0:s.name)??"sentry.javascript.browser",version:(s==null?void 0:s.version)??"0.0.0"},profiler_id:n||Me(),platform:"javascript",version:"2",release:o.release??"",environment:o.environment??"production",debug_meta:{images:qy(e.resources)},profile:r}}function aL(e){try{if(!e||typeof e!="object")return{reason:"chunk is not an object"};const t=r=>typeof r=="string"&&/^[a-f0-9]{32}$/.test(r);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"};const 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(t){return{reason:`unknown validation error: ${t}`}}}function cL(e){const t=[];for(let a=0;a<e.frames.length;a++){const c=e.frames[a];c&&(t[a]={function:c.name,abs_path:typeof c.resourceId=="number"?e.resources[c.resourceId]:void 0,lineno:c.line,colno:c.column})}const n=[];for(let a=0;a<e.stacks.length;a++){const c=e.stacks[a];if(!c)continue;const u=[];let d=c;for(;d;)u.push(d.frameId),d=d.parentId===void 0?void 0:e.stacks[d.parentId];n[a]=u}const r=Ce(),o=typeof performance.timeOrigin=="number"?performance.timeOrigin:r||0,s=o-(r||o),i=[];for(let a=0;a<e.samples.length;a++){const c=e.samples[a];if(!c)continue;const u=(o+(c.timestamp-s))/1e3;i[a]={stack_id:c.stackId??0,thread_id:Gn,timestamp:u}}return{frames:t,stacks:n,samples:i,thread_metadata:{[Gn]:{name:Hl}}}}function zy(e){return U(e).op==="pageload"}function uL(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[Gn]:{name:Hl}}},o=e.samples[0];if(!o)return r;const s=o.timestamp,i=Ce(),a=typeof performance.timeOrigin=="number"?performance.timeOrigin:i||0,c=a-(i||a);return e.samples.forEach((u,d)=>{if(u.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[d]={elapsed_since_start_ns:((u.timestamp+c-s)*Fp).toFixed(0),stack_id:t,thread_id:Gn};return}let l=e.stacks[u.stackId];const f=[];for(;l;){f.push(l.frameId);const h=e.frames[l.frameId];h&&r.frames[l.frameId]===void 0&&(r.frames[l.frameId]={function:h.name,abs_path:typeof h.resourceId=="number"?e.resources[h.resourceId]:void 0,lineno:h.line,colno:h.column}),l=l.parentId===void 0?void 0:e.stacks[l.parentId]}const p={elapsed_since_start_ns:((u.timestamp+c-s)*Fp).toFixed(0),stack_id:n,thread_id:Gn};r.stacks[n]=f,r.samples[d]=p,n++}),r}function lL(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function dL(e){const t=[];return Xn(e,(n,r)=>{var o,s;if(r==="transaction")for(let i=1;i<n.length;i++){const a=n[i];(s=(o=a==null?void 0:a.contexts)==null?void 0:o.profile)!=null&&s.profile_id&&t.push(n[i])}}),t}function qy(e){const t=N(),n=t==null?void 0:t.getOptions(),r=n==null?void 0:n.stackParser;return r?tE(r,e):[]}function Gy(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(C&&_.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?(C&&_.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function fL(e){return e.samples.length<2?(C&&_.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(C&&_.log("[Profiling] Discarding profile because it contains no frames"),!1)}let Wl=!1;const Vy=3e4;function pL(e){return typeof e=="function"}function Yy(){const e=A.Profiler;if(!pL(e)){C&&_.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(Vy/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{C&&(_.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),_.log("[Profiling] Disabling profiling for current user session.")),Wl=!0}}function Bp(e){if(Wl)return C&&_.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return C&&_.log("[Profiling] Discarding profile because root span was not sampled."),!1;const t=N(),n=t==null?void 0:t.getOptions();if(!n)return C&&_.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return Gy(r)?r?(r===!0?!0:Math.random()<r)?!0:(C&&_.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(C&&_.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(C&&_.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function hL(e){if(Wl)return C&&_.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 C&&_.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;const t=e.profileSessionSampleRate;return Gy(t)?t?Math.random()<=t:(C&&_.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(C&&_.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}function Us(e){return typeof e.profilesSampleRate<"u"}function mL(e,t,n,r){return fL(n)?sL(e,t,n,r):null}const Un=new Map;function gL(){return Un.size}function _L(e){const t=Un.get(e);return t&&Un.delete(e),t}function yL(e,t){if(Un.set(e,t),Un.size>30){const n=Un.keys().next().value;n!==void 0&&Un.delete(n)}}const Ky=new WeakSet;function $i(e){e.setAttribute("thread.id",Gn),e.setAttribute("thread.name",Hl)}function Up(e){let t;zy(e)&&(t=ye()*1e3);const n=Yy();if(!n)return;C&&_.log(`[Profiling] started profiling span: ${U(e).description}`);const r=Me();let o=null;j().setContext("profile",{profile_id:r,start_timestamp:t}),Ky.add(e),$i(e);async function s(){if(e&&n){if(o){C&&_.log("[Profiling] profile for:",U(e).description,"already exists, returning early");return}return n.stop().then(u=>{if(i&&(A.clearTimeout(i),i=void 0),C&&_.log(`[Profiling] stopped profiling of span: ${U(e).description}`),!u){C&&_.log(`[Profiling] profiler returned null profile for: ${U(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started");return}o=u,yL(r,u)}).catch(u=>{C&&_.log("[Profiling] error while stopping profiler:",u)})}}let i=A.setTimeout(()=>{C&&_.log("[Profiling] max profile duration elapsed, stopping profiling for:",U(e).description),s()},Vy);const a=e.end.bind(e);function c(){return e?(s().then(()=>{a()},()=>{a()}),e):a()}e.end=c}const bL=6e4,SL=3e5;class vL{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(t){const n=t.getOptions().profileLifecycle,r=hL(t.getOptions());C&&_.log(`[Profiling] Initializing profiler (lifecycle='${n}').`),r||C&&_.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=Me(),this._client=t,this._sessionSampled=r,this._lifecycleMode=n,n==="trace"&&this._setupTraceLifecycleListeners(t),t.on("spanStart",o=>{this._isRunning&&$i(o)})}start(){if(this._lifecycleMode==="trace"){C&&_.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.');return}if(this._isRunning){C&&_.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op.");return}if(!this._sessionSampled){C&&_.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op.");return}this._beginProfiling()}stop(){if(this._lifecycleMode==="trace"){C&&_.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.');return}if(!this._isRunning){C&&_.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op.");return}this._endProfiling()}notifyRootSpanActive(t){if(this._lifecycleMode!=="trace"||!this._sessionSampled)return;const n=t.spanContext().spanId;if(!n||this._activeRootSpanIds.has(n))return;this._registerTraceRootSpan(n);const r=this._activeRootSpanIds.size;r===1&&(C&&_.log("[Profiling] Detected already active root span during setup. Active root spans now:",r),this._beginProfiling()),this._isRunning&&$i(t)}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,C&&_.log("[Profiling] Started profiling with profiler ID:",this._profilerId),Ct().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler){C&&_.log("[Profiling] Failed to start JS Profiler; stopping."),this._resetProfilerInfo();return}this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(t=>{C&&_.error("[Profiling] Failed to collect current profile chunk on `stop()`:",t)}),this._lifecycleMode==="manual"&&Ct().setContext("profile",{}))}_setupTraceLifecycleListeners(t){t.on("spanStart",n=>{if(!this._sessionSampled){C&&_.log("[Profiling] Span not profiled because of negative sampling decision for user session.");return}if(n!==Ee(n))return;if(!n.isRecording()){C&&_.log("[Profiling] Discarding profile because root span was not sampled.");return}const r=n.spanContext().spanId;if(!r||this._activeRootSpanIds.has(r))return;this._registerTraceRootSpan(r);const o=this._activeRootSpanIds.size;o===1&&(C&&_.log(`[Profiling] Root span ${r} started. Profiling active while there are active root spans (count=${o}).`),this._beginProfiling())}),t.on("spanEnd",n=>{if(!this._sessionSampled)return;const r=n.spanContext().spanId;if(!r||!this._activeRootSpanIds.has(r))return;this._activeRootSpanIds.delete(r);const o=this._activeRootSpanIds.size;C&&_.log(`[Profiling] Root span with ID ${r} ended. Will continue profiling for as long as there are active root spans (currently: ${o}).`),o===0&&(this._collectCurrentChunk().catch(s=>{C&&_.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",s)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,Ct().setContext("profile",{})}_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(t=>clearTimeout(t)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(t){this._activeRootSpanIds.add(t);const n=setTimeout(()=>this._onRootSpanTimeout(t),SL);this._rootSpanTimeouts.set(t,n)}_startProfilerInstance(){var n;if(((n=this._profiler)==null?void 0:n.stopped)===!1)return;const t=Yy();if(!t){C&&_.log("[Profiling] Failed to start JS Profiler.");return}this._profiler=t}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(t=>{C&&_.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",t)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler){this._resetProfilerInfo();return}this._startPeriodicChunking()}},bL))}_onRootSpanTimeout(t){this._rootSpanTimeouts.has(t)&&(this._rootSpanTimeouts.delete(t),this._activeRootSpanIds.has(t)&&(C&&_.log(`[Profiling] Reached 5-minute timeout for root span ${t}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(t),this._activeRootSpanIds.size===0&&this._endProfiling()))}async _collectCurrentChunk(){const t=this._profiler;if(this._profiler=void 0,!!t)try{const n=await t.stop(),r=iL(n,this._client,this._profilerId),o=aL(r);if("reason"in o){C&&_.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",o.reason);return}this._sendProfileChunk(r),C&&_.log("[Profiling] Collected browser profile chunk.")}catch(n){C&&_.log("[Profiling] Error while stopping JS Profiler for chunk:",n)}}_sendProfileChunk(t){var a;const n=this._client,r=Qo((a=n.getSdkMetadata)==null?void 0:a.call(n)),o=n.getDsn(),s=n.getOptions().tunnel,i=dt({event_id:Me(),sent_at:new Date().toISOString(),...r&&{sdk:r},...!!s&&o&&{dsn:Ut(o)}},[[{type:"profile_chunk",platform:"javascript"},t]]);n.sendEnvelope(i).then(null,c=>{C&&_.error("Error while sending profile chunk envelope:",c)})}}const EL="BrowserProfiling",TL=(()=>({name:EL,setup(e){const t=e.getOptions(),n=new vL;if(!Us(t)&&!t.profileLifecycle&&(t.profileLifecycle="manual"),Us(t)&&!t.profilesSampleRate){C&&_.log("[Profiling] Profiling disabled, no profiling options found.");return}const r=Te(),o=r&&Ee(r);if(Us(t)&&t.profileSessionSampleRate!==void 0&&C&&_.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),Us(t))o&&zy(o)&&Bp(o)&&Up(o),e.on("spanStart",s=>{const i=Ee(s);s===i?Bp(s)&&Up(s):Ky.has(i)&&$i(s)}),e.on("beforeEnvelope",s=>{var c,u;if(!gL())return;const i=dL(s);if(!i.length)return;const a=[];for(const d of i){const l=d==null?void 0:d.contexts,f=(c=l==null?void 0:l.profile)==null?void 0:c.profile_id,p=(u=l==null?void 0:l.profile)==null?void 0:u.start_timestamp;if(typeof f!="string"){C&&_.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!f){C&&_.log("[Profiling] cannot find profile for a span without a profile context");continue}l!=null&&l.profile&&delete l.profile;const h=_L(f);if(!h){C&&_.log(`[Profiling] Could not retrieve profile for span: ${f}`);continue}const m=mL(f,p,h,d);m&&a.push(m)}lL(s,a)});else{const s=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),s==="manual")n.initialize(e);else if(s==="trace"){if(!Je(t)){C&&_.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.");return}n.initialize(e),o&&n.notifyRootSpanActive(o),A.setTimeout(()=>{const i=Te(),a=i&&Ee(i);a&&n.notifyRootSpanActive(a)},0)}}}})),IL=TL,wL="SpotlightBrowser",kL=[{op:"ui.interaction.click",name:"#sentry-spotlight"}],RL=((e={})=>{const t=e.sidecarUrl||"http://localhost:8969/stream";return{name:wL,setup:()=>{C&&_.log("Using Sidecar URL",t)},beforeSetup(n){const r=n.getOptions();r.ignoreSpans=[...r.ignoreSpans||[],...kL]},afterAllSetup:n=>{AL(n,t)}}});function AL(e,t){const n=fl("fetch");let r=0;e.on("beforeEnvelope",o=>{if(r>3){_.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r);return}n(t,{method:"POST",body:mi(o),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(s=>{s.status>=200&&s.status<400&&(r=0)},s=>{r++,_.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",s)})})}const Jy=RL,CL=()=>({name:"LaunchDarkly",processEvent(e,t,n){return no(e)}});function NL(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{Qn(e,t.value),Zn(e,t.value)}}}const xL=()=>({name:"OpenFeature",processEvent(e,t,n){return no(e)}});class ML{after(t,n){Qn(n.flagKey,n.value),Zn(n.flagKey,n.value)}error(t,n,r){Qn(t.flagKey,t.defaultValue),Zn(t.flagKey,t.defaultValue)}}const OL=({featureFlagClientClass:e})=>({name:"Unleash",setupOnce(){const t=e.prototype;De(t,"isEnabled",PL)},processEvent(t,n,r){return no(t)}});function PL(e){return function(...t){const n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"?(Qn(n,r),Zn(n,r)):C&&_.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${n} (${typeof n}), result: ${r} (${typeof r})`),r}}const LL=(({growthbookClass:e})=>H0({growthbookClass:e})),DL=({featureFlagClient:e})=>({name:"Statsig",setup(t){e.on("gate_evaluation",n=>{Qn(n.gate.name,n.gate.value),Zn(n.gate.name,n.gate.value)})},processEvent(t,n,r){return no(t)}});async function FL(){const e=N();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";const r=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 vu(()=>fetch(r,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}const $L="WebWorker",BL=({worker:e})=>({name:$L,setupOnce:()=>{(Array.isArray(e)?e:[e]).forEach(t=>Hp(t))},addWorker:t=>Hp(t)});function Hp(e){e.addEventListener("message",t=>{if(WL(t.data)){if(t.stopImmediatePropagation(),t.data._sentryDebugIds&&(C&&_.log("Sentry debugId web worker message received",t.data),A._sentryDebugIds={...t.data._sentryDebugIds,...A._sentryDebugIds}),t.data._sentryModuleMetadata&&(C&&_.log("Sentry module metadata web worker message received",t.data),A._sentryModuleMetadata={...t.data._sentryModuleMetadata,...A._sentryModuleMetadata}),t.data._sentryWasmImages){C&&_.log("Sentry WASM images web worker message received",t.data);const n=A._sentryWasmImages||[],r=t.data._sentryWasmImages.filter(o=>je(o)&&typeof o.code_file=="string"&&!n.some(s=>s.code_file===o.code_file));A._sentryWasmImages=[...n,...r]}t.data._sentryWorkerError&&(C&&_.log("Sentry worker rejection message received",t.data._sentryWorkerError),UL(t.data._sentryWorkerError))}})}function UL(e){const t=N();if(!t)return;const n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,o=e.reason,s=Ot(o)?N_(o):ma(n,o,void 0,r,!0);s.level="error",e.filename&&(s.contexts={...s.contexts,worker:{filename:e.filename}}),or(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),C&&_.log("Captured worker unhandled rejection",o)}function HL({self:e}){e.postMessage({_sentryMessage:!0,_sentryDebugIds:e._sentryDebugIds??void 0,_sentryModuleMetadata:e._sentryModuleMetadata??void 0}),e.addEventListener("unhandledrejection",t=>{var o;const r={reason:C_(t),filename:(o=e.location)==null?void 0:o.href};e.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),C&&_.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),C&&_.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function WL(e){if(!je(e)||e._sentryMessage!==!0)return!1;const t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e,o="_sentryWasmImages"in e;return!(!t&&!n&&!r&&!o||t&&!(je(e._sentryDebugIds)||e._sentryDebugIds===void 0)||n&&!(je(e._sentryModuleMetadata)||e._sentryModuleMetadata===void 0)||r&&!je(e._sentryWorkerError)||o&&(!Array.isArray(e._sentryWasmImages)||!e._sentryWasmImages.every(s=>je(s)&&typeof s.code_file=="string")))}function jL(e){return je(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function zL(e){const t={...e};Vm(t,"react"),Qi("react",{version:xe.version});const n=P_(t);return Th(qL),n}function qL(e){return jL(e)?"[SyntheticEvent]":vl(e)}function GL(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function VL(e,t){const n=new WeakSet;function r(o,s){if(!n.has(o)){if(o.cause)return n.add(o),r(o.cause,s);o.cause=s}}r(e,t)}function jl(e,{componentStack:t},n){if(GL(xe.version)&&Rt(e)&&t){const r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,VL(e,r)}return pe(e,n)}function YL(e){return(t,n)=>{const r=!!e,o=jl(t,n,{mechanism:{handled:r,type:"auto.function.react.error_handler"}});r&&e(t,n,o)}}const Xy="ui.react.render",KL="ui.react.update",Qy="ui.react.mount",JL={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},XL={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},QL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zy={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ZL=Symbol.for("react.forward_ref"),eb=Symbol.for("react.memo");function eD(e){return typeof e=="object"&&e!==null&&e.$$typeof===eb}const zl={};zl[ZL]=QL;zl[eb]=Zy;function Wp(e){if(eD(e))return Zy;const t=e.$$typeof;return t&&zl[t]||JL}const tD=Object.defineProperty.bind(Object),nD=Object.getOwnPropertyNames.bind(Object);var uh;const jp=(uh=Object.getOwnPropertySymbols)==null?void 0:uh.bind(Object),zp=Object.getOwnPropertyDescriptor.bind(Object),rD=Object.getPrototypeOf.bind(Object),qp=Object.prototype;function gs(e,t,n){if(typeof t!="string"){if(qp){const i=rD(t);i&&i!==qp&&gs(e,i)}let r=nD(t);jp&&(r=r.concat(jp(t)));const o=Wp(e),s=Wp(t);for(const i of r)if(!XL[i]&&!(s!=null&&s[i])&&!(o!=null&&o[i])&&!zp(e,i)){const a=zp(t,i);if(a)try{tD(e,i,a)}catch{}}}return e}const oD="unknown";class ql extends xe.Component{constructor(t){super(t);const{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=qe({name:`<${n}>`,onlyIfParent:!0,op:Qy,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:t,includeUpdates:n=!0}){if(n&&this._mountSpan&&t!==this.props.updateProps){const r=Object.keys(t).filter(o=>t[o]!==this.props.updateProps[o]);if(r.length>0){const o=ye();this._updateSpan=gn(this._mountSpan,()=>qe({name:`<${this.props.name}>`,onlyIfParent:!0,op:KL,startTime:o,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":this.props.name,"ui.react.changed_props":r}}))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){const t=ye(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){const o=U(this._mountSpan).timestamp;gn(this._mountSpan,()=>{const s=qe({onlyIfParent:!0,name:`<${n}>`,op:Xy,startTime:o,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":n}});s&&s.end(t)})}}render(){return this.props.children}}Object.assign(ql,{defaultProps:{disabled:!1,includeRender:!0,includeUpdates:!0}});function sD(e,t){const n=(t==null?void 0:t.name)||e.displayName||e.name||oD,r=o=>xe.createElement(ql,{...t,name:n,updateProps:o},xe.createElement(e,{...o}));return r.displayName=`profiler(${n})`,gs(r,e),r}function iD(e,t={disabled:!1,hasRenderSpan:!0}){const[n]=xe.useState(()=>{if(!(t!=null&&t.disabled))return qe({name:`<${e}>`,onlyIfParent:!0,op:Qy,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":e}})});xe.useEffect(()=>(n&&n.end(),()=>{if(n&&t.hasRenderSpan){const r=U(n).timestamp,o=ye(),s=qe({name:`<${e}>`,onlyIfParent:!0,op:Xy,startTime:r,attributes:{[Y]:"auto.ui.react.profiler","ui.component_name":e}});s&&s.end(o)}}),[])}const Oe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,aD="unknown",hc={componentStack:null,error:null,eventId:null};class tb extends xe.Component{constructor(t){super(t),this.state=hc,this._openFallbackReportDialog=!0;const n=N();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Kc({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){const{componentStack:r}=n,{beforeCapture:o,onError:s,showDialog:i,dialogOptions:a}=this.props;Ge(c=>{o&&o(c,t,r);const u=this.props.handled!=null?this.props.handled:!!this.props.fallback,d=jl(t,n,{mechanism:{handled:u,type:"auto.function.react.error_boundary"}});s&&s(t,r,d),i&&(this._lastEventId=d,this._openFallbackReportDialog&&Kc({...a,eventId:d})),this.setState({error:t,componentStack:r,eventId:d})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:o}=this.props;o&&(this.state===hc?o(null,null,null):o(t,n,r)),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}resetErrorBoundary(){const{onReset:t}=this.props,{error:n,componentStack:r,eventId:o}=this.state;t&&t(n,r,o),this.setState(hc)}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.componentStack===null)return typeof n=="function"?n():n;const o=typeof t=="function"?xe.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:()=>this.resetErrorBoundary(),eventId:r.eventId}):t;return xe.isValidElement(o)?o:(t&&Oe&&_.warn("fallback did not produce a valid ReactElement"),null)}}function cD(e,t){const n=e.displayName||e.name||aD,r=xe.memo(o=>xe.createElement(tb,{...t},xe.createElement(e,{...o})));return r.displayName=`errorBoundary(${n})`,gs(r,e),r}const uD="redux.action",lD="info",dD={attachReduxState:!0,actionTransformer:e=>e,stateTransformer:e=>e||null};function fD(e){const t={...dD,...e};return n=>(r,o)=>{t.attachReduxState&&Ct().addEventProcessor((a,c)=>{try{a.type===void 0&&a.contexts.state.state.type==="redux"&&(c.attachments=[...c.attachments||[],{filename:"redux_state.json",data:JSON.stringify(a.contexts.state.state.value)}])}catch{}return a});function s(a){return(c,u)=>{const d=a(c,u),l=j(),f=t.actionTransformer(u);typeof f<"u"&&f!==null&&ut({category:uD,data:f,type:lD});const p=t.stateTransformer(d);if(typeof p<"u"&&p!==null){const m=N(),g=m==null?void 0:m.getOptions(),y=(g==null?void 0:g.normalizeDepth)||3,S={state:{type:"redux",value:p}};Zb(S,3+y),l.setContext("state",S)}else l.setContext("state",null);const{configureScopeWithState:h}=t;return typeof h=="function"&&h(l,d),d}}const i=n(s(r),o);return i.replaceReducer=new Proxy(i.replaceReducer,{apply:function(a,c,u){a.apply(c,[s(u[0])])}}),i}}function pD(e){const t=ur({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:o,instrumentPageLoad:s=!0,instrumentNavigation:i=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a),s&&A.location&&Gp(r,A.location,o,(c,u="url")=>{lo(a,{name:c,attributes:{[ce]:"pageload",[Y]:"auto.pageload.react.reactrouter_v3",[ue]:u}})}),i&&n.listen&&n.listen(c=>{(c.action==="PUSH"||c.action==="POP")&&Gp(r,c,o,(u,d="url")=>{fo(a,{name:u,attributes:{[ce]:"navigation",[Y]:"auto.navigation.react.reactrouter_v3",[ue]:d}})})})}}}function Gp(e,t,n,r){let o=t.pathname;n({location:t,routes:e},(s,i,a)=>{if(s||!a)return r(o);const c=hD(a.routes||[]);return c.length===0||c==="/*"?r(o):(o=c,r(o,"route"))})}function hD(e){var r;if(!Array.isArray(e)||e.length===0)return"";const t=e.filter(o=>!!o.path);let n=-1;for(let o=t.length-1;o>=0;o--)if((r=t[o].path)!=null&&r.startsWith("/")){n=o;break}return t.slice(n).reduce((o,{path:s})=>{const i=o==="/"||o===""?s:`/${s}`;return`${o}${i}`},"")}function mD(e,t={}){const n=e,r=ur({...t,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:o=!0,instrumentNavigation:s=!0}=t;return{...r,afterAllSetup(i){r.afterAllSetup(i);const a=A.location;if(o&&a){const c=n.matchRoutes(a.pathname,n.options.parseSearch(a.search),{preload:!1,throwOnError:!1}),u=c[c.length-1],d=(u==null?void 0:u.routeId)!=="__root__"?u:void 0;lo(i,{name:d?d.routeId:a.pathname,attributes:{[ce]:"pageload",[Y]:"auto.pageload.react.tanstack_router",[ue]:d?"route":"url",...Vp(d)}})}s&&n.subscribe("onBeforeNavigate",c=>{if(!c.fromLocation||c.toLocation.state===c.fromLocation.state)return;const u=n.matchRoutes(c.toLocation.pathname,c.toLocation.search,{preload:!1,throwOnError:!1}),d=u[u.length-1],l=(d==null?void 0:d.routeId)!=="__root__"?d:void 0,f=A.location,p=fo(i,{name:l?l.routeId:f.pathname,attributes:{[ce]:"navigation",[Y]:"auto.navigation.react.tanstack_router",[ue]:l?"route":"url"}}),h=n.subscribe("onResolved",m=>{if(h(),p){const g=n.matchRoutes(m.toLocation.pathname,m.toLocation.search,{preload:!1,throwOnError:!1}),y=g[g.length-1],S=(y==null?void 0:y.routeId)!=="__root__"?y:void 0;S&&(p.updateName(S.routeId),p.setAttribute(ue,"route"),p.setAttributes(Vp(S)))}})})}}}function Vp(e){if(!e)return{};const t={};return Object.entries(e.params).forEach(([n,r])=>{t[`url.path.params.${n}`]=r,t[`url.path.parameter.${n}`]=r,t[`params.${n}`]=r}),t}function gD(e){const t=ur({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:s=!0,instrumentNavigation:i=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a),nb(a,s,i,n,"reactrouter_v4",r,o)}}}function _D(e){const t=ur({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:o,instrumentPageLoad:s=!0,instrumentNavigation:i=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a),nb(a,s,i,n,"reactrouter_v5",r,o)}}}function nb(e,t,n,r,o,s=[],i){function a(){if(r.location)return r.location.pathname;if(A.location)return A.location.pathname}function c(u){if(s.length===0||!i)return[u,"url"];const d=rb(s,u,i);for(const l of d)if(l.match.isExact)return[l.match.path,"route"];return[u,"url"]}if(t){const u=a();if(u){const[d,l]=c(u);lo(e,{name:d,attributes:{[ce]:"pageload",[Y]:`auto.pageload.react.${o}`,[ue]:l}})}}n&&r.listen&&r.listen((u,d)=>{if(d&&(d==="PUSH"||d==="POP")){const[l,f]=c(u.pathname);fo(e,{name:l,attributes:{[ce]:"navigation",[Y]:`auto.navigation.react.${o}`,[ue]:f}})}})}function rb(e,t,n,r=[]){return e.some(o=>{const s=o.path?n(t,o):r.length?r[r.length-1].match:yD(t);return s&&(r.push({route:o,match:s}),o.routes&&rb(o.routes,t,n,r)),!!s}),r}function yD(e){return{path:"/",url:"/",params:{},isExact:e==="/"}}function bD(e){const t=e.displayName||e.name,n=r=>{var o;if((o=r==null?void 0:r.computedMatch)!=null&&o.isExact){const s=r.computedMatch.path,i=SD();j().setTransactionName(s),i&&(i.updateName(s),i.setAttribute(ue,"route"))}return xe.createElement(e,{...r})};return n.displayName=`sentryRoute(${t})`,gs(n,e),n}function SD(){const e=Te(),t=e&&Ee(e);if(!t)return;const n=U(t).op;return n==="navigation"||n==="pageload"?t:void 0}function _s(e,t){if(!t||t==="/"||!e.toLowerCase().startsWith(t.toLowerCase()))return e;const n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?e:e.slice(n)||"/"}const Yp=new WeakMap;function vD(e,t,n){if(!e||!(t!=null&&t.length))return null;const r=n?_s(e,n):e;let o=Yp.get(t);o||(o=RD(t),Yp.set(t,o),Oe&&_.log("[React Router] Sorted route manifest by specificity:",o.length,"patterns"));for(const s of o)if(ED(r,s))return Oe&&_.log("[React Router] Matched pathname",r,"to pattern",s),s;return Oe&&_.log("[React Router] No manifest match found for pathname:",r),null}function ED(e,t){if(t==="/")return e==="/"||e==="";const n=Jp(e),r=Jp(t);if(r.length>0&&r[r.length-1]==="*"){const s=r.slice(0,-1);if(n.length<s.length)return!1;for(const[i,a]of s.entries())if(!Kp(n[i],a))return!1;return!0}if(n.length!==r.length)return!1;for(const[s,i]of r.entries())if(!Kp(n[s],i))return!1;return!0}function Kp(e,t){return e===void 0||t===void 0?!1:ob.test(t)?!0:e===t}function Jp(e){return e.split("/").filter(Boolean)}const ob=/^:[\w-]+$/,TD=10,ID=3,wD=1,kD=-2;function Xp(e){const t=e.split("/");let n=t.length;t.includes("*")&&(n+=kD);for(const r of t)r!=="*"&&(ob.test(r)?n+=ID:r===""?n+=wD:n+=TD);return n}function RD(e){return[...e].sort((t,n)=>{const r=Xp(t);return Xp(n)-r})}let Gl,Vn=!1;const pn=[],AD=10;function CD(e,t){const n={};return pn.length>=AD&&(Oe&&_.warn("[React Router] Navigation context stack overflow - removing oldest context"),pn.shift()),pn.push({token:n,targetPath:e,span:t}),n}function ND(e){const t=pn[pn.length-1];(t==null?void 0:t.token)===e&&pn.pop()}function sb(){const e=pn.length;return e>0?pn[e-1]??null:null}function xD(e,t=!1){Gl=e,Vn=t}function MD(e){return PD(e.route.path||"")}function OD(e){return e.params["*"]||""}function PD(e){return e[e.length-1]==="*"?e.slice(0,-1):e}function Or(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function ib(e){return e.endsWith("*")}function En(e){return e.includes("/*")||e.endsWith("*")}function Qp(e,t){var n;return ib(e)&&!!((n=t.route.children)!=null&&n.length)||!1}function LD(e){var t;return!!(!e.children&&e.element&&((t=e.path)!=null&&t.endsWith("/*")))}function DD(e,t,n){const r=e&&e.length>0?e:Vn?_s(t,n):t;let o=r.slice(-2)==="/*"?r.slice(0,-2):r;return o.length>1&&o[o.length-1]==="/"&&(o=o.slice(0,-1)),[o,"route"]}function Zp(e){return e.split(/\\?\//).filter(t=>t.length>0&&t!==",").length}function Bi(e){return e[0]==="/"?e:`/${e}`}function ab(e,t){const n=Gl(e,t);if(!n||n.length===0)return"";for(const r of n)if(r.route.path&&r.route.path!=="*"){const o=MD(r),s=_s(t.pathname,Bi(r.pathnameBase));return t.pathname===s?Or(s):Or(Or(o||"")+Bi(ab(e.filter(i=>i!==r.route),{pathname:s})))}return""}function FD(e,t){const n=Gl(t,e);if(n){for(const r of n)if(LD(r.route)&&OD(r))return!0}return!1}function eh(e,t){return Vn?_s(e.pathname,t):e.pathname||""}function $D(e,t,n,r=""){if(!e||e.length===0)return[Vn?_s(t.pathname,r):t.pathname,"url"];if(!n)return[eh(t,r),"url"];let o="";for(const s of n){const i=s.route;if(!i)continue;if(i.index)return DD(o,s.pathname,r);const a=i.path;if(!a||Qp(a,s))continue;const c=a[0]==="/"||o[o.length-1]==="/"?a:`/${a}`;if(o=Or(o)+Bi(c),Or(t.pathname)===Or(r+s.pathname))return Zp(o)!==Zp(s.pathname)&&!ib(o)?[(Vn?"":r)+c,"route"]:(Qp(o,s)&&(o=o.slice(0,-1)),[(Vn?"":r)+o,"route"])}return[eh(t,r),"url"]}function Oa(e,t,n,r,o="",s,i){if(i&&s&&s.length>0){const d=vD(e.pathname,s,o);if(d)return[(Vn?"":o)+d,"route"]}let a,c="url";const u=FD(e,n);return u&&(a=Bi(ab(n,e)),c="route"),(!u||!a)&&([a,c]=$D(t,e,r,o)),[a||e.pathname,c]}function Dt(){const e=Te(),t=e?Ee(e):void 0;if(!t)return;const n=U(t).op;return n==="navigation"||n==="pageload"?t:void 0}function BD(){const e=sb();if(e)return e.targetPath?{pathname:e.targetPath,search:"",hash:"",state:null,key:"default"}:null;if(typeof A<"u")try{const t=A.location;if(t)return{pathname:t.pathname,search:t.search||"",hash:t.hash||"",state:null,key:"default"}}catch{Oe&&_.warn("[React Router] Could not access window.location")}return null}function UD(){const e=sb();return e?e.span:Dt()}function HD(e,t,n,r){const o=new Proxy(e,{apply(s,i,a){const c=BD(),u=UD(),d=s.apply(i,a);return WD(d,t,n,r,c,u),d}});return we(o,"__sentry_proxied__",!0),o}function WD(e,t,n,r,o,s){wn(e)?e.then(i=>{Array.isArray(i)&&r(i,t,o??void 0,s)}).catch(i=>{Oe&&_.warn(`Error resolving async handler '${n}' for route`,t,i)}):Array.isArray(e)&&r(e,t,o??void 0,s)}function Pa(e,t){if(e.handle&&typeof e.handle=="object")for(const n of Object.keys(e.handle)){const r=e.handle[n];typeof r=="function"&&!r.__sentry_proxied__&&(e.handle[n]=HD(r,e,n,t))}if(Array.isArray(e.children))for(const n of e.children)Pa(n,t)}let Qr,hn,mn,si,lt,An=!1,Hn=3e3,ys,Vl="";const cb=new WeakSet,ub=A!=null&&A.document?xe.useLayoutEffect:xe.useEffect,Fn=new WeakMap,Fe=new Set,ii=new WeakMap,cu=new WeakMap;function jD(e){return A!=null&&A.requestAnimationFrame?A.requestAnimationFrame(e):setTimeout(e,0)}function th(e){A!=null&&A.cancelAnimationFrame?A.cancelAnimationFrame(e):clearTimeout(e)}function lb(e){return`${e.pathname}${e.search||""}${e.hash||""}`}function nh(e){return e.includes(":")||e.includes("*")}function zD(e,t,n,r){var s;if(!e)return{skip:!1,shouldUpdate:!1};if(e.locationKey===t&&(e.isPlaceholder||!r)){const i=!!e.routeName&&En(e.routeName),a=En(n),c=!!e.routeName&&nh(e.routeName),u=nh(n),d=i&&!a,l=!c&&u,f=n!==e.routeName&&n.length>(((s=e.routeName)==null?void 0:s.length)||0)&&!a;return{skip:!0,shouldUpdate:!!(e.routeName&&(d||l||f))}}return{skip:!1,shouldUpdate:!1}}function db(e,t){const n=t.children||[],r=e.filter(o=>!n.some(s=>s===o||o.path&&s.path===o.path||o.id&&s.id===o.id));r.length>0&&(t.children=[...n,...r])}function fb(e,t){let n=ii.get(e);n||(n=new Set,ii.set(e,n)),n.add(t),t.finally(()=>{const r=ii.get(e);r&&r.delete(t)})}function pb(e){const t=new Promise(n=>{cu.set(e,n)});fb(e,t)}function qD(e){const t=cu.get(e);t&&(t(),cu.delete(e),e.__sentry_may_have_lazy_routes__&&(e.__sentry_may_have_lazy_routes__=!1))}function Yl(e,t,n=null,r){e.forEach(s=>{Fe.add(s),An&&Pa(s,Yl)}),t&&db(e,t);const o=r??Dt();if(o){const s=U(o);if(s.timestamp){Oe&&_.warn("[React Router] Lazy handler resolved after span ended - skipping update");return}const i=s.op;let a=n;if(!a&&!r&&typeof A<"u"){const c=A.location;c!=null&&c.pathname&&(a={pathname:c.pathname})}a&&(i==="pageload"?Ss({activeRootSpan:o,location:{pathname:a.pathname},routes:Array.from(Fe),allRoutes:Array.from(Fe)}):i==="navigation"&&uu(o,a,Array.from(Fe),!1,lt))}}function uu(e,t,n,r=!1,o){var d;const s=U(e),i=s.description,a=e==null?void 0:e.__sentry_navigation_name_set__,c=i&&En(i);if((!a||r||c)&&!s.timestamp){const l=o(n,t),[f,p]=Oa(t,n,n,l||[],Vl,ys,An),h=(d=s.data)==null?void 0:d[ue];f&&(!i||!a&&(h!=="route"||p==="route")||h!=="route"&&p==="route"||h==="route"&&p==="route"&&c)&&(e.updateName(f),e.setAttribute(ue,p),!En(f)&&p==="route"&&we(e,"__sentry_navigation_name_set__",!0))}}function hb(e,t,n,r,o){let s=!1,i=!!o&&U(o).op==="pageload",a=!1,c=null,u=null;e.subscribe(d=>{if(!s){const f=Dt();f&&U(f).op==="pageload"?i=!0:i&&(d.historyAction==="POP"&&!a?a=!0:s=!0)}if(d.historyAction==="PUSH"||d.historyAction==="POP"&&s){const f=lb(d.location),p=()=>{u!==f&&(u=f,c=null,Zl({location:d.location,routes:t,navigationType:d.historyAction,version:n,basename:r,allRoutes:Array.from(Fe)}))};d.navigation.state!=="idle"?(u!==f&&(u=null),c!==null&&th(c),c=jD(p)):(c!==null&&(th(c),c=null),p())}})}function Kl(e,t){return!Qr||!hn||!mn||!lt?(Oe&&_.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(bs(n),An)for(const u of n)Pa(u,Yl);const o=Dt();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(we(o,"__sentry_may_have_lazy_routes__",!0),pb(o));const i=mb(r,!1,o),a=e(n,i),c=r==null?void 0:r.basename;return a.state.historyAction==="POP"&&o&&Ss({activeRootSpan:o,location:a.state.location,routes:n,basename:c,allRoutes:Array.from(Fe)}),Vl=c||"",hb(a,n,t,c,o),a}}function Jl(e,t){return!Qr||!hn||!mn||!lt?(Oe&&_.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(bs(n),An)for(const g of n)Pa(g,Yl);const o=Dt();r&&"patchRoutesOnNavigation"in r&&typeof r.patchRoutesOnNavigation=="function"&&o&&(we(o,"__sentry_may_have_lazy_routes__",!0),pb(o));const i=mb(r,!0,o),a=e(n,i),c=r==null?void 0:r.basename;let u;const d=r==null?void 0:r.initialEntries,l=r==null?void 0:r.initialIndex,f=(d==null?void 0:d.length)===1,p=l!==void 0&&(d==null?void 0:d[l]);u=f?d[0]:p?d[l]:void 0;const h=u?typeof u=="string"?{pathname:u}:u:a.state.location,m=Dt();return a.state.historyAction==="POP"&&m&&Ss({activeRootSpan:m,location:h,routes:n,basename:c,allRoutes:Array.from(Fe)}),Vl=c||"",hb(a,n,t,c,m),a}}function Xl(e,t){const n=ur({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:r,useLocation:o,useNavigationType:s,createRoutesFromChildren:i,matchRoutes:a,stripBasename:c,enableAsyncRouteHandlers:u=!1,instrumentPageLoad:d=!0,instrumentNavigation:l=!0,lazyRouteTimeout:f,lazyRouteManifest:p}=e;return{...n,setup(h){n.setup(h);const m=e.finalTimeout??3e4,g=(e.idleTimeout??1e3)*3,y=f??g;y===1/0?(Hn=m,Oe&&_.log("[React Router] lazyRouteTimeout set to Infinity, capping at finalTimeout:",m,"ms to prevent indefinite hangs")):Number.isNaN(y)?(Oe&&_.warn("[React Router] lazyRouteTimeout must be a number, falling back to default:",g),Hn=g):y<0?(Oe&&_.warn("[React Router] lazyRouteTimeout must be non-negative or Infinity, got:",y,"falling back to:",g),Hn=g):Hn=y,Qr=r,hn=o,mn=s,lt=a,si=i,An=u,ys=p,xD(a,c||!1)},afterAllSetup(h){var g;n.afterAllSetup(h);const m=(g=A.location)==null?void 0:g.pathname;d&&m&&lo(h,{name:m,attributes:{[ue]:"url",[ce]:"pageload",[Y]:`auto.pageload.react.reactrouter${t?`_v${t}`:""}`}}),l&&cb.add(h)}}}function Ql(e,t){if(!Qr||!hn||!mn||!lt)return Oe&&_.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),e;const n=r=>{const o=xe.useRef(!0),{routes:s,locationArg:i}=r,a=e(s,i),c=hn(),u=mn(),d=typeof i=="string"||i!=null&&i.pathname?i:c;return ub(()=>{const l=typeof d=="string"?{pathname:d}:d;o.current?(bs(s),Ss({activeRootSpan:Dt(),location:l,routes:s,allRoutes:Array.from(Fe)}),o.current=!1):Zl({location:l,routes:s,navigationType:u,version:t,allRoutes:Array.from(Fe)})},[u,d]),a};return(r,o)=>xe.createElement(n,{routes:r,locationArg:o})}function mb(e,t=!1,n){if(!e||!("patchRoutesOnNavigation"in e)||typeof e.patchRoutesOnNavigation!="function")return e||{};const r=e.patchRoutesOnNavigation;return{...e,patchRoutesOnNavigation:async o=>{const s=o==null?void 0:o.path,i=Dt()??n;if(!t){const c=o==null?void 0:o.patch,u=o==null?void 0:o.matches;c&&(o.patch=(d,l)=>{if(bs(l),u&&u.length>0){const p=u[u.length-1],h=p==null?void 0:p.route;if(h){const m=Array.from(Fe).find(g=>{const y=g.id!==void 0&&g.id===d,S=g===h,k=g.path!==void 0&&h.path!==void 0&&g.path===h.path;return y||S||k});m&&db(l,m)}}const f=i?U(i):void 0;return s&&i&&f&&!f.timestamp&&f.op==="navigation"&&uu(i,{pathname:s,search:"",hash:"",state:null,key:"default"},Array.from(Fe),!0,lt),c(d,l)})}const a=(async()=>{const c=CD(s,i);let u;try{u=await r(o)}finally{ND(c),i&&qD(i)}const d=i?U(i):void 0;if(i&&d&&!d.timestamp&&d.op==="navigation"){const l=s;l&&uu(i,{pathname:l,search:"",hash:"",state:null,key:"default"},Array.from(Fe),!1,lt)}return u})();return i&&fb(i,a),a}}}function Zl(e){const{location:t,routes:n,navigationType:r,version:o,matches:s,basename:i,allRoutes:a}=e,c=Array.isArray(s)?s:lt(a||n,t,i),u=N();if(!u||!cb.has(u))return;const d=Dt();if(!(d&&U(d).op==="pageload"&&r==="POP")&&(r==="PUSH"||r==="POP")&&c){const[l,f]=Oa(t,a||n,a||n,c,i,ys,An),p=lb(t),h=Fn.get(u),m=h&&!h.isPlaceholder?!!U(h.span).timestamp:!1,{skip:g,shouldUpdate:y}=zD(h,p,l,m);if(g){if(y&&h){const x=h.routeName;h.isPlaceholder?(h.routeName=l,Oe&&_.log(`[Tracing] Updated placeholder navigation name from "${x}" to "${l}" (will apply to real span)`)):(h.span.updateName(l),h.span.setAttribute(ue,f),we(h.span,"__sentry_navigation_name_set__",!0),h.routeName=l,Oe&&_.log(`[Tracing] Updated navigation span name from "${x}" to "${l}"`))}else Oe&&_.log(`[Tracing] Skipping duplicate navigation for location: ${p}`);return}const k={span:{end:()=>{}},routeName:l,pathname:t.pathname,locationKey:p,isPlaceholder:!0};Fn.set(u,k);let E;try{E=fo(u,{name:k.routeName,attributes:{[ue]:f,[ce]:"navigation",[Y]:`auto.navigation.react.reactrouter${o?`_v${o}`:""}`}})}catch(x){throw Fn.delete(u),x}E?(Fn.set(u,{span:E,routeName:k.routeName,pathname:t.pathname,locationKey:p}),lu(E,t,n,i,"navigation")):Fn.delete(u)}}function bs(e){e.forEach(t=>{gb(t).forEach(r=>{Fe.add(r)})})}function gb(e,t=new Set){return t.has(e)||(t.add(e),e.children&&!e.index&&e.children.forEach(n=>{gb(n,t).forEach(o=>{t.add(o)})})),t}function Ss({activeRootSpan:e,location:t,routes:n,matches:r,basename:o,allRoutes:s}){const i=Array.isArray(r)?r:lt(s||n,t,o);if(i){const[a,c]=Oa(t,s||n,s||n,i,o,ys,An);j().setTransactionName(a||"/"),e&&(e.updateName(a),e.setAttribute(ue,c),lu(e,t,n,o,"pageload"))}else e&&lu(e,t,n,o,"pageload")}function GD(e,t,n,r,o=!1){return n?!!(!e&&o||e&&En(e)&&r==="route"&&!En(n)||t!=="route"&&r==="route"):!1}function mc(e,t,n,r,o,s,i,a){var c;try{const u=(c=t.data)==null?void 0:c[ue];if(u==="route"&&n&&!En(n))return;const d=Array.from(a),l=d.length>0?d:o,f=lt(l,r,s);if(!f)return;const[p,h]=Oa(r,l,l,f,s,ys,An),m=GD(n,u,p,h,!0),g=i==="pageload"||!t.timestamp;m&&g&&(e.updateName(p),e.setAttribute(ue,h))}catch(u){Oe&&_.warn(`Error updating span details before ending: ${u}`)}}function lu(e,t,n,r,o){const s=`__sentry_${o}_end_patched__`;if((e==null?void 0:e[s])||!e.end)return;const a=e.end.bind(e);let c=!1;e.end=function(...d){var E;if(c)return;c=!0;const l=d.length>0?d[0]:Date.now()/1e3,f=U(e),p=f.description,h=(E=f.data)==null?void 0:E[ue],m=()=>{const x=N();if(x&&o==="navigation"){const w=Fn.get(x);w&&w.span===e&&Fn.delete(x)}},g=ii.get(e),y=e.__sentry_may_have_lazy_routes__;if((g&&g.size>0||y)&&p&&(En(p)||h!=="route")){if(Hn===0){mc(e,f,p,t,n,r,o,Fe),m(),a(l);return}const x=new Promise(b=>setTimeout(b,Hn));let w;if(g&&g.size>0){const b=Promise.allSettled(g).then(()=>{});w=Hn===1/0?b:Promise.race([b,x])}else w=x;w.then(()=>{const b=U(e);mc(e,b,b.description,t,n,r,o,Fe),m(),a(l)}).catch(()=>{m(),a(l)});return}mc(e,f,p,t,n,r,o,Fe),m(),a(l)},we(e,s,!0)}function ed(e,t){if(!Qr||!hn||!mn||!si||!lt)return Oe&&_.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
useEffect: ${Qr}. useLocation: ${hn}. useNavigationType: ${mn}.
createRoutesFromChildren: ${si}. matchRoutes: ${lt}.`),e;const n=r=>{const o=xe.useRef(!0),s=hn(),i=mn();return ub(()=>{const a=si(r.children);o.current?(bs(a),Ss({activeRootSpan:Dt(),location:s,routes:a,allRoutes:Array.from(Fe)}),o.current=!1):Zl({location:s,routes:a,navigationType:i,version:t,allRoutes:Array.from(Fe)})},[s,i]),xe.createElement(e,{...r})};return gs(n,e),n}function VD(e){return Xl(e,"6")}function YD(e){return Ql(e,"6")}function KD(e){return Kl(e,"6")}function JD(e){return Jl(e,"6")}function XD(e){return ed(e,"6")}function QD(e){return Xl(e,"7")}function ZD(e){return ed(e,"7")}function eF(e){return Kl(e,"7")}function tF(e){return Jl(e,"7")}function nF(e){return Ql(e,"7")}function rF(e){return Xl(e,"")}function oF(e){return ed(e,"")}function sF(e){return Kl(e,"")}function iF(e){return Jl(e,"")}function aF(e){return Ql(e,"")}const t$=Object.freeze(Object.defineProperty({__proto__:null,BrowserClient:i_,ErrorBoundary:tb,MULTIPLEXED_TRANSPORT_EXTRA_KEY:qs,OpenFeatureIntegrationHook:ML,Profiler:ql,SDK_VERSION:mt,SEMANTIC_ATTRIBUTE_SENTRY_OP:ce,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:Y,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:qi,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:ue,Scope:bt,WINDOW:A,addBreadcrumb:ut,addEventProcessor:xu,addIntegration:Rc,bindScopeToEmitter:Fv,breadcrumbsIntegration:gl,browserApiErrorsIntegration:_l,browserProfilingIntegration:IL,browserSessionIntegration:yl,browserTracingIntegration:ur,buildLaunchDarklyFlagUsedHandler:NL,captureConsoleIntegration:qT,captureEvent:or,captureException:pe,captureFeedback:ag,captureMessage:Nu,captureReactException:jl,captureSession:js,chromeStackLineParser:T_,close:pE,consoleLoggingIntegration:aI,contextLinesIntegration:aN,continueTrace:kv,createConsolaReporter:dI,createLangChainCallbackHandler:Zu,createReduxEnhancer:fD,createTransport:Dm,createUserFeedbackEnvelope:s1,cultureContextIntegration:A_,dedupeIntegration:ju,defaultRequestInstrumentationOptions:Bl,defaultStackLineParsers:w_,defaultStackParser:k_,diagnoseSdkConnectivity:FL,elementTimingIntegration:uC,endSession:Mu,eventFiltersIntegration:Hu,eventFromException:o_,eventFromMessage:s_,exceptionFromError:pa,extraErrorDataIntegration:e0,featureFlagsIntegration:U0,feedbackAsyncIntegration:zR,feedbackIntegration:Ff,feedbackSyncIntegration:Ff,fetchStreamPerformanceIntegration:Py,flush:Em,forceLoad:U1,functionToStringIntegration:Uu,geckoStackLineParser:I_,getActiveSpan:Te,getClient:N,getCurrentScope:j,getDefaultIntegrations:O_,getFeedback:Qk,getGlobalScope:Ct,getIsolationScope:he,getReplay:nP,getRootSpan:Ee,getSpanDescendants:To,getSpanStatusFromHttpCode:Lh,getTraceData:Bu,globalHandlersIntegration:bl,graphqlClientIntegration:mN,growthbookIntegration:LL,httpClientIntegration:Y1,httpContextIntegration:Sl,inboundFiltersIntegration:Ym,init:zL,instrumentAnthropicAiClient:Aw,instrumentCreateReactAgent:ak,instrumentGoogleGenAIClient:Uw,instrumentLangChainEmbeddings:Ik,instrumentLangGraph:ck,instrumentOpenAiClient:uw,instrumentOutgoingRequests:Oy,instrumentSupabaseClient:ig,isBotUserAgent:$y,isEnabled:Tm,isInitialized:hE,lastEventId:vm,launchDarklyIntegration:CL,lazyLoadIntegration:n_,linkedErrorsIntegration:M_,logger:cg,makeBrowserOfflineTransport:QP,makeFetchTransport:ml,makeMultiplexedTransport:cT,metrics:dg,moduleMetadataIntegration:HT,normalizeStringifyValue:vl,onLoad:H1,openFeatureIntegration:xL,opera10StackLineParser:t1,opera11StackLineParser:o1,parameterize:Gm,reactErrorHandler:YL,reactRouterBrowserTracingIntegration:rF,reactRouterV3BrowserTracingIntegration:pD,reactRouterV4BrowserTracingIntegration:gD,reactRouterV5BrowserTracingIntegration:_D,reactRouterV6BrowserTracingIntegration:VD,reactRouterV7BrowserTracingIntegration:QD,registerSpanErrorInstrumentation:bu,registerWebWorker:HL,replayCanvasIntegration:vP,replayIntegration:ZO,reportPageLoaded:jP,reportingObserverIntegration:q1,rewriteFramesIntegration:rg,sendFeedback:Wg,setActiveSpanInBrowser:zP,setContext:Qi,setConversationId:fE,setCurrentClient:Fu,setExtra:_m,setExtras:gm,setHttpStatus:Mo,setMeasurement:Ki,setTag:bm,setTags:ym,setUser:Sm,showReportDialog:Kc,spanStreamingIntegration:qP,spanToBaggageHeader:cv,spanToJSON:U,spanToTraceHeader:Kh,spotlightBrowserIntegration:Jy,startBrowserTracingNavigationSpan:fo,startBrowserTracingPageLoadSpan:lo,startInactiveSpan:qe,startNewTrace:um,startSession:kc,startSpan:Et,startSpanManual:wt,statsigIntegration:DL,supabaseIntegration:v0,suppressTracing:vu,tanstackRouterBrowserTracingIntegration:mD,thirdPartyErrorFilterIntegration:x0,uiProfiler:DC,unleashIntegration:OL,updateSpanName:ov,useProfiler:iD,viewHierarchyIntegration:gN,webVitalsIntegration:Dy,webWorkerIntegration:BL,winjsStackLineParser:QC,withActiveSpan:gn,withErrorBoundary:cD,withIsolationScope:kS,withProfiler:sD,withScope:Ge,withSentryReactRouterV6Routing:XD,withSentryReactRouterV7Routing:ZD,withSentryRouting:bD,withStreamedSpan:uv,wrapCreateBrowserRouter:sF,wrapCreateBrowserRouterV6:KD,wrapCreateBrowserRouterV7:eF,wrapCreateMemoryRouter:iF,wrapCreateMemoryRouterV6:JD,wrapCreateMemoryRouterV7:tF,wrapReactRouterRouting:oF,wrapUseRoutes:aF,wrapUseRoutesV6:YD,wrapUseRoutesV7:nF,zodErrorsIntegration:N0},Symbol.toStringTag,{value:"Module"})),cF="info";function uF(e){const t={};if(typeof e.type=="string"&&(t.type=e.type),typeof e.level=="string"&&(t.level=Do(e.level)),typeof e.event_id=="string"&&(t.event_id=e.event_id),typeof e.category=="string"&&(t.category=e.category),typeof e.message=="string"&&(t.message=e.message),typeof e.data=="object"&&e.data!==null&&(t.data=e.data),typeof e.timestamp=="string"){const n=Date.parse(e.timestamp)/1e3;isNaN(n)||(t.timestamp=n)}return t}const td=H;function lF(){return td.WEBVIEW_SERVER_URL}function dF(){return td.CAP_SPOTLIGHT_URL}function fF(e){var t,n;return{attachStacktrace:e.attachStacktrace,attachThreads:e.attachThreads,debug:e.debug,dist:e.dist,dsn:e.dsn,enabled:e.enabled,enableNdkScopeSync:e.enableNdkScopeSync,enableWatchdogTerminationTracking:e.enableWatchdogTerminationTracking,environment:e.environment,maxBreadcrumbs:e.maxBreadcrumbs,release:e.release,sampleRate:e.sampleRate,sendClientReports:e.sendClientReports,sendDefaultPii:(n=(t=e.dataCollection)===null||t===void 0?void 0:t.userInfo)!==null&&n!==void 0?n:e.sendDefaultPii,sessionTrackingIntervalMillis:e.sessionTrackingIntervalMillis,tracesSampleRate:e.tracesSampleRate,enableCaptureFailedRequests:e.enableCaptureFailedRequests,...e.strictTraceContinuation!==void 0&&{strictTraceContinuation:e.strictTraceContinuation},...e.orgId!==void 0&&{orgId:e.orgId},...pF(e),...hF(e),...mF()}}function pF(e){return Jt.getPlatform()==="ios"?{enableAppHangTracking:e.enableAppHangTracking,appHangTimeoutInterval:e.appHangTimeoutInterval}:{}}function hF(e){if(e.enableLogs&&Jt.getPlatform()==="android")return{enableLogs:!0}}function mF(){const e=dF();if(e)return{sidecarUrl:e}}const Le=fu("SentryCapacitor"),gF="value";function _b(e){var t;const n=(t=N())===null||t===void 0?void 0:t.getOptions(),r=Ae(e,n==null?void 0:n.normalizeDepth,n==null?void 0:n.normalizeMaxBreadth);return r===null||typeof r!="object"?{[gF]:r}:r}function vo(e,t){t=t||1/0;let n;const r=e.length;let o=null;const s=[];for(let i=0;i<r;++i){if(n=e.charCodeAt(i),n>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(i+1===r){(t-=3)>-1&&s.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return s}const It=[],rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let e=0,t=rh.length;e<t;++e)It[e]=rh[e];function _F(e){return It[e>>18&63]+It[e>>12&63]+It[e>>6&63]+It[e&63]}function yF(e,t,n){let r;const o=[];for(let s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),o.push(_F(r));return o.join("")}function bF(e){let t;const n=e.length,r=n%3,o=[],s=16383;for(let i=0,a=n-r;i<a;i+=s)o.push(yF(e,i,i+s>a?a:i+s));return r===1?(t=e[n-1],o.push(`${It[t>>2]+It[t<<4&63]}==`)):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(`${It[t>>10]+It[t>>4&63]+It[t<<2&63]}=`)),o.join("")}const Ie={async sendEnvelope(e){if(!this.enableNative)throw this._DisabledNativeError;if(!this.isNativeClientAvailable())throw this._NativeClientError;const t=10,[n,r]=e,o=JSON.stringify(n);let s=vo(o);s.push(t);for(const a of r){const[c,u]=this._processItem(a);let d,l=[];typeof u=="string"?(d="text/plain",l=vo(u)):u instanceof Uint8Array?(d=typeof c.content_type=="string"?c.content_type:"application/octet-stream",l=[...u]):(d=typeof c.content_type=="string"?c.content_type:"application/json",l=vo(JSON.stringify(u))),c.content_type=d,c.length=l.length;const f=JSON.stringify(c);s.push(...vo(f)),s.push(t),s=s.concat(l),s.push(t)}let i=200;return await Le.captureEnvelope({envelope:bF(s)}).then(a=>a,a=>{_.error("Failed to capture Envelope: ",a),i=500}),{statusCode:i}},async initNativeSdk(e){if(!e.dsn)return _.warn("Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized."),this.enableNative=!1,!1;if(!e.enableNative)return e.enableNativeNagger&&_.warn("Note: Native Sentry SDK is disabled."),this.enableNative=!1,!1;if(!this.isNativeClientAvailable())throw this._NativeClientError;const t=fF(e);return Le.initNativeSdk({options:t})},async fetchNativeDeviceContexts(){if(!this.enableNative)throw this._DisabledNativeError;if(!this.isNativeClientAvailable())throw this._NativeClientError;return Le.fetchNativeDeviceContexts()},async fetchNativeLogAttributes(){if(!this.enableNative)throw this._DisabledNativeError;if(!this.isNativeClientAvailable())throw this._NativeClientError;return Le.fetchNativeLogAttributes()},async fetchNativeRelease(){if(!this.enableNative)throw this._DisabledNativeError;return Le.fetchNativeRelease()},async fetchNativeSdkInfo(){if(!this.enableNative)throw this._DisabledNativeError;return Le.fetchNativeSdkInfo()},crash(){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;Le.crash()}},setUser(e){if(!this.enableNative)return;if(!this.isNativeClientAvailable())throw this._NativeClientError;let t=null,n=null;if(e){const{id:r,ip_address:o,email:s,username:i,...a}=e;t=this._serializeObject({email:s,id:r,ip_address:o,username:i},!0),n=this._serializeObject(a,!0)}Le.setUser({defaultUserKeys:t,otherUserKeys:n})},setTag(e,t){if(!this.enableNative)return;if(!this.isNativeClientAvailable())throw this._NativeClientError;const n=typeof t=="string"?t:JSON.stringify(t);Le.setTag({key:e,value:n})},setExtra(e,t){if(!this.enableNative)return;if(!this.isNativeClientAvailable())throw this._NativeClientError;const n=typeof t=="string"?t:JSON.stringify(t);Le.setExtra({key:e,value:n})},addBreadcrumb(e){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;Le.addBreadcrumb({...e,level:e.level?this._processLevel(e.level):void 0,data:e.data?_b(e.data):void 0})}},clearBreadcrumbs(){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;Le.clearBreadcrumbs()}},closeNativeSdk(){if(!this.enableNative)return _.log(this._DisabledNativeError),Promise.resolve();if(!this.isNativeClientAvailable())throw this._NativeClientError;return Le.closeNativeSdk().then(()=>{this.enableNative=!1})},setContext(e,t){if(this.enableNative){if(!this.isNativeClientAvailable())throw this._NativeClientError;this.platform==="android"?this.setExtra(e,t):Le.setContext({key:e,value:t!==null?this._serializeObject(t):null})}},pauseAppHangTracking(){if(this.enableNative)if(this.isNativeClientAvailable())this.platform==="ios"?Le.pauseAppHangTracking():_.warn(`PauseAppHangTracking ${this._IosOnlyMessage}`);else throw this._NativeClientError},resumeAppHangTracking(){if(this.enableNative)if(this.isNativeClientAvailable())this.platform==="ios"?Le.resumeAppHangTracking():_.warn(`ResumeAppHangTracking ${this._IosOnlyMessage}`);else throw this._NativeClientError},_processItem(e){if(Ie.platform==="android"){const[t,n]=e;if(t.type=="event"||t.type=="transaction"){const r=this._processLevels(n);return"message"in r&&(r.message={message:r.message}),[t,r]}}return e},_serializeObject(e,t){const n={};return Object.keys(e).forEach(r=>{const o=e[r];(t!==!0||o!==void 0)&&(n[r]=typeof o=="string"?o:JSON.stringify(o))}),n},_processLevels(e){var t;return{...e,level:e.level?this._processLevel(e.level):void 0,breadcrumbs:(t=e.breadcrumbs)===null||t===void 0?void 0:t.map(r=>({...r,level:r.level?this._processLevel(r.level):void 0}))}},_processLevel(e){return e=="log"?"debug":e=="critical"?"fatal":e},isModuleLoaded(){return!!Le},isNativeClientAvailable(){return this.isModuleLoaded()&&Jt.isPluginAvailable("SentryCapacitor")},_DisabledNativeError:new Error("Native is disabled"),_NativeClientError:new Error("Native Client is not available, can't start on native."),_IosOnlyMessage:"is only supported on iOS.",enableNative:!0,platform:Jt.getPlatform()};function SF(){Ie.pauseAppHangTracking()}function vF(){Ie.resumeAppHangTracking()}const EF="DeviceContext",yb=()=>({name:EF,processEvent:TF});async function TF(e,t,n){var r;try{const o=await Ie.fetchNativeDeviceContexts(),s=o.contexts;if(e.contexts={...s,...e.contexts},"user"in o){const a=o.user;e.user||(e.user={...a})}const i=Array.isArray(o.breadcrumbs)?o.breadcrumbs.map(uF):void 0;if(i){const a=(r=n==null?void 0:n.getOptions().maxBreadcrumbs)!==null&&r!==void 0?r:100;e.breadcrumbs=i.concat(e.breadcrumbs||[]).sort((c,u)=>{var d,l;return((d=c.timestamp)!==null&&d!==void 0?d:0)-((l=u.timestamp)!==null&&l!==void 0?l:0)}).slice(-a)}}catch(o){_.log(`Failed to get device context from native: ${o}`)}return e}const IF="EventOrigin",bb=()=>({name:IF,preprocessEvent:wF});async function wF(e){var t;return e.tags=(t=e.tags)!==null&&t!==void 0?t:{},e.tags["event.origin"]="javascript",e.tags["event.environment"]="javascript",e}const kF="LogEnricher",Sb=()=>({name:kF,setup(e){RF().then(()=>{e.on("beforeCaptureLog",t=>{AF(t)})},t=>{_.log(t)})}});let on;function _r(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}async function RF(){var e,t,n,r,o;try{const s=await Ie.fetchNativeLogAttributes();on={...((e=s==null?void 0:s.contexts)===null||e===void 0?void 0:e.device)&&{brand:(t=s.contexts.device)===null||t===void 0?void 0:t.brand,model:(n=s.contexts.device)===null||n===void 0?void 0:n.model,family:(r=s.contexts.device)===null||r===void 0?void 0:r.family},...((o=s==null?void 0:s.contexts)===null||o===void 0?void 0:o.os)&&{os:s.contexts.os.name,version:s.contexts.os.version},...(s==null?void 0:s.release)&&{release:s.release}}}catch(s){return Promise.reject(`[LOGS]: Failed to prepare attributes from Native Layer: ${s}`)}return Promise.resolve()}function AF(e){var t;if(on===void 0)return;const n=(t=e.attributes)!==null&&t!==void 0?t:{};_r(n,"device.brand",on.brand),_r(n,"device.model",on.model),_r(n,"device.family",on.family),_r(n,"os.name",on.os),_r(n,"os.version",on.version),_r(n,"sentry.release",on.release),e.attributes=n}const CF="Release",vb=()=>({name:CF,processEvent:NF});async function NF(e,t,n){const r=n.getOptions();if(typeof(r==null?void 0:r.release)=="string"&&(e.release=r.release),typeof(r==null?void 0:r.dist)=="string"&&(e.dist=r.dist),e.release&&e.dist)return e;try{const o=await Ie.fetchNativeRelease();o&&(e.release||(e.release=`${o.id}@${o.version}+${o.build}`),e.dist||(e.dist=`${o.build}`))}catch{}return e}const Eb=()=>rg({iteratee:xF});function xF(e){if(e.filename){const t=/^https?:\/\//.test(e.filename),n=lF();if(n?e.filename=e.filename.replace(n,""):e.filename=e.filename.replace(/^https?:\/\/localhost(:\d+)?/,"").replace(/^capacitor:\/\/localhost(:\d+)?/,""),e.filename=e.filename.replace(/^ng:\/\//,""),e.filename==="[native code]"||e.filename==="native")e.in_app=!1;else{if(!t){const o=e.filename.startsWith("/")?e.filename:`/${e.filename}`,s="app://";e.filename=`${s}${o}`}e.in_app=!0}}return e}const Tb="sentry.javascript.capacitor",Ui="4.2.0",MF="SdkInfo";let Hs=null,du;const Ib=()=>({name:MF,processEvent:OF,setup(e){var t,n;const r=e.getOptions();du=(n=(t=r.dataCollection)===null||t===void 0?void 0:t.userInfo)!==null&&n!==void 0?n:r.sendDefaultPii,du&&e.on("beforeSendEvent",(o=>{var s;((s=o.user)===null||s===void 0?void 0:s.ip_address)==="{{auto}}"&&delete o.user.ip_address}))}});async function OF(e){if(Ie.platform==="ios"&&Hs===null)try{Hs=await Ie.fetchNativeSdkInfo()}catch{_.warn("[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation.")}e.platform=e.platform||"javascript";const t=e.sdk||{};return t.packages=[...t.packages||[],...Hs&&[Hs]||[],{name:"npm:@sentry/capacitor",version:Ui}],t.settings={infer_ip:du?"auto":"never",...t.settings},e.sdk=t,e}function PF(e){return e!=null&&e.sidecarUrl&&(td.CAP_SPOTLIGHT_URL=e.sidecarUrl),Ie.platform==="web"?Jy(e):{name:"Spotlight"}}const LF="SentryNativeLog";let Wn;async function DF(e,t,n){const r=await Le.addListener(LF,e);n()?await r.remove():(t(r),_.log("Native log listener set up successfully."))}function FF(e){if(Wn)return;const t=Jt.getPlatform();if(t!=="ios"&&t!=="android"){_.log("Native log listener is only supported on iOS and Android.");return}let n,r=!1;Wn=()=>{r=!0,Wn=void 0,n==null||n.remove()},DF(e,o=>{n=o},()=>r).catch(o=>{_.warn("Failed to set up native log listener:",o),Wn=void 0})}function $F(){Wn==null||Wn()}function BF(e){const t=`[Native] [${e.component}] ${e.message}`;switch(e.level.toLowerCase()){case"fatal":case"error":_.error(t);break;case"warning":_.warn(t);break;case"info":case"debug":default:_.log(t);break}}function tn(e,t,n){De(e,t,n)}function nn(e,t){const n=zi(e[t]);n&&(e[t]=n)}const Hi=new WeakMap;function oh(e){Hi.has(e)||(Hi.set(e,!0),tn(e,"setUser",t=>n=>(Ie.setUser(n),t.call(e,n))),tn(e,"setTag",t=>(n,r)=>(Ie.setTag(n,r),t.call(e,n,r))),tn(e,"setTags",t=>n=>(Object.keys(n).forEach(r=>{Ie.setTag(r,n[r])}),t.call(e,n))),tn(e,"setExtras",t=>n=>(Object.keys(n).forEach(r=>{Ie.setExtra(r,n[r])}),t.call(e,n))),tn(e,"setExtra",t=>(n,r)=>(Ie.setExtra(n,r),t.call(e,n,r))),tn(e,"addBreadcrumb",t=>(n,r)=>{const o={...n,level:n.level||cF,data:n.data?_b(n.data):void 0};t.call(e,o,r);const s=e.getLastBreadcrumb();return s&&Ie.addBreadcrumb(s),e}),tn(e,"clearBreadcrumbs",t=>()=>(Ie.clearBreadcrumbs(),t.call(e))),tn(e,"setContext",t=>(n,r)=>(Ie.setContext(n,r),t.call(e,n,r))))}function sh(e){Hi.has(e)&&(Hi.delete(e),nn(e,"clearBreadcrumbs"),nn(e,"setContext"),nn(e,"setExtra"),nn(e,"setExtras"),nn(e,"setTags"),nn(e,"setTag"),nn(e,"setUser"),nn(e,"addBreadcrumb"))}function UF(e,t){e.enableNative&&(e.transport=t,sh(Ct()),sh(he()))}function HF(){var e,t;const n=N();if(n){const r=n.getOptions();if(!(!((e=r._metadata)===null||e===void 0)&&e.sdk))return;const o=r._metadata.sdk;o.name=`${o.name}.capacitor`,o.version=Ui,(t=o.packages)===null||t===void 0||t.push({name:Tb,version:Ui}),r._metadata.sdk=o}}function WF(e,t,n,r){Ie.initNativeSdk(t).then(()=>{var o;if(t.debug){const s=(o=t.onNativeLog)!==null&&o!==void 0?o:BF;FF(s)}n(e)}).catch(o=>{console.error(`Native Sentry SDK failed to initialize. Using Sentry JavaScript SDK without native integraiton.
`,{error:o}),UF(e,r),n(e)}).finally(()=>{HF()})}function jF(e){const t=[];return t.push(Eb()),t.push(vb()),t.push(bb()),t.push(Ib()),e.enableNative?(t.push(yb()),t.push(Sb())):t.push(Sl()),t.push(Hu(),Uu(),_l(),gl(),bl(),$T(),ju()),e.enableAutoSessionTracking&&!e.enableNative&&t.push(yl()),t}const zF=()=>{const e=Ft(),t=e.__SENTRY__=e.__SENTRY__||{};(t[mt]=t[mt]||{}).encodePolyfill=qF},qF=e=>new Uint8Array(vo(e)),wb=30;class GF{constructor(t={}){this._buffer=ea(t.bufferSize||wb)}send(t){return this._buffer.add(()=>Ie.sendEnvelope(t))}flush(t){return this._buffer.drain(t)}}function VF(e={}){return new GF(e)}function YF(e,t={}){return typeof e=="function"?(...n)=>{try{return e(...n)}catch(r){return _.error(t.loggerMessage?t.loggerMessage:`The ${e.name} callback threw an error`,r),n[0]}}:e}const KF=()=>typeof TextEncoder<"u";function JF(e,t=P_){var n,r,o,s,i,a,c;const u={enableAutoSessionTracking:!0,enableWatchdogTerminationTracking:!0,enableCaptureFailedRequests:!1,...e};u.siblingOptions&&delete u.siblingOptions,u.enabled===!1||Ie.platform==="web"?(u.enableNative=!1,u.enableNativeNagger=!1):((n=u.enableNativeNagger)!==null&&n!==void 0||(u.enableNativeNagger=!0),(r=u.enableNative)!==null&&r!==void 0||(u.enableNative=!0)),u.enableNative&&!e.transport&&Ie.platform!=="web"&&(u.transport=e.transport||VF,u.transportOptions={...(o=e.transportOptions)!==null&&o!==void 0?o:{},bufferSize:wb}),KF()||zF(),u.enableNative&&(oh(Ct()),oh(he()));const d={...(s=e.siblingOptions)===null||s===void 0?void 0:s.vueOptions,...(i=e.siblingOptions)===null||i===void 0?void 0:i.nuxtClientOptions,...u,integrations:YF(e.integrations,{loggerMessage:"The integrations threw an error"}),enableMetrics:(a=u._experiments)===null||a===void 0?void 0:a.enableMetrics,beforeSendMetric:(c=u._experiments)===null||c===void 0?void 0:c.beforeSendMetric};d.defaultIntegrations=e.defaultIntegrations===void 0?jF(u):e.defaultIntegrations;const l={...u,enableAutoSessionTracking:Ie.platform!=="web"&&u.enableAutoSessionTracking};WF(d,l,t,e.transport)}async function XF(){$F();try{const e=N();e&&(await e.close(),await Ie.closeNativeSdk())}catch{_.error("Failed to close the SDK")}}function QF(){Ie.crash()}const n$=Object.freeze(Object.defineProperty({__proto__:null,SDK_NAME:Tb,SDK_VERSION:Ui,addBreadcrumb:ut,addChildSpanToSpan:di,addEventProcessor:xu,browserTracingIntegration:ur,capacitorRewriteFramesIntegration:Eb,captureEvent:or,captureException:pe,captureMessage:Nu,close:XF,consoleSandbox:$t,deviceContextIntegration:yb,eventOriginIntegration:bb,flush:Em,getActiveSpan:Te,getClient:N,getCurrentScope:j,getGlobalScope:Ct,getIsolationScope:he,getRootSpan:Ee,init:JF,logEnricherIntegration:Sb,logger:cg,metrics:dg,nativeCrash:QF,nativeReleaseIntegration:vb,pauseAppHangTracking:SF,registerSpanErrorInstrumentation:bu,resumeAppHangTracking:vF,sdkInfoIntegration:Ib,setContext:Qi,setCurrentClient:Fu,setExtra:_m,setExtras:gm,setMeasurement:Ki,setTag:bm,setTags:ym,setUser:Sm,spanIsSampled:Ht,spanToJSON:U,spotlightIntegration:PF,startIdleSpan:Ru,startInactiveSpan:qe,startSpan:Et,startSpanManual:wt,suppressTracing:vu,withActiveSpan:gn,withScope:Ge},Symbol.toStringTag,{value:"Module"}));export{Jt as C,dh as W,Sm as a,ur as b,pe as c,La as d,t$ as e,n$ as f,zL as i,fu as r,bm as s};